(_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 */
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 */
}
}
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) {
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;
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;
}
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