mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Keep trace number in EG(jit_trace_num) instead of EG(reserved)[zend_func_info_rid]
This commit is contained in:
parent
3376f19742
commit
bfc56ed511
5 changed files with 8 additions and 14 deletions
|
@ -794,9 +794,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
|||
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 */
|
||||
|
|
|
@ -164,6 +164,8 @@ struct _zend_executor_globals {
|
|||
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;
|
||||
|
|
|
@ -385,6 +385,7 @@ static int zend_jit_disasm_init(void)
|
|||
REGISTER_EG(vm_stack_top);
|
||||
REGISTER_EG(vm_stack_end);
|
||||
REGISTER_EG(symbol_table);
|
||||
REGISTER_EG(jit_trace_num);
|
||||
#undef REGISTER_EG
|
||||
#endif
|
||||
|
||||
|
|
|
@ -4994,7 +4994,7 @@ blacklist:
|
|||
|
||||
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;
|
||||
|
|
|
@ -2853,8 +2853,8 @@ static int zend_jit_trace_begin(dasm_State **Dst, uint32_t trace_num)
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
@ -8588,17 +8588,6 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
|
|||
| 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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue