]> granicus.if.org Git - php/commitdiff
Fixed JIT on load with -O4
authorDmitry Stogov <dmitry@zend.com>
Mon, 18 May 2020 12:29:28 +0000 (15:29 +0300)
committerDmitry Stogov <dmitry@zend.com>
Mon, 18 May 2020 12:29:28 +0000 (15:29 +0300)
ext/opcache/jit/zend_jit_x86.dasc

index 50a5d4298a1f481be4177e506eec189b185d7bff..97b926085d8da82fc586ad498e2bf41bb01e5715 100644 (file)
@@ -8327,6 +8327,13 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
                                if (func) {
                                        if (func->op_array.fn_flags & ZEND_ACC_IMMUTABLE) {
                                                |       MEM_OP2_2_ZTS add, r2, aword, compiler_globals, map_ptr_base, r1
+                                       } else if (JIT_G(opt_level) < ZEND_JIT_LEVEL_OPT_SCRIPT
+                                        && JIT_G(trigger) == ZEND_JIT_ON_SCRIPT_LOAD) {
+                                               /* the called op_array may be not persisted yet */
+                                               |       test r2, 1
+                                               |       jz >1
+                                               |       MEM_OP2_2_ZTS add, r2, aword, compiler_globals, map_ptr_base, r1
+                                               |1:
                                        }
                                        |       mov r2, aword [r2]
                                } else {