Ruby
2.4.2p198(2017-09-14revision59899)
|
#include "id_table.h"
Go to the source code of this file.
Data Structures | |
struct | cache_entry |
Macros | |
#define | METHOD_DEBUG 0 |
#define | GLOBAL_METHOD_CACHE(c, m) (rb_bug("global method cache disabled improperly"), NULL) |
#define | object_id idObject_id |
#define | added idMethod_added |
#define | singleton_added idSingleton_method_added |
#define | removed idMethod_removed |
#define | singleton_removed idSingleton_method_removed |
#define | undefined idMethod_undefined |
#define | singleton_undefined idSingleton_method_undefined |
#define | attached id__attached__ |
#define | ruby_running (GET_VM()->running) |
#define | CALL_METHOD_HOOK(klass, hook, mid) |
#define | UNDEF_ALLOC_FUNC ((rb_alloc_func_t)-1) |
#define | BOUND_PRIVATE 0x01 |
#define | BOUND_RESPONDS 0x02 |
#define | rb_intern(str) rb_intern_const(str) |
#define | REPLICATE_METHOD(klass, id) |
Variables | |
static VALUE(*)(VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *) | call_cfunc_invoker_func (int argc) |
#define added idMethod_added |
Definition at line 32 of file vm_method.c.
Referenced by getifaddrs(), and method_added().
#define attached id__attached__ |
Definition at line 38 of file vm_method.c.
#define BOUND_PRIVATE 0x01 |
Definition at line 1065 of file vm_method.c.
Referenced by check_funcall_failed().
#define BOUND_RESPONDS 0x02 |
Definition at line 1066 of file vm_method.c.
Referenced by basic_obj_respond_to(), check_funcall_failed(), and rb_method_boundp().
#define CALL_METHOD_HOOK | ( | klass, | |
hook, | |||
mid | |||
) |
Definition at line 611 of file vm_method.c.
Referenced by method_added(), rb_undef(), and remove_method().
#define GLOBAL_METHOD_CACHE | ( | c, | |
m | |||
) | (rb_bug("global method cache disabled improperly"), NULL) |
Definition at line 25 of file vm_method.c.
Referenced by method_entry_get(), and method_entry_get_without_cache().
#define METHOD_DEBUG 0 |
Definition at line 7 of file vm_method.c.
Referenced by method_definition_addref(), method_definition_addref_complement(), and rb_method_definition_release().
#define object_id idObject_id |
Definition at line 31 of file vm_method.c.
Referenced by rb_method_entry_make(), rb_undef(), and remove_method().
#define rb_intern | ( | str | ) | rb_intern_const(str) |
Referenced by rb_remove_method().
#define removed idMethod_removed |
Definition at line 34 of file vm_method.c.
Referenced by remove_method().
#define REPLICATE_METHOD | ( | klass, | |
id | |||
) |
Referenced by Init_eval_method().
#define ruby_running (GET_VM()->running) |
Definition at line 59 of file vm_method.c.
Referenced by method_added(), method_entry_get_without_cache(), and rb_method_entry_create().
#define singleton_added idSingleton_method_added |
Definition at line 33 of file vm_method.c.
#define singleton_removed idSingleton_method_removed |
Definition at line 35 of file vm_method.c.
#define singleton_undefined idSingleton_method_undefined |
Definition at line 37 of file vm_method.c.
#define UNDEF_ALLOC_FUNC ((rb_alloc_func_t)-1) |
Definition at line 671 of file vm_method.c.
Referenced by rb_get_alloc_func(), and rb_undef_alloc_func().
#define undefined idMethod_undefined |
Definition at line 36 of file vm_method.c.
Referenced by bind_local_variable_get(), rb_method_call_status(), and rb_undef().
|
inlinestatic |
Definition at line 1916 of file vm_method.c.
References basic_obj_respond_to_missing(), BOUND_RESPONDS, CLASS_OF, FALSE, ID2SYM, Qfalse, Qtrue, Qundef, rb_method_boundp(), RTEST, and TRUE.
Referenced by obj_respond_to(), and rb_obj_respond_to().
|
static |
Definition at line 1901 of file vm_method.c.
References call_method_entry(), cache_entry::defined_class, idRespond_to_missing, METHOD_ENTRY_BASIC, method_entry_get(), cache_entry::mid, and Qundef.
Referenced by basic_obj_respond_to(), check_funcall_missing(), and obj_respond_to().
|
static |
Definition at line 1889 of file vm_method.c.
References prepare_callable_method_entry(), result, vm_call0(), vm_passed_block_handler(), and vm_passed_block_handler_set().
Referenced by basic_obj_respond_to_missing(), check_funcall_exec(), and vm_respond_to().
|
static |
Definition at line 1306 of file vm_method.c.
References cache_entry::me, METHOD_ENTRY_VISI, Qfalse, Qtrue, rb_check_id(), and rb_method_entry_without_refinements().
Referenced by rb_mod_private_method_defined(), rb_mod_protected_method_defined(), and rb_mod_public_method_defined().
Definition at line 476 of file vm_method.c.
References lookup_method_table(), cache_entry::me, rb_method_entry_struct::owner, rb_class_foreach_subclass(), rb_method_entry(), rb_vm_check_redefinition_opt_method(), RCLASS_ORIGIN, and vm_redefinition_check_flag().
Referenced by rb_method_entry_make().
Definition at line 379 of file vm_method.c.
References BUILTIN_TYPE, rb_bug(), rb_obj_info(), T_CLASS, T_ICLASS, and T_MODULE.
Referenced by rb_method_entry_create().
void Init_eval_method | ( | void | ) |
Definition at line 2087 of file vm_method.c.
References idRespond_to, idRespond_to_missing, obj_respond_to(), obj_respond_to_missing(), rb_cModule, rb_define_method(), rb_define_private_method(), rb_eException, rb_mKernel, rb_mod_alias_method(), rb_mod_method_defined(), rb_mod_modfunc(), rb_mod_private(), rb_mod_private_method(), rb_mod_private_method_defined(), rb_mod_protected(), rb_mod_protected_method_defined(), rb_mod_public(), rb_mod_public_method(), rb_mod_public_method_defined(), rb_mod_remove_method(), rb_mod_undef_method(), rb_singleton_class(), rb_vm_top_self(), REPLICATE_METHOD, top_private(), and top_public().
Referenced by Init_eval().
void Init_Method | ( | void | ) |
Definition at line 2062 of file vm_method.c.
References calloc, EXIT_FAILURE, getenv, NULL, and val.
|
inlinestatic |
Definition at line 183 of file vm_method.c.
References rb_id_table_lookup(), RCLASS_M_TBL, and st_data_t.
Referenced by check_override_opt_method(), rb_add_refined_method_entry(), rb_method_entry_at(), rb_method_entry_make(), and search_method().
|
static |
Definition at line 435 of file vm_method.c.
References rb_method_entry_struct::called_id, rb_method_entry_struct::def, rb_method_entry_struct::defined_class, method_definition_addref(), method_definition_create(), method_definition_set(), METHOD_ENTRY_FLAGS_COPY(), METHOD_ENTRY_VISI_SET(), METHOD_VISI_PUBLIC, rb_method_entry_struct::owner, rb_method_entry_alloc(), rb_vm_check_redefinition_opt_method(), rb_method_definition_struct::type, and VM_METHOD_TYPE_REFINED.
Referenced by rb_add_refined_method_entry(), and rb_method_entry_make().
Definition at line 623 of file vm_method.c.
References added, CALL_METHOD_HOOK, and ruby_running.
Referenced by method_entry_set(), rb_add_method(), and rb_alias().
|
static |
Definition at line 356 of file vm_method.c.
References rb_method_definition_struct::alias_count, METHOD_DEBUG, rb_method_definition_struct::original_id, and rb_id2name().
Referenced by make_method_entry_refined(), method_entry_set(), rb_method_entry_clone(), and rb_method_entry_copy().
|
static |
Definition at line 364 of file vm_method.c.
References rb_method_definition_struct::alias_count, rb_method_definition_struct::complemented_count, METHOD_DEBUG, rb_method_definition_struct::original_id, and rb_id2name().
Referenced by rb_method_entry_complement_defined_class().
|
static |
Definition at line 346 of file vm_method.c.
References cache_entry::mid, rb_method_definition_struct::original_id, rb_method_definition_struct::type, and ZALLOC.
Referenced by make_method_entry_refined(), and rb_method_entry_make().
|
static |
Definition at line 312 of file vm_method.c.
References rb_method_definition_struct::alias, rb_method_definition_struct::attr, rb_method_definition_struct::body, rb_method_iseq_struct::cref, rb_method_entry_struct::def, rb_method_definition_struct::iseq, rb_method_iseq_struct::iseqptr, rb_method_attr_struct::location, rb_method_refined_struct::orig_me, rb_method_alias_struct::original_me, rb_method_refined_struct::owner, rb_method_definition_struct::proc, Qundef, RB_OBJ_WRITTEN, rb_method_definition_struct::refined, 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 rb_method_entry_copy(), and rb_method_entry_create().
|
static |
Definition at line 232 of file vm_method.c.
References rb_method_definition_struct::alias, rb_method_cfunc_struct::argc, rb_method_definition_struct::attr, rb_method_definition_struct::body, rb_iseq_struct::body, rb_thread_struct::cfp, rb_method_definition_struct::cfunc, rb_method_iseq_struct::cref, rb_method_entry_struct::def, rb_method_cfunc_struct::func, GET_THREAD, rb_method_attr_struct::id, if(), INT2FIX, rb_method_definition_struct::iseq, rb_control_frame_struct::iseq, rb_method_iseq_struct::iseqptr, rb_method_attr_struct::location, rb_iseq_constant_body::location, method_cref(), NULL, rb_method_definition_struct::optimize_type, rb_method_refined_struct::orig_me, rb_method_alias_struct::original_me, rb_method_refined_struct::owner, rb_iseq_location_struct::path, rb_method_definition_struct::proc, rb_ary_freeze(), rb_ary_new3, rb_f_notimplement(), RB_OBJ_WRITE, rb_vm_get_ruby_level_next_cfp(), rb_vm_get_sourceline(), rb_method_definition_struct::refined, setup_method_cfunc_struct(), rb_method_definition_struct::type, VM_ASSERT, vm_cref_dump(), vm_cref_new_toplevel(), 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 make_method_entry_refined(), and rb_method_entry_make().
|
static |
Definition at line 776 of file vm_method.c.
References cache_entry::class_serial, cache_entry::defined_class, GET_GLOBAL_METHOD_STATE, GLOBAL_METHOD_CACHE, cache_entry::me, method_entry_get_without_cache(), cache_entry::method_state, cache_entry::mid, and RCLASS_SERIAL.
Referenced by basic_obj_respond_to_missing(), check_funcall_missing(), method_entry_resolve_refinement(), rb_callable_method_entry(), rb_method_entry(), refined_method_original_method_entry(), resolve_refined_method(), and vm_respond_to().
|
static |
Definition at line 726 of file vm_method.c.
References cache_entry::class_serial, cache_entry::defined_class, GET_GLOBAL_METHOD_STATE, GLOBAL_METHOD_CACHE, id, cache_entry::me, cache_entry::method_state, cache_entry::mid, NULL, OPT_GLOBAL_METHOD_CACHE, rb_bug(), RCLASS_SERIAL, ruby_running, search_method(), and UNDEFINED_METHOD_ENTRY_P.
Referenced by method_entry_get().
|
static |
Definition at line 844 of file vm_method.c.
References CREF_REFINEMENTS(), rb_method_entry_struct::def, cache_entry::me, method_entry_get(), NULL, Qnil, rb_vm_cref(), resolve_refined_method(), rb_method_definition_struct::type, UNDEFINED_METHOD_ENTRY_P, and VM_METHOD_TYPE_REFINED.
Referenced by rb_callable_method_entry_with_refinements(), rb_callable_method_entry_without_refinements(), rb_method_entry_with_refinements(), and rb_method_entry_without_refinements().
|
static |
Definition at line 656 of file vm_method.c.
References rb_method_entry_struct::def, method_added(), method_definition_addref(), NULL, rb_method_entry_make(), and rb_method_definition_struct::type.
Referenced by rb_alias(), and rb_method_entry_set().
Definition at line 2022 of file vm_method.c.
References basic_obj_respond_to(), basic_obj_respond_to_missing(), CLASS_OF, GET_THREAD, id, cache_entry::mid, Qfalse, Qtrue, Qundef, rb_check_id(), rb_scan_args(), rb_to_symbol(), and RTEST.
Referenced by Init_eval_method().
|
static |
Definition at line 1427 of file vm_method.c.
References rb_method_definition_struct::alias, rb_method_definition_struct::body, rb_method_entry_struct::def, rb_method_refined_struct::orig_me, rb_method_alias_struct::original_me, rb_method_definition_struct::refined, rb_method_definition_struct::type, VM_METHOD_TYPE_ALIAS, and VM_METHOD_TYPE_REFINED.
Referenced by rb_hash_method_definition(), and rb_method_definition_eq().
|
static |
Definition at line 802 of file vm_method.c.
References rb_method_entry_struct::defined_class, NULL, rb_id_table_create(), rb_id_table_insert(), rb_id_table_lookup(), rb_method_entry_complement_defined_class(), RB_TYPE_P, RCLASS_CALLABLE_M_TBL, RCLASS_EXT, T_ICLASS, T_MODULE, and VM_ASSERT.
Referenced by call_method_entry(), rb_callable_method_entry(), rb_callable_method_entry_with_refinements(), and rb_callable_method_entry_without_refinements().
rb_method_entry_t* rb_add_method | ( | VALUE | klass, |
ID | mid, | ||
rb_method_type_t | type, | ||
void * | opts, | ||
rb_method_visibility_t | visi | ||
) |
Definition at line 631 of file vm_method.c.
References cache_entry::me, method_added(), NULL, rb_method_entry_make(), VM_METHOD_TYPE_REFINED, and VM_METHOD_TYPE_UNDEF.
Referenced by Init_Proc(), Init_vm_eval(), rb_add_method_cfunc(), rb_add_method_iseq(), rb_add_refined_method_entry(), rb_attr(), rb_define_notimplement_method_id(), rb_export_method(), rb_mod_define_method(), rb_undef(), rb_undef_method(), and undef_method_i().
void rb_add_method_cfunc | ( | VALUE | klass, |
ID | mid, | ||
VALUE(*)(ANYARGS) | func, | ||
int | argc, | ||
rb_method_visibility_t | visi | ||
) |
Definition at line 136 of file vm_method.c.
References rb_method_cfunc_struct::argc, argc, func, rb_method_cfunc_struct::func, rb_add_method(), rb_define_notimplement_method_id(), rb_eArgError, rb_f_notimplement(), rb_raise(), and VM_METHOD_TYPE_CFUNC.
Referenced by rb_define_method(), rb_define_method_id(), rb_define_private_method(), and rb_define_protected_method().
void rb_add_method_iseq | ( | VALUE | klass, |
ID | mid, | ||
const rb_iseq_t * | iseq, | ||
rb_cref_t * | cref, | ||
rb_method_visibility_t | visi | ||
) |
Definition at line 643 of file vm_method.c.
References rb_add_method(), and VM_METHOD_TYPE_ISEQ.
Referenced by clone_method(), define_aref_method(), define_aset_method(), and vm_define_method().
Definition at line 462 of file vm_method.c.
References lookup_method_table(), make_method_entry_refined(), cache_entry::me, METHOD_VISI_PUBLIC, rb_add_method(), rb_clear_method_cache_by_class(), and VM_METHOD_TYPE_REFINED.
Referenced by add_refined_method_entry_i(), rb_method_entry_make(), and remove_method().
Definition at line 1526 of file vm_method.c.
References rb_method_entry_struct::called_id, rb_method_entry_struct::def, cache_entry::defined_class, rb_method_entry_struct::defined_class, method_added(), method_entry_set(), METHOD_ENTRY_VISI, METHOD_VISI_UNDEF, NIL_P, NULL, rb_method_definition_struct::original_id, rb_method_entry_struct::owner, Qnil, rb_cObject, rb_eTypeError, rb_frozen_class_p(), rb_method_entry_clone(), rb_method_entry_make(), RB_OBJ_WRITE, rb_print_undef(), rb_raise(), rb_resolve_refined_method(), RB_TYPE_P, RCLASS_SUPER, search_method(), T_MODULE, rb_method_definition_struct::type, UNDEFINED_METHOD_ENTRY_P, UNDEFINED_REFINED_METHOD_P, VM_METHOD_TYPE_ALIAS, VM_METHOD_TYPE_REFINED, and VM_METHOD_TYPE_ZSUPER.
Referenced by Init_signal(), Init_strscan(), m_core_set_method_alias(), rb_define_alias(), and rb_mod_alias_method().
Definition at line 1138 of file vm_method.c.
References METHOD_VISI_PRIVATE, METHOD_VISI_PROTECTED, METHOD_VISI_PUBLIC, PRIsVALUE, rb_add_method(), rb_id2str, rb_id_attrset(), rb_intern_str, rb_scope_module_func_check(), rb_scope_visibility_get(), rb_sprintf(), rb_warning(), VM_METHOD_TYPE_ATTRSET, and VM_METHOD_TYPE_IVAR.
Referenced by Init_Exception(), Init_ossl_asn1(), Init_ossl_pkcs12(), Init_ossl_pkcs7(), Init_ossl_ssl(), Init_ossl_x509ext(), Init_ossl_x509store(), rb_define_attr(), rb_mod_attr(), rb_mod_attr_accessor(), rb_mod_attr_reader(), and rb_mod_attr_writer().
const rb_callable_method_entry_t* rb_callable_method_entry | ( | VALUE | klass, |
ID | id | ||
) |
Definition at line 834 of file vm_method.c.
References cache_entry::defined_class, method_entry_get(), prepare_callable_method_entry(), and resolve_refined_method().
Referenced by method_missing(), rb_search_method_entry(), vm_call0_body(), vm_call_method_each_type(), vm_call_super(), vm_call_zsuper(), vm_search_method(), and vm_search_super_method().
const rb_callable_method_entry_t* rb_callable_method_entry_with_refinements | ( | VALUE | klass, |
ID | id | ||
) |
Definition at line 873 of file vm_method.c.
References cache_entry::defined_class, method_entry_resolve_refinement(), prepare_callable_method_entry(), and TRUE.
Referenced by check_match(), refine_sym_proc_call(), and vm_call_opt_send().
const rb_callable_method_entry_t* rb_callable_method_entry_without_refinements | ( | VALUE | klass, |
ID | id | ||
) |
Definition at line 887 of file vm_method.c.
References cache_entry::defined_class, FALSE, method_entry_resolve_refinement(), and prepare_callable_method_entry().
Referenced by method_super_method(), mnew(), mnew_internal(), and vm_call_method_missing().
Definition at line 63 of file vm_method.c.
References rb_bug(), rb_class_foreach_subclass(), rb_id_table_clear(), rb_next_class_serial(), rb_obj_info_dump(), RB_TYPE_P, RCLASS_CALLABLE_M_TBL, RCLASS_SERIAL, and T_ICLASS.
Referenced by rb_clear_method_cache_by_class().
void rb_clear_cache | ( | void | ) |
Definition at line 84 of file vm_method.c.
References ONLY_FOR_INTERNAL_USE.
void rb_clear_constant_cache | ( | void | ) |
Definition at line 90 of file vm_method.c.
References INC_GLOBAL_CONSTANT_STATE.
Referenced by const_tbl_update(), include_modules_at(), rb_const_remove(), rb_const_set(), and set_const_visibility().
void rb_clear_method_cache_by_class | ( | VALUE | klass | ) |
Definition at line 96 of file vm_method.c.
References INC_GLOBAL_METHOD_STATE, rb_subclass_entry::klass, rb_subclass_entry::next, NULL, Qnil, Qundef, rb_cBasicObject, rb_class2name(), rb_class_clear_method_cache(), rb_cObject, rb_id_table_clear(), rb_mKernel, RCLASS_CALLABLE_M_TBL, RCLASS_EXT, and RUBY_DTRACE_HOOK.
Referenced by include_modules_at(), m_core_undef_method(), rb_add_refined_method_entry(), rb_export_method(), rb_method_entry_make(), rb_using_module(), and remove_method().
Definition at line 674 of file vm_method.c.
References Check_Type, func, RCLASS_EXT, and T_CLASS.
Referenced by rb_undef_alloc_func().
|
static |
Definition at line 130 of file vm_method.c.
References rb_add_method(), and VM_METHOD_TYPE_NOTIMPLEMENTED.
Referenced by rb_add_method_cfunc().
|
static |
Definition at line 1033 of file vm_method.c.
References rb_method_definition_struct::body, rb_method_entry_struct::def, cache_entry::defined_class, cache_entry::me, METHOD_ENTRY_VISI, METHOD_ENTRY_VISI_SET(), METHOD_VISI_UNDEF, rb_method_refined_struct::orig_me, rb_add_method(), rb_clear_method_cache_by_class(), rb_cObject, rb_print_undef(), RB_TYPE_P, rb_vm_check_redefinition_opt_method(), RCLASS_ORIGIN, rb_method_definition_struct::refined, search_method(), T_MODULE, rb_method_definition_struct::type, UNDEFINED_METHOD_ENTRY_P, UNDEFINED_REFINED_METHOD_P, VM_METHOD_TYPE_REFINED, and VM_METHOD_TYPE_ZSUPER.
Referenced by set_method_visibility().
Definition at line 122 of file vm_method.c.
References rb_notimplement(), and UNREACHABLE.
Referenced by Init_ossl_ssl(), method_definition_set(), and rb_add_method_cfunc().
void rb_free_method_entry | ( | const rb_method_entry_t * | me | ) |
Definition at line 174 of file vm_method.c.
References d1, rb_method_entry_struct::def, METHOD_ENTRY_COMPLEMENTED, rb_method_definition_eq(), rb_method_definition_release(), and search_method().
Referenced by obj_free().
rb_alloc_func_t rb_get_alloc_func | ( | VALUE | klass | ) |
Definition at line 687 of file vm_method.c.
References Check_Type, RCLASS_EXT, RCLASS_SUPER, T_CLASS, and UNDEF_ALLOC_FUNC.
Referenced by obj_alloc_by_klass(), r_fixup_compat(), r_object0(), rb_marshal_define_compat(), rb_obj_alloc(), and w_object().
|
static |
Definition at line 1486 of file vm_method.c.
References rb_method_cfunc_struct::argc, rb_method_definition_struct::attr, rb_method_definition_struct::body, rb_method_definition_struct::cfunc, rb_method_cfunc_struct::func, hash(), rb_method_attr_struct::id, rb_method_definition_struct::iseq, rb_method_iseq_struct::iseqptr, rb_method_definition_struct::optimize_type, rb_method_definition_struct::original_id, original_method_definition(), rb_method_definition_struct::proc, rb_bug(), rb_hash_proc(), rb_hash_uint(), 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 rb_hash_method_entry().
st_index_t rb_hash_method_entry | ( | st_index_t | hash, |
const rb_method_entry_t * | me | ||
) |
Definition at line 1520 of file vm_method.c.
References rb_method_entry_struct::def, and rb_hash_method_definition().
Referenced by method_hash().
Definition at line 1880 of file vm_method.c.
References FALSE, cache_entry::me, METHOD_ENTRY_BASIC, rb_method_entry(), and TRUE.
Referenced by ary_inject_op(), basic_to_f_p(), dig_basic_p(), enum_inject(), enum_sum(), rb_get_backtrace(), rb_hash_default_value(), rb_mod_const_get(), rb_p(), respond_to_missing_p(), send_internal(), set_backtrace(), vm_call_opt_send(), and vm_caller_setup_arg_block().
Definition at line 1069 of file vm_method.c.
References BOUND_RESPONDS, rb_method_entry_struct::def, METHOD_ENTRY_VISI, METHOD_VISI_PRIVATE, METHOD_VISI_PROTECTED, rb_method_entry_without_refinements(), rb_method_definition_struct::type, and VM_METHOD_TYPE_NOTIMPLEMENTED.
Referenced by basic_obj_respond_to(), check_funcall_failed(), rb_mod_method_defined(), and vm_defined().
|
static |
Definition at line 1449 of file vm_method.c.
References rb_method_cfunc_struct::argc, rb_method_definition_struct::attr, rb_method_definition_struct::body, rb_method_definition_struct::cfunc, rb_method_cfunc_struct::func, rb_method_attr_struct::id, rb_method_definition_struct::iseq, rb_method_iseq_struct::iseqptr, rb_method_definition_struct::optimize_type, rb_method_definition_struct::original_id, original_method_definition(), rb_method_definition_struct::proc, rb_bug(), rb_equal(), RTEST, 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 rb_free_method_entry(), rb_method_entry_eq(), and rb_method_entry_make().
|
static |
Definition at line 151 of file vm_method.c.
References rb_method_definition_struct::alias_count, rb_method_definition_struct::complemented_count, METHOD_DEBUG, NULL, rb_method_definition_struct::original_id, rb_id2name(), VM_ASSERT, and xfree().
Referenced by rb_free_method_entry().
const rb_method_entry_t* rb_method_entry | ( | VALUE | klass, |
ID | id | ||
) |
Definition at line 796 of file vm_method.c.
References method_entry_get(), and NULL.
Referenced by check_override_opt_method(), check_redefined_method(), original_method_entry(), rb_method_basic_definition_p(), rb_obj_basic_to_s_p(), and vm_defined().
|
static |
Definition at line 372 of file vm_method.c.
References imemo_ment, cache_entry::me, and rb_imemo_new().
Referenced by make_method_entry_refined(), rb_method_entry_clone(), rb_method_entry_complement_defined_class(), and rb_method_entry_create().
const rb_method_entry_t* rb_method_entry_at | ( | VALUE | klass, |
ID | id | ||
) |
Definition at line 714 of file vm_method.c.
References lookup_method_table().
Referenced by add_opt_method(), and rb_obj_singleton_method().
const rb_method_entry_t* rb_method_entry_clone | ( | const rb_method_entry_t * | src_me | ) |
Definition at line 402 of file vm_method.c.
References rb_method_entry_struct::called_id, rb_method_entry_struct::def, rb_method_entry_struct::defined_class, cache_entry::me, method_definition_addref(), METHOD_ENTRY_FLAGS_COPY(), rb_method_entry_struct::owner, and rb_method_entry_alloc().
Referenced by method_clone(), method_unbind(), move_refined_method(), rb_alias(), and umethod_bind().
const rb_callable_method_entry_t* rb_method_entry_complement_defined_class | ( | const rb_method_entry_t * | src_me, |
ID | called_id, | ||
VALUE | defined_class | ||
) |
Definition at line 411 of file vm_method.c.
References rb_method_entry_struct::def, cache_entry::me, method_definition_addref_complement(), METHOD_ENTRY_COMPLEMENTED_SET, METHOD_ENTRY_FLAGS_COPY(), rb_method_entry_struct::owner, rb_method_entry_alloc(), RB_TYPE_P, T_MODULE, and VM_ASSERT.
Referenced by aliased_callable_method_entry(), prepare_callable_method_entry(), rb_resolve_refined_method_callable(), and umethod_bind().
void rb_method_entry_copy | ( | rb_method_entry_t * | dst, |
const rb_method_entry_t * | src | ||
) |
Definition at line 424 of file vm_method.c.
References rb_method_entry_struct::called_id, rb_method_entry_struct::def, rb_method_entry_struct::defined_class, method_definition_addref(), method_definition_reset(), METHOD_ENTRY_FLAGS_COPY(), rb_method_entry_struct::owner, and RB_OBJ_WRITE.
Referenced by move_refined_method().
rb_method_entry_t* rb_method_entry_create | ( | ID | called_id, |
VALUE | klass, | ||
rb_method_visibility_t | visi, | ||
const rb_method_definition_t * | def | ||
) |
Definition at line 393 of file vm_method.c.
References FALSE, filter_defined_class(), cache_entry::me, method_definition_reset(), METHOD_ENTRY_FLAGS_SET(), NULL, rb_method_entry_alloc(), ruby_running, and TRUE.
Referenced by mnew_missing(), and rb_method_entry_make().
int rb_method_entry_eq | ( | const rb_method_entry_t * | m1, |
const rb_method_entry_t * | m2 | ||
) |
Definition at line 1421 of file vm_method.c.
References rb_method_entry_struct::def, and rb_method_definition_eq().
Referenced by method_eq().
|
static |
Definition at line 498 of file vm_method.c.
References rb_method_definition_struct::alias_count, rb_method_definition_struct::body, rb_iseq_struct::body, check_override_opt_method(), rb_method_entry_struct::def, def_iseq_ptr(), rb_iseq_location_struct::first_lineno, FIX2INT, FL_SINGLETON, FL_TEST, idRespond_to_missing, rb_iseq_constant_body::location, lookup_method_table(), make_method_entry_refined(), cache_entry::me, method_definition_create(), method_definition_set(), METHOD_VISI_PRIVATE, NIL_P, NULL, object_id, rb_method_definition_struct::original_id, rb_iseq_location_struct::path, PRIsVALUE, rb_method_definition_struct::proc, Qundef, rb_add_refined_method_entry(), rb_clear_method_cache_by_class(), rb_cObject, rb_compile_warning(), rb_frozen_class_p(), rb_id2name(), rb_id2str, rb_id_table_insert(), rb_id_table_lookup(), rb_method_definition_eq(), rb_method_entry_create(), RB_OBJ_WRITTEN, rb_proc_get_iseq(), rb_refinement_module_get_refined_class(), RB_TYPE_P, rb_vm_check_redefinition_opt_method(), rb_warn(), rb_warning(), RCLASS_M_TBL, RCLASS_ORIGIN, RMODULE_IS_REFINEMENT, RSTRING_PTR, RTEST, ruby_verbose, search_method(), st_data_t, T_MODULE, rb_method_definition_struct::type, VM_ASSERT, VM_METHOD_TYPE_ALIAS, VM_METHOD_TYPE_BMETHOD, VM_METHOD_TYPE_ISEQ, VM_METHOD_TYPE_NOTIMPLEMENTED, VM_METHOD_TYPE_REFINED, VM_METHOD_TYPE_UNDEF, and VM_METHOD_TYPE_ZSUPER.
Referenced by method_entry_set(), rb_add_method(), and rb_alias().
rb_method_entry_t* rb_method_entry_set | ( | VALUE | klass, |
ID | mid, | ||
const rb_method_entry_t * | me, | ||
rb_method_visibility_t | visi | ||
) |
Definition at line 666 of file vm_method.c.
References method_entry_set().
Referenced by clone_method(), rb_mod_define_method(), and rb_mod_modfunc().
const rb_method_entry_t* rb_method_entry_with_refinements | ( | VALUE | klass, |
ID | id | ||
) |
Definition at line 867 of file vm_method.c.
References method_entry_resolve_refinement(), NULL, and TRUE.
const rb_method_entry_t* rb_method_entry_without_refinements | ( | VALUE | klass, |
ID | id | ||
) |
Definition at line 881 of file vm_method.c.
References FALSE, method_entry_resolve_refinement(), and NULL.
Referenced by check_definition(), mnew(), mnew_internal(), and rb_method_boundp().
Definition at line 1601 of file vm_method.c.
References mod, rb_alias(), rb_check_id(), rb_print_undef_str(), and rb_to_id().
Referenced by Init_eval_method().
Definition at line 1295 of file vm_method.c.
References Qfalse, Qtrue, rb_check_id(), and rb_method_boundp().
Referenced by Init_eval_method().
Definition at line 1838 of file vm_method.c.
References argc, rb_method_entry_struct::def, id, cache_entry::me, METHOD_VISI_PRIVATE, METHOD_VISI_PUBLIC, METHOD_VISI_UNDEF, rb_cObject, rb_eTypeError, rb_method_entry_set(), rb_print_undef(), rb_raise(), rb_scope_module_func_set(), rb_singleton_class(), rb_to_id(), RB_TYPE_P, RCLASS_SUPER, search_method(), set_method_visibility(), T_MODULE, rb_method_definition_struct::type, UNDEFINED_METHOD_ENTRY_P, and VM_METHOD_TYPE_ZSUPER.
Referenced by Init_eval_method().
Definition at line 1714 of file vm_method.c.
References METHOD_VISI_PRIVATE, and set_visibility().
Referenced by Init_eval_method(), and top_private().
Definition at line 1756 of file vm_method.c.
References METHOD_VISI_PRIVATE, rb_singleton_class(), and set_method_visibility().
Referenced by Init_eval_method().
Definition at line 1381 of file vm_method.c.
References check_definition(), and METHOD_VISI_PRIVATE.
Referenced by Init_eval_method().
Definition at line 1685 of file vm_method.c.
References METHOD_VISI_PROTECTED, and set_visibility().
Referenced by Init_eval_method().
Definition at line 1415 of file vm_method.c.
References check_definition(), and METHOD_VISI_PROTECTED.
Referenced by Init_eval_method().
Definition at line 1658 of file vm_method.c.
References METHOD_VISI_PUBLIC, and set_visibility().
Referenced by Init_eval_method(), and top_public().
Definition at line 1730 of file vm_method.c.
References METHOD_VISI_PUBLIC, rb_singleton_class(), and set_method_visibility().
Referenced by Init_eval_method().
Definition at line 1347 of file vm_method.c.
References check_definition(), and METHOD_VISI_PUBLIC.
Referenced by Init_eval_method().
Definition at line 1016 of file vm_method.c.
References argc, mod, rb_check_id(), rb_name_err_raise, and remove_method().
Referenced by Init_eval_method().
Definition at line 1246 of file vm_method.c.
References argc, mod, rb_check_id(), rb_method_name_error(), and rb_undef().
Referenced by Init_eval_method().
Definition at line 1985 of file vm_method.c.
References basic_obj_respond_to(), CLASS_OF, GET_THREAD, and vm_respond_to().
Referenced by r_object0(), rb_respond_to(), should_be_callable(), and w_object().
Definition at line 1000 of file vm_method.c.
References rb_intern, and remove_method().
const rb_method_entry_t* rb_resolve_refined_method | ( | VALUE | refinements, |
const rb_method_entry_t * | me | ||
) |
Definition at line 941 of file vm_method.c.
References NULL, and resolve_refined_method().
Referenced by method_entry_i(), rb_alias(), and rb_undef().
const rb_callable_method_entry_t* rb_resolve_refined_method_callable | ( | VALUE | refinements, |
const rb_callable_method_entry_t * | me | ||
) |
Definition at line 947 of file vm_method.c.
References rb_method_entry_struct::called_id, rb_method_entry_struct::defined_class, rb_callable_method_entry_struct::defined_class, rb_method_entry_complement_defined_class(), and resolve_refined_method().
Referenced by rb_method_call_status().
Definition at line 1995 of file vm_method.c.
References FALSE, and rb_obj_respond_to().
Referenced by copy_stream_body(), copy_stream_fallback_body(), discrete_object_p(), do_coerce(), enum_zip(), enumerator_initialize(), generate_json(), gzfile_close(), gzfile_write_raw(), hash_equal(), iseq_translate(), lazy_flat_map_proc(), lazy_zip(), must_respond_to(), mustbe_callable(), num_exact(), ole_search_handler_method(), ossl_ssl_initialize(), ossl_to_der_if_possible(), parse(), parser_compile_error(), range_values(), rb_ary_equal(), rb_econv_prepare_options(), rb_f_open(), rb_gzreader_initialize(), rb_gzwriter_flush(), rb_gzwriter_initialize(), rb_marshal_dump_limited(), rb_marshal_load_with_proc(), rb_range_values(), rb_str_equal(), and syserr_eqq().
|
static |
Definition at line 1104 of file vm_method.c.
References rb_thread_struct::cfp, CREF_SCOPE_VISI(), rb_control_frame_struct::ep, FALSE, GET_THREAD, rb_scope_visi_struct::module_func, rb_vm_cref(), rb_vm_get_ruby_level_next_cfp(), and vm_env_cref_by_cref().
Referenced by rb_attr(), and vm_define_method().
|
static |
Definition at line 1132 of file vm_method.c.
References METHOD_VISI_PRIVATE, TRUE, and vm_cref_set_visibility().
Referenced by rb_mod_modfunc().
|
static |
Definition at line 1090 of file vm_method.c.
References rb_thread_struct::cfp, CREF_SCOPE_VISI(), rb_control_frame_struct::ep, GET_THREAD, rb_scope_visi_struct::method_visi, METHOD_VISI_PUBLIC, rb_vm_cref(), rb_vm_get_ruby_level_next_cfp(), and vm_env_cref_by_cref().
Referenced by rb_attr(), and vm_define_method().
void rb_scope_visibility_set | ( | rb_method_visibility_t | visi | ) |
Definition at line 1126 of file vm_method.c.
References FALSE, and vm_cref_set_visibility().
Referenced by load_ext(), and set_visibility().
Definition at line 1173 of file vm_method.c.
References CALL_METHOD_HOOK, rb_method_entry_struct::def, cache_entry::me, METHOD_VISI_PUBLIC, NIL_P, object_id, Qnil, rb_add_method(), rb_eTypeError, rb_frozen_class_p(), rb_id2name(), rb_id2str, rb_method_name_error(), rb_raise(), rb_resolve_refined_method(), rb_warn(), search_method(), rb_method_definition_struct::type, undefined, UNDEFINED_METHOD_ENTRY_P, UNDEFINED_REFINED_METHOD_P, VM_METHOD_TYPE_REFINED, and VM_METHOD_TYPE_UNDEF.
Referenced by m_core_undef_method(), and rb_mod_undef_method().
void rb_undef_alloc_func | ( | VALUE | klass | ) |
Definition at line 681 of file vm_method.c.
References rb_define_alloc_func(), and UNDEF_ALLOC_FUNC.
Referenced by Init_Binding(), Init_cparse(), Init_ISeq(), Init_Numeric(), Init_ossl_engine(), Init_Proc(), Init_String(), Init_VM(), Init_vm_backtrace(), Init_vm_trace(), Init_zlib(), InitVM_Object(), InitVM_process(), InitVM_Struct(), and ruby_Init_Continuation_body().
|
static |
|
static |
Definition at line 895 of file vm_method.c.
References rb_method_definition_struct::body, rb_method_entry_struct::called_id, rb_method_entry_struct::def, rb_method_entry_struct::defined_class, method_entry_get(), rb_method_refined_struct::orig_me, rb_method_entry_struct::owner, RCLASS_SUPER, rb_method_definition_struct::refined, and resolve_refined_method().
Referenced by resolve_refined_method().
Definition at line 961 of file vm_method.c.
References CALL_METHOD_HOOK, rb_method_entry_struct::def, ID2SYM, object_id, rb_add_refined_method_entry(), rb_clear_method_cache_by_class(), rb_frozen_class_p(), rb_id2name(), rb_id_table_delete(), rb_id_table_lookup(), rb_name_err_raise, rb_vm_check_redefinition_opt_method(), rb_warn(), RCLASS_M_TBL, RCLASS_ORIGIN, removed, rb_method_definition_struct::type, UNDEFINED_REFINED_METHOD_P, VM_METHOD_TYPE_REFINED, and VM_METHOD_TYPE_UNDEF.
Referenced by rb_mod_remove_method(), rb_remove_method(), and rb_remove_method_id().
|
static |
Definition at line 914 of file vm_method.c.
References rb_method_entry_struct::called_id, rb_method_entry_struct::def, find_refinement(), cache_entry::me, method_entry_get(), NIL_P, rb_method_entry_struct::owner, refined_method_original_method_entry(), rb_method_definition_struct::type, and VM_METHOD_TYPE_REFINED.
Referenced by method_entry_resolve_refinement(), rb_callable_method_entry(), rb_resolve_refined_method(), rb_resolve_refined_method_callable(), and refined_method_original_method_entry().
|
inlinestatic |
Definition at line 700 of file vm_method.c.
References lookup_method_table(), cache_entry::me, and RCLASS_SUPER.
Referenced by method_entry_get_without_cache(), rb_alias(), rb_export_method(), rb_free_method_entry(), rb_method_entry_make(), rb_mod_modfunc(), and rb_undef().
|
static |
Definition at line 1612 of file vm_method.c.
References argc, PRIsVALUE, QUOTE_ID, rb_check_frozen, rb_check_id(), rb_export_method(), rb_frame_callee(), rb_print_undef_str(), and rb_warning().
Referenced by rb_mod_modfunc(), rb_mod_private_method(), rb_mod_public_method(), and set_visibility().
|
static |
Definition at line 1634 of file vm_method.c.
References rb_scope_visibility_set(), and set_method_visibility().
Referenced by rb_mod_private(), rb_mod_protected(), and rb_mod_public().
|
static |
Definition at line 224 of file vm_method.c.
References rb_method_cfunc_struct::argc, argc, call_cfunc_invoker_func, func, rb_method_cfunc_struct::func, and rb_method_cfunc_struct::invoker.
Referenced by method_definition_set().
Definition at line 1794 of file vm_method.c.
References rb_cObject, and rb_mod_private().
Referenced by Init_eval_method().
Definition at line 1776 of file vm_method.c.
References rb_cObject, and rb_mod_public().
Referenced by Init_eval_method().
|
static |
Definition at line 1118 of file vm_method.c.
References rb_scope_visi_struct::method_visi, rb_scope_visi_struct::module_func, rb_vm_cref(), and rb_cref_struct::scope_visi.
Referenced by rb_scope_module_func_set(), and rb_scope_visibility_set().
|
static |
Referenced by check_override_opt_method().
|
static |
Definition at line 1934 of file vm_method.c.
References call_method_entry(), cache_entry::defined_class, FL_SINGLETON, FL_TEST, ID2SYM, idRespond_to, METHOD_ENTRY_BASIC, method_entry_get(), NIL_P, NUM2INT, PRIsVALUE, Qtrue, QUOTE_ID, RARRAY_AREF, rb_compile_warn(), rb_eArgError, rb_method_entry_arity(), rb_method_entry_location(), rb_raise(), rb_warn(), result, RSTRING_PTR, RTEST, and ruby_verbose.
Referenced by check_funcall_respond_to(), and rb_obj_respond_to().