debase-ruby_core_source 0.10.16 → 0.10.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/addr2line.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/builtin.h +121 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/ccan/list/list.h +789 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/ccan/str/str.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/constant.h +55 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/darray.h +179 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/debug_counter.h +469 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/dln.h +31 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/encindex.h +70 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/eval_intern.h +339 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/gc.h +143 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/hrtime.h +226 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/id.h +295 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/id_table.h +36 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/insns.inc +249 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/insns_info.inc +9061 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/array.h +162 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/bignum.h +246 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/bits.h +565 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/class.h +212 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/cmdlineopt.h +58 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/compar.h +49 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/compile.h +35 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/compilers.h +107 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/complex.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/cont.h +26 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/dir.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/enc.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/encoding.h +30 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/enum.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/enumerator.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/error.h +191 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/eval.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/file.h +38 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/fixnum.h +184 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/gc.h +188 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/hash.h +243 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/imemo.h +242 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/inits.h +50 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/io.h +38 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/load.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/loadpath.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/math.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/missing.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/numeric.h +271 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/object.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/parse.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/proc.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/process.h +137 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/ractor.h +6 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/random.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/range.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/rational.h +72 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/re.h +30 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/sanitizers.h +190 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/serial.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/signal.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/static_assert.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/string.h +146 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/struct.h +153 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/symbol.h +42 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/thread.h +54 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/time.h +34 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/transcode.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/util.h +27 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/variable.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/vm.h +134 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal/warnings.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/internal.h +113 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/iseq.h +328 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/known_errors.inc +791 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/method.h +253 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/mjit.h +136 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/mjit_compile_attr.inc +430 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/mjit_compiler.h +58 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/mjit_unit.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/node.h +510 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/node_name.inc +208 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/opt_sc.inc +109 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/optinsn.inc +128 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/optunifs.inc +43 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/parse.h +214 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/probes_helper.h +44 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/ractor_core.h +341 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/regenc.h +255 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/regint.h +957 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/regparse.h +370 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/revision.h +2 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/ruby_assert.h +14 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/ruby_atomic.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/symbol.h +119 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/thread_none.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/thread_pthread.h +132 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/thread_win32.h +63 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/timev.h +57 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/transcode_data.h +138 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/transient_heap.h +65 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/variable.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/version.h +68 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/vm.inc +5476 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/vm_call_iseq_optimized.inc +244 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/vm_callinfo.h +522 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/vm_core.h +2130 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/vm_debug.h +122 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/vm_exec.h +197 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/vm_insnhelper.h +269 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/vm_opts.h +73 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/vm_sync.h +137 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/vmtc.inc +243 -0
- data/lib/debase/ruby_core_source/ruby-3.2.0-preview2/yjit.h +72 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +116 -2
@@ -0,0 +1,328 @@
|
|
1
|
+
#ifndef RUBY_ISEQ_H
|
2
|
+
#define RUBY_ISEQ_H 1
|
3
|
+
/**********************************************************************
|
4
|
+
|
5
|
+
iseq.h -
|
6
|
+
|
7
|
+
$Author$
|
8
|
+
created at: 04/01/01 23:36:57 JST
|
9
|
+
|
10
|
+
Copyright (C) 2004-2008 Koichi Sasada
|
11
|
+
|
12
|
+
**********************************************************************/
|
13
|
+
#include "internal/gc.h"
|
14
|
+
#include "vm_core.h"
|
15
|
+
|
16
|
+
RUBY_EXTERN const int ruby_api_version[];
|
17
|
+
#define ISEQ_MAJOR_VERSION ((unsigned int)ruby_api_version[0])
|
18
|
+
#define ISEQ_MINOR_VERSION ((unsigned int)ruby_api_version[1])
|
19
|
+
|
20
|
+
#define ISEQ_MBITS_SIZE sizeof(iseq_bits_t)
|
21
|
+
#define ISEQ_MBITS_BITLENGTH (ISEQ_MBITS_SIZE * CHAR_BIT)
|
22
|
+
#define ISEQ_MBITS_SET(buf, i) (buf[(i) / ISEQ_MBITS_BITLENGTH] |= ((iseq_bits_t)1 << ((i) % ISEQ_MBITS_BITLENGTH)))
|
23
|
+
#define ISEQ_MBITS_SET_P(buf, i) ((buf[(i) / ISEQ_MBITS_BITLENGTH] >> ((i) % ISEQ_MBITS_BITLENGTH)) & 0x1)
|
24
|
+
#define ISEQ_MBITS_BUFLEN(size) roomof(size, ISEQ_MBITS_BITLENGTH)
|
25
|
+
|
26
|
+
#ifndef USE_ISEQ_NODE_ID
|
27
|
+
#define USE_ISEQ_NODE_ID 1
|
28
|
+
#endif
|
29
|
+
|
30
|
+
#ifndef rb_iseq_t
|
31
|
+
typedef struct rb_iseq_struct rb_iseq_t;
|
32
|
+
#define rb_iseq_t rb_iseq_t
|
33
|
+
#endif
|
34
|
+
|
35
|
+
extern const ID rb_iseq_shared_exc_local_tbl[];
|
36
|
+
|
37
|
+
#define ISEQ_COVERAGE(iseq) ISEQ_BODY(iseq)->variable.coverage
|
38
|
+
#define ISEQ_COVERAGE_SET(iseq, cov) RB_OBJ_WRITE(iseq, &ISEQ_BODY(iseq)->variable.coverage, cov)
|
39
|
+
#define ISEQ_LINE_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_LINES)
|
40
|
+
#define ISEQ_BRANCH_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_BRANCHES)
|
41
|
+
|
42
|
+
#define ISEQ_PC2BRANCHINDEX(iseq) ISEQ_BODY(iseq)->variable.pc2branchindex
|
43
|
+
#define ISEQ_PC2BRANCHINDEX_SET(iseq, h) RB_OBJ_WRITE(iseq, &ISEQ_BODY(iseq)->variable.pc2branchindex, h)
|
44
|
+
|
45
|
+
#define ISEQ_FLIP_CNT(iseq) ISEQ_BODY(iseq)->variable.flip_count
|
46
|
+
|
47
|
+
static inline rb_snum_t
|
48
|
+
ISEQ_FLIP_CNT_INCREMENT(const rb_iseq_t *iseq)
|
49
|
+
{
|
50
|
+
rb_snum_t cnt = ISEQ_BODY(iseq)->variable.flip_count;
|
51
|
+
ISEQ_BODY(iseq)->variable.flip_count += 1;
|
52
|
+
return cnt;
|
53
|
+
}
|
54
|
+
|
55
|
+
static inline VALUE *
|
56
|
+
ISEQ_ORIGINAL_ISEQ(const rb_iseq_t *iseq)
|
57
|
+
{
|
58
|
+
return ISEQ_BODY(iseq)->variable.original_iseq;
|
59
|
+
}
|
60
|
+
|
61
|
+
static inline void
|
62
|
+
ISEQ_ORIGINAL_ISEQ_CLEAR(const rb_iseq_t *iseq)
|
63
|
+
{
|
64
|
+
void *ptr = ISEQ_BODY(iseq)->variable.original_iseq;
|
65
|
+
ISEQ_BODY(iseq)->variable.original_iseq = NULL;
|
66
|
+
if (ptr) {
|
67
|
+
ruby_xfree(ptr);
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
static inline VALUE *
|
72
|
+
ISEQ_ORIGINAL_ISEQ_ALLOC(const rb_iseq_t *iseq, long size)
|
73
|
+
{
|
74
|
+
return ISEQ_BODY(iseq)->variable.original_iseq =
|
75
|
+
ALLOC_N(VALUE, size);
|
76
|
+
}
|
77
|
+
|
78
|
+
#define ISEQ_TRACE_EVENTS (RUBY_EVENT_LINE | \
|
79
|
+
RUBY_EVENT_CLASS | \
|
80
|
+
RUBY_EVENT_END | \
|
81
|
+
RUBY_EVENT_CALL | \
|
82
|
+
RUBY_EVENT_RETURN| \
|
83
|
+
RUBY_EVENT_C_CALL| \
|
84
|
+
RUBY_EVENT_C_RETURN| \
|
85
|
+
RUBY_EVENT_B_CALL| \
|
86
|
+
RUBY_EVENT_B_RETURN| \
|
87
|
+
RUBY_EVENT_COVERAGE_LINE| \
|
88
|
+
RUBY_EVENT_COVERAGE_BRANCH)
|
89
|
+
|
90
|
+
#define ISEQ_NOT_LOADED_YET IMEMO_FL_USER1
|
91
|
+
#define ISEQ_USE_COMPILE_DATA IMEMO_FL_USER2
|
92
|
+
#define ISEQ_TRANSLATED IMEMO_FL_USER3
|
93
|
+
|
94
|
+
#define ISEQ_EXECUTABLE_P(iseq) (FL_TEST_RAW(((VALUE)iseq), ISEQ_NOT_LOADED_YET | ISEQ_USE_COMPILE_DATA) == 0)
|
95
|
+
|
96
|
+
struct iseq_compile_data {
|
97
|
+
/* GC is needed */
|
98
|
+
const VALUE err_info;
|
99
|
+
const VALUE catch_table_ary; /* Array */
|
100
|
+
|
101
|
+
/* GC is not needed */
|
102
|
+
struct iseq_label_data *start_label;
|
103
|
+
struct iseq_label_data *end_label;
|
104
|
+
struct iseq_label_data *redo_label;
|
105
|
+
const rb_iseq_t *current_block;
|
106
|
+
struct iseq_compile_data_ensure_node_stack *ensure_node_stack;
|
107
|
+
struct {
|
108
|
+
struct iseq_compile_data_storage *storage_head;
|
109
|
+
struct iseq_compile_data_storage *storage_current;
|
110
|
+
} node;
|
111
|
+
struct {
|
112
|
+
struct iseq_compile_data_storage *storage_head;
|
113
|
+
struct iseq_compile_data_storage *storage_current;
|
114
|
+
} insn;
|
115
|
+
bool in_rescue;
|
116
|
+
int loopval_popped; /* used by NODE_BREAK */
|
117
|
+
int last_line;
|
118
|
+
int label_no;
|
119
|
+
int node_level;
|
120
|
+
int isolated_depth;
|
121
|
+
unsigned int ci_index;
|
122
|
+
unsigned int ic_index;
|
123
|
+
const rb_compile_option_t *option;
|
124
|
+
struct rb_id_table *ivar_cache_table;
|
125
|
+
const struct rb_builtin_function *builtin_function_table;
|
126
|
+
const NODE *root_node;
|
127
|
+
#if OPT_SUPPORT_JOKE
|
128
|
+
st_table *labels_table;
|
129
|
+
#endif
|
130
|
+
};
|
131
|
+
|
132
|
+
static inline struct iseq_compile_data *
|
133
|
+
ISEQ_COMPILE_DATA(const rb_iseq_t *iseq)
|
134
|
+
{
|
135
|
+
if (iseq->flags & ISEQ_USE_COMPILE_DATA) {
|
136
|
+
return iseq->aux.compile_data;
|
137
|
+
}
|
138
|
+
else {
|
139
|
+
return NULL;
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
static inline void
|
144
|
+
ISEQ_COMPILE_DATA_ALLOC(rb_iseq_t *iseq)
|
145
|
+
{
|
146
|
+
iseq->aux.compile_data = ZALLOC(struct iseq_compile_data);
|
147
|
+
iseq->flags |= ISEQ_USE_COMPILE_DATA;
|
148
|
+
}
|
149
|
+
|
150
|
+
static inline void
|
151
|
+
ISEQ_COMPILE_DATA_CLEAR(rb_iseq_t *iseq)
|
152
|
+
{
|
153
|
+
iseq->flags &= ~ISEQ_USE_COMPILE_DATA;
|
154
|
+
iseq->aux.compile_data = NULL;
|
155
|
+
}
|
156
|
+
|
157
|
+
static inline rb_iseq_t *
|
158
|
+
iseq_imemo_alloc(void)
|
159
|
+
{
|
160
|
+
return (rb_iseq_t *)rb_imemo_new(imemo_iseq, 0, 0, 0, 0);
|
161
|
+
}
|
162
|
+
|
163
|
+
VALUE rb_iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt);
|
164
|
+
void rb_ibf_load_iseq_complete(rb_iseq_t *iseq);
|
165
|
+
const rb_iseq_t *rb_iseq_ibf_load(VALUE str);
|
166
|
+
const rb_iseq_t *rb_iseq_ibf_load_bytes(const char *cstr, size_t);
|
167
|
+
VALUE rb_iseq_ibf_load_extra_data(VALUE str);
|
168
|
+
void rb_iseq_init_trace(rb_iseq_t *iseq);
|
169
|
+
int rb_iseq_add_local_tracepoint_recursively(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line, bool target_bmethod);
|
170
|
+
int rb_iseq_remove_local_tracepoint_recursively(const rb_iseq_t *iseq, VALUE tpval);
|
171
|
+
const rb_iseq_t *rb_iseq_load_iseq(VALUE fname);
|
172
|
+
|
173
|
+
#if VM_INSN_INFO_TABLE_IMPL == 2
|
174
|
+
unsigned int *rb_iseq_insns_info_decode_positions(const struct rb_iseq_constant_body *body);
|
175
|
+
#endif
|
176
|
+
|
177
|
+
int rb_vm_insn_addr2opcode(const void *addr);
|
178
|
+
|
179
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
180
|
+
|
181
|
+
/* compile.c */
|
182
|
+
VALUE rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node);
|
183
|
+
VALUE rb_iseq_compile_callback(rb_iseq_t *iseq, const struct rb_iseq_new_with_callback_callback_func * ifunc);
|
184
|
+
VALUE *rb_iseq_original_iseq(const rb_iseq_t *iseq);
|
185
|
+
void rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc,
|
186
|
+
VALUE locals, VALUE args,
|
187
|
+
VALUE exception, VALUE body);
|
188
|
+
void rb_iseq_mark_insn_storage(struct iseq_compile_data_storage *arena);
|
189
|
+
|
190
|
+
VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
|
191
|
+
VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
|
192
|
+
unsigned int rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos);
|
193
|
+
#ifdef USE_ISEQ_NODE_ID
|
194
|
+
int rb_iseq_node_id(const rb_iseq_t *iseq, size_t pos);
|
195
|
+
#endif
|
196
|
+
void rb_iseq_trace_set(const rb_iseq_t *iseq, rb_event_flag_t turnon_events);
|
197
|
+
void rb_iseq_trace_set_all(rb_event_flag_t turnon_events);
|
198
|
+
void rb_iseq_insns_info_encode_positions(const rb_iseq_t *iseq);
|
199
|
+
|
200
|
+
struct rb_iseq_constant_body *rb_iseq_constant_body_alloc(void);
|
201
|
+
VALUE rb_iseqw_new(const rb_iseq_t *iseq);
|
202
|
+
const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw);
|
203
|
+
|
204
|
+
VALUE rb_iseq_absolute_path(const rb_iseq_t *iseq); /* obsolete */
|
205
|
+
int rb_iseq_from_eval_p(const rb_iseq_t *iseq);
|
206
|
+
VALUE rb_iseq_type(const rb_iseq_t *iseq);
|
207
|
+
VALUE rb_iseq_label(const rb_iseq_t *iseq);
|
208
|
+
VALUE rb_iseq_base_label(const rb_iseq_t *iseq);
|
209
|
+
VALUE rb_iseq_first_lineno(const rb_iseq_t *iseq);
|
210
|
+
VALUE rb_iseq_method_name(const rb_iseq_t *iseq);
|
211
|
+
void rb_iseq_code_location(const rb_iseq_t *iseq, int *first_lineno, int *first_column, int *last_lineno, int *last_column);
|
212
|
+
|
213
|
+
void rb_iseq_remove_coverage_all(void);
|
214
|
+
|
215
|
+
/* proc.c */
|
216
|
+
const rb_iseq_t *rb_method_iseq(VALUE body);
|
217
|
+
const rb_iseq_t *rb_proc_get_iseq(VALUE proc, int *is_proc);
|
218
|
+
|
219
|
+
struct rb_compile_option_struct {
|
220
|
+
unsigned int inline_const_cache: 1;
|
221
|
+
unsigned int peephole_optimization: 1;
|
222
|
+
unsigned int tailcall_optimization: 1;
|
223
|
+
unsigned int specialized_instruction: 1;
|
224
|
+
unsigned int operands_unification: 1;
|
225
|
+
unsigned int instructions_unification: 1;
|
226
|
+
unsigned int stack_caching: 1;
|
227
|
+
unsigned int frozen_string_literal: 1;
|
228
|
+
unsigned int debug_frozen_string_literal: 1;
|
229
|
+
unsigned int coverage_enabled: 1;
|
230
|
+
int debug_level;
|
231
|
+
};
|
232
|
+
|
233
|
+
struct iseq_insn_info_entry {
|
234
|
+
int line_no;
|
235
|
+
#ifdef USE_ISEQ_NODE_ID
|
236
|
+
int node_id;
|
237
|
+
#endif
|
238
|
+
rb_event_flag_t events;
|
239
|
+
};
|
240
|
+
|
241
|
+
/*
|
242
|
+
* iseq type:
|
243
|
+
* CATCH_TYPE_RESCUE, CATCH_TYPE_ENSURE:
|
244
|
+
* use iseq as continuation.
|
245
|
+
*
|
246
|
+
* CATCH_TYPE_BREAK (iter):
|
247
|
+
* use iseq as key.
|
248
|
+
*
|
249
|
+
* CATCH_TYPE_BREAK (while), CATCH_TYPE_RETRY,
|
250
|
+
* CATCH_TYPE_REDO, CATCH_TYPE_NEXT:
|
251
|
+
* NULL.
|
252
|
+
*/
|
253
|
+
enum rb_catch_type {
|
254
|
+
CATCH_TYPE_RESCUE = INT2FIX(1),
|
255
|
+
CATCH_TYPE_ENSURE = INT2FIX(2),
|
256
|
+
CATCH_TYPE_RETRY = INT2FIX(3),
|
257
|
+
CATCH_TYPE_BREAK = INT2FIX(4),
|
258
|
+
CATCH_TYPE_REDO = INT2FIX(5),
|
259
|
+
CATCH_TYPE_NEXT = INT2FIX(6)
|
260
|
+
};
|
261
|
+
|
262
|
+
struct iseq_catch_table_entry {
|
263
|
+
enum rb_catch_type type;
|
264
|
+
rb_iseq_t *iseq;
|
265
|
+
|
266
|
+
unsigned int start;
|
267
|
+
unsigned int end;
|
268
|
+
unsigned int cont;
|
269
|
+
unsigned int sp;
|
270
|
+
};
|
271
|
+
|
272
|
+
PACKED_STRUCT_UNALIGNED(struct iseq_catch_table {
|
273
|
+
unsigned int size;
|
274
|
+
struct iseq_catch_table_entry entries[FLEX_ARY_LEN];
|
275
|
+
});
|
276
|
+
|
277
|
+
static inline int
|
278
|
+
iseq_catch_table_bytes(int n)
|
279
|
+
{
|
280
|
+
enum {
|
281
|
+
catch_table_entry_size = sizeof(struct iseq_catch_table_entry),
|
282
|
+
catch_table_entries_max = (INT_MAX - offsetof(struct iseq_catch_table, entries)) / catch_table_entry_size
|
283
|
+
};
|
284
|
+
if (n > catch_table_entries_max) rb_fatal("too large iseq_catch_table - %d", n);
|
285
|
+
return (int)(offsetof(struct iseq_catch_table, entries) +
|
286
|
+
n * catch_table_entry_size);
|
287
|
+
}
|
288
|
+
|
289
|
+
#define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE (512)
|
290
|
+
|
291
|
+
struct iseq_compile_data_storage {
|
292
|
+
struct iseq_compile_data_storage *next;
|
293
|
+
unsigned int pos;
|
294
|
+
unsigned int size;
|
295
|
+
char buff[FLEX_ARY_LEN];
|
296
|
+
};
|
297
|
+
|
298
|
+
/* defined? */
|
299
|
+
|
300
|
+
enum defined_type {
|
301
|
+
DEFINED_NOT_DEFINED,
|
302
|
+
DEFINED_NIL = 1,
|
303
|
+
DEFINED_IVAR,
|
304
|
+
DEFINED_LVAR,
|
305
|
+
DEFINED_GVAR,
|
306
|
+
DEFINED_CVAR,
|
307
|
+
DEFINED_CONST,
|
308
|
+
DEFINED_METHOD,
|
309
|
+
DEFINED_YIELD,
|
310
|
+
DEFINED_ZSUPER,
|
311
|
+
DEFINED_SELF,
|
312
|
+
DEFINED_TRUE,
|
313
|
+
DEFINED_FALSE,
|
314
|
+
DEFINED_ASGN,
|
315
|
+
DEFINED_EXPR,
|
316
|
+
DEFINED_REF,
|
317
|
+
DEFINED_FUNC,
|
318
|
+
DEFINED_CONST_FROM
|
319
|
+
};
|
320
|
+
|
321
|
+
VALUE rb_iseq_defined_string(enum defined_type type);
|
322
|
+
|
323
|
+
/* vm.c */
|
324
|
+
VALUE rb_iseq_local_variables(const rb_iseq_t *iseq);
|
325
|
+
|
326
|
+
RUBY_SYMBOL_EXPORT_END
|
327
|
+
|
328
|
+
#endif /* RUBY_ISEQ_H */
|