12#define RUBY_METHOD_H 1
16#ifndef END_OF_ENUMERATION
17# if defined(__GNUC__) &&! defined(__STRICT_ANSI__)
18# define END_OF_ENUMERATION(key)
20# define END_OF_ENUMERATION(key) END_OF_##key##_PLACEHOLDER = 0
67#define METHOD_ENTRY_VISI(me) (rb_method_visibility_t)(((me)->flags & (IMEMO_FL_USER0 | IMEMO_FL_USER1)) >> (IMEMO_FL_USHIFT+0))
68#define METHOD_ENTRY_BASIC(me) (int) (((me)->flags & (IMEMO_FL_USER2 )) >> (IMEMO_FL_USHIFT+2))
69#define METHOD_ENTRY_COMPLEMENTED(me) ((me)->flags & IMEMO_FL_USER3)
70#define METHOD_ENTRY_COMPLEMENTED_SET(me) ((me)->flags = (me)->flags | IMEMO_FL_USER3)
117#define VM_METHOD_TYPE_MINIMUM_BITS 4
123#define rb_iseq_t rb_iseq_t
187#define UNDEFINED_METHOD_ENTRY_P(me) (!(me) || !(me)->def || (me)->def->type == VM_METHOD_TYPE_UNDEF)
188#define UNDEFINED_REFINED_METHOD_P(def) \
189 ((def)->type == VM_METHOD_TYPE_REFINED && \
190 UNDEFINED_METHOD_ENTRY_P((def)->body.refined.orig_me))
const rb_method_entry_t * rb_method_entry_clone(const rb_method_entry_t *me)
int rb_method_entry_eq(const rb_method_entry_t *m1, const rb_method_entry_t *m2)
const rb_callable_method_entry_t * rb_callable_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class)
struct rb_method_cfunc_struct rb_method_cfunc_t
const rb_method_entry_t * rb_method_entry(VALUE klass, ID id)
int rb_method_entry_arity(const rb_method_entry_t *me)
const rb_callable_method_entry_t * rb_callable_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class)
void rb_add_method_iseq(VALUE klass, ID mid, const rb_iseq_t *iseq, rb_cref_t *cref, rb_method_visibility_t visi)
struct rb_method_attr_struct rb_method_attr_t
const rb_method_entry_t * rb_resolve_refined_method(VALUE refinements, const rb_method_entry_t *me)
void rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_visibility_t visi)
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)
struct rb_callable_method_entry_struct rb_callable_method_entry_t
void rb_free_method_entry(const rb_method_entry_t *me)
struct rb_method_entry_struct rb_method_entry_t
rb_method_entry_t * rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_visibility_t noex)
#define VM_METHOD_TYPE_MINIMUM_BITS
RUBY_SYMBOL_EXPORT_BEGIN const rb_method_entry_t * rb_resolve_me_location(const rb_method_entry_t *, VALUE[5])
struct rb_method_iseq_struct rb_method_iseq_t
@ VM_METHOD_TYPE_ISEQ
Ruby method.
@ VM_METHOD_TYPE_ATTRSET
attr_writer or attr_accessor
@ VM_METHOD_TYPE_CFUNC
C method.
@ VM_METHOD_TYPE_OPTIMIZED
Kernel::send, Proc::call, etc.
@ VM_METHOD_TYPE_REFINED
refinement
@ VM_METHOD_TYPE_NOTIMPLEMENTED
@ VM_METHOD_TYPE_MISSING
wrapper for method_missing(id)
@ VM_METHOD_TYPE_IVAR
attr_reader or attr_accessor
@ OPTIMIZED_METHOD_TYPE_CALL
@ OPTIMIZED_METHOD_TYPE__MAX
@ OPTIMIZED_METHOD_TYPE_BLOCK_CALL
@ OPTIMIZED_METHOD_TYPE_SEND
VALUE rb_unnamed_parameters(int arity)
struct rb_scope_visi_struct rb_scope_visibility_t
const rb_method_entry_t * rb_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class)
RUBY_SYMBOL_EXPORT_END const rb_callable_method_entry_t * rb_callable_method_entry(VALUE klass, ID id)
const rb_method_entry_t * rb_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class)
struct rb_method_bmethod_struct rb_method_bmethod_t
VALUE rb_method_entry_location(const rb_method_entry_t *me)
struct rb_method_refined_struct rb_method_refined_t
void rb_scope_visibility_set(rb_method_visibility_t)
const rb_method_entry_t * rb_method_entry_at(VALUE obj, ID id)
void rb_add_method_cfunc(VALUE klass, ID mid, VALUE(*func)(ANYARGS), int argc, rb_method_visibility_t visi)
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)
STATIC_ASSERT(VM_METHOD_TYPE_MINIMUM_BITS, VM_METHOD_TYPE_REFINED<=(1<< VM_METHOD_TYPE_MINIMUM_BITS))
st_index_t rb_hash_method_entry(st_index_t hash, const rb_method_entry_t *me)
struct rb_cref_struct rb_cref_t
CREF (Class REFerence)
rb_method_entry_t * rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, const rb_method_definition_t *def)
#define END_OF_ENUMERATION(key)
struct rb_method_alias_struct rb_method_alias_t
VALUE type(ANYARGS)
ANYARGS-ed function type.
struct rb_method_definition_struct *const def
const VALUE defined_class
const rb_scope_visibility_t scope_visi
struct rb_cref_struct * next
struct rb_method_entry_struct * original_me
struct rb_hook_list_struct * hooks
VALUE(* invoker)(VALUE recv, int argc, const VALUE *argv, VALUE(*func)())
unsigned int no_redef_warning
BITFIELD(rb_method_type_t, type, VM_METHOD_TYPE_MINIMUM_BITS)
rb_method_bmethod_t bmethod
enum method_optimized_type optimize_type
union rb_method_definition_struct::@41 body
rb_method_refined_t refined
struct rb_method_definition_struct *const def
rb_iseq_t * iseqptr
iseq pointer, should be separated from iseqval
rb_cref_t * cref
class reference, should be marked
struct rb_method_entry_struct * orig_me
BITFIELD(rb_method_visibility_t, method_visi, 3)
rb_method_visibility_t method_visi