Skip to content

Commit 6ce13ce

Browse files
committed
Fixup remaining place in zend_jit_vm_helpers.c
Signed-off-by: Bob Weinand <[email protected]>
1 parent 80006c5 commit 6ce13ce

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7664,10 +7664,12 @@ ZEND_EXT_API void zend_jit_blacklist_function(zend_op_array *op_array) {
76647664

76657665
zend_shared_alloc_lock();
76667666
SHM_UNPROTECT();
7667+
zend_jit_unprotect();
76677668

76687669
zend_jit_stop_persistent_op_array(op_array);
76697670
jit_extension->func_info.flags &= ~ZEND_FUNC_JIT_ON_HOT_TRACE;
76707671

7672+
zend_jit_protect();
76717673
SHM_PROTECT();
76727674
zend_shared_alloc_unlock();
76737675
}

ext/opcache/jit/zend_jit_vm_helpers.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,26 +1095,15 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
10951095
if (func->type == ZEND_USER_FUNCTION) {
10961096
jit_extension =
10971097
(zend_jit_op_array_trace_extension*)ZEND_FUNC_INFO(&func->op_array);
1098+
if (UNEXPECTED(!jit_extension
1099+
|| !(jit_extension->func_info.flags & ZEND_FUNC_JIT_ON_HOT_TRACE))
1100+
|| (func->op_array.fn_flags & ZEND_ACC_FAKE_CLOSURE)) {
1101+
stop = ZEND_JIT_TRACE_STOP_INTERPRETER;
1102+
break;
1103+
}
10981104
if (func->op_array.fn_flags & ZEND_ACC_CLOSURE) {
1099-
if (UNEXPECTED(!jit_extension
1100-
|| !(jit_extension->func_info.flags & ZEND_FUNC_JIT_ON_HOT_TRACE)
1101-
|| (func->op_array.fn_flags & ZEND_ACC_FAKE_CLOSURE))) {
1102-
stop = ZEND_JIT_TRACE_STOP_INTERPRETER;
1103-
break;
1104-
}
11051105
func = (zend_function*)jit_extension->op_array;
11061106
}
1107-
// First not-skipped op
1108-
zend_op *opline = func->op_array.opcodes;
1109-
if (!(func->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
1110-
while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {
1111-
opline++;
1112-
}
1113-
}
1114-
if (jit_extension && ZEND_OP_TRACE_INFO(opline, jit_extension->offset)->trace_flags & ZEND_JIT_TRACE_BLACKLISTED) {
1115-
stop = ZEND_JIT_TRACE_STOP_BLACK_LIST;
1116-
break;
1117-
}
11181107
}
11191108

11201109
#ifndef HAVE_GCC_GLOBAL_REGS

0 commit comments

Comments
 (0)