summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2018-07-06 18:47:30 +0800
committerXinchen Hui <laruence@gmail.com>2018-07-06 18:47:30 +0800
commitf9297387f434b91e75db64ea32df8f22ee98bcde (patch)
tree5b02e621b4adc3e13c0f2a1c88345e7743d20cac
parente3355ac5ec1787b84ffd08c863dfbd26fe7bfb0f (diff)
downloadphp-git-f9297387f434b91e75db64ea32df8f22ee98bcde.tar.gz
Rename zval_dtor_func and ref_dotr_func
-rw-r--r--Zend/zend_execute.c6
-rw-r--r--Zend/zend_execute.h6
-rw-r--r--Zend/zend_gc.c2
-rw-r--r--Zend/zend_variables.c34
-rw-r--r--Zend/zend_variables.h9
-rw-r--r--Zend/zend_vm_def.h6
-rw-r--r--Zend/zend_vm_execute.h20
-rw-r--r--ext/soap/php_packet_soap.c2
8 files changed, 43 insertions, 42 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index afddbc1643..588ee0d814 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -146,7 +146,7 @@ ZEND_API const zend_internal_function zend_pass_function = {
if (EXPECTED(Z_TYPE_P(__zv) == IS_INDIRECT)) { \
ZVAL_COPY(__zv, Z_INDIRECT_P(__zv)); \
} \
- zval_dtor_func(__ref); \
+ ref_dtor_func(__ref); \
} \
} \
} while (0)
@@ -604,7 +604,7 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
if (GC_DELREF(garbage) == 0) {
ZVAL_REF(variable_ptr, ref);
- zval_dtor_func(garbage);
+ ref_dtor_func(garbage);
return;
} else {
gc_check_possible_root(garbage);
@@ -2366,7 +2366,7 @@ static zend_always_inline void i_free_compiled_variables(zend_execute_data *exec
zend_refcounted *r = Z_COUNTED_P(cv);
if (!GC_DELREF(r)) {
ZVAL_NULL(cv);
- zval_dtor_func(r);
+ ref_dtor_func(r);
} else {
gc_check_possible_root(r);
}
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index c90531cb22..9701f1d6d8 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -107,7 +107,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
Z_ADDREF_P(variable_ptr);
}
}
- zval_dtor_func(garbage);
+ ref_dtor_func(garbage);
return variable_ptr;
} else { /* we need to split */
/* 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
zend_refcounted *r = Z_COUNTED_P(p);
if (!GC_DELREF(r)) {
ZVAL_NULL(p);
- zval_dtor_func(r);
+ ref_dtor_func(r);
} else {
gc_check_possible_root(r);
}
@@ -259,7 +259,7 @@ static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call)
zend_refcounted *r = Z_COUNTED_P(p);
if (!GC_DELREF(r)) {
ZVAL_NULL(p);
- zval_dtor_func(r);
+ ref_dtor_func(r);
}
}
p++;
diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c
index ea19a77573..a921672cc0 100644
--- a/Zend/zend_gc.c
+++ b/Zend/zend_gc.c
@@ -512,7 +512,7 @@ static zend_never_inline void ZEND_FASTCALL gc_possible_root_when_full(zend_refc
GC_ADDREF(ref);
gc_adjust_threshold(gc_collect_cycles());
if (UNEXPECTED(GC_DELREF(ref)) == 0) {
- zval_dtor_func(ref);
+ ref_dtor_func(ref);
return;
} else if (UNEXPECTED(GC_INFO(ref))) {
return;
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index 32612f6cf0..aa543694d8 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -44,27 +44,27 @@ static void ZEND_FASTCALL zend_ast_ref_destroy_wrapper(zend_ast_ref *ast ZEND_FI
# define zend_ast_ref_destroy_wrapper zend_ast_ref_destroy
#endif
-typedef void (ZEND_FASTCALL *zend_zval_dtor_func_t)(zend_refcounted *p ZEND_FILE_LINE_DC);
-
-static const zend_zval_dtor_func_t zend_zval_dtor_func[] = {
- /* IS_UNDEF */ (zend_zval_dtor_func_t)zend_empty_destroy,
- /* IS_NULL */ (zend_zval_dtor_func_t)zend_empty_destroy,
- /* IS_FALSE */ (zend_zval_dtor_func_t)zend_empty_destroy,
- /* IS_TRUE */ (zend_zval_dtor_func_t)zend_empty_destroy,
- /* IS_LONG */ (zend_zval_dtor_func_t)zend_empty_destroy,
- /* IS_DOUBLE */ (zend_zval_dtor_func_t)zend_empty_destroy,
- /* IS_STRING */ (zend_zval_dtor_func_t)zend_string_destroy,
- /* IS_ARRAY */ (zend_zval_dtor_func_t)zend_array_destroy_wrapper,
- /* IS_OBJECT */ (zend_zval_dtor_func_t)zend_object_destroy_wrapper,
- /* IS_RESOURCE */ (zend_zval_dtor_func_t)zend_resource_destroy_wrapper,
- /* IS_REFERENCE */ (zend_zval_dtor_func_t)zend_reference_destroy,
- /* IS_CONSTANT_AST */ (zend_zval_dtor_func_t)zend_ast_ref_destroy_wrapper
+typedef void (ZEND_FASTCALL *zend_ref_dtor_func_t)(zend_refcounted *p ZEND_FILE_LINE_DC);
+
+static const zend_ref_dtor_func_t zend_ref_dtor_func[] = {
+ /* IS_UNDEF */ (zend_ref_dtor_func_t)zend_empty_destroy,
+ /* IS_NULL */ (zend_ref_dtor_func_t)zend_empty_destroy,
+ /* IS_FALSE */ (zend_ref_dtor_func_t)zend_empty_destroy,
+ /* IS_TRUE */ (zend_ref_dtor_func_t)zend_empty_destroy,
+ /* IS_LONG */ (zend_ref_dtor_func_t)zend_empty_destroy,
+ /* IS_DOUBLE */ (zend_ref_dtor_func_t)zend_empty_destroy,
+ /* IS_STRING */ (zend_ref_dtor_func_t)zend_string_destroy,
+ /* IS_ARRAY */ (zend_ref_dtor_func_t)zend_array_destroy_wrapper,
+ /* IS_OBJECT */ (zend_ref_dtor_func_t)zend_object_destroy_wrapper,
+ /* IS_RESOURCE */ (zend_ref_dtor_func_t)zend_resource_destroy_wrapper,
+ /* IS_REFERENCE */ (zend_ref_dtor_func_t)zend_reference_destroy,
+ /* IS_CONSTANT_AST */ (zend_ref_dtor_func_t)zend_ast_ref_destroy_wrapper
};
-ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
+ZEND_API void ZEND_FASTCALL _ref_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
{
ZEND_ASSERT(GC_TYPE(p) <= IS_CONSTANT_AST);
- zend_zval_dtor_func[GC_TYPE(p)](p ZEND_FILE_LINE_RELAY_CC);
+ zend_ref_dtor_func[GC_TYPE(p)](p ZEND_FILE_LINE_RELAY_CC);
}
static void ZEND_FASTCALL zend_string_destroy(zend_string *str ZEND_FILE_LINE_DC)
diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h
index ebc6c5b40c..50cd38c28d 100644
--- a/Zend/zend_variables.h
+++ b/Zend/zend_variables.h
@@ -28,16 +28,16 @@
BEGIN_EXTERN_C()
-ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC);
+ZEND_API void ZEND_FASTCALL _ref_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC);
ZEND_API void ZEND_FASTCALL _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC);
-#define zval_dtor_func(zv) _zval_dtor_func(zv ZEND_FILE_LINE_CC)
+#define ref_dtor_func(ref) _ref_dtor_func(ref ZEND_FILE_LINE_CC)
#define zval_copy_ctor_func(zv) _zval_copy_ctor_func(zv ZEND_FILE_LINE_CC)
static zend_always_inline void _zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LINE_DC)
{
if (Z_REFCOUNTED_P(zval_ptr) && !Z_DELREF_P(zval_ptr)) {
- _zval_dtor_func(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_RELAY_CC);
+ _ref_dtor_func(Z_COUNTED_P(zval_ptr) ZEND_FILE_LINE_RELAY_CC);
}
}
@@ -46,7 +46,7 @@ static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC)
if (Z_REFCOUNTED_P(zval_ptr)) {
zend_refcounted *ref = Z_COUNTED_P(zval_ptr);
if (!GC_DELREF(ref)) {
- _zval_dtor_func(ref ZEND_FILE_LINE_RELAY_CC);
+ _ref_dtor_func(ref ZEND_FILE_LINE_RELAY_CC);
} else {
gc_check_possible_root(ref);
}
@@ -92,6 +92,7 @@ ZEND_API void _zval_internal_ptr_dtor(zval *zvalue ZEND_FILE_LINE_DC);
/* Kept for compatibility */
#define zval_dtor(zvalue) zval_ptr_dtor_nogc(zvalue)
#define zval_internal_dtor(zvalue) _zval_internal_ptr_dtor((zvalue) ZEND_FILE_LINE_CC)
+#define zval_dtor_func _ref_dtor_func
#if ZEND_DEBUG
ZEND_API void _zval_ptr_dtor_wrapper(zval *zval_ptr);
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index e6d665a368..28691935c7 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -3813,7 +3813,7 @@ ZEND_VM_HOT_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY)
if (OP1_TYPE & (IS_VAR|IS_TMP_VAR)) {
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
SAVE_OPLINE();
- zval_dtor_func(Z_COUNTED_P(free_op1));
+ ref_dtor_func(Z_COUNTED_P(free_op1));
}
}
} else {
@@ -5441,7 +5441,7 @@ ZEND_VM_HANDLER(196, ZEND_UNSET_CV, CV, UNUSED)
ZVAL_UNDEF(var);
SAVE_OPLINE();
if (!GC_DELREF(garbage)) {
- zval_dtor_func(garbage);
+ ref_dtor_func(garbage);
} else {
gc_check_possible_root(garbage);
}
@@ -7489,7 +7489,7 @@ ZEND_VM_C_LABEL(check_indirect):
if (EXPECTED(variable_ptr != value)) {
if (refcnt == 0) {
SAVE_OPLINE();
- zval_dtor_func(ref);
+ ref_dtor_func(ref);
if (UNEXPECTED(EG(exception))) {
ZVAL_NULL(variable_ptr);
HANDLE_EXCEPTION();
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 147c57a0d3..9e3add1480 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -2773,7 +2773,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_
if (IS_CONST & (IS_VAR|IS_TMP_VAR)) {
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
SAVE_OPLINE();
- zval_dtor_func(Z_COUNTED_P(free_op1));
+ ref_dtor_func(Z_COUNTED_P(free_op1));
}
}
} else {
@@ -17780,7 +17780,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HA
if (IS_TMP_VAR & (IS_VAR|IS_TMP_VAR)) {
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
SAVE_OPLINE();
- zval_dtor_func(Z_COUNTED_P(free_op1));
+ ref_dtor_func(Z_COUNTED_P(free_op1));
}
}
} else {
@@ -20592,7 +20592,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HA
if (IS_VAR & (IS_VAR|IS_TMP_VAR)) {
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
SAVE_OPLINE();
- zval_dtor_func(Z_COUNTED_P(free_op1));
+ ref_dtor_func(Z_COUNTED_P(free_op1));
}
}
} else {
@@ -36744,7 +36744,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HAN
if (IS_CV & (IS_VAR|IS_TMP_VAR)) {
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
SAVE_OPLINE();
- zval_dtor_func(Z_COUNTED_P(free_op1));
+ ref_dtor_func(Z_COUNTED_P(free_op1));
}
}
} else {
@@ -41623,7 +41623,7 @@ check_indirect:
if (EXPECTED(variable_ptr != value)) {
if (refcnt == 0) {
SAVE_OPLINE();
- zval_dtor_func(ref);
+ ref_dtor_func(ref);
if (UNEXPECTED(EG(exception))) {
ZVAL_NULL(variable_ptr);
HANDLE_EXCEPTION();
@@ -46762,7 +46762,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_CV_SPEC_CV_UNUSED_HANDLE
ZVAL_UNDEF(var);
SAVE_OPLINE();
if (!GC_DELREF(garbage)) {
- zval_dtor_func(garbage);
+ ref_dtor_func(garbage);
} else {
gc_check_possible_root(garbage);
}
@@ -55095,7 +55095,7 @@ zend_leave_helper_SPEC_LABEL:
if (IS_CONST & (IS_VAR|IS_TMP_VAR)) {
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
SAVE_OPLINE();
- zval_dtor_func(Z_COUNTED_P(free_op1));
+ ref_dtor_func(Z_COUNTED_P(free_op1));
}
}
} else {
@@ -56761,7 +56761,7 @@ zend_leave_helper_SPEC_LABEL:
if (IS_TMP_VAR & (IS_VAR|IS_TMP_VAR)) {
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
SAVE_OPLINE();
- zval_dtor_func(Z_COUNTED_P(free_op1));
+ ref_dtor_func(Z_COUNTED_P(free_op1));
}
}
} else {
@@ -57051,7 +57051,7 @@ zend_leave_helper_SPEC_LABEL:
if (IS_VAR & (IS_VAR|IS_TMP_VAR)) {
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
SAVE_OPLINE();
- zval_dtor_func(Z_COUNTED_P(free_op1));
+ ref_dtor_func(Z_COUNTED_P(free_op1));
}
}
} else {
@@ -58697,7 +58697,7 @@ zend_leave_helper_SPEC_LABEL:
if (IS_CV & (IS_VAR|IS_TMP_VAR)) {
if (Z_REFCOUNTED_P(free_op1) && !Z_DELREF_P(free_op1)) {
SAVE_OPLINE();
- zval_dtor_func(Z_COUNTED_P(free_op1));
+ ref_dtor_func(Z_COUNTED_P(free_op1));
}
}
} else {
diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c
index 6e8a351c21..9d1253e1cf 100644
--- a/ext/soap/php_packet_soap.c
+++ b/ext/soap/php_packet_soap.c
@@ -385,7 +385,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
} else {
zend_refcounted *garbage = Z_COUNTED_P(return_value);
ZVAL_COPY(return_value, tmp);
- zval_dtor_func(garbage);
+ ref_dtor_func(garbage);
}
}
}