Skip to content

Commit 18d2b7f

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fixed reference-counting Fixed incorrect FETCH_THIS optimization
2 parents 04393f2 + eb6d496 commit 18d2b7f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5332,7 +5332,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
53325332
goto done;
53335333
case ZEND_FETCH_THIS:
53345334
delayed_fetch_this = 0;
5335-
if (ssa_op->result_def >= 0) {
5335+
if (ssa_op->result_def >= 0 && opline->result_type != IS_CV) {
53365336
if (zend_jit_may_delay_fetch_this(ssa, ssa_opcodes, ssa_op->result_def)) {
53375337
ssa->var_info[ssa_op->result_def].delayed_fetch_this = 1;
53385338
delayed_fetch_this = 1;

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12015,6 +12015,13 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
1201512015
}
1201612016
}
1201712017

12018+
#ifdef ZEND_JIT_USE_RC_INFERENCE
12019+
if ((opline->op2_type & (IS_TMP_VAR|IS_VAR)) && (op1_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_ARRAY|MAY_BE_OBJECT))) {
12020+
/* ASSIGN_DIM may increase refcount of the key */
12021+
op2_info |= MAY_BE_RCN;
12022+
}
12023+
#endif
12024+
1201812025
|8:
1201912026
| FREE_OP opline->op2_type, opline->op2, op2_info, 0, opline
1202012027

0 commit comments

Comments
 (0)