diff options
author | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-05 01:44:36 +0000 |
---|---|---|
committer | charliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-05 01:44:36 +0000 |
commit | ed0e42c30b379c0833980f186071d89c7bb7618c (patch) | |
tree | 75a63729ff4057f7e059bb14c6680201029bfbcd /vm_insnhelper.c | |
parent | b1b395911cd1676a99089d463764dc52d893004d (diff) | |
download | ruby-ed0e42c30b379c0833980f186071d89c7bb7618c.tar.gz |
* vm_insnhelper.c (vm_getivar): use class sequence to check class
identity, instead of pointer + vm state
* vm_insnhelper.c (vm_setivar): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index ed4fe213bf..545b45e034 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -510,7 +510,7 @@ vm_getivar(VALUE obj, ID id, IC ic, rb_call_info_t *ci, int is_attr) VALUE val = Qundef; VALUE klass = RBASIC(obj)->klass; - if (LIKELY((!is_attr && (ic->ic_class == klass && ic->ic_vmstat == GET_VM_STATE_VERSION())) || + if (LIKELY((!is_attr && ic->ic_seq == RCLASS_EXT(klass)->seq) || (is_attr && ci->aux.index > 0))) { long index = !is_attr ? (long)ic->ic_value.index : ci->aux.index - 1; long len = ROBJECT_NUMIV(obj); @@ -532,9 +532,8 @@ vm_getivar(VALUE obj, ID id, IC ic, rb_call_info_t *ci, int is_attr) val = ptr[index]; } if (!is_attr) { - ic->ic_class = klass; ic->ic_value.index = index; - ic->ic_vmstat = GET_VM_STATE_VERSION(); + ic->ic_seq = RCLASS_EXT(klass)->seq; } else { /* call_info */ ci->aux.index = index + 1; @@ -566,7 +565,7 @@ vm_setivar(VALUE obj, ID id, VALUE val, IC ic, rb_call_info_t *ci, int is_attr) st_data_t index; if (LIKELY( - (!is_attr && ic->ic_class == klass && ic->ic_vmstat == GET_VM_STATE_VERSION()) || + (!is_attr && ic->ic_seq == RCLASS_EXT(klass)->seq) || (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,9 +581,8 @@ vm_setivar(VALUE obj, ID id, VALUE val, IC ic, rb_call_info_t *ci, int is_attr) if (iv_index_tbl && st_lookup(iv_index_tbl, (st_data_t)id, &index)) { if (!is_attr) { - ic->ic_class = klass; ic->ic_value.index = index; - ic->ic_vmstat = GET_VM_STATE_VERSION(); + ic->ic_seq = RCLASS_EXT(klass)->seq; } else { ci->aux.index = index + 1; |