debugger-ruby_core_source 1.3.3 → 1.3.4

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