#include "eval_intern.h"#include "internal.h"#include "gc.h"#include "iseq.h"Go to the source code of this file.
Data Structures | |
| struct | METHOD |
Defines | |
| #define | IS_METHOD_PROC_NODE(node) (nd_type(node) == NODE_IFUNC && (node)->nd_cfnc == bmcall) |
| #define | check_argc(argc) (argc) |
| #define | get_proc_iseq rb_proc_get_iseq |
Functions | |
| static VALUE | bmcall (VALUE, VALUE, int, VALUE *, VALUE) |
| static int | method_arity (VALUE) |
| static int | method_min_max_arity (VALUE, int *max) |
| static void | proc_free (void *ptr) |
| static void | proc_mark (void *ptr) |
| static size_t | proc_memsize (const void *ptr) |
| VALUE | rb_proc_alloc (VALUE klass) |
| VALUE | rb_obj_is_proc (VALUE proc) |
| static VALUE | proc_dup (VALUE self) |
| static VALUE | proc_clone (VALUE self) |
| VALUE | rb_proc_lambda_p (VALUE procval) |
| static void | binding_free (void *ptr) |
| static void | binding_mark (void *ptr) |
| static size_t | binding_memsize (const void *ptr) |
| VALUE | rb_binding_alloc (VALUE klass) |
| static VALUE | binding_dup (VALUE self) |
| static VALUE | binding_clone (VALUE self) |
| VALUE | rb_binding_new_with_cfp (rb_thread_t *th, const rb_control_frame_t *src_cfp) |
| VALUE | rb_binding_new (void) |
| static VALUE | rb_f_binding (VALUE self) |
| static VALUE | bind_eval (int argc, VALUE *argv, VALUE bindval) |
| static VALUE | proc_new (VALUE klass, int is_lambda) |
| static VALUE | rb_proc_s_new (int argc, VALUE *argv, VALUE klass) |
| VALUE | rb_block_proc (void) |
| VALUE | rb_block_lambda (void) |
| VALUE | rb_f_lambda (void) |
| static VALUE | proc_call (int argc, VALUE *argv, VALUE procval) |
| VALUE | rb_proc_call (VALUE self, VALUE args) |
| VALUE | rb_proc_call_with_block (VALUE self, int argc, VALUE *argv, VALUE pass_procval) |
| static VALUE | proc_arity (VALUE self) |
| static int | rb_iseq_min_max_arity (const rb_iseq_t *iseq, int *max) |
| static int | rb_proc_min_max_arity (VALUE self, int *max) |
| int | rb_proc_arity (VALUE self) |
| rb_iseq_t * | rb_proc_get_iseq (VALUE self, int *is_proc) |
| static VALUE | iseq_location (rb_iseq_t *iseq) |
| VALUE | rb_proc_location (VALUE self) |
| static VALUE | unnamed_parameters (int arity) |
| static VALUE | rb_proc_parameters (VALUE self) |
| st_index_t | rb_hash_proc (st_index_t hash, VALUE prc) |
| static VALUE | proc_hash (VALUE self) |
| static VALUE | proc_to_s (VALUE self) |
| static VALUE | proc_to_proc (VALUE self) |
| static void | bm_mark (void *ptr) |
| static void | bm_free (void *ptr) |
| static size_t | bm_memsize (const void *ptr) |
| VALUE | rb_obj_is_method (VALUE m) |
| static VALUE | mnew (VALUE klass, VALUE obj, ID id, VALUE mclass, int scope) |
| static VALUE | method_eq (VALUE method, VALUE other) |
| static VALUE | method_hash (VALUE method) |
| static VALUE | method_unbind (VALUE obj) |
| static VALUE | method_receiver (VALUE obj) |
| static VALUE | method_name (VALUE obj) |
| static VALUE | method_owner (VALUE obj) |
| void | rb_method_name_error (VALUE klass, VALUE str) |
| VALUE | rb_obj_method (VALUE obj, VALUE vid) |
| VALUE | rb_obj_public_method (VALUE obj, VALUE vid) |
| static VALUE | rb_mod_instance_method (VALUE mod, VALUE vid) |
| static VALUE | rb_mod_public_instance_method (VALUE mod, VALUE vid) |
| static VALUE | rb_mod_define_method (int argc, VALUE *argv, VALUE mod) |
| static VALUE | rb_obj_define_method (int argc, VALUE *argv, VALUE obj) |
| static VALUE | top_define_method (int argc, VALUE *argv, VALUE obj) |
| static VALUE | method_clone (VALUE self) |
| VALUE | rb_method_call (int argc, VALUE *argv, VALUE method) |
| VALUE | rb_method_call_with_block (int argc, VALUE *argv, VALUE method, VALUE pass_procval) |
| static VALUE | umethod_bind (VALUE method, VALUE recv) |
| static int | rb_method_entry_min_max_arity (const rb_method_entry_t *me, int *max) |
| int | rb_method_entry_arity (const rb_method_entry_t *me) |
| static VALUE | method_arity_m (VALUE method) |
| static rb_method_entry_t * | original_method_entry (VALUE mod, ID id) |
| int | rb_mod_method_arity (VALUE mod, ID id) |
| int | rb_obj_method_arity (VALUE obj, ID id) |
| static rb_method_definition_t * | method_get_def (VALUE method) |
| static rb_iseq_t * | method_get_iseq (rb_method_definition_t *def) |
| rb_iseq_t * | rb_method_get_iseq (VALUE method) |
| static VALUE | method_def_location (rb_method_definition_t *def) |
| VALUE | rb_method_entry_location (rb_method_entry_t *me) |
| VALUE | rb_mod_method_location (VALUE mod, ID id) |
| VALUE | rb_obj_method_location (VALUE obj, ID id) |
| VALUE | rb_method_location (VALUE method) |
| static VALUE | rb_method_parameters (VALUE method) |
| static VALUE | method_inspect (VALUE method) |
| static VALUE | mproc (VALUE method) |
| static VALUE | mlambda (VALUE method) |
| VALUE | rb_proc_new (VALUE(*func)(ANYARGS), VALUE val) |
| static VALUE | method_proc (VALUE method) |
| static VALUE | localjump_xvalue (VALUE exc) |
| static VALUE | localjump_reason (VALUE exc) |
| static VALUE | proc_binding (VALUE self) |
| static VALUE | curry (VALUE dummy, VALUE args, int argc, VALUE *argv, VALUE passed_proc) |
| static VALUE | make_curry_proc (VALUE proc, VALUE passed, VALUE arity) |
| static VALUE | proc_curry (int argc, VALUE *argv, VALUE self) |
| void | Init_Proc (void) |
| void | Init_Binding (void) |
Variables | |
| VALUE | rb_cUnboundMethod |
| VALUE | rb_cMethod |
| VALUE | rb_cBinding |
| VALUE | rb_cProc |
| static ID | attached |
| static const rb_data_type_t | proc_data_type |
| static const rb_data_type_t | binding_data_type |
| static const rb_data_type_t | method_data_type |
Definition at line 567 of file proc.c.
Referenced by bmcall(), curry(), rb_method_entry_min_max_arity(), and rb_proc_call().
| #define get_proc_iseq rb_proc_get_iseq |
Definition at line 689 of file proc.c.
Referenced by method_get_iseq(), rb_proc_location(), and rb_proc_parameters().
Definition at line 38 of file proc.c.
Referenced by proc_binding(), rb_proc_get_iseq(), and rb_proc_min_max_arity().
| static VALUE bind_eval | ( | int | argc, | |
| VALUE * | argv, | |||
| VALUE | bindval | |||
| ) | [static] |
Definition at line 367 of file proc.c.
References args, Qnil, rb_f_eval(), and rb_scan_args().
Referenced by Init_Binding().
| static VALUE binding_clone | ( | VALUE | self | ) | [static] |
Definition at line 308 of file proc.c.
References binding_dup(), and CLONESETUP.
Referenced by Init_Binding().
| static VALUE binding_dup | ( | VALUE | self | ) | [static] |
Definition at line 293 of file proc.c.
References rb_binding_t::blockprocval, rb_binding_t::env, rb_binding_t::first_lineno, GetBindingPtr, rb_binding_t::path, rb_binding_alloc(), and rb_cBinding.
Referenced by binding_clone(), and Init_Binding().
| static void binding_free | ( | void * | ptr | ) | [static] |
Definition at line 242 of file proc.c.
References RUBY_FREE_ENTER, RUBY_FREE_LEAVE, and ruby_xfree().
| static void binding_mark | ( | void * | ptr | ) | [static] |
Definition at line 254 of file proc.c.
References rb_binding_t::blockprocval, rb_binding_t::env, rb_binding_t::path, RUBY_MARK_ENTER, RUBY_MARK_LEAVE, and RUBY_MARK_UNLESS_NULL.
| static void bm_free | ( | void * | ptr | ) | [static] |
Definition at line 877 of file proc.c.
References GET_VM, rb_method_entry_struct::mark, unlinked_method_entry_list_entry::me, METHOD::me, unlinked_method_entry_list_entry::next, METHOD::ume, and xfree.
| static void bm_mark | ( | void * | ptr | ) | [static] |
Definition at line 867 of file proc.c.
References METHOD::defined_class, METHOD::me, rb_gc_mark(), rb_mark_method_entry(), METHOD::rclass, and METHOD::recv.
| static VALUE bmcall | ( | VALUE | args, | |
| VALUE | method, | |||
| int | argc, | |||
| VALUE * | argv, | |||
| VALUE | passed_proc | |||
| ) | [static] |
Definition at line 2000 of file proc.c.
References check_argc, CLASS_OF, RARRAY_LEN, RARRAY_PTR, rb_ary_new3(), rb_cArray, RB_GC_GUARD, and rb_method_call_with_block().
Referenced by method_proc().
| static VALUE curry | ( | VALUE | dummy, | |
| VALUE | args, | |||
| int | argc, | |||
| VALUE * | argv, | |||
| VALUE | passed_proc | |||
| ) | [static] |
Definition at line 2153 of file proc.c.
References check_argc, FIX2INT, make_curry_proc(), NIL_P, RARRAY_LEN, RARRAY_PTR, rb_ary_freeze(), rb_ary_new4(), rb_ary_plus(), rb_proc_call_with_block(), and rb_warn().
Referenced by make_curry_proc().
| void Init_Binding | ( | void | ) |
Definition at line 2437 of file proc.c.
References attached, bind_eval(), binding_clone(), binding_dup(), CLASS_OF, rb_cBinding, rb_cObject, rb_define_class(), rb_define_global_function(), rb_define_method(), rb_f_binding(), rb_intern, rb_undef_alloc_func(), and rb_undef_method().
| void Init_Proc | ( | void | ) |
Definition at line 2300 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_owner(), method_proc(), method_receiver(), method_unbind(), OBJ_TAINT, proc_arity(), proc_binding(), proc_call(), 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_exc_new3(), rb_intern, rb_method_call(), 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_freeze(), rb_obj_method(), rb_obj_public_method(), rb_proc_lambda_p(), rb_proc_location(), rb_proc_parameters(), rb_proc_s_new(), rb_singleton_class(), rb_str_new2, rb_undef_alloc_func(), rb_undef_method(), rb_vm_top_self(), sysstack_error, top_define_method(), umethod_bind(), and VM_METHOD_TYPE_OPTIMIZED.
| static VALUE iseq_location | ( | rb_iseq_t * | iseq | ) | [static] |
Definition at line 713 of file proc.c.
References INT2FIX, rb_iseq_struct::line_info_table, rb_iseq_struct::location, rb_iseq_location_struct::path, Qnil, rb_ary_new4(), and rb_iseq_first_lineno().
Referenced by method_def_location(), and rb_proc_location().
| static VALUE localjump_reason | ( | VALUE | exc | ) | [static] |
| static VALUE localjump_xvalue | ( | VALUE | exc | ) | [static] |
| static VALUE make_curry_proc | ( | VALUE | proc, | |
| VALUE | passed, | |||
| VALUE | arity | |||
| ) | [static] |
Definition at line 2136 of file proc.c.
References args, curry(), GetProcPtr, rb_proc_t::is_lambda, rb_ary_freeze(), rb_ary_new3(), and rb_proc_new().
Referenced by curry(), and proc_curry().
| static int method_arity | ( | VALUE | method | ) | [static] |
Definition at line 1790 of file proc.c.
References METHOD::me, method_data_type, rb_method_entry_arity(), and TypedData_Get_Struct.
Referenced by method_arity_m(), and rb_method_parameters().
| static VALUE method_arity_m | ( | VALUE | method | ) | [static] |
Definition at line 1783 of file proc.c.
References INT2FIX, and method_arity().
Referenced by Init_Proc().
| static VALUE method_clone | ( | VALUE | self | ) | [static] |
Definition at line 1473 of file proc.c.
References rb_method_definition_struct::alias_count, ALLOC, CLASS_OF, CLONESETUP, rb_method_entry_struct::def, METHOD::me, method_data_type, TypedData_Get_Struct, TypedData_Make_Struct, and METHOD::ume.
Referenced by Init_Proc().
| static VALUE method_def_location | ( | rb_method_definition_t * | def | ) | [static] |
Definition at line 1865 of file proc.c.
References rb_method_definition_struct::attr, rb_method_definition_struct::body, iseq_location(), rb_method_attr_struct::location, method_get_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().
| static VALUE method_eq | ( | VALUE | method, | |
| VALUE | other | |||
| ) | [static] |
Definition at line 1033 of file proc.c.
References Check_TypedStruct, CLASS_OF, DATA_PTR, METHOD::me, method_data_type, Qfalse, Qtrue, rb_method_entry_eq(), rb_obj_is_method(), METHOD::rclass, and METHOD::recv.
Referenced by Init_Proc().
| static rb_method_definition_t* method_get_def | ( | VALUE | method | ) | [inline, static] |
Definition at line 1837 of file proc.c.
References rb_method_entry_struct::def, METHOD::me, method_data_type, and TypedData_Get_Struct.
Referenced by rb_method_get_iseq(), and rb_method_location().
| static rb_iseq_t* method_get_iseq | ( | rb_method_definition_t * | def | ) | [static] |
Definition at line 1846 of file proc.c.
References rb_method_definition_struct::body, get_proc_iseq, rb_method_definition_struct::iseq, rb_method_definition_struct::proc, rb_method_definition_struct::type, VM_METHOD_TYPE_BMETHOD, and VM_METHOD_TYPE_ISEQ.
Referenced by method_def_location(), method_proc(), and rb_method_get_iseq().
| static VALUE method_hash | ( | VALUE | method | ) | [static] |
Definition at line 1063 of file proc.c.
References hash(), INT2FIX, METHOD::me, method_data_type, rb_hash_end, rb_hash_method_entry(), rb_hash_start(), rb_hash_uint, METHOD::rclass, METHOD::recv, and TypedData_Get_Struct.
Referenced by Init_Proc().
| static VALUE method_inspect | ( | VALUE | method | ) | [static] |
Definition at line 1938 of file proc.c.
References attached, rb_method_entry_struct::def, FL_SINGLETON, FL_TEST, rb_method_entry_struct::klass, METHOD::me, method_data_type, rb_method_definition_struct::original_id, Qundef, rb_class2name(), 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, METHOD::rclass, METHOD::recv, rb_method_definition_struct::type, TypedData_Get_Struct, and VM_METHOD_TYPE_NOTIMPLEMENTED.
Referenced by Init_Proc().
| static int method_min_max_arity | ( | VALUE | method, | |
| int * | max | |||
| ) | [static] |
Definition at line 1814 of file proc.c.
References METHOD::me, method_data_type, rb_method_entry_min_max_arity(), and TypedData_Get_Struct.
Referenced by rb_proc_min_max_arity().
| static VALUE method_name | ( | VALUE | obj | ) | [static] |
Definition at line 1132 of file proc.c.
References METHOD::id, ID2SYM, method_data_type, and TypedData_Get_Struct.
Referenced by Init_Proc().
| static VALUE method_owner | ( | VALUE | obj | ) | [static] |
Definition at line 1148 of file proc.c.
References METHOD::defined_class, method_data_type, RB_TYPE_P, RBASIC, T_ICLASS, and TypedData_Get_Struct.
Referenced by Init_Proc().
| static VALUE method_proc | ( | VALUE | method | ) | [static] |
Definition at line 2034 of file proc.c.
References rb_env_t::block, rb_proc_t::block, bmcall(), rb_method_entry_struct::def, METHOD::defined_class, env, rb_proc_t::envval, GetEnvPtr, GetProcPtr, rb_proc_t::is_from_method, rb_block_struct::iseq, rb_block_struct::klass, METHOD::me, method_data_type, method_get_iseq(), mlambda(), rb_iterate(), METHOD::recv, rb_block_struct::self, and TypedData_Get_Struct.
Referenced by Init_Proc().
| static VALUE method_receiver | ( | VALUE | obj | ) | [static] |
Definition at line 1116 of file proc.c.
References method_data_type, METHOD::recv, and TypedData_Get_Struct.
Referenced by Init_Proc().
| static VALUE method_unbind | ( | VALUE | obj | ) | [static] |
Definition at line 1087 of file proc.c.
References rb_method_definition_struct::alias_count, ALLOC, rb_method_entry_struct::def, METHOD::defined_class, METHOD::id, METHOD::me, method_data_type, OBJ_INFECT, Qundef, rb_cUnboundMethod, METHOD::rclass, METHOD::recv, TypedData_Get_Struct, TypedData_Make_Struct, and METHOD::ume.
Referenced by Init_Proc().
| static VALUE mlambda | ( | VALUE | method | ) | [static] |
Definition at line 1994 of file proc.c.
References rb_funcall(), and rb_mRubyVMFrozenCore.
Referenced by method_proc().
| static VALUE mnew | ( | VALUE | klass, | |
| VALUE | obj, | |||
| ID | id, | |||
| VALUE | mclass, | |||
| int | scope | |||
| ) | [static] |
Definition at line 915 of file proc.c.
References rb_method_definition_struct::alias_count, ALLOC, rb_method_entry_struct::called_id, rb_method_entry_struct::def, METHOD::defined_class, FL_SINGLETON, FL_TEST, rb_method_entry_struct::flag, METHOD::id, ID2SYM, idRespond_to_missing, rb_method_entry_struct::klass, rb_method_entry_struct::mark, METHOD::me, method_data_type, NOEX_MASK, NOEX_PRIVATE, NOEX_PROTECTED, NOEX_PUBLIC, NOEX_UNDEF, OBJ_INFECT, rb_method_definition_struct::original_id, Qfalse, Qtrue, Qundef, rb_class2name(), rb_funcall(), rb_id2name(), rb_method_basic_definition_p(), rb_method_entry_without_refinements(), rb_name_error(), rb_print_undef(), RB_TYPE_P, METHOD::rclass, RCLASS_SUPER, METHOD::recv, RTEST, sym, T_ICLASS, T_MODULE, rb_method_definition_struct::type, TypedData_Make_Struct, METHOD::ume, UNDEFINED_METHOD_ENTRY_P, VM_METHOD_TYPE_MISSING, and VM_METHOD_TYPE_ZSUPER.
Referenced by rb_mod_instance_method(), rb_mod_public_instance_method(), rb_obj_method(), and rb_obj_public_method().
| static VALUE mproc | ( | VALUE | method | ) | [static] |
Definition at line 1988 of file proc.c.
References rb_funcall2(), and rb_mRubyVMFrozenCore.
Referenced by rb_proc_new().
| static rb_method_entry_t* original_method_entry | ( | VALUE | mod, | |
| ID | id | |||
| ) | [static] |
Definition at line 1799 of file proc.c.
References rb_method_entry_struct::def, METHOD::me, rb_method_definition_struct::original_id, rb_method_entry(), METHOD::rclass, RCLASS_SUPER, rb_method_definition_struct::type, and VM_METHOD_TYPE_ZSUPER.
Referenced by rb_mod_method_arity(), and rb_mod_method_location().
| static VALUE proc_arity | ( | VALUE | self | ) | [static] |
Definition at line 636 of file proc.c.
References INT2FIX, and rb_proc_arity().
Referenced by Init_Proc().
| static VALUE proc_binding | ( | VALUE | self | ) | [static] |
Definition at line 2105 of file proc.c.
References rb_proc_t::block, rb_proc_t::blockprocval, rb_binding_t::blockprocval, rb_binding_t::env, rb_proc_t::envval, rb_binding_t::first_lineno, GetBindingPtr, GetProcPtr, IS_METHOD_PROC_NODE, rb_block_struct::iseq, rb_iseq_struct::location, rb_iseq_location_struct::path, rb_binding_t::path, Qnil, rb_binding_alloc(), rb_cBinding, rb_eArgError, rb_iseq_first_lineno(), rb_raise(), RB_TYPE_P, RUBY_VM_NORMAL_ISEQ_P, and T_NODE.
Referenced by Init_Proc().
| static VALUE proc_call | ( | int | argc, | |
| VALUE * | argv, | |||
| VALUE | procval | |||
| ) | [static] |
Definition at line 532 of file proc.c.
References rb_iseq_struct::arg_block, rb_proc_t::block, BUILTIN_TYPE, GET_THREAD(), GetProcPtr, rb_block_struct::iseq, rb_block_given_p(), rb_block_proc(), RB_GC_GUARD, rb_vm_invoke_proc(), and T_NODE.
Referenced by Init_Proc().
| static VALUE proc_clone | ( | VALUE | self | ) | [static] |
Definition at line 122 of file proc.c.
References CLONESETUP, and proc_dup().
Referenced by Init_Proc().
| static VALUE proc_curry | ( | int | argc, | |
| VALUE * | argv, | |||
| VALUE | self | |||
| ) | [static] |
Definition at line 2219 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().
| static VALUE proc_dup | ( | VALUE | self | ) | [static] |
Definition at line 103 of file proc.c.
References rb_proc_t::block, rb_proc_t::blockprocval, rb_proc_t::envval, GetProcPtr, rb_proc_t::is_lambda, rb_block_struct::proc, rb_cProc, rb_proc_alloc(), and rb_proc_t::safe_level.
Referenced by Init_Proc(), proc_clone(), proc_new(), and rb_mod_define_method().
| static void proc_free | ( | void * | ptr | ) | [static] |
Definition at line 41 of file proc.c.
References RUBY_FREE_ENTER, RUBY_FREE_LEAVE, and ruby_xfree().
| static VALUE proc_hash | ( | VALUE | self | ) | [static] |
Definition at line 800 of file proc.c.
References hash(), LONG2FIX, rb_hash_end, rb_hash_proc(), and rb_hash_start().
Referenced by Init_Proc().
| static void proc_mark | ( | void * | ptr | ) | [static] |
Definition at line 51 of file proc.c.
References rb_proc_t::block, rb_proc_t::blockprocval, rb_proc_t::envval, rb_block_struct::iseq, rb_block_struct::proc, RUBY_MARK_ENTER, RUBY_MARK_LEAVE, RUBY_MARK_UNLESS_NULL, RUBY_VM_IFUNC_P, and rb_block_struct::self.
| static VALUE proc_new | ( | VALUE | klass, | |
| int | is_lambda | |||
| ) | [static] |
Definition at line 377 of file proc.c.
References rb_thread_struct::cfp, GET_THREAD(), GetProcPtr, rb_proc_t::is_lambda, rb_block_struct::proc, proc_dup(), Qnil, rb_eArgError, rb_raise(), rb_vm_control_frame_block_ptr(), rb_vm_make_proc(), rb_warn(), RBASIC, RUBY_VM_PREVIOUS_CONTROL_FRAME, and TRUE.
Referenced by rb_block_lambda(), rb_block_proc(), and rb_proc_s_new().
| static VALUE proc_to_proc | ( | VALUE | self | ) | [static] |
Definition at line 861 of file proc.c.
Referenced by Init_Proc().
| static VALUE proc_to_s | ( | VALUE | self | ) | [static] |
Definition at line 818 of file proc.c.
References rb_proc_t::block, GetProcPtr, rb_proc_t::is_lambda, rb_block_struct::iseq, rb_iseq_struct::line_info_table, rb_iseq_struct::location, OBJ_TAINT, OBJ_TAINTED, rb_iseq_location_struct::path, rb_iseq_first_lineno(), rb_obj_classname(), rb_sprintf(), RSTRING_PTR, and RUBY_VM_NORMAL_ISEQ_P.
Referenced by Init_Proc().
| VALUE rb_binding_alloc | ( | VALUE | klass | ) |
Definition at line 283 of file proc.c.
References binding_data_type, and TypedData_Make_Struct.
Referenced by binding_dup(), proc_binding(), and rb_vm_make_binding().
| VALUE rb_binding_new | ( | void | ) |
Definition at line 322 of file proc.c.
References rb_thread_struct::cfp, GET_THREAD(), and rb_binding_new_with_cfp().
Referenced by call_trace_func(), Init_VM(), and rb_f_binding().
| VALUE rb_binding_new_with_cfp | ( | rb_thread_t * | th, | |
| const rb_control_frame_t * | src_cfp | |||
| ) |
Definition at line 316 of file proc.c.
References rb_vm_make_binding().
Referenced by collect_caller_bindings(), rb_binding_new(), and rb_tracearg_binding().
| VALUE rb_block_lambda | ( | void | ) |
Definition at line 472 of file proc.c.
References proc_new(), rb_cProc, and TRUE.
Referenced by Init_Proc(), Init_VM(), rb_f_lambda(), and rb_mod_define_method().
| VALUE rb_block_proc | ( | void | ) |
Definition at line 458 of file proc.c.
References FALSE, proc_new(), and rb_cProc.
Referenced by define_final(), enum_chunk(), enum_slice_before(), enumerator_initialize(), ev_on_event(), generator_initialize(), Init_Proc(), Init_VM(), lazy_to_enum(), lib_thread_callback(), obj_to_enum(), ossl_x509store_verify(), proc_call(), 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(), tk_install_cmd(), tracepoint_new_s(), and yielder_initialize().
| static VALUE rb_f_binding | ( | VALUE | self | ) | [static] |
| VALUE rb_f_lambda | ( | void | ) |
Definition at line 478 of file proc.c.
References rb_block_lambda(), and rb_warn().
| st_index_t rb_hash_proc | ( | st_index_t | hash, | |
| VALUE | prc | |||
| ) |
Definition at line 783 of file proc.c.
References rb_proc_t::block, rb_proc_t::envval, rb_block_struct::ep, GetProcPtr, rb_block_struct::iseq, and rb_hash_uint.
Referenced by proc_hash(), and rb_hash_method_definition().
| static int rb_iseq_min_max_arity | ( | const rb_iseq_t * | iseq, | |
| int * | max | |||
| ) | [inline, static] |
Definition at line 643 of file proc.c.
References rb_iseq_struct::arg_opts, rb_iseq_struct::arg_post_len, rb_iseq_struct::arg_rest, rb_iseq_struct::argc, and UNLIMITED_ARGUMENTS.
Referenced by rb_method_entry_min_max_arity(), and rb_proc_min_max_arity().
| VALUE rb_method_call | ( | int | argc, | |
| VALUE * | argv, | |||
| VALUE | method | |||
| ) |
Definition at line 1504 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, | |
| VALUE * | argv, | |||
| VALUE | method, | |||
| VALUE | pass_procval | |||
| ) |
Definition at line 1511 of file proc.c.
References rb_proc_t::block, BUILTIN_TYPE, METHOD::defined_class, EXEC_TAG, GET_THREAD(), GetProcPtr, METHOD::id, JUMP_TAG, METHOD::me, method_data_type, NIL_P, OBJ_TAINTED, rb_thread_struct::passed_block, POP_TAG, PUSH_TAG, Qnil, Qundef, rb_eTypeError, rb_raise(), rb_safe_level, rb_set_safe_level_force(), rb_vm_call(), METHOD::rclass, METHOD::recv, result, T_MODULE, and TypedData_Get_Struct.
Referenced by bmcall(), and rb_method_call().
| int rb_method_entry_arity | ( | const rb_method_entry_t * | me | ) |
Definition at line 1743 of file proc.c.
References max(), and rb_method_entry_min_max_arity().
Referenced by check_funcall_respond_to(), method_arity(), and rb_mod_method_arity().
| VALUE rb_method_entry_location | ( | rb_method_entry_t * | me | ) |
Definition at line 1876 of file proc.c.
References rb_method_entry_struct::def, method_def_location(), and Qnil.
Referenced by rb_mod_method_location().
| static int rb_method_entry_min_max_arity | ( | const rb_method_entry_t * | me, | |
| int * | max | |||
| ) | [static] |
Definition at line 1695 of file proc.c.
References 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_definition_struct::optimize_type, rb_method_definition_struct::proc, rb_bug(), rb_iseq_min_max_arity(), rb_proc_min_max_arity(), rb_method_definition_struct::type, UNLIMITED_ARGUMENTS, UNREACHABLE, 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().
| rb_iseq_t* rb_method_get_iseq | ( | VALUE | method | ) |
Definition at line 1859 of file proc.c.
References method_get_def(), and method_get_iseq().
Referenced by iseq_s_of(), rb_method_parameters(), and rb_proc_get_iseq().
| VALUE rb_method_location | ( | VALUE | method | ) |
Definition at line 1904 of file proc.c.
References method_def_location(), and method_get_def().
Referenced by Init_Proc().
| void rb_method_name_error | ( | VALUE | klass, | |
| VALUE | str | |||
| ) |
Definition at line 1164 of file proc.c.
References attached, FL_SINGLETON, FL_TEST, PRIsVALUE, QUOTE, rb_class_name(), rb_ivar_get(), rb_name_error_str(), RB_TYPE_P, T_CLASS, T_MODULE, and TYPE.
Referenced by rb_mod_instance_method(), rb_mod_public_instance_method(), rb_mod_undef_method(), rb_obj_method(), and rb_obj_public_method().
| static VALUE rb_method_parameters | ( | VALUE | method | ) | [static] |
Definition at line 1918 of file proc.c.
References method_arity(), rb_iseq_parameters(), rb_method_get_iseq(), and unnamed_parameters().
Referenced by Init_Proc().
| static VALUE rb_mod_define_method | ( | int | argc, | |
| VALUE * | argv, | |||
| VALUE | mod | |||
| ) | [static] |
Definition at line 1337 of file proc.c.
References rb_proc_t::block, BUILTIN_TYPE, DATA_PTR, rb_iseq_struct::defined_method_id, FL_SINGLETON, FL_TEST, GetProcPtr, id, rb_proc_t::is_from_method, rb_proc_t::is_lambda, rb_block_struct::iseq, rb_block_struct::klass, rb_iseq_struct::klass, METHOD::me, NOEX_PUBLIC, proc_dup(), rb_add_method(), rb_block_lambda(), rb_check_arity, rb_class2name(), rb_class_inherited_p(), rb_eTypeError, RB_GC_GUARD, rb_method_entry_set(), rb_obj_classname(), rb_obj_is_method(), rb_obj_is_proc(), rb_raise(), rb_to_id(), RB_TYPE_P, METHOD::rclass, RTEST, T_MODULE, T_NODE, TRUE, and VM_METHOD_TYPE_BMETHOD.
Referenced by Init_Proc(), rb_obj_define_method(), and top_define_method().
| static VALUE rb_mod_instance_method | ( | VALUE | mod, | |
| VALUE | vid | |||
| ) | [static] |
Definition at line 1273 of file proc.c.
References FALSE, mnew(), Qundef, rb_check_id(), rb_cUnboundMethod, and rb_method_name_error().
Referenced by Init_Proc().
| int rb_mod_method_arity | ( | VALUE | mod, | |
| ID | id | |||
| ) |
Definition at line 1823 of file proc.c.
References METHOD::me, original_method_entry(), and rb_method_entry_arity().
Referenced by rb_obj_method_arity().
| VALUE rb_mod_method_location | ( | VALUE | mod, | |
| ID | id | |||
| ) |
Definition at line 1883 of file proc.c.
References METHOD::me, original_method_entry(), and rb_method_entry_location().
Referenced by rb_obj_method_location(), and rb_obj_respond_to().
| static VALUE rb_mod_public_instance_method | ( | VALUE | mod, | |
| VALUE | vid | |||
| ) | [static] |
Definition at line 1290 of file proc.c.
References mnew(), Qundef, rb_check_id(), rb_cUnboundMethod, rb_method_name_error(), and TRUE.
Referenced by Init_Proc().
| static VALUE rb_obj_define_method | ( | int | argc, | |
| VALUE * | argv, | |||
| VALUE | obj | |||
| ) | [static] |
Definition at line 1424 of file proc.c.
References rb_mod_define_method(), and rb_singleton_class().
Referenced by Init_Proc().
| VALUE rb_obj_is_method | ( | VALUE | m | ) |
Definition at line 904 of file proc.c.
References method_data_type, Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Referenced by method_eq(), rb_econv_prepare_options(), rb_mod_define_method(), and transcode_loop().
| VALUE rb_obj_is_proc | ( | VALUE | proc | ) |
Definition at line 91 of file proc.c.
References proc_data_type, Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Referenced by enumerator_initialize(), enumerator_size(), generator_initialize(), iseq_s_of(), rb_econv_prepare_options(), rb_hash_set_default_proc(), rb_mod_define_method(), set_trace_func(), thread_add_trace_func(), transcode_loop(), and vm_caller_setup_args().
| VALUE rb_obj_method | ( | VALUE | obj, | |
| VALUE | vid | |||
| ) |
Definition at line 1215 of file proc.c.
References CLASS_OF, FALSE, mnew(), rb_check_id(), rb_cMethod, and rb_method_name_error().
Referenced by Init_Proc(), and wmap_allocate().
| int rb_obj_method_arity | ( | VALUE | obj, | |
| ID | id | |||
| ) |
Definition at line 1831 of file proc.c.
References CLASS_OF, and rb_mod_method_arity().
Referenced by rb_obj_respond_to().
| VALUE rb_obj_method_location | ( | VALUE | obj, | |
| ID | id | |||
| ) |
Definition at line 1890 of file proc.c.
References CLASS_OF, and rb_mod_method_location().
| VALUE rb_obj_public_method | ( | VALUE | obj, | |
| VALUE | vid | |||
| ) |
Definition at line 1232 of file proc.c.
References CLASS_OF, mnew(), rb_check_id(), rb_cMethod, rb_method_name_error(), and TRUE.
Referenced by Init_Proc().
| VALUE rb_proc_alloc | ( | VALUE | klass | ) |
Definition at line 84 of file proc.c.
References proc_data_type, and TypedData_Make_Struct.
Referenced by proc_dup(), and rb_vm_make_proc().
| int rb_proc_arity | ( | VALUE | self | ) |
Definition at line 681 of file proc.c.
References GetProcPtr, rb_proc_t::is_lambda, max(), rb_proc_min_max_arity(), and UNLIMITED_ARGUMENTS.
Referenced by default_proc_arity_check(), proc_arity(), and rb_proc_parameters().
| VALUE rb_proc_call | ( | VALUE | self, | |
| VALUE | args | |||
| ) |
Definition at line 571 of file proc.c.
References check_argc, GET_THREAD(), GetProcPtr, RARRAY_LEN, RARRAY_PTR, RB_GC_GUARD, and rb_vm_invoke_proc().
Referenced by enumerator_size(), generator_each(), proc_fallback(), rb_call_end_proc(), and yielder_yield().
| VALUE rb_proc_call_with_block | ( | VALUE | self, | |
| int | argc, | |||
| VALUE * | argv, | |||
| VALUE | pass_procval | |||
| ) |
Definition at line 584 of file proc.c.
References rb_proc_t::block, GET_THREAD(), GetProcPtr, NIL_P, RB_GC_GUARD, and rb_vm_invoke_proc().
Referenced by call_trace_func(), curry(), enumerator_size(), and tp_call_trace().
| rb_iseq_t* rb_proc_get_iseq | ( | VALUE | self, | |
| int * | is_proc | |||
| ) |
Definition at line 692 of file proc.c.
References rb_proc_t::block, GetProcPtr, rb_proc_t::is_lambda, IS_METHOD_PROC_NODE, rb_block_struct::iseq, node, rb_method_get_iseq(), and RUBY_VM_NORMAL_ISEQ_P.
Referenced by rb_method_entry_make().
| VALUE rb_proc_lambda_p | ( | VALUE | procval | ) |
Definition at line 231 of file proc.c.
References GetProcPtr, rb_proc_t::is_lambda, Qfalse, and Qtrue.
Referenced by default_proc_arity_check(), Init_Proc(), and proc_curry().
| VALUE rb_proc_location | ( | VALUE | self | ) |
Definition at line 737 of file proc.c.
References get_proc_iseq, and iseq_location().
Referenced by Init_Proc(), and thread_initialize().
| static int rb_proc_min_max_arity | ( | VALUE | self, | |
| int * | max | |||
| ) | [static] |
Definition at line 658 of file proc.c.
References rb_proc_t::block, BUILTIN_TYPE, GetProcPtr, IS_METHOD_PROC_NODE, rb_block_struct::iseq, method_min_max_arity(), node, rb_iseq_min_max_arity(), T_NODE, and UNLIMITED_ARGUMENTS.
Referenced by proc_curry(), rb_method_entry_min_max_arity(), and rb_proc_arity().
| VALUE rb_proc_new | ( | VALUE(*)(ANYARGS) | func, | |
| VALUE | val | |||
| ) |
Definition at line 2018 of file proc.c.
References func, mproc(), and rb_iterate().
Referenced by call_queue_handler(), create_encoding_table(), eval_queue_handler(), invoke_queue_handler(), make_curry_proc(), rb_fiber_new(), sym_to_proc(), and yielder_new().
| static VALUE rb_proc_parameters | ( | VALUE | self | ) | [static] |
Definition at line 772 of file proc.c.
References get_proc_iseq, rb_iseq_parameters(), rb_proc_arity(), and unnamed_parameters().
Referenced by Init_Proc().
| static VALUE rb_proc_s_new | ( | int | argc, | |
| VALUE * | argv, | |||
| VALUE | klass | |||
| ) | [static] |
Definition at line 442 of file proc.c.
References FALSE, proc_new(), and rb_obj_call_init().
Referenced by Init_Proc().
| static VALUE top_define_method | ( | int | argc, | |
| VALUE * | argv, | |||
| VALUE | obj | |||
| ) | [static] |
Definition at line 1439 of file proc.c.
References GET_THREAD(), rb_cObject, rb_mod_define_method(), rb_secure(), rb_warning(), and rb_thread_struct::top_wrapper.
Referenced by Init_Proc().
| static VALUE umethod_bind | ( | VALUE | method, | |
| VALUE | recv | |||
| ) | [static] |
Definition at line 1646 of file proc.c.
References rb_method_definition_struct::alias_count, ALLOC, BUILTIN_TYPE, CLASS_OF, rb_method_entry_struct::def, METHOD::defined_class, FL_SINGLETON, FL_TEST, METHOD::me, method_data_type, rb_class2name(), rb_class_search_ancestor(), rb_cMethod, rb_eTypeError, rb_include_class_new(), rb_obj_is_kind_of(), rb_raise(), RB_TYPE_P, METHOD::rclass, METHOD::recv, T_MODULE, TypedData_Get_Struct, TypedData_Make_Struct, and METHOD::ume.
Referenced by Init_Proc().
| static VALUE unnamed_parameters | ( | int | arity | ) | [static] |
Definition at line 743 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().
ID attached [static] |
Definition at line 34 of file proc.c.
Referenced by Init_Binding(), method_inspect(), and rb_method_name_error().
const rb_data_type_t binding_data_type [static] |
{
"binding",
{
binding_mark,
binding_free,
binding_memsize,
},
}
Definition at line 273 of file proc.c.
Referenced by rb_binding_alloc().
const rb_data_type_t method_data_type [static] |
{
"method",
{
bm_mark,
bm_free,
bm_memsize,
},
}
Definition at line 894 of file proc.c.
Referenced by method_arity(), method_clone(), method_eq(), method_get_def(), method_hash(), method_inspect(), method_min_max_arity(), method_name(), method_owner(), method_proc(), method_receiver(), method_unbind(), mnew(), rb_method_call_with_block(), rb_obj_is_method(), and umethod_bind().
const rb_data_type_t proc_data_type [static] |
{
"proc",
{
proc_mark,
proc_free,
proc_memsize,
},
}
Definition at line 74 of file proc.c.
Referenced by rb_obj_is_proc(), and rb_proc_alloc().
| VALUE rb_cBinding |
Definition at line 28 of file proc.c.
Referenced by binding_dup(), eval_string_with_cref(), Init_Binding(), proc_binding(), and rb_vm_make_binding().
| VALUE rb_cMethod |
Definition at line 27 of file proc.c.
Referenced by Init_Proc(), rb_obj_method(), rb_obj_public_method(), and umethod_bind().
| VALUE rb_cProc |
Definition at line 29 of file proc.c.
Referenced by get_eval_string_core(), Init_Proc(), m_core_set_postexe(), proc_dup(), rb_block_lambda(), rb_block_proc(), vm_callee_setup_arg_complex(), vm_make_proc_from_block(), vm_yield_setup_block_args(), and vm_yield_with_cfunc().
| VALUE rb_cUnboundMethod |
Definition at line 26 of file proc.c.
Referenced by Init_Proc(), method_unbind(), rb_mod_instance_method(), and rb_mod_public_instance_method().
1.6.1