Ruby
2.0.0p645(2015-04-13revision50299)
|
Go to the source code of this file.
Data Structures | |
struct | cache_entry |
Macros | |
#define | CACHE_SIZE 0x800 |
#define | CACHE_MASK 0x7ff |
#define | EXPR1(c, m) ((((c)>>3)^(m))&CACHE_MASK) |
#define | NOEX_NOREDEF 0 |
#define | ruby_running (GET_VM()->running) |
#define | CALL_METHOD_HOOK(klass, hook, mid) |
#define | UNDEF_ALLOC_FUNC ((rb_alloc_func_t)-1) |
#define | VISI_CHECK(x, f) (((x)&NOEX_MASK) == (f)) |
#define | rb_intern(str) rb_intern_const(str) |
#define | REPLICATE_METHOD(klass, id, noex) |
Variables | |
static ID | object_id |
static ID | removed |
static ID | singleton_removed |
static ID | undefined |
static ID | singleton_undefined |
static ID | added |
static ID | singleton_added |
static ID | attached |
static struct cache_entry | cache [CACHE_SIZE] |
static VALUE(*)(VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *) | call_cfunc_invoker_func (int argc) |
#define CACHE_MASK 0x7ff |
Definition at line 6 of file vm_method.c.
#define CACHE_SIZE 0x800 |
Definition at line 5 of file vm_method.c.
Referenced by vm_clear_global_method_cache().
#define CALL_METHOD_HOOK | ( | klass, | |
hook, | |||
mid | |||
) |
Definition at line 350 of file vm_method.c.
Referenced by method_added(), rb_undef(), and remove_method().
#define EXPR1 | ( | c, | |
m | |||
) | ((((c)>>3)^(m))&CACHE_MASK) |
Definition at line 7 of file vm_method.c.
Referenced by rb_method_entry(), and rb_method_entry_get_without_cache().
#define NOEX_NOREDEF 0 |
Definition at line 9 of file vm_method.c.
Referenced by rb_method_entry_make().
#define rb_intern | ( | str | ) | rb_intern_const(str) |
Referenced by Init_eval_method(), and rb_remove_method().
#define REPLICATE_METHOD | ( | klass, | |
id, | |||
noex | |||
) |
Referenced by Init_eval_method().
#define ruby_running (GET_VM()->running) |
Definition at line 29 of file vm_method.c.
Referenced by method_added(), and rb_method_entry_get_without_cache().
#define UNDEF_ALLOC_FUNC ((rb_alloc_func_t)-1) |
Definition at line 483 of file vm_method.c.
Referenced by rb_get_alloc_func(), and rb_undef_alloc_func().
Definition at line 1008 of file vm_method.c.
Referenced by check_definition().
Definition at line 1541 of file vm_method.c.
References args, CLASS_OF, FALSE, ID2SYM, idRespond_to_missing, NOEX_RESPONDS, Qfalse, Qtrue, rb_funcall2(), rb_method_boundp(), RTEST, and TRUE.
Referenced by obj_respond_to(), and rb_obj_respond_to().
|
static |
Definition at line 1011 of file vm_method.c.
References rb_method_entry_struct::flag, cache_entry::me, Qfalse, Qtrue, rb_check_id(), rb_method_entry_without_refinements(), and VISI_CHECK.
Referenced by rb_mod_private_method_defined(), rb_mod_protected_method_defined(), and rb_mod_public_method_defined().
|
static |
Definition at line 590 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::klass, rb_method_definition_struct::orig_me, rb_method_entry(), rb_resolve_refined_method(), and RCLASS_SUPER.
Referenced by rb_resolve_refined_method().
void Init_eval_method | ( | void | ) |
Definition at line 1659 of file vm_method.c.
References added, attached, idRespond_to, idRespond_to_missing, NOEX_PRIVATE, NOEX_PUBLIC, obj_respond_to(), obj_respond_to_missing(), object_id, rb_cModule, rb_define_method(), rb_define_private_method(), rb_eException, rb_intern, 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(), removed, REPLICATE_METHOD, singleton_added, singleton_removed, singleton_undefined, top_private(), top_public(), and undefined.
Referenced by Init_eval().
|
inlinestatic |
Definition at line 179 of file vm_method.c.
References RCLASS_M_TBL, and st_lookup().
Referenced by rb_add_refined_method_entry(), rb_method_entry_make(), and search_method().
|
static |
Definition at line 192 of file vm_method.c.
References rb_method_definition_struct::alias_count, ALLOC, rb_method_definition_struct::body, rb_method_entry_struct::called_id, rb_method_entry_struct::def, rb_method_entry_struct::flag, rb_method_entry_struct::klass, unlinked_method_entry_list_entry::me, NOEX_PUBLIC, NOEX_WITH_SAFE, rb_method_definition_struct::orig_me, rb_method_definition_struct::original_id, 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 362 of file vm_method.c.
References added, CALL_METHOD_HOOK, and ruby_running.
Referenced by method_entry_set(), and rb_add_method().
|
static |
Definition at line 467 of file vm_method.c.
References rb_method_entry_struct::def, method_added(), rb_method_entry_make(), rb_method_definition_struct::type, type, and VM_METHOD_TYPE_UNDEF.
Referenced by rb_alias(), and rb_method_entry_set().
Definition at line 1621 of file vm_method.c.
References args, basic_obj_respond_to(), CLASS_OF, id, ID2SYM, idRespond_to_missing, cache_entry::mid, Qfalse, Qtrue, rb_check_id(), rb_funcall2(), rb_method_basic_definition_p(), rb_scan_args(), rb_to_id(), and RTEST.
Referenced by Init_eval_method().
rb_method_entry_t* rb_add_method | ( | VALUE | klass, |
ID | mid, | ||
rb_method_type_t | type, | ||
void * | opts, | ||
rb_method_flag_t | noex | ||
) |
Definition at line 405 of file vm_method.c.
References rb_method_definition_struct::alias_count, ALLOC, rb_method_cfunc_struct::argc, rb_method_definition_struct::attr, rb_method_definition_struct::body, rb_thread_struct::cfp, rb_method_definition_struct::cfunc, rb_method_entry_struct::def, rb_method_cfunc_struct::func, GET_THREAD(), rb_method_attr_struct::id, INT2FIX, rb_method_definition_struct::iseq, rb_control_frame_struct::iseq, rb_method_attr_struct::location, rb_iseq_struct::location, unlinked_method_entry_list_entry::me, method_added(), rb_method_definition_struct::optimize_type, rb_method_definition_struct::orig_me, rb_method_definition_struct::original_id, rb_iseq_location_struct::path, rb_method_definition_struct::proc, Qfalse, rb_ary_freeze(), rb_ary_new3(), rb_bug(), rb_f_notimplement(), rb_method_entry_make(), rb_vm_get_ruby_level_next_cfp(), rb_vm_get_sourceline(), setup_method_cfunc_struct(), rb_method_definition_struct::type, type, VM_METHOD_TYPE_ATTRSET, VM_METHOD_TYPE_BMETHOD, VM_METHOD_TYPE_CFUNC, VM_METHOD_TYPE_ISEQ, VM_METHOD_TYPE_IVAR, VM_METHOD_TYPE_NOTIMPLEMENTED, VM_METHOD_TYPE_OPTIMIZED, VM_METHOD_TYPE_REFINED, VM_METHOD_TYPE_UNDEF, and VM_METHOD_TYPE_ZSUPER.
Referenced by clone_method(), Init_Proc(), Init_vm_eval(), rb_add_method_cfunc(), 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 vm_define_method().
void rb_add_method_cfunc | ( | VALUE | klass, |
ID | mid, | ||
VALUE(*)(ANYARGS) | func, | ||
int | argc, | ||
rb_method_flag_t | noex | ||
) |
Definition at line 84 of file vm_method.c.
References rb_method_cfunc_struct::argc, argc, rb_method_cfunc_struct::func, 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().
Definition at line 212 of file vm_method.c.
References lookup_method_table(), make_method_entry_refined(), unlinked_method_entry_list_entry::me, NOEX_PUBLIC, rb_add_method(), and VM_METHOD_TYPE_REFINED.
Referenced by add_refined_method_entry_i(), rb_method_entry_make(), and remove_method().
Definition at line 1209 of file vm_method.c.
References rb_method_entry_struct::def, cache_entry::defined_class, rb_method_entry_struct::flag, cache_entry::klass, method_entry_set(), NIL_P, NOEX_UNDEF, rb_method_definition_struct::original_id, rb_cObject, rb_eTypeError, rb_frozen_class_p(), rb_print_undef(), rb_raise(), rb_secure(), RB_TYPE_P, RBASIC, RCLASS_ORIGIN, RCLASS_SUPER, search_method(), T_ICLASS, T_MODULE, rb_method_definition_struct::type, UNDEFINED_METHOD_ENTRY_P, UNDEFINED_REFINED_METHOD_P, and VM_METHOD_TYPE_ZSUPER.
Referenced by each_attr_def(), Init_signal(), Init_strscan(), m_core_set_method_alias(), rb_define_alias(), and rb_mod_alias_method().
Definition at line 824 of file vm_method.c.
References name, NOEX_MODFUNC, NOEX_PRIVATE, NOEX_PROTECTED, NOEX_PUBLIC, rb_add_method(), rb_eArgError, rb_enc_copy(), rb_id2name(), rb_id2str(), rb_id_attrset(), rb_intern_str, rb_is_const_id(), rb_is_local_id(), rb_name_error(), rb_raise(), rb_sprintf(), rb_warning(), SCOPE_CHECK, SCOPE_TEST, VM_METHOD_TYPE_ATTRSET, and VM_METHOD_TYPE_IVAR.
Referenced by cbsubst_table_setup(), 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().
void rb_clear_cache | ( | void | ) |
Definition at line 46 of file vm_method.c.
References rb_vm_change_state().
Referenced by rb_include_module(), rb_prepend_module(), and top_using().
void rb_clear_cache_by_class | ( | VALUE | klass | ) |
Definition at line 64 of file vm_method.c.
References rb_vm_change_state().
Referenced by obj_free(), set_const_visibility(), and set_method_visibility().
|
static |
Definition at line 58 of file vm_method.c.
References rb_vm_change_state().
Referenced by rb_method_entry_make().
Definition at line 52 of file vm_method.c.
References rb_vm_change_state().
Referenced by remove_method().
Definition at line 486 of file vm_method.c.
References Check_Type, func, RCLASS_EXT, and T_CLASS.
Referenced by rb_undef_alloc_func().
|
static |
Definition at line 78 of file vm_method.c.
References rb_add_method(), and VM_METHOD_TYPE_NOTIMPLEMENTED.
Referenced by rb_add_method_cfunc().
Definition at line 754 of file vm_method.c.
Definition at line 760 of file vm_method.c.
References rb_warning().
|
static |
Definition at line 766 of file vm_method.c.
References rb_method_definition_struct::body, rb_method_entry_struct::def, cache_entry::defined_class, rb_method_entry_struct::flag, cache_entry::me, rb_method_definition_struct::orig_me, rb_add_method(), rb_cObject, rb_print_undef(), rb_secure(), RB_TYPE_P, rb_vm_check_redefinition_opt_method(), RCLASS_ORIGIN, 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 70 of file vm_method.c.
References rb_notimplement(), and UNREACHABLE.
Referenced by rb_add_method(), and rb_add_method_cfunc().
void rb_free_method_entry | ( | rb_method_entry_t * | me | ) |
Definition at line 169 of file vm_method.c.
References rb_method_entry_struct::def, release_method_definition(), and xfree().
Referenced by free_method_entry_i(), and rb_sweep_method_entry().
void rb_gc_mark_unlinked_live_method_entries | ( | void * | pvm | ) |
Definition at line 108 of file vm_method.c.
References rb_method_entry_struct::mark, unlinked_method_entry_list_entry::me, unlinked_method_entry_list_entry::next, rb_mark_method_entry(), and rb_vm_struct::unlinked_method_entry_list.
Referenced by gc_marks().
rb_alloc_func_t rb_get_alloc_func | ( | VALUE | klass | ) |
Definition at line 499 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_leave(), rb_marshal_define_compat(), rb_obj_alloc(), and w_object().
|
static |
Definition at line 1165 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_entry_struct::def, rb_method_cfunc_struct::func, hash(), rb_method_attr_struct::id, rb_method_definition_struct::iseq, rb_method_definition_struct::optimize_type, rb_method_definition_struct::orig_me, rb_method_definition_struct::original_id, rb_method_definition_struct::proc, rb_bug(), rb_hash_proc(), rb_hash_uint(), 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_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 1203 of file vm_method.c.
References rb_method_entry_struct::def, and rb_hash_method_definition().
Referenced by method_hash().
Definition at line 1532 of file vm_method.c.
References rb_method_entry_struct::flag, cache_entry::me, NOEX_BASIC, and rb_method_entry().
Referenced by check_funcall_missing(), hash_default_value(), make_no_method_exception(), method_missing(), mnew(), obj_respond_to(), rb_mod_const_get(), rb_obj_respond_to(), rb_p(), send_internal(), set_backtrace(), and vm_call_opt_send().
Definition at line 802 of file vm_method.c.
References rb_method_entry_struct::def, rb_method_entry_struct::flag, cache_entry::me, NOEX_PRIVATE, NOEX_PROTECTED, NOEX_RESPONDS, rb_method_entry_without_refinements(), rb_method_definition_struct::type, and VM_METHOD_TYPE_NOTIMPLEMENTED.
Referenced by basic_obj_respond_to(), and rb_mod_method_defined().
|
static |
Definition at line 1127 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_entry_struct::def, rb_method_cfunc_struct::func, rb_method_attr_struct::id, rb_method_definition_struct::iseq, rb_method_definition_struct::optimize_type, rb_method_definition_struct::orig_me, rb_method_definition_struct::original_id, rb_method_definition_struct::proc, rb_bug(), rb_equal(), RTEST, 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_REFINED, VM_METHOD_TYPE_UNDEF, and VM_METHOD_TYPE_ZSUPER.
Referenced by rb_method_entry_eq(), and rb_method_entry_make().
rb_method_entry_t* rb_method_entry | ( | VALUE | klass, |
ID | id, | ||
VALUE * | defined_class_ptr | ||
) |
Definition at line 572 of file vm_method.c.
References cache, cache_entry::defined_class, EXPR1, cache_entry::filled_version, GET_VM_STATE_VERSION, cache_entry::klass, cache_entry::me, cache_entry::mid, and rb_method_entry_get_without_cache().
Referenced by check_funcall_respond_to(), check_redefined_method(), get_original_method_entry(), original_method_entry(), rb_method_basic_definition_p(), rb_method_entry_with_refinements(), rb_method_entry_without_refinements(), rb_obj_basic_to_s_p(), rb_resolve_refined_method(), rb_search_method_entry(), vm_call0_body(), vm_call_method(), vm_call_method_missing(), vm_call_super(), vm_search_method(), and vm_search_super_method().
int rb_method_entry_eq | ( | const rb_method_entry_t * | m1, |
const rb_method_entry_t * | m2 | ||
) |
Definition at line 1121 of file vm_method.c.
References rb_method_entry_struct::def, and rb_method_definition_eq().
Referenced by method_eq().
rb_method_entry_t* rb_method_entry_get_without_cache | ( | VALUE | klass, |
ID | id, | ||
VALUE * | defined_class_ptr | ||
) |
Definition at line 532 of file vm_method.c.
References BUILTIN_TYPE, cache, cache_entry::defined_class, EXPR1, cache_entry::filled_version, FL_SINGLETON, GET_VM_STATE_VERSION, id, cache_entry::klass, rb_method_entry_struct::klass, cache_entry::me, unlinked_method_entry_list_entry::me, cache_entry::mid, RBASIC, ruby_running, search_method(), T_CLASS, T_ICLASS, and UNDEFINED_METHOD_ENTRY_P.
Referenced by rb_method_entry().
|
static |
Definition at line 226 of file vm_method.c.
References rb_method_definition_struct::alias_count, ALLOC, rb_method_definition_struct::body, rb_method_entry_struct::called_id, rb_method_entry_struct::def, FL_SINGLETON, FL_TEST, rb_method_entry_struct::flag, idRespond_to_missing, rb_method_definition_struct::iseq, rb_method_entry_struct::klass, rb_iseq_struct::line_info_table, rb_iseq_struct::location, lookup_method_table(), make_method_entry_refined(), rb_method_entry_struct::mark, unlinked_method_entry_list_entry::me, NIL_P, NOEX_NOREDEF, NOEX_PRIVATE, NOEX_WITH_SAFE, OBJ_UNTRUSTED, object_id, rb_method_definition_struct::original_id, rb_iseq_location_struct::path, PRIsVALUE, rb_method_definition_struct::proc, rb_add_refined_method_entry(), rb_check_frozen, rb_class_name(), rb_clear_cache_by_id(), rb_cObject, rb_compile_warning(), rb_eSecurityError, rb_eTypeError, rb_id2name(), rb_id2str(), rb_iseq_first_lineno(), rb_method_definition_eq(), rb_proc_get_iseq(), rb_raise(), rb_refinement_module_get_refined_class(), rb_safe_level, rb_unlink_method_entry(), 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_insert(), st_lookup(), rb_method_definition_struct::type, 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(), and rb_add_method().
rb_method_entry_t* rb_method_entry_set | ( | VALUE | klass, |
ID | mid, | ||
const rb_method_entry_t * | me, | ||
rb_method_flag_t | noex | ||
) |
Definition at line 478 of file vm_method.c.
References method_entry_set().
Referenced by clone_method(), rb_mod_define_method(), and rb_mod_modfunc().
rb_method_entry_t* rb_method_entry_with_refinements | ( | VALUE | klass, |
ID | id, | ||
VALUE * | defined_class_ptr | ||
) |
Definition at line 635 of file vm_method.c.
References rb_method_entry_struct::def, cache_entry::defined_class, cache_entry::me, Qnil, rb_method_entry(), rb_resolve_refined_method(), rb_vm_cref(), rb_method_definition_struct::type, and VM_METHOD_TYPE_REFINED.
Referenced by check_match().
rb_method_entry_t* rb_method_entry_without_refinements | ( | VALUE | klass, |
ID | id, | ||
VALUE * | defined_class_ptr | ||
) |
Definition at line 653 of file vm_method.c.
References rb_method_entry_struct::def, cache_entry::defined_class, cache_entry::me, Qnil, rb_method_entry(), rb_resolve_refined_method(), rb_method_definition_struct::type, UNDEFINED_METHOD_ENTRY_P, and VM_METHOD_TYPE_REFINED.
Referenced by check_definition(), mnew(), rb_method_boundp(), and vm_call_opt_send().
Definition at line 1275 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 998 of file vm_method.c.
References Qfalse, Qtrue, rb_check_id(), and rb_method_boundp().
Referenced by Init_eval_method().
Definition at line 1489 of file vm_method.c.
References argc, rb_method_entry_struct::def, i, id, cache_entry::me, NOEX_MODFUNC, NOEX_PRIVATE, NOEX_PUBLIC, rb_cObject, rb_eTypeError, rb_method_entry_set(), rb_print_undef(), rb_raise(), rb_singleton_class(), rb_to_id(), RB_TYPE_P, RCLASS_SUPER, SCOPE_SET, search_method(), secure_visibility(), 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 1381 of file vm_method.c.
References NOEX_PRIVATE, SCOPE_SET, secure_visibility(), and set_method_visibility().
Referenced by Init_eval_method(), and top_private().
Definition at line 1424 of file vm_method.c.
References NOEX_PRIVATE, rb_singleton_class(), and set_method_visibility().
Referenced by Init_eval_method().
Definition at line 1083 of file vm_method.c.
References check_definition(), and NOEX_PRIVATE.
Referenced by Init_eval_method().
Definition at line 1349 of file vm_method.c.
References NOEX_PROTECTED, SCOPE_SET, secure_visibility(), and set_method_visibility().
Referenced by Init_eval_method().
Definition at line 1115 of file vm_method.c.
References check_definition(), and NOEX_PROTECTED.
Referenced by Init_eval_method().
Definition at line 1326 of file vm_method.c.
References NOEX_PUBLIC, SCOPE_SET, secure_visibility(), and set_method_visibility().
Referenced by Init_eval_method(), and top_public().
Definition at line 1401 of file vm_method.c.
References NOEX_PUBLIC, rb_singleton_class(), and set_method_visibility().
Referenced by Init_eval_method().
Definition at line 1051 of file vm_method.c.
References check_definition(), and NOEX_PUBLIC.
Referenced by Init_eval_method().
Definition at line 734 of file vm_method.c.
References argc, i, mod, rb_check_id(), rb_class2name(), rb_name_error_str(), remove_method(), RSTRING_PTR, and v.
Referenced by Init_eval_method().
Definition at line 957 of file vm_method.c.
References argc, i, mod, rb_check_id(), rb_method_name_error(), rb_undef(), and v.
Referenced by Init_eval_method().
Definition at line 1559 of file vm_method.c.
References args, basic_obj_respond_to(), CLASS_OF, FL_SINGLETON, FL_TEST, ID2SYM, idRespond_to, NIL_P, NUM2INT, PRIsVALUE, Qtrue, QUOTE_ID, RARRAY_PTR, rb_compile_warn(), rb_funcall2(), rb_method_basic_definition_p(), rb_mod_method_location(), rb_obj_method_arity(), rb_warn(), RSTRING_PTR, RTEST, and ruby_verbose.
Referenced by ary2list(), ary2list2(), get_eval_string_core(), r_object0(), rb_respond_to(), and w_object().
Definition at line 720 of file vm_method.c.
References rb_intern, and remove_method().
rb_method_entry_t* rb_resolve_refined_method | ( | VALUE | refinements, |
const rb_method_entry_t * | me, | ||
VALUE * | defined_class_ptr | ||
) |
Definition at line 607 of file vm_method.c.
References rb_method_entry_struct::called_id, rb_method_entry_struct::def, find_refinement(), get_original_method_entry(), rb_method_entry_struct::klass, cache_entry::me, NIL_P, rb_method_entry(), rb_method_definition_struct::type, and VM_METHOD_TYPE_REFINED.
Referenced by get_original_method_entry(), method_entry_i(), rb_method_entry_with_refinements(), and rb_method_entry_without_refinements().
Definition at line 1598 of file vm_method.c.
References FALSE, and rb_obj_respond_to().
Referenced by check_funcall_failed(), copy_stream_body(), copy_stream_fallback_body(), define_final(), discrete_object_p(), do_coerce(), encoding_table_get_name_core(), enum_zip(), generate_json(), gzfile_close(), gzfile_write_raw(), hash_equal(), lazy_flat_map_func(), lazy_zip(), marshal_dump(), marshal_load(), must_respond_to(), num_exact(), ole_search_handler_method(), ossl_to_der_if_possible(), parse(), range_values(), rb_ary_equal(), rb_define_final(), rb_econv_prepare_options(), rb_f_open(), rb_gzreader_initialize(), rb_gzwriter_flush(), rb_gzwriter_initialize(), rb_range_values(), rb_str_equal(), readline_s_set_completion_proc(), syserr_eqq(), and TkStringValue().
void rb_sweep_method_entry | ( | void * | pvm | ) |
Definition at line 122 of file vm_method.c.
References rb_method_entry_struct::mark, unlinked_method_entry_list_entry::me, unlinked_method_entry_list_entry::next, rb_free_method_entry(), rb_vm_struct::unlinked_method_entry_list, and xfree().
Referenced by before_gc_sweep().
Definition at line 868 of file vm_method.c.
References attached, CALL_METHOD_HOOK, rb_method_entry_struct::def, FL_SINGLETON, FL_TEST, cache_entry::klass, cache_entry::me, NIL_P, NOEX_PUBLIC, OBJ_UNTRUSTED, object_id, PRIsVALUE, QUOTE_ID, rb_add_method(), rb_class_name(), rb_cObject, rb_eSecurityError, rb_eTypeError, rb_frozen_class_p(), rb_id2name(), rb_ivar_get(), rb_name_error(), rb_raise(), rb_safe_level, rb_secure(), RB_TYPE_P, rb_vm_cbase(), rb_warn(), search_method(), T_CLASS, T_MODULE, undefined, UNDEFINED_METHOD_ENTRY_P, UNDEFINED_REFINED_METHOD_P, 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 493 of file vm_method.c.
References rb_define_alloc_func(), and UNDEF_ALLOC_FUNC.
Referenced by Init_Binding(), Init_Encoding(), Init_Numeric(), Init_Object(), Init_Proc(), Init_String(), Init_Struct(), Init_VM(), Init_vm_backtrace(), Init_vm_trace(), Init_zlib(), and ruby_Init_Continuation_body().
void rb_unlink_method_entry | ( | rb_method_entry_t * | me | ) |
Definition at line 99 of file vm_method.c.
References ALLOC, GET_VM, unlinked_method_entry_list_entry::me, and unlinked_method_entry_list_entry::next.
Referenced by rb_method_entry_make(), and remove_method().
|
static |
Referenced by make_method_entry_refined(), rb_export_method(), rb_method_entry_make(), and remove_method().
|
static |
Definition at line 151 of file vm_method.c.
References rb_method_definition_struct::alias_count, rb_method_definition_struct::body, rb_method_entry_struct::def, rb_method_definition_struct::orig_me, rb_method_definition_struct::type, VM_METHOD_TYPE_REFINED, and xfree().
Referenced by rb_free_method_entry().
Definition at line 673 of file vm_method.c.
References CALL_METHOD_HOOK, rb_method_entry_struct::def, key, cache_entry::klass, cache_entry::me, OBJ_UNTRUSTED, object_id, rb_add_refined_method_entry(), rb_check_frozen, rb_class2name(), rb_clear_cache_for_undef(), rb_cObject, rb_eSecurityError, rb_id2name(), rb_name_error(), rb_raise(), rb_safe_level, rb_secure(), rb_unlink_method_entry(), rb_vm_check_redefinition_opt_method(), rb_warn(), RCLASS_M_TBL, RCLASS_ORIGIN, removed, st_delete(), st_lookup(), 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().
|
inlinestatic |
Definition at line 512 of file vm_method.c.
References lookup_method_table(), unlinked_method_entry_list_entry::me, and RCLASS_SUPER.
Referenced by rb_alias(), rb_export_method(), rb_method_entry_get_without_cache(), rb_method_entry_make(), rb_mod_modfunc(), and rb_undef().
|
static |
Definition at line 1286 of file vm_method.c.
References OBJ_UNTRUSTED, rb_eSecurityError, rb_raise(), and rb_safe_level.
Referenced by rb_mod_modfunc(), rb_mod_private(), rb_mod_protected(), rb_mod_public(), and set_method_visibility().
|
static |
Definition at line 1295 of file vm_method.c.
References argc, i, rb_check_id(), rb_clear_cache_by_class(), rb_export_method(), rb_frame_callee(), rb_id2name(), rb_print_undef_str(), rb_warning(), secure_visibility(), and v.
Referenced by rb_mod_modfunc(), rb_mod_private(), rb_mod_private_method(), rb_mod_protected(), rb_mod_public(), and rb_mod_public_method().
|
static |
Definition at line 397 of file vm_method.c.
References rb_method_cfunc_struct::argc, argc, call_cfunc_invoker_func, rb_method_cfunc_struct::func, func, and rb_method_cfunc_struct::invoker.
Referenced by rb_add_method().
Definition at line 1447 of file vm_method.c.
References rb_cObject, and rb_mod_private().
Referenced by Init_eval_method().
Definition at line 1441 of file vm_method.c.
References rb_cObject, and rb_mod_public().
Referenced by Init_eval_method().
|
static |
Definition at line 33 of file vm_method.c.
References cache, CACHE_SIZE, and cache_entry::filled_version.
|
static |
Definition at line 18 of file vm_method.c.
Referenced by Init_eval_method(), and method_added().
|
static |
Definition at line 18 of file vm_method.c.
Referenced by Init_eval_method(), and rb_undef().
|
static |
Definition at line 28 of file vm_method.c.
Referenced by rb_method_entry(), rb_method_entry_get_without_cache(), and vm_clear_global_method_cache().
|
static |
Definition at line 370 of file vm_method.c.
Referenced by setup_method_cfunc_struct().
|
static |
Definition at line 16 of file vm_method.c.
Referenced by Init_eval_method(), rb_method_entry_make(), rb_undef(), and remove_method().
|
static |
Definition at line 17 of file vm_method.c.
Referenced by Init_eval_method(), and remove_method().
|
static |
Definition at line 18 of file vm_method.c.
Referenced by Init_eval_method().
|
static |
Definition at line 17 of file vm_method.c.
Referenced by Init_eval_method().
|
static |
Definition at line 17 of file vm_method.c.
Referenced by Init_eval_method().
|
static |
Definition at line 17 of file vm_method.c.
Referenced by Init_eval_method(), and rb_undef().