Skip to content

Commit

Permalink
Fixed final dump "after optimizer"
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Jul 5, 2017
1 parent 73d5097 commit 7bb4ae5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ext/opcache/Optimizer/zend_optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,10 @@ static void zend_optimize(zend_op_array *op_array,
}
}

if (ZEND_OPTIMIZER_PASS_7 & ctx->optimization_level) {
return;
}

if (ctx->debug_level & ZEND_DUMP_AFTER_OPTIMIZER) {
zend_dump_op_array(op_array, 0, "after optimizer", NULL);
}
Expand Down Expand Up @@ -1228,6 +1232,20 @@ int zend_optimize_script(zend_script *script, zend_long optimization_level, zend
} ZEND_HASH_FOREACH_END();
}

if (debug_level & ZEND_DUMP_AFTER_OPTIMIZER) {
ZEND_HASH_FOREACH_PTR(&script->function_table, op_array) {
zend_dump_op_array(op_array, ZEND_DUMP_RT_CONSTANTS, "after optimizer", NULL);
} ZEND_HASH_FOREACH_END();

ZEND_HASH_FOREACH_PTR(&script->class_table, ce) {
ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->function_table, name, op_array) {
if (op_array->scope == ce) {
zend_dump_op_array(op_array, ZEND_DUMP_RT_CONSTANTS, "after optimizer", NULL);
}
} ZEND_HASH_FOREACH_END();
} ZEND_HASH_FOREACH_END();
}

if (ctx.constants) {
zend_hash_destroy(ctx.constants);
}
Expand Down

0 comments on commit 7bb4ae5

Please sign in to comment.