Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
#include "id_table.h"
Go to the source code of this file.
Macros | |
#define | METHOD_DEBUG 0 |
#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 | REPLICATE_METHOD(klass, id) |
#define added idMethod_added |
Definition at line 14 of file vm_method.c.
#define attached id__attached__ |
Definition at line 20 of file vm_method.c.
#define BOUND_PRIVATE 0x01 |
Definition at line 1429 of file vm_method.c.
#define BOUND_RESPONDS 0x02 |
Definition at line 1430 of file vm_method.c.
#define CALL_METHOD_HOOK | ( | klass, | |
hook, | |||
mid | |||
) |
Definition at line 880 of file vm_method.c.
#define METHOD_DEBUG 0 |
Definition at line 7 of file vm_method.c.
#define object_id idObject_id |
Definition at line 13 of file vm_method.c.
#define removed idMethod_removed |
Definition at line 16 of file vm_method.c.
#define REPLICATE_METHOD | ( | klass, | |
id | |||
) |
#define ruby_running (GET_VM()->running) |
Definition at line 22 of file vm_method.c.
#define singleton_added idSingleton_method_added |
Definition at line 15 of file vm_method.c.
#define singleton_removed idSingleton_method_removed |
Definition at line 17 of file vm_method.c.
#define singleton_undefined idSingleton_method_undefined |
Definition at line 19 of file vm_method.c.
#define UNDEF_ALLOC_FUNC ((rb_alloc_func_t)-1) |
Definition at line 944 of file vm_method.c.
#define undefined idMethod_undefined |
Definition at line 18 of file vm_method.c.
void Init_eval_method | ( | void | ) |
Definition at line 2634 of file vm_method.c.
References idRespond_to, idRespond_to_missing, rb_cModule, rb_define_method, rb_define_private_method, rb_eException, rb_mKernel, rb_singleton_class(), rb_vm_top_self(), and REPLICATE_METHOD.
Referenced by Init_eval().
void Init_Method | ( | void | ) |
Definition at line 2628 of file vm_method.c.
void rb_add_method | ( | VALUE | klass, |
ID | mid, | ||
rb_method_type_t | type, | ||
void * | opts, | ||
rb_method_visibility_t | visi | ||
) |
Definition at line 900 of file vm_method.c.
References NULL, VM_METHOD_TYPE_REFINED, and VM_METHOD_TYPE_UNDEF.
Referenced by Init_Proc(), Init_VM(), Init_vm_eval(), rb_add_method_cfunc(), rb_add_method_iseq(), rb_add_refined_method_entry(), rb_attr(), rb_undef(), and rb_undef_method().
void rb_add_method_cfunc | ( | VALUE | klass, |
ID | mid, | ||
VALUE(*)(ANYARGS) | func, | ||
int | argc, | ||
rb_method_visibility_t | visi | ||
) |
Definition at line 313 of file vm_method.c.
References rb_method_cfunc_struct::argc, argc, rb_method_cfunc_struct::func, rb_add_method(), 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 910 of file vm_method.c.
References rb_add_method(), and VM_METHOD_TYPE_ISEQ.
Definition at line 709 of file vm_method.c.
References METHOD_VISI_PUBLIC, rb_add_method(), rb_clear_method_cache(), and VM_METHOD_TYPE_REFINED.
Definition at line 1926 of file vm_method.c.
References rb_method_entry_struct::called_id, rb_method_entry_struct::def, rb_method_entry_struct::defined_class, METHOD_ENTRY_VISI, METHOD_VISI_UNDEF, NIL_P, NULL, rb_method_definition_struct::original_id, rb_method_entry_struct::owner, Qnil, rb_class_modify_check(), rb_cObject, rb_eTypeError, rb_method_entry_clone(), RB_OBJ_WRITE, rb_print_undef(), rb_raise(), rb_resolve_refined_method(), RCLASS_SUPER, T_MODULE, 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(), and rb_define_alias().
Definition at line 1508 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_sprintf(), rb_vm_cref_in_context(), rb_warning(), read(), VM_METHOD_TYPE_ATTRSET, VM_METHOD_TYPE_IVAR, and write().
Referenced by Init_Exception(), Init_ossl_asn1(), Init_ossl_ec(), Init_ossl_pkcs12(), Init_ossl_pkcs7(), Init_ossl_ssl(), Init_ossl_ts(), Init_ossl_x509ext(), Init_ossl_x509store(), and rb_define_attr().
const rb_callable_method_entry_t * rb_callable_method_entry | ( | VALUE | klass, |
ID | mid | ||
) |
Definition at line 1177 of file vm_method.c.
References NULL.
Referenced by rb_check_funcall_basic_kw(), and rb_method_basic_definition_p().
const rb_callable_method_entry_t * rb_callable_method_entry_with_refinements | ( | VALUE | klass, |
ID | id, | ||
VALUE * | defined_class_ptr | ||
) |
Definition at line 1235 of file vm_method.c.
const rb_callable_method_entry_t * rb_callable_method_entry_without_refinements | ( | VALUE | klass, |
ID | id, | ||
VALUE * | defined_class_ptr | ||
) |
Definition at line 1253 of file vm_method.c.
void rb_cc_table_free | ( | VALUE | klass | ) |
Definition at line 2727 of file gc.c.
References cc_tbl_i_data::klass, and TRUE.
void rb_clear_constant_cache | ( | void | ) |
Definition at line 127 of file vm_method.c.
References INC_GLOBAL_CONSTANT_STATE.
Referenced by rb_const_remove(), and rb_const_set().
Definition at line 236 of file vm_method.c.
References FL_TEST, rb_class_foreach_subclass(), rb_clear_method_cache(), RMODULE_IS_REFINEMENT, and T_MODULE.
Referenced by rb_add_refined_method_entry(), and rb_clear_method_cache().
void rb_clear_method_cache_all | ( | void | ) |
Definition at line 280 of file vm_method.c.
References NULL, and rb_objspace_each_objects().
Definition at line 947 of file vm_method.c.
References RCLASS_EXT, and T_CLASS.
Referenced by rb_undef_alloc_func().
int rb_ec_obj_respond_to | ( | rb_execution_context_t * | ec, |
VALUE | obj, | ||
ID | id, | ||
int | priv | ||
) |
Definition at line 2552 of file vm_method.c.
References CLASS_OF.
Referenced by rb_obj_respond_to().
Definition at line 299 of file vm_method.c.
References Qnil, rb_notimplement(), and UNREACHABLE_RETURN.
Referenced by Init_ossl_ssl(), rb_add_method_cfunc(), and rb_method_definition_set().
void rb_free_method_entry | ( | const rb_method_entry_t * | me | ) |
Definition at line 358 of file vm_method.c.
References rb_method_entry_struct::def, and METHOD_ENTRY_COMPLEMENTED.
rb_alloc_func_t rb_get_alloc_func | ( | VALUE | klass | ) |
Definition at line 960 of file vm_method.c.
References RCLASS_EXT, RCLASS_SUPER, T_CLASS, and UNDEF_ALLOC_FUNC.
st_index_t rb_hash_method_entry | ( | st_index_t | hash, |
const rb_method_entry_t * | me | ||
) |
Definition at line 1920 of file vm_method.c.
References rb_method_entry_struct::def.
Definition at line 2439 of file vm_method.c.
References FALSE, METHOD_ENTRY_BASIC, rb_callable_method_entry(), and TRUE.
rb_method_definition_t * rb_method_definition_create | ( | rb_method_type_t | type, |
ID | mid | ||
) |
Definition at line 546 of file vm_method.c.
Referenced by rb_method_entry_complement_defined_class().
int rb_method_definition_eq | ( | const rb_method_definition_t * | d1, |
const rb_method_definition_t * | d2 | ||
) |
Definition at line 1849 of file vm_method.c.
References rb_method_cfunc_struct::argc, rb_method_definition_struct::attr, rb_method_definition_struct::bmethod, rb_method_definition_struct::body, rb_method_definition_struct::cfunc, d1, 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, rb_method_bmethod_struct::proc, rb_bug(), rb_equal(), RTEST, 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_eq().
void rb_method_definition_set | ( | const rb_method_entry_t * | me, |
rb_method_definition_t * | def, | ||
void * | opts | ||
) |
Definition at line 428 of file vm_method.c.
References rb_method_cfunc_struct::argc, rb_execution_context_struct::cfp, rb_method_iseq_struct::cref, def(), rb_method_entry_struct::def, rb_method_cfunc_struct::func, if(), INT2FIX, rb_control_frame_struct::iseq, rb_method_iseq_struct::iseqptr, NULL, rb_method_refined_struct::orig_me, rb_method_refined_struct::owner, rb_ary_freeze(), rb_ary_new3, rb_f_notimplement(), rb_iseq_path(), RB_OBJ_WRITE, rb_vm_get_ruby_level_next_cfp(), rb_vm_get_sourceline(), UNALIGNED_MEMBER_PTR, VM_ASSERT, 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_complement_defined_class().
const rb_method_entry_t * rb_method_entry | ( | VALUE | klass, |
ID | id | ||
) |
Definition at line 1023 of file vm_method.c.
References NULL.
const rb_method_entry_t * rb_method_entry_at | ( | VALUE | klass, |
ID | id | ||
) |
Definition at line 973 of file vm_method.c.
Referenced by rb_obj_singleton_method().
const rb_method_entry_t * rb_method_entry_clone | ( | const rb_method_entry_t * | src_me | ) |
Definition at line 606 of file vm_method.c.
References rb_method_entry_struct::called_id, rb_method_entry_struct::def, rb_method_entry_struct::defined_class, METHOD_ENTRY_COMPLEMENTED, and rb_method_entry_struct::owner.
Referenced by rb_alias(), and rb_method_entry_complement_defined_class().
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 619 of file vm_method.c.
References rb_method_entry_struct::called_id, def(), rb_method_entry_struct::def, rb_method_entry_struct::defined_class, METHOD_ENTRY_COMPLEMENTED_SET, NULL, rb_method_entry_struct::owner, rb_method_definition_create(), rb_method_definition_set(), rb_method_entry_clone(), RB_OBJ_WRITE, T_MODULE, VM_ASSERT, and VM_METHOD_TYPE_REFINED.
Referenced by rb_resolve_refined_method_callable().
void rb_method_entry_copy | ( | rb_method_entry_t * | dst, |
const rb_method_entry_t * | src | ||
) |
Definition at line 655 of file vm_method.c.
References rb_method_entry_struct::called_id, rb_method_entry_struct::def, rb_method_entry_struct::defined_class, rb_method_entry_struct::owner, and RB_OBJ_WRITE.
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 597 of file vm_method.c.
References def(), FALSE, NULL, ruby_running, and TRUE.
int rb_method_entry_eq | ( | const rb_method_entry_t * | m1, |
const rb_method_entry_t * | m2 | ||
) |
Definition at line 1821 of file vm_method.c.
References rb_method_entry_struct::def, and rb_method_definition_eq().
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 939 of file vm_method.c.
const rb_method_entry_t * rb_method_entry_with_refinements | ( | VALUE | klass, |
ID | id, | ||
VALUE * | defined_class_ptr | ||
) |
Definition at line 1208 of file vm_method.c.
References TRUE.
const rb_method_entry_t * rb_method_entry_without_refinements | ( | VALUE | klass, |
ID | id, | ||
VALUE * | defined_class_ptr | ||
) |
Definition at line 1247 of file vm_method.c.
References FALSE.
Referenced by rb_tracearg_parameters().
void rb_method_table_insert | ( | VALUE | klass, |
struct rb_id_table * | table, | ||
ID | method_id, | ||
const rb_method_entry_t * | me | ||
) |
Definition at line 286 of file vm_method.c.
References Qundef, rb_id_table_insert(), RB_OBJ_WRITTEN, RBASIC, RCLASS_M_TBL, T_CLASS, T_ICLASS, T_MODULE, and VM_ASSERT.
Definition at line 2545 of file vm_method.c.
References rb_ec_obj_respond_to().
Referenced by rb_respond_to().
Definition at line 1357 of file vm_method.c.
References name, and rb_intern().
Definition at line 1351 of file vm_method.c.
const rb_method_entry_t * rb_resolve_refined_method | ( | VALUE | refinements, |
const rb_method_entry_t * | me | ||
) |
Definition at line 1294 of file vm_method.c.
References NULL.
Referenced by 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 1301 of file vm_method.c.
References rb_callable_method_entry_struct::called_id, rb_method_entry_struct::defined_class, rb_callable_method_entry_struct::defined_class, and rb_method_entry_complement_defined_class().
Definition at line 2561 of file vm_method.c.
References FALSE, and rb_obj_respond_to().
Referenced by ossl_to_der_if_possible(), rb_econv_prepare_options(), rb_scheduler_close(), rb_scheduler_supports_io_read(), rb_scheduler_supports_io_write(), rb_scheduler_supports_process_wait(), and rb_str_equal().
void rb_scope_visibility_set | ( | rb_method_visibility_t | visi | ) |
Definition at line 1483 of file vm_method.c.
References FALSE.
Definition at line 1545 of file vm_method.c.
References CALL_METHOD_HOOK, rb_method_entry_struct::def, METHOD_VISI_PUBLIC, NIL_P, object_id, Qnil, rb_add_method(), rb_class_modify_check(), rb_eTypeError, rb_id2name(), rb_id2str, rb_method_name_error(), rb_raise(), rb_resolve_refined_method(), rb_warn(), undefined, UNDEFINED_METHOD_ENTRY_P, UNDEFINED_REFINED_METHOD_P, VM_METHOD_TYPE_REFINED, and VM_METHOD_TYPE_UNDEF.
void rb_undef_alloc_func | ( | VALUE | klass | ) |
Definition at line 954 of file vm_method.c.
References rb_define_alloc_func(), and UNDEF_ALLOC_FUNC.
Referenced by Init_ast(), Init_bigdecimal(), Init_Binding(), Init_cparse(), Init_ISeq(), Init_Numeric(), Init_objspace(), Init_ossl_engine(), Init_Proc(), Init_Ractor(), Init_String(), Init_VM(), Init_vm_backtrace(), Init_vm_trace(), Init_zlib(), InitVM_Enumerator(), InitVM_process(), InitVM_Random(), InitVM_Struct(), rsock_init_sockifaddr(), and ruby_Init_Continuation_body().
Definition at line 111 of file vm_method.c.