#define ZEND_FUNC_HAS_EXTENDED_STMT (1<<11)
#define ZEND_SSA_TSSA (1<<12) /* used by tracing JIT */
+#define ZEND_FUNC_JIT_ON_FIRST_EXEC (1<<13) /* used by JIT */
+#define ZEND_FUNC_JIT_ON_PROF_REQUEST (1<<14) /* used by JIT */
+#define ZEND_FUNC_JIT_ON_HOT_COUNTERS (1<<15) /* used by JIT */
+#define ZEND_FUNC_JIT_ON_HOT_TRACE (1<<16) /* used by JIT */
+
+
typedef struct _zend_func_info zend_func_info;
typedef struct _zend_call_info zend_call_info;
if (JIT_G(trigger) == ZEND_JIT_ON_FIRST_EXEC ||
JIT_G(trigger) == ZEND_JIT_ON_PROF_REQUEST ||
JIT_G(trigger) == ZEND_JIT_ON_HOT_COUNTERS) {
- memset(func_info, 0, sizeof(zend_func_info));
+ func_info->num = 0;
+ func_info->flags &= ZEND_FUNC_JIT_ON_FIRST_EXEC
+ | ZEND_FUNC_JIT_ON_PROF_REQUEST
+ | ZEND_FUNC_JIT_ON_HOT_COUNTERS
+ | ZEND_FUNC_JIT_ON_HOT_TRACE;
+ memset(&func_info->ssa, 0, sizeof(zend_func_info) - offsetof(zend_func_info, ssa));
} else {
ZEND_SET_FUNC_INFO(op_array, NULL);
}
jit_extension = (zend_jit_op_array_hot_extension*)zend_shared_alloc(sizeof(zend_jit_op_array_hot_extension) + (op_array->last - 1) * sizeof(void*));
memset(&jit_extension->func_info, 0, sizeof(zend_func_info));
+ jit_extension->func_info.flags = ZEND_FUNC_JIT_ON_HOT_COUNTERS;
jit_extension->counter = &zend_jit_hot_counters[zend_jit_op_array_hash(op_array) & (ZEND_HOT_COUNTERS_COUNT - 1)];
for (i = 0; i < op_array->last; i++) {
jit_extension->orig_handlers[i] = op_array->opcodes[i].handler;
}
jit_extension = (zend_jit_op_array_extension*)zend_shared_alloc(sizeof(zend_jit_op_array_extension));
memset(&jit_extension->func_info, 0, sizeof(zend_func_info));
+ jit_extension->func_info.flags = ZEND_FUNC_JIT_ON_FIRST_EXEC;
jit_extension->orig_handler = (void*)opline->handler;
ZEND_SET_FUNC_INFO(op_array, (void*)jit_extension);
opline->handler = (const void*)zend_jit_runtime_jit_handler;
}
jit_extension = (zend_jit_op_array_extension*)zend_shared_alloc(sizeof(zend_jit_op_array_extension));
memset(&jit_extension->func_info, 0, sizeof(zend_func_info));
+ jit_extension->func_info.flags = ZEND_FUNC_JIT_ON_PROF_REQUEST;
jit_extension->orig_handler = (void*)opline->handler;
ZEND_SET_FUNC_INFO(op_array, (void*)jit_extension);
opline->handler = (const void*)zend_jit_profile_jit_handler;
jit_extension =
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array);
- memset(&jit_extension->func_info, 0, sizeof(jit_extension->func_info));
+ jit_extension->func_info.num = 0;
+ jit_extension->func_info.flags &= ZEND_FUNC_JIT_ON_FIRST_EXEC
+ | ZEND_FUNC_JIT_ON_PROF_REQUEST
+ | ZEND_FUNC_JIT_ON_HOT_COUNTERS
+ | ZEND_FUNC_JIT_ON_HOT_TRACE;
+ memset(&jit_extension->func_info.ssa, 0, sizeof(zend_func_info) - offsetof(zend_func_info, ssa));
ssa = &jit_extension->func_info.ssa;
if (JIT_G(opt_level) >= ZEND_JIT_LEVEL_OPT_FUNC) {
jit_extension =
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array);
- memset(&jit_extension->func_info, 0, sizeof(jit_extension->func_info));
+ jit_extension->func_info.num = 0;
+ jit_extension->func_info.flags &= ZEND_FUNC_JIT_ON_FIRST_EXEC
+ | ZEND_FUNC_JIT_ON_PROF_REQUEST
+ | ZEND_FUNC_JIT_ON_HOT_COUNTERS
+ | ZEND_FUNC_JIT_ON_HOT_TRACE;
+ memset(&jit_extension->func_info.ssa, 0, sizeof(zend_func_info) - offsetof(zend_func_info, ssa));
}
zend_arena_release(&CG(arena), checkpoint);
jit_extension = (zend_jit_op_array_trace_extension*)zend_shared_alloc(sizeof(zend_jit_op_array_trace_extension) + (op_array->last - 1) * sizeof(zend_op_trace_info));
memset(&jit_extension->func_info, 0, sizeof(zend_func_info));
+ jit_extension->func_info.flags = ZEND_FUNC_JIT_ON_HOT_TRACE;
jit_extension->op_array = op_array;
jit_extension->offset = (char*)jit_extension->trace_info - (char*)op_array->opcodes;
for (i = 0; i < op_array->last; i++) {