2cd9f50073ffacdf703e6d9bccac65b6d1151029
[ruby.git] / internal / basic_operators.h
blob2cd9f50073ffacdf703e6d9bccac65b6d1151029
1 #ifndef INTERNAL_BOP_H /*-*-C-*-vi:se ft=c:*/
2 #define INTERNAL_BOP_H
4 #include "internal.h"
5 #include "ruby/internal/dllexport.h"
7 enum ruby_basic_operators {
8 BOP_PLUS,
9 BOP_MINUS,
10 BOP_MULT,
11 BOP_DIV,
12 BOP_MOD,
13 BOP_EQ,
14 BOP_EQQ,
15 BOP_LT,
16 BOP_LE,
17 BOP_LTLT,
18 BOP_AREF,
19 BOP_ASET,
20 BOP_LENGTH,
21 BOP_SIZE,
22 BOP_EMPTY_P,
23 BOP_NIL_P,
24 BOP_SUCC,
25 BOP_GT,
26 BOP_GE,
27 BOP_NOT,
28 BOP_NEQ,
29 BOP_MATCH,
30 BOP_FREEZE,
31 BOP_UMINUS,
32 BOP_MAX,
33 BOP_MIN,
34 BOP_CALL,
35 BOP_AND,
36 BOP_OR,
37 BOP_CMP,
38 BOP_DEFAULT,
40 BOP_LAST_
43 MJIT_SYMBOL_EXPORT_BEGIN
44 RUBY_EXTERN short ruby_vm_redefined_flag[BOP_LAST_];
45 MJIT_SYMBOL_EXPORT_END
47 /* optimize insn */
48 #define INTEGER_REDEFINED_OP_FLAG (1 << 0)
49 #define FLOAT_REDEFINED_OP_FLAG (1 << 1)
50 #define STRING_REDEFINED_OP_FLAG (1 << 2)
51 #define ARRAY_REDEFINED_OP_FLAG (1 << 3)
52 #define HASH_REDEFINED_OP_FLAG (1 << 4)
53 /* #define BIGNUM_REDEFINED_OP_FLAG (1 << 5) */
54 #define SYMBOL_REDEFINED_OP_FLAG (1 << 6)
55 #define TIME_REDEFINED_OP_FLAG (1 << 7)
56 #define REGEXP_REDEFINED_OP_FLAG (1 << 8)
57 #define NIL_REDEFINED_OP_FLAG (1 << 9)
58 #define TRUE_REDEFINED_OP_FLAG (1 << 10)
59 #define FALSE_REDEFINED_OP_FLAG (1 << 11)
60 #define PROC_REDEFINED_OP_FLAG (1 << 12)
62 #define BASIC_OP_UNREDEFINED_P(op, klass) (LIKELY((ruby_vm_redefined_flag[(op)]&(klass)) == 0))
64 #endif