Skip to content

Commit a99025c

Browse files
committed
Review
1 parent f7b7472 commit a99025c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,8 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
17451745
if (!(orig_op1_type & IS_TRACE_PACKED)) {
17461746
zend_ssa_var_info *info = &tssa->var_info[tssa->ops[idx].op1_use];
17471747

1748-
if (MAY_BE_PACKED(info->type) && MAY_BE_HASH(info->type)) {
1748+
if (MAY_BE_PACKED(info->type) && MAY_BE_HASH(info->type)
1749+
&& (info->type & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_ARRAY) {
17491750
info->type |= MAY_BE_PACKED_GUARD;
17501751
info->type &= ~MAY_BE_ARRAY_PACKED;
17511752
}
@@ -1754,7 +1755,8 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
17541755
&& val_type != IS_UNDEF) {
17551756
zend_ssa_var_info *info = &tssa->var_info[tssa->ops[idx].op1_use];
17561757

1757-
if (MAY_BE_PACKED(info->type) && MAY_BE_HASH(info->type)) {
1758+
if (MAY_BE_PACKED(info->type) && MAY_BE_HASH(info->type)
1759+
&& (info->type & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_ARRAY) {
17581760
info->type |= MAY_BE_PACKED_GUARD;
17591761
info->type &= ~(MAY_BE_ARRAY_NUMERIC_HASH|MAY_BE_ARRAY_STRING_HASH);
17601762
}
@@ -1833,7 +1835,8 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
18331835

18341836
zend_ssa_var_info *info = &tssa->var_info[tssa->ops[idx].op1_use];
18351837

1836-
if (MAY_BE_PACKED(info->type) && MAY_BE_HASH(info->type)) {
1838+
if (MAY_BE_PACKED(info->type) && MAY_BE_HASH(info->type)
1839+
&& (info->type & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_ARRAY) {
18371840
info->type |= MAY_BE_PACKED_GUARD;
18381841
if (orig_op1_type & IS_TRACE_PACKED) {
18391842
info->type &= ~(MAY_BE_ARRAY_NUMERIC_HASH|MAY_BE_ARRAY_STRING_HASH);
@@ -1935,7 +1938,8 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
19351938

19361939
zend_ssa_var_info *info = &tssa->var_info[tssa->ops[idx].op1_use];
19371940

1938-
if (MAY_BE_PACKED(info->type) && MAY_BE_HASH(info->type)) {
1941+
if (MAY_BE_PACKED(info->type) && MAY_BE_HASH(info->type)
1942+
&& (info->type & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_ARRAY) {
19391943
info->type |= MAY_BE_PACKED_GUARD;
19401944
if (orig_op1_type & IS_TRACE_PACKED) {
19411945
info->type &= ~(MAY_BE_ARRAY_NUMERIC_HASH|MAY_BE_ARRAY_STRING_HASH);
@@ -1965,7 +1969,8 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
19651969

19661970
zend_ssa_var_info *info = &tssa->var_info[tssa->ops[idx].op1_use];
19671971

1968-
if (MAY_BE_PACKED(info->type) && MAY_BE_HASH(info->type)) {
1972+
if (MAY_BE_PACKED(info->type) && MAY_BE_HASH(info->type)
1973+
&& (info->type & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_ARRAY) {
19691974
info->type |= MAY_BE_PACKED_GUARD;
19701975
info->type &= ~MAY_BE_ARRAY_PACKED;
19711976
}
@@ -4162,10 +4167,11 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
41624167
}
41634168

41644169
if ((info & MAY_BE_PACKED_GUARD) != 0
4165-
&& (info & MAY_BE_GUARD) == 0
41664170
&& (trace_buffer->stop == ZEND_JIT_TRACE_STOP_LOOP
41674171
|| trace_buffer->stop == ZEND_JIT_TRACE_STOP_RECURSIVE_CALL
4168-
|| trace_buffer->stop == ZEND_JIT_TRACE_STOP_RECURSIVE_RET)
4172+
|| (trace_buffer->stop == ZEND_JIT_TRACE_STOP_RECURSIVE_RET
4173+
&& (opline-1)->result_type == IS_VAR
4174+
&& EX_VAR_TO_NUM((opline-1)->result.var) == i))
41694175
&& (ssa->vars[i].use_chain != -1
41704176
|| (ssa->vars[i].phi_use_chain
41714177
&& !(ssa->var_info[ssa->vars[i].phi_use_chain->ssa_var].type & MAY_BE_PACKED_GUARD)))) {

0 commit comments

Comments
 (0)