Skip to content

Commit d8b56be

Browse files
committed
Dump IR for stubs only if disassembling of stubs is requested
1 parent 59ced40 commit d8b56be

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

ext/opcache/jit/zend_jit_ir.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3429,7 +3429,8 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name)
34293429
{
34303430
void *entry;
34313431

3432-
if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_SRC) {
3432+
if ((JIT_G(debug) & ZEND_JIT_DEBUG_IR_SRC)
3433+
&& (!name || (JIT_G(debug) & ZEND_JIT_DEBUG_ASM_STUBS))) {
34333434
if (name) fprintf(stderr, "%s: ; after folding\n", name);
34343435
ir_save(ctx, stderr);
34353436
}
@@ -3448,7 +3449,8 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name)
34483449
ir_sccp(ctx);
34493450
#endif
34503451

3451-
if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_SCCP) {
3452+
if ((JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_SCCP)
3453+
&& (!name || (JIT_G(debug) & ZEND_JIT_DEBUG_ASM_STUBS))) {
34523454
if (name) fprintf(stderr, "%s: ; after SCCP\n", name);
34533455
ir_save(ctx, stderr);
34543456
}
@@ -3460,7 +3462,8 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name)
34603462
ir_build_dominators_tree(ctx);
34613463
ir_find_loops(ctx);
34623464

3463-
if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_SCCP) {
3465+
if ((JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_SCCP)
3466+
&& (!name || (JIT_G(debug) & ZEND_JIT_DEBUG_ASM_STUBS))) {
34643467
if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_CFG) {
34653468
ir_dump_cfg(ctx, stderr);
34663469
}
@@ -3469,7 +3472,8 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name)
34693472
ir_gcm(ctx);
34703473
ir_schedule(ctx);
34713474

3472-
if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_SCHEDULE) {
3475+
if ((JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_SCHEDULE)
3476+
&& (!name || (JIT_G(debug) & ZEND_JIT_DEBUG_ASM_STUBS))) {
34733477
if (name) fprintf(stderr, "%s: ; after schedule\n", name);
34743478
ir_save(ctx, stderr);
34753479
if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_CFG) {
@@ -3484,7 +3488,8 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name)
34843488
ir_coalesce(ctx);
34853489
ir_reg_alloc(ctx);
34863490

3487-
if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_REGS) {
3491+
if ((JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_REGS)
3492+
&& (!name || (JIT_G(debug) & ZEND_JIT_DEBUG_ASM_STUBS))) {
34883493
if (name) fprintf(stderr, "%s: ; after register allocation\n", name);
34893494
ir_save(ctx, stderr);
34903495
if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_CFG) {
@@ -3497,7 +3502,8 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name)
34973502

34983503
ir_schedule_blocks(ctx);
34993504

3500-
if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_FINAL) {
3505+
if ((JIT_G(debug) & ZEND_JIT_DEBUG_IR_FINAL)
3506+
&& (!name || (JIT_G(debug) & ZEND_JIT_DEBUG_ASM_STUBS))) {
35013507
if (name) fprintf(stderr, "%s: ; final\n", name);
35023508
ir_save(ctx, stderr);
35033509
if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_CFG) {

0 commit comments

Comments
 (0)