9static int vm_redefinition_check_flag(
VALUE klass);
13#define object_id idObject_id
14#define added idMethod_added
15#define singleton_added idSingleton_method_added
16#define removed idMethod_removed
17#define singleton_removed idSingleton_method_removed
18#define undefined idMethod_undefined
19#define singleton_undefined idSingleton_method_undefined
20#define attached id__attached__
22#define ruby_running (GET_VM()->running)
26vm_ccs_dump_i(
ID mid,
VALUE val,
void *data)
29 fprintf(stderr,
" | %s (len:%d) ",
rb_id2name(mid), ccs->
len);
32 for (
int i=0; i<ccs->
len; i++) {
33 fprintf(stderr,
" | [%d]\t", i); vm_ci_dump(ccs->
entries[i].
ci);
41vm_ccs_dump(
VALUE klass,
ID target_mid)
48 fprintf(stderr,
" [CCTB] %p\n", (
void *)cc_tbl);
49 vm_ccs_dump_i(target_mid, (
VALUE)ccs,
NULL);
53 fprintf(stderr,
" [CCTB] %p\n", (
void *)cc_tbl);
60vm_cme_dump_i(
ID mid,
VALUE val,
void *data)
62 ID target_mid = (
ID)data;
63 if (target_mid == 0 || mid == target_mid) {
70vm_mtbl_dump(
VALUE klass,
ID target_mid)
72 fprintf(stderr,
"# vm_mtbl\n");
78 if (target_mid != 0) {
84 fprintf(stderr,
" ## RCLASS_M_TBL (%p)\n", (
void *)
RCLASS_M_TBL(klass));
89 fprintf(stderr,
" MTBL: NULL\n");
92 if (target_mid != 0) {
98 fprintf(stderr,
" ## RCLASS_CALLABLE_M_TBL\n");
103 vm_ccs_dump(klass, target_mid);
113 fprintf(stderr,
"[%s] ", msg);
114 vm_mtbl_dump(klass, target_mid);
137clear_method_cache_by_id_in_class(
VALUE klass,
ID mid)
177 VALUE klass_housing_cme;
179 klass_housing_cme = owner;
219clear_iclass_method_cache_by_id(
VALUE iclass,
VALUE d)
223 clear_method_cache_by_id_in_class(iclass, mid);
227clear_iclass_method_cache_by_id_for_refinements(
VALUE klass,
VALUE d)
231 clear_method_cache_by_id_in_class(klass, mid);
238 if (RB_TYPE_P(klass_or_module,
T_MODULE)) {
239 VALUE module = klass_or_module;
242 VALUE refined_class = rb_refinement_module_get_refined_class(module);
249 clear_method_cache_by_id_in_class(klass_or_module, mid);
257invalidate_all_cc(
void *vstart,
void *vend,
size_t stride,
void *data)
260 for (; v != (
VALUE)vend; v += stride) {
261 void *
ptr = asan_poisoned_object_p(v);
262 asan_unpoison_object(v,
false);
273 asan_poison_object(v);
288 VALUE table_owner = klass;
289 if (RB_TYPE_P(klass,
T_ICLASS) && !RICLASS_OWNS_M_TBL_P(klass)) {
290 table_owner =
RBASIC(table_owner)->klass;
323 rb_define_notimplement_method_id(klass, mid, visi);
331 const int alias_count =
def->alias_count;
332 const int complemented_count =
def->complemented_count;
336 if (alias_count + complemented_count == 0) {
337 if (
METHOD_DEBUG) fprintf(stderr,
"-%p-%s:%d,%d (remove)\n", (
void *)
def,
338 rb_id2name(
def->original_id), alias_count, complemented_count);
345 def->complemented_count--;
347 else if (
def->alias_count > 0) {
352 alias_count,
def->alias_count, complemented_count,
def->complemented_count);
369 if (!GET_THREAD()->ext_config.ractor_safe) {
371 case -2:
return &call_cfunc_m2;
372 case -1:
return &call_cfunc_m1;
373 case 0:
return &call_cfunc_0;
374 case 1:
return &call_cfunc_1;
375 case 2:
return &call_cfunc_2;
376 case 3:
return &call_cfunc_3;
377 case 4:
return &call_cfunc_4;
378 case 5:
return &call_cfunc_5;
379 case 6:
return &call_cfunc_6;
380 case 7:
return &call_cfunc_7;
381 case 8:
return &call_cfunc_8;
382 case 9:
return &call_cfunc_9;
383 case 10:
return &call_cfunc_10;
384 case 11:
return &call_cfunc_11;
385 case 12:
return &call_cfunc_12;
386 case 13:
return &call_cfunc_13;
387 case 14:
return &call_cfunc_14;
388 case 15:
return &call_cfunc_15;
395 case -2:
return &ractor_safe_call_cfunc_m2;
396 case -1:
return &ractor_safe_call_cfunc_m1;
397 case 0:
return &ractor_safe_call_cfunc_0;
398 case 1:
return &ractor_safe_call_cfunc_1;
399 case 2:
return &ractor_safe_call_cfunc_2;
400 case 3:
return &ractor_safe_call_cfunc_3;
401 case 4:
return &ractor_safe_call_cfunc_4;
402 case 5:
return &ractor_safe_call_cfunc_5;
403 case 6:
return &ractor_safe_call_cfunc_6;
404 case 7:
return &ractor_safe_call_cfunc_7;
405 case 8:
return &ractor_safe_call_cfunc_8;
406 case 9:
return &ractor_safe_call_cfunc_9;
407 case 10:
return &ractor_safe_call_cfunc_10;
408 case 11:
return &ractor_safe_call_cfunc_11;
409 case 12:
return &ractor_safe_call_cfunc_12;
410 case 13:
return &ractor_safe_call_cfunc_13;
411 case 14:
return &ractor_safe_call_cfunc_14;
412 case 15:
return &ractor_safe_call_cfunc_15;
442 if (0) vm_cref_dump(
"rb_method_definition_create", cref);
448 method_cref = vm_cref_new_toplevel(GET_EC());
482 RB_OBJ_WRITE(me, &
def->body.bmethod.defined_ractor, rb_ractor_self(GET_RACTOR()));
551 def->original_id = mid;
553 def->method_serial = method_serial++;
568 def->complemented_count++;
581filter_defined_class(
VALUE klass)
599 rb_method_entry_t *me = rb_method_entry_alloc(called_id, klass, filter_defined_class(klass),
def);
601 if (
def !=
NULL) method_definition_reset(me);
609 method_definition_addref(src_me->
def));
611 method_definition_addref_complement(src_me->
def);
614 METHOD_ENTRY_FLAGS_COPY(me, src_me);
630 def->body.refined.orig_me) {
634 refined.orig_me = orig_me;
639 def = method_definition_addref_complement(
def);
642 METHOD_ENTRY_FLAGS_COPY(me, src_me);
658 method_definition_reset(dst);
662 METHOD_ENTRY_FLAGS_COPY(dst, src);
678 rb_vm_check_redefinition_opt_method(me, me->
owner);
684 method_definition_addref(me->
def));
685 METHOD_ENTRY_FLAGS_COPY(refined.orig_me, me);
686 refined.owner =
owner;
695lookup_method_table(
VALUE klass,
ID id)
714 make_method_entry_refined(refined_class, me);
723check_override_opt_method_i(
VALUE klass,
VALUE arg)
728 if (vm_redefinition_check_flag(klass)) {
732 if (newme != me) rb_vm_check_redefinition_opt_method(me, me->
owner);
739check_override_opt_method(
VALUE klass,
VALUE mid)
742 check_override_opt_method_i(klass, mid);
759 int make_refined = 0;
772 case idInitialize_copy:
773 case idInitialize_clone:
774 case idInitialize_dup:
785 VALUE refined_class = rb_refinement_module_get_refined_class(klass);
790 if (old_me) rb_vm_check_redefinition_opt_method(old_me, klass);
794 if (klass != orig_klass) {
806 rb_vm_check_redefinition_opt_method(old_me, klass);
821 switch (old_def->type) {
823 iseq = def_iseq_ptr(old_def);
834 "previous definition of %"PRIsVALUE" was here",
852 case idMethodMissing:
858 if (mid ==
object_id || mid == id__send__) {
865 make_method_entry_refined(klass, me);
873 if (RB_TYPE_P(orig_klass,
T_MODULE)) {
874 check_override_opt_method(klass, (
VALUE)mid);
880#define CALL_METHOD_HOOK(klass, hook, mid) do { \
881 const VALUE arg = ID2SYM(mid); \
882 VALUE recv_class = (klass); \
883 ID hook_id = (hook); \
884 if (FL_TEST((klass), FL_SINGLETON)) { \
885 recv_class = rb_ivar_get((klass), attached); \
886 hook_id = singleton_##hook; \
888 rb_funcallv(recv_class, hook_id, 1, &arg); \
892method_added(
VALUE klass,
ID mid)
902 rb_method_entry_make(klass, mid, klass, visi,
type,
NULL, mid, opts);
905 method_added(klass, mid);
917 iseq_body.iseqptr = iseq;
918 iseq_body.cref = cref;
932 method_definition_addref(me->
def);
934 method_added(klass, mid);
941 return method_entry_set(klass, mid, me, visi, klass);
944#define UNDEF_ALLOC_FUNC ((rb_alloc_func_t)-1)
967 if (allocator)
return allocator;
975 return lookup_method_table(klass,
id);
979search_method0(
VALUE klass,
ID id,
VALUE *defined_class_ptr,
bool skip_refined)
987 if ((me = lookup_method_table(klass,
id)) != 0) {
995 if (defined_class_ptr) *defined_class_ptr = klass;
1004search_method(
VALUE klass,
ID id,
VALUE *defined_class_ptr)
1006 return search_method0(klass,
id, defined_class_ptr,
false);
1010search_method_protect(
VALUE klass,
ID id,
VALUE *defined_class_ptr)
1025 return search_method_protect(klass,
id,
NULL);
1044 VM_ASSERT(callable_method_entry_p(cme));
1054 VM_ASSERT(callable_method_entry_p(cme));
1062 VM_ASSERT(callable_method_entry_p(cme));
1073complemented_callable_method_entry(
VALUE klass,
ID id)
1075 VALUE defined_class;
1077 return prepare_callable_method_entry(defined_class,
id, me,
FALSE);
1081cached_callable_method_entry(
VALUE klass,
ID mid)
1123 ccs = vm_ccs_create(klass,
cme);
1144callable_method_entry(
VALUE klass,
ID mid,
VALUE *defined_class_ptr)
1151 cme = cached_callable_method_entry(klass, mid);
1157 VALUE defined_class;
1159 if (defined_class_ptr) *defined_class_ptr = defined_class;
1162 cme = prepare_callable_method_entry(defined_class, mid, me,
TRUE);
1165 cme = negative_cme(mid);
1168 cache_callable_method_entry(klass, mid,
cme);
1179 return callable_method_entry(klass, mid,
NULL);
1185method_entry_resolve_refinement(
VALUE klass,
ID id,
int with_refinement,
VALUE *defined_class_ptr)
1187 const rb_method_entry_t *me = search_method_protect(klass,
id, defined_class_ptr);
1191 if (with_refinement) {
1193 VALUE refinements = cref ? CREF_REFINEMENTS(cref) :
Qnil;
1194 me = resolve_refined_method(refinements, me, defined_class_ptr);
1197 me = resolve_refined_method(
Qnil, me, defined_class_ptr);
1210 return method_entry_resolve_refinement(klass,
id,
TRUE, defined_class_ptr);
1214callable_method_entry_refeinements0(
VALUE klass,
ID id,
VALUE *defined_class_ptr,
bool with_refinements,
1221 VALUE defined_class, *dcp = defined_class_ptr ? defined_class_ptr : &defined_class;
1222 const rb_method_entry_t *me = method_entry_resolve_refinement(klass,
id, with_refinements, dcp);
1223 return prepare_callable_method_entry(*dcp,
id, me,
TRUE);
1228callable_method_entry_refeinements(
VALUE klass,
ID id,
VALUE *defined_class_ptr,
bool with_refinements)
1231 return callable_method_entry_refeinements0(klass,
id, defined_class_ptr, with_refinements,
cme);
1237 return callable_method_entry_refeinements(klass,
id, defined_class_ptr,
true);
1241callable_method_entry_without_refinements(
VALUE klass,
ID id,
VALUE *defined_class_ptr)
1243 return callable_method_entry_refeinements(klass,
id, defined_class_ptr,
false);
1249 return method_entry_resolve_refinement(klass,
id,
FALSE, defined_class_ptr);
1255 VALUE defined_class, *dcp = defined_class_ptr ? defined_class_ptr : &defined_class;
1257 return prepare_callable_method_entry(*dcp,
id, me,
TRUE);
1268 refinement = find_refinement(refinements, me->
owner);
1269 if (!
NIL_P(refinement)) {
1270 tmp_me = search_method_protect(refinement, me->
called_id, defined_class_ptr);
1279 if (defined_class_ptr) *defined_class_ptr = tmp_me->
defined_class;
1288 me = search_method_protect(super, me->
called_id, defined_class_ptr);
1296 return resolve_refined_method(refinements, me,
NULL);
1315remove_method(
VALUE klass,
ID mid)
1323 if (mid ==
object_id || mid == id__send__ || mid == idInitialize) {
1331 rb_name_err_raise(
"method `%1$s' not defined in %2$s",
1335 if (klass != self) {
1341 rb_vm_check_redefinition_opt_method(me, klass);
1353 remove_method(klass, mid);
1377 for (i = 0; i <
argc; i++) {
1381 rb_name_err_raise(
"method `%1$s' not defined in %2$s",
1384 remove_method(
mod,
id);
1393 VALUE defined_class;
1396 me = search_method0(origin_class,
name, &defined_class,
true);
1398 if (!me && RB_TYPE_P(klass,
T_MODULE)) {
1408 rb_vm_check_redefinition_opt_method(me, klass);
1410 if (klass == defined_class || origin_class == defined_class) {
1419 METHOD_ENTRY_VISI_SET(me, visi);
1429#define BOUND_PRIVATE 0x01
1430#define BOUND_RESPONDS 0x02
1433method_boundp(
VALUE klass,
ID id,
int ex)
1443 cme = callable_method_entry_without_refinements(klass,
id,
NULL);
1471 return method_boundp(klass,
id, ex);
1478 scope_visi->method_visi = method_visi;
1485 vm_cref_set_visibility(visi,
FALSE);
1489scope_visibility_check(
void)
1494 rb_warn(
"calling %s without arguments inside a method may not have the intended effect",
1500rb_scope_module_func_set(
void)
1502 scope_visibility_check();
1519 switch (vm_scope_visibility_get(ec)) {
1521 if (vm_scope_module_func_check(ec)) {
1522 rb_warning(
"attribute accessor as module_function");
1553 if (
id ==
object_id ||
id == id__send__ ||
id == idInitialize) {
1557 me = search_method(klass,
id, 0);
1621 for (i = 0; i <
argc; i++) {
1636 VALUE mid, include_super, lookup_mod =
mod;
1648 inc_super =
RTEST(include_super);
1831 switch (
def->type) {
1833 if (
def->body.refined.orig_me) {
1834 def =
def->body.refined.orig_me->def;
1839 def =
def->body.alias.original_me->def;
1851 d1 = original_method_definition(
d1);
1852 d2 = original_method_definition(d2);
1854 if (
d1 == d2)
return 1;
1855 if (!
d1 || !d2)
return 0;
1856 if (
d1->type != d2->type)
return 0;
1882 rb_bug(
"rb_method_definition_eq: unsupported type: %d\n",
d1->type);
1889 def = original_method_definition(
def);
1891 if (!
def)
return hash;
1893 switch (
def->type) {
1916 rb_bug(
"rb_hash_method_definition: unsupported method type (%d)\n",
def->type);
1922 return rb_hash_method_definition(hash, me->
def);
1928 const VALUE target_klass = klass;
1929 VALUE defined_class;
1940 orig_me = search_method(klass, original_name, &defined_class);
1948 if ((!RB_TYPE_P(klass,
T_MODULE)) ||
1949 (orig_me = search_method(
rb_cObject, original_name, &defined_class),
1965 rb_method_entry_make(target_klass, alias_name, target_klass, visi,
1968 method_added(target_klass, alias_name);
1973 alias_me = method_entry_set(target_klass, alias_name, orig_me, visi, orig_me->
owner);
2020 rb_export_method(self,
id, visi);
2042 check_and_export_method(self,
RARRAY_AREF(v, j), visi);
2045 for (i = 0; i <
argc; i++) {
2046 check_and_export_method(self,
argv[i], visi);
2055 scope_visibility_check();
2059 set_method_visibility(module,
argc,
argv, visi);
2186 for (i = 0; i <
argc; i++) {
2190 VALUE defined_class;
2196 me = search_method(origin_class,
name, &defined_class);
2197 if (!me && RB_TYPE_P(module,
T_MODULE)) {
2206 if (module == defined_class || origin_class == defined_class) {
2207 switch (me->
def->type) {
2216 rb_warn(
"Skipping set of ruby2_keywords flag for %s (method accepts keywords or method does not accept argument splat)",
rb_id2name(
name));
2222 procval = vm_proc_to_block_handler(VM_BH_TO_PROC(procval));
2235 rb_warn(
"Skipping set of ruby2_keywords flag for %s (method accepts keywords or method does not accept argument splat)",
rb_id2name(
name));
2242 rb_warn(
"Skipping set of ruby2_keywords flag for %s (method not defined in Ruby)",
rb_id2name(
name));
2247 rb_warn(
"Skipping set of ruby2_keywords flag for %s (can only set in method defining module)",
rb_id2name(
name));
2399 if (!RB_TYPE_P(module,
T_MODULE)) {
2404 rb_scope_module_func_set();
2410 for (i = 0; i <
argc; i++) {
2415 me = search_method(m,
id, 0);
2435#pragma push_macro("rb_method_basic_definition_p")
2436#undef rb_method_basic_definition_p
2442 if (!klass)
return TRUE;
2447#pragma pop_macro("rb_method_basic_definition_p")
2454 VALUE passed_block_handler = vm_passed_block_handler(ec);
2456 vm_passed_block_handler_set(ec, passed_block_handler);
2464 VALUE defined_class, args[2];
2471 return call_method_entry(ec, defined_class, obj, rtmid, cme, 2, args,
RB_NO_KEYWORDS);
2484 ret = basic_obj_respond_to_missing(ec, klass, obj,
ID2SYM(
id),
2495 VALUE defined_class;
2499 if (!cme)
return -1;
2514 "respond_to? must accept 1 or 2 arguments (requires %d)",
2524 " the deprecated method signature, which takes one parameter",
2528 if (!
NIL_P(location)) {
2534 "respond_to? is defined here");
2539 result = call_method_entry(ec, defined_class, obj, resid, cme,
argc, args,
RB_NO_KEYWORDS);
2540 return RTEST(result);
2555 int ret = vm_respond_to(ec, klass, obj,
id, priv);
2556 if (ret == -1) ret = basic_obj_respond_to(ec, obj,
id, !priv);
2596 VALUE ret = basic_obj_respond_to_missing(ec,
CLASS_OF(obj), obj,
2601 if (basic_obj_respond_to(ec, obj,
id, !
RTEST(priv)))
2656 "public", top_public, -1);
2658 "private", top_private, -1);
2660 "ruby2_keywords", top_ruby2_keywords, -1);
2663#define REPLICATE_METHOD(klass, id) do { \
2664 const rb_method_entry_t *me = rb_method_entry((klass), (id)); \
2665 rb_method_entry_set((klass), (id), me, METHOD_ENTRY_VISI(me)); \
VALUE rb_ary_freeze(VALUE ary)
VALUE rb_check_array_type(VALUE ary)
#define UNREACHABLE_RETURN
#define rb_category_warn(category,...)
#define rb_define_method(klass, mid, func, arity)
Defines klass#mid.
#define rb_define_private_method(klass, mid, func, arity)
Defines klass#mid and makes it private.
#define RB_DEBUG_COUNTER_INC(type)
#define MJIT_FUNC_EXPORTED
void rb_print_undef(VALUE klass, ID id, rb_method_visibility_t visi)
void rb_print_undef_str(VALUE klass, VALUE name)
void rb_method_name_error(VALUE, VALUE)
rb_cref_t * rb_vm_cref(void)
#define RSTRING_PTR(string)
int rb_objspace_garbage_object_p(VALUE obj)
const char * rb_obj_info(VALUE obj)
void rb_vm_ccs_free(struct rb_class_cc_entries *ccs)
VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0)
void rb_objspace_each_objects(each_obj_callback *callback, void *data)
void rb_gc_writebarrier_remember(VALUE obj)
#define rb_intern_str(string)
void rb_class_foreach_subclass(VALUE klass, void(*f)(VALUE, VALUE), VALUE arg)
VALUE rb_singleton_class(VALUE obj)
Returns the singleton class of obj.
void rb_class_modify_check(VALUE klass)
Asserts that klass is not a frozen class.
ID rb_frame_callee(void)
The name of the current method.
ID rb_frame_this_func(void)
The original name of the current method.
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
void rb_notimplement(void)
void rb_raise(VALUE exc, const char *fmt,...)
void rb_category_compile_warn(rb_warning_category_t category, const char *file, int line, const char *fmt,...)
void rb_bug(const char *fmt,...)
void rb_warn(const char *fmt,...)
void rb_compile_warning(const char *file, int line, const char *fmt,...)
void rb_warning(const char *fmt,...)
VALUE rb_mKernel
Kernel module.
VALUE rb_cObject
Object class.
VALUE rb_cModule
Module class.
VALUE rb_equal(VALUE, VALUE)
This function is an optimized version of calling #==.
int rb_id_table_insert(struct rb_id_table *tbl, ID id, VALUE val)
int rb_id_table_lookup(struct rb_id_table *tbl, ID id, VALUE *valp)
struct rb_id_table * rb_id_table_create(size_t capa)
int rb_id_table_delete(struct rb_id_table *tbl, ID id)
void rb_id_table_foreach(struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, void *data)
rb_id_table_iterator_result
#define IMEMO_TYPE_P(v, t)
@ RB_WARN_CATEGORY_DEPRECATED
#define UNLIMITED_ARGUMENTS
#define rb_hash_uint(h, i)
VALUE(* rb_alloc_func_t)(VALUE)
const char * rb_id2name(ID)
ID rb_intern(const char *)
ID rb_check_id(volatile VALUE *)
Returns ID for the given name if it is interned already, or 0.
VALUE rb_to_symbol(VALUE name)
#define RCLASS_CALLABLE_M_TBL(c)
#define UNALIGNED_MEMBER_PTR(ptr, mem)
st_index_t rb_hash_proc(st_index_t hash, VALUE proc)
VALUE rb_vm_top_self(void)
int rb_vm_check_optimizable_mid(VALUE mid)
#define rb_method_basic_definition_p(...)
VALUE rb_iseq_path(const rb_iseq_t *iseq)
const rb_iseq_t * rb_proc_get_iseq(VALUE proc, int *is_proc)
#define METHOD_ENTRY_CACHED(me)
int rb_method_entry_arity(const rb_method_entry_t *me)
#define METHOD_ENTRY_COMPLEMENTED(me)
#define METHOD_ENTRY_COMPLEMENTED_SET(me)
#define UNDEFINED_REFINED_METHOD_P(def)
#define METHOD_ENTRY_INVALIDATED_SET(me)
@ 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
#define METHOD_ENTRY_INVALIDATED(me)
#define UNDEFINED_METHOD_ENTRY_P(me)
VALUE rb_method_entry_location(const rb_method_entry_t *me)
#define METHOD_ENTRY_BASIC(me)
#define METHOD_ENTRY_VISI(me)
VALUE type(ANYARGS)
ANYARGS-ed function type.
#define RARRAY_AREF(a, i)
#define RMODULE_IS_REFINEMENT
#define RB_OBJ_WRITE(a, slot, b)
WB for new reference from ‘a’ to ‘b’.
#define RB_OBJ_WRITTEN(a, oldv, b)
WB for new reference from ‘a’ to ‘b’.
VALUE rb_sprintf(const char *,...)
const VALUE defined_class
struct rb_method_definition_struct *const def
union rb_captured_block::@198 code
const struct rb_callcache * cc
const struct rb_callinfo * ci
const struct rb_callable_method_entry_struct * cme
struct rb_class_cc_entries::rb_class_cc_entries_entry * entries
const rb_scope_visibility_t scope_visi
unsigned int ruby2_keywords
enum rb_iseq_constant_body::iseq_type type
struct rb_iseq_constant_body::@188::@190 flags
rb_iseq_location_t location
struct rb_iseq_constant_body::@188 param
parameter information
struct rb_iseq_constant_body * body
VALUE(* invoker)(VALUE recv, int argc, const VALUE *argv, VALUE(*func)(ANYARGS))
unsigned int no_redef_warning
rb_method_bmethod_t bmethod
union rb_method_definition_struct::@123 body
enum method_optimized_type optimize_type
rb_method_refined_t refined
struct rb_method_definition_struct *const def
rb_cref_t * cref
class reference, should be marked
rb_iseq_t * iseqptr
iseq pointer, should be separated from iseqval
struct rb_method_entry_struct * orig_me
struct rb_id_table * negative_cme_table
rb_control_frame_t * rb_vm_get_ruby_level_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp)
int rb_vm_get_sourceline(const rb_control_frame_t *cfp)
@ block_handler_type_proc
@ block_handler_type_iseq
VALUE rb_vm_call_kw(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me, int kw_splat)
#define INC_GLOBAL_CONSTANT_STATE()
int rb_method_entry_eq(const rb_method_entry_t *m1, const rb_method_entry_t *m2)
#define CALL_METHOD_HOOK(klass, hook, mid)
void rb_attr(VALUE klass, ID id, int read, int write, int ex)
int rb_method_definition_eq(const rb_method_definition_t *d1, const rb_method_definition_t *d2)
const rb_method_entry_t * rb_method_entry(VALUE klass, ID id)
void rb_undef_alloc_func(VALUE klass)
const rb_callable_method_entry_t * rb_resolve_refined_method_callable(VALUE refinements, const rb_callable_method_entry_t *me)
void rb_add_method_iseq(VALUE klass, ID mid, const rb_iseq_t *iseq, rb_cref_t *cref, rb_method_visibility_t visi)
const rb_method_entry_t * rb_resolve_refined_method(VALUE refinements, const rb_method_entry_t *me)
void Init_eval_method(void)
const rb_callable_method_entry_t * rb_callable_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class_ptr)
void rb_clear_constant_cache(void)
void rb_method_entry_copy(rb_method_entry_t *dst, const rb_method_entry_t *src)
void rb_undef(VALUE klass, ID id)
void rb_add_refined_method_entry(VALUE refined_class, ID mid)
const rb_cref_t * rb_vm_cref_in_context(VALUE self, VALUE cbase)
const rb_method_entry_t * rb_method_entry_at(VALUE klass, ID id)
void rb_clear_method_cache_all(void)
const rb_method_entry_t * rb_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class_ptr)
void rb_remove_method(VALUE klass, const char *name)
void rb_method_definition_set(const rb_method_entry_t *me, rb_method_definition_t *def, void *opts)
void rb_method_table_insert(VALUE klass, struct rb_id_table *table, ID method_id, const rb_method_entry_t *me)
void rb_free_method_entry(const rb_method_entry_t *me)
rb_alloc_func_t rb_get_alloc_func(VALUE klass)
void rb_vm_mtbl_dump(const char *msg, VALUE klass, ID target_mid)
void rb_alias(VALUE klass, ID alias_name, ID original_name)
#define REPLICATE_METHOD(klass, id)
const rb_method_entry_t * rb_method_entry_clone(const rb_method_entry_t *src_me)
int rb_respond_to(VALUE obj, ID id)
rb_method_entry_t * rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *me, rb_method_visibility_t visi)
const rb_callable_method_entry_t * rb_callable_method_entry(VALUE klass, ID mid)
const rb_callable_method_entry_t * rb_callable_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class_ptr)
void rb_cc_table_free(VALUE klass)
int rb_obj_respond_to(VALUE obj, ID id, int priv)
void rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *opts, rb_method_visibility_t visi)
void rb_clear_method_cache(VALUE klass_or_module, ID mid)
void rb_remove_method_id(VALUE klass, ID mid)
void rb_scope_visibility_set(rb_method_visibility_t visi)
int rb_ec_obj_respond_to(rb_execution_context_t *ec, VALUE obj, ID id, int priv)
const rb_method_entry_t * rb_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class_ptr)
void rb_define_alloc_func(VALUE klass, VALUE(*func)(VALUE))
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)
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_definition_t * rb_method_definition_create(rb_method_type_t type, ID mid)
st_index_t rb_hash_method_entry(st_index_t hash, const rb_method_entry_t *me)
int rb_method_boundp(VALUE klass, ID id, int ex)
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 ASSERT_vm_locking()
#define RB_VM_LOCK_ENTER()
#define RB_VM_LOCK_LEAVE()
if((ID)(DISPID) nameid !=nameid)
int def(FILE *source, FILE *dest, int level)
int write(ozstream &zs, const T *x, Items items)
int read(izstream &zs, T *x, Items items)
#define ZALLOC(strm, items, size)