com php-src: [Observer+JIT] Save opline before calling begin/end handlers: ext/opcache/jit/zend_jit_vm_helpers.c ext/opcache/jit /zend_jit_x86.dasc
| From: | Dmitry Stogov | Date: | Wed, 11 Nov 2020 10:50:53 +0000 |
| Subject: | com php-src: [Observer+JIT] Save opline before calling begin/end handlers: ext/opcache/jit/zend_jit_vm_helpers.c ext/opcache/jit /zend_jit_x86.dasc | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-114126@lists.php.net to get a copy of this message | ||
Commit: 11c4821ba968d2a39310851ab89d673c553b72f3
Author: Dmitry Stogov <dmitry@zend.com> Wed, 11 Nov 2020 13:50:53 +0300
Parents: 855d8fa68fd0456afbfb9e7ecd50a20e41334fd1
Branches: PHP-8.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=11c4821ba968d2a39310851ab89d673c553b72f3
Log:
[Observer+JIT] Save opline before calling begin/end handlers
Changed paths:
M ext/opcache/jit/zend_jit_vm_helpers.c
M ext/opcache/jit/zend_jit_x86.dasc
Diff:
diff --git a/ext/opcache/jit/zend_jit_vm_helpers.c b/ext/opcache/jit/zend_jit_vm_helpers.c
index 6296532fdbf..898b7c1f42a 100644
--- a/ext/opcache/jit/zend_jit_vm_helpers.c
+++ b/ext/opcache/jit/zend_jit_vm_helpers.c
@@ -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;
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc
index c90dd674573..7306ee2a3cb 100644
--- a/ext/opcache/jit/zend_jit_x86.dasc
+++ b/ext/opcache/jit/zend_jit_x86.dasc
@@ -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
}
@@ -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
}
@@ -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;
@@ -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;