debase-ruby_core_source 3.2.1 → 3.2.3
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 +10 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/addr2line.h +3 -1
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/darray.h +246 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/debug_counter.h +7 -10
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/eval_intern.h +3 -1
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/id.h +44 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/insns_info.inc +128 -154
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/array.h +9 -20
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/internal/bits.h +568 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/class.h +11 -2
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/cmdlineopt.h +5 -1
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/compile.h +0 -1
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/error.h +24 -2
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/gc.h +29 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/hash.h +19 -44
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/imemo.h +0 -1
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/internal/io.h +137 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/internal/parse.h +108 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/process.h +0 -14
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/range.h +2 -2
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/re.h +1 -1
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/internal/ruby_parser.h +69 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/signal.h +4 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/string.h +15 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/struct.h +9 -34
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/thread.h +14 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/variable.h +17 -35
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/vm.h +9 -2
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/iseq.h +4 -4
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/method.h +8 -7
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/node.h +128 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/node_name.inc +4 -2
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/parse.h +19 -6
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1/internal/bits.h → ruby-3.3.0-preview3/parser_bits.h} +4 -4
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/parser_node.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/parser_st.h +162 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/parser_value.h +106 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/prism_compile.h +18 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ractor_core.h +10 -4
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/regint.h +8 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/regparse.h +2 -1
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/revision.h +5 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/rubyparser.h +1403 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/shape.h +32 -22
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/symbol.h +2 -3
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/thread_none.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/thread_pthread.h +66 -28
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/thread_win32.h +1 -6
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/variable.h +9 -2
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/version.h +7 -3
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm.inc +383 -497
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_callinfo.h +54 -16
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_core.h +92 -57
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_exec.h +11 -10
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_insnhelper.h +20 -23
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_opts.h +0 -5
- data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/yjit.h +12 -12
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +120 -115
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/darray.h +0 -179
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/io.h +0 -38
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/parse.h +0 -25
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/node.h +0 -514
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/opt_sc.inc +0 -109
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/revision.h +0 -5
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/transient_heap.h +0 -65
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/builtin.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ccan/build_assert/build_assert.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ccan/check_type/check_type.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ccan/container_of/container_of.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ccan/list/list.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ccan/str/str.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/constant.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/dln.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/encindex.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/hrtime.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/id_table.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/insns.inc +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/basic_operators.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/bignum.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/compar.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/compilers.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/complex.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/cont.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/dir.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/enc.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/encoding.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/enum.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/enumerator.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/eval.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/file.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/fixnum.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/inits.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/load.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/loadpath.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/math.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/missing.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/numeric.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/object.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/proc.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/ractor.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/random.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/rational.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/sanitizers.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/serial.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/static_assert.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/symbol.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/time.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/transcode.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/util.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/warnings.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/known_errors.inc +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/optinsn.inc +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/optunifs.inc +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/probes_helper.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/regenc.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/rjit.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/rjit_c.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ruby_assert.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ruby_atomic.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/siphash.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/timev.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/transcode_data.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_call_iseq_optimized.inc +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_debug.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_sync.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vmtc.inc +0 -0
|
@@ -43,6 +43,7 @@ enum vm_call_flag_bits {
|
|
|
43
43
|
|
|
44
44
|
struct rb_callinfo_kwarg {
|
|
45
45
|
int keyword_len;
|
|
46
|
+
int references;
|
|
46
47
|
VALUE keywords[];
|
|
47
48
|
};
|
|
48
49
|
|
|
@@ -65,8 +66,12 @@ struct rb_callinfo {
|
|
|
65
66
|
VALUE argc;
|
|
66
67
|
};
|
|
67
68
|
|
|
68
|
-
#
|
|
69
|
+
#if !defined(USE_EMBED_CI) || (USE_EMBED_CI+0)
|
|
70
|
+
#undef USE_EMBED_CI
|
|
69
71
|
#define USE_EMBED_CI 1
|
|
72
|
+
#else
|
|
73
|
+
#undef USE_EMBED_CI
|
|
74
|
+
#define USE_EMBED_CI 0
|
|
70
75
|
#endif
|
|
71
76
|
|
|
72
77
|
#if SIZEOF_VALUE == 8
|
|
@@ -96,7 +101,9 @@ struct rb_callinfo {
|
|
|
96
101
|
static inline bool
|
|
97
102
|
vm_ci_packed_p(const struct rb_callinfo *ci)
|
|
98
103
|
{
|
|
99
|
-
|
|
104
|
+
if (!USE_EMBED_CI) {
|
|
105
|
+
return 0;
|
|
106
|
+
}
|
|
100
107
|
if (LIKELY(((VALUE)ci) & 0x01)) {
|
|
101
108
|
return 1;
|
|
102
109
|
}
|
|
@@ -104,9 +111,6 @@ vm_ci_packed_p(const struct rb_callinfo *ci)
|
|
|
104
111
|
VM_ASSERT(IMEMO_TYPE_P(ci, imemo_callinfo));
|
|
105
112
|
return 0;
|
|
106
113
|
}
|
|
107
|
-
#else
|
|
108
|
-
return 0;
|
|
109
|
-
#endif
|
|
110
114
|
}
|
|
111
115
|
|
|
112
116
|
static inline bool
|
|
@@ -196,12 +200,13 @@ vm_ci_dump(const struct rb_callinfo *ci)
|
|
|
196
200
|
static inline const struct rb_callinfo *
|
|
197
201
|
vm_ci_new_(ID mid, unsigned int flag, unsigned int argc, const struct rb_callinfo_kwarg *kwarg, const char *file, int line)
|
|
198
202
|
{
|
|
199
|
-
|
|
200
|
-
|
|
203
|
+
if (kwarg) {
|
|
204
|
+
((struct rb_callinfo_kwarg *)kwarg)->references++;
|
|
205
|
+
}
|
|
206
|
+
if (USE_EMBED_CI && VM_CI_EMBEDDABLE_P(mid, flag, argc, kwarg)) {
|
|
201
207
|
RB_DEBUG_COUNTER_INC(ci_packed);
|
|
202
208
|
return vm_ci_new_id(mid, flag, argc, kwarg);
|
|
203
209
|
}
|
|
204
|
-
#endif
|
|
205
210
|
|
|
206
211
|
const bool debug = 0;
|
|
207
212
|
if (debug) ruby_debug_printf("%s:%d ", file, line);
|
|
@@ -295,6 +300,17 @@ struct rb_callcache {
|
|
|
295
300
|
#define VM_CALLCACHE_UNMARKABLE FL_FREEZE
|
|
296
301
|
#define VM_CALLCACHE_ON_STACK FL_EXIVAR
|
|
297
302
|
|
|
303
|
+
#define VM_CALLCACHE_IVAR IMEMO_FL_USER0
|
|
304
|
+
#define VM_CALLCACHE_BF IMEMO_FL_USER1
|
|
305
|
+
#define VM_CALLCACHE_SUPER IMEMO_FL_USER2
|
|
306
|
+
#define VM_CALLCACHE_REFINEMENT IMEMO_FL_USER3
|
|
307
|
+
|
|
308
|
+
enum vm_cc_type {
|
|
309
|
+
cc_type_normal, // chained from ccs
|
|
310
|
+
cc_type_super,
|
|
311
|
+
cc_type_refinement,
|
|
312
|
+
};
|
|
313
|
+
|
|
298
314
|
extern const struct rb_callcache *rb_vm_empty_cc(void);
|
|
299
315
|
extern const struct rb_callcache *rb_vm_empty_cc_for_super(void);
|
|
300
316
|
|
|
@@ -311,14 +327,39 @@ vm_cc_attr_index_initialize(const struct rb_callcache *cc, shape_id_t shape_id)
|
|
|
311
327
|
static inline const struct rb_callcache *
|
|
312
328
|
vm_cc_new(VALUE klass,
|
|
313
329
|
const struct rb_callable_method_entry_struct *cme,
|
|
314
|
-
vm_call_handler call
|
|
330
|
+
vm_call_handler call,
|
|
331
|
+
enum vm_cc_type type)
|
|
315
332
|
{
|
|
316
333
|
const struct rb_callcache *cc = (const struct rb_callcache *)rb_imemo_new(imemo_callcache, (VALUE)cme, (VALUE)call, 0, klass);
|
|
334
|
+
|
|
335
|
+
switch (type) {
|
|
336
|
+
case cc_type_normal:
|
|
337
|
+
break;
|
|
338
|
+
case cc_type_super:
|
|
339
|
+
*(VALUE *)&cc->flags |= VM_CALLCACHE_SUPER;
|
|
340
|
+
break;
|
|
341
|
+
case cc_type_refinement:
|
|
342
|
+
*(VALUE *)&cc->flags |= VM_CALLCACHE_REFINEMENT;
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
|
|
317
346
|
vm_cc_attr_index_initialize(cc, INVALID_SHAPE_ID);
|
|
318
347
|
RB_DEBUG_COUNTER_INC(cc_new);
|
|
319
348
|
return cc;
|
|
320
349
|
}
|
|
321
350
|
|
|
351
|
+
static inline bool
|
|
352
|
+
vm_cc_super_p(const struct rb_callcache *cc)
|
|
353
|
+
{
|
|
354
|
+
return (cc->flags & VM_CALLCACHE_SUPER) != 0;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
static inline bool
|
|
358
|
+
vm_cc_refinement_p(const struct rb_callcache *cc)
|
|
359
|
+
{
|
|
360
|
+
return (cc->flags & VM_CALLCACHE_REFINEMENT) != 0;
|
|
361
|
+
}
|
|
362
|
+
|
|
322
363
|
#define VM_CC_ON_STACK(clazz, call, aux, cme) \
|
|
323
364
|
(struct rb_callcache) { \
|
|
324
365
|
.flags = T_IMEMO | \
|
|
@@ -438,9 +479,6 @@ vm_cc_valid_p(const struct rb_callcache *cc, const rb_callable_method_entry_t *c
|
|
|
438
479
|
|
|
439
480
|
/* callcache: mutate */
|
|
440
481
|
|
|
441
|
-
#define VM_CALLCACH_IVAR IMEMO_FL_USER0
|
|
442
|
-
#define VM_CALLCACH_BF IMEMO_FL_USER1
|
|
443
|
-
|
|
444
482
|
static inline void
|
|
445
483
|
vm_cc_call_set(const struct rb_callcache *cc, vm_call_handler call)
|
|
446
484
|
{
|
|
@@ -460,13 +498,13 @@ vm_cc_attr_index_set(const struct rb_callcache *cc, attr_index_t index, shape_id
|
|
|
460
498
|
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
|
461
499
|
VM_ASSERT(cc != vm_cc_empty());
|
|
462
500
|
*attr_value = (attr_index_t)(index + 1) | ((uintptr_t)(dest_shape_id) << SHAPE_FLAG_SHIFT);
|
|
463
|
-
*(VALUE *)&cc->flags |=
|
|
501
|
+
*(VALUE *)&cc->flags |= VM_CALLCACHE_IVAR;
|
|
464
502
|
}
|
|
465
503
|
|
|
466
504
|
static inline bool
|
|
467
505
|
vm_cc_ivar_p(const struct rb_callcache *cc)
|
|
468
506
|
{
|
|
469
|
-
return (cc->flags &
|
|
507
|
+
return (cc->flags & VM_CALLCACHE_IVAR) != 0;
|
|
470
508
|
}
|
|
471
509
|
|
|
472
510
|
static inline void
|
|
@@ -495,13 +533,13 @@ vm_cc_bf_set(const struct rb_callcache *cc, const struct rb_builtin_function *bf
|
|
|
495
533
|
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
|
496
534
|
VM_ASSERT(cc != vm_cc_empty());
|
|
497
535
|
*(const struct rb_builtin_function **)&cc->aux_.bf = bf;
|
|
498
|
-
*(VALUE *)&cc->flags |=
|
|
536
|
+
*(VALUE *)&cc->flags |= VM_CALLCACHE_BF;
|
|
499
537
|
}
|
|
500
538
|
|
|
501
539
|
static inline bool
|
|
502
540
|
vm_cc_bf_p(const struct rb_callcache *cc)
|
|
503
541
|
{
|
|
504
|
-
return (cc->flags &
|
|
542
|
+
return (cc->flags & VM_CALLCACHE_BF) != 0;
|
|
505
543
|
}
|
|
506
544
|
|
|
507
545
|
static inline void
|
|
@@ -132,18 +132,9 @@ extern int ruby_assert_critical_section_entered;
|
|
|
132
132
|
#define RUBY_NSIG NSIG
|
|
133
133
|
|
|
134
134
|
#if defined(SIGCLD)
|
|
135
|
-
# define RUBY_SIGCHLD
|
|
135
|
+
# define RUBY_SIGCHLD (SIGCLD)
|
|
136
136
|
#elif defined(SIGCHLD)
|
|
137
|
-
# define RUBY_SIGCHLD
|
|
138
|
-
#else
|
|
139
|
-
# define RUBY_SIGCHLD (0)
|
|
140
|
-
#endif
|
|
141
|
-
|
|
142
|
-
/* platforms with broken or non-existent SIGCHLD work by polling */
|
|
143
|
-
#if defined(__APPLE__)
|
|
144
|
-
# define SIGCHLD_LOSSY (1)
|
|
145
|
-
#else
|
|
146
|
-
# define SIGCHLD_LOSSY (0)
|
|
137
|
+
# define RUBY_SIGCHLD (SIGCHLD)
|
|
147
138
|
#endif
|
|
148
139
|
|
|
149
140
|
#if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__)
|
|
@@ -191,9 +182,6 @@ void *rb_register_sigaltstack(void *);
|
|
|
191
182
|
#if OPT_DIRECT_THREADED_CODE
|
|
192
183
|
#undef OPT_DIRECT_THREADED_CODE
|
|
193
184
|
#endif /* OPT_DIRECT_THREADED_CODE */
|
|
194
|
-
#if OPT_STACK_CACHING
|
|
195
|
-
#undef OPT_STACK_CACHING
|
|
196
|
-
#endif /* OPT_STACK_CACHING */
|
|
197
185
|
#endif /* OPT_CALL_THREADED_CODE */
|
|
198
186
|
|
|
199
187
|
void rb_vm_encoded_insn_data_table_init(void);
|
|
@@ -290,7 +278,7 @@ union iseq_inline_storage_entry {
|
|
|
290
278
|
};
|
|
291
279
|
|
|
292
280
|
struct rb_calling_info {
|
|
293
|
-
const struct
|
|
281
|
+
const struct rb_call_data *cd;
|
|
294
282
|
const struct rb_callcache *cc;
|
|
295
283
|
VALUE block_handler;
|
|
296
284
|
VALUE recv;
|
|
@@ -515,10 +503,17 @@ struct rb_iseq_constant_body {
|
|
|
515
503
|
const rb_iseq_t *mandatory_only_iseq;
|
|
516
504
|
|
|
517
505
|
#if USE_RJIT || USE_YJIT
|
|
518
|
-
// Function pointer for JIT code
|
|
519
|
-
rb_jit_func_t
|
|
520
|
-
// Number of
|
|
521
|
-
long unsigned
|
|
506
|
+
// Function pointer for JIT code on jit_exec()
|
|
507
|
+
rb_jit_func_t jit_entry;
|
|
508
|
+
// Number of calls on jit_exec()
|
|
509
|
+
long unsigned jit_entry_calls;
|
|
510
|
+
#endif
|
|
511
|
+
|
|
512
|
+
#if USE_YJIT
|
|
513
|
+
// Function pointer for JIT code on jit_exec_exception()
|
|
514
|
+
rb_jit_func_t jit_exception;
|
|
515
|
+
// Number of calls on jit_exec_exception()
|
|
516
|
+
long unsigned jit_exception_calls;
|
|
522
517
|
#endif
|
|
523
518
|
|
|
524
519
|
#if USE_RJIT
|
|
@@ -529,6 +524,8 @@ struct rb_iseq_constant_body {
|
|
|
529
524
|
#if USE_YJIT
|
|
530
525
|
// YJIT stores some data on each iseq.
|
|
531
526
|
void *yjit_payload;
|
|
527
|
+
// Used to estimate how frequently this ISEQ gets called
|
|
528
|
+
uint64_t yjit_calls_at_interv;
|
|
532
529
|
#endif
|
|
533
530
|
};
|
|
534
531
|
|
|
@@ -557,22 +554,21 @@ struct rb_iseq_struct {
|
|
|
557
554
|
|
|
558
555
|
#define ISEQ_BODY(iseq) ((iseq)->body)
|
|
559
556
|
|
|
560
|
-
#
|
|
557
|
+
#if !defined(USE_LAZY_LOAD) || !(USE_LAZY_LOAD+0)
|
|
561
558
|
#define USE_LAZY_LOAD 0
|
|
562
559
|
#endif
|
|
563
560
|
|
|
564
|
-
#if USE_LAZY_LOAD
|
|
565
|
-
const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq);
|
|
561
|
+
#if !USE_LAZY_LOAD
|
|
562
|
+
static inline const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq) {return 0;}
|
|
566
563
|
#endif
|
|
564
|
+
const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq);
|
|
567
565
|
|
|
568
566
|
static inline const rb_iseq_t *
|
|
569
567
|
rb_iseq_check(const rb_iseq_t *iseq)
|
|
570
568
|
{
|
|
571
|
-
|
|
572
|
-
if (ISEQ_BODY(iseq) == NULL) {
|
|
569
|
+
if (USE_LAZY_LOAD && ISEQ_BODY(iseq) == NULL) {
|
|
573
570
|
rb_iseq_complete((rb_iseq_t *)iseq);
|
|
574
571
|
}
|
|
575
|
-
#endif
|
|
576
572
|
return iseq;
|
|
577
573
|
}
|
|
578
574
|
|
|
@@ -640,15 +636,51 @@ typedef struct rb_vm_struct {
|
|
|
640
636
|
struct rb_ractor_struct *lock_owner;
|
|
641
637
|
unsigned int lock_rec;
|
|
642
638
|
|
|
643
|
-
// barrier
|
|
644
|
-
bool barrier_waiting;
|
|
645
|
-
unsigned int barrier_cnt;
|
|
646
|
-
rb_nativethread_cond_t barrier_cond;
|
|
647
|
-
|
|
648
639
|
// join at exit
|
|
649
640
|
rb_nativethread_cond_t terminate_cond;
|
|
650
641
|
bool terminate_waiting;
|
|
642
|
+
|
|
643
|
+
#ifndef RUBY_THREAD_PTHREAD_H
|
|
644
|
+
bool barrier_waiting;
|
|
645
|
+
unsigned int barrier_cnt;
|
|
646
|
+
rb_nativethread_cond_t barrier_cond;
|
|
647
|
+
#endif
|
|
651
648
|
} sync;
|
|
649
|
+
|
|
650
|
+
// ractor scheduling
|
|
651
|
+
struct {
|
|
652
|
+
rb_nativethread_lock_t lock;
|
|
653
|
+
struct rb_ractor_struct *lock_owner;
|
|
654
|
+
bool locked;
|
|
655
|
+
|
|
656
|
+
rb_nativethread_cond_t cond; // GRQ
|
|
657
|
+
unsigned int snt_cnt; // count of shared NTs
|
|
658
|
+
unsigned int dnt_cnt; // count of dedicated NTs
|
|
659
|
+
|
|
660
|
+
unsigned int running_cnt;
|
|
661
|
+
|
|
662
|
+
unsigned int max_cpu;
|
|
663
|
+
struct ccan_list_head grq; // // Global Ready Queue
|
|
664
|
+
unsigned int grq_cnt;
|
|
665
|
+
|
|
666
|
+
// running threads
|
|
667
|
+
struct ccan_list_head running_threads;
|
|
668
|
+
|
|
669
|
+
// threads which switch context by timeslice
|
|
670
|
+
struct ccan_list_head timeslice_threads;
|
|
671
|
+
|
|
672
|
+
struct ccan_list_head zombie_threads;
|
|
673
|
+
|
|
674
|
+
// true if timeslice timer is not enable
|
|
675
|
+
bool timeslice_wait_inf;
|
|
676
|
+
|
|
677
|
+
// barrier
|
|
678
|
+
rb_nativethread_cond_t barrier_complete_cond;
|
|
679
|
+
rb_nativethread_cond_t barrier_release_cond;
|
|
680
|
+
bool barrier_waiting;
|
|
681
|
+
unsigned int barrier_waiting_cnt;
|
|
682
|
+
unsigned int barrier_serial;
|
|
683
|
+
} sched;
|
|
652
684
|
} ractor;
|
|
653
685
|
|
|
654
686
|
#ifdef USE_SIGALTSTACK
|
|
@@ -819,19 +851,16 @@ struct rb_block {
|
|
|
819
851
|
};
|
|
820
852
|
|
|
821
853
|
typedef struct rb_control_frame_struct {
|
|
822
|
-
const VALUE *pc;
|
|
823
|
-
VALUE *sp;
|
|
824
|
-
const rb_iseq_t *iseq;
|
|
825
|
-
VALUE self;
|
|
826
|
-
const VALUE *ep;
|
|
827
|
-
const void *block_code;
|
|
828
|
-
|
|
829
|
-
|
|
854
|
+
const VALUE *pc; // cfp[0]
|
|
855
|
+
VALUE *sp; // cfp[1]
|
|
856
|
+
const rb_iseq_t *iseq; // cfp[2]
|
|
857
|
+
VALUE self; // cfp[3] / block[0]
|
|
858
|
+
const VALUE *ep; // cfp[4] / block[1]
|
|
859
|
+
const void *block_code; // cfp[5] / block[2] -- iseq, ifunc, or forwarded block handler
|
|
860
|
+
void *jit_return; // cfp[6] -- return address for JIT code
|
|
830
861
|
#if VM_DEBUG_BP_CHECK
|
|
831
|
-
VALUE *bp_check;
|
|
862
|
+
VALUE *bp_check; // cfp[7]
|
|
832
863
|
#endif
|
|
833
|
-
// Return address for YJIT code
|
|
834
|
-
void *jit_return;
|
|
835
864
|
} rb_control_frame_t;
|
|
836
865
|
|
|
837
866
|
extern const rb_data_type_t ruby_threadptr_data_type;
|
|
@@ -1559,12 +1588,6 @@ vm_block_handler_verify(MAYBE_UNUSED(VALUE block_handler))
|
|
|
1559
1588
|
(vm_block_handler_type(block_handler), 1));
|
|
1560
1589
|
}
|
|
1561
1590
|
|
|
1562
|
-
static inline int
|
|
1563
|
-
vm_cfp_forwarded_bh_p(const rb_control_frame_t *cfp, VALUE block_handler)
|
|
1564
|
-
{
|
|
1565
|
-
return ((VALUE) cfp->block_code) == block_handler;
|
|
1566
|
-
}
|
|
1567
|
-
|
|
1568
1591
|
static inline enum rb_block_type
|
|
1569
1592
|
vm_block_type(const struct rb_block *block)
|
|
1570
1593
|
{
|
|
@@ -1693,17 +1716,13 @@ VALUE rb_proc_alloc(VALUE klass);
|
|
|
1693
1716
|
VALUE rb_proc_dup(VALUE self);
|
|
1694
1717
|
|
|
1695
1718
|
/* for debug */
|
|
1696
|
-
extern
|
|
1697
|
-
extern
|
|
1698
|
-
extern
|
|
1699
|
-
#if OPT_STACK_CACHING
|
|
1700
|
-
, VALUE reg_a, VALUE reg_b
|
|
1701
|
-
#endif
|
|
1702
|
-
);
|
|
1719
|
+
extern bool rb_vmdebug_stack_dump_raw(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, FILE *);
|
|
1720
|
+
extern bool rb_vmdebug_debug_print_pre(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, const VALUE *_pc, FILE *);
|
|
1721
|
+
extern bool rb_vmdebug_debug_print_post(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, FILE *);
|
|
1703
1722
|
|
|
1704
|
-
#define SDR() rb_vmdebug_stack_dump_raw(GET_EC(), GET_EC()->cfp)
|
|
1705
|
-
#define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_EC(), (cfp))
|
|
1706
|
-
|
|
1723
|
+
#define SDR() rb_vmdebug_stack_dump_raw(GET_EC(), GET_EC()->cfp, stderr)
|
|
1724
|
+
#define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_EC(), (cfp), stderr)
|
|
1725
|
+
bool rb_vm_bugreport(const void *, FILE *);
|
|
1707
1726
|
typedef void (*ruby_sighandler_t)(int);
|
|
1708
1727
|
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 4, 5)
|
|
1709
1728
|
NORETURN(void rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int sig, const void *, const char *fmt, ...));
|
|
@@ -1758,6 +1777,7 @@ rb_vm_living_threads_init(rb_vm_t *vm)
|
|
|
1758
1777
|
ccan_list_head_init(&vm->waiting_fds);
|
|
1759
1778
|
ccan_list_head_init(&vm->workqueue);
|
|
1760
1779
|
ccan_list_head_init(&vm->ractor.set);
|
|
1780
|
+
ccan_list_head_init(&vm->ractor.sched.zombie_threads);
|
|
1761
1781
|
}
|
|
1762
1782
|
|
|
1763
1783
|
typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE);
|
|
@@ -1771,6 +1791,7 @@ rb_thread_t * ruby_thread_from_native(void);
|
|
|
1771
1791
|
int ruby_thread_set_native(rb_thread_t *th);
|
|
1772
1792
|
int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, ID *called_idp, VALUE *klassp);
|
|
1773
1793
|
void rb_vm_rewind_cfp(rb_execution_context_t *ec, rb_control_frame_t *cfp);
|
|
1794
|
+
void rb_vm_env_write(const VALUE *ep, int index, VALUE v);
|
|
1774
1795
|
VALUE rb_vm_bh_to_procval(const rb_execution_context_t *ec, VALUE block_handler);
|
|
1775
1796
|
|
|
1776
1797
|
void rb_vm_register_special_exception_str(enum ruby_special_exceptions sp, VALUE exception_class, VALUE mesg);
|
|
@@ -1857,6 +1878,20 @@ rb_current_execution_context(bool expect_ec)
|
|
|
1857
1878
|
#else
|
|
1858
1879
|
rb_execution_context_t *ec = ruby_current_ec;
|
|
1859
1880
|
#endif
|
|
1881
|
+
|
|
1882
|
+
/* On the shared objects, `__tls_get_addr()` is used to access the TLS
|
|
1883
|
+
* and the address of the `ruby_current_ec` can be stored on a function
|
|
1884
|
+
* frame. However, this address can be mis-used after native thread
|
|
1885
|
+
* migration of a coroutine.
|
|
1886
|
+
* 1) Get `ptr =&ruby_current_ec` op NT1 and store it on the frame.
|
|
1887
|
+
* 2) Context switch and resume it on the NT2.
|
|
1888
|
+
* 3) `ptr` is used on NT2 but it accesses to the TLS on NT1.
|
|
1889
|
+
* This assertion checks such misusage.
|
|
1890
|
+
*
|
|
1891
|
+
* To avoid accidents, `GET_EC()` should be called once on the frame.
|
|
1892
|
+
* Note that inlining can produce the problem.
|
|
1893
|
+
*/
|
|
1894
|
+
VM_ASSERT(ec == rb_current_ec_noinline());
|
|
1860
1895
|
#else
|
|
1861
1896
|
rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key);
|
|
1862
1897
|
#endif
|
|
@@ -21,11 +21,7 @@ typedef rb_iseq_t *ISEQ;
|
|
|
21
21
|
#define DEBUG_ENTER_INSN(insn) \
|
|
22
22
|
rb_vmdebug_debug_print_pre(ec, GET_CFP(), GET_PC());
|
|
23
23
|
|
|
24
|
-
#if OPT_STACK_CACHING
|
|
25
|
-
#define SC_REGS() , reg_a, reg_b
|
|
26
|
-
#else
|
|
27
24
|
#define SC_REGS()
|
|
28
|
-
#endif
|
|
29
25
|
|
|
30
26
|
#define DEBUG_END_INSN() \
|
|
31
27
|
rb_vmdebug_debug_print_post(ec, GET_CFP() SC_REGS());
|
|
@@ -40,10 +36,6 @@ typedef rb_iseq_t *ISEQ;
|
|
|
40
36
|
#define throwdebug if(0)ruby_debug_printf
|
|
41
37
|
/* #define throwdebug ruby_debug_printf */
|
|
42
38
|
|
|
43
|
-
#ifndef USE_INSNS_COUNTER
|
|
44
|
-
#define USE_INSNS_COUNTER 0
|
|
45
|
-
#endif
|
|
46
|
-
|
|
47
39
|
/************************************************/
|
|
48
40
|
#if defined(DISPATCH_XXX)
|
|
49
41
|
error !
|
|
@@ -80,8 +72,7 @@ error !
|
|
|
80
72
|
(reg_cfp->pc - ISEQ_BODY(reg_cfp->iseq)->iseq_encoded), \
|
|
81
73
|
RSTRING_PTR(rb_iseq_path(reg_cfp->iseq)), \
|
|
82
74
|
rb_iseq_line_no(reg_cfp->iseq, reg_pc - ISEQ_BODY(reg_cfp->iseq)->iseq_encoded)); \
|
|
83
|
-
}
|
|
84
|
-
if (USE_INSNS_COUNTER) vm_insns_counter_count_insn(BIN(insn));
|
|
75
|
+
}
|
|
85
76
|
|
|
86
77
|
#define INSN_DISPATCH_SIG(insn)
|
|
87
78
|
|
|
@@ -174,10 +165,20 @@ default: \
|
|
|
174
165
|
#define THROW_EXCEPTION(exc) return (VALUE)(exc)
|
|
175
166
|
#endif
|
|
176
167
|
|
|
168
|
+
// Run the interpreter from the JIT
|
|
169
|
+
#define VM_EXEC(ec, val) do { \
|
|
170
|
+
if (val == Qundef) { \
|
|
171
|
+
VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH); \
|
|
172
|
+
val = vm_exec(ec); \
|
|
173
|
+
} \
|
|
174
|
+
} while (0)
|
|
175
|
+
|
|
176
|
+
// Run the JIT from the interpreter
|
|
177
177
|
#define JIT_EXEC(ec, val) do { \
|
|
178
178
|
rb_jit_func_t func; \
|
|
179
179
|
if (val == Qundef && (func = jit_compile(ec))) { \
|
|
180
180
|
val = func(ec, ec->cfp); \
|
|
181
|
+
RESTORE_REGS(); /* fix cfp for tailcall */ \
|
|
181
182
|
if (ec->tag->state) THROW_EXCEPTION(val); \
|
|
182
183
|
} \
|
|
183
184
|
} while (0)
|
data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_insnhelper.h
RENAMED
|
@@ -20,30 +20,29 @@ RUBY_EXTERN rb_serial_t ruby_vm_global_cvar_state;
|
|
|
20
20
|
# define RJIT_STATS RUBY_DEBUG
|
|
21
21
|
#endif
|
|
22
22
|
|
|
23
|
+
#if USE_YJIT // We want vm_insns_count on any YJIT-enabled build
|
|
24
|
+
// Increment vm_insns_count for --yjit-stats. We increment this even when
|
|
25
|
+
// --yjit or --yjit-stats is not used because branching to skip it is slower.
|
|
26
|
+
// We also don't use ATOMIC_INC for performance, allowing inaccuracy on Ractors.
|
|
27
|
+
#define YJIT_COLLECT_USAGE_INSN(insn) rb_vm_insns_count++
|
|
28
|
+
#else
|
|
29
|
+
#define YJIT_COLLECT_USAGE_INSN(insn) // none
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
#if RJIT_STATS
|
|
33
|
+
#define RJIT_COLLECT_USAGE_INSN(insn) rb_rjit_collect_vm_usage_insn(insn)
|
|
34
|
+
#else
|
|
35
|
+
#define RJIT_COLLECT_USAGE_INSN(insn) // none
|
|
36
|
+
#endif
|
|
37
|
+
|
|
23
38
|
#if VM_COLLECT_USAGE_DETAILS
|
|
24
39
|
#define COLLECT_USAGE_INSN(insn) vm_collect_usage_insn(insn)
|
|
25
40
|
#define COLLECT_USAGE_OPERAND(insn, n, op) vm_collect_usage_operand((insn), (n), ((VALUE)(op)))
|
|
26
|
-
|
|
27
41
|
#define COLLECT_USAGE_REGISTER(reg, s) vm_collect_usage_register((reg), (s))
|
|
28
|
-
#elif RJIT_STATS && YJIT_STATS
|
|
29
|
-
// Both flags could be enabled at the same time. You need to call both in that case.
|
|
30
|
-
#define COLLECT_USAGE_INSN(insn) rb_rjit_collect_vm_usage_insn(insn); rb_yjit_collect_vm_usage_insn(insn)
|
|
31
|
-
#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */
|
|
32
|
-
#define COLLECT_USAGE_REGISTER(reg, s) /* none */
|
|
33
|
-
#elif RJIT_STATS
|
|
34
|
-
// for --rjit-stats
|
|
35
|
-
#define COLLECT_USAGE_INSN(insn) rb_rjit_collect_vm_usage_insn(insn)
|
|
36
|
-
#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */
|
|
37
|
-
#define COLLECT_USAGE_REGISTER(reg, s) /* none */
|
|
38
|
-
#elif YJIT_STATS
|
|
39
|
-
/* for --yjit-stats */
|
|
40
|
-
#define COLLECT_USAGE_INSN(insn) rb_yjit_collect_vm_usage_insn(insn)
|
|
41
|
-
#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */
|
|
42
|
-
#define COLLECT_USAGE_REGISTER(reg, s) /* none */
|
|
43
42
|
#else
|
|
44
|
-
#define COLLECT_USAGE_INSN(insn)
|
|
45
|
-
#define COLLECT_USAGE_OPERAND(insn, n, op)
|
|
46
|
-
#define COLLECT_USAGE_REGISTER(reg, s)
|
|
43
|
+
#define COLLECT_USAGE_INSN(insn) YJIT_COLLECT_USAGE_INSN(insn); RJIT_COLLECT_USAGE_INSN(insn)
|
|
44
|
+
#define COLLECT_USAGE_OPERAND(insn, n, op) // none
|
|
45
|
+
#define COLLECT_USAGE_REGISTER(reg, s) // none
|
|
47
46
|
#endif
|
|
48
47
|
|
|
49
48
|
/**********************************************************/
|
|
@@ -182,10 +181,8 @@ CC_SET_FASTPATH(const struct rb_callcache *cc, vm_call_handler func, bool enable
|
|
|
182
181
|
/**********************************************************/
|
|
183
182
|
|
|
184
183
|
#define CALL_SIMPLE_METHOD() do { \
|
|
185
|
-
rb_snum_t
|
|
186
|
-
|
|
187
|
-
rb_snum_t z = x - y; \
|
|
188
|
-
ADD_PC(z); \
|
|
184
|
+
rb_snum_t insn_width = attr_width_opt_send_without_block(0); \
|
|
185
|
+
ADD_PC(-insn_width); \
|
|
189
186
|
DISPATCH_ORIGINAL_INSN(opt_send_without_block); \
|
|
190
187
|
} while (0)
|
|
191
188
|
|
|
@@ -54,17 +54,12 @@
|
|
|
54
54
|
#define OPT_OPERANDS_UNIFICATION 1
|
|
55
55
|
#define OPT_INSTRUCTIONS_UNIFICATION 0
|
|
56
56
|
#define OPT_UNIFY_ALL_COMBINATION 0
|
|
57
|
-
#define OPT_STACK_CACHING 0
|
|
58
57
|
|
|
59
58
|
/* misc */
|
|
60
59
|
#ifndef OPT_SUPPORT_JOKE
|
|
61
60
|
#define OPT_SUPPORT_JOKE 0
|
|
62
61
|
#endif
|
|
63
62
|
|
|
64
|
-
#ifndef OPT_SUPPORT_CALL_C_FUNCTION
|
|
65
|
-
#define OPT_SUPPORT_CALL_C_FUNCTION 0
|
|
66
|
-
#endif
|
|
67
|
-
|
|
68
63
|
#ifndef VM_COLLECT_USAGE_DETAILS
|
|
69
64
|
#define VM_COLLECT_USAGE_DETAILS 0
|
|
70
65
|
#endif
|
|
@@ -25,16 +25,17 @@
|
|
|
25
25
|
#endif
|
|
26
26
|
|
|
27
27
|
// Expose these as declarations since we are building YJIT.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
extern uint64_t rb_yjit_call_threshold;
|
|
29
|
+
extern uint64_t rb_yjit_cold_threshold;
|
|
30
|
+
extern uint64_t rb_yjit_live_iseq_count;
|
|
31
|
+
extern bool rb_yjit_enabled_p;
|
|
32
|
+
void rb_yjit_incr_counter(const char *counter_name);
|
|
31
33
|
void rb_yjit_invalidate_all_method_lookup_assumptions(void);
|
|
32
34
|
void rb_yjit_cme_invalidate(rb_callable_method_entry_t *cme);
|
|
33
|
-
void rb_yjit_collect_vm_usage_insn(int insn);
|
|
34
35
|
void rb_yjit_collect_binding_alloc(void);
|
|
35
36
|
void rb_yjit_collect_binding_set(void);
|
|
36
|
-
|
|
37
|
-
void rb_yjit_init(
|
|
37
|
+
void rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception);
|
|
38
|
+
void rb_yjit_init(bool yjit_enabled);
|
|
38
39
|
void rb_yjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop);
|
|
39
40
|
void rb_yjit_constant_state_changed(ID id);
|
|
40
41
|
void rb_yjit_iseq_mark(void *payload);
|
|
@@ -43,21 +44,20 @@ void rb_yjit_iseq_free(void *payload);
|
|
|
43
44
|
void rb_yjit_before_ractor_spawn(void);
|
|
44
45
|
void rb_yjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx);
|
|
45
46
|
void rb_yjit_tracing_invalidate_all(void);
|
|
47
|
+
void rb_yjit_show_usage(int help, int highlight, unsigned int width, int columns);
|
|
46
48
|
|
|
47
49
|
#else
|
|
48
50
|
// !USE_YJIT
|
|
49
51
|
// In these builds, YJIT could never be turned on. Provide dummy implementations.
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
static inline
|
|
53
|
-
static inline unsigned rb_yjit_call_threshold(void) { return UINT_MAX; }
|
|
53
|
+
#define rb_yjit_enabled_p false
|
|
54
|
+
static inline void rb_yjit_incr_counter(const char *counter_name) {}
|
|
54
55
|
static inline void rb_yjit_invalidate_all_method_lookup_assumptions(void) {}
|
|
55
56
|
static inline void rb_yjit_cme_invalidate(rb_callable_method_entry_t *cme) {}
|
|
56
|
-
static inline void rb_yjit_collect_vm_usage_insn(int insn) {}
|
|
57
57
|
static inline void rb_yjit_collect_binding_alloc(void) {}
|
|
58
58
|
static inline void rb_yjit_collect_binding_set(void) {}
|
|
59
|
-
static inline
|
|
60
|
-
static inline void rb_yjit_init(
|
|
59
|
+
static inline void rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception) {}
|
|
60
|
+
static inline void rb_yjit_init(bool yjit_enabled) {}
|
|
61
61
|
static inline void rb_yjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {}
|
|
62
62
|
static inline void rb_yjit_constant_state_changed(ID id) {}
|
|
63
63
|
static inline void rb_yjit_iseq_mark(void *payload) {}
|