]> granicus.if.org Git - php/commitdiff
Fixed tracing JIT for tests/classes/unset_properties.phpt
authorDmitry Stogov <dmitry@zend.com>
Tue, 27 Oct 2020 07:30:38 +0000 (10:30 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 27 Oct 2020 07:30:38 +0000 (10:30 +0300)
ext/opcache/jit/zend_jit_trace.c

index 5fc4c66e494872e5e114ef76b5c539c8a23c2657..cf4918b80b9765f4f26030e0b854ddfa0e61032d 100644 (file)
@@ -6976,6 +6976,7 @@ int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf
        const zend_op *orig_opline = EX(opline);
        const zend_op *opline;
        zend_jit_trace_info *t = &zend_jit_traces[trace_num];
+       int repeat_last_opline = 0;
 
        /* Deoptimizatoion of VM stack state */
        uint32_t i;
@@ -7030,19 +7031,7 @@ int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf
 
                                if (UNEXPECTED(Z_TYPE_P(val) == IS_UNDEF)) {
                                        /* Undefined array index or property */
-                                       if (JIT_G(debug) & ZEND_JIT_DEBUG_TRACE_EXIT) {
-                                               fprintf(stderr, "     TRACE %d exit %d %s%s%s() %s:%d\n",
-                                                       trace_num,
-                                                       exit_num,
-                                                       EX(func)->op_array.scope ? ZSTR_VAL(EX(func)->op_array.scope->name) : "",
-                                                       EX(func)->op_array.scope ? "::" : "",
-                                                       EX(func)->op_array.function_name ?
-                                                               ZSTR_VAL(EX(func)->op_array.function_name) : "$main",
-                                                       ZSTR_VAL(EX(func)->op_array.filename),
-                                                       EX(opline)->lineno);
-                                       }
-                                       EX(opline) = t->exit_info[exit_num].opline - 1;
-                                       return 0;
+                                       repeat_last_opline = 1;
                                } else {
                                        ZVAL_COPY(EX_VAR_NUM(i), val);
                                }
@@ -7106,6 +7095,11 @@ int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf
                        EX(opline)->lineno);
        }
 
+       if (repeat_last_opline) {
+               EX(opline) = t->exit_info[exit_num].opline - 1;
+               return (EX(opline) == t->opline);
+       }
+
        if (t->exit_info[exit_num].flags & ZEND_JIT_EXIT_TO_VM) {
                if (zend_jit_trace_exit_is_bad(trace_num, exit_num)) {
                        zend_jit_blacklist_trace_exit(trace_num, exit_num);