Skip to content

Commit 9f23891

Browse files
committed
Fixed tracing JIT + preloading failures:
ext/opcache/tests/preload_003.phpt ext/opcache/tests/preload_trait_multiple_fixup.phpt ext/opcache/tests/preload_trait_static.phpt
1 parent cb0854b commit 9f23891

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

ext/opcache/zend_persist.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,10 +1270,22 @@ static void zend_accel_persist_class_table(HashTable *class_table)
12701270
for (uint32_t i = 0; i < op_array->num_dynamic_func_defs; i++) {
12711271
zend_jit_op_array(op_array->dynamic_func_defs[i], ZCG(current_persistent_script) ? &ZCG(current_persistent_script)->script : NULL);
12721272
}
1273-
} else if (JIT_G(trigger) == ZEND_JIT_ON_FIRST_EXEC
1274-
|| JIT_G(trigger) == ZEND_JIT_ON_PROF_REQUEST
1275-
|| JIT_G(trigger) == ZEND_JIT_ON_HOT_COUNTERS
1276-
|| JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
1273+
}
1274+
}
1275+
} ZEND_HASH_FOREACH_END();
1276+
}
1277+
} ZEND_HASH_FOREACH_END();
1278+
ZEND_HASH_FOREACH_BUCKET(class_table, p) {
1279+
if (EXPECTED(Z_TYPE(p->val) != IS_ALIAS_PTR)) {
1280+
ce = Z_PTR(p->val);
1281+
ZEND_HASH_FOREACH_PTR(&ce->function_table, op_array) {
1282+
if (op_array->type == ZEND_USER_FUNCTION) {
1283+
if ((op_array->scope != ce
1284+
|| (op_array->fn_flags & ZEND_ACC_TRAIT_CLONE))
1285+
&& (JIT_G(trigger) == ZEND_JIT_ON_FIRST_EXEC
1286+
|| JIT_G(trigger) == ZEND_JIT_ON_PROF_REQUEST
1287+
|| JIT_G(trigger) == ZEND_JIT_ON_HOT_COUNTERS
1288+
|| JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE)) {
12771289
void *jit_extension = zend_shared_alloc_get_xlat_entry(op_array->opcodes);
12781290

12791291
if (jit_extension) {

0 commit comments

Comments
 (0)