Ruby
2.4.2p198(2017-09-14revision59899)
|
Go to the source code of this file.
Data Structures | |
struct | METHOD |
struct | cfunc_proc_t |
Macros | |
#define | PROC_NEW_REQUIRES_BLOCK 0 |
#define | NO_CLOBBERED(v) (*(volatile VALUE *)&(v)) |
#define | attached id__attached__ |
#define | IS_METHOD_PROC_IFUNC(ifunc) ((ifunc)->func == bmcall) |
#define | check_argc(argc) (argc) |
#define | MSG(s) rb_fstring_cstr("undefined method `%1$s' for"s" `%2$s'") |
Variables | |
VALUE | rb_cUnboundMethod |
VALUE | rb_cMethod |
VALUE | rb_cBinding |
VALUE | rb_cProc |
static const rb_data_type_t | proc_data_type |
const rb_data_type_t | ruby_binding_data_type |
static const char | proc_without_block [] = "tried to create Proc object without a block" |
static const rb_data_type_t | method_data_type |
#define attached id__attached__ |
Definition at line 45 of file proc.c.
Referenced by method_inspect(), and rb_method_name_error().
Definition at line 875 of file proc.c.
Referenced by curry(), rb_block_lambda(), rb_method_entry_min_max_arity(), and rb_proc_call().
Definition at line 49 of file proc.c.
Referenced by proc_binding(), rb_proc_get_iseq(), and rb_vm_block_min_max_arity().
#define MSG | ( | s | ) | rb_fstring_cstr("undefined method `%1$s' for"s" `%2$s'") |
Referenced by ole_msg_loop(), and rb_method_name_error().
#define NO_CLOBBERED | ( | v | ) | (*(volatile VALUE *)&(v)) |
Definition at line 22 of file proc.c.
Referenced by call_method_data_safe().
Definition at line 385 of file proc.c.
References Qnil, rb_f_eval(), and rb_scan_args().
Referenced by Init_Binding().
Definition at line 584 of file proc.c.
References rb_binding_t::block, check_local_id(), env, get_local_variable_ptr(), GetBindingPtr, Qfalse, Qtrue, vm_block_ep(), and VM_ENV_ENVVAL_PTR().
Referenced by Init_Binding().
Definition at line 496 of file proc.c.
References rb_binding_t::block, check_local_id(), env, get_local_variable_ptr(), GetBindingPtr, ID2SYM, NULL, rb_name_err_raise, undefined, vm_block_ep(), and VM_ENV_ENVVAL_PTR().
Referenced by Init_Binding().
Definition at line 544 of file proc.c.
References rb_binding_t::block, check_local_id(), env, get_local_variable_ptr(), GetBindingPtr, NULL, rb_binding_add_dynavars(), rb_intern_str, RB_OBJ_WRITE, val, vm_block_ep(), and VM_ENV_ENVVAL_PTR().
Referenced by Init_Binding().
Definition at line 468 of file proc.c.
References rb_binding_t::block, env, GetBindingPtr, rb_vm_env_local_variables(), vm_block_ep(), and VM_ENV_ENVVAL_PTR().
Referenced by Init_Binding().
Definition at line 604 of file proc.c.
References rb_binding_t::block, GetBindingPtr, and vm_block_self().
Referenced by Init_Binding().
Definition at line 332 of file proc.c.
References binding_dup(), and CLONESETUP.
Referenced by Init_Binding().
Definition at line 318 of file proc.c.
References rb_binding_t::block, rb_binding_t::first_lineno, GetBindingPtr, rb_binding_t::path, rb_binding_alloc(), and rb_cBinding.
Referenced by binding_clone(), and Init_Binding().
|
static |
Definition at line 266 of file proc.c.
References RUBY_FREE_ENTER, RUBY_FREE_LEAVE, and ruby_xfree().
|
static |
Definition at line 278 of file proc.c.
References rb_binding_t::block, block_mark(), rb_binding_t::path, RUBY_MARK_ENTER, RUBY_MARK_LEAVE, and RUBY_MARK_UNLESS_NULL.
Definition at line 54 of file proc.c.
References rb_block::as, block_type_ifunc, block_type_iseq, block_type_proc, block_type_symbol, rb_block::captured, rb_captured_block::code, rb_captured_block::ep, rb_block::proc, Qundef, RUBY_MARK_UNLESS_NULL, rb_captured_block::self, rb_block::symbol, rb_captured_block::val, vm_block_type(), VM_ENV_DATA_INDEX_ENV, and VM_ENV_ENVVAL().
Referenced by binding_mark(), and proc_mark().
Definition at line 1019 of file proc.c.
References rb_block::as, block_handler_type_ifunc, block_handler_type_iseq, block_handler_type_proc, block_handler_type_symbol, block_type_ifunc, block_type_iseq, block_type_proc, block_type_symbol, rb_block::captured, rb_block::proc, rb_block::symbol, rb_block::type, VM_BH_TO_IFUNC_BLOCK(), VM_BH_TO_ISEQ_BLOCK(), VM_BH_TO_PROC(), VM_BH_TO_SYMBOL(), and vm_block_handler_type().
Referenced by rb_block_arity(), and rb_block_min_max_arity().
|
static |
Definition at line 1324 of file proc.c.
References METHOD::klass, METHOD::me, rb_gc_mark(), and METHOD::recv.
Definition at line 2655 of file proc.c.
References rb_method_call_with_block().
Referenced by method_to_proc().
|
inlinestatic |
Definition at line 2096 of file proc.c.
References rb_method_entry_struct::called_id, METHOD::me, method_callable_method_entry(), proc_to_block_handler(), rb_vm_call(), METHOD::recv, and vm_passed_block_handler_set().
Referenced by call_method_data_safe(), and rb_method_call_with_block().
|
static |
Definition at line 2105 of file proc.c.
References call_method_data(), NO_CLOBBERED, Qnil, rb_set_safe_level_force(), result, TH_EXEC_TAG, TH_JUMP_TAG, TH_POP_TAG, and TH_PUSH_TAG.
Referenced by rb_method_call_with_block().
Definition at line 612 of file proc.c.
References rb_block::as, cfunc_proc_t::basic, rb_proc_t::block, block_type_ifunc, rb_block::captured, rb_captured_block::code, cfunc_proc_t::env, rb_captured_block::ep, rb_captured_block::ifunc, rb_proc_t::is_lambda, Qfalse, Qundef, RB_OBJ_WRITE, TypedData_Make_Struct, VM_BLOCK_HANDLER_NONE, vm_block_type_set(), VM_ENV_DATA_INDEX_ENV, VM_ENV_DATA_INDEX_FLAGS, VM_ENV_DATA_INDEX_ME_CREF, VM_ENV_DATA_INDEX_SPECVAL, VM_ENV_DATA_SIZE, VM_ENV_FLAG_ESCAPED, VM_ENV_FLAG_LOCAL, VM_FRAME_FLAG_CFRAME, and VM_FRAME_MAGIC_IFUNC.
Referenced by rb_func_lambda_new(), and rb_func_proc_new().
Definition at line 428 of file proc.c.
References ID2SYM, name, rb_check_id(), rb_is_local_id(), rb_is_local_name(), and rb_name_err_raise.
Referenced by bind_local_variable_defined_p(), bind_local_variable_get(), and bind_local_variable_set().
Definition at line 2873 of file proc.c.
References check_argc, FIX2INT, make_curry_proc(), NIL_P, RARRAY_AREF, RARRAY_CONST_PTR, RARRAY_LEN, rb_ary_freeze(), rb_ary_new4, rb_ary_plus(), rb_proc_call_with_block(), and rb_warn().
Referenced by proc_binding().
Definition at line 2749 of file proc.c.
References ALLOC_N, rb_env_t::env, rb_env_t::env_size, rb_env_t::ep, rb_env_t::iseq, MEMCPY, NULL, RB_OBJ_WRITE, rb_vm_cref_new_toplevel(), VM_ASSERT, VM_ENV_DATA_INDEX_ME_CREF, VM_ENV_ESCAPED_P(), and vm_env_new().
Referenced by proc_binding().
Definition at line 395 of file proc.c.
References env, rb_env_t::env, rb_env_t::ep, rb_env_t::iseq, NULL, rb_obj_is_iseq(), rb_vm_env_prev_env(), VM_ASSERT, VM_ENV_FLAGS(), and VM_FRAME_FLAG_CFRAME.
Referenced by bind_local_variable_defined_p(), bind_local_variable_get(), and bind_local_variable_set().
void Init_Binding | ( | void | ) |
Definition at line 3200 of file proc.c.
References bind_eval(), bind_local_variable_defined_p(), bind_local_variable_get(), bind_local_variable_set(), bind_local_variables(), bind_receiver(), binding_clone(), binding_dup(), CLASS_OF, rb_cBinding, rb_cObject, rb_define_class(), rb_define_global_function(), rb_define_method(), rb_f_binding(), rb_undef_alloc_func(), and rb_undef_method().
void Init_Proc | ( | void | ) |
Definition at line 3058 of file proc.c.
References CLASS_OF, localjump_reason(), localjump_xvalue(), method_arity_m(), method_clone(), method_eq(), method_hash(), method_inspect(), method_name(), method_original_name(), method_owner(), method_receiver(), method_super_method(), method_to_proc(), method_unbind(), METHOD_VISI_PUBLIC, proc_arity(), proc_binding(), proc_clone(), proc_curry(), proc_dup(), proc_hash(), proc_to_proc(), proc_to_s(), rb_add_method(), rb_block_lambda(), rb_block_proc(), rb_cMethod, rb_cModule, rb_cObject, rb_cProc, rb_cUnboundMethod, rb_define_alias(), rb_define_class(), rb_define_global_function(), rb_define_method(), rb_define_private_method(), rb_define_singleton_method(), rb_eException, rb_eLocalJumpError, rb_eStandardError, rb_eSysStackError, rb_intern, rb_method_call(), rb_method_curry(), rb_method_location(), rb_method_parameters(), rb_mKernel, rb_mod_define_method(), rb_mod_instance_method(), rb_mod_public_instance_method(), rb_obj_define_method(), rb_obj_method(), rb_obj_public_method(), rb_obj_singleton_method(), rb_proc_lambda_p(), rb_proc_location(), rb_proc_parameters(), rb_proc_s_new(), rb_singleton_class(), rb_undef_alloc_func(), rb_undef_method(), rb_vm_register_special_exception(), rb_vm_top_self(), ruby_error_sysstack, top_define_method(), umethod_bind(), and VM_METHOD_TYPE_OPTIMIZED.
Definition at line 1126 of file proc.c.
References rb_iseq_struct::body, rb_iseq_location_struct::first_lineno, rb_iseq_constant_body::location, rb_iseq_location_struct::path, Qnil, rb_ary_new4, and rb_iseq_check().
Referenced by method_def_location(), and rb_proc_location().
Definition at line 2741 of file proc.c.
References rb_iv_get(), and rb_vm_cref_new_toplevel().
Referenced by Init_Proc().
Definition at line 2856 of file proc.c.
References GetProcPtr, rb_proc_t::is_lambda, rb_ary_freeze(), rb_ary_new3, and rb_proc_new().
Referenced by curry(), and proc_curry().
|
static |
Definition at line 2388 of file proc.c.
References METHOD::me, rb_method_entry_arity(), and TypedData_Get_Struct.
Referenced by method_arity_m(), and rb_method_parameters().
Definition at line 2381 of file proc.c.
References INT2FIX, and method_arity().
Referenced by Init_Proc().
|
static |
Definition at line 2089 of file proc.c.
References rb_method_entry_struct::defined_class, METHOD::me, and rb_bug().
Referenced by call_method_data().
Definition at line 2054 of file proc.c.
References CLASS_OF, CLONESETUP, METHOD::klass, METHOD::me, rb_method_entry_clone(), RB_OBJ_WRITE, METHOD::recv, TypedData_Get_Struct, and TypedData_Make_Struct.
Referenced by Init_Proc().
Definition at line 2473 of file proc.c.
References rb_method_definition_struct::alias, rb_method_definition_struct::body, rb_method_iseq_struct::cref, rb_method_entry_struct::def, rb_method_definition_struct::iseq, method_def(), NULL, rb_method_alias_struct::original_me, rb_method_definition_struct::type, VM_METHOD_TYPE_ALIAS, and VM_METHOD_TYPE_ISEQ.
Referenced by method_definition_set(), and proc_binding().
|
inlinestatic |
Definition at line 2434 of file proc.c.
References rb_method_entry_struct::def, METHOD::me, and TypedData_Get_Struct.
Referenced by method_cref(), rb_method_iseq(), and rb_method_location().
|
static |
Definition at line 2443 of file proc.c.
References rb_method_definition_struct::alias, rb_method_definition_struct::body, rb_method_entry_struct::def, rb_method_definition_struct::iseq, rb_method_iseq_struct::iseqptr, NULL, rb_method_alias_struct::original_me, rb_method_definition_struct::proc, rb_iseq_check(), rb_proc_get_iseq(), rb_method_definition_struct::type, VM_METHOD_TYPE_ALIAS, VM_METHOD_TYPE_ATTRSET, VM_METHOD_TYPE_BMETHOD, VM_METHOD_TYPE_CFUNC, VM_METHOD_TYPE_ISEQ, VM_METHOD_TYPE_IVAR, VM_METHOD_TYPE_MISSING, VM_METHOD_TYPE_NOTIMPLEMENTED, VM_METHOD_TYPE_OPTIMIZED, VM_METHOD_TYPE_REFINED, VM_METHOD_TYPE_UNDEF, and VM_METHOD_TYPE_ZSUPER.
Referenced by method_def_location(), and rb_method_iseq().
|
static |
Definition at line 2490 of file proc.c.
References rb_method_definition_struct::attr, rb_method_definition_struct::body, iseq_location(), rb_method_attr_struct::location, method_def_iseq(), Qnil, rb_ary_dup(), rb_method_definition_struct::type, VM_METHOD_TYPE_ATTRSET, and VM_METHOD_TYPE_IVAR.
Referenced by rb_method_entry_location(), and rb_method_location().
|
inlinestatic |
Definition at line 1468 of file proc.c.
References rb_method_entry_struct::defined_class, and rb_method_entry_struct::owner.
Referenced by method_eq(), method_inspect(), and method_super_method().
Definition at line 1509 of file proc.c.
References Check_TypedStruct, CLASS_OF, DATA_PTR, METHOD::klass, METHOD::me, method_entry_defined_class(), Qfalse, Qtrue, rb_method_entry_eq(), rb_obj_is_method(), and METHOD::recv.
Referenced by Init_Proc().
Definition at line 1546 of file proc.c.
References hash(), INT2FIX, METHOD::me, rb_hash_end(), rb_hash_method_entry(), rb_hash_start(), METHOD::recv, and TypedData_Get_Struct.
Referenced by Init_Proc().
Definition at line 2574 of file proc.c.
References rb_method_definition_struct::alias, attached, rb_method_definition_struct::body, rb_method_entry_struct::called_id, rb_method_entry_struct::def, FL_SINGLETON, FL_TEST, METHOD::klass, METHOD::me, method_entry_defined_class(), rb_method_definition_struct::original_id, rb_method_alias_struct::original_me, rb_method_entry_struct::owner, PRIsVALUE, Qundef, rb_class_name(), rb_id2str, rb_inspect(), rb_ivar_get(), rb_obj_classname(), rb_str_append(), rb_str_buf_append(), rb_str_buf_cat2(), rb_str_buf_new2(), rb_str_catf(), RB_TYPE_P, RBASIC_CLASS, METHOD::recv, T_ICLASS, rb_method_definition_struct::type, TypedData_Get_Struct, VM_METHOD_TYPE_ALIAS, and VM_METHOD_TYPE_NOTIMPLEMENTED.
Referenced by Init_Proc().
|
static |
Definition at line 2411 of file proc.c.
References METHOD::me, rb_method_entry_min_max_arity(), and TypedData_Get_Struct.
Referenced by rb_vm_block_min_max_arity().
Definition at line 1609 of file proc.c.
References rb_method_entry_struct::called_id, ID2SYM, METHOD::me, and TypedData_Get_Struct.
Referenced by Init_Proc(), and rb_profile_frame_qualified_method_name().
Definition at line 1625 of file proc.c.
References rb_method_entry_struct::def, ID2SYM, METHOD::me, rb_method_definition_struct::original_id, and TypedData_Get_Struct.
Referenced by Init_Proc().
Definition at line 1641 of file proc.c.
References METHOD::me, rb_method_entry_struct::owner, and TypedData_Get_Struct.
Referenced by Init_Proc().
Definition at line 1593 of file proc.c.
References METHOD::recv, and TypedData_Get_Struct.
Referenced by Init_Proc(), and proc_binding().
Definition at line 2706 of file proc.c.
References rb_method_entry_struct::called_id, FALSE, METHOD::me, method_entry_defined_class(), mnew_internal(), Qnil, rb_callable_method_entry_without_refinements(), rb_obj_class(), RCLASS_ORIGIN, RCLASS_SUPER, METHOD::recv, and TypedData_Get_Struct.
Referenced by Init_Proc().
Definition at line 2677 of file proc.c.
References bmcall(), GetProcPtr, rb_proc_t::is_from_method, mlambda(), and rb_iterate().
Referenced by Init_Proc(), and rb_method_curry().
Definition at line 1569 of file proc.c.
References METHOD::klass, METHOD::me, OBJ_INFECT, Qundef, rb_cUnboundMethod, rb_method_entry_clone(), RB_OBJ_WRITE, METHOD::recv, TypedData_Get_Struct, and TypedData_Make_Struct.
Referenced by Init_Proc().
Definition at line 2649 of file proc.c.
References rb_funcallv, and rb_mRubyVMFrozenCore.
Referenced by method_to_proc().
Definition at line 1454 of file proc.c.
References METHOD::me, mnew_from_me(), Qundef, rb_callable_method_entry_without_refinements(), and rb_method_entry_without_refinements().
Referenced by obj_method(), rb_mod_instance_method(), and rb_mod_public_instance_method().
|
static |
Definition at line 1447 of file proc.c.
References mnew_internal(), and TRUE.
Referenced by mnew(), and rb_obj_singleton_method().
|
static |
Definition at line 1396 of file proc.c.
References rb_method_entry_struct::def, rb_method_entry_struct::defined_class, FL_SINGLETON, FL_TEST, ID2SYM, METHOD::klass, METHOD::me, METHOD_ENTRY_VISI, METHOD_VISI_PUBLIC, METHOD_VISI_UNDEF, mnew_missing(), OBJ_INFECT, rb_method_definition_struct::original_id, rb_method_entry_struct::owner, Qnil, rb_callable_method_entry_without_refinements(), rb_method_entry_without_refinements(), RB_OBJ_WRITE, rb_print_inaccessible(), rb_print_undef(), RB_TYPE_P, RCLASS_ORIGIN, RCLASS_SUPER, METHOD::recv, respond_to_missing_p(), T_ICLASS, rb_method_definition_struct::type, TypedData_Make_Struct, UNDEFINED_METHOD_ENTRY_P, and VM_METHOD_TYPE_ZSUPER.
Referenced by method_super_method(), and mnew_from_me().
Definition at line 1372 of file proc.c.
References id, METHOD::klass, METHOD::me, METHOD_VISI_UNDEF, OBJ_INFECT, rb_method_definition_struct::original_id, rb_method_entry_create(), RB_OBJ_WRITE, METHOD::recv, rb_method_definition_struct::type, TypedData_Make_Struct, VM_METHOD_TYPE_MISSING, and ZALLOC.
Referenced by mnew_internal(), obj_method(), and rb_obj_singleton_method().
Definition at line 2643 of file proc.c.
References rb_funcallv, and rb_mRubyVMFrozenCore.
Referenced by rb_proc_new().
Definition at line 1678 of file proc.c.
References CLASS_OF, METHOD::klass, mnew(), mnew_missing(), rb_check_id(), rb_cMethod, rb_intern_str, rb_method_name_error(), and respond_to_missing_p().
Referenced by rb_obj_method(), and rb_obj_public_method().
|
static |
Definition at line 2397 of file proc.c.
References rb_method_entry_struct::def, METHOD::me, rb_method_definition_struct::original_id, rb_method_entry_struct::owner, rb_method_entry(), RCLASS_SUPER, rb_method_definition_struct::type, and VM_METHOD_TYPE_ZSUPER.
Referenced by rb_mod_method_arity(), and rb_mod_method_location().
Definition at line 953 of file proc.c.
References INT2FIX, and rb_proc_arity().
Referenced by Init_Proc().
Definition at line 2787 of file proc.c.
References rb_block::as, rb_proc_t::block, rb_binding_t::block, block_type_ifunc, block_type_iseq, block_type_proc, block_type_symbol, rb_iseq_struct::body, rb_block::captured, rb_captured_block::code, curry(), vm_ifunc::data, env, env_clone(), rb_captured_block::ep, rb_env_t::ep, rb_binding_t::first_lineno, FIX2INT, GetBindingPtr, GetProcPtr, rb_captured_block::ifunc, IS_METHOD_PROC_IFUNC, rb_captured_block::iseq, rb_env_t::iseq, rb_iseq_constant_body::location, method_cref(), method_receiver(), NULL, rb_iseq_location_struct::path, rb_binding_t::path, rb_block::proc, Qnil, Qundef, rb_binding_alloc(), rb_cBinding, rb_eArgError, rb_iseq_check(), rb_iseq_first_lineno(), rb_iseq_new(), rb_method_iseq(), RB_OBJ_WRITE, rb_raise(), rb_str_new2, rb_captured_block::self, vm_block_type(), and VM_ENV_ENVVAL_PTR().
Referenced by Init_Proc().
Definition at line 146 of file proc.c.
References CLONESETUP, and proc_dup().
Referenced by Init_Proc().
Definition at line 2938 of file proc.c.
References FIX2INT, INT2FIX, make_curry_proc(), NIL_P, rb_ary_new(), rb_check_arity, rb_proc_lambda_p(), rb_proc_min_max_arity(), and rb_scan_args().
Referenced by Init_Proc(), and rb_method_curry().
Definition at line 132 of file proc.c.
References rb_proc_t::block, GetProcPtr, rb_proc_t::is_from_method, rb_proc_t::is_lambda, rb_cProc, RB_GC_GUARD, rb_proc_create(), and rb_proc_t::safe_level.
Referenced by Init_Proc(), proc_clone(), proc_new(), and rb_mod_define_method().
Definition at line 1243 of file proc.c.
References hash(), rb_hash_end(), rb_hash_proc(), rb_hash_start(), and ST2FIX.
Referenced by Init_Proc().
|
static |
Definition at line 78 of file proc.c.
References rb_proc_t::block, block_mark(), and RUBY_MARK_LEAVE.
|
static |
Definition at line 91 of file proc.c.
References rb_block::as, rb_proc_t::block, rb_block::captured, and rb_captured_block::ep.
Definition at line 692 of file proc.c.
References block_handler_type_ifunc, block_handler_type_iseq, block_handler_type_proc, block_handler_type_symbol, rb_thread_struct::cfp, rb_control_frame_struct::ep, GET_THREAD, proc_dup(), Qnil, rb_cProc, rb_eArgError, rb_raise(), rb_sym_to_proc(), rb_vm_ep_local_ep(), rb_vm_frame_block_handler(), rb_vm_make_proc_lambda(), rb_warn(), RBASIC_CLASS, RBASIC_SET_CLASS, RUBY_VM_PREVIOUS_CONTROL_FRAME, sym_proc_new(), VM_BH_TO_CAPT_BLOCK(), VM_BH_TO_PROC(), VM_BH_TO_SYMBOL(), VM_BLOCK_HANDLER_NONE, vm_block_handler_type(), VM_ENV_ESCAPED_P(), VM_ENV_PROCVAL(), and VM_UNREACHABLE.
Referenced by rb_block_lambda(), rb_block_proc(), and rb_proc_s_new().
Definition at line 893 of file proc.c.
References NIL_P, and VM_BLOCK_HANDLER_NONE.
Referenced by call_method_data(), and rb_proc_call_with_block().
Definition at line 1318 of file proc.c.
Referenced by Init_Proc().
Definition at line 1261 of file proc.c.
References GetProcPtr, and proc_to_s_().
Referenced by Init_Proc().
Definition at line 1269 of file proc.c.
References rb_block::as, rb_proc_t::block, block_type_ifunc, block_type_iseq, block_type_proc, block_type_symbol, rb_iseq_struct::body, rb_block::captured, rb_captured_block::code, rb_iseq_location_struct::first_lineno, FIX2INT, rb_captured_block::ifunc, rb_proc_t::is_lambda, rb_captured_block::iseq, rb_iseq_constant_body::location, OBJ_TAINT, OBJ_TAINTED, rb_iseq_location_struct::path, PRIsVALUE, rb_block::proc, rb_iseq_check(), rb_obj_classname(), rb_sprintf(), rb_block::symbol, vm_block_type(), and vm_proc_block().
Referenced by proc_to_s().
Definition at line 308 of file proc.c.
References TypedData_Make_Struct.
Referenced by binding_dup(), proc_binding(), rb_vm_make_binding(), and VM_BH_FROM_PROC().
VALUE rb_binding_new | ( | void | ) |
Definition at line 340 of file proc.c.
References rb_thread_struct::cfp, GET_THREAD, and rb_vm_make_binding().
Referenced by call_trace_func(), Init_VM(), and rb_f_binding().
int rb_block_arity | ( | void | ) |
Definition at line 1041 of file proc.c.
References block_handler_type_proc, block_handler_type_symbol, block_setup(), rb_thread_struct::cfp, GET_THREAD, GetProcPtr, rb_proc_t::is_lambda, max(), rb_block::proc, rb_eArgError, rb_raise(), rb_vm_block_min_max_arity(), rb_vm_frame_block_handler(), UNLIMITED_ARGUMENTS, VM_BLOCK_HANDLER_NONE, and vm_block_type().
Referenced by enum_each_cons(), enum_each_slice(), env_each_pair(), rb_ary_zip(), rb_hash_any_p(), rb_hash_each_pair(), and rb_struct_each_pair().
VALUE rb_block_lambda | ( | void | ) |
Definition at line 801 of file proc.c.
References argc, argv, check_argc, proc_new(), rb_cProc, rb_eArgError, rb_raise(), and TRUE.
Referenced by Init_Proc(), Init_VM(), and rb_mod_define_method().
int rb_block_min_max_arity | ( | int * | max | ) |
Definition at line 1075 of file proc.c.
References block_setup(), rb_thread_struct::cfp, GET_THREAD, rb_eArgError, rb_raise(), rb_vm_block_min_max_arity(), rb_vm_frame_block_handler(), and VM_BLOCK_HANDLER_NONE.
Referenced by enum_collect().
VALUE rb_block_proc | ( | void | ) |
Definition at line 787 of file proc.c.
References FALSE, proc_new(), and rb_cProc.
Referenced by define_final(), enum_chunk(), enum_chunk_while(), enum_slice_after(), enum_slice_before(), enum_slice_when(), enumerator_initialize(), ev_on_event(), generator_initialize(), Init_Proc(), Init_VM(), lazy_add_method(), lazy_to_enum(), m_core_set_postexe(), obj_to_enum(), ossl_x509store_verify(), rb_f_at_exit(), rb_f_trace_var(), rb_fiber_init(), rb_hash_initialize(), rb_method_call(), rb_scan_args(), sig_trap(), thread_create_core(), tracepoint_new_s(), and yielder_initialize().
VALUE rb_func_lambda_new | ( | rb_block_call_func_t | func, |
VALUE | val, | ||
int | min_argc, | ||
int | max_argc | ||
) |
Definition at line 683 of file proc.c.
References cfunc_proc_new(), rb_cProc, and rb_vm_ifunc_new().
VALUE rb_func_proc_new | ( | rb_block_call_func_t | func, |
VALUE | val | ||
) |
Definition at line 676 of file proc.c.
References cfunc_proc_new(), rb_cProc, and rb_vm_ifunc_proc_new().
Referenced by rb_hash_to_proc(), and vm_caller_setup_arg_block().
st_index_t rb_hash_proc | ( | st_index_t | hash, |
VALUE | prc | ||
) |
Definition at line 1193 of file proc.c.
References rb_block::as, rb_proc_t::block, rb_block::captured, rb_captured_block::code, rb_captured_block::ep, GetProcPtr, rb_hash_uint(), rb_captured_block::self, and rb_captured_block::val.
Referenced by proc_hash(), and rb_hash_method_definition().
Definition at line 960 of file proc.c.
References rb_iseq_struct::body, FALSE, rb_iseq_constant_body::flags, rb_iseq_constant_body::keyword, rb_iseq_constant_body::lead_num, rb_iseq_constant_body::opt_num, rb_iseq_constant_body::param, rb_iseq_constant_body::post_num, TRUE, and UNLIMITED_ARGUMENTS.
Referenced by rb_method_entry_min_max_arity(), and rb_vm_block_min_max_arity().
Definition at line 2082 of file proc.c.
References Qnil, rb_block_given_p(), rb_block_proc(), and rb_method_call_with_block().
Referenced by Init_Proc(), and method_fallback().
VALUE rb_method_call_with_block | ( | int | argc, |
const VALUE * | argv, | ||
VALUE | method, | ||
VALUE | passed_procval | ||
) |
Definition at line 2126 of file proc.c.
References call_method_data(), call_method_data_safe(), GET_THREAD, OBJ_TAINTED, Qundef, rb_eTypeError, rb_raise(), rb_safe_level(), rb_set_safe_level_force(), METHOD::recv, RUBY_SAFE_LEVEL_MAX, and TypedData_Get_Struct.
Referenced by bmcall(), and rb_method_call().
Definition at line 2990 of file proc.c.
References method_to_proc(), and proc_curry().
Referenced by Init_Proc().
int rb_method_entry_arity | ( | const rb_method_entry_t * | me | ) |
Definition at line 2341 of file proc.c.
References max(), and rb_method_entry_min_max_arity().
Referenced by method_arity(), rb_mod_method_arity(), and vm_respond_to().
VALUE rb_method_entry_location | ( | const rb_method_entry_t * | me | ) |
Definition at line 2501 of file proc.c.
References rb_method_entry_struct::def, method_def_location(), and Qnil.
Referenced by rb_mod_method_location(), and vm_respond_to().
|
static |
Definition at line 2286 of file proc.c.
References rb_method_definition_struct::alias, rb_method_cfunc_struct::argc, rb_method_definition_struct::body, rb_method_definition_struct::cfunc, check_argc, rb_method_entry_struct::def, rb_method_definition_struct::iseq, rb_method_iseq_struct::iseqptr, rb_method_definition_struct::optimize_type, rb_method_alias_struct::original_me, rb_method_definition_struct::proc, rb_bug(), rb_iseq_check(), rb_iseq_min_max_arity(), rb_proc_min_max_arity(), rb_method_definition_struct::type, UNLIMITED_ARGUMENTS, UNREACHABLE, VM_METHOD_TYPE_ALIAS, VM_METHOD_TYPE_ATTRSET, VM_METHOD_TYPE_BMETHOD, VM_METHOD_TYPE_CFUNC, VM_METHOD_TYPE_ISEQ, VM_METHOD_TYPE_IVAR, VM_METHOD_TYPE_MISSING, VM_METHOD_TYPE_NOTIMPLEMENTED, VM_METHOD_TYPE_OPTIMIZED, VM_METHOD_TYPE_REFINED, VM_METHOD_TYPE_UNDEF, and VM_METHOD_TYPE_ZSUPER.
Referenced by method_min_max_arity(), and rb_method_entry_arity().
Definition at line 2467 of file proc.c.
References method_def(), and method_def_iseq().
Referenced by iseqw_s_of(), proc_binding(), rb_method_parameters(), and rb_proc_get_iseq().
Definition at line 2529 of file proc.c.
References method_def(), and method_def_location().
Referenced by Init_Proc().
Definition at line 1649 of file proc.c.
References attached, BUILTIN_TYPE, FL_SINGLETON, FL_TEST, METHOD::klass, MSG, rb_ivar_get(), rb_name_err_raise_str, RB_TYPE_P, T_CLASS, and T_MODULE.
Referenced by obj_method(), rb_mod_instance_method(), rb_mod_public_instance_method(), rb_mod_undef_method(), and rb_undef().
Definition at line 2554 of file proc.c.
References method_arity(), rb_iseq_parameters(), rb_method_iseq(), and unnamed_parameters().
Referenced by Init_Proc().
Definition at line 1887 of file proc.c.
References block_handler_type_ifunc, block_handler_type_iseq, block_handler_type_proc, block_handler_type_symbol, rb_thread_struct::cfp, CREF_SCOPE_VISI(), DATA_PTR, FALSE, FL_SINGLETON, FL_TEST, GET_THREAD, GetProcPtr, id, ID2SYM, rb_proc_t::is_from_method, rb_proc_t::is_lambda, METHOD::me, rb_scope_visi_struct::method_visi, METHOD_VISI_PUBLIC, rb_scope_visi_struct::module_func, name, NULL, rb_method_entry_struct::owner, PRIsVALUE, proc_dup(), rb_add_method(), rb_block_lambda(), rb_check_arity, rb_check_id(), rb_class_inherited_p(), rb_class_name(), rb_cProc, rb_eArgError, rb_eTypeError, RB_GC_GUARD, rb_method_entry_set(), rb_obj_classname(), rb_obj_is_method(), rb_obj_is_proc(), rb_raise(), rb_singleton_class(), rb_sym_to_proc(), rb_to_id(), RB_TYPE_P, rb_vm_cref_in_context(), rb_vm_frame_block_handler(), rb_vm_make_proc_lambda(), RTEST, T_MODULE, TRUE, VM_BH_TO_CAPT_BLOCK(), VM_BH_TO_PROC(), VM_BH_TO_SYMBOL(), VM_BLOCK_HANDLER_NONE, vm_block_handler_type(), VM_METHOD_TYPE_BMETHOD, and vm_proc_iseq().
Referenced by Init_Proc(), rb_obj_define_method(), and top_define_method().
Definition at line 1823 of file proc.c.
References FALSE, mnew(), Qundef, rb_check_id(), rb_cUnboundMethod, and rb_method_name_error().
Referenced by Init_Proc().
Definition at line 2420 of file proc.c.
References METHOD::me, original_method_entry(), and rb_method_entry_arity().
Referenced by rb_obj_method_arity().
Definition at line 2508 of file proc.c.
References METHOD::me, original_method_entry(), and rb_method_entry_location().
Referenced by rb_obj_method_location().
Definition at line 1840 of file proc.c.
References mnew(), Qundef, rb_check_id(), rb_cUnboundMethod, rb_method_name_error(), and TRUE.
Referenced by Init_Proc().
Definition at line 2006 of file proc.c.
References METHOD::klass, rb_mod_define_method(), and rb_singleton_class().
Referenced by Init_Proc().
Definition at line 1349 of file proc.c.
References Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Referenced by method_eq(), rb_econv_prepare_options(), rb_mod_define_method(), and transcode_loop().
Definition at line 117 of file proc.c.
References METHOD::klass, Qfalse, Qtrue, rb_proc_create(), and rb_typeddata_is_kind_of().
Referenced by generator_initialize(), iseqw_s_of(), rb_econv_prepare_options(), rb_hash_set_default_proc(), rb_mod_define_method(), rb_raw_obj_info(), set_trace_func(), thread_add_trace_func(), transcode_loop(), VM_BH_FROM_PROC(), VM_BH_TO_PROC(), vm_block_handler_type(), vm_block_type(), vm_proc_block(), vm_proc_iseq(), and vm_to_proc().
Definition at line 1723 of file proc.c.
References FALSE, and obj_method().
Referenced by Init_Proc(), and wmap_allocate().
Definition at line 2428 of file proc.c.
References CLASS_OF, and rb_mod_method_arity().
Definition at line 2515 of file proc.c.
References CLASS_OF, and rb_mod_method_location().
Definition at line 1736 of file proc.c.
References obj_method(), and TRUE.
Referenced by Init_Proc().
Definition at line 1766 of file proc.c.
References rb_method_entry_struct::def, FALSE, ID2SYM, METHOD::klass, METHOD::me, mnew_from_me(), mnew_missing(), NIL_P, rb_check_id(), rb_cMethod, rb_intern_str, rb_method_entry_at(), rb_name_err_raise, rb_singleton_class_get(), respond_to_missing_p(), UNDEFINED_METHOD_ENTRY_P, and UNDEFINED_REFINED_METHOD_P.
Referenced by Init_Proc().
Definition at line 110 of file proc.c.
References TypedData_Make_Struct.
Referenced by rb_proc_create(), rb_proc_create_from_captured(), sym_proc_new(), and VM_BH_FROM_PROC().
int rb_proc_arity | ( | VALUE | self | ) |
Definition at line 1009 of file proc.c.
References rb_proc_t::block, GetProcPtr, rb_proc_t::is_lambda, max(), rb_vm_block_min_max_arity(), and UNLIMITED_ARGUMENTS.
Referenced by proc_arity(), rb_proc_parameters(), and set_proc_default().
Definition at line 879 of file proc.c.
References check_argc, GET_THREAD, GetProcPtr, RARRAY_CONST_PTR, RARRAY_LEN, RB_GC_GUARD, rb_vm_invoke_proc(), and VM_BLOCK_HANDLER_NONE.
Referenced by generator_each(), proc_fallback(), rb_call_end_proc(), and yielder_yield().
Definition at line 899 of file proc.c.
References GET_THREAD, GetProcPtr, proc_to_block_handler(), RB_GC_GUARD, and rb_vm_invoke_proc().
Referenced by call_trace_func(), curry(), lazy_grep_iter_proc(), lazyenum_yield(), lazyenum_yield_values(), tp_call_trace(), and vm_once_exec().
VALUE rb_proc_create | ( | VALUE | klass, |
const struct rb_block * | block, | ||
int8_t | safe_level, | ||
int8_t | is_from_method, | ||
int8_t | is_lambda | ||
) |
Definition at line 830 of file vm.c.
References rb_block::as, rb_proc_t::block, block_type_ifunc, block_type_iseq, block_type_proc, block_type_symbol, rb_block::captured, rb_captured_block::code, rb_captured_block::ep, GET_THREAD, rb_proc_t::is_from_method, rb_proc_t::is_lambda, rb_block::proc, Qundef, RB_OBJ_WRITE, RB_OBJ_WRITTEN, rb_proc_alloc(), RTYPEDDATA_DATA, rb_proc_t::safe_level, rb_captured_block::self, rb_block::symbol, rb_block::type, rb_captured_block::val, VM_ASSERT, vm_block_ep(), vm_block_type(), vm_block_type_set(), and VM_ENV_ENVVAL().
Referenced by proc_dup(), and rb_obj_is_proc().
Definition at line 1091 of file proc.c.
References rb_block::as, rb_proc_t::block, block_type_ifunc, block_type_iseq, block_type_proc, block_type_symbol, rb_block::captured, rb_captured_block::code, vm_ifunc::data, GetProcPtr, rb_captured_block::ifunc, rb_proc_t::is_lambda, IS_METHOD_PROC_IFUNC, rb_captured_block::iseq, NULL, rb_block::proc, rb_iseq_check(), rb_method_iseq(), vm_block_type(), and VM_UNREACHABLE.
Referenced by method_def_iseq(), rb_method_entry_make(), rb_proc_location(), and rb_proc_parameters().
Definition at line 255 of file proc.c.
References GetProcPtr, rb_proc_t::is_lambda, Qfalse, and Qtrue.
Referenced by Init_Proc(), proc_curry(), set_proc_default(), and yield_under().
Definition at line 1147 of file proc.c.
References iseq_location(), and rb_proc_get_iseq().
Referenced by Init_Proc(), rb_thread_inspect(), and thread_initialize().
|
static |
Definition at line 1001 of file proc.c.
References rb_proc_t::block, GetProcPtr, and rb_vm_block_min_max_arity().
Referenced by proc_curry(), and rb_method_entry_min_max_arity().
Definition at line 2661 of file proc.c.
References func, mproc(), and rb_iterate().
Referenced by gc_stat_internal(), make_curry_proc(), rb_fiber_new(), rb_obj_info_dump(), and yielder_new().
Definition at line 1182 of file proc.c.
References rb_iseq_parameters(), rb_proc_arity(), rb_proc_get_iseq(), and unnamed_parameters().
Referenced by Init_Proc().
Definition at line 771 of file proc.c.
References FALSE, proc_new(), and rb_obj_call_init().
Referenced by Init_Proc().
Definition at line 1203 of file proc.c.
References id, ID2SYM, Qfalse, Qnil, RARRAY_PTR, rb_ary_store(), rb_ary_tmp_new(), rb_cProc, rb_gc_register_mark_object(), sym, SYM2ID, and sym_proc_new().
Referenced by args_setup_block_parameter(), Init_String(), proc_new(), rb_mod_define_method(), rb_sym_proc_call(), and vm_block_handler_to_proc().
Definition at line 970 of file proc.c.
References vm_ifunc::argc, rb_block::as, block_type_ifunc, block_type_iseq, block_type_proc, block_type_symbol, rb_block::captured, rb_captured_block::code, vm_ifunc::data, rb_captured_block::ifunc, IS_METHOD_PROC_IFUNC, rb_captured_block::iseq, vm_ifunc_argc::max, method_min_max_arity(), vm_ifunc_argc::min, rb_block::proc, rb_iseq_min_max_arity(), UNLIMITED_ARGUMENTS, vm_block_type(), and vm_proc_block().
Referenced by rb_block_arity(), rb_block_min_max_arity(), rb_proc_arity(), and rb_proc_min_max_arity().
Definition at line 1321 of file vm.c.
References rb_thread_struct::cfp, CREF_CLASS(), CREF_NEXT(), dp, rb_control_frame_struct::ep, GET_THREAD, NULL, rb_vm_get_cref(), rb_vm_get_ruby_level_next_cfp(), rb_control_frame_struct::self, and vm_env_cref_by_cref().
Referenced by rb_mod_define_method().
rb_cref_t* rb_vm_cref_new_toplevel | ( | void | ) |
Definition at line 253 of file vm.c.
References GET_THREAD, and vm_cref_new_toplevel().
Referenced by env_clone(), and localjump_reason().
struct vm_ifunc* rb_vm_ifunc_new | ( | VALUE(*)(ANYARGS) | func, |
const void * | data, | ||
int | min_argc, | ||
int | max_argc | ||
) |
Definition at line 647 of file proc.c.
References CHAR_BIT, func, IFUNC_NEW, rb_eRangeError, rb_raise(), SIZEOF_VALUE, and UNLIMITED_ARGUMENTS.
Referenced by rb_func_lambda_new(), rb_lambda_call(), and rb_vm_ifunc_proc_new().
Definition at line 1360 of file proc.c.
References idRespond_to_missing, Qfalse, Qtrue, Qundef, rb_funcall(), rb_method_basic_definition_p(), and RTEST.
Referenced by mnew_internal(), obj_method(), and rb_obj_singleton_method().
Definition at line 635 of file proc.c.
References rb_block::as, rb_proc_t::block, block_type_symbol, GetProcPtr, RB_OBJ_WRITE, rb_proc_alloc(), rb_block::symbol, and vm_block_type_set().
Referenced by proc_new(), and rb_sym_to_proc().
Definition at line 2021 of file proc.c.
References GET_THREAD, METHOD::klass, rb_cObject, rb_mod_define_method(), rb_warning(), and rb_thread_struct::top_wrapper.
Referenced by Init_Proc().
Definition at line 2238 of file proc.c.
References rb_method_entry_struct::called_id, CLASS_OF, FL_SINGLETON, FL_TEST, METHOD::klass, METHOD::me, rb_method_entry_struct::owner, PRIsVALUE, rb_class_name(), rb_class_search_ancestor(), rb_cMethod, rb_eTypeError, rb_include_class_new(), rb_method_entry_clone(), rb_method_entry_complement_defined_class(), rb_obj_is_kind_of(), RB_OBJ_WRITE, rb_raise(), RB_TYPE_P, METHOD::recv, T_MODULE, TypedData_Get_Struct, and TypedData_Make_Struct.
Referenced by Init_Proc().
|
static |
Definition at line 1153 of file proc.c.
References CONST_ID, ID2SYM, OBJ_FREEZE, rb_ary_new2, rb_ary_new3, rb_ary_push(), and rb_ary_store().
Referenced by rb_method_parameters(), and rb_proc_parameters().
|
static |
|
static |
|
static |
VALUE rb_cBinding |
Definition at line 38 of file proc.c.
Referenced by binding_dup(), Init_Binding(), and proc_binding().
VALUE rb_cMethod |
Definition at line 37 of file proc.c.
Referenced by Init_Proc(), obj_method(), rb_obj_singleton_method(), and umethod_bind().
VALUE rb_cProc |
Definition at line 39 of file proc.c.
Referenced by Init_Proc(), proc_dup(), proc_new(), rb_block_lambda(), rb_block_proc(), rb_func_lambda_new(), rb_func_proc_new(), rb_mod_define_method(), and rb_sym_to_proc().
VALUE rb_cUnboundMethod |
Definition at line 36 of file proc.c.
Referenced by Init_Proc(), method_unbind(), rb_mod_instance_method(), and rb_mod_public_instance_method().
const rb_data_type_t ruby_binding_data_type |
Definition at line 297 of file proc.c.
Referenced by eval_string_with_cref().