@@ -11366,6 +11366,7 @@ static int zend_jit_fetch_dimension_address_inner(zend_jit_ctx *jit,
1136611366 uint32_t type,
1136711367 uint32_t op1_info,
1136811368 uint32_t op2_info,
11369+ zend_jit_addr op2_addr,
1136911370 uint8_t dim_type,
1137011371 const void *found_exit_addr,
1137111372 const void *not_found_exit_addr,
@@ -11377,7 +11378,6 @@ static int zend_jit_fetch_dimension_address_inner(zend_jit_ctx *jit,
1137711378 ir_ref *end_inputs,
1137811379 ir_ref *not_found_inputs)
1137911380{
11380- zend_jit_addr op2_addr = OP2_ADDR();
1138111381 zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
1138211382 ir_ref ref = IR_UNUSED, cond, if_found;
1138311383 ir_ref if_type = IS_UNUSED;
@@ -11965,11 +11965,12 @@ static int zend_jit_fetch_dim_read(zend_jit_ctx *jit,
1196511965 zend_jit_addr op1_addr,
1196611966 bool op1_avoid_refcounting,
1196711967 uint32_t op2_info,
11968+ zend_jit_addr op2_addr,
1196811969 uint32_t res_info,
1196911970 zend_jit_addr res_addr,
1197011971 uint8_t dim_type)
1197111972{
11972- zend_jit_addr orig_op1_addr, op2_addr ;
11973+ zend_jit_addr orig_op1_addr;
1197311974 const void *exit_addr = NULL;
1197411975 const void *not_found_exit_addr = NULL;
1197511976 bool result_type_guard = 0;
@@ -11981,7 +11982,6 @@ static int zend_jit_fetch_dim_read(zend_jit_ctx *jit,
1198111982 ir_ref not_found_inputs = IR_UNUSED;
1198211983
1198311984 orig_op1_addr = OP1_ADDR();
11984- op2_addr = OP2_ADDR();
1198511985
1198611986 if (opline->opcode != ZEND_FETCH_DIM_IS
1198711987 && JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE
@@ -12086,7 +12086,7 @@ static int zend_jit_fetch_dim_read(zend_jit_ctx *jit,
1208612086
1208712087 if (!zend_jit_fetch_dimension_address_inner(jit, opline,
1208812088 (opline->opcode != ZEND_FETCH_DIM_IS) ? BP_VAR_R : BP_VAR_IS,
12089- op1_info, op2_info, dim_type, NULL, not_found_exit_addr, exit_addr,
12089+ op1_info, op2_info, op2_addr, dim_type, NULL, not_found_exit_addr, exit_addr,
1209012090 result_type_guard, ht_ref, found_inputs, found_vals,
1209112091 &end_inputs, ¬_found_inputs)) {
1209212092 return 0;
@@ -12489,7 +12489,8 @@ static int zend_jit_fetch_dim(zend_jit_ctx *jit,
1248912489 if (op2_info & ((MAY_BE_ANY|MAY_BE_UNDEF) - (MAY_BE_LONG|MAY_BE_STRING))) {
1249012490 may_throw = 1;
1249112491 }
12492- if (!zend_jit_fetch_dimension_address_inner(jit, opline, type, op1_info, op2_info, dim_type, NULL, NULL, NULL,
12492+ if (!zend_jit_fetch_dimension_address_inner(jit, opline, type, op1_info,
12493+ op2_info, OP2_ADDR(), dim_type, NULL, NULL, NULL,
1249312494 0, ht_ref, found_inputs, found_vals, &end_inputs, NULL)) {
1249412495 return 0;
1249512496 }
@@ -12648,7 +12649,8 @@ static int zend_jit_isset_isempty_dim(zend_jit_ctx *jit,
1264812649 not_found_exit_addr = exit_addr;
1264912650 }
1265012651 }
12651- if (!zend_jit_fetch_dimension_address_inner(jit, opline, BP_JIT_IS, op1_info, op2_info, dim_type, found_exit_addr, not_found_exit_addr, NULL,
12652+ if (!zend_jit_fetch_dimension_address_inner(jit, opline, BP_JIT_IS, op1_info,
12653+ op2_info, OP2_ADDR(), dim_type, found_exit_addr, not_found_exit_addr, NULL,
1265212654 0, ht_ref, true_inputs, NULL, &false_inputs, NULL)) {
1265312655 return 0;
1265412656 }
@@ -12849,7 +12851,8 @@ static int zend_jit_assign_dim(zend_jit_ctx *jit, const zend_op *opline, uint32_
1284912851 ir_refs_init(found_inputs, 8);
1285012852 ir_refs_init(found_values, 8);
1285112853
12852- if (!zend_jit_fetch_dimension_address_inner(jit, opline, BP_VAR_W, op1_info, op2_info, dim_type, NULL, NULL, NULL,
12854+ if (!zend_jit_fetch_dimension_address_inner(jit, opline, BP_VAR_W, op1_info,
12855+ op2_info, OP2_ADDR(), dim_type, NULL, NULL, NULL,
1285312856 0, ht_ref, found_inputs, found_values, &end_inputs, NULL)) {
1285412857 return 0;
1285512858 }
@@ -13009,7 +13012,8 @@ static int zend_jit_assign_dim_op(zend_jit_ctx *jit, const zend_op *opline, uint
1300913012 }
1301013013 }
1301113014
13012- if (!zend_jit_fetch_dimension_address_inner(jit, opline, BP_VAR_RW, op1_info, op2_info, dim_type, NULL, not_found_exit_addr, NULL,
13015+ if (!zend_jit_fetch_dimension_address_inner(jit, opline, BP_VAR_RW, op1_info,
13016+ op2_info, OP2_ADDR(), dim_type, NULL, not_found_exit_addr, NULL,
1301313017 0, ht_ref, found_inputs, found_values, &end_inputs, NULL)) {
1301413018 return 0;
1301513019 }
@@ -16536,6 +16540,8 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa
1653616540 case ZEND_FETCH_CONSTANT:
1653716541 return 1;
1653816542 case ZEND_FETCH_DIM_R:
16543+ case ZEND_FETCH_DIM_IS:
16544+ case ZEND_FETCH_LIST_R:
1653916545 op1_info = OP1_INFO();
1654016546 op2_info = OP2_INFO();
1654116547 if (trace
@@ -16544,10 +16550,8 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa
1654416550 op1_info &= ~((MAY_BE_ANY|MAY_BE_UNDEF) - MAY_BE_ARRAY);
1654516551 }
1654616552 return ((op1_info & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_ARRAY) &&
16547- (!(opline->op1_type & (IS_TMP_VAR|IS_VAR)) || !(op1_info & MAY_BE_RC1)) &&
1654816553 (((op2_info & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_LONG) ||
16549- (((op2_info & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_STRING) &&
16550- (!(opline->op2_type & (IS_TMP_VAR|IS_VAR)) || !(op2_info & MAY_BE_RC1))));
16554+ ((op2_info & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_STRING));
1655116555 }
1655216556 return 0;
1655316557}
0 commit comments