summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-01-19 10:07:32 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-01-19 10:09:53 +0100
commitfbd8e20ed5c6014b96c6f533e7f94b35789ac2f0 (patch)
treebbc40c73dc050daf192b80eabe4f0108404fa2b1
parentdd7d829896d6efaf35e001c0a57db20cfcc42be3 (diff)
downloadphp-git-fbd8e20ed5c6014b96c6f533e7f94b35789ac2f0.tar.gz
Observe unused return values in JIT
Even if the return value is not used, it should still be available to the observer.
-rw-r--r--ext/opcache/jit/zend_jit_x86.dasc19
1 files changed, 7 insertions, 12 deletions
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc
index 79519d47e8..5ff3c05034 100644
--- a/ext/opcache/jit/zend_jit_x86.dasc
+++ b/ext/opcache/jit/zend_jit_x86.dasc
@@ -11431,6 +11431,13 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
return_value_used = -1;
}
+ if (ZEND_OBSERVER_ENABLED) {
+ | LOAD_ZVAL_ADDR FCARG2a, op1_addr
+ | mov FCARG1a, FP
+ | SET_EX_OPLINE opline, r0
+ | EXT_CALL zend_observer_fcall_end, r0
+ }
+
// if (!EX(return_value))
if (Z_MODE(op1_addr) == IS_REG && Z_REG(op1_addr) == ZREG_R1) {
if (return_value_used != 0) {
@@ -11497,12 +11504,6 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
if (return_value_used == 0) {
|9:
- if (ZEND_OBSERVER_ENABLED) {
- | xor FCARG2a, FCARG2a
- | mov FCARG1a, FP
- | SET_EX_OPLINE opline, r0
- | EXT_CALL zend_observer_fcall_end, r0
- }
return 1;
}
@@ -11571,12 +11572,6 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
}
|9:
- 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;
}