debase-ruby_core_source 0.10.12 → 0.10.13

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