Skip to content

Commit 7bb4ae5

Browse files
committed
Fixed final dump "after optimizer"
1 parent 73d5097 commit 7bb4ae5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

ext/opcache/Optimizer/zend_optimizer.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,10 @@ static void zend_optimize(zend_op_array *op_array,
980980
}
981981
}
982982

983+
if (ZEND_OPTIMIZER_PASS_7 & ctx->optimization_level) {
984+
return;
985+
}
986+
983987
if (ctx->debug_level & ZEND_DUMP_AFTER_OPTIMIZER) {
984988
zend_dump_op_array(op_array, 0, "after optimizer", NULL);
985989
}
@@ -1228,6 +1232,20 @@ int zend_optimize_script(zend_script *script, zend_long optimization_level, zend
12281232
} ZEND_HASH_FOREACH_END();
12291233
}
12301234

1235+
if (debug_level & ZEND_DUMP_AFTER_OPTIMIZER) {
1236+
ZEND_HASH_FOREACH_PTR(&script->function_table, op_array) {
1237+
zend_dump_op_array(op_array, ZEND_DUMP_RT_CONSTANTS, "after optimizer", NULL);
1238+
} ZEND_HASH_FOREACH_END();
1239+
1240+
ZEND_HASH_FOREACH_PTR(&script->class_table, ce) {
1241+
ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->function_table, name, op_array) {
1242+
if (op_array->scope == ce) {
1243+
zend_dump_op_array(op_array, ZEND_DUMP_RT_CONSTANTS, "after optimizer", NULL);
1244+
}
1245+
} ZEND_HASH_FOREACH_END();
1246+
} ZEND_HASH_FOREACH_END();
1247+
}
1248+
12311249
if (ctx.constants) {
12321250
zend_hash_destroy(ctx.constants);
12331251
}

0 commit comments

Comments
 (0)