Skip to content

Commit dd163d0

Browse files
committed
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.
1 parent 9908426 commit dd163d0

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,22 +161,15 @@ static zend_bool zend_long_is_power_of_two(zend_long x)
161161
return (x > 0) && !(x & (x - 1));
162162
}
163163

164-
#define OP_RANGE_EX(ssa_op, opN) \
164+
#define OP_RANGE(ssa_op, opN) \
165165
(((opline->opN##_type & (IS_TMP_VAR|IS_VAR|IS_CV)) && \
166166
(ssa_op)->opN##_use >= 0 && \
167167
ssa->var_info[(ssa_op)->opN##_use].has_range) ? \
168168
&ssa->var_info[(ssa_op)->opN##_use].range : NULL)
169169

170-
#define OP_RANGE(line, opN) \
171-
(ssa->var_info ? OP_RANGE_EX(ssa->ops + (line), opN) : NULL)
172-
173-
#define OP1_RANGE() OP_RANGE(opline - op_array->opcodes, op1)
174-
#define OP2_RANGE() OP_RANGE(opline - op_array->opcodes, op2)
175-
#define OP1_DATA_RANGE() OP_RANGE(opline - op_array->opcodes + 1, op1)
176-
177-
#define OP1_RANGE_EX() OP_RANGE_EX(ssa_op, op1)
178-
#define OP2_RANGE_EX() OP_RANGE_EX(ssa_op, op2)
179-
#define OP1_DATA_RANGE_EX() OP_RANGE_EX(ssa_op + 1, op1)
170+
#define OP1_RANGE() OP_RANGE(ssa_op, op1)
171+
#define OP2_RANGE() OP_RANGE(ssa_op, op2)
172+
#define OP1_DATA_RANGE() OP_RANGE(ssa_op + 1, op1)
180173

181174
#include "dynasm/dasm_x86.h"
182175
#include "jit/zend_jit_helpers.c"

ext/opcache/jit/zend_jit_trace.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,8 +1952,8 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
19521952
}
19531953
res_info = RES_INFO();
19541954
if (!zend_jit_long_math(&dasm_state, opline, op_array,
1955-
op1_info, OP1_RANGE_EX(), OP1_REG_ADDR(),
1956-
op2_info, OP2_RANGE_EX(), OP2_REG_ADDR(),
1955+
op1_info, OP1_RANGE(), OP1_REG_ADDR(),
1956+
op2_info, OP2_RANGE(), OP2_REG_ADDR(),
19571957
res_use_info, res_info, res_addr,
19581958
send_result,
19591959
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
21062106
}
21072107
op1_def_info = OP1_DEF_INFO();
21082108
if (!zend_jit_assign_op(&dasm_state, opline, op_array,
2109-
op1_info, op1_def_info, OP1_RANGE_EX(),
2110-
op2_info, OP2_RANGE_EX(),
2109+
op1_info, op1_def_info, OP1_RANGE(),
2110+
op2_info, OP2_RANGE(),
21112111
(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),
21122112
zend_may_throw(opline, ssa_op, op_array, ssa))) {
21132113
goto jit_failure;
@@ -2137,7 +2137,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
21372137
op1_def_info = OP1_DEF_INFO();
21382138
if (!zend_jit_assign_dim_op(&dasm_state, opline, op_array,
21392139
op1_info, op1_def_info, op2_info,
2140-
op1_data_info, OP1_DATA_RANGE_EX(),
2140+
op1_data_info, OP1_DATA_RANGE(),
21412141
zend_may_throw(opline, ssa_op, op_array, ssa))) {
21422142
goto jit_failure;
21432143
}

0 commit comments

Comments
 (0)