]> granicus.if.org Git - php/commitdiff
Replace zend_jit_trace_info.loop_kind by zend_jit_trace_info.flags
authorDmitry Stogov <dmitry@zend.com>
Tue, 12 May 2020 21:56:04 +0000 (00:56 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 12 May 2020 21:56:04 +0000 (00:56 +0300)
ext/opcache/jit/zend_jit_internal.h
ext/opcache/jit/zend_jit_trace.c
ext/opcache/jit/zend_jit_x86.dasc

index 9f6f16d62765fca28c959be823e416fccc6c76d6..531727a642f730ce3a8bb37734645422b6472c0c 100644 (file)
@@ -343,6 +343,9 @@ typedef union _zend_jit_trace_stack {
                (_stack)[_slot].reg = _reg; \
        } while (0)
 
+/* trace info flags */
+#define ZEND_JIT_TRACE_CHECK_INTERRUPT (1<<0)
+
 typedef struct _zend_jit_trace_info {
        uint32_t                  id;            /* trace id */
        uint32_t                  root;          /* root trace id or self id for root traces */
@@ -353,7 +356,7 @@ typedef struct _zend_jit_trace_info {
        uint32_t                  code_size;     /* size of native code */
        uint32_t                  exit_counters; /* offset in exit counters array */
        uint32_t                  stack_map_size;
-       uint32_t                  loop_kind;     /* LOOP, RECURSIVE_CALL or RECURSIVE_RET */
+       uint32_t                  flags;         /* See ZEND_JIT_TRACE_... defines above */
        const zend_op            *opline;        /* first opline */
        const void               *code_start;    /* address of native code */
        zend_jit_trace_exit_info *exit_info;     /* info about side exits */
index 367b2335a1836de98f5d4d4bf74eccec4926bc05..4dfde5454be2c8e31f077702763a6c3d94888a26 100644 (file)
@@ -3981,7 +3981,9 @@ done:
                        }
                }
                t->link = ZEND_JIT_TRACE_NUM;
-               t->loop_kind = p->stop;
+               if (p->stop != ZEND_JIT_TRACE_STOP_RECURSIVE_RET) {
+                       t->flags |= ZEND_JIT_TRACE_CHECK_INTERRUPT;
+               }
                zend_jit_trace_end_loop(&dasm_state, 0, timeout_exit_addr); /* jump back to start of the trace loop */
        } else if (p->stop == ZEND_JIT_TRACE_STOP_LINK) {
                if (ra) {
@@ -4140,7 +4142,7 @@ static zend_jit_trace_stop zend_jit_compile_root_trace(zend_jit_trace_rec *trace
                t->exit_count = 0;
                t->child_count = 0;
                t->stack_map_size = 0;
-               t->loop_kind = 0;
+               t->flags = 0;
                t->opline = ((zend_jit_trace_start_rec*)trace_buffer)->opline;
                t->exit_info = exit_info;
                t->stack_map = NULL;
@@ -4701,7 +4703,7 @@ static zend_jit_trace_stop zend_jit_compile_side_trace(zend_jit_trace_rec *trace
                t->exit_count = 0;
                t->child_count = 0;
                t->stack_map_size = 0;
-               t->loop_kind = 0;
+               t->flags = 0;
                t->opline = NULL;
                t->exit_info = exit_info;
                t->stack_map = NULL;
index e0ae11241e16b45efd6076586cf7a54687b48c40..9675791a78ef70c91cb6c84607cf407e61d8b41e 100644 (file)
@@ -3029,7 +3029,7 @@ static int zend_jit_trace_link_to_root(dasm_State **Dst, zend_jit_trace_info *t)
        }
        link_addr = (const void*)((const char*)t->code_start + prologue_size);
 
-       if (t->link == t->id && t->loop_kind != ZEND_JIT_TRACE_STOP_RECURSIVE_RET) {
+       if (t->flags & ZEND_JIT_TRACE_CHECK_INTERRUPT) {
                /* Check timeout for links to LOOP */
                |       MEM_OP2_1_ZTS cmp, byte, executor_globals, vm_interrupt, 0, r0
                |       je &link_addr