#include "eval_intern.h"
#include "gc.h"
Go to the source code of this file.
Definition at line 571 of file proc.c.
Referenced by bmcall(), curry(), rb_method_entry_arity(), and rb_proc_call().
#define get_proc_iseq rb_proc_get_iseq |
Definition at line 655 of file proc.c.
Referenced by method_get_iseq(), rb_proc_location(), and rb_proc_parameters().
#define IS_METHOD_PROC_NODE | ( | node | ) | (nd_type(node) == NODE_IFUNC && (node)->nd_cfnc == bmcall) |
Definition at line 36 of file proc.c.
Referenced by proc_binding(), rb_proc_arity(), and rb_proc_get_iseq().
Definition at line 366 of file proc.c.
References Qnil, rb_f_eval(), and rb_scan_args().
Referenced by Init_Binding().
Definition at line 277 of file proc.c.
References TypedData_Make_Struct.
Referenced by binding_dup(), proc_binding(), and rb_binding_new().
Definition at line 301 of file proc.c.
References binding_dup(), and CLONESETUP.
Referenced by Init_Binding().
Definition at line 287 of file proc.c.
References binding_alloc(), rb_binding_t::env, rb_binding_t::filename, GetBindingPtr, rb_binding_t::line_no, and rb_cBinding.
Referenced by binding_clone(), and Init_Binding().
static void binding_free | ( | void * | ptr | ) | [static] |
Definition at line 239 of file proc.c.
References RUBY_FREE_ENTER, RUBY_FREE_LEAVE, and ruby_xfree().
static void binding_mark | ( | void * | ptr | ) | [static] |
Definition at line 251 of file proc.c.
References rb_binding_t::env, rb_binding_t::filename, RUBY_MARK_ENTER, RUBY_MARK_LEAVE, and RUBY_MARK_UNLESS_NULL.
static void bm_free | ( | void * | ptr | ) | [static] |
Definition at line 866 of file proc.c.
References rb_method_definition_struct::alias_count, rb_method_entry_struct::def, METHOD::me, and xfree().
static void bm_mark | ( | void * | ptr | ) | [static] |
Definition at line 857 of file proc.c.
References METHOD::me, rb_gc_mark(), rb_mark_method_entry(), METHOD::rclass, and METHOD::recv.
Definition at line 1793 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().
Referenced by method_proc().
Definition at line 1936 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 2223 of file proc.c.
References 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_undef_alloc_func(), and rb_undef_method().
void Init_Proc | ( | void | ) |
Definition at line 2088 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_eq(), proc_hash(), proc_lambda(), proc_to_proc(), proc_to_s(), rb_add_method(), rb_block_proc(), rb_cMethod, rb_cModule, rb_cObject, rb_cProc, rb_cUnboundMethod, 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_str_new2(), rb_undef_alloc_func(), rb_undef_method(), sysstack_error, umethod_bind(), and VM_METHOD_TYPE_OPTIMIZED.
Definition at line 679 of file proc.c.
References rb_iseq_struct::filename, rb_iseq_struct::insn_info_table, INT2FIX, rb_ary_new4(), and rb_iseq_first_lineno().
Referenced by rb_method_location(), and rb_proc_location().
Definition at line 1919 of file proc.c.
References 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 1634 of file proc.c.
References METHOD::me, method_data_type, rb_method_entry_arity(), and TypedData_Get_Struct.
Referenced by method_arity_m(), rb_method_parameters(), and rb_proc_arity().
Definition at line 1627 of file proc.c.
References INT2FIX, and method_arity().
Referenced by Init_Proc().
Definition at line 1369 of file proc.c.
References rb_method_definition_struct::alias_count, CLASS_OF, CLONESETUP, rb_method_entry_struct::def, METHOD::me, method_data_type, TypedData_Get_Struct, and TypedData_Make_Struct.
Referenced by Init_Proc().
Definition at line 1014 of file proc.c.
References Check_TypedStruct, CLASS_OF, DATA_PTR, method_data_type, rb_method_entry_eq(), and rb_obj_is_method().
Referenced by Init_Proc().
static rb_method_definition_t* method_get_def | ( | VALUE | method | ) | [inline, static] |
Definition at line 1656 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 1665 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 rb_method_get_iseq(), and rb_method_location().
Definition at line 1045 of file proc.c.
References rb_method_entry_struct::def, INT2FIX, METHOD::me, method_data_type, rb_hash_end(), rb_hash_start(), rb_hash_uint(), METHOD::rclass, METHOD::recv, and TypedData_Get_Struct.
Referenced by Init_Proc().
Definition at line 1731 of file proc.c.
References 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_iv_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().
Definition at line 1111 of file proc.c.
References METHOD::id, ID2SYM, method_data_type, and TypedData_Get_Struct.
Referenced by Init_Proc().
Definition at line 1127 of file proc.c.
References rb_method_entry_struct::klass, METHOD::me, method_data_type, and TypedData_Get_Struct.
Referenced by Init_Proc().
Definition at line 1828 of file proc.c.
References bmcall(), GetProcPtr, rb_proc_t::is_from_method, mlambda(), and rb_iterate().
Referenced by Init_Proc().
Definition at line 1095 of file proc.c.
References method_data_type, METHOD::recv, and TypedData_Get_Struct.
Referenced by Init_Proc().
Definition at line 1069 of file proc.c.
References rb_method_definition_struct::alias_count, rb_method_entry_struct::def, METHOD::id, METHOD::me, method_data_type, OBJ_INFECT, rb_cUnboundMethod, METHOD::rclass, METHOD::recv, TypedData_Get_Struct, and TypedData_Make_Struct.
Referenced by Init_Proc().
Definition at line 1787 of file proc.c.
References Qnil, rb_funcall(), and rb_intern.
Referenced by method_proc().
Definition at line 897 of file proc.c.
References rb_method_definition_struct::alias_count, ALLOC, rb_method_entry_struct::called_id, rb_method_entry_struct::def, FL_SINGLETON, FL_TEST, rb_method_entry_struct::flag, METHOD::id, ID2SYM, 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_intern, rb_method_basic_definition_p(), rb_method_entry(), rb_name_error(), rb_print_undef(), RBASIC, METHOD::rclass, RCLASS_SUPER, METHOD::recv, RTEST, T_ICLASS, T_MODULE, TYPE, rb_method_definition_struct::type, TypedData_Make_Struct, UNDEFINED_METHOD_ENTRY_P, and VM_METHOD_TYPE_ZSUPER.
Referenced by rb_mod_instance_method(), rb_mod_public_instance_method(), rb_obj_method(), and rb_obj_public_method().
Definition at line 1781 of file proc.c.
References Qnil, rb_funcall(), and rb_intern.
Referenced by rb_proc_new().
Definition at line 622 of file proc.c.
References INT2FIX, and rb_proc_arity().
Referenced by Init_Proc().
Definition at line 1889 of file proc.c.
References binding_alloc(), rb_proc_t::block, rb_binding_t::env, rb_proc_t::envval, rb_iseq_struct::filename, rb_binding_t::filename, GetBindingPtr, GetProcPtr, IS_METHOD_PROC_NODE, rb_block_struct::iseq, rb_binding_t::line_no, rb_cBinding, rb_eArgError, rb_iseq_first_lineno(), rb_raise(), RUBY_VM_NORMAL_ISEQ_P, T_NODE, and TYPE.
Referenced by Init_Proc().
Definition at line 538 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(), rb_block_struct::self, and T_NODE.
Referenced by Init_Proc().
Definition at line 118 of file proc.c.
References CLONESETUP, and proc_dup().
Referenced by Init_Proc().
Definition at line 2002 of file proc.c.
References FIX2INT, INT2FIX, make_curry_proc(), NIL_P, rb_ary_new(), rb_eArgError, rb_proc_arity(), rb_proc_lambda_p(), rb_raise(), and rb_scan_args().
Referenced by Init_Proc().
Definition at line 99 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().
Definition at line 757 of file proc.c.
References rb_proc_t::block, rb_proc_t::envval, GetProcPtr, rb_iseq_struct::iseq, rb_block_struct::iseq, rb_iseq_struct::iseq_size, rb_iseq_struct::local_size, MEMCMP, and rb_obj_is_proc().
Referenced by Init_Proc().
static void proc_free | ( | void * | ptr | ) | [static] |
Definition at line 39 of file proc.c.
References RUBY_FREE_ENTER, RUBY_FREE_LEAVE, and ruby_xfree().
Definition at line 787 of file proc.c.
References rb_proc_t::block, rb_proc_t::envval, GetProcPtr, rb_block_struct::iseq, rb_block_struct::lfp, LONG2FIX, rb_hash_end(), rb_hash_start(), and rb_hash_uint().
Referenced by Init_Proc().
static VALUE proc_lambda | ( | void | ) | [static] |
static void proc_mark | ( | void * | ptr | ) | [static] |
Definition at line 49 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.
Definition at line 376 of file proc.c.
References rb_thread_struct::cfp, GC_GUARDED_PTR_REF, GET_THREAD, GetProcPtr, rb_proc_t::is_lambda, rb_control_frame_t::lfp, rb_block_struct::proc, proc_dup(), rb_eArgError, rb_raise(), rb_vm_make_proc(), rb_warn(), RBASIC, and RUBY_VM_PREVIOUS_CONTROL_FRAME.
Referenced by rb_block_lambda(), rb_block_proc(), and rb_proc_s_new().
Definition at line 851 of file proc.c.
Referenced by Init_Proc().
Definition at line 808 of file proc.c.
References rb_proc_t::block, rb_iseq_struct::filename, GetProcPtr, rb_iseq_struct::insn_info_table, rb_proc_t::is_lambda, rb_block_struct::iseq, OBJ_TAINT, OBJ_TAINTED, rb_iseq_first_lineno(), rb_obj_classname(), rb_sprintf(), RSTRING_PTR, and RUBY_VM_NORMAL_ISEQ_P.
Referenced by Init_Proc().
VALUE rb_binding_new | ( | void | ) |
Definition at line 309 of file proc.c.
References binding_alloc(), rb_thread_struct::cfp, rb_binding_t::env, rb_iseq_struct::filename, rb_binding_t::filename, GET_THREAD, GetBindingPtr, rb_control_frame_t::iseq, rb_binding_t::line_no, rb_cBinding, rb_eRuntimeError, rb_raise(), rb_vm_get_ruby_level_next_cfp(), rb_vm_get_sourceline(), and rb_vm_make_env_object().
Referenced by call_trace_proc(), Init_VM(), and rb_f_binding().
VALUE rb_block_lambda | ( | void | ) |
Definition at line 467 of file proc.c.
References proc_new(), rb_cProc, and TRUE.
Referenced by proc_lambda(), rb_f_lambda(), and rb_mod_define_method().
VALUE rb_block_proc | ( | void | ) |
Definition at line 461 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(), lib_thread_callback(), ossl_x509store_verify(), proc_call(), rb_f_at_exit(), rb_f_trace_var(), rb_fiber_init(), rb_hash_initialize(), rb_scan_args(), sig_trap(), thread_create_core(), tk_install_cmd(), and yielder_initialize().
VALUE rb_f_lambda | ( | void | ) |
Definition at line 473 of file proc.c.
References rb_block_lambda(), and rb_warn().
Definition at line 1376 of file iseq.c.
References rb_iseq_struct::arg_block, rb_iseq_struct::arg_post_len, rb_iseq_struct::arg_post_start, rb_iseq_struct::arg_rest, rb_iseq_struct::arg_size, rb_iseq_struct::argc, CONST_ID, ID2SYM, PARAM, PARAM_ID, PARAM_TYPE, Qnil, rb_ary_new2(), rb_ary_push(), and rb_id2name().
Referenced by rb_method_parameters(), and rb_proc_parameters().
Definition at line 1397 of file proc.c.
References EXEC_TAG, GET_THREAD, METHOD::id, JUMP_TAG, METHOD::me, method_data_type, OBJ_TAINTED, PASS_PASSED_BLOCK_TH, POP_TAG, PUSH_TAG, Qundef, rb_eTypeError, rb_raise(), rb_safe_level, rb_set_safe_level_force(), rb_vm_call(), METHOD::recv, result, and TypedData_Get_Struct.
Referenced by bmcall(), and Init_Proc().
int rb_method_entry_arity | ( | const rb_method_entry_t * | me | ) |
Definition at line 1550 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, 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_proc_arity(), rb_method_definition_struct::type, 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_UNDEF, and VM_METHOD_TYPE_ZSUPER.
Referenced by method_arity(), and rb_mod_method_arity().
Definition at line 1678 of file proc.c.
References method_get_def(), and method_get_iseq().
Referenced by iseq_s_disasm(), rb_method_parameters(), and rb_proc_get_iseq().
Definition at line 1692 of file proc.c.
References rb_method_definition_struct::attr, rb_method_definition_struct::body, iseq_location(), rb_method_attr_struct::location, method_get_def(), method_get_iseq(), rb_ary_dup(), rb_method_definition_struct::type, VM_METHOD_TYPE_ATTRSET, and VM_METHOD_TYPE_IVAR.
Referenced by Init_Proc().
Definition at line 1711 of file proc.c.
References method_arity(), rb_iseq_parameters(), rb_method_get_iseq(), and unnamed_parameters().
Referenced by Init_Proc().
Definition at line 1270 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_iseq_struct::klass, METHOD::me, proc_dup(), rb_add_method(), rb_block_lambda(), rb_class2name(), rb_class_inherited_p(), rb_eArgError, rb_eTypeError, rb_method_entry_set(), rb_obj_classname(), rb_obj_is_method(), rb_obj_is_proc(), rb_raise(), rb_to_id(), METHOD::rclass, RTEST, T_NODE, and VM_METHOD_TYPE_BMETHOD.
Referenced by Init_Proc(), and rb_obj_define_method().
Definition at line 1214 of file proc.c.
References FALSE, mnew(), Qundef, rb_cUnboundMethod, and rb_to_id().
Referenced by Init_Proc().
Definition at line 1643 of file proc.c.
References METHOD::me, rb_method_entry(), and rb_method_entry_arity().
Referenced by rb_obj_method_arity().
Definition at line 1227 of file proc.c.
References mnew(), Qundef, rb_cUnboundMethod, rb_to_id(), and TRUE.
Referenced by Init_Proc().
Definition at line 1356 of file proc.c.
References rb_mod_define_method(), and rb_singleton_class().
Referenced by Init_Proc().
static int rb_obj_is_method | ( | VALUE | m | ) | [inline, static] |
Definition at line 891 of file proc.c.
References method_data_type, and rb_typeddata_is_kind_of().
Referenced by method_eq(), and rb_mod_define_method().
Definition at line 87 of file proc.c.
References rb_typeddata_is_kind_of().
Referenced by caller_setup_args(), generator_initialize(), iseq_s_disasm(), proc_eq(), rb_hash_set_default_proc(), rb_mod_define_method(), set_trace_func(), and thread_add_trace_func().
Definition at line 1164 of file proc.c.
References CLASS_OF, FALSE, mnew(), rb_cMethod, and rb_to_id().
Referenced by Init_Proc().
Definition at line 1650 of file proc.c.
References CLASS_OF, and rb_mod_method_arity().
Definition at line 1177 of file proc.c.
References CLASS_OF, mnew(), rb_cMethod, rb_to_id(), and TRUE.
Referenced by Init_Proc().
Definition at line 80 of file proc.c.
References TypedData_Make_Struct.
Referenced by proc_dup(), and rb_vm_make_proc().
int rb_proc_arity | ( | VALUE | self | ) |
Definition at line 629 of file proc.c.
References rb_iseq_struct::arg_post_len, rb_iseq_struct::arg_rest, rb_iseq_struct::argc, rb_proc_t::block, BUILTIN_TYPE, GetProcPtr, IS_METHOD_PROC_NODE, rb_block_struct::iseq, method_arity(), and T_NODE.
Referenced by default_proc_arity_check(), proc_arity(), proc_curry(), rb_method_entry_arity(), and rb_proc_parameters().
Definition at line 575 of file proc.c.
References rb_proc_t::block, check_argc, GET_THREAD, GetProcPtr, RARRAY_LEN, RARRAY_PTR, rb_vm_invoke_proc(), and rb_block_struct::self.
Referenced by generator_each(), rb_call_end_proc(), and yielder_yield().
Definition at line 584 of file proc.c.
References rb_proc_t::block, GET_THREAD, GetProcPtr, NIL_P, rb_vm_invoke_proc(), and rb_block_struct::self.
Referenced by call_trace_proc(), and curry().
Definition at line 658 of file proc.c.
References rb_proc_t::block, GetProcPtr, rb_proc_t::is_lambda, IS_METHOD_PROC_NODE, rb_block_struct::iseq, rb_method_get_iseq(), and RUBY_VM_NORMAL_ISEQ_P.
Referenced by rb_method_entry_make().
Definition at line 228 of file proc.c.
References GetProcPtr, rb_proc_t::is_lambda, and Qtrue.
Referenced by default_proc_arity_check(), Init_Proc(), and proc_curry().
Definition at line 703 of file proc.c.
References get_proc_iseq, and iseq_location().
Referenced by Init_Proc(), and thread_initialize().
Definition at line 1812 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().
Definition at line 738 of file proc.c.
References get_proc_iseq, rb_iseq_parameters(), rb_proc_arity(), and unnamed_parameters().
Referenced by Init_Proc().
Definition at line 445 of file proc.c.
References FALSE, proc_new(), and rb_obj_call_init().
Referenced by Init_Proc().
Definition at line 1523 of file proc.c.
References rb_method_definition_struct::alias_count, CLASS_OF, rb_method_entry_struct::def, FL_SINGLETON, FL_TEST, METHOD::me, method_data_type, rb_class2name(), rb_cMethod, rb_eTypeError, rb_obj_is_kind_of(), rb_raise(), METHOD::rclass, METHOD::recv, TypedData_Get_Struct, and TypedData_Make_Struct.
Referenced by Init_Proc().
static VALUE unnamed_parameters | ( | int | arity | ) | [static] |
Definition at line 709 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().
const rb_data_type_t binding_data_type [static] |
const rb_data_type_t method_data_type [static] |
{
"method",
bm_mark,
bm_free,
bm_memsize,
}
Definition at line 883 of file proc.c.
Referenced by method_arity(), method_clone(), method_eq(), method_get_def(), method_hash(), method_inspect(), method_name(), method_owner(), method_receiver(), method_unbind(), mnew(), rb_method_call(), rb_obj_is_method(), and umethod_bind().
const rb_data_type_t proc_data_type [static] |