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