Skip to content

Commit e3355ac

Browse files
committed
Revert "Rename _zval_dtor_func to _ref_dtor_func"
This reverts commit a362ae6.
1 parent a362ae6 commit e3355ac

File tree

11 files changed

+761
-812
lines changed

11 files changed

+761
-812
lines changed

Zend/zend_execute.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ ZEND_API const zend_internal_function zend_pass_function = {
146146
if (EXPECTED(Z_TYPE_P(__zv) == IS_INDIRECT)) { \
147147
ZVAL_COPY(__zv, Z_INDIRECT_P(__zv)); \
148148
} \
149-
ref_dtor_func(__ref); \
149+
zval_dtor_func(__ref); \
150150
} \
151151
} \
152152
} while (0)
@@ -604,7 +604,7 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
604604

605605
if (GC_DELREF(garbage) == 0) {
606606
ZVAL_REF(variable_ptr, ref);
607-
ref_dtor_func(garbage);
607+
zval_dtor_func(garbage);
608608
return;
609609
} else {
610610
gc_check_possible_root(garbage);
@@ -2366,7 +2366,7 @@ static zend_always_inline void i_free_compiled_variables(zend_execute_data *exec
23662366
zend_refcounted *r = Z_COUNTED_P(cv);
23672367
if (!GC_DELREF(r)) {
23682368
ZVAL_NULL(cv);
2369-
ref_dtor_func(r);
2369+
zval_dtor_func(r);
23702370
} else {
23712371
gc_check_possible_root(r);
23722372
}

Zend/zend_execute.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
107107
Z_ADDREF_P(variable_ptr);
108108
}
109109
}
110-
ref_dtor_func(garbage);
110+
zval_dtor_func(garbage);
111111
return variable_ptr;
112112
} else { /* we need to split */
113113
/* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
@@ -232,7 +232,7 @@ static zend_always_inline void zend_vm_stack_free_extra_args_ex(uint32_t call_in
232232
zend_refcounted *r = Z_COUNTED_P(p);
233233
if (!GC_DELREF(r)) {
234234
ZVAL_NULL(p);
235-
ref_dtor_func(r);
235+
zval_dtor_func(r);
236236
} else {
237237
gc_check_possible_root(r);
238238
}
@@ -259,7 +259,7 @@ static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call)
259259
zend_refcounted *r = Z_COUNTED_P(p);
260260
if (!GC_DELREF(r)) {
261261
ZVAL_NULL(p);
262-
ref_dtor_func(r);
262+
zval_dtor_func(r);
263263
}
264264
}
265265
p++;

Zend/zend_gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ static zend_never_inline void ZEND_FASTCALL gc_possible_root_when_full(zend_refc
512512
GC_ADDREF(ref);
513513
gc_adjust_threshold(gc_collect_cycles());
514514
if (UNEXPECTED(GC_DELREF(ref)) == 0) {
515-
ref_dtor_func(ref);
515+
zval_dtor_func(ref);
516516
return;
517517
} else if (UNEXPECTED(GC_INFO(ref))) {
518518
return;

Zend/zend_variables.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,27 @@ static void ZEND_FASTCALL zend_ast_ref_destroy_wrapper(zend_ast_ref *ast ZEND_FI
4444
# define zend_ast_ref_destroy_wrapper zend_ast_ref_destroy
4545
#endif
4646

47-
typedef void (ZEND_FASTCALL *zend_ref_dtor_func_t)(zend_refcounted *p ZEND_FILE_LINE_DC);
48-
49-
static const zend_ref_dtor_func_t zend_ref_dtor_func[] = {
50-
/* IS_UNDEF */ (zend_ref_dtor_func_t)zend_empty_destroy,
51-
/* IS_NULL */ (zend_ref_dtor_func_t)zend_empty_destroy,
52-
/* IS_FALSE */ (zend_ref_dtor_func_t)zend_empty_destroy,
53-
/* IS_TRUE */ (zend_ref_dtor_func_t)zend_empty_destroy,
54-
/* IS_LONG */ (zend_ref_dtor_func_t)zend_empty_destroy,
55-
/* IS_DOUBLE */ (zend_ref_dtor_func_t)zend_empty_destroy,
56-
/* IS_STRING */ (zend_ref_dtor_func_t)zend_string_destroy,
57-
/* IS_ARRAY */ (zend_ref_dtor_func_t)zend_array_destroy_wrapper,
58-
/* IS_OBJECT */ (zend_ref_dtor_func_t)zend_object_destroy_wrapper,
59-
/* IS_RESOURCE */ (zend_ref_dtor_func_t)zend_resource_destroy_wrapper,
60-
/* IS_REFERENCE */ (zend_ref_dtor_func_t)zend_reference_destroy,
61-
/* IS_CONSTANT_AST */ (zend_ref_dtor_func_t)zend_ast_ref_destroy_wrapper
47+
typedef void (ZEND_FASTCALL *zend_zval_dtor_func_t)(zend_refcounted *p ZEND_FILE_LINE_DC);
48+
49+
static const zend_zval_dtor_func_t zend_zval_dtor_func[] = {
50+
/* IS_UNDEF */ (zend_zval_dtor_func_t)zend_empty_destroy,
51+
/* IS_NULL */ (zend_zval_dtor_func_t)zend_empty_destroy,
52+
/* IS_FALSE */ (zend_zval_dtor_func_t)zend_empty_destroy,
53+
/* IS_TRUE */ (zend_zval_dtor_func_t)zend_empty_destroy,
54+
/* IS_LONG */ (zend_zval_dtor_func_t)zend_empty_destroy,
55+
/* IS_DOUBLE */ (zend_zval_dtor_func_t)zend_empty_destroy,
56+
/* IS_STRING */ (zend_zval_dtor_func_t)zend_string_destroy,
57+
/* IS_ARRAY */ (zend_zval_dtor_func_t)zend_array_destroy_wrapper,
58+
/* IS_OBJECT */ (zend_zval_dtor_func_t)zend_object_destroy_wrapper,
59+
/* IS_RESOURCE */ (zend_zval_dtor_func_t)zend_resource_destroy_wrapper,
60+
/* IS_REFERENCE */ (zend_zval_dtor_func_t)zend_reference_destroy,
61+
/* IS_CONSTANT_AST */ (zend_zval_dtor_func_t)zend_ast_ref_destroy_wrapper
6262
};
6363

64-
ZEND_API void ZEND_FASTCALL _ref_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
64+
ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
6565
{
6666
ZEND_ASSERT(GC_TYPE(p) <= IS_CONSTANT_AST);
67-
zend_ref_dtor_func[GC_TYPE(p)](p ZEND_FILE_LINE_RELAY_CC);
67+
zend_zval_dtor_func[GC_TYPE(p)](p ZEND_FILE_LINE_RELAY_CC);
6868
}
6969

7070
static void ZEND_FASTCALL zend_string_destroy(zend_string *str ZEND_FILE_LINE_DC)

Zend/zend_variables.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828

2929
BEGIN_EXTERN_C()
3030

31-
ZEND_API void ZEND_FASTCALL _ref_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC);
31+
ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC);
3232
ZEND_API void ZEND_FASTCALL _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC);
3333

34-
#define ref_dtor_func(ref) _ref_dtor_func(ref ZEND_FILE_LINE_CC)
34+
#define zval_dtor_func(zv) _zval_dtor_func(zv ZEND_FILE_LINE_CC)
3535
#define zval_copy_ctor_func(zv) _zval_copy_ctor_func(zv ZEND_FILE_LINE_CC)
3636

3737
static zend_always_inline void _zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LINE_DC)
3838
{
3939
if (Z_REFCOUNTED_P(zval_ptr) && !Z_DELREF_P(zval_ptr)) {
40-
_ref_dtor_func(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_RELAY_CC);
40+
_zval_dtor_func(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_RELAY_CC);
4141
}
4242
}
4343

@@ -46,7 +46,7 @@ static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC)
4646
if (Z_REFCOUNTED_P(zval_ptr)) {
4747
zend_refcounted *ref = Z_COUNTED_P(zval_ptr);
4848
if (!GC_DELREF(ref)) {
49-
_ref_dtor_func(ref ZEND_FILE_LINE_RELAY_CC);
49+
_zval_dtor_func(ref ZEND_FILE_LINE_RELAY_CC);
5050
} else {
5151
gc_check_possible_root(ref);
5252
}
@@ -92,7 +92,6 @@ ZEND_API void _zval_internal_ptr_dtor(zval *zvalue ZEND_FILE_LINE_DC);
9292
/* Kept for compatibility */
9393
#define zval_dtor(zvalue) zval_ptr_dtor_nogc(zvalue)
9494
#define zval_internal_dtor(zvalue) _zval_internal_ptr_dtor((zvalue) ZEND_FILE_LINE_CC)
95-
#define zval_dtor_func _ref_dtor_func
9695

9796
#if ZEND_DEBUG
9897
ZEND_API void _zval_ptr_dtor_wrapper(zval *zval_ptr);

Zend/zend_vm_def.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3813,7 +3813,7 @@ ZEND_VM_HOT_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
38133813
if (OP1_TYPE & (IS_VAR|IS_TMP_VAR)) {
38143814
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
38153815
SAVE_OPLINE();
3816-
ref_dtor_func(Z_COUNTED_P(free_op1));
3816+
zval_dtor_func(Z_COUNTED_P(free_op1));
38173817
}
38183818
}
38193819
} else {
@@ -5441,7 +5441,7 @@ ZEND_VM_HANDLER(196, ZEND_UNSET_CV, CV, UNUSED)
54415441
ZVAL_UNDEF(var);
54425442
SAVE_OPLINE();
54435443
if (!GC_DELREF(garbage)) {
5444-
ref_dtor_func(garbage);
5444+
zval_dtor_func(garbage);
54455445
} else {
54465446
gc_check_possible_root(garbage);
54475447
}
@@ -7489,7 +7489,7 @@ ZEND_VM_C_LABEL(check_indirect):
74897489
if (EXPECTED(variable_ptr != value)) {
74907490
if (refcnt == 0) {
74917491
SAVE_OPLINE();
7492-
ref_dtor_func(ref);
7492+
zval_dtor_func(ref);
74937493
if (UNEXPECTED(EG(exception))) {
74947494
ZVAL_NULL(variable_ptr);
74957495
HANDLE_EXCEPTION();

Zend/zend_vm_execute.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2773,7 +2773,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_
27732773
if (IS_CONST & (IS_VAR|IS_TMP_VAR)) {
27742774
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
27752775
SAVE_OPLINE();
2776-
ref_dtor_func(Z_COUNTED_P(free_op1));
2776+
zval_dtor_func(Z_COUNTED_P(free_op1));
27772777
}
27782778
}
27792779
} else {
@@ -17780,7 +17780,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HA
1778017780
if (IS_TMP_VAR & (IS_VAR|IS_TMP_VAR)) {
1778117781
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
1778217782
SAVE_OPLINE();
17783-
ref_dtor_func(Z_COUNTED_P(free_op1));
17783+
zval_dtor_func(Z_COUNTED_P(free_op1));
1778417784
}
1778517785
}
1778617786
} else {
@@ -20592,7 +20592,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HA
2059220592
if (IS_VAR & (IS_VAR|IS_TMP_VAR)) {
2059320593
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
2059420594
SAVE_OPLINE();
20595-
ref_dtor_func(Z_COUNTED_P(free_op1));
20595+
zval_dtor_func(Z_COUNTED_P(free_op1));
2059620596
}
2059720597
}
2059820598
} else {
@@ -36744,7 +36744,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HAN
3674436744
if (IS_CV & (IS_VAR|IS_TMP_VAR)) {
3674536745
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
3674636746
SAVE_OPLINE();
36747-
ref_dtor_func(Z_COUNTED_P(free_op1));
36747+
zval_dtor_func(Z_COUNTED_P(free_op1));
3674836748
}
3674936749
}
3675036750
} else {
@@ -41623,7 +41623,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BIND_GLOBAL_SPEC_C
4162341623
if (EXPECTED(variable_ptr != value)) {
4162441624
if (refcnt == 0) {
4162541625
SAVE_OPLINE();
41626-
ref_dtor_func(ref);
41626+
zval_dtor_func(ref);
4162741627
if (UNEXPECTED(EG(exception))) {
4162841628
ZVAL_NULL(variable_ptr);
4162941629
HANDLE_EXCEPTION();
@@ -46762,7 +46762,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_CV_SPEC_CV_UNUSED_HANDLE
4676246762
ZVAL_UNDEF(var);
4676346763
SAVE_OPLINE();
4676446764
if (!GC_DELREF(garbage)) {
46765-
ref_dtor_func(garbage);
46765+
zval_dtor_func(garbage);
4676646766
} else {
4676746767
gc_check_possible_root(garbage);
4676846768
}
@@ -55095,7 +55095,7 @@ ZEND_API void execute_ex(zend_execute_data *ex)
5509555095
if (IS_CONST & (IS_VAR|IS_TMP_VAR)) {
5509655096
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
5509755097
SAVE_OPLINE();
55098-
ref_dtor_func(Z_COUNTED_P(free_op1));
55098+
zval_dtor_func(Z_COUNTED_P(free_op1));
5509955099
}
5510055100
}
5510155101
} else {
@@ -56761,7 +56761,7 @@ ZEND_API void execute_ex(zend_execute_data *ex)
5676156761
if (IS_TMP_VAR & (IS_VAR|IS_TMP_VAR)) {
5676256762
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
5676356763
SAVE_OPLINE();
56764-
ref_dtor_func(Z_COUNTED_P(free_op1));
56764+
zval_dtor_func(Z_COUNTED_P(free_op1));
5676556765
}
5676656766
}
5676756767
} else {
@@ -57051,7 +57051,7 @@ ZEND_API void execute_ex(zend_execute_data *ex)
5705157051
if (IS_VAR & (IS_VAR|IS_TMP_VAR)) {
5705257052
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
5705357053
SAVE_OPLINE();
57054-
ref_dtor_func(Z_COUNTED_P(free_op1));
57054+
zval_dtor_func(Z_COUNTED_P(free_op1));
5705557055
}
5705657056
}
5705757057
} else {
@@ -58697,7 +58697,7 @@ ZEND_API void execute_ex(zend_execute_data *ex)
5869758697
if (IS_CV & (IS_VAR|IS_TMP_VAR)) {
5869858698
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
5869958699
SAVE_OPLINE();
58700-
ref_dtor_func(Z_COUNTED_P(free_op1));
58700+
zval_dtor_func(Z_COUNTED_P(free_op1));
5870158701
}
5870258702
}
5870358703
} else {

0 commit comments

Comments
 (0)