1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
ko1 2009-09-12 17:16:27 +00:00
parent 6bbed0e31b
commit 6f817b6dd2
4 changed files with 25 additions and 14 deletions

View file

@ -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.

View file

@ -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;
}

View file

@ -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

View file

@ -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