debase-ruby_core_source 0.10.14 → 0.10.15

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