if (func->type == ZEND_USER_FUNCTION) {
int call_via_handler = (func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) != 0;
const zend_op *current_opline_before_exception = EG(opline_before_exception);
+ uint32_t orig_jit_trace_num = EG(jit_trace_num);
zend_init_func_execute_data(call, &func->op_array, fci->retval);
zend_execute_ex(call);
+ EG(jit_trace_num) = orig_jit_trace_num;
EG(opline_before_exception) = current_opline_before_exception;
if (call_via_handler) {
/* We must re-initialize function again */
struct _zend_execute_data *current_execute_data;
zend_class_entry *fake_scope; /* used to avoid checks accessing properties */
+ uint32_t jit_trace_num; /* Used by tracing JIT to reference the currently running trace */
+
zend_long precision;
int ticks_count;
int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf *regs)
{
- uint32_t trace_num = (uint32_t)(uintptr_t)EG(reserved)[zend_func_info_rid];
+ uint32_t trace_num = EG(jit_trace_num);
zend_execute_data *execute_data = EG(current_execute_data);
const zend_op *orig_opline = EX(opline);
const zend_op *opline;
{
current_trace_num = trace_num;
- | //EG(reserved)[zend_func_info_rid] = trace_num;
- | MEM_OP2_1_ZTS mov, aword, executor_globals, reserved[zend_func_info_rid], trace_num, r0
+ | // EG(jit_trace_num) = trace_num;
+ | MEM_OP2_1_ZTS mov, dword, executor_globals, jit_trace_num, trace_num, r0
return 1;
}
| call aword [r0 + offsetof(zend_internal_function, handler)]
}
- if (trace) {
- // TODO: This is a quick dirty fix ??????
- //
- // Internal function may call another trace that,
- // replaces EG(trace_id) and the following side exit
- // from this trace is going to be mad !!!!!!
- //
- // Lets set EG(trace_id) once again...
- zend_jit_trace_begin(Dst, current_trace_num);
- }
-
| // EG(current_execute_data) = execute_data;
| MEM_OP2_1_ZTS mov, aword, executor_globals, current_execute_data, FP, r0