From 0684b9fcdcad4f0f02d40d763f5fa7751eb561bb Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 25 Mar 2020 12:42:04 +0300 Subject: [PATCH] Always print numeric opline numbers --- ext/opcache/Optimizer/zend_dump.c | 123 +++++---------------- ext/opcache/Optimizer/zend_dump.h | 1 - ext/opcache/jit/zend_jit.c | 4 +- ext/opcache/jit/zend_jit_trace.c | 6 +- ext/opcache/tests/opt/coalesce.phpt | 31 +++--- ext/opcache/tests/opt/dce_001.phpt | 26 +++-- ext/opcache/tests/opt/dce_002.phpt | 26 +++-- ext/opcache/tests/opt/dce_003.phpt | 22 ++-- ext/opcache/tests/opt/dce_004.phpt | 24 ++-- ext/opcache/tests/opt/dce_005.phpt | 20 ++-- ext/opcache/tests/opt/dce_006.phpt | 41 +++---- ext/opcache/tests/opt/dce_007.phpt | 22 ++-- ext/opcache/tests/opt/dce_008.phpt | 24 ++-- ext/opcache/tests/opt/jmp_001.phpt | 24 ++-- ext/opcache/tests/opt/prop_types.phpt | 152 ++++++++++++++------------ ext/opcache/tests/opt/sccp_001.phpt | 18 +-- ext/opcache/tests/opt/sccp_002.phpt | 24 ++-- ext/opcache/tests/opt/sccp_003.phpt | 22 ++-- ext/opcache/tests/opt/sccp_004.phpt | 24 ++-- ext/opcache/tests/opt/sccp_005.phpt | 22 ++-- ext/opcache/tests/opt/sccp_006.phpt | 34 +++--- ext/opcache/tests/opt/sccp_007.phpt | 22 ++-- ext/opcache/tests/opt/sccp_008.phpt | 32 +++--- ext/opcache/tests/opt/sccp_009.phpt | 22 ++-- ext/opcache/tests/opt/sccp_010.phpt | 22 ++-- ext/opcache/tests/opt/sccp_011.phpt | 22 ++-- ext/opcache/tests/opt/sccp_012.phpt | 22 ++-- ext/opcache/tests/opt/sccp_016.phpt | 15 +-- ext/opcache/tests/opt/sccp_017.phpt | 20 ++-- ext/opcache/tests/opt/sccp_019.phpt | 20 ++-- ext/opcache/tests/opt/sccp_022.phpt | 36 +++--- ext/opcache/tests/opt/sccp_024.phpt | 36 +++--- ext/opcache/tests/opt/sccp_026.phpt | 34 +++--- ext/opcache/tests/opt/sccp_031.phpt | 24 ++-- 34 files changed, 507 insertions(+), 510 deletions(-) diff --git a/ext/opcache/Optimizer/zend_dump.c b/ext/opcache/Optimizer/zend_dump.c index e14ea642b5..e06128457a 100644 --- a/ext/opcache/Optimizer/zend_dump.c +++ b/ext/opcache/Optimizer/zend_dump.c @@ -605,10 +605,8 @@ void zend_dump_op(const zend_op_array *op_array, const zend_basic_block *b, cons if (ZEND_VM_OP_JMP_ADDR == (op1_flags & ZEND_VM_OP_MASK)) { if (b) { fprintf(stderr, " BB%d", b->successors[n++]); - } else if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " %04u", (uint32_t)(OP_JMP_ADDR(opline, opline->op1) - op_array->opcodes)); } else { - fprintf(stderr, " L%u", (uint32_t)(OP_JMP_ADDR(opline, opline->op1) - op_array->opcodes)); + fprintf(stderr, " %04u", (uint32_t)(OP_JMP_ADDR(opline, opline->op1) - op_array->opcodes)); } } else { zend_dump_unused_op(opline, opline->op1, op1_flags); @@ -630,10 +628,8 @@ void zend_dump_op(const zend_op_array *op_array, const zend_basic_block *b, cons } if (b) { fprintf(stderr, " BB%d,", b->successors[n++]); - } else if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " %04u,", (uint32_t)ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, Z_LVAL_P(zv))); } else { - fprintf(stderr, " L%u,", (uint32_t)ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, Z_LVAL_P(zv))); + fprintf(stderr, " %04u,", (uint32_t)ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, Z_LVAL_P(zv))); } } ZEND_HASH_FOREACH_END(); fprintf(stderr, " default:"); @@ -667,10 +663,8 @@ void zend_dump_op(const zend_op_array *op_array, const zend_basic_block *b, cons if (opline->opcode != ZEND_CATCH || !(opline->extended_value & ZEND_LAST_CATCH)) { if (b) { fprintf(stderr, " BB%d", b->successors[n++]); - } else if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " %04u", (uint32_t)(OP_JMP_ADDR(opline, opline->op2) - op_array->opcodes)); } else { - fprintf(stderr, " L%u", (uint32_t)(OP_JMP_ADDR(opline, opline->op2) - op_array->opcodes)); + fprintf(stderr, " %04u", (uint32_t)(OP_JMP_ADDR(opline, opline->op2) - op_array->opcodes)); } } } else { @@ -681,10 +675,8 @@ void zend_dump_op(const zend_op_array *op_array, const zend_basic_block *b, cons if (ZEND_VM_EXT_JMP_ADDR == (flags & ZEND_VM_EXT_MASK)) { if (b) { fprintf(stderr, " BB%d", b->successors[n++]); - } else if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " %04u", (uint32_t)ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value)); } else { - fprintf(stderr, " L%u", (uint32_t)ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value)); + fprintf(stderr, " %04u", (uint32_t)ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value)); } } if (opline->result_type == IS_CONST) { @@ -724,15 +716,8 @@ static void zend_dump_op_line(const zend_op_array *op_array, const zend_basic_bl const zend_ssa *ssa = NULL; zend_ssa_op *ssa_op = NULL; - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - len = fprintf(stderr, "%04u", (uint32_t)(opline - op_array->opcodes)); - fprintf(stderr, "%*c", 5-len, ' '); - } else if (!b) { - len = fprintf(stderr, "L%u (%u):", (uint32_t)(opline - op_array->opcodes), opline->lineno); - fprintf(stderr, "%*c", 12-len, ' '); - } else { - fprintf(stderr, "%*c", 12-len, ' '); - } + len = fprintf(stderr, "%04u", (uint32_t)(opline - op_array->opcodes)); + fprintf(stderr, "%*c", 5-len, ' '); if (dump_flags & ZEND_DUMP_SSA) { ssa = (const zend_ssa*)data; @@ -749,10 +734,7 @@ static void zend_dump_block_info(const zend_cfg *cfg, int n, uint32_t dump_flags { zend_basic_block *b = cfg->blocks + n; - fprintf(stderr, "BB%d:", n); - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, "\n ;"); - } + fprintf(stderr, "BB%d:\n ;", n); if (b->flags & ZEND_BB_START) { fprintf(stderr, " start"); } @@ -806,10 +788,7 @@ static void zend_dump_block_info(const zend_cfg *cfg, int n, uint32_t dump_flags int *p = cfg->predecessors + b->predecessor_offset; int *end = p + b->predecessors_count; - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " "); - } - fprintf(stderr, " ; from=(BB%d", *p); + fprintf(stderr, " ; from=(BB%d", *p); for (p++; p < end; p++) { fprintf(stderr, ", BB%d", *p); } @@ -818,10 +797,7 @@ static void zend_dump_block_info(const zend_cfg *cfg, int n, uint32_t dump_flags if (b->successors_count > 0) { int s; - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " "); - } - fprintf(stderr, " ; to=(BB%d", b->successors[0]); + fprintf(stderr, " ; to=(BB%d", b->successors[0]); for (s = 1; s < b->successors_count; s++) { fprintf(stderr, ", BB%d", b->successors[s]); } @@ -829,29 +805,17 @@ static void zend_dump_block_info(const zend_cfg *cfg, int n, uint32_t dump_flags } if (b->idom >= 0) { - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " "); - } - fprintf(stderr, " ; idom=BB%d\n", b->idom); + fprintf(stderr, " ; idom=BB%d\n", b->idom); } if (b->level >= 0) { - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " "); - } - fprintf(stderr, " ; level=%d\n", b->level); + fprintf(stderr, " ; level=%d\n", b->level); } if (b->loop_header >= 0) { - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " "); - } - fprintf(stderr, " ; loop_header=%d\n", b->loop_header); + fprintf(stderr, " ; loop_header=%d\n", b->loop_header); } if (b->children >= 0) { int j = b->children; - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " "); - } - fprintf(stderr, " ; children=(BB%d", j); + fprintf(stderr, " ; children=(BB%d", j); j = cfg->blocks[j].next_child; while (j >= 0) { fprintf(stderr, ", BB%d", j); @@ -870,11 +834,7 @@ static void zend_dump_block_header(const zend_cfg *cfg, const zend_op_array *op_ do { int j; - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " "); - } else { - fprintf(stderr, " "); - } + fprintf(stderr, " "); zend_dump_ssa_var(op_array, ssa, p->ssa_var, 0, p->var, dump_flags); if (p->pi < 0) { fprintf(stderr, " = Phi("); @@ -945,11 +905,7 @@ void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_flags, cons fprintf(stderr, "\n"); zend_dump_op_array_name(op_array); - fprintf(stderr, ":"); - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, "\n "); - } - fprintf(stderr, " ; (lines=%d, args=%d", + fprintf(stderr, ":\n ; (lines=%d, args=%d", op_array->last, op_array->num_args); if (func_info && func_info->num_args >= 0) { @@ -1008,24 +964,15 @@ void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_flags, cons } fprintf(stderr, ")\n"); if (msg) { - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " "); - } - fprintf(stderr, " ; (%s)\n", msg); - } - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " "); + fprintf(stderr, " ; (%s)\n", msg); } - fprintf(stderr, " ; %s:%u-%u\n", op_array->filename->val, op_array->line_start, op_array->line_end); + fprintf(stderr, " ; %s:%u-%u\n", op_array->filename->val, op_array->line_start, op_array->line_end); if (func_info && func_info->num_args > 0) { uint32_t j; for (j = 0; j < MIN(op_array->num_args, func_info->num_args ); j++) { - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " "); - } - fprintf(stderr, " ; arg %d ", j); + fprintf(stderr, " ; arg %d ", j); zend_dump_type_info(func_info->arg_info[j].info.type, func_info->arg_info[j].info.ce, func_info->arg_info[j].info.is_instanceof, dump_flags); zend_dump_range(&func_info->arg_info[j].info.range); fprintf(stderr, "\n"); @@ -1033,10 +980,7 @@ void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_flags, cons } if (func_info) { - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " "); - } - fprintf(stderr, " ; return "); + fprintf(stderr, " ; return "); zend_dump_type_info(func_info->return_info.type, func_info->return_info.ce, func_info->return_info.is_instanceof, dump_flags); zend_dump_range(&func_info->return_info.range); fprintf(stderr, "\n"); @@ -1044,10 +988,7 @@ void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_flags, cons if (ssa && ssa->var_info) { for (i = 0; i < op_array->last_var; i++) { - if (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) { - fprintf(stderr, " "); - } - fprintf(stderr, " ; "); + fprintf(stderr, " ; "); zend_dump_ssa_var(op_array, ssa, i, IS_CV, i, dump_flags); fprintf(stderr, "\n"); } @@ -1076,9 +1017,7 @@ void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_flags, cons fprintf(stderr, "LIVE RANGES:\n"); for (i = 0; i < op_array->last_live_range; i++) { fprintf(stderr, - (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) ? - " %u: %04u - %04u " : - " %u: L%u - L%u ", + " %u: %04u - %04u ", EX_VAR_TO_NUM(op_array->live_range[i].var & ~ZEND_LIVE_MASK), op_array->live_range[i].start, op_array->live_range[i].end); @@ -1138,9 +1077,7 @@ void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_flags, cons fprintf(stderr, "LIVE RANGES:\n"); for (i = 0; i < op_array->last_live_range; i++) { fprintf(stderr, - (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) ? - " %u: %04u - %04u " : - " %u: L%u - L%u ", + " %u: %04u - %04u ", EX_VAR_TO_NUM(op_array->live_range[i].var & ~ZEND_LIVE_MASK), op_array->live_range[i].start, op_array->live_range[i].end); @@ -1167,34 +1104,26 @@ void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_flags, cons fprintf(stderr, "EXCEPTION TABLE:\n"); for (i = 0; i < op_array->last_try_catch; i++) { fprintf(stderr, - (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) ? - " %04u" : - " L%u", + " %04u", op_array->try_catch_array[i].try_op); if (op_array->try_catch_array[i].catch_op) { fprintf(stderr, - (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) ? - ", %04u" : - ", L%u", + ", %04u", op_array->try_catch_array[i].catch_op); } else { fprintf(stderr, ", -"); } if (op_array->try_catch_array[i].finally_op) { fprintf(stderr, - (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) ? - ", %04u" : - ", L%u", + ", %04u", op_array->try_catch_array[i].finally_op); } else { fprintf(stderr, ", -"); } if (op_array->try_catch_array[i].finally_end) { fprintf(stderr, - (dump_flags & ZEND_DUMP_NUMERIC_OPLINES) ? - ", %04u" : - ", L%u\n", + ", %04u", op_array->try_catch_array[i].finally_end); } else { fprintf(stderr, ", -\n"); diff --git a/ext/opcache/Optimizer/zend_dump.h b/ext/opcache/Optimizer/zend_dump.h index 669ac69980..3d8ff7ad7a 100644 --- a/ext/opcache/Optimizer/zend_dump.h +++ b/ext/opcache/Optimizer/zend_dump.h @@ -27,7 +27,6 @@ #define ZEND_DUMP_CFG (1<<2) #define ZEND_DUMP_SSA (1<<3) #define ZEND_DUMP_LIVE_RANGES (1<<4) -#define ZEND_DUMP_NUMERIC_OPLINES (1<<5) BEGIN_EXTERN_C() diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 6f03d0fa5a..70c60e7bff 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -3066,7 +3066,7 @@ static int zend_real_jit_func(zend_op_array *op_array, zend_script *script, cons } if (ZCG(accel_directives).jit_debug & ZEND_JIT_DEBUG_SSA) { - zend_dump_op_array(op_array, ZEND_DUMP_NUMERIC_OPLINES|ZEND_DUMP_HIDE_UNREACHABLE|ZEND_DUMP_RC_INFERENCE|ZEND_DUMP_SSA, "JIT", &ssa); + zend_dump_op_array(op_array, ZEND_DUMP_HIDE_UNREACHABLE|ZEND_DUMP_RC_INFERENCE|ZEND_DUMP_SSA, "JIT", &ssa); } if (zend_jit(op_array, &ssa, rt_opline) != SUCCESS) { @@ -3380,7 +3380,7 @@ ZEND_EXT_API int zend_jit_script(zend_script *script) } info = ZEND_FUNC_INFO(call_graph.op_arrays[i]); if (info) { - zend_dump_op_array(call_graph.op_arrays[i], ZEND_DUMP_NUMERIC_OPLINES|ZEND_DUMP_HIDE_UNREACHABLE|ZEND_DUMP_RC_INFERENCE|ZEND_DUMP_SSA, "JIT", &info->ssa); + zend_dump_op_array(call_graph.op_arrays[i], ZEND_DUMP_HIDE_UNREACHABLE|ZEND_DUMP_RC_INFERENCE|ZEND_DUMP_SSA, "JIT", &info->ssa); } } } diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 03b990f535..34878a8ade 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -445,7 +445,7 @@ static zend_ssa *zend_jit_trace_build_ssa(const zend_op_array *op_array, zend_sc } if (ZCG(accel_directives).jit_debug & ZEND_JIT_DEBUG_SSA) { - zend_dump_op_array(op_array, ZEND_DUMP_NUMERIC_OPLINES|ZEND_DUMP_HIDE_UNREACHABLE|ZEND_DUMP_RC_INFERENCE|ZEND_DUMP_SSA, "JIT", ssa); + zend_dump_op_array(op_array, ZEND_DUMP_HIDE_UNREACHABLE|ZEND_DUMP_RC_INFERENCE|ZEND_DUMP_SSA, "JIT", ssa); } return ssa; } while (0); @@ -3360,7 +3360,7 @@ static void zend_jit_dump_trace(zend_jit_trace_rec *trace_buffer, zend_ssa *tssa fprintf(stderr, "%04d%*c", (int)(opline - op_array->opcodes), level, ' '); - zend_dump_op(op_array, NULL, opline, ZEND_DUMP_NUMERIC_OPLINES|ZEND_DUMP_RC_INFERENCE, tssa, (tssa && tssa->ops) ? tssa->ops + idx : NULL); + zend_dump_op(op_array, NULL, opline, ZEND_DUMP_RC_INFERENCE, tssa, (tssa && tssa->ops) ? tssa->ops + idx : NULL); op1_type = p->op1_type; op2_type = p->op2_type; @@ -3404,7 +3404,7 @@ static void zend_jit_dump_trace(zend_jit_trace_rec *trace_buffer, zend_ssa *tssa fprintf(stderr, "%04d%*c;", (int)(opline - op_array->opcodes), level, ' '); - zend_dump_op(op_array, NULL, opline, ZEND_DUMP_NUMERIC_OPLINES|ZEND_DUMP_RC_INFERENCE, tssa, (tssa && tssa->ops) ? tssa->ops + idx : NULL); + zend_dump_op(op_array, NULL, opline, ZEND_DUMP_RC_INFERENCE, tssa, (tssa && tssa->ops) ? tssa->ops + idx : NULL); idx++; len--; fprintf(stderr, "\n"); diff --git a/ext/opcache/tests/opt/coalesce.phpt b/ext/opcache/tests/opt/coalesce.phpt index 0135b0df7d..94934fe602 100644 --- a/ext/opcache/tests/opt/coalesce.phpt +++ b/ext/opcache/tests/opt/coalesce.phpt @@ -22,19 +22,22 @@ function b() { ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %s -L0 (14): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %s +0000 RETURN int(1) -a: ; (lines=2, args=0, vars=1, tmps=1) - ; (after optimizer) - ; %s -L0 (4): T1 = COALESCE CV0($test) L1 -L1 (5): RETURN bool(true) +a: + ; (lines=2, args=0, vars=1, tmps=1) + ; (after optimizer) + ; %s +0000 T1 = COALESCE CV0($test) 0001 +0001 RETURN bool(true) -b: ; (lines=2, args=0, vars=1, tmps=1) - ; (after optimizer) - ; %s -L0 (9): T1 = COALESCE CV0($test) L1 -L1 (10): RETURN bool(true) +b: + ; (lines=2, args=0, vars=1, tmps=1) + ; (after optimizer) + ; %s +0000 T1 = COALESCE CV0($test) 0001 +0001 RETURN bool(true) diff --git a/ext/opcache/tests/opt/dce_001.phpt b/ext/opcache/tests/opt/dce_001.phpt index 77a3da6809..d3578f1791 100644 --- a/ext/opcache/tests/opt/dce_001.phpt +++ b/ext/opcache/tests/opt/dce_001.phpt @@ -17,16 +17,18 @@ function foo(string $s1, string $s2, string $s3, string $s4) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %sdce_001.php:1-8 -L0 (8): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %sdce_001.php:1-8 +0000 RETURN int(1) -foo: ; (lines=5, args=4, vars=4, tmps=0) - ; (after optimizer) - ; %sdce_001.php:2-6 -L0 (2): CV0($s1) = RECV 1 -L1 (2): CV1($s2) = RECV 2 -L2 (2): CV2($s3) = RECV 3 -L3 (2): CV3($s4) = RECV 4 -L4 (5): RETURN int(0) +foo: + ; (lines=5, args=4, vars=4, tmps=0) + ; (after optimizer) + ; %sdce_001.php:2-6 +0000 CV0($s1) = RECV 1 +0001 CV1($s2) = RECV 2 +0002 CV2($s3) = RECV 3 +0003 CV3($s4) = RECV 4 +0004 RETURN int(0) diff --git a/ext/opcache/tests/opt/dce_002.phpt b/ext/opcache/tests/opt/dce_002.phpt index 002ada627d..73b1902079 100644 --- a/ext/opcache/tests/opt/dce_002.phpt +++ b/ext/opcache/tests/opt/dce_002.phpt @@ -20,16 +20,18 @@ function foo(int $a) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %sdce_002.php:1-11 -L0 (11): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %sdce_002.php:1-11 +0000 RETURN int(1) -foo: ; (lines=5, args=1, vars=2, tmps=0) - ; (after optimizer) - ; %sdce_002.php:2-9 -L0 (2): CV0($a) = RECV 1 -L1 (3): CV0($a) = QM_ASSIGN int(10) -L2 (5): CV1($x) = FUNC_GET_ARGS -L3 (6): CV0($a) = QM_ASSIGN int(30) -L4 (8): RETURN CV1($x) +foo: + ; (lines=5, args=1, vars=2, tmps=0) + ; (after optimizer) + ; %sdce_002.php:2-9 +0000 CV0($a) = RECV 1 +0001 CV0($a) = QM_ASSIGN int(10) +0002 CV1($x) = FUNC_GET_ARGS +0003 CV0($a) = QM_ASSIGN int(30) +0004 RETURN CV1($x) diff --git a/ext/opcache/tests/opt/dce_003.phpt b/ext/opcache/tests/opt/dce_003.phpt index a60e982b95..f31b2b2075 100644 --- a/ext/opcache/tests/opt/dce_003.phpt +++ b/ext/opcache/tests/opt/dce_003.phpt @@ -16,14 +16,16 @@ function foo(int $a) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %sdce_003.php:1-7 -L0 (7): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %sdce_003.php:1-7 +0000 RETURN int(1) -foo: ; (lines=3, args=1, vars=1, tmps=0) - ; (after optimizer) - ; %sdce_003.php:2-5 -L0 (2): CV0($a) = RECV 1 -L1 (3): CV0($a) = ADD CV0($a) int(3) -L2 (4): RETURN CV0($a) +foo: + ; (lines=3, args=1, vars=1, tmps=0) + ; (after optimizer) + ; %sdce_003.php:2-5 +0000 CV0($a) = RECV 1 +0001 CV0($a) = ADD CV0($a) int(3) +0002 RETURN CV0($a) diff --git a/ext/opcache/tests/opt/dce_004.phpt b/ext/opcache/tests/opt/dce_004.phpt index d595c17acb..40d6e19eef 100644 --- a/ext/opcache/tests/opt/dce_004.phpt +++ b/ext/opcache/tests/opt/dce_004.phpt @@ -17,15 +17,17 @@ function foo(int $x, int $y) { return $a; } --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %sdce_004.php:1-8 -L0 (8): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %sdce_004.php:1-8 +0000 RETURN int(1) -foo: ; (lines=4, args=2, vars=3, tmps=0) - ; (after optimizer) - ; %sdce_004.php:2-7 -L0 (2): CV0($x) = RECV 1 -L1 (2): CV1($y) = RECV 2 -L2 (5): CV2($a) = QM_ASSIGN CV1($y) -L3 (6): RETURN CV2($a) +foo: + ; (lines=4, args=2, vars=3, tmps=0) + ; (after optimizer) + ; %sdce_004.php:2-7 +0000 CV0($x) = RECV 1 +0001 CV1($y) = RECV 2 +0002 CV2($a) = QM_ASSIGN CV1($y) +0003 RETURN CV2($a) diff --git a/ext/opcache/tests/opt/dce_005.phpt b/ext/opcache/tests/opt/dce_005.phpt index 294cf92b33..c998e30482 100644 --- a/ext/opcache/tests/opt/dce_005.phpt +++ b/ext/opcache/tests/opt/dce_005.phpt @@ -17,13 +17,15 @@ function foo(int $x) { $a->foo = $x; } --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %sdce_005.php:1-8 -L0 (8): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %sdce_005.php:1-8 +0000 RETURN int(1) -foo: ; (lines=2, args=1, vars=1, tmps=0) - ; (after optimizer) - ; %sdce_005.php:4-7 -L0 (4): CV0($x) = RECV 1 -L1 (7): RETURN null +foo: + ; (lines=2, args=1, vars=1, tmps=0) + ; (after optimizer) + ; %sdce_005.php:4-7 +0000 CV0($x) = RECV 1 +0001 RETURN null diff --git a/ext/opcache/tests/opt/dce_006.phpt b/ext/opcache/tests/opt/dce_006.phpt index c595f9088d..a6ff4fe4cf 100644 --- a/ext/opcache/tests/opt/dce_006.phpt +++ b/ext/opcache/tests/opt/dce_006.phpt @@ -18,25 +18,28 @@ function foo(int $x) { $a->foo = $x; } --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %sdce_006.php:1-9 -L0 (9): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %sdce_006.php:1-9 +0000 RETURN int(1) -foo: ; (lines=7, args=1, vars=2, tmps=1) - ; (after optimizer) - ; %sdce_006.php:5-8 -L0 (5): CV0($x) = RECV 1 -L1 (6): V2 = NEW 0 string("A") -L2 (6): DO_FCALL -L3 (6): CV1($a) = QM_ASSIGN V2 -L4 (7): ASSIGN_OBJ CV1($a) string("foo") -L5 (7): OP_DATA CV0($x) -L6 (8): RETURN null +foo: + ; (lines=7, args=1, vars=2, tmps=1) + ; (after optimizer) + ; %sdce_006.php:5-8 +0000 CV0($x) = RECV 1 +0001 V2 = NEW 0 string("A") +0002 DO_FCALL +0003 CV1($a) = QM_ASSIGN V2 +0004 ASSIGN_OBJ CV1($a) string("foo") +0005 OP_DATA CV0($x) +0006 RETURN null LIVE RANGES: - 2: L2 - L3 (new) + 2: 0002 - 0003 (new) -A::__destruct: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %sdce_006.php:3-3 -L0 (3): RETURN null +A::__destruct: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %sdce_006.php:3-3 +0000 RETURN null diff --git a/ext/opcache/tests/opt/dce_007.phpt b/ext/opcache/tests/opt/dce_007.phpt index a3ae04edd9..3e3f7c532a 100644 --- a/ext/opcache/tests/opt/dce_007.phpt +++ b/ext/opcache/tests/opt/dce_007.phpt @@ -16,14 +16,16 @@ function esc($x) { return $a; } --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %sdce_007.php:1-7 -L0 (7): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %sdce_007.php:1-7 +0000 RETURN int(1) -esc: ; (lines=3, args=1, vars=2, tmps=0) - ; (after optimizer) - ; %sdce_007.php:2-6 -L0 (2): CV0($x) = RECV 1 -L1 (3): CV1($a) = INIT_ARRAY 1 (packed) CV0($x) NEXT -L2 (5): RETURN CV1($a) +esc: + ; (lines=3, args=1, vars=2, tmps=0) + ; (after optimizer) + ; %sdce_007.php:2-6 +0000 CV0($x) = RECV 1 +0001 CV1($a) = INIT_ARRAY 1 (packed) CV0($x) NEXT +0002 RETURN CV1($a) diff --git a/ext/opcache/tests/opt/dce_008.phpt b/ext/opcache/tests/opt/dce_008.phpt index 3b697ee203..39dda38722 100644 --- a/ext/opcache/tests/opt/dce_008.phpt +++ b/ext/opcache/tests/opt/dce_008.phpt @@ -16,15 +16,17 @@ function esc(int $x) { return $a; } --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %sdce_008.php:1-7 -L0 (7): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %sdce_008.php:1-7 +0000 RETURN int(1) -esc: ; (lines=4, args=1, vars=2, tmps=0) - ; (after optimizer) - ; %sdce_008.php:2-6 -L0 (2): CV0($x) = RECV 1 -L1 (3): ASSIGN_DIM CV1($a) int(0) -L2 (3): OP_DATA CV0($x) -L3 (5): RETURN CV1($a) +esc: + ; (lines=4, args=1, vars=2, tmps=0) + ; (after optimizer) + ; %sdce_008.php:2-6 +0000 CV0($x) = RECV 1 +0001 ASSIGN_DIM CV1($a) int(0) +0002 OP_DATA CV0($x) +0003 RETURN CV1($a) diff --git a/ext/opcache/tests/opt/jmp_001.phpt b/ext/opcache/tests/opt/jmp_001.phpt index 3ec84ed658..e37a080d15 100644 --- a/ext/opcache/tests/opt/jmp_001.phpt +++ b/ext/opcache/tests/opt/jmp_001.phpt @@ -16,15 +16,17 @@ function test() { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %s:1-8 -L0 (8): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %s:1-8 +0000 RETURN int(1) -test: ; (lines=4, args=0, vars=1, tmps=1) - ; (after optimizer) - ; %s:2-6 -L0 (4): INIT_FCALL_BY_NAME 0 string("test2") -L1 (4): V1 = DO_FCALL_BY_NAME -L2 (4): CV0($var) = QM_ASSIGN V1 -L3 (5): RETURN CV0($var) +test: + ; (lines=4, args=0, vars=1, tmps=1) + ; (after optimizer) + ; %s:2-6 +0000 INIT_FCALL_BY_NAME 0 string("test2") +0001 V1 = DO_FCALL_BY_NAME +0002 CV0($var) = QM_ASSIGN V1 +0003 RETURN CV0($var) diff --git a/ext/opcache/tests/opt/prop_types.phpt b/ext/opcache/tests/opt/prop_types.phpt index 33cb5fa033..c5858999d0 100644 --- a/ext/opcache/tests/opt/prop_types.phpt +++ b/ext/opcache/tests/opt/prop_types.phpt @@ -39,78 +39,88 @@ function noScope(Test $test) { ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0, ssa_vars=0, no_loops) - ; (before dfa pass) - ; %s - ; return [long] RANGE[1..1] -BB0: start exit lines=[0-0] - ; level=0 - RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0, ssa_vars=0, no_loops) + ; (before dfa pass) + ; %s + ; return [long] RANGE[1..1] +BB0: + ; start exit lines=[0-0] + ; level=0 +0000 RETURN int(1) -noScope: ; (lines=10, args=1, vars=1, tmps=1, ssa_vars=5, no_loops) - ; (before dfa pass) - ; %s - ; return [null] RANGE[0..0] - ; #0.CV0($test) NOVAL [undef] -BB0: start exit lines=[0-9] - ; level=0 - #1.CV0($test) [object (instanceof Test)] = RECV 1 - INIT_FCALL 3 %d string("var_dump") - #2.T1 [bool] = FETCH_OBJ_R #1.CV0($test) [object (instanceof Test)] string("public") - SEND_VAL #2.T1 [bool] 1 - #3.T1 [any] = FETCH_OBJ_R #1.CV0($test) [object (instanceof Test)] string("protected") - SEND_VAL #3.T1 [any] 2 - #4.T1 [any] = FETCH_OBJ_R #1.CV0($test) [object (instanceof Test)] string("private") - SEND_VAL #4.T1 [any] 3 - DO_ICALL - RETURN null +noScope: + ; (lines=10, args=1, vars=1, tmps=1, ssa_vars=5, no_loops) + ; (before dfa pass) + ; %s + ; return [null] RANGE[0..0] + ; #0.CV0($test) NOVAL [undef] +BB0: + ; start exit lines=[0-9] + ; level=0 +0000 #1.CV0($test) [object (instanceof Test)] = RECV 1 +0001 INIT_FCALL 3 %d string("var_dump") +0002 #2.T1 [bool] = FETCH_OBJ_R #1.CV0($test) [object (instanceof Test)] string("public") +0003 SEND_VAL #2.T1 [bool] 1 +0004 #3.T1 [any] = FETCH_OBJ_R #1.CV0($test) [object (instanceof Test)] string("protected") +0005 SEND_VAL #3.T1 [any] 2 +0006 #4.T1 [any] = FETCH_OBJ_R #1.CV0($test) [object (instanceof Test)] string("private") +0007 SEND_VAL #4.T1 [any] 3 +0008 DO_ICALL +0009 RETURN null -Test::inTest: ; (lines=9, args=0, vars=0, tmps=1, ssa_vars=3, no_loops) - ; (before dfa pass) - ; %s - ; return [null] RANGE[0..0] -BB0: start exit lines=[0-8] - ; level=0 - INIT_FCALL 3 %d string("var_dump") - #0.T0 [bool] = FETCH_OBJ_R THIS string("public") - SEND_VAL #0.T0 [bool] 1 - #1.T0 [long] = FETCH_OBJ_R THIS string("protected") - SEND_VAL #1.T0 [long] 2 - #2.T0 [double] = FETCH_OBJ_R THIS string("private") - SEND_VAL #2.T0 [double] 3 - DO_ICALL - RETURN null +Test::inTest: + ; (lines=9, args=0, vars=0, tmps=1, ssa_vars=3, no_loops) + ; (before dfa pass) + ; %s + ; return [null] RANGE[0..0] +BB0: + ; start exit lines=[0-8] + ; level=0 +0000 INIT_FCALL 3 %d string("var_dump") +0001 #0.T0 [bool] = FETCH_OBJ_R THIS string("public") +0002 SEND_VAL #0.T0 [bool] 1 +0003 #1.T0 [long] = FETCH_OBJ_R THIS string("protected") +0004 SEND_VAL #1.T0 [long] 2 +0005 #2.T0 [double] = FETCH_OBJ_R THIS string("private") +0006 SEND_VAL #2.T0 [double] 3 +0007 DO_ICALL +0008 RETURN null -Test::inTestWithTest2: ; (lines=10, args=1, vars=1, tmps=1, ssa_vars=5, no_loops) - ; (before dfa pass) - ; %s - ; return [null] RANGE[0..0] - ; #0.CV0($test2) NOVAL [undef] -BB0: start exit lines=[0-9] - ; level=0 - #1.CV0($test2) [object (instanceof Test2)] = RECV 1 - INIT_FCALL 3 %d string("var_dump") - #2.T1 [bool] = FETCH_OBJ_R #1.CV0($test2) [object (instanceof Test2)] string("public") - SEND_VAL #2.T1 [bool] 1 - #3.T1 [long] = FETCH_OBJ_R #1.CV0($test2) [object (instanceof Test2)] string("protected") - SEND_VAL #3.T1 [long] 2 - #4.T1 [double] = FETCH_OBJ_R #1.CV0($test2) [object (instanceof Test2)] string("private") - SEND_VAL #4.T1 [double] 3 - DO_ICALL - RETURN null +Test::inTestWithTest2: + ; (lines=10, args=1, vars=1, tmps=1, ssa_vars=5, no_loops) + ; (before dfa pass) + ; %s + ; return [null] RANGE[0..0] + ; #0.CV0($test2) NOVAL [undef] +BB0: + ; start exit lines=[0-9] + ; level=0 +0000 #1.CV0($test2) [object (instanceof Test2)] = RECV 1 +0001 INIT_FCALL 3 %d string("var_dump") +0002 #2.T1 [bool] = FETCH_OBJ_R #1.CV0($test2) [object (instanceof Test2)] string("public") +0003 SEND_VAL #2.T1 [bool] 1 +0004 #3.T1 [long] = FETCH_OBJ_R #1.CV0($test2) [object (instanceof Test2)] string("protected") +0005 SEND_VAL #3.T1 [long] 2 +0006 #4.T1 [double] = FETCH_OBJ_R #1.CV0($test2) [object (instanceof Test2)] string("private") +0007 SEND_VAL #4.T1 [double] 3 +0008 DO_ICALL +0009 RETURN null -Test2::inTest2: ; (lines=9, args=0, vars=0, tmps=1, ssa_vars=3, no_loops) - ; (before dfa pass) - ; %s - ; return [null] RANGE[0..0] -BB0: start exit lines=[0-8] - ; level=0 - INIT_FCALL 3 %d string("var_dump") - #0.T0 [bool] = FETCH_OBJ_R THIS string("public") - SEND_VAL #0.T0 [bool] 1 - #1.T0 [long] = FETCH_OBJ_R THIS string("protected") - SEND_VAL #1.T0 [long] 2 - #2.T0 [array of [any, ref]] = FETCH_OBJ_R THIS string("private") - SEND_VAL #2.T0 [array of [any, ref]] 3 - DO_ICALL - RETURN null +Test2::inTest2: + ; (lines=9, args=0, vars=0, tmps=1, ssa_vars=3, no_loops) + ; (before dfa pass) + ; %s + ; return [null] RANGE[0..0] +BB0: + ; start exit lines=[0-8] + ; level=0 +0000 INIT_FCALL 3 %d string("var_dump") +0001 #0.T0 [bool] = FETCH_OBJ_R THIS string("public") +0002 SEND_VAL #0.T0 [bool] 1 +0003 #1.T0 [long] = FETCH_OBJ_R THIS string("protected") +0004 SEND_VAL #1.T0 [long] 2 +0005 #2.T0 [array of [any, ref]] = FETCH_OBJ_R THIS string("private") +0006 SEND_VAL #2.T0 [array of [any, ref]] 3 +0007 DO_ICALL +0008 RETURN null diff --git a/ext/opcache/tests/opt/sccp_001.phpt b/ext/opcache/tests/opt/sccp_001.phpt index d7cb8c700a..d55f0a9984 100644 --- a/ext/opcache/tests/opt/sccp_001.phpt +++ b/ext/opcache/tests/opt/sccp_001.phpt @@ -18,12 +18,14 @@ function foo() { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_001.php:1-9 -L0 (9): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_001.php:1-9 +0000 RETURN int(1) -foo: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_001.php:2-7 -L0 (6): RETURN int(4) +foo: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_001.php:2-7 +0000 RETURN int(4) diff --git a/ext/opcache/tests/opt/sccp_002.phpt b/ext/opcache/tests/opt/sccp_002.phpt index ff00281a03..500855b3f1 100644 --- a/ext/opcache/tests/opt/sccp_002.phpt +++ b/ext/opcache/tests/opt/sccp_002.phpt @@ -23,15 +23,17 @@ function foo(int $x) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_002.php:1-14 -L0 (14): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_002.php:1-14 +0000 RETURN int(1) -foo: ; (lines=4, args=1, vars=1, tmps=0) - ; (after optimizer) - ; %ssccp_002.php:2-12 -L0 (2): CV0($x) = RECV 1 -L1 (9): ECHO string("1") -L2 (11): ECHO string("1") -L3 (12): RETURN null +foo: + ; (lines=4, args=1, vars=1, tmps=0) + ; (after optimizer) + ; %ssccp_002.php:2-12 +0000 CV0($x) = RECV 1 +0001 ECHO string("1") +0002 ECHO string("1") +0003 RETURN null diff --git a/ext/opcache/tests/opt/sccp_003.phpt b/ext/opcache/tests/opt/sccp_003.phpt index a0ac2e0236..46dc4ae7d8 100644 --- a/ext/opcache/tests/opt/sccp_003.phpt +++ b/ext/opcache/tests/opt/sccp_003.phpt @@ -23,14 +23,16 @@ function foo() { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_003.php:1-14 -L0 (14): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_003.php:1-14 +0000 RETURN int(1) -foo: ; (lines=3, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_003.php:2-12 -L0 (9): ECHO string("1") -L1 (11): ECHO string("1") -L2 (12): RETURN null +foo: + ; (lines=3, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_003.php:2-12 +0000 ECHO string("1") +0001 ECHO string("1") +0002 RETURN null diff --git a/ext/opcache/tests/opt/sccp_004.phpt b/ext/opcache/tests/opt/sccp_004.phpt index 659e3488c1..4d1b2a4843 100644 --- a/ext/opcache/tests/opt/sccp_004.phpt +++ b/ext/opcache/tests/opt/sccp_004.phpt @@ -26,15 +26,17 @@ function foo(int $x) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_004.php:1-17 -L0 (17): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_004.php:1-17 +0000 RETURN int(1) -foo: ; (lines=4, args=1, vars=1, tmps=0) - ; (after optimizer) - ; %ssccp_004.php:2-15 -L0 (2): CV0($x) = RECV 1 -L1 (11): ECHO string("1") -L2 (14): ECHO string("1") -L3 (15): RETURN null +foo: + ; (lines=4, args=1, vars=1, tmps=0) + ; (after optimizer) + ; %ssccp_004.php:2-15 +0000 CV0($x) = RECV 1 +0001 ECHO string("1") +0002 ECHO string("1") +0003 RETURN null diff --git a/ext/opcache/tests/opt/sccp_005.phpt b/ext/opcache/tests/opt/sccp_005.phpt index 4fb86eacc0..8f83b42399 100644 --- a/ext/opcache/tests/opt/sccp_005.phpt +++ b/ext/opcache/tests/opt/sccp_005.phpt @@ -16,14 +16,16 @@ function foo(int $x) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_005.php:1-7 -L0 (7): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_005.php:1-7 +0000 RETURN int(1) -foo: ; (lines=3, args=1, vars=1, tmps=0) - ; (after optimizer) - ; %ssccp_005.php:2-5 -L0 (2): CV0($x) = RECV 1 -L1 (4): ECHO string("2") -L2 (5): RETURN null +foo: + ; (lines=3, args=1, vars=1, tmps=0) + ; (after optimizer) + ; %ssccp_005.php:2-5 +0000 CV0($x) = RECV 1 +0001 ECHO string("2") +0002 RETURN null diff --git a/ext/opcache/tests/opt/sccp_006.phpt b/ext/opcache/tests/opt/sccp_006.phpt index bc24ebbfb2..d1cf79d760 100644 --- a/ext/opcache/tests/opt/sccp_006.phpt +++ b/ext/opcache/tests/opt/sccp_006.phpt @@ -16,21 +16,23 @@ function foo(int $x) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_006.php:1-7 -L0 (7): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_006.php:1-7 +0000 RETURN int(1) -foo: ; (lines=8, args=1, vars=2, tmps=1) - ; (after optimizer) - ; %ssccp_006.php:2-5 -L0 (2): CV0($x) = RECV 1 -L1 (3): T2 = INIT_ARRAY 3 int(1) string("a") -L2 (3): T2 = ADD_ARRAY_ELEMENT int(2) string("a") -L3 (3): T2 = ADD_ARRAY_ELEMENT CV0($x) string("a") -L4 (3): CV1($a) = QM_ASSIGN T2 -L5 (4): T2 = FETCH_DIM_R CV1($a) string("a") -L6 (4): ECHO T2 -L7 (5): RETURN null +foo: + ; (lines=8, args=1, vars=2, tmps=1) + ; (after optimizer) + ; %ssccp_006.php:2-5 +0000 CV0($x) = RECV 1 +0001 T2 = INIT_ARRAY 3 int(1) string("a") +0002 T2 = ADD_ARRAY_ELEMENT int(2) string("a") +0003 T2 = ADD_ARRAY_ELEMENT CV0($x) string("a") +0004 CV1($a) = QM_ASSIGN T2 +0005 T2 = FETCH_DIM_R CV1($a) string("a") +0006 ECHO T2 +0007 RETURN null LIVE RANGES: - 2: L2 - L4 (tmp/var) + 2: 0002 - 0004 (tmp/var) diff --git a/ext/opcache/tests/opt/sccp_007.phpt b/ext/opcache/tests/opt/sccp_007.phpt index 44ff01e640..1850b3b73f 100644 --- a/ext/opcache/tests/opt/sccp_007.phpt +++ b/ext/opcache/tests/opt/sccp_007.phpt @@ -20,14 +20,16 @@ function foo(int $x) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_007.php:1-11 -L0 (11): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_007.php:1-11 +0000 RETURN int(1) -foo: ; (lines=3, args=1, vars=1, tmps=0) - ; (after optimizer) - ; %ssccp_007.php:2-9 -L0 (2): CV0($x) = RECV 1 -L1 (8): ECHO string("0") -L2 (9): RETURN null +foo: + ; (lines=3, args=1, vars=1, tmps=0) + ; (after optimizer) + ; %ssccp_007.php:2-9 +0000 CV0($x) = RECV 1 +0001 ECHO string("0") +0002 RETURN null diff --git a/ext/opcache/tests/opt/sccp_008.phpt b/ext/opcache/tests/opt/sccp_008.phpt index a5ba8a7d22..bb4f6895d8 100644 --- a/ext/opcache/tests/opt/sccp_008.phpt +++ b/ext/opcache/tests/opt/sccp_008.phpt @@ -20,19 +20,21 @@ function foo(int $x) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_008.php:1-11 -L0 (11): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_008.php:1-11 +0000 RETURN int(1) -foo: ; (lines=8, args=1, vars=2, tmps=1) - ; (after optimizer) - ; %ssccp_008.php:2-9 -L0 (2): CV0($x) = RECV 1 -L1 (3): JMPZ CV0($x) L4 -L2 (4): CV1($a) = QM_ASSIGN array(...) -L3 (4): JMP L5 -L4 (6): CV1($a) = QM_ASSIGN array(...) -L5 (8): T2 = FETCH_DIM_R CV1($a) int(1) -L6 (8): ECHO T2 -L7 (9): RETURN null +foo: + ; (lines=8, args=1, vars=2, tmps=1) + ; (after optimizer) + ; %ssccp_008.php:2-9 +0000 CV0($x) = RECV 1 +0001 JMPZ CV0($x) 0004 +0002 CV1($a) = QM_ASSIGN array(...) +0003 JMP 0005 +0004 CV1($a) = QM_ASSIGN array(...) +0005 T2 = FETCH_DIM_R CV1($a) int(1) +0006 ECHO T2 +0007 RETURN null diff --git a/ext/opcache/tests/opt/sccp_009.phpt b/ext/opcache/tests/opt/sccp_009.phpt index 601586fd64..17c6b57f33 100644 --- a/ext/opcache/tests/opt/sccp_009.phpt +++ b/ext/opcache/tests/opt/sccp_009.phpt @@ -17,14 +17,16 @@ function foo(int $x) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_009.php:1-8 -L0 (8): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_009.php:1-8 +0000 RETURN int(1) -foo: ; (lines=3, args=1, vars=1, tmps=0) - ; (after optimizer) - ; %ssccp_009.php:2-6 -L0 (2): CV0($x) = RECV 1 -L1 (5): ECHO string("2") -L2 (6): RETURN null +foo: + ; (lines=3, args=1, vars=1, tmps=0) + ; (after optimizer) + ; %ssccp_009.php:2-6 +0000 CV0($x) = RECV 1 +0001 ECHO string("2") +0002 RETURN null diff --git a/ext/opcache/tests/opt/sccp_010.phpt b/ext/opcache/tests/opt/sccp_010.phpt index 8943b179e3..1a57c497bf 100644 --- a/ext/opcache/tests/opt/sccp_010.phpt +++ b/ext/opcache/tests/opt/sccp_010.phpt @@ -24,14 +24,16 @@ function foo() { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_010.php:1-15 -L0 (15): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_010.php:1-15 +0000 RETURN int(1) -foo: ; (lines=3, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_010.php:2-13 -L0 (10): ECHO string("1") -L1 (12): ECHO string("1") -L2 (13): RETURN null +foo: + ; (lines=3, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_010.php:2-13 +0000 ECHO string("1") +0001 ECHO string("1") +0002 RETURN null diff --git a/ext/opcache/tests/opt/sccp_011.phpt b/ext/opcache/tests/opt/sccp_011.phpt index 4bd90b18e6..b6dfdfe534 100644 --- a/ext/opcache/tests/opt/sccp_011.phpt +++ b/ext/opcache/tests/opt/sccp_011.phpt @@ -23,14 +23,16 @@ function foo(int $x) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_011.php:1-14 -L0 (14): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_011.php:1-14 +0000 RETURN int(1) -foo: ; (lines=3, args=1, vars=1, tmps=0) - ; (after optimizer) - ; %ssccp_011.php:2-12 -L0 (2): CV0($x) = RECV 1 -L1 (11): ECHO string("0") -L2 (12): RETURN null +foo: + ; (lines=3, args=1, vars=1, tmps=0) + ; (after optimizer) + ; %ssccp_011.php:2-12 +0000 CV0($x) = RECV 1 +0001 ECHO string("0") +0002 RETURN null diff --git a/ext/opcache/tests/opt/sccp_012.phpt b/ext/opcache/tests/opt/sccp_012.phpt index 1ad1ed3b4c..08d271307e 100644 --- a/ext/opcache/tests/opt/sccp_012.phpt +++ b/ext/opcache/tests/opt/sccp_012.phpt @@ -26,14 +26,16 @@ function foo() { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_012.php:1-17 -L0 (17): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_012.php:1-17 +0000 RETURN int(1) -foo: ; (lines=3, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_012.php:2-15 -L0 (10): ECHO string("1") -L1 (14): ECHO string("4") -L2 (15): RETURN null +foo: + ; (lines=3, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_012.php:2-15 +0000 ECHO string("1") +0001 ECHO string("4") +0002 RETURN null diff --git a/ext/opcache/tests/opt/sccp_016.phpt b/ext/opcache/tests/opt/sccp_016.phpt index bceb33e2a0..0ce1bbec1e 100644 --- a/ext/opcache/tests/opt/sccp_016.phpt +++ b/ext/opcache/tests/opt/sccp_016.phpt @@ -13,10 +13,11 @@ opcache.preload= return isset($undef) || php_sapi_name() == php_sapi_name(); ?> --EXPECTF-- -$_main: ; (lines=4, args=0, vars=1, tmps=1) - ; (after optimizer) - ; %ssccp_016.php:1-4 -L0 (2): T1 = ISSET_ISEMPTY_CV (isset) CV0($undef) -L1 (2): T1 = JMPNZ_EX T1 L3 -L2 (2): T1 = QM_ASSIGN bool(true) -L3 (2): RETURN T1 +$_main: + ; (lines=4, args=0, vars=1, tmps=1) + ; (after optimizer) + ; %ssccp_016.php:1-4 +0000 T1 = ISSET_ISEMPTY_CV (isset) CV0($undef) +0001 T1 = JMPNZ_EX T1 0003 +0002 T1 = QM_ASSIGN bool(true) +0003 RETURN T1 diff --git a/ext/opcache/tests/opt/sccp_017.phpt b/ext/opcache/tests/opt/sccp_017.phpt index e72d892bdc..6d068b3371 100644 --- a/ext/opcache/tests/opt/sccp_017.phpt +++ b/ext/opcache/tests/opt/sccp_017.phpt @@ -19,13 +19,15 @@ function foo(int $x) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_017.php:1-10 -L0 (10): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_017.php:1-10 +0000 RETURN int(1) -foo: ; (lines=2, args=1, vars=1, tmps=0) - ; (after optimizer) - ; %ssccp_017.php:2-8 -L0 (2): CV0($x) = RECV 1 -L1 (7): RETURN int(5) +foo: + ; (lines=2, args=1, vars=1, tmps=0) + ; (after optimizer) + ; %ssccp_017.php:2-8 +0000 CV0($x) = RECV 1 +0001 RETURN int(5) diff --git a/ext/opcache/tests/opt/sccp_019.phpt b/ext/opcache/tests/opt/sccp_019.phpt index 3ed2d6bd81..427b6d16a3 100644 --- a/ext/opcache/tests/opt/sccp_019.phpt +++ b/ext/opcache/tests/opt/sccp_019.phpt @@ -18,13 +18,15 @@ function foo(int $x) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_019.php:1-9 -L0 (9): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_019.php:1-9 +0000 RETURN int(1) -foo: ; (lines=2, args=1, vars=1, tmps=0) - ; (after optimizer) - ; %ssccp_019.php:2-7 -L0 (2): CV0($x) = RECV 1 -L1 (6): RETURN int(5) +foo: + ; (lines=2, args=1, vars=1, tmps=0) + ; (after optimizer) + ; %ssccp_019.php:2-7 +0000 CV0($x) = RECV 1 +0001 RETURN int(5) diff --git a/ext/opcache/tests/opt/sccp_022.phpt b/ext/opcache/tests/opt/sccp_022.phpt index c69e57176e..ed40252a2b 100644 --- a/ext/opcache/tests/opt/sccp_022.phpt +++ b/ext/opcache/tests/opt/sccp_022.phpt @@ -19,21 +19,23 @@ function foo(int $x) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_022.php:1-10 -L0 (10): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_022.php:1-10 +0000 RETURN int(1) -foo: ; (lines=10, args=1, vars=2, tmps=1) - ; (after optimizer) - ; %ssccp_022.php:2-8 -L0 (2): CV0($x) = RECV 1 -L1 (3): ASSIGN_DIM CV1($a) int(0) -L2 (3): OP_DATA CV0($x) -L3 (4): ASSIGN_DIM CV1($a) int(1) -L4 (4): OP_DATA int(5) -L5 (5): ECHO string("5") -L6 (6): ASSIGN_OBJ CV1($a) string("foo") -L7 (6): OP_DATA int(5) -L8 (7): T2 = FETCH_DIM_R null int(1) -L9 (8): RETURN null +foo: + ; (lines=10, args=1, vars=2, tmps=1) + ; (after optimizer) + ; %ssccp_022.php:2-8 +0000 CV0($x) = RECV 1 +0001 ASSIGN_DIM CV1($a) int(0) +0002 OP_DATA CV0($x) +0003 ASSIGN_DIM CV1($a) int(1) +0004 OP_DATA int(5) +0005 ECHO string("5") +0006 ASSIGN_OBJ CV1($a) string("foo") +0007 OP_DATA int(5) +0008 T2 = FETCH_DIM_R null int(1) +0009 RETURN null diff --git a/ext/opcache/tests/opt/sccp_024.phpt b/ext/opcache/tests/opt/sccp_024.phpt index bd9a2fed67..0e4cbee76a 100644 --- a/ext/opcache/tests/opt/sccp_024.phpt +++ b/ext/opcache/tests/opt/sccp_024.phpt @@ -22,21 +22,23 @@ class A { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_024.php:1-13 -L0 (13): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_024.php:1-13 +0000 RETURN int(1) -A::t: ; (lines=10, args=1, vars=2, tmps=2) - ; (after optimizer) - ; %ssccp_024.php:3-10 -L0 (3): CV0($obj) = RECV 1 -L1 (6): CV1($c) = QM_ASSIGN int(1) -L2 (7): T2 = INSTANCEOF CV0($obj) string("A") -L3 (7): ECHO T2 -L4 (8): T2 = INSTANCEOF CV0($obj) string("self") -L5 (8): ECHO T2 -L6 (9): V3 = FETCH_CLASS (no-autolod) (exception) CV1($c) -L7 (9): T2 = INSTANCEOF CV0($obj) V3 -L8 (9): ECHO T2 -L9 (10): RETURN null +A::t: + ; (lines=10, args=1, vars=2, tmps=2) + ; (after optimizer) + ; %ssccp_024.php:3-10 +0000 CV0($obj) = RECV 1 +0001 CV1($c) = QM_ASSIGN int(1) +0002 T2 = INSTANCEOF CV0($obj) string("A") +0003 ECHO T2 +0004 T2 = INSTANCEOF CV0($obj) string("self") +0005 ECHO T2 +0006 V3 = FETCH_CLASS (no-autolod) (exception) CV1($c) +0007 T2 = INSTANCEOF CV0($obj) V3 +0008 ECHO T2 +0009 RETURN null diff --git a/ext/opcache/tests/opt/sccp_026.phpt b/ext/opcache/tests/opt/sccp_026.phpt index 6f02a57a5a..7b2ca4b44e 100644 --- a/ext/opcache/tests/opt/sccp_026.phpt +++ b/ext/opcache/tests/opt/sccp_026.phpt @@ -19,20 +19,22 @@ function test($var) { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %s:1-10 -L0 (10): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %s:1-10 +0000 RETURN int(1) -test: ; (lines=9, args=1, vars=2, tmps=1) - ; (after optimizer) - ; %s:2-8 -L0 (2): CV0($var) = RECV 1 -L1 (3): T2 = TYPE_CHECK (string) CV0($var) -L2 (3): JMPZ T2 L4 -L3 (3): JMP L5 -L4 (4): RETURN null -L5 (7): INIT_FCALL 1 %d string("var_dump") -L6 (7): SEND_VAR CV1($username) 1 -L7 (7): DO_ICALL -L8 (8): RETURN null +test: + ; (lines=9, args=1, vars=2, tmps=1) + ; (after optimizer) + ; %s:2-8 +0000 CV0($var) = RECV 1 +0001 T2 = TYPE_CHECK (string) CV0($var) +0002 JMPZ T2 0004 +0003 JMP 0005 +0004 RETURN null +0005 INIT_FCALL 1 %d string("var_dump") +0006 SEND_VAR CV1($username) 1 +0007 DO_ICALL +0008 RETURN null diff --git a/ext/opcache/tests/opt/sccp_031.phpt b/ext/opcache/tests/opt/sccp_031.phpt index b787e7c979..097c96bcf8 100644 --- a/ext/opcache/tests/opt/sccp_031.phpt +++ b/ext/opcache/tests/opt/sccp_031.phpt @@ -22,15 +22,17 @@ function foo() { } ?> --EXPECTF-- -$_main: ; (lines=1, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %ssccp_031.php:1-13 -L0 (13): RETURN int(1) +$_main: + ; (lines=1, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %ssccp_031.php:1-13 +0000 RETURN int(1) -foo: ; (lines=4, args=0, vars=0, tmps=0) - ; (after optimizer) - ; %s_031.php:2-11 -L0 (6): ECHO string("b") -L1 (8): ECHO string("c") -L2 (10): ECHO array(...) -L3 (11): RETURN null +foo: + ; (lines=4, args=0, vars=0, tmps=0) + ; (after optimizer) + ; %s_031.php:2-11 +0000 ECHO string("b") +0001 ECHO string("c") +0002 ECHO array(...) +0003 RETURN null -- 2.40.0