diff options
Diffstat (limited to 'ext/opcache')
-rw-r--r-- | ext/opcache/Optimizer/dce.c | 6 | ||||
-rw-r--r-- | ext/opcache/Optimizer/sccp.c | 12 | ||||
-rw-r--r-- | ext/opcache/Optimizer/zend_cfg.c | 3 | ||||
-rw-r--r-- | ext/opcache/Optimizer/zend_dfg.c | 4 | ||||
-rw-r--r-- | ext/opcache/Optimizer/zend_dump.c | 3 | ||||
-rw-r--r-- | ext/opcache/Optimizer/zend_inference.c | 10 | ||||
-rw-r--r-- | ext/opcache/Optimizer/zend_ssa.c | 10 | ||||
-rw-r--r-- | ext/opcache/Optimizer/zend_ssa.h | 3 |
8 files changed, 18 insertions, 33 deletions
diff --git a/ext/opcache/Optimizer/dce.c b/ext/opcache/Optimizer/dce.c index 2c21154ef7..e3b4285197 100644 --- a/ext/opcache/Optimizer/dce.c +++ b/ext/opcache/Optimizer/dce.c @@ -116,6 +116,7 @@ static inline zend_bool may_have_side_effects( case ZEND_ISSET_ISEMPTY_THIS: case ZEND_ISSET_ISEMPTY_DIM_OBJ: case ZEND_FETCH_DIM_IS: + case ZEND_ISSET_ISEMPTY_CV: case ZEND_ISSET_ISEMPTY_VAR: case ZEND_FETCH_IS: /* No side effects */ @@ -172,11 +173,10 @@ static inline zend_bool may_have_side_effects( return 0; } case ZEND_UNSET_VAR: + return 1; + case ZEND_UNSET_CV: { uint32_t t1 = OP1_INFO(); - if (!(opline->extended_value & ZEND_QUICK_SET)) { - return 1; - } if (t1 & MAY_BE_REF) { /* We don't consider uses as the LHS of an assignment as real uses during DCE, so * an unset may be considered dead even if there is a later assignment to the diff --git a/ext/opcache/Optimizer/sccp.c b/ext/opcache/Optimizer/sccp.c index 1e023f1b1b..06a4406fe8 100644 --- a/ext/opcache/Optimizer/sccp.c +++ b/ext/opcache/Optimizer/sccp.c @@ -192,11 +192,9 @@ static zend_bool can_replace_op1( case ZEND_BIND_STATIC: case ZEND_BIND_GLOBAL: case ZEND_MAKE_REF: + case ZEND_UNSET_CV: + case ZEND_ISSET_ISEMPTY_CV: return 0; - case ZEND_UNSET_VAR: - case ZEND_ISSET_ISEMPTY_VAR: - /* CV has special meaning here - cannot simply be replaced */ - return (opline->extended_value & ZEND_QUICK_SET) == 0; case ZEND_INIT_ARRAY: case ZEND_ADD_ARRAY_ELEMENT: return !(opline->extended_value & ZEND_ARRAY_ELEMENT_REF); @@ -440,10 +438,6 @@ static inline int ct_eval_incdec(zval *result, zend_uchar opcode, zval *op1) { } static inline int ct_eval_isset_isempty(zval *result, uint32_t extended_value, zval *op1) { - if (!(extended_value & ZEND_QUICK_SET)) { - return FAILURE; - } - if (extended_value & ZEND_ISSET) { ZVAL_BOOL(result, Z_TYPE_P(op1) != IS_NULL); } else { @@ -879,7 +873,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o } SET_RESULT(result, op1); break; - case ZEND_ISSET_ISEMPTY_VAR: + case ZEND_ISSET_ISEMPTY_CV: SKIP_IF_TOP(op1); if (ct_eval_isset_isempty(&zv, opline->extended_value, op1) == SUCCESS) { SET_RESULT(result, &zv); diff --git a/ext/opcache/Optimizer/zend_cfg.c b/ext/opcache/Optimizer/zend_cfg.c index 25d0acb6ce..4914c9e45e 100644 --- a/ext/opcache/Optimizer/zend_cfg.c +++ b/ext/opcache/Optimizer/zend_cfg.c @@ -418,8 +418,7 @@ int zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, uint32_t b } case ZEND_UNSET_VAR: case ZEND_ISSET_ISEMPTY_VAR: - if (((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_LOCAL) && - !(opline->extended_value & ZEND_QUICK_SET)) { + if ((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_LOCAL) { flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS; } else if (((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_GLOBAL || (opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_GLOBAL_LOCK) && diff --git a/ext/opcache/Optimizer/zend_dfg.c b/ext/opcache/Optimizer/zend_dfg.c index e51c3a583a..a65d82cf4b 100644 --- a/ext/opcache/Optimizer/zend_dfg.c +++ b/ext/opcache/Optimizer/zend_dfg.c @@ -89,9 +89,7 @@ int zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, zend_dfg goto op1_def; } goto op1_use; - case ZEND_UNSET_VAR: - ZEND_ASSERT(opline->extended_value & ZEND_QUICK_SET); - /* break missing intentionally */ + case ZEND_UNSET_CV: case ZEND_ASSIGN: case ZEND_ASSIGN_REF: case ZEND_BIND_GLOBAL: diff --git a/ext/opcache/Optimizer/zend_dump.c b/ext/opcache/Optimizer/zend_dump.c index 49d579721c..364c7b1980 100644 --- a/ext/opcache/Optimizer/zend_dump.c +++ b/ext/opcache/Optimizer/zend_dump.c @@ -519,9 +519,6 @@ static void zend_dump_op(const zend_op_array *op_array, const zend_basic_block * } } if (ZEND_VM_EXT_ISSET & flags) { - if (opline->extended_value & ZEND_QUICK_SET) { - fprintf(stderr, " (quick)"); - } if (opline->extended_value & ZEND_ISSET) { fprintf(stderr, " (isset)"); } else if (opline->extended_value & ZEND_ISEMPTY) { diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 1e52474897..c9e782c352 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -2192,6 +2192,7 @@ static int zend_update_type_info(const zend_op_array *op_array, case ZEND_JMPNZ_EX: case ZEND_CASE: case ZEND_BOOL: + case ZEND_ISSET_ISEMPTY_CV: case ZEND_ISSET_ISEMPTY_VAR: case ZEND_ISSET_ISEMPTY_DIM_OBJ: case ZEND_ISSET_ISEMPTY_PROP_OBJ: @@ -2879,8 +2880,7 @@ static int zend_update_type_info(const zend_op_array *op_array, UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def); } break; - case ZEND_UNSET_VAR: - ZEND_ASSERT(opline->extended_value & ZEND_QUICK_SET); + case ZEND_UNSET_CV: tmp = MAY_BE_UNDEF; if (!op_array->function_name) { /* In global scope, we know nothing */ @@ -3937,9 +3937,6 @@ int zend_may_throw(const zend_op *opline, zend_op_array *op_array, zend_ssa *ssa switch (opline->opcode) { case ZEND_UNSET_VAR: case ZEND_ISSET_ISEMPTY_VAR: - if (opline->extended_value & ZEND_QUICK_SET) { - break; - } return 1; case ZEND_ISSET_ISEMPTY_DIM_OBJ: case ZEND_ISSET_ISEMPTY_PROP_OBJ: @@ -3950,6 +3947,8 @@ int zend_may_throw(const zend_op *opline, zend_op_array *op_array, zend_ssa *ssa case ZEND_FETCH_DIM_IS: case ZEND_FETCH_OBJ_IS: case ZEND_SEND_REF: + case ZEND_UNSET_CV: + case ZEND_ISSET_ISEMPTY_CV: break; default: /* undefined variable warning */ @@ -4026,6 +4025,7 @@ int zend_may_throw(const zend_op *opline, zend_op_array *op_array, zend_ssa *ssa case ZEND_SWITCH_LONG: case ZEND_SWITCH_STRING: case ZEND_ISSET_ISEMPTY_VAR: + case ZEND_ISSET_ISEMPTY_CV: return 0; case ZEND_INIT_FCALL: /* can't throw, because call is resolved at compile time */ diff --git a/ext/opcache/Optimizer/zend_ssa.c b/ext/opcache/Optimizer/zend_ssa.c index b0eb87995d..b0c087b1bd 100644 --- a/ext/opcache/Optimizer/zend_ssa.c +++ b/ext/opcache/Optimizer/zend_ssa.c @@ -713,12 +713,10 @@ static int zend_ssa_rename(const zend_op_array *op_array, uint32_t build_flags, //NEW_SSA_VAR(opline->op1.var) } break; - case ZEND_UNSET_VAR: - if (opline->extended_value & ZEND_QUICK_SET) { - ssa_ops[k].op1_def = ssa_vars_count; - var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; - ssa_vars_count++; - } + case ZEND_UNSET_CV: + ssa_ops[k].op1_def = ssa_vars_count; + var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count; + ssa_vars_count++; break; case ZEND_UNSET_DIM: case ZEND_UNSET_OBJ: diff --git a/ext/opcache/Optimizer/zend_ssa.h b/ext/opcache/Optimizer/zend_ssa.h index c7724fa032..f5855f2453 100644 --- a/ext/opcache/Optimizer/zend_ssa.h +++ b/ext/opcache/Optimizer/zend_ssa.h @@ -202,8 +202,7 @@ static zend_always_inline zend_ssa_phi* zend_ssa_next_use_phi(const zend_ssa *ss static zend_always_inline zend_bool zend_ssa_is_no_val_use(const zend_op *opline, const zend_ssa_op *ssa_op, int var) { - if (opline->opcode == ZEND_ASSIGN || - (opline->opcode == ZEND_UNSET_VAR && (opline->extended_value & ZEND_QUICK_SET))) { + if (opline->opcode == ZEND_ASSIGN || opline->opcode == ZEND_UNSET_CV) { return ssa_op->op1_use == var && ssa_op->op2_use != var; } if (opline->opcode == ZEND_FE_FETCH_R) { |