1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
ko1 2009-09-06 20:42:50 +00:00
parent cea5aeb795
commit b82db5251c
4 changed files with 45 additions and 23 deletions

View file

@ -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, vm_method_search(id, klass, ic), recv); \
} while (0)
#else
#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); \
} while (0)
#define CALL_SIMPLE_METHOD_IC(num, id, recv, ic) do { \
VALUE klass = CLASS_OF(recv); \
CALL_METHOD(num, 0, 0, id, vm_method_search(id, klass, ic), recv); \
} while (0)
#endif
#endif /* RUBY_INSNHELPER_H */