datadog-ruby_core_source 3.5.4 → 3.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/datadog-ruby_core_source.gemspec +1 -1
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ccan/build_assert/build_assert.h +40 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ccan/check_type/check_type.h +63 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ccan/container_of/container_of.h +142 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ccan/list/list.h +788 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ccan/str/str.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/id.h +252 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/internal.h +2465 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/iseq.h +304 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/method.h +229 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/node.h +449 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ruby_assert.h +60 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/ruby_atomic.h +244 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/thread_pthread.h +75 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/thread_win32.h +36 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/vm_core.h +1902 -0
- data/lib/datadog/ruby_core_source/ruby-2.6.0-p0/vm_opts.h +70 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ccan/build_assert/build_assert.h +40 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ccan/check_type/check_type.h +63 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ccan/container_of/container_of.h +142 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ccan/list/list.h +788 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ccan/str/str.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/id.h +290 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/internal.h +2697 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/iseq.h +312 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/method.h +229 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/node.h +476 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ruby_assert.h +15 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/ruby_atomic.h +244 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/thread_pthread.h +75 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/thread_win32.h +36 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/vm_core.h +1968 -0
- data/lib/datadog/ruby_core_source/ruby-2.7.0-p0/vm_opts.h +72 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ccan/build_assert/build_assert.h +40 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ccan/check_type/check_type.h +63 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ccan/container_of/container_of.h +142 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ccan/list/list.h +788 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ccan/str/str.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/id.h +290 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/id_table.h +36 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/array.h +119 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/class.h +174 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/compilers.h +108 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/gc.h +161 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/imemo.h +243 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/serial.h +24 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/static_assert.h +17 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/vm.h +136 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal/warnings.h +17 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/internal.h +107 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/iseq.h +305 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/method.h +245 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/node.h +484 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ractor_core.h +343 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ruby_assert.h +15 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/ruby_atomic.h +23 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/thread_pthread.h +115 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/thread_win32.h +61 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/vm_core.h +2023 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/vm_debug.h +116 -0
- data/lib/datadog/ruby_core_source/ruby-3.0.0-p0/vm_opts.h +73 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ccan/build_assert/build_assert.h +40 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ccan/check_type/check_type.h +63 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ccan/container_of/container_of.h +142 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ccan/list/list.h +788 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ccan/str/str.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/darray.h +198 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/id.h +293 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/id_table.h +36 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/array.h +113 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/class.h +196 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/compilers.h +107 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/gc.h +186 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/imemo.h +243 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/serial.h +23 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/static_assert.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/vm.h +133 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal/warnings.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/internal.h +109 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/iseq.h +322 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/method.h +253 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/node.h +510 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ractor_core.h +346 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ruby_assert.h +14 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/ruby_atomic.h +23 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/thread_pthread.h +115 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/vm_core.h +2107 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/vm_debug.h +124 -0
- data/lib/datadog/ruby_core_source/ruby-3.1.0-p0/vm_opts.h +73 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ccan/build_assert/build_assert.h +40 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ccan/check_type/check_type.h +63 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ccan/container_of/container_of.h +142 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ccan/list/list.h +789 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ccan/str/str.h +17 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/id.h +299 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/id_table.h +39 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/array.h +163 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/basic_operators.h +64 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/class.h +182 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/compilers.h +107 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/gc.h +192 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/imemo.h +242 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/serial.h +23 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/static_assert.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/vm.h +134 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal/warnings.h +16 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/internal.h +113 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/iseq.h +329 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/method.h +254 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/node.h +514 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ractor_core.h +342 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ruby_assert.h +14 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/ruby_atomic.h +23 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/shape.h +232 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/thread_none.h +20 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/thread_pthread.h +133 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/vm_core.h +2106 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/vm_debug.h +122 -0
- data/lib/datadog/ruby_core_source/ruby-3.2.0-p0/vm_opts.h +73 -0
- data/lib/datadog/ruby_core_source/version.rb +1 -1
- metadata +122 -4
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
|
|
2
|
+
#ifndef CCAN_STR_H
|
|
3
|
+
#define CCAN_STR_H
|
|
4
|
+
/**
|
|
5
|
+
* stringify - Turn expression into a string literal
|
|
6
|
+
* @expr: any C expression
|
|
7
|
+
*
|
|
8
|
+
* Example:
|
|
9
|
+
* #define PRINT_COND_IF_FALSE(cond) \
|
|
10
|
+
* ((cond) || printf("%s is false!", stringify(cond)))
|
|
11
|
+
*/
|
|
12
|
+
#define stringify(expr) stringify_1(expr)
|
|
13
|
+
/* Double-indirection required to stringify expansions */
|
|
14
|
+
#define stringify_1(expr) #expr
|
|
15
|
+
|
|
16
|
+
#endif /* CCAN_STR_H */
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/* DO NOT EDIT THIS FILE DIRECTLY */
|
|
2
|
+
/**********************************************************************
|
|
3
|
+
|
|
4
|
+
id.h -
|
|
5
|
+
|
|
6
|
+
$Author$
|
|
7
|
+
created at: Sun Oct 19 21:12:51 2008
|
|
8
|
+
|
|
9
|
+
Copyright (C) 2007 Koichi Sasada
|
|
10
|
+
|
|
11
|
+
**********************************************************************/
|
|
12
|
+
|
|
13
|
+
#ifndef RUBY_ID_H
|
|
14
|
+
#define RUBY_ID_H
|
|
15
|
+
|
|
16
|
+
enum ruby_id_types {
|
|
17
|
+
RUBY_ID_STATIC_SYM = 0x01,
|
|
18
|
+
RUBY_ID_LOCAL = 0x00,
|
|
19
|
+
RUBY_ID_INSTANCE = (0x01<<1),
|
|
20
|
+
RUBY_ID_GLOBAL = (0x03<<1),
|
|
21
|
+
RUBY_ID_ATTRSET = (0x04<<1),
|
|
22
|
+
RUBY_ID_CONST = (0x05<<1),
|
|
23
|
+
RUBY_ID_CLASS = (0x06<<1),
|
|
24
|
+
RUBY_ID_JUNK = (0x07<<1),
|
|
25
|
+
RUBY_ID_INTERNAL = RUBY_ID_JUNK,
|
|
26
|
+
RUBY_ID_SCOPE_SHIFT = 4,
|
|
27
|
+
RUBY_ID_SCOPE_MASK = (~(~0U<<(RUBY_ID_SCOPE_SHIFT-1))<<1)
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
#define ID_STATIC_SYM RUBY_ID_STATIC_SYM
|
|
31
|
+
#define ID_SCOPE_SHIFT RUBY_ID_SCOPE_SHIFT
|
|
32
|
+
#define ID_SCOPE_MASK RUBY_ID_SCOPE_MASK
|
|
33
|
+
#define ID_LOCAL RUBY_ID_LOCAL
|
|
34
|
+
#define ID_INSTANCE RUBY_ID_INSTANCE
|
|
35
|
+
#define ID_GLOBAL RUBY_ID_GLOBAL
|
|
36
|
+
#define ID_ATTRSET RUBY_ID_ATTRSET
|
|
37
|
+
#define ID_CONST RUBY_ID_CONST
|
|
38
|
+
#define ID_CLASS RUBY_ID_CLASS
|
|
39
|
+
#define ID_JUNK RUBY_ID_JUNK
|
|
40
|
+
#define ID_INTERNAL RUBY_ID_INTERNAL
|
|
41
|
+
|
|
42
|
+
#define symIFUNC ID2SYM(idIFUNC)
|
|
43
|
+
#define symCFUNC ID2SYM(idCFUNC)
|
|
44
|
+
|
|
45
|
+
#define RUBY_TOKEN_DOT2 128
|
|
46
|
+
#define RUBY_TOKEN_DOT3 129
|
|
47
|
+
#define RUBY_TOKEN_BDOT2 130
|
|
48
|
+
#define RUBY_TOKEN_BDOT3 131
|
|
49
|
+
#define RUBY_TOKEN_UPLUS 132
|
|
50
|
+
#define RUBY_TOKEN_UMINUS 133
|
|
51
|
+
#define RUBY_TOKEN_POW 134
|
|
52
|
+
#define RUBY_TOKEN_CMP 135
|
|
53
|
+
#define RUBY_TOKEN_LSHFT 136
|
|
54
|
+
#define RUBY_TOKEN_RSHFT 137
|
|
55
|
+
#define RUBY_TOKEN_LEQ 138
|
|
56
|
+
#define RUBY_TOKEN_GEQ 139
|
|
57
|
+
#define RUBY_TOKEN_EQ 140
|
|
58
|
+
#define RUBY_TOKEN_EQQ 141
|
|
59
|
+
#define RUBY_TOKEN_NEQ 142
|
|
60
|
+
#define RUBY_TOKEN_MATCH 143
|
|
61
|
+
#define RUBY_TOKEN_NMATCH 144
|
|
62
|
+
#define RUBY_TOKEN_AREF 145
|
|
63
|
+
#define RUBY_TOKEN_ASET 146
|
|
64
|
+
#define RUBY_TOKEN_COLON2 147
|
|
65
|
+
#define RUBY_TOKEN_ANDOP 148
|
|
66
|
+
#define RUBY_TOKEN_OROP 149
|
|
67
|
+
#define RUBY_TOKEN_ANDDOT 150
|
|
68
|
+
#define RUBY_TOKEN(t) RUBY_TOKEN_##t
|
|
69
|
+
|
|
70
|
+
#define RUBY_TOKEN2ID_TYPE(tok, type) ((tok<<RUBY_ID_SCOPE_SHIFT)|type|RUBY_ID_STATIC_SYM)
|
|
71
|
+
#define TOKEN2LOCALID(tok) RUBY_TOKEN2ID_TYPE(tok, RUBY_ID_LOCAL)
|
|
72
|
+
#define TOKEN2INSTANCEID(tok) RUBY_TOKEN2ID_TYPE(tok, RUBY_ID_INSTANCE)
|
|
73
|
+
#define TOKEN2GLOBALID(tok) RUBY_TOKEN2ID_TYPE(tok, RUBY_ID_GLOBAL)
|
|
74
|
+
#define TOKEN2CONSTID(tok) RUBY_TOKEN2ID_TYPE(tok, RUBY_ID_CONST)
|
|
75
|
+
#define TOKEN2CLASSID(tok) RUBY_TOKEN2ID_TYPE(tok, RUBY_ID_CLASS)
|
|
76
|
+
#define TOKEN2ATTRSETID(tok) RUBY_TOKEN2ID_TYPE(tok, RUBY_ID_ATTRSET)
|
|
77
|
+
|
|
78
|
+
enum ruby_method_ids {
|
|
79
|
+
idDot2 = RUBY_TOKEN(DOT2),
|
|
80
|
+
idDot3 = RUBY_TOKEN(DOT3),
|
|
81
|
+
idUPlus = RUBY_TOKEN(UPLUS),
|
|
82
|
+
idUMinus = RUBY_TOKEN(UMINUS),
|
|
83
|
+
idPow = RUBY_TOKEN(POW),
|
|
84
|
+
idCmp = RUBY_TOKEN(CMP),
|
|
85
|
+
idPLUS = '+',
|
|
86
|
+
idMINUS = '-',
|
|
87
|
+
idMULT = '*',
|
|
88
|
+
idDIV = '/',
|
|
89
|
+
idMOD = '%',
|
|
90
|
+
idLTLT = RUBY_TOKEN(LSHFT),
|
|
91
|
+
idGTGT = RUBY_TOKEN(RSHFT),
|
|
92
|
+
idLT = '<',
|
|
93
|
+
idLE = RUBY_TOKEN(LEQ),
|
|
94
|
+
idGT = '>',
|
|
95
|
+
idGE = RUBY_TOKEN(GEQ),
|
|
96
|
+
idEq = RUBY_TOKEN(EQ),
|
|
97
|
+
idEqq = RUBY_TOKEN(EQQ),
|
|
98
|
+
idNeq = RUBY_TOKEN(NEQ),
|
|
99
|
+
idNot = '!',
|
|
100
|
+
idAnd = '&',
|
|
101
|
+
idOr = '|',
|
|
102
|
+
idBackquote = '`',
|
|
103
|
+
idEqTilde = RUBY_TOKEN(MATCH),
|
|
104
|
+
idNeqTilde = RUBY_TOKEN(NMATCH),
|
|
105
|
+
idAREF = RUBY_TOKEN(AREF),
|
|
106
|
+
idASET = RUBY_TOKEN(ASET),
|
|
107
|
+
idCOLON2 = RUBY_TOKEN(COLON2),
|
|
108
|
+
idANDOP = RUBY_TOKEN(ANDOP),
|
|
109
|
+
idOROP = RUBY_TOKEN(OROP),
|
|
110
|
+
idANDDOT = RUBY_TOKEN(ANDDOT),
|
|
111
|
+
tPRESERVED_ID_BEGIN = 150,
|
|
112
|
+
idNilP,
|
|
113
|
+
idNULL,
|
|
114
|
+
idEmptyP,
|
|
115
|
+
idEqlP,
|
|
116
|
+
idRespond_to,
|
|
117
|
+
idRespond_to_missing,
|
|
118
|
+
idIFUNC,
|
|
119
|
+
idCFUNC,
|
|
120
|
+
id_core_set_method_alias,
|
|
121
|
+
id_core_set_variable_alias,
|
|
122
|
+
id_core_undef_method,
|
|
123
|
+
id_core_define_method,
|
|
124
|
+
id_core_define_singleton_method,
|
|
125
|
+
id_core_set_postexe,
|
|
126
|
+
id_core_hash_merge_ptr,
|
|
127
|
+
id_core_hash_merge_kwd,
|
|
128
|
+
id_core_raise,
|
|
129
|
+
id_debug_created_info,
|
|
130
|
+
tPRESERVED_ID_END,
|
|
131
|
+
tTOKEN_LOCAL_BEGIN = tPRESERVED_ID_END-1,
|
|
132
|
+
tMax,
|
|
133
|
+
tMin,
|
|
134
|
+
tFreeze,
|
|
135
|
+
tInspect,
|
|
136
|
+
tIntern,
|
|
137
|
+
tObject_id,
|
|
138
|
+
tConst_missing,
|
|
139
|
+
tMethodMissing,
|
|
140
|
+
tMethod_added,
|
|
141
|
+
tSingleton_method_added,
|
|
142
|
+
tMethod_removed,
|
|
143
|
+
tSingleton_method_removed,
|
|
144
|
+
tMethod_undefined,
|
|
145
|
+
tSingleton_method_undefined,
|
|
146
|
+
tLength,
|
|
147
|
+
tSize,
|
|
148
|
+
tGets,
|
|
149
|
+
tSucc,
|
|
150
|
+
tEach,
|
|
151
|
+
tProc,
|
|
152
|
+
tLambda,
|
|
153
|
+
tSend,
|
|
154
|
+
t__send__,
|
|
155
|
+
t__attached__,
|
|
156
|
+
tInitialize,
|
|
157
|
+
tInitialize_copy,
|
|
158
|
+
tInitialize_clone,
|
|
159
|
+
tInitialize_dup,
|
|
160
|
+
tTo_int,
|
|
161
|
+
tTo_ary,
|
|
162
|
+
tTo_str,
|
|
163
|
+
tTo_sym,
|
|
164
|
+
tTo_hash,
|
|
165
|
+
tTo_proc,
|
|
166
|
+
tTo_io,
|
|
167
|
+
tTo_a,
|
|
168
|
+
tTo_s,
|
|
169
|
+
tTo_i,
|
|
170
|
+
tTo_f,
|
|
171
|
+
tTo_r,
|
|
172
|
+
tBt,
|
|
173
|
+
tBt_locations,
|
|
174
|
+
tCall,
|
|
175
|
+
tMesg,
|
|
176
|
+
tException,
|
|
177
|
+
tLocals,
|
|
178
|
+
tNOT,
|
|
179
|
+
tAND,
|
|
180
|
+
tOR,
|
|
181
|
+
tDiv,
|
|
182
|
+
tDivmod,
|
|
183
|
+
tFdiv,
|
|
184
|
+
tQuo,
|
|
185
|
+
tName,
|
|
186
|
+
tNil,
|
|
187
|
+
tUScore,
|
|
188
|
+
tNUMPARAM_1,
|
|
189
|
+
tNUMPARAM_2,
|
|
190
|
+
tNUMPARAM_3,
|
|
191
|
+
tNUMPARAM_4,
|
|
192
|
+
tNUMPARAM_5,
|
|
193
|
+
tNUMPARAM_6,
|
|
194
|
+
tNUMPARAM_7,
|
|
195
|
+
tNUMPARAM_8,
|
|
196
|
+
tNUMPARAM_9,
|
|
197
|
+
tTOKEN_LOCAL_END,
|
|
198
|
+
tTOKEN_INSTANCE_BEGIN = tTOKEN_LOCAL_END-1,
|
|
199
|
+
tTOKEN_INSTANCE_END,
|
|
200
|
+
tTOKEN_GLOBAL_BEGIN = tTOKEN_INSTANCE_END-1,
|
|
201
|
+
tLASTLINE,
|
|
202
|
+
tBACKREF,
|
|
203
|
+
tERROR_INFO,
|
|
204
|
+
tTOKEN_GLOBAL_END,
|
|
205
|
+
tTOKEN_CONST_BEGIN = tTOKEN_GLOBAL_END-1,
|
|
206
|
+
tTOKEN_CONST_END,
|
|
207
|
+
tTOKEN_CLASS_BEGIN = tTOKEN_CONST_END-1,
|
|
208
|
+
tTOKEN_CLASS_END,
|
|
209
|
+
tTOKEN_ATTRSET_BEGIN = tTOKEN_CLASS_END-1,
|
|
210
|
+
tTOKEN_ATTRSET_END,
|
|
211
|
+
tNEXT_ID = tTOKEN_ATTRSET_END,
|
|
212
|
+
#define DEFINE_LOCALID_FROM_TOKEN(n) id##n = TOKEN2LOCALID(t##n)
|
|
213
|
+
DEFINE_LOCALID_FROM_TOKEN(Max),
|
|
214
|
+
DEFINE_LOCALID_FROM_TOKEN(Min),
|
|
215
|
+
DEFINE_LOCALID_FROM_TOKEN(Freeze),
|
|
216
|
+
DEFINE_LOCALID_FROM_TOKEN(Inspect),
|
|
217
|
+
DEFINE_LOCALID_FROM_TOKEN(Intern),
|
|
218
|
+
DEFINE_LOCALID_FROM_TOKEN(Object_id),
|
|
219
|
+
DEFINE_LOCALID_FROM_TOKEN(Const_missing),
|
|
220
|
+
DEFINE_LOCALID_FROM_TOKEN(MethodMissing),
|
|
221
|
+
DEFINE_LOCALID_FROM_TOKEN(Method_added),
|
|
222
|
+
DEFINE_LOCALID_FROM_TOKEN(Singleton_method_added),
|
|
223
|
+
DEFINE_LOCALID_FROM_TOKEN(Method_removed),
|
|
224
|
+
DEFINE_LOCALID_FROM_TOKEN(Singleton_method_removed),
|
|
225
|
+
DEFINE_LOCALID_FROM_TOKEN(Method_undefined),
|
|
226
|
+
DEFINE_LOCALID_FROM_TOKEN(Singleton_method_undefined),
|
|
227
|
+
DEFINE_LOCALID_FROM_TOKEN(Length),
|
|
228
|
+
DEFINE_LOCALID_FROM_TOKEN(Size),
|
|
229
|
+
DEFINE_LOCALID_FROM_TOKEN(Gets),
|
|
230
|
+
DEFINE_LOCALID_FROM_TOKEN(Succ),
|
|
231
|
+
DEFINE_LOCALID_FROM_TOKEN(Each),
|
|
232
|
+
DEFINE_LOCALID_FROM_TOKEN(Proc),
|
|
233
|
+
DEFINE_LOCALID_FROM_TOKEN(Lambda),
|
|
234
|
+
DEFINE_LOCALID_FROM_TOKEN(Send),
|
|
235
|
+
DEFINE_LOCALID_FROM_TOKEN(__send__),
|
|
236
|
+
DEFINE_LOCALID_FROM_TOKEN(__attached__),
|
|
237
|
+
DEFINE_LOCALID_FROM_TOKEN(Initialize),
|
|
238
|
+
DEFINE_LOCALID_FROM_TOKEN(Initialize_copy),
|
|
239
|
+
DEFINE_LOCALID_FROM_TOKEN(Initialize_clone),
|
|
240
|
+
DEFINE_LOCALID_FROM_TOKEN(Initialize_dup),
|
|
241
|
+
DEFINE_LOCALID_FROM_TOKEN(To_int),
|
|
242
|
+
DEFINE_LOCALID_FROM_TOKEN(To_ary),
|
|
243
|
+
DEFINE_LOCALID_FROM_TOKEN(To_str),
|
|
244
|
+
DEFINE_LOCALID_FROM_TOKEN(To_sym),
|
|
245
|
+
DEFINE_LOCALID_FROM_TOKEN(To_hash),
|
|
246
|
+
DEFINE_LOCALID_FROM_TOKEN(To_proc),
|
|
247
|
+
DEFINE_LOCALID_FROM_TOKEN(To_io),
|
|
248
|
+
DEFINE_LOCALID_FROM_TOKEN(To_a),
|
|
249
|
+
DEFINE_LOCALID_FROM_TOKEN(To_s),
|
|
250
|
+
DEFINE_LOCALID_FROM_TOKEN(To_i),
|
|
251
|
+
DEFINE_LOCALID_FROM_TOKEN(To_f),
|
|
252
|
+
DEFINE_LOCALID_FROM_TOKEN(To_r),
|
|
253
|
+
DEFINE_LOCALID_FROM_TOKEN(Bt),
|
|
254
|
+
DEFINE_LOCALID_FROM_TOKEN(Bt_locations),
|
|
255
|
+
DEFINE_LOCALID_FROM_TOKEN(Call),
|
|
256
|
+
DEFINE_LOCALID_FROM_TOKEN(Mesg),
|
|
257
|
+
DEFINE_LOCALID_FROM_TOKEN(Exception),
|
|
258
|
+
DEFINE_LOCALID_FROM_TOKEN(Locals),
|
|
259
|
+
DEFINE_LOCALID_FROM_TOKEN(NOT),
|
|
260
|
+
DEFINE_LOCALID_FROM_TOKEN(AND),
|
|
261
|
+
DEFINE_LOCALID_FROM_TOKEN(OR),
|
|
262
|
+
DEFINE_LOCALID_FROM_TOKEN(Div),
|
|
263
|
+
DEFINE_LOCALID_FROM_TOKEN(Divmod),
|
|
264
|
+
DEFINE_LOCALID_FROM_TOKEN(Fdiv),
|
|
265
|
+
DEFINE_LOCALID_FROM_TOKEN(Quo),
|
|
266
|
+
DEFINE_LOCALID_FROM_TOKEN(Name),
|
|
267
|
+
DEFINE_LOCALID_FROM_TOKEN(Nil),
|
|
268
|
+
DEFINE_LOCALID_FROM_TOKEN(UScore),
|
|
269
|
+
DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_1),
|
|
270
|
+
DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_2),
|
|
271
|
+
DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_3),
|
|
272
|
+
DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_4),
|
|
273
|
+
DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_5),
|
|
274
|
+
DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_6),
|
|
275
|
+
DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_7),
|
|
276
|
+
DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_8),
|
|
277
|
+
DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_9),
|
|
278
|
+
#define DEFINE_INSTANCEID_FROM_TOKEN(n) id##n = TOKEN2INSTANCEID(t##n)
|
|
279
|
+
#define DEFINE_GLOBALID_FROM_TOKEN(n) id##n = TOKEN2GLOBALID(t##n)
|
|
280
|
+
DEFINE_GLOBALID_FROM_TOKEN(LASTLINE),
|
|
281
|
+
DEFINE_GLOBALID_FROM_TOKEN(BACKREF),
|
|
282
|
+
DEFINE_GLOBALID_FROM_TOKEN(ERROR_INFO),
|
|
283
|
+
#define DEFINE_CONSTID_FROM_TOKEN(n) id##n = TOKEN2CONSTID(t##n)
|
|
284
|
+
#define DEFINE_CLASSID_FROM_TOKEN(n) id##n = TOKEN2CLASSID(t##n)
|
|
285
|
+
#define DEFINE_ATTRSETID_FROM_TOKEN(n) id##n = TOKEN2ATTRSETID(t##n)
|
|
286
|
+
tLAST_OP_ID = tPRESERVED_ID_END-1,
|
|
287
|
+
idLAST_OP_ID = tLAST_OP_ID >> ID_SCOPE_SHIFT
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
#endif /* RUBY_ID_H */
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#ifndef RUBY_ID_TABLE_H
|
|
2
|
+
#define RUBY_ID_TABLE_H 1
|
|
3
|
+
#include "ruby/internal/config.h"
|
|
4
|
+
#include <stddef.h>
|
|
5
|
+
#include "ruby/ruby.h"
|
|
6
|
+
|
|
7
|
+
struct rb_id_table;
|
|
8
|
+
|
|
9
|
+
/* compatible with ST_* */
|
|
10
|
+
enum rb_id_table_iterator_result {
|
|
11
|
+
ID_TABLE_CONTINUE = ST_CONTINUE,
|
|
12
|
+
ID_TABLE_STOP = ST_STOP,
|
|
13
|
+
ID_TABLE_DELETE = ST_DELETE,
|
|
14
|
+
ID_TABLE_REPLACE = ST_REPLACE,
|
|
15
|
+
ID_TABLE_ITERATOR_RESULT_END
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
struct rb_id_table *rb_id_table_create(size_t size);
|
|
19
|
+
void rb_id_table_free(struct rb_id_table *tbl);
|
|
20
|
+
void rb_id_table_clear(struct rb_id_table *tbl);
|
|
21
|
+
|
|
22
|
+
size_t rb_id_table_size(const struct rb_id_table *tbl);
|
|
23
|
+
size_t rb_id_table_memsize(const struct rb_id_table *tbl);
|
|
24
|
+
|
|
25
|
+
int rb_id_table_insert(struct rb_id_table *tbl, ID id, VALUE val);
|
|
26
|
+
int rb_id_table_lookup(struct rb_id_table *tbl, ID id, VALUE *valp);
|
|
27
|
+
int rb_id_table_delete(struct rb_id_table *tbl, ID id);
|
|
28
|
+
|
|
29
|
+
typedef enum rb_id_table_iterator_result rb_id_table_update_callback_func_t(ID *id, VALUE *val, void *data, int existing);
|
|
30
|
+
typedef enum rb_id_table_iterator_result rb_id_table_foreach_func_t(ID id, VALUE val, void *data);
|
|
31
|
+
typedef enum rb_id_table_iterator_result rb_id_table_foreach_values_func_t(VALUE val, void *data);
|
|
32
|
+
void rb_id_table_foreach(struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, void *data);
|
|
33
|
+
void rb_id_table_foreach_with_replace(struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, rb_id_table_update_callback_func_t *replace, void *data);
|
|
34
|
+
void rb_id_table_foreach_values(struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data);
|
|
35
|
+
|
|
36
|
+
#endif /* RUBY_ID_TABLE_H */
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
#ifndef INTERNAL_ARRAY_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_ARRAY_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
* @brief Internal header for Array.
|
|
11
|
+
*/
|
|
12
|
+
#include "ruby/internal/config.h"
|
|
13
|
+
#include <stddef.h> /* for size_t */
|
|
14
|
+
#include "internal/static_assert.h" /* for STATIC_ASSERT */
|
|
15
|
+
#include "ruby/internal/stdbool.h" /* for bool */
|
|
16
|
+
#include "ruby/ruby.h" /* for RARRAY_LEN */
|
|
17
|
+
|
|
18
|
+
#ifndef ARRAY_DEBUG
|
|
19
|
+
# define ARRAY_DEBUG (0+RUBY_DEBUG)
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
#define RARRAY_PTR_IN_USE_FLAG FL_USER14
|
|
23
|
+
|
|
24
|
+
/* array.c */
|
|
25
|
+
VALUE rb_ary_last(int, const VALUE *, VALUE);
|
|
26
|
+
void rb_ary_set_len(VALUE, long);
|
|
27
|
+
void rb_ary_delete_same(VALUE, VALUE);
|
|
28
|
+
VALUE rb_ary_tmp_new_fill(long capa);
|
|
29
|
+
VALUE rb_ary_at(VALUE, VALUE);
|
|
30
|
+
size_t rb_ary_memsize(VALUE);
|
|
31
|
+
VALUE rb_to_array_type(VALUE obj);
|
|
32
|
+
void rb_ary_cancel_sharing(VALUE ary);
|
|
33
|
+
|
|
34
|
+
static inline VALUE rb_ary_entry_internal(VALUE ary, long offset);
|
|
35
|
+
static inline bool ARY_PTR_USING_P(VALUE ary);
|
|
36
|
+
static inline void RARY_TRANSIENT_SET(VALUE ary);
|
|
37
|
+
static inline void RARY_TRANSIENT_UNSET(VALUE ary);
|
|
38
|
+
|
|
39
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
|
40
|
+
/* array.c (export) */
|
|
41
|
+
void rb_ary_detransient(VALUE a);
|
|
42
|
+
VALUE *rb_ary_ptr_use_start(VALUE ary);
|
|
43
|
+
void rb_ary_ptr_use_end(VALUE ary);
|
|
44
|
+
RUBY_SYMBOL_EXPORT_END
|
|
45
|
+
|
|
46
|
+
MJIT_SYMBOL_EXPORT_BEGIN
|
|
47
|
+
VALUE rb_ary_tmp_new_from_values(VALUE, long, const VALUE *);
|
|
48
|
+
VALUE rb_check_to_array(VALUE ary);
|
|
49
|
+
VALUE rb_ary_behead(VALUE, long);
|
|
50
|
+
VALUE rb_ary_aref1(VALUE ary, VALUE i);
|
|
51
|
+
|
|
52
|
+
struct rb_execution_context_struct;
|
|
53
|
+
VALUE rb_ec_ary_new_from_values(struct rb_execution_context_struct *ec, long n, const VALUE *elts);
|
|
54
|
+
MJIT_SYMBOL_EXPORT_END
|
|
55
|
+
|
|
56
|
+
static inline VALUE
|
|
57
|
+
rb_ary_entry_internal(VALUE ary, long offset)
|
|
58
|
+
{
|
|
59
|
+
long len = RARRAY_LEN(ary);
|
|
60
|
+
const VALUE *ptr = RARRAY_CONST_PTR_TRANSIENT(ary);
|
|
61
|
+
if (len == 0) return Qnil;
|
|
62
|
+
if (offset < 0) {
|
|
63
|
+
offset += len;
|
|
64
|
+
if (offset < 0) return Qnil;
|
|
65
|
+
}
|
|
66
|
+
else if (len <= offset) {
|
|
67
|
+
return Qnil;
|
|
68
|
+
}
|
|
69
|
+
return ptr[offset];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static inline bool
|
|
73
|
+
ARY_PTR_USING_P(VALUE ary)
|
|
74
|
+
{
|
|
75
|
+
return FL_TEST_RAW(ary, RARRAY_PTR_IN_USE_FLAG);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
static inline void
|
|
79
|
+
RARY_TRANSIENT_SET(VALUE ary)
|
|
80
|
+
{
|
|
81
|
+
#if USE_TRANSIENT_HEAP
|
|
82
|
+
FL_SET_RAW(ary, RARRAY_TRANSIENT_FLAG);
|
|
83
|
+
#endif
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
static inline void
|
|
87
|
+
RARY_TRANSIENT_UNSET(VALUE ary)
|
|
88
|
+
{
|
|
89
|
+
#if USE_TRANSIENT_HEAP
|
|
90
|
+
FL_UNSET_RAW(ary, RARRAY_TRANSIENT_FLAG);
|
|
91
|
+
#endif
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
#undef rb_ary_new_from_args
|
|
95
|
+
#if RBIMPL_HAS_WARNING("-Wgnu-zero-variadic-macro-arguments")
|
|
96
|
+
# /* Skip it; clang -pedantic doesn't like the following */
|
|
97
|
+
#elif defined(__GNUC__) && defined(HAVE_VA_ARGS_MACRO)
|
|
98
|
+
#define rb_ary_new_from_args(n, ...) \
|
|
99
|
+
__extension__ ({ \
|
|
100
|
+
const VALUE args_to_new_ary[] = {__VA_ARGS__}; \
|
|
101
|
+
if (__builtin_constant_p(n)) { \
|
|
102
|
+
STATIC_ASSERT(rb_ary_new_from_args, numberof(args_to_new_ary) == (n)); \
|
|
103
|
+
} \
|
|
104
|
+
rb_ary_new_from_values(numberof(args_to_new_ary), args_to_new_ary); \
|
|
105
|
+
})
|
|
106
|
+
#endif
|
|
107
|
+
|
|
108
|
+
#undef RARRAY_AREF
|
|
109
|
+
RBIMPL_ATTR_PURE_UNLESS_DEBUG()
|
|
110
|
+
RBIMPL_ATTR_ARTIFICIAL()
|
|
111
|
+
static inline VALUE
|
|
112
|
+
RARRAY_AREF(VALUE ary, long i)
|
|
113
|
+
{
|
|
114
|
+
RBIMPL_ASSERT_TYPE(ary, RUBY_T_ARRAY);
|
|
115
|
+
|
|
116
|
+
return RARRAY_CONST_PTR_TRANSIENT(ary)[i];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
#endif /* INTERNAL_ARRAY_H */
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#ifndef INTERNAL_CLASS_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_CLASS_H
|
|
3
|
+
/**
|
|
4
|
+
* @file
|
|
5
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
6
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
7
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
8
|
+
* modify this file, provided that the conditions mentioned in the
|
|
9
|
+
* file COPYING are met. Consult the file for details.
|
|
10
|
+
* @brief Internal header for Class.
|
|
11
|
+
*/
|
|
12
|
+
#include "id_table.h" /* for struct rb_id_table */
|
|
13
|
+
#include "internal/gc.h" /* for RB_OBJ_WRITE */
|
|
14
|
+
#include "internal/serial.h" /* for rb_serial_t */
|
|
15
|
+
#include "ruby/internal/stdbool.h" /* for bool */
|
|
16
|
+
#include "ruby/intern.h" /* for rb_alloc_func_t */
|
|
17
|
+
#include "ruby/ruby.h" /* for struct RBasic */
|
|
18
|
+
|
|
19
|
+
#ifdef RCLASS_SUPER
|
|
20
|
+
# undef RCLASS_SUPER
|
|
21
|
+
#endif
|
|
22
|
+
|
|
23
|
+
struct rb_subclass_entry {
|
|
24
|
+
VALUE klass;
|
|
25
|
+
struct rb_subclass_entry *next;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
struct rb_iv_index_tbl_entry {
|
|
29
|
+
uint32_t index;
|
|
30
|
+
rb_serial_t class_serial;
|
|
31
|
+
VALUE class_value;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
struct rb_classext_struct {
|
|
35
|
+
struct st_table *iv_index_tbl; // ID -> struct rb_iv_index_tbl_entry
|
|
36
|
+
struct st_table *iv_tbl;
|
|
37
|
+
#if SIZEOF_SERIAL_T == SIZEOF_VALUE /* otherwise m_tbl is in struct RClass */
|
|
38
|
+
struct rb_id_table *m_tbl;
|
|
39
|
+
#endif
|
|
40
|
+
struct rb_id_table *const_tbl;
|
|
41
|
+
struct rb_id_table *callable_m_tbl;
|
|
42
|
+
struct rb_id_table *cc_tbl; /* ID -> [[ci, cc1], cc2, ...] */
|
|
43
|
+
struct rb_subclass_entry *subclasses;
|
|
44
|
+
struct rb_subclass_entry **parent_subclasses;
|
|
45
|
+
/**
|
|
46
|
+
* In the case that this is an `ICLASS`, `module_subclasses` points to the link
|
|
47
|
+
* in the module's `subclasses` list that indicates that the klass has been
|
|
48
|
+
* included. Hopefully that makes sense.
|
|
49
|
+
*/
|
|
50
|
+
struct rb_subclass_entry **module_subclasses;
|
|
51
|
+
#if SIZEOF_SERIAL_T != SIZEOF_VALUE /* otherwise class_serial is in struct RClass */
|
|
52
|
+
rb_serial_t class_serial;
|
|
53
|
+
#endif
|
|
54
|
+
const VALUE origin_;
|
|
55
|
+
const VALUE refined_class;
|
|
56
|
+
rb_alloc_func_t allocator;
|
|
57
|
+
const VALUE includer;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
struct RClass {
|
|
61
|
+
struct RBasic basic;
|
|
62
|
+
VALUE super;
|
|
63
|
+
struct rb_classext_struct *ptr;
|
|
64
|
+
#if SIZEOF_SERIAL_T == SIZEOF_VALUE
|
|
65
|
+
/* Class serial is as wide as VALUE. Place it here. */
|
|
66
|
+
rb_serial_t class_serial;
|
|
67
|
+
#else
|
|
68
|
+
/* Class serial does not fit into struct RClass. Place m_tbl instead. */
|
|
69
|
+
struct rb_id_table *m_tbl;
|
|
70
|
+
#endif
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
typedef struct rb_subclass_entry rb_subclass_entry_t;
|
|
74
|
+
typedef struct rb_classext_struct rb_classext_t;
|
|
75
|
+
|
|
76
|
+
#define RCLASS_EXT(c) (RCLASS(c)->ptr)
|
|
77
|
+
#define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
|
|
78
|
+
#define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
|
|
79
|
+
#if SIZEOF_SERIAL_T == SIZEOF_VALUE
|
|
80
|
+
# define RCLASS_M_TBL(c) (RCLASS_EXT(c)->m_tbl)
|
|
81
|
+
#else
|
|
82
|
+
# define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
|
|
83
|
+
#endif
|
|
84
|
+
#define RCLASS_CALLABLE_M_TBL(c) (RCLASS_EXT(c)->callable_m_tbl)
|
|
85
|
+
#define RCLASS_CC_TBL(c) (RCLASS_EXT(c)->cc_tbl)
|
|
86
|
+
#define RCLASS_IV_INDEX_TBL(c) (RCLASS_EXT(c)->iv_index_tbl)
|
|
87
|
+
#define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin_)
|
|
88
|
+
#define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class)
|
|
89
|
+
#if SIZEOF_SERIAL_T == SIZEOF_VALUE
|
|
90
|
+
# define RCLASS_SERIAL(c) (RCLASS(c)->class_serial)
|
|
91
|
+
#else
|
|
92
|
+
# define RCLASS_SERIAL(c) (RCLASS_EXT(c)->class_serial)
|
|
93
|
+
#endif
|
|
94
|
+
#define RCLASS_INCLUDER(c) (RCLASS_EXT(c)->includer)
|
|
95
|
+
|
|
96
|
+
#define RICLASS_IS_ORIGIN FL_USER5
|
|
97
|
+
#define RCLASS_CLONED FL_USER6
|
|
98
|
+
#define RICLASS_ORIGIN_SHARED_MTBL FL_USER8
|
|
99
|
+
|
|
100
|
+
/* class.c */
|
|
101
|
+
void rb_class_subclass_add(VALUE super, VALUE klass);
|
|
102
|
+
void rb_class_remove_from_super_subclasses(VALUE);
|
|
103
|
+
int rb_singleton_class_internal_p(VALUE sklass);
|
|
104
|
+
VALUE rb_class_boot(VALUE);
|
|
105
|
+
VALUE rb_make_metaclass(VALUE, VALUE);
|
|
106
|
+
VALUE rb_include_class_new(VALUE, VALUE);
|
|
107
|
+
void rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE);
|
|
108
|
+
void rb_class_detach_subclasses(VALUE);
|
|
109
|
+
void rb_class_detach_module_subclasses(VALUE);
|
|
110
|
+
void rb_class_remove_from_module_subclasses(VALUE);
|
|
111
|
+
VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj);
|
|
112
|
+
VALUE rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj);
|
|
113
|
+
VALUE rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj);
|
|
114
|
+
VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj);
|
|
115
|
+
VALUE rb_special_singleton_class(VALUE);
|
|
116
|
+
VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach);
|
|
117
|
+
VALUE rb_singleton_class_get(VALUE obj);
|
|
118
|
+
int rb_class_has_methods(VALUE c);
|
|
119
|
+
void rb_undef_methods_from(VALUE klass, VALUE super);
|
|
120
|
+
|
|
121
|
+
static inline void RCLASS_SET_ORIGIN(VALUE klass, VALUE origin);
|
|
122
|
+
static inline void RICLASS_SET_ORIGIN_SHARED_MTBL(VALUE iclass);
|
|
123
|
+
static inline VALUE RCLASS_SUPER(VALUE klass);
|
|
124
|
+
static inline VALUE RCLASS_SET_SUPER(VALUE klass, VALUE super);
|
|
125
|
+
static inline void RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass);
|
|
126
|
+
|
|
127
|
+
MJIT_SYMBOL_EXPORT_BEGIN
|
|
128
|
+
VALUE rb_class_inherited(VALUE, VALUE);
|
|
129
|
+
VALUE rb_keyword_error_new(const char *, VALUE);
|
|
130
|
+
MJIT_SYMBOL_EXPORT_END
|
|
131
|
+
|
|
132
|
+
static inline void
|
|
133
|
+
RCLASS_SET_ORIGIN(VALUE klass, VALUE origin)
|
|
134
|
+
{
|
|
135
|
+
RB_OBJ_WRITE(klass, &RCLASS_ORIGIN(klass), origin);
|
|
136
|
+
if (klass != origin) FL_SET(origin, RICLASS_IS_ORIGIN);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
static inline void
|
|
140
|
+
RICLASS_SET_ORIGIN_SHARED_MTBL(VALUE iclass)
|
|
141
|
+
{
|
|
142
|
+
FL_SET(iclass, RICLASS_ORIGIN_SHARED_MTBL);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static inline bool
|
|
146
|
+
RICLASS_OWNS_M_TBL_P(VALUE iclass)
|
|
147
|
+
{
|
|
148
|
+
return FL_TEST_RAW(iclass, RICLASS_IS_ORIGIN | RICLASS_ORIGIN_SHARED_MTBL) == RICLASS_IS_ORIGIN;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
static inline void
|
|
152
|
+
RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass)
|
|
153
|
+
{
|
|
154
|
+
RB_OBJ_WRITE(iclass, &RCLASS_INCLUDER(iclass), klass);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
static inline VALUE
|
|
158
|
+
RCLASS_SUPER(VALUE klass)
|
|
159
|
+
{
|
|
160
|
+
return RCLASS(klass)->super;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
static inline VALUE
|
|
164
|
+
RCLASS_SET_SUPER(VALUE klass, VALUE super)
|
|
165
|
+
{
|
|
166
|
+
if (super) {
|
|
167
|
+
rb_class_remove_from_super_subclasses(klass);
|
|
168
|
+
rb_class_subclass_add(super, klass);
|
|
169
|
+
}
|
|
170
|
+
RB_OBJ_WRITE(klass, &RCLASS(klass)->super, super);
|
|
171
|
+
return super;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
#endif /* INTERNAL_CLASS_H */
|