From bc34d92f3dd7d78752fcdd1a2c4a6cbbcb01017b Mon Sep 17 00:00:00 2001 From: k0kubun Date: Tue, 3 Apr 2018 15:42:00 +0000 Subject: [PATCH] mjit.c: add class serial of singleton class for toplevel self. Toplevel self's class is not `Object` but `#`. This commit allows to inline method call setup for toplevel methods. I've thought r63053 works but it doesn't... I actually want to add all singleton classes but I'm not sure what's the good way for it. I assumed that using ObjectSpace.each_object is suboptimal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- mjit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mjit.c b/mjit.c index a5c75e5103..4ba45cd0ec 100644 --- a/mjit.c +++ b/mjit.c @@ -1380,6 +1380,7 @@ mjit_init(struct mjit_options *opts) rb_obj_hide(valid_class_serials); rb_gc_register_mark_object(valid_class_serials); mjit_add_class_serial(RCLASS_SERIAL(rb_cObject)); + mjit_add_class_serial(RCLASS_SERIAL(CLASS_OF(rb_vm_top_self()))); if (RCLASS_CONST_TBL(rb_cObject)) { rb_id_table_foreach(RCLASS_CONST_TBL(rb_cObject), valid_class_serials_add_i, NULL); }