Skip to content

Commit

Permalink
[Observer+JIT] Save opline before calling begin/end handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Nov 11, 2020
1 parent 855d8fa commit 11c4821
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/opcache/jit/zend_jit_vm_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_trace_c
}
#ifdef HAVE_GCC_GLOBAL_REGS
execute_data = EG(current_execute_data);
opline = EX(opline);
opline = execute_data ? EX(opline) : NULL;
return;
#else
return 1;
Expand Down
4 changes: 4 additions & 0 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -9841,6 +9841,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
if (!trace && op_array == &func->op_array) {
/* recursive call */
if (ZEND_OBSERVER_ENABLED) {
| SAVE_IP
| mov FCARG1a, FP
| EXT_CALL zend_observer_fcall_begin, r0
}
Expand Down Expand Up @@ -9950,6 +9951,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
}

if (ZEND_OBSERVER_ENABLED) {
| SAVE_IP
| mov FCARG1a, FP
| EXT_CALL zend_observer_fcall_begin, r0
}
Expand Down Expand Up @@ -11364,6 +11366,7 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
if (ZEND_OBSERVER_ENABLED) {
| xor FCARG2a, FCARG2a
| mov FCARG1a, FP
| SET_EX_OPLINE opline, r0
| EXT_CALL zend_observer_fcall_end, r0
}
return 1;
Expand Down Expand Up @@ -11437,6 +11440,7 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
if (ZEND_OBSERVER_ENABLED) {
| LOAD_ZVAL_ADDR FCARG2a, ret_addr
| mov FCARG1a, FP
| SET_EX_OPLINE opline, r0
| EXT_CALL zend_observer_fcall_end, r0
}
return 1;
Expand Down

0 comments on commit 11c4821

Please sign in to comment.