summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-05 01:44:36 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-05 01:44:36 +0000
commited0e42c30b379c0833980f186071d89c7bb7618c (patch)
tree75a63729ff4057f7e059bb14c6680201029bfbcd
parentb1b395911cd1676a99089d463764dc52d893004d (diff)
* 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
-rw-r--r--ChangeLog7
-rw-r--r--vm_insnhelper.c10
2 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 8714b62aca6..ea2f9e653ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Sep 5 10:41:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_getivar): use class sequence to check class
+ identity, instead of pointer + vm state
+
+ * vm_insnhelper.c (vm_setivar): ditto
+
Thu Sep 5 08:20:58 2013 Tanaka Akira <akr@fsij.org>
* bignum.c (GMP_DIV_DIGITS): New macro.
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index ed4fe213bf4..545b45e0347 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;