Ruby: vm_method.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions
vm_method.c File Reference
`#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)

## Functions
void | rb_vm_mtbl_dump (const char *msg, VALUE klass, ID target_mid)
void | rb_clear_constant_cache (void)
const rb_method_entry_t * | rb_method_entry_clone (const rb_method_entry_t *src_me)
void | rb_clear_method_cache (VALUE klass_or_module, ID mid)
void | rb_cc_table_free (VALUE klass)
void | rb_clear_method_cache_all (void)
void | rb_method_table_insert (VALUE klass, struct rb_id_table *table, ID method_id, const rb_method_entry_t *me)
VALUE | rb_f_notimplement (int argc, const VALUE *argv, VALUE obj, VALUE marker)
void | rb_add_method_cfunc (VALUE klass, ID mid, VALUE(*func)(ANYARGS), int argc, rb_method_visibility_t visi)
void | rb_free_method_entry (const rb_method_entry_t *me)
int | rb_method_definition_eq (const rb_method_definition_t *d1, const rb_method_definition_t *d2)
void | rb_method_definition_set (const rb_method_entry_t *me, rb_method_definition_t *def, void *opts)
rb_method_definition_t * | rb_method_definition_create (rb_method_type_t type, ID mid)
rb_method_entry_t * | rb_method_entry_create (ID called_id, VALUE klass, rb_method_visibility_t visi, const rb_method_definition_t *def)
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)
void | rb_method_entry_copy (rb_method_entry_t *dst, const rb_method_entry_t *src)
void | rb_add_refined_method_entry (VALUE refined_class, ID mid)
void | rb_add_method (VALUE klass, ID mid, rb_method_type_t type, void *opts, rb_method_visibility_t visi)
void | rb_add_method_iseq (VALUE klass, ID mid, const rb_iseq_t *iseq, rb_cref_t *cref, rb_method_visibility_t visi)
rb_method_entry_t * | rb_method_entry_set (VALUE klass, ID mid, const rb_method_entry_t *me, rb_method_visibility_t visi)
void | rb_define_alloc_func (VALUE klass, VALUE(*func)(VALUE))
void | rb_undef_alloc_func (VALUE klass)
rb_alloc_func_t | rb_get_alloc_func (VALUE klass)
const rb_method_entry_t * | rb_method_entry_at (VALUE klass, ID id)
const rb_method_entry_t * | rb_method_entry (VALUE klass, ID id)
const rb_callable_method_entry_t * | rb_callable_method_entry (VALUE klass, ID mid)
const rb_method_entry_t * | rb_method_entry_with_refinements (VALUE klass, ID id, VALUE *defined_class_ptr)
const rb_callable_method_entry_t * | rb_callable_method_entry_with_refinements (VALUE klass, ID id, VALUE *defined_class_ptr)
const rb_method_entry_t * | rb_method_entry_without_refinements (VALUE klass, ID id, VALUE *defined_class_ptr)
const rb_callable_method_entry_t * | rb_callable_method_entry_without_refinements (VALUE klass, ID id, VALUE *defined_class_ptr)
const rb_method_entry_t * | rb_resolve_refined_method (VALUE refinements, const rb_method_entry_t *me)
const rb_callable_method_entry_t * | rb_resolve_refined_method_callable (VALUE refinements, const rb_callable_method_entry_t *me)
void | rb_remove_method_id (VALUE klass, ID mid)
void | rb_remove_method (VALUE klass, const char *name)
int | rb_method_boundp (VALUE klass, ID id, int ex)
void | rb_scope_visibility_set (rb_method_visibility_t visi)
const rb_cref_t * | rb_vm_cref_in_context (VALUE self, VALUE cbase)
void | rb_attr (VALUE klass, ID id, int read, int write, int ex)
void | rb_undef (VALUE klass, ID id)
int | rb_method_entry_eq (const rb_method_entry_t *m1, const rb_method_entry_t *m2)
st_index_t | rb_hash_method_entry (st_index_t hash, const rb_method_entry_t *me)
void | rb_alias (VALUE klass, ID alias_name, ID original_name)
int | rb_method_basic_definition_p (VALUE klass, ID id)
int | rb_obj_respond_to (VALUE obj, ID id, int priv)
int | rb_ec_obj_respond_to (rb_execution_context_t *ec, VALUE obj, ID id, int priv)
int | rb_respond_to (VALUE obj, ID id)
void | Init_Method (void)
void | Init_eval_method (void)

## Macro Definition Documentation

## ◆ added

#define added idMethod_added

Definition at line 14 of file vm_method.c.

## ◆ attached

#define attached id__attached__

Definition at line 20 of file vm_method.c.

## ◆ BOUND_PRIVATE

#define BOUND_PRIVATE 0x01

Definition at line 1429 of file vm_method.c.

## ◆ BOUND_RESPONDS

#define BOUND_RESPONDS 0x02

Definition at line 1430 of file vm_method.c.

## ◆ CALL_METHOD_HOOK

#define CALL_METHOD_HOOK | ( |  | klass,
|  |  | hook,
|  |  | mid
| ) |  |

Value:
do { \
const VALUE arg = ID2SYM(mid); \
VALUE recv_class = (klass); \
ID hook_id = (hook); \
if (FL_TEST((klass), FL_SINGLETON)) { \
recv_class = rb_ivar_get((klass), attached); \
hook_id = singleton_##hook; \
} \
rb_funcallv(recv_class, hook_id, 1, &arg); \
} while (0)
FL_SINGLETON
#define FL_SINGLETON
Definition: fl_type.h:49
FL_TEST
#define FL_TEST
Definition: fl_type.h:130
rb_ivar_get
VALUE rb_ivar_get(VALUE, ID)
Definition: variable.c:1234
ID2SYM
#define ID2SYM
Definition: symbol.h:44
VALUE
unsigned long VALUE
Definition: value.h:38
ID
unsigned long ID
Definition: value.h:39
attached
#define attached
Definition: vm_method.c:20

Definition at line 880 of file vm_method.c.

## ◆ METHOD_DEBUG

#define METHOD_DEBUG 0

Definition at line 7 of file vm_method.c.

## ◆ object_id

#define object_id idObject_id

Definition at line 13 of file vm_method.c.

## ◆ removed

#define removed idMethod_removed

Definition at line 16 of file vm_method.c.

## ◆ REPLICATE_METHOD

#define REPLICATE_METHOD | ( |  | klass,
|  |  | id
| ) |  |

Value:
do { \
const rb_method_entry_t *me = rb_method_entry((klass), (id)); \
rb_method_entry_set((klass), (id), me, METHOD_ENTRY_VISI(me)); \
} while (0)
METHOD_ENTRY_VISI
#define METHOD_ENTRY_VISI(me)
Definition: method.h:70
rb_method_entry_struct
Definition: method.h:54
rb_method_entry
const rb_method_entry_t * rb_method_entry(VALUE klass, ID id)
Definition: vm_method.c:1023

## ◆ ruby_running

#define ruby_running (GET_VM()->running)

Definition at line 22 of file vm_method.c.

## ◆ singleton_added

#define singleton_added idSingleton_method_added

Definition at line 15 of file vm_method.c.

## ◆ singleton_removed

#define singleton_removed idSingleton_method_removed

Definition at line 17 of file vm_method.c.

## ◆ singleton_undefined

#define singleton_undefined idSingleton_method_undefined

Definition at line 19 of file vm_method.c.

## ◆ UNDEF_ALLOC_FUNC

#define UNDEF_ALLOC_FUNC ((rb_alloc_func_t)-1)

Definition at line 944 of file vm_method.c.

## ◆ undefined

#define undefined idMethod_undefined

Definition at line 18 of file vm_method.c.

## Function Documentation

## ◆ Init_eval_method()

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().

## ◆ Init_Method()

void Init_Method | ( | void |  | ) |

Definition at line 2628 of file vm_method.c.

## ◆ rb_add_method()

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().

## ◆ rb_add_method_cfunc()

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().

## ◆ rb_add_method_iseq()

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.

## ◆ rb_add_refined_method_entry()

void rb_add_refined_method_entry | ( | VALUE | refined_class,
|  | ID | mid
| ) |  |

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.

## ◆ rb_alias()

void rb_alias | ( | VALUE | klass,
|  | ID | alias_name,
|  | ID | original_name
| ) |  |

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().

## ◆ rb_attr()

void rb_attr | ( | VALUE | klass,
|  | ID | id,
|  | int | read,
|  | int | write,
|  | int | ex
| ) |  |

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().

## ◆ rb_callable_method_entry()

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().

## ◆ rb_callable_method_entry_with_refinements()

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.

## ◆ rb_callable_method_entry_without_refinements()

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.

References FALSE, and TRUE.

## ◆ rb_cc_table_free()

void rb_cc_table_free | ( | VALUE | klass | ) |

Definition at line 2727 of file gc.c.

References cc_tbl_i_data::klass, and TRUE.

## ◆ rb_clear_constant_cache()

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().

## ◆ rb_clear_method_cache()

void rb_clear_method_cache | ( | VALUE | klass_or_module,
|  | ID | mid
| ) |  |

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().

## ◆ rb_clear_method_cache_all()

void rb_clear_method_cache_all | ( | void |  | ) |

Definition at line 280 of file vm_method.c.

References NULL, and rb_objspace_each_objects().

## ◆ rb_define_alloc_func()

void rb_define_alloc_func | ( | VALUE | klass,
|  | VALUE(*)(VALUE) | func
| ) |  |

Definition at line 947 of file vm_method.c.

References RCLASS_EXT, and T_CLASS.

Referenced by rb_undef_alloc_func().

## ◆ rb_ec_obj_respond_to()

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().

## ◆ rb_f_notimplement()

VALUE rb_f_notimplement | ( | int | argc,
|  | const VALUE * | argv,
|  | VALUE | obj,
|  | VALUE | marker
| ) |  |

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().

## ◆ rb_free_method_entry()

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_get_alloc_func()

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.

## ◆ rb_hash_method_entry()

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.

## ◆ rb_method_basic_definition_p()

int rb_method_basic_definition_p | ( | VALUE | klass,
|  | ID | id
| ) |  |

Definition at line 2439 of file vm_method.c.

References FALSE, METHOD_ENTRY_BASIC, rb_callable_method_entry(), and TRUE.

## ◆ rb_method_boundp()

int rb_method_boundp | ( | VALUE | klass,
|  | ID | id,
|  | int | ex
| ) |  |

Definition at line 1469 of file vm_method.c.

## ◆ rb_method_definition_create()

rb_method_definition_t * rb_method_definition_create | ( | rb_method_type_t | type,
|  | ID | mid
| ) |  |

Definition at line 546 of file vm_method.c.

References def(), and ZALLOC.

Referenced by rb_method_entry_complement_defined_class().

## ◆ rb_method_definition_eq()

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().

## ◆ rb_method_definition_set()

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().

## ◆ rb_method_entry()

const rb_method_entry_t * rb_method_entry | ( | VALUE | klass,
|  | ID | id
| ) |  |

Definition at line 1023 of file vm_method.c.

References NULL.

## ◆ rb_method_entry_at()

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().

## ◆ rb_method_entry_clone()

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().

## ◆ 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().

## ◆ rb_method_entry_copy()

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_create()

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.

## ◆ rb_method_entry_eq()

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_set()

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.

## ◆ rb_method_entry_with_refinements()

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.

## ◆ rb_method_entry_without_refinements()

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().

## ◆ rb_method_table_insert()

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.

## ◆ rb_obj_respond_to()

int rb_obj_respond_to | ( | VALUE | obj,
|  | ID | id,
|  | int | priv
| ) |  |

Definition at line 2545 of file vm_method.c.

References rb_ec_obj_respond_to().

Referenced by rb_respond_to().

## ◆ rb_remove_method()

void rb_remove_method | ( | VALUE | klass,
|  | const char * | name
| ) |  |

Definition at line 1357 of file vm_method.c.

References name, and rb_intern().

## ◆ rb_remove_method_id()

void rb_remove_method_id | ( | VALUE | klass,
|  | ID | mid
| ) |  |

Definition at line 1351 of file vm_method.c.

## ◆ rb_resolve_refined_method()

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().

## ◆ rb_resolve_refined_method_callable()

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().

## ◆ rb_respond_to()

int rb_respond_to | ( | VALUE | obj,
|  | ID | id
| ) |  |

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().

## ◆ rb_scope_visibility_set()

void rb_scope_visibility_set | ( | rb_method_visibility_t | visi | ) |

Definition at line 1483 of file vm_method.c.

References FALSE.

## ◆ rb_undef()

void rb_undef | ( | VALUE | klass,
|  | ID | id
| ) |  |

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.

## ◆ rb_undef_alloc_func()

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().

## ◆ rb_vm_cref_in_context()

const rb_cref_t * rb_vm_cref_in_context | ( | VALUE | self,
|  | VALUE | cbase
| ) |  |

Definition at line 1640 of file vm.c.

Referenced by rb_attr().

## ◆ rb_vm_mtbl_dump()

void rb_vm_mtbl_dump | ( | const char * | msg,
|  | VALUE | klass,
|  | ID | target_mid
| ) |  |

Definition at line 111 of file vm_method.c.