summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2014-04-22 11:59:53 +0800
committerXinchen Hui <laruence@gmail.com>2014-04-22 11:59:53 +0800
commit89d89b95861c4366f93e705546c0ca8c4443a425 (patch)
treed59aaef97b53a61bc7c10de368dad7adcc34fef7 /Zend/zend_opcode.c
parente48b9ad197b4ec6ac72e75538453cc350d0a41f4 (diff)
parentfa588a5c82c0264dc10862495c993a914a421667 (diff)
downloadphp-git-89d89b95861c4366f93e705546c0ca8c4443a425.tar.gz
Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c65
1 files changed, 10 insertions, 55 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 087960ca33..1987d819b8 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -132,42 +132,26 @@ ZEND_API void zend_function_dtor(zval *zv)
pefree(function, function->type == ZEND_INTERNAL_FUNCTION);
}
-static void zend_cleanup_op_array_data(zend_op_array *op_array)
+ZEND_API void zend_cleanup_op_array_data(zend_op_array *op_array)
{
if (op_array->static_variables) {
zend_hash_clean(op_array->static_variables);
}
}
-ZEND_API int zend_cleanup_function_data(zval *zv TSRMLS_DC)
-{
- zend_function *function = Z_PTR_P(zv);
-
- if (function->type == ZEND_USER_FUNCTION) {
- zend_cleanup_op_array_data((zend_op_array *) function);
- return ZEND_HASH_APPLY_KEEP;
- } else {
- return ZEND_HASH_APPLY_STOP;
- }
-}
-
-ZEND_API int zend_cleanup_function_data_full(zval *zv TSRMLS_DC)
-{
- zend_function *function = Z_PTR_P(zv);
-
- if (function->type == ZEND_USER_FUNCTION) {
- zend_cleanup_op_array_data((zend_op_array *) function);
- }
- return 0;
-}
-
-static inline void cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC)
+ZEND_API void zend_cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC)
{
/* Clean all parts that can contain run-time data */
/* Note that only run-time accessed data need to be cleaned up, pre-defined data can
not contain objects and thus are not probelmatic */
if (ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS) {
- zend_hash_apply(&ce->function_table, zend_cleanup_function_data_full TSRMLS_CC);
+ zend_function *func;
+
+ ZEND_HASH_FOREACH_PTR(&ce->function_table, func) {
+ if (func->type == ZEND_USER_FUNCTION) {
+ zend_cleanup_op_array_data((zend_op_array *) func);
+ }
+ } ZEND_HASH_FOREACH_END();
}
if (ce->static_members_table) {
int i;
@@ -185,7 +169,7 @@ static inline void cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC)
}
}
-static inline void cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC)
+ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC)
{
if (CE_STATIC_MEMBERS(ce)) {
int i;
@@ -202,35 +186,6 @@ static inline void cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC)
}
}
-ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC)
-{
- cleanup_internal_class_data(ce TSRMLS_CC);
-}
-
-ZEND_API int zend_cleanup_user_class_data(zval *zv TSRMLS_DC)
-{
- zend_class_entry *ce = Z_PTR_P(zv);
-
- if (ce->type == ZEND_USER_CLASS) {
- cleanup_user_class_data(ce TSRMLS_CC);
- return ZEND_HASH_APPLY_KEEP;
- } else {
- return ZEND_HASH_APPLY_STOP;
- }
-}
-
-ZEND_API int zend_cleanup_class_data(zval *zv TSRMLS_DC)
-{
- zend_class_entry *ce = Z_PTR_P(zv);
-
- if (ce->type == ZEND_USER_CLASS) {
- cleanup_user_class_data(ce TSRMLS_CC);
- } else {
- cleanup_internal_class_data(ce TSRMLS_CC);
- }
- return 0;
-}
-
void _destroy_zend_class_traits_info(zend_class_entry *ce)
{
if (ce->num_traits > 0 && ce->traits) {