Ruby: internal/basic_operators.h Source File

Ruby 3.4.4p34 (2025-05-14 revision a38531fd3f617bf734ef7d6c595325f69985ea1d)

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