Skip to content

Commit

Permalink
Always generate interrupt check in jit
Browse files Browse the repository at this point in the history
Even if zend_interrupt_function is NULL, we still need to perform
the interrupt check for timeouts (which do not use
zend_interrupt_function).
  • Loading branch information
nikic committed Jul 5, 2019
1 parent 705f8ab commit da8b583
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions ext/opcache/jit/zend_jit_x86.dasc
Expand Up @@ -2680,28 +2680,25 @@ static int zend_jit_set_valid_ip(dasm_State **Dst, const zend_op *opline)

static int zend_jit_check_timeout(dasm_State **Dst, const zend_op *opline)
{
if (zend_interrupt_function) {
#if 0
if (!zend_jit_set_valid_ip(Dst, opline)) {
return 0;
}
| MEM_OP2_1_ZTS cmp, byte, executor_globals, vm_interrupt, 0, r0
| jne ->interrupt_handler
if (!zend_jit_set_valid_ip(Dst, opline)) {
return 0;
}
| MEM_OP2_1_ZTS cmp, byte, executor_globals, vm_interrupt, 0, r0
| jne ->interrupt_handler
#else
| MEM_OP2_1_ZTS cmp, byte, executor_globals, vm_interrupt, 0, r0
if (last_valid_opline == opline) {
| jne ->interrupt_handler
} else {
| jne >1
|.cold_code
|1:
| LOAD_IP_ADDR opline
| jmp ->interrupt_handler
|.code
}
return 1;
#endif
| MEM_OP2_1_ZTS cmp, byte, executor_globals, vm_interrupt, 0, r0
if (last_valid_opline == opline) {
| jne ->interrupt_handler
} else {
| jne >1
|.cold_code
|1:
| LOAD_IP_ADDR opline
| jmp ->interrupt_handler
|.code
}
#endif
return 1;
}

Expand Down

0 comments on commit da8b583

Please sign in to comment.