summaryrefslogtreecommitdiff
path: root/vm_insnhelper.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-24 22:02:03 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-24 22:02:03 +0000
commitbeb26e1b491f8d9fd20a2d944f036100cd1abac3 (patch)
tree55827b3594aa69f0c294e464598685630b161b78 /vm_insnhelper.h
parent72107daf0e9b35d28ae75c728134b64d2383cb65 (diff)
* vm_insnhelper.h, vm_insnhelper.c, vm.c, vm_method.c, insns.def:
Manage a redefinition of special methods for each classes. A patch from Joel Gouly <joel.gouly@gmail.com>. Thanks! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r--vm_insnhelper.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 1b35293..018adb6 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -184,8 +184,17 @@ extern VALUE ruby_vm_const_missing_count;
/**********************************************************/
/* optimize insn */
+#define FIXNUM_REDEFINED_OP_FLAG (1 << 0)
+#define FLOAT_REDEFINED_OP_FLAG (1 << 1)
+#define STRING_REDEFINED_OP_FLAG (1 << 2)
+#define ARRAY_REDEFINED_OP_FLAG (1 << 3)
+#define HASH_REDEFINED_OP_FLAG (1 << 4)
+#define BIGNUM_REDEFINED_OP_FLAG (1 << 5)
+#define SYMBOL_REDEFINED_OP_FLAG (1 << 6)
+#define TIME_REDEFINED_OP_FLAG (1 << 7)
+
#define FIXNUM_2_P(a, b) ((a) & (b) & 1)
-#define BASIC_OP_UNREDEFINED_P(op) (LIKELY(ruby_vm_redefined_flag[(op)] == 0))
+#define BASIC_OP_UNREDEFINED_P(op, klass) (LIKELY((ruby_vm_redefined_flag[(op)]&(klass)) == 0))
#define HEAP_CLASS_OF(obj) RBASIC(obj)->klass
#ifndef USE_IC_FOR_SPECIALIZED_METHOD