summaryrefslogtreecommitdiff
path: root/vm_insnhelper.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-06 20:42:50 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-06 20:42:50 +0000
commitb82db5251c2c39f8a10cd21b595cc1cad8155cdc (patch)
tree9a3e5a4bac2efb8080b4649661b874a007c45cdf /vm_insnhelper.h
parentcea5aeb795149cead9a9cb151a4754c6ce185d13 (diff)
* insns.def (opt_*): add IC operands.
* vm_insnhelper.h (CALL_SIMPLE_METHOD): add a version which use an inline cache. USE_IC_FOR_SPECIALIZED_METHOD macro switchs the behaviour. This change also removes CALL_SIMPLE_METHOD_IC() macro. * tool/instruction.rb: fix elimination process to ignore variable "ic". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r--vm_insnhelper.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index d4dd5aec4d..79eb8856ff 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -184,14 +184,24 @@ extern VALUE ruby_vm_const_missing_count;
#define BASIC_OP_UNREDEFINED_P(op) (LIKELY(ruby_vm_redefined_flag[op] == 0))
#define HEAP_CLASS_OF(obj) RBASIC(obj)->klass
+#ifndef USE_IC_FOR_SPECIALIZED_METHOD
+#define USE_IC_FOR_SPECIALIZED_METHOD 1
+#endif
+
+#if USE_IC_FOR_SPECIALIZED_METHOD
+
#define CALL_SIMPLE_METHOD(num, id, recv) do { \
VALUE klass = CLASS_OF(recv); \
- CALL_METHOD(num, 0, 0, id, rb_method_entry(klass, id), recv); \
+ CALL_METHOD(num, 0, 0, id, vm_method_search(id, klass, ic), recv); \
} while (0)
-#define CALL_SIMPLE_METHOD_IC(num, id, recv, ic) do { \
+#else
+
+#define CALL_SIMPLE_METHOD(num, id, recv) do { \
VALUE klass = CLASS_OF(recv); \
- CALL_METHOD(num, 0, 0, id, vm_method_search(id, klass, ic), recv); \
+ CALL_METHOD(num, 0, 0, id, rb_method_entry(klass, id), recv); \
} while (0)
+#endif
+
#endif /* RUBY_INSNHELPER_H */