Skip to content

Commit 2b279b4

Browse files
committed
We don't need "safe" destruction anymore
1 parent 6b862e8 commit 2b279b4

File tree

3 files changed

+5
-27
lines changed

3 files changed

+5
-27
lines changed

Zend/zend_execute.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3373,15 +3373,7 @@ static zend_always_inline void i_free_compiled_variables(zend_execute_data *exec
33733373
zval *cv = EX_VAR_NUM(0);
33743374
int count = EX(func)->op_array.last_var;
33753375
while (EXPECTED(count != 0)) {
3376-
if (Z_REFCOUNTED_P(cv)) {
3377-
zend_refcounted *r = Z_COUNTED_P(cv);
3378-
if (!GC_DELREF(r)) {
3379-
ZVAL_NULL(cv);
3380-
rc_dtor_func(r);
3381-
} else {
3382-
gc_check_possible_root(r);
3383-
}
3384-
}
3376+
i_zval_ptr_dtor(cv);
33853377
cv++;
33863378
count--;
33873379
}

Zend/zend_execute.h

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,7 @@ static zend_always_inline void zend_vm_stack_free_extra_args_ex(uint32_t call_in
230230
uint32_t count = ZEND_CALL_NUM_ARGS(call) - call->func->op_array.num_args;
231231
zval *p = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T);
232232
do {
233-
if (Z_REFCOUNTED_P(p)) {
234-
zend_refcounted *r = Z_COUNTED_P(p);
235-
if (!GC_DELREF(r)) {
236-
ZVAL_NULL(p);
237-
rc_dtor_func(r);
238-
} else {
239-
gc_check_possible_root(r);
240-
}
241-
}
233+
i_zval_ptr_dtor(p);
242234
p++;
243235
} while (--count);
244236
}
@@ -257,13 +249,7 @@ static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call)
257249
zval *p = ZEND_CALL_ARG(call, 1);
258250

259251
do {
260-
if (Z_REFCOUNTED_P(p)) {
261-
zend_refcounted *r = Z_COUNTED_P(p);
262-
if (!GC_DELREF(r)) {
263-
ZVAL_NULL(p);
264-
rc_dtor_func(r);
265-
}
266-
}
252+
zval_ptr_dtor_nogc(p);
267253
p++;
268254
} while (--num_args);
269255
}

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7207,7 +7207,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
72077207
if (func) {
72087208
for (i = 0; i < call_info->num_args; i++ ) {
72097209
uint32_t offset = (uint32_t)(uintptr_t)ZEND_CALL_VAR_NUM(NULL, i);
7210-
| ZVAL_PTR_DTOR ZEND_ADDR_MEM_ZVAL(ZREG_RX, offset), MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN, 0, 1, 1, opline
7210+
| ZVAL_PTR_DTOR ZEND_ADDR_MEM_ZVAL(ZREG_RX, offset), MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN, 0, 1, 0, opline
72117211
}
72127212
} else {
72137213
| mov FCARG1a, RX
@@ -7939,7 +7939,7 @@ static int zend_jit_free_compiled_variables(dasm_State **Dst, const zend_op *opl
79397939

79407940
if (info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) {
79417941
uint32_t offset = (uint32_t)(uintptr_t)ZEND_CALL_VAR_NUM(NULL, i);
7942-
| ZVAL_PTR_DTOR ZEND_ADDR_MEM_ZVAL(ZREG_FP, offset), info, 1, 1, 1, opline
7942+
| ZVAL_PTR_DTOR ZEND_ADDR_MEM_ZVAL(ZREG_FP, offset), info, 1, 1, 0, opline
79437943
}
79447944
}
79457945
return 1;

0 commit comments

Comments
 (0)