From: Nikita Popov Date: Wed, 15 Apr 2020 10:58:50 +0000 (+0200) Subject: Remove OP_RANGE_EX distinction X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd163d05ffeb1e3fea8cc5ba2b187324e9b32553;p=php Remove OP_RANGE_EX distinction Only leave OP_RANGE macros, which always have the "EX" behavior. This was already done for most other macros before, but these were missed. This helps avoid mistakes by using the wrong macro. --- diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 27f889f031..9f03a11826 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -161,22 +161,15 @@ static zend_bool zend_long_is_power_of_two(zend_long x) return (x > 0) && !(x & (x - 1)); } -#define OP_RANGE_EX(ssa_op, opN) \ +#define OP_RANGE(ssa_op, opN) \ (((opline->opN##_type & (IS_TMP_VAR|IS_VAR|IS_CV)) && \ (ssa_op)->opN##_use >= 0 && \ ssa->var_info[(ssa_op)->opN##_use].has_range) ? \ &ssa->var_info[(ssa_op)->opN##_use].range : NULL) -#define OP_RANGE(line, opN) \ - (ssa->var_info ? OP_RANGE_EX(ssa->ops + (line), opN) : NULL) - -#define OP1_RANGE() OP_RANGE(opline - op_array->opcodes, op1) -#define OP2_RANGE() OP_RANGE(opline - op_array->opcodes, op2) -#define OP1_DATA_RANGE() OP_RANGE(opline - op_array->opcodes + 1, op1) - -#define OP1_RANGE_EX() OP_RANGE_EX(ssa_op, op1) -#define OP2_RANGE_EX() OP_RANGE_EX(ssa_op, op2) -#define OP1_DATA_RANGE_EX() OP_RANGE_EX(ssa_op + 1, op1) +#define OP1_RANGE() OP_RANGE(ssa_op, op1) +#define OP2_RANGE() OP_RANGE(ssa_op, op2) +#define OP1_DATA_RANGE() OP_RANGE(ssa_op + 1, op1) #include "dynasm/dasm_x86.h" #include "jit/zend_jit_helpers.c" diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index a819b08cd6..8034e408c1 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -1952,8 +1952,8 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par } res_info = RES_INFO(); if (!zend_jit_long_math(&dasm_state, opline, op_array, - op1_info, OP1_RANGE_EX(), OP1_REG_ADDR(), - op2_info, OP2_RANGE_EX(), OP2_REG_ADDR(), + op1_info, OP1_RANGE(), OP1_REG_ADDR(), + op2_info, OP2_RANGE(), OP2_REG_ADDR(), res_use_info, res_info, res_addr, send_result, zend_may_throw(opline, ssa_op, op_array, ssa))) { @@ -2106,8 +2106,8 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par } op1_def_info = OP1_DEF_INFO(); if (!zend_jit_assign_op(&dasm_state, opline, op_array, - op1_info, op1_def_info, OP1_RANGE_EX(), - op2_info, OP2_RANGE_EX(), + op1_info, op1_def_info, OP1_RANGE(), + op2_info, OP2_RANGE(), (op1_def_info & MAY_BE_LONG) && (op1_def_info & (MAY_BE_DOUBLE|MAY_BE_GUARD)) && zend_may_overflow_ex(opline, ssa_op, op_array, ssa), zend_may_throw(opline, ssa_op, op_array, ssa))) { goto jit_failure; @@ -2137,7 +2137,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par op1_def_info = OP1_DEF_INFO(); if (!zend_jit_assign_dim_op(&dasm_state, opline, op_array, op1_info, op1_def_info, op2_info, - op1_data_info, OP1_DATA_RANGE_EX(), + op1_data_info, OP1_DATA_RANGE(), zend_may_throw(opline, ssa_op, op_array, ssa))) { goto jit_failure; }