Lines Matching refs:closure

68 		zend_closure *closure, zval *newthis, zend_class_entry *scope) /* {{{ */  in zend_valid_closure_binding()  argument
70 zend_function *func = &closure->func; in zend_valid_closure_binding()
114 zend_closure *closure; in ZEND_METHOD() local
127 closure = (zend_closure *) Z_OBJ_P(zclosure); in ZEND_METHOD()
131 if (!zend_valid_closure_binding(closure, newthis, Z_OBJCE_P(newthis))) { in ZEND_METHOD()
149 …zend_create_closure(&new_closure, fci_cache.function_handler, Z_OBJCE_P(newthis), closure->called_… in ZEND_METHOD()
150 closure = (zend_closure *) Z_OBJ(new_closure); in ZEND_METHOD()
151 fci_cache.function_handler = &closure->func; in ZEND_METHOD()
159 if (ZEND_USER_CODE(my_function.type) && closure->func.common.scope != Z_OBJCE_P(newthis)) { in ZEND_METHOD()
174 --GC_REFCOUNT(&closure->std); in ZEND_METHOD()
175 } else if (ZEND_USER_CODE(my_function.type) && closure->func.common.scope != Z_OBJCE_P(newthis)) { in ZEND_METHOD()
186 zend_closure *closure; in ZEND_METHOD() local
193 closure = (zend_closure *)Z_OBJ_P(zclosure); in ZEND_METHOD()
203 ce = closure->func.common.scope; in ZEND_METHOD()
212 ce = closure->func.common.scope; in ZEND_METHOD()
215 if (!zend_valid_closure_binding(closure, newthis, ce)) { in ZEND_METHOD()
225 zend_create_closure(return_value, &closure->func, ce, called_scope, newthis); in ZEND_METHOD()
350 zend_closure *closure = (zend_closure *)object; in zend_get_closure_invoke_method() local
355 invoke->common = closure->func.common; in zend_get_closure_invoke_method()
363 ZEND_ACC_PUBLIC | ZEND_ACC_CALL_VIA_HANDLER | (closure->func.common.fn_flags & keep_flags); in zend_get_closure_invoke_method()
364 …if (closure->func.type != ZEND_INTERNAL_FUNCTION || (closure->func.common.fn_flags & ZEND_ACC_USER… in zend_get_closure_invoke_method()
378 zend_closure *closure = (zend_closure *)Z_OBJ_P(obj); in zend_get_closure_method_def() local
379 return &closure->func; in zend_get_closure_method_def()
385 zend_closure *closure = (zend_closure *)Z_OBJ_P(obj); in zend_get_closure_this_ptr() local
386 return &closure->this_ptr; in zend_get_closure_this_ptr()
437 zend_closure *closure = (zend_closure *)object; in zend_closure_free_storage() local
439 zend_object_std_dtor(&closure->std); in zend_closure_free_storage()
441 if (closure->func.type == ZEND_USER_FUNCTION) { in zend_closure_free_storage()
442 if (closure->func.op_array.fn_flags & ZEND_ACC_NO_RT_ARENA) { in zend_closure_free_storage()
443 efree(closure->func.op_array.run_time_cache); in zend_closure_free_storage()
444 closure->func.op_array.run_time_cache = NULL; in zend_closure_free_storage()
446 destroy_op_array(&closure->func.op_array); in zend_closure_free_storage()
449 if (Z_TYPE(closure->this_ptr) != IS_UNDEF) { in zend_closure_free_storage()
450 zval_ptr_dtor(&closure->this_ptr); in zend_closure_free_storage()
457 zend_closure *closure; in zend_closure_new() local
459 closure = emalloc(sizeof(zend_closure)); in zend_closure_new()
460 memset(closure, 0, sizeof(zend_closure)); in zend_closure_new()
462 zend_object_std_init(&closure->std, class_type); in zend_closure_new()
463 closure->std.handlers = &closure_handlers; in zend_closure_new()
465 return (zend_object*)closure; in zend_closure_new()
471 zend_closure *closure = (zend_closure *)Z_OBJ_P(zobject); in zend_closure_clone() local
474 zend_create_closure(&result, &closure->func, in zend_closure_clone()
475 closure->func.common.scope, closure->called_scope, &closure->this_ptr); in zend_closure_clone()
482 zend_closure *closure = (zend_closure *)Z_OBJ_P(obj); in zend_closure_get_closure() local
483 *fptr_ptr = &closure->func; in zend_closure_get_closure()
484 *ce_ptr = closure->called_scope; in zend_closure_get_closure()
486 if (Z_TYPE(closure->this_ptr) != IS_UNDEF) { in zend_closure_get_closure()
487 *obj_ptr = Z_OBJ(closure->this_ptr); in zend_closure_get_closure()
498 zend_closure *closure = (zend_closure *)Z_OBJ_P(object); in zend_closure_get_debug_info() local
500 struct _zend_arg_info *arg_info = closure->func.common.arg_info; in zend_closure_get_debug_info()
502 …zend_bool zstr_args = (closure->func.type == ZEND_USER_FUNCTION) || (closure->func.common.fn_flags… in zend_closure_get_debug_info()
509 if (closure->func.type == ZEND_USER_FUNCTION && closure->func.op_array.static_variables) { in zend_closure_get_debug_info()
510 HashTable *static_variables = closure->func.op_array.static_variables; in zend_closure_get_debug_info()
515 if (Z_TYPE(closure->this_ptr) != IS_UNDEF) { in zend_closure_get_debug_info()
516 Z_ADDREF(closure->this_ptr); in zend_closure_get_debug_info()
517 zend_hash_update(debug_info, ZSTR_KNOWN(ZEND_STR_THIS), &closure->this_ptr); in zend_closure_get_debug_info()
521 (closure->func.common.num_args || in zend_closure_get_debug_info()
522 (closure->func.common.fn_flags & ZEND_ACC_VARIADIC))) { in zend_closure_get_debug_info()
523 uint32_t i, num_args, required = closure->func.common.required_num_args; in zend_closure_get_debug_info()
527 num_args = closure->func.common.num_args; in zend_closure_get_debug_info()
528 if (closure->func.common.fn_flags & ZEND_ACC_VARIADIC) { in zend_closure_get_debug_info()
563 zend_closure *closure = (zend_closure *)Z_OBJ_P(obj); in zend_closure_get_gc() local
565 *table = Z_TYPE(closure->this_ptr) != IS_NULL ? &closure->this_ptr : NULL; in zend_closure_get_gc()
566 *n = Z_TYPE(closure->this_ptr) != IS_NULL ? 1 : 0; in zend_closure_get_gc()
567 return (closure->func.type == ZEND_USER_FUNCTION) ? in zend_closure_get_gc()
568 closure->func.op_array.static_variables : NULL; in zend_closure_get_gc()
586 ZEND_ARG_INFO(0, closure)
639 zend_closure *closure = (zend_closure*)EX(func)->common.prototype; in ZEND_NAMED_FUNCTION() local
640 closure->orig_internal_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); in ZEND_NAMED_FUNCTION()
641 OBJ_RELEASE((zend_object*)closure); in ZEND_NAMED_FUNCTION()
648 zend_closure *closure; in zend_create_closure() local
652 closure = (zend_closure *)Z_OBJ_P(res); in zend_create_closure()
661 memcpy(&closure->func, func, sizeof(zend_op_array)); in zend_create_closure()
662 closure->func.common.prototype = (zend_function*)closure; in zend_create_closure()
663 closure->func.common.fn_flags |= ZEND_ACC_CLOSURE; in zend_create_closure()
664 if (closure->func.op_array.static_variables) { in zend_create_closure()
665 closure->func.op_array.static_variables = in zend_create_closure()
666 zend_array_dup(closure->func.op_array.static_variables); in zend_create_closure()
670 if (!closure->func.op_array.run_time_cache in zend_create_closure()
679 closure->func.op_array.run_time_cache = func->op_array.run_time_cache; in zend_create_closure()
682 closure->func.op_array.run_time_cache = emalloc(func->op_array.cache_size); in zend_create_closure()
683 closure->func.op_array.fn_flags |= ZEND_ACC_NO_RT_ARENA; in zend_create_closure()
685 memset(closure->func.op_array.run_time_cache, 0, func->op_array.cache_size); in zend_create_closure()
687 if (closure->func.op_array.refcount) { in zend_create_closure()
688 (*closure->func.op_array.refcount)++; in zend_create_closure()
691 memcpy(&closure->func, func, sizeof(zend_internal_function)); in zend_create_closure()
692 closure->func.common.prototype = (zend_function*)closure; in zend_create_closure()
693 closure->func.common.fn_flags |= ZEND_ACC_CLOSURE; in zend_create_closure()
695 if (UNEXPECTED(closure->func.internal_function.handler == zend_closure_internal_handler)) { in zend_create_closure()
699 closure->orig_internal_handler = nested->orig_internal_handler; in zend_create_closure()
701 closure->orig_internal_handler = closure->func.internal_function.handler; in zend_create_closure()
703 closure->func.internal_function.handler = zend_closure_internal_handler; in zend_create_closure()
711 ZVAL_UNDEF(&closure->this_ptr); in zend_create_closure()
714 closure->func.common.scope = scope; in zend_create_closure()
715 closure->called_scope = called_scope; in zend_create_closure()
717 closure->func.common.fn_flags |= ZEND_ACC_PUBLIC; in zend_create_closure()
718 …if (this_ptr && Z_TYPE_P(this_ptr) == IS_OBJECT && (closure->func.common.fn_flags & ZEND_ACC_STATI… in zend_create_closure()
719 ZVAL_COPY(&closure->this_ptr, this_ptr); in zend_create_closure()
727 zend_closure *closure; in zend_create_fake_closure() local
731 closure = (zend_closure *)Z_OBJ_P(res); in zend_create_fake_closure()
732 closure->func.common.fn_flags |= ZEND_ACC_FAKE_CLOSURE; in zend_create_fake_closure()
738 zend_closure *closure = (zend_closure *) Z_OBJ_P(closure_zv); in zend_closure_bind_var() local
739 HashTable *static_variables = closure->func.op_array.static_variables; in zend_closure_bind_var()