Ruby  2.4.2p198(2017-09-14revision59899)
Data Structures | Macros | Functions | Variables
vm_method.c File Reference
#include "id_table.h"
Include dependency graph for vm_method.c:
This graph shows which files directly or indirectly include this file:

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)
 

Functions

static int vm_redefinition_check_flag (VALUE klass)
 
static void rb_vm_check_redefinition_opt_method (const rb_method_entry_t *me, VALUE klass)
 
static void rb_class_clear_method_cache (VALUE klass, VALUE arg)
 
void rb_clear_cache (void)
 
void rb_clear_constant_cache (void)
 
void rb_clear_method_cache_by_class (VALUE klass)
 
VALUE rb_f_notimplement (int argc, const VALUE *argv, VALUE obj)
 
static void rb_define_notimplement_method_id (VALUE mod, ID id, rb_method_visibility_t visi)
 
void rb_add_method_cfunc (VALUE klass, ID mid, VALUE(*func)(ANYARGS), int argc, rb_method_visibility_t visi)
 
static void rb_method_definition_release (rb_method_definition_t *def, int complemented)
 
void rb_free_method_entry (const rb_method_entry_t *me)
 
static rb_method_entry_tsearch_method (VALUE klass, ID id, VALUE *defined_class_ptr)
 
static int rb_method_definition_eq (const rb_method_definition_t *d1, const rb_method_definition_t *d2)
 
static rb_method_entry_tlookup_method_table (VALUE klass, ID id)
 
static void setup_method_cfunc_struct (rb_method_cfunc_t *cfunc, VALUE(*func)(), int argc)
 
static void method_definition_set (const rb_method_entry_t *me, rb_method_definition_t *def, void *opts)
 
static void method_definition_reset (const rb_method_entry_t *me)
 
static rb_method_definition_tmethod_definition_create (rb_method_type_t type, ID mid)
 
static rb_method_definition_tmethod_definition_addref (rb_method_definition_t *def)
 
static rb_method_definition_tmethod_definition_addref_complement (rb_method_definition_t *def)
 
static rb_method_entry_trb_method_entry_alloc (ID called_id, VALUE owner, VALUE defined_class, const rb_method_definition_t *def)
 
static VALUE filter_defined_class (VALUE klass)
 
rb_method_entry_trb_method_entry_create (ID called_id, VALUE klass, rb_method_visibility_t visi, const rb_method_definition_t *def)
 
const rb_method_entry_trb_method_entry_clone (const rb_method_entry_t *src_me)
 
const rb_callable_method_entry_trb_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)
 
static void make_method_entry_refined (VALUE owner, rb_method_entry_t *me)
 
void rb_add_refined_method_entry (VALUE refined_class, ID mid)
 
static void check_override_opt_method (VALUE klass, VALUE arg)
 
static rb_method_entry_trb_method_entry_make (VALUE klass, ID mid, VALUE defined_class, rb_method_visibility_t visi, rb_method_type_t type, rb_method_definition_t *def, ID original_id, void *opts)
 
static void method_added (VALUE klass, ID mid)
 
rb_method_entry_trb_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)
 
static rb_method_entry_tmethod_entry_set (VALUE klass, ID mid, const rb_method_entry_t *me, rb_method_visibility_t visi, VALUE defined_class)
 
rb_method_entry_trb_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_trb_method_entry_at (VALUE klass, ID id)
 
static rb_method_entry_tmethod_entry_get_without_cache (VALUE klass, ID id, VALUE *defined_class_ptr)
 
static rb_method_entry_tmethod_entry_get (VALUE klass, ID id, VALUE *defined_class_ptr)
 
const rb_method_entry_trb_method_entry (VALUE klass, ID id)
 
static const rb_callable_method_entry_tprepare_callable_method_entry (VALUE defined_class, ID id, const rb_method_entry_t *me)
 
const rb_callable_method_entry_trb_callable_method_entry (VALUE klass, ID id)
 
static const rb_method_entry_tresolve_refined_method (VALUE refinements, const rb_method_entry_t *me, VALUE *defined_class_ptr)
 
static const rb_method_entry_tmethod_entry_resolve_refinement (VALUE klass, ID id, int with_refinement, VALUE *defined_class_ptr)
 
const rb_method_entry_trb_method_entry_with_refinements (VALUE klass, ID id)
 
const rb_callable_method_entry_trb_callable_method_entry_with_refinements (VALUE klass, ID id)
 
const rb_method_entry_trb_method_entry_without_refinements (VALUE klass, ID id)
 
const rb_callable_method_entry_trb_callable_method_entry_without_refinements (VALUE klass, ID id)
 
static const rb_method_entry_trefined_method_original_method_entry (VALUE refinements, const rb_method_entry_t *me, VALUE *defined_class_ptr)
 
const rb_method_entry_trb_resolve_refined_method (VALUE refinements, const rb_method_entry_t *me)
 
const rb_callable_method_entry_trb_resolve_refined_method_callable (VALUE refinements, const rb_callable_method_entry_t *me)
 
static void remove_method (VALUE klass, ID mid)
 
void rb_remove_method_id (VALUE klass, ID mid)
 
void rb_remove_method (VALUE klass, const char *name)
 
static VALUE rb_mod_remove_method (int argc, VALUE *argv, VALUE mod)
 
static void rb_export_method (VALUE klass, ID name, rb_method_visibility_t visi)
 
int rb_method_boundp (VALUE klass, ID id, int ex)
 
static rb_method_visibility_t rb_scope_visibility_get (void)
 
static int rb_scope_module_func_check (void)
 
static void vm_cref_set_visibility (rb_method_visibility_t method_visi, int module_func)
 
void rb_scope_visibility_set (rb_method_visibility_t visi)
 
static void rb_scope_module_func_set (void)
 
void rb_attr (VALUE klass, ID id, int read, int write, int ex)
 
void rb_undef (VALUE klass, ID id)
 
static VALUE rb_mod_undef_method (int argc, VALUE *argv, VALUE mod)
 
static VALUE rb_mod_method_defined (VALUE mod, VALUE mid)
 
static VALUE check_definition (VALUE mod, VALUE mid, rb_method_visibility_t visi)
 
static VALUE rb_mod_public_method_defined (VALUE mod, VALUE mid)
 
static VALUE rb_mod_private_method_defined (VALUE mod, VALUE mid)
 
static VALUE rb_mod_protected_method_defined (VALUE mod, VALUE mid)
 
int rb_method_entry_eq (const rb_method_entry_t *m1, const rb_method_entry_t *m2)
 
static const rb_method_definition_toriginal_method_definition (const rb_method_definition_t *def)
 
static st_index_t rb_hash_method_definition (st_index_t hash, const rb_method_definition_t *def)
 
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)
 
static VALUE rb_mod_alias_method (VALUE mod, VALUE newname, VALUE oldname)
 
static void set_method_visibility (VALUE self, int argc, const VALUE *argv, rb_method_visibility_t visi)
 
static VALUE set_visibility (int argc, const VALUE *argv, VALUE module, rb_method_visibility_t visi)
 
static VALUE rb_mod_public (int argc, VALUE *argv, VALUE module)
 
static VALUE rb_mod_protected (int argc, VALUE *argv, VALUE module)
 
static VALUE rb_mod_private (int argc, VALUE *argv, VALUE module)
 
static VALUE rb_mod_public_method (int argc, VALUE *argv, VALUE obj)
 
static VALUE rb_mod_private_method (int argc, VALUE *argv, VALUE obj)
 
static VALUE top_public (int argc, VALUE *argv)
 
static VALUE top_private (int argc, VALUE *argv)
 
static VALUE rb_mod_modfunc (int argc, VALUE *argv, VALUE module)
 
int rb_method_basic_definition_p (VALUE klass, ID id)
 
static VALUE call_method_entry (rb_thread_t *th, VALUE defined_class, VALUE obj, ID id, const rb_method_entry_t *me, int argc, const VALUE *argv)
 
static VALUE basic_obj_respond_to_missing (rb_thread_t *th, VALUE klass, VALUE obj, VALUE mid, VALUE priv)
 
static int basic_obj_respond_to (rb_thread_t *th, VALUE obj, ID id, int pub)
 
static int vm_respond_to (rb_thread_t *th, VALUE klass, VALUE obj, ID id, int priv)
 
int rb_obj_respond_to (VALUE obj, ID id, int priv)
 
int rb_respond_to (VALUE obj, ID id)
 
static VALUE obj_respond_to (int argc, VALUE *argv, VALUE obj)
 
static VALUE obj_respond_to_missing (VALUE obj, VALUE mid, VALUE priv)
 
void Init_Method (void)
 
void Init_eval_method (void)
 

Variables

static VALUE(*)(VALUE(*func)(ANYARGS), VALUE recv, int argc, const VALUE *) call_cfunc_invoker_func (int argc)
 

Macro Definition Documentation

◆ added

#define added   idMethod_added

Definition at line 32 of file vm_method.c.

Referenced by getifaddrs(), and method_added().

◆ attached

#define attached   id__attached__

Definition at line 38 of file vm_method.c.

◆ BOUND_PRIVATE

#define BOUND_PRIVATE   0x01

Definition at line 1065 of file vm_method.c.

Referenced by check_funcall_failed().

◆ BOUND_RESPONDS

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

◆ 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)
VALUE rb_ivar_get(VALUE, ID)
Definition: variable.c:1260
#define FL_SINGLETON
Definition: ruby.h:1215
#define FL_TEST(x, f)
Definition: ruby.h:1284
unsigned long VALUE
Definition: ruby.h:85
#define attached
Definition: vm_method.c:38
#define ID2SYM(x)
Definition: ruby.h:383

Definition at line 611 of file vm_method.c.

Referenced by method_added(), rb_undef(), and remove_method().

◆ GLOBAL_METHOD_CACHE

#define GLOBAL_METHOD_CACHE (   c,
 
)    (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().

◆ METHOD_DEBUG

#define METHOD_DEBUG   0

◆ object_id

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

◆ rb_intern

#define rb_intern (   str)    rb_intern_const(str)

Referenced by rb_remove_method().

◆ removed

#define removed   idMethod_removed

Definition at line 34 of file vm_method.c.

Referenced by remove_method().

◆ 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)
const rb_method_entry_t * rb_method_entry(VALUE klass, ID id)
Definition: vm_method.c:796
Definition: method.h:50
#define METHOD_ENTRY_VISI(me)
Definition: method.h:66

Referenced by Init_eval_method().

◆ ruby_running

#define ruby_running   (GET_VM()->running)

◆ singleton_added

#define singleton_added   idSingleton_method_added

Definition at line 33 of file vm_method.c.

◆ singleton_removed

#define singleton_removed   idSingleton_method_removed

Definition at line 35 of file vm_method.c.

◆ singleton_undefined

#define singleton_undefined   idSingleton_method_undefined

Definition at line 37 of file vm_method.c.

◆ UNDEF_ALLOC_FUNC

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

◆ undefined

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

Function Documentation

◆ basic_obj_respond_to()

static int basic_obj_respond_to ( rb_thread_t th,
VALUE  obj,
ID  id,
int  pub 
)
inlinestatic

◆ basic_obj_respond_to_missing()

static VALUE basic_obj_respond_to_missing ( rb_thread_t th,
VALUE  klass,
VALUE  obj,
VALUE  mid,
VALUE  priv 
)
static

◆ call_method_entry()

static VALUE call_method_entry ( rb_thread_t th,
VALUE  defined_class,
VALUE  obj,
ID  id,
const rb_method_entry_t me,
int  argc,
const VALUE argv 
)
static

◆ check_definition()

static VALUE check_definition ( VALUE  mod,
VALUE  mid,
rb_method_visibility_t  visi 
)
static

◆ check_override_opt_method()

static void check_override_opt_method ( VALUE  klass,
VALUE  arg 
)
static

◆ filter_defined_class()

static VALUE filter_defined_class ( VALUE  klass)
static

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

◆ Init_eval_method()

void Init_eval_method ( void  )

◆ Init_Method()

void Init_Method ( void  )

Definition at line 2062 of file vm_method.c.

References calloc, EXIT_FAILURE, getenv, NULL, and val.

◆ lookup_method_table()

static rb_method_entry_t* lookup_method_table ( VALUE  klass,
ID  id 
)
inlinestatic

◆ make_method_entry_refined()

static void make_method_entry_refined ( VALUE  owner,
rb_method_entry_t me 
)
static

◆ method_added()

static void method_added ( VALUE  klass,
ID  mid 
)
static

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

◆ method_definition_addref()

static rb_method_definition_t* method_definition_addref ( rb_method_definition_t def)
static

◆ method_definition_addref_complement()

static rb_method_definition_t* method_definition_addref_complement ( rb_method_definition_t def)
static

◆ method_definition_create()

static rb_method_definition_t* method_definition_create ( rb_method_type_t  type,
ID  mid 
)
static

◆ method_definition_reset()

static void method_definition_reset ( const rb_method_entry_t me)
static

◆ method_definition_set()

static void method_definition_set ( const rb_method_entry_t me,
rb_method_definition_t def,
void *  opts 
)
static

◆ method_entry_get()

static rb_method_entry_t* method_entry_get ( VALUE  klass,
ID  id,
VALUE defined_class_ptr 
)
static

◆ method_entry_get_without_cache()

static rb_method_entry_t* method_entry_get_without_cache ( VALUE  klass,
ID  id,
VALUE defined_class_ptr 
)
static

◆ method_entry_resolve_refinement()

static const rb_method_entry_t* method_entry_resolve_refinement ( VALUE  klass,
ID  id,
int  with_refinement,
VALUE defined_class_ptr 
)
static

◆ method_entry_set()

static rb_method_entry_t* method_entry_set ( VALUE  klass,
ID  mid,
const rb_method_entry_t me,
rb_method_visibility_t  visi,
VALUE  defined_class 
)
static

◆ obj_respond_to()

static VALUE obj_respond_to ( int  argc,
VALUE argv,
VALUE  obj 
)
static

◆ obj_respond_to_missing()

static VALUE obj_respond_to_missing ( VALUE  obj,
VALUE  mid,
VALUE  priv 
)
static

Definition at line 2056 of file vm_method.c.

References Qfalse.

Referenced by Init_eval_method().

◆ original_method_definition()

static const rb_method_definition_t* original_method_definition ( const rb_method_definition_t def)
static

◆ prepare_callable_method_entry()

static const rb_callable_method_entry_t* prepare_callable_method_entry ( VALUE  defined_class,
ID  id,
const rb_method_entry_t me 
)
static

◆ rb_add_method()

rb_method_entry_t* rb_add_method ( VALUE  klass,
ID  mid,
rb_method_type_t  type,
void *  opts,
rb_method_visibility_t  visi 
)

◆ rb_add_method_cfunc()

void rb_add_method_cfunc ( VALUE  klass,
ID  mid,
VALUE(*)(ANYARGS func,
int  argc,
rb_method_visibility_t  visi 
)

◆ 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 
)

◆ rb_add_refined_method_entry()

void rb_add_refined_method_entry ( VALUE  refined_class,
ID  mid 
)

◆ rb_alias()

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

◆ rb_attr()

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

◆ rb_callable_method_entry()

const rb_callable_method_entry_t* rb_callable_method_entry ( VALUE  klass,
ID  id 
)

◆ rb_callable_method_entry_with_refinements()

const rb_callable_method_entry_t* rb_callable_method_entry_with_refinements ( VALUE  klass,
ID  id 
)

◆ rb_callable_method_entry_without_refinements()

const rb_callable_method_entry_t* rb_callable_method_entry_without_refinements ( VALUE  klass,
ID  id 
)

◆ rb_class_clear_method_cache()

static void rb_class_clear_method_cache ( VALUE  klass,
VALUE  arg 
)
static

◆ rb_clear_cache()

void rb_clear_cache ( void  )

Definition at line 84 of file vm_method.c.

References ONLY_FOR_INTERNAL_USE.

◆ rb_clear_constant_cache()

void rb_clear_constant_cache ( void  )

◆ rb_clear_method_cache_by_class()

void rb_clear_method_cache_by_class ( VALUE  klass)

◆ rb_define_alloc_func()

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

Definition at line 674 of file vm_method.c.

References Check_Type, func, RCLASS_EXT, and T_CLASS.

Referenced by rb_undef_alloc_func().

◆ rb_define_notimplement_method_id()

static void rb_define_notimplement_method_id ( VALUE  mod,
ID  id,
rb_method_visibility_t  visi 
)
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().

◆ rb_export_method()

static void rb_export_method ( VALUE  klass,
ID  name,
rb_method_visibility_t  visi 
)
static

◆ rb_f_notimplement()

VALUE rb_f_notimplement ( int  argc,
const VALUE argv,
VALUE  obj 
)

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

◆ rb_free_method_entry()

void rb_free_method_entry ( const rb_method_entry_t me)

◆ rb_get_alloc_func()

rb_alloc_func_t rb_get_alloc_func ( VALUE  klass)

◆ rb_hash_method_definition()

static st_index_t rb_hash_method_definition ( st_index_t  hash,
const rb_method_definition_t def 
)
static

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

◆ rb_method_basic_definition_p()

int rb_method_basic_definition_p ( VALUE  klass,
ID  id 
)

◆ rb_method_boundp()

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

◆ rb_method_definition_eq()

static int rb_method_definition_eq ( const rb_method_definition_t d1,
const rb_method_definition_t d2 
)
static

◆ rb_method_definition_release()

static void rb_method_definition_release ( rb_method_definition_t def,
int  complemented 
)
static

◆ rb_method_entry()

const rb_method_entry_t* rb_method_entry ( VALUE  klass,
ID  id 
)

◆ rb_method_entry_alloc()

static rb_method_entry_t* rb_method_entry_alloc ( ID  called_id,
VALUE  owner,
VALUE  defined_class,
const rb_method_definition_t def 
)
static

◆ rb_method_entry_at()

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

◆ rb_method_entry_clone()

const rb_method_entry_t* rb_method_entry_clone ( const rb_method_entry_t src_me)

◆ 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 
)

◆ rb_method_entry_copy()

void rb_method_entry_copy ( rb_method_entry_t dst,
const rb_method_entry_t src 
)

◆ 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 
)

◆ rb_method_entry_eq()

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

◆ rb_method_entry_make()

static rb_method_entry_t* rb_method_entry_make ( VALUE  klass,
ID  mid,
VALUE  defined_class,
rb_method_visibility_t  visi,
rb_method_type_t  type,
rb_method_definition_t def,
ID  original_id,
void *  opts 
)
static

◆ 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 666 of file vm_method.c.

References method_entry_set().

Referenced by clone_method(), rb_mod_define_method(), and rb_mod_modfunc().

◆ rb_method_entry_with_refinements()

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.

◆ rb_method_entry_without_refinements()

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

◆ rb_mod_alias_method()

static VALUE rb_mod_alias_method ( VALUE  mod,
VALUE  newname,
VALUE  oldname 
)
static

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

◆ rb_mod_method_defined()

static VALUE rb_mod_method_defined ( VALUE  mod,
VALUE  mid 
)
static

Definition at line 1295 of file vm_method.c.

References Qfalse, Qtrue, rb_check_id(), and rb_method_boundp().

Referenced by Init_eval_method().

◆ rb_mod_modfunc()

static VALUE rb_mod_modfunc ( int  argc,
VALUE argv,
VALUE  module 
)
static

◆ rb_mod_private()

static VALUE rb_mod_private ( int  argc,
VALUE argv,
VALUE  module 
)
static

Definition at line 1714 of file vm_method.c.

References METHOD_VISI_PRIVATE, and set_visibility().

Referenced by Init_eval_method(), and top_private().

◆ rb_mod_private_method()

static VALUE rb_mod_private_method ( int  argc,
VALUE argv,
VALUE  obj 
)
static

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

◆ rb_mod_private_method_defined()

static VALUE rb_mod_private_method_defined ( VALUE  mod,
VALUE  mid 
)
static

Definition at line 1381 of file vm_method.c.

References check_definition(), and METHOD_VISI_PRIVATE.

Referenced by Init_eval_method().

◆ rb_mod_protected()

static VALUE rb_mod_protected ( int  argc,
VALUE argv,
VALUE  module 
)
static

Definition at line 1685 of file vm_method.c.

References METHOD_VISI_PROTECTED, and set_visibility().

Referenced by Init_eval_method().

◆ rb_mod_protected_method_defined()

static VALUE rb_mod_protected_method_defined ( VALUE  mod,
VALUE  mid 
)
static

Definition at line 1415 of file vm_method.c.

References check_definition(), and METHOD_VISI_PROTECTED.

Referenced by Init_eval_method().

◆ rb_mod_public()

static VALUE rb_mod_public ( int  argc,
VALUE argv,
VALUE  module 
)
static

Definition at line 1658 of file vm_method.c.

References METHOD_VISI_PUBLIC, and set_visibility().

Referenced by Init_eval_method(), and top_public().

◆ rb_mod_public_method()

static VALUE rb_mod_public_method ( int  argc,
VALUE argv,
VALUE  obj 
)
static

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

◆ rb_mod_public_method_defined()

static VALUE rb_mod_public_method_defined ( VALUE  mod,
VALUE  mid 
)
static

Definition at line 1347 of file vm_method.c.

References check_definition(), and METHOD_VISI_PUBLIC.

Referenced by Init_eval_method().

◆ rb_mod_remove_method()

static VALUE rb_mod_remove_method ( int  argc,
VALUE argv,
VALUE  mod 
)
static

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

◆ rb_mod_undef_method()

static VALUE rb_mod_undef_method ( int  argc,
VALUE argv,
VALUE  mod 
)
static

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

◆ rb_obj_respond_to()

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

◆ rb_remove_method()

void rb_remove_method ( VALUE  klass,
const char *  name 
)

Definition at line 1000 of file vm_method.c.

References rb_intern, and remove_method().

◆ rb_remove_method_id()

void rb_remove_method_id ( VALUE  klass,
ID  mid 
)

Definition at line 994 of file vm_method.c.

References remove_method().

Referenced by num_sadded().

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

◆ 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 
)

◆ rb_respond_to()

int rb_respond_to ( VALUE  obj,
ID  id 
)

◆ rb_scope_module_func_check()

static int rb_scope_module_func_check ( void  )
static

◆ rb_scope_module_func_set()

static void rb_scope_module_func_set ( void  )
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().

◆ rb_scope_visibility_get()

static rb_method_visibility_t rb_scope_visibility_get ( void  )
static

◆ rb_scope_visibility_set()

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

◆ rb_undef()

void rb_undef ( VALUE  klass,
ID  id 
)

◆ rb_undef_alloc_func()

void rb_undef_alloc_func ( VALUE  klass)

◆ rb_vm_check_redefinition_opt_method()

static void rb_vm_check_redefinition_opt_method ( const rb_method_entry_t me,
VALUE  klass 
)
static

◆ refined_method_original_method_entry()

static const rb_method_entry_t* refined_method_original_method_entry ( VALUE  refinements,
const rb_method_entry_t me,
VALUE defined_class_ptr 
)
static

◆ remove_method()

static void remove_method ( VALUE  klass,
ID  mid 
)
static

◆ resolve_refined_method()

static const rb_method_entry_t * resolve_refined_method ( VALUE  refinements,
const rb_method_entry_t me,
VALUE defined_class_ptr 
)
static

◆ search_method()

static rb_method_entry_t * search_method ( VALUE  klass,
ID  id,
VALUE defined_class_ptr 
)
inlinestatic

◆ set_method_visibility()

static void set_method_visibility ( VALUE  self,
int  argc,
const VALUE argv,
rb_method_visibility_t  visi 
)
static

◆ set_visibility()

static VALUE set_visibility ( int  argc,
const VALUE argv,
VALUE  module,
rb_method_visibility_t  visi 
)
static

◆ setup_method_cfunc_struct()

static void setup_method_cfunc_struct ( rb_method_cfunc_t cfunc,
VALUE(*)()  func,
int  argc 
)
static

◆ top_private()

static VALUE top_private ( int  argc,
VALUE argv 
)
static

Definition at line 1794 of file vm_method.c.

References rb_cObject, and rb_mod_private().

Referenced by Init_eval_method().

◆ top_public()

static VALUE top_public ( int  argc,
VALUE argv 
)
static

Definition at line 1776 of file vm_method.c.

References rb_cObject, and rb_mod_public().

Referenced by Init_eval_method().

◆ vm_cref_set_visibility()

static void vm_cref_set_visibility ( rb_method_visibility_t  method_visi,
int  module_func 
)
static

◆ vm_redefinition_check_flag()

static int vm_redefinition_check_flag ( VALUE  klass)
static

◆ vm_respond_to()

static int vm_respond_to ( rb_thread_t th,
VALUE  klass,
VALUE  obj,
ID  id,
int  priv 
)
static

Variable Documentation

◆ call_cfunc_invoker_func

VALUE(*)(VALUE (*func)(ANYARGS), VALUE recv, int argc, const VALUE *) call_cfunc_invoker_func(int argc)
static

Definition at line 197 of file vm_method.c.

Referenced by setup_method_cfunc_struct().