Skip to content

Commit 2558311

Browse files
committed
Merge branch 'master' into sccp
* master: Fixed final dump "after optimizer"
2 parents 722a59d + 7bb4ae5 commit 2558311

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
@@ -1007,6 +1007,10 @@ static void zend_optimize(zend_op_array *op_array,
10071007
}
10081008
}
10091009

1010+
if (ZEND_OPTIMIZER_PASS_7 & ctx->optimization_level) {
1011+
return;
1012+
}
1013+
10101014
if (ctx->debug_level & ZEND_DUMP_AFTER_OPTIMIZER) {
10111015
zend_dump_op_array(op_array, 0, "after optimizer", NULL);
10121016
}
@@ -1255,6 +1259,20 @@ int zend_optimize_script(zend_script *script, zend_long optimization_level, zend
12551259
} ZEND_HASH_FOREACH_END();
12561260
}
12571261

1262+
if (debug_level & ZEND_DUMP_AFTER_OPTIMIZER) {
1263+
ZEND_HASH_FOREACH_PTR(&script->function_table, op_array) {
1264+
zend_dump_op_array(op_array, ZEND_DUMP_RT_CONSTANTS, "after optimizer", NULL);
1265+
} ZEND_HASH_FOREACH_END();
1266+
1267+
ZEND_HASH_FOREACH_PTR(&script->class_table, ce) {
1268+
ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->function_table, name, op_array) {
1269+
if (op_array->scope == ce) {
1270+
zend_dump_op_array(op_array, ZEND_DUMP_RT_CONSTANTS, "after optimizer", NULL);
1271+
}
1272+
} ZEND_HASH_FOREACH_END();
1273+
} ZEND_HASH_FOREACH_END();
1274+
}
1275+
12581276
if (ctx.constants) {
12591277
zend_hash_destroy(ctx.constants);
12601278
}

0 commit comments

Comments
 (0)