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