ruby-changes:50870
From: k0kubun <ko1@a...>
Date: Wed, 4 Apr 2018 00:42:05 +0900 (JST)
Subject: [ruby-changes:50870] k0kubun:r63077 (trunk): mjit.c: add class serial of singleton class
k0kubun 2018-04-04 00:42:00 +0900 (Wed, 04 Apr 2018) New Revision: 63077 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63077 Log: mjit.c: add class serial of singleton class for toplevel self. Toplevel self's class is not `Object` but `#<Class:Object>`. 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. Modified files: trunk/mjit.c Index: mjit.c =================================================================== --- mjit.c (revision 63076) +++ mjit.c (revision 63077) @@ -1380,6 +1380,7 @@ mjit_init(struct mjit_options *opts) https://github.com/ruby/ruby/blob/trunk/mjit.c#L1380 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); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/