summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-09 03:46:48 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-09 03:46:48 +0000
commit1546fb6c005389b391bd1db54135357331a52f77 (patch)
tree460a2c88082b49562d3b0ab455fa6e1db99043c6
parent8b0771b0142dffb45dd0d7fc18f6c2868eeb2b3b (diff)
downloadruby-1546fb6c005389b391bd1db54135357331a52f77.tar.gz
* insns.def: unify ic_constant_serial and ic_class_serial into one field
ic_serial. This is possible because these fields are only ever used exclusively with each other. * insns.def: ditto * vm_core.h: ditto * vm_insnhelper.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--insns.def4
-rw-r--r--vm_core.h3
-rw-r--r--vm_insnhelper.c8
4 files changed, 17 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 523a8dc0dd..8c55c0355c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Sat Nov 9 12:45:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * insns.def: unify ic_constant_serial and ic_class_serial into one field
+ ic_serial. This is possible because these fields are only ever used
+ exclusively with each other.
+
+ * insns.def: ditto
+ * vm_core.h: ditto
+ * vm_insnhelper.c: ditto
+
Sat Nov 9 12:31:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
* class.c: unify names of vm state version counters to 'serial'.
diff --git a/insns.def b/insns.def
index 402371e288..6075d98db2 100644
--- a/insns.def
+++ b/insns.def
@@ -1183,7 +1183,7 @@ getinlinecache
()
(VALUE val)
{
- if (ic->ic_constant_serial == GET_CONSTANT_SERIAL()) {
+ if (ic->ic_serial == GET_CONSTANT_SERIAL()) {
val = ic->ic_value.value;
JUMP(dst);
}
@@ -1208,7 +1208,7 @@ setinlinecache
rb_iseq_add_mark_object(GET_ISEQ(), val);
}
ic->ic_value.value = val;
- ic->ic_constant_serial = GET_CONSTANT_SERIAL() - ruby_vm_const_missing_count;
+ ic->ic_serial = GET_CONSTANT_SERIAL() - ruby_vm_const_missing_count;
ruby_vm_const_missing_count = 0;
}
diff --git a/vm_core.h b/vm_core.h
index 4bb5cc2976..44f871dd6f 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -131,8 +131,7 @@ typedef struct rb_compile_option_struct rb_compile_option_t;
struct iseq_inline_cache_entry {
- rb_serial_t ic_constant_serial;
- rb_serial_t ic_class_serial;
+ rb_serial_t ic_serial;
union {
size_t index;
VALUE value;
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 20f7af896d..9844d47689 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_serial == RCLASS_EXT(klass)->class_serial) ||
+ if (LIKELY((!is_attr && ic->ic_serial == RCLASS_EXT(klass)->class_serial) ||
(is_attr && ci->aux.index > 0))) {
long index = !is_attr ? (long)ic->ic_value.index : ci->aux.index - 1;
long len = ROBJECT_NUMIV(obj);
@@ -533,7 +533,7 @@ vm_getivar(VALUE obj, ID id, IC ic, rb_call_info_t *ci, int is_attr)
}
if (!is_attr) {
ic->ic_value.index = index;
- ic->ic_class_serial = RCLASS_EXT(klass)->class_serial;
+ ic->ic_serial = RCLASS_EXT(klass)->class_serial;
}
else { /* call_info */
ci->aux.index = index + 1;
@@ -565,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_serial == RCLASS_EXT(klass)->class_serial) ||
+ (!is_attr && ic->ic_serial == RCLASS_EXT(klass)->class_serial) ||
(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,7 +582,7 @@ 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_value.index = index;
- ic->ic_class_serial = RCLASS_EXT(klass)->class_serial;
+ ic->ic_serial = RCLASS_EXT(klass)->class_serial;
}
else {
ci->aux.index = index + 1;