debase-ruby_core_source 0.9.8 → 0.9.9
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/CHANGELOG.md +5 -1
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/addr2line.h +21 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/ccan/list/list.h +773 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/ccan/str/str.h +16 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/constant.h +50 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/dln.h +51 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/encindex.h +67 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/eval_intern.h +304 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/gc.h +114 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/id.h +211 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/id_table.h +30 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/insns.inc +110 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/insns_info.inc +776 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/internal.h +1407 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/iseq.h +249 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/known_errors.inc +746 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/method.h +213 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/node.h +520 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/node_name.inc +208 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/opt_sc.inc +758 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/optinsn.inc +83 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/optunifs.inc +127 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/parse.h +185 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/probes_helper.h +43 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/regenc.h +237 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/regint.h +987 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/regparse.h +367 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/revision.h +1 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/ruby_atomic.h +233 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/symbol.h +108 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/thread_pthread.h +54 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/thread_win32.h +36 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/timev.h +42 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/transcode_data.h +139 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/version.h +55 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm.inc +3414 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm_call_iseq_optimized.inc +212 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm_core.h +1240 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm_debug.h +37 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm_exec.h +182 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm_insnhelper.h +227 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm_opts.h +57 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vmtc.inc +108 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +48 -2
@@ -0,0 +1,3414 @@
|
|
1
|
+
/* -*-c-*- *********************************************************/
|
2
|
+
/*******************************************************************/
|
3
|
+
/*******************************************************************/
|
4
|
+
/**
|
5
|
+
This file is VM main loop.
|
6
|
+
|
7
|
+
----
|
8
|
+
This file is auto generated by insns2vm.rb
|
9
|
+
DO NOT TOUCH!
|
10
|
+
|
11
|
+
If you want to fix something, you must edit 'insns.def'
|
12
|
+
*/
|
13
|
+
|
14
|
+
|
15
|
+
INSN_ENTRY(nop){
|
16
|
+
{
|
17
|
+
|
18
|
+
|
19
|
+
DEBUG_ENTER_INSN("nop");
|
20
|
+
ADD_PC(1+0);
|
21
|
+
PREFETCH(GET_PC());
|
22
|
+
#define CURRENT_INSN_nop 1
|
23
|
+
#define INSN_IS_SC() 0
|
24
|
+
#define INSN_LABEL(lab) LABEL_nop_##lab
|
25
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
26
|
+
COLLECT_USAGE_INSN(BIN(nop));
|
27
|
+
{
|
28
|
+
#line 40 "insns.def"
|
29
|
+
/* none */
|
30
|
+
|
31
|
+
#line 32 "vm.inc"
|
32
|
+
#undef CURRENT_INSN_nop
|
33
|
+
#undef INSN_IS_SC
|
34
|
+
#undef INSN_LABEL
|
35
|
+
#undef LABEL_IS_SC
|
36
|
+
END_INSN(nop);}}}
|
37
|
+
INSN_ENTRY(getlocal){
|
38
|
+
{
|
39
|
+
VALUE val;
|
40
|
+
rb_num_t level = (rb_num_t)GET_OPERAND(2);
|
41
|
+
lindex_t idx = (lindex_t)GET_OPERAND(1);
|
42
|
+
|
43
|
+
DEBUG_ENTER_INSN("getlocal");
|
44
|
+
ADD_PC(1+2);
|
45
|
+
PREFETCH(GET_PC());
|
46
|
+
#define CURRENT_INSN_getlocal 1
|
47
|
+
#define INSN_IS_SC() 0
|
48
|
+
#define INSN_LABEL(lab) LABEL_getlocal_##lab
|
49
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
50
|
+
COLLECT_USAGE_INSN(BIN(getlocal));
|
51
|
+
COLLECT_USAGE_OPERAND(BIN(getlocal), 0, idx);
|
52
|
+
COLLECT_USAGE_OPERAND(BIN(getlocal), 1, level);
|
53
|
+
{
|
54
|
+
#line 60 "insns.def"
|
55
|
+
int i, lev = (int)level;
|
56
|
+
VALUE *ep = GET_EP();
|
57
|
+
|
58
|
+
/* optimized insns generated for level == (0|1) in defs/opt_operand.def */
|
59
|
+
for (i = 0; i < lev; i++) {
|
60
|
+
ep = GET_PREV_EP(ep);
|
61
|
+
}
|
62
|
+
val = *(ep - idx);
|
63
|
+
|
64
|
+
#line 65 "vm.inc"
|
65
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
66
|
+
PUSH(val);
|
67
|
+
#undef CURRENT_INSN_getlocal
|
68
|
+
#undef INSN_IS_SC
|
69
|
+
#undef INSN_LABEL
|
70
|
+
#undef LABEL_IS_SC
|
71
|
+
END_INSN(getlocal);}}}
|
72
|
+
INSN_ENTRY(setlocal){
|
73
|
+
{
|
74
|
+
rb_num_t level = (rb_num_t)GET_OPERAND(2);
|
75
|
+
lindex_t idx = (lindex_t)GET_OPERAND(1);
|
76
|
+
VALUE val = TOPN(0);
|
77
|
+
DEBUG_ENTER_INSN("setlocal");
|
78
|
+
ADD_PC(1+2);
|
79
|
+
PREFETCH(GET_PC());
|
80
|
+
POPN(1);
|
81
|
+
#define CURRENT_INSN_setlocal 1
|
82
|
+
#define INSN_IS_SC() 0
|
83
|
+
#define INSN_LABEL(lab) LABEL_setlocal_##lab
|
84
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
85
|
+
COLLECT_USAGE_INSN(BIN(setlocal));
|
86
|
+
COLLECT_USAGE_OPERAND(BIN(setlocal), 0, idx);
|
87
|
+
COLLECT_USAGE_OPERAND(BIN(setlocal), 1, level);
|
88
|
+
{
|
89
|
+
#line 83 "insns.def"
|
90
|
+
int i, lev = (int)level;
|
91
|
+
VALUE *ep = GET_EP();
|
92
|
+
|
93
|
+
/* optimized insns generated for level == (0|1) in defs/opt_operand.def */
|
94
|
+
for (i = 0; i < lev; i++) {
|
95
|
+
ep = GET_PREV_EP(ep);
|
96
|
+
}
|
97
|
+
*(ep - idx) = val;
|
98
|
+
|
99
|
+
#line 100 "vm.inc"
|
100
|
+
#undef CURRENT_INSN_setlocal
|
101
|
+
#undef INSN_IS_SC
|
102
|
+
#undef INSN_LABEL
|
103
|
+
#undef LABEL_IS_SC
|
104
|
+
END_INSN(setlocal);}}}
|
105
|
+
INSN_ENTRY(getspecial){
|
106
|
+
{
|
107
|
+
VALUE val;
|
108
|
+
rb_num_t type = (rb_num_t)GET_OPERAND(2);
|
109
|
+
rb_num_t key = (rb_num_t)GET_OPERAND(1);
|
110
|
+
|
111
|
+
DEBUG_ENTER_INSN("getspecial");
|
112
|
+
ADD_PC(1+2);
|
113
|
+
PREFETCH(GET_PC());
|
114
|
+
#define CURRENT_INSN_getspecial 1
|
115
|
+
#define INSN_IS_SC() 0
|
116
|
+
#define INSN_LABEL(lab) LABEL_getspecial_##lab
|
117
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
118
|
+
COLLECT_USAGE_INSN(BIN(getspecial));
|
119
|
+
COLLECT_USAGE_OPERAND(BIN(getspecial), 0, key);
|
120
|
+
COLLECT_USAGE_OPERAND(BIN(getspecial), 1, type);
|
121
|
+
{
|
122
|
+
#line 104 "insns.def"
|
123
|
+
val = vm_getspecial(th, GET_LEP(), key, type);
|
124
|
+
|
125
|
+
#line 126 "vm.inc"
|
126
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
127
|
+
PUSH(val);
|
128
|
+
#undef CURRENT_INSN_getspecial
|
129
|
+
#undef INSN_IS_SC
|
130
|
+
#undef INSN_LABEL
|
131
|
+
#undef LABEL_IS_SC
|
132
|
+
END_INSN(getspecial);}}}
|
133
|
+
INSN_ENTRY(setspecial){
|
134
|
+
{
|
135
|
+
rb_num_t key = (rb_num_t)GET_OPERAND(1);
|
136
|
+
VALUE obj = TOPN(0);
|
137
|
+
DEBUG_ENTER_INSN("setspecial");
|
138
|
+
ADD_PC(1+1);
|
139
|
+
PREFETCH(GET_PC());
|
140
|
+
POPN(1);
|
141
|
+
#define CURRENT_INSN_setspecial 1
|
142
|
+
#define INSN_IS_SC() 0
|
143
|
+
#define INSN_LABEL(lab) LABEL_setspecial_##lab
|
144
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
145
|
+
COLLECT_USAGE_INSN(BIN(setspecial));
|
146
|
+
COLLECT_USAGE_OPERAND(BIN(setspecial), 0, key);
|
147
|
+
{
|
148
|
+
#line 118 "insns.def"
|
149
|
+
lep_svar_set(th, GET_LEP(), key, obj);
|
150
|
+
|
151
|
+
#line 152 "vm.inc"
|
152
|
+
#undef CURRENT_INSN_setspecial
|
153
|
+
#undef INSN_IS_SC
|
154
|
+
#undef INSN_LABEL
|
155
|
+
#undef LABEL_IS_SC
|
156
|
+
END_INSN(setspecial);}}}
|
157
|
+
INSN_ENTRY(getinstancevariable){
|
158
|
+
{
|
159
|
+
VALUE val;
|
160
|
+
IC ic = (IC)GET_OPERAND(2);
|
161
|
+
ID id = (ID)GET_OPERAND(1);
|
162
|
+
|
163
|
+
DEBUG_ENTER_INSN("getinstancevariable");
|
164
|
+
ADD_PC(1+2);
|
165
|
+
PREFETCH(GET_PC());
|
166
|
+
#define CURRENT_INSN_getinstancevariable 1
|
167
|
+
#define INSN_IS_SC() 0
|
168
|
+
#define INSN_LABEL(lab) LABEL_getinstancevariable_##lab
|
169
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
170
|
+
COLLECT_USAGE_INSN(BIN(getinstancevariable));
|
171
|
+
COLLECT_USAGE_OPERAND(BIN(getinstancevariable), 0, id);
|
172
|
+
COLLECT_USAGE_OPERAND(BIN(getinstancevariable), 1, ic);
|
173
|
+
{
|
174
|
+
#line 133 "insns.def"
|
175
|
+
val = vm_getinstancevariable(GET_SELF(), id, ic);
|
176
|
+
|
177
|
+
#line 178 "vm.inc"
|
178
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
179
|
+
PUSH(val);
|
180
|
+
#undef CURRENT_INSN_getinstancevariable
|
181
|
+
#undef INSN_IS_SC
|
182
|
+
#undef INSN_LABEL
|
183
|
+
#undef LABEL_IS_SC
|
184
|
+
END_INSN(getinstancevariable);}}}
|
185
|
+
INSN_ENTRY(setinstancevariable){
|
186
|
+
{
|
187
|
+
IC ic = (IC)GET_OPERAND(2);
|
188
|
+
ID id = (ID)GET_OPERAND(1);
|
189
|
+
VALUE val = TOPN(0);
|
190
|
+
DEBUG_ENTER_INSN("setinstancevariable");
|
191
|
+
ADD_PC(1+2);
|
192
|
+
PREFETCH(GET_PC());
|
193
|
+
POPN(1);
|
194
|
+
#define CURRENT_INSN_setinstancevariable 1
|
195
|
+
#define INSN_IS_SC() 0
|
196
|
+
#define INSN_LABEL(lab) LABEL_setinstancevariable_##lab
|
197
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
198
|
+
COLLECT_USAGE_INSN(BIN(setinstancevariable));
|
199
|
+
COLLECT_USAGE_OPERAND(BIN(setinstancevariable), 0, id);
|
200
|
+
COLLECT_USAGE_OPERAND(BIN(setinstancevariable), 1, ic);
|
201
|
+
{
|
202
|
+
#line 148 "insns.def"
|
203
|
+
vm_setinstancevariable(GET_SELF(), id, val, ic);
|
204
|
+
|
205
|
+
#line 206 "vm.inc"
|
206
|
+
#undef CURRENT_INSN_setinstancevariable
|
207
|
+
#undef INSN_IS_SC
|
208
|
+
#undef INSN_LABEL
|
209
|
+
#undef LABEL_IS_SC
|
210
|
+
END_INSN(setinstancevariable);}}}
|
211
|
+
INSN_ENTRY(getclassvariable){
|
212
|
+
{
|
213
|
+
VALUE val;
|
214
|
+
ID id = (ID)GET_OPERAND(1);
|
215
|
+
|
216
|
+
DEBUG_ENTER_INSN("getclassvariable");
|
217
|
+
ADD_PC(1+1);
|
218
|
+
PREFETCH(GET_PC());
|
219
|
+
#define CURRENT_INSN_getclassvariable 1
|
220
|
+
#define INSN_IS_SC() 0
|
221
|
+
#define INSN_LABEL(lab) LABEL_getclassvariable_##lab
|
222
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
223
|
+
COLLECT_USAGE_INSN(BIN(getclassvariable));
|
224
|
+
COLLECT_USAGE_OPERAND(BIN(getclassvariable), 0, id);
|
225
|
+
{
|
226
|
+
#line 162 "insns.def"
|
227
|
+
val = rb_cvar_get(vm_get_cvar_base(rb_vm_get_cref(GET_EP()), GET_CFP()), id);
|
228
|
+
|
229
|
+
#line 230 "vm.inc"
|
230
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
231
|
+
PUSH(val);
|
232
|
+
#undef CURRENT_INSN_getclassvariable
|
233
|
+
#undef INSN_IS_SC
|
234
|
+
#undef INSN_LABEL
|
235
|
+
#undef LABEL_IS_SC
|
236
|
+
END_INSN(getclassvariable);}}}
|
237
|
+
INSN_ENTRY(setclassvariable){
|
238
|
+
{
|
239
|
+
ID id = (ID)GET_OPERAND(1);
|
240
|
+
VALUE val = TOPN(0);
|
241
|
+
DEBUG_ENTER_INSN("setclassvariable");
|
242
|
+
ADD_PC(1+1);
|
243
|
+
PREFETCH(GET_PC());
|
244
|
+
POPN(1);
|
245
|
+
#define CURRENT_INSN_setclassvariable 1
|
246
|
+
#define INSN_IS_SC() 0
|
247
|
+
#define INSN_LABEL(lab) LABEL_setclassvariable_##lab
|
248
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
249
|
+
COLLECT_USAGE_INSN(BIN(setclassvariable));
|
250
|
+
COLLECT_USAGE_OPERAND(BIN(setclassvariable), 0, id);
|
251
|
+
{
|
252
|
+
#line 176 "insns.def"
|
253
|
+
rb_cvar_set(vm_get_cvar_base(rb_vm_get_cref(GET_EP()), GET_CFP()), id, val);
|
254
|
+
|
255
|
+
#line 256 "vm.inc"
|
256
|
+
#undef CURRENT_INSN_setclassvariable
|
257
|
+
#undef INSN_IS_SC
|
258
|
+
#undef INSN_LABEL
|
259
|
+
#undef LABEL_IS_SC
|
260
|
+
END_INSN(setclassvariable);}}}
|
261
|
+
INSN_ENTRY(getconstant){
|
262
|
+
{
|
263
|
+
VALUE val;
|
264
|
+
ID id = (ID)GET_OPERAND(1);
|
265
|
+
VALUE klass = TOPN(0);
|
266
|
+
DEBUG_ENTER_INSN("getconstant");
|
267
|
+
ADD_PC(1+1);
|
268
|
+
PREFETCH(GET_PC());
|
269
|
+
POPN(1);
|
270
|
+
#define CURRENT_INSN_getconstant 1
|
271
|
+
#define INSN_IS_SC() 0
|
272
|
+
#define INSN_LABEL(lab) LABEL_getconstant_##lab
|
273
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
274
|
+
COLLECT_USAGE_INSN(BIN(getconstant));
|
275
|
+
COLLECT_USAGE_OPERAND(BIN(getconstant), 0, id);
|
276
|
+
{
|
277
|
+
#line 197 "insns.def"
|
278
|
+
val = vm_get_ev_const(th, klass, id, 0);
|
279
|
+
|
280
|
+
#line 281 "vm.inc"
|
281
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
282
|
+
PUSH(val);
|
283
|
+
#undef CURRENT_INSN_getconstant
|
284
|
+
#undef INSN_IS_SC
|
285
|
+
#undef INSN_LABEL
|
286
|
+
#undef LABEL_IS_SC
|
287
|
+
END_INSN(getconstant);}}}
|
288
|
+
INSN_ENTRY(setconstant){
|
289
|
+
{
|
290
|
+
ID id = (ID)GET_OPERAND(1);
|
291
|
+
VALUE val = TOPN(1);
|
292
|
+
VALUE cbase = TOPN(0);
|
293
|
+
DEBUG_ENTER_INSN("setconstant");
|
294
|
+
ADD_PC(1+1);
|
295
|
+
PREFETCH(GET_PC());
|
296
|
+
POPN(2);
|
297
|
+
#define CURRENT_INSN_setconstant 1
|
298
|
+
#define INSN_IS_SC() 0
|
299
|
+
#define INSN_LABEL(lab) LABEL_setconstant_##lab
|
300
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
301
|
+
COLLECT_USAGE_INSN(BIN(setconstant));
|
302
|
+
COLLECT_USAGE_OPERAND(BIN(setconstant), 0, id);
|
303
|
+
{
|
304
|
+
#line 219 "insns.def"
|
305
|
+
vm_check_if_namespace(cbase);
|
306
|
+
rb_const_set(cbase, id, val);
|
307
|
+
|
308
|
+
#line 309 "vm.inc"
|
309
|
+
#undef CURRENT_INSN_setconstant
|
310
|
+
#undef INSN_IS_SC
|
311
|
+
#undef INSN_LABEL
|
312
|
+
#undef LABEL_IS_SC
|
313
|
+
END_INSN(setconstant);}}}
|
314
|
+
INSN_ENTRY(getglobal){
|
315
|
+
{
|
316
|
+
VALUE val;
|
317
|
+
GENTRY entry = (GENTRY)GET_OPERAND(1);
|
318
|
+
|
319
|
+
DEBUG_ENTER_INSN("getglobal");
|
320
|
+
ADD_PC(1+1);
|
321
|
+
PREFETCH(GET_PC());
|
322
|
+
#define CURRENT_INSN_getglobal 1
|
323
|
+
#define INSN_IS_SC() 0
|
324
|
+
#define INSN_LABEL(lab) LABEL_getglobal_##lab
|
325
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
326
|
+
COLLECT_USAGE_INSN(BIN(getglobal));
|
327
|
+
COLLECT_USAGE_OPERAND(BIN(getglobal), 0, entry);
|
328
|
+
{
|
329
|
+
#line 234 "insns.def"
|
330
|
+
val = GET_GLOBAL((VALUE)entry);
|
331
|
+
|
332
|
+
#line 333 "vm.inc"
|
333
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
334
|
+
PUSH(val);
|
335
|
+
#undef CURRENT_INSN_getglobal
|
336
|
+
#undef INSN_IS_SC
|
337
|
+
#undef INSN_LABEL
|
338
|
+
#undef LABEL_IS_SC
|
339
|
+
END_INSN(getglobal);}}}
|
340
|
+
INSN_ENTRY(setglobal){
|
341
|
+
{
|
342
|
+
GENTRY entry = (GENTRY)GET_OPERAND(1);
|
343
|
+
VALUE val = TOPN(0);
|
344
|
+
DEBUG_ENTER_INSN("setglobal");
|
345
|
+
ADD_PC(1+1);
|
346
|
+
PREFETCH(GET_PC());
|
347
|
+
POPN(1);
|
348
|
+
#define CURRENT_INSN_setglobal 1
|
349
|
+
#define INSN_IS_SC() 0
|
350
|
+
#define INSN_LABEL(lab) LABEL_setglobal_##lab
|
351
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
352
|
+
COLLECT_USAGE_INSN(BIN(setglobal));
|
353
|
+
COLLECT_USAGE_OPERAND(BIN(setglobal), 0, entry);
|
354
|
+
{
|
355
|
+
#line 248 "insns.def"
|
356
|
+
SET_GLOBAL((VALUE)entry, val);
|
357
|
+
|
358
|
+
#line 359 "vm.inc"
|
359
|
+
#undef CURRENT_INSN_setglobal
|
360
|
+
#undef INSN_IS_SC
|
361
|
+
#undef INSN_LABEL
|
362
|
+
#undef LABEL_IS_SC
|
363
|
+
END_INSN(setglobal);}}}
|
364
|
+
INSN_ENTRY(putnil){
|
365
|
+
{
|
366
|
+
VALUE val;
|
367
|
+
|
368
|
+
|
369
|
+
DEBUG_ENTER_INSN("putnil");
|
370
|
+
ADD_PC(1+0);
|
371
|
+
PREFETCH(GET_PC());
|
372
|
+
#define CURRENT_INSN_putnil 1
|
373
|
+
#define INSN_IS_SC() 0
|
374
|
+
#define INSN_LABEL(lab) LABEL_putnil_##lab
|
375
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
376
|
+
COLLECT_USAGE_INSN(BIN(putnil));
|
377
|
+
{
|
378
|
+
#line 267 "insns.def"
|
379
|
+
val = Qnil;
|
380
|
+
|
381
|
+
#line 382 "vm.inc"
|
382
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
383
|
+
PUSH(val);
|
384
|
+
#undef CURRENT_INSN_putnil
|
385
|
+
#undef INSN_IS_SC
|
386
|
+
#undef INSN_LABEL
|
387
|
+
#undef LABEL_IS_SC
|
388
|
+
END_INSN(putnil);}}}
|
389
|
+
INSN_ENTRY(putself){
|
390
|
+
{
|
391
|
+
VALUE val;
|
392
|
+
|
393
|
+
|
394
|
+
DEBUG_ENTER_INSN("putself");
|
395
|
+
ADD_PC(1+0);
|
396
|
+
PREFETCH(GET_PC());
|
397
|
+
#define CURRENT_INSN_putself 1
|
398
|
+
#define INSN_IS_SC() 0
|
399
|
+
#define INSN_LABEL(lab) LABEL_putself_##lab
|
400
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
401
|
+
COLLECT_USAGE_INSN(BIN(putself));
|
402
|
+
{
|
403
|
+
#line 281 "insns.def"
|
404
|
+
val = GET_SELF();
|
405
|
+
|
406
|
+
#line 407 "vm.inc"
|
407
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
408
|
+
PUSH(val);
|
409
|
+
#undef CURRENT_INSN_putself
|
410
|
+
#undef INSN_IS_SC
|
411
|
+
#undef INSN_LABEL
|
412
|
+
#undef LABEL_IS_SC
|
413
|
+
END_INSN(putself);}}}
|
414
|
+
INSN_ENTRY(putobject){
|
415
|
+
{
|
416
|
+
VALUE val = (VALUE)GET_OPERAND(1);
|
417
|
+
|
418
|
+
DEBUG_ENTER_INSN("putobject");
|
419
|
+
ADD_PC(1+1);
|
420
|
+
PREFETCH(GET_PC());
|
421
|
+
#define CURRENT_INSN_putobject 1
|
422
|
+
#define INSN_IS_SC() 0
|
423
|
+
#define INSN_LABEL(lab) LABEL_putobject_##lab
|
424
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
425
|
+
COLLECT_USAGE_INSN(BIN(putobject));
|
426
|
+
COLLECT_USAGE_OPERAND(BIN(putobject), 0, val);
|
427
|
+
{
|
428
|
+
#line 297 "insns.def"
|
429
|
+
/* */
|
430
|
+
|
431
|
+
#line 432 "vm.inc"
|
432
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
433
|
+
PUSH(val);
|
434
|
+
#undef CURRENT_INSN_putobject
|
435
|
+
#undef INSN_IS_SC
|
436
|
+
#undef INSN_LABEL
|
437
|
+
#undef LABEL_IS_SC
|
438
|
+
END_INSN(putobject);}}}
|
439
|
+
INSN_ENTRY(putspecialobject){
|
440
|
+
{
|
441
|
+
VALUE val;
|
442
|
+
rb_num_t value_type = (rb_num_t)GET_OPERAND(1);
|
443
|
+
|
444
|
+
DEBUG_ENTER_INSN("putspecialobject");
|
445
|
+
ADD_PC(1+1);
|
446
|
+
PREFETCH(GET_PC());
|
447
|
+
#define CURRENT_INSN_putspecialobject 1
|
448
|
+
#define INSN_IS_SC() 0
|
449
|
+
#define INSN_LABEL(lab) LABEL_putspecialobject_##lab
|
450
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
451
|
+
COLLECT_USAGE_INSN(BIN(putspecialobject));
|
452
|
+
COLLECT_USAGE_OPERAND(BIN(putspecialobject), 0, value_type);
|
453
|
+
{
|
454
|
+
#line 312 "insns.def"
|
455
|
+
enum vm_special_object_type type = (enum vm_special_object_type)value_type;
|
456
|
+
|
457
|
+
switch (type) {
|
458
|
+
case VM_SPECIAL_OBJECT_VMCORE:
|
459
|
+
val = rb_mRubyVMFrozenCore;
|
460
|
+
break;
|
461
|
+
case VM_SPECIAL_OBJECT_CBASE:
|
462
|
+
val = vm_get_cbase(GET_EP());
|
463
|
+
break;
|
464
|
+
case VM_SPECIAL_OBJECT_CONST_BASE:
|
465
|
+
val = vm_get_const_base(GET_EP());
|
466
|
+
break;
|
467
|
+
default:
|
468
|
+
rb_bug("putspecialobject insn: unknown value_type");
|
469
|
+
}
|
470
|
+
|
471
|
+
#line 472 "vm.inc"
|
472
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
473
|
+
PUSH(val);
|
474
|
+
#undef CURRENT_INSN_putspecialobject
|
475
|
+
#undef INSN_IS_SC
|
476
|
+
#undef INSN_LABEL
|
477
|
+
#undef LABEL_IS_SC
|
478
|
+
END_INSN(putspecialobject);}}}
|
479
|
+
INSN_ENTRY(putiseq){
|
480
|
+
{
|
481
|
+
VALUE ret;
|
482
|
+
ISEQ iseq = (ISEQ)GET_OPERAND(1);
|
483
|
+
|
484
|
+
DEBUG_ENTER_INSN("putiseq");
|
485
|
+
ADD_PC(1+1);
|
486
|
+
PREFETCH(GET_PC());
|
487
|
+
#define CURRENT_INSN_putiseq 1
|
488
|
+
#define INSN_IS_SC() 0
|
489
|
+
#define INSN_LABEL(lab) LABEL_putiseq_##lab
|
490
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
491
|
+
COLLECT_USAGE_INSN(BIN(putiseq));
|
492
|
+
COLLECT_USAGE_OPERAND(BIN(putiseq), 0, iseq);
|
493
|
+
{
|
494
|
+
#line 340 "insns.def"
|
495
|
+
ret = (VALUE)iseq;
|
496
|
+
|
497
|
+
#line 498 "vm.inc"
|
498
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
499
|
+
PUSH(ret);
|
500
|
+
#undef CURRENT_INSN_putiseq
|
501
|
+
#undef INSN_IS_SC
|
502
|
+
#undef INSN_LABEL
|
503
|
+
#undef LABEL_IS_SC
|
504
|
+
END_INSN(putiseq);}}}
|
505
|
+
INSN_ENTRY(putstring){
|
506
|
+
{
|
507
|
+
VALUE val;
|
508
|
+
VALUE str = (VALUE)GET_OPERAND(1);
|
509
|
+
|
510
|
+
DEBUG_ENTER_INSN("putstring");
|
511
|
+
ADD_PC(1+1);
|
512
|
+
PREFETCH(GET_PC());
|
513
|
+
#define CURRENT_INSN_putstring 1
|
514
|
+
#define INSN_IS_SC() 0
|
515
|
+
#define INSN_LABEL(lab) LABEL_putstring_##lab
|
516
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
517
|
+
COLLECT_USAGE_INSN(BIN(putstring));
|
518
|
+
COLLECT_USAGE_OPERAND(BIN(putstring), 0, str);
|
519
|
+
{
|
520
|
+
#line 354 "insns.def"
|
521
|
+
val = rb_str_resurrect(str);
|
522
|
+
|
523
|
+
#line 524 "vm.inc"
|
524
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
525
|
+
PUSH(val);
|
526
|
+
#undef CURRENT_INSN_putstring
|
527
|
+
#undef INSN_IS_SC
|
528
|
+
#undef INSN_LABEL
|
529
|
+
#undef LABEL_IS_SC
|
530
|
+
END_INSN(putstring);}}}
|
531
|
+
INSN_ENTRY(concatstrings){
|
532
|
+
{
|
533
|
+
VALUE val;
|
534
|
+
rb_num_t num = (rb_num_t)GET_OPERAND(1);
|
535
|
+
|
536
|
+
DEBUG_ENTER_INSN("concatstrings");
|
537
|
+
ADD_PC(1+1);
|
538
|
+
PREFETCH(GET_PC());
|
539
|
+
#define CURRENT_INSN_concatstrings 1
|
540
|
+
#define INSN_IS_SC() 0
|
541
|
+
#define INSN_LABEL(lab) LABEL_concatstrings_##lab
|
542
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
543
|
+
COLLECT_USAGE_INSN(BIN(concatstrings));
|
544
|
+
COLLECT_USAGE_OPERAND(BIN(concatstrings), 0, num);
|
545
|
+
{
|
546
|
+
#line 368 "insns.def"
|
547
|
+
rb_num_t i = num - 1;
|
548
|
+
|
549
|
+
val = rb_str_resurrect(TOPN(i));
|
550
|
+
while (i-- > 0) {
|
551
|
+
const VALUE v = TOPN(i);
|
552
|
+
rb_str_append_literal(val, v);
|
553
|
+
}
|
554
|
+
POPN(num);
|
555
|
+
|
556
|
+
#line 557 "vm.inc"
|
557
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
558
|
+
PUSH(val);
|
559
|
+
#undef CURRENT_INSN_concatstrings
|
560
|
+
#undef INSN_IS_SC
|
561
|
+
#undef INSN_LABEL
|
562
|
+
#undef LABEL_IS_SC
|
563
|
+
END_INSN(concatstrings);}}}
|
564
|
+
INSN_ENTRY(tostring){
|
565
|
+
{
|
566
|
+
|
567
|
+
VALUE val = TOPN(0);
|
568
|
+
DEBUG_ENTER_INSN("tostring");
|
569
|
+
ADD_PC(1+0);
|
570
|
+
PREFETCH(GET_PC());
|
571
|
+
POPN(1);
|
572
|
+
#define CURRENT_INSN_tostring 1
|
573
|
+
#define INSN_IS_SC() 0
|
574
|
+
#define INSN_LABEL(lab) LABEL_tostring_##lab
|
575
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
576
|
+
COLLECT_USAGE_INSN(BIN(tostring));
|
577
|
+
{
|
578
|
+
#line 389 "insns.def"
|
579
|
+
val = rb_obj_as_string(val);
|
580
|
+
|
581
|
+
#line 582 "vm.inc"
|
582
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
583
|
+
PUSH(val);
|
584
|
+
#undef CURRENT_INSN_tostring
|
585
|
+
#undef INSN_IS_SC
|
586
|
+
#undef INSN_LABEL
|
587
|
+
#undef LABEL_IS_SC
|
588
|
+
END_INSN(tostring);}}}
|
589
|
+
INSN_ENTRY(freezestring){
|
590
|
+
{
|
591
|
+
VALUE debug_info = (VALUE)GET_OPERAND(1);
|
592
|
+
VALUE str = TOPN(0);
|
593
|
+
DEBUG_ENTER_INSN("freezestring");
|
594
|
+
ADD_PC(1+1);
|
595
|
+
PREFETCH(GET_PC());
|
596
|
+
POPN(1);
|
597
|
+
#define CURRENT_INSN_freezestring 1
|
598
|
+
#define INSN_IS_SC() 0
|
599
|
+
#define INSN_LABEL(lab) LABEL_freezestring_##lab
|
600
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
601
|
+
COLLECT_USAGE_INSN(BIN(freezestring));
|
602
|
+
COLLECT_USAGE_OPERAND(BIN(freezestring), 0, debug_info);
|
603
|
+
{
|
604
|
+
#line 403 "insns.def"
|
605
|
+
if (!NIL_P(debug_info)) {
|
606
|
+
rb_ivar_set(str, id_debug_created_info, debug_info);
|
607
|
+
}
|
608
|
+
rb_str_freeze(str);
|
609
|
+
|
610
|
+
#line 611 "vm.inc"
|
611
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
612
|
+
PUSH(str);
|
613
|
+
#undef CURRENT_INSN_freezestring
|
614
|
+
#undef INSN_IS_SC
|
615
|
+
#undef INSN_LABEL
|
616
|
+
#undef LABEL_IS_SC
|
617
|
+
END_INSN(freezestring);}}}
|
618
|
+
INSN_ENTRY(toregexp){
|
619
|
+
{
|
620
|
+
VALUE val;
|
621
|
+
rb_num_t cnt = (rb_num_t)GET_OPERAND(2);
|
622
|
+
rb_num_t opt = (rb_num_t)GET_OPERAND(1);
|
623
|
+
|
624
|
+
DEBUG_ENTER_INSN("toregexp");
|
625
|
+
ADD_PC(1+2);
|
626
|
+
PREFETCH(GET_PC());
|
627
|
+
#define CURRENT_INSN_toregexp 1
|
628
|
+
#define INSN_IS_SC() 0
|
629
|
+
#define INSN_LABEL(lab) LABEL_toregexp_##lab
|
630
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
631
|
+
COLLECT_USAGE_INSN(BIN(toregexp));
|
632
|
+
COLLECT_USAGE_OPERAND(BIN(toregexp), 0, opt);
|
633
|
+
COLLECT_USAGE_OPERAND(BIN(toregexp), 1, cnt);
|
634
|
+
{
|
635
|
+
#line 421 "insns.def"
|
636
|
+
VALUE rb_reg_new_ary(VALUE ary, int options);
|
637
|
+
rb_num_t i;
|
638
|
+
const VALUE ary = rb_ary_tmp_new(cnt);
|
639
|
+
for (i = 0; i < cnt; i++) {
|
640
|
+
rb_ary_store(ary, cnt-i-1, TOPN(i));
|
641
|
+
}
|
642
|
+
POPN(cnt);
|
643
|
+
val = rb_reg_new_ary(ary, (int)opt);
|
644
|
+
rb_ary_clear(ary);
|
645
|
+
|
646
|
+
#line 647 "vm.inc"
|
647
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
648
|
+
PUSH(val);
|
649
|
+
#undef CURRENT_INSN_toregexp
|
650
|
+
#undef INSN_IS_SC
|
651
|
+
#undef INSN_LABEL
|
652
|
+
#undef LABEL_IS_SC
|
653
|
+
END_INSN(toregexp);}}}
|
654
|
+
INSN_ENTRY(newarray){
|
655
|
+
{
|
656
|
+
VALUE val;
|
657
|
+
rb_num_t num = (rb_num_t)GET_OPERAND(1);
|
658
|
+
|
659
|
+
DEBUG_ENTER_INSN("newarray");
|
660
|
+
ADD_PC(1+1);
|
661
|
+
PREFETCH(GET_PC());
|
662
|
+
#define CURRENT_INSN_newarray 1
|
663
|
+
#define INSN_IS_SC() 0
|
664
|
+
#define INSN_LABEL(lab) LABEL_newarray_##lab
|
665
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
666
|
+
COLLECT_USAGE_INSN(BIN(newarray));
|
667
|
+
COLLECT_USAGE_OPERAND(BIN(newarray), 0, num);
|
668
|
+
{
|
669
|
+
#line 443 "insns.def"
|
670
|
+
val = rb_ary_new4((long)num, STACK_ADDR_FROM_TOP(num));
|
671
|
+
POPN(num);
|
672
|
+
|
673
|
+
#line 674 "vm.inc"
|
674
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
675
|
+
PUSH(val);
|
676
|
+
#undef CURRENT_INSN_newarray
|
677
|
+
#undef INSN_IS_SC
|
678
|
+
#undef INSN_LABEL
|
679
|
+
#undef LABEL_IS_SC
|
680
|
+
END_INSN(newarray);}}}
|
681
|
+
INSN_ENTRY(duparray){
|
682
|
+
{
|
683
|
+
VALUE val;
|
684
|
+
VALUE ary = (VALUE)GET_OPERAND(1);
|
685
|
+
|
686
|
+
DEBUG_ENTER_INSN("duparray");
|
687
|
+
ADD_PC(1+1);
|
688
|
+
PREFETCH(GET_PC());
|
689
|
+
#define CURRENT_INSN_duparray 1
|
690
|
+
#define INSN_IS_SC() 0
|
691
|
+
#define INSN_LABEL(lab) LABEL_duparray_##lab
|
692
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
693
|
+
COLLECT_USAGE_INSN(BIN(duparray));
|
694
|
+
COLLECT_USAGE_OPERAND(BIN(duparray), 0, ary);
|
695
|
+
{
|
696
|
+
#line 458 "insns.def"
|
697
|
+
val = rb_ary_resurrect(ary);
|
698
|
+
|
699
|
+
#line 700 "vm.inc"
|
700
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
701
|
+
PUSH(val);
|
702
|
+
#undef CURRENT_INSN_duparray
|
703
|
+
#undef INSN_IS_SC
|
704
|
+
#undef INSN_LABEL
|
705
|
+
#undef LABEL_IS_SC
|
706
|
+
END_INSN(duparray);}}}
|
707
|
+
INSN_ENTRY(expandarray){
|
708
|
+
{
|
709
|
+
rb_num_t flag = (rb_num_t)GET_OPERAND(2);
|
710
|
+
rb_num_t num = (rb_num_t)GET_OPERAND(1);
|
711
|
+
VALUE ary = TOPN(0);
|
712
|
+
DEBUG_ENTER_INSN("expandarray");
|
713
|
+
ADD_PC(1+2);
|
714
|
+
PREFETCH(GET_PC());
|
715
|
+
POPN(1);
|
716
|
+
#define CURRENT_INSN_expandarray 1
|
717
|
+
#define INSN_IS_SC() 0
|
718
|
+
#define INSN_LABEL(lab) LABEL_expandarray_##lab
|
719
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
720
|
+
COLLECT_USAGE_INSN(BIN(expandarray));
|
721
|
+
COLLECT_USAGE_OPERAND(BIN(expandarray), 0, num);
|
722
|
+
COLLECT_USAGE_OPERAND(BIN(expandarray), 1, flag);
|
723
|
+
{
|
724
|
+
#line 479 "insns.def"
|
725
|
+
vm_expandarray(GET_CFP(), ary, num, (int)flag);
|
726
|
+
|
727
|
+
#line 728 "vm.inc"
|
728
|
+
#undef CURRENT_INSN_expandarray
|
729
|
+
#undef INSN_IS_SC
|
730
|
+
#undef INSN_LABEL
|
731
|
+
#undef LABEL_IS_SC
|
732
|
+
END_INSN(expandarray);}}}
|
733
|
+
INSN_ENTRY(concatarray){
|
734
|
+
{
|
735
|
+
VALUE ary;
|
736
|
+
|
737
|
+
VALUE ary1 = TOPN(1);
|
738
|
+
VALUE ary2st = TOPN(0);
|
739
|
+
DEBUG_ENTER_INSN("concatarray");
|
740
|
+
ADD_PC(1+0);
|
741
|
+
PREFETCH(GET_PC());
|
742
|
+
POPN(2);
|
743
|
+
#define CURRENT_INSN_concatarray 1
|
744
|
+
#define INSN_IS_SC() 0
|
745
|
+
#define INSN_LABEL(lab) LABEL_concatarray_##lab
|
746
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
747
|
+
COLLECT_USAGE_INSN(BIN(concatarray));
|
748
|
+
{
|
749
|
+
#line 493 "insns.def"
|
750
|
+
const VALUE ary2 = ary2st;
|
751
|
+
VALUE tmp1 = rb_check_convert_type(ary1, T_ARRAY, "Array", "to_a");
|
752
|
+
VALUE tmp2 = rb_check_convert_type(ary2, T_ARRAY, "Array", "to_a");
|
753
|
+
|
754
|
+
if (NIL_P(tmp1)) {
|
755
|
+
tmp1 = rb_ary_new3(1, ary1);
|
756
|
+
}
|
757
|
+
|
758
|
+
if (NIL_P(tmp2)) {
|
759
|
+
tmp2 = rb_ary_new3(1, ary2);
|
760
|
+
}
|
761
|
+
|
762
|
+
if (tmp1 == ary1) {
|
763
|
+
tmp1 = rb_ary_dup(ary1);
|
764
|
+
}
|
765
|
+
ary = rb_ary_concat(tmp1, tmp2);
|
766
|
+
|
767
|
+
#line 768 "vm.inc"
|
768
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
769
|
+
PUSH(ary);
|
770
|
+
#undef CURRENT_INSN_concatarray
|
771
|
+
#undef INSN_IS_SC
|
772
|
+
#undef INSN_LABEL
|
773
|
+
#undef LABEL_IS_SC
|
774
|
+
END_INSN(concatarray);}}}
|
775
|
+
INSN_ENTRY(splatarray){
|
776
|
+
{
|
777
|
+
VALUE obj;
|
778
|
+
VALUE flag = (VALUE)GET_OPERAND(1);
|
779
|
+
VALUE ary = TOPN(0);
|
780
|
+
DEBUG_ENTER_INSN("splatarray");
|
781
|
+
ADD_PC(1+1);
|
782
|
+
PREFETCH(GET_PC());
|
783
|
+
POPN(1);
|
784
|
+
#define CURRENT_INSN_splatarray 1
|
785
|
+
#define INSN_IS_SC() 0
|
786
|
+
#define INSN_LABEL(lab) LABEL_splatarray_##lab
|
787
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
788
|
+
COLLECT_USAGE_INSN(BIN(splatarray));
|
789
|
+
COLLECT_USAGE_OPERAND(BIN(splatarray), 0, flag);
|
790
|
+
{
|
791
|
+
#line 522 "insns.def"
|
792
|
+
VALUE tmp = rb_check_convert_type(ary, T_ARRAY, "Array", "to_a");
|
793
|
+
if (NIL_P(tmp)) {
|
794
|
+
tmp = rb_ary_new3(1, ary);
|
795
|
+
}
|
796
|
+
else if (RTEST(flag)) {
|
797
|
+
tmp = rb_ary_dup(tmp);
|
798
|
+
}
|
799
|
+
obj = tmp;
|
800
|
+
|
801
|
+
#line 802 "vm.inc"
|
802
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
803
|
+
PUSH(obj);
|
804
|
+
#undef CURRENT_INSN_splatarray
|
805
|
+
#undef INSN_IS_SC
|
806
|
+
#undef INSN_LABEL
|
807
|
+
#undef LABEL_IS_SC
|
808
|
+
END_INSN(splatarray);}}}
|
809
|
+
INSN_ENTRY(newhash){
|
810
|
+
{
|
811
|
+
VALUE val;
|
812
|
+
rb_num_t num = (rb_num_t)GET_OPERAND(1);
|
813
|
+
|
814
|
+
DEBUG_ENTER_INSN("newhash");
|
815
|
+
ADD_PC(1+1);
|
816
|
+
PREFETCH(GET_PC());
|
817
|
+
#define CURRENT_INSN_newhash 1
|
818
|
+
#define INSN_IS_SC() 0
|
819
|
+
#define INSN_LABEL(lab) LABEL_newhash_##lab
|
820
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
821
|
+
COLLECT_USAGE_INSN(BIN(newhash));
|
822
|
+
COLLECT_USAGE_OPERAND(BIN(newhash), 0, num);
|
823
|
+
{
|
824
|
+
#line 544 "insns.def"
|
825
|
+
rb_num_t i;
|
826
|
+
|
827
|
+
RUBY_DTRACE_CREATE_HOOK(HASH, num);
|
828
|
+
|
829
|
+
val = rb_hash_new();
|
830
|
+
|
831
|
+
for (i = num; i > 0; i -= 2) {
|
832
|
+
const VALUE v = TOPN(i - 2);
|
833
|
+
const VALUE k = TOPN(i - 1);
|
834
|
+
rb_hash_aset(val, k, v);
|
835
|
+
}
|
836
|
+
POPN(num);
|
837
|
+
|
838
|
+
#line 839 "vm.inc"
|
839
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
840
|
+
PUSH(val);
|
841
|
+
#undef CURRENT_INSN_newhash
|
842
|
+
#undef INSN_IS_SC
|
843
|
+
#undef INSN_LABEL
|
844
|
+
#undef LABEL_IS_SC
|
845
|
+
END_INSN(newhash);}}}
|
846
|
+
INSN_ENTRY(newrange){
|
847
|
+
{
|
848
|
+
VALUE val;
|
849
|
+
rb_num_t flag = (rb_num_t)GET_OPERAND(1);
|
850
|
+
VALUE low = TOPN(1);
|
851
|
+
VALUE high = TOPN(0);
|
852
|
+
DEBUG_ENTER_INSN("newrange");
|
853
|
+
ADD_PC(1+1);
|
854
|
+
PREFETCH(GET_PC());
|
855
|
+
POPN(2);
|
856
|
+
#define CURRENT_INSN_newrange 1
|
857
|
+
#define INSN_IS_SC() 0
|
858
|
+
#define INSN_LABEL(lab) LABEL_newrange_##lab
|
859
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
860
|
+
COLLECT_USAGE_INSN(BIN(newrange));
|
861
|
+
COLLECT_USAGE_OPERAND(BIN(newrange), 0, flag);
|
862
|
+
{
|
863
|
+
#line 569 "insns.def"
|
864
|
+
val = rb_range_new(low, high, (int)flag);
|
865
|
+
|
866
|
+
#line 867 "vm.inc"
|
867
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
868
|
+
PUSH(val);
|
869
|
+
#undef CURRENT_INSN_newrange
|
870
|
+
#undef INSN_IS_SC
|
871
|
+
#undef INSN_LABEL
|
872
|
+
#undef LABEL_IS_SC
|
873
|
+
END_INSN(newrange);}}}
|
874
|
+
INSN_ENTRY(pop){
|
875
|
+
{
|
876
|
+
|
877
|
+
VALUE val = TOPN(0);
|
878
|
+
DEBUG_ENTER_INSN("pop");
|
879
|
+
ADD_PC(1+0);
|
880
|
+
PREFETCH(GET_PC());
|
881
|
+
POPN(1);
|
882
|
+
#define CURRENT_INSN_pop 1
|
883
|
+
#define INSN_IS_SC() 0
|
884
|
+
#define INSN_LABEL(lab) LABEL_pop_##lab
|
885
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
886
|
+
COLLECT_USAGE_INSN(BIN(pop));
|
887
|
+
{
|
888
|
+
#line 587 "insns.def"
|
889
|
+
(void)val;
|
890
|
+
/* none */
|
891
|
+
|
892
|
+
#line 893 "vm.inc"
|
893
|
+
#undef CURRENT_INSN_pop
|
894
|
+
#undef INSN_IS_SC
|
895
|
+
#undef INSN_LABEL
|
896
|
+
#undef LABEL_IS_SC
|
897
|
+
END_INSN(pop);}}}
|
898
|
+
INSN_ENTRY(dup){
|
899
|
+
{
|
900
|
+
VALUE val2;
|
901
|
+
VALUE val1;
|
902
|
+
|
903
|
+
VALUE val = TOPN(0);
|
904
|
+
DEBUG_ENTER_INSN("dup");
|
905
|
+
ADD_PC(1+0);
|
906
|
+
PREFETCH(GET_PC());
|
907
|
+
POPN(1);
|
908
|
+
#define CURRENT_INSN_dup 1
|
909
|
+
#define INSN_IS_SC() 0
|
910
|
+
#define INSN_LABEL(lab) LABEL_dup_##lab
|
911
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
912
|
+
COLLECT_USAGE_INSN(BIN(dup));
|
913
|
+
{
|
914
|
+
#line 602 "insns.def"
|
915
|
+
val1 = val2 = val;
|
916
|
+
|
917
|
+
#line 918 "vm.inc"
|
918
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 2);
|
919
|
+
PUSH(val1);
|
920
|
+
PUSH(val2);
|
921
|
+
#undef CURRENT_INSN_dup
|
922
|
+
#undef INSN_IS_SC
|
923
|
+
#undef INSN_LABEL
|
924
|
+
#undef LABEL_IS_SC
|
925
|
+
END_INSN(dup);}}}
|
926
|
+
INSN_ENTRY(dupn){
|
927
|
+
{
|
928
|
+
rb_num_t n = (rb_num_t)GET_OPERAND(1);
|
929
|
+
|
930
|
+
DEBUG_ENTER_INSN("dupn");
|
931
|
+
ADD_PC(1+1);
|
932
|
+
PREFETCH(GET_PC());
|
933
|
+
#define CURRENT_INSN_dupn 1
|
934
|
+
#define INSN_IS_SC() 0
|
935
|
+
#define INSN_LABEL(lab) LABEL_dupn_##lab
|
936
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
937
|
+
COLLECT_USAGE_INSN(BIN(dupn));
|
938
|
+
COLLECT_USAGE_OPERAND(BIN(dupn), 0, n);
|
939
|
+
{
|
940
|
+
#line 616 "insns.def"
|
941
|
+
rb_num_t i;
|
942
|
+
VALUE *sp = STACK_ADDR_FROM_TOP(n);
|
943
|
+
for (i = 0; i < n; i++) {
|
944
|
+
GET_SP()[i] = sp[i];
|
945
|
+
}
|
946
|
+
INC_SP(n);
|
947
|
+
|
948
|
+
#line 949 "vm.inc"
|
949
|
+
#undef CURRENT_INSN_dupn
|
950
|
+
#undef INSN_IS_SC
|
951
|
+
#undef INSN_LABEL
|
952
|
+
#undef LABEL_IS_SC
|
953
|
+
END_INSN(dupn);}}}
|
954
|
+
INSN_ENTRY(swap){
|
955
|
+
{
|
956
|
+
|
957
|
+
VALUE val = TOPN(1);
|
958
|
+
VALUE obj = TOPN(0);
|
959
|
+
DEBUG_ENTER_INSN("swap");
|
960
|
+
ADD_PC(1+0);
|
961
|
+
PREFETCH(GET_PC());
|
962
|
+
POPN(2);
|
963
|
+
#define CURRENT_INSN_swap 1
|
964
|
+
#define INSN_IS_SC() 0
|
965
|
+
#define INSN_LABEL(lab) LABEL_swap_##lab
|
966
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
967
|
+
COLLECT_USAGE_INSN(BIN(swap));
|
968
|
+
{
|
969
|
+
#line 636 "insns.def"
|
970
|
+
/* none */
|
971
|
+
|
972
|
+
#line 973 "vm.inc"
|
973
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 2);
|
974
|
+
PUSH(obj);
|
975
|
+
PUSH(val);
|
976
|
+
#undef CURRENT_INSN_swap
|
977
|
+
#undef INSN_IS_SC
|
978
|
+
#undef INSN_LABEL
|
979
|
+
#undef LABEL_IS_SC
|
980
|
+
END_INSN(swap);}}}
|
981
|
+
INSN_ENTRY(reverse){
|
982
|
+
{
|
983
|
+
rb_num_t n = (rb_num_t)GET_OPERAND(1);
|
984
|
+
|
985
|
+
DEBUG_ENTER_INSN("reverse");
|
986
|
+
ADD_PC(1+1);
|
987
|
+
PREFETCH(GET_PC());
|
988
|
+
#define CURRENT_INSN_reverse 1
|
989
|
+
#define INSN_IS_SC() 0
|
990
|
+
#define INSN_LABEL(lab) LABEL_reverse_##lab
|
991
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
992
|
+
COLLECT_USAGE_INSN(BIN(reverse));
|
993
|
+
COLLECT_USAGE_OPERAND(BIN(reverse), 0, n);
|
994
|
+
{
|
995
|
+
#line 650 "insns.def"
|
996
|
+
rb_num_t i;
|
997
|
+
VALUE *sp = STACK_ADDR_FROM_TOP(n);
|
998
|
+
|
999
|
+
for (i=0; i<n/2; i++) {
|
1000
|
+
VALUE v0 = sp[i];
|
1001
|
+
VALUE v1 = TOPN(i);
|
1002
|
+
sp[i] = v1;
|
1003
|
+
TOPN(i) = v0;
|
1004
|
+
}
|
1005
|
+
|
1006
|
+
#line 1007 "vm.inc"
|
1007
|
+
#undef CURRENT_INSN_reverse
|
1008
|
+
#undef INSN_IS_SC
|
1009
|
+
#undef INSN_LABEL
|
1010
|
+
#undef LABEL_IS_SC
|
1011
|
+
END_INSN(reverse);}}}
|
1012
|
+
INSN_ENTRY(reput){
|
1013
|
+
{
|
1014
|
+
|
1015
|
+
VALUE val = TOPN(0);
|
1016
|
+
DEBUG_ENTER_INSN("reput");
|
1017
|
+
ADD_PC(1+0);
|
1018
|
+
PREFETCH(GET_PC());
|
1019
|
+
POPN(1);
|
1020
|
+
#define CURRENT_INSN_reput 1
|
1021
|
+
#define INSN_IS_SC() 0
|
1022
|
+
#define INSN_LABEL(lab) LABEL_reput_##lab
|
1023
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1024
|
+
COLLECT_USAGE_INSN(BIN(reput));
|
1025
|
+
{
|
1026
|
+
#line 672 "insns.def"
|
1027
|
+
/* none */
|
1028
|
+
|
1029
|
+
#line 1030 "vm.inc"
|
1030
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1031
|
+
PUSH(val);
|
1032
|
+
#undef CURRENT_INSN_reput
|
1033
|
+
#undef INSN_IS_SC
|
1034
|
+
#undef INSN_LABEL
|
1035
|
+
#undef LABEL_IS_SC
|
1036
|
+
END_INSN(reput);}}}
|
1037
|
+
INSN_ENTRY(topn){
|
1038
|
+
{
|
1039
|
+
VALUE val;
|
1040
|
+
rb_num_t n = (rb_num_t)GET_OPERAND(1);
|
1041
|
+
|
1042
|
+
DEBUG_ENTER_INSN("topn");
|
1043
|
+
ADD_PC(1+1);
|
1044
|
+
PREFETCH(GET_PC());
|
1045
|
+
#define CURRENT_INSN_topn 1
|
1046
|
+
#define INSN_IS_SC() 0
|
1047
|
+
#define INSN_LABEL(lab) LABEL_topn_##lab
|
1048
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1049
|
+
COLLECT_USAGE_INSN(BIN(topn));
|
1050
|
+
COLLECT_USAGE_OPERAND(BIN(topn), 0, n);
|
1051
|
+
{
|
1052
|
+
#line 686 "insns.def"
|
1053
|
+
val = TOPN(n);
|
1054
|
+
|
1055
|
+
#line 1056 "vm.inc"
|
1056
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1057
|
+
PUSH(val);
|
1058
|
+
#undef CURRENT_INSN_topn
|
1059
|
+
#undef INSN_IS_SC
|
1060
|
+
#undef INSN_LABEL
|
1061
|
+
#undef LABEL_IS_SC
|
1062
|
+
END_INSN(topn);}}}
|
1063
|
+
INSN_ENTRY(setn){
|
1064
|
+
{
|
1065
|
+
rb_num_t n = (rb_num_t)GET_OPERAND(1);
|
1066
|
+
VALUE val = TOPN(0);
|
1067
|
+
DEBUG_ENTER_INSN("setn");
|
1068
|
+
ADD_PC(1+1);
|
1069
|
+
PREFETCH(GET_PC());
|
1070
|
+
POPN(1);
|
1071
|
+
#define CURRENT_INSN_setn 1
|
1072
|
+
#define INSN_IS_SC() 0
|
1073
|
+
#define INSN_LABEL(lab) LABEL_setn_##lab
|
1074
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1075
|
+
COLLECT_USAGE_INSN(BIN(setn));
|
1076
|
+
COLLECT_USAGE_OPERAND(BIN(setn), 0, n);
|
1077
|
+
{
|
1078
|
+
#line 700 "insns.def"
|
1079
|
+
TOPN(n-1) = val;
|
1080
|
+
|
1081
|
+
#line 1082 "vm.inc"
|
1082
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1083
|
+
PUSH(val);
|
1084
|
+
#undef CURRENT_INSN_setn
|
1085
|
+
#undef INSN_IS_SC
|
1086
|
+
#undef INSN_LABEL
|
1087
|
+
#undef LABEL_IS_SC
|
1088
|
+
END_INSN(setn);}}}
|
1089
|
+
INSN_ENTRY(adjuststack){
|
1090
|
+
{
|
1091
|
+
rb_num_t n = (rb_num_t)GET_OPERAND(1);
|
1092
|
+
|
1093
|
+
DEBUG_ENTER_INSN("adjuststack");
|
1094
|
+
ADD_PC(1+1);
|
1095
|
+
PREFETCH(GET_PC());
|
1096
|
+
#define CURRENT_INSN_adjuststack 1
|
1097
|
+
#define INSN_IS_SC() 0
|
1098
|
+
#define INSN_LABEL(lab) LABEL_adjuststack_##lab
|
1099
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1100
|
+
COLLECT_USAGE_INSN(BIN(adjuststack));
|
1101
|
+
COLLECT_USAGE_OPERAND(BIN(adjuststack), 0, n);
|
1102
|
+
{
|
1103
|
+
#line 714 "insns.def"
|
1104
|
+
DEC_SP(n);
|
1105
|
+
|
1106
|
+
#line 1107 "vm.inc"
|
1107
|
+
#undef CURRENT_INSN_adjuststack
|
1108
|
+
#undef INSN_IS_SC
|
1109
|
+
#undef INSN_LABEL
|
1110
|
+
#undef LABEL_IS_SC
|
1111
|
+
END_INSN(adjuststack);}}}
|
1112
|
+
INSN_ENTRY(defined){
|
1113
|
+
{
|
1114
|
+
VALUE val;
|
1115
|
+
VALUE needstr = (VALUE)GET_OPERAND(3);
|
1116
|
+
VALUE obj = (VALUE)GET_OPERAND(2);
|
1117
|
+
rb_num_t op_type = (rb_num_t)GET_OPERAND(1);
|
1118
|
+
VALUE v = TOPN(0);
|
1119
|
+
DEBUG_ENTER_INSN("defined");
|
1120
|
+
ADD_PC(1+3);
|
1121
|
+
PREFETCH(GET_PC());
|
1122
|
+
POPN(1);
|
1123
|
+
#define CURRENT_INSN_defined 1
|
1124
|
+
#define INSN_IS_SC() 0
|
1125
|
+
#define INSN_LABEL(lab) LABEL_defined_##lab
|
1126
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1127
|
+
COLLECT_USAGE_INSN(BIN(defined));
|
1128
|
+
COLLECT_USAGE_OPERAND(BIN(defined), 0, op_type);
|
1129
|
+
COLLECT_USAGE_OPERAND(BIN(defined), 1, obj);
|
1130
|
+
COLLECT_USAGE_OPERAND(BIN(defined), 2, needstr);
|
1131
|
+
{
|
1132
|
+
#line 733 "insns.def"
|
1133
|
+
val = vm_defined(th, GET_CFP(), op_type, obj, needstr, v);
|
1134
|
+
|
1135
|
+
#line 1136 "vm.inc"
|
1136
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1137
|
+
PUSH(val);
|
1138
|
+
#undef CURRENT_INSN_defined
|
1139
|
+
#undef INSN_IS_SC
|
1140
|
+
#undef INSN_LABEL
|
1141
|
+
#undef LABEL_IS_SC
|
1142
|
+
END_INSN(defined);}}}
|
1143
|
+
INSN_ENTRY(checkmatch){
|
1144
|
+
{
|
1145
|
+
VALUE result;
|
1146
|
+
rb_num_t flag = (rb_num_t)GET_OPERAND(1);
|
1147
|
+
VALUE target = TOPN(1);
|
1148
|
+
VALUE pattern = TOPN(0);
|
1149
|
+
DEBUG_ENTER_INSN("checkmatch");
|
1150
|
+
ADD_PC(1+1);
|
1151
|
+
PREFETCH(GET_PC());
|
1152
|
+
POPN(2);
|
1153
|
+
#define CURRENT_INSN_checkmatch 1
|
1154
|
+
#define INSN_IS_SC() 0
|
1155
|
+
#define INSN_LABEL(lab) LABEL_checkmatch_##lab
|
1156
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1157
|
+
COLLECT_USAGE_INSN(BIN(checkmatch));
|
1158
|
+
COLLECT_USAGE_OPERAND(BIN(checkmatch), 0, flag);
|
1159
|
+
{
|
1160
|
+
#line 752 "insns.def"
|
1161
|
+
enum vm_check_match_type checkmatch_type =
|
1162
|
+
(enum vm_check_match_type)(flag & VM_CHECKMATCH_TYPE_MASK);
|
1163
|
+
result = Qfalse;
|
1164
|
+
|
1165
|
+
if (flag & VM_CHECKMATCH_ARRAY) {
|
1166
|
+
int i;
|
1167
|
+
for (i = 0; i < RARRAY_LEN(pattern); i++) {
|
1168
|
+
if (RTEST(check_match(RARRAY_AREF(pattern, i), target, checkmatch_type))) {
|
1169
|
+
result = Qtrue;
|
1170
|
+
break;
|
1171
|
+
}
|
1172
|
+
}
|
1173
|
+
}
|
1174
|
+
else {
|
1175
|
+
if (RTEST(check_match(pattern, target, checkmatch_type))) {
|
1176
|
+
result = Qtrue;
|
1177
|
+
}
|
1178
|
+
}
|
1179
|
+
|
1180
|
+
#line 1181 "vm.inc"
|
1181
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1182
|
+
PUSH(result);
|
1183
|
+
#undef CURRENT_INSN_checkmatch
|
1184
|
+
#undef INSN_IS_SC
|
1185
|
+
#undef INSN_LABEL
|
1186
|
+
#undef LABEL_IS_SC
|
1187
|
+
END_INSN(checkmatch);}}}
|
1188
|
+
INSN_ENTRY(checkkeyword){
|
1189
|
+
{
|
1190
|
+
VALUE ret;
|
1191
|
+
rb_num_t keyword_index = (rb_num_t)GET_OPERAND(2);
|
1192
|
+
lindex_t kw_bits_index = (lindex_t)GET_OPERAND(1);
|
1193
|
+
|
1194
|
+
DEBUG_ENTER_INSN("checkkeyword");
|
1195
|
+
ADD_PC(1+2);
|
1196
|
+
PREFETCH(GET_PC());
|
1197
|
+
#define CURRENT_INSN_checkkeyword 1
|
1198
|
+
#define INSN_IS_SC() 0
|
1199
|
+
#define INSN_LABEL(lab) LABEL_checkkeyword_##lab
|
1200
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1201
|
+
COLLECT_USAGE_INSN(BIN(checkkeyword));
|
1202
|
+
COLLECT_USAGE_OPERAND(BIN(checkkeyword), 0, kw_bits_index);
|
1203
|
+
COLLECT_USAGE_OPERAND(BIN(checkkeyword), 1, keyword_index);
|
1204
|
+
{
|
1205
|
+
#line 783 "insns.def"
|
1206
|
+
const VALUE *ep = GET_EP();
|
1207
|
+
const VALUE kw_bits = *(ep - kw_bits_index);
|
1208
|
+
|
1209
|
+
if (FIXNUM_P(kw_bits)) {
|
1210
|
+
int bits = FIX2INT(kw_bits);
|
1211
|
+
ret = (bits & (0x01 << keyword_index)) ? Qfalse : Qtrue;
|
1212
|
+
}
|
1213
|
+
else {
|
1214
|
+
assert(RB_TYPE_P(kw_bits, T_HASH));
|
1215
|
+
ret = rb_hash_has_key(kw_bits, INT2FIX(keyword_index)) ? Qfalse : Qtrue;
|
1216
|
+
}
|
1217
|
+
|
1218
|
+
#line 1219 "vm.inc"
|
1219
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1220
|
+
PUSH(ret);
|
1221
|
+
#undef CURRENT_INSN_checkkeyword
|
1222
|
+
#undef INSN_IS_SC
|
1223
|
+
#undef INSN_LABEL
|
1224
|
+
#undef LABEL_IS_SC
|
1225
|
+
END_INSN(checkkeyword);}}}
|
1226
|
+
INSN_ENTRY(trace){
|
1227
|
+
{
|
1228
|
+
rb_num_t nf = (rb_num_t)GET_OPERAND(1);
|
1229
|
+
|
1230
|
+
DEBUG_ENTER_INSN("trace");
|
1231
|
+
ADD_PC(1+1);
|
1232
|
+
PREFETCH(GET_PC());
|
1233
|
+
#define CURRENT_INSN_trace 1
|
1234
|
+
#define INSN_IS_SC() 0
|
1235
|
+
#define INSN_LABEL(lab) LABEL_trace_##lab
|
1236
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1237
|
+
COLLECT_USAGE_INSN(BIN(trace));
|
1238
|
+
COLLECT_USAGE_OPERAND(BIN(trace), 0, nf);
|
1239
|
+
{
|
1240
|
+
#line 807 "insns.def"
|
1241
|
+
rb_event_flag_t flag = (rb_event_flag_t)nf;
|
1242
|
+
|
1243
|
+
if (RUBY_DTRACE_METHOD_ENTRY_ENABLED() ||
|
1244
|
+
RUBY_DTRACE_METHOD_RETURN_ENABLED() ||
|
1245
|
+
RUBY_DTRACE_CMETHOD_ENTRY_ENABLED() ||
|
1246
|
+
RUBY_DTRACE_CMETHOD_RETURN_ENABLED()) {
|
1247
|
+
|
1248
|
+
switch (flag) {
|
1249
|
+
case RUBY_EVENT_CALL:
|
1250
|
+
RUBY_DTRACE_METHOD_ENTRY_HOOK(th, 0, 0);
|
1251
|
+
break;
|
1252
|
+
case RUBY_EVENT_C_CALL:
|
1253
|
+
RUBY_DTRACE_CMETHOD_ENTRY_HOOK(th, 0, 0);
|
1254
|
+
break;
|
1255
|
+
case RUBY_EVENT_RETURN:
|
1256
|
+
RUBY_DTRACE_METHOD_RETURN_HOOK(th, 0, 0);
|
1257
|
+
break;
|
1258
|
+
case RUBY_EVENT_C_RETURN:
|
1259
|
+
RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, 0, 0);
|
1260
|
+
break;
|
1261
|
+
}
|
1262
|
+
}
|
1263
|
+
|
1264
|
+
EXEC_EVENT_HOOK(th, flag, GET_SELF(), 0, 0 /* id and klass are resolved at callee */,
|
1265
|
+
(flag & (RUBY_EVENT_RETURN | RUBY_EVENT_B_RETURN)) ? TOPN(0) : Qundef);
|
1266
|
+
|
1267
|
+
#line 1268 "vm.inc"
|
1268
|
+
#undef CURRENT_INSN_trace
|
1269
|
+
#undef INSN_IS_SC
|
1270
|
+
#undef INSN_LABEL
|
1271
|
+
#undef LABEL_IS_SC
|
1272
|
+
END_INSN(trace);}}}
|
1273
|
+
INSN_ENTRY(defineclass){
|
1274
|
+
{
|
1275
|
+
VALUE val;
|
1276
|
+
rb_num_t flags = (rb_num_t)GET_OPERAND(3);
|
1277
|
+
ISEQ class_iseq = (ISEQ)GET_OPERAND(2);
|
1278
|
+
ID id = (ID)GET_OPERAND(1);
|
1279
|
+
VALUE cbase = TOPN(1);
|
1280
|
+
VALUE super = TOPN(0);
|
1281
|
+
DEBUG_ENTER_INSN("defineclass");
|
1282
|
+
ADD_PC(1+3);
|
1283
|
+
PREFETCH(GET_PC());
|
1284
|
+
POPN(2);
|
1285
|
+
#define CURRENT_INSN_defineclass 1
|
1286
|
+
#define INSN_IS_SC() 0
|
1287
|
+
#define INSN_LABEL(lab) LABEL_defineclass_##lab
|
1288
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1289
|
+
COLLECT_USAGE_INSN(BIN(defineclass));
|
1290
|
+
COLLECT_USAGE_OPERAND(BIN(defineclass), 0, id);
|
1291
|
+
COLLECT_USAGE_OPERAND(BIN(defineclass), 1, class_iseq);
|
1292
|
+
COLLECT_USAGE_OPERAND(BIN(defineclass), 2, flags);
|
1293
|
+
{
|
1294
|
+
#line 853 "insns.def"
|
1295
|
+
VALUE klass;
|
1296
|
+
rb_vm_defineclass_type_t type = VM_DEFINECLASS_TYPE(flags);
|
1297
|
+
|
1298
|
+
switch (type) {
|
1299
|
+
case VM_DEFINECLASS_TYPE_CLASS:
|
1300
|
+
/* val is dummy. classdef returns class scope value */
|
1301
|
+
|
1302
|
+
if (VM_DEFINECLASS_HAS_SUPERCLASS_P(flags) &&
|
1303
|
+
!RB_TYPE_P(super, T_CLASS)) {
|
1304
|
+
rb_raise(rb_eTypeError, "superclass must be a Class (%"PRIsVALUE" given)",
|
1305
|
+
rb_obj_class(super));
|
1306
|
+
}
|
1307
|
+
|
1308
|
+
vm_check_if_namespace(cbase);
|
1309
|
+
|
1310
|
+
/* find klass */
|
1311
|
+
rb_autoload_load(cbase, id);
|
1312
|
+
if ((klass = vm_search_const_defined_class(cbase, id)) != 0) {
|
1313
|
+
/* already exist */
|
1314
|
+
klass = VM_DEFINECLASS_SCOPED_P(flags) ?
|
1315
|
+
rb_public_const_get_at(klass, id) : rb_const_get_at(klass, id);
|
1316
|
+
if (!RB_TYPE_P(klass, T_CLASS)) {
|
1317
|
+
rb_raise(rb_eTypeError, "%"PRIsVALUE" is not a class", rb_id2str(id));
|
1318
|
+
}
|
1319
|
+
|
1320
|
+
if (VM_DEFINECLASS_HAS_SUPERCLASS_P(flags)) {
|
1321
|
+
VALUE tmp;
|
1322
|
+
tmp = rb_class_real(RCLASS_SUPER(klass));
|
1323
|
+
|
1324
|
+
if (tmp != super) {
|
1325
|
+
rb_raise(rb_eTypeError, "superclass mismatch for class %"PRIsVALUE"",
|
1326
|
+
rb_id2str(id));
|
1327
|
+
}
|
1328
|
+
}
|
1329
|
+
}
|
1330
|
+
else {
|
1331
|
+
if (!VM_DEFINECLASS_HAS_SUPERCLASS_P(flags)) {
|
1332
|
+
super = rb_cObject;
|
1333
|
+
}
|
1334
|
+
/* new class declaration */
|
1335
|
+
klass = rb_define_class_id(id, super);
|
1336
|
+
rb_set_class_path_string(klass, cbase, rb_id2str(id));
|
1337
|
+
rb_const_set(cbase, id, klass);
|
1338
|
+
rb_class_inherited(super, klass);
|
1339
|
+
}
|
1340
|
+
break;
|
1341
|
+
case VM_DEFINECLASS_TYPE_SINGLETON_CLASS:
|
1342
|
+
/* val is dummy. classdef returns class scope value */
|
1343
|
+
/* super is dummy */
|
1344
|
+
klass = rb_singleton_class(cbase);
|
1345
|
+
break;
|
1346
|
+
case VM_DEFINECLASS_TYPE_MODULE:
|
1347
|
+
/* val is dummy. classdef returns class scope value */
|
1348
|
+
/* super is dummy */
|
1349
|
+
|
1350
|
+
vm_check_if_namespace(cbase);
|
1351
|
+
|
1352
|
+
/* find klass */
|
1353
|
+
if ((klass = vm_search_const_defined_class(cbase, id)) != 0) {
|
1354
|
+
klass = VM_DEFINECLASS_SCOPED_P(flags) ?
|
1355
|
+
rb_public_const_get_at(klass, id) : rb_const_get_at(klass, id);
|
1356
|
+
/* already exist */
|
1357
|
+
if (!RB_TYPE_P(klass, T_MODULE)) {
|
1358
|
+
rb_raise(rb_eTypeError, "%"PRIsVALUE" is not a module", rb_id2str(id));
|
1359
|
+
}
|
1360
|
+
}
|
1361
|
+
else {
|
1362
|
+
/* new module declaration */
|
1363
|
+
klass = rb_define_module_id(id);
|
1364
|
+
rb_set_class_path_string(klass, cbase, rb_id2str(id));
|
1365
|
+
rb_const_set(cbase, id, klass);
|
1366
|
+
}
|
1367
|
+
break;
|
1368
|
+
default:
|
1369
|
+
rb_bug("unknown defineclass type: %d", (int)type);
|
1370
|
+
}
|
1371
|
+
|
1372
|
+
rb_iseq_check(class_iseq);
|
1373
|
+
|
1374
|
+
/* enter scope */
|
1375
|
+
vm_push_frame(th, class_iseq, VM_FRAME_MAGIC_CLASS, klass,
|
1376
|
+
VM_ENVVAL_BLOCK_PTR(GET_BLOCK_PTR()),
|
1377
|
+
(VALUE)vm_cref_push(th, klass, NULL, FALSE),
|
1378
|
+
class_iseq->body->iseq_encoded, GET_SP(),
|
1379
|
+
class_iseq->body->local_size,
|
1380
|
+
class_iseq->body->stack_max);
|
1381
|
+
RESTORE_REGS();
|
1382
|
+
NEXT_INSN();
|
1383
|
+
|
1384
|
+
#line 1385 "vm.inc"
|
1385
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1386
|
+
PUSH(val);
|
1387
|
+
#undef CURRENT_INSN_defineclass
|
1388
|
+
#undef INSN_IS_SC
|
1389
|
+
#undef INSN_LABEL
|
1390
|
+
#undef LABEL_IS_SC
|
1391
|
+
END_INSN(defineclass);}}}
|
1392
|
+
INSN_ENTRY(send){
|
1393
|
+
{
|
1394
|
+
VALUE val;
|
1395
|
+
ISEQ blockiseq = (ISEQ)GET_OPERAND(3);
|
1396
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
1397
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
1398
|
+
|
1399
|
+
DEBUG_ENTER_INSN("send");
|
1400
|
+
ADD_PC(1+3);
|
1401
|
+
PREFETCH(GET_PC());
|
1402
|
+
#define CURRENT_INSN_send 1
|
1403
|
+
#define INSN_IS_SC() 0
|
1404
|
+
#define INSN_LABEL(lab) LABEL_send_##lab
|
1405
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1406
|
+
COLLECT_USAGE_INSN(BIN(send));
|
1407
|
+
COLLECT_USAGE_OPERAND(BIN(send), 0, ci);
|
1408
|
+
COLLECT_USAGE_OPERAND(BIN(send), 1, cc);
|
1409
|
+
COLLECT_USAGE_OPERAND(BIN(send), 2, blockiseq);
|
1410
|
+
{
|
1411
|
+
#line 959 "insns.def"
|
1412
|
+
struct rb_calling_info calling;
|
1413
|
+
|
1414
|
+
vm_caller_setup_arg_block(th, reg_cfp, &calling, ci, blockiseq, FALSE);
|
1415
|
+
vm_search_method(ci, cc, calling.recv = TOPN(calling.argc = ci->orig_argc));
|
1416
|
+
CALL_METHOD(&calling, ci, cc);
|
1417
|
+
|
1418
|
+
#line 1419 "vm.inc"
|
1419
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1420
|
+
PUSH(val);
|
1421
|
+
#undef CURRENT_INSN_send
|
1422
|
+
#undef INSN_IS_SC
|
1423
|
+
#undef INSN_LABEL
|
1424
|
+
#undef LABEL_IS_SC
|
1425
|
+
END_INSN(send);}}}
|
1426
|
+
INSN_ENTRY(opt_str_freeze){
|
1427
|
+
{
|
1428
|
+
VALUE val;
|
1429
|
+
VALUE str = (VALUE)GET_OPERAND(1);
|
1430
|
+
|
1431
|
+
DEBUG_ENTER_INSN("opt_str_freeze");
|
1432
|
+
ADD_PC(1+1);
|
1433
|
+
PREFETCH(GET_PC());
|
1434
|
+
#define CURRENT_INSN_opt_str_freeze 1
|
1435
|
+
#define INSN_IS_SC() 0
|
1436
|
+
#define INSN_LABEL(lab) LABEL_opt_str_freeze_##lab
|
1437
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1438
|
+
COLLECT_USAGE_INSN(BIN(opt_str_freeze));
|
1439
|
+
COLLECT_USAGE_OPERAND(BIN(opt_str_freeze), 0, str);
|
1440
|
+
{
|
1441
|
+
#line 972 "insns.def"
|
1442
|
+
if (BASIC_OP_UNREDEFINED_P(BOP_FREEZE, STRING_REDEFINED_OP_FLAG)) {
|
1443
|
+
val = str;
|
1444
|
+
}
|
1445
|
+
else {
|
1446
|
+
val = rb_funcall(rb_str_resurrect(str), idFreeze, 0);
|
1447
|
+
}
|
1448
|
+
|
1449
|
+
#line 1450 "vm.inc"
|
1450
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1451
|
+
PUSH(val);
|
1452
|
+
#undef CURRENT_INSN_opt_str_freeze
|
1453
|
+
#undef INSN_IS_SC
|
1454
|
+
#undef INSN_LABEL
|
1455
|
+
#undef LABEL_IS_SC
|
1456
|
+
END_INSN(opt_str_freeze);}}}
|
1457
|
+
INSN_ENTRY(opt_send_without_block){
|
1458
|
+
{
|
1459
|
+
VALUE val;
|
1460
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
1461
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
1462
|
+
|
1463
|
+
DEBUG_ENTER_INSN("opt_send_without_block");
|
1464
|
+
ADD_PC(1+2);
|
1465
|
+
PREFETCH(GET_PC());
|
1466
|
+
#define CURRENT_INSN_opt_send_without_block 1
|
1467
|
+
#define INSN_IS_SC() 0
|
1468
|
+
#define INSN_LABEL(lab) LABEL_opt_send_without_block_##lab
|
1469
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1470
|
+
COLLECT_USAGE_INSN(BIN(opt_send_without_block));
|
1471
|
+
COLLECT_USAGE_OPERAND(BIN(opt_send_without_block), 0, ci);
|
1472
|
+
COLLECT_USAGE_OPERAND(BIN(opt_send_without_block), 1, cc);
|
1473
|
+
{
|
1474
|
+
#line 991 "insns.def"
|
1475
|
+
struct rb_calling_info calling;
|
1476
|
+
calling.blockptr = NULL;
|
1477
|
+
vm_search_method(ci, cc, calling.recv = TOPN(calling.argc = ci->orig_argc));
|
1478
|
+
CALL_METHOD(&calling, ci, cc);
|
1479
|
+
|
1480
|
+
#line 1481 "vm.inc"
|
1481
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1482
|
+
PUSH(val);
|
1483
|
+
#undef CURRENT_INSN_opt_send_without_block
|
1484
|
+
#undef INSN_IS_SC
|
1485
|
+
#undef INSN_LABEL
|
1486
|
+
#undef LABEL_IS_SC
|
1487
|
+
END_INSN(opt_send_without_block);}}}
|
1488
|
+
INSN_ENTRY(invokesuper){
|
1489
|
+
{
|
1490
|
+
VALUE val;
|
1491
|
+
ISEQ blockiseq = (ISEQ)GET_OPERAND(3);
|
1492
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
1493
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
1494
|
+
|
1495
|
+
DEBUG_ENTER_INSN("invokesuper");
|
1496
|
+
ADD_PC(1+3);
|
1497
|
+
PREFETCH(GET_PC());
|
1498
|
+
#define CURRENT_INSN_invokesuper 1
|
1499
|
+
#define INSN_IS_SC() 0
|
1500
|
+
#define INSN_LABEL(lab) LABEL_invokesuper_##lab
|
1501
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1502
|
+
COLLECT_USAGE_INSN(BIN(invokesuper));
|
1503
|
+
COLLECT_USAGE_OPERAND(BIN(invokesuper), 0, ci);
|
1504
|
+
COLLECT_USAGE_OPERAND(BIN(invokesuper), 1, cc);
|
1505
|
+
COLLECT_USAGE_OPERAND(BIN(invokesuper), 2, blockiseq);
|
1506
|
+
{
|
1507
|
+
#line 1008 "insns.def"
|
1508
|
+
struct rb_calling_info calling;
|
1509
|
+
calling.argc = ci->orig_argc;
|
1510
|
+
|
1511
|
+
vm_caller_setup_arg_block(th, reg_cfp, &calling, ci, blockiseq, TRUE);
|
1512
|
+
calling.recv = GET_SELF();
|
1513
|
+
vm_search_super_method(th, GET_CFP(), &calling, ci, cc);
|
1514
|
+
CALL_METHOD(&calling, ci, cc);
|
1515
|
+
|
1516
|
+
#line 1517 "vm.inc"
|
1517
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1518
|
+
PUSH(val);
|
1519
|
+
#undef CURRENT_INSN_invokesuper
|
1520
|
+
#undef INSN_IS_SC
|
1521
|
+
#undef INSN_LABEL
|
1522
|
+
#undef LABEL_IS_SC
|
1523
|
+
END_INSN(invokesuper);}}}
|
1524
|
+
INSN_ENTRY(invokeblock){
|
1525
|
+
{
|
1526
|
+
VALUE val;
|
1527
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
1528
|
+
|
1529
|
+
DEBUG_ENTER_INSN("invokeblock");
|
1530
|
+
ADD_PC(1+1);
|
1531
|
+
PREFETCH(GET_PC());
|
1532
|
+
#define CURRENT_INSN_invokeblock 1
|
1533
|
+
#define INSN_IS_SC() 0
|
1534
|
+
#define INSN_LABEL(lab) LABEL_invokeblock_##lab
|
1535
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1536
|
+
COLLECT_USAGE_INSN(BIN(invokeblock));
|
1537
|
+
COLLECT_USAGE_OPERAND(BIN(invokeblock), 0, ci);
|
1538
|
+
{
|
1539
|
+
#line 1028 "insns.def"
|
1540
|
+
struct rb_calling_info calling;
|
1541
|
+
calling.argc = ci->orig_argc;
|
1542
|
+
calling.blockptr = NULL;
|
1543
|
+
calling.recv = GET_SELF();
|
1544
|
+
|
1545
|
+
val = vm_invoke_block(th, GET_CFP(), &calling, ci);
|
1546
|
+
if (val == Qundef) {
|
1547
|
+
RESTORE_REGS();
|
1548
|
+
NEXT_INSN();
|
1549
|
+
}
|
1550
|
+
|
1551
|
+
#line 1552 "vm.inc"
|
1552
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1553
|
+
PUSH(val);
|
1554
|
+
#undef CURRENT_INSN_invokeblock
|
1555
|
+
#undef INSN_IS_SC
|
1556
|
+
#undef INSN_LABEL
|
1557
|
+
#undef LABEL_IS_SC
|
1558
|
+
END_INSN(invokeblock);}}}
|
1559
|
+
INSN_ENTRY(leave){
|
1560
|
+
{
|
1561
|
+
|
1562
|
+
VALUE val = TOPN(0);
|
1563
|
+
DEBUG_ENTER_INSN("leave");
|
1564
|
+
ADD_PC(1+0);
|
1565
|
+
PREFETCH(GET_PC());
|
1566
|
+
POPN(1);
|
1567
|
+
#define CURRENT_INSN_leave 1
|
1568
|
+
#define INSN_IS_SC() 0
|
1569
|
+
#define INSN_LABEL(lab) LABEL_leave_##lab
|
1570
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1571
|
+
COLLECT_USAGE_INSN(BIN(leave));
|
1572
|
+
{
|
1573
|
+
#line 1051 "insns.def"
|
1574
|
+
if (OPT_CHECKED_RUN) {
|
1575
|
+
const VALUE *const bp = vm_base_ptr(reg_cfp);
|
1576
|
+
if (reg_cfp->sp != bp) {
|
1577
|
+
rb_bug("Stack consistency error (sp: %"PRIdPTRDIFF", bp: %"PRIdPTRDIFF")",
|
1578
|
+
VM_SP_CNT(th, reg_cfp->sp), VM_SP_CNT(th, bp));
|
1579
|
+
}
|
1580
|
+
}
|
1581
|
+
|
1582
|
+
RUBY_VM_CHECK_INTS(th);
|
1583
|
+
|
1584
|
+
if (UNLIKELY(VM_FRAME_TYPE_FINISH_P(GET_CFP()))) {
|
1585
|
+
vm_pop_frame(th);
|
1586
|
+
|
1587
|
+
#if OPT_CALL_THREADED_CODE
|
1588
|
+
th->retval = val;
|
1589
|
+
return 0;
|
1590
|
+
#else
|
1591
|
+
return val;
|
1592
|
+
#endif
|
1593
|
+
}
|
1594
|
+
else {
|
1595
|
+
vm_pop_frame(th);
|
1596
|
+
RESTORE_REGS();
|
1597
|
+
}
|
1598
|
+
|
1599
|
+
#line 1600 "vm.inc"
|
1600
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1601
|
+
PUSH(val);
|
1602
|
+
#undef CURRENT_INSN_leave
|
1603
|
+
#undef INSN_IS_SC
|
1604
|
+
#undef INSN_LABEL
|
1605
|
+
#undef LABEL_IS_SC
|
1606
|
+
END_INSN(leave);}}}
|
1607
|
+
INSN_ENTRY(throw){
|
1608
|
+
{
|
1609
|
+
VALUE val;
|
1610
|
+
rb_num_t throw_state = (rb_num_t)GET_OPERAND(1);
|
1611
|
+
VALUE throwobj = TOPN(0);
|
1612
|
+
DEBUG_ENTER_INSN("throw");
|
1613
|
+
ADD_PC(1+1);
|
1614
|
+
PREFETCH(GET_PC());
|
1615
|
+
POPN(1);
|
1616
|
+
#define CURRENT_INSN_throw 1
|
1617
|
+
#define INSN_IS_SC() 0
|
1618
|
+
#define INSN_LABEL(lab) LABEL_throw_##lab
|
1619
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1620
|
+
COLLECT_USAGE_INSN(BIN(throw));
|
1621
|
+
COLLECT_USAGE_OPERAND(BIN(throw), 0, throw_state);
|
1622
|
+
{
|
1623
|
+
#line 1092 "insns.def"
|
1624
|
+
RUBY_VM_CHECK_INTS(th);
|
1625
|
+
val = vm_throw(th, GET_CFP(), throw_state, throwobj);
|
1626
|
+
THROW_EXCEPTION(val);
|
1627
|
+
/* unreachable */
|
1628
|
+
|
1629
|
+
#line 1630 "vm.inc"
|
1630
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1631
|
+
PUSH(val);
|
1632
|
+
#undef CURRENT_INSN_throw
|
1633
|
+
#undef INSN_IS_SC
|
1634
|
+
#undef INSN_LABEL
|
1635
|
+
#undef LABEL_IS_SC
|
1636
|
+
END_INSN(throw);}}}
|
1637
|
+
INSN_ENTRY(jump){
|
1638
|
+
{
|
1639
|
+
OFFSET dst = (OFFSET)GET_OPERAND(1);
|
1640
|
+
|
1641
|
+
DEBUG_ENTER_INSN("jump");
|
1642
|
+
ADD_PC(1+1);
|
1643
|
+
PREFETCH(GET_PC());
|
1644
|
+
#define CURRENT_INSN_jump 1
|
1645
|
+
#define INSN_IS_SC() 0
|
1646
|
+
#define INSN_LABEL(lab) LABEL_jump_##lab
|
1647
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1648
|
+
COLLECT_USAGE_INSN(BIN(jump));
|
1649
|
+
COLLECT_USAGE_OPERAND(BIN(jump), 0, dst);
|
1650
|
+
{
|
1651
|
+
#line 1113 "insns.def"
|
1652
|
+
RUBY_VM_CHECK_INTS(th);
|
1653
|
+
JUMP(dst);
|
1654
|
+
|
1655
|
+
#line 1656 "vm.inc"
|
1656
|
+
#undef CURRENT_INSN_jump
|
1657
|
+
#undef INSN_IS_SC
|
1658
|
+
#undef INSN_LABEL
|
1659
|
+
#undef LABEL_IS_SC
|
1660
|
+
END_INSN(jump);}}}
|
1661
|
+
INSN_ENTRY(branchif){
|
1662
|
+
{
|
1663
|
+
OFFSET dst = (OFFSET)GET_OPERAND(1);
|
1664
|
+
VALUE val = TOPN(0);
|
1665
|
+
DEBUG_ENTER_INSN("branchif");
|
1666
|
+
ADD_PC(1+1);
|
1667
|
+
PREFETCH(GET_PC());
|
1668
|
+
POPN(1);
|
1669
|
+
#define CURRENT_INSN_branchif 1
|
1670
|
+
#define INSN_IS_SC() 0
|
1671
|
+
#define INSN_LABEL(lab) LABEL_branchif_##lab
|
1672
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1673
|
+
COLLECT_USAGE_INSN(BIN(branchif));
|
1674
|
+
COLLECT_USAGE_OPERAND(BIN(branchif), 0, dst);
|
1675
|
+
{
|
1676
|
+
#line 1128 "insns.def"
|
1677
|
+
if (RTEST(val)) {
|
1678
|
+
RUBY_VM_CHECK_INTS(th);
|
1679
|
+
JUMP(dst);
|
1680
|
+
}
|
1681
|
+
|
1682
|
+
#line 1683 "vm.inc"
|
1683
|
+
#undef CURRENT_INSN_branchif
|
1684
|
+
#undef INSN_IS_SC
|
1685
|
+
#undef INSN_LABEL
|
1686
|
+
#undef LABEL_IS_SC
|
1687
|
+
END_INSN(branchif);}}}
|
1688
|
+
INSN_ENTRY(branchunless){
|
1689
|
+
{
|
1690
|
+
OFFSET dst = (OFFSET)GET_OPERAND(1);
|
1691
|
+
VALUE val = TOPN(0);
|
1692
|
+
DEBUG_ENTER_INSN("branchunless");
|
1693
|
+
ADD_PC(1+1);
|
1694
|
+
PREFETCH(GET_PC());
|
1695
|
+
POPN(1);
|
1696
|
+
#define CURRENT_INSN_branchunless 1
|
1697
|
+
#define INSN_IS_SC() 0
|
1698
|
+
#define INSN_LABEL(lab) LABEL_branchunless_##lab
|
1699
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1700
|
+
COLLECT_USAGE_INSN(BIN(branchunless));
|
1701
|
+
COLLECT_USAGE_OPERAND(BIN(branchunless), 0, dst);
|
1702
|
+
{
|
1703
|
+
#line 1145 "insns.def"
|
1704
|
+
if (!RTEST(val)) {
|
1705
|
+
RUBY_VM_CHECK_INTS(th);
|
1706
|
+
JUMP(dst);
|
1707
|
+
}
|
1708
|
+
|
1709
|
+
#line 1710 "vm.inc"
|
1710
|
+
#undef CURRENT_INSN_branchunless
|
1711
|
+
#undef INSN_IS_SC
|
1712
|
+
#undef INSN_LABEL
|
1713
|
+
#undef LABEL_IS_SC
|
1714
|
+
END_INSN(branchunless);}}}
|
1715
|
+
INSN_ENTRY(branchnil){
|
1716
|
+
{
|
1717
|
+
OFFSET dst = (OFFSET)GET_OPERAND(1);
|
1718
|
+
VALUE val = TOPN(0);
|
1719
|
+
DEBUG_ENTER_INSN("branchnil");
|
1720
|
+
ADD_PC(1+1);
|
1721
|
+
PREFETCH(GET_PC());
|
1722
|
+
POPN(1);
|
1723
|
+
#define CURRENT_INSN_branchnil 1
|
1724
|
+
#define INSN_IS_SC() 0
|
1725
|
+
#define INSN_LABEL(lab) LABEL_branchnil_##lab
|
1726
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1727
|
+
COLLECT_USAGE_INSN(BIN(branchnil));
|
1728
|
+
COLLECT_USAGE_OPERAND(BIN(branchnil), 0, dst);
|
1729
|
+
{
|
1730
|
+
#line 1162 "insns.def"
|
1731
|
+
if (NIL_P(val)) {
|
1732
|
+
RUBY_VM_CHECK_INTS(th);
|
1733
|
+
JUMP(dst);
|
1734
|
+
}
|
1735
|
+
|
1736
|
+
#line 1737 "vm.inc"
|
1737
|
+
#undef CURRENT_INSN_branchnil
|
1738
|
+
#undef INSN_IS_SC
|
1739
|
+
#undef INSN_LABEL
|
1740
|
+
#undef LABEL_IS_SC
|
1741
|
+
END_INSN(branchnil);}}}
|
1742
|
+
INSN_ENTRY(getinlinecache){
|
1743
|
+
{
|
1744
|
+
VALUE val;
|
1745
|
+
IC ic = (IC)GET_OPERAND(2);
|
1746
|
+
OFFSET dst = (OFFSET)GET_OPERAND(1);
|
1747
|
+
|
1748
|
+
DEBUG_ENTER_INSN("getinlinecache");
|
1749
|
+
ADD_PC(1+2);
|
1750
|
+
PREFETCH(GET_PC());
|
1751
|
+
#define CURRENT_INSN_getinlinecache 1
|
1752
|
+
#define INSN_IS_SC() 0
|
1753
|
+
#define INSN_LABEL(lab) LABEL_getinlinecache_##lab
|
1754
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1755
|
+
COLLECT_USAGE_INSN(BIN(getinlinecache));
|
1756
|
+
COLLECT_USAGE_OPERAND(BIN(getinlinecache), 0, dst);
|
1757
|
+
COLLECT_USAGE_OPERAND(BIN(getinlinecache), 1, ic);
|
1758
|
+
{
|
1759
|
+
#line 1184 "insns.def"
|
1760
|
+
if (ic->ic_serial == GET_GLOBAL_CONSTANT_STATE() &&
|
1761
|
+
(ic->ic_cref == NULL || ic->ic_cref == rb_vm_get_cref(GET_EP()))) {
|
1762
|
+
val = ic->ic_value.value;
|
1763
|
+
JUMP(dst);
|
1764
|
+
}
|
1765
|
+
else {
|
1766
|
+
/* none */
|
1767
|
+
val = Qnil;
|
1768
|
+
}
|
1769
|
+
|
1770
|
+
#line 1771 "vm.inc"
|
1771
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1772
|
+
PUSH(val);
|
1773
|
+
#undef CURRENT_INSN_getinlinecache
|
1774
|
+
#undef INSN_IS_SC
|
1775
|
+
#undef INSN_LABEL
|
1776
|
+
#undef LABEL_IS_SC
|
1777
|
+
END_INSN(getinlinecache);}}}
|
1778
|
+
INSN_ENTRY(setinlinecache){
|
1779
|
+
{
|
1780
|
+
IC ic = (IC)GET_OPERAND(1);
|
1781
|
+
VALUE val = TOPN(0);
|
1782
|
+
DEBUG_ENTER_INSN("setinlinecache");
|
1783
|
+
ADD_PC(1+1);
|
1784
|
+
PREFETCH(GET_PC());
|
1785
|
+
POPN(1);
|
1786
|
+
#define CURRENT_INSN_setinlinecache 1
|
1787
|
+
#define INSN_IS_SC() 0
|
1788
|
+
#define INSN_LABEL(lab) LABEL_setinlinecache_##lab
|
1789
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1790
|
+
COLLECT_USAGE_INSN(BIN(setinlinecache));
|
1791
|
+
COLLECT_USAGE_OPERAND(BIN(setinlinecache), 0, ic);
|
1792
|
+
{
|
1793
|
+
#line 1206 "insns.def"
|
1794
|
+
VM_ASSERT(ic->ic_value.value != Qundef);
|
1795
|
+
ic->ic_value.value = val;
|
1796
|
+
ic->ic_serial = GET_GLOBAL_CONSTANT_STATE() - ruby_vm_const_missing_count;
|
1797
|
+
ic->ic_cref = vm_get_const_key_cref(GET_EP());
|
1798
|
+
ruby_vm_const_missing_count = 0;
|
1799
|
+
|
1800
|
+
#line 1801 "vm.inc"
|
1801
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1802
|
+
PUSH(val);
|
1803
|
+
#undef CURRENT_INSN_setinlinecache
|
1804
|
+
#undef INSN_IS_SC
|
1805
|
+
#undef INSN_LABEL
|
1806
|
+
#undef LABEL_IS_SC
|
1807
|
+
END_INSN(setinlinecache);}}}
|
1808
|
+
INSN_ENTRY(once){
|
1809
|
+
{
|
1810
|
+
VALUE val;
|
1811
|
+
IC ic = (IC)GET_OPERAND(2);
|
1812
|
+
ISEQ iseq = (ISEQ)GET_OPERAND(1);
|
1813
|
+
|
1814
|
+
DEBUG_ENTER_INSN("once");
|
1815
|
+
ADD_PC(1+2);
|
1816
|
+
PREFETCH(GET_PC());
|
1817
|
+
#define CURRENT_INSN_once 1
|
1818
|
+
#define INSN_IS_SC() 0
|
1819
|
+
#define INSN_LABEL(lab) LABEL_once_##lab
|
1820
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1821
|
+
COLLECT_USAGE_INSN(BIN(once));
|
1822
|
+
COLLECT_USAGE_OPERAND(BIN(once), 0, iseq);
|
1823
|
+
COLLECT_USAGE_OPERAND(BIN(once), 1, ic);
|
1824
|
+
{
|
1825
|
+
#line 1224 "insns.def"
|
1826
|
+
union iseq_inline_storage_entry *is = (union iseq_inline_storage_entry *)ic;
|
1827
|
+
|
1828
|
+
#define RUNNING_THREAD_ONCE_DONE ((rb_thread_t *)(0x1))
|
1829
|
+
retry:
|
1830
|
+
if (is->once.running_thread == RUNNING_THREAD_ONCE_DONE) {
|
1831
|
+
val = is->once.value;
|
1832
|
+
}
|
1833
|
+
else if (is->once.running_thread == NULL) {
|
1834
|
+
is->once.running_thread = th;
|
1835
|
+
val = is->once.value = rb_ensure(vm_once_exec, (VALUE)iseq, vm_once_clear, (VALUE)is);
|
1836
|
+
/* is->once.running_thread is cleared by vm_once_clear() */
|
1837
|
+
is->once.running_thread = RUNNING_THREAD_ONCE_DONE; /* success */
|
1838
|
+
rb_iseq_add_mark_object(GET_ISEQ(), val);
|
1839
|
+
}
|
1840
|
+
else if (is->once.running_thread == th) {
|
1841
|
+
/* recursive once */
|
1842
|
+
val = vm_once_exec((VALUE)iseq);
|
1843
|
+
}
|
1844
|
+
else {
|
1845
|
+
/* waiting for finish */
|
1846
|
+
RUBY_VM_CHECK_INTS(th);
|
1847
|
+
rb_thread_schedule();
|
1848
|
+
goto retry;
|
1849
|
+
}
|
1850
|
+
|
1851
|
+
#line 1852 "vm.inc"
|
1852
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1853
|
+
PUSH(val);
|
1854
|
+
#undef CURRENT_INSN_once
|
1855
|
+
#undef INSN_IS_SC
|
1856
|
+
#undef INSN_LABEL
|
1857
|
+
#undef LABEL_IS_SC
|
1858
|
+
END_INSN(once);}}}
|
1859
|
+
INSN_ENTRY(opt_case_dispatch){
|
1860
|
+
{
|
1861
|
+
OFFSET else_offset = (OFFSET)GET_OPERAND(2);
|
1862
|
+
CDHASH hash = (CDHASH)GET_OPERAND(1);
|
1863
|
+
VALUE key = TOPN(0);
|
1864
|
+
DEBUG_ENTER_INSN("opt_case_dispatch");
|
1865
|
+
ADD_PC(1+2);
|
1866
|
+
PREFETCH(GET_PC());
|
1867
|
+
POPN(1);
|
1868
|
+
#define CURRENT_INSN_opt_case_dispatch 1
|
1869
|
+
#define INSN_IS_SC() 0
|
1870
|
+
#define INSN_LABEL(lab) LABEL_opt_case_dispatch_##lab
|
1871
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1872
|
+
COLLECT_USAGE_INSN(BIN(opt_case_dispatch));
|
1873
|
+
COLLECT_USAGE_OPERAND(BIN(opt_case_dispatch), 0, hash);
|
1874
|
+
COLLECT_USAGE_OPERAND(BIN(opt_case_dispatch), 1, else_offset);
|
1875
|
+
{
|
1876
|
+
#line 1261 "insns.def"
|
1877
|
+
switch(TYPE(key)) {
|
1878
|
+
case T_FLOAT: {
|
1879
|
+
double ival;
|
1880
|
+
if (modf(RFLOAT_VALUE(key), &ival) == 0.0 && !isinf(ival)) {
|
1881
|
+
key = FIXABLE(ival) ? LONG2FIX((long)ival) : rb_dbl2big(ival);
|
1882
|
+
}
|
1883
|
+
}
|
1884
|
+
case T_TRUE:
|
1885
|
+
case T_FALSE:
|
1886
|
+
case T_NIL:
|
1887
|
+
case T_SYMBOL: /* fall through */
|
1888
|
+
case T_FIXNUM:
|
1889
|
+
case T_BIGNUM:
|
1890
|
+
case T_STRING:
|
1891
|
+
if (BASIC_OP_UNREDEFINED_P(BOP_EQQ,
|
1892
|
+
SYMBOL_REDEFINED_OP_FLAG |
|
1893
|
+
FIXNUM_REDEFINED_OP_FLAG |
|
1894
|
+
FLOAT_REDEFINED_OP_FLAG |
|
1895
|
+
BIGNUM_REDEFINED_OP_FLAG |
|
1896
|
+
NIL_REDEFINED_OP_FLAG |
|
1897
|
+
TRUE_REDEFINED_OP_FLAG |
|
1898
|
+
FALSE_REDEFINED_OP_FLAG |
|
1899
|
+
STRING_REDEFINED_OP_FLAG)) {
|
1900
|
+
st_data_t val;
|
1901
|
+
if (st_lookup(RHASH_TBL_RAW(hash), key, &val)) {
|
1902
|
+
JUMP(FIX2INT((VALUE)val));
|
1903
|
+
}
|
1904
|
+
else {
|
1905
|
+
JUMP(else_offset);
|
1906
|
+
}
|
1907
|
+
break;
|
1908
|
+
}
|
1909
|
+
default:
|
1910
|
+
break;
|
1911
|
+
}
|
1912
|
+
|
1913
|
+
#line 1914 "vm.inc"
|
1914
|
+
#undef CURRENT_INSN_opt_case_dispatch
|
1915
|
+
#undef INSN_IS_SC
|
1916
|
+
#undef INSN_LABEL
|
1917
|
+
#undef LABEL_IS_SC
|
1918
|
+
END_INSN(opt_case_dispatch);}}}
|
1919
|
+
INSN_ENTRY(opt_plus){
|
1920
|
+
{
|
1921
|
+
VALUE val;
|
1922
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
1923
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
1924
|
+
VALUE recv = TOPN(1);
|
1925
|
+
VALUE obj = TOPN(0);
|
1926
|
+
DEBUG_ENTER_INSN("opt_plus");
|
1927
|
+
ADD_PC(1+2);
|
1928
|
+
PREFETCH(GET_PC());
|
1929
|
+
POPN(2);
|
1930
|
+
#define CURRENT_INSN_opt_plus 1
|
1931
|
+
#define INSN_IS_SC() 0
|
1932
|
+
#define INSN_LABEL(lab) LABEL_opt_plus_##lab
|
1933
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
1934
|
+
COLLECT_USAGE_INSN(BIN(opt_plus));
|
1935
|
+
COLLECT_USAGE_OPERAND(BIN(opt_plus), 0, ci);
|
1936
|
+
COLLECT_USAGE_OPERAND(BIN(opt_plus), 1, cc);
|
1937
|
+
{
|
1938
|
+
#line 1311 "insns.def"
|
1939
|
+
if (FIXNUM_2_P(recv, obj) &&
|
1940
|
+
BASIC_OP_UNREDEFINED_P(BOP_PLUS,FIXNUM_REDEFINED_OP_FLAG)) {
|
1941
|
+
/* fixnum + fixnum */
|
1942
|
+
#ifndef LONG_LONG_VALUE
|
1943
|
+
val = (recv + (obj & (~1)));
|
1944
|
+
if ((~(recv ^ obj) & (recv ^ val)) &
|
1945
|
+
((VALUE)0x01 << ((sizeof(VALUE) * CHAR_BIT) - 1))) {
|
1946
|
+
val = rb_big_plus(rb_int2big(FIX2LONG(recv)),
|
1947
|
+
rb_int2big(FIX2LONG(obj)));
|
1948
|
+
}
|
1949
|
+
#else
|
1950
|
+
long a, b, c;
|
1951
|
+
a = FIX2LONG(recv);
|
1952
|
+
b = FIX2LONG(obj);
|
1953
|
+
c = a + b;
|
1954
|
+
if (FIXABLE(c)) {
|
1955
|
+
val = LONG2FIX(c);
|
1956
|
+
}
|
1957
|
+
else {
|
1958
|
+
val = rb_big_plus(rb_int2big(a), rb_int2big(b));
|
1959
|
+
}
|
1960
|
+
#endif
|
1961
|
+
}
|
1962
|
+
else if (FLONUM_2_P(recv, obj) &&
|
1963
|
+
BASIC_OP_UNREDEFINED_P(BOP_PLUS, FLOAT_REDEFINED_OP_FLAG)) {
|
1964
|
+
val = DBL2NUM(RFLOAT_VALUE(recv) + RFLOAT_VALUE(obj));
|
1965
|
+
}
|
1966
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
1967
|
+
if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
|
1968
|
+
BASIC_OP_UNREDEFINED_P(BOP_PLUS, FLOAT_REDEFINED_OP_FLAG)) {
|
1969
|
+
val = DBL2NUM(RFLOAT_VALUE(recv) + RFLOAT_VALUE(obj));
|
1970
|
+
}
|
1971
|
+
else if (RBASIC_CLASS(recv) == rb_cString && RBASIC_CLASS(obj) == rb_cString &&
|
1972
|
+
BASIC_OP_UNREDEFINED_P(BOP_PLUS, STRING_REDEFINED_OP_FLAG)) {
|
1973
|
+
val = rb_str_plus(recv, obj);
|
1974
|
+
}
|
1975
|
+
else if (RBASIC_CLASS(recv) == rb_cArray &&
|
1976
|
+
BASIC_OP_UNREDEFINED_P(BOP_PLUS, ARRAY_REDEFINED_OP_FLAG)) {
|
1977
|
+
val = rb_ary_plus(recv, obj);
|
1978
|
+
}
|
1979
|
+
else {
|
1980
|
+
goto INSN_LABEL(normal_dispatch);
|
1981
|
+
}
|
1982
|
+
}
|
1983
|
+
else {
|
1984
|
+
INSN_LABEL(normal_dispatch):
|
1985
|
+
PUSH(recv);
|
1986
|
+
PUSH(obj);
|
1987
|
+
CALL_SIMPLE_METHOD(recv);
|
1988
|
+
}
|
1989
|
+
|
1990
|
+
#line 1991 "vm.inc"
|
1991
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
1992
|
+
PUSH(val);
|
1993
|
+
#undef CURRENT_INSN_opt_plus
|
1994
|
+
#undef INSN_IS_SC
|
1995
|
+
#undef INSN_LABEL
|
1996
|
+
#undef LABEL_IS_SC
|
1997
|
+
END_INSN(opt_plus);}}}
|
1998
|
+
INSN_ENTRY(opt_minus){
|
1999
|
+
{
|
2000
|
+
VALUE val;
|
2001
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2002
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2003
|
+
VALUE recv = TOPN(1);
|
2004
|
+
VALUE obj = TOPN(0);
|
2005
|
+
DEBUG_ENTER_INSN("opt_minus");
|
2006
|
+
ADD_PC(1+2);
|
2007
|
+
PREFETCH(GET_PC());
|
2008
|
+
POPN(2);
|
2009
|
+
#define CURRENT_INSN_opt_minus 1
|
2010
|
+
#define INSN_IS_SC() 0
|
2011
|
+
#define INSN_LABEL(lab) LABEL_opt_minus_##lab
|
2012
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2013
|
+
COLLECT_USAGE_INSN(BIN(opt_minus));
|
2014
|
+
COLLECT_USAGE_OPERAND(BIN(opt_minus), 0, ci);
|
2015
|
+
COLLECT_USAGE_OPERAND(BIN(opt_minus), 1, cc);
|
2016
|
+
{
|
2017
|
+
#line 1374 "insns.def"
|
2018
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2019
|
+
BASIC_OP_UNREDEFINED_P(BOP_MINUS, FIXNUM_REDEFINED_OP_FLAG)) {
|
2020
|
+
long a, b, c;
|
2021
|
+
|
2022
|
+
a = FIX2LONG(recv);
|
2023
|
+
b = FIX2LONG(obj);
|
2024
|
+
c = a - b;
|
2025
|
+
|
2026
|
+
if (FIXABLE(c)) {
|
2027
|
+
val = LONG2FIX(c);
|
2028
|
+
}
|
2029
|
+
else {
|
2030
|
+
val = rb_big_minus(rb_int2big(a), rb_int2big(b));
|
2031
|
+
}
|
2032
|
+
}
|
2033
|
+
else if (FLONUM_2_P(recv, obj) &&
|
2034
|
+
BASIC_OP_UNREDEFINED_P(BOP_MINUS, FLOAT_REDEFINED_OP_FLAG)) {
|
2035
|
+
val = DBL2NUM(RFLOAT_VALUE(recv) - RFLOAT_VALUE(obj));
|
2036
|
+
}
|
2037
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
2038
|
+
if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
|
2039
|
+
BASIC_OP_UNREDEFINED_P(BOP_MINUS, FLOAT_REDEFINED_OP_FLAG)) {
|
2040
|
+
val = DBL2NUM(RFLOAT_VALUE(recv) - RFLOAT_VALUE(obj));
|
2041
|
+
}
|
2042
|
+
else {
|
2043
|
+
goto INSN_LABEL(normal_dispatch);
|
2044
|
+
}
|
2045
|
+
}
|
2046
|
+
else {
|
2047
|
+
/* other */
|
2048
|
+
INSN_LABEL(normal_dispatch):
|
2049
|
+
PUSH(recv);
|
2050
|
+
PUSH(obj);
|
2051
|
+
CALL_SIMPLE_METHOD(recv);
|
2052
|
+
}
|
2053
|
+
|
2054
|
+
#line 2055 "vm.inc"
|
2055
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2056
|
+
PUSH(val);
|
2057
|
+
#undef CURRENT_INSN_opt_minus
|
2058
|
+
#undef INSN_IS_SC
|
2059
|
+
#undef INSN_LABEL
|
2060
|
+
#undef LABEL_IS_SC
|
2061
|
+
END_INSN(opt_minus);}}}
|
2062
|
+
INSN_ENTRY(opt_mult){
|
2063
|
+
{
|
2064
|
+
VALUE val;
|
2065
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2066
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2067
|
+
VALUE recv = TOPN(1);
|
2068
|
+
VALUE obj = TOPN(0);
|
2069
|
+
DEBUG_ENTER_INSN("opt_mult");
|
2070
|
+
ADD_PC(1+2);
|
2071
|
+
PREFETCH(GET_PC());
|
2072
|
+
POPN(2);
|
2073
|
+
#define CURRENT_INSN_opt_mult 1
|
2074
|
+
#define INSN_IS_SC() 0
|
2075
|
+
#define INSN_LABEL(lab) LABEL_opt_mult_##lab
|
2076
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2077
|
+
COLLECT_USAGE_INSN(BIN(opt_mult));
|
2078
|
+
COLLECT_USAGE_OPERAND(BIN(opt_mult), 0, ci);
|
2079
|
+
COLLECT_USAGE_OPERAND(BIN(opt_mult), 1, cc);
|
2080
|
+
{
|
2081
|
+
#line 1422 "insns.def"
|
2082
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2083
|
+
BASIC_OP_UNREDEFINED_P(BOP_MULT, FIXNUM_REDEFINED_OP_FLAG)) {
|
2084
|
+
long a, b;
|
2085
|
+
|
2086
|
+
a = FIX2LONG(recv);
|
2087
|
+
if (a == 0) {
|
2088
|
+
val = recv;
|
2089
|
+
}
|
2090
|
+
else {
|
2091
|
+
b = FIX2LONG(obj);
|
2092
|
+
if (MUL_OVERFLOW_FIXNUM_P(a, b)) {
|
2093
|
+
val = rb_big_mul(rb_int2big(a), rb_int2big(b));
|
2094
|
+
}
|
2095
|
+
else {
|
2096
|
+
val = LONG2FIX(a * b);
|
2097
|
+
}
|
2098
|
+
}
|
2099
|
+
}
|
2100
|
+
else if (FLONUM_2_P(recv, obj) &&
|
2101
|
+
BASIC_OP_UNREDEFINED_P(BOP_MULT, FLOAT_REDEFINED_OP_FLAG)) {
|
2102
|
+
val = DBL2NUM(RFLOAT_VALUE(recv) * RFLOAT_VALUE(obj));
|
2103
|
+
}
|
2104
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
2105
|
+
if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
|
2106
|
+
BASIC_OP_UNREDEFINED_P(BOP_MULT, FLOAT_REDEFINED_OP_FLAG)) {
|
2107
|
+
val = DBL2NUM(RFLOAT_VALUE(recv) * RFLOAT_VALUE(obj));
|
2108
|
+
}
|
2109
|
+
else {
|
2110
|
+
goto INSN_LABEL(normal_dispatch);
|
2111
|
+
}
|
2112
|
+
}
|
2113
|
+
else {
|
2114
|
+
INSN_LABEL(normal_dispatch):
|
2115
|
+
PUSH(recv);
|
2116
|
+
PUSH(obj);
|
2117
|
+
CALL_SIMPLE_METHOD(recv);
|
2118
|
+
}
|
2119
|
+
|
2120
|
+
#line 2121 "vm.inc"
|
2121
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2122
|
+
PUSH(val);
|
2123
|
+
#undef CURRENT_INSN_opt_mult
|
2124
|
+
#undef INSN_IS_SC
|
2125
|
+
#undef INSN_LABEL
|
2126
|
+
#undef LABEL_IS_SC
|
2127
|
+
END_INSN(opt_mult);}}}
|
2128
|
+
INSN_ENTRY(opt_div){
|
2129
|
+
{
|
2130
|
+
VALUE val;
|
2131
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2132
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2133
|
+
VALUE recv = TOPN(1);
|
2134
|
+
VALUE obj = TOPN(0);
|
2135
|
+
DEBUG_ENTER_INSN("opt_div");
|
2136
|
+
ADD_PC(1+2);
|
2137
|
+
PREFETCH(GET_PC());
|
2138
|
+
POPN(2);
|
2139
|
+
#define CURRENT_INSN_opt_div 1
|
2140
|
+
#define INSN_IS_SC() 0
|
2141
|
+
#define INSN_LABEL(lab) LABEL_opt_div_##lab
|
2142
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2143
|
+
COLLECT_USAGE_INSN(BIN(opt_div));
|
2144
|
+
COLLECT_USAGE_OPERAND(BIN(opt_div), 0, ci);
|
2145
|
+
COLLECT_USAGE_OPERAND(BIN(opt_div), 1, cc);
|
2146
|
+
{
|
2147
|
+
#line 1472 "insns.def"
|
2148
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2149
|
+
BASIC_OP_UNREDEFINED_P(BOP_DIV, FIXNUM_REDEFINED_OP_FLAG)) {
|
2150
|
+
long x, y, div;
|
2151
|
+
|
2152
|
+
x = FIX2LONG(recv);
|
2153
|
+
y = FIX2LONG(obj);
|
2154
|
+
{
|
2155
|
+
/* copied from numeric.c#fixdivmod */
|
2156
|
+
long mod;
|
2157
|
+
if (y == 0)
|
2158
|
+
goto INSN_LABEL(normal_dispatch);
|
2159
|
+
if (y < 0) {
|
2160
|
+
if (x < 0)
|
2161
|
+
div = -x / -y;
|
2162
|
+
else
|
2163
|
+
div = -(x / -y);
|
2164
|
+
}
|
2165
|
+
else {
|
2166
|
+
if (x < 0)
|
2167
|
+
div = -(-x / y);
|
2168
|
+
else
|
2169
|
+
div = x / y;
|
2170
|
+
}
|
2171
|
+
mod = x - div * y;
|
2172
|
+
if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) {
|
2173
|
+
mod += y;
|
2174
|
+
div -= 1;
|
2175
|
+
}
|
2176
|
+
}
|
2177
|
+
val = LONG2NUM(div);
|
2178
|
+
}
|
2179
|
+
else if (FLONUM_2_P(recv, obj) &&
|
2180
|
+
BASIC_OP_UNREDEFINED_P(BOP_DIV, FLOAT_REDEFINED_OP_FLAG)) {
|
2181
|
+
val = DBL2NUM(RFLOAT_VALUE(recv) / RFLOAT_VALUE(obj));
|
2182
|
+
}
|
2183
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
2184
|
+
if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
|
2185
|
+
BASIC_OP_UNREDEFINED_P(BOP_DIV, FLOAT_REDEFINED_OP_FLAG)) {
|
2186
|
+
val = DBL2NUM(RFLOAT_VALUE(recv) / RFLOAT_VALUE(obj));
|
2187
|
+
}
|
2188
|
+
else {
|
2189
|
+
goto INSN_LABEL(normal_dispatch);
|
2190
|
+
}
|
2191
|
+
}
|
2192
|
+
else {
|
2193
|
+
INSN_LABEL(normal_dispatch):
|
2194
|
+
PUSH(recv);
|
2195
|
+
PUSH(obj);
|
2196
|
+
CALL_SIMPLE_METHOD(recv);
|
2197
|
+
}
|
2198
|
+
|
2199
|
+
#line 2200 "vm.inc"
|
2200
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2201
|
+
PUSH(val);
|
2202
|
+
#undef CURRENT_INSN_opt_div
|
2203
|
+
#undef INSN_IS_SC
|
2204
|
+
#undef INSN_LABEL
|
2205
|
+
#undef LABEL_IS_SC
|
2206
|
+
END_INSN(opt_div);}}}
|
2207
|
+
INSN_ENTRY(opt_mod){
|
2208
|
+
{
|
2209
|
+
VALUE val;
|
2210
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2211
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2212
|
+
VALUE recv = TOPN(1);
|
2213
|
+
VALUE obj = TOPN(0);
|
2214
|
+
DEBUG_ENTER_INSN("opt_mod");
|
2215
|
+
ADD_PC(1+2);
|
2216
|
+
PREFETCH(GET_PC());
|
2217
|
+
POPN(2);
|
2218
|
+
#define CURRENT_INSN_opt_mod 1
|
2219
|
+
#define INSN_IS_SC() 0
|
2220
|
+
#define INSN_LABEL(lab) LABEL_opt_mod_##lab
|
2221
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2222
|
+
COLLECT_USAGE_INSN(BIN(opt_mod));
|
2223
|
+
COLLECT_USAGE_OPERAND(BIN(opt_mod), 0, ci);
|
2224
|
+
COLLECT_USAGE_OPERAND(BIN(opt_mod), 1, cc);
|
2225
|
+
{
|
2226
|
+
#line 1535 "insns.def"
|
2227
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2228
|
+
BASIC_OP_UNREDEFINED_P(BOP_MOD, FIXNUM_REDEFINED_OP_FLAG )) {
|
2229
|
+
long x, y;
|
2230
|
+
|
2231
|
+
x = FIX2LONG(recv);
|
2232
|
+
y = FIX2LONG(obj);
|
2233
|
+
if (x > 0 && y > 0) {
|
2234
|
+
val = LONG2FIX(x % y);
|
2235
|
+
}
|
2236
|
+
else {
|
2237
|
+
/* copied from numeric.c#fixdivmod */
|
2238
|
+
long div, mod;
|
2239
|
+
|
2240
|
+
if (y == 0)
|
2241
|
+
goto INSN_LABEL(normal_dispatch);
|
2242
|
+
if (y < 0) {
|
2243
|
+
if (x < 0)
|
2244
|
+
div = -x / -y;
|
2245
|
+
else
|
2246
|
+
div = -(x / -y);
|
2247
|
+
}
|
2248
|
+
else {
|
2249
|
+
if (x < 0)
|
2250
|
+
div = -(-x / y);
|
2251
|
+
else
|
2252
|
+
div = x / y;
|
2253
|
+
}
|
2254
|
+
mod = x - div * y;
|
2255
|
+
if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) {
|
2256
|
+
mod += y;
|
2257
|
+
div -= 1;
|
2258
|
+
}
|
2259
|
+
val = LONG2FIX(mod);
|
2260
|
+
}
|
2261
|
+
}
|
2262
|
+
else if (FLONUM_2_P(recv, obj) &&
|
2263
|
+
BASIC_OP_UNREDEFINED_P(BOP_MOD, FLOAT_REDEFINED_OP_FLAG)) {
|
2264
|
+
val = DBL2NUM(ruby_float_mod(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj)));
|
2265
|
+
}
|
2266
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
2267
|
+
if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
|
2268
|
+
BASIC_OP_UNREDEFINED_P(BOP_MOD, FLOAT_REDEFINED_OP_FLAG)) {
|
2269
|
+
val = DBL2NUM(ruby_float_mod(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj)));
|
2270
|
+
}
|
2271
|
+
else {
|
2272
|
+
goto INSN_LABEL(normal_dispatch);
|
2273
|
+
}
|
2274
|
+
}
|
2275
|
+
else {
|
2276
|
+
INSN_LABEL(normal_dispatch):
|
2277
|
+
PUSH(recv);
|
2278
|
+
PUSH(obj);
|
2279
|
+
CALL_SIMPLE_METHOD(recv);
|
2280
|
+
}
|
2281
|
+
|
2282
|
+
#line 2283 "vm.inc"
|
2283
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2284
|
+
PUSH(val);
|
2285
|
+
#undef CURRENT_INSN_opt_mod
|
2286
|
+
#undef INSN_IS_SC
|
2287
|
+
#undef INSN_LABEL
|
2288
|
+
#undef LABEL_IS_SC
|
2289
|
+
END_INSN(opt_mod);}}}
|
2290
|
+
INSN_ENTRY(opt_eq){
|
2291
|
+
{
|
2292
|
+
VALUE val;
|
2293
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2294
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2295
|
+
VALUE recv = TOPN(1);
|
2296
|
+
VALUE obj = TOPN(0);
|
2297
|
+
DEBUG_ENTER_INSN("opt_eq");
|
2298
|
+
ADD_PC(1+2);
|
2299
|
+
PREFETCH(GET_PC());
|
2300
|
+
POPN(2);
|
2301
|
+
#define CURRENT_INSN_opt_eq 1
|
2302
|
+
#define INSN_IS_SC() 0
|
2303
|
+
#define INSN_LABEL(lab) LABEL_opt_eq_##lab
|
2304
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2305
|
+
COLLECT_USAGE_INSN(BIN(opt_eq));
|
2306
|
+
COLLECT_USAGE_OPERAND(BIN(opt_eq), 0, ci);
|
2307
|
+
COLLECT_USAGE_OPERAND(BIN(opt_eq), 1, cc);
|
2308
|
+
{
|
2309
|
+
#line 1602 "insns.def"
|
2310
|
+
val = opt_eq_func(recv, obj, ci, cc);
|
2311
|
+
|
2312
|
+
if (val == Qundef) {
|
2313
|
+
/* other */
|
2314
|
+
PUSH(recv);
|
2315
|
+
PUSH(obj);
|
2316
|
+
CALL_SIMPLE_METHOD(recv);
|
2317
|
+
}
|
2318
|
+
|
2319
|
+
#line 2320 "vm.inc"
|
2320
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2321
|
+
PUSH(val);
|
2322
|
+
#undef CURRENT_INSN_opt_eq
|
2323
|
+
#undef INSN_IS_SC
|
2324
|
+
#undef INSN_LABEL
|
2325
|
+
#undef LABEL_IS_SC
|
2326
|
+
END_INSN(opt_eq);}}}
|
2327
|
+
INSN_ENTRY(opt_neq){
|
2328
|
+
{
|
2329
|
+
VALUE val;
|
2330
|
+
CALL_CACHE cc_eq = (CALL_CACHE)GET_OPERAND(4);
|
2331
|
+
CALL_INFO ci_eq = (CALL_INFO)GET_OPERAND(3);
|
2332
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2333
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2334
|
+
VALUE recv = TOPN(1);
|
2335
|
+
VALUE obj = TOPN(0);
|
2336
|
+
DEBUG_ENTER_INSN("opt_neq");
|
2337
|
+
ADD_PC(1+4);
|
2338
|
+
PREFETCH(GET_PC());
|
2339
|
+
POPN(2);
|
2340
|
+
#define CURRENT_INSN_opt_neq 1
|
2341
|
+
#define INSN_IS_SC() 0
|
2342
|
+
#define INSN_LABEL(lab) LABEL_opt_neq_##lab
|
2343
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2344
|
+
COLLECT_USAGE_INSN(BIN(opt_neq));
|
2345
|
+
COLLECT_USAGE_OPERAND(BIN(opt_neq), 0, ci);
|
2346
|
+
COLLECT_USAGE_OPERAND(BIN(opt_neq), 1, cc);
|
2347
|
+
COLLECT_USAGE_OPERAND(BIN(opt_neq), 2, ci_eq);
|
2348
|
+
COLLECT_USAGE_OPERAND(BIN(opt_neq), 3, cc_eq);
|
2349
|
+
{
|
2350
|
+
#line 1623 "insns.def"
|
2351
|
+
extern VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2);
|
2352
|
+
vm_search_method(ci, cc, recv);
|
2353
|
+
|
2354
|
+
val = Qundef;
|
2355
|
+
|
2356
|
+
if (check_cfunc(cc->me, rb_obj_not_equal)) {
|
2357
|
+
val = opt_eq_func(recv, obj, ci_eq, cc_eq);
|
2358
|
+
|
2359
|
+
if (val != Qundef) {
|
2360
|
+
val = RTEST(val) ? Qfalse : Qtrue;
|
2361
|
+
}
|
2362
|
+
}
|
2363
|
+
|
2364
|
+
if (val == Qundef) {
|
2365
|
+
/* other */
|
2366
|
+
PUSH(recv);
|
2367
|
+
PUSH(obj);
|
2368
|
+
CALL_SIMPLE_METHOD(recv);
|
2369
|
+
}
|
2370
|
+
|
2371
|
+
#line 2372 "vm.inc"
|
2372
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2373
|
+
PUSH(val);
|
2374
|
+
#undef CURRENT_INSN_opt_neq
|
2375
|
+
#undef INSN_IS_SC
|
2376
|
+
#undef INSN_LABEL
|
2377
|
+
#undef LABEL_IS_SC
|
2378
|
+
END_INSN(opt_neq);}}}
|
2379
|
+
INSN_ENTRY(opt_lt){
|
2380
|
+
{
|
2381
|
+
VALUE val;
|
2382
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2383
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2384
|
+
VALUE recv = TOPN(1);
|
2385
|
+
VALUE obj = TOPN(0);
|
2386
|
+
DEBUG_ENTER_INSN("opt_lt");
|
2387
|
+
ADD_PC(1+2);
|
2388
|
+
PREFETCH(GET_PC());
|
2389
|
+
POPN(2);
|
2390
|
+
#define CURRENT_INSN_opt_lt 1
|
2391
|
+
#define INSN_IS_SC() 0
|
2392
|
+
#define INSN_LABEL(lab) LABEL_opt_lt_##lab
|
2393
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2394
|
+
COLLECT_USAGE_INSN(BIN(opt_lt));
|
2395
|
+
COLLECT_USAGE_OPERAND(BIN(opt_lt), 0, ci);
|
2396
|
+
COLLECT_USAGE_OPERAND(BIN(opt_lt), 1, cc);
|
2397
|
+
{
|
2398
|
+
#line 1655 "insns.def"
|
2399
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2400
|
+
BASIC_OP_UNREDEFINED_P(BOP_LT, FIXNUM_REDEFINED_OP_FLAG)) {
|
2401
|
+
SIGNED_VALUE a = recv, b = obj;
|
2402
|
+
|
2403
|
+
if (a < b) {
|
2404
|
+
val = Qtrue;
|
2405
|
+
}
|
2406
|
+
else {
|
2407
|
+
val = Qfalse;
|
2408
|
+
}
|
2409
|
+
}
|
2410
|
+
else if (FLONUM_2_P(recv, obj) &&
|
2411
|
+
BASIC_OP_UNREDEFINED_P(BOP_LT, FLOAT_REDEFINED_OP_FLAG)) {
|
2412
|
+
/* flonum is not NaN */
|
2413
|
+
val = RFLOAT_VALUE(recv) < RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
|
2414
|
+
}
|
2415
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
2416
|
+
if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
|
2417
|
+
BASIC_OP_UNREDEFINED_P(BOP_LT, FLOAT_REDEFINED_OP_FLAG)) {
|
2418
|
+
val = double_cmp_lt(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj));
|
2419
|
+
}
|
2420
|
+
else {
|
2421
|
+
goto INSN_LABEL(normal_dispatch);
|
2422
|
+
}
|
2423
|
+
}
|
2424
|
+
else {
|
2425
|
+
INSN_LABEL(normal_dispatch):
|
2426
|
+
PUSH(recv);
|
2427
|
+
PUSH(obj);
|
2428
|
+
CALL_SIMPLE_METHOD(recv);
|
2429
|
+
}
|
2430
|
+
|
2431
|
+
#line 2432 "vm.inc"
|
2432
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2433
|
+
PUSH(val);
|
2434
|
+
#undef CURRENT_INSN_opt_lt
|
2435
|
+
#undef INSN_IS_SC
|
2436
|
+
#undef INSN_LABEL
|
2437
|
+
#undef LABEL_IS_SC
|
2438
|
+
END_INSN(opt_lt);}}}
|
2439
|
+
INSN_ENTRY(opt_le){
|
2440
|
+
{
|
2441
|
+
VALUE val;
|
2442
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2443
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2444
|
+
VALUE recv = TOPN(1);
|
2445
|
+
VALUE obj = TOPN(0);
|
2446
|
+
DEBUG_ENTER_INSN("opt_le");
|
2447
|
+
ADD_PC(1+2);
|
2448
|
+
PREFETCH(GET_PC());
|
2449
|
+
POPN(2);
|
2450
|
+
#define CURRENT_INSN_opt_le 1
|
2451
|
+
#define INSN_IS_SC() 0
|
2452
|
+
#define INSN_LABEL(lab) LABEL_opt_le_##lab
|
2453
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2454
|
+
COLLECT_USAGE_INSN(BIN(opt_le));
|
2455
|
+
COLLECT_USAGE_OPERAND(BIN(opt_le), 0, ci);
|
2456
|
+
COLLECT_USAGE_OPERAND(BIN(opt_le), 1, cc);
|
2457
|
+
{
|
2458
|
+
#line 1699 "insns.def"
|
2459
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2460
|
+
BASIC_OP_UNREDEFINED_P(BOP_LE, FIXNUM_REDEFINED_OP_FLAG)) {
|
2461
|
+
SIGNED_VALUE a = recv, b = obj;
|
2462
|
+
|
2463
|
+
if (a <= b) {
|
2464
|
+
val = Qtrue;
|
2465
|
+
}
|
2466
|
+
else {
|
2467
|
+
val = Qfalse;
|
2468
|
+
}
|
2469
|
+
}
|
2470
|
+
else if (FLONUM_2_P(recv, obj) &&
|
2471
|
+
BASIC_OP_UNREDEFINED_P(BOP_LE, FLOAT_REDEFINED_OP_FLAG)) {
|
2472
|
+
/* flonum is not NaN */
|
2473
|
+
val = RFLOAT_VALUE(recv) <= RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
|
2474
|
+
}
|
2475
|
+
else {
|
2476
|
+
/* other */
|
2477
|
+
PUSH(recv);
|
2478
|
+
PUSH(obj);
|
2479
|
+
CALL_SIMPLE_METHOD(recv);
|
2480
|
+
}
|
2481
|
+
|
2482
|
+
#line 2483 "vm.inc"
|
2483
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2484
|
+
PUSH(val);
|
2485
|
+
#undef CURRENT_INSN_opt_le
|
2486
|
+
#undef INSN_IS_SC
|
2487
|
+
#undef INSN_LABEL
|
2488
|
+
#undef LABEL_IS_SC
|
2489
|
+
END_INSN(opt_le);}}}
|
2490
|
+
INSN_ENTRY(opt_gt){
|
2491
|
+
{
|
2492
|
+
VALUE val;
|
2493
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2494
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2495
|
+
VALUE recv = TOPN(1);
|
2496
|
+
VALUE obj = TOPN(0);
|
2497
|
+
DEBUG_ENTER_INSN("opt_gt");
|
2498
|
+
ADD_PC(1+2);
|
2499
|
+
PREFETCH(GET_PC());
|
2500
|
+
POPN(2);
|
2501
|
+
#define CURRENT_INSN_opt_gt 1
|
2502
|
+
#define INSN_IS_SC() 0
|
2503
|
+
#define INSN_LABEL(lab) LABEL_opt_gt_##lab
|
2504
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2505
|
+
COLLECT_USAGE_INSN(BIN(opt_gt));
|
2506
|
+
COLLECT_USAGE_OPERAND(BIN(opt_gt), 0, ci);
|
2507
|
+
COLLECT_USAGE_OPERAND(BIN(opt_gt), 1, cc);
|
2508
|
+
{
|
2509
|
+
#line 1734 "insns.def"
|
2510
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2511
|
+
BASIC_OP_UNREDEFINED_P(BOP_GT, FIXNUM_REDEFINED_OP_FLAG)) {
|
2512
|
+
SIGNED_VALUE a = recv, b = obj;
|
2513
|
+
|
2514
|
+
if (a > b) {
|
2515
|
+
val = Qtrue;
|
2516
|
+
}
|
2517
|
+
else {
|
2518
|
+
val = Qfalse;
|
2519
|
+
}
|
2520
|
+
}
|
2521
|
+
else if (FLONUM_2_P(recv, obj) &&
|
2522
|
+
BASIC_OP_UNREDEFINED_P(BOP_GT, FLOAT_REDEFINED_OP_FLAG)) {
|
2523
|
+
/* flonum is not NaN */
|
2524
|
+
val = RFLOAT_VALUE(recv) > RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
|
2525
|
+
}
|
2526
|
+
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
2527
|
+
if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
|
2528
|
+
BASIC_OP_UNREDEFINED_P(BOP_GT, FLOAT_REDEFINED_OP_FLAG)) {
|
2529
|
+
val = double_cmp_gt(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj));
|
2530
|
+
}
|
2531
|
+
else {
|
2532
|
+
goto INSN_LABEL(normal_dispatch);
|
2533
|
+
}
|
2534
|
+
}
|
2535
|
+
else {
|
2536
|
+
INSN_LABEL(normal_dispatch):
|
2537
|
+
PUSH(recv);
|
2538
|
+
PUSH(obj);
|
2539
|
+
CALL_SIMPLE_METHOD(recv);
|
2540
|
+
}
|
2541
|
+
|
2542
|
+
#line 2543 "vm.inc"
|
2543
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2544
|
+
PUSH(val);
|
2545
|
+
#undef CURRENT_INSN_opt_gt
|
2546
|
+
#undef INSN_IS_SC
|
2547
|
+
#undef INSN_LABEL
|
2548
|
+
#undef LABEL_IS_SC
|
2549
|
+
END_INSN(opt_gt);}}}
|
2550
|
+
INSN_ENTRY(opt_ge){
|
2551
|
+
{
|
2552
|
+
VALUE val;
|
2553
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2554
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2555
|
+
VALUE recv = TOPN(1);
|
2556
|
+
VALUE obj = TOPN(0);
|
2557
|
+
DEBUG_ENTER_INSN("opt_ge");
|
2558
|
+
ADD_PC(1+2);
|
2559
|
+
PREFETCH(GET_PC());
|
2560
|
+
POPN(2);
|
2561
|
+
#define CURRENT_INSN_opt_ge 1
|
2562
|
+
#define INSN_IS_SC() 0
|
2563
|
+
#define INSN_LABEL(lab) LABEL_opt_ge_##lab
|
2564
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2565
|
+
COLLECT_USAGE_INSN(BIN(opt_ge));
|
2566
|
+
COLLECT_USAGE_OPERAND(BIN(opt_ge), 0, ci);
|
2567
|
+
COLLECT_USAGE_OPERAND(BIN(opt_ge), 1, cc);
|
2568
|
+
{
|
2569
|
+
#line 1778 "insns.def"
|
2570
|
+
if (FIXNUM_2_P(recv, obj) &&
|
2571
|
+
BASIC_OP_UNREDEFINED_P(BOP_GE, FIXNUM_REDEFINED_OP_FLAG)) {
|
2572
|
+
SIGNED_VALUE a = recv, b = obj;
|
2573
|
+
|
2574
|
+
if (a >= b) {
|
2575
|
+
val = Qtrue;
|
2576
|
+
}
|
2577
|
+
else {
|
2578
|
+
val = Qfalse;
|
2579
|
+
}
|
2580
|
+
}
|
2581
|
+
else if (FLONUM_2_P(recv, obj) &&
|
2582
|
+
BASIC_OP_UNREDEFINED_P(BOP_GE, FLOAT_REDEFINED_OP_FLAG)) {
|
2583
|
+
/* flonum is not NaN */
|
2584
|
+
val = RFLOAT_VALUE(recv) >= RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
|
2585
|
+
}
|
2586
|
+
else {
|
2587
|
+
PUSH(recv);
|
2588
|
+
PUSH(obj);
|
2589
|
+
CALL_SIMPLE_METHOD(recv);
|
2590
|
+
}
|
2591
|
+
|
2592
|
+
#line 2593 "vm.inc"
|
2593
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2594
|
+
PUSH(val);
|
2595
|
+
#undef CURRENT_INSN_opt_ge
|
2596
|
+
#undef INSN_IS_SC
|
2597
|
+
#undef INSN_LABEL
|
2598
|
+
#undef LABEL_IS_SC
|
2599
|
+
END_INSN(opt_ge);}}}
|
2600
|
+
INSN_ENTRY(opt_ltlt){
|
2601
|
+
{
|
2602
|
+
VALUE val;
|
2603
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2604
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2605
|
+
VALUE recv = TOPN(1);
|
2606
|
+
VALUE obj = TOPN(0);
|
2607
|
+
DEBUG_ENTER_INSN("opt_ltlt");
|
2608
|
+
ADD_PC(1+2);
|
2609
|
+
PREFETCH(GET_PC());
|
2610
|
+
POPN(2);
|
2611
|
+
#define CURRENT_INSN_opt_ltlt 1
|
2612
|
+
#define INSN_IS_SC() 0
|
2613
|
+
#define INSN_LABEL(lab) LABEL_opt_ltlt_##lab
|
2614
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2615
|
+
COLLECT_USAGE_INSN(BIN(opt_ltlt));
|
2616
|
+
COLLECT_USAGE_OPERAND(BIN(opt_ltlt), 0, ci);
|
2617
|
+
COLLECT_USAGE_OPERAND(BIN(opt_ltlt), 1, cc);
|
2618
|
+
{
|
2619
|
+
#line 1812 "insns.def"
|
2620
|
+
if (!SPECIAL_CONST_P(recv)) {
|
2621
|
+
if (RBASIC_CLASS(recv) == rb_cString &&
|
2622
|
+
BASIC_OP_UNREDEFINED_P(BOP_LTLT, STRING_REDEFINED_OP_FLAG)) {
|
2623
|
+
val = rb_str_concat(recv, obj);
|
2624
|
+
}
|
2625
|
+
else if (RBASIC_CLASS(recv) == rb_cArray &&
|
2626
|
+
BASIC_OP_UNREDEFINED_P(BOP_LTLT, ARRAY_REDEFINED_OP_FLAG)) {
|
2627
|
+
val = rb_ary_push(recv, obj);
|
2628
|
+
}
|
2629
|
+
else {
|
2630
|
+
goto INSN_LABEL(normal_dispatch);
|
2631
|
+
}
|
2632
|
+
}
|
2633
|
+
else {
|
2634
|
+
INSN_LABEL(normal_dispatch):
|
2635
|
+
PUSH(recv);
|
2636
|
+
PUSH(obj);
|
2637
|
+
CALL_SIMPLE_METHOD(recv);
|
2638
|
+
}
|
2639
|
+
|
2640
|
+
#line 2641 "vm.inc"
|
2641
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2642
|
+
PUSH(val);
|
2643
|
+
#undef CURRENT_INSN_opt_ltlt
|
2644
|
+
#undef INSN_IS_SC
|
2645
|
+
#undef INSN_LABEL
|
2646
|
+
#undef LABEL_IS_SC
|
2647
|
+
END_INSN(opt_ltlt);}}}
|
2648
|
+
INSN_ENTRY(opt_aref){
|
2649
|
+
{
|
2650
|
+
VALUE val;
|
2651
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2652
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2653
|
+
VALUE recv = TOPN(1);
|
2654
|
+
VALUE obj = TOPN(0);
|
2655
|
+
DEBUG_ENTER_INSN("opt_aref");
|
2656
|
+
ADD_PC(1+2);
|
2657
|
+
PREFETCH(GET_PC());
|
2658
|
+
POPN(2);
|
2659
|
+
#define CURRENT_INSN_opt_aref 1
|
2660
|
+
#define INSN_IS_SC() 0
|
2661
|
+
#define INSN_LABEL(lab) LABEL_opt_aref_##lab
|
2662
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2663
|
+
COLLECT_USAGE_INSN(BIN(opt_aref));
|
2664
|
+
COLLECT_USAGE_OPERAND(BIN(opt_aref), 0, ci);
|
2665
|
+
COLLECT_USAGE_OPERAND(BIN(opt_aref), 1, cc);
|
2666
|
+
{
|
2667
|
+
#line 1844 "insns.def"
|
2668
|
+
if (!SPECIAL_CONST_P(recv)) {
|
2669
|
+
if (RBASIC_CLASS(recv) == rb_cArray && BASIC_OP_UNREDEFINED_P(BOP_AREF, ARRAY_REDEFINED_OP_FLAG) && FIXNUM_P(obj)) {
|
2670
|
+
val = rb_ary_entry(recv, FIX2LONG(obj));
|
2671
|
+
}
|
2672
|
+
else if (RBASIC_CLASS(recv) == rb_cHash && BASIC_OP_UNREDEFINED_P(BOP_AREF, HASH_REDEFINED_OP_FLAG)) {
|
2673
|
+
val = rb_hash_aref(recv, obj);
|
2674
|
+
}
|
2675
|
+
else {
|
2676
|
+
goto INSN_LABEL(normal_dispatch);
|
2677
|
+
}
|
2678
|
+
}
|
2679
|
+
else {
|
2680
|
+
INSN_LABEL(normal_dispatch):
|
2681
|
+
PUSH(recv);
|
2682
|
+
PUSH(obj);
|
2683
|
+
CALL_SIMPLE_METHOD(recv);
|
2684
|
+
}
|
2685
|
+
|
2686
|
+
#line 2687 "vm.inc"
|
2687
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2688
|
+
PUSH(val);
|
2689
|
+
#undef CURRENT_INSN_opt_aref
|
2690
|
+
#undef INSN_IS_SC
|
2691
|
+
#undef INSN_LABEL
|
2692
|
+
#undef LABEL_IS_SC
|
2693
|
+
END_INSN(opt_aref);}}}
|
2694
|
+
INSN_ENTRY(opt_aset){
|
2695
|
+
{
|
2696
|
+
VALUE val;
|
2697
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2698
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2699
|
+
VALUE recv = TOPN(2);
|
2700
|
+
VALUE obj = TOPN(1);
|
2701
|
+
VALUE set = TOPN(0);
|
2702
|
+
DEBUG_ENTER_INSN("opt_aset");
|
2703
|
+
ADD_PC(1+2);
|
2704
|
+
PREFETCH(GET_PC());
|
2705
|
+
POPN(3);
|
2706
|
+
#define CURRENT_INSN_opt_aset 1
|
2707
|
+
#define INSN_IS_SC() 0
|
2708
|
+
#define INSN_LABEL(lab) LABEL_opt_aset_##lab
|
2709
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2710
|
+
COLLECT_USAGE_INSN(BIN(opt_aset));
|
2711
|
+
COLLECT_USAGE_OPERAND(BIN(opt_aset), 0, ci);
|
2712
|
+
COLLECT_USAGE_OPERAND(BIN(opt_aset), 1, cc);
|
2713
|
+
{
|
2714
|
+
#line 1874 "insns.def"
|
2715
|
+
if (!SPECIAL_CONST_P(recv)) {
|
2716
|
+
if (RBASIC_CLASS(recv) == rb_cArray && BASIC_OP_UNREDEFINED_P(BOP_ASET, ARRAY_REDEFINED_OP_FLAG) && FIXNUM_P(obj)) {
|
2717
|
+
rb_ary_store(recv, FIX2LONG(obj), set);
|
2718
|
+
val = set;
|
2719
|
+
}
|
2720
|
+
else if (RBASIC_CLASS(recv) == rb_cHash && BASIC_OP_UNREDEFINED_P(BOP_ASET, HASH_REDEFINED_OP_FLAG)) {
|
2721
|
+
rb_hash_aset(recv, obj, set);
|
2722
|
+
val = set;
|
2723
|
+
}
|
2724
|
+
else {
|
2725
|
+
goto INSN_LABEL(normal_dispatch);
|
2726
|
+
}
|
2727
|
+
}
|
2728
|
+
else {
|
2729
|
+
INSN_LABEL(normal_dispatch):
|
2730
|
+
PUSH(recv);
|
2731
|
+
PUSH(obj);
|
2732
|
+
PUSH(set);
|
2733
|
+
CALL_SIMPLE_METHOD(recv);
|
2734
|
+
}
|
2735
|
+
|
2736
|
+
#line 2737 "vm.inc"
|
2737
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2738
|
+
PUSH(val);
|
2739
|
+
#undef CURRENT_INSN_opt_aset
|
2740
|
+
#undef INSN_IS_SC
|
2741
|
+
#undef INSN_LABEL
|
2742
|
+
#undef LABEL_IS_SC
|
2743
|
+
END_INSN(opt_aset);}}}
|
2744
|
+
INSN_ENTRY(opt_aset_with){
|
2745
|
+
{
|
2746
|
+
VALUE key = (VALUE)GET_OPERAND(3);
|
2747
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2748
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2749
|
+
VALUE recv = TOPN(1);
|
2750
|
+
VALUE val = TOPN(0);
|
2751
|
+
DEBUG_ENTER_INSN("opt_aset_with");
|
2752
|
+
ADD_PC(1+3);
|
2753
|
+
PREFETCH(GET_PC());
|
2754
|
+
POPN(2);
|
2755
|
+
#define CURRENT_INSN_opt_aset_with 1
|
2756
|
+
#define INSN_IS_SC() 0
|
2757
|
+
#define INSN_LABEL(lab) LABEL_opt_aset_with_##lab
|
2758
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2759
|
+
COLLECT_USAGE_INSN(BIN(opt_aset_with));
|
2760
|
+
COLLECT_USAGE_OPERAND(BIN(opt_aset_with), 0, ci);
|
2761
|
+
COLLECT_USAGE_OPERAND(BIN(opt_aset_with), 1, cc);
|
2762
|
+
COLLECT_USAGE_OPERAND(BIN(opt_aset_with), 2, key);
|
2763
|
+
{
|
2764
|
+
#line 1907 "insns.def"
|
2765
|
+
if (!SPECIAL_CONST_P(recv) && RBASIC_CLASS(recv) == rb_cHash &&
|
2766
|
+
BASIC_OP_UNREDEFINED_P(BOP_ASET, HASH_REDEFINED_OP_FLAG) &&
|
2767
|
+
rb_hash_compare_by_id_p(recv) == Qfalse) {
|
2768
|
+
rb_hash_aset(recv, key, val);
|
2769
|
+
}
|
2770
|
+
else {
|
2771
|
+
PUSH(recv);
|
2772
|
+
PUSH(rb_str_resurrect(key));
|
2773
|
+
PUSH(val);
|
2774
|
+
CALL_SIMPLE_METHOD(recv);
|
2775
|
+
}
|
2776
|
+
|
2777
|
+
#line 2778 "vm.inc"
|
2778
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2779
|
+
PUSH(val);
|
2780
|
+
#undef CURRENT_INSN_opt_aset_with
|
2781
|
+
#undef INSN_IS_SC
|
2782
|
+
#undef INSN_LABEL
|
2783
|
+
#undef LABEL_IS_SC
|
2784
|
+
END_INSN(opt_aset_with);}}}
|
2785
|
+
INSN_ENTRY(opt_aref_with){
|
2786
|
+
{
|
2787
|
+
VALUE val;
|
2788
|
+
VALUE key = (VALUE)GET_OPERAND(3);
|
2789
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2790
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2791
|
+
VALUE recv = TOPN(0);
|
2792
|
+
DEBUG_ENTER_INSN("opt_aref_with");
|
2793
|
+
ADD_PC(1+3);
|
2794
|
+
PREFETCH(GET_PC());
|
2795
|
+
POPN(1);
|
2796
|
+
#define CURRENT_INSN_opt_aref_with 1
|
2797
|
+
#define INSN_IS_SC() 0
|
2798
|
+
#define INSN_LABEL(lab) LABEL_opt_aref_with_##lab
|
2799
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2800
|
+
COLLECT_USAGE_INSN(BIN(opt_aref_with));
|
2801
|
+
COLLECT_USAGE_OPERAND(BIN(opt_aref_with), 0, ci);
|
2802
|
+
COLLECT_USAGE_OPERAND(BIN(opt_aref_with), 1, cc);
|
2803
|
+
COLLECT_USAGE_OPERAND(BIN(opt_aref_with), 2, key);
|
2804
|
+
{
|
2805
|
+
#line 1931 "insns.def"
|
2806
|
+
if (!SPECIAL_CONST_P(recv) && RBASIC_CLASS(recv) == rb_cHash &&
|
2807
|
+
BASIC_OP_UNREDEFINED_P(BOP_AREF, HASH_REDEFINED_OP_FLAG) &&
|
2808
|
+
rb_hash_compare_by_id_p(recv) == Qfalse) {
|
2809
|
+
val = rb_hash_aref(recv, key);
|
2810
|
+
}
|
2811
|
+
else {
|
2812
|
+
PUSH(recv);
|
2813
|
+
PUSH(rb_str_resurrect(key));
|
2814
|
+
CALL_SIMPLE_METHOD(recv);
|
2815
|
+
}
|
2816
|
+
|
2817
|
+
#line 2818 "vm.inc"
|
2818
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2819
|
+
PUSH(val);
|
2820
|
+
#undef CURRENT_INSN_opt_aref_with
|
2821
|
+
#undef INSN_IS_SC
|
2822
|
+
#undef INSN_LABEL
|
2823
|
+
#undef LABEL_IS_SC
|
2824
|
+
END_INSN(opt_aref_with);}}}
|
2825
|
+
INSN_ENTRY(opt_length){
|
2826
|
+
{
|
2827
|
+
VALUE val;
|
2828
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2829
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2830
|
+
VALUE recv = TOPN(0);
|
2831
|
+
DEBUG_ENTER_INSN("opt_length");
|
2832
|
+
ADD_PC(1+2);
|
2833
|
+
PREFETCH(GET_PC());
|
2834
|
+
POPN(1);
|
2835
|
+
#define CURRENT_INSN_opt_length 1
|
2836
|
+
#define INSN_IS_SC() 0
|
2837
|
+
#define INSN_LABEL(lab) LABEL_opt_length_##lab
|
2838
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2839
|
+
COLLECT_USAGE_INSN(BIN(opt_length));
|
2840
|
+
COLLECT_USAGE_OPERAND(BIN(opt_length), 0, ci);
|
2841
|
+
COLLECT_USAGE_OPERAND(BIN(opt_length), 1, cc);
|
2842
|
+
{
|
2843
|
+
#line 1954 "insns.def"
|
2844
|
+
if (!SPECIAL_CONST_P(recv)) {
|
2845
|
+
if (RBASIC_CLASS(recv) == rb_cString &&
|
2846
|
+
BASIC_OP_UNREDEFINED_P(BOP_LENGTH, STRING_REDEFINED_OP_FLAG)) {
|
2847
|
+
val = rb_str_length(recv);
|
2848
|
+
}
|
2849
|
+
else if (RBASIC_CLASS(recv) == rb_cArray &&
|
2850
|
+
BASIC_OP_UNREDEFINED_P(BOP_LENGTH, ARRAY_REDEFINED_OP_FLAG)) {
|
2851
|
+
val = LONG2NUM(RARRAY_LEN(recv));
|
2852
|
+
}
|
2853
|
+
else if (RBASIC_CLASS(recv) == rb_cHash &&
|
2854
|
+
BASIC_OP_UNREDEFINED_P(BOP_LENGTH, HASH_REDEFINED_OP_FLAG)) {
|
2855
|
+
val = INT2FIX(RHASH_SIZE(recv));
|
2856
|
+
}
|
2857
|
+
else {
|
2858
|
+
goto INSN_LABEL(normal_dispatch);
|
2859
|
+
}
|
2860
|
+
}
|
2861
|
+
else {
|
2862
|
+
INSN_LABEL(normal_dispatch):
|
2863
|
+
PUSH(recv);
|
2864
|
+
CALL_SIMPLE_METHOD(recv);
|
2865
|
+
}
|
2866
|
+
|
2867
|
+
#line 2868 "vm.inc"
|
2868
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2869
|
+
PUSH(val);
|
2870
|
+
#undef CURRENT_INSN_opt_length
|
2871
|
+
#undef INSN_IS_SC
|
2872
|
+
#undef INSN_LABEL
|
2873
|
+
#undef LABEL_IS_SC
|
2874
|
+
END_INSN(opt_length);}}}
|
2875
|
+
INSN_ENTRY(opt_size){
|
2876
|
+
{
|
2877
|
+
VALUE val;
|
2878
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2879
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2880
|
+
VALUE recv = TOPN(0);
|
2881
|
+
DEBUG_ENTER_INSN("opt_size");
|
2882
|
+
ADD_PC(1+2);
|
2883
|
+
PREFETCH(GET_PC());
|
2884
|
+
POPN(1);
|
2885
|
+
#define CURRENT_INSN_opt_size 1
|
2886
|
+
#define INSN_IS_SC() 0
|
2887
|
+
#define INSN_LABEL(lab) LABEL_opt_size_##lab
|
2888
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2889
|
+
COLLECT_USAGE_INSN(BIN(opt_size));
|
2890
|
+
COLLECT_USAGE_OPERAND(BIN(opt_size), 0, ci);
|
2891
|
+
COLLECT_USAGE_OPERAND(BIN(opt_size), 1, cc);
|
2892
|
+
{
|
2893
|
+
#line 1989 "insns.def"
|
2894
|
+
if (!SPECIAL_CONST_P(recv)) {
|
2895
|
+
if (RBASIC_CLASS(recv) == rb_cString &&
|
2896
|
+
BASIC_OP_UNREDEFINED_P(BOP_SIZE, STRING_REDEFINED_OP_FLAG)) {
|
2897
|
+
val = rb_str_length(recv);
|
2898
|
+
}
|
2899
|
+
else if (RBASIC_CLASS(recv) == rb_cArray &&
|
2900
|
+
BASIC_OP_UNREDEFINED_P(BOP_SIZE, ARRAY_REDEFINED_OP_FLAG)) {
|
2901
|
+
val = LONG2NUM(RARRAY_LEN(recv));
|
2902
|
+
}
|
2903
|
+
else if (RBASIC_CLASS(recv) == rb_cHash &&
|
2904
|
+
BASIC_OP_UNREDEFINED_P(BOP_SIZE, HASH_REDEFINED_OP_FLAG)) {
|
2905
|
+
val = INT2FIX(RHASH_SIZE(recv));
|
2906
|
+
}
|
2907
|
+
else {
|
2908
|
+
goto INSN_LABEL(normal_dispatch);
|
2909
|
+
}
|
2910
|
+
}
|
2911
|
+
else {
|
2912
|
+
INSN_LABEL(normal_dispatch):
|
2913
|
+
PUSH(recv);
|
2914
|
+
CALL_SIMPLE_METHOD(recv);
|
2915
|
+
}
|
2916
|
+
|
2917
|
+
#line 2918 "vm.inc"
|
2918
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2919
|
+
PUSH(val);
|
2920
|
+
#undef CURRENT_INSN_opt_size
|
2921
|
+
#undef INSN_IS_SC
|
2922
|
+
#undef INSN_LABEL
|
2923
|
+
#undef LABEL_IS_SC
|
2924
|
+
END_INSN(opt_size);}}}
|
2925
|
+
INSN_ENTRY(opt_empty_p){
|
2926
|
+
{
|
2927
|
+
VALUE val;
|
2928
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2929
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2930
|
+
VALUE recv = TOPN(0);
|
2931
|
+
DEBUG_ENTER_INSN("opt_empty_p");
|
2932
|
+
ADD_PC(1+2);
|
2933
|
+
PREFETCH(GET_PC());
|
2934
|
+
POPN(1);
|
2935
|
+
#define CURRENT_INSN_opt_empty_p 1
|
2936
|
+
#define INSN_IS_SC() 0
|
2937
|
+
#define INSN_LABEL(lab) LABEL_opt_empty_p_##lab
|
2938
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2939
|
+
COLLECT_USAGE_INSN(BIN(opt_empty_p));
|
2940
|
+
COLLECT_USAGE_OPERAND(BIN(opt_empty_p), 0, ci);
|
2941
|
+
COLLECT_USAGE_OPERAND(BIN(opt_empty_p), 1, cc);
|
2942
|
+
{
|
2943
|
+
#line 2024 "insns.def"
|
2944
|
+
if (!SPECIAL_CONST_P(recv)) {
|
2945
|
+
if (RBASIC_CLASS(recv) == rb_cString &&
|
2946
|
+
BASIC_OP_UNREDEFINED_P(BOP_EMPTY_P, STRING_REDEFINED_OP_FLAG)) {
|
2947
|
+
if (RSTRING_LEN(recv) == 0) val = Qtrue;
|
2948
|
+
else val = Qfalse;
|
2949
|
+
}
|
2950
|
+
else if (RBASIC_CLASS(recv) == rb_cArray &&
|
2951
|
+
BASIC_OP_UNREDEFINED_P(BOP_EMPTY_P, ARRAY_REDEFINED_OP_FLAG)) {
|
2952
|
+
if (RARRAY_LEN(recv) == 0) val = Qtrue;
|
2953
|
+
else val = Qfalse;
|
2954
|
+
}
|
2955
|
+
else if (RBASIC_CLASS(recv) == rb_cHash &&
|
2956
|
+
BASIC_OP_UNREDEFINED_P(BOP_EMPTY_P, HASH_REDEFINED_OP_FLAG)) {
|
2957
|
+
if (RHASH_EMPTY_P(recv)) val = Qtrue;
|
2958
|
+
else val = Qfalse;
|
2959
|
+
}
|
2960
|
+
else {
|
2961
|
+
goto INSN_LABEL(normal_dispatch);
|
2962
|
+
}
|
2963
|
+
}
|
2964
|
+
else {
|
2965
|
+
INSN_LABEL(normal_dispatch):
|
2966
|
+
PUSH(recv);
|
2967
|
+
CALL_SIMPLE_METHOD(recv);
|
2968
|
+
}
|
2969
|
+
|
2970
|
+
#line 2971 "vm.inc"
|
2971
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
2972
|
+
PUSH(val);
|
2973
|
+
#undef CURRENT_INSN_opt_empty_p
|
2974
|
+
#undef INSN_IS_SC
|
2975
|
+
#undef INSN_LABEL
|
2976
|
+
#undef LABEL_IS_SC
|
2977
|
+
END_INSN(opt_empty_p);}}}
|
2978
|
+
INSN_ENTRY(opt_succ){
|
2979
|
+
{
|
2980
|
+
VALUE val;
|
2981
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
2982
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
2983
|
+
VALUE recv = TOPN(0);
|
2984
|
+
DEBUG_ENTER_INSN("opt_succ");
|
2985
|
+
ADD_PC(1+2);
|
2986
|
+
PREFETCH(GET_PC());
|
2987
|
+
POPN(1);
|
2988
|
+
#define CURRENT_INSN_opt_succ 1
|
2989
|
+
#define INSN_IS_SC() 0
|
2990
|
+
#define INSN_LABEL(lab) LABEL_opt_succ_##lab
|
2991
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
2992
|
+
COLLECT_USAGE_INSN(BIN(opt_succ));
|
2993
|
+
COLLECT_USAGE_OPERAND(BIN(opt_succ), 0, ci);
|
2994
|
+
COLLECT_USAGE_OPERAND(BIN(opt_succ), 1, cc);
|
2995
|
+
{
|
2996
|
+
#line 2062 "insns.def"
|
2997
|
+
if (SPECIAL_CONST_P(recv)) {
|
2998
|
+
if (FIXNUM_P(recv) &&
|
2999
|
+
BASIC_OP_UNREDEFINED_P(BOP_SUCC, FIXNUM_REDEFINED_OP_FLAG)) {
|
3000
|
+
const VALUE obj = INT2FIX(1);
|
3001
|
+
/* fixnum + INT2FIX(1) */
|
3002
|
+
val = (recv + (obj & (~1)));
|
3003
|
+
if ((~(recv ^ obj) & (recv ^ val)) & ((unsigned long)LONG_MAX + 1)) {
|
3004
|
+
val = rb_big_plus(rb_int2big(FIX2LONG(recv)),
|
3005
|
+
rb_int2big(FIX2LONG(obj)));
|
3006
|
+
}
|
3007
|
+
}
|
3008
|
+
else {
|
3009
|
+
goto INSN_LABEL(normal_dispatch);
|
3010
|
+
}
|
3011
|
+
}
|
3012
|
+
else {
|
3013
|
+
if (RBASIC_CLASS(recv) == rb_cString &&
|
3014
|
+
BASIC_OP_UNREDEFINED_P(BOP_SUCC, STRING_REDEFINED_OP_FLAG)) {
|
3015
|
+
val = rb_str_succ(recv);
|
3016
|
+
}
|
3017
|
+
else {
|
3018
|
+
goto INSN_LABEL(normal_dispatch);
|
3019
|
+
}
|
3020
|
+
}
|
3021
|
+
if (0) {
|
3022
|
+
INSN_LABEL(normal_dispatch):
|
3023
|
+
PUSH(recv);
|
3024
|
+
CALL_SIMPLE_METHOD(recv);
|
3025
|
+
}
|
3026
|
+
|
3027
|
+
#line 3028 "vm.inc"
|
3028
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
3029
|
+
PUSH(val);
|
3030
|
+
#undef CURRENT_INSN_opt_succ
|
3031
|
+
#undef INSN_IS_SC
|
3032
|
+
#undef INSN_LABEL
|
3033
|
+
#undef LABEL_IS_SC
|
3034
|
+
END_INSN(opt_succ);}}}
|
3035
|
+
INSN_ENTRY(opt_not){
|
3036
|
+
{
|
3037
|
+
VALUE val;
|
3038
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
3039
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
3040
|
+
VALUE recv = TOPN(0);
|
3041
|
+
DEBUG_ENTER_INSN("opt_not");
|
3042
|
+
ADD_PC(1+2);
|
3043
|
+
PREFETCH(GET_PC());
|
3044
|
+
POPN(1);
|
3045
|
+
#define CURRENT_INSN_opt_not 1
|
3046
|
+
#define INSN_IS_SC() 0
|
3047
|
+
#define INSN_LABEL(lab) LABEL_opt_not_##lab
|
3048
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3049
|
+
COLLECT_USAGE_INSN(BIN(opt_not));
|
3050
|
+
COLLECT_USAGE_OPERAND(BIN(opt_not), 0, ci);
|
3051
|
+
COLLECT_USAGE_OPERAND(BIN(opt_not), 1, cc);
|
3052
|
+
{
|
3053
|
+
#line 2104 "insns.def"
|
3054
|
+
extern VALUE rb_obj_not(VALUE obj);
|
3055
|
+
|
3056
|
+
vm_search_method(ci, cc, recv);
|
3057
|
+
|
3058
|
+
if (check_cfunc(cc->me, rb_obj_not)) {
|
3059
|
+
val = RTEST(recv) ? Qfalse : Qtrue;
|
3060
|
+
}
|
3061
|
+
else {
|
3062
|
+
PUSH(recv);
|
3063
|
+
CALL_SIMPLE_METHOD(recv);
|
3064
|
+
}
|
3065
|
+
|
3066
|
+
#line 3067 "vm.inc"
|
3067
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
3068
|
+
PUSH(val);
|
3069
|
+
#undef CURRENT_INSN_opt_not
|
3070
|
+
#undef INSN_IS_SC
|
3071
|
+
#undef INSN_LABEL
|
3072
|
+
#undef LABEL_IS_SC
|
3073
|
+
END_INSN(opt_not);}}}
|
3074
|
+
INSN_ENTRY(opt_regexpmatch1){
|
3075
|
+
{
|
3076
|
+
VALUE val;
|
3077
|
+
VALUE r = (VALUE)GET_OPERAND(1);
|
3078
|
+
VALUE obj = TOPN(0);
|
3079
|
+
DEBUG_ENTER_INSN("opt_regexpmatch1");
|
3080
|
+
ADD_PC(1+1);
|
3081
|
+
PREFETCH(GET_PC());
|
3082
|
+
POPN(1);
|
3083
|
+
#define CURRENT_INSN_opt_regexpmatch1 1
|
3084
|
+
#define INSN_IS_SC() 0
|
3085
|
+
#define INSN_LABEL(lab) LABEL_opt_regexpmatch1_##lab
|
3086
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3087
|
+
COLLECT_USAGE_INSN(BIN(opt_regexpmatch1));
|
3088
|
+
COLLECT_USAGE_OPERAND(BIN(opt_regexpmatch1), 0, r);
|
3089
|
+
{
|
3090
|
+
#line 2129 "insns.def"
|
3091
|
+
if (BASIC_OP_UNREDEFINED_P(BOP_MATCH, REGEXP_REDEFINED_OP_FLAG)) {
|
3092
|
+
val = rb_reg_match(r, obj);
|
3093
|
+
}
|
3094
|
+
else {
|
3095
|
+
val = rb_funcall(r, idEqTilde, 1, obj);
|
3096
|
+
}
|
3097
|
+
|
3098
|
+
#line 3099 "vm.inc"
|
3099
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
3100
|
+
PUSH(val);
|
3101
|
+
#undef CURRENT_INSN_opt_regexpmatch1
|
3102
|
+
#undef INSN_IS_SC
|
3103
|
+
#undef INSN_LABEL
|
3104
|
+
#undef LABEL_IS_SC
|
3105
|
+
END_INSN(opt_regexpmatch1);}}}
|
3106
|
+
INSN_ENTRY(opt_regexpmatch2){
|
3107
|
+
{
|
3108
|
+
VALUE val;
|
3109
|
+
CALL_CACHE cc = (CALL_CACHE)GET_OPERAND(2);
|
3110
|
+
CALL_INFO ci = (CALL_INFO)GET_OPERAND(1);
|
3111
|
+
VALUE obj2 = TOPN(1);
|
3112
|
+
VALUE obj1 = TOPN(0);
|
3113
|
+
DEBUG_ENTER_INSN("opt_regexpmatch2");
|
3114
|
+
ADD_PC(1+2);
|
3115
|
+
PREFETCH(GET_PC());
|
3116
|
+
POPN(2);
|
3117
|
+
#define CURRENT_INSN_opt_regexpmatch2 1
|
3118
|
+
#define INSN_IS_SC() 0
|
3119
|
+
#define INSN_LABEL(lab) LABEL_opt_regexpmatch2_##lab
|
3120
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3121
|
+
COLLECT_USAGE_INSN(BIN(opt_regexpmatch2));
|
3122
|
+
COLLECT_USAGE_OPERAND(BIN(opt_regexpmatch2), 0, ci);
|
3123
|
+
COLLECT_USAGE_OPERAND(BIN(opt_regexpmatch2), 1, cc);
|
3124
|
+
{
|
3125
|
+
#line 2148 "insns.def"
|
3126
|
+
if (CLASS_OF(obj2) == rb_cString &&
|
3127
|
+
BASIC_OP_UNREDEFINED_P(BOP_MATCH, STRING_REDEFINED_OP_FLAG)) {
|
3128
|
+
val = rb_reg_match(obj1, obj2);
|
3129
|
+
}
|
3130
|
+
else {
|
3131
|
+
PUSH(obj2);
|
3132
|
+
PUSH(obj1);
|
3133
|
+
CALL_SIMPLE_METHOD(obj2);
|
3134
|
+
}
|
3135
|
+
|
3136
|
+
#line 3137 "vm.inc"
|
3137
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
3138
|
+
PUSH(val);
|
3139
|
+
#undef CURRENT_INSN_opt_regexpmatch2
|
3140
|
+
#undef INSN_IS_SC
|
3141
|
+
#undef INSN_LABEL
|
3142
|
+
#undef LABEL_IS_SC
|
3143
|
+
END_INSN(opt_regexpmatch2);}}}
|
3144
|
+
INSN_ENTRY(opt_call_c_function){
|
3145
|
+
{
|
3146
|
+
rb_insn_func_t funcptr = (rb_insn_func_t)GET_OPERAND(1);
|
3147
|
+
|
3148
|
+
DEBUG_ENTER_INSN("opt_call_c_function");
|
3149
|
+
ADD_PC(1+1);
|
3150
|
+
PREFETCH(GET_PC());
|
3151
|
+
#define CURRENT_INSN_opt_call_c_function 1
|
3152
|
+
#define INSN_IS_SC() 0
|
3153
|
+
#define INSN_LABEL(lab) LABEL_opt_call_c_function_##lab
|
3154
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3155
|
+
COLLECT_USAGE_INSN(BIN(opt_call_c_function));
|
3156
|
+
COLLECT_USAGE_OPERAND(BIN(opt_call_c_function), 0, funcptr);
|
3157
|
+
{
|
3158
|
+
#line 2170 "insns.def"
|
3159
|
+
reg_cfp = (funcptr)(th, reg_cfp);
|
3160
|
+
|
3161
|
+
if (reg_cfp == 0) {
|
3162
|
+
VALUE err = th->errinfo;
|
3163
|
+
th->errinfo = Qnil;
|
3164
|
+
THROW_EXCEPTION(err);
|
3165
|
+
}
|
3166
|
+
|
3167
|
+
RESTORE_REGS();
|
3168
|
+
NEXT_INSN();
|
3169
|
+
|
3170
|
+
#line 3171 "vm.inc"
|
3171
|
+
#undef CURRENT_INSN_opt_call_c_function
|
3172
|
+
#undef INSN_IS_SC
|
3173
|
+
#undef INSN_LABEL
|
3174
|
+
#undef LABEL_IS_SC
|
3175
|
+
END_INSN(opt_call_c_function);}}}
|
3176
|
+
INSN_ENTRY(bitblt){
|
3177
|
+
{
|
3178
|
+
VALUE ret;
|
3179
|
+
|
3180
|
+
|
3181
|
+
DEBUG_ENTER_INSN("bitblt");
|
3182
|
+
ADD_PC(1+0);
|
3183
|
+
PREFETCH(GET_PC());
|
3184
|
+
#define CURRENT_INSN_bitblt 1
|
3185
|
+
#define INSN_IS_SC() 0
|
3186
|
+
#define INSN_LABEL(lab) LABEL_bitblt_##lab
|
3187
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3188
|
+
COLLECT_USAGE_INSN(BIN(bitblt));
|
3189
|
+
{
|
3190
|
+
#line 2193 "insns.def"
|
3191
|
+
ret = rb_str_new2("a bit of bacon, lettuce and tomato");
|
3192
|
+
|
3193
|
+
#line 3194 "vm.inc"
|
3194
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
3195
|
+
PUSH(ret);
|
3196
|
+
#undef CURRENT_INSN_bitblt
|
3197
|
+
#undef INSN_IS_SC
|
3198
|
+
#undef INSN_LABEL
|
3199
|
+
#undef LABEL_IS_SC
|
3200
|
+
END_INSN(bitblt);}}}
|
3201
|
+
INSN_ENTRY(answer){
|
3202
|
+
{
|
3203
|
+
VALUE ret;
|
3204
|
+
|
3205
|
+
|
3206
|
+
DEBUG_ENTER_INSN("answer");
|
3207
|
+
ADD_PC(1+0);
|
3208
|
+
PREFETCH(GET_PC());
|
3209
|
+
#define CURRENT_INSN_answer 1
|
3210
|
+
#define INSN_IS_SC() 0
|
3211
|
+
#define INSN_LABEL(lab) LABEL_answer_##lab
|
3212
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3213
|
+
COLLECT_USAGE_INSN(BIN(answer));
|
3214
|
+
{
|
3215
|
+
#line 2207 "insns.def"
|
3216
|
+
ret = INT2FIX(42);
|
3217
|
+
|
3218
|
+
#line 3219 "vm.inc"
|
3219
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
3220
|
+
PUSH(ret);
|
3221
|
+
#undef CURRENT_INSN_answer
|
3222
|
+
#undef INSN_IS_SC
|
3223
|
+
#undef INSN_LABEL
|
3224
|
+
#undef LABEL_IS_SC
|
3225
|
+
END_INSN(answer);}}}
|
3226
|
+
INSN_ENTRY(getlocal_OP__WC__0){
|
3227
|
+
{
|
3228
|
+
VALUE val;
|
3229
|
+
#define level 0
|
3230
|
+
lindex_t idx = (lindex_t)GET_OPERAND(1);
|
3231
|
+
|
3232
|
+
DEBUG_ENTER_INSN("getlocal_OP__WC__0");
|
3233
|
+
ADD_PC(1+1);
|
3234
|
+
PREFETCH(GET_PC());
|
3235
|
+
#define CURRENT_INSN_getlocal_OP__WC__0 1
|
3236
|
+
#define INSN_IS_SC() 0
|
3237
|
+
#define INSN_LABEL(lab) LABEL_getlocal_OP__WC__0_##lab
|
3238
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3239
|
+
COLLECT_USAGE_INSN(BIN(getlocal_OP__WC__0));
|
3240
|
+
COLLECT_USAGE_OPERAND(BIN(getlocal_OP__WC__0), 0, idx);
|
3241
|
+
{
|
3242
|
+
#line 60 "insns.def"
|
3243
|
+
int i, lev = (int)level;
|
3244
|
+
VALUE *ep = GET_EP();
|
3245
|
+
|
3246
|
+
/* optimized insns generated for level == (0|1) in defs/opt_operand.def */
|
3247
|
+
for (i = 0; i < lev; i++) {
|
3248
|
+
ep = GET_PREV_EP(ep);
|
3249
|
+
}
|
3250
|
+
val = *(ep - idx);
|
3251
|
+
|
3252
|
+
#line 3253 "vm.inc"
|
3253
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
3254
|
+
PUSH(val);
|
3255
|
+
#undef level
|
3256
|
+
#undef CURRENT_INSN_getlocal_OP__WC__0
|
3257
|
+
#undef INSN_IS_SC
|
3258
|
+
#undef INSN_LABEL
|
3259
|
+
#undef LABEL_IS_SC
|
3260
|
+
END_INSN(getlocal_OP__WC__0);}}}
|
3261
|
+
INSN_ENTRY(getlocal_OP__WC__1){
|
3262
|
+
{
|
3263
|
+
VALUE val;
|
3264
|
+
#define level 1
|
3265
|
+
lindex_t idx = (lindex_t)GET_OPERAND(1);
|
3266
|
+
|
3267
|
+
DEBUG_ENTER_INSN("getlocal_OP__WC__1");
|
3268
|
+
ADD_PC(1+1);
|
3269
|
+
PREFETCH(GET_PC());
|
3270
|
+
#define CURRENT_INSN_getlocal_OP__WC__1 1
|
3271
|
+
#define INSN_IS_SC() 0
|
3272
|
+
#define INSN_LABEL(lab) LABEL_getlocal_OP__WC__1_##lab
|
3273
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3274
|
+
COLLECT_USAGE_INSN(BIN(getlocal_OP__WC__1));
|
3275
|
+
COLLECT_USAGE_OPERAND(BIN(getlocal_OP__WC__1), 0, idx);
|
3276
|
+
{
|
3277
|
+
#line 60 "insns.def"
|
3278
|
+
int i, lev = (int)level;
|
3279
|
+
VALUE *ep = GET_EP();
|
3280
|
+
|
3281
|
+
/* optimized insns generated for level == (0|1) in defs/opt_operand.def */
|
3282
|
+
for (i = 0; i < lev; i++) {
|
3283
|
+
ep = GET_PREV_EP(ep);
|
3284
|
+
}
|
3285
|
+
val = *(ep - idx);
|
3286
|
+
|
3287
|
+
#line 3288 "vm.inc"
|
3288
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
3289
|
+
PUSH(val);
|
3290
|
+
#undef level
|
3291
|
+
#undef CURRENT_INSN_getlocal_OP__WC__1
|
3292
|
+
#undef INSN_IS_SC
|
3293
|
+
#undef INSN_LABEL
|
3294
|
+
#undef LABEL_IS_SC
|
3295
|
+
END_INSN(getlocal_OP__WC__1);}}}
|
3296
|
+
INSN_ENTRY(setlocal_OP__WC__0){
|
3297
|
+
{
|
3298
|
+
#define level 0
|
3299
|
+
lindex_t idx = (lindex_t)GET_OPERAND(1);
|
3300
|
+
VALUE val = TOPN(0);
|
3301
|
+
DEBUG_ENTER_INSN("setlocal_OP__WC__0");
|
3302
|
+
ADD_PC(1+1);
|
3303
|
+
PREFETCH(GET_PC());
|
3304
|
+
POPN(1);
|
3305
|
+
#define CURRENT_INSN_setlocal_OP__WC__0 1
|
3306
|
+
#define INSN_IS_SC() 0
|
3307
|
+
#define INSN_LABEL(lab) LABEL_setlocal_OP__WC__0_##lab
|
3308
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3309
|
+
COLLECT_USAGE_INSN(BIN(setlocal_OP__WC__0));
|
3310
|
+
COLLECT_USAGE_OPERAND(BIN(setlocal_OP__WC__0), 0, idx);
|
3311
|
+
{
|
3312
|
+
#line 83 "insns.def"
|
3313
|
+
int i, lev = (int)level;
|
3314
|
+
VALUE *ep = GET_EP();
|
3315
|
+
|
3316
|
+
/* optimized insns generated for level == (0|1) in defs/opt_operand.def */
|
3317
|
+
for (i = 0; i < lev; i++) {
|
3318
|
+
ep = GET_PREV_EP(ep);
|
3319
|
+
}
|
3320
|
+
*(ep - idx) = val;
|
3321
|
+
|
3322
|
+
#line 3323 "vm.inc"
|
3323
|
+
#undef level
|
3324
|
+
#undef CURRENT_INSN_setlocal_OP__WC__0
|
3325
|
+
#undef INSN_IS_SC
|
3326
|
+
#undef INSN_LABEL
|
3327
|
+
#undef LABEL_IS_SC
|
3328
|
+
END_INSN(setlocal_OP__WC__0);}}}
|
3329
|
+
INSN_ENTRY(setlocal_OP__WC__1){
|
3330
|
+
{
|
3331
|
+
#define level 1
|
3332
|
+
lindex_t idx = (lindex_t)GET_OPERAND(1);
|
3333
|
+
VALUE val = TOPN(0);
|
3334
|
+
DEBUG_ENTER_INSN("setlocal_OP__WC__1");
|
3335
|
+
ADD_PC(1+1);
|
3336
|
+
PREFETCH(GET_PC());
|
3337
|
+
POPN(1);
|
3338
|
+
#define CURRENT_INSN_setlocal_OP__WC__1 1
|
3339
|
+
#define INSN_IS_SC() 0
|
3340
|
+
#define INSN_LABEL(lab) LABEL_setlocal_OP__WC__1_##lab
|
3341
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3342
|
+
COLLECT_USAGE_INSN(BIN(setlocal_OP__WC__1));
|
3343
|
+
COLLECT_USAGE_OPERAND(BIN(setlocal_OP__WC__1), 0, idx);
|
3344
|
+
{
|
3345
|
+
#line 83 "insns.def"
|
3346
|
+
int i, lev = (int)level;
|
3347
|
+
VALUE *ep = GET_EP();
|
3348
|
+
|
3349
|
+
/* optimized insns generated for level == (0|1) in defs/opt_operand.def */
|
3350
|
+
for (i = 0; i < lev; i++) {
|
3351
|
+
ep = GET_PREV_EP(ep);
|
3352
|
+
}
|
3353
|
+
*(ep - idx) = val;
|
3354
|
+
|
3355
|
+
#line 3356 "vm.inc"
|
3356
|
+
#undef level
|
3357
|
+
#undef CURRENT_INSN_setlocal_OP__WC__1
|
3358
|
+
#undef INSN_IS_SC
|
3359
|
+
#undef INSN_LABEL
|
3360
|
+
#undef LABEL_IS_SC
|
3361
|
+
END_INSN(setlocal_OP__WC__1);}}}
|
3362
|
+
INSN_ENTRY(putobject_OP_INT2FIX_O_0_C_){
|
3363
|
+
{
|
3364
|
+
#define val INT2FIX(0)
|
3365
|
+
|
3366
|
+
|
3367
|
+
DEBUG_ENTER_INSN("putobject_OP_INT2FIX_O_0_C_");
|
3368
|
+
ADD_PC(1+0);
|
3369
|
+
PREFETCH(GET_PC());
|
3370
|
+
#define CURRENT_INSN_putobject_OP_INT2FIX_O_0_C_ 1
|
3371
|
+
#define INSN_IS_SC() 0
|
3372
|
+
#define INSN_LABEL(lab) LABEL_putobject_OP_INT2FIX_O_0_C__##lab
|
3373
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3374
|
+
COLLECT_USAGE_INSN(BIN(putobject_OP_INT2FIX_O_0_C_));
|
3375
|
+
{
|
3376
|
+
#line 297 "insns.def"
|
3377
|
+
/* */
|
3378
|
+
|
3379
|
+
#line 3380 "vm.inc"
|
3380
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
3381
|
+
PUSH(val);
|
3382
|
+
#undef val
|
3383
|
+
#undef CURRENT_INSN_putobject_OP_INT2FIX_O_0_C_
|
3384
|
+
#undef INSN_IS_SC
|
3385
|
+
#undef INSN_LABEL
|
3386
|
+
#undef LABEL_IS_SC
|
3387
|
+
END_INSN(putobject_OP_INT2FIX_O_0_C_);}}}
|
3388
|
+
INSN_ENTRY(putobject_OP_INT2FIX_O_1_C_){
|
3389
|
+
{
|
3390
|
+
#define val INT2FIX(1)
|
3391
|
+
|
3392
|
+
|
3393
|
+
DEBUG_ENTER_INSN("putobject_OP_INT2FIX_O_1_C_");
|
3394
|
+
ADD_PC(1+0);
|
3395
|
+
PREFETCH(GET_PC());
|
3396
|
+
#define CURRENT_INSN_putobject_OP_INT2FIX_O_1_C_ 1
|
3397
|
+
#define INSN_IS_SC() 0
|
3398
|
+
#define INSN_LABEL(lab) LABEL_putobject_OP_INT2FIX_O_1_C__##lab
|
3399
|
+
#define LABEL_IS_SC(lab) LABEL_##lab##_##t
|
3400
|
+
COLLECT_USAGE_INSN(BIN(putobject_OP_INT2FIX_O_1_C_));
|
3401
|
+
{
|
3402
|
+
#line 297 "insns.def"
|
3403
|
+
/* */
|
3404
|
+
|
3405
|
+
#line 3406 "vm.inc"
|
3406
|
+
CHECK_VM_STACK_OVERFLOW_FOR_INSN(REG_CFP, 1);
|
3407
|
+
PUSH(val);
|
3408
|
+
#undef val
|
3409
|
+
#undef CURRENT_INSN_putobject_OP_INT2FIX_O_1_C_
|
3410
|
+
#undef INSN_IS_SC
|
3411
|
+
#undef INSN_LABEL
|
3412
|
+
#undef LABEL_IS_SC
|
3413
|
+
END_INSN(putobject_OP_INT2FIX_O_1_C_);}}}
|
3414
|
+
|