Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
#include "eval_intern.h"
#include "gc.h"
#include "internal.h"
#include "internal/class.h"
#include "internal/error.h"
#include "internal/eval.h"
#include "internal/object.h"
#include "internal/proc.h"
#include "internal/symbol.h"
#include "iseq.h"
#include "vm_core.h"
Go to the source code of this file.
Data Structures | |
struct | METHOD |
struct | cfunc_proc_t |
Macros | |
#define | NO_CLOBBERED(v) (v) |
#define | UPDATE_TYPED_REFERENCE(_type, _ref) *(_type*)&_ref = (_type)rb_gc_location((VALUE)_ref) |
#define | UPDATE_REFERENCE(_ref) UPDATE_TYPED_REFERENCE(VALUE, _ref) |
#define | attached id__attached__ |
#define | IS_METHOD_PROC_IFUNC(ifunc) ((ifunc)->func == bmcall) |
#define | check_argc(argc) (argc) |
#define | MSG(s) rb_fstring_lit("undefined method `%1$s' for"s" `%2$s'") |
Variables | |
VALUE | rb_cUnboundMethod |
VALUE | rb_cMethod |
VALUE | rb_cBinding |
VALUE | rb_cProc |
const rb_data_type_t | ruby_binding_data_type |
#define IS_METHOD_PROC_IFUNC | ( | ifunc | ) | ((ifunc)->func == bmcall) |
#define MSG | ( | s | ) | rb_fstring_lit("undefined method `%1$s' for"s" `%2$s'") |
#define UPDATE_REFERENCE | ( | _ref | ) | UPDATE_TYPED_REFERENCE(VALUE, _ref) |
#define UPDATE_TYPED_REFERENCE | ( | _type, | |
_ref | |||
) | *(_type*)&_ref = (_type)rb_gc_location((VALUE)_ref) |
void Init_Binding | ( | void | ) |
Definition at line 4228 of file proc.c.
References CLASS_OF, rb_cBinding, rb_cObject, rb_define_class(), rb_define_global_function, rb_define_method, rb_undef_alloc_func(), and rb_undef_method().
void Init_Proc | ( | void | ) |
Definition at line 4075 of file proc.c.
References CLASS_OF, METHOD_VISI_PUBLIC, OPTIMIZED_METHOD_TYPE_CALL, rb_add_method(), 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_location(), rb_mKernel, rb_obj_method(), rb_obj_public_method(), rb_obj_singleton_method(), rb_proc_dup(), rb_proc_lambda_p(), rb_proc_location(), rb_singleton_class(), rb_undef_alloc_func(), rb_undef_method(), rb_vm_register_special_exception, rb_vm_top_self(), ruby_error_sysstack, and VM_METHOD_TYPE_OPTIMIZED.
Definition at line 331 of file proc.c.
References ruby_binding_data_type, and TypedData_Make_Struct.
Referenced by rb_vm_make_binding().
VALUE rb_binding_new | ( | void | ) |
Definition at line 364 of file proc.c.
References rb_execution_context_struct::cfp, and rb_vm_make_binding().
Referenced by Init_VM().
int rb_block_arity | ( | void | ) |
Definition at line 1193 of file proc.c.
References block_handler_type_proc, block_handler_type_symbol, rb_execution_context_struct::cfp, GetProcPtr, max, rb_block::proc, rb_eArgError, rb_raise(), rb_vm_frame_block_handler(), UNLIMITED_ARGUMENTS, and VM_BLOCK_HANDLER_NONE.
VALUE rb_block_lambda | ( | void | ) |
Definition at line 1226 of file proc.c.
References rb_execution_context_struct::cfp, max, rb_eArgError, rb_raise(), rb_vm_frame_block_handler(), and VM_BLOCK_HANDLER_NONE.
int rb_block_pair_yield_optimizable | ( | void | ) |
Definition at line 1158 of file proc.c.
References block_handler_type_proc, block_handler_type_symbol, rb_execution_context_struct::cfp, GetProcPtr, max, rb_block::proc, rb_eArgError, rb_raise(), rb_vm_frame_block_handler(), and VM_BLOCK_HANDLER_NONE.
VALUE rb_block_proc | ( | void | ) |
Definition at line 826 of file proc.c.
References FALSE, and rb_cProc.
Referenced by rb_f_trace_var(), rb_method_call(), and rb_method_call_kw().
Definition at line 1491 of file proc.c.
References rb_block::as, 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_captured_block::iseq, rb_iseq_constant_body::location, PRIsVALUE, rb_block::proc, rb_iseq_path(), rb_obj_class(), rb_sprintf(), rb_str_cat_cstr, rb_str_catf(), str, and rb_block::symbol.
Definition at line 2787 of file proc.c.
References Qundef, rb_funcall(), rb_intern(), rb_obj_is_method(), and rb_obj_is_proc().
Definition at line 3011 of file vm_insnhelper.c.
References FL_TEST, RBASIC_CLASS, RCLASS_SUPER, RICLASS_IS_ORIGIN, RTEST, T_CLASS, and T_ICLASS.
VALUE rb_func_lambda_new | ( | rb_block_call_func_t | func, |
VALUE | val, | ||
int | min_argc, | ||
int | max_argc | ||
) |
Definition at line 742 of file proc.c.
References vm_ifunc::func, rb_cProc, and rb_vm_ifunc_new().
VALUE rb_func_proc_new | ( | rb_block_call_func_t | func, |
VALUE | val | ||
) |
Definition at line 735 of file proc.c.
References vm_ifunc::func, and rb_cProc.
st_index_t rb_hash_proc | ( | st_index_t | hash, |
VALUE | prc | ||
) |
Definition at line 1433 of file proc.c.
References GetProcPtr, rb_block::proc, and rb_hash_uint.
Definition at line 2398 of file proc.c.
References argc, argv, Qnil, rb_block_given_p(), rb_block_proc(), and rb_method_call_with_block().
Definition at line 2391 of file proc.c.
References argc, argv, Qnil, rb_block_given_p(), rb_block_proc(), and rb_method_call_with_block_kw().
VALUE rb_method_call_with_block | ( | int | argc, |
const VALUE * | argv, | ||
VALUE | method, | ||
VALUE | passed_procval | ||
) |
Definition at line 2434 of file proc.c.
References argc, argv, rb_method_call_with_block_kw(), and RB_NO_KEYWORDS.
Referenced by rb_method_call().
VALUE rb_method_call_with_block_kw | ( | int | argc, |
const VALUE * | argv, | ||
VALUE | method, | ||
VALUE | passed_procval, | ||
int | kw_splat | ||
) |
Definition at line 2421 of file proc.c.
References argc, argv, Qundef, rb_eTypeError, rb_raise(), METHOD::recv, and TypedData_Get_Struct.
Referenced by rb_method_call_kw(), and rb_method_call_with_block().
const rb_method_definition_t * rb_method_def | ( | VALUE | method | ) |
Definition at line 2802 of file proc.c.
References rb_method_entry_struct::def, METHOD::me, and TypedData_Get_Struct.
Referenced by rb_method_iseq(), and rb_method_location().
int rb_method_entry_arity | ( | const rb_method_entry_t * | me | ) |
Definition at line 2684 of file proc.c.
References max, and METHOD::me.
Referenced by rb_mod_method_arity(), and rb_tracearg_parameters().
VALUE rb_method_entry_location | ( | const rb_method_entry_t * | me | ) |
Definition at line 2869 of file proc.c.
References rb_method_entry_struct::def, METHOD::me, and Qnil.
Definition at line 2835 of file proc.c.
References rb_method_def().
Referenced by rb_proc_get_iseq().
Definition at line 1909 of file proc.c.
References attached, BUILTIN_TYPE, FL_SINGLETON, FL_TEST, METHOD::klass, MSG, Qundef, rb_ivar_get(), str, T_CLASS, and T_MODULE.
Referenced by rb_undef().
Definition at line 2773 of file proc.c.
References METHOD::me, mod, and rb_method_entry_arity().
Referenced by rb_obj_method_arity().
Definition at line 1590 of file proc.c.
References Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Referenced by rb_callable_receiver(), and rb_econv_prepare_options().
Definition at line 152 of file proc.c.
References Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Referenced by rb_callable_receiver(), rb_econv_prepare_options(), rb_hash_set_default_proc(), and rb_raw_obj_info().
Definition at line 2781 of file proc.c.
References CLASS_OF, and rb_mod_method_arity().
Definition at line 2035 of file proc.c.
References rb_method_entry_struct::def, FALSE, ID2SYM, METHOD::klass, METHOD::me, NIL_P, Qundef, rb_check_id(), rb_cMethod, rb_method_entry_at(), rb_singleton_class_get(), RCLASS_ORIGIN, UNDEFINED_METHOD_ENTRY_P, UNDEFINED_REFINED_METHOD_P, and UNREACHABLE_RETURN.
Referenced by Init_Proc().
Definition at line 145 of file proc.c.
References TypedData_Make_Struct.
Definition at line 1126 of file proc.c.
References rb_proc_t::block, GetProcPtr, rb_proc_t::is_lambda, max, and UNLIMITED_ARGUMENTS.
Definition at line 981 of file proc.c.
References check_argc, GetProcPtr, RARRAY_CONST_PTR, RARRAY_LEN, RB_GC_GUARD, RB_NO_KEYWORDS, rb_vm_invoke_proc(), rb_captured_block::self, and VM_BLOCK_HANDLER_NONE.
Referenced by rb_call_end_proc().
Definition at line 966 of file proc.c.
References argc, argv, check_argc, GetProcPtr, RARRAY_CONST_PTR, RARRAY_LEN, RB_GC_GUARD, rb_vm_invoke_proc(), rb_captured_block::self, and VM_BLOCK_HANDLER_NONE.
Definition at line 1013 of file proc.c.
References argc, argv, GetProcPtr, RB_GC_GUARD, RB_NO_KEYWORDS, rb_vm_invoke_proc(), and rb_captured_block::self.
VALUE rb_proc_call_with_block_kw | ( | VALUE | self, |
int | argc, | ||
const VALUE * | argv, | ||
VALUE | passed_procval, | ||
int | kw_splat | ||
) |
Definition at line 1001 of file proc.c.
References argc, argv, GetProcPtr, RB_GC_GUARD, rb_vm_invoke_proc(), and rb_captured_block::self.
Definition at line 1242 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, vm_ifunc::data, GetProcPtr, rb_captured_block::ifunc, IS_METHOD_PROC_IFUNC, rb_captured_block::iseq, NULL, rb_block::proc, rb_method_iseq(), rb_proc_get_iseq(), and VM_UNREACHABLE.
Referenced by rb_proc_get_iseq(), rb_proc_location(), and rb_resolve_me_location().
Definition at line 275 of file proc.c.
References GetProcPtr, rb_proc_t::is_lambda, Qfalse, and Qtrue.
Referenced by Init_Proc().
VALUE rb_proc_new | ( | rb_block_call_func_t | func, |
VALUE | val | ||
) |
Definition at line 3145 of file proc.c.
References ruby::backward::cxxanyargs::rb_iterate().
Definition at line 1443 of file proc.c.
References id, ID2SYM, rb_block::proc, Qfalse, Qnil, RARRAY_AREF, rb_ary_store(), rb_ary_tmp_new(), rb_cProc, rb_gc_register_mark_object(), sym, and SYM2ID.
Referenced by Init_String(), and rb_vm_bh_to_procval().
Definition at line 1393 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_tracearg_parameters().
Definition at line 1640 of file vm.c.
References rb_execution_context_struct::cfp, rb_control_frame_struct::ep, NULL, rb_vm_get_ruby_level_next_cfp(), and rb_control_frame_struct::self.
struct vm_ifunc * rb_vm_ifunc_new | ( | rb_block_call_func_t | func, |
const void * | data, | ||
int | min_argc, | ||
int | max_argc | ||
) |
Definition at line 705 of file proc.c.
References vm_ifunc::argc, CHAR_BIT, imemo_ifunc, rb_eRangeError, rb_imemo_new(), rb_raise(), SIZEOF_VALUE, and UNLIMITED_ARGUMENTS.
Referenced by rb_func_lambda_new(), and rb_lambda_call().
VALUE rb_cBinding |
Definition at line 45 of file proc.c.
Referenced by Init_Binding(), and rb_vm_make_binding().
VALUE rb_cMethod |
Definition at line 44 of file proc.c.
Referenced by Init_Proc(), and rb_obj_singleton_method().
VALUE rb_cProc |
Definition at line 46 of file proc.c.
Referenced by Init_Proc(), rb_block_lambda(), rb_block_proc(), rb_func_lambda_new(), rb_func_proc_new(), rb_proc_dup(), rb_sym_to_proc(), and rb_vm_bh_to_procval().
VALUE rb_cUnboundMethod |
Definition at line 43 of file proc.c.
Referenced by Init_Proc().
const rb_data_type_t ruby_binding_data_type |
Definition at line 319 of file proc.c.
Referenced by rb_binding_alloc().