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