Skip to content

Commit

Permalink
Fixed JIT for indirectly recursive traces
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Aug 17, 2020
1 parent 72383cc commit 28e24e7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ext/opcache/jit/zend_jit_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -4677,15 +4677,26 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par

if (handler) {
if (p->stop == ZEND_JIT_TRACE_STOP_RECURSIVE_CALL) {
op_array = trace_buffer->op_array;
const zend_op_array *rec_op_array;

rec_op_array = op_array = trace_buffer->op_array;
jit_extension =
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array);
p = trace_buffer + ZEND_JIT_TRACE_START_REC_SIZE;
for (;;p++) {
if (p->op == ZEND_JIT_TRACE_VM) {
opline = p->opline;
} else if (p->op == ZEND_JIT_TRACE_ENTER) {
if (p->op_array == op_array) {
if (p->op_array == rec_op_array) {
zend_jit_trace_setup_ret_counter(opline, jit_extension->offset);
}
op_array = p->op_array;
jit_extension =
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array);
} else if (p->op == ZEND_JIT_TRACE_BACK) {
op_array = p->op_array;
jit_extension =
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(op_array);
} else if (p->op == ZEND_JIT_TRACE_END) {
break;
}
Expand Down

0 comments on commit 28e24e7

Please sign in to comment.