ruby-changes:31517
From: charliesome <ko1@a...>
Date: Sat, 9 Nov 2013 12:46:54 +0900 (JST)
Subject: [ruby-changes:31517] charliesome:r43596 (trunk): * insns.def: unify ic_constant_serial and ic_class_serial into one field
charliesome 2013-11-09 12:46:48 +0900 (Sat, 09 Nov 2013) New Revision: 43596 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43596 Log: * insns.def: unify ic_constant_serial and ic_class_serial into one field ic_serial. This is possible because these fields are only ever used exclusively with each other. * insns.def: ditto * vm_core.h: ditto * vm_insnhelper.c: ditto Modified files: trunk/ChangeLog trunk/insns.def trunk/vm_core.h trunk/vm_insnhelper.c Index: ChangeLog =================================================================== --- ChangeLog (revision 43595) +++ ChangeLog (revision 43596) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Nov 9 12:45:00 2013 Charlie Somerville <charliesome@r...> + + * insns.def: unify ic_constant_serial and ic_class_serial into one field + ic_serial. This is possible because these fields are only ever used + exclusively with each other. + + * insns.def: ditto + * vm_core.h: ditto + * vm_insnhelper.c: ditto + Sat Nov 9 12:31:00 2013 Charlie Somerville <charliesome@r...> * class.c: unify names of vm state version counters to 'serial'. Index: insns.def =================================================================== --- insns.def (revision 43595) +++ insns.def (revision 43596) @@ -1183,7 +1183,7 @@ getinlinecache https://github.com/ruby/ruby/blob/trunk/insns.def#L1183 () (VALUE val) { - if (ic->ic_constant_serial == GET_CONSTANT_SERIAL()) { + if (ic->ic_serial == GET_CONSTANT_SERIAL()) { val = ic->ic_value.value; JUMP(dst); } @@ -1208,7 +1208,7 @@ setinlinecache https://github.com/ruby/ruby/blob/trunk/insns.def#L1208 rb_iseq_add_mark_object(GET_ISEQ(), val); } ic->ic_value.value = val; - ic->ic_constant_serial = GET_CONSTANT_SERIAL() - ruby_vm_const_missing_count; + ic->ic_serial = GET_CONSTANT_SERIAL() - ruby_vm_const_missing_count; ruby_vm_const_missing_count = 0; } Index: vm_core.h =================================================================== --- vm_core.h (revision 43595) +++ vm_core.h (revision 43596) @@ -131,8 +131,7 @@ typedef struct rb_compile_option_struct https://github.com/ruby/ruby/blob/trunk/vm_core.h#L131 struct iseq_inline_cache_entry { - rb_serial_t ic_constant_serial; - rb_serial_t ic_class_serial; + rb_serial_t ic_serial; union { size_t index; VALUE value; Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 43595) +++ vm_insnhelper.c (revision 43596) @@ -510,7 +510,7 @@ vm_getivar(VALUE obj, ID id, IC ic, rb_c https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L510 VALUE val = Qundef; VALUE klass = RBASIC(obj)->klass; - if (LIKELY((!is_attr && ic->ic_class_serial == RCLASS_EXT(klass)->class_serial) || + if (LIKELY((!is_attr && ic->ic_serial == RCLASS_EXT(klass)->class_serial) || (is_attr && ci->aux.index > 0))) { long index = !is_attr ? (long)ic->ic_value.index : ci->aux.index - 1; long len = ROBJECT_NUMIV(obj); @@ -533,7 +533,7 @@ vm_getivar(VALUE obj, ID id, IC ic, rb_c https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L533 } if (!is_attr) { ic->ic_value.index = index; - ic->ic_class_serial = RCLASS_EXT(klass)->class_serial; + ic->ic_serial = RCLASS_EXT(klass)->class_serial; } else { /* call_info */ ci->aux.index = index + 1; @@ -565,7 +565,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L565 st_data_t index; if (LIKELY( - (!is_attr && ic->ic_class_serial == RCLASS_EXT(klass)->class_serial) || + (!is_attr && ic->ic_serial == RCLASS_EXT(klass)->class_serial) || (is_attr && ci->aux.index > 0))) { long index = !is_attr ? (long)ic->ic_value.index : ci->aux.index-1; long len = ROBJECT_NUMIV(obj); @@ -582,7 +582,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L582 if (iv_index_tbl && st_lookup(iv_index_tbl, (st_data_t)id, &index)) { if (!is_attr) { ic->ic_value.index = index; - ic->ic_class_serial = RCLASS_EXT(klass)->class_serial; + ic->ic_serial = RCLASS_EXT(klass)->class_serial; } else { ci->aux.index = index + 1; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/