Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
* vm_insnhelper.c (vm_search_method): no need to check klass == ci->k…
lass

  in method cache guard - class sequence number has the same uniqueness
  guarantees

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
Charlie Somerville committed Oct 23, 2013
commit 866edf4506c714d5f865d1529f74cf92cf050202
10 changes: 4 additions & 6 deletions vm_insnhelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,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 ? ic->ic_value.index : ci->aux.index - 1;
long len = ROBJECT_NUMIV(obj);
Expand All @@ -526,9 +526,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;
Expand Down Expand Up @@ -564,7 +563,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 ? ic->ic_value.index : ci->aux.index-1;
long len = ROBJECT_NUMIV(obj);
Expand All @@ -580,9 +579,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;
Expand Down