Skip to content

Commit 2c95c94

Browse files
committed
JIT: Eliminate useless EG(exception) checks after FETCH_DIM_*
1 parent 493c91c commit 2c95c94

File tree

4 files changed

+80
-39
lines changed

4 files changed

+80
-39
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3689,8 +3689,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
36893689
}
36903690
if (!zend_jit_fetch_dim_read(&dasm_state, opline, ssa, ssa_op,
36913691
OP1_INFO(), OP1_REG_ADDR(), 0,
3692-
OP2_INFO(), RES_INFO(), RES_REG_ADDR(), IS_UNKNOWN,
3693-
zend_may_throw(opline, ssa_op, op_array, ssa))) {
3692+
OP2_INFO(), RES_INFO(), RES_REG_ADDR(), IS_UNKNOWN)) {
36943693
goto jit_failure;
36953694
}
36963695
goto done;
@@ -3705,9 +3704,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
37053704
break;
37063705
}
37073706
if (!zend_jit_fetch_dim(&dasm_state, opline,
3708-
OP1_INFO(), OP1_REG_ADDR(), OP2_INFO(), RES_REG_ADDR(), IS_UNKNOWN,
3709-
zend_may_throw_ex(opline, ssa_op, op_array, ssa, OP1_INFO(),
3710-
OP2_INFO()))) {
3707+
OP1_INFO(), OP1_REG_ADDR(), OP2_INFO(), RES_REG_ADDR(), IS_UNKNOWN)) {
37113708
goto jit_failure;
37123709
}
37133710
goto done;

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10977,15 +10977,15 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1097710977
uint32_t op2_info,
1097810978
uint32_t res_info,
1097910979
zend_jit_addr res_addr,
10980-
uint8_t dim_type,
10981-
int may_throw)
10980+
uint8_t dim_type)
1098210981
{
1098310982
zend_jit_addr orig_op1_addr, op2_addr;
1098410983
const void *exit_addr = NULL;
1098510984
const void *not_found_exit_addr = NULL;
1098610985
const void *res_exit_addr = NULL;
1098710986
bool result_avoid_refcounting = 0;
1098810987
uint32_t may_be_string = (opline->opcode != ZEND_FETCH_LIST_R) ? MAY_BE_STRING : 0;
10988+
int may_throw = 0;
1098910989

1099010990
orig_op1_addr = OP1_ADDR();
1099110991
op2_addr = OP2_ADDR();
@@ -11079,6 +11079,10 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1107911079
}
1108011080
}
1108111081
| GET_ZVAL_LVAL ZREG_FCARG1, op1_addr, TMP1
11082+
if ((op2_info & ((MAY_BE_ANY|MAY_BE_UNDEF) - (MAY_BE_LONG|MAY_BE_STRING))) ||
11083+
(opline->opcode != ZEND_FETCH_DIM_IS && JIT_G(trigger) != ZEND_JIT_ON_HOT_TRACE)) {
11084+
may_throw = 1;
11085+
}
1108211086
if (!zend_jit_fetch_dimension_address_inner(Dst, opline, (opline->opcode != ZEND_FETCH_DIM_IS) ? BP_VAR_R : BP_VAR_IS, op1_info, op2_info, dim_type, res_exit_addr, not_found_exit_addr, exit_addr)) {
1108311087
return 0;
1108411088
}
@@ -11091,6 +11095,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1109111095
}
1109211096

1109311097
if (opline->opcode != ZEND_FETCH_LIST_R && (op1_info & MAY_BE_STRING)) {
11098+
may_throw = 1;
1109411099
if (op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_ARRAY|MAY_BE_STRING))) {
1109511100
if (exit_addr && !(op1_info & MAY_BE_OBJECT)) {
1109611101
| IF_NOT_ZVAL_TYPE op1_addr, IS_STRING, &exit_addr, ZREG_TMP1
@@ -11123,6 +11128,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1112311128
}
1112411129

1112511130
if (op1_info & MAY_BE_OBJECT) {
11131+
may_throw = 1;
1112611132
if (op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_ARRAY|MAY_BE_OBJECT|may_be_string))) {
1112711133
if (exit_addr) {
1112811134
| IF_NOT_ZVAL_TYPE op1_addr, IS_OBJECT, &exit_addr, ZREG_TMP1
@@ -11156,6 +11162,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1115611162
if ((opline->opcode != ZEND_FETCH_DIM_IS && (op1_info & MAY_BE_UNDEF)) || (op2_info & MAY_BE_UNDEF)) {
1115711163
| SET_EX_OPLINE opline, REG0
1115811164
if (opline->opcode != ZEND_FETCH_DIM_IS && (op1_info & MAY_BE_UNDEF)) {
11165+
may_throw = 1;
1115911166
| IF_NOT_ZVAL_TYPE op1_addr, IS_UNDEF, >1, ZREG_TMP1
1116011167
| // zend_error(E_WARNING, "Undefined variable $%s", ZSTR_VAL(CV_DEF_OF(EX_VAR_TO_NUM(opline->op1.var))));
1116111168
| LOAD_32BIT_VAL FCARG1w, opline->op1.var
@@ -11164,6 +11171,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1116411171
}
1116511172

1116611173
if (op2_info & MAY_BE_UNDEF) {
11174+
may_throw = 1;
1116711175
| IF_NOT_ZVAL_TYPE op2_addr, IS_UNDEF, >1, ZREG_TMP1
1116811176
| LOAD_32BIT_VAL FCARG1w, opline->op2.var
1116911177
| EXT_CALL zend_jit_undefined_op_helper, REG0
@@ -11174,6 +11182,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1117411182
if ((op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_ARRAY|MAY_BE_OBJECT|may_be_string)))
1117511183
&& (!exit_addr || !(op1_info & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_STRING)))) {
1117611184
if (opline->opcode != ZEND_FETCH_DIM_IS && opline->opcode != ZEND_FETCH_LIST_R) {
11185+
may_throw = 1;
1117711186
if ((op1_info & MAY_BE_UNDEF) || (op2_info & MAY_BE_UNDEF)) {
1117811187
| LOAD_ZVAL_ADDR FCARG1x, orig_op1_addr
1117911188
} else {
@@ -11285,9 +11294,19 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1128511294
}
1128611295
#endif
1128711296

11288-
| FREE_OP opline->op2_type, opline->op2, op2_info, 0, opline, ZREG_TMP1, ZREG_TMP2
11297+
if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) {
11298+
if ((op2_info & MAY_HAVE_DTOR) && (op2_info & MAY_BE_RC1)) {
11299+
may_throw = 1;
11300+
}
11301+
| FREE_OP opline->op2_type, opline->op2, op2_info, 0, opline, ZREG_TMP1, ZREG_TMP2
11302+
}
1128911303
if (opline->opcode != ZEND_FETCH_LIST_R && !op1_avoid_refcounting) {
11290-
| FREE_OP opline->op1_type, opline->op1, op1_info, 0, opline, ZREG_TMP1, ZREG_TMP2
11304+
if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) {
11305+
if ((op1_info & MAY_HAVE_DTOR) && (op1_info & MAY_BE_RC1)) {
11306+
may_throw = 1;
11307+
}
11308+
| FREE_OP opline->op1_type, opline->op1, op1_info, 0, opline, ZREG_TMP1, ZREG_TMP2
11309+
}
1129111310
}
1129211311

1129311312
if (may_throw) {
@@ -11305,14 +11324,15 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1130511324
zend_jit_addr op1_addr,
1130611325
uint32_t op2_info,
1130711326
zend_jit_addr res_addr,
11308-
uint8_t dim_type,
11309-
int may_throw)
11327+
uint8_t dim_type)
1131011328
{
1131111329
zend_jit_addr op2_addr;
11330+
int may_throw = 0;
1131211331

1131311332
op2_addr = (opline->op2_type != IS_UNUSED) ? OP2_ADDR() : 0;
1131411333

1131511334
if (op1_info & MAY_BE_REF) {
11335+
may_throw = 1;
1131611336
| LOAD_ZVAL_ADDR FCARG1x, op1_addr
1131711337
| IF_NOT_Z_TYPE FCARG1x, IS_REFERENCE, >1, TMP1w
1131811338
| GET_Z_PTR FCARG2x, FCARG1x
@@ -11354,6 +11374,7 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1135411374
}
1135511375
if ((op1_info & MAY_BE_UNDEF)
1135611376
&& opline->opcode == ZEND_FETCH_DIM_RW) {
11377+
may_throw = 1;
1135711378
if (op1_info & MAY_BE_NULL) {
1135811379
| IF_NOT_ZVAL_TYPE op1_addr, IS_UNDEF, >1, ZREG_TMP1
1135911380
}
@@ -11381,6 +11402,7 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1138111402
if (op1_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_ARRAY)) {
1138211403
|6:
1138311404
if (opline->op2_type == IS_UNUSED) {
11405+
may_throw = 1;
1138411406
| // var_ptr = zend_hash_next_index_insert(Z_ARRVAL_P(container), &EG(uninitialized_zval));
1138511407
| LOAD_ADDR_ZTS FCARG2x, executor_globals, uninitialized_zval
1138611408
| EXT_CALL zend_hash_next_index_insert, REG0
@@ -11405,6 +11427,7 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1140511427
type = BP_VAR_W;
1140611428
break;
1140711429
case ZEND_FETCH_DIM_RW:
11430+
may_throw = 1;
1140811431
type = BP_VAR_RW;
1140911432
break;
1141011433
case ZEND_FETCH_DIM_UNSET:
@@ -11414,6 +11437,9 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1141411437
ZEND_UNREACHABLE();
1141511438
}
1141611439

11440+
if (op2_info & ((MAY_BE_ANY|MAY_BE_UNDEF) - (MAY_BE_LONG|MAY_BE_STRING))) {
11441+
may_throw = 1;
11442+
}
1141711443
if (!zend_jit_fetch_dimension_address_inner(Dst, opline, type, op1_info, op2_info, dim_type, NULL, NULL, NULL)) {
1141811444
return 0;
1141911445
}
@@ -11433,6 +11459,7 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1143311459
}
1143411460

1143511461
if (op1_info & (MAY_BE_ANY-(MAY_BE_NULL|MAY_BE_ARRAY))) {
11462+
may_throw = 1;
1143611463
if (op1_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_ARRAY)) {
1143711464
|.cold_code
1143811465
|7:
@@ -11479,6 +11506,11 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1147911506
}
1148011507
#endif
1148111508

11509+
if ((opline->op2_type & (IS_TMP_VAR|IS_VAR))
11510+
&& (op2_info & MAY_HAVE_DTOR)
11511+
&& (op2_info & MAY_BE_RC1)) {
11512+
may_throw = 1;
11513+
}
1148211514
|8:
1148311515
| FREE_OP opline->op2_type, opline->op2, op2_info, 0, opline, ZREG_TMP1, ZREG_TMP2
1148411516

ext/opcache/jit/zend_jit_trace.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5405,20 +5405,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
54055405
}
54065406
if (!zend_jit_fetch_dim_read(&dasm_state, opline, ssa, ssa_op,
54075407
op1_info, op1_addr, avoid_refcounting,
5408-
op2_info, res_info, RES_REG_ADDR(), val_type,
5409-
(
5410-
(op1_info & MAY_BE_ANY) != MAY_BE_ARRAY ||
5411-
(op2_info & (MAY_BE_ANY - (MAY_BE_LONG|MAY_BE_STRING))) != 0 ||
5412-
((op1_info & MAY_BE_UNDEF) != 0 &&
5413-
opline->opcode != ZEND_FETCH_DIM_IS) ||
5414-
(opline->opcode != ZEND_FETCH_LIST_R &&
5415-
(opline->op1_type & (IS_TMP_VAR|IS_VAR)) != 0 &&
5416-
(op1_info & MAY_BE_RC1) &&
5417-
(op1_info & (MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE|MAY_BE_ARRAY_OF_ARRAY)) != 0) ||
5418-
(op2_info & MAY_BE_UNDEF) != 0 ||
5419-
((opline->op2_type & (IS_TMP_VAR|IS_VAR)) != 0 &&
5420-
(op2_info & MAY_BE_RC1) &&
5421-
(op2_info & (MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE|MAY_BE_ARRAY_OF_ARRAY)) != 0)))) {
5408+
op2_info, res_info, RES_REG_ADDR(), val_type)) {
54225409
goto jit_failure;
54235410
}
54245411
goto done;
@@ -5461,14 +5448,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
54615448
CHECK_OP2_TRACE_TYPE();
54625449
op1_def_info = OP1_DEF_INFO();
54635450
if (!zend_jit_fetch_dim(&dasm_state, opline,
5464-
op1_info, op1_addr, op2_info, RES_REG_ADDR(), val_type,
5465-
(opline->opcode == ZEND_FETCH_DIM_RW
5466-
|| opline->op2_type == IS_UNUSED
5467-
|| (op1_info & (MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF))
5468-
|| (op2_info & (MAY_BE_UNDEF|MAY_BE_RESOURCE|MAY_BE_ARRAY|MAY_BE_OBJECT))
5469-
|| (opline->op1_type == IS_VAR
5470-
&& (op1_info & MAY_BE_UNDEF)
5471-
&& !ssa->var_info[ssa_op->op1_use].indirect_reference)))) {
5451+
op1_info, op1_addr, op2_info, RES_REG_ADDR(), val_type)) {
54725452
goto jit_failure;
54735453
}
54745454
if (ssa_op->result_def > 0

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11631,15 +11631,15 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1163111631
uint32_t op2_info,
1163211632
uint32_t res_info,
1163311633
zend_jit_addr res_addr,
11634-
uint8_t dim_type,
11635-
int may_throw)
11634+
uint8_t dim_type)
1163611635
{
1163711636
zend_jit_addr orig_op1_addr, op2_addr;
1163811637
const void *exit_addr = NULL;
1163911638
const void *not_found_exit_addr = NULL;
1164011639
const void *res_exit_addr = NULL;
1164111640
bool result_avoid_refcounting = 0;
1164211641
uint32_t may_be_string = (opline->opcode != ZEND_FETCH_LIST_R) ? MAY_BE_STRING : 0;
11642+
int may_throw = 0;
1164311643

1164411644
orig_op1_addr = OP1_ADDR();
1164511645
op2_addr = OP2_ADDR();
@@ -11733,6 +11733,10 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1173311733
}
1173411734
}
1173511735
| GET_ZVAL_LVAL ZREG_FCARG1, op1_addr
11736+
if ((op2_info & ((MAY_BE_ANY|MAY_BE_UNDEF) - (MAY_BE_LONG|MAY_BE_STRING))) ||
11737+
(opline->opcode != ZEND_FETCH_DIM_IS && JIT_G(trigger) != ZEND_JIT_ON_HOT_TRACE)) {
11738+
may_throw = 1;
11739+
}
1173611740
if (!zend_jit_fetch_dimension_address_inner(Dst, opline, (opline->opcode != ZEND_FETCH_DIM_IS) ? BP_VAR_R : BP_VAR_IS, op1_info, op2_info, dim_type, res_exit_addr, not_found_exit_addr, exit_addr)) {
1173711741
return 0;
1173811742
}
@@ -11745,6 +11749,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1174511749
}
1174611750

1174711751
if (opline->opcode != ZEND_FETCH_LIST_R && (op1_info & MAY_BE_STRING)) {
11752+
may_throw = 1;
1174811753
if (op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_ARRAY|MAY_BE_STRING))) {
1174911754
if (exit_addr && !(op1_info & MAY_BE_OBJECT)) {
1175011755
| IF_NOT_ZVAL_TYPE op1_addr, IS_STRING, &exit_addr
@@ -11785,6 +11790,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1178511790
}
1178611791

1178711792
if (op1_info & MAY_BE_OBJECT) {
11793+
may_throw = 1;
1178811794
if (op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_ARRAY|MAY_BE_OBJECT|may_be_string))) {
1178911795
if (exit_addr) {
1179011796
| IF_NOT_ZVAL_TYPE op1_addr, IS_OBJECT, &exit_addr
@@ -11826,6 +11832,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1182611832
if ((opline->opcode != ZEND_FETCH_DIM_IS && (op1_info & MAY_BE_UNDEF)) || (op2_info & MAY_BE_UNDEF)) {
1182711833
| SET_EX_OPLINE opline, r0
1182811834
if (opline->opcode != ZEND_FETCH_DIM_IS && (op1_info & MAY_BE_UNDEF)) {
11835+
may_throw = 1;
1182911836
| IF_NOT_ZVAL_TYPE op1_addr, IS_UNDEF, >1
1183011837
| // zend_error(E_WARNING, "Undefined variable $%s", ZSTR_VAL(CV_DEF_OF(EX_VAR_TO_NUM(opline->op1.var))));
1183111838
| mov FCARG1d, opline->op1.var
@@ -11834,6 +11841,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1183411841
}
1183511842

1183611843
if (op2_info & MAY_BE_UNDEF) {
11844+
may_throw = 1;
1183711845
| IF_NOT_ZVAL_TYPE op2_addr, IS_UNDEF, >1
1183811846
| mov FCARG1d, opline->op2.var
1183911847
| EXT_CALL zend_jit_undefined_op_helper, r0
@@ -11844,6 +11852,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1184411852
if ((op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_ARRAY|MAY_BE_OBJECT|may_be_string)))
1184511853
&& (!exit_addr || !(op1_info & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_STRING)))) {
1184611854
if (opline->opcode != ZEND_FETCH_DIM_IS && opline->opcode != ZEND_FETCH_LIST_R) {
11855+
may_throw = 1;
1184711856
if ((op1_info & MAY_BE_UNDEF) || (op2_info & MAY_BE_UNDEF)) {
1184811857
| LOAD_ZVAL_ADDR FCARG1a, orig_op1_addr
1184911858
} else {
@@ -11954,9 +11963,19 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1195411963
}
1195511964
#endif
1195611965

11957-
| FREE_OP opline->op2_type, opline->op2, op2_info, 0, opline
11966+
if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) {
11967+
if ((op2_info & MAY_HAVE_DTOR) && (op2_info & MAY_BE_RC1)) {
11968+
may_throw = 1;
11969+
}
11970+
| FREE_OP opline->op2_type, opline->op2, op2_info, 0, opline
11971+
}
1195811972
if (opline->opcode != ZEND_FETCH_LIST_R && !op1_avoid_refcounting) {
11959-
| FREE_OP opline->op1_type, opline->op1, op1_info, 0, opline
11973+
if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) {
11974+
if ((op1_info & MAY_HAVE_DTOR) && (op1_info & MAY_BE_RC1)) {
11975+
may_throw = 1;
11976+
}
11977+
| FREE_OP opline->op1_type, opline->op1, op1_info, 0, opline
11978+
}
1196011979
}
1196111980

1196211981
if (may_throw) {
@@ -11974,14 +11993,15 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1197411993
zend_jit_addr op1_addr,
1197511994
uint32_t op2_info,
1197611995
zend_jit_addr res_addr,
11977-
uint8_t dim_type,
11978-
int may_throw)
11996+
uint8_t dim_type)
1197911997
{
1198011998
zend_jit_addr op2_addr;
11999+
int may_throw = 0;
1198112000

1198212001
op2_addr = (opline->op2_type != IS_UNUSED) ? OP2_ADDR() : 0;
1198312002

1198412003
if (op1_info & MAY_BE_REF) {
12004+
may_throw = 1;
1198512005
| LOAD_ZVAL_ADDR FCARG1a, op1_addr
1198612006
| IF_NOT_Z_TYPE FCARG1a, IS_REFERENCE, >1
1198712007
| GET_Z_PTR FCARG2a, FCARG1a
@@ -12022,6 +12042,7 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1202212042
}
1202312043
if ((op1_info & MAY_BE_UNDEF)
1202412044
&& opline->opcode == ZEND_FETCH_DIM_RW) {
12045+
may_throw = 1;
1202512046
if (op1_info & MAY_BE_NULL) {
1202612047
| IF_NOT_ZVAL_TYPE op1_addr, IS_UNDEF, >1
1202712048
}
@@ -12048,6 +12069,7 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1204812069
if (op1_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_ARRAY)) {
1204912070
|6:
1205012071
if (opline->op2_type == IS_UNUSED) {
12072+
may_throw = 1;
1205112073
| // var_ptr = zend_hash_next_index_insert(Z_ARRVAL_P(container), &EG(uninitialized_zval));
1205212074
| LOAD_ADDR_ZTS FCARG2a, executor_globals, uninitialized_zval
1205312075
| EXT_CALL zend_hash_next_index_insert, r0
@@ -12073,6 +12095,7 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1207312095
type = BP_VAR_W;
1207412096
break;
1207512097
case ZEND_FETCH_DIM_RW:
12098+
may_throw = 1;
1207612099
type = BP_VAR_RW;
1207712100
break;
1207812101
case ZEND_FETCH_DIM_UNSET:
@@ -12082,6 +12105,9 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1208212105
ZEND_UNREACHABLE();
1208312106
}
1208412107

12108+
if (op2_info & ((MAY_BE_ANY|MAY_BE_UNDEF) - (MAY_BE_LONG|MAY_BE_STRING))) {
12109+
may_throw = 1;
12110+
}
1208512111
if (!zend_jit_fetch_dimension_address_inner(Dst, opline, type, op1_info, op2_info, dim_type, NULL, NULL, NULL)) {
1208612112
return 0;
1208712113
}
@@ -12101,6 +12127,7 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1210112127
}
1210212128

1210312129
if (op1_info & (MAY_BE_ANY-(MAY_BE_NULL|MAY_BE_ARRAY))) {
12130+
may_throw = 1;
1210412131
if (op1_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_ARRAY)) {
1210512132
|.cold_code
1210612133
|7:
@@ -12155,6 +12182,11 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1215512182
}
1215612183
#endif
1215712184

12185+
if ((opline->op2_type & (IS_TMP_VAR|IS_VAR))
12186+
&& (op2_info & MAY_HAVE_DTOR)
12187+
&& (op2_info & MAY_BE_RC1)) {
12188+
may_throw = 1;
12189+
}
1215812190
|8:
1215912191
| FREE_OP opline->op2_type, opline->op2, op2_info, 0, opline
1216012192

0 commit comments

Comments
 (0)