debase-ruby_core_source 0.10.11 → 0.10.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/addr2line.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/builtin.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/ccan/build_assert/build_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/ccan/check_type/check_type.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/ccan/container_of/container_of.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/ccan/list/list.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/ccan/str/str.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/constant.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/debug_counter.h +38 -4
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/dln.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/encindex.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/eval_intern.h +16 -5
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/gc.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/hrtime.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/id.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/id_table.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/insns.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/insns_info.inc +93 -89
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/array.h +5 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/bignum.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/bits.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/class.h +7 -1
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/compar.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/compile.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/compilers.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/complex.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/cont.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/dir.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/enc.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/encoding.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/enum.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/enumerator.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/error.h +0 -7
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/eval.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/file.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/fixnum.h +1 -1
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/gc.h +9 -2
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/hash.h +2 -1
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/imemo.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/inits.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/io.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/load.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/loadpath.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/math.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/missing.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/numeric.h +4 -1
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/object.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/parse.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/proc.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/process.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/random.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/range.h +4 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/rational.h +2 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/re.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/sanitizers.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/scheduler.h +9 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/serial.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/signal.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/static_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/string.h +5 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/struct.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/symbol.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/thread.h +0 -6
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/time.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/transcode.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/util.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/variable.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/vm.h +7 -6
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/internal/warnings.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/iseq.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/known_errors.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/method.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/mjit.h +37 -14
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/mjit_compile.inc +715 -557
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/node.h +2 -2
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/node_name.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/opt_sc.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/optinsn.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/optunifs.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/parse.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/probes_helper.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1/ractor.h → ruby-3.0.0-p0/ractor_core.h} +97 -25
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/regenc.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/regint.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/regparse.h +0 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/revision.h +2 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/ruby_assert.h +0 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ruby_atomic.h +23 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/siphash.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/symbol.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/thread_pthread.h +23 -14
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/thread_win32.h +5 -10
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/timev.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/transcode_data.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/transient_heap.h +4 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/variable.h +2 -1
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/version.h +3 -3
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm.inc +94 -99
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_call_iseq_optimized.inc +48 -48
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_callinfo.h +2 -3
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_core.h +96 -25
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_debug.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_exec.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_insnhelper.h +1 -4
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_opts.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vm_sync.h +44 -5
- data/lib/debase/ruby_core_source/{ruby-3.0.0-preview1 → ruby-3.0.0-p0}/vmtc.inc +0 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +111 -113
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/mjit.h +0 -29
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ractor_pub.h +0 -50
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/revision.h +0 -2
- data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ruby_atomic.h +0 -236
@@ -37,7 +37,7 @@
|
|
37
37
|
*/
|
38
38
|
|
39
39
|
switch (insn) {
|
40
|
-
case BIN(nop):
|
40
|
+
case BIN(nop): {
|
41
41
|
fprintf(f, "{\n");
|
42
42
|
{
|
43
43
|
if (status->local_stack_p) {
|
@@ -45,7 +45,7 @@ switch (insn) {
|
|
45
45
|
}
|
46
46
|
|
47
47
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
48
|
-
if (
|
48
|
+
if (false) {
|
49
49
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
50
50
|
pc_moved_p = true;
|
51
51
|
}
|
@@ -61,7 +61,8 @@ switch (insn) {
|
|
61
61
|
}
|
62
62
|
fprintf(f, "}\n");
|
63
63
|
break;
|
64
|
-
|
64
|
+
}
|
65
|
+
case BIN(getlocal): {
|
65
66
|
fprintf(f, "{\n");
|
66
67
|
{
|
67
68
|
MAYBE_UNUSED(lindex_t idx) = (lindex_t)operands[0];
|
@@ -78,7 +79,7 @@ switch (insn) {
|
|
78
79
|
fprintf(f, " level = (rb_num_t)0x%"PRIxVALUE";", operands[1]);
|
79
80
|
fprintf(f, "\n");
|
80
81
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
81
|
-
if (
|
82
|
+
if (false) {
|
82
83
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
83
84
|
pc_moved_p = true;
|
84
85
|
}
|
@@ -97,7 +98,8 @@ switch (insn) {
|
|
97
98
|
}
|
98
99
|
fprintf(f, "}\n");
|
99
100
|
break;
|
100
|
-
|
101
|
+
}
|
102
|
+
case BIN(setlocal): {
|
101
103
|
fprintf(f, "{\n");
|
102
104
|
{
|
103
105
|
MAYBE_UNUSED(lindex_t idx) = (lindex_t)operands[0];
|
@@ -115,7 +117,7 @@ switch (insn) {
|
|
115
117
|
fprintf(f, "\n");
|
116
118
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
117
119
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
118
|
-
if (
|
120
|
+
if (false) {
|
119
121
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
120
122
|
pc_moved_p = true;
|
121
123
|
}
|
@@ -133,7 +135,8 @@ switch (insn) {
|
|
133
135
|
}
|
134
136
|
fprintf(f, "}\n");
|
135
137
|
break;
|
136
|
-
|
138
|
+
}
|
139
|
+
case BIN(getblockparam): {
|
137
140
|
fprintf(f, "{\n");
|
138
141
|
{
|
139
142
|
MAYBE_UNUSED(lindex_t idx) = (lindex_t)operands[0];
|
@@ -150,7 +153,7 @@ switch (insn) {
|
|
150
153
|
fprintf(f, " level = (rb_num_t)0x%"PRIxVALUE";", operands[1]);
|
151
154
|
fprintf(f, "\n");
|
152
155
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
153
|
-
if (
|
156
|
+
if (false) {
|
154
157
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
155
158
|
pc_moved_p = true;
|
156
159
|
}
|
@@ -179,7 +182,8 @@ switch (insn) {
|
|
179
182
|
}
|
180
183
|
fprintf(f, "}\n");
|
181
184
|
break;
|
182
|
-
|
185
|
+
}
|
186
|
+
case BIN(setblockparam): {
|
183
187
|
fprintf(f, "{\n");
|
184
188
|
{
|
185
189
|
MAYBE_UNUSED(lindex_t idx) = (lindex_t)operands[0];
|
@@ -197,7 +201,7 @@ switch (insn) {
|
|
197
201
|
fprintf(f, "\n");
|
198
202
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
199
203
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
200
|
-
if (
|
204
|
+
if (false) {
|
201
205
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
202
206
|
pc_moved_p = true;
|
203
207
|
}
|
@@ -220,7 +224,8 @@ switch (insn) {
|
|
220
224
|
}
|
221
225
|
fprintf(f, "}\n");
|
222
226
|
break;
|
223
|
-
|
227
|
+
}
|
228
|
+
case BIN(getblockparamproxy): {
|
224
229
|
fprintf(f, "{\n");
|
225
230
|
{
|
226
231
|
MAYBE_UNUSED(lindex_t idx) = (lindex_t)operands[0];
|
@@ -237,7 +242,7 @@ switch (insn) {
|
|
237
242
|
fprintf(f, " level = (rb_num_t)0x%"PRIxVALUE";", operands[1]);
|
238
243
|
fprintf(f, "\n");
|
239
244
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
240
|
-
if (
|
245
|
+
if (false) {
|
241
246
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
242
247
|
pc_moved_p = true;
|
243
248
|
}
|
@@ -287,7 +292,8 @@ switch (insn) {
|
|
287
292
|
}
|
288
293
|
fprintf(f, "}\n");
|
289
294
|
break;
|
290
|
-
|
295
|
+
}
|
296
|
+
case BIN(getspecial): {
|
291
297
|
fprintf(f, "{\n");
|
292
298
|
{
|
293
299
|
MAYBE_UNUSED(rb_num_t key) = (rb_num_t)operands[0];
|
@@ -303,7 +309,7 @@ switch (insn) {
|
|
303
309
|
fprintf(f, " type = (rb_num_t)0x%"PRIxVALUE";", operands[1]);
|
304
310
|
fprintf(f, "\n");
|
305
311
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
306
|
-
if (
|
312
|
+
if (true) {
|
307
313
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
308
314
|
pc_moved_p = true;
|
309
315
|
}
|
@@ -328,7 +334,8 @@ switch (insn) {
|
|
328
334
|
}
|
329
335
|
fprintf(f, "}\n");
|
330
336
|
break;
|
331
|
-
|
337
|
+
}
|
338
|
+
case BIN(setspecial): {
|
332
339
|
fprintf(f, "{\n");
|
333
340
|
{
|
334
341
|
MAYBE_UNUSED(rb_num_t key) = (rb_num_t)operands[0];
|
@@ -342,7 +349,7 @@ switch (insn) {
|
|
342
349
|
fprintf(f, "\n");
|
343
350
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
344
351
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
345
|
-
if (
|
352
|
+
if (false) {
|
346
353
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
347
354
|
pc_moved_p = true;
|
348
355
|
}
|
@@ -358,29 +365,30 @@ switch (insn) {
|
|
358
365
|
}
|
359
366
|
fprintf(f, "}\n");
|
360
367
|
break;
|
361
|
-
|
368
|
+
}
|
369
|
+
case BIN(getinstancevariable): {
|
362
370
|
#if OPT_IC_FOR_IVAR
|
363
371
|
{
|
364
372
|
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
365
373
|
MAYBE_UNUSED(IVC ic) = (IVC)operands[1];
|
366
374
|
IVC ic_copy = &(status->is_entries + ((union iseq_inline_storage_entry *)ic - body->is_entries))->iv_cache;
|
367
|
-
if (!status->compile_info->disable_ivar_cache && ic_copy->
|
375
|
+
if (!status->compile_info->disable_ivar_cache && ic_copy->entry) { // Only ic_copy is enabled.
|
368
376
|
fprintf(f, "{\n");
|
369
377
|
fprintf(f, " VALUE obj = GET_SELF();\n");
|
370
|
-
fprintf(f, " const
|
378
|
+
fprintf(f, " const uint32_t index = %u;\n", (ic_copy->entry->index));
|
371
379
|
if (status->merge_ivar_guards_p) {
|
372
380
|
fprintf(f, " VM_ASSERT(RB_TYPE_P(obj, T_OBJECT));\n");
|
373
|
-
fprintf(f, " VM_ASSERT((rb_serial_t)%"PRI_SERIALT_PREFIX"u == RCLASS_SERIAL(RBASIC(obj)->klass));\n", ic_copy->
|
381
|
+
fprintf(f, " VM_ASSERT((rb_serial_t)%"PRI_SERIALT_PREFIX"u == RCLASS_SERIAL(RBASIC(obj)->klass));\n", ic_copy->entry->class_serial);
|
374
382
|
fprintf(f, " VM_ASSERT(index < ROBJECT_NUMIV(obj));\n");
|
375
383
|
fprintf(f, " VALUE val;\n");
|
376
|
-
fprintf(f, " if (LIKELY(%
|
377
|
-
status->max_ivar_index >= ROBJECT_EMBED_LEN_MAX ? "
|
384
|
+
fprintf(f, " if (LIKELY(%s && (val = ROBJECT(obj)->as.%s) != Qundef)) {\n",
|
385
|
+
status->max_ivar_index >= ROBJECT_EMBED_LEN_MAX ? "true" : "RB_FL_ANY_RAW(obj, ROBJECT_EMBED)",
|
378
386
|
status->max_ivar_index >= ROBJECT_EMBED_LEN_MAX ? "heap.ivptr[index]" : "ary[index]");
|
379
387
|
fprintf(f, " stack[%d] = val;\n", b->stack_size);
|
380
388
|
fprintf(f, " }\n");
|
381
389
|
}
|
382
390
|
else {
|
383
|
-
fprintf(f, " const rb_serial_t ic_serial = (rb_serial_t)%"PRI_SERIALT_PREFIX"u;\n", ic_copy->
|
391
|
+
fprintf(f, " const rb_serial_t ic_serial = (rb_serial_t)%"PRI_SERIALT_PREFIX"u;\n", ic_copy->entry->class_serial);
|
384
392
|
fprintf(f, " VALUE val;\n");
|
385
393
|
fprintf(f, " if (LIKELY(RB_TYPE_P(obj, T_OBJECT) && ic_serial == RCLASS_SERIAL(RBASIC(obj)->klass) && index < ROBJECT_NUMIV(obj) && (val = ROBJECT_IVPTR(obj)[index]) != Qundef)) {\n");
|
386
394
|
fprintf(f, " stack[%d] = val;\n", b->stack_size);
|
@@ -396,14 +404,14 @@ switch (insn) {
|
|
396
404
|
fprintf(f, "}\n");
|
397
405
|
break;
|
398
406
|
}
|
399
|
-
else if (!status->compile_info->disable_exivar_cache && ic_copy->
|
407
|
+
else if (!status->compile_info->disable_exivar_cache && ic_copy->entry) {
|
400
408
|
fprintf(f, "{\n");
|
401
409
|
fprintf(f, " VALUE obj = GET_SELF();\n");
|
402
|
-
fprintf(f, " const rb_serial_t ic_serial = (rb_serial_t)%"PRI_SERIALT_PREFIX"u;\n", ic_copy->
|
403
|
-
fprintf(f, " const
|
410
|
+
fprintf(f, " const rb_serial_t ic_serial = (rb_serial_t)%"PRI_SERIALT_PREFIX"u;\n", ic_copy->entry->class_serial);
|
411
|
+
fprintf(f, " const uint32_t index = %u;\n", ic_copy->entry->index);
|
404
412
|
fprintf(f, " struct gen_ivtbl *ivtbl;\n");
|
405
413
|
fprintf(f, " VALUE val;\n");
|
406
|
-
fprintf(f, " if (LIKELY(FL_TEST_RAW(obj, FL_EXIVAR) && ic_serial == RCLASS_SERIAL(RBASIC(obj)->klass) &&
|
414
|
+
fprintf(f, " if (LIKELY(FL_TEST_RAW(obj, FL_EXIVAR) && ic_serial == RCLASS_SERIAL(RBASIC(obj)->klass) && rb_ivar_generic_ivtbl_lookup(obj, &ivtbl) && index < ivtbl->numiv && (val = ivtbl->ivptr[index]) != Qundef)) {\n");
|
407
415
|
fprintf(f, " stack[%d] = val;\n", b->stack_size);
|
408
416
|
fprintf(f, " }\n");
|
409
417
|
fprintf(f, " else {\n");
|
@@ -435,7 +443,7 @@ switch (insn) {
|
|
435
443
|
fprintf(f, " ic = (IVC)0x%"PRIxVALUE";", operands[1]);
|
436
444
|
fprintf(f, "\n");
|
437
445
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
438
|
-
if (
|
446
|
+
if (true) {
|
439
447
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
440
448
|
pc_moved_p = true;
|
441
449
|
}
|
@@ -445,7 +453,7 @@ switch (insn) {
|
|
445
453
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
446
454
|
}
|
447
455
|
fprintf(f, " {\n");
|
448
|
-
fprintf(f, " val = vm_getinstancevariable(GET_SELF(), id, ic);\n");
|
456
|
+
fprintf(f, " val = vm_getinstancevariable(GET_ISEQ(), GET_SELF(), id, ic);\n");
|
449
457
|
fprintf(f, " }\n");
|
450
458
|
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_getinstancevariable(id, ic) - 1);
|
451
459
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
@@ -460,28 +468,29 @@ switch (insn) {
|
|
460
468
|
}
|
461
469
|
fprintf(f, "}\n");
|
462
470
|
break;
|
463
|
-
|
471
|
+
}
|
472
|
+
case BIN(setinstancevariable): {
|
464
473
|
#if OPT_IC_FOR_IVAR
|
465
474
|
{
|
466
475
|
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
467
476
|
MAYBE_UNUSED(IVC ic) = (IVC)operands[1];
|
468
477
|
IVC ic_copy = &(status->is_entries + ((union iseq_inline_storage_entry *)ic - body->is_entries))->iv_cache;
|
469
|
-
if (!status->compile_info->disable_ivar_cache && ic_copy->
|
478
|
+
if (!status->compile_info->disable_ivar_cache && ic_copy->entry) { // Only ic_copy is enabled.
|
470
479
|
fprintf(f, "{\n");
|
471
480
|
fprintf(f, " VALUE obj = GET_SELF();\n");
|
472
|
-
fprintf(f, " const
|
481
|
+
fprintf(f, " const uint32_t index = %u;\n", (ic_copy->entry->index));
|
473
482
|
if (status->merge_ivar_guards_p) {
|
474
483
|
fprintf(f, " VM_ASSERT(RB_TYPE_P(obj, T_OBJECT));\n");
|
475
|
-
fprintf(f, " VM_ASSERT((rb_serial_t)%"PRI_SERIALT_PREFIX"u == RCLASS_SERIAL(RBASIC(obj)->klass));\n", ic_copy->
|
484
|
+
fprintf(f, " VM_ASSERT((rb_serial_t)%"PRI_SERIALT_PREFIX"u == RCLASS_SERIAL(RBASIC(obj)->klass));\n", ic_copy->entry->class_serial);
|
476
485
|
fprintf(f, " VM_ASSERT(index < ROBJECT_NUMIV(obj));\n");
|
477
|
-
fprintf(f, " if (LIKELY(!
|
486
|
+
fprintf(f, " if (LIKELY(!RB_OBJ_FROZEN_RAW(obj) && %s)) {\n", status->max_ivar_index >= ROBJECT_EMBED_LEN_MAX ? "true" : "RB_FL_ANY_RAW(obj, ROBJECT_EMBED)");
|
478
487
|
fprintf(f, " RB_OBJ_WRITE(obj, &ROBJECT(obj)->as.%s, stack[%d]);\n",
|
479
488
|
status->max_ivar_index >= ROBJECT_EMBED_LEN_MAX ? "heap.ivptr[index]" : "ary[index]", b->stack_size - 1);
|
480
489
|
fprintf(f, " }\n");
|
481
490
|
}
|
482
491
|
else {
|
483
|
-
fprintf(f, " const rb_serial_t ic_serial = (rb_serial_t)%"PRI_SERIALT_PREFIX"u;\n", ic_copy->
|
484
|
-
fprintf(f, " if (LIKELY(RB_TYPE_P(obj, T_OBJECT) && ic_serial == RCLASS_SERIAL(RBASIC(obj)->klass) && index < ROBJECT_NUMIV(obj) && !
|
492
|
+
fprintf(f, " const rb_serial_t ic_serial = (rb_serial_t)%"PRI_SERIALT_PREFIX"u;\n", ic_copy->entry->class_serial);
|
493
|
+
fprintf(f, " if (LIKELY(RB_TYPE_P(obj, T_OBJECT) && ic_serial == RCLASS_SERIAL(RBASIC(obj)->klass) && index < ROBJECT_NUMIV(obj) && !RB_OBJ_FROZEN_RAW(obj))) {\n");
|
485
494
|
fprintf(f, " VALUE *ptr = ROBJECT_IVPTR(obj);\n");
|
486
495
|
fprintf(f, " RB_OBJ_WRITE(obj, &ptr[index], stack[%d]);\n", b->stack_size - 1);
|
487
496
|
fprintf(f, " }\n");
|
@@ -516,7 +525,7 @@ switch (insn) {
|
|
516
525
|
fprintf(f, "\n");
|
517
526
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
518
527
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
519
|
-
if (
|
528
|
+
if (true) {
|
520
529
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
521
530
|
pc_moved_p = true;
|
522
531
|
}
|
@@ -526,7 +535,7 @@ switch (insn) {
|
|
526
535
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
527
536
|
}
|
528
537
|
fprintf(f, " {\n");
|
529
|
-
fprintf(f, " vm_setinstancevariable(GET_SELF(), id, val, ic);\n");
|
538
|
+
fprintf(f, " vm_setinstancevariable(GET_ISEQ(), GET_SELF(), id, val, ic);\n");
|
530
539
|
fprintf(f, " }\n");
|
531
540
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
532
541
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_setinstancevariable(id, ic));
|
@@ -540,7 +549,8 @@ switch (insn) {
|
|
540
549
|
}
|
541
550
|
fprintf(f, "}\n");
|
542
551
|
break;
|
543
|
-
|
552
|
+
}
|
553
|
+
case BIN(getclassvariable): {
|
544
554
|
fprintf(f, "{\n");
|
545
555
|
{
|
546
556
|
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
@@ -554,7 +564,7 @@ switch (insn) {
|
|
554
564
|
comment_id(f, (ID)operands[0]);
|
555
565
|
fprintf(f, "\n");
|
556
566
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
557
|
-
if (
|
567
|
+
if (true) {
|
558
568
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
559
569
|
pc_moved_p = true;
|
560
570
|
}
|
@@ -579,7 +589,8 @@ switch (insn) {
|
|
579
589
|
}
|
580
590
|
fprintf(f, "}\n");
|
581
591
|
break;
|
582
|
-
|
592
|
+
}
|
593
|
+
case BIN(setclassvariable): {
|
583
594
|
fprintf(f, "{\n");
|
584
595
|
{
|
585
596
|
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
@@ -594,7 +605,7 @@ switch (insn) {
|
|
594
605
|
fprintf(f, "\n");
|
595
606
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
596
607
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
597
|
-
if (
|
608
|
+
if (true) {
|
598
609
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
599
610
|
pc_moved_p = true;
|
600
611
|
}
|
@@ -619,7 +630,8 @@ switch (insn) {
|
|
619
630
|
}
|
620
631
|
fprintf(f, "}\n");
|
621
632
|
break;
|
622
|
-
|
633
|
+
}
|
634
|
+
case BIN(getconstant): {
|
623
635
|
fprintf(f, "{\n");
|
624
636
|
{
|
625
637
|
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
@@ -635,7 +647,7 @@ switch (insn) {
|
|
635
647
|
fprintf(f, " klass = stack[%d];\n", b->stack_size - 2);
|
636
648
|
fprintf(f, " allow_nil = stack[%d];\n", b->stack_size - 1);
|
637
649
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
638
|
-
if (
|
650
|
+
if (true) {
|
639
651
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
640
652
|
pc_moved_p = true;
|
641
653
|
}
|
@@ -660,7 +672,8 @@ switch (insn) {
|
|
660
672
|
}
|
661
673
|
fprintf(f, "}\n");
|
662
674
|
break;
|
663
|
-
|
675
|
+
}
|
676
|
+
case BIN(setconstant): {
|
664
677
|
fprintf(f, "{\n");
|
665
678
|
{
|
666
679
|
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
@@ -676,7 +689,7 @@ switch (insn) {
|
|
676
689
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 2);
|
677
690
|
fprintf(f, " cbase = stack[%d];\n", b->stack_size - 1);
|
678
691
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
679
|
-
if (
|
692
|
+
if (true) {
|
680
693
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
681
694
|
pc_moved_p = true;
|
682
695
|
}
|
@@ -702,7 +715,8 @@ switch (insn) {
|
|
702
715
|
}
|
703
716
|
fprintf(f, "}\n");
|
704
717
|
break;
|
705
|
-
|
718
|
+
}
|
719
|
+
case BIN(getglobal): {
|
706
720
|
fprintf(f, "{\n");
|
707
721
|
{
|
708
722
|
MAYBE_UNUSED(ID gid) = (ID)operands[0];
|
@@ -716,7 +730,7 @@ switch (insn) {
|
|
716
730
|
comment_id(f, (ID)operands[0]);
|
717
731
|
fprintf(f, "\n");
|
718
732
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
719
|
-
if (
|
733
|
+
if (true) {
|
720
734
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
721
735
|
pc_moved_p = true;
|
722
736
|
}
|
@@ -741,7 +755,8 @@ switch (insn) {
|
|
741
755
|
}
|
742
756
|
fprintf(f, "}\n");
|
743
757
|
break;
|
744
|
-
|
758
|
+
}
|
759
|
+
case BIN(setglobal): {
|
745
760
|
fprintf(f, "{\n");
|
746
761
|
{
|
747
762
|
MAYBE_UNUSED(ID gid) = (ID)operands[0];
|
@@ -756,7 +771,7 @@ switch (insn) {
|
|
756
771
|
fprintf(f, "\n");
|
757
772
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
758
773
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
759
|
-
if (
|
774
|
+
if (true) {
|
760
775
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
761
776
|
pc_moved_p = true;
|
762
777
|
}
|
@@ -780,7 +795,8 @@ switch (insn) {
|
|
780
795
|
}
|
781
796
|
fprintf(f, "}\n");
|
782
797
|
break;
|
783
|
-
|
798
|
+
}
|
799
|
+
case BIN(putnil): {
|
784
800
|
fprintf(f, "{\n");
|
785
801
|
{
|
786
802
|
if (status->local_stack_p) {
|
@@ -789,7 +805,7 @@ switch (insn) {
|
|
789
805
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
790
806
|
|
791
807
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
792
|
-
if (
|
808
|
+
if (false) {
|
793
809
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
794
810
|
pc_moved_p = true;
|
795
811
|
}
|
@@ -806,7 +822,8 @@ switch (insn) {
|
|
806
822
|
}
|
807
823
|
fprintf(f, "}\n");
|
808
824
|
break;
|
809
|
-
|
825
|
+
}
|
826
|
+
case BIN(putself): {
|
810
827
|
fprintf(f, "{\n");
|
811
828
|
{
|
812
829
|
if (status->local_stack_p) {
|
@@ -815,7 +832,7 @@ switch (insn) {
|
|
815
832
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
816
833
|
|
817
834
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
818
|
-
if (
|
835
|
+
if (false) {
|
819
836
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
820
837
|
pc_moved_p = true;
|
821
838
|
}
|
@@ -832,7 +849,8 @@ switch (insn) {
|
|
832
849
|
}
|
833
850
|
fprintf(f, "}\n");
|
834
851
|
break;
|
835
|
-
|
852
|
+
}
|
853
|
+
case BIN(putobject): {
|
836
854
|
fprintf(f, "{\n");
|
837
855
|
{
|
838
856
|
MAYBE_UNUSED(VALUE val) = (VALUE)operands[0];
|
@@ -845,7 +863,7 @@ switch (insn) {
|
|
845
863
|
if (SYMBOL_P((VALUE)operands[0])) comment_id(f, SYM2ID((VALUE)operands[0]));
|
846
864
|
fprintf(f, "\n");
|
847
865
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
848
|
-
if (
|
866
|
+
if (false) {
|
849
867
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
850
868
|
pc_moved_p = true;
|
851
869
|
}
|
@@ -862,7 +880,8 @@ switch (insn) {
|
|
862
880
|
}
|
863
881
|
fprintf(f, "}\n");
|
864
882
|
break;
|
865
|
-
|
883
|
+
}
|
884
|
+
case BIN(putspecialobject): {
|
866
885
|
fprintf(f, "{\n");
|
867
886
|
{
|
868
887
|
MAYBE_UNUSED(rb_num_t value_type) = (rb_num_t)operands[0];
|
@@ -875,7 +894,7 @@ switch (insn) {
|
|
875
894
|
fprintf(f, " value_type = (rb_num_t)0x%"PRIxVALUE";", operands[0]);
|
876
895
|
fprintf(f, "\n");
|
877
896
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
878
|
-
if (
|
897
|
+
if (false) {
|
879
898
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
880
899
|
pc_moved_p = true;
|
881
900
|
}
|
@@ -895,7 +914,8 @@ switch (insn) {
|
|
895
914
|
}
|
896
915
|
fprintf(f, "}\n");
|
897
916
|
break;
|
898
|
-
|
917
|
+
}
|
918
|
+
case BIN(putstring): {
|
899
919
|
fprintf(f, "{\n");
|
900
920
|
{
|
901
921
|
MAYBE_UNUSED(VALUE str) = (VALUE)operands[0];
|
@@ -908,7 +928,7 @@ switch (insn) {
|
|
908
928
|
if (SYMBOL_P((VALUE)operands[0])) comment_id(f, SYM2ID((VALUE)operands[0]));
|
909
929
|
fprintf(f, "\n");
|
910
930
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
911
|
-
if (
|
931
|
+
if (false) {
|
912
932
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
913
933
|
pc_moved_p = true;
|
914
934
|
}
|
@@ -918,14 +938,15 @@ switch (insn) {
|
|
918
938
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
919
939
|
}
|
920
940
|
fprintf(f, " {\n");
|
921
|
-
fprintf(f, " val =
|
941
|
+
fprintf(f, " val = rb_ec_str_resurrect(ec, str);\n");
|
922
942
|
fprintf(f, " }\n");
|
923
943
|
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_putstring(str) - 1);
|
924
944
|
b->stack_size += attr_sp_inc_putstring(str);
|
925
945
|
}
|
926
946
|
fprintf(f, "}\n");
|
927
947
|
break;
|
928
|
-
|
948
|
+
}
|
949
|
+
case BIN(concatstrings): {
|
929
950
|
fprintf(f, "{\n");
|
930
951
|
{
|
931
952
|
MAYBE_UNUSED(rb_num_t num) = (rb_num_t)operands[0];
|
@@ -938,7 +959,7 @@ switch (insn) {
|
|
938
959
|
fprintf(f, " num = (rb_num_t)0x%"PRIxVALUE";", operands[0]);
|
939
960
|
fprintf(f, "\n");
|
940
961
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
941
|
-
if (
|
962
|
+
if (true) {
|
942
963
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
943
964
|
pc_moved_p = true;
|
944
965
|
}
|
@@ -964,7 +985,8 @@ switch (insn) {
|
|
964
985
|
}
|
965
986
|
fprintf(f, "}\n");
|
966
987
|
break;
|
967
|
-
|
988
|
+
}
|
989
|
+
case BIN(tostring): {
|
968
990
|
fprintf(f, "{\n");
|
969
991
|
{
|
970
992
|
if (status->local_stack_p) {
|
@@ -975,7 +997,7 @@ switch (insn) {
|
|
975
997
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 2);
|
976
998
|
fprintf(f, " str = stack[%d];\n", b->stack_size - 1);
|
977
999
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
978
|
-
if (
|
1000
|
+
if (false) {
|
979
1001
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
980
1002
|
pc_moved_p = true;
|
981
1003
|
}
|
@@ -992,7 +1014,8 @@ switch (insn) {
|
|
992
1014
|
}
|
993
1015
|
fprintf(f, "}\n");
|
994
1016
|
break;
|
995
|
-
|
1017
|
+
}
|
1018
|
+
case BIN(toregexp): {
|
996
1019
|
fprintf(f, "{\n");
|
997
1020
|
{
|
998
1021
|
MAYBE_UNUSED(rb_num_t opt) = (rb_num_t)operands[0];
|
@@ -1008,7 +1031,7 @@ switch (insn) {
|
|
1008
1031
|
fprintf(f, " cnt = (rb_num_t)0x%"PRIxVALUE";", operands[1]);
|
1009
1032
|
fprintf(f, "\n");
|
1010
1033
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1011
|
-
if (
|
1034
|
+
if (true) {
|
1012
1035
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1013
1036
|
pc_moved_p = true;
|
1014
1037
|
}
|
@@ -1036,7 +1059,8 @@ switch (insn) {
|
|
1036
1059
|
}
|
1037
1060
|
fprintf(f, "}\n");
|
1038
1061
|
break;
|
1039
|
-
|
1062
|
+
}
|
1063
|
+
case BIN(intern): {
|
1040
1064
|
fprintf(f, "{\n");
|
1041
1065
|
{
|
1042
1066
|
if (status->local_stack_p) {
|
@@ -1046,7 +1070,7 @@ switch (insn) {
|
|
1046
1070
|
|
1047
1071
|
fprintf(f, " str = stack[%d];\n", b->stack_size - 1);
|
1048
1072
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1049
|
-
if (
|
1073
|
+
if (false) {
|
1050
1074
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1051
1075
|
pc_moved_p = true;
|
1052
1076
|
}
|
@@ -1063,7 +1087,8 @@ switch (insn) {
|
|
1063
1087
|
}
|
1064
1088
|
fprintf(f, "}\n");
|
1065
1089
|
break;
|
1066
|
-
|
1090
|
+
}
|
1091
|
+
case BIN(newarray): {
|
1067
1092
|
fprintf(f, "{\n");
|
1068
1093
|
{
|
1069
1094
|
MAYBE_UNUSED(rb_num_t num) = (rb_num_t)operands[0];
|
@@ -1076,7 +1101,7 @@ switch (insn) {
|
|
1076
1101
|
fprintf(f, " num = (rb_num_t)0x%"PRIxVALUE";", operands[0]);
|
1077
1102
|
fprintf(f, "\n");
|
1078
1103
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1079
|
-
if (
|
1104
|
+
if (false) {
|
1080
1105
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1081
1106
|
pc_moved_p = true;
|
1082
1107
|
}
|
@@ -1086,7 +1111,7 @@ switch (insn) {
|
|
1086
1111
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
1087
1112
|
}
|
1088
1113
|
fprintf(f, " {\n");
|
1089
|
-
fprintf(f, " val =
|
1114
|
+
fprintf(f, " val = rb_ec_ary_new_from_values(ec, num, %s);\n",
|
1090
1115
|
(status->local_stack_p ? "(stack + (stack_size - (num)))" : "STACK_ADDR_FROM_TOP(num)"));
|
1091
1116
|
fprintf(f, " }\n");
|
1092
1117
|
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_newarray(num) - 1);
|
@@ -1094,7 +1119,8 @@ switch (insn) {
|
|
1094
1119
|
}
|
1095
1120
|
fprintf(f, "}\n");
|
1096
1121
|
break;
|
1097
|
-
|
1122
|
+
}
|
1123
|
+
case BIN(newarraykwsplat): {
|
1098
1124
|
fprintf(f, "{\n");
|
1099
1125
|
{
|
1100
1126
|
MAYBE_UNUSED(rb_num_t num) = (rb_num_t)operands[0];
|
@@ -1107,7 +1133,7 @@ switch (insn) {
|
|
1107
1133
|
fprintf(f, " num = (rb_num_t)0x%"PRIxVALUE";", operands[0]);
|
1108
1134
|
fprintf(f, "\n");
|
1109
1135
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1110
|
-
if (
|
1136
|
+
if (false) {
|
1111
1137
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1112
1138
|
pc_moved_p = true;
|
1113
1139
|
}
|
@@ -1132,7 +1158,8 @@ switch (insn) {
|
|
1132
1158
|
}
|
1133
1159
|
fprintf(f, "}\n");
|
1134
1160
|
break;
|
1135
|
-
|
1161
|
+
}
|
1162
|
+
case BIN(duparray): {
|
1136
1163
|
fprintf(f, "{\n");
|
1137
1164
|
{
|
1138
1165
|
MAYBE_UNUSED(VALUE ary) = (VALUE)operands[0];
|
@@ -1145,7 +1172,7 @@ switch (insn) {
|
|
1145
1172
|
if (SYMBOL_P((VALUE)operands[0])) comment_id(f, SYM2ID((VALUE)operands[0]));
|
1146
1173
|
fprintf(f, "\n");
|
1147
1174
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1148
|
-
if (
|
1175
|
+
if (false) {
|
1149
1176
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1150
1177
|
pc_moved_p = true;
|
1151
1178
|
}
|
@@ -1163,7 +1190,8 @@ switch (insn) {
|
|
1163
1190
|
}
|
1164
1191
|
fprintf(f, "}\n");
|
1165
1192
|
break;
|
1166
|
-
|
1193
|
+
}
|
1194
|
+
case BIN(duphash): {
|
1167
1195
|
fprintf(f, "{\n");
|
1168
1196
|
{
|
1169
1197
|
MAYBE_UNUSED(VALUE hash) = (VALUE)operands[0];
|
@@ -1176,7 +1204,7 @@ switch (insn) {
|
|
1176
1204
|
if (SYMBOL_P((VALUE)operands[0])) comment_id(f, SYM2ID((VALUE)operands[0]));
|
1177
1205
|
fprintf(f, "\n");
|
1178
1206
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1179
|
-
if (
|
1207
|
+
if (false) {
|
1180
1208
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1181
1209
|
pc_moved_p = true;
|
1182
1210
|
}
|
@@ -1194,7 +1222,8 @@ switch (insn) {
|
|
1194
1222
|
}
|
1195
1223
|
fprintf(f, "}\n");
|
1196
1224
|
break;
|
1197
|
-
|
1225
|
+
}
|
1226
|
+
case BIN(expandarray): {
|
1198
1227
|
fprintf(f, "{\n");
|
1199
1228
|
{
|
1200
1229
|
MAYBE_UNUSED(rb_num_t num) = (rb_num_t)operands[0];
|
@@ -1211,7 +1240,7 @@ switch (insn) {
|
|
1211
1240
|
fprintf(f, "\n");
|
1212
1241
|
fprintf(f, " ary = stack[%d];\n", b->stack_size - 1);
|
1213
1242
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1214
|
-
if (
|
1243
|
+
if (true) {
|
1215
1244
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1216
1245
|
pc_moved_p = true;
|
1217
1246
|
}
|
@@ -1235,7 +1264,8 @@ switch (insn) {
|
|
1235
1264
|
}
|
1236
1265
|
fprintf(f, "}\n");
|
1237
1266
|
break;
|
1238
|
-
|
1267
|
+
}
|
1268
|
+
case BIN(concatarray): {
|
1239
1269
|
fprintf(f, "{\n");
|
1240
1270
|
{
|
1241
1271
|
if (status->local_stack_p) {
|
@@ -1246,7 +1276,7 @@ switch (insn) {
|
|
1246
1276
|
fprintf(f, " ary1 = stack[%d];\n", b->stack_size - 2);
|
1247
1277
|
fprintf(f, " ary2 = stack[%d];\n", b->stack_size - 1);
|
1248
1278
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1249
|
-
if (
|
1279
|
+
if (true) {
|
1250
1280
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1251
1281
|
pc_moved_p = true;
|
1252
1282
|
}
|
@@ -1271,7 +1301,8 @@ switch (insn) {
|
|
1271
1301
|
}
|
1272
1302
|
fprintf(f, "}\n");
|
1273
1303
|
break;
|
1274
|
-
|
1304
|
+
}
|
1305
|
+
case BIN(splatarray): {
|
1275
1306
|
fprintf(f, "{\n");
|
1276
1307
|
{
|
1277
1308
|
MAYBE_UNUSED(VALUE flag) = (VALUE)operands[0];
|
@@ -1285,7 +1316,7 @@ switch (insn) {
|
|
1285
1316
|
fprintf(f, "\n");
|
1286
1317
|
fprintf(f, " ary = stack[%d];\n", b->stack_size - 1);
|
1287
1318
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1288
|
-
if (
|
1319
|
+
if (true) {
|
1289
1320
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1290
1321
|
pc_moved_p = true;
|
1291
1322
|
}
|
@@ -1310,7 +1341,8 @@ switch (insn) {
|
|
1310
1341
|
}
|
1311
1342
|
fprintf(f, "}\n");
|
1312
1343
|
break;
|
1313
|
-
|
1344
|
+
}
|
1345
|
+
case BIN(newhash): {
|
1314
1346
|
fprintf(f, "{\n");
|
1315
1347
|
{
|
1316
1348
|
MAYBE_UNUSED(rb_num_t num) = (rb_num_t)operands[0];
|
@@ -1323,7 +1355,7 @@ switch (insn) {
|
|
1323
1355
|
fprintf(f, " num = (rb_num_t)0x%"PRIxVALUE";", operands[0]);
|
1324
1356
|
fprintf(f, "\n");
|
1325
1357
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1326
|
-
if (
|
1358
|
+
if (true) {
|
1327
1359
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1328
1360
|
pc_moved_p = true;
|
1329
1361
|
}
|
@@ -1355,7 +1387,8 @@ switch (insn) {
|
|
1355
1387
|
}
|
1356
1388
|
fprintf(f, "}\n");
|
1357
1389
|
break;
|
1358
|
-
|
1390
|
+
}
|
1391
|
+
case BIN(newrange): {
|
1359
1392
|
fprintf(f, "{\n");
|
1360
1393
|
{
|
1361
1394
|
MAYBE_UNUSED(rb_num_t flag) = (rb_num_t)operands[0];
|
@@ -1370,7 +1403,7 @@ switch (insn) {
|
|
1370
1403
|
fprintf(f, " low = stack[%d];\n", b->stack_size - 2);
|
1371
1404
|
fprintf(f, " high = stack[%d];\n", b->stack_size - 1);
|
1372
1405
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1373
|
-
if (
|
1406
|
+
if (true) {
|
1374
1407
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1375
1408
|
pc_moved_p = true;
|
1376
1409
|
}
|
@@ -1395,7 +1428,8 @@ switch (insn) {
|
|
1395
1428
|
}
|
1396
1429
|
fprintf(f, "}\n");
|
1397
1430
|
break;
|
1398
|
-
|
1431
|
+
}
|
1432
|
+
case BIN(pop): {
|
1399
1433
|
fprintf(f, "{\n");
|
1400
1434
|
{
|
1401
1435
|
if (status->local_stack_p) {
|
@@ -1405,7 +1439,7 @@ switch (insn) {
|
|
1405
1439
|
|
1406
1440
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
1407
1441
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1408
|
-
if (
|
1442
|
+
if (false) {
|
1409
1443
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1410
1444
|
pc_moved_p = true;
|
1411
1445
|
}
|
@@ -1422,7 +1456,8 @@ switch (insn) {
|
|
1422
1456
|
}
|
1423
1457
|
fprintf(f, "}\n");
|
1424
1458
|
break;
|
1425
|
-
|
1459
|
+
}
|
1460
|
+
case BIN(dup): {
|
1426
1461
|
fprintf(f, "{\n");
|
1427
1462
|
{
|
1428
1463
|
if (status->local_stack_p) {
|
@@ -1432,7 +1467,7 @@ switch (insn) {
|
|
1432
1467
|
|
1433
1468
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
1434
1469
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1435
|
-
if (
|
1470
|
+
if (false) {
|
1436
1471
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1437
1472
|
pc_moved_p = true;
|
1438
1473
|
}
|
@@ -1450,7 +1485,8 @@ switch (insn) {
|
|
1450
1485
|
}
|
1451
1486
|
fprintf(f, "}\n");
|
1452
1487
|
break;
|
1453
|
-
|
1488
|
+
}
|
1489
|
+
case BIN(dupn): {
|
1454
1490
|
fprintf(f, "{\n");
|
1455
1491
|
{
|
1456
1492
|
MAYBE_UNUSED(rb_num_t n) = (rb_num_t)operands[0];
|
@@ -1462,7 +1498,7 @@ switch (insn) {
|
|
1462
1498
|
fprintf(f, " n = (rb_num_t)0x%"PRIxVALUE";", operands[0]);
|
1463
1499
|
fprintf(f, "\n");
|
1464
1500
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1465
|
-
if (
|
1501
|
+
if (false) {
|
1466
1502
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1467
1503
|
pc_moved_p = true;
|
1468
1504
|
}
|
@@ -1482,7 +1518,8 @@ switch (insn) {
|
|
1482
1518
|
}
|
1483
1519
|
fprintf(f, "}\n");
|
1484
1520
|
break;
|
1485
|
-
|
1521
|
+
}
|
1522
|
+
case BIN(swap): {
|
1486
1523
|
fprintf(f, "{\n");
|
1487
1524
|
{
|
1488
1525
|
if (status->local_stack_p) {
|
@@ -1493,7 +1530,7 @@ switch (insn) {
|
|
1493
1530
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 2);
|
1494
1531
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
1495
1532
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1496
|
-
if (
|
1533
|
+
if (false) {
|
1497
1534
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1498
1535
|
pc_moved_p = true;
|
1499
1536
|
}
|
@@ -1511,7 +1548,8 @@ switch (insn) {
|
|
1511
1548
|
}
|
1512
1549
|
fprintf(f, "}\n");
|
1513
1550
|
break;
|
1514
|
-
|
1551
|
+
}
|
1552
|
+
case BIN(reverse): {
|
1515
1553
|
fprintf(f, "{\n");
|
1516
1554
|
{
|
1517
1555
|
MAYBE_UNUSED(rb_num_t n) = (rb_num_t)operands[0];
|
@@ -1523,7 +1561,7 @@ switch (insn) {
|
|
1523
1561
|
fprintf(f, " n = (rb_num_t)0x%"PRIxVALUE";", operands[0]);
|
1524
1562
|
fprintf(f, "\n");
|
1525
1563
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1526
|
-
if (
|
1564
|
+
if (false) {
|
1527
1565
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1528
1566
|
pc_moved_p = true;
|
1529
1567
|
}
|
@@ -1550,7 +1588,8 @@ switch (insn) {
|
|
1550
1588
|
}
|
1551
1589
|
fprintf(f, "}\n");
|
1552
1590
|
break;
|
1553
|
-
|
1591
|
+
}
|
1592
|
+
case BIN(topn): {
|
1554
1593
|
fprintf(f, "{\n");
|
1555
1594
|
{
|
1556
1595
|
MAYBE_UNUSED(rb_num_t n) = (rb_num_t)operands[0];
|
@@ -1563,7 +1602,7 @@ switch (insn) {
|
|
1563
1602
|
fprintf(f, " n = (rb_num_t)0x%"PRIxVALUE";", operands[0]);
|
1564
1603
|
fprintf(f, "\n");
|
1565
1604
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1566
|
-
if (
|
1605
|
+
if (false) {
|
1567
1606
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1568
1607
|
pc_moved_p = true;
|
1569
1608
|
}
|
@@ -1581,7 +1620,8 @@ switch (insn) {
|
|
1581
1620
|
}
|
1582
1621
|
fprintf(f, "}\n");
|
1583
1622
|
break;
|
1584
|
-
|
1623
|
+
}
|
1624
|
+
case BIN(setn): {
|
1585
1625
|
fprintf(f, "{\n");
|
1586
1626
|
{
|
1587
1627
|
MAYBE_UNUSED(rb_num_t n) = (rb_num_t)operands[0];
|
@@ -1595,7 +1635,7 @@ switch (insn) {
|
|
1595
1635
|
fprintf(f, "\n");
|
1596
1636
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
1597
1637
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1598
|
-
if (
|
1638
|
+
if (false) {
|
1599
1639
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1600
1640
|
pc_moved_p = true;
|
1601
1641
|
}
|
@@ -1613,7 +1653,8 @@ switch (insn) {
|
|
1613
1653
|
}
|
1614
1654
|
fprintf(f, "}\n");
|
1615
1655
|
break;
|
1616
|
-
|
1656
|
+
}
|
1657
|
+
case BIN(adjuststack): {
|
1617
1658
|
fprintf(f, "{\n");
|
1618
1659
|
{
|
1619
1660
|
MAYBE_UNUSED(rb_num_t n) = (rb_num_t)operands[0];
|
@@ -1625,7 +1666,7 @@ switch (insn) {
|
|
1625
1666
|
fprintf(f, " n = (rb_num_t)0x%"PRIxVALUE";", operands[0]);
|
1626
1667
|
fprintf(f, "\n");
|
1627
1668
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1628
|
-
if (
|
1669
|
+
if (false) {
|
1629
1670
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1630
1671
|
pc_moved_p = true;
|
1631
1672
|
}
|
@@ -1641,7 +1682,8 @@ switch (insn) {
|
|
1641
1682
|
}
|
1642
1683
|
fprintf(f, "}\n");
|
1643
1684
|
break;
|
1644
|
-
|
1685
|
+
}
|
1686
|
+
case BIN(defined): {
|
1645
1687
|
fprintf(f, "{\n");
|
1646
1688
|
{
|
1647
1689
|
MAYBE_UNUSED(rb_num_t op_type) = (rb_num_t)operands[0];
|
@@ -1663,7 +1705,7 @@ switch (insn) {
|
|
1663
1705
|
fprintf(f, "\n");
|
1664
1706
|
fprintf(f, " v = stack[%d];\n", b->stack_size - 1);
|
1665
1707
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1666
|
-
if (
|
1708
|
+
if (true) {
|
1667
1709
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1668
1710
|
pc_moved_p = true;
|
1669
1711
|
}
|
@@ -1688,7 +1730,8 @@ switch (insn) {
|
|
1688
1730
|
}
|
1689
1731
|
fprintf(f, "}\n");
|
1690
1732
|
break;
|
1691
|
-
|
1733
|
+
}
|
1734
|
+
case BIN(checkmatch): {
|
1692
1735
|
fprintf(f, "{\n");
|
1693
1736
|
{
|
1694
1737
|
MAYBE_UNUSED(rb_num_t flag) = (rb_num_t)operands[0];
|
@@ -1703,7 +1746,7 @@ switch (insn) {
|
|
1703
1746
|
fprintf(f, " target = stack[%d];\n", b->stack_size - 2);
|
1704
1747
|
fprintf(f, " pattern = stack[%d];\n", b->stack_size - 1);
|
1705
1748
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1706
|
-
if (
|
1749
|
+
if (true) {
|
1707
1750
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1708
1751
|
pc_moved_p = true;
|
1709
1752
|
}
|
@@ -1728,7 +1771,8 @@ switch (insn) {
|
|
1728
1771
|
}
|
1729
1772
|
fprintf(f, "}\n");
|
1730
1773
|
break;
|
1731
|
-
|
1774
|
+
}
|
1775
|
+
case BIN(checkkeyword): {
|
1732
1776
|
fprintf(f, "{\n");
|
1733
1777
|
{
|
1734
1778
|
MAYBE_UNUSED(lindex_t kw_bits_index) = (lindex_t)operands[0];
|
@@ -1744,7 +1788,7 @@ switch (insn) {
|
|
1744
1788
|
fprintf(f, " keyword_index = (lindex_t)0x%"PRIxVALUE";", operands[1]);
|
1745
1789
|
fprintf(f, "\n");
|
1746
1790
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1747
|
-
if (
|
1791
|
+
if (false) {
|
1748
1792
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1749
1793
|
pc_moved_p = true;
|
1750
1794
|
}
|
@@ -1761,7 +1805,8 @@ switch (insn) {
|
|
1761
1805
|
}
|
1762
1806
|
fprintf(f, "}\n");
|
1763
1807
|
break;
|
1764
|
-
|
1808
|
+
}
|
1809
|
+
case BIN(checktype): {
|
1765
1810
|
fprintf(f, "{\n");
|
1766
1811
|
{
|
1767
1812
|
MAYBE_UNUSED(rb_num_t type) = (rb_num_t)operands[0];
|
@@ -1775,7 +1820,7 @@ switch (insn) {
|
|
1775
1820
|
fprintf(f, "\n");
|
1776
1821
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
1777
1822
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1778
|
-
if (
|
1823
|
+
if (false) {
|
1779
1824
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1780
1825
|
pc_moved_p = true;
|
1781
1826
|
}
|
@@ -1792,7 +1837,8 @@ switch (insn) {
|
|
1792
1837
|
}
|
1793
1838
|
fprintf(f, "}\n");
|
1794
1839
|
break;
|
1795
|
-
|
1840
|
+
}
|
1841
|
+
case BIN(definemethod): {
|
1796
1842
|
fprintf(f, "{\n");
|
1797
1843
|
{
|
1798
1844
|
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
@@ -1809,7 +1855,7 @@ switch (insn) {
|
|
1809
1855
|
fprintf(f, " iseq = (ISEQ)0x%"PRIxVALUE";", operands[1]);
|
1810
1856
|
fprintf(f, "\n");
|
1811
1857
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1812
|
-
if (
|
1858
|
+
if (true) {
|
1813
1859
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1814
1860
|
pc_moved_p = true;
|
1815
1861
|
}
|
@@ -1841,7 +1887,8 @@ switch (insn) {
|
|
1841
1887
|
}
|
1842
1888
|
fprintf(f, "}\n");
|
1843
1889
|
break;
|
1844
|
-
|
1890
|
+
}
|
1891
|
+
case BIN(definesmethod): {
|
1845
1892
|
fprintf(f, "{\n");
|
1846
1893
|
{
|
1847
1894
|
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
@@ -1860,7 +1907,7 @@ switch (insn) {
|
|
1860
1907
|
fprintf(f, "\n");
|
1861
1908
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
1862
1909
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1863
|
-
if (
|
1910
|
+
if (true) {
|
1864
1911
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1865
1912
|
pc_moved_p = true;
|
1866
1913
|
}
|
@@ -1892,7 +1939,8 @@ switch (insn) {
|
|
1892
1939
|
}
|
1893
1940
|
fprintf(f, "}\n");
|
1894
1941
|
break;
|
1895
|
-
|
1942
|
+
}
|
1943
|
+
case BIN(send): {
|
1896
1944
|
{
|
1897
1945
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
1898
1946
|
MAYBE_UNUSED(ISEQ blockiseq) = (ISEQ)operands[1];
|
@@ -1908,7 +1956,8 @@ switch (insn) {
|
|
1908
1956
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
1909
1957
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
1910
1958
|
)) {
|
1911
|
-
|
1959
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
1960
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
1912
1961
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
1913
1962
|
|
1914
1963
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -1925,7 +1974,7 @@ switch (insn) {
|
|
1925
1974
|
fprintf(f, " }\n");
|
1926
1975
|
|
1927
1976
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
1928
|
-
if (
|
1977
|
+
if (true) {
|
1929
1978
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
1930
1979
|
pc_moved_p = true;
|
1931
1980
|
}
|
@@ -1961,19 +2010,20 @@ switch (insn) {
|
|
1961
2010
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
1962
2011
|
|
1963
2012
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
1964
|
-
fprintf(f, "
|
1965
|
-
fprintf(f, "
|
2013
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
2014
|
+
fprintf(f, " calling.cc = cc;");
|
2015
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
1966
2016
|
}
|
1967
2017
|
else { // VM_METHOD_TYPE_ISEQ
|
1968
2018
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
1969
2019
|
if (iseq->body->catch_except_p) {
|
1970
2020
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
1971
|
-
fprintf(f, " val = vm_exec(ec,
|
2021
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
1972
2022
|
}
|
1973
2023
|
else {
|
1974
2024
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
1975
2025
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
1976
|
-
fprintf(f, " val = vm_exec(ec,
|
2026
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
1977
2027
|
fprintf(f, " }\n");
|
1978
2028
|
}
|
1979
2029
|
}
|
@@ -2013,7 +2063,7 @@ switch (insn) {
|
|
2013
2063
|
fprintf(f, " blockiseq = (ISEQ)0x%"PRIxVALUE";", operands[1]);
|
2014
2064
|
fprintf(f, "\n");
|
2015
2065
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2016
|
-
if (
|
2066
|
+
if (true) {
|
2017
2067
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2018
2068
|
pc_moved_p = true;
|
2019
2069
|
}
|
@@ -2032,7 +2082,7 @@ switch (insn) {
|
|
2032
2082
|
}
|
2033
2083
|
fprintf(f, " {\n");
|
2034
2084
|
fprintf(f, " VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), cd->ci, blockiseq, false);\n");
|
2035
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
2085
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
2036
2086
|
fprintf(f, "\n");
|
2037
2087
|
fprintf(f, " if (val == Qundef) {\n");
|
2038
2088
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -2057,7 +2107,8 @@ switch (insn) {
|
|
2057
2107
|
}
|
2058
2108
|
fprintf(f, "}\n");
|
2059
2109
|
break;
|
2060
|
-
|
2110
|
+
}
|
2111
|
+
case BIN(opt_send_without_block): {
|
2061
2112
|
{
|
2062
2113
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
2063
2114
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -2072,7 +2123,8 @@ switch (insn) {
|
|
2072
2123
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
2073
2124
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
2074
2125
|
)) {
|
2075
|
-
|
2126
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
2127
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
2076
2128
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
2077
2129
|
|
2078
2130
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -2089,7 +2141,7 @@ switch (insn) {
|
|
2089
2141
|
fprintf(f, " }\n");
|
2090
2142
|
|
2091
2143
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2092
|
-
if (
|
2144
|
+
if (true) {
|
2093
2145
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2094
2146
|
pc_moved_p = true;
|
2095
2147
|
}
|
@@ -2125,19 +2177,20 @@ switch (insn) {
|
|
2125
2177
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
2126
2178
|
|
2127
2179
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
2128
|
-
fprintf(f, "
|
2129
|
-
fprintf(f, "
|
2180
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
2181
|
+
fprintf(f, " calling.cc = cc;");
|
2182
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
2130
2183
|
}
|
2131
2184
|
else { // VM_METHOD_TYPE_ISEQ
|
2132
2185
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
2133
2186
|
if (iseq->body->catch_except_p) {
|
2134
2187
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
2135
|
-
fprintf(f, " val = vm_exec(ec,
|
2188
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
2136
2189
|
}
|
2137
2190
|
else {
|
2138
2191
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
2139
2192
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
2140
|
-
fprintf(f, " val = vm_exec(ec,
|
2193
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
2141
2194
|
fprintf(f, " }\n");
|
2142
2195
|
}
|
2143
2196
|
}
|
@@ -2173,7 +2226,7 @@ switch (insn) {
|
|
2173
2226
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
2174
2227
|
fprintf(f, "\n");
|
2175
2228
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2176
|
-
if (
|
2229
|
+
if (true) {
|
2177
2230
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2178
2231
|
pc_moved_p = true;
|
2179
2232
|
}
|
@@ -2192,7 +2245,7 @@ switch (insn) {
|
|
2192
2245
|
}
|
2193
2246
|
fprintf(f, " {\n");
|
2194
2247
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
2195
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
2248
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
2196
2249
|
fprintf(f, "\n");
|
2197
2250
|
fprintf(f, " if (val == Qundef) {\n");
|
2198
2251
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -2217,7 +2270,8 @@ switch (insn) {
|
|
2217
2270
|
}
|
2218
2271
|
fprintf(f, "}\n");
|
2219
2272
|
break;
|
2220
|
-
|
2273
|
+
}
|
2274
|
+
case BIN(opt_str_freeze): {
|
2221
2275
|
fprintf(f, "{\n");
|
2222
2276
|
{
|
2223
2277
|
MAYBE_UNUSED(VALUE str) = (VALUE)operands[0];
|
@@ -2235,7 +2289,7 @@ switch (insn) {
|
|
2235
2289
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[1])->ci));
|
2236
2290
|
fprintf(f, "\n");
|
2237
2291
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2238
|
-
if (
|
2292
|
+
if (false) {
|
2239
2293
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2240
2294
|
pc_moved_p = true;
|
2241
2295
|
}
|
@@ -2262,8 +2316,9 @@ switch (insn) {
|
|
2262
2316
|
}
|
2263
2317
|
fprintf(f, "}\n");
|
2264
2318
|
break;
|
2265
|
-
|
2266
|
-
|
2319
|
+
}
|
2320
|
+
case BIN(opt_nil_p): {
|
2321
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_nil_p))) {
|
2267
2322
|
{
|
2268
2323
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
2269
2324
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -2278,7 +2333,8 @@ switch (insn) {
|
|
2278
2333
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
2279
2334
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
2280
2335
|
)) {
|
2281
|
-
|
2336
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
2337
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
2282
2338
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
2283
2339
|
|
2284
2340
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -2295,7 +2351,7 @@ switch (insn) {
|
|
2295
2351
|
fprintf(f, " }\n");
|
2296
2352
|
|
2297
2353
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2298
|
-
if (
|
2354
|
+
if (true) {
|
2299
2355
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2300
2356
|
pc_moved_p = true;
|
2301
2357
|
}
|
@@ -2331,19 +2387,20 @@ switch (insn) {
|
|
2331
2387
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
2332
2388
|
|
2333
2389
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
2334
|
-
fprintf(f, "
|
2335
|
-
fprintf(f, "
|
2390
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
2391
|
+
fprintf(f, " calling.cc = cc;");
|
2392
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
2336
2393
|
}
|
2337
2394
|
else { // VM_METHOD_TYPE_ISEQ
|
2338
2395
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
2339
2396
|
if (iseq->body->catch_except_p) {
|
2340
2397
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
2341
|
-
fprintf(f, " val = vm_exec(ec,
|
2398
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
2342
2399
|
}
|
2343
2400
|
else {
|
2344
2401
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
2345
2402
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
2346
|
-
fprintf(f, " val = vm_exec(ec,
|
2403
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
2347
2404
|
fprintf(f, " }\n");
|
2348
2405
|
}
|
2349
2406
|
}
|
@@ -2379,7 +2436,7 @@ switch (insn) {
|
|
2379
2436
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
2380
2437
|
fprintf(f, "\n");
|
2381
2438
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2382
|
-
if (
|
2439
|
+
if (true) {
|
2383
2440
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2384
2441
|
pc_moved_p = true;
|
2385
2442
|
}
|
@@ -2398,7 +2455,7 @@ switch (insn) {
|
|
2398
2455
|
}
|
2399
2456
|
fprintf(f, " {\n");
|
2400
2457
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
2401
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
2458
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
2402
2459
|
fprintf(f, "\n");
|
2403
2460
|
fprintf(f, " if (val == Qundef) {\n");
|
2404
2461
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -2422,8 +2479,8 @@ switch (insn) {
|
|
2422
2479
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
2423
2480
|
}
|
2424
2481
|
fprintf(f, "}\n");
|
2425
|
-
|
2426
|
-
|
2482
|
+
break;
|
2483
|
+
}
|
2427
2484
|
fprintf(f, "{\n");
|
2428
2485
|
{
|
2429
2486
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -2438,7 +2495,7 @@ switch (insn) {
|
|
2438
2495
|
fprintf(f, "\n");
|
2439
2496
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
2440
2497
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2441
|
-
if (
|
2498
|
+
if (false) {
|
2442
2499
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2443
2500
|
pc_moved_p = true;
|
2444
2501
|
}
|
@@ -2464,7 +2521,8 @@ switch (insn) {
|
|
2464
2521
|
}
|
2465
2522
|
fprintf(f, "}\n");
|
2466
2523
|
break;
|
2467
|
-
|
2524
|
+
}
|
2525
|
+
case BIN(opt_str_uminus): {
|
2468
2526
|
fprintf(f, "{\n");
|
2469
2527
|
{
|
2470
2528
|
MAYBE_UNUSED(VALUE str) = (VALUE)operands[0];
|
@@ -2482,7 +2540,7 @@ switch (insn) {
|
|
2482
2540
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[1])->ci));
|
2483
2541
|
fprintf(f, "\n");
|
2484
2542
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2485
|
-
if (
|
2543
|
+
if (false) {
|
2486
2544
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2487
2545
|
pc_moved_p = true;
|
2488
2546
|
}
|
@@ -2509,7 +2567,8 @@ switch (insn) {
|
|
2509
2567
|
}
|
2510
2568
|
fprintf(f, "}\n");
|
2511
2569
|
break;
|
2512
|
-
|
2570
|
+
}
|
2571
|
+
case BIN(opt_newarray_max): {
|
2513
2572
|
fprintf(f, "{\n");
|
2514
2573
|
{
|
2515
2574
|
MAYBE_UNUSED(rb_num_t num) = (rb_num_t)operands[0];
|
@@ -2522,7 +2581,7 @@ switch (insn) {
|
|
2522
2581
|
fprintf(f, " num = (rb_num_t)0x%"PRIxVALUE";", operands[0]);
|
2523
2582
|
fprintf(f, "\n");
|
2524
2583
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2525
|
-
if (
|
2584
|
+
if (true) {
|
2526
2585
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2527
2586
|
pc_moved_p = true;
|
2528
2587
|
}
|
@@ -2548,7 +2607,8 @@ switch (insn) {
|
|
2548
2607
|
}
|
2549
2608
|
fprintf(f, "}\n");
|
2550
2609
|
break;
|
2551
|
-
|
2610
|
+
}
|
2611
|
+
case BIN(opt_newarray_min): {
|
2552
2612
|
fprintf(f, "{\n");
|
2553
2613
|
{
|
2554
2614
|
MAYBE_UNUSED(rb_num_t num) = (rb_num_t)operands[0];
|
@@ -2561,7 +2621,7 @@ switch (insn) {
|
|
2561
2621
|
fprintf(f, " num = (rb_num_t)0x%"PRIxVALUE";", operands[0]);
|
2562
2622
|
fprintf(f, "\n");
|
2563
2623
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2564
|
-
if (
|
2624
|
+
if (true) {
|
2565
2625
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2566
2626
|
pc_moved_p = true;
|
2567
2627
|
}
|
@@ -2587,7 +2647,8 @@ switch (insn) {
|
|
2587
2647
|
}
|
2588
2648
|
fprintf(f, "}\n");
|
2589
2649
|
break;
|
2590
|
-
|
2650
|
+
}
|
2651
|
+
case BIN(invokesuper): {
|
2591
2652
|
fprintf(f, "{\n");
|
2592
2653
|
{
|
2593
2654
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -2605,7 +2666,7 @@ switch (insn) {
|
|
2605
2666
|
fprintf(f, " blockiseq = (ISEQ)0x%"PRIxVALUE";", operands[1]);
|
2606
2667
|
fprintf(f, "\n");
|
2607
2668
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2608
|
-
if (
|
2669
|
+
if (true) {
|
2609
2670
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2610
2671
|
pc_moved_p = true;
|
2611
2672
|
}
|
@@ -2624,7 +2685,7 @@ switch (insn) {
|
|
2624
2685
|
}
|
2625
2686
|
fprintf(f, " {\n");
|
2626
2687
|
fprintf(f, " VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), cd->ci, blockiseq, true);\n");
|
2627
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
2688
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_super);\n");
|
2628
2689
|
fprintf(f, "\n");
|
2629
2690
|
fprintf(f, " if (val == Qundef) {\n");
|
2630
2691
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -2649,7 +2710,8 @@ switch (insn) {
|
|
2649
2710
|
}
|
2650
2711
|
fprintf(f, "}\n");
|
2651
2712
|
break;
|
2652
|
-
|
2713
|
+
}
|
2714
|
+
case BIN(invokeblock): {
|
2653
2715
|
fprintf(f, "{\n");
|
2654
2716
|
{
|
2655
2717
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -2663,7 +2725,7 @@ switch (insn) {
|
|
2663
2725
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
2664
2726
|
fprintf(f, "\n");
|
2665
2727
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2666
|
-
if (
|
2728
|
+
if (true) {
|
2667
2729
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2668
2730
|
pc_moved_p = true;
|
2669
2731
|
}
|
@@ -2681,13 +2743,8 @@ switch (insn) {
|
|
2681
2743
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size - 0); /* POPN(INSN_ATTR(popn)); */
|
2682
2744
|
}
|
2683
2745
|
fprintf(f, " {\n");
|
2684
|
-
fprintf(f, " if (UNLIKELY(vm_cc_call(cd->cc) != vm_invokeblock_i)) {\n");
|
2685
|
-
fprintf(f, " const struct rb_callcache *cc = vm_cc_new(0, NULL, vm_invokeblock_i);\n");
|
2686
|
-
fprintf(f, " RB_OBJ_WRITE(GET_ISEQ(), &cd->cc, cc);\n");
|
2687
|
-
fprintf(f, " }\n");
|
2688
|
-
fprintf(f, "\n");
|
2689
2746
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
2690
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
2747
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_invokeblock);\n");
|
2691
2748
|
fprintf(f, "\n");
|
2692
2749
|
fprintf(f, " if (val == Qundef) {\n");
|
2693
2750
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -2712,27 +2769,26 @@ switch (insn) {
|
|
2712
2769
|
}
|
2713
2770
|
fprintf(f, "}\n");
|
2714
2771
|
break;
|
2715
|
-
|
2716
|
-
|
2717
|
-
|
2718
|
-
|
2719
|
-
|
2720
|
-
|
2721
|
-
|
2722
|
-
|
2723
|
-
|
2724
|
-
|
2725
|
-
|
2726
|
-
|
2727
|
-
|
2728
|
-
|
2729
|
-
|
2730
|
-
}
|
2731
|
-
fprintf(f, " return stack[0];\n");
|
2732
|
-
b->stack_size += attr_sp_inc_leave();
|
2733
|
-
b->finish_p = TRUE;
|
2734
|
-
break;
|
2772
|
+
}
|
2773
|
+
case BIN(leave): {
|
2774
|
+
if (b->stack_size != 1) {
|
2775
|
+
if (mjit_opts.warnings || mjit_opts.verbose)
|
2776
|
+
fprintf(stderr, "MJIT warning: Unexpected JIT stack_size on leave: %d\n", b->stack_size);
|
2777
|
+
status->success = false;
|
2778
|
+
}
|
2779
|
+
if (status->inlined_iseqs != NULL) { // the current ISeq is NOT being inlined
|
2780
|
+
fprintf(f, " if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(ec))) {\n");
|
2781
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
2782
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
2783
|
+
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_leave);\n");
|
2784
|
+
fprintf(f, " goto cancel;\n");
|
2785
|
+
fprintf(f, " }\n");
|
2786
|
+
fprintf(f, " ec->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(reg_cfp);\n"); // vm_pop_frame
|
2735
2787
|
}
|
2788
|
+
fprintf(f, " return stack[0];\n");
|
2789
|
+
b->stack_size += attr_sp_inc_leave();
|
2790
|
+
b->finish_p = TRUE;
|
2791
|
+
break;
|
2736
2792
|
fprintf(f, "{\n");
|
2737
2793
|
{
|
2738
2794
|
if (status->local_stack_p) {
|
@@ -2742,7 +2798,7 @@ switch (insn) {
|
|
2742
2798
|
|
2743
2799
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
2744
2800
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2745
|
-
if (
|
2801
|
+
if (true) {
|
2746
2802
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2747
2803
|
pc_moved_p = true;
|
2748
2804
|
}
|
@@ -2798,7 +2854,8 @@ switch (insn) {
|
|
2798
2854
|
fprintf(f, "}\n");
|
2799
2855
|
b->finish_p = TRUE;
|
2800
2856
|
break;
|
2801
|
-
|
2857
|
+
}
|
2858
|
+
case BIN(throw): {
|
2802
2859
|
fprintf(f, "{\n");
|
2803
2860
|
{
|
2804
2861
|
MAYBE_UNUSED(rb_num_t throw_state) = (rb_num_t)operands[0];
|
@@ -2812,7 +2869,7 @@ switch (insn) {
|
|
2812
2869
|
fprintf(f, "\n");
|
2813
2870
|
fprintf(f, " throwobj = stack[%d];\n", b->stack_size - 1);
|
2814
2871
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2815
|
-
if (
|
2872
|
+
if (true) {
|
2816
2873
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2817
2874
|
pc_moved_p = true;
|
2818
2875
|
}
|
@@ -2840,7 +2897,8 @@ switch (insn) {
|
|
2840
2897
|
fprintf(f, "}\n");
|
2841
2898
|
b->finish_p = TRUE;
|
2842
2899
|
break;
|
2843
|
-
|
2900
|
+
}
|
2901
|
+
case BIN(jump): {
|
2844
2902
|
fprintf(f, "{\n");
|
2845
2903
|
{
|
2846
2904
|
MAYBE_UNUSED(OFFSET dst) = (OFFSET)operands[0];
|
@@ -2852,7 +2910,7 @@ switch (insn) {
|
|
2852
2910
|
fprintf(f, " dst = (OFFSET)0x%"PRIxVALUE";", operands[0]);
|
2853
2911
|
fprintf(f, "\n");
|
2854
2912
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2855
|
-
if (
|
2913
|
+
if (false) {
|
2856
2914
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2857
2915
|
pc_moved_p = true;
|
2858
2916
|
}
|
@@ -2862,23 +2920,24 @@ switch (insn) {
|
|
2862
2920
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
2863
2921
|
}
|
2864
2922
|
fprintf(f, " {\n");
|
2865
|
-
fprintf(f, "
|
2923
|
+
fprintf(f, " if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(ec))) {\n");
|
2924
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2925
|
+
fprintf(f, " rb_threadptr_execute_interrupts(rb_ec_thread_ptr(ec), 0);\n");
|
2926
|
+
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
2927
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
2928
|
+
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
2929
|
+
fprintf(f, " goto cancel;\n");
|
2930
|
+
fprintf(f, " }\n");
|
2931
|
+
fprintf(f, " }\n");
|
2866
2932
|
next_pos = pos + insn_len(insn) + (unsigned int)dst;
|
2867
2933
|
fprintf(f, " goto label_%d;\n", next_pos);
|
2868
2934
|
fprintf(f, " }\n");
|
2869
|
-
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
2870
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_jump(dst));
|
2871
|
-
if (!pc_moved_p) {
|
2872
|
-
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
2873
|
-
}
|
2874
|
-
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
2875
|
-
fprintf(f, " goto cancel;\n");
|
2876
|
-
fprintf(f, " }\n");
|
2877
2935
|
b->stack_size += attr_sp_inc_jump(dst);
|
2878
2936
|
}
|
2879
2937
|
fprintf(f, "}\n");
|
2880
2938
|
break;
|
2881
|
-
|
2939
|
+
}
|
2940
|
+
case BIN(branchif): {
|
2882
2941
|
fprintf(f, "{\n");
|
2883
2942
|
{
|
2884
2943
|
MAYBE_UNUSED(OFFSET dst) = (OFFSET)operands[0];
|
@@ -2892,7 +2951,7 @@ switch (insn) {
|
|
2892
2951
|
fprintf(f, "\n");
|
2893
2952
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
2894
2953
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2895
|
-
if (
|
2954
|
+
if (false) {
|
2896
2955
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2897
2956
|
pc_moved_p = true;
|
2898
2957
|
}
|
@@ -2903,19 +2962,19 @@ switch (insn) {
|
|
2903
2962
|
}
|
2904
2963
|
fprintf(f, " {\n");
|
2905
2964
|
fprintf(f, " if (RTEST(val)) {\n");
|
2906
|
-
fprintf(f, "
|
2965
|
+
fprintf(f, " if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(ec))) {\n");
|
2966
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2967
|
+
fprintf(f, " rb_threadptr_execute_interrupts(rb_ec_thread_ptr(ec), 0);\n");
|
2968
|
+
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
2969
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
2970
|
+
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
2971
|
+
fprintf(f, " goto cancel;\n");
|
2972
|
+
fprintf(f, " }\n");
|
2973
|
+
fprintf(f, " }\n");
|
2907
2974
|
next_pos = pos + insn_len(insn) + (unsigned int)dst;
|
2908
2975
|
fprintf(f, " goto label_%d;\n", next_pos);
|
2909
2976
|
fprintf(f, " }\n");
|
2910
2977
|
fprintf(f, " }\n");
|
2911
|
-
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
2912
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_branchif(dst));
|
2913
|
-
if (!pc_moved_p) {
|
2914
|
-
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
2915
|
-
}
|
2916
|
-
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
2917
|
-
fprintf(f, " goto cancel;\n");
|
2918
|
-
fprintf(f, " }\n");
|
2919
2978
|
b->stack_size += attr_sp_inc_branchif(dst);
|
2920
2979
|
}
|
2921
2980
|
fprintf(f, "}\n");
|
@@ -2926,7 +2985,8 @@ switch (insn) {
|
|
2926
2985
|
compile_insns(f, body, b->stack_size, pos + insn_len(insn), status);
|
2927
2986
|
}
|
2928
2987
|
break;
|
2929
|
-
|
2988
|
+
}
|
2989
|
+
case BIN(branchunless): {
|
2930
2990
|
fprintf(f, "{\n");
|
2931
2991
|
{
|
2932
2992
|
MAYBE_UNUSED(OFFSET dst) = (OFFSET)operands[0];
|
@@ -2940,7 +3000,7 @@ switch (insn) {
|
|
2940
3000
|
fprintf(f, "\n");
|
2941
3001
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
2942
3002
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2943
|
-
if (
|
3003
|
+
if (false) {
|
2944
3004
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2945
3005
|
pc_moved_p = true;
|
2946
3006
|
}
|
@@ -2951,19 +3011,19 @@ switch (insn) {
|
|
2951
3011
|
}
|
2952
3012
|
fprintf(f, " {\n");
|
2953
3013
|
fprintf(f, " if (!RTEST(val)) {\n");
|
2954
|
-
fprintf(f, "
|
3014
|
+
fprintf(f, " if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(ec))) {\n");
|
3015
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3016
|
+
fprintf(f, " rb_threadptr_execute_interrupts(rb_ec_thread_ptr(ec), 0);\n");
|
3017
|
+
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
3018
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
3019
|
+
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
3020
|
+
fprintf(f, " goto cancel;\n");
|
3021
|
+
fprintf(f, " }\n");
|
3022
|
+
fprintf(f, " }\n");
|
2955
3023
|
next_pos = pos + insn_len(insn) + (unsigned int)dst;
|
2956
3024
|
fprintf(f, " goto label_%d;\n", next_pos);
|
2957
3025
|
fprintf(f, " }\n");
|
2958
3026
|
fprintf(f, " }\n");
|
2959
|
-
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
2960
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_branchunless(dst));
|
2961
|
-
if (!pc_moved_p) {
|
2962
|
-
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
2963
|
-
}
|
2964
|
-
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
2965
|
-
fprintf(f, " goto cancel;\n");
|
2966
|
-
fprintf(f, " }\n");
|
2967
3027
|
b->stack_size += attr_sp_inc_branchunless(dst);
|
2968
3028
|
}
|
2969
3029
|
fprintf(f, "}\n");
|
@@ -2974,7 +3034,8 @@ switch (insn) {
|
|
2974
3034
|
compile_insns(f, body, b->stack_size, pos + insn_len(insn), status);
|
2975
3035
|
}
|
2976
3036
|
break;
|
2977
|
-
|
3037
|
+
}
|
3038
|
+
case BIN(branchnil): {
|
2978
3039
|
fprintf(f, "{\n");
|
2979
3040
|
{
|
2980
3041
|
MAYBE_UNUSED(OFFSET dst) = (OFFSET)operands[0];
|
@@ -2988,7 +3049,7 @@ switch (insn) {
|
|
2988
3049
|
fprintf(f, "\n");
|
2989
3050
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
2990
3051
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
2991
|
-
if (
|
3052
|
+
if (false) {
|
2992
3053
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
2993
3054
|
pc_moved_p = true;
|
2994
3055
|
}
|
@@ -2999,19 +3060,19 @@ switch (insn) {
|
|
2999
3060
|
}
|
3000
3061
|
fprintf(f, " {\n");
|
3001
3062
|
fprintf(f, " if (NIL_P(val)) {\n");
|
3002
|
-
fprintf(f, "
|
3063
|
+
fprintf(f, " if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(ec))) {\n");
|
3064
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3065
|
+
fprintf(f, " rb_threadptr_execute_interrupts(rb_ec_thread_ptr(ec), 0);\n");
|
3066
|
+
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
3067
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
3068
|
+
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
3069
|
+
fprintf(f, " goto cancel;\n");
|
3070
|
+
fprintf(f, " }\n");
|
3071
|
+
fprintf(f, " }\n");
|
3003
3072
|
next_pos = pos + insn_len(insn) + (unsigned int)dst;
|
3004
3073
|
fprintf(f, " goto label_%d;\n", next_pos);
|
3005
3074
|
fprintf(f, " }\n");
|
3006
3075
|
fprintf(f, " }\n");
|
3007
|
-
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
3008
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_branchnil(dst));
|
3009
|
-
if (!pc_moved_p) {
|
3010
|
-
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
3011
|
-
}
|
3012
|
-
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
3013
|
-
fprintf(f, " goto cancel;\n");
|
3014
|
-
fprintf(f, " }\n");
|
3015
3076
|
b->stack_size += attr_sp_inc_branchnil(dst);
|
3016
3077
|
}
|
3017
3078
|
fprintf(f, "}\n");
|
@@ -3022,7 +3083,31 @@ switch (insn) {
|
|
3022
3083
|
compile_insns(f, body, b->stack_size, pos + insn_len(insn), status);
|
3023
3084
|
}
|
3024
3085
|
break;
|
3025
|
-
|
3086
|
+
}
|
3087
|
+
case BIN(opt_getinlinecache): {
|
3088
|
+
OFFSET dst = (OFFSET)operands[0];
|
3089
|
+
IC ic = (IC)operands[1];
|
3090
|
+
|
3091
|
+
rb_mjit_before_vm_ic_update();
|
3092
|
+
rb_serial_t ic_serial = ic->ic_serial;
|
3093
|
+
const rb_cref_t *ic_cref = ic->ic_cref;
|
3094
|
+
VALUE ic_value = ic->value;
|
3095
|
+
rb_mjit_after_vm_ic_update();
|
3096
|
+
|
3097
|
+
if (ic_serial && !status->compile_info->disable_const_cache) {
|
3098
|
+
fprintf(f, " if (vm_ic_hit_p((rb_serial_t)%"PRI_SERIALT_PREFIX"u, (const rb_cref_t *)0x%"PRIxVALUE", reg_cfp->ep)) {", ic_serial, (VALUE)ic_cref);
|
3099
|
+
fprintf(f, " stack[%d] = 0x%"PRIxVALUE";\n", b->stack_size, ic_value);
|
3100
|
+
fprintf(f, " goto label_%d;\n", pos + insn_len(insn) + (int)dst);
|
3101
|
+
fprintf(f, " }");
|
3102
|
+
fprintf(f, " else {");
|
3103
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
3104
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
3105
|
+
fprintf(f, " goto const_cancel;\n");
|
3106
|
+
fprintf(f, " }");
|
3107
|
+
|
3108
|
+
b->stack_size += attr_sp_inc_opt_getinlinecache(dst, ic);
|
3109
|
+
break;
|
3110
|
+
}
|
3026
3111
|
fprintf(f, "{\n");
|
3027
3112
|
{
|
3028
3113
|
MAYBE_UNUSED(OFFSET dst) = (OFFSET)operands[0];
|
@@ -3039,7 +3124,7 @@ switch (insn) {
|
|
3039
3124
|
fprintf(f, " ic = (IC)0x%"PRIxVALUE";", operands[1]);
|
3040
3125
|
fprintf(f, "\n");
|
3041
3126
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3042
|
-
if (
|
3127
|
+
if (false) {
|
3043
3128
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3044
3129
|
pc_moved_p = true;
|
3045
3130
|
}
|
@@ -3049,7 +3134,7 @@ switch (insn) {
|
|
3049
3134
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
3050
3135
|
}
|
3051
3136
|
fprintf(f, " {\n");
|
3052
|
-
fprintf(f, " if (vm_ic_hit_p(ic, GET_EP())) {\n");
|
3137
|
+
fprintf(f, " if (vm_ic_hit_p(ic->ic_serial, ic->ic_cref, GET_EP())) {\n");
|
3053
3138
|
fprintf(f, " val = ic->value;\n");
|
3054
3139
|
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_getinlinecache(dst, ic) - 1);
|
3055
3140
|
next_pos = pos + insn_len(insn) + (unsigned int)dst;
|
@@ -3070,7 +3155,8 @@ switch (insn) {
|
|
3070
3155
|
compile_insns(f, body, b->stack_size, pos + insn_len(insn), status);
|
3071
3156
|
}
|
3072
3157
|
break;
|
3073
|
-
|
3158
|
+
}
|
3159
|
+
case BIN(opt_setinlinecache): {
|
3074
3160
|
fprintf(f, "{\n");
|
3075
3161
|
{
|
3076
3162
|
MAYBE_UNUSED(IC ic) = (IC)operands[0];
|
@@ -3084,7 +3170,7 @@ switch (insn) {
|
|
3084
3170
|
fprintf(f, "\n");
|
3085
3171
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
3086
3172
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3087
|
-
if (
|
3173
|
+
if (false) {
|
3088
3174
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3089
3175
|
pc_moved_p = true;
|
3090
3176
|
}
|
@@ -3101,7 +3187,8 @@ switch (insn) {
|
|
3101
3187
|
}
|
3102
3188
|
fprintf(f, "}\n");
|
3103
3189
|
break;
|
3104
|
-
|
3190
|
+
}
|
3191
|
+
case BIN(once): {
|
3105
3192
|
fprintf(f, "{\n");
|
3106
3193
|
{
|
3107
3194
|
MAYBE_UNUSED(ISEQ iseq) = (ISEQ)operands[0];
|
@@ -3118,7 +3205,7 @@ switch (insn) {
|
|
3118
3205
|
fprintf(f, " ise = (ISE)0x%"PRIxVALUE";", operands[1]);
|
3119
3206
|
fprintf(f, "\n");
|
3120
3207
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3121
|
-
if (
|
3208
|
+
if (true) {
|
3122
3209
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3123
3210
|
pc_moved_p = true;
|
3124
3211
|
}
|
@@ -3151,7 +3238,8 @@ switch (insn) {
|
|
3151
3238
|
}
|
3152
3239
|
fprintf(f, "}\n");
|
3153
3240
|
break;
|
3154
|
-
|
3241
|
+
}
|
3242
|
+
case BIN(opt_case_dispatch): {
|
3155
3243
|
fprintf(f, "{\n");
|
3156
3244
|
{
|
3157
3245
|
MAYBE_UNUSED(CDHASH hash) = (CDHASH)operands[0];
|
@@ -3169,7 +3257,7 @@ switch (insn) {
|
|
3169
3257
|
fprintf(f, "\n");
|
3170
3258
|
fprintf(f, " key = stack[%d];\n", b->stack_size - 1);
|
3171
3259
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3172
|
-
if (
|
3260
|
+
if (false) {
|
3173
3261
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3174
3262
|
pc_moved_p = true;
|
3175
3263
|
}
|
@@ -3206,8 +3294,9 @@ switch (insn) {
|
|
3206
3294
|
compile_insns(f, body, b->stack_size, pos + insn_len(insn), status);
|
3207
3295
|
}
|
3208
3296
|
break;
|
3209
|
-
|
3210
|
-
|
3297
|
+
}
|
3298
|
+
case BIN(opt_plus): {
|
3299
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_plus))) {
|
3211
3300
|
{
|
3212
3301
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
3213
3302
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -3222,7 +3311,8 @@ switch (insn) {
|
|
3222
3311
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
3223
3312
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
3224
3313
|
)) {
|
3225
|
-
|
3314
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
3315
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
3226
3316
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
3227
3317
|
|
3228
3318
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -3239,7 +3329,7 @@ switch (insn) {
|
|
3239
3329
|
fprintf(f, " }\n");
|
3240
3330
|
|
3241
3331
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3242
|
-
if (
|
3332
|
+
if (true) {
|
3243
3333
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3244
3334
|
pc_moved_p = true;
|
3245
3335
|
}
|
@@ -3275,19 +3365,20 @@ switch (insn) {
|
|
3275
3365
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
3276
3366
|
|
3277
3367
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
3278
|
-
fprintf(f, "
|
3279
|
-
fprintf(f, "
|
3368
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
3369
|
+
fprintf(f, " calling.cc = cc;");
|
3370
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
3280
3371
|
}
|
3281
3372
|
else { // VM_METHOD_TYPE_ISEQ
|
3282
3373
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
3283
3374
|
if (iseq->body->catch_except_p) {
|
3284
3375
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
3285
|
-
fprintf(f, " val = vm_exec(ec,
|
3376
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
3286
3377
|
}
|
3287
3378
|
else {
|
3288
3379
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
3289
3380
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
3290
|
-
fprintf(f, " val = vm_exec(ec,
|
3381
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
3291
3382
|
fprintf(f, " }\n");
|
3292
3383
|
}
|
3293
3384
|
}
|
@@ -3323,7 +3414,7 @@ switch (insn) {
|
|
3323
3414
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
3324
3415
|
fprintf(f, "\n");
|
3325
3416
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3326
|
-
if (
|
3417
|
+
if (true) {
|
3327
3418
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3328
3419
|
pc_moved_p = true;
|
3329
3420
|
}
|
@@ -3342,7 +3433,7 @@ switch (insn) {
|
|
3342
3433
|
}
|
3343
3434
|
fprintf(f, " {\n");
|
3344
3435
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
3345
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
3436
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
3346
3437
|
fprintf(f, "\n");
|
3347
3438
|
fprintf(f, " if (val == Qundef) {\n");
|
3348
3439
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -3366,8 +3457,8 @@ switch (insn) {
|
|
3366
3457
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
3367
3458
|
}
|
3368
3459
|
fprintf(f, "}\n");
|
3369
|
-
|
3370
|
-
|
3460
|
+
break;
|
3461
|
+
}
|
3371
3462
|
fprintf(f, "{\n");
|
3372
3463
|
{
|
3373
3464
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -3383,7 +3474,7 @@ switch (insn) {
|
|
3383
3474
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
3384
3475
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
3385
3476
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3386
|
-
if (
|
3477
|
+
if (false) {
|
3387
3478
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3388
3479
|
pc_moved_p = true;
|
3389
3480
|
}
|
@@ -3409,8 +3500,9 @@ switch (insn) {
|
|
3409
3500
|
}
|
3410
3501
|
fprintf(f, "}\n");
|
3411
3502
|
break;
|
3412
|
-
|
3413
|
-
|
3503
|
+
}
|
3504
|
+
case BIN(opt_minus): {
|
3505
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_minus))) {
|
3414
3506
|
{
|
3415
3507
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
3416
3508
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -3425,7 +3517,8 @@ switch (insn) {
|
|
3425
3517
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
3426
3518
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
3427
3519
|
)) {
|
3428
|
-
|
3520
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
3521
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
3429
3522
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
3430
3523
|
|
3431
3524
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -3442,7 +3535,7 @@ switch (insn) {
|
|
3442
3535
|
fprintf(f, " }\n");
|
3443
3536
|
|
3444
3537
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3445
|
-
if (
|
3538
|
+
if (true) {
|
3446
3539
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3447
3540
|
pc_moved_p = true;
|
3448
3541
|
}
|
@@ -3478,19 +3571,20 @@ switch (insn) {
|
|
3478
3571
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
3479
3572
|
|
3480
3573
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
3481
|
-
fprintf(f, "
|
3482
|
-
fprintf(f, "
|
3574
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
3575
|
+
fprintf(f, " calling.cc = cc;");
|
3576
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
3483
3577
|
}
|
3484
3578
|
else { // VM_METHOD_TYPE_ISEQ
|
3485
3579
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
3486
3580
|
if (iseq->body->catch_except_p) {
|
3487
3581
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
3488
|
-
fprintf(f, " val = vm_exec(ec,
|
3582
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
3489
3583
|
}
|
3490
3584
|
else {
|
3491
3585
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
3492
3586
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
3493
|
-
fprintf(f, " val = vm_exec(ec,
|
3587
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
3494
3588
|
fprintf(f, " }\n");
|
3495
3589
|
}
|
3496
3590
|
}
|
@@ -3526,7 +3620,7 @@ switch (insn) {
|
|
3526
3620
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
3527
3621
|
fprintf(f, "\n");
|
3528
3622
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3529
|
-
if (
|
3623
|
+
if (true) {
|
3530
3624
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3531
3625
|
pc_moved_p = true;
|
3532
3626
|
}
|
@@ -3545,7 +3639,7 @@ switch (insn) {
|
|
3545
3639
|
}
|
3546
3640
|
fprintf(f, " {\n");
|
3547
3641
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
3548
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
3642
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
3549
3643
|
fprintf(f, "\n");
|
3550
3644
|
fprintf(f, " if (val == Qundef) {\n");
|
3551
3645
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -3569,8 +3663,8 @@ switch (insn) {
|
|
3569
3663
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
3570
3664
|
}
|
3571
3665
|
fprintf(f, "}\n");
|
3572
|
-
|
3573
|
-
|
3666
|
+
break;
|
3667
|
+
}
|
3574
3668
|
fprintf(f, "{\n");
|
3575
3669
|
{
|
3576
3670
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -3586,7 +3680,7 @@ switch (insn) {
|
|
3586
3680
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
3587
3681
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
3588
3682
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3589
|
-
if (
|
3683
|
+
if (false) {
|
3590
3684
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3591
3685
|
pc_moved_p = true;
|
3592
3686
|
}
|
@@ -3612,8 +3706,9 @@ switch (insn) {
|
|
3612
3706
|
}
|
3613
3707
|
fprintf(f, "}\n");
|
3614
3708
|
break;
|
3615
|
-
|
3616
|
-
|
3709
|
+
}
|
3710
|
+
case BIN(opt_mult): {
|
3711
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_mult))) {
|
3617
3712
|
{
|
3618
3713
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
3619
3714
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -3628,7 +3723,8 @@ switch (insn) {
|
|
3628
3723
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
3629
3724
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
3630
3725
|
)) {
|
3631
|
-
|
3726
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
3727
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
3632
3728
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
3633
3729
|
|
3634
3730
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -3645,7 +3741,7 @@ switch (insn) {
|
|
3645
3741
|
fprintf(f, " }\n");
|
3646
3742
|
|
3647
3743
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3648
|
-
if (
|
3744
|
+
if (true) {
|
3649
3745
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3650
3746
|
pc_moved_p = true;
|
3651
3747
|
}
|
@@ -3681,19 +3777,20 @@ switch (insn) {
|
|
3681
3777
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
3682
3778
|
|
3683
3779
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
3684
|
-
fprintf(f, "
|
3685
|
-
fprintf(f, "
|
3780
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
3781
|
+
fprintf(f, " calling.cc = cc;");
|
3782
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
3686
3783
|
}
|
3687
3784
|
else { // VM_METHOD_TYPE_ISEQ
|
3688
3785
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
3689
3786
|
if (iseq->body->catch_except_p) {
|
3690
3787
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
3691
|
-
fprintf(f, " val = vm_exec(ec,
|
3788
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
3692
3789
|
}
|
3693
3790
|
else {
|
3694
3791
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
3695
3792
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
3696
|
-
fprintf(f, " val = vm_exec(ec,
|
3793
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
3697
3794
|
fprintf(f, " }\n");
|
3698
3795
|
}
|
3699
3796
|
}
|
@@ -3729,7 +3826,7 @@ switch (insn) {
|
|
3729
3826
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
3730
3827
|
fprintf(f, "\n");
|
3731
3828
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3732
|
-
if (
|
3829
|
+
if (true) {
|
3733
3830
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3734
3831
|
pc_moved_p = true;
|
3735
3832
|
}
|
@@ -3748,7 +3845,7 @@ switch (insn) {
|
|
3748
3845
|
}
|
3749
3846
|
fprintf(f, " {\n");
|
3750
3847
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
3751
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
3848
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
3752
3849
|
fprintf(f, "\n");
|
3753
3850
|
fprintf(f, " if (val == Qundef) {\n");
|
3754
3851
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -3772,8 +3869,8 @@ switch (insn) {
|
|
3772
3869
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
3773
3870
|
}
|
3774
3871
|
fprintf(f, "}\n");
|
3775
|
-
|
3776
|
-
|
3872
|
+
break;
|
3873
|
+
}
|
3777
3874
|
fprintf(f, "{\n");
|
3778
3875
|
{
|
3779
3876
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -3789,7 +3886,7 @@ switch (insn) {
|
|
3789
3886
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
3790
3887
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
3791
3888
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3792
|
-
if (
|
3889
|
+
if (false) {
|
3793
3890
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3794
3891
|
pc_moved_p = true;
|
3795
3892
|
}
|
@@ -3815,8 +3912,9 @@ switch (insn) {
|
|
3815
3912
|
}
|
3816
3913
|
fprintf(f, "}\n");
|
3817
3914
|
break;
|
3818
|
-
|
3819
|
-
|
3915
|
+
}
|
3916
|
+
case BIN(opt_div): {
|
3917
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_div))) {
|
3820
3918
|
{
|
3821
3919
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
3822
3920
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -3831,7 +3929,8 @@ switch (insn) {
|
|
3831
3929
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
3832
3930
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
3833
3931
|
)) {
|
3834
|
-
|
3932
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
3933
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
3835
3934
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
3836
3935
|
|
3837
3936
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -3848,7 +3947,7 @@ switch (insn) {
|
|
3848
3947
|
fprintf(f, " }\n");
|
3849
3948
|
|
3850
3949
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3851
|
-
if (
|
3950
|
+
if (true) {
|
3852
3951
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3853
3952
|
pc_moved_p = true;
|
3854
3953
|
}
|
@@ -3884,19 +3983,20 @@ switch (insn) {
|
|
3884
3983
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
3885
3984
|
|
3886
3985
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
3887
|
-
fprintf(f, "
|
3888
|
-
fprintf(f, "
|
3986
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
3987
|
+
fprintf(f, " calling.cc = cc;");
|
3988
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
3889
3989
|
}
|
3890
3990
|
else { // VM_METHOD_TYPE_ISEQ
|
3891
3991
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
3892
3992
|
if (iseq->body->catch_except_p) {
|
3893
3993
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
3894
|
-
fprintf(f, " val = vm_exec(ec,
|
3994
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
3895
3995
|
}
|
3896
3996
|
else {
|
3897
3997
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
3898
3998
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
3899
|
-
fprintf(f, " val = vm_exec(ec,
|
3999
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
3900
4000
|
fprintf(f, " }\n");
|
3901
4001
|
}
|
3902
4002
|
}
|
@@ -3932,7 +4032,7 @@ switch (insn) {
|
|
3932
4032
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
3933
4033
|
fprintf(f, "\n");
|
3934
4034
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3935
|
-
if (
|
4035
|
+
if (true) {
|
3936
4036
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3937
4037
|
pc_moved_p = true;
|
3938
4038
|
}
|
@@ -3951,7 +4051,7 @@ switch (insn) {
|
|
3951
4051
|
}
|
3952
4052
|
fprintf(f, " {\n");
|
3953
4053
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
3954
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
4054
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
3955
4055
|
fprintf(f, "\n");
|
3956
4056
|
fprintf(f, " if (val == Qundef) {\n");
|
3957
4057
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -3975,8 +4075,8 @@ switch (insn) {
|
|
3975
4075
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
3976
4076
|
}
|
3977
4077
|
fprintf(f, "}\n");
|
3978
|
-
|
3979
|
-
|
4078
|
+
break;
|
4079
|
+
}
|
3980
4080
|
fprintf(f, "{\n");
|
3981
4081
|
{
|
3982
4082
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -3992,7 +4092,7 @@ switch (insn) {
|
|
3992
4092
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
3993
4093
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
3994
4094
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
3995
|
-
if (
|
4095
|
+
if (true) {
|
3996
4096
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
3997
4097
|
pc_moved_p = true;
|
3998
4098
|
}
|
@@ -4026,8 +4126,9 @@ switch (insn) {
|
|
4026
4126
|
}
|
4027
4127
|
fprintf(f, "}\n");
|
4028
4128
|
break;
|
4029
|
-
|
4030
|
-
|
4129
|
+
}
|
4130
|
+
case BIN(opt_mod): {
|
4131
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_mod))) {
|
4031
4132
|
{
|
4032
4133
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
4033
4134
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -4042,7 +4143,8 @@ switch (insn) {
|
|
4042
4143
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
4043
4144
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
4044
4145
|
)) {
|
4045
|
-
|
4146
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
4147
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
4046
4148
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
4047
4149
|
|
4048
4150
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -4059,7 +4161,7 @@ switch (insn) {
|
|
4059
4161
|
fprintf(f, " }\n");
|
4060
4162
|
|
4061
4163
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4062
|
-
if (
|
4164
|
+
if (true) {
|
4063
4165
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4064
4166
|
pc_moved_p = true;
|
4065
4167
|
}
|
@@ -4095,19 +4197,20 @@ switch (insn) {
|
|
4095
4197
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
4096
4198
|
|
4097
4199
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
4098
|
-
fprintf(f, "
|
4099
|
-
fprintf(f, "
|
4200
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
4201
|
+
fprintf(f, " calling.cc = cc;");
|
4202
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
4100
4203
|
}
|
4101
4204
|
else { // VM_METHOD_TYPE_ISEQ
|
4102
4205
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
4103
4206
|
if (iseq->body->catch_except_p) {
|
4104
4207
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
4105
|
-
fprintf(f, " val = vm_exec(ec,
|
4208
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
4106
4209
|
}
|
4107
4210
|
else {
|
4108
4211
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
4109
4212
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
4110
|
-
fprintf(f, " val = vm_exec(ec,
|
4213
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
4111
4214
|
fprintf(f, " }\n");
|
4112
4215
|
}
|
4113
4216
|
}
|
@@ -4143,7 +4246,7 @@ switch (insn) {
|
|
4143
4246
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
4144
4247
|
fprintf(f, "\n");
|
4145
4248
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4146
|
-
if (
|
4249
|
+
if (true) {
|
4147
4250
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4148
4251
|
pc_moved_p = true;
|
4149
4252
|
}
|
@@ -4162,7 +4265,7 @@ switch (insn) {
|
|
4162
4265
|
}
|
4163
4266
|
fprintf(f, " {\n");
|
4164
4267
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
4165
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
4268
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
4166
4269
|
fprintf(f, "\n");
|
4167
4270
|
fprintf(f, " if (val == Qundef) {\n");
|
4168
4271
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -4186,8 +4289,8 @@ switch (insn) {
|
|
4186
4289
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
4187
4290
|
}
|
4188
4291
|
fprintf(f, "}\n");
|
4189
|
-
|
4190
|
-
|
4292
|
+
break;
|
4293
|
+
}
|
4191
4294
|
fprintf(f, "{\n");
|
4192
4295
|
{
|
4193
4296
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -4203,7 +4306,7 @@ switch (insn) {
|
|
4203
4306
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
4204
4307
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
4205
4308
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4206
|
-
if (
|
4309
|
+
if (true) {
|
4207
4310
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4208
4311
|
pc_moved_p = true;
|
4209
4312
|
}
|
@@ -4237,8 +4340,9 @@ switch (insn) {
|
|
4237
4340
|
}
|
4238
4341
|
fprintf(f, "}\n");
|
4239
4342
|
break;
|
4240
|
-
|
4241
|
-
|
4343
|
+
}
|
4344
|
+
case BIN(opt_eq): {
|
4345
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_eq))) {
|
4242
4346
|
{
|
4243
4347
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
4244
4348
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -4253,7 +4357,8 @@ switch (insn) {
|
|
4253
4357
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
4254
4358
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
4255
4359
|
)) {
|
4256
|
-
|
4360
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
4361
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
4257
4362
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
4258
4363
|
|
4259
4364
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -4270,7 +4375,7 @@ switch (insn) {
|
|
4270
4375
|
fprintf(f, " }\n");
|
4271
4376
|
|
4272
4377
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4273
|
-
if (
|
4378
|
+
if (true) {
|
4274
4379
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4275
4380
|
pc_moved_p = true;
|
4276
4381
|
}
|
@@ -4306,19 +4411,20 @@ switch (insn) {
|
|
4306
4411
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
4307
4412
|
|
4308
4413
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
4309
|
-
fprintf(f, "
|
4310
|
-
fprintf(f, "
|
4414
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
4415
|
+
fprintf(f, " calling.cc = cc;");
|
4416
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
4311
4417
|
}
|
4312
4418
|
else { // VM_METHOD_TYPE_ISEQ
|
4313
4419
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
4314
4420
|
if (iseq->body->catch_except_p) {
|
4315
4421
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
4316
|
-
fprintf(f, " val = vm_exec(ec,
|
4422
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
4317
4423
|
}
|
4318
4424
|
else {
|
4319
4425
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
4320
4426
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
4321
|
-
fprintf(f, " val = vm_exec(ec,
|
4427
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
4322
4428
|
fprintf(f, " }\n");
|
4323
4429
|
}
|
4324
4430
|
}
|
@@ -4354,7 +4460,7 @@ switch (insn) {
|
|
4354
4460
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
4355
4461
|
fprintf(f, "\n");
|
4356
4462
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4357
|
-
if (
|
4463
|
+
if (true) {
|
4358
4464
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4359
4465
|
pc_moved_p = true;
|
4360
4466
|
}
|
@@ -4373,7 +4479,7 @@ switch (insn) {
|
|
4373
4479
|
}
|
4374
4480
|
fprintf(f, " {\n");
|
4375
4481
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
4376
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
4482
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
4377
4483
|
fprintf(f, "\n");
|
4378
4484
|
fprintf(f, " if (val == Qundef) {\n");
|
4379
4485
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -4397,8 +4503,8 @@ switch (insn) {
|
|
4397
4503
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
4398
4504
|
}
|
4399
4505
|
fprintf(f, "}\n");
|
4400
|
-
|
4401
|
-
|
4506
|
+
break;
|
4507
|
+
}
|
4402
4508
|
fprintf(f, "{\n");
|
4403
4509
|
{
|
4404
4510
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -4414,7 +4520,7 @@ switch (insn) {
|
|
4414
4520
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
4415
4521
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
4416
4522
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4417
|
-
if (
|
4523
|
+
if (false) {
|
4418
4524
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4419
4525
|
pc_moved_p = true;
|
4420
4526
|
}
|
@@ -4440,7 +4546,8 @@ switch (insn) {
|
|
4440
4546
|
}
|
4441
4547
|
fprintf(f, "}\n");
|
4442
4548
|
break;
|
4443
|
-
|
4549
|
+
}
|
4550
|
+
case BIN(opt_neq): {
|
4444
4551
|
fprintf(f, "{\n");
|
4445
4552
|
{
|
4446
4553
|
MAYBE_UNUSED(CALL_DATA cd_eq) = (CALL_DATA)operands[0];
|
@@ -4460,7 +4567,7 @@ switch (insn) {
|
|
4460
4567
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
4461
4568
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
4462
4569
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4463
|
-
if (
|
4570
|
+
if (false) {
|
4464
4571
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4465
4572
|
pc_moved_p = true;
|
4466
4573
|
}
|
@@ -4486,8 +4593,9 @@ switch (insn) {
|
|
4486
4593
|
}
|
4487
4594
|
fprintf(f, "}\n");
|
4488
4595
|
break;
|
4489
|
-
|
4490
|
-
|
4596
|
+
}
|
4597
|
+
case BIN(opt_lt): {
|
4598
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_lt))) {
|
4491
4599
|
{
|
4492
4600
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
4493
4601
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -4502,7 +4610,8 @@ switch (insn) {
|
|
4502
4610
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
4503
4611
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
4504
4612
|
)) {
|
4505
|
-
|
4613
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
4614
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
4506
4615
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
4507
4616
|
|
4508
4617
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -4519,7 +4628,7 @@ switch (insn) {
|
|
4519
4628
|
fprintf(f, " }\n");
|
4520
4629
|
|
4521
4630
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4522
|
-
if (
|
4631
|
+
if (true) {
|
4523
4632
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4524
4633
|
pc_moved_p = true;
|
4525
4634
|
}
|
@@ -4555,19 +4664,20 @@ switch (insn) {
|
|
4555
4664
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
4556
4665
|
|
4557
4666
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
4558
|
-
fprintf(f, "
|
4559
|
-
fprintf(f, "
|
4667
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
4668
|
+
fprintf(f, " calling.cc = cc;");
|
4669
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
4560
4670
|
}
|
4561
4671
|
else { // VM_METHOD_TYPE_ISEQ
|
4562
4672
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
4563
4673
|
if (iseq->body->catch_except_p) {
|
4564
4674
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
4565
|
-
fprintf(f, " val = vm_exec(ec,
|
4675
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
4566
4676
|
}
|
4567
4677
|
else {
|
4568
4678
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
4569
4679
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
4570
|
-
fprintf(f, " val = vm_exec(ec,
|
4680
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
4571
4681
|
fprintf(f, " }\n");
|
4572
4682
|
}
|
4573
4683
|
}
|
@@ -4603,7 +4713,7 @@ switch (insn) {
|
|
4603
4713
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
4604
4714
|
fprintf(f, "\n");
|
4605
4715
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4606
|
-
if (
|
4716
|
+
if (true) {
|
4607
4717
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4608
4718
|
pc_moved_p = true;
|
4609
4719
|
}
|
@@ -4622,7 +4732,7 @@ switch (insn) {
|
|
4622
4732
|
}
|
4623
4733
|
fprintf(f, " {\n");
|
4624
4734
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
4625
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
4735
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
4626
4736
|
fprintf(f, "\n");
|
4627
4737
|
fprintf(f, " if (val == Qundef) {\n");
|
4628
4738
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -4646,8 +4756,8 @@ switch (insn) {
|
|
4646
4756
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
4647
4757
|
}
|
4648
4758
|
fprintf(f, "}\n");
|
4649
|
-
|
4650
|
-
|
4759
|
+
break;
|
4760
|
+
}
|
4651
4761
|
fprintf(f, "{\n");
|
4652
4762
|
{
|
4653
4763
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -4663,7 +4773,7 @@ switch (insn) {
|
|
4663
4773
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
4664
4774
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
4665
4775
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4666
|
-
if (
|
4776
|
+
if (false) {
|
4667
4777
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4668
4778
|
pc_moved_p = true;
|
4669
4779
|
}
|
@@ -4689,8 +4799,9 @@ switch (insn) {
|
|
4689
4799
|
}
|
4690
4800
|
fprintf(f, "}\n");
|
4691
4801
|
break;
|
4692
|
-
|
4693
|
-
|
4802
|
+
}
|
4803
|
+
case BIN(opt_le): {
|
4804
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_le))) {
|
4694
4805
|
{
|
4695
4806
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
4696
4807
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -4705,7 +4816,8 @@ switch (insn) {
|
|
4705
4816
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
4706
4817
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
4707
4818
|
)) {
|
4708
|
-
|
4819
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
4820
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
4709
4821
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
4710
4822
|
|
4711
4823
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -4722,7 +4834,7 @@ switch (insn) {
|
|
4722
4834
|
fprintf(f, " }\n");
|
4723
4835
|
|
4724
4836
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4725
|
-
if (
|
4837
|
+
if (true) {
|
4726
4838
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4727
4839
|
pc_moved_p = true;
|
4728
4840
|
}
|
@@ -4758,19 +4870,20 @@ switch (insn) {
|
|
4758
4870
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
4759
4871
|
|
4760
4872
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
4761
|
-
fprintf(f, "
|
4762
|
-
fprintf(f, "
|
4873
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
4874
|
+
fprintf(f, " calling.cc = cc;");
|
4875
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
4763
4876
|
}
|
4764
4877
|
else { // VM_METHOD_TYPE_ISEQ
|
4765
4878
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
4766
4879
|
if (iseq->body->catch_except_p) {
|
4767
4880
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
4768
|
-
fprintf(f, " val = vm_exec(ec,
|
4881
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
4769
4882
|
}
|
4770
4883
|
else {
|
4771
4884
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
4772
4885
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
4773
|
-
fprintf(f, " val = vm_exec(ec,
|
4886
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
4774
4887
|
fprintf(f, " }\n");
|
4775
4888
|
}
|
4776
4889
|
}
|
@@ -4806,7 +4919,7 @@ switch (insn) {
|
|
4806
4919
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
4807
4920
|
fprintf(f, "\n");
|
4808
4921
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4809
|
-
if (
|
4922
|
+
if (true) {
|
4810
4923
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4811
4924
|
pc_moved_p = true;
|
4812
4925
|
}
|
@@ -4825,7 +4938,7 @@ switch (insn) {
|
|
4825
4938
|
}
|
4826
4939
|
fprintf(f, " {\n");
|
4827
4940
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
4828
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
4941
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
4829
4942
|
fprintf(f, "\n");
|
4830
4943
|
fprintf(f, " if (val == Qundef) {\n");
|
4831
4944
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -4849,8 +4962,8 @@ switch (insn) {
|
|
4849
4962
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
4850
4963
|
}
|
4851
4964
|
fprintf(f, "}\n");
|
4852
|
-
|
4853
|
-
|
4965
|
+
break;
|
4966
|
+
}
|
4854
4967
|
fprintf(f, "{\n");
|
4855
4968
|
{
|
4856
4969
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -4866,7 +4979,7 @@ switch (insn) {
|
|
4866
4979
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
4867
4980
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
4868
4981
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4869
|
-
if (
|
4982
|
+
if (false) {
|
4870
4983
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4871
4984
|
pc_moved_p = true;
|
4872
4985
|
}
|
@@ -4892,8 +5005,9 @@ switch (insn) {
|
|
4892
5005
|
}
|
4893
5006
|
fprintf(f, "}\n");
|
4894
5007
|
break;
|
4895
|
-
|
4896
|
-
|
5008
|
+
}
|
5009
|
+
case BIN(opt_gt): {
|
5010
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_gt))) {
|
4897
5011
|
{
|
4898
5012
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
4899
5013
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -4908,7 +5022,8 @@ switch (insn) {
|
|
4908
5022
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
4909
5023
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
4910
5024
|
)) {
|
4911
|
-
|
5025
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
5026
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
4912
5027
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
4913
5028
|
|
4914
5029
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -4925,7 +5040,7 @@ switch (insn) {
|
|
4925
5040
|
fprintf(f, " }\n");
|
4926
5041
|
|
4927
5042
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
4928
|
-
if (
|
5043
|
+
if (true) {
|
4929
5044
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
4930
5045
|
pc_moved_p = true;
|
4931
5046
|
}
|
@@ -4961,19 +5076,20 @@ switch (insn) {
|
|
4961
5076
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
4962
5077
|
|
4963
5078
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
4964
|
-
fprintf(f, "
|
4965
|
-
fprintf(f, "
|
5079
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
5080
|
+
fprintf(f, " calling.cc = cc;");
|
5081
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
4966
5082
|
}
|
4967
5083
|
else { // VM_METHOD_TYPE_ISEQ
|
4968
5084
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
4969
5085
|
if (iseq->body->catch_except_p) {
|
4970
5086
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
4971
|
-
fprintf(f, " val = vm_exec(ec,
|
5087
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
4972
5088
|
}
|
4973
5089
|
else {
|
4974
5090
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
4975
5091
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
4976
|
-
fprintf(f, " val = vm_exec(ec,
|
5092
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
4977
5093
|
fprintf(f, " }\n");
|
4978
5094
|
}
|
4979
5095
|
}
|
@@ -5009,7 +5125,7 @@ switch (insn) {
|
|
5009
5125
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
5010
5126
|
fprintf(f, "\n");
|
5011
5127
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5012
|
-
if (
|
5128
|
+
if (true) {
|
5013
5129
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5014
5130
|
pc_moved_p = true;
|
5015
5131
|
}
|
@@ -5028,7 +5144,7 @@ switch (insn) {
|
|
5028
5144
|
}
|
5029
5145
|
fprintf(f, " {\n");
|
5030
5146
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
5031
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
5147
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
5032
5148
|
fprintf(f, "\n");
|
5033
5149
|
fprintf(f, " if (val == Qundef) {\n");
|
5034
5150
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -5052,8 +5168,8 @@ switch (insn) {
|
|
5052
5168
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
5053
5169
|
}
|
5054
5170
|
fprintf(f, "}\n");
|
5055
|
-
|
5056
|
-
|
5171
|
+
break;
|
5172
|
+
}
|
5057
5173
|
fprintf(f, "{\n");
|
5058
5174
|
{
|
5059
5175
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -5069,7 +5185,7 @@ switch (insn) {
|
|
5069
5185
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
5070
5186
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
5071
5187
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5072
|
-
if (
|
5188
|
+
if (false) {
|
5073
5189
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5074
5190
|
pc_moved_p = true;
|
5075
5191
|
}
|
@@ -5095,8 +5211,9 @@ switch (insn) {
|
|
5095
5211
|
}
|
5096
5212
|
fprintf(f, "}\n");
|
5097
5213
|
break;
|
5098
|
-
|
5099
|
-
|
5214
|
+
}
|
5215
|
+
case BIN(opt_ge): {
|
5216
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_ge))) {
|
5100
5217
|
{
|
5101
5218
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
5102
5219
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -5111,7 +5228,8 @@ switch (insn) {
|
|
5111
5228
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
5112
5229
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
5113
5230
|
)) {
|
5114
|
-
|
5231
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
5232
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
5115
5233
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
5116
5234
|
|
5117
5235
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -5128,7 +5246,7 @@ switch (insn) {
|
|
5128
5246
|
fprintf(f, " }\n");
|
5129
5247
|
|
5130
5248
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5131
|
-
if (
|
5249
|
+
if (true) {
|
5132
5250
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5133
5251
|
pc_moved_p = true;
|
5134
5252
|
}
|
@@ -5164,19 +5282,20 @@ switch (insn) {
|
|
5164
5282
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
5165
5283
|
|
5166
5284
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
5167
|
-
fprintf(f, "
|
5168
|
-
fprintf(f, "
|
5285
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
5286
|
+
fprintf(f, " calling.cc = cc;");
|
5287
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
5169
5288
|
}
|
5170
5289
|
else { // VM_METHOD_TYPE_ISEQ
|
5171
5290
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
5172
5291
|
if (iseq->body->catch_except_p) {
|
5173
5292
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
5174
|
-
fprintf(f, " val = vm_exec(ec,
|
5293
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
5175
5294
|
}
|
5176
5295
|
else {
|
5177
5296
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
5178
5297
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
5179
|
-
fprintf(f, " val = vm_exec(ec,
|
5298
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
5180
5299
|
fprintf(f, " }\n");
|
5181
5300
|
}
|
5182
5301
|
}
|
@@ -5212,7 +5331,7 @@ switch (insn) {
|
|
5212
5331
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
5213
5332
|
fprintf(f, "\n");
|
5214
5333
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5215
|
-
if (
|
5334
|
+
if (true) {
|
5216
5335
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5217
5336
|
pc_moved_p = true;
|
5218
5337
|
}
|
@@ -5231,7 +5350,7 @@ switch (insn) {
|
|
5231
5350
|
}
|
5232
5351
|
fprintf(f, " {\n");
|
5233
5352
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
5234
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
5353
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
5235
5354
|
fprintf(f, "\n");
|
5236
5355
|
fprintf(f, " if (val == Qundef) {\n");
|
5237
5356
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -5255,8 +5374,8 @@ switch (insn) {
|
|
5255
5374
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
5256
5375
|
}
|
5257
5376
|
fprintf(f, "}\n");
|
5258
|
-
|
5259
|
-
|
5377
|
+
break;
|
5378
|
+
}
|
5260
5379
|
fprintf(f, "{\n");
|
5261
5380
|
{
|
5262
5381
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -5272,7 +5391,7 @@ switch (insn) {
|
|
5272
5391
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
5273
5392
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
5274
5393
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5275
|
-
if (
|
5394
|
+
if (false) {
|
5276
5395
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5277
5396
|
pc_moved_p = true;
|
5278
5397
|
}
|
@@ -5298,8 +5417,9 @@ switch (insn) {
|
|
5298
5417
|
}
|
5299
5418
|
fprintf(f, "}\n");
|
5300
5419
|
break;
|
5301
|
-
|
5302
|
-
|
5420
|
+
}
|
5421
|
+
case BIN(opt_ltlt): {
|
5422
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_ltlt))) {
|
5303
5423
|
{
|
5304
5424
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
5305
5425
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -5314,7 +5434,8 @@ switch (insn) {
|
|
5314
5434
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
5315
5435
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
5316
5436
|
)) {
|
5317
|
-
|
5437
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
5438
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
5318
5439
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
5319
5440
|
|
5320
5441
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -5331,7 +5452,7 @@ switch (insn) {
|
|
5331
5452
|
fprintf(f, " }\n");
|
5332
5453
|
|
5333
5454
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5334
|
-
if (
|
5455
|
+
if (true) {
|
5335
5456
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5336
5457
|
pc_moved_p = true;
|
5337
5458
|
}
|
@@ -5367,19 +5488,20 @@ switch (insn) {
|
|
5367
5488
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
5368
5489
|
|
5369
5490
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
5370
|
-
fprintf(f, "
|
5371
|
-
fprintf(f, "
|
5491
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
5492
|
+
fprintf(f, " calling.cc = cc;");
|
5493
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
5372
5494
|
}
|
5373
5495
|
else { // VM_METHOD_TYPE_ISEQ
|
5374
5496
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
5375
5497
|
if (iseq->body->catch_except_p) {
|
5376
5498
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
5377
|
-
fprintf(f, " val = vm_exec(ec,
|
5499
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
5378
5500
|
}
|
5379
5501
|
else {
|
5380
5502
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
5381
5503
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
5382
|
-
fprintf(f, " val = vm_exec(ec,
|
5504
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
5383
5505
|
fprintf(f, " }\n");
|
5384
5506
|
}
|
5385
5507
|
}
|
@@ -5415,7 +5537,7 @@ switch (insn) {
|
|
5415
5537
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
5416
5538
|
fprintf(f, "\n");
|
5417
5539
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5418
|
-
if (
|
5540
|
+
if (true) {
|
5419
5541
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5420
5542
|
pc_moved_p = true;
|
5421
5543
|
}
|
@@ -5434,7 +5556,7 @@ switch (insn) {
|
|
5434
5556
|
}
|
5435
5557
|
fprintf(f, " {\n");
|
5436
5558
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
5437
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
5559
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
5438
5560
|
fprintf(f, "\n");
|
5439
5561
|
fprintf(f, " if (val == Qundef) {\n");
|
5440
5562
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -5458,8 +5580,8 @@ switch (insn) {
|
|
5458
5580
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
5459
5581
|
}
|
5460
5582
|
fprintf(f, "}\n");
|
5461
|
-
|
5462
|
-
|
5583
|
+
break;
|
5584
|
+
}
|
5463
5585
|
fprintf(f, "{\n");
|
5464
5586
|
{
|
5465
5587
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -5475,7 +5597,7 @@ switch (insn) {
|
|
5475
5597
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
5476
5598
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
5477
5599
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5478
|
-
if (
|
5600
|
+
if (true) {
|
5479
5601
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5480
5602
|
pc_moved_p = true;
|
5481
5603
|
}
|
@@ -5509,8 +5631,9 @@ switch (insn) {
|
|
5509
5631
|
}
|
5510
5632
|
fprintf(f, "}\n");
|
5511
5633
|
break;
|
5512
|
-
|
5513
|
-
|
5634
|
+
}
|
5635
|
+
case BIN(opt_and): {
|
5636
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_and))) {
|
5514
5637
|
{
|
5515
5638
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
5516
5639
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -5525,7 +5648,8 @@ switch (insn) {
|
|
5525
5648
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
5526
5649
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
5527
5650
|
)) {
|
5528
|
-
|
5651
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
5652
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
5529
5653
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
5530
5654
|
|
5531
5655
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -5542,7 +5666,7 @@ switch (insn) {
|
|
5542
5666
|
fprintf(f, " }\n");
|
5543
5667
|
|
5544
5668
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5545
|
-
if (
|
5669
|
+
if (true) {
|
5546
5670
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5547
5671
|
pc_moved_p = true;
|
5548
5672
|
}
|
@@ -5578,19 +5702,20 @@ switch (insn) {
|
|
5578
5702
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
5579
5703
|
|
5580
5704
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
5581
|
-
fprintf(f, "
|
5582
|
-
fprintf(f, "
|
5705
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
5706
|
+
fprintf(f, " calling.cc = cc;");
|
5707
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
5583
5708
|
}
|
5584
5709
|
else { // VM_METHOD_TYPE_ISEQ
|
5585
5710
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
5586
5711
|
if (iseq->body->catch_except_p) {
|
5587
5712
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
5588
|
-
fprintf(f, " val = vm_exec(ec,
|
5713
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
5589
5714
|
}
|
5590
5715
|
else {
|
5591
5716
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
5592
5717
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
5593
|
-
fprintf(f, " val = vm_exec(ec,
|
5718
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
5594
5719
|
fprintf(f, " }\n");
|
5595
5720
|
}
|
5596
5721
|
}
|
@@ -5626,7 +5751,7 @@ switch (insn) {
|
|
5626
5751
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
5627
5752
|
fprintf(f, "\n");
|
5628
5753
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5629
|
-
if (
|
5754
|
+
if (true) {
|
5630
5755
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5631
5756
|
pc_moved_p = true;
|
5632
5757
|
}
|
@@ -5645,7 +5770,7 @@ switch (insn) {
|
|
5645
5770
|
}
|
5646
5771
|
fprintf(f, " {\n");
|
5647
5772
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
5648
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
5773
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
5649
5774
|
fprintf(f, "\n");
|
5650
5775
|
fprintf(f, " if (val == Qundef) {\n");
|
5651
5776
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -5669,8 +5794,8 @@ switch (insn) {
|
|
5669
5794
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
5670
5795
|
}
|
5671
5796
|
fprintf(f, "}\n");
|
5672
|
-
|
5673
|
-
|
5797
|
+
break;
|
5798
|
+
}
|
5674
5799
|
fprintf(f, "{\n");
|
5675
5800
|
{
|
5676
5801
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -5686,7 +5811,7 @@ switch (insn) {
|
|
5686
5811
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
5687
5812
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
5688
5813
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5689
|
-
if (
|
5814
|
+
if (false) {
|
5690
5815
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5691
5816
|
pc_moved_p = true;
|
5692
5817
|
}
|
@@ -5712,8 +5837,9 @@ switch (insn) {
|
|
5712
5837
|
}
|
5713
5838
|
fprintf(f, "}\n");
|
5714
5839
|
break;
|
5715
|
-
|
5716
|
-
|
5840
|
+
}
|
5841
|
+
case BIN(opt_or): {
|
5842
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_or))) {
|
5717
5843
|
{
|
5718
5844
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
5719
5845
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -5728,7 +5854,8 @@ switch (insn) {
|
|
5728
5854
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
5729
5855
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
5730
5856
|
)) {
|
5731
|
-
|
5857
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
5858
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
5732
5859
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
5733
5860
|
|
5734
5861
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -5745,7 +5872,7 @@ switch (insn) {
|
|
5745
5872
|
fprintf(f, " }\n");
|
5746
5873
|
|
5747
5874
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5748
|
-
if (
|
5875
|
+
if (true) {
|
5749
5876
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5750
5877
|
pc_moved_p = true;
|
5751
5878
|
}
|
@@ -5781,19 +5908,20 @@ switch (insn) {
|
|
5781
5908
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
5782
5909
|
|
5783
5910
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
5784
|
-
fprintf(f, "
|
5785
|
-
fprintf(f, "
|
5911
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
5912
|
+
fprintf(f, " calling.cc = cc;");
|
5913
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
5786
5914
|
}
|
5787
5915
|
else { // VM_METHOD_TYPE_ISEQ
|
5788
5916
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
5789
5917
|
if (iseq->body->catch_except_p) {
|
5790
5918
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
5791
|
-
fprintf(f, " val = vm_exec(ec,
|
5919
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
5792
5920
|
}
|
5793
5921
|
else {
|
5794
5922
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
5795
5923
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
5796
|
-
fprintf(f, " val = vm_exec(ec,
|
5924
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
5797
5925
|
fprintf(f, " }\n");
|
5798
5926
|
}
|
5799
5927
|
}
|
@@ -5829,7 +5957,7 @@ switch (insn) {
|
|
5829
5957
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
5830
5958
|
fprintf(f, "\n");
|
5831
5959
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5832
|
-
if (
|
5960
|
+
if (true) {
|
5833
5961
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5834
5962
|
pc_moved_p = true;
|
5835
5963
|
}
|
@@ -5848,7 +5976,7 @@ switch (insn) {
|
|
5848
5976
|
}
|
5849
5977
|
fprintf(f, " {\n");
|
5850
5978
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
5851
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
5979
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
5852
5980
|
fprintf(f, "\n");
|
5853
5981
|
fprintf(f, " if (val == Qundef) {\n");
|
5854
5982
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -5872,8 +6000,8 @@ switch (insn) {
|
|
5872
6000
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
5873
6001
|
}
|
5874
6002
|
fprintf(f, "}\n");
|
5875
|
-
|
5876
|
-
|
6003
|
+
break;
|
6004
|
+
}
|
5877
6005
|
fprintf(f, "{\n");
|
5878
6006
|
{
|
5879
6007
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -5889,7 +6017,7 @@ switch (insn) {
|
|
5889
6017
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
5890
6018
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
5891
6019
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5892
|
-
if (
|
6020
|
+
if (false) {
|
5893
6021
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5894
6022
|
pc_moved_p = true;
|
5895
6023
|
}
|
@@ -5915,8 +6043,9 @@ switch (insn) {
|
|
5915
6043
|
}
|
5916
6044
|
fprintf(f, "}\n");
|
5917
6045
|
break;
|
5918
|
-
|
5919
|
-
|
6046
|
+
}
|
6047
|
+
case BIN(opt_aref): {
|
6048
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_aref))) {
|
5920
6049
|
{
|
5921
6050
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
5922
6051
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -5931,7 +6060,8 @@ switch (insn) {
|
|
5931
6060
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
5932
6061
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
5933
6062
|
)) {
|
5934
|
-
|
6063
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
6064
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
5935
6065
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
5936
6066
|
|
5937
6067
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -5948,7 +6078,7 @@ switch (insn) {
|
|
5948
6078
|
fprintf(f, " }\n");
|
5949
6079
|
|
5950
6080
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
5951
|
-
if (
|
6081
|
+
if (true) {
|
5952
6082
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
5953
6083
|
pc_moved_p = true;
|
5954
6084
|
}
|
@@ -5984,19 +6114,20 @@ switch (insn) {
|
|
5984
6114
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
5985
6115
|
|
5986
6116
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
5987
|
-
fprintf(f, "
|
5988
|
-
fprintf(f, "
|
6117
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
6118
|
+
fprintf(f, " calling.cc = cc;");
|
6119
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
5989
6120
|
}
|
5990
6121
|
else { // VM_METHOD_TYPE_ISEQ
|
5991
6122
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
5992
6123
|
if (iseq->body->catch_except_p) {
|
5993
6124
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
5994
|
-
fprintf(f, " val = vm_exec(ec,
|
6125
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
5995
6126
|
}
|
5996
6127
|
else {
|
5997
6128
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
5998
6129
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
5999
|
-
fprintf(f, " val = vm_exec(ec,
|
6130
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
6000
6131
|
fprintf(f, " }\n");
|
6001
6132
|
}
|
6002
6133
|
}
|
@@ -6032,7 +6163,7 @@ switch (insn) {
|
|
6032
6163
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
6033
6164
|
fprintf(f, "\n");
|
6034
6165
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6035
|
-
if (
|
6166
|
+
if (true) {
|
6036
6167
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6037
6168
|
pc_moved_p = true;
|
6038
6169
|
}
|
@@ -6051,7 +6182,7 @@ switch (insn) {
|
|
6051
6182
|
}
|
6052
6183
|
fprintf(f, " {\n");
|
6053
6184
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
6054
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
6185
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
6055
6186
|
fprintf(f, "\n");
|
6056
6187
|
fprintf(f, " if (val == Qundef) {\n");
|
6057
6188
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -6075,8 +6206,8 @@ switch (insn) {
|
|
6075
6206
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
6076
6207
|
}
|
6077
6208
|
fprintf(f, "}\n");
|
6078
|
-
|
6079
|
-
|
6209
|
+
break;
|
6210
|
+
}
|
6080
6211
|
fprintf(f, "{\n");
|
6081
6212
|
{
|
6082
6213
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -6092,7 +6223,7 @@ switch (insn) {
|
|
6092
6223
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
6093
6224
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
6094
6225
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6095
|
-
if (
|
6226
|
+
if (true) {
|
6096
6227
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6097
6228
|
pc_moved_p = true;
|
6098
6229
|
}
|
@@ -6126,8 +6257,9 @@ switch (insn) {
|
|
6126
6257
|
}
|
6127
6258
|
fprintf(f, "}\n");
|
6128
6259
|
break;
|
6129
|
-
|
6130
|
-
|
6260
|
+
}
|
6261
|
+
case BIN(opt_aset): {
|
6262
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_aset))) {
|
6131
6263
|
{
|
6132
6264
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
6133
6265
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -6142,7 +6274,8 @@ switch (insn) {
|
|
6142
6274
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
6143
6275
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
6144
6276
|
)) {
|
6145
|
-
|
6277
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
6278
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
6146
6279
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
6147
6280
|
|
6148
6281
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -6159,7 +6292,7 @@ switch (insn) {
|
|
6159
6292
|
fprintf(f, " }\n");
|
6160
6293
|
|
6161
6294
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6162
|
-
if (
|
6295
|
+
if (true) {
|
6163
6296
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6164
6297
|
pc_moved_p = true;
|
6165
6298
|
}
|
@@ -6195,19 +6328,20 @@ switch (insn) {
|
|
6195
6328
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
6196
6329
|
|
6197
6330
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
6198
|
-
fprintf(f, "
|
6199
|
-
fprintf(f, "
|
6331
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
6332
|
+
fprintf(f, " calling.cc = cc;");
|
6333
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
6200
6334
|
}
|
6201
6335
|
else { // VM_METHOD_TYPE_ISEQ
|
6202
6336
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
6203
6337
|
if (iseq->body->catch_except_p) {
|
6204
6338
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
6205
|
-
fprintf(f, " val = vm_exec(ec,
|
6339
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
6206
6340
|
}
|
6207
6341
|
else {
|
6208
6342
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
6209
6343
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
6210
|
-
fprintf(f, " val = vm_exec(ec,
|
6344
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
6211
6345
|
fprintf(f, " }\n");
|
6212
6346
|
}
|
6213
6347
|
}
|
@@ -6243,7 +6377,7 @@ switch (insn) {
|
|
6243
6377
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
6244
6378
|
fprintf(f, "\n");
|
6245
6379
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6246
|
-
if (
|
6380
|
+
if (true) {
|
6247
6381
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6248
6382
|
pc_moved_p = true;
|
6249
6383
|
}
|
@@ -6262,7 +6396,7 @@ switch (insn) {
|
|
6262
6396
|
}
|
6263
6397
|
fprintf(f, " {\n");
|
6264
6398
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
6265
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
6399
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
6266
6400
|
fprintf(f, "\n");
|
6267
6401
|
fprintf(f, " if (val == Qundef) {\n");
|
6268
6402
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -6286,8 +6420,8 @@ switch (insn) {
|
|
6286
6420
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
6287
6421
|
}
|
6288
6422
|
fprintf(f, "}\n");
|
6289
|
-
|
6290
|
-
|
6423
|
+
break;
|
6424
|
+
}
|
6291
6425
|
fprintf(f, "{\n");
|
6292
6426
|
{
|
6293
6427
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -6304,7 +6438,7 @@ switch (insn) {
|
|
6304
6438
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 2);
|
6305
6439
|
fprintf(f, " set = stack[%d];\n", b->stack_size - 1);
|
6306
6440
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6307
|
-
if (
|
6441
|
+
if (true) {
|
6308
6442
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6309
6443
|
pc_moved_p = true;
|
6310
6444
|
}
|
@@ -6338,7 +6472,8 @@ switch (insn) {
|
|
6338
6472
|
}
|
6339
6473
|
fprintf(f, "}\n");
|
6340
6474
|
break;
|
6341
|
-
|
6475
|
+
}
|
6476
|
+
case BIN(opt_aset_with): {
|
6342
6477
|
fprintf(f, "{\n");
|
6343
6478
|
{
|
6344
6479
|
MAYBE_UNUSED(VALUE key) = (VALUE)operands[0];
|
@@ -6358,7 +6493,7 @@ switch (insn) {
|
|
6358
6493
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
6359
6494
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
6360
6495
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6361
|
-
if (
|
6496
|
+
if (true) {
|
6362
6497
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6363
6498
|
pc_moved_p = true;
|
6364
6499
|
}
|
@@ -6400,7 +6535,8 @@ switch (insn) {
|
|
6400
6535
|
}
|
6401
6536
|
fprintf(f, "}\n");
|
6402
6537
|
break;
|
6403
|
-
|
6538
|
+
}
|
6539
|
+
case BIN(opt_aref_with): {
|
6404
6540
|
fprintf(f, "{\n");
|
6405
6541
|
{
|
6406
6542
|
MAYBE_UNUSED(VALUE key) = (VALUE)operands[0];
|
@@ -6419,7 +6555,7 @@ switch (insn) {
|
|
6419
6555
|
fprintf(f, "\n");
|
6420
6556
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
6421
6557
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6422
|
-
if (
|
6558
|
+
if (true) {
|
6423
6559
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6424
6560
|
pc_moved_p = true;
|
6425
6561
|
}
|
@@ -6456,8 +6592,9 @@ switch (insn) {
|
|
6456
6592
|
}
|
6457
6593
|
fprintf(f, "}\n");
|
6458
6594
|
break;
|
6459
|
-
|
6460
|
-
|
6595
|
+
}
|
6596
|
+
case BIN(opt_length): {
|
6597
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_length))) {
|
6461
6598
|
{
|
6462
6599
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
6463
6600
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -6472,7 +6609,8 @@ switch (insn) {
|
|
6472
6609
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
6473
6610
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
6474
6611
|
)) {
|
6475
|
-
|
6612
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
6613
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
6476
6614
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
6477
6615
|
|
6478
6616
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -6489,7 +6627,7 @@ switch (insn) {
|
|
6489
6627
|
fprintf(f, " }\n");
|
6490
6628
|
|
6491
6629
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6492
|
-
if (
|
6630
|
+
if (true) {
|
6493
6631
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6494
6632
|
pc_moved_p = true;
|
6495
6633
|
}
|
@@ -6525,19 +6663,20 @@ switch (insn) {
|
|
6525
6663
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
6526
6664
|
|
6527
6665
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
6528
|
-
fprintf(f, "
|
6529
|
-
fprintf(f, "
|
6666
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
6667
|
+
fprintf(f, " calling.cc = cc;");
|
6668
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
6530
6669
|
}
|
6531
6670
|
else { // VM_METHOD_TYPE_ISEQ
|
6532
6671
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
6533
6672
|
if (iseq->body->catch_except_p) {
|
6534
6673
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
6535
|
-
fprintf(f, " val = vm_exec(ec,
|
6674
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
6536
6675
|
}
|
6537
6676
|
else {
|
6538
6677
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
6539
6678
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
6540
|
-
fprintf(f, " val = vm_exec(ec,
|
6679
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
6541
6680
|
fprintf(f, " }\n");
|
6542
6681
|
}
|
6543
6682
|
}
|
@@ -6573,7 +6712,7 @@ switch (insn) {
|
|
6573
6712
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
6574
6713
|
fprintf(f, "\n");
|
6575
6714
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6576
|
-
if (
|
6715
|
+
if (true) {
|
6577
6716
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6578
6717
|
pc_moved_p = true;
|
6579
6718
|
}
|
@@ -6592,7 +6731,7 @@ switch (insn) {
|
|
6592
6731
|
}
|
6593
6732
|
fprintf(f, " {\n");
|
6594
6733
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
6595
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
6734
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
6596
6735
|
fprintf(f, "\n");
|
6597
6736
|
fprintf(f, " if (val == Qundef) {\n");
|
6598
6737
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -6616,8 +6755,8 @@ switch (insn) {
|
|
6616
6755
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
6617
6756
|
}
|
6618
6757
|
fprintf(f, "}\n");
|
6619
|
-
|
6620
|
-
|
6758
|
+
break;
|
6759
|
+
}
|
6621
6760
|
fprintf(f, "{\n");
|
6622
6761
|
{
|
6623
6762
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -6632,7 +6771,7 @@ switch (insn) {
|
|
6632
6771
|
fprintf(f, "\n");
|
6633
6772
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
6634
6773
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6635
|
-
if (
|
6774
|
+
if (false) {
|
6636
6775
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6637
6776
|
pc_moved_p = true;
|
6638
6777
|
}
|
@@ -6658,8 +6797,9 @@ switch (insn) {
|
|
6658
6797
|
}
|
6659
6798
|
fprintf(f, "}\n");
|
6660
6799
|
break;
|
6661
|
-
|
6662
|
-
|
6800
|
+
}
|
6801
|
+
case BIN(opt_size): {
|
6802
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_size))) {
|
6663
6803
|
{
|
6664
6804
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
6665
6805
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -6674,7 +6814,8 @@ switch (insn) {
|
|
6674
6814
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
6675
6815
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
6676
6816
|
)) {
|
6677
|
-
|
6817
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
6818
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
6678
6819
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
6679
6820
|
|
6680
6821
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -6691,7 +6832,7 @@ switch (insn) {
|
|
6691
6832
|
fprintf(f, " }\n");
|
6692
6833
|
|
6693
6834
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6694
|
-
if (
|
6835
|
+
if (true) {
|
6695
6836
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6696
6837
|
pc_moved_p = true;
|
6697
6838
|
}
|
@@ -6727,19 +6868,20 @@ switch (insn) {
|
|
6727
6868
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
6728
6869
|
|
6729
6870
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
6730
|
-
fprintf(f, "
|
6731
|
-
fprintf(f, "
|
6871
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
6872
|
+
fprintf(f, " calling.cc = cc;");
|
6873
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
6732
6874
|
}
|
6733
6875
|
else { // VM_METHOD_TYPE_ISEQ
|
6734
6876
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
6735
6877
|
if (iseq->body->catch_except_p) {
|
6736
6878
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
6737
|
-
fprintf(f, " val = vm_exec(ec,
|
6879
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
6738
6880
|
}
|
6739
6881
|
else {
|
6740
6882
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
6741
6883
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
6742
|
-
fprintf(f, " val = vm_exec(ec,
|
6884
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
6743
6885
|
fprintf(f, " }\n");
|
6744
6886
|
}
|
6745
6887
|
}
|
@@ -6775,7 +6917,7 @@ switch (insn) {
|
|
6775
6917
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
6776
6918
|
fprintf(f, "\n");
|
6777
6919
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6778
|
-
if (
|
6920
|
+
if (true) {
|
6779
6921
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6780
6922
|
pc_moved_p = true;
|
6781
6923
|
}
|
@@ -6794,7 +6936,7 @@ switch (insn) {
|
|
6794
6936
|
}
|
6795
6937
|
fprintf(f, " {\n");
|
6796
6938
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
6797
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
6939
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
6798
6940
|
fprintf(f, "\n");
|
6799
6941
|
fprintf(f, " if (val == Qundef) {\n");
|
6800
6942
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -6818,8 +6960,8 @@ switch (insn) {
|
|
6818
6960
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
6819
6961
|
}
|
6820
6962
|
fprintf(f, "}\n");
|
6821
|
-
|
6822
|
-
|
6963
|
+
break;
|
6964
|
+
}
|
6823
6965
|
fprintf(f, "{\n");
|
6824
6966
|
{
|
6825
6967
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -6834,7 +6976,7 @@ switch (insn) {
|
|
6834
6976
|
fprintf(f, "\n");
|
6835
6977
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
6836
6978
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6837
|
-
if (
|
6979
|
+
if (false) {
|
6838
6980
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6839
6981
|
pc_moved_p = true;
|
6840
6982
|
}
|
@@ -6860,8 +7002,9 @@ switch (insn) {
|
|
6860
7002
|
}
|
6861
7003
|
fprintf(f, "}\n");
|
6862
7004
|
break;
|
6863
|
-
|
6864
|
-
|
7005
|
+
}
|
7006
|
+
case BIN(opt_empty_p): {
|
7007
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_empty_p))) {
|
6865
7008
|
{
|
6866
7009
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
6867
7010
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -6876,7 +7019,8 @@ switch (insn) {
|
|
6876
7019
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
6877
7020
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
6878
7021
|
)) {
|
6879
|
-
|
7022
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
7023
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
6880
7024
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
6881
7025
|
|
6882
7026
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -6893,7 +7037,7 @@ switch (insn) {
|
|
6893
7037
|
fprintf(f, " }\n");
|
6894
7038
|
|
6895
7039
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6896
|
-
if (
|
7040
|
+
if (true) {
|
6897
7041
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6898
7042
|
pc_moved_p = true;
|
6899
7043
|
}
|
@@ -6929,19 +7073,20 @@ switch (insn) {
|
|
6929
7073
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
6930
7074
|
|
6931
7075
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
6932
|
-
fprintf(f, "
|
6933
|
-
fprintf(f, "
|
7076
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
7077
|
+
fprintf(f, " calling.cc = cc;");
|
7078
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
6934
7079
|
}
|
6935
7080
|
else { // VM_METHOD_TYPE_ISEQ
|
6936
7081
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
6937
7082
|
if (iseq->body->catch_except_p) {
|
6938
7083
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
6939
|
-
fprintf(f, " val = vm_exec(ec,
|
7084
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
6940
7085
|
}
|
6941
7086
|
else {
|
6942
7087
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
6943
7088
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
6944
|
-
fprintf(f, " val = vm_exec(ec,
|
7089
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
6945
7090
|
fprintf(f, " }\n");
|
6946
7091
|
}
|
6947
7092
|
}
|
@@ -6977,7 +7122,7 @@ switch (insn) {
|
|
6977
7122
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
6978
7123
|
fprintf(f, "\n");
|
6979
7124
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
6980
|
-
if (
|
7125
|
+
if (true) {
|
6981
7126
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
6982
7127
|
pc_moved_p = true;
|
6983
7128
|
}
|
@@ -6996,7 +7141,7 @@ switch (insn) {
|
|
6996
7141
|
}
|
6997
7142
|
fprintf(f, " {\n");
|
6998
7143
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
6999
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
7144
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
7000
7145
|
fprintf(f, "\n");
|
7001
7146
|
fprintf(f, " if (val == Qundef) {\n");
|
7002
7147
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -7020,8 +7165,8 @@ switch (insn) {
|
|
7020
7165
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
7021
7166
|
}
|
7022
7167
|
fprintf(f, "}\n");
|
7023
|
-
|
7024
|
-
|
7168
|
+
break;
|
7169
|
+
}
|
7025
7170
|
fprintf(f, "{\n");
|
7026
7171
|
{
|
7027
7172
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -7036,7 +7181,7 @@ switch (insn) {
|
|
7036
7181
|
fprintf(f, "\n");
|
7037
7182
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
7038
7183
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7039
|
-
if (
|
7184
|
+
if (false) {
|
7040
7185
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7041
7186
|
pc_moved_p = true;
|
7042
7187
|
}
|
@@ -7062,8 +7207,9 @@ switch (insn) {
|
|
7062
7207
|
}
|
7063
7208
|
fprintf(f, "}\n");
|
7064
7209
|
break;
|
7065
|
-
|
7066
|
-
|
7210
|
+
}
|
7211
|
+
case BIN(opt_succ): {
|
7212
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_succ))) {
|
7067
7213
|
{
|
7068
7214
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
7069
7215
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -7078,7 +7224,8 @@ switch (insn) {
|
|
7078
7224
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
7079
7225
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
7080
7226
|
)) {
|
7081
|
-
|
7227
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
7228
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
7082
7229
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
7083
7230
|
|
7084
7231
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -7095,7 +7242,7 @@ switch (insn) {
|
|
7095
7242
|
fprintf(f, " }\n");
|
7096
7243
|
|
7097
7244
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7098
|
-
if (
|
7245
|
+
if (true) {
|
7099
7246
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7100
7247
|
pc_moved_p = true;
|
7101
7248
|
}
|
@@ -7131,19 +7278,20 @@ switch (insn) {
|
|
7131
7278
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
7132
7279
|
|
7133
7280
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
7134
|
-
fprintf(f, "
|
7135
|
-
fprintf(f, "
|
7281
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
7282
|
+
fprintf(f, " calling.cc = cc;");
|
7283
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
7136
7284
|
}
|
7137
7285
|
else { // VM_METHOD_TYPE_ISEQ
|
7138
7286
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
7139
7287
|
if (iseq->body->catch_except_p) {
|
7140
7288
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
7141
|
-
fprintf(f, " val = vm_exec(ec,
|
7289
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
7142
7290
|
}
|
7143
7291
|
else {
|
7144
7292
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
7145
7293
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
7146
|
-
fprintf(f, " val = vm_exec(ec,
|
7294
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
7147
7295
|
fprintf(f, " }\n");
|
7148
7296
|
}
|
7149
7297
|
}
|
@@ -7179,7 +7327,7 @@ switch (insn) {
|
|
7179
7327
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
7180
7328
|
fprintf(f, "\n");
|
7181
7329
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7182
|
-
if (
|
7330
|
+
if (true) {
|
7183
7331
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7184
7332
|
pc_moved_p = true;
|
7185
7333
|
}
|
@@ -7198,7 +7346,7 @@ switch (insn) {
|
|
7198
7346
|
}
|
7199
7347
|
fprintf(f, " {\n");
|
7200
7348
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
7201
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
7349
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
7202
7350
|
fprintf(f, "\n");
|
7203
7351
|
fprintf(f, " if (val == Qundef) {\n");
|
7204
7352
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -7222,8 +7370,8 @@ switch (insn) {
|
|
7222
7370
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
7223
7371
|
}
|
7224
7372
|
fprintf(f, "}\n");
|
7225
|
-
|
7226
|
-
|
7373
|
+
break;
|
7374
|
+
}
|
7227
7375
|
fprintf(f, "{\n");
|
7228
7376
|
{
|
7229
7377
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -7238,7 +7386,7 @@ switch (insn) {
|
|
7238
7386
|
fprintf(f, "\n");
|
7239
7387
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
7240
7388
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7241
|
-
if (
|
7389
|
+
if (false) {
|
7242
7390
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7243
7391
|
pc_moved_p = true;
|
7244
7392
|
}
|
@@ -7264,8 +7412,9 @@ switch (insn) {
|
|
7264
7412
|
}
|
7265
7413
|
fprintf(f, "}\n");
|
7266
7414
|
break;
|
7267
|
-
|
7268
|
-
|
7415
|
+
}
|
7416
|
+
case BIN(opt_not): {
|
7417
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_not))) {
|
7269
7418
|
{
|
7270
7419
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
7271
7420
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -7280,7 +7429,8 @@ switch (insn) {
|
|
7280
7429
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
7281
7430
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
7282
7431
|
)) {
|
7283
|
-
|
7432
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
7433
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
7284
7434
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
7285
7435
|
|
7286
7436
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -7297,7 +7447,7 @@ switch (insn) {
|
|
7297
7447
|
fprintf(f, " }\n");
|
7298
7448
|
|
7299
7449
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7300
|
-
if (
|
7450
|
+
if (true) {
|
7301
7451
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7302
7452
|
pc_moved_p = true;
|
7303
7453
|
}
|
@@ -7333,19 +7483,20 @@ switch (insn) {
|
|
7333
7483
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
7334
7484
|
|
7335
7485
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
7336
|
-
fprintf(f, "
|
7337
|
-
fprintf(f, "
|
7486
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
7487
|
+
fprintf(f, " calling.cc = cc;");
|
7488
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
7338
7489
|
}
|
7339
7490
|
else { // VM_METHOD_TYPE_ISEQ
|
7340
7491
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
7341
7492
|
if (iseq->body->catch_except_p) {
|
7342
7493
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
7343
|
-
fprintf(f, " val = vm_exec(ec,
|
7494
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
7344
7495
|
}
|
7345
7496
|
else {
|
7346
7497
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
7347
7498
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
7348
|
-
fprintf(f, " val = vm_exec(ec,
|
7499
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
7349
7500
|
fprintf(f, " }\n");
|
7350
7501
|
}
|
7351
7502
|
}
|
@@ -7381,7 +7532,7 @@ switch (insn) {
|
|
7381
7532
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
7382
7533
|
fprintf(f, "\n");
|
7383
7534
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7384
|
-
if (
|
7535
|
+
if (true) {
|
7385
7536
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7386
7537
|
pc_moved_p = true;
|
7387
7538
|
}
|
@@ -7400,7 +7551,7 @@ switch (insn) {
|
|
7400
7551
|
}
|
7401
7552
|
fprintf(f, " {\n");
|
7402
7553
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
7403
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
7554
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
7404
7555
|
fprintf(f, "\n");
|
7405
7556
|
fprintf(f, " if (val == Qundef) {\n");
|
7406
7557
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -7424,8 +7575,8 @@ switch (insn) {
|
|
7424
7575
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
7425
7576
|
}
|
7426
7577
|
fprintf(f, "}\n");
|
7427
|
-
|
7428
|
-
|
7578
|
+
break;
|
7579
|
+
}
|
7429
7580
|
fprintf(f, "{\n");
|
7430
7581
|
{
|
7431
7582
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -7440,7 +7591,7 @@ switch (insn) {
|
|
7440
7591
|
fprintf(f, "\n");
|
7441
7592
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
7442
7593
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7443
|
-
if (
|
7594
|
+
if (false) {
|
7444
7595
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7445
7596
|
pc_moved_p = true;
|
7446
7597
|
}
|
@@ -7466,8 +7617,9 @@ switch (insn) {
|
|
7466
7617
|
}
|
7467
7618
|
fprintf(f, "}\n");
|
7468
7619
|
break;
|
7469
|
-
|
7470
|
-
|
7620
|
+
}
|
7621
|
+
case BIN(opt_regexpmatch2): {
|
7622
|
+
if (has_cache_for_send(captured_cc_entries(status)[call_data_index((CALL_DATA)operands[0], body)], BIN(opt_regexpmatch2))) {
|
7471
7623
|
{
|
7472
7624
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
7473
7625
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
@@ -7482,7 +7634,8 @@ switch (insn) {
|
|
7482
7634
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))
|
7483
7635
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL))
|
7484
7636
|
)) {
|
7485
|
-
|
7637
|
+
const bool cfunc_debug = false; // Set true when you want to see inlined cfunc
|
7638
|
+
if (cfunc_debug && vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC)
|
7486
7639
|
fprintf(stderr, " * %s\n", rb_id2name(vm_ci_mid(ci)));
|
7487
7640
|
|
7488
7641
|
int sp_inc = (int)sp_inc_of_sendish(ci);
|
@@ -7499,7 +7652,7 @@ switch (insn) {
|
|
7499
7652
|
fprintf(f, " }\n");
|
7500
7653
|
|
7501
7654
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7502
|
-
if (
|
7655
|
+
if (true) {
|
7503
7656
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7504
7657
|
pc_moved_p = true;
|
7505
7658
|
}
|
@@ -7535,19 +7688,20 @@ switch (insn) {
|
|
7535
7688
|
fprintf(f, " calling.argc = %d;\n", vm_ci_argc(ci));
|
7536
7689
|
|
7537
7690
|
if (vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_CFUNC) {
|
7538
|
-
fprintf(f, "
|
7539
|
-
fprintf(f, "
|
7691
|
+
fprintf(f, " calling.ci = (CALL_INFO)0x%"PRIxVALUE";\n", (VALUE)ci); // creating local cd here because operand's cd->cc may not be the same as inlined cc.
|
7692
|
+
fprintf(f, " calling.cc = cc;");
|
7693
|
+
fprintf(f, " val = vm_call_cfunc_with_frame(ec, reg_cfp, &calling);\n");
|
7540
7694
|
}
|
7541
7695
|
else { // VM_METHOD_TYPE_ISEQ
|
7542
7696
|
fprintf(f, " vm_call_iseq_setup_normal(ec, reg_cfp, &calling, cc_cme, 0, %d, %d);\n", iseq->body->param.size, iseq->body->local_table_size);
|
7543
7697
|
if (iseq->body->catch_except_p) {
|
7544
7698
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n");
|
7545
|
-
fprintf(f, " val = vm_exec(ec,
|
7699
|
+
fprintf(f, " val = vm_exec(ec, true);\n");
|
7546
7700
|
}
|
7547
7701
|
else {
|
7548
7702
|
fprintf(f, " if ((val = mjit_exec(ec)) == Qundef) {\n");
|
7549
7703
|
fprintf(f, " VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH);\n"); // This is vm_call0_body's code after vm_call_iseq_setup
|
7550
|
-
fprintf(f, " val = vm_exec(ec,
|
7704
|
+
fprintf(f, " val = vm_exec(ec, false);\n");
|
7551
7705
|
fprintf(f, " }\n");
|
7552
7706
|
}
|
7553
7707
|
}
|
@@ -7583,7 +7737,7 @@ switch (insn) {
|
|
7583
7737
|
comment_id(f, vm_ci_mid(((CALL_DATA)operands[0])->ci));
|
7584
7738
|
fprintf(f, "\n");
|
7585
7739
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7586
|
-
if (
|
7740
|
+
if (true) {
|
7587
7741
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7588
7742
|
pc_moved_p = true;
|
7589
7743
|
}
|
@@ -7602,7 +7756,7 @@ switch (insn) {
|
|
7602
7756
|
}
|
7603
7757
|
fprintf(f, " {\n");
|
7604
7758
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
7605
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh,
|
7759
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);\n");
|
7606
7760
|
fprintf(f, "\n");
|
7607
7761
|
fprintf(f, " if (val == Qundef) {\n");
|
7608
7762
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
@@ -7626,8 +7780,8 @@ switch (insn) {
|
|
7626
7780
|
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
7627
7781
|
}
|
7628
7782
|
fprintf(f, "}\n");
|
7629
|
-
|
7630
|
-
|
7783
|
+
break;
|
7784
|
+
}
|
7631
7785
|
fprintf(f, "{\n");
|
7632
7786
|
{
|
7633
7787
|
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
@@ -7643,7 +7797,7 @@ switch (insn) {
|
|
7643
7797
|
fprintf(f, " obj2 = stack[%d];\n", b->stack_size - 2);
|
7644
7798
|
fprintf(f, " obj1 = stack[%d];\n", b->stack_size - 1);
|
7645
7799
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7646
|
-
if (
|
7800
|
+
if (true) {
|
7647
7801
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7648
7802
|
pc_moved_p = true;
|
7649
7803
|
}
|
@@ -7677,8 +7831,8 @@ switch (insn) {
|
|
7677
7831
|
}
|
7678
7832
|
fprintf(f, "}\n");
|
7679
7833
|
break;
|
7680
|
-
|
7681
|
-
|
7834
|
+
}
|
7835
|
+
case BIN(invokebuiltin): {
|
7682
7836
|
RB_BUILTIN bf = (RB_BUILTIN)operands[0];
|
7683
7837
|
rb_snum_t sp_inc = attr_sp_inc_invokebuiltin(bf);
|
7684
7838
|
unsigned sp = b->stack_size + (unsigned)sp_inc;
|
@@ -7694,7 +7848,6 @@ switch (insn) {
|
|
7694
7848
|
b->stack_size = sp;
|
7695
7849
|
break;
|
7696
7850
|
}
|
7697
|
-
}
|
7698
7851
|
fprintf(f, "{\n");
|
7699
7852
|
{
|
7700
7853
|
MAYBE_UNUSED(RB_BUILTIN bf) = (RB_BUILTIN)operands[0];
|
@@ -7707,7 +7860,7 @@ switch (insn) {
|
|
7707
7860
|
fprintf(f, " bf = (RB_BUILTIN)0x%"PRIxVALUE";", operands[0]);
|
7708
7861
|
fprintf(f, "\n");
|
7709
7862
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7710
|
-
if (
|
7863
|
+
if (true) {
|
7711
7864
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7712
7865
|
pc_moved_p = true;
|
7713
7866
|
}
|
@@ -7733,8 +7886,8 @@ switch (insn) {
|
|
7733
7886
|
}
|
7734
7887
|
fprintf(f, "}\n");
|
7735
7888
|
break;
|
7736
|
-
|
7737
|
-
|
7889
|
+
}
|
7890
|
+
case BIN(opt_invokebuiltin_delegate): {
|
7738
7891
|
RB_BUILTIN bf = (RB_BUILTIN)operands[0];
|
7739
7892
|
rb_num_t index = (rb_num_t)operands[1];
|
7740
7893
|
rb_snum_t sp_inc = attr_sp_inc_opt_invokebuiltin_delegate(bf, index);
|
@@ -7751,7 +7904,6 @@ switch (insn) {
|
|
7751
7904
|
b->stack_size = sp;
|
7752
7905
|
break;
|
7753
7906
|
}
|
7754
|
-
}
|
7755
7907
|
fprintf(f, "{\n");
|
7756
7908
|
{
|
7757
7909
|
MAYBE_UNUSED(RB_BUILTIN bf) = (RB_BUILTIN)operands[0];
|
@@ -7768,7 +7920,7 @@ switch (insn) {
|
|
7768
7920
|
fprintf(f, " index = (rb_num_t)0x%"PRIxVALUE";", operands[1]);
|
7769
7921
|
fprintf(f, "\n");
|
7770
7922
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7771
|
-
if (
|
7923
|
+
if (true) {
|
7772
7924
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7773
7925
|
pc_moved_p = true;
|
7774
7926
|
}
|
@@ -7793,8 +7945,8 @@ switch (insn) {
|
|
7793
7945
|
}
|
7794
7946
|
fprintf(f, "}\n");
|
7795
7947
|
break;
|
7796
|
-
|
7797
|
-
|
7948
|
+
}
|
7949
|
+
case BIN(opt_invokebuiltin_delegate_leave): {
|
7798
7950
|
RB_BUILTIN bf = (RB_BUILTIN)operands[0];
|
7799
7951
|
rb_num_t index = (rb_num_t)operands[1];
|
7800
7952
|
rb_snum_t sp_inc = attr_sp_inc_opt_invokebuiltin_delegate_leave(bf, index);
|
@@ -7809,20 +7961,19 @@ switch (insn) {
|
|
7809
7961
|
fprintf(f, " stack[%u] = val;\n", sp - 1);
|
7810
7962
|
fprintf(f, "}\n");
|
7811
7963
|
}
|
7812
|
-
|
7813
|
-
|
7814
|
-
|
7815
|
-
|
7816
|
-
|
7817
|
-
|
7818
|
-
|
7819
|
-
|
7820
|
-
}
|
7821
|
-
fprintf(f, " return stack[0];\n");
|
7822
|
-
b->stack_size += attr_sp_inc_opt_invokebuiltin_delegate_leave(bf, index);
|
7823
|
-
b->finish_p = TRUE;
|
7824
|
-
break;
|
7964
|
+
if (status->inlined_iseqs != NULL) { // the current ISeq is NOT being inlined
|
7965
|
+
fprintf(f, " if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(ec))) {\n");
|
7966
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
7967
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
7968
|
+
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_leave);\n");
|
7969
|
+
fprintf(f, " goto cancel;\n");
|
7970
|
+
fprintf(f, " }\n");
|
7971
|
+
fprintf(f, " ec->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(reg_cfp);\n"); // vm_pop_frame
|
7825
7972
|
}
|
7973
|
+
fprintf(f, " return stack[0];\n");
|
7974
|
+
b->stack_size += attr_sp_inc_opt_invokebuiltin_delegate_leave(bf, index);
|
7975
|
+
b->finish_p = TRUE;
|
7976
|
+
break;
|
7826
7977
|
fprintf(f, "{\n");
|
7827
7978
|
{
|
7828
7979
|
MAYBE_UNUSED(RB_BUILTIN bf) = (RB_BUILTIN)operands[0];
|
@@ -7839,7 +7990,7 @@ switch (insn) {
|
|
7839
7990
|
fprintf(f, " index = (rb_num_t)0x%"PRIxVALUE";", operands[1]);
|
7840
7991
|
fprintf(f, "\n");
|
7841
7992
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7842
|
-
if (
|
7993
|
+
if (true) {
|
7843
7994
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7844
7995
|
pc_moved_p = true;
|
7845
7996
|
}
|
@@ -7884,7 +8035,8 @@ switch (insn) {
|
|
7884
8035
|
fprintf(f, "}\n");
|
7885
8036
|
b->finish_p = TRUE;
|
7886
8037
|
break;
|
7887
|
-
|
8038
|
+
}
|
8039
|
+
case BIN(getlocal_WC_0): {
|
7888
8040
|
fprintf(f, "{\n");
|
7889
8041
|
{
|
7890
8042
|
MAYBE_UNUSED(lindex_t idx) = (lindex_t)operands[0];
|
@@ -7899,7 +8051,7 @@ switch (insn) {
|
|
7899
8051
|
fprintf(f, " idx = (lindex_t)0x%"PRIxVALUE";", operands[0]);
|
7900
8052
|
fprintf(f, "\n");
|
7901
8053
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7902
|
-
if (
|
8054
|
+
if (false) {
|
7903
8055
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7904
8056
|
pc_moved_p = true;
|
7905
8057
|
}
|
@@ -7918,7 +8070,8 @@ switch (insn) {
|
|
7918
8070
|
}
|
7919
8071
|
fprintf(f, "}\n");
|
7920
8072
|
break;
|
7921
|
-
|
8073
|
+
}
|
8074
|
+
case BIN(getlocal_WC_1): {
|
7922
8075
|
fprintf(f, "{\n");
|
7923
8076
|
{
|
7924
8077
|
MAYBE_UNUSED(lindex_t idx) = (lindex_t)operands[0];
|
@@ -7933,7 +8086,7 @@ switch (insn) {
|
|
7933
8086
|
fprintf(f, " idx = (lindex_t)0x%"PRIxVALUE";", operands[0]);
|
7934
8087
|
fprintf(f, "\n");
|
7935
8088
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7936
|
-
if (
|
8089
|
+
if (false) {
|
7937
8090
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7938
8091
|
pc_moved_p = true;
|
7939
8092
|
}
|
@@ -7952,7 +8105,8 @@ switch (insn) {
|
|
7952
8105
|
}
|
7953
8106
|
fprintf(f, "}\n");
|
7954
8107
|
break;
|
7955
|
-
|
8108
|
+
}
|
8109
|
+
case BIN(setlocal_WC_0): {
|
7956
8110
|
fprintf(f, "{\n");
|
7957
8111
|
{
|
7958
8112
|
MAYBE_UNUSED(lindex_t idx) = (lindex_t)operands[0];
|
@@ -7968,7 +8122,7 @@ switch (insn) {
|
|
7968
8122
|
fprintf(f, "\n");
|
7969
8123
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
7970
8124
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
7971
|
-
if (
|
8125
|
+
if (false) {
|
7972
8126
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
7973
8127
|
pc_moved_p = true;
|
7974
8128
|
}
|
@@ -7986,7 +8140,8 @@ switch (insn) {
|
|
7986
8140
|
}
|
7987
8141
|
fprintf(f, "}\n");
|
7988
8142
|
break;
|
7989
|
-
|
8143
|
+
}
|
8144
|
+
case BIN(setlocal_WC_1): {
|
7990
8145
|
fprintf(f, "{\n");
|
7991
8146
|
{
|
7992
8147
|
MAYBE_UNUSED(lindex_t idx) = (lindex_t)operands[0];
|
@@ -8002,7 +8157,7 @@ switch (insn) {
|
|
8002
8157
|
fprintf(f, "\n");
|
8003
8158
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
8004
8159
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
8005
|
-
if (
|
8160
|
+
if (false) {
|
8006
8161
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
8007
8162
|
pc_moved_p = true;
|
8008
8163
|
}
|
@@ -8020,7 +8175,8 @@ switch (insn) {
|
|
8020
8175
|
}
|
8021
8176
|
fprintf(f, "}\n");
|
8022
8177
|
break;
|
8023
|
-
|
8178
|
+
}
|
8179
|
+
case BIN(putobject_INT2FIX_0_): {
|
8024
8180
|
fprintf(f, "{\n");
|
8025
8181
|
{
|
8026
8182
|
if (status->local_stack_p) {
|
@@ -8030,7 +8186,7 @@ switch (insn) {
|
|
8030
8186
|
|
8031
8187
|
fprintf(f, " val = INT2FIX(0);\n");
|
8032
8188
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
8033
|
-
if (
|
8189
|
+
if (false) {
|
8034
8190
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
8035
8191
|
pc_moved_p = true;
|
8036
8192
|
}
|
@@ -8047,7 +8203,8 @@ switch (insn) {
|
|
8047
8203
|
}
|
8048
8204
|
fprintf(f, "}\n");
|
8049
8205
|
break;
|
8050
|
-
|
8206
|
+
}
|
8207
|
+
case BIN(putobject_INT2FIX_1_): {
|
8051
8208
|
fprintf(f, "{\n");
|
8052
8209
|
{
|
8053
8210
|
if (status->local_stack_p) {
|
@@ -8057,7 +8214,7 @@ switch (insn) {
|
|
8057
8214
|
|
8058
8215
|
fprintf(f, " val = INT2FIX(1);\n");
|
8059
8216
|
MAYBE_UNUSED(bool pc_moved_p) = false;
|
8060
|
-
if (
|
8217
|
+
if (false) {
|
8061
8218
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
8062
8219
|
pc_moved_p = true;
|
8063
8220
|
}
|
@@ -8074,6 +8231,7 @@ switch (insn) {
|
|
8074
8231
|
}
|
8075
8232
|
fprintf(f, "}\n");
|
8076
8233
|
break;
|
8234
|
+
}
|
8077
8235
|
default:
|
8078
8236
|
if (mjit_opts.warnings || mjit_opts.verbose)
|
8079
8237
|
fprintf(stderr, "MJIT warning: Skipped to compile unsupported instruction: %s\n", insn_name(insn));
|