summaryrefslogtreecommitdiffstats
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
commitec547571bb2375bdd8f835a40214d8f30402e5ff (patch)
tree9a3e5a4bac2efb8080b4649661b874a007c45cdf /vm_insnhelper.h
parent470a0f2b85576e61c268b7ab3e3ce8dc90633666 (diff)
downloadruby-ec547571bb2375bdd8f835a40214d8f30402e5ff.tar.gz
ruby-ec547571bb2375bdd8f835a40214d8f30402e5ff.tar.xz
ruby-ec547571bb2375bdd8f835a40214d8f30402e5ff.zip
* 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: http://svn.ruby-lang.org/repos/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 d4dd5aec4..79eb8856f 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 */