Always generate interrupt check in jit

Even if zend_interrupt_function is NULL, we still need to perform
the interrupt check for timeouts (which do not use
zend_interrupt_function).
This commit is contained in:
Nikita Popov 2019-07-05 20:51:31 +02:00
parent 705f8abcb7
commit da8b583ac1

View File

@ -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
#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
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
}
#endif
return 1;
}