summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-09 05:33:54 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-09 05:33:54 +0000
commit7ea3edc409dc6d383df9bc10d0034a6ecddb84dc (patch)
treecafccae4237491cdb82afeaa1e07dbe330907fab /vm_insnhelper.c
parent4be0c562a4b3e1bc6f185cf8fbd636b9e8ebb7f4 (diff)
* vm_core.h (rb_call_info_t): add new type `rb_call_inf_t'.
This data structure contains information including inline method cache. After that, `struct iseq_inline_cache_entry' does not need to contain inline cache for method invocation. Other information will be added to this data structure. * vm_core.h (rb_iseq_t): add `callinfo_entries' and `callinfo_size' members to `rb_iseq_t'. * insns.def, compile.c: Use CALL_INFO instead of IC. * tool/instruction.rb: support CALL_INFO as operand type. * vm_insnhelper.c, vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 34de8e430f..06cc85934a 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1430,25 +1430,27 @@ vm_setivar(VALUE obj, ID id, VALUE val, IC ic)
}
static inline const rb_method_entry_t *
-vm_method_search(VALUE id, VALUE klass, IC ic, VALUE *defined_class_ptr)
+vm_method_search(VALUE id, VALUE klass, CALL_INFO ci, VALUE *defined_class_ptr)
{
rb_method_entry_t *me;
#if OPT_INLINE_METHOD_CACHE
- if (LIKELY(klass == ic->ic_class &&
- GET_VM_STATE_VERSION() == ic->ic_vmstat)) {
- me = ic->ic_value.method;
- if (defined_class_ptr)
- *defined_class_ptr = ic->ic_value2.defined_class;
+ if (LIKELY(klass == ci->ic_class &&
+ GET_VM_STATE_VERSION() == ci->ic_vmstat)) {
+ me = ci->method;
+ if (defined_class_ptr) {
+ *defined_class_ptr = ci->defined_class;
+ }
}
else {
VALUE defined_class;
me = rb_method_entry(klass, id, &defined_class);
- if (defined_class_ptr)
+ if (defined_class_ptr) {
*defined_class_ptr = defined_class;
- ic->ic_class = klass;
- ic->ic_value.method = me;
- ic->ic_value2.defined_class = defined_class;
- ic->ic_vmstat = GET_VM_STATE_VERSION();
+ }
+ ci->ic_class = klass;
+ ci->method = me;
+ ci->defined_class = defined_class;
+ ci->ic_vmstat = GET_VM_STATE_VERSION();
}
#else
me = rb_method_entry(klass, id, defined_class_ptr);
@@ -1773,7 +1775,7 @@ static
inline
#endif
VALUE
-opt_eq_func(VALUE recv, VALUE obj, IC ic)
+opt_eq_func(VALUE recv, VALUE obj, CALL_INFO ci)
{
if (FIXNUM_2_P(recv, obj) &&
BASIC_OP_UNREDEFINED_P(BOP_EQ, FIXNUM_REDEFINED_OP_FLAG)) {
@@ -1803,7 +1805,7 @@ opt_eq_func(VALUE recv, VALUE obj, IC ic)
}
{
- const rb_method_entry_t *me = vm_method_search(idEq, CLASS_OF(recv), ic, 0);
+ const rb_method_entry_t *me = vm_method_search(idEq, CLASS_OF(recv), ci, 0);
if (check_cfunc(me, rb_obj_equal)) {
return recv == obj ? Qtrue : Qfalse;