diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-12 17:16:27 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-12 17:16:27 +0000 |
commit | 6f817b6dd2d0c749a6657077845331130a1fa4da (patch) | |
tree | 6e48666a2acb43710ace626d15aedff2c2e19746 | |
parent | 6bbed0e31b1d32808443b3dd3e451aad28d46096 (diff) | |
download | ruby-6f817b6dd2d0c749a6657077845331130a1fa4da.tar.gz |
* vm_core.h: change members of iseq_inline_cache_entry.
make cache value members to one union member "ic_value".
* insns.def: ditto.
* vm_insnhelper.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | insns.def | 10 | ||||
-rw-r--r-- | vm_core.h | 8 | ||||
-rw-r--r-- | vm_insnhelper.c | 12 |
4 files changed, 25 insertions, 14 deletions
@@ -1,3 +1,12 @@ +Sun Sep 13 02:08:43 2009 Koichi Sasada <ko1@atdot.net> + + * vm_core.h: change members of iseq_inline_cache_entry. + make cache value members to one union member "ic_value". + + * insns.def: ditto. + + * vm_insnhelper.c: ditto. + Sun Sep 13 01:15:49 2009 Tanaka Akira <akr@fsij.org> * lib/open-uri.rb (URI::FTP#buffer_open): fix the %2F handling. @@ -1174,7 +1174,7 @@ getinlinecache (VALUE val) { if (ic->ic_vmstat == GET_VM_STATE_VERSION()) { - val = ic->ic_value; + val = ic->ic_value.value; JUMP(dst); } else { @@ -1195,12 +1195,12 @@ onceinlinecache (VALUE val) { if (ic->ic_vmstat) { - val = ic->ic_value; + val = ic->ic_value.value; JUMP(dst); } else { /* none */ - ic->ic_value = Qundef; + ic->ic_value.value = Qundef; val = Qnil; } } @@ -1218,10 +1218,10 @@ setinlinecache { IC ic = GET_CONST_INLINE_CACHE(dst); - if (ic->ic_value == Qundef) { + if (ic->ic_value.value == Qundef) { rb_ary_push(GET_ISEQ()->mark_ary, val); } - ic->ic_value = val; + ic->ic_value.value = val; ic->ic_vmstat = GET_VM_STATE_VERSION() - ruby_vm_const_missing_count; ruby_vm_const_missing_count = 0; } @@ -112,9 +112,11 @@ typedef struct rb_compile_option_struct { struct iseq_inline_cache_entry { long ic_vmstat; VALUE ic_class; - VALUE ic_value; - rb_method_entry_t *ic_method; -#define ic_index ic_vmstat + union { + VALUE value; + rb_method_entry_t *method; + long index; + } ic_value; }; #if 1 diff --git a/vm_insnhelper.c b/vm_insnhelper.c index b00b2464dd..3020756d6c 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1196,7 +1196,7 @@ vm_getivar(VALUE obj, ID id, IC ic) VALUE klass = RBASIC(obj)->klass; if (ic->ic_class == klass) { - long index = ic->ic_index; + long index = ic->ic_value.index; long len = ROBJECT_NUMIV(obj); VALUE *ptr = ROBJECT_IVPTR(obj); @@ -1216,7 +1216,7 @@ vm_getivar(VALUE obj, ID id, IC ic) val = ptr[index]; } ic->ic_class = klass; - ic->ic_index = index; + ic->ic_value.index = index; } } } @@ -1250,7 +1250,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, IC ic) st_data_t index; if (ic->ic_class == klass) { - long index = ic->ic_index; + long index = ic->ic_value.index; long len = ROBJECT_NUMIV(obj); VALUE *ptr = ROBJECT_IVPTR(obj); @@ -1264,7 +1264,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, IC ic) if (iv_index_tbl && st_lookup(iv_index_tbl, (st_data_t)id, &index)) { ic->ic_class = klass; - ic->ic_index = index; + ic->ic_value.index = index; } /* fall through */ } @@ -1282,12 +1282,12 @@ vm_method_search(VALUE id, VALUE klass, IC ic) #if OPT_INLINE_METHOD_CACHE if (LIKELY(klass == ic->ic_class) && LIKELY(GET_VM_STATE_VERSION() == ic->ic_vmstat)) { - me = ic->ic_method; + me = ic->ic_value.method; } else { me = rb_method_entry(klass, id); ic->ic_class = klass; - ic->ic_method = me; + ic->ic_value.method = me; ic->ic_vmstat = GET_VM_STATE_VERSION(); } #else |