debase-ruby_core_source 0.10.17 → 0.10.18

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