debase-ruby_core_source 3.2.0 → 3.2.2

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