summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-09-25 11:50:38 +0300
committerDmitry Stogov <dmitry@zend.com>2015-09-25 11:50:38 +0300
commita05fc48055dee5562b97f8ea8c598186852f2cea (patch)
treebcaed579ab47a6a04166eaeab5960c834d93531c /Zend/zend_opcode.c
parentf509706318bcd7198faff747f0eab326f2953524 (diff)
downloadphp-git-a05fc48055dee5562b97f8ea8c598186852f2cea.tar.gz
Extended zend_extension API to allow storing additional data associated with op_arrays in opcache SHM. (op_array->reserved[])
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 1a78148823..8abfd7a56c 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -99,7 +99,9 @@ void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_siz
memset(op_array->reserved, 0, ZEND_MAX_RESERVED_RESOURCES * sizeof(void*));
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_ctor_handler, op_array);
+ if (zend_extension_flags & ZEND_EXTENSIONS_HAVE_OP_ARRAY_CTOR) {
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_ctor_handler, op_array);
+ }
}
ZEND_API void destroy_zend_function(zend_function *function)
@@ -391,8 +393,10 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
if (op_array->try_catch_array) {
efree(op_array->try_catch_array);
}
- if (op_array->fn_flags & ZEND_ACC_DONE_PASS_TWO) {
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_dtor_handler, op_array);
+ if (zend_extension_flags & ZEND_EXTENSIONS_HAVE_OP_ARRAY_DTOR) {
+ if (op_array->fn_flags & ZEND_ACC_DONE_PASS_TWO) {
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_dtor_handler, op_array);
+ }
}
if (op_array->arg_info) {
int32_t num_args = op_array->num_args;
@@ -582,7 +586,9 @@ ZEND_API int pass_two(zend_op_array *op_array)
zend_update_extended_info(op_array);
}
if (CG(compiler_options) & ZEND_COMPILE_HANDLE_OP_ARRAY) {
- zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array);
+ if (zend_extension_flags & ZEND_EXTENSIONS_HAVE_OP_ARRAY_PERSIST) {
+ zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array);
+ }
}
if (CG(context).vars_size != op_array->last_var) {