debase-ruby_core_source 0.10.12 → 0.10.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/debase-ruby_core_source.gemspec +1 -1
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/addr2line.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/builtin.h +84 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/list/list.h +788 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/str/str.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/constant.h +55 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/darray.h +198 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/debug_counter.h +469 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/dln.h +31 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/encindex.h +70 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/eval_intern.h +335 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/gc.h +141 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/hrtime.h +168 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/id.h +293 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/id_table.h +36 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/insns.inc +249 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/insns_info.inc +9063 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/array.h +113 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/bignum.h +246 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/bits.h +565 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/class.h +196 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/compar.h +49 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/compile.h +35 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/compilers.h +107 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/complex.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/cont.h +24 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/dir.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/enc.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/encoding.h +30 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/enum.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/enumerator.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/error.h +191 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/eval.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/file.h +38 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/fixnum.h +184 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/gc.h +186 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/hash.h +243 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/imemo.h +243 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/inits.h +50 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/io.h +38 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/load.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/loadpath.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/math.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/missing.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/numeric.h +271 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/object.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/parse.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/proc.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/process.h +137 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/random.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/range.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/rational.h +72 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/re.h +30 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/sanitizers.h +190 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/serial.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/signal.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/static_assert.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/string.h +141 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/struct.h +153 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/symbol.h +41 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/thread.h +53 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/time.h +34 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/transcode.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/util.h +27 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/variable.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/vm.h +133 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/warnings.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal.h +109 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/iseq.h +322 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/known_errors.inc +791 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/method.h +253 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/mjit.h +231 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/mjit_compile.inc +8322 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/node.h +510 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/node_name.inc +208 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/opt_sc.inc +109 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/optinsn.inc +128 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/optunifs.inc +43 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/parse.h +214 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/probes_helper.h +44 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ractor_core.h +346 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/regenc.h +254 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/regint.h +942 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/regparse.h +370 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/revision.h +2 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ruby_assert.h +14 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ruby_atomic.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/symbol.h +119 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/thread_pthread.h +115 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/thread_win32.h +61 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/timev.h +57 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/transcode_data.h +138 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/transient_heap.h +65 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/variable.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/version.h +88 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm.inc +5470 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_call_iseq_optimized.inc +244 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_callinfo.h +487 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_core.h +2107 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_debug.h +124 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_exec.h +197 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_insnhelper.h +265 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_opts.h +73 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_sync.h +137 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vmtc.inc +243 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit.h +73 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_asm.h +408 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_codegen.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_core.h +307 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_iface.h +38 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +117 -4
@@ -0,0 +1,307 @@
|
|
1
|
+
#ifndef YJIT_CORE_H
|
2
|
+
#define YJIT_CORE_H 1
|
3
|
+
|
4
|
+
#include <stddef.h>
|
5
|
+
#include <stdint.h>
|
6
|
+
#include "yjit_asm.h"
|
7
|
+
|
8
|
+
// Callee-saved regs
|
9
|
+
#define REG_CFP R13
|
10
|
+
#define REG_EC R12
|
11
|
+
#define REG_SP RBX
|
12
|
+
|
13
|
+
// Scratch registers used by YJIT
|
14
|
+
#define REG0 RAX
|
15
|
+
#define REG0_32 EAX
|
16
|
+
#define REG0_8 AL
|
17
|
+
#define REG1 RCX
|
18
|
+
#define REG1_32 ECX
|
19
|
+
|
20
|
+
// Maximum number of temp value types we keep track of
|
21
|
+
#define MAX_TEMP_TYPES 8
|
22
|
+
|
23
|
+
// Maximum number of local variable types we keep track of
|
24
|
+
#define MAX_LOCAL_TYPES 8
|
25
|
+
|
26
|
+
// Default versioning context (no type information)
|
27
|
+
#define DEFAULT_CTX ( (ctx_t){ 0 } )
|
28
|
+
|
29
|
+
enum yjit_type_enum
|
30
|
+
{
|
31
|
+
ETYPE_UNKNOWN = 0,
|
32
|
+
ETYPE_NIL,
|
33
|
+
ETYPE_TRUE,
|
34
|
+
ETYPE_FALSE,
|
35
|
+
ETYPE_FIXNUM,
|
36
|
+
ETYPE_FLONUM,
|
37
|
+
ETYPE_ARRAY,
|
38
|
+
ETYPE_HASH,
|
39
|
+
ETYPE_SYMBOL,
|
40
|
+
ETYPE_STRING
|
41
|
+
};
|
42
|
+
|
43
|
+
// Represent the type of a value (local/stack/self) in YJIT
|
44
|
+
typedef struct yjit_type_struct
|
45
|
+
{
|
46
|
+
// Value is definitely a heap object
|
47
|
+
uint8_t is_heap : 1;
|
48
|
+
|
49
|
+
// Value is definitely an immediate
|
50
|
+
uint8_t is_imm : 1;
|
51
|
+
|
52
|
+
// Specific value type, if known
|
53
|
+
uint8_t type : 4;
|
54
|
+
|
55
|
+
} val_type_t;
|
56
|
+
STATIC_ASSERT(val_type_size, sizeof(val_type_t) == 1);
|
57
|
+
|
58
|
+
// Unknown type, could be anything, all zeroes
|
59
|
+
#define TYPE_UNKNOWN ( (val_type_t){ 0 } )
|
60
|
+
|
61
|
+
// Could be any heap object
|
62
|
+
#define TYPE_HEAP ( (val_type_t){ .is_heap = 1 } )
|
63
|
+
|
64
|
+
// Could be any immediate
|
65
|
+
#define TYPE_IMM ( (val_type_t){ .is_imm = 1 } )
|
66
|
+
|
67
|
+
#define TYPE_NIL ( (val_type_t){ .is_imm = 1, .type = ETYPE_NIL } )
|
68
|
+
#define TYPE_TRUE ( (val_type_t){ .is_imm = 1, .type = ETYPE_TRUE } )
|
69
|
+
#define TYPE_FALSE ( (val_type_t){ .is_imm = 1, .type = ETYPE_FALSE } )
|
70
|
+
#define TYPE_FIXNUM ( (val_type_t){ .is_imm = 1, .type = ETYPE_FIXNUM } )
|
71
|
+
#define TYPE_FLONUM ( (val_type_t){ .is_imm = 1, .type = ETYPE_FLONUM } )
|
72
|
+
#define TYPE_STATIC_SYMBOL ( (val_type_t){ .is_imm = 1, .type = ETYPE_SYMBOL } )
|
73
|
+
#define TYPE_ARRAY ( (val_type_t){ .is_heap = 1, .type = ETYPE_ARRAY } )
|
74
|
+
#define TYPE_HASH ( (val_type_t){ .is_heap = 1, .type = ETYPE_HASH } )
|
75
|
+
#define TYPE_STRING ( (val_type_t){ .is_heap = 1, .type = ETYPE_STRING } )
|
76
|
+
|
77
|
+
enum yjit_temp_loc
|
78
|
+
{
|
79
|
+
TEMP_STACK = 0,
|
80
|
+
TEMP_SELF,
|
81
|
+
TEMP_LOCAL, // Local with index
|
82
|
+
//TEMP_CONST, // Small constant (0, 1, 2, Qnil, Qfalse, Qtrue)
|
83
|
+
};
|
84
|
+
|
85
|
+
// Potential mapping of a value on the temporary stack to
|
86
|
+
// self, a local variable or constant so that we can track its type
|
87
|
+
typedef struct yjit_temp_mapping
|
88
|
+
{
|
89
|
+
// Where/how is the value stored?
|
90
|
+
uint8_t kind: 2;
|
91
|
+
|
92
|
+
// Index of the local variale,
|
93
|
+
// or small non-negative constant in [0, 63]
|
94
|
+
uint8_t idx : 6;
|
95
|
+
|
96
|
+
} temp_mapping_t;
|
97
|
+
STATIC_ASSERT(temp_mapping_size, sizeof(temp_mapping_t) == 1);
|
98
|
+
|
99
|
+
// By default, temps are just temps on the stack.
|
100
|
+
// Name conflict with an mmap flag. This is a struct instance,
|
101
|
+
// so the compiler will check for wrong usage.
|
102
|
+
#undef MAP_STACK
|
103
|
+
#define MAP_STACK ( (temp_mapping_t) { 0 } )
|
104
|
+
|
105
|
+
// Temp value is actually self
|
106
|
+
#define MAP_SELF ( (temp_mapping_t) { .kind = TEMP_SELF } )
|
107
|
+
|
108
|
+
// Represents both the type and mapping
|
109
|
+
typedef struct {
|
110
|
+
temp_mapping_t mapping;
|
111
|
+
val_type_t type;
|
112
|
+
} temp_type_mapping_t;
|
113
|
+
STATIC_ASSERT(temp_type_mapping_size, sizeof(temp_type_mapping_t) == 2);
|
114
|
+
|
115
|
+
// Operand to a bytecode instruction
|
116
|
+
typedef struct yjit_insn_opnd
|
117
|
+
{
|
118
|
+
// Indicates if the value is self
|
119
|
+
bool is_self;
|
120
|
+
|
121
|
+
// Index on the temporary stack (for stack operands only)
|
122
|
+
uint16_t idx;
|
123
|
+
|
124
|
+
} insn_opnd_t;
|
125
|
+
|
126
|
+
#define OPND_SELF ( (insn_opnd_t){ .is_self = true } )
|
127
|
+
#define OPND_STACK(stack_idx) ( (insn_opnd_t){ .is_self = false, .idx = stack_idx } )
|
128
|
+
|
129
|
+
/**
|
130
|
+
Code generation context
|
131
|
+
Contains information we can use to optimize code
|
132
|
+
*/
|
133
|
+
typedef struct yjit_context
|
134
|
+
{
|
135
|
+
// Number of values currently on the temporary stack
|
136
|
+
uint16_t stack_size;
|
137
|
+
|
138
|
+
// Offset of the JIT SP relative to the interpreter SP
|
139
|
+
// This represents how far the JIT's SP is from the "real" SP
|
140
|
+
int16_t sp_offset;
|
141
|
+
|
142
|
+
// Depth of this block in the sidechain (eg: inline-cache chain)
|
143
|
+
uint8_t chain_depth;
|
144
|
+
|
145
|
+
// Local variable types we keepp track of
|
146
|
+
val_type_t local_types[MAX_LOCAL_TYPES];
|
147
|
+
|
148
|
+
// Temporary variable types we keep track of
|
149
|
+
val_type_t temp_types[MAX_TEMP_TYPES];
|
150
|
+
|
151
|
+
// Type we track for self
|
152
|
+
val_type_t self_type;
|
153
|
+
|
154
|
+
// Mapping of temp stack entries to types we track
|
155
|
+
temp_mapping_t temp_mapping[MAX_TEMP_TYPES];
|
156
|
+
|
157
|
+
} ctx_t;
|
158
|
+
STATIC_ASSERT(yjit_ctx_size, sizeof(ctx_t) <= 32);
|
159
|
+
|
160
|
+
// Tuple of (iseq, idx) used to identify basic blocks
|
161
|
+
typedef struct BlockId
|
162
|
+
{
|
163
|
+
// Instruction sequence
|
164
|
+
const rb_iseq_t *iseq;
|
165
|
+
|
166
|
+
// Index in the iseq where the block starts
|
167
|
+
uint32_t idx;
|
168
|
+
|
169
|
+
} blockid_t;
|
170
|
+
|
171
|
+
// Null block id constant
|
172
|
+
static const blockid_t BLOCKID_NULL = { 0, 0 };
|
173
|
+
|
174
|
+
/// Branch code shape enumeration
|
175
|
+
typedef enum branch_shape
|
176
|
+
{
|
177
|
+
SHAPE_NEXT0, // Target 0 is next
|
178
|
+
SHAPE_NEXT1, // Target 1 is next
|
179
|
+
SHAPE_DEFAULT // Neither target is next
|
180
|
+
} branch_shape_t;
|
181
|
+
|
182
|
+
// Branch code generation function signature
|
183
|
+
typedef void (*branchgen_fn)(codeblock_t* cb, uint8_t* target0, uint8_t* target1, uint8_t shape);
|
184
|
+
|
185
|
+
/**
|
186
|
+
Store info about an outgoing branch in a code segment
|
187
|
+
Note: care must be taken to minimize the size of branch_t objects
|
188
|
+
*/
|
189
|
+
typedef struct yjit_branch_entry
|
190
|
+
{
|
191
|
+
// Block this is attached to
|
192
|
+
struct yjit_block_version *block;
|
193
|
+
|
194
|
+
// Positions where the generated code starts and ends
|
195
|
+
uint8_t *start_addr;
|
196
|
+
uint8_t *end_addr;
|
197
|
+
|
198
|
+
// Context right after the branch instruction
|
199
|
+
// Unused for now.
|
200
|
+
// ctx_t src_ctx;
|
201
|
+
|
202
|
+
// Branch target blocks and their contexts
|
203
|
+
blockid_t targets[2];
|
204
|
+
ctx_t target_ctxs[2];
|
205
|
+
struct yjit_block_version *blocks[2];
|
206
|
+
|
207
|
+
// Jump target addresses
|
208
|
+
uint8_t *dst_addrs[2];
|
209
|
+
|
210
|
+
// Branch code generation function
|
211
|
+
branchgen_fn gen_fn;
|
212
|
+
|
213
|
+
// Shape of the branch
|
214
|
+
branch_shape_t shape : 2;
|
215
|
+
|
216
|
+
} branch_t;
|
217
|
+
|
218
|
+
// In case this block is invalidated, these two pieces of info
|
219
|
+
// help to remove all pointers to this block in the system.
|
220
|
+
typedef struct {
|
221
|
+
VALUE receiver_klass;
|
222
|
+
VALUE callee_cme;
|
223
|
+
} cme_dependency_t;
|
224
|
+
|
225
|
+
typedef rb_darray(cme_dependency_t) cme_dependency_array_t;
|
226
|
+
|
227
|
+
typedef rb_darray(branch_t*) branch_array_t;
|
228
|
+
|
229
|
+
typedef rb_darray(uint32_t) int32_array_t;
|
230
|
+
|
231
|
+
/**
|
232
|
+
Basic block version
|
233
|
+
Represents a portion of an iseq compiled with a given context
|
234
|
+
Note: care must be taken to minimize the size of block_t objects
|
235
|
+
*/
|
236
|
+
typedef struct yjit_block_version
|
237
|
+
{
|
238
|
+
// Bytecode sequence (iseq, idx) this is a version of
|
239
|
+
blockid_t blockid;
|
240
|
+
|
241
|
+
// Context at the start of the block
|
242
|
+
ctx_t ctx;
|
243
|
+
|
244
|
+
// Positions where the generated code starts and ends
|
245
|
+
uint8_t *start_addr;
|
246
|
+
uint8_t *end_addr;
|
247
|
+
|
248
|
+
// List of incoming branches (from predecessors)
|
249
|
+
branch_array_t incoming;
|
250
|
+
|
251
|
+
// List of outgoing branches (to successors)
|
252
|
+
// Note: these are owned by this block version
|
253
|
+
branch_array_t outgoing;
|
254
|
+
|
255
|
+
// Offsets for GC managed objects in the mainline code block
|
256
|
+
int32_array_t gc_object_offsets;
|
257
|
+
|
258
|
+
// CME dependencies of this block, to help to remove all pointers to this
|
259
|
+
// block in the system.
|
260
|
+
cme_dependency_array_t cme_dependencies;
|
261
|
+
|
262
|
+
// Code address of an exit for `ctx` and `blockid`. Used for block
|
263
|
+
// invalidation.
|
264
|
+
uint8_t *entry_exit;
|
265
|
+
|
266
|
+
// Index one past the last instruction in the iseq
|
267
|
+
uint32_t end_idx;
|
268
|
+
|
269
|
+
} block_t;
|
270
|
+
|
271
|
+
// Code generation state
|
272
|
+
typedef struct JITState
|
273
|
+
{
|
274
|
+
// Inline and outlined code blocks we are
|
275
|
+
// currently generating code into
|
276
|
+
codeblock_t* cb;
|
277
|
+
codeblock_t* ocb;
|
278
|
+
|
279
|
+
// Block version being compiled
|
280
|
+
block_t *block;
|
281
|
+
|
282
|
+
// Instruction sequence this is associated with
|
283
|
+
const rb_iseq_t *iseq;
|
284
|
+
|
285
|
+
// Index of the current instruction being compiled
|
286
|
+
uint32_t insn_idx;
|
287
|
+
|
288
|
+
// Opcode for the instruction being compiled
|
289
|
+
int opcode;
|
290
|
+
|
291
|
+
// PC of the instruction being compiled
|
292
|
+
VALUE *pc;
|
293
|
+
|
294
|
+
// Side exit to the instruction being compiled. See :side-exit:.
|
295
|
+
uint8_t *side_exit_for_pc;
|
296
|
+
|
297
|
+
// Execution context when compilation started
|
298
|
+
// This allows us to peek at run-time values
|
299
|
+
rb_execution_context_t *ec;
|
300
|
+
|
301
|
+
// Whether we need to record the code address at
|
302
|
+
// the end of this bytecode instruction for global invalidation
|
303
|
+
bool record_boundary_patch_point;
|
304
|
+
|
305
|
+
} jitstate_t;
|
306
|
+
|
307
|
+
#endif // #ifndef YJIT_CORE_H
|
@@ -0,0 +1,38 @@
|
|
1
|
+
//
|
2
|
+
// These are definitions YJIT uses to interface with the CRuby codebase,
|
3
|
+
// but which are only used internally by YJIT.
|
4
|
+
//
|
5
|
+
|
6
|
+
#ifndef YJIT_IFACE_H
|
7
|
+
#define YJIT_IFACE_H 1
|
8
|
+
|
9
|
+
#include "ruby/internal/config.h"
|
10
|
+
#include "ruby_assert.h" // for RUBY_DEBUG
|
11
|
+
#include "yjit.h" // for YJIT_STATS
|
12
|
+
#include "vm_core.h"
|
13
|
+
#include "yjit_core.h"
|
14
|
+
|
15
|
+
#ifndef YJIT_DEFAULT_CALL_THRESHOLD
|
16
|
+
# define YJIT_DEFAULT_CALL_THRESHOLD 10
|
17
|
+
#endif
|
18
|
+
|
19
|
+
RUBY_EXTERN struct rb_yjit_options rb_yjit_opts;
|
20
|
+
|
21
|
+
static VALUE *yjit_iseq_pc_at_idx(const rb_iseq_t *iseq, uint32_t insn_idx);
|
22
|
+
static int yjit_opcode_at_pc(const rb_iseq_t *iseq, const VALUE *pc);
|
23
|
+
static void yjit_print_iseq(const rb_iseq_t *iseq);
|
24
|
+
|
25
|
+
#if YJIT_STATS
|
26
|
+
// this function *must* return passed exit_pc
|
27
|
+
static const VALUE *yjit_count_side_exit_op(const VALUE *exit_pc);
|
28
|
+
#endif
|
29
|
+
|
30
|
+
static void yjit_unlink_method_lookup_dependency(block_t *block);
|
31
|
+
static void yjit_block_assumptions_free(block_t *block);
|
32
|
+
|
33
|
+
static VALUE yjit_get_code_page(uint32_t cb_bytes_needed, uint32_t ocb_bytes_needed);
|
34
|
+
//code_page_t *rb_yjit_code_page_unwrap(VALUE cp_obj);
|
35
|
+
//void rb_yjit_get_cb(codeblock_t* cb, uint8_t* code_ptr);
|
36
|
+
//void rb_yjit_get_ocb(codeblock_t* cb, uint8_t* code_ptr);
|
37
|
+
|
38
|
+
#endif // #ifndef YJIT_IFACE_H
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debase-ruby_core_source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Moseley
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-12-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: archive-tar-minitar
|
@@ -2407,8 +2407,121 @@ files:
|
|
2407
2407
|
- lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_opts.h
|
2408
2408
|
- lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_sync.h
|
2409
2409
|
- lib/debase/ruby_core_source/ruby-3.0.0-p0/vmtc.inc
|
2410
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/addr2line.h
|
2411
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/builtin.h
|
2412
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/build_assert/build_assert.h
|
2413
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/check_type/check_type.h
|
2414
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/container_of/container_of.h
|
2415
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/list/list.h
|
2416
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/str/str.h
|
2417
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/constant.h
|
2418
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/darray.h
|
2419
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/debug_counter.h
|
2420
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/dln.h
|
2421
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/encindex.h
|
2422
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/eval_intern.h
|
2423
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/gc.h
|
2424
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/hrtime.h
|
2425
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/id.h
|
2426
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/id_table.h
|
2427
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/insns.inc
|
2428
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/insns_info.inc
|
2429
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal.h
|
2430
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/array.h
|
2431
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/bignum.h
|
2432
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/bits.h
|
2433
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/class.h
|
2434
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/compar.h
|
2435
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/compile.h
|
2436
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/compilers.h
|
2437
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/complex.h
|
2438
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/cont.h
|
2439
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/dir.h
|
2440
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/enc.h
|
2441
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/encoding.h
|
2442
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/enum.h
|
2443
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/enumerator.h
|
2444
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/error.h
|
2445
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/eval.h
|
2446
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/file.h
|
2447
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/fixnum.h
|
2448
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/gc.h
|
2449
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/hash.h
|
2450
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/imemo.h
|
2451
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/inits.h
|
2452
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/io.h
|
2453
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/load.h
|
2454
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/loadpath.h
|
2455
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/math.h
|
2456
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/missing.h
|
2457
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/numeric.h
|
2458
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/object.h
|
2459
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/parse.h
|
2460
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/proc.h
|
2461
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/process.h
|
2462
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/random.h
|
2463
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/range.h
|
2464
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/rational.h
|
2465
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/re.h
|
2466
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/sanitizers.h
|
2467
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/serial.h
|
2468
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/signal.h
|
2469
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/static_assert.h
|
2470
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/string.h
|
2471
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/struct.h
|
2472
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/symbol.h
|
2473
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/thread.h
|
2474
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/time.h
|
2475
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/transcode.h
|
2476
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/util.h
|
2477
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/variable.h
|
2478
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/vm.h
|
2479
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/warnings.h
|
2480
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/iseq.h
|
2481
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/known_errors.inc
|
2482
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/method.h
|
2483
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/mjit.h
|
2484
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/mjit_compile.inc
|
2485
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/node.h
|
2486
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/node_name.inc
|
2487
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/opt_sc.inc
|
2488
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/optinsn.inc
|
2489
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/optunifs.inc
|
2490
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/parse.h
|
2491
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/probes_helper.h
|
2492
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/ractor_core.h
|
2493
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/regenc.h
|
2494
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/regint.h
|
2495
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/regparse.h
|
2496
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/revision.h
|
2497
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/ruby_assert.h
|
2498
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/ruby_atomic.h
|
2499
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/siphash.h
|
2500
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/symbol.h
|
2501
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/thread_pthread.h
|
2502
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/thread_win32.h
|
2503
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/timev.h
|
2504
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/transcode_data.h
|
2505
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/transient_heap.h
|
2506
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/variable.h
|
2507
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/version.h
|
2508
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/vm.inc
|
2509
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_call_iseq_optimized.inc
|
2510
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_callinfo.h
|
2511
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_core.h
|
2512
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_debug.h
|
2513
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_exec.h
|
2514
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_insnhelper.h
|
2515
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_opts.h
|
2516
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_sync.h
|
2517
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/vmtc.inc
|
2518
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit.h
|
2519
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_asm.h
|
2520
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_codegen.h
|
2521
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_core.h
|
2522
|
+
- lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_iface.h
|
2410
2523
|
- lib/debase/ruby_core_source/version.rb
|
2411
|
-
homepage:
|
2524
|
+
homepage: https://github.com/ruby-debug/debase-ruby_core_source
|
2412
2525
|
licenses:
|
2413
2526
|
- MIT
|
2414
2527
|
metadata: {}
|
@@ -2427,7 +2540,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2427
2540
|
- !ruby/object:Gem::Version
|
2428
2541
|
version: 1.3.6
|
2429
2542
|
requirements: []
|
2430
|
-
rubygems_version: 3.
|
2543
|
+
rubygems_version: 3.3.0.dev
|
2431
2544
|
signing_key:
|
2432
2545
|
specification_version: 4
|
2433
2546
|
summary: Provide Ruby core source files
|