Lines Matching refs:func

37 	zend_function     func;  member
49 zend_function *func = EX(func); in ZEND_METHOD() local
57 zend_string_release_ex(func->internal_function.function_name, 0); in ZEND_METHOD()
58 efree(func); in ZEND_METHOD()
60 execute_data->func = NULL; in ZEND_METHOD()
68 zend_function *func = &closure->func; in zend_valid_closure_binding() local
69 zend_bool is_fake_closure = (func->common.fn_flags & ZEND_ACC_FAKE_CLOSURE) != 0; in zend_valid_closure_binding()
71 if (func->common.fn_flags & ZEND_ACC_STATIC) { in zend_valid_closure_binding()
76 if (is_fake_closure && func->common.scope && in zend_valid_closure_binding()
77 !instanceof_function(Z_OBJCE_P(newthis), func->common.scope)) { in zend_valid_closure_binding()
80 ZSTR_VAL(func->common.scope->name), in zend_valid_closure_binding()
81 ZSTR_VAL(func->common.function_name), in zend_valid_closure_binding()
85 } else if (is_fake_closure && func->common.scope in zend_valid_closure_binding()
86 && !(func->common.fn_flags & ZEND_ACC_STATIC)) { in zend_valid_closure_binding()
87 if (func->type == ZEND_INTERNAL_FUNCTION) { in zend_valid_closure_binding()
94 && (func->common.fn_flags & ZEND_ACC_USES_THIS)) { in zend_valid_closure_binding()
99 if (scope && scope != func->common.scope && scope->type == ZEND_INTERNAL_CLASS) { in zend_valid_closure_binding()
106 if (is_fake_closure && scope != func->common.scope) { in zend_valid_closure_binding()
107 if (func->common.scope == NULL) { in zend_valid_closure_binding()
145 if (closure->func.common.fn_flags & ZEND_ACC_GENERATOR) { in ZEND_METHOD()
147 …zend_create_closure(&new_closure, &closure->func, Z_OBJCE_P(newthis), closure->called_scope, newth… in ZEND_METHOD()
149 fci_cache.function_handler = &closure->func; in ZEND_METHOD()
151 …memcpy(&my_function, &closure->func, closure->func.type == ZEND_USER_FUNCTION ? sizeof(zend_op_arr… in ZEND_METHOD()
155 if (closure->func.type == ZEND_INTERNAL_FUNCTION) { in ZEND_METHOD()
162 && (closure->func.common.scope != Z_OBJCE_P(newthis) in ZEND_METHOD()
163 || (closure->func.common.fn_flags & ZEND_ACC_HEAP_RT_CACHE))) { in ZEND_METHOD()
223 ce = closure->func.common.scope; in ZEND_METHOD()
232 ce = closure->func.common.scope; in ZEND_METHOD()
245 zend_create_closure(return_value, &closure->func, ce, called_scope, newthis); in ZEND_METHOD()
260 fcc.function_handler = (EX(func)->internal_function.fn_flags & ZEND_ACC_STATIC) ? in ZEND_NAMED_FUNCTION()
261 EX(func)->internal_function.scope->__callstatic : EX(func)->internal_function.scope->__call; in ZEND_NAMED_FUNCTION()
264 ZVAL_STR(&fci.params[0], EX(func)->common.function_name); in ZEND_NAMED_FUNCTION()
390 invoke->common = closure->func.common; in zend_get_closure_invoke_method()
398 ZEND_ACC_PUBLIC | ZEND_ACC_CALL_VIA_HANDLER | (closure->func.common.fn_flags & keep_flags); in zend_get_closure_invoke_method()
399 …if (closure->func.type != ZEND_INTERNAL_FUNCTION || (closure->func.common.fn_flags & ZEND_ACC_USER… in zend_get_closure_invoke_method()
414 return &closure->func; in zend_get_closure_method_def()
477 if (closure->func.type == ZEND_USER_FUNCTION) { in zend_closure_free_storage()
478 destroy_op_array(&closure->func.op_array); in zend_closure_free_storage()
480 zend_string_release(closure->func.common.function_name); in zend_closure_free_storage()
508 zend_create_closure(&result, &closure->func, in zend_closure_clone()
509 closure->func.common.scope, closure->called_scope, &closure->this_ptr); in zend_closure_clone()
517 *fptr_ptr = &closure->func; in zend_closure_get_closure()
534 struct _zend_arg_info *arg_info = closure->func.common.arg_info; in zend_closure_get_debug_info()
536 …zend_bool zstr_args = (closure->func.type == ZEND_USER_FUNCTION) || (closure->func.common.fn_flags… in zend_closure_get_debug_info()
542 if (closure->func.type == ZEND_USER_FUNCTION && closure->func.op_array.static_variables) { in zend_closure_get_debug_info()
545 ZEND_MAP_PTR_GET(closure->func.op_array.static_variables_ptr); in zend_closure_get_debug_info()
562 (closure->func.common.num_args || in zend_closure_get_debug_info()
563 (closure->func.common.fn_flags & ZEND_ACC_VARIADIC))) { in zend_closure_get_debug_info()
564 uint32_t i, num_args, required = closure->func.common.required_num_args; in zend_closure_get_debug_info()
568 num_args = closure->func.common.num_args; in zend_closure_get_debug_info()
569 if (closure->func.common.fn_flags & ZEND_ACC_VARIADIC) { in zend_closure_get_debug_info()
608 return (closure->func.type == ZEND_USER_FUNCTION) ? in zend_closure_get_gc()
609 ZEND_MAP_PTR_GET(closure->func.op_array.static_variables_ptr) : NULL; in zend_closure_get_gc()
680 zend_closure *closure = (zend_closure*)ZEND_CLOSURE_OBJECT(EX(func)); in ZEND_NAMED_FUNCTION()
683 EX(func) = NULL; in ZEND_NAMED_FUNCTION()
687 ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_cla… in zend_create_closure() argument
701 if (func->type == ZEND_USER_FUNCTION) { in zend_create_closure()
702 memcpy(&closure->func, func, sizeof(zend_op_array)); in zend_create_closure()
703 closure->func.common.fn_flags |= ZEND_ACC_CLOSURE; in zend_create_closure()
704 closure->func.common.fn_flags &= ~ZEND_ACC_IMMUTABLE; in zend_create_closure()
706 if (closure->func.op_array.static_variables) { in zend_create_closure()
707 closure->func.op_array.static_variables = in zend_create_closure()
708 zend_array_dup(closure->func.op_array.static_variables); in zend_create_closure()
710 ZEND_MAP_PTR_INIT(closure->func.op_array.static_variables_ptr, in zend_create_closure()
711 &closure->func.op_array.static_variables); in zend_create_closure()
714 if (!ZEND_MAP_PTR_GET(closure->func.op_array.run_time_cache) in zend_create_closure()
715 || func->common.scope != scope in zend_create_closure()
716 || (func->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE) in zend_create_closure()
720 if (!ZEND_MAP_PTR_GET(func->op_array.run_time_cache) in zend_create_closure()
721 && (func->common.fn_flags & ZEND_ACC_CLOSURE) in zend_create_closure()
722 && (func->common.scope == scope || in zend_create_closure()
723 !(func->common.fn_flags & ZEND_ACC_IMMUTABLE))) { in zend_create_closure()
726 if (func->common.scope != scope) { in zend_create_closure()
727 func->common.scope = scope; in zend_create_closure()
729 closure->func.op_array.fn_flags &= ~ZEND_ACC_HEAP_RT_CACHE; in zend_create_closure()
730 ptr = zend_arena_alloc(&CG(arena), func->op_array.cache_size); in zend_create_closure()
731 ZEND_MAP_PTR_SET(func->op_array.run_time_cache, ptr); in zend_create_closure()
732 ZEND_MAP_PTR_SET(closure->func.op_array.run_time_cache, ptr); in zend_create_closure()
735 closure->func.op_array.fn_flags |= ZEND_ACC_HEAP_RT_CACHE; in zend_create_closure()
736 ptr = emalloc(sizeof(void*) + func->op_array.cache_size); in zend_create_closure()
737 ZEND_MAP_PTR_INIT(closure->func.op_array.run_time_cache, ptr); in zend_create_closure()
739 ZEND_MAP_PTR_SET(closure->func.op_array.run_time_cache, ptr); in zend_create_closure()
741 memset(ptr, 0, func->op_array.cache_size); in zend_create_closure()
743 if (closure->func.op_array.refcount) { in zend_create_closure()
744 (*closure->func.op_array.refcount)++; in zend_create_closure()
747 memcpy(&closure->func, func, sizeof(zend_internal_function)); in zend_create_closure()
748 closure->func.common.fn_flags |= ZEND_ACC_CLOSURE; in zend_create_closure()
750 if (UNEXPECTED(closure->func.internal_function.handler == zend_closure_internal_handler)) { in zend_create_closure()
752 zend_closure *nested = (zend_closure*)((char*)func - XtOffsetOf(zend_closure, func)); in zend_create_closure()
756 closure->orig_internal_handler = closure->func.internal_function.handler; in zend_create_closure()
758 closure->func.internal_function.handler = zend_closure_internal_handler; in zend_create_closure()
759 if (!func->common.scope) { in zend_create_closure()
769 closure->func.common.scope = scope; in zend_create_closure()
772 closure->func.common.fn_flags |= ZEND_ACC_PUBLIC; in zend_create_closure()
773 …if (this_ptr && Z_TYPE_P(this_ptr) == IS_OBJECT && (closure->func.common.fn_flags & ZEND_ACC_STATI… in zend_create_closure()
781 ZEND_API void zend_create_fake_closure(zval *res, zend_function *func, zend_class_entry *scope, zen… in zend_create_fake_closure() argument
785 zend_create_closure(res, func, scope, called_scope, this_ptr); in zend_create_fake_closure()
788 closure->func.common.fn_flags |= ZEND_ACC_FAKE_CLOSURE; in zend_create_fake_closure()
795 HashTable *static_variables = ZEND_MAP_PTR_GET(closure->func.op_array.static_variables_ptr); in zend_closure_bind_var()
803 HashTable *static_variables = ZEND_MAP_PTR_GET(closure->func.op_array.static_variables_ptr); in zend_closure_bind_var_ex()