Ruby 4.0.0dev (2025-12-06 revision 0346206d3eab2a8e659be0dd52aea6fc7b0ebb06)
basic_operators.h
1#ifndef INTERNAL_BOP_H /*-*-C-*-vi:se ft=c:*/
2#define INTERNAL_BOP_H
3
4#include "internal.h"
6
7enum 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_GTGT,
28 BOP_NOT,
29 BOP_NEQ,
30 BOP_MATCH,
31 BOP_FREEZE,
32 BOP_UMINUS,
33 BOP_MAX,
34 BOP_MIN,
35 BOP_HASH,
36 BOP_CALL,
37 BOP_AND,
38 BOP_OR,
39 BOP_CMP,
40 BOP_DEFAULT,
41 BOP_PACK,
42 BOP_INCLUDE_P,
43
44 BOP_LAST_
45};
46
47RUBY_EXTERN short ruby_vm_redefined_flag[BOP_LAST_];
48
49/* optimize insn */
50#define INTEGER_REDEFINED_OP_FLAG (1 << 0)
51#define FLOAT_REDEFINED_OP_FLAG (1 << 1)
52#define STRING_REDEFINED_OP_FLAG (1 << 2)
53#define ARRAY_REDEFINED_OP_FLAG (1 << 3)
54#define HASH_REDEFINED_OP_FLAG (1 << 4)
55/* #define BIGNUM_REDEFINED_OP_FLAG (1 << 5) */
56#define SYMBOL_REDEFINED_OP_FLAG (1 << 6)
57#define TIME_REDEFINED_OP_FLAG (1 << 7)
58#define REGEXP_REDEFINED_OP_FLAG (1 << 8)
59#define NIL_REDEFINED_OP_FLAG (1 << 9)
60#define TRUE_REDEFINED_OP_FLAG (1 << 10)
61#define FALSE_REDEFINED_OP_FLAG (1 << 11)
62#define PROC_REDEFINED_OP_FLAG (1 << 12)
63
64#define BASIC_OP_UNREDEFINED_P(op, klass) (LIKELY((ruby_vm_redefined_flag[(op)]&(klass)) == 0))
65
66#endif
Tweaking visibility of C variables/functions.
#define RUBY_EXTERN
Declaration of externally visible global variables.
Definition dllexport.h:45