debase-ruby_core_source 0.10.7 → 0.10.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/Rakefile +6 -3
- data/debase-ruby_core_source.gemspec +2 -1
- data/lib/debase/ruby_core_source.rb +0 -1
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/addr2line.h +0 -0
- data/lib/debase/ruby_core_source/ruby-2.7.0-p0/builtin.h +78 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/build_assert/build_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/check_type/check_type.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/container_of/container_of.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/list/list.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/str/str.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/constant.h +0 -4
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/debug_counter.h +21 -9
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/dln.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/encindex.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/eval_intern.h +1 -3
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/gc.h +2 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/hrtime.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/id.h +1 -3
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/id_table.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/insns.inc +6 -2
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/insns_info.inc +1471 -1888
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/internal.h +106 -91
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/iseq.h +5 -5
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/known_errors.inc +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/method.h +1 -4
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/mjit.h +3 -5
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/mjit_compile.inc +768 -872
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/node.h +4 -11
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/node_name.inc +0 -2
- data/lib/debase/ruby_core_source/ruby-2.7.0-p0/opt_sc.inc +109 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/optinsn.inc +0 -0
- data/lib/debase/ruby_core_source/ruby-2.7.0-p0/optunifs.inc +43 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/parse.h +1 -1
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/probes_helper.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/regenc.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/regint.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/regparse.h +0 -0
- data/lib/debase/ruby_core_source/ruby-2.7.0-p0/revision.h +2 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ruby_assert.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ruby_atomic.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/siphash.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/symbol.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/thread_pthread.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/thread_win32.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/timev.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/transcode_data.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/transient_heap.h +0 -0
- data/lib/debase/ruby_core_source/ruby-2.7.0-p0/variable.h +9 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/version.h +4 -4
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm.inc +604 -407
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_call_iseq_optimized.inc +49 -49
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_core.h +42 -29
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_debug.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_exec.h +0 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_insnhelper.h +16 -4
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_opts.h +2 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vmtc.inc +6 -2
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/addr2line.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/builtin.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/list/list.h +788 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/str/str.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/constant.h +55 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/debug_counter.h +457 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/dln.h +36 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/encindex.h +70 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/eval_intern.h +323 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/gc.h +140 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/hrtime.h +168 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/id.h +290 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/id_table.h +36 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/insns.inc +249 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/insns_info.inc +8983 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal.h +107 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/array.h +119 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/bignum.h +246 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/bits.h +566 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/class.h +174 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compar.h +50 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compile.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compilers.h +108 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/complex.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/cont.h +25 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/dir.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enc.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/encoding.h +28 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enum.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enumerator.h +22 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/error.h +124 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/eval.h +33 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/file.h +39 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/fixnum.h +185 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/gc.h +161 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/hash.h +241 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/imemo.h +243 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/inits.h +51 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/io.h +35 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/load.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/loadpath.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/math.h +24 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/missing.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/numeric.h +255 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/object.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/parse.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/proc.h +33 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/process.h +136 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/random.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/range.h +41 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/rational.h +71 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/re.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/sanitizers.h +191 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/scheduler.h +44 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/serial.h +24 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/signal.h +22 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/static_assert.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/string.h +140 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/struct.h +154 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/symbol.h +41 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/thread.h +54 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/time.h +35 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/transcode.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/util.h +31 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/variable.h +84 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/vm.h +136 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/warnings.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/iseq.h +305 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/known_errors.inc +791 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/method.h +245 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/mjit.h +220 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/mjit_compile.inc +8240 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/node.h +484 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/node_name.inc +210 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/opt_sc.inc +0 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/optinsn.inc +128 -0
- data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/optunifs.inc +0 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/parse.h +211 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/probes_helper.h +44 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ractor_core.h +343 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/regenc.h +254 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/regint.h +938 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/regparse.h +370 -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-p0/ruby_assert.h +15 -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-p0/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/symbol.h +119 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/thread_pthread.h +115 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/thread_win32.h +61 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/timev.h +57 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/transcode_data.h +138 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/transient_heap.h +65 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/variable.h +22 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/version.h +89 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm.inc +5355 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_call_iseq_optimized.inc +244 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_callinfo.h +456 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_core.h +2023 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_debug.h +116 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_exec.h +196 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_insnhelper.h +257 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_opts.h +73 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_sync.h +136 -0
- data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vmtc.inc +243 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +181 -57
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/revision.h +0 -2
|
@@ -116,6 +116,7 @@ struct iseq_compile_data {
|
|
|
116
116
|
unsigned int ci_kw_index;
|
|
117
117
|
const rb_compile_option_t *option;
|
|
118
118
|
struct rb_id_table *ivar_cache_table;
|
|
119
|
+
const struct rb_builtin_function *builtin_function_table;
|
|
119
120
|
#if OPT_SUPPORT_JOKE
|
|
120
121
|
st_table *labels_table;
|
|
121
122
|
#endif
|
|
@@ -155,6 +156,7 @@ iseq_imemo_alloc(void)
|
|
|
155
156
|
VALUE rb_iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt);
|
|
156
157
|
void rb_ibf_load_iseq_complete(rb_iseq_t *iseq);
|
|
157
158
|
const rb_iseq_t *rb_iseq_ibf_load(VALUE str);
|
|
159
|
+
const rb_iseq_t *rb_iseq_ibf_load_bytes(const char *cstr, size_t);
|
|
158
160
|
VALUE rb_iseq_ibf_load_extra_data(VALUE str);
|
|
159
161
|
void rb_iseq_init_trace(rb_iseq_t *iseq);
|
|
160
162
|
int rb_iseq_add_local_tracepoint_recursively(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line);
|
|
@@ -170,7 +172,6 @@ RUBY_SYMBOL_EXPORT_BEGIN
|
|
|
170
172
|
/* compile.c */
|
|
171
173
|
VALUE rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node);
|
|
172
174
|
VALUE rb_iseq_compile_callback(rb_iseq_t *iseq, const struct rb_iseq_new_with_callback_callback_func * ifunc);
|
|
173
|
-
int rb_iseq_translate_threaded_code(rb_iseq_t *iseq);
|
|
174
175
|
VALUE *rb_iseq_original_iseq(const rb_iseq_t *iseq);
|
|
175
176
|
void rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc,
|
|
176
177
|
VALUE locals, VALUE args,
|
|
@@ -180,13 +181,12 @@ void rb_iseq_mark_insn_storage(struct iseq_compile_data_storage *arena);
|
|
|
180
181
|
/* iseq.c */
|
|
181
182
|
VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
|
|
182
183
|
VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
|
|
183
|
-
struct st_table *ruby_insn_make_insn_table(void);
|
|
184
184
|
unsigned int rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos);
|
|
185
185
|
void rb_iseq_trace_set(const rb_iseq_t *iseq, rb_event_flag_t turnon_events);
|
|
186
186
|
void rb_iseq_trace_set_all(rb_event_flag_t turnon_events);
|
|
187
|
-
void rb_iseq_trace_on_all(void);
|
|
188
187
|
void rb_iseq_insns_info_encode_positions(const rb_iseq_t *iseq);
|
|
189
188
|
|
|
189
|
+
struct rb_iseq_constant_body *rb_iseq_constant_body_alloc(void);
|
|
190
190
|
VALUE rb_iseqw_new(const rb_iseq_t *iseq);
|
|
191
191
|
const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw);
|
|
192
192
|
|
|
@@ -298,11 +298,11 @@ enum defined_type {
|
|
|
298
298
|
DEFINED_EXPR,
|
|
299
299
|
DEFINED_IVAR2,
|
|
300
300
|
DEFINED_REF,
|
|
301
|
-
DEFINED_FUNC
|
|
301
|
+
DEFINED_FUNC,
|
|
302
|
+
DEFINED_CONST_FROM
|
|
302
303
|
};
|
|
303
304
|
|
|
304
305
|
VALUE rb_iseq_defined_string(enum defined_type type);
|
|
305
|
-
void rb_iseq_make_compile_option(struct rb_compile_option_struct *option, VALUE opt);
|
|
306
306
|
|
|
307
307
|
/* vm.c */
|
|
308
308
|
VALUE rb_iseq_local_variables(const rb_iseq_t *iseq);
|
|
File without changes
|
|
@@ -177,6 +177,7 @@ struct rb_method_definition_struct {
|
|
|
177
177
|
} body;
|
|
178
178
|
|
|
179
179
|
ID original_id;
|
|
180
|
+
uintptr_t method_serial;
|
|
180
181
|
};
|
|
181
182
|
|
|
182
183
|
typedef struct rb_method_definition_struct rb_method_definition_t;
|
|
@@ -202,7 +203,6 @@ const rb_method_entry_t *rb_method_entry_with_refinements(VALUE klass, ID id, VA
|
|
|
202
203
|
const rb_method_entry_t *rb_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class);
|
|
203
204
|
const rb_method_entry_t *rb_resolve_refined_method(VALUE refinements, const rb_method_entry_t *me);
|
|
204
205
|
RUBY_SYMBOL_EXPORT_BEGIN
|
|
205
|
-
const rb_callable_method_entry_t *rb_resolve_refined_method_callable(VALUE refinements, const rb_callable_method_entry_t *me);
|
|
206
206
|
const rb_method_entry_t *rb_resolve_me_location(const rb_method_entry_t *, VALUE[5]);
|
|
207
207
|
RUBY_SYMBOL_EXPORT_END
|
|
208
208
|
|
|
@@ -215,11 +215,8 @@ int rb_method_entry_eq(const rb_method_entry_t *m1, const rb_method_entry_t *m2)
|
|
|
215
215
|
st_index_t rb_hash_method_entry(st_index_t hash, const rb_method_entry_t *me);
|
|
216
216
|
|
|
217
217
|
VALUE rb_method_entry_location(const rb_method_entry_t *me);
|
|
218
|
-
VALUE rb_mod_method_location(VALUE mod, ID id);
|
|
219
|
-
VALUE rb_obj_method_location(VALUE obj, ID id);
|
|
220
218
|
|
|
221
219
|
void rb_free_method_entry(const rb_method_entry_t *me);
|
|
222
|
-
void rb_sweep_method_entry(void *vm);
|
|
223
220
|
|
|
224
221
|
const rb_method_entry_t *rb_method_entry_clone(const rb_method_entry_t *me);
|
|
225
222
|
const rb_callable_method_entry_t *rb_method_entry_complement_defined_class(const rb_method_entry_t *src_me, ID called_id, VALUE defined_class);
|
|
@@ -43,6 +43,8 @@ struct mjit_options {
|
|
|
43
43
|
// Disable compiler optimization and add debug symbols. It can be
|
|
44
44
|
// very slow.
|
|
45
45
|
char debug;
|
|
46
|
+
// Add arbitrary cflags.
|
|
47
|
+
char* debug_flags;
|
|
46
48
|
// If not 0, all ISeqs are synchronously compiled. For testing.
|
|
47
49
|
unsigned int wait;
|
|
48
50
|
// Number of calls to trigger JIT compilation. For testing.
|
|
@@ -78,9 +80,7 @@ extern void rb_mjit_recompile_iseq(const rb_iseq_t *iseq);
|
|
|
78
80
|
RUBY_SYMBOL_EXPORT_END
|
|
79
81
|
|
|
80
82
|
extern bool mjit_compile(FILE *f, const rb_iseq_t *iseq, const char *funcname);
|
|
81
|
-
extern void mjit_init(struct mjit_options *opts);
|
|
82
|
-
extern void mjit_postponed_job_register_start_hook(void);
|
|
83
|
-
extern void mjit_postponed_job_register_finish_hook(void);
|
|
83
|
+
extern void mjit_init(const struct mjit_options *opts);
|
|
84
84
|
extern void mjit_gc_start_hook(void);
|
|
85
85
|
extern void mjit_gc_exit_hook(void);
|
|
86
86
|
extern void mjit_free_iseq(const rb_iseq_t *iseq);
|
|
@@ -164,8 +164,6 @@ void mjit_child_after_fork(void);
|
|
|
164
164
|
#else // USE_MJIT
|
|
165
165
|
static inline struct mjit_cont *mjit_cont_new(rb_execution_context_t *ec){return NULL;}
|
|
166
166
|
static inline void mjit_cont_free(struct mjit_cont *cont){}
|
|
167
|
-
static inline void mjit_postponed_job_register_start_hook(void){}
|
|
168
|
-
static inline void mjit_postponed_job_register_finish_hook(void){}
|
|
169
167
|
static inline void mjit_gc_start_hook(void){}
|
|
170
168
|
static inline void mjit_gc_exit_hook(void){}
|
|
171
169
|
static inline void mjit_free_iseq(const rb_iseq_t *iseq){}
|
|
@@ -362,13 +362,13 @@ switch (insn) {
|
|
|
362
362
|
#if OPT_IC_FOR_IVAR
|
|
363
363
|
{
|
|
364
364
|
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
|
365
|
-
MAYBE_UNUSED(
|
|
366
|
-
|
|
365
|
+
MAYBE_UNUSED(IVC ic) = (IVC)operands[1];
|
|
366
|
+
IVC ic_copy = &(status->is_entries + ((union iseq_inline_storage_entry *)ic - body->is_entries))->iv_cache;
|
|
367
367
|
if (!status->compile_info->disable_ivar_cache && ic_copy->ic_serial) {
|
|
368
368
|
fprintf(f, "{\n");
|
|
369
369
|
fprintf(f, " VALUE obj = GET_SELF();\n");
|
|
370
370
|
fprintf(f, " const rb_serial_t ic_serial = (rb_serial_t)%"PRI_SERIALT_PREFIX"u;\n", ic_copy->ic_serial);
|
|
371
|
-
fprintf(f, " const st_index_t index = %"PRIuSIZE";\n", ic_copy->
|
|
371
|
+
fprintf(f, " const st_index_t index = %"PRIuSIZE";\n", ic_copy->index);
|
|
372
372
|
fprintf(f, " VALUE val;\n");
|
|
373
373
|
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");
|
|
374
374
|
fprintf(f, " stack[%d] = val;\n", b->stack_size);
|
|
@@ -389,18 +389,18 @@ switch (insn) {
|
|
|
389
389
|
{
|
|
390
390
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
391
391
|
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
|
392
|
-
MAYBE_UNUSED(
|
|
392
|
+
MAYBE_UNUSED(IVC ic) = (IVC)operands[1];
|
|
393
393
|
if (status->local_stack_p) {
|
|
394
394
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
395
395
|
}
|
|
396
|
-
fprintf(f, " MAYBE_UNUSED(IC) ic;\n");
|
|
397
396
|
fprintf(f, " MAYBE_UNUSED(ID) id;\n");
|
|
397
|
+
fprintf(f, " MAYBE_UNUSED(IVC) ic;\n");
|
|
398
398
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
399
399
|
|
|
400
400
|
fprintf(f, " id = (ID)0x%"PRIxVALUE";", operands[0]);
|
|
401
401
|
comment_id(f, (ID)operands[0]);
|
|
402
402
|
fprintf(f, "\n");
|
|
403
|
-
fprintf(f, " ic = (
|
|
403
|
+
fprintf(f, " ic = (IVC)0x%"PRIxVALUE";", operands[1]);
|
|
404
404
|
fprintf(f, "\n");
|
|
405
405
|
if (body->catch_except_p || TRUE) {
|
|
406
406
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -431,13 +431,13 @@ switch (insn) {
|
|
|
431
431
|
#if OPT_IC_FOR_IVAR
|
|
432
432
|
{
|
|
433
433
|
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
|
434
|
-
MAYBE_UNUSED(
|
|
435
|
-
|
|
434
|
+
MAYBE_UNUSED(IVC ic) = (IVC)operands[1];
|
|
435
|
+
IVC ic_copy = &(status->is_entries + ((union iseq_inline_storage_entry *)ic - body->is_entries))->iv_cache;
|
|
436
436
|
if (!status->compile_info->disable_ivar_cache && ic_copy->ic_serial) {
|
|
437
437
|
fprintf(f, "{\n");
|
|
438
438
|
fprintf(f, " VALUE obj = GET_SELF();\n");
|
|
439
439
|
fprintf(f, " const rb_serial_t ic_serial = (rb_serial_t)%"PRI_SERIALT_PREFIX"u;\n", ic_copy->ic_serial);
|
|
440
|
-
fprintf(f, " const st_index_t index = %"PRIuSIZE";\n", ic_copy->
|
|
440
|
+
fprintf(f, " const st_index_t index = %"PRIuSIZE";\n", ic_copy->index);
|
|
441
441
|
fprintf(f, " VALUE val = stack[%d];\n", b->stack_size - 1);
|
|
442
442
|
fprintf(f, " if (LIKELY(RB_TYPE_P(obj, T_OBJECT) && ic_serial == RCLASS_SERIAL(RBASIC(obj)->klass) && index < ROBJECT_NUMIV(obj) && !RB_OBJ_FROZEN(obj))) {\n");
|
|
443
443
|
fprintf(f, " VALUE *ptr = ROBJECT_IVPTR(obj);\n");
|
|
@@ -459,18 +459,18 @@ switch (insn) {
|
|
|
459
459
|
{
|
|
460
460
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
461
461
|
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
|
462
|
-
MAYBE_UNUSED(
|
|
462
|
+
MAYBE_UNUSED(IVC ic) = (IVC)operands[1];
|
|
463
463
|
if (status->local_stack_p) {
|
|
464
464
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
465
465
|
}
|
|
466
|
-
fprintf(f, " MAYBE_UNUSED(IC) ic;\n");
|
|
467
466
|
fprintf(f, " MAYBE_UNUSED(ID) id;\n");
|
|
467
|
+
fprintf(f, " MAYBE_UNUSED(IVC) ic;\n");
|
|
468
468
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
469
469
|
|
|
470
470
|
fprintf(f, " id = (ID)0x%"PRIxVALUE";", operands[0]);
|
|
471
471
|
comment_id(f, (ID)operands[0]);
|
|
472
472
|
fprintf(f, "\n");
|
|
473
|
-
fprintf(f, " ic = (
|
|
473
|
+
fprintf(f, " ic = (IVC)0x%"PRIxVALUE";", operands[1]);
|
|
474
474
|
fprintf(f, "\n");
|
|
475
475
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
|
476
476
|
if (body->catch_except_p || TRUE) {
|
|
@@ -1780,39 +1780,6 @@ switch (insn) {
|
|
|
1780
1780
|
}
|
|
1781
1781
|
fprintf(f, "}\n");
|
|
1782
1782
|
break;
|
|
1783
|
-
case BIN(methodref):
|
|
1784
|
-
fprintf(f, "{\n");
|
|
1785
|
-
{
|
|
1786
|
-
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
1787
|
-
MAYBE_UNUSED(ID id) = (ID)operands[0];
|
|
1788
|
-
if (status->local_stack_p) {
|
|
1789
|
-
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
1790
|
-
}
|
|
1791
|
-
fprintf(f, " MAYBE_UNUSED(ID) id;\n");
|
|
1792
|
-
fprintf(f, " MAYBE_UNUSED(VALUE) ret, val;\n");
|
|
1793
|
-
|
|
1794
|
-
fprintf(f, " id = (ID)0x%"PRIxVALUE";", operands[0]);
|
|
1795
|
-
comment_id(f, (ID)operands[0]);
|
|
1796
|
-
fprintf(f, "\n");
|
|
1797
|
-
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
|
1798
|
-
if (body->catch_except_p || FALSE) {
|
|
1799
|
-
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
1800
|
-
pc_moved_p = TRUE;
|
|
1801
|
-
}
|
|
1802
|
-
if (status->local_stack_p) {
|
|
1803
|
-
}
|
|
1804
|
-
else {
|
|
1805
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
1806
|
-
}
|
|
1807
|
-
fprintf(f, " {\n");
|
|
1808
|
-
fprintf(f, " ret = rb_obj_method(val, ID2SYM(id));\n");
|
|
1809
|
-
fprintf(f, " RB_OBJ_FREEZE_RAW(ret);\n");
|
|
1810
|
-
fprintf(f, " }\n");
|
|
1811
|
-
fprintf(f, " stack[%d] = ret;\n", b->stack_size + (int)attr_sp_inc_methodref(id) - 1);
|
|
1812
|
-
b->stack_size += attr_sp_inc_methodref(id);
|
|
1813
|
-
}
|
|
1814
|
-
fprintf(f, "}\n");
|
|
1815
|
-
break;
|
|
1816
1783
|
case BIN(definemethod):
|
|
1817
1784
|
fprintf(f, "{\n");
|
|
1818
1785
|
{
|
|
@@ -1916,12 +1883,12 @@ switch (insn) {
|
|
|
1916
1883
|
case BIN(send):
|
|
1917
1884
|
{
|
|
1918
1885
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
1919
|
-
MAYBE_UNUSED(
|
|
1920
|
-
MAYBE_UNUSED(
|
|
1921
|
-
|
|
1922
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
1886
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
1887
|
+
MAYBE_UNUSED(ISEQ blockiseq) = (ISEQ)operands[1];
|
|
1888
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
1923
1889
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
1924
1890
|
const rb_iseq_t *iseq;
|
|
1891
|
+
const CALL_INFO ci = &cd->ci;
|
|
1925
1892
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
1926
1893
|
argc += ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0); // simulate `vm_caller_setup_arg_block`'s `--reg_cfp->sp`
|
|
1927
1894
|
|
|
@@ -1935,7 +1902,7 @@ switch (insn) {
|
|
|
1935
1902
|
}
|
|
1936
1903
|
|
|
1937
1904
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
1938
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
1905
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
1939
1906
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
1940
1907
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
1941
1908
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -1948,7 +1915,7 @@ switch (insn) {
|
|
|
1948
1915
|
if (status->local_stack_p) {
|
|
1949
1916
|
{
|
|
1950
1917
|
rb_snum_t i, push_size;
|
|
1951
|
-
push_size = -attr_sp_inc_send(
|
|
1918
|
+
push_size = -attr_sp_inc_send(cd, blockiseq) + 1 - 0;
|
|
1952
1919
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
1953
1920
|
for (i = 0; i < push_size; i++) {
|
|
1954
1921
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -1970,7 +1937,7 @@ switch (insn) {
|
|
|
1970
1937
|
else {
|
|
1971
1938
|
fprintf(f, " {\n");
|
|
1972
1939
|
fprintf(f, " struct rb_calling_info calling;\n");
|
|
1973
|
-
fprintf(f, " calling.block_handler = vm_caller_setup_arg_block(ec, reg_cfp, (CALL_INFO)0x%"PRIxVALUE", (rb_iseq_t *)0x%"PRIxVALUE", FALSE);\n",
|
|
1940
|
+
fprintf(f, " calling.block_handler = vm_caller_setup_arg_block(ec, reg_cfp, (CALL_INFO)0x%"PRIxVALUE", (rb_iseq_t *)0x%"PRIxVALUE", FALSE);\n", (VALUE)ci, (VALUE)blockiseq);
|
|
1974
1941
|
fprintf(f, " calling.argc = %d;\n", ci->orig_argc);
|
|
1975
1942
|
fprintf(f, " calling.recv = stack[%d];\n", b->stack_size - 1 - argc);
|
|
1976
1943
|
|
|
@@ -1994,7 +1961,7 @@ switch (insn) {
|
|
|
1994
1961
|
fprintf(f, " }\n");
|
|
1995
1962
|
|
|
1996
1963
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
1997
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_send(
|
|
1964
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_send(cd, blockiseq));
|
|
1998
1965
|
if (!pc_moved_p) {
|
|
1999
1966
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
2000
1967
|
}
|
|
@@ -2003,7 +1970,7 @@ switch (insn) {
|
|
|
2003
1970
|
fprintf(f, " }\n");
|
|
2004
1971
|
}
|
|
2005
1972
|
|
|
2006
|
-
b->stack_size += attr_sp_inc_send(
|
|
1973
|
+
b->stack_size += attr_sp_inc_send(cd, blockiseq);
|
|
2007
1974
|
|
|
2008
1975
|
fprintf(f, "}\n");
|
|
2009
1976
|
break;
|
|
@@ -2013,23 +1980,19 @@ switch (insn) {
|
|
|
2013
1980
|
fprintf(f, "{\n");
|
|
2014
1981
|
{
|
|
2015
1982
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
2016
|
-
MAYBE_UNUSED(
|
|
2017
|
-
MAYBE_UNUSED(
|
|
2018
|
-
MAYBE_UNUSED(ISEQ blockiseq) = (ISEQ)operands[2];
|
|
1983
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
1984
|
+
MAYBE_UNUSED(ISEQ blockiseq) = (ISEQ)operands[1];
|
|
2019
1985
|
if (status->local_stack_p) {
|
|
2020
1986
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
2021
1987
|
}
|
|
2022
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
2023
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
1988
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
2024
1989
|
fprintf(f, " MAYBE_UNUSED(ISEQ) blockiseq;\n");
|
|
2025
1990
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
2026
1991
|
|
|
2027
|
-
fprintf(f, "
|
|
2028
|
-
comment_id(f, ((
|
|
2029
|
-
fprintf(f, "\n");
|
|
2030
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
1992
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
1993
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
2031
1994
|
fprintf(f, "\n");
|
|
2032
|
-
fprintf(f, " blockiseq = (ISEQ)0x%"PRIxVALUE";", operands[
|
|
1995
|
+
fprintf(f, " blockiseq = (ISEQ)0x%"PRIxVALUE";", operands[1]);
|
|
2033
1996
|
fprintf(f, "\n");
|
|
2034
1997
|
if (body->catch_except_p || TRUE) {
|
|
2035
1998
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -2038,7 +2001,7 @@ switch (insn) {
|
|
|
2038
2001
|
if (status->local_stack_p) {
|
|
2039
2002
|
{
|
|
2040
2003
|
rb_snum_t i, push_size;
|
|
2041
|
-
push_size = -attr_sp_inc_send(
|
|
2004
|
+
push_size = -attr_sp_inc_send(cd, blockiseq) + 1 - 0;
|
|
2042
2005
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
2043
2006
|
for (i = 0; i < push_size; i++) {
|
|
2044
2007
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -2049,8 +2012,8 @@ switch (insn) {
|
|
|
2049
2012
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size - 0); /* POPN(INSN_ATTR(popn)); */
|
|
2050
2013
|
}
|
|
2051
2014
|
fprintf(f, " {\n");
|
|
2052
|
-
fprintf(f, " VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), ci, blockiseq, false);\n");
|
|
2053
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
2015
|
+
fprintf(f, " VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), &cd->ci, blockiseq, false);\n");
|
|
2016
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
2054
2017
|
fprintf(f, "\n");
|
|
2055
2018
|
fprintf(f, " if (val == Qundef) {\n");
|
|
2056
2019
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -2062,27 +2025,27 @@ switch (insn) {
|
|
|
2062
2025
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
2063
2026
|
fprintf(f, " }\n");
|
|
2064
2027
|
fprintf(f, " }\n");
|
|
2065
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_send(
|
|
2028
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_send(cd, blockiseq) - 1);
|
|
2066
2029
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
2067
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_send(
|
|
2030
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_send(cd, blockiseq));
|
|
2068
2031
|
if (!pc_moved_p) {
|
|
2069
2032
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
2070
2033
|
}
|
|
2071
2034
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
2072
2035
|
fprintf(f, " goto cancel;\n");
|
|
2073
2036
|
fprintf(f, " }\n");
|
|
2074
|
-
b->stack_size += attr_sp_inc_send(
|
|
2037
|
+
b->stack_size += attr_sp_inc_send(cd, blockiseq);
|
|
2075
2038
|
}
|
|
2076
2039
|
fprintf(f, "}\n");
|
|
2077
2040
|
break;
|
|
2078
2041
|
case BIN(opt_send_without_block):
|
|
2079
2042
|
{
|
|
2080
2043
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
2081
|
-
MAYBE_UNUSED(
|
|
2082
|
-
|
|
2083
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
2044
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
2045
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
2084
2046
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
2085
2047
|
const rb_iseq_t *iseq;
|
|
2048
|
+
const CALL_INFO ci = &cd->ci;
|
|
2086
2049
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
2087
2050
|
|
|
2088
2051
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -2095,7 +2058,7 @@ switch (insn) {
|
|
|
2095
2058
|
}
|
|
2096
2059
|
|
|
2097
2060
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
2098
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
2061
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
2099
2062
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
2100
2063
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
2101
2064
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -2108,7 +2071,7 @@ switch (insn) {
|
|
|
2108
2071
|
if (status->local_stack_p) {
|
|
2109
2072
|
{
|
|
2110
2073
|
rb_snum_t i, push_size;
|
|
2111
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
2074
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
2112
2075
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
2113
2076
|
for (i = 0; i < push_size; i++) {
|
|
2114
2077
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -2154,7 +2117,7 @@ switch (insn) {
|
|
|
2154
2117
|
fprintf(f, " }\n");
|
|
2155
2118
|
|
|
2156
2119
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
2157
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
2120
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
2158
2121
|
if (!pc_moved_p) {
|
|
2159
2122
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
2160
2123
|
}
|
|
@@ -2163,7 +2126,7 @@ switch (insn) {
|
|
|
2163
2126
|
fprintf(f, " }\n");
|
|
2164
2127
|
}
|
|
2165
2128
|
|
|
2166
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
2129
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
2167
2130
|
|
|
2168
2131
|
fprintf(f, "}\n");
|
|
2169
2132
|
break;
|
|
@@ -2173,19 +2136,15 @@ switch (insn) {
|
|
|
2173
2136
|
fprintf(f, "{\n");
|
|
2174
2137
|
{
|
|
2175
2138
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
2176
|
-
MAYBE_UNUSED(
|
|
2177
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
2139
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
2178
2140
|
if (status->local_stack_p) {
|
|
2179
2141
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
2180
2142
|
}
|
|
2181
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
2182
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
2143
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
2183
2144
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
2184
2145
|
|
|
2185
|
-
fprintf(f, "
|
|
2186
|
-
comment_id(f, ((
|
|
2187
|
-
fprintf(f, "\n");
|
|
2188
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
2146
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
2147
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
2189
2148
|
fprintf(f, "\n");
|
|
2190
2149
|
if (body->catch_except_p || TRUE) {
|
|
2191
2150
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -2194,7 +2153,7 @@ switch (insn) {
|
|
|
2194
2153
|
if (status->local_stack_p) {
|
|
2195
2154
|
{
|
|
2196
2155
|
rb_snum_t i, push_size;
|
|
2197
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
2156
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
2198
2157
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
2199
2158
|
for (i = 0; i < push_size; i++) {
|
|
2200
2159
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -2206,7 +2165,7 @@ switch (insn) {
|
|
|
2206
2165
|
}
|
|
2207
2166
|
fprintf(f, " {\n");
|
|
2208
2167
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
2209
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
2168
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
2210
2169
|
fprintf(f, "\n");
|
|
2211
2170
|
fprintf(f, " if (val == Qundef) {\n");
|
|
2212
2171
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -2218,16 +2177,16 @@ switch (insn) {
|
|
|
2218
2177
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
2219
2178
|
fprintf(f, " }\n");
|
|
2220
2179
|
fprintf(f, " }\n");
|
|
2221
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
2180
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
2222
2181
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
2223
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
2182
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
2224
2183
|
if (!pc_moved_p) {
|
|
2225
2184
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
2226
2185
|
}
|
|
2227
2186
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
2228
2187
|
fprintf(f, " goto cancel;\n");
|
|
2229
2188
|
fprintf(f, " }\n");
|
|
2230
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
2189
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
2231
2190
|
}
|
|
2232
2191
|
fprintf(f, "}\n");
|
|
2233
2192
|
break;
|
|
@@ -2236,22 +2195,18 @@ switch (insn) {
|
|
|
2236
2195
|
{
|
|
2237
2196
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
2238
2197
|
MAYBE_UNUSED(VALUE str) = (VALUE)operands[0];
|
|
2239
|
-
MAYBE_UNUSED(
|
|
2240
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[2];
|
|
2198
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[1];
|
|
2241
2199
|
if (status->local_stack_p) {
|
|
2242
2200
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
2243
2201
|
}
|
|
2244
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
2245
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
2202
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
2246
2203
|
fprintf(f, " MAYBE_UNUSED(VALUE) str, val;\n");
|
|
2247
2204
|
|
|
2248
2205
|
fprintf(f, " str = (VALUE)0x%"PRIxVALUE";", operands[0]);
|
|
2249
2206
|
if (SYMBOL_P((VALUE)operands[0])) comment_id(f, SYM2ID((VALUE)operands[0]));
|
|
2250
2207
|
fprintf(f, "\n");
|
|
2251
|
-
fprintf(f, "
|
|
2252
|
-
comment_id(f, ((
|
|
2253
|
-
fprintf(f, "\n");
|
|
2254
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[2]);
|
|
2208
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[1]);
|
|
2209
|
+
comment_id(f, ((CALL_DATA)operands[1])->ci.mid);
|
|
2255
2210
|
fprintf(f, "\n");
|
|
2256
2211
|
if (body->catch_except_p || FALSE) {
|
|
2257
2212
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -2275,20 +2230,20 @@ switch (insn) {
|
|
|
2275
2230
|
fprintf(f, " goto cancel;\n");
|
|
2276
2231
|
fprintf(f, " }\n");
|
|
2277
2232
|
fprintf(f, " }\n");
|
|
2278
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_str_freeze(str,
|
|
2279
|
-
b->stack_size += attr_sp_inc_opt_str_freeze(str,
|
|
2233
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_str_freeze(str, cd) - 1);
|
|
2234
|
+
b->stack_size += attr_sp_inc_opt_str_freeze(str, cd);
|
|
2280
2235
|
}
|
|
2281
2236
|
fprintf(f, "}\n");
|
|
2282
2237
|
break;
|
|
2283
2238
|
case BIN(opt_nil_p):
|
|
2284
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
2239
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
2285
2240
|
{
|
|
2286
2241
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
2287
|
-
MAYBE_UNUSED(
|
|
2288
|
-
|
|
2289
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
2242
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
2243
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
2290
2244
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
2291
2245
|
const rb_iseq_t *iseq;
|
|
2246
|
+
const CALL_INFO ci = &cd->ci;
|
|
2292
2247
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
2293
2248
|
|
|
2294
2249
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -2301,7 +2256,7 @@ switch (insn) {
|
|
|
2301
2256
|
}
|
|
2302
2257
|
|
|
2303
2258
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
2304
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
2259
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
2305
2260
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
2306
2261
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
2307
2262
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -2314,7 +2269,7 @@ switch (insn) {
|
|
|
2314
2269
|
if (status->local_stack_p) {
|
|
2315
2270
|
{
|
|
2316
2271
|
rb_snum_t i, push_size;
|
|
2317
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
2272
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
2318
2273
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
2319
2274
|
for (i = 0; i < push_size; i++) {
|
|
2320
2275
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -2360,7 +2315,7 @@ switch (insn) {
|
|
|
2360
2315
|
fprintf(f, " }\n");
|
|
2361
2316
|
|
|
2362
2317
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
2363
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
2318
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
2364
2319
|
if (!pc_moved_p) {
|
|
2365
2320
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
2366
2321
|
}
|
|
@@ -2369,7 +2324,7 @@ switch (insn) {
|
|
|
2369
2324
|
fprintf(f, " }\n");
|
|
2370
2325
|
}
|
|
2371
2326
|
|
|
2372
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
2327
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
2373
2328
|
|
|
2374
2329
|
fprintf(f, "}\n");
|
|
2375
2330
|
break;
|
|
@@ -2379,19 +2334,15 @@ switch (insn) {
|
|
|
2379
2334
|
fprintf(f, "{\n");
|
|
2380
2335
|
{
|
|
2381
2336
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
2382
|
-
MAYBE_UNUSED(
|
|
2383
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
2337
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
2384
2338
|
if (status->local_stack_p) {
|
|
2385
2339
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
2386
2340
|
}
|
|
2387
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
2388
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
2341
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
2389
2342
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
2390
2343
|
|
|
2391
|
-
fprintf(f, "
|
|
2392
|
-
comment_id(f, ((
|
|
2393
|
-
fprintf(f, "\n");
|
|
2394
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
2344
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
2345
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
2395
2346
|
fprintf(f, "\n");
|
|
2396
2347
|
if (body->catch_except_p || TRUE) {
|
|
2397
2348
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -2400,7 +2351,7 @@ switch (insn) {
|
|
|
2400
2351
|
if (status->local_stack_p) {
|
|
2401
2352
|
{
|
|
2402
2353
|
rb_snum_t i, push_size;
|
|
2403
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
2354
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
2404
2355
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
2405
2356
|
for (i = 0; i < push_size; i++) {
|
|
2406
2357
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -2412,7 +2363,7 @@ switch (insn) {
|
|
|
2412
2363
|
}
|
|
2413
2364
|
fprintf(f, " {\n");
|
|
2414
2365
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
2415
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
2366
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
2416
2367
|
fprintf(f, "\n");
|
|
2417
2368
|
fprintf(f, " if (val == Qundef) {\n");
|
|
2418
2369
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -2424,16 +2375,16 @@ switch (insn) {
|
|
|
2424
2375
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
2425
2376
|
fprintf(f, " }\n");
|
|
2426
2377
|
fprintf(f, " }\n");
|
|
2427
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
2378
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
2428
2379
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
2429
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
2380
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
2430
2381
|
if (!pc_moved_p) {
|
|
2431
2382
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
2432
2383
|
}
|
|
2433
2384
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
2434
2385
|
fprintf(f, " goto cancel;\n");
|
|
2435
2386
|
fprintf(f, " }\n");
|
|
2436
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
2387
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
2437
2388
|
}
|
|
2438
2389
|
fprintf(f, "}\n");
|
|
2439
2390
|
break;
|
|
@@ -2441,19 +2392,15 @@ switch (insn) {
|
|
|
2441
2392
|
fprintf(f, "{\n");
|
|
2442
2393
|
{
|
|
2443
2394
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
2444
|
-
MAYBE_UNUSED(
|
|
2445
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
2395
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
2446
2396
|
if (status->local_stack_p) {
|
|
2447
2397
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
2448
2398
|
}
|
|
2449
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
2450
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
2399
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
2451
2400
|
fprintf(f, " MAYBE_UNUSED(VALUE) recv, val;\n");
|
|
2452
2401
|
|
|
2453
|
-
fprintf(f, "
|
|
2454
|
-
comment_id(f, ((
|
|
2455
|
-
fprintf(f, "\n");
|
|
2456
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
2402
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
2403
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
2457
2404
|
fprintf(f, "\n");
|
|
2458
2405
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
|
2459
2406
|
if (body->catch_except_p || FALSE) {
|
|
@@ -2466,7 +2413,7 @@ switch (insn) {
|
|
|
2466
2413
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
2467
2414
|
}
|
|
2468
2415
|
fprintf(f, " {\n");
|
|
2469
|
-
fprintf(f, " val = vm_opt_nil_p(
|
|
2416
|
+
fprintf(f, " val = vm_opt_nil_p(cd, recv);\n");
|
|
2470
2417
|
fprintf(f, "\n");
|
|
2471
2418
|
fprintf(f, " if (val == Qundef) {\n");
|
|
2472
2419
|
if (status->local_stack_p) {
|
|
@@ -2477,8 +2424,8 @@ switch (insn) {
|
|
|
2477
2424
|
fprintf(f, " goto cancel;\n");
|
|
2478
2425
|
fprintf(f, " }\n");
|
|
2479
2426
|
fprintf(f, " }\n");
|
|
2480
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_nil_p(
|
|
2481
|
-
b->stack_size += attr_sp_inc_opt_nil_p(
|
|
2427
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_nil_p(cd) - 1);
|
|
2428
|
+
b->stack_size += attr_sp_inc_opt_nil_p(cd);
|
|
2482
2429
|
}
|
|
2483
2430
|
fprintf(f, "}\n");
|
|
2484
2431
|
break;
|
|
@@ -2487,22 +2434,18 @@ switch (insn) {
|
|
|
2487
2434
|
{
|
|
2488
2435
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
2489
2436
|
MAYBE_UNUSED(VALUE str) = (VALUE)operands[0];
|
|
2490
|
-
MAYBE_UNUSED(
|
|
2491
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[2];
|
|
2437
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[1];
|
|
2492
2438
|
if (status->local_stack_p) {
|
|
2493
2439
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
2494
2440
|
}
|
|
2495
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
2496
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
2441
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
2497
2442
|
fprintf(f, " MAYBE_UNUSED(VALUE) str, val;\n");
|
|
2498
2443
|
|
|
2499
2444
|
fprintf(f, " str = (VALUE)0x%"PRIxVALUE";", operands[0]);
|
|
2500
2445
|
if (SYMBOL_P((VALUE)operands[0])) comment_id(f, SYM2ID((VALUE)operands[0]));
|
|
2501
2446
|
fprintf(f, "\n");
|
|
2502
|
-
fprintf(f, "
|
|
2503
|
-
comment_id(f, ((
|
|
2504
|
-
fprintf(f, "\n");
|
|
2505
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[2]);
|
|
2447
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[1]);
|
|
2448
|
+
comment_id(f, ((CALL_DATA)operands[1])->ci.mid);
|
|
2506
2449
|
fprintf(f, "\n");
|
|
2507
2450
|
if (body->catch_except_p || FALSE) {
|
|
2508
2451
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -2526,8 +2469,8 @@ switch (insn) {
|
|
|
2526
2469
|
fprintf(f, " goto cancel;\n");
|
|
2527
2470
|
fprintf(f, " }\n");
|
|
2528
2471
|
fprintf(f, " }\n");
|
|
2529
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_str_uminus(str,
|
|
2530
|
-
b->stack_size += attr_sp_inc_opt_str_uminus(str,
|
|
2472
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_str_uminus(str, cd) - 1);
|
|
2473
|
+
b->stack_size += attr_sp_inc_opt_str_uminus(str, cd);
|
|
2531
2474
|
}
|
|
2532
2475
|
fprintf(f, "}\n");
|
|
2533
2476
|
break;
|
|
@@ -2613,23 +2556,19 @@ switch (insn) {
|
|
|
2613
2556
|
fprintf(f, "{\n");
|
|
2614
2557
|
{
|
|
2615
2558
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
2616
|
-
MAYBE_UNUSED(
|
|
2617
|
-
MAYBE_UNUSED(
|
|
2618
|
-
MAYBE_UNUSED(ISEQ blockiseq) = (ISEQ)operands[2];
|
|
2559
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
2560
|
+
MAYBE_UNUSED(ISEQ blockiseq) = (ISEQ)operands[1];
|
|
2619
2561
|
if (status->local_stack_p) {
|
|
2620
2562
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
2621
2563
|
}
|
|
2622
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
2623
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
2564
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
2624
2565
|
fprintf(f, " MAYBE_UNUSED(ISEQ) blockiseq;\n");
|
|
2625
2566
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
2626
2567
|
|
|
2627
|
-
fprintf(f, "
|
|
2628
|
-
comment_id(f, ((
|
|
2629
|
-
fprintf(f, "\n");
|
|
2630
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
2568
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
2569
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
2631
2570
|
fprintf(f, "\n");
|
|
2632
|
-
fprintf(f, " blockiseq = (ISEQ)0x%"PRIxVALUE";", operands[
|
|
2571
|
+
fprintf(f, " blockiseq = (ISEQ)0x%"PRIxVALUE";", operands[1]);
|
|
2633
2572
|
fprintf(f, "\n");
|
|
2634
2573
|
if (body->catch_except_p || TRUE) {
|
|
2635
2574
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -2638,7 +2577,7 @@ switch (insn) {
|
|
|
2638
2577
|
if (status->local_stack_p) {
|
|
2639
2578
|
{
|
|
2640
2579
|
rb_snum_t i, push_size;
|
|
2641
|
-
push_size = -attr_sp_inc_invokesuper(
|
|
2580
|
+
push_size = -attr_sp_inc_invokesuper(cd, blockiseq) + 1 - 0;
|
|
2642
2581
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
2643
2582
|
for (i = 0; i < push_size; i++) {
|
|
2644
2583
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -2649,8 +2588,8 @@ switch (insn) {
|
|
|
2649
2588
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size - 0); /* POPN(INSN_ATTR(popn)); */
|
|
2650
2589
|
}
|
|
2651
2590
|
fprintf(f, " {\n");
|
|
2652
|
-
fprintf(f, " VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), ci, blockiseq, true);\n");
|
|
2653
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
2591
|
+
fprintf(f, " VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), &cd->ci, blockiseq, true);\n");
|
|
2592
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_super_method);\n");
|
|
2654
2593
|
fprintf(f, "\n");
|
|
2655
2594
|
fprintf(f, " if (val == Qundef) {\n");
|
|
2656
2595
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -2662,16 +2601,16 @@ switch (insn) {
|
|
|
2662
2601
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
2663
2602
|
fprintf(f, " }\n");
|
|
2664
2603
|
fprintf(f, " }\n");
|
|
2665
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_invokesuper(
|
|
2604
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_invokesuper(cd, blockiseq) - 1);
|
|
2666
2605
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
2667
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_invokesuper(
|
|
2606
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_invokesuper(cd, blockiseq));
|
|
2668
2607
|
if (!pc_moved_p) {
|
|
2669
2608
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
2670
2609
|
}
|
|
2671
2610
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
2672
2611
|
fprintf(f, " goto cancel;\n");
|
|
2673
2612
|
fprintf(f, " }\n");
|
|
2674
|
-
b->stack_size += attr_sp_inc_invokesuper(
|
|
2613
|
+
b->stack_size += attr_sp_inc_invokesuper(cd, blockiseq);
|
|
2675
2614
|
}
|
|
2676
2615
|
fprintf(f, "}\n");
|
|
2677
2616
|
break;
|
|
@@ -2679,15 +2618,15 @@ switch (insn) {
|
|
|
2679
2618
|
fprintf(f, "{\n");
|
|
2680
2619
|
{
|
|
2681
2620
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
2682
|
-
MAYBE_UNUSED(
|
|
2621
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
2683
2622
|
if (status->local_stack_p) {
|
|
2684
2623
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
2685
2624
|
}
|
|
2686
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
2625
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
2687
2626
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
2688
2627
|
|
|
2689
|
-
fprintf(f, "
|
|
2690
|
-
comment_id(f, ((
|
|
2628
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
2629
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
2691
2630
|
fprintf(f, "\n");
|
|
2692
2631
|
if (body->catch_except_p || TRUE) {
|
|
2693
2632
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -2696,7 +2635,7 @@ switch (insn) {
|
|
|
2696
2635
|
if (status->local_stack_p) {
|
|
2697
2636
|
{
|
|
2698
2637
|
rb_snum_t i, push_size;
|
|
2699
|
-
push_size = -attr_sp_inc_invokeblock(
|
|
2638
|
+
push_size = -attr_sp_inc_invokeblock(cd) + 1 - 0;
|
|
2700
2639
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
2701
2640
|
for (i = 0; i < push_size; i++) {
|
|
2702
2641
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -2707,12 +2646,12 @@ switch (insn) {
|
|
|
2707
2646
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size - 0); /* POPN(INSN_ATTR(popn)); */
|
|
2708
2647
|
}
|
|
2709
2648
|
fprintf(f, " {\n");
|
|
2710
|
-
fprintf(f, "
|
|
2711
|
-
fprintf(f, "
|
|
2712
|
-
fprintf(f, " }
|
|
2649
|
+
fprintf(f, " if (UNLIKELY(cd->cc.call != vm_invokeblock_i)) {\n");
|
|
2650
|
+
fprintf(f, " cd->cc.call = vm_invokeblock_i; // check before setting to avoid CoW\n");
|
|
2651
|
+
fprintf(f, " }\n");
|
|
2713
2652
|
fprintf(f, "\n");
|
|
2714
2653
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
2715
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
2654
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_invokeblock);\n");
|
|
2716
2655
|
fprintf(f, "\n");
|
|
2717
2656
|
fprintf(f, " if (val == Qundef) {\n");
|
|
2718
2657
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -2724,16 +2663,16 @@ switch (insn) {
|
|
|
2724
2663
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
2725
2664
|
fprintf(f, " }\n");
|
|
2726
2665
|
fprintf(f, " }\n");
|
|
2727
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_invokeblock(
|
|
2666
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_invokeblock(cd) - 1);
|
|
2728
2667
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
2729
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_invokeblock(
|
|
2668
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_invokeblock(cd));
|
|
2730
2669
|
if (!pc_moved_p) {
|
|
2731
2670
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
2732
2671
|
}
|
|
2733
2672
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
2734
2673
|
fprintf(f, " goto cancel;\n");
|
|
2735
2674
|
fprintf(f, " }\n");
|
|
2736
|
-
b->stack_size += attr_sp_inc_invokeblock(
|
|
2675
|
+
b->stack_size += attr_sp_inc_invokeblock(cd);
|
|
2737
2676
|
}
|
|
2738
2677
|
fprintf(f, "}\n");
|
|
2739
2678
|
break;
|
|
@@ -2782,8 +2721,6 @@ switch (insn) {
|
|
|
2782
2721
|
fprintf(f, " }\n");
|
|
2783
2722
|
fprintf(f, " }\n");
|
|
2784
2723
|
fprintf(f, "\n");
|
|
2785
|
-
fprintf(f, " RUBY_VM_CHECK_INTS(ec);\n");
|
|
2786
|
-
fprintf(f, "\n");
|
|
2787
2724
|
fprintf(f, " if (vm_pop_frame(ec, GET_CFP(), GET_EP())) {\n");
|
|
2788
2725
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
2789
2726
|
fprintf(f, " rb_ec_thread_ptr(ec)->retval = val;\n");
|
|
@@ -2839,7 +2776,6 @@ switch (insn) {
|
|
|
2839
2776
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
2840
2777
|
}
|
|
2841
2778
|
fprintf(f, " {\n");
|
|
2842
|
-
fprintf(f, " RUBY_VM_CHECK_INTS(ec);\n");
|
|
2843
2779
|
fprintf(f, " val = vm_throw(ec, GET_CFP(), throw_state, throwobj);\n");
|
|
2844
2780
|
fprintf(f, " THROW_EXCEPTION(val);\n");
|
|
2845
2781
|
fprintf(f, " /* unreachable */\n");
|
|
@@ -3053,7 +2989,7 @@ switch (insn) {
|
|
|
3053
2989
|
}
|
|
3054
2990
|
fprintf(f, " {\n");
|
|
3055
2991
|
fprintf(f, " if (vm_ic_hit_p(ic, GET_EP())) {\n");
|
|
3056
|
-
fprintf(f, " val = ic->
|
|
2992
|
+
fprintf(f, " val = ic->value;\n");
|
|
3057
2993
|
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_getinlinecache(dst, ic) - 1);
|
|
3058
2994
|
next_pos = pos + insn_len(insn) + (unsigned int)dst;
|
|
3059
2995
|
fprintf(f, " goto label_%d;\n", next_pos);
|
|
@@ -3200,14 +3136,14 @@ switch (insn) {
|
|
|
3200
3136
|
compile_insns(f, body, b->stack_size, pos + insn_len(insn), status);
|
|
3201
3137
|
break;
|
|
3202
3138
|
case BIN(opt_plus):
|
|
3203
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
3139
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
3204
3140
|
{
|
|
3205
3141
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
3206
|
-
MAYBE_UNUSED(
|
|
3207
|
-
|
|
3208
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
3142
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3143
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
3209
3144
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
3210
3145
|
const rb_iseq_t *iseq;
|
|
3146
|
+
const CALL_INFO ci = &cd->ci;
|
|
3211
3147
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
3212
3148
|
|
|
3213
3149
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -3220,7 +3156,7 @@ switch (insn) {
|
|
|
3220
3156
|
}
|
|
3221
3157
|
|
|
3222
3158
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
3223
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
3159
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
3224
3160
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
3225
3161
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
3226
3162
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -3233,7 +3169,7 @@ switch (insn) {
|
|
|
3233
3169
|
if (status->local_stack_p) {
|
|
3234
3170
|
{
|
|
3235
3171
|
rb_snum_t i, push_size;
|
|
3236
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
3172
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
3237
3173
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
3238
3174
|
for (i = 0; i < push_size; i++) {
|
|
3239
3175
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -3279,7 +3215,7 @@ switch (insn) {
|
|
|
3279
3215
|
fprintf(f, " }\n");
|
|
3280
3216
|
|
|
3281
3217
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
3282
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
3218
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
3283
3219
|
if (!pc_moved_p) {
|
|
3284
3220
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
3285
3221
|
}
|
|
@@ -3288,7 +3224,7 @@ switch (insn) {
|
|
|
3288
3224
|
fprintf(f, " }\n");
|
|
3289
3225
|
}
|
|
3290
3226
|
|
|
3291
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
3227
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
3292
3228
|
|
|
3293
3229
|
fprintf(f, "}\n");
|
|
3294
3230
|
break;
|
|
@@ -3298,19 +3234,15 @@ switch (insn) {
|
|
|
3298
3234
|
fprintf(f, "{\n");
|
|
3299
3235
|
{
|
|
3300
3236
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
3301
|
-
MAYBE_UNUSED(
|
|
3302
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
3237
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3303
3238
|
if (status->local_stack_p) {
|
|
3304
3239
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
3305
3240
|
}
|
|
3306
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
3307
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
3241
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
3308
3242
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
3309
3243
|
|
|
3310
|
-
fprintf(f, "
|
|
3311
|
-
comment_id(f, ((
|
|
3312
|
-
fprintf(f, "\n");
|
|
3313
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
3244
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
3245
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
3314
3246
|
fprintf(f, "\n");
|
|
3315
3247
|
if (body->catch_except_p || TRUE) {
|
|
3316
3248
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -3319,7 +3251,7 @@ switch (insn) {
|
|
|
3319
3251
|
if (status->local_stack_p) {
|
|
3320
3252
|
{
|
|
3321
3253
|
rb_snum_t i, push_size;
|
|
3322
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
3254
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
3323
3255
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
3324
3256
|
for (i = 0; i < push_size; i++) {
|
|
3325
3257
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -3331,7 +3263,7 @@ switch (insn) {
|
|
|
3331
3263
|
}
|
|
3332
3264
|
fprintf(f, " {\n");
|
|
3333
3265
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
3334
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
3266
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
3335
3267
|
fprintf(f, "\n");
|
|
3336
3268
|
fprintf(f, " if (val == Qundef) {\n");
|
|
3337
3269
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -3343,16 +3275,16 @@ switch (insn) {
|
|
|
3343
3275
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
3344
3276
|
fprintf(f, " }\n");
|
|
3345
3277
|
fprintf(f, " }\n");
|
|
3346
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
3278
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
3347
3279
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
3348
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
3280
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
3349
3281
|
if (!pc_moved_p) {
|
|
3350
3282
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
3351
3283
|
}
|
|
3352
3284
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
3353
3285
|
fprintf(f, " goto cancel;\n");
|
|
3354
3286
|
fprintf(f, " }\n");
|
|
3355
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
3287
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
3356
3288
|
}
|
|
3357
3289
|
fprintf(f, "}\n");
|
|
3358
3290
|
break;
|
|
@@ -3360,19 +3292,15 @@ switch (insn) {
|
|
|
3360
3292
|
fprintf(f, "{\n");
|
|
3361
3293
|
{
|
|
3362
3294
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
3363
|
-
MAYBE_UNUSED(
|
|
3364
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
3295
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3365
3296
|
if (status->local_stack_p) {
|
|
3366
3297
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
3367
3298
|
}
|
|
3368
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
3369
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
3299
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
3370
3300
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
3371
3301
|
|
|
3372
|
-
fprintf(f, "
|
|
3373
|
-
comment_id(f, ((
|
|
3374
|
-
fprintf(f, "\n");
|
|
3375
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
3302
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
3303
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
3376
3304
|
fprintf(f, "\n");
|
|
3377
3305
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
3378
3306
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -3397,20 +3325,20 @@ switch (insn) {
|
|
|
3397
3325
|
fprintf(f, " goto cancel;\n");
|
|
3398
3326
|
fprintf(f, " }\n");
|
|
3399
3327
|
fprintf(f, " }\n");
|
|
3400
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_plus(
|
|
3401
|
-
b->stack_size += attr_sp_inc_opt_plus(
|
|
3328
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_plus(cd) - 1);
|
|
3329
|
+
b->stack_size += attr_sp_inc_opt_plus(cd);
|
|
3402
3330
|
}
|
|
3403
3331
|
fprintf(f, "}\n");
|
|
3404
3332
|
break;
|
|
3405
3333
|
case BIN(opt_minus):
|
|
3406
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
3334
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
3407
3335
|
{
|
|
3408
3336
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
3409
|
-
MAYBE_UNUSED(
|
|
3410
|
-
|
|
3411
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
3337
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3338
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
3412
3339
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
3413
3340
|
const rb_iseq_t *iseq;
|
|
3341
|
+
const CALL_INFO ci = &cd->ci;
|
|
3414
3342
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
3415
3343
|
|
|
3416
3344
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -3423,7 +3351,7 @@ switch (insn) {
|
|
|
3423
3351
|
}
|
|
3424
3352
|
|
|
3425
3353
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
3426
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
3354
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
3427
3355
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
3428
3356
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
3429
3357
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -3436,7 +3364,7 @@ switch (insn) {
|
|
|
3436
3364
|
if (status->local_stack_p) {
|
|
3437
3365
|
{
|
|
3438
3366
|
rb_snum_t i, push_size;
|
|
3439
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
3367
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
3440
3368
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
3441
3369
|
for (i = 0; i < push_size; i++) {
|
|
3442
3370
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -3482,7 +3410,7 @@ switch (insn) {
|
|
|
3482
3410
|
fprintf(f, " }\n");
|
|
3483
3411
|
|
|
3484
3412
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
3485
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
3413
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
3486
3414
|
if (!pc_moved_p) {
|
|
3487
3415
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
3488
3416
|
}
|
|
@@ -3491,7 +3419,7 @@ switch (insn) {
|
|
|
3491
3419
|
fprintf(f, " }\n");
|
|
3492
3420
|
}
|
|
3493
3421
|
|
|
3494
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
3422
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
3495
3423
|
|
|
3496
3424
|
fprintf(f, "}\n");
|
|
3497
3425
|
break;
|
|
@@ -3501,19 +3429,15 @@ switch (insn) {
|
|
|
3501
3429
|
fprintf(f, "{\n");
|
|
3502
3430
|
{
|
|
3503
3431
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
3504
|
-
MAYBE_UNUSED(
|
|
3505
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
3432
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3506
3433
|
if (status->local_stack_p) {
|
|
3507
3434
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
3508
3435
|
}
|
|
3509
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
3510
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
3436
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
3511
3437
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
3512
3438
|
|
|
3513
|
-
fprintf(f, "
|
|
3514
|
-
comment_id(f, ((
|
|
3515
|
-
fprintf(f, "\n");
|
|
3516
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
3439
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
3440
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
3517
3441
|
fprintf(f, "\n");
|
|
3518
3442
|
if (body->catch_except_p || TRUE) {
|
|
3519
3443
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -3522,7 +3446,7 @@ switch (insn) {
|
|
|
3522
3446
|
if (status->local_stack_p) {
|
|
3523
3447
|
{
|
|
3524
3448
|
rb_snum_t i, push_size;
|
|
3525
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
3449
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
3526
3450
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
3527
3451
|
for (i = 0; i < push_size; i++) {
|
|
3528
3452
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -3534,7 +3458,7 @@ switch (insn) {
|
|
|
3534
3458
|
}
|
|
3535
3459
|
fprintf(f, " {\n");
|
|
3536
3460
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
3537
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
3461
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
3538
3462
|
fprintf(f, "\n");
|
|
3539
3463
|
fprintf(f, " if (val == Qundef) {\n");
|
|
3540
3464
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -3546,16 +3470,16 @@ switch (insn) {
|
|
|
3546
3470
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
3547
3471
|
fprintf(f, " }\n");
|
|
3548
3472
|
fprintf(f, " }\n");
|
|
3549
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
3473
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
3550
3474
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
3551
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
3475
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
3552
3476
|
if (!pc_moved_p) {
|
|
3553
3477
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
3554
3478
|
}
|
|
3555
3479
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
3556
3480
|
fprintf(f, " goto cancel;\n");
|
|
3557
3481
|
fprintf(f, " }\n");
|
|
3558
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
3482
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
3559
3483
|
}
|
|
3560
3484
|
fprintf(f, "}\n");
|
|
3561
3485
|
break;
|
|
@@ -3563,19 +3487,15 @@ switch (insn) {
|
|
|
3563
3487
|
fprintf(f, "{\n");
|
|
3564
3488
|
{
|
|
3565
3489
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
3566
|
-
MAYBE_UNUSED(
|
|
3567
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
3490
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3568
3491
|
if (status->local_stack_p) {
|
|
3569
3492
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
3570
3493
|
}
|
|
3571
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
3572
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
3494
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
3573
3495
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
3574
3496
|
|
|
3575
|
-
fprintf(f, "
|
|
3576
|
-
comment_id(f, ((
|
|
3577
|
-
fprintf(f, "\n");
|
|
3578
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
3497
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
3498
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
3579
3499
|
fprintf(f, "\n");
|
|
3580
3500
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
3581
3501
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -3600,20 +3520,20 @@ switch (insn) {
|
|
|
3600
3520
|
fprintf(f, " goto cancel;\n");
|
|
3601
3521
|
fprintf(f, " }\n");
|
|
3602
3522
|
fprintf(f, " }\n");
|
|
3603
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_minus(
|
|
3604
|
-
b->stack_size += attr_sp_inc_opt_minus(
|
|
3523
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_minus(cd) - 1);
|
|
3524
|
+
b->stack_size += attr_sp_inc_opt_minus(cd);
|
|
3605
3525
|
}
|
|
3606
3526
|
fprintf(f, "}\n");
|
|
3607
3527
|
break;
|
|
3608
3528
|
case BIN(opt_mult):
|
|
3609
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
3529
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
3610
3530
|
{
|
|
3611
3531
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
3612
|
-
MAYBE_UNUSED(
|
|
3613
|
-
|
|
3614
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
3532
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3533
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
3615
3534
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
3616
3535
|
const rb_iseq_t *iseq;
|
|
3536
|
+
const CALL_INFO ci = &cd->ci;
|
|
3617
3537
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
3618
3538
|
|
|
3619
3539
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -3626,7 +3546,7 @@ switch (insn) {
|
|
|
3626
3546
|
}
|
|
3627
3547
|
|
|
3628
3548
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
3629
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
3549
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
3630
3550
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
3631
3551
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
3632
3552
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -3639,7 +3559,7 @@ switch (insn) {
|
|
|
3639
3559
|
if (status->local_stack_p) {
|
|
3640
3560
|
{
|
|
3641
3561
|
rb_snum_t i, push_size;
|
|
3642
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
3562
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
3643
3563
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
3644
3564
|
for (i = 0; i < push_size; i++) {
|
|
3645
3565
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -3685,7 +3605,7 @@ switch (insn) {
|
|
|
3685
3605
|
fprintf(f, " }\n");
|
|
3686
3606
|
|
|
3687
3607
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
3688
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
3608
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
3689
3609
|
if (!pc_moved_p) {
|
|
3690
3610
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
3691
3611
|
}
|
|
@@ -3694,7 +3614,7 @@ switch (insn) {
|
|
|
3694
3614
|
fprintf(f, " }\n");
|
|
3695
3615
|
}
|
|
3696
3616
|
|
|
3697
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
3617
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
3698
3618
|
|
|
3699
3619
|
fprintf(f, "}\n");
|
|
3700
3620
|
break;
|
|
@@ -3704,19 +3624,15 @@ switch (insn) {
|
|
|
3704
3624
|
fprintf(f, "{\n");
|
|
3705
3625
|
{
|
|
3706
3626
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
3707
|
-
MAYBE_UNUSED(
|
|
3708
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
3627
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3709
3628
|
if (status->local_stack_p) {
|
|
3710
3629
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
3711
3630
|
}
|
|
3712
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
3713
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
3631
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
3714
3632
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
3715
3633
|
|
|
3716
|
-
fprintf(f, "
|
|
3717
|
-
comment_id(f, ((
|
|
3718
|
-
fprintf(f, "\n");
|
|
3719
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
3634
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
3635
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
3720
3636
|
fprintf(f, "\n");
|
|
3721
3637
|
if (body->catch_except_p || TRUE) {
|
|
3722
3638
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -3725,7 +3641,7 @@ switch (insn) {
|
|
|
3725
3641
|
if (status->local_stack_p) {
|
|
3726
3642
|
{
|
|
3727
3643
|
rb_snum_t i, push_size;
|
|
3728
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
3644
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
3729
3645
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
3730
3646
|
for (i = 0; i < push_size; i++) {
|
|
3731
3647
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -3737,7 +3653,7 @@ switch (insn) {
|
|
|
3737
3653
|
}
|
|
3738
3654
|
fprintf(f, " {\n");
|
|
3739
3655
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
3740
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
3656
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
3741
3657
|
fprintf(f, "\n");
|
|
3742
3658
|
fprintf(f, " if (val == Qundef) {\n");
|
|
3743
3659
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -3749,16 +3665,16 @@ switch (insn) {
|
|
|
3749
3665
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
3750
3666
|
fprintf(f, " }\n");
|
|
3751
3667
|
fprintf(f, " }\n");
|
|
3752
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
3668
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
3753
3669
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
3754
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
3670
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
3755
3671
|
if (!pc_moved_p) {
|
|
3756
3672
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
3757
3673
|
}
|
|
3758
3674
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
3759
3675
|
fprintf(f, " goto cancel;\n");
|
|
3760
3676
|
fprintf(f, " }\n");
|
|
3761
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
3677
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
3762
3678
|
}
|
|
3763
3679
|
fprintf(f, "}\n");
|
|
3764
3680
|
break;
|
|
@@ -3766,19 +3682,15 @@ switch (insn) {
|
|
|
3766
3682
|
fprintf(f, "{\n");
|
|
3767
3683
|
{
|
|
3768
3684
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
3769
|
-
MAYBE_UNUSED(
|
|
3770
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
3685
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3771
3686
|
if (status->local_stack_p) {
|
|
3772
3687
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
3773
3688
|
}
|
|
3774
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
3775
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
3689
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
3776
3690
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
3777
3691
|
|
|
3778
|
-
fprintf(f, "
|
|
3779
|
-
comment_id(f, ((
|
|
3780
|
-
fprintf(f, "\n");
|
|
3781
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
3692
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
3693
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
3782
3694
|
fprintf(f, "\n");
|
|
3783
3695
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
3784
3696
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -3803,20 +3715,20 @@ switch (insn) {
|
|
|
3803
3715
|
fprintf(f, " goto cancel;\n");
|
|
3804
3716
|
fprintf(f, " }\n");
|
|
3805
3717
|
fprintf(f, " }\n");
|
|
3806
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_mult(
|
|
3807
|
-
b->stack_size += attr_sp_inc_opt_mult(
|
|
3718
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_mult(cd) - 1);
|
|
3719
|
+
b->stack_size += attr_sp_inc_opt_mult(cd);
|
|
3808
3720
|
}
|
|
3809
3721
|
fprintf(f, "}\n");
|
|
3810
3722
|
break;
|
|
3811
3723
|
case BIN(opt_div):
|
|
3812
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
3724
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
3813
3725
|
{
|
|
3814
3726
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
3815
|
-
MAYBE_UNUSED(
|
|
3816
|
-
|
|
3817
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
3727
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3728
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
3818
3729
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
3819
3730
|
const rb_iseq_t *iseq;
|
|
3731
|
+
const CALL_INFO ci = &cd->ci;
|
|
3820
3732
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
3821
3733
|
|
|
3822
3734
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -3829,7 +3741,7 @@ switch (insn) {
|
|
|
3829
3741
|
}
|
|
3830
3742
|
|
|
3831
3743
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
3832
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
3744
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
3833
3745
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
3834
3746
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
3835
3747
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -3842,7 +3754,7 @@ switch (insn) {
|
|
|
3842
3754
|
if (status->local_stack_p) {
|
|
3843
3755
|
{
|
|
3844
3756
|
rb_snum_t i, push_size;
|
|
3845
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
3757
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
3846
3758
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
3847
3759
|
for (i = 0; i < push_size; i++) {
|
|
3848
3760
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -3888,7 +3800,7 @@ switch (insn) {
|
|
|
3888
3800
|
fprintf(f, " }\n");
|
|
3889
3801
|
|
|
3890
3802
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
3891
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
3803
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
3892
3804
|
if (!pc_moved_p) {
|
|
3893
3805
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
3894
3806
|
}
|
|
@@ -3897,7 +3809,7 @@ switch (insn) {
|
|
|
3897
3809
|
fprintf(f, " }\n");
|
|
3898
3810
|
}
|
|
3899
3811
|
|
|
3900
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
3812
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
3901
3813
|
|
|
3902
3814
|
fprintf(f, "}\n");
|
|
3903
3815
|
break;
|
|
@@ -3907,19 +3819,15 @@ switch (insn) {
|
|
|
3907
3819
|
fprintf(f, "{\n");
|
|
3908
3820
|
{
|
|
3909
3821
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
3910
|
-
MAYBE_UNUSED(
|
|
3911
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
3822
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3912
3823
|
if (status->local_stack_p) {
|
|
3913
3824
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
3914
3825
|
}
|
|
3915
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
3916
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
3826
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
3917
3827
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
3918
3828
|
|
|
3919
|
-
fprintf(f, "
|
|
3920
|
-
comment_id(f, ((
|
|
3921
|
-
fprintf(f, "\n");
|
|
3922
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
3829
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
3830
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
3923
3831
|
fprintf(f, "\n");
|
|
3924
3832
|
if (body->catch_except_p || TRUE) {
|
|
3925
3833
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -3928,7 +3836,7 @@ switch (insn) {
|
|
|
3928
3836
|
if (status->local_stack_p) {
|
|
3929
3837
|
{
|
|
3930
3838
|
rb_snum_t i, push_size;
|
|
3931
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
3839
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
3932
3840
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
3933
3841
|
for (i = 0; i < push_size; i++) {
|
|
3934
3842
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -3940,7 +3848,7 @@ switch (insn) {
|
|
|
3940
3848
|
}
|
|
3941
3849
|
fprintf(f, " {\n");
|
|
3942
3850
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
3943
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
3851
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
3944
3852
|
fprintf(f, "\n");
|
|
3945
3853
|
fprintf(f, " if (val == Qundef) {\n");
|
|
3946
3854
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -3952,16 +3860,16 @@ switch (insn) {
|
|
|
3952
3860
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
3953
3861
|
fprintf(f, " }\n");
|
|
3954
3862
|
fprintf(f, " }\n");
|
|
3955
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
3863
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
3956
3864
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
3957
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
3865
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
3958
3866
|
if (!pc_moved_p) {
|
|
3959
3867
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
3960
3868
|
}
|
|
3961
3869
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
3962
3870
|
fprintf(f, " goto cancel;\n");
|
|
3963
3871
|
fprintf(f, " }\n");
|
|
3964
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
3872
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
3965
3873
|
}
|
|
3966
3874
|
fprintf(f, "}\n");
|
|
3967
3875
|
break;
|
|
@@ -3969,19 +3877,15 @@ switch (insn) {
|
|
|
3969
3877
|
fprintf(f, "{\n");
|
|
3970
3878
|
{
|
|
3971
3879
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
3972
|
-
MAYBE_UNUSED(
|
|
3973
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
3880
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3974
3881
|
if (status->local_stack_p) {
|
|
3975
3882
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
3976
3883
|
}
|
|
3977
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
3978
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
3884
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
3979
3885
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
3980
3886
|
|
|
3981
|
-
fprintf(f, "
|
|
3982
|
-
comment_id(f, ((
|
|
3983
|
-
fprintf(f, "\n");
|
|
3984
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
3887
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
3888
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
3985
3889
|
fprintf(f, "\n");
|
|
3986
3890
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
3987
3891
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -4006,28 +3910,28 @@ switch (insn) {
|
|
|
4006
3910
|
fprintf(f, " goto cancel;\n");
|
|
4007
3911
|
fprintf(f, " }\n");
|
|
4008
3912
|
fprintf(f, " }\n");
|
|
4009
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_div(
|
|
3913
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_div(cd) - 1);
|
|
4010
3914
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
4011
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_div(
|
|
3915
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_div(cd));
|
|
4012
3916
|
if (!pc_moved_p) {
|
|
4013
3917
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
4014
3918
|
}
|
|
4015
3919
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
4016
3920
|
fprintf(f, " goto cancel;\n");
|
|
4017
3921
|
fprintf(f, " }\n");
|
|
4018
|
-
b->stack_size += attr_sp_inc_opt_div(
|
|
3922
|
+
b->stack_size += attr_sp_inc_opt_div(cd);
|
|
4019
3923
|
}
|
|
4020
3924
|
fprintf(f, "}\n");
|
|
4021
3925
|
break;
|
|
4022
3926
|
case BIN(opt_mod):
|
|
4023
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
3927
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
4024
3928
|
{
|
|
4025
3929
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4026
|
-
MAYBE_UNUSED(
|
|
4027
|
-
|
|
4028
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
3930
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
3931
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
4029
3932
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
4030
3933
|
const rb_iseq_t *iseq;
|
|
3934
|
+
const CALL_INFO ci = &cd->ci;
|
|
4031
3935
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
4032
3936
|
|
|
4033
3937
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -4040,7 +3944,7 @@ switch (insn) {
|
|
|
4040
3944
|
}
|
|
4041
3945
|
|
|
4042
3946
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
4043
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
3947
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
4044
3948
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
4045
3949
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
4046
3950
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -4053,7 +3957,7 @@ switch (insn) {
|
|
|
4053
3957
|
if (status->local_stack_p) {
|
|
4054
3958
|
{
|
|
4055
3959
|
rb_snum_t i, push_size;
|
|
4056
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
3960
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
4057
3961
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
4058
3962
|
for (i = 0; i < push_size; i++) {
|
|
4059
3963
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -4099,7 +4003,7 @@ switch (insn) {
|
|
|
4099
4003
|
fprintf(f, " }\n");
|
|
4100
4004
|
|
|
4101
4005
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
4102
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4006
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
4103
4007
|
if (!pc_moved_p) {
|
|
4104
4008
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
4105
4009
|
}
|
|
@@ -4108,7 +4012,7 @@ switch (insn) {
|
|
|
4108
4012
|
fprintf(f, " }\n");
|
|
4109
4013
|
}
|
|
4110
4014
|
|
|
4111
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
4015
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
4112
4016
|
|
|
4113
4017
|
fprintf(f, "}\n");
|
|
4114
4018
|
break;
|
|
@@ -4118,19 +4022,15 @@ switch (insn) {
|
|
|
4118
4022
|
fprintf(f, "{\n");
|
|
4119
4023
|
{
|
|
4120
4024
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4121
|
-
MAYBE_UNUSED(
|
|
4122
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
4025
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4123
4026
|
if (status->local_stack_p) {
|
|
4124
4027
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
4125
4028
|
}
|
|
4126
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
4127
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
4029
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
4128
4030
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
4129
4031
|
|
|
4130
|
-
fprintf(f, "
|
|
4131
|
-
comment_id(f, ((
|
|
4132
|
-
fprintf(f, "\n");
|
|
4133
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
4032
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
4033
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
4134
4034
|
fprintf(f, "\n");
|
|
4135
4035
|
if (body->catch_except_p || TRUE) {
|
|
4136
4036
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -4139,7 +4039,7 @@ switch (insn) {
|
|
|
4139
4039
|
if (status->local_stack_p) {
|
|
4140
4040
|
{
|
|
4141
4041
|
rb_snum_t i, push_size;
|
|
4142
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
4042
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
4143
4043
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
4144
4044
|
for (i = 0; i < push_size; i++) {
|
|
4145
4045
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -4151,7 +4051,7 @@ switch (insn) {
|
|
|
4151
4051
|
}
|
|
4152
4052
|
fprintf(f, " {\n");
|
|
4153
4053
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
4154
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
4054
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
4155
4055
|
fprintf(f, "\n");
|
|
4156
4056
|
fprintf(f, " if (val == Qundef) {\n");
|
|
4157
4057
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -4163,16 +4063,16 @@ switch (insn) {
|
|
|
4163
4063
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
4164
4064
|
fprintf(f, " }\n");
|
|
4165
4065
|
fprintf(f, " }\n");
|
|
4166
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4066
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
4167
4067
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
4168
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4068
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
4169
4069
|
if (!pc_moved_p) {
|
|
4170
4070
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
4171
4071
|
}
|
|
4172
4072
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
4173
4073
|
fprintf(f, " goto cancel;\n");
|
|
4174
4074
|
fprintf(f, " }\n");
|
|
4175
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
4075
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
4176
4076
|
}
|
|
4177
4077
|
fprintf(f, "}\n");
|
|
4178
4078
|
break;
|
|
@@ -4180,19 +4080,15 @@ switch (insn) {
|
|
|
4180
4080
|
fprintf(f, "{\n");
|
|
4181
4081
|
{
|
|
4182
4082
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4183
|
-
MAYBE_UNUSED(
|
|
4184
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
4083
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4185
4084
|
if (status->local_stack_p) {
|
|
4186
4085
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
4187
4086
|
}
|
|
4188
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
4189
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
4087
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
4190
4088
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
4191
4089
|
|
|
4192
|
-
fprintf(f, "
|
|
4193
|
-
comment_id(f, ((
|
|
4194
|
-
fprintf(f, "\n");
|
|
4195
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
4090
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
4091
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
4196
4092
|
fprintf(f, "\n");
|
|
4197
4093
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
4198
4094
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -4217,28 +4113,28 @@ switch (insn) {
|
|
|
4217
4113
|
fprintf(f, " goto cancel;\n");
|
|
4218
4114
|
fprintf(f, " }\n");
|
|
4219
4115
|
fprintf(f, " }\n");
|
|
4220
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_mod(
|
|
4116
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_mod(cd) - 1);
|
|
4221
4117
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
4222
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_mod(
|
|
4118
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_mod(cd));
|
|
4223
4119
|
if (!pc_moved_p) {
|
|
4224
4120
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
4225
4121
|
}
|
|
4226
4122
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
4227
4123
|
fprintf(f, " goto cancel;\n");
|
|
4228
4124
|
fprintf(f, " }\n");
|
|
4229
|
-
b->stack_size += attr_sp_inc_opt_mod(
|
|
4125
|
+
b->stack_size += attr_sp_inc_opt_mod(cd);
|
|
4230
4126
|
}
|
|
4231
4127
|
fprintf(f, "}\n");
|
|
4232
4128
|
break;
|
|
4233
4129
|
case BIN(opt_eq):
|
|
4234
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
4130
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
4235
4131
|
{
|
|
4236
4132
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4237
|
-
MAYBE_UNUSED(
|
|
4238
|
-
|
|
4239
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
4133
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4134
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
4240
4135
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
4241
4136
|
const rb_iseq_t *iseq;
|
|
4137
|
+
const CALL_INFO ci = &cd->ci;
|
|
4242
4138
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
4243
4139
|
|
|
4244
4140
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -4251,7 +4147,7 @@ switch (insn) {
|
|
|
4251
4147
|
}
|
|
4252
4148
|
|
|
4253
4149
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
4254
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
4150
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
4255
4151
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
4256
4152
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
4257
4153
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -4264,7 +4160,7 @@ switch (insn) {
|
|
|
4264
4160
|
if (status->local_stack_p) {
|
|
4265
4161
|
{
|
|
4266
4162
|
rb_snum_t i, push_size;
|
|
4267
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
4163
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
4268
4164
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
4269
4165
|
for (i = 0; i < push_size; i++) {
|
|
4270
4166
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -4310,7 +4206,7 @@ switch (insn) {
|
|
|
4310
4206
|
fprintf(f, " }\n");
|
|
4311
4207
|
|
|
4312
4208
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
4313
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4209
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
4314
4210
|
if (!pc_moved_p) {
|
|
4315
4211
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
4316
4212
|
}
|
|
@@ -4319,7 +4215,7 @@ switch (insn) {
|
|
|
4319
4215
|
fprintf(f, " }\n");
|
|
4320
4216
|
}
|
|
4321
4217
|
|
|
4322
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
4218
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
4323
4219
|
|
|
4324
4220
|
fprintf(f, "}\n");
|
|
4325
4221
|
break;
|
|
@@ -4329,19 +4225,15 @@ switch (insn) {
|
|
|
4329
4225
|
fprintf(f, "{\n");
|
|
4330
4226
|
{
|
|
4331
4227
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4332
|
-
MAYBE_UNUSED(
|
|
4333
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
4228
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4334
4229
|
if (status->local_stack_p) {
|
|
4335
4230
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
4336
4231
|
}
|
|
4337
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
4338
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
4232
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
4339
4233
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
4340
4234
|
|
|
4341
|
-
fprintf(f, "
|
|
4342
|
-
comment_id(f, ((
|
|
4343
|
-
fprintf(f, "\n");
|
|
4344
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
4235
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
4236
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
4345
4237
|
fprintf(f, "\n");
|
|
4346
4238
|
if (body->catch_except_p || TRUE) {
|
|
4347
4239
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -4350,7 +4242,7 @@ switch (insn) {
|
|
|
4350
4242
|
if (status->local_stack_p) {
|
|
4351
4243
|
{
|
|
4352
4244
|
rb_snum_t i, push_size;
|
|
4353
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
4245
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
4354
4246
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
4355
4247
|
for (i = 0; i < push_size; i++) {
|
|
4356
4248
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -4362,7 +4254,7 @@ switch (insn) {
|
|
|
4362
4254
|
}
|
|
4363
4255
|
fprintf(f, " {\n");
|
|
4364
4256
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
4365
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
4257
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
4366
4258
|
fprintf(f, "\n");
|
|
4367
4259
|
fprintf(f, " if (val == Qundef) {\n");
|
|
4368
4260
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -4374,16 +4266,16 @@ switch (insn) {
|
|
|
4374
4266
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
4375
4267
|
fprintf(f, " }\n");
|
|
4376
4268
|
fprintf(f, " }\n");
|
|
4377
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4269
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
4378
4270
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
4379
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4271
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
4380
4272
|
if (!pc_moved_p) {
|
|
4381
4273
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
4382
4274
|
}
|
|
4383
4275
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
4384
4276
|
fprintf(f, " goto cancel;\n");
|
|
4385
4277
|
fprintf(f, " }\n");
|
|
4386
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
4278
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
4387
4279
|
}
|
|
4388
4280
|
fprintf(f, "}\n");
|
|
4389
4281
|
break;
|
|
@@ -4391,19 +4283,15 @@ switch (insn) {
|
|
|
4391
4283
|
fprintf(f, "{\n");
|
|
4392
4284
|
{
|
|
4393
4285
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4394
|
-
MAYBE_UNUSED(
|
|
4395
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
4286
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4396
4287
|
if (status->local_stack_p) {
|
|
4397
4288
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
4398
4289
|
}
|
|
4399
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
4400
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
4290
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
4401
4291
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
4402
4292
|
|
|
4403
|
-
fprintf(f, "
|
|
4404
|
-
comment_id(f, ((
|
|
4405
|
-
fprintf(f, "\n");
|
|
4406
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
4293
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
4294
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
4407
4295
|
fprintf(f, "\n");
|
|
4408
4296
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
4409
4297
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -4417,7 +4305,7 @@ switch (insn) {
|
|
|
4417
4305
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
4418
4306
|
}
|
|
4419
4307
|
fprintf(f, " {\n");
|
|
4420
|
-
fprintf(f, " val = opt_eq_func(recv, obj,
|
|
4308
|
+
fprintf(f, " val = opt_eq_func(recv, obj, cd);\n");
|
|
4421
4309
|
fprintf(f, "\n");
|
|
4422
4310
|
fprintf(f, " if (val == Qundef) {\n");
|
|
4423
4311
|
if (status->local_stack_p) {
|
|
@@ -4428,8 +4316,8 @@ switch (insn) {
|
|
|
4428
4316
|
fprintf(f, " goto cancel;\n");
|
|
4429
4317
|
fprintf(f, " }\n");
|
|
4430
4318
|
fprintf(f, " }\n");
|
|
4431
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_eq(
|
|
4432
|
-
b->stack_size += attr_sp_inc_opt_eq(
|
|
4319
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_eq(cd) - 1);
|
|
4320
|
+
b->stack_size += attr_sp_inc_opt_eq(cd);
|
|
4433
4321
|
}
|
|
4434
4322
|
fprintf(f, "}\n");
|
|
4435
4323
|
break;
|
|
@@ -4437,26 +4325,19 @@ switch (insn) {
|
|
|
4437
4325
|
fprintf(f, "{\n");
|
|
4438
4326
|
{
|
|
4439
4327
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4440
|
-
MAYBE_UNUSED(
|
|
4441
|
-
MAYBE_UNUSED(
|
|
4442
|
-
MAYBE_UNUSED(CALL_INFO ci) = (CALL_INFO)operands[2];
|
|
4443
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[3];
|
|
4328
|
+
MAYBE_UNUSED(CALL_DATA cd_eq) = (CALL_DATA)operands[0];
|
|
4329
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[1];
|
|
4444
4330
|
if (status->local_stack_p) {
|
|
4445
4331
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
4446
4332
|
}
|
|
4447
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
4448
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci, ci_eq;\n");
|
|
4333
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd, cd_eq;\n");
|
|
4449
4334
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
4450
4335
|
|
|
4451
|
-
fprintf(f, "
|
|
4452
|
-
comment_id(f, ((
|
|
4453
|
-
fprintf(f, "\n");
|
|
4454
|
-
fprintf(f, " cc_eq = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
4336
|
+
fprintf(f, " cd_eq = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
4337
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
4455
4338
|
fprintf(f, "\n");
|
|
4456
|
-
fprintf(f, "
|
|
4457
|
-
comment_id(f, ((
|
|
4458
|
-
fprintf(f, "\n");
|
|
4459
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[3]);
|
|
4339
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[1]);
|
|
4340
|
+
comment_id(f, ((CALL_DATA)operands[1])->ci.mid);
|
|
4460
4341
|
fprintf(f, "\n");
|
|
4461
4342
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
4462
4343
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -4470,7 +4351,7 @@ switch (insn) {
|
|
|
4470
4351
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
4471
4352
|
}
|
|
4472
4353
|
fprintf(f, " {\n");
|
|
4473
|
-
fprintf(f, " val = vm_opt_neq(
|
|
4354
|
+
fprintf(f, " val = vm_opt_neq(cd, cd_eq, recv, obj);\n");
|
|
4474
4355
|
fprintf(f, "\n");
|
|
4475
4356
|
fprintf(f, " if (val == Qundef) {\n");
|
|
4476
4357
|
if (status->local_stack_p) {
|
|
@@ -4481,20 +4362,20 @@ switch (insn) {
|
|
|
4481
4362
|
fprintf(f, " goto cancel;\n");
|
|
4482
4363
|
fprintf(f, " }\n");
|
|
4483
4364
|
fprintf(f, " }\n");
|
|
4484
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_neq(
|
|
4485
|
-
b->stack_size += attr_sp_inc_opt_neq(
|
|
4365
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_neq(cd_eq, cd) - 1);
|
|
4366
|
+
b->stack_size += attr_sp_inc_opt_neq(cd_eq, cd);
|
|
4486
4367
|
}
|
|
4487
4368
|
fprintf(f, "}\n");
|
|
4488
4369
|
break;
|
|
4489
4370
|
case BIN(opt_lt):
|
|
4490
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
4371
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
4491
4372
|
{
|
|
4492
4373
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4493
|
-
MAYBE_UNUSED(
|
|
4494
|
-
|
|
4495
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
4374
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4375
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
4496
4376
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
4497
4377
|
const rb_iseq_t *iseq;
|
|
4378
|
+
const CALL_INFO ci = &cd->ci;
|
|
4498
4379
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
4499
4380
|
|
|
4500
4381
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -4507,7 +4388,7 @@ switch (insn) {
|
|
|
4507
4388
|
}
|
|
4508
4389
|
|
|
4509
4390
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
4510
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
4391
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
4511
4392
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
4512
4393
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
4513
4394
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -4520,7 +4401,7 @@ switch (insn) {
|
|
|
4520
4401
|
if (status->local_stack_p) {
|
|
4521
4402
|
{
|
|
4522
4403
|
rb_snum_t i, push_size;
|
|
4523
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
4404
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
4524
4405
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
4525
4406
|
for (i = 0; i < push_size; i++) {
|
|
4526
4407
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -4566,7 +4447,7 @@ switch (insn) {
|
|
|
4566
4447
|
fprintf(f, " }\n");
|
|
4567
4448
|
|
|
4568
4449
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
4569
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4450
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
4570
4451
|
if (!pc_moved_p) {
|
|
4571
4452
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
4572
4453
|
}
|
|
@@ -4575,7 +4456,7 @@ switch (insn) {
|
|
|
4575
4456
|
fprintf(f, " }\n");
|
|
4576
4457
|
}
|
|
4577
4458
|
|
|
4578
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
4459
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
4579
4460
|
|
|
4580
4461
|
fprintf(f, "}\n");
|
|
4581
4462
|
break;
|
|
@@ -4585,19 +4466,15 @@ switch (insn) {
|
|
|
4585
4466
|
fprintf(f, "{\n");
|
|
4586
4467
|
{
|
|
4587
4468
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4588
|
-
MAYBE_UNUSED(
|
|
4589
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
4469
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4590
4470
|
if (status->local_stack_p) {
|
|
4591
4471
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
4592
4472
|
}
|
|
4593
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
4594
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
4473
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
4595
4474
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
4596
4475
|
|
|
4597
|
-
fprintf(f, "
|
|
4598
|
-
comment_id(f, ((
|
|
4599
|
-
fprintf(f, "\n");
|
|
4600
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
4476
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
4477
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
4601
4478
|
fprintf(f, "\n");
|
|
4602
4479
|
if (body->catch_except_p || TRUE) {
|
|
4603
4480
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -4606,7 +4483,7 @@ switch (insn) {
|
|
|
4606
4483
|
if (status->local_stack_p) {
|
|
4607
4484
|
{
|
|
4608
4485
|
rb_snum_t i, push_size;
|
|
4609
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
4486
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
4610
4487
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
4611
4488
|
for (i = 0; i < push_size; i++) {
|
|
4612
4489
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -4618,7 +4495,7 @@ switch (insn) {
|
|
|
4618
4495
|
}
|
|
4619
4496
|
fprintf(f, " {\n");
|
|
4620
4497
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
4621
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
4498
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
4622
4499
|
fprintf(f, "\n");
|
|
4623
4500
|
fprintf(f, " if (val == Qundef) {\n");
|
|
4624
4501
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -4630,16 +4507,16 @@ switch (insn) {
|
|
|
4630
4507
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
4631
4508
|
fprintf(f, " }\n");
|
|
4632
4509
|
fprintf(f, " }\n");
|
|
4633
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4510
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
4634
4511
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
4635
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4512
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
4636
4513
|
if (!pc_moved_p) {
|
|
4637
4514
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
4638
4515
|
}
|
|
4639
4516
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
4640
4517
|
fprintf(f, " goto cancel;\n");
|
|
4641
4518
|
fprintf(f, " }\n");
|
|
4642
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
4519
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
4643
4520
|
}
|
|
4644
4521
|
fprintf(f, "}\n");
|
|
4645
4522
|
break;
|
|
@@ -4647,19 +4524,15 @@ switch (insn) {
|
|
|
4647
4524
|
fprintf(f, "{\n");
|
|
4648
4525
|
{
|
|
4649
4526
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4650
|
-
MAYBE_UNUSED(
|
|
4651
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
4527
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4652
4528
|
if (status->local_stack_p) {
|
|
4653
4529
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
4654
4530
|
}
|
|
4655
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
4656
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
4531
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
4657
4532
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
4658
4533
|
|
|
4659
|
-
fprintf(f, "
|
|
4660
|
-
comment_id(f, ((
|
|
4661
|
-
fprintf(f, "\n");
|
|
4662
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
4534
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
4535
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
4663
4536
|
fprintf(f, "\n");
|
|
4664
4537
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
4665
4538
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -4684,20 +4557,20 @@ switch (insn) {
|
|
|
4684
4557
|
fprintf(f, " goto cancel;\n");
|
|
4685
4558
|
fprintf(f, " }\n");
|
|
4686
4559
|
fprintf(f, " }\n");
|
|
4687
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_lt(
|
|
4688
|
-
b->stack_size += attr_sp_inc_opt_lt(
|
|
4560
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_lt(cd) - 1);
|
|
4561
|
+
b->stack_size += attr_sp_inc_opt_lt(cd);
|
|
4689
4562
|
}
|
|
4690
4563
|
fprintf(f, "}\n");
|
|
4691
4564
|
break;
|
|
4692
4565
|
case BIN(opt_le):
|
|
4693
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
4566
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
4694
4567
|
{
|
|
4695
4568
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4696
|
-
MAYBE_UNUSED(
|
|
4697
|
-
|
|
4698
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
4569
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4570
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
4699
4571
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
4700
4572
|
const rb_iseq_t *iseq;
|
|
4573
|
+
const CALL_INFO ci = &cd->ci;
|
|
4701
4574
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
4702
4575
|
|
|
4703
4576
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -4710,7 +4583,7 @@ switch (insn) {
|
|
|
4710
4583
|
}
|
|
4711
4584
|
|
|
4712
4585
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
4713
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
4586
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
4714
4587
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
4715
4588
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
4716
4589
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -4723,7 +4596,7 @@ switch (insn) {
|
|
|
4723
4596
|
if (status->local_stack_p) {
|
|
4724
4597
|
{
|
|
4725
4598
|
rb_snum_t i, push_size;
|
|
4726
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
4599
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
4727
4600
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
4728
4601
|
for (i = 0; i < push_size; i++) {
|
|
4729
4602
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -4769,7 +4642,7 @@ switch (insn) {
|
|
|
4769
4642
|
fprintf(f, " }\n");
|
|
4770
4643
|
|
|
4771
4644
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
4772
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4645
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
4773
4646
|
if (!pc_moved_p) {
|
|
4774
4647
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
4775
4648
|
}
|
|
@@ -4778,7 +4651,7 @@ switch (insn) {
|
|
|
4778
4651
|
fprintf(f, " }\n");
|
|
4779
4652
|
}
|
|
4780
4653
|
|
|
4781
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
4654
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
4782
4655
|
|
|
4783
4656
|
fprintf(f, "}\n");
|
|
4784
4657
|
break;
|
|
@@ -4788,19 +4661,15 @@ switch (insn) {
|
|
|
4788
4661
|
fprintf(f, "{\n");
|
|
4789
4662
|
{
|
|
4790
4663
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4791
|
-
MAYBE_UNUSED(
|
|
4792
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
4664
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4793
4665
|
if (status->local_stack_p) {
|
|
4794
4666
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
4795
4667
|
}
|
|
4796
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
4797
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
4668
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
4798
4669
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
4799
4670
|
|
|
4800
|
-
fprintf(f, "
|
|
4801
|
-
comment_id(f, ((
|
|
4802
|
-
fprintf(f, "\n");
|
|
4803
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
4671
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
4672
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
4804
4673
|
fprintf(f, "\n");
|
|
4805
4674
|
if (body->catch_except_p || TRUE) {
|
|
4806
4675
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -4809,7 +4678,7 @@ switch (insn) {
|
|
|
4809
4678
|
if (status->local_stack_p) {
|
|
4810
4679
|
{
|
|
4811
4680
|
rb_snum_t i, push_size;
|
|
4812
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
4681
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
4813
4682
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
4814
4683
|
for (i = 0; i < push_size; i++) {
|
|
4815
4684
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -4821,7 +4690,7 @@ switch (insn) {
|
|
|
4821
4690
|
}
|
|
4822
4691
|
fprintf(f, " {\n");
|
|
4823
4692
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
4824
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
4693
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
4825
4694
|
fprintf(f, "\n");
|
|
4826
4695
|
fprintf(f, " if (val == Qundef) {\n");
|
|
4827
4696
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -4833,16 +4702,16 @@ switch (insn) {
|
|
|
4833
4702
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
4834
4703
|
fprintf(f, " }\n");
|
|
4835
4704
|
fprintf(f, " }\n");
|
|
4836
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4705
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
4837
4706
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
4838
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4707
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
4839
4708
|
if (!pc_moved_p) {
|
|
4840
4709
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
4841
4710
|
}
|
|
4842
4711
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
4843
4712
|
fprintf(f, " goto cancel;\n");
|
|
4844
4713
|
fprintf(f, " }\n");
|
|
4845
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
4714
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
4846
4715
|
}
|
|
4847
4716
|
fprintf(f, "}\n");
|
|
4848
4717
|
break;
|
|
@@ -4850,19 +4719,15 @@ switch (insn) {
|
|
|
4850
4719
|
fprintf(f, "{\n");
|
|
4851
4720
|
{
|
|
4852
4721
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4853
|
-
MAYBE_UNUSED(
|
|
4854
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
4722
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4855
4723
|
if (status->local_stack_p) {
|
|
4856
4724
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
4857
4725
|
}
|
|
4858
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
4859
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
4726
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
4860
4727
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
4861
4728
|
|
|
4862
|
-
fprintf(f, "
|
|
4863
|
-
comment_id(f, ((
|
|
4864
|
-
fprintf(f, "\n");
|
|
4865
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
4729
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
4730
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
4866
4731
|
fprintf(f, "\n");
|
|
4867
4732
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
4868
4733
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -4887,20 +4752,20 @@ switch (insn) {
|
|
|
4887
4752
|
fprintf(f, " goto cancel;\n");
|
|
4888
4753
|
fprintf(f, " }\n");
|
|
4889
4754
|
fprintf(f, " }\n");
|
|
4890
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_le(
|
|
4891
|
-
b->stack_size += attr_sp_inc_opt_le(
|
|
4755
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_le(cd) - 1);
|
|
4756
|
+
b->stack_size += attr_sp_inc_opt_le(cd);
|
|
4892
4757
|
}
|
|
4893
4758
|
fprintf(f, "}\n");
|
|
4894
4759
|
break;
|
|
4895
4760
|
case BIN(opt_gt):
|
|
4896
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
4761
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
4897
4762
|
{
|
|
4898
4763
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4899
|
-
MAYBE_UNUSED(
|
|
4900
|
-
|
|
4901
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
4764
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4765
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
4902
4766
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
4903
4767
|
const rb_iseq_t *iseq;
|
|
4768
|
+
const CALL_INFO ci = &cd->ci;
|
|
4904
4769
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
4905
4770
|
|
|
4906
4771
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -4913,7 +4778,7 @@ switch (insn) {
|
|
|
4913
4778
|
}
|
|
4914
4779
|
|
|
4915
4780
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
4916
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
4781
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
4917
4782
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
4918
4783
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
4919
4784
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -4926,7 +4791,7 @@ switch (insn) {
|
|
|
4926
4791
|
if (status->local_stack_p) {
|
|
4927
4792
|
{
|
|
4928
4793
|
rb_snum_t i, push_size;
|
|
4929
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
4794
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
4930
4795
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
4931
4796
|
for (i = 0; i < push_size; i++) {
|
|
4932
4797
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -4972,7 +4837,7 @@ switch (insn) {
|
|
|
4972
4837
|
fprintf(f, " }\n");
|
|
4973
4838
|
|
|
4974
4839
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
4975
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4840
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
4976
4841
|
if (!pc_moved_p) {
|
|
4977
4842
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
4978
4843
|
}
|
|
@@ -4981,7 +4846,7 @@ switch (insn) {
|
|
|
4981
4846
|
fprintf(f, " }\n");
|
|
4982
4847
|
}
|
|
4983
4848
|
|
|
4984
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
4849
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
4985
4850
|
|
|
4986
4851
|
fprintf(f, "}\n");
|
|
4987
4852
|
break;
|
|
@@ -4991,19 +4856,15 @@ switch (insn) {
|
|
|
4991
4856
|
fprintf(f, "{\n");
|
|
4992
4857
|
{
|
|
4993
4858
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
4994
|
-
MAYBE_UNUSED(
|
|
4995
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
4859
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4996
4860
|
if (status->local_stack_p) {
|
|
4997
4861
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
4998
4862
|
}
|
|
4999
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
5000
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
4863
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
5001
4864
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
5002
4865
|
|
|
5003
|
-
fprintf(f, "
|
|
5004
|
-
comment_id(f, ((
|
|
5005
|
-
fprintf(f, "\n");
|
|
5006
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
4866
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
4867
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
5007
4868
|
fprintf(f, "\n");
|
|
5008
4869
|
if (body->catch_except_p || TRUE) {
|
|
5009
4870
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -5012,7 +4873,7 @@ switch (insn) {
|
|
|
5012
4873
|
if (status->local_stack_p) {
|
|
5013
4874
|
{
|
|
5014
4875
|
rb_snum_t i, push_size;
|
|
5015
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
4876
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
5016
4877
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
5017
4878
|
for (i = 0; i < push_size; i++) {
|
|
5018
4879
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -5024,7 +4885,7 @@ switch (insn) {
|
|
|
5024
4885
|
}
|
|
5025
4886
|
fprintf(f, " {\n");
|
|
5026
4887
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
5027
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
4888
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
5028
4889
|
fprintf(f, "\n");
|
|
5029
4890
|
fprintf(f, " if (val == Qundef) {\n");
|
|
5030
4891
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -5036,16 +4897,16 @@ switch (insn) {
|
|
|
5036
4897
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
5037
4898
|
fprintf(f, " }\n");
|
|
5038
4899
|
fprintf(f, " }\n");
|
|
5039
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4900
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
5040
4901
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
5041
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
4902
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
5042
4903
|
if (!pc_moved_p) {
|
|
5043
4904
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
5044
4905
|
}
|
|
5045
4906
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
5046
4907
|
fprintf(f, " goto cancel;\n");
|
|
5047
4908
|
fprintf(f, " }\n");
|
|
5048
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
4909
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
5049
4910
|
}
|
|
5050
4911
|
fprintf(f, "}\n");
|
|
5051
4912
|
break;
|
|
@@ -5053,19 +4914,15 @@ switch (insn) {
|
|
|
5053
4914
|
fprintf(f, "{\n");
|
|
5054
4915
|
{
|
|
5055
4916
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5056
|
-
MAYBE_UNUSED(
|
|
5057
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
4917
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5058
4918
|
if (status->local_stack_p) {
|
|
5059
4919
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
5060
4920
|
}
|
|
5061
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
5062
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
4921
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
5063
4922
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
5064
4923
|
|
|
5065
|
-
fprintf(f, "
|
|
5066
|
-
comment_id(f, ((
|
|
5067
|
-
fprintf(f, "\n");
|
|
5068
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
4924
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
4925
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
5069
4926
|
fprintf(f, "\n");
|
|
5070
4927
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
5071
4928
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -5090,20 +4947,20 @@ switch (insn) {
|
|
|
5090
4947
|
fprintf(f, " goto cancel;\n");
|
|
5091
4948
|
fprintf(f, " }\n");
|
|
5092
4949
|
fprintf(f, " }\n");
|
|
5093
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_gt(
|
|
5094
|
-
b->stack_size += attr_sp_inc_opt_gt(
|
|
4950
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_gt(cd) - 1);
|
|
4951
|
+
b->stack_size += attr_sp_inc_opt_gt(cd);
|
|
5095
4952
|
}
|
|
5096
4953
|
fprintf(f, "}\n");
|
|
5097
4954
|
break;
|
|
5098
4955
|
case BIN(opt_ge):
|
|
5099
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
4956
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
5100
4957
|
{
|
|
5101
4958
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5102
|
-
MAYBE_UNUSED(
|
|
5103
|
-
|
|
5104
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
4959
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
4960
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
5105
4961
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
5106
4962
|
const rb_iseq_t *iseq;
|
|
4963
|
+
const CALL_INFO ci = &cd->ci;
|
|
5107
4964
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
5108
4965
|
|
|
5109
4966
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -5116,7 +4973,7 @@ switch (insn) {
|
|
|
5116
4973
|
}
|
|
5117
4974
|
|
|
5118
4975
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
5119
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
4976
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
5120
4977
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
5121
4978
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
5122
4979
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -5129,7 +4986,7 @@ switch (insn) {
|
|
|
5129
4986
|
if (status->local_stack_p) {
|
|
5130
4987
|
{
|
|
5131
4988
|
rb_snum_t i, push_size;
|
|
5132
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
4989
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
5133
4990
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
5134
4991
|
for (i = 0; i < push_size; i++) {
|
|
5135
4992
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -5175,7 +5032,7 @@ switch (insn) {
|
|
|
5175
5032
|
fprintf(f, " }\n");
|
|
5176
5033
|
|
|
5177
5034
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
5178
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5035
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
5179
5036
|
if (!pc_moved_p) {
|
|
5180
5037
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
5181
5038
|
}
|
|
@@ -5184,7 +5041,7 @@ switch (insn) {
|
|
|
5184
5041
|
fprintf(f, " }\n");
|
|
5185
5042
|
}
|
|
5186
5043
|
|
|
5187
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
5044
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
5188
5045
|
|
|
5189
5046
|
fprintf(f, "}\n");
|
|
5190
5047
|
break;
|
|
@@ -5194,19 +5051,15 @@ switch (insn) {
|
|
|
5194
5051
|
fprintf(f, "{\n");
|
|
5195
5052
|
{
|
|
5196
5053
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5197
|
-
MAYBE_UNUSED(
|
|
5198
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
5054
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5199
5055
|
if (status->local_stack_p) {
|
|
5200
5056
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
5201
5057
|
}
|
|
5202
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
5203
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
5058
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
5204
5059
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
5205
5060
|
|
|
5206
|
-
fprintf(f, "
|
|
5207
|
-
comment_id(f, ((
|
|
5208
|
-
fprintf(f, "\n");
|
|
5209
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
5061
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
5062
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
5210
5063
|
fprintf(f, "\n");
|
|
5211
5064
|
if (body->catch_except_p || TRUE) {
|
|
5212
5065
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -5215,7 +5068,7 @@ switch (insn) {
|
|
|
5215
5068
|
if (status->local_stack_p) {
|
|
5216
5069
|
{
|
|
5217
5070
|
rb_snum_t i, push_size;
|
|
5218
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
5071
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
5219
5072
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
5220
5073
|
for (i = 0; i < push_size; i++) {
|
|
5221
5074
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -5227,7 +5080,7 @@ switch (insn) {
|
|
|
5227
5080
|
}
|
|
5228
5081
|
fprintf(f, " {\n");
|
|
5229
5082
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
5230
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
5083
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
5231
5084
|
fprintf(f, "\n");
|
|
5232
5085
|
fprintf(f, " if (val == Qundef) {\n");
|
|
5233
5086
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -5239,16 +5092,16 @@ switch (insn) {
|
|
|
5239
5092
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
5240
5093
|
fprintf(f, " }\n");
|
|
5241
5094
|
fprintf(f, " }\n");
|
|
5242
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5095
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
5243
5096
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
5244
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5097
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
5245
5098
|
if (!pc_moved_p) {
|
|
5246
5099
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
5247
5100
|
}
|
|
5248
5101
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
5249
5102
|
fprintf(f, " goto cancel;\n");
|
|
5250
5103
|
fprintf(f, " }\n");
|
|
5251
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
5104
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
5252
5105
|
}
|
|
5253
5106
|
fprintf(f, "}\n");
|
|
5254
5107
|
break;
|
|
@@ -5256,19 +5109,15 @@ switch (insn) {
|
|
|
5256
5109
|
fprintf(f, "{\n");
|
|
5257
5110
|
{
|
|
5258
5111
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5259
|
-
MAYBE_UNUSED(
|
|
5260
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
5112
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5261
5113
|
if (status->local_stack_p) {
|
|
5262
5114
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
5263
5115
|
}
|
|
5264
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
5265
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
5116
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
5266
5117
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
5267
5118
|
|
|
5268
|
-
fprintf(f, "
|
|
5269
|
-
comment_id(f, ((
|
|
5270
|
-
fprintf(f, "\n");
|
|
5271
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
5119
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
5120
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
5272
5121
|
fprintf(f, "\n");
|
|
5273
5122
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
5274
5123
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -5293,20 +5142,20 @@ switch (insn) {
|
|
|
5293
5142
|
fprintf(f, " goto cancel;\n");
|
|
5294
5143
|
fprintf(f, " }\n");
|
|
5295
5144
|
fprintf(f, " }\n");
|
|
5296
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_ge(
|
|
5297
|
-
b->stack_size += attr_sp_inc_opt_ge(
|
|
5145
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_ge(cd) - 1);
|
|
5146
|
+
b->stack_size += attr_sp_inc_opt_ge(cd);
|
|
5298
5147
|
}
|
|
5299
5148
|
fprintf(f, "}\n");
|
|
5300
5149
|
break;
|
|
5301
5150
|
case BIN(opt_ltlt):
|
|
5302
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
5151
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
5303
5152
|
{
|
|
5304
5153
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5305
|
-
MAYBE_UNUSED(
|
|
5306
|
-
|
|
5307
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
5154
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5155
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
5308
5156
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
5309
5157
|
const rb_iseq_t *iseq;
|
|
5158
|
+
const CALL_INFO ci = &cd->ci;
|
|
5310
5159
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
5311
5160
|
|
|
5312
5161
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -5319,7 +5168,7 @@ switch (insn) {
|
|
|
5319
5168
|
}
|
|
5320
5169
|
|
|
5321
5170
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
5322
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
5171
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
5323
5172
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
5324
5173
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
5325
5174
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -5332,7 +5181,7 @@ switch (insn) {
|
|
|
5332
5181
|
if (status->local_stack_p) {
|
|
5333
5182
|
{
|
|
5334
5183
|
rb_snum_t i, push_size;
|
|
5335
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
5184
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
5336
5185
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
5337
5186
|
for (i = 0; i < push_size; i++) {
|
|
5338
5187
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -5378,7 +5227,7 @@ switch (insn) {
|
|
|
5378
5227
|
fprintf(f, " }\n");
|
|
5379
5228
|
|
|
5380
5229
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
5381
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5230
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
5382
5231
|
if (!pc_moved_p) {
|
|
5383
5232
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
5384
5233
|
}
|
|
@@ -5387,7 +5236,7 @@ switch (insn) {
|
|
|
5387
5236
|
fprintf(f, " }\n");
|
|
5388
5237
|
}
|
|
5389
5238
|
|
|
5390
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
5239
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
5391
5240
|
|
|
5392
5241
|
fprintf(f, "}\n");
|
|
5393
5242
|
break;
|
|
@@ -5397,19 +5246,15 @@ switch (insn) {
|
|
|
5397
5246
|
fprintf(f, "{\n");
|
|
5398
5247
|
{
|
|
5399
5248
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5400
|
-
MAYBE_UNUSED(
|
|
5401
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
5249
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5402
5250
|
if (status->local_stack_p) {
|
|
5403
5251
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
5404
5252
|
}
|
|
5405
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
5406
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
5253
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
5407
5254
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
5408
5255
|
|
|
5409
|
-
fprintf(f, "
|
|
5410
|
-
comment_id(f, ((
|
|
5411
|
-
fprintf(f, "\n");
|
|
5412
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
5256
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
5257
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
5413
5258
|
fprintf(f, "\n");
|
|
5414
5259
|
if (body->catch_except_p || TRUE) {
|
|
5415
5260
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -5418,7 +5263,7 @@ switch (insn) {
|
|
|
5418
5263
|
if (status->local_stack_p) {
|
|
5419
5264
|
{
|
|
5420
5265
|
rb_snum_t i, push_size;
|
|
5421
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
5266
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
5422
5267
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
5423
5268
|
for (i = 0; i < push_size; i++) {
|
|
5424
5269
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -5430,7 +5275,7 @@ switch (insn) {
|
|
|
5430
5275
|
}
|
|
5431
5276
|
fprintf(f, " {\n");
|
|
5432
5277
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
5433
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
5278
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
5434
5279
|
fprintf(f, "\n");
|
|
5435
5280
|
fprintf(f, " if (val == Qundef) {\n");
|
|
5436
5281
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -5442,16 +5287,16 @@ switch (insn) {
|
|
|
5442
5287
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
5443
5288
|
fprintf(f, " }\n");
|
|
5444
5289
|
fprintf(f, " }\n");
|
|
5445
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5290
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
5446
5291
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
5447
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5292
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
5448
5293
|
if (!pc_moved_p) {
|
|
5449
5294
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
5450
5295
|
}
|
|
5451
5296
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
5452
5297
|
fprintf(f, " goto cancel;\n");
|
|
5453
5298
|
fprintf(f, " }\n");
|
|
5454
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
5299
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
5455
5300
|
}
|
|
5456
5301
|
fprintf(f, "}\n");
|
|
5457
5302
|
break;
|
|
@@ -5459,19 +5304,15 @@ switch (insn) {
|
|
|
5459
5304
|
fprintf(f, "{\n");
|
|
5460
5305
|
{
|
|
5461
5306
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5462
|
-
MAYBE_UNUSED(
|
|
5463
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
5307
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5464
5308
|
if (status->local_stack_p) {
|
|
5465
5309
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
5466
5310
|
}
|
|
5467
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
5468
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
5311
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
5469
5312
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
5470
5313
|
|
|
5471
|
-
fprintf(f, "
|
|
5472
|
-
comment_id(f, ((
|
|
5473
|
-
fprintf(f, "\n");
|
|
5474
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
5314
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
5315
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
5475
5316
|
fprintf(f, "\n");
|
|
5476
5317
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
5477
5318
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -5496,28 +5337,28 @@ switch (insn) {
|
|
|
5496
5337
|
fprintf(f, " goto cancel;\n");
|
|
5497
5338
|
fprintf(f, " }\n");
|
|
5498
5339
|
fprintf(f, " }\n");
|
|
5499
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_ltlt(
|
|
5340
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_ltlt(cd) - 1);
|
|
5500
5341
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
5501
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_ltlt(
|
|
5342
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_ltlt(cd));
|
|
5502
5343
|
if (!pc_moved_p) {
|
|
5503
5344
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
5504
5345
|
}
|
|
5505
5346
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
5506
5347
|
fprintf(f, " goto cancel;\n");
|
|
5507
5348
|
fprintf(f, " }\n");
|
|
5508
|
-
b->stack_size += attr_sp_inc_opt_ltlt(
|
|
5349
|
+
b->stack_size += attr_sp_inc_opt_ltlt(cd);
|
|
5509
5350
|
}
|
|
5510
5351
|
fprintf(f, "}\n");
|
|
5511
5352
|
break;
|
|
5512
5353
|
case BIN(opt_and):
|
|
5513
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
5354
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
5514
5355
|
{
|
|
5515
5356
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5516
|
-
MAYBE_UNUSED(
|
|
5517
|
-
|
|
5518
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
5357
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5358
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
5519
5359
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
5520
5360
|
const rb_iseq_t *iseq;
|
|
5361
|
+
const CALL_INFO ci = &cd->ci;
|
|
5521
5362
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
5522
5363
|
|
|
5523
5364
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -5530,7 +5371,7 @@ switch (insn) {
|
|
|
5530
5371
|
}
|
|
5531
5372
|
|
|
5532
5373
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
5533
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
5374
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
5534
5375
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
5535
5376
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
5536
5377
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -5543,7 +5384,7 @@ switch (insn) {
|
|
|
5543
5384
|
if (status->local_stack_p) {
|
|
5544
5385
|
{
|
|
5545
5386
|
rb_snum_t i, push_size;
|
|
5546
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
5387
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
5547
5388
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
5548
5389
|
for (i = 0; i < push_size; i++) {
|
|
5549
5390
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -5589,7 +5430,7 @@ switch (insn) {
|
|
|
5589
5430
|
fprintf(f, " }\n");
|
|
5590
5431
|
|
|
5591
5432
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
5592
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5433
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
5593
5434
|
if (!pc_moved_p) {
|
|
5594
5435
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
5595
5436
|
}
|
|
@@ -5598,7 +5439,7 @@ switch (insn) {
|
|
|
5598
5439
|
fprintf(f, " }\n");
|
|
5599
5440
|
}
|
|
5600
5441
|
|
|
5601
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
5442
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
5602
5443
|
|
|
5603
5444
|
fprintf(f, "}\n");
|
|
5604
5445
|
break;
|
|
@@ -5608,19 +5449,15 @@ switch (insn) {
|
|
|
5608
5449
|
fprintf(f, "{\n");
|
|
5609
5450
|
{
|
|
5610
5451
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5611
|
-
MAYBE_UNUSED(
|
|
5612
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
5452
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5613
5453
|
if (status->local_stack_p) {
|
|
5614
5454
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
5615
5455
|
}
|
|
5616
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
5617
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
5456
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
5618
5457
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
5619
5458
|
|
|
5620
|
-
fprintf(f, "
|
|
5621
|
-
comment_id(f, ((
|
|
5622
|
-
fprintf(f, "\n");
|
|
5623
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
5459
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
5460
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
5624
5461
|
fprintf(f, "\n");
|
|
5625
5462
|
if (body->catch_except_p || TRUE) {
|
|
5626
5463
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -5629,7 +5466,7 @@ switch (insn) {
|
|
|
5629
5466
|
if (status->local_stack_p) {
|
|
5630
5467
|
{
|
|
5631
5468
|
rb_snum_t i, push_size;
|
|
5632
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
5469
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
5633
5470
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
5634
5471
|
for (i = 0; i < push_size; i++) {
|
|
5635
5472
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -5641,7 +5478,7 @@ switch (insn) {
|
|
|
5641
5478
|
}
|
|
5642
5479
|
fprintf(f, " {\n");
|
|
5643
5480
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
5644
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
5481
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
5645
5482
|
fprintf(f, "\n");
|
|
5646
5483
|
fprintf(f, " if (val == Qundef) {\n");
|
|
5647
5484
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -5653,16 +5490,16 @@ switch (insn) {
|
|
|
5653
5490
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
5654
5491
|
fprintf(f, " }\n");
|
|
5655
5492
|
fprintf(f, " }\n");
|
|
5656
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5493
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
5657
5494
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
5658
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5495
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
5659
5496
|
if (!pc_moved_p) {
|
|
5660
5497
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
5661
5498
|
}
|
|
5662
5499
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
5663
5500
|
fprintf(f, " goto cancel;\n");
|
|
5664
5501
|
fprintf(f, " }\n");
|
|
5665
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
5502
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
5666
5503
|
}
|
|
5667
5504
|
fprintf(f, "}\n");
|
|
5668
5505
|
break;
|
|
@@ -5670,19 +5507,15 @@ switch (insn) {
|
|
|
5670
5507
|
fprintf(f, "{\n");
|
|
5671
5508
|
{
|
|
5672
5509
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5673
|
-
MAYBE_UNUSED(
|
|
5674
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
5510
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5675
5511
|
if (status->local_stack_p) {
|
|
5676
5512
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
5677
5513
|
}
|
|
5678
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
5679
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
5514
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
5680
5515
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
5681
5516
|
|
|
5682
|
-
fprintf(f, "
|
|
5683
|
-
comment_id(f, ((
|
|
5684
|
-
fprintf(f, "\n");
|
|
5685
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
5517
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
5518
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
5686
5519
|
fprintf(f, "\n");
|
|
5687
5520
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
5688
5521
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -5707,20 +5540,20 @@ switch (insn) {
|
|
|
5707
5540
|
fprintf(f, " goto cancel;\n");
|
|
5708
5541
|
fprintf(f, " }\n");
|
|
5709
5542
|
fprintf(f, " }\n");
|
|
5710
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_and(
|
|
5711
|
-
b->stack_size += attr_sp_inc_opt_and(
|
|
5543
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_and(cd) - 1);
|
|
5544
|
+
b->stack_size += attr_sp_inc_opt_and(cd);
|
|
5712
5545
|
}
|
|
5713
5546
|
fprintf(f, "}\n");
|
|
5714
5547
|
break;
|
|
5715
5548
|
case BIN(opt_or):
|
|
5716
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
5549
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
5717
5550
|
{
|
|
5718
5551
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5719
|
-
MAYBE_UNUSED(
|
|
5720
|
-
|
|
5721
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
5552
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5553
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
5722
5554
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
5723
5555
|
const rb_iseq_t *iseq;
|
|
5556
|
+
const CALL_INFO ci = &cd->ci;
|
|
5724
5557
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
5725
5558
|
|
|
5726
5559
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -5733,7 +5566,7 @@ switch (insn) {
|
|
|
5733
5566
|
}
|
|
5734
5567
|
|
|
5735
5568
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
5736
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
5569
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
5737
5570
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
5738
5571
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
5739
5572
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -5746,7 +5579,7 @@ switch (insn) {
|
|
|
5746
5579
|
if (status->local_stack_p) {
|
|
5747
5580
|
{
|
|
5748
5581
|
rb_snum_t i, push_size;
|
|
5749
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
5582
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
5750
5583
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
5751
5584
|
for (i = 0; i < push_size; i++) {
|
|
5752
5585
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -5792,7 +5625,7 @@ switch (insn) {
|
|
|
5792
5625
|
fprintf(f, " }\n");
|
|
5793
5626
|
|
|
5794
5627
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
5795
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5628
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
5796
5629
|
if (!pc_moved_p) {
|
|
5797
5630
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
5798
5631
|
}
|
|
@@ -5801,7 +5634,7 @@ switch (insn) {
|
|
|
5801
5634
|
fprintf(f, " }\n");
|
|
5802
5635
|
}
|
|
5803
5636
|
|
|
5804
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
5637
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
5805
5638
|
|
|
5806
5639
|
fprintf(f, "}\n");
|
|
5807
5640
|
break;
|
|
@@ -5811,19 +5644,15 @@ switch (insn) {
|
|
|
5811
5644
|
fprintf(f, "{\n");
|
|
5812
5645
|
{
|
|
5813
5646
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5814
|
-
MAYBE_UNUSED(
|
|
5815
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
5647
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5816
5648
|
if (status->local_stack_p) {
|
|
5817
5649
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
5818
5650
|
}
|
|
5819
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
5820
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
5651
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
5821
5652
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
5822
5653
|
|
|
5823
|
-
fprintf(f, "
|
|
5824
|
-
comment_id(f, ((
|
|
5825
|
-
fprintf(f, "\n");
|
|
5826
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
5654
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
5655
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
5827
5656
|
fprintf(f, "\n");
|
|
5828
5657
|
if (body->catch_except_p || TRUE) {
|
|
5829
5658
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -5832,7 +5661,7 @@ switch (insn) {
|
|
|
5832
5661
|
if (status->local_stack_p) {
|
|
5833
5662
|
{
|
|
5834
5663
|
rb_snum_t i, push_size;
|
|
5835
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
5664
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
5836
5665
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
5837
5666
|
for (i = 0; i < push_size; i++) {
|
|
5838
5667
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -5844,7 +5673,7 @@ switch (insn) {
|
|
|
5844
5673
|
}
|
|
5845
5674
|
fprintf(f, " {\n");
|
|
5846
5675
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
5847
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
5676
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
5848
5677
|
fprintf(f, "\n");
|
|
5849
5678
|
fprintf(f, " if (val == Qundef) {\n");
|
|
5850
5679
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -5856,16 +5685,16 @@ switch (insn) {
|
|
|
5856
5685
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
5857
5686
|
fprintf(f, " }\n");
|
|
5858
5687
|
fprintf(f, " }\n");
|
|
5859
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5688
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
5860
5689
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
5861
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5690
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
5862
5691
|
if (!pc_moved_p) {
|
|
5863
5692
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
5864
5693
|
}
|
|
5865
5694
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
5866
5695
|
fprintf(f, " goto cancel;\n");
|
|
5867
5696
|
fprintf(f, " }\n");
|
|
5868
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
5697
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
5869
5698
|
}
|
|
5870
5699
|
fprintf(f, "}\n");
|
|
5871
5700
|
break;
|
|
@@ -5873,19 +5702,15 @@ switch (insn) {
|
|
|
5873
5702
|
fprintf(f, "{\n");
|
|
5874
5703
|
{
|
|
5875
5704
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5876
|
-
MAYBE_UNUSED(
|
|
5877
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
5705
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5878
5706
|
if (status->local_stack_p) {
|
|
5879
5707
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
5880
5708
|
}
|
|
5881
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
5882
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
5709
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
5883
5710
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
5884
5711
|
|
|
5885
|
-
fprintf(f, "
|
|
5886
|
-
comment_id(f, ((
|
|
5887
|
-
fprintf(f, "\n");
|
|
5888
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
5712
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
5713
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
5889
5714
|
fprintf(f, "\n");
|
|
5890
5715
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
5891
5716
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -5910,20 +5735,20 @@ switch (insn) {
|
|
|
5910
5735
|
fprintf(f, " goto cancel;\n");
|
|
5911
5736
|
fprintf(f, " }\n");
|
|
5912
5737
|
fprintf(f, " }\n");
|
|
5913
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_or(
|
|
5914
|
-
b->stack_size += attr_sp_inc_opt_or(
|
|
5738
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_or(cd) - 1);
|
|
5739
|
+
b->stack_size += attr_sp_inc_opt_or(cd);
|
|
5915
5740
|
}
|
|
5916
5741
|
fprintf(f, "}\n");
|
|
5917
5742
|
break;
|
|
5918
5743
|
case BIN(opt_aref):
|
|
5919
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
5744
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
5920
5745
|
{
|
|
5921
5746
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
5922
|
-
MAYBE_UNUSED(
|
|
5923
|
-
|
|
5924
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
5747
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5748
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
5925
5749
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
5926
5750
|
const rb_iseq_t *iseq;
|
|
5751
|
+
const CALL_INFO ci = &cd->ci;
|
|
5927
5752
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
5928
5753
|
|
|
5929
5754
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -5936,7 +5761,7 @@ switch (insn) {
|
|
|
5936
5761
|
}
|
|
5937
5762
|
|
|
5938
5763
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
5939
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
5764
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
5940
5765
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
5941
5766
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
5942
5767
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -5949,7 +5774,7 @@ switch (insn) {
|
|
|
5949
5774
|
if (status->local_stack_p) {
|
|
5950
5775
|
{
|
|
5951
5776
|
rb_snum_t i, push_size;
|
|
5952
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
5777
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
5953
5778
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
5954
5779
|
for (i = 0; i < push_size; i++) {
|
|
5955
5780
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -5995,7 +5820,7 @@ switch (insn) {
|
|
|
5995
5820
|
fprintf(f, " }\n");
|
|
5996
5821
|
|
|
5997
5822
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
5998
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5823
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
5999
5824
|
if (!pc_moved_p) {
|
|
6000
5825
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6001
5826
|
}
|
|
@@ -6004,7 +5829,7 @@ switch (insn) {
|
|
|
6004
5829
|
fprintf(f, " }\n");
|
|
6005
5830
|
}
|
|
6006
5831
|
|
|
6007
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
5832
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
6008
5833
|
|
|
6009
5834
|
fprintf(f, "}\n");
|
|
6010
5835
|
break;
|
|
@@ -6014,19 +5839,15 @@ switch (insn) {
|
|
|
6014
5839
|
fprintf(f, "{\n");
|
|
6015
5840
|
{
|
|
6016
5841
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6017
|
-
MAYBE_UNUSED(
|
|
6018
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
5842
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6019
5843
|
if (status->local_stack_p) {
|
|
6020
5844
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
6021
5845
|
}
|
|
6022
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
6023
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
5846
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
6024
5847
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
6025
5848
|
|
|
6026
|
-
fprintf(f, "
|
|
6027
|
-
comment_id(f, ((
|
|
6028
|
-
fprintf(f, "\n");
|
|
6029
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
5849
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
5850
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
6030
5851
|
fprintf(f, "\n");
|
|
6031
5852
|
if (body->catch_except_p || TRUE) {
|
|
6032
5853
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -6035,7 +5856,7 @@ switch (insn) {
|
|
|
6035
5856
|
if (status->local_stack_p) {
|
|
6036
5857
|
{
|
|
6037
5858
|
rb_snum_t i, push_size;
|
|
6038
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
5859
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
6039
5860
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
6040
5861
|
for (i = 0; i < push_size; i++) {
|
|
6041
5862
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -6047,7 +5868,7 @@ switch (insn) {
|
|
|
6047
5868
|
}
|
|
6048
5869
|
fprintf(f, " {\n");
|
|
6049
5870
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
6050
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
5871
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
6051
5872
|
fprintf(f, "\n");
|
|
6052
5873
|
fprintf(f, " if (val == Qundef) {\n");
|
|
6053
5874
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -6059,16 +5880,16 @@ switch (insn) {
|
|
|
6059
5880
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
6060
5881
|
fprintf(f, " }\n");
|
|
6061
5882
|
fprintf(f, " }\n");
|
|
6062
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5883
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
6063
5884
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
6064
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
5885
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
6065
5886
|
if (!pc_moved_p) {
|
|
6066
5887
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6067
5888
|
}
|
|
6068
5889
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
6069
5890
|
fprintf(f, " goto cancel;\n");
|
|
6070
5891
|
fprintf(f, " }\n");
|
|
6071
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
5892
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
6072
5893
|
}
|
|
6073
5894
|
fprintf(f, "}\n");
|
|
6074
5895
|
break;
|
|
@@ -6076,19 +5897,15 @@ switch (insn) {
|
|
|
6076
5897
|
fprintf(f, "{\n");
|
|
6077
5898
|
{
|
|
6078
5899
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6079
|
-
MAYBE_UNUSED(
|
|
6080
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
5900
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6081
5901
|
if (status->local_stack_p) {
|
|
6082
5902
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
6083
5903
|
}
|
|
6084
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
6085
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
5904
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
6086
5905
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, val;\n");
|
|
6087
5906
|
|
|
6088
|
-
fprintf(f, "
|
|
6089
|
-
comment_id(f, ((
|
|
6090
|
-
fprintf(f, "\n");
|
|
6091
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
5907
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
5908
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
6092
5909
|
fprintf(f, "\n");
|
|
6093
5910
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
6094
5911
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 1);
|
|
@@ -6113,28 +5930,28 @@ switch (insn) {
|
|
|
6113
5930
|
fprintf(f, " goto cancel;\n");
|
|
6114
5931
|
fprintf(f, " }\n");
|
|
6115
5932
|
fprintf(f, " }\n");
|
|
6116
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_aref(
|
|
5933
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_aref(cd) - 1);
|
|
6117
5934
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
6118
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_aref(
|
|
5935
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_aref(cd));
|
|
6119
5936
|
if (!pc_moved_p) {
|
|
6120
5937
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6121
5938
|
}
|
|
6122
5939
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
6123
5940
|
fprintf(f, " goto cancel;\n");
|
|
6124
5941
|
fprintf(f, " }\n");
|
|
6125
|
-
b->stack_size += attr_sp_inc_opt_aref(
|
|
5942
|
+
b->stack_size += attr_sp_inc_opt_aref(cd);
|
|
6126
5943
|
}
|
|
6127
5944
|
fprintf(f, "}\n");
|
|
6128
5945
|
break;
|
|
6129
5946
|
case BIN(opt_aset):
|
|
6130
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
5947
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
6131
5948
|
{
|
|
6132
5949
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6133
|
-
MAYBE_UNUSED(
|
|
6134
|
-
|
|
6135
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
5950
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
5951
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
6136
5952
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
6137
5953
|
const rb_iseq_t *iseq;
|
|
5954
|
+
const CALL_INFO ci = &cd->ci;
|
|
6138
5955
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
6139
5956
|
|
|
6140
5957
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -6147,7 +5964,7 @@ switch (insn) {
|
|
|
6147
5964
|
}
|
|
6148
5965
|
|
|
6149
5966
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
6150
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
5967
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
6151
5968
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
6152
5969
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
6153
5970
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -6160,7 +5977,7 @@ switch (insn) {
|
|
|
6160
5977
|
if (status->local_stack_p) {
|
|
6161
5978
|
{
|
|
6162
5979
|
rb_snum_t i, push_size;
|
|
6163
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
5980
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
6164
5981
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
6165
5982
|
for (i = 0; i < push_size; i++) {
|
|
6166
5983
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -6206,7 +6023,7 @@ switch (insn) {
|
|
|
6206
6023
|
fprintf(f, " }\n");
|
|
6207
6024
|
|
|
6208
6025
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
6209
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6026
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
6210
6027
|
if (!pc_moved_p) {
|
|
6211
6028
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6212
6029
|
}
|
|
@@ -6215,7 +6032,7 @@ switch (insn) {
|
|
|
6215
6032
|
fprintf(f, " }\n");
|
|
6216
6033
|
}
|
|
6217
6034
|
|
|
6218
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
6035
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
6219
6036
|
|
|
6220
6037
|
fprintf(f, "}\n");
|
|
6221
6038
|
break;
|
|
@@ -6225,19 +6042,15 @@ switch (insn) {
|
|
|
6225
6042
|
fprintf(f, "{\n");
|
|
6226
6043
|
{
|
|
6227
6044
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6228
|
-
MAYBE_UNUSED(
|
|
6229
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
6045
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6230
6046
|
if (status->local_stack_p) {
|
|
6231
6047
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
6232
6048
|
}
|
|
6233
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
6234
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
6049
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
6235
6050
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
6236
6051
|
|
|
6237
|
-
fprintf(f, "
|
|
6238
|
-
comment_id(f, ((
|
|
6239
|
-
fprintf(f, "\n");
|
|
6240
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
6052
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
6053
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
6241
6054
|
fprintf(f, "\n");
|
|
6242
6055
|
if (body->catch_except_p || TRUE) {
|
|
6243
6056
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -6246,7 +6059,7 @@ switch (insn) {
|
|
|
6246
6059
|
if (status->local_stack_p) {
|
|
6247
6060
|
{
|
|
6248
6061
|
rb_snum_t i, push_size;
|
|
6249
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
6062
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
6250
6063
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
6251
6064
|
for (i = 0; i < push_size; i++) {
|
|
6252
6065
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -6258,7 +6071,7 @@ switch (insn) {
|
|
|
6258
6071
|
}
|
|
6259
6072
|
fprintf(f, " {\n");
|
|
6260
6073
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
6261
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
6074
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
6262
6075
|
fprintf(f, "\n");
|
|
6263
6076
|
fprintf(f, " if (val == Qundef) {\n");
|
|
6264
6077
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -6270,16 +6083,16 @@ switch (insn) {
|
|
|
6270
6083
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
6271
6084
|
fprintf(f, " }\n");
|
|
6272
6085
|
fprintf(f, " }\n");
|
|
6273
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6086
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
6274
6087
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
6275
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6088
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
6276
6089
|
if (!pc_moved_p) {
|
|
6277
6090
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6278
6091
|
}
|
|
6279
6092
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
6280
6093
|
fprintf(f, " goto cancel;\n");
|
|
6281
6094
|
fprintf(f, " }\n");
|
|
6282
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
6095
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
6283
6096
|
}
|
|
6284
6097
|
fprintf(f, "}\n");
|
|
6285
6098
|
break;
|
|
@@ -6287,19 +6100,15 @@ switch (insn) {
|
|
|
6287
6100
|
fprintf(f, "{\n");
|
|
6288
6101
|
{
|
|
6289
6102
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6290
|
-
MAYBE_UNUSED(
|
|
6291
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
6103
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6292
6104
|
if (status->local_stack_p) {
|
|
6293
6105
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
6294
6106
|
}
|
|
6295
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
6296
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
6107
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
6297
6108
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj, recv, set, val;\n");
|
|
6298
6109
|
|
|
6299
|
-
fprintf(f, "
|
|
6300
|
-
comment_id(f, ((
|
|
6301
|
-
fprintf(f, "\n");
|
|
6302
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
6110
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
6111
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
6303
6112
|
fprintf(f, "\n");
|
|
6304
6113
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 3);
|
|
6305
6114
|
fprintf(f, " obj = stack[%d];\n", b->stack_size - 2);
|
|
@@ -6325,16 +6134,16 @@ switch (insn) {
|
|
|
6325
6134
|
fprintf(f, " goto cancel;\n");
|
|
6326
6135
|
fprintf(f, " }\n");
|
|
6327
6136
|
fprintf(f, " }\n");
|
|
6328
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_aset(
|
|
6137
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_aset(cd) - 1);
|
|
6329
6138
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
6330
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_aset(
|
|
6139
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_aset(cd));
|
|
6331
6140
|
if (!pc_moved_p) {
|
|
6332
6141
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6333
6142
|
}
|
|
6334
6143
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
6335
6144
|
fprintf(f, " goto cancel;\n");
|
|
6336
6145
|
fprintf(f, " }\n");
|
|
6337
|
-
b->stack_size += attr_sp_inc_opt_aset(
|
|
6146
|
+
b->stack_size += attr_sp_inc_opt_aset(cd);
|
|
6338
6147
|
}
|
|
6339
6148
|
fprintf(f, "}\n");
|
|
6340
6149
|
break;
|
|
@@ -6343,22 +6152,18 @@ switch (insn) {
|
|
|
6343
6152
|
{
|
|
6344
6153
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6345
6154
|
MAYBE_UNUSED(VALUE key) = (VALUE)operands[0];
|
|
6346
|
-
MAYBE_UNUSED(
|
|
6347
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[2];
|
|
6155
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[1];
|
|
6348
6156
|
if (status->local_stack_p) {
|
|
6349
6157
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
6350
6158
|
}
|
|
6351
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
6352
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
6159
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
6353
6160
|
fprintf(f, " MAYBE_UNUSED(VALUE) key, recv, val;\n");
|
|
6354
6161
|
|
|
6355
6162
|
fprintf(f, " key = (VALUE)0x%"PRIxVALUE";", operands[0]);
|
|
6356
6163
|
if (SYMBOL_P((VALUE)operands[0])) comment_id(f, SYM2ID((VALUE)operands[0]));
|
|
6357
6164
|
fprintf(f, "\n");
|
|
6358
|
-
fprintf(f, "
|
|
6359
|
-
comment_id(f, ((
|
|
6360
|
-
fprintf(f, "\n");
|
|
6361
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[2]);
|
|
6165
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[1]);
|
|
6166
|
+
comment_id(f, ((CALL_DATA)operands[1])->ci.mid);
|
|
6362
6167
|
fprintf(f, "\n");
|
|
6363
6168
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 2);
|
|
6364
6169
|
fprintf(f, " val = stack[%d];\n", b->stack_size - 1);
|
|
@@ -6391,16 +6196,16 @@ switch (insn) {
|
|
|
6391
6196
|
fprintf(f, " goto cancel;\n");
|
|
6392
6197
|
fprintf(f, " }\n");
|
|
6393
6198
|
fprintf(f, " }\n");
|
|
6394
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_aset_with(key,
|
|
6199
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_aset_with(key, cd) - 1);
|
|
6395
6200
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
6396
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_aset_with(key,
|
|
6201
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_aset_with(key, cd));
|
|
6397
6202
|
if (!pc_moved_p) {
|
|
6398
6203
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6399
6204
|
}
|
|
6400
6205
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
6401
6206
|
fprintf(f, " goto cancel;\n");
|
|
6402
6207
|
fprintf(f, " }\n");
|
|
6403
|
-
b->stack_size += attr_sp_inc_opt_aset_with(key,
|
|
6208
|
+
b->stack_size += attr_sp_inc_opt_aset_with(key, cd);
|
|
6404
6209
|
}
|
|
6405
6210
|
fprintf(f, "}\n");
|
|
6406
6211
|
break;
|
|
@@ -6409,22 +6214,18 @@ switch (insn) {
|
|
|
6409
6214
|
{
|
|
6410
6215
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6411
6216
|
MAYBE_UNUSED(VALUE key) = (VALUE)operands[0];
|
|
6412
|
-
MAYBE_UNUSED(
|
|
6413
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[2];
|
|
6217
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[1];
|
|
6414
6218
|
if (status->local_stack_p) {
|
|
6415
6219
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
6416
6220
|
}
|
|
6417
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
6418
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
6221
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
6419
6222
|
fprintf(f, " MAYBE_UNUSED(VALUE) key, recv, val;\n");
|
|
6420
6223
|
|
|
6421
6224
|
fprintf(f, " key = (VALUE)0x%"PRIxVALUE";", operands[0]);
|
|
6422
6225
|
if (SYMBOL_P((VALUE)operands[0])) comment_id(f, SYM2ID((VALUE)operands[0]));
|
|
6423
6226
|
fprintf(f, "\n");
|
|
6424
|
-
fprintf(f, "
|
|
6425
|
-
comment_id(f, ((
|
|
6426
|
-
fprintf(f, "\n");
|
|
6427
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[2]);
|
|
6227
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[1]);
|
|
6228
|
+
comment_id(f, ((CALL_DATA)operands[1])->ci.mid);
|
|
6428
6229
|
fprintf(f, "\n");
|
|
6429
6230
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
|
6430
6231
|
if (body->catch_except_p || TRUE) {
|
|
@@ -6451,28 +6252,28 @@ switch (insn) {
|
|
|
6451
6252
|
fprintf(f, " goto cancel;\n");
|
|
6452
6253
|
fprintf(f, " }\n");
|
|
6453
6254
|
fprintf(f, " }\n");
|
|
6454
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_aref_with(key,
|
|
6255
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_aref_with(key, cd) - 1);
|
|
6455
6256
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
6456
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_aref_with(key,
|
|
6257
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_aref_with(key, cd));
|
|
6457
6258
|
if (!pc_moved_p) {
|
|
6458
6259
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6459
6260
|
}
|
|
6460
6261
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
6461
6262
|
fprintf(f, " goto cancel;\n");
|
|
6462
6263
|
fprintf(f, " }\n");
|
|
6463
|
-
b->stack_size += attr_sp_inc_opt_aref_with(key,
|
|
6264
|
+
b->stack_size += attr_sp_inc_opt_aref_with(key, cd);
|
|
6464
6265
|
}
|
|
6465
6266
|
fprintf(f, "}\n");
|
|
6466
6267
|
break;
|
|
6467
6268
|
case BIN(opt_length):
|
|
6468
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
6269
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
6469
6270
|
{
|
|
6470
6271
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6471
|
-
MAYBE_UNUSED(
|
|
6472
|
-
|
|
6473
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
6272
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6273
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
6474
6274
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
6475
6275
|
const rb_iseq_t *iseq;
|
|
6276
|
+
const CALL_INFO ci = &cd->ci;
|
|
6476
6277
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
6477
6278
|
|
|
6478
6279
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -6485,7 +6286,7 @@ switch (insn) {
|
|
|
6485
6286
|
}
|
|
6486
6287
|
|
|
6487
6288
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
6488
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
6289
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
6489
6290
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
6490
6291
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
6491
6292
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -6498,7 +6299,7 @@ switch (insn) {
|
|
|
6498
6299
|
if (status->local_stack_p) {
|
|
6499
6300
|
{
|
|
6500
6301
|
rb_snum_t i, push_size;
|
|
6501
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
6302
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
6502
6303
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
6503
6304
|
for (i = 0; i < push_size; i++) {
|
|
6504
6305
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -6544,7 +6345,7 @@ switch (insn) {
|
|
|
6544
6345
|
fprintf(f, " }\n");
|
|
6545
6346
|
|
|
6546
6347
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
6547
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6348
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
6548
6349
|
if (!pc_moved_p) {
|
|
6549
6350
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6550
6351
|
}
|
|
@@ -6553,7 +6354,7 @@ switch (insn) {
|
|
|
6553
6354
|
fprintf(f, " }\n");
|
|
6554
6355
|
}
|
|
6555
6356
|
|
|
6556
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
6357
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
6557
6358
|
|
|
6558
6359
|
fprintf(f, "}\n");
|
|
6559
6360
|
break;
|
|
@@ -6563,19 +6364,15 @@ switch (insn) {
|
|
|
6563
6364
|
fprintf(f, "{\n");
|
|
6564
6365
|
{
|
|
6565
6366
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6566
|
-
MAYBE_UNUSED(
|
|
6567
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
6367
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6568
6368
|
if (status->local_stack_p) {
|
|
6569
6369
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
6570
6370
|
}
|
|
6571
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
6572
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
6371
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
6573
6372
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
6574
6373
|
|
|
6575
|
-
fprintf(f, "
|
|
6576
|
-
comment_id(f, ((
|
|
6577
|
-
fprintf(f, "\n");
|
|
6578
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
6374
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
6375
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
6579
6376
|
fprintf(f, "\n");
|
|
6580
6377
|
if (body->catch_except_p || TRUE) {
|
|
6581
6378
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -6584,7 +6381,7 @@ switch (insn) {
|
|
|
6584
6381
|
if (status->local_stack_p) {
|
|
6585
6382
|
{
|
|
6586
6383
|
rb_snum_t i, push_size;
|
|
6587
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
6384
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
6588
6385
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
6589
6386
|
for (i = 0; i < push_size; i++) {
|
|
6590
6387
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -6596,7 +6393,7 @@ switch (insn) {
|
|
|
6596
6393
|
}
|
|
6597
6394
|
fprintf(f, " {\n");
|
|
6598
6395
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
6599
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
6396
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
6600
6397
|
fprintf(f, "\n");
|
|
6601
6398
|
fprintf(f, " if (val == Qundef) {\n");
|
|
6602
6399
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -6608,16 +6405,16 @@ switch (insn) {
|
|
|
6608
6405
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
6609
6406
|
fprintf(f, " }\n");
|
|
6610
6407
|
fprintf(f, " }\n");
|
|
6611
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6408
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
6612
6409
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
6613
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6410
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
6614
6411
|
if (!pc_moved_p) {
|
|
6615
6412
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6616
6413
|
}
|
|
6617
6414
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
6618
6415
|
fprintf(f, " goto cancel;\n");
|
|
6619
6416
|
fprintf(f, " }\n");
|
|
6620
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
6417
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
6621
6418
|
}
|
|
6622
6419
|
fprintf(f, "}\n");
|
|
6623
6420
|
break;
|
|
@@ -6625,19 +6422,15 @@ switch (insn) {
|
|
|
6625
6422
|
fprintf(f, "{\n");
|
|
6626
6423
|
{
|
|
6627
6424
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6628
|
-
MAYBE_UNUSED(
|
|
6629
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
6425
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6630
6426
|
if (status->local_stack_p) {
|
|
6631
6427
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
6632
6428
|
}
|
|
6633
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
6634
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
6429
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
6635
6430
|
fprintf(f, " MAYBE_UNUSED(VALUE) recv, val;\n");
|
|
6636
6431
|
|
|
6637
|
-
fprintf(f, "
|
|
6638
|
-
comment_id(f, ((
|
|
6639
|
-
fprintf(f, "\n");
|
|
6640
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
6432
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
6433
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
6641
6434
|
fprintf(f, "\n");
|
|
6642
6435
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
|
6643
6436
|
if (body->catch_except_p || FALSE) {
|
|
@@ -6661,20 +6454,20 @@ switch (insn) {
|
|
|
6661
6454
|
fprintf(f, " goto cancel;\n");
|
|
6662
6455
|
fprintf(f, " }\n");
|
|
6663
6456
|
fprintf(f, " }\n");
|
|
6664
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_length(
|
|
6665
|
-
b->stack_size += attr_sp_inc_opt_length(
|
|
6457
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_length(cd) - 1);
|
|
6458
|
+
b->stack_size += attr_sp_inc_opt_length(cd);
|
|
6666
6459
|
}
|
|
6667
6460
|
fprintf(f, "}\n");
|
|
6668
6461
|
break;
|
|
6669
6462
|
case BIN(opt_size):
|
|
6670
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
6463
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
6671
6464
|
{
|
|
6672
6465
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6673
|
-
MAYBE_UNUSED(
|
|
6674
|
-
|
|
6675
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
6466
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6467
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
6676
6468
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
6677
6469
|
const rb_iseq_t *iseq;
|
|
6470
|
+
const CALL_INFO ci = &cd->ci;
|
|
6678
6471
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
6679
6472
|
|
|
6680
6473
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -6687,7 +6480,7 @@ switch (insn) {
|
|
|
6687
6480
|
}
|
|
6688
6481
|
|
|
6689
6482
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
6690
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
6483
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
6691
6484
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
6692
6485
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
6693
6486
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -6700,7 +6493,7 @@ switch (insn) {
|
|
|
6700
6493
|
if (status->local_stack_p) {
|
|
6701
6494
|
{
|
|
6702
6495
|
rb_snum_t i, push_size;
|
|
6703
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
6496
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
6704
6497
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
6705
6498
|
for (i = 0; i < push_size; i++) {
|
|
6706
6499
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -6746,7 +6539,7 @@ switch (insn) {
|
|
|
6746
6539
|
fprintf(f, " }\n");
|
|
6747
6540
|
|
|
6748
6541
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
6749
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6542
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
6750
6543
|
if (!pc_moved_p) {
|
|
6751
6544
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6752
6545
|
}
|
|
@@ -6755,7 +6548,7 @@ switch (insn) {
|
|
|
6755
6548
|
fprintf(f, " }\n");
|
|
6756
6549
|
}
|
|
6757
6550
|
|
|
6758
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
6551
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
6759
6552
|
|
|
6760
6553
|
fprintf(f, "}\n");
|
|
6761
6554
|
break;
|
|
@@ -6765,19 +6558,15 @@ switch (insn) {
|
|
|
6765
6558
|
fprintf(f, "{\n");
|
|
6766
6559
|
{
|
|
6767
6560
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6768
|
-
MAYBE_UNUSED(
|
|
6769
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
6561
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6770
6562
|
if (status->local_stack_p) {
|
|
6771
6563
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
6772
6564
|
}
|
|
6773
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
6774
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
6565
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
6775
6566
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
6776
6567
|
|
|
6777
|
-
fprintf(f, "
|
|
6778
|
-
comment_id(f, ((
|
|
6779
|
-
fprintf(f, "\n");
|
|
6780
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
6568
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
6569
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
6781
6570
|
fprintf(f, "\n");
|
|
6782
6571
|
if (body->catch_except_p || TRUE) {
|
|
6783
6572
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -6786,7 +6575,7 @@ switch (insn) {
|
|
|
6786
6575
|
if (status->local_stack_p) {
|
|
6787
6576
|
{
|
|
6788
6577
|
rb_snum_t i, push_size;
|
|
6789
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
6578
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
6790
6579
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
6791
6580
|
for (i = 0; i < push_size; i++) {
|
|
6792
6581
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -6798,7 +6587,7 @@ switch (insn) {
|
|
|
6798
6587
|
}
|
|
6799
6588
|
fprintf(f, " {\n");
|
|
6800
6589
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
6801
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
6590
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
6802
6591
|
fprintf(f, "\n");
|
|
6803
6592
|
fprintf(f, " if (val == Qundef) {\n");
|
|
6804
6593
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -6810,16 +6599,16 @@ switch (insn) {
|
|
|
6810
6599
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
6811
6600
|
fprintf(f, " }\n");
|
|
6812
6601
|
fprintf(f, " }\n");
|
|
6813
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6602
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
6814
6603
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
6815
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6604
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
6816
6605
|
if (!pc_moved_p) {
|
|
6817
6606
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6818
6607
|
}
|
|
6819
6608
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
6820
6609
|
fprintf(f, " goto cancel;\n");
|
|
6821
6610
|
fprintf(f, " }\n");
|
|
6822
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
6611
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
6823
6612
|
}
|
|
6824
6613
|
fprintf(f, "}\n");
|
|
6825
6614
|
break;
|
|
@@ -6827,19 +6616,15 @@ switch (insn) {
|
|
|
6827
6616
|
fprintf(f, "{\n");
|
|
6828
6617
|
{
|
|
6829
6618
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6830
|
-
MAYBE_UNUSED(
|
|
6831
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
6619
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6832
6620
|
if (status->local_stack_p) {
|
|
6833
6621
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
6834
6622
|
}
|
|
6835
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
6836
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
6623
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
6837
6624
|
fprintf(f, " MAYBE_UNUSED(VALUE) recv, val;\n");
|
|
6838
6625
|
|
|
6839
|
-
fprintf(f, "
|
|
6840
|
-
comment_id(f, ((
|
|
6841
|
-
fprintf(f, "\n");
|
|
6842
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
6626
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
6627
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
6843
6628
|
fprintf(f, "\n");
|
|
6844
6629
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
|
6845
6630
|
if (body->catch_except_p || FALSE) {
|
|
@@ -6863,20 +6648,20 @@ switch (insn) {
|
|
|
6863
6648
|
fprintf(f, " goto cancel;\n");
|
|
6864
6649
|
fprintf(f, " }\n");
|
|
6865
6650
|
fprintf(f, " }\n");
|
|
6866
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_size(
|
|
6867
|
-
b->stack_size += attr_sp_inc_opt_size(
|
|
6651
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_size(cd) - 1);
|
|
6652
|
+
b->stack_size += attr_sp_inc_opt_size(cd);
|
|
6868
6653
|
}
|
|
6869
6654
|
fprintf(f, "}\n");
|
|
6870
6655
|
break;
|
|
6871
6656
|
case BIN(opt_empty_p):
|
|
6872
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
6657
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
6873
6658
|
{
|
|
6874
6659
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6875
|
-
MAYBE_UNUSED(
|
|
6876
|
-
|
|
6877
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
6660
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6661
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
6878
6662
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
6879
6663
|
const rb_iseq_t *iseq;
|
|
6664
|
+
const CALL_INFO ci = &cd->ci;
|
|
6880
6665
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
6881
6666
|
|
|
6882
6667
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -6889,7 +6674,7 @@ switch (insn) {
|
|
|
6889
6674
|
}
|
|
6890
6675
|
|
|
6891
6676
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
6892
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
6677
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
6893
6678
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
6894
6679
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
6895
6680
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -6902,7 +6687,7 @@ switch (insn) {
|
|
|
6902
6687
|
if (status->local_stack_p) {
|
|
6903
6688
|
{
|
|
6904
6689
|
rb_snum_t i, push_size;
|
|
6905
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
6690
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
6906
6691
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
6907
6692
|
for (i = 0; i < push_size; i++) {
|
|
6908
6693
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -6948,7 +6733,7 @@ switch (insn) {
|
|
|
6948
6733
|
fprintf(f, " }\n");
|
|
6949
6734
|
|
|
6950
6735
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
6951
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6736
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
6952
6737
|
if (!pc_moved_p) {
|
|
6953
6738
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
6954
6739
|
}
|
|
@@ -6957,7 +6742,7 @@ switch (insn) {
|
|
|
6957
6742
|
fprintf(f, " }\n");
|
|
6958
6743
|
}
|
|
6959
6744
|
|
|
6960
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
6745
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
6961
6746
|
|
|
6962
6747
|
fprintf(f, "}\n");
|
|
6963
6748
|
break;
|
|
@@ -6967,19 +6752,15 @@ switch (insn) {
|
|
|
6967
6752
|
fprintf(f, "{\n");
|
|
6968
6753
|
{
|
|
6969
6754
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
6970
|
-
MAYBE_UNUSED(
|
|
6971
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
6755
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6972
6756
|
if (status->local_stack_p) {
|
|
6973
6757
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
6974
6758
|
}
|
|
6975
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
6976
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
6759
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
6977
6760
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
6978
6761
|
|
|
6979
|
-
fprintf(f, "
|
|
6980
|
-
comment_id(f, ((
|
|
6981
|
-
fprintf(f, "\n");
|
|
6982
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
6762
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
6763
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
6983
6764
|
fprintf(f, "\n");
|
|
6984
6765
|
if (body->catch_except_p || TRUE) {
|
|
6985
6766
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -6988,7 +6769,7 @@ switch (insn) {
|
|
|
6988
6769
|
if (status->local_stack_p) {
|
|
6989
6770
|
{
|
|
6990
6771
|
rb_snum_t i, push_size;
|
|
6991
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
6772
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
6992
6773
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
6993
6774
|
for (i = 0; i < push_size; i++) {
|
|
6994
6775
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -7000,7 +6781,7 @@ switch (insn) {
|
|
|
7000
6781
|
}
|
|
7001
6782
|
fprintf(f, " {\n");
|
|
7002
6783
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
7003
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
6784
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
7004
6785
|
fprintf(f, "\n");
|
|
7005
6786
|
fprintf(f, " if (val == Qundef) {\n");
|
|
7006
6787
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -7012,16 +6793,16 @@ switch (insn) {
|
|
|
7012
6793
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
7013
6794
|
fprintf(f, " }\n");
|
|
7014
6795
|
fprintf(f, " }\n");
|
|
7015
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6796
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
7016
6797
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
7017
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6798
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
7018
6799
|
if (!pc_moved_p) {
|
|
7019
6800
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
7020
6801
|
}
|
|
7021
6802
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
7022
6803
|
fprintf(f, " goto cancel;\n");
|
|
7023
6804
|
fprintf(f, " }\n");
|
|
7024
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
6805
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
7025
6806
|
}
|
|
7026
6807
|
fprintf(f, "}\n");
|
|
7027
6808
|
break;
|
|
@@ -7029,19 +6810,15 @@ switch (insn) {
|
|
|
7029
6810
|
fprintf(f, "{\n");
|
|
7030
6811
|
{
|
|
7031
6812
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7032
|
-
MAYBE_UNUSED(
|
|
7033
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
6813
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
7034
6814
|
if (status->local_stack_p) {
|
|
7035
6815
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
7036
6816
|
}
|
|
7037
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
7038
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
6817
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
7039
6818
|
fprintf(f, " MAYBE_UNUSED(VALUE) recv, val;\n");
|
|
7040
6819
|
|
|
7041
|
-
fprintf(f, "
|
|
7042
|
-
comment_id(f, ((
|
|
7043
|
-
fprintf(f, "\n");
|
|
7044
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
6820
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
6821
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
7045
6822
|
fprintf(f, "\n");
|
|
7046
6823
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
|
7047
6824
|
if (body->catch_except_p || FALSE) {
|
|
@@ -7065,20 +6842,20 @@ switch (insn) {
|
|
|
7065
6842
|
fprintf(f, " goto cancel;\n");
|
|
7066
6843
|
fprintf(f, " }\n");
|
|
7067
6844
|
fprintf(f, " }\n");
|
|
7068
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_empty_p(
|
|
7069
|
-
b->stack_size += attr_sp_inc_opt_empty_p(
|
|
6845
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_empty_p(cd) - 1);
|
|
6846
|
+
b->stack_size += attr_sp_inc_opt_empty_p(cd);
|
|
7070
6847
|
}
|
|
7071
6848
|
fprintf(f, "}\n");
|
|
7072
6849
|
break;
|
|
7073
6850
|
case BIN(opt_succ):
|
|
7074
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
6851
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
7075
6852
|
{
|
|
7076
6853
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7077
|
-
MAYBE_UNUSED(
|
|
7078
|
-
|
|
7079
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
6854
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
6855
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
7080
6856
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
7081
6857
|
const rb_iseq_t *iseq;
|
|
6858
|
+
const CALL_INFO ci = &cd->ci;
|
|
7082
6859
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
7083
6860
|
|
|
7084
6861
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -7091,7 +6868,7 @@ switch (insn) {
|
|
|
7091
6868
|
}
|
|
7092
6869
|
|
|
7093
6870
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
7094
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
6871
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
7095
6872
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
7096
6873
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
7097
6874
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -7104,7 +6881,7 @@ switch (insn) {
|
|
|
7104
6881
|
if (status->local_stack_p) {
|
|
7105
6882
|
{
|
|
7106
6883
|
rb_snum_t i, push_size;
|
|
7107
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
6884
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
7108
6885
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
7109
6886
|
for (i = 0; i < push_size; i++) {
|
|
7110
6887
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -7150,7 +6927,7 @@ switch (insn) {
|
|
|
7150
6927
|
fprintf(f, " }\n");
|
|
7151
6928
|
|
|
7152
6929
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
7153
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6930
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
7154
6931
|
if (!pc_moved_p) {
|
|
7155
6932
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
7156
6933
|
}
|
|
@@ -7159,7 +6936,7 @@ switch (insn) {
|
|
|
7159
6936
|
fprintf(f, " }\n");
|
|
7160
6937
|
}
|
|
7161
6938
|
|
|
7162
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
6939
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
7163
6940
|
|
|
7164
6941
|
fprintf(f, "}\n");
|
|
7165
6942
|
break;
|
|
@@ -7169,19 +6946,15 @@ switch (insn) {
|
|
|
7169
6946
|
fprintf(f, "{\n");
|
|
7170
6947
|
{
|
|
7171
6948
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7172
|
-
MAYBE_UNUSED(
|
|
7173
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
6949
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
7174
6950
|
if (status->local_stack_p) {
|
|
7175
6951
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
7176
6952
|
}
|
|
7177
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
7178
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
6953
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
7179
6954
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
7180
6955
|
|
|
7181
|
-
fprintf(f, "
|
|
7182
|
-
comment_id(f, ((
|
|
7183
|
-
fprintf(f, "\n");
|
|
7184
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
6956
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
6957
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
7185
6958
|
fprintf(f, "\n");
|
|
7186
6959
|
if (body->catch_except_p || TRUE) {
|
|
7187
6960
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -7190,7 +6963,7 @@ switch (insn) {
|
|
|
7190
6963
|
if (status->local_stack_p) {
|
|
7191
6964
|
{
|
|
7192
6965
|
rb_snum_t i, push_size;
|
|
7193
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
6966
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
7194
6967
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
7195
6968
|
for (i = 0; i < push_size; i++) {
|
|
7196
6969
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -7202,7 +6975,7 @@ switch (insn) {
|
|
|
7202
6975
|
}
|
|
7203
6976
|
fprintf(f, " {\n");
|
|
7204
6977
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
7205
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
6978
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
7206
6979
|
fprintf(f, "\n");
|
|
7207
6980
|
fprintf(f, " if (val == Qundef) {\n");
|
|
7208
6981
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -7214,16 +6987,16 @@ switch (insn) {
|
|
|
7214
6987
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
7215
6988
|
fprintf(f, " }\n");
|
|
7216
6989
|
fprintf(f, " }\n");
|
|
7217
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6990
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
7218
6991
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
7219
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
6992
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
7220
6993
|
if (!pc_moved_p) {
|
|
7221
6994
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
7222
6995
|
}
|
|
7223
6996
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
7224
6997
|
fprintf(f, " goto cancel;\n");
|
|
7225
6998
|
fprintf(f, " }\n");
|
|
7226
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
6999
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
7227
7000
|
}
|
|
7228
7001
|
fprintf(f, "}\n");
|
|
7229
7002
|
break;
|
|
@@ -7231,19 +7004,15 @@ switch (insn) {
|
|
|
7231
7004
|
fprintf(f, "{\n");
|
|
7232
7005
|
{
|
|
7233
7006
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7234
|
-
MAYBE_UNUSED(
|
|
7235
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
7007
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
7236
7008
|
if (status->local_stack_p) {
|
|
7237
7009
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
7238
7010
|
}
|
|
7239
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
7240
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
7011
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
7241
7012
|
fprintf(f, " MAYBE_UNUSED(VALUE) recv, val;\n");
|
|
7242
7013
|
|
|
7243
|
-
fprintf(f, "
|
|
7244
|
-
comment_id(f, ((
|
|
7245
|
-
fprintf(f, "\n");
|
|
7246
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
7014
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
7015
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
7247
7016
|
fprintf(f, "\n");
|
|
7248
7017
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
|
7249
7018
|
if (body->catch_except_p || FALSE) {
|
|
@@ -7267,20 +7036,20 @@ switch (insn) {
|
|
|
7267
7036
|
fprintf(f, " goto cancel;\n");
|
|
7268
7037
|
fprintf(f, " }\n");
|
|
7269
7038
|
fprintf(f, " }\n");
|
|
7270
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_succ(
|
|
7271
|
-
b->stack_size += attr_sp_inc_opt_succ(
|
|
7039
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_succ(cd) - 1);
|
|
7040
|
+
b->stack_size += attr_sp_inc_opt_succ(cd);
|
|
7272
7041
|
}
|
|
7273
7042
|
fprintf(f, "}\n");
|
|
7274
7043
|
break;
|
|
7275
7044
|
case BIN(opt_not):
|
|
7276
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
7045
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
7277
7046
|
{
|
|
7278
7047
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7279
|
-
MAYBE_UNUSED(
|
|
7280
|
-
|
|
7281
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
7048
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
7049
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
7282
7050
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
7283
7051
|
const rb_iseq_t *iseq;
|
|
7052
|
+
const CALL_INFO ci = &cd->ci;
|
|
7284
7053
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
7285
7054
|
|
|
7286
7055
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -7293,7 +7062,7 @@ switch (insn) {
|
|
|
7293
7062
|
}
|
|
7294
7063
|
|
|
7295
7064
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
7296
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
7065
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
7297
7066
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
7298
7067
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
7299
7068
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -7306,7 +7075,7 @@ switch (insn) {
|
|
|
7306
7075
|
if (status->local_stack_p) {
|
|
7307
7076
|
{
|
|
7308
7077
|
rb_snum_t i, push_size;
|
|
7309
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
7078
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
7310
7079
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
7311
7080
|
for (i = 0; i < push_size; i++) {
|
|
7312
7081
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -7352,7 +7121,7 @@ switch (insn) {
|
|
|
7352
7121
|
fprintf(f, " }\n");
|
|
7353
7122
|
|
|
7354
7123
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
7355
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
7124
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
7356
7125
|
if (!pc_moved_p) {
|
|
7357
7126
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
7358
7127
|
}
|
|
@@ -7361,7 +7130,7 @@ switch (insn) {
|
|
|
7361
7130
|
fprintf(f, " }\n");
|
|
7362
7131
|
}
|
|
7363
7132
|
|
|
7364
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
7133
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
7365
7134
|
|
|
7366
7135
|
fprintf(f, "}\n");
|
|
7367
7136
|
break;
|
|
@@ -7371,19 +7140,15 @@ switch (insn) {
|
|
|
7371
7140
|
fprintf(f, "{\n");
|
|
7372
7141
|
{
|
|
7373
7142
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7374
|
-
MAYBE_UNUSED(
|
|
7375
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
7143
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
7376
7144
|
if (status->local_stack_p) {
|
|
7377
7145
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
7378
7146
|
}
|
|
7379
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
7380
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
7147
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
7381
7148
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
7382
7149
|
|
|
7383
|
-
fprintf(f, "
|
|
7384
|
-
comment_id(f, ((
|
|
7385
|
-
fprintf(f, "\n");
|
|
7386
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
7150
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
7151
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
7387
7152
|
fprintf(f, "\n");
|
|
7388
7153
|
if (body->catch_except_p || TRUE) {
|
|
7389
7154
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -7392,7 +7157,7 @@ switch (insn) {
|
|
|
7392
7157
|
if (status->local_stack_p) {
|
|
7393
7158
|
{
|
|
7394
7159
|
rb_snum_t i, push_size;
|
|
7395
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
7160
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
7396
7161
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
7397
7162
|
for (i = 0; i < push_size; i++) {
|
|
7398
7163
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -7404,7 +7169,7 @@ switch (insn) {
|
|
|
7404
7169
|
}
|
|
7405
7170
|
fprintf(f, " {\n");
|
|
7406
7171
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
7407
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
7172
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
7408
7173
|
fprintf(f, "\n");
|
|
7409
7174
|
fprintf(f, " if (val == Qundef) {\n");
|
|
7410
7175
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -7416,16 +7181,16 @@ switch (insn) {
|
|
|
7416
7181
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
7417
7182
|
fprintf(f, " }\n");
|
|
7418
7183
|
fprintf(f, " }\n");
|
|
7419
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
7184
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
7420
7185
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
7421
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
7186
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
7422
7187
|
if (!pc_moved_p) {
|
|
7423
7188
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
7424
7189
|
}
|
|
7425
7190
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
7426
7191
|
fprintf(f, " goto cancel;\n");
|
|
7427
7192
|
fprintf(f, " }\n");
|
|
7428
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
7193
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
7429
7194
|
}
|
|
7430
7195
|
fprintf(f, "}\n");
|
|
7431
7196
|
break;
|
|
@@ -7433,19 +7198,15 @@ switch (insn) {
|
|
|
7433
7198
|
fprintf(f, "{\n");
|
|
7434
7199
|
{
|
|
7435
7200
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7436
|
-
MAYBE_UNUSED(
|
|
7437
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
7201
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
7438
7202
|
if (status->local_stack_p) {
|
|
7439
7203
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
7440
7204
|
}
|
|
7441
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
7442
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
7205
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
7443
7206
|
fprintf(f, " MAYBE_UNUSED(VALUE) recv, val;\n");
|
|
7444
7207
|
|
|
7445
|
-
fprintf(f, "
|
|
7446
|
-
comment_id(f, ((
|
|
7447
|
-
fprintf(f, "\n");
|
|
7448
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
7208
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
7209
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
7449
7210
|
fprintf(f, "\n");
|
|
7450
7211
|
fprintf(f, " recv = stack[%d];\n", b->stack_size - 1);
|
|
7451
7212
|
if (body->catch_except_p || FALSE) {
|
|
@@ -7458,7 +7219,7 @@ switch (insn) {
|
|
|
7458
7219
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
7459
7220
|
}
|
|
7460
7221
|
fprintf(f, " {\n");
|
|
7461
|
-
fprintf(f, " val = vm_opt_not(
|
|
7222
|
+
fprintf(f, " val = vm_opt_not(cd, recv);\n");
|
|
7462
7223
|
fprintf(f, "\n");
|
|
7463
7224
|
fprintf(f, " if (val == Qundef) {\n");
|
|
7464
7225
|
if (status->local_stack_p) {
|
|
@@ -7469,20 +7230,20 @@ switch (insn) {
|
|
|
7469
7230
|
fprintf(f, " goto cancel;\n");
|
|
7470
7231
|
fprintf(f, " }\n");
|
|
7471
7232
|
fprintf(f, " }\n");
|
|
7472
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_not(
|
|
7473
|
-
b->stack_size += attr_sp_inc_opt_not(
|
|
7233
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_not(cd) - 1);
|
|
7234
|
+
b->stack_size += attr_sp_inc_opt_not(cd);
|
|
7474
7235
|
}
|
|
7475
7236
|
fprintf(f, "}\n");
|
|
7476
7237
|
break;
|
|
7477
7238
|
case BIN(opt_regexpmatch2):
|
|
7478
|
-
if (has_valid_method_type(status->cc_entries + ((
|
|
7239
|
+
if (has_valid_method_type(status->cc_entries + call_data_index((CALL_DATA)operands[0], body))) {
|
|
7479
7240
|
{
|
|
7480
7241
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7481
|
-
MAYBE_UNUSED(
|
|
7482
|
-
|
|
7483
|
-
CALL_CACHE cc_copy = status->cc_entries + (cc - body->cc_entries);
|
|
7242
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
7243
|
+
CALL_CACHE cc_copy = status->cc_entries + call_data_index(cd, body);
|
|
7484
7244
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(cc_copy)) {
|
|
7485
7245
|
const rb_iseq_t *iseq;
|
|
7246
|
+
const CALL_INFO ci = &cd->ci;
|
|
7486
7247
|
unsigned int argc = ci->orig_argc; // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
|
7487
7248
|
|
|
7488
7249
|
if (!(ci->flag & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
@@ -7495,7 +7256,7 @@ switch (insn) {
|
|
|
7495
7256
|
}
|
|
7496
7257
|
|
|
7497
7258
|
fprintf(f, " if (UNLIKELY(GET_GLOBAL_METHOD_STATE() != %"PRI_SERIALT_PREFIX"u ||\n", cc_copy->method_state);
|
|
7498
|
-
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial);
|
|
7259
|
+
fprintf(f, " RCLASS_SERIAL(CLASS_OF(stack[%d])) != %"PRI_SERIALT_PREFIX"u)) {\n", b->stack_size - 1 - argc, cc_copy->class_serial[0]);
|
|
7499
7260
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", pos);
|
|
7500
7261
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
7501
7262
|
fprintf(f, " goto send_cancel;\n");
|
|
@@ -7508,7 +7269,7 @@ switch (insn) {
|
|
|
7508
7269
|
if (status->local_stack_p) {
|
|
7509
7270
|
{
|
|
7510
7271
|
rb_snum_t i, push_size;
|
|
7511
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
7272
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
7512
7273
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
7513
7274
|
for (i = 0; i < push_size; i++) {
|
|
7514
7275
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -7554,7 +7315,7 @@ switch (insn) {
|
|
|
7554
7315
|
fprintf(f, " }\n");
|
|
7555
7316
|
|
|
7556
7317
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
7557
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
7318
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
7558
7319
|
if (!pc_moved_p) {
|
|
7559
7320
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
7560
7321
|
}
|
|
@@ -7563,7 +7324,7 @@ switch (insn) {
|
|
|
7563
7324
|
fprintf(f, " }\n");
|
|
7564
7325
|
}
|
|
7565
7326
|
|
|
7566
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
7327
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
7567
7328
|
|
|
7568
7329
|
fprintf(f, "}\n");
|
|
7569
7330
|
break;
|
|
@@ -7573,19 +7334,15 @@ switch (insn) {
|
|
|
7573
7334
|
fprintf(f, "{\n");
|
|
7574
7335
|
{
|
|
7575
7336
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7576
|
-
MAYBE_UNUSED(
|
|
7577
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
7337
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
7578
7338
|
if (status->local_stack_p) {
|
|
7579
7339
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
7580
7340
|
}
|
|
7581
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
7582
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
7341
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
7583
7342
|
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
7584
7343
|
|
|
7585
|
-
fprintf(f, "
|
|
7586
|
-
comment_id(f, ((
|
|
7587
|
-
fprintf(f, "\n");
|
|
7588
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
7344
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
7345
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
7589
7346
|
fprintf(f, "\n");
|
|
7590
7347
|
if (body->catch_except_p || TRUE) {
|
|
7591
7348
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
@@ -7594,7 +7351,7 @@ switch (insn) {
|
|
|
7594
7351
|
if (status->local_stack_p) {
|
|
7595
7352
|
{
|
|
7596
7353
|
rb_snum_t i, push_size;
|
|
7597
|
-
push_size = -attr_sp_inc_opt_send_without_block(
|
|
7354
|
+
push_size = -attr_sp_inc_opt_send_without_block(cd) + 1 - 0;
|
|
7598
7355
|
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %ld;\n", push_size); /* POPN(INSN_ATTR(popn)); */
|
|
7599
7356
|
for (i = 0; i < push_size; i++) {
|
|
7600
7357
|
fprintf(f, " *(reg_cfp->sp + %ld) = stack[%ld];\n", i - push_size, (rb_snum_t)b->stack_size - push_size + i);
|
|
@@ -7606,7 +7363,7 @@ switch (insn) {
|
|
|
7606
7363
|
}
|
|
7607
7364
|
fprintf(f, " {\n");
|
|
7608
7365
|
fprintf(f, " VALUE bh = VM_BLOCK_HANDLER_NONE;\n");
|
|
7609
|
-
fprintf(f, " val = vm_sendish(ec, GET_CFP(),
|
|
7366
|
+
fprintf(f, " val = vm_sendish(ec, GET_CFP(), cd, bh, vm_search_method_wrap);\n");
|
|
7610
7367
|
fprintf(f, "\n");
|
|
7611
7368
|
fprintf(f, " if (val == Qundef) {\n");
|
|
7612
7369
|
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
@@ -7618,16 +7375,16 @@ switch (insn) {
|
|
|
7618
7375
|
fprintf(f, " UNREACHABLE_RETURN(Qundef);\n");
|
|
7619
7376
|
fprintf(f, " }\n");
|
|
7620
7377
|
fprintf(f, " }\n");
|
|
7621
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
7378
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd) - 1);
|
|
7622
7379
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
7623
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(
|
|
7380
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_send_without_block(cd));
|
|
7624
7381
|
if (!pc_moved_p) {
|
|
7625
7382
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
7626
7383
|
}
|
|
7627
7384
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
7628
7385
|
fprintf(f, " goto cancel;\n");
|
|
7629
7386
|
fprintf(f, " }\n");
|
|
7630
|
-
b->stack_size += attr_sp_inc_opt_send_without_block(
|
|
7387
|
+
b->stack_size += attr_sp_inc_opt_send_without_block(cd);
|
|
7631
7388
|
}
|
|
7632
7389
|
fprintf(f, "}\n");
|
|
7633
7390
|
break;
|
|
@@ -7635,19 +7392,15 @@ switch (insn) {
|
|
|
7635
7392
|
fprintf(f, "{\n");
|
|
7636
7393
|
{
|
|
7637
7394
|
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7638
|
-
MAYBE_UNUSED(
|
|
7639
|
-
MAYBE_UNUSED(CALL_CACHE cc) = (CALL_CACHE)operands[1];
|
|
7395
|
+
MAYBE_UNUSED(CALL_DATA cd) = (CALL_DATA)operands[0];
|
|
7640
7396
|
if (status->local_stack_p) {
|
|
7641
7397
|
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
7642
7398
|
}
|
|
7643
|
-
fprintf(f, " MAYBE_UNUSED(
|
|
7644
|
-
fprintf(f, " MAYBE_UNUSED(CALL_INFO) ci;\n");
|
|
7399
|
+
fprintf(f, " MAYBE_UNUSED(CALL_DATA) cd;\n");
|
|
7645
7400
|
fprintf(f, " MAYBE_UNUSED(VALUE) obj1, obj2, val;\n");
|
|
7646
7401
|
|
|
7647
|
-
fprintf(f, "
|
|
7648
|
-
comment_id(f, ((
|
|
7649
|
-
fprintf(f, "\n");
|
|
7650
|
-
fprintf(f, " cc = (CALL_CACHE)0x%"PRIxVALUE";", operands[1]);
|
|
7402
|
+
fprintf(f, " cd = (CALL_DATA)0x%"PRIxVALUE";", operands[0]);
|
|
7403
|
+
comment_id(f, ((CALL_DATA)operands[0])->ci.mid);
|
|
7651
7404
|
fprintf(f, "\n");
|
|
7652
7405
|
fprintf(f, " obj2 = stack[%d];\n", b->stack_size - 2);
|
|
7653
7406
|
fprintf(f, " obj1 = stack[%d];\n", b->stack_size - 1);
|
|
@@ -7672,19 +7425,162 @@ switch (insn) {
|
|
|
7672
7425
|
fprintf(f, " goto cancel;\n");
|
|
7673
7426
|
fprintf(f, " }\n");
|
|
7674
7427
|
fprintf(f, " }\n");
|
|
7675
|
-
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_regexpmatch2(
|
|
7428
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_regexpmatch2(cd) - 1);
|
|
7676
7429
|
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
7677
|
-
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_regexpmatch2(
|
|
7430
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_regexpmatch2(cd));
|
|
7678
7431
|
if (!pc_moved_p) {
|
|
7679
7432
|
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
7680
7433
|
}
|
|
7681
7434
|
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
7682
7435
|
fprintf(f, " goto cancel;\n");
|
|
7683
7436
|
fprintf(f, " }\n");
|
|
7684
|
-
b->stack_size += attr_sp_inc_opt_regexpmatch2(
|
|
7437
|
+
b->stack_size += attr_sp_inc_opt_regexpmatch2(cd);
|
|
7685
7438
|
}
|
|
7686
7439
|
fprintf(f, "}\n");
|
|
7687
7440
|
break;
|
|
7441
|
+
case BIN(invokebuiltin):
|
|
7442
|
+
fprintf(f, "{\n");
|
|
7443
|
+
{
|
|
7444
|
+
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7445
|
+
MAYBE_UNUSED(RB_BUILTIN bf) = (RB_BUILTIN)operands[0];
|
|
7446
|
+
if (status->local_stack_p) {
|
|
7447
|
+
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
7448
|
+
}
|
|
7449
|
+
fprintf(f, " MAYBE_UNUSED(RB_BUILTIN) bf;\n");
|
|
7450
|
+
fprintf(f, " MAYBE_UNUSED(VALUE) ret;\n");
|
|
7451
|
+
|
|
7452
|
+
fprintf(f, " bf = (RB_BUILTIN)0x%"PRIxVALUE";", operands[0]);
|
|
7453
|
+
fprintf(f, "\n");
|
|
7454
|
+
if (body->catch_except_p || TRUE) {
|
|
7455
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
7456
|
+
pc_moved_p = TRUE;
|
|
7457
|
+
}
|
|
7458
|
+
if (status->local_stack_p) {
|
|
7459
|
+
}
|
|
7460
|
+
else {
|
|
7461
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
7462
|
+
}
|
|
7463
|
+
fprintf(f, " {\n");
|
|
7464
|
+
fprintf(f, " ret = vm_invoke_builtin(ec, reg_cfp, bf, %s);\n",
|
|
7465
|
+
(status->local_stack_p ? "stack + (stack_size - (bf->argc))" : "STACK_ADDR_FROM_TOP(bf->argc)"));
|
|
7466
|
+
fprintf(f, " }\n");
|
|
7467
|
+
fprintf(f, " stack[%d] = ret;\n", b->stack_size + (int)attr_sp_inc_invokebuiltin(bf) - 1);
|
|
7468
|
+
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
7469
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_invokebuiltin(bf));
|
|
7470
|
+
if (!pc_moved_p) {
|
|
7471
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
7472
|
+
}
|
|
7473
|
+
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
7474
|
+
fprintf(f, " goto cancel;\n");
|
|
7475
|
+
fprintf(f, " }\n");
|
|
7476
|
+
b->stack_size += attr_sp_inc_invokebuiltin(bf);
|
|
7477
|
+
}
|
|
7478
|
+
fprintf(f, "}\n");
|
|
7479
|
+
break;
|
|
7480
|
+
case BIN(opt_invokebuiltin_delegate):
|
|
7481
|
+
fprintf(f, "{\n");
|
|
7482
|
+
{
|
|
7483
|
+
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7484
|
+
MAYBE_UNUSED(RB_BUILTIN bf) = (RB_BUILTIN)operands[0];
|
|
7485
|
+
MAYBE_UNUSED(rb_num_t index) = (rb_num_t)operands[1];
|
|
7486
|
+
if (status->local_stack_p) {
|
|
7487
|
+
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
7488
|
+
}
|
|
7489
|
+
fprintf(f, " MAYBE_UNUSED(RB_BUILTIN) bf;\n");
|
|
7490
|
+
fprintf(f, " MAYBE_UNUSED(VALUE) ret;\n");
|
|
7491
|
+
fprintf(f, " MAYBE_UNUSED(rb_num_t) index;\n");
|
|
7492
|
+
|
|
7493
|
+
fprintf(f, " bf = (RB_BUILTIN)0x%"PRIxVALUE";", operands[0]);
|
|
7494
|
+
fprintf(f, "\n");
|
|
7495
|
+
fprintf(f, " index = (rb_num_t)0x%"PRIxVALUE";", operands[1]);
|
|
7496
|
+
fprintf(f, "\n");
|
|
7497
|
+
if (body->catch_except_p || TRUE) {
|
|
7498
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
7499
|
+
pc_moved_p = TRUE;
|
|
7500
|
+
}
|
|
7501
|
+
if (status->local_stack_p) {
|
|
7502
|
+
}
|
|
7503
|
+
else {
|
|
7504
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
7505
|
+
}
|
|
7506
|
+
fprintf(f, " {\n");
|
|
7507
|
+
fprintf(f, " ret = vm_invoke_builtin_delegate(ec, reg_cfp, bf, (unsigned int)index);\n");
|
|
7508
|
+
fprintf(f, " }\n");
|
|
7509
|
+
fprintf(f, " stack[%d] = ret;\n", b->stack_size + (int)attr_sp_inc_opt_invokebuiltin_delegate(bf, index) - 1);
|
|
7510
|
+
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
7511
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_invokebuiltin_delegate(bf, index));
|
|
7512
|
+
if (!pc_moved_p) {
|
|
7513
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
7514
|
+
}
|
|
7515
|
+
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
7516
|
+
fprintf(f, " goto cancel;\n");
|
|
7517
|
+
fprintf(f, " }\n");
|
|
7518
|
+
b->stack_size += attr_sp_inc_opt_invokebuiltin_delegate(bf, index);
|
|
7519
|
+
}
|
|
7520
|
+
fprintf(f, "}\n");
|
|
7521
|
+
break;
|
|
7522
|
+
case BIN(opt_invokebuiltin_delegate_leave):
|
|
7523
|
+
fprintf(f, "{\n");
|
|
7524
|
+
{
|
|
7525
|
+
MAYBE_UNUSED(int pc_moved_p) = FALSE;
|
|
7526
|
+
MAYBE_UNUSED(RB_BUILTIN bf) = (RB_BUILTIN)operands[0];
|
|
7527
|
+
MAYBE_UNUSED(rb_num_t index) = (rb_num_t)operands[1];
|
|
7528
|
+
if (status->local_stack_p) {
|
|
7529
|
+
fprintf(f, " MAYBE_UNUSED(unsigned int) stack_size = %u;\n", b->stack_size);
|
|
7530
|
+
}
|
|
7531
|
+
fprintf(f, " MAYBE_UNUSED(RB_BUILTIN) bf;\n");
|
|
7532
|
+
fprintf(f, " MAYBE_UNUSED(VALUE) val;\n");
|
|
7533
|
+
fprintf(f, " MAYBE_UNUSED(rb_num_t) index;\n");
|
|
7534
|
+
|
|
7535
|
+
fprintf(f, " bf = (RB_BUILTIN)0x%"PRIxVALUE";", operands[0]);
|
|
7536
|
+
fprintf(f, "\n");
|
|
7537
|
+
fprintf(f, " index = (rb_num_t)0x%"PRIxVALUE";", operands[1]);
|
|
7538
|
+
fprintf(f, "\n");
|
|
7539
|
+
if (body->catch_except_p || TRUE) {
|
|
7540
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos); /* ADD_PC(INSN_ATTR(width)); */
|
|
7541
|
+
pc_moved_p = TRUE;
|
|
7542
|
+
}
|
|
7543
|
+
if (status->local_stack_p) {
|
|
7544
|
+
}
|
|
7545
|
+
else {
|
|
7546
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
|
|
7547
|
+
}
|
|
7548
|
+
fprintf(f, " {\n");
|
|
7549
|
+
fprintf(f, " val = vm_invoke_builtin_delegate(ec, reg_cfp, bf, (unsigned int)index);\n");
|
|
7550
|
+
fprintf(f, "\n");
|
|
7551
|
+
fprintf(f, " /* leave fastpath */\n");
|
|
7552
|
+
fprintf(f, " /* TracePoint/return should fallback this insn to opt_invokebuiltin_delegate */\n");
|
|
7553
|
+
fprintf(f, " if (vm_pop_frame(ec, GET_CFP(), GET_EP())) {\n");
|
|
7554
|
+
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
7555
|
+
fprintf(f, " rb_ec_thread_ptr(ec)->retval = val;\n");
|
|
7556
|
+
fprintf(f, " return 0;\n");
|
|
7557
|
+
fprintf(f, "#else\n");
|
|
7558
|
+
fprintf(f, " return val;\n");
|
|
7559
|
+
fprintf(f, "#endif\n");
|
|
7560
|
+
fprintf(f, " }\n");
|
|
7561
|
+
fprintf(f, " else {\n");
|
|
7562
|
+
fprintf(f, "#if OPT_CALL_THREADED_CODE\n");
|
|
7563
|
+
fprintf(f, " rb_ec_thread_ptr(ec)->retval = val;\n");
|
|
7564
|
+
fprintf(f, " return 0;\n");
|
|
7565
|
+
fprintf(f, "#else\n");
|
|
7566
|
+
fprintf(f, " return val;\n");
|
|
7567
|
+
fprintf(f, "#endif\n");
|
|
7568
|
+
fprintf(f, " }\n");
|
|
7569
|
+
fprintf(f, " }\n");
|
|
7570
|
+
fprintf(f, " stack[%d] = val;\n", b->stack_size + (int)attr_sp_inc_opt_invokebuiltin_delegate_leave(bf, index) - 1);
|
|
7571
|
+
fprintf(f, " if (UNLIKELY(!mjit_call_p)) {\n");
|
|
7572
|
+
fprintf(f, " reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size + (int)attr_sp_inc_opt_invokebuiltin_delegate_leave(bf, index));
|
|
7573
|
+
if (!pc_moved_p) {
|
|
7574
|
+
fprintf(f, " reg_cfp->pc = original_body_iseq + %d;\n", next_pos);
|
|
7575
|
+
}
|
|
7576
|
+
fprintf(f, " RB_DEBUG_COUNTER_INC(mjit_cancel_invalidate_all);\n");
|
|
7577
|
+
fprintf(f, " goto cancel;\n");
|
|
7578
|
+
fprintf(f, " }\n");
|
|
7579
|
+
b->stack_size += attr_sp_inc_opt_invokebuiltin_delegate_leave(bf, index);
|
|
7580
|
+
}
|
|
7581
|
+
fprintf(f, "}\n");
|
|
7582
|
+
b->finish_p = TRUE;
|
|
7583
|
+
break;
|
|
7688
7584
|
case BIN(getlocal_WC_0):
|
|
7689
7585
|
fprintf(f, "{\n");
|
|
7690
7586
|
{
|