debase-ruby_core_source 4.0.1 → 4.1.0.preview1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/addr2line.h +22 -0
  4. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/builtin.h +127 -0
  5. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/ccan/build_assert/build_assert.h +40 -0
  6. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/ccan/check_type/check_type.h +63 -0
  7. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/ccan/container_of/container_of.h +142 -0
  8. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/ccan/list/list.h +791 -0
  9. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/ccan/str/str.h +17 -0
  10. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/constant.h +53 -0
  11. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/darray.h +295 -0
  12. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/debug_counter.h +428 -0
  13. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/dln.h +33 -0
  14. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/encindex.h +70 -0
  15. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/eval_intern.h +356 -0
  16. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/hrtime.h +237 -0
  17. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/id.h +365 -0
  18. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/id_table.h +74 -0
  19. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/insns.inc +315 -0
  20. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/insns_info.inc +11637 -0
  21. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/array.h +158 -0
  22. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/basic_operators.h +67 -0
  23. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/bignum.h +249 -0
  24. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/bits.h +647 -0
  25. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/box.h +103 -0
  26. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/class.h +797 -0
  27. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/cmdlineopt.h +64 -0
  28. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/compar.h +30 -0
  29. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/compile.h +34 -0
  30. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/compilers.h +104 -0
  31. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/complex.h +29 -0
  32. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/concurrent_set.h +21 -0
  33. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/cont.h +33 -0
  34. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/coverage.h +51 -0
  35. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/dir.h +16 -0
  36. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/enc.h +19 -0
  37. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/encoding.h +40 -0
  38. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/enum.h +18 -0
  39. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/enumerator.h +21 -0
  40. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/error.h +287 -0
  41. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/eval.h +43 -0
  42. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/file.h +40 -0
  43. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/fixnum.h +185 -0
  44. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/gc.h +411 -0
  45. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/hash.h +220 -0
  46. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/imemo.h +302 -0
  47. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/inits.h +54 -0
  48. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/io.h +167 -0
  49. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/io_buffer.h +36 -0
  50. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/jit.h +23 -0
  51. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/load.h +20 -0
  52. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/loadpath.h +16 -0
  53. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/marshal.h +17 -0
  54. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/math.h +23 -0
  55. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/missing.h +19 -0
  56. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/numeric.h +326 -0
  57. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/object.h +88 -0
  58. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/objspace.h +24 -0
  59. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/parse.h +131 -0
  60. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/proc.h +34 -0
  61. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/process.h +124 -0
  62. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/ractor.h +9 -0
  63. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/random.h +17 -0
  64. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/range.h +46 -0
  65. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/rational.h +92 -0
  66. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/re.h +87 -0
  67. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/ruby_parser.h +109 -0
  68. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/sanitizers.h +346 -0
  69. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/scheduler.h +7 -0
  70. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/serial.h +23 -0
  71. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/set.h +20 -0
  72. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/set_table.h +77 -0
  73. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/signal.h +25 -0
  74. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/simd.h +18 -0
  75. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/st.h +32 -0
  76. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/static_assert.h +16 -0
  77. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/string.h +240 -0
  78. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/struct.h +120 -0
  79. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/symbol.h +46 -0
  80. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/thread.h +108 -0
  81. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/time.h +34 -0
  82. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/transcode.h +23 -0
  83. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/util.h +27 -0
  84. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/variable.h +81 -0
  85. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/vm.h +144 -0
  86. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/vm_map.h +95 -0
  87. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal/warnings.h +16 -0
  88. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/internal.h +106 -0
  89. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/iseq.h +439 -0
  90. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/known_errors.inc +1419 -0
  91. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/method.h +279 -0
  92. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/node.h +122 -0
  93. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/node_name.inc +224 -0
  94. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/optinsn.inc +128 -0
  95. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/optunifs.inc +41 -0
  96. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/parse.h +246 -0
  97. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/parser_bits.h +647 -0
  98. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/parser_node.h +32 -0
  99. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/parser_st.h +161 -0
  100. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/parser_value.h +116 -0
  101. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/arena.h +37 -0
  102. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/ast.h +10371 -0
  103. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/buffer.h +52 -0
  104. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/comments.h +43 -0
  105. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/accel.h +19 -0
  106. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/align.h +36 -0
  107. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/assume.h +25 -0
  108. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/exported.h +24 -0
  109. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/fallthrough.h +22 -0
  110. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/filesystem.h +32 -0
  111. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/flex_array.h +19 -0
  112. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/force_inline.h +21 -0
  113. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/format.h +25 -0
  114. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/inline.h +17 -0
  115. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/nodiscard.h +22 -0
  116. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/nonnull.h +18 -0
  117. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/compiler/unused.h +18 -0
  118. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/constant_pool.h +81 -0
  119. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/diagnostic.h +93 -0
  120. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/errors_format.h +53 -0
  121. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/excludes.h +29 -0
  122. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/extension.h +19 -0
  123. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/integer.h +41 -0
  124. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/allocator.h +68 -0
  125. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/allocator_debug.h +88 -0
  126. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/arena.h +108 -0
  127. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/bit.h +42 -0
  128. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/buffer.h +91 -0
  129. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/char.h +139 -0
  130. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/comments.h +20 -0
  131. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/constant_pool.h +152 -0
  132. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/diagnostic.h +389 -0
  133. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/encoding.h +242 -0
  134. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/integer.h +68 -0
  135. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/isinf.h +16 -0
  136. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/line_offset_list.h +34 -0
  137. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/list.h +62 -0
  138. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/magic_comments.h +23 -0
  139. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/memchr.h +15 -0
  140. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/node.h +32 -0
  141. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/options.h +224 -0
  142. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/parser.h +971 -0
  143. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/regexp.h +42 -0
  144. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/serialize.h +39 -0
  145. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/source.h +72 -0
  146. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/static_literals.h +100 -0
  147. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/stringy.h +35 -0
  148. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/strncasecmp.h +18 -0
  149. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/strpbrk.h +33 -0
  150. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/internal/tokens.h +11 -0
  151. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/json.h +32 -0
  152. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/line_offset_list.h +61 -0
  153. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/magic_comments.h +35 -0
  154. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/node.h +94 -0
  155. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/options.h +335 -0
  156. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/parser.h +348 -0
  157. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/prettyprint.h +31 -0
  158. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/prism.h +131 -0
  159. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/serialize.h +115 -0
  160. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/source.h +155 -0
  161. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/stream.h +28 -0
  162. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/string_query.h +63 -0
  163. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/stringy.h +72 -0
  164. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism/version.h +38 -0
  165. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism_compile.h +204 -0
  166. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/prism_xallocator.h +6 -0
  167. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/probes_helper.h +42 -0
  168. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/ractor_core.h +421 -0
  169. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/regenc.h +261 -0
  170. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/regint.h +983 -0
  171. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/regparse.h +371 -0
  172. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/revision.h +5 -0
  173. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/ruby_assert.h +14 -0
  174. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/ruby_atomic.h +115 -0
  175. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/rubyparser.h +1389 -0
  176. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/shape.h +733 -0
  177. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/siphash.h +48 -0
  178. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/symbol.h +116 -0
  179. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/thread_none.h +25 -0
  180. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/thread_pthread.h +63 -0
  181. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/thread_sched.h +271 -0
  182. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/thread_win32.h +48 -0
  183. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/timev.h +58 -0
  184. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/transcode_data.h +138 -0
  185. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/variable.h +26 -0
  186. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/version.h +69 -0
  187. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/vm.inc +6457 -0
  188. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/vm_call_iseq_optimized.inc +244 -0
  189. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/vm_callinfo.h +688 -0
  190. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/vm_core.h +2509 -0
  191. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/vm_debug.h +124 -0
  192. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/vm_exec.h +202 -0
  193. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/vm_insnhelper.h +280 -0
  194. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/vm_opts.h +65 -0
  195. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/vm_sync.h +160 -0
  196. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/vmtc.inc +302 -0
  197. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/yjit.h +87 -0
  198. data/lib/debase/ruby_core_source/ruby-4.1.0-preview1/zjit.h +221 -0
  199. data/lib/debase/ruby_core_source/version.rb +1 -1
  200. metadata +2930 -2724
@@ -0,0 +1,221 @@
1
+ #ifndef ZJIT_H
2
+ #define ZJIT_H 1
3
+ //
4
+ // This file contains definitions ZJIT exposes to the CRuby codebase
5
+ //
6
+
7
+ #include "shape.h" // for shape_id_t
8
+
9
+ // ZJIT_STATS controls whether to support runtime counters in the interpreter
10
+ #ifndef ZJIT_STATS
11
+ # define ZJIT_STATS (USE_ZJIT && RUBY_DEBUG)
12
+ #endif
13
+
14
+ // JITFrame is defined here as the single source of truth and imported into
15
+ // Rust via bindgen. C code reads fields directly; Rust uses an impl block.
16
+ typedef struct zjit_jit_frame {
17
+ // Program counter for this frame, used for backtraces and GC.
18
+ // NULL for C frames (they don't have a Ruby PC).
19
+ const VALUE *pc;
20
+ // The ISEQ this frame belongs to. Marked via rb_execution_context_mark.
21
+ // NULL for C frames.
22
+ const rb_iseq_t *iseq;
23
+ // Whether to materialize block_code when this frame is materialized.
24
+ // True when the ISEQ doesn't contain send/invokesuper/invokeblock
25
+ // (which write block_code themselves), so we must restore it.
26
+ // Always false for C frames.
27
+ bool materialize_block_code;
28
+
29
+ // Number of stack map entries in stack[].
30
+ uint32_t stack_size;
31
+ // Flexible array of stack map entries, executed in order by
32
+ // zjit_materialize_frames(). See the ZJIT_STACK_MAP_* opcodes above.
33
+ VALUE stack[];
34
+ } zjit_jit_frame_t;
35
+
36
+ #if USE_ZJIT
37
+ // Stack map entries are opcodes for zjit_materialize_frames(), which walks them
38
+ // in order while moving a cursor down the VM stack. An untagged entry is an
39
+ // immediate Ruby VALUE to store; the tagged forms below copy from the native
40
+ // stack, skip slots, or move the cursor. Stack maps never contain heap VALUEs,
41
+ // so these tags are available: they are not Qfalse (0), and their low 3 bits
42
+ // are zero, so RB_SPECIAL_CONST_P is false. Tags must stay non-zero multiples
43
+ // of 8 for that to hold.
44
+ #define ZJIT_STACK_MAP_VREG_TAG 0x08
45
+ #define ZJIT_STACK_MAP_SKIP_TAG 0x10
46
+ #define ZJIT_STACK_MAP_BASE_PTR_TAG 0x18
47
+ #define ZJIT_STACK_MAP_TAG_MASK 0xff
48
+ #define ZJIT_STACK_MAP_SHIFT 8
49
+
50
+ // The BASE_PTR payload packs two fields above the tag byte: the slot index in
51
+ // bits 8..=31 and the operand stack size in bits 32..=63.
52
+ #define ZJIT_STACK_MAP_BASE_PTR_SIZE_SHIFT 32
53
+ #define ZJIT_STACK_MAP_BASE_PTR_INDEX_MASK 0xffffff
54
+
55
+ static inline bool
56
+ ZJIT_STACK_MAP_VREG_P(VALUE entry)
57
+ {
58
+ return (entry & ZJIT_STACK_MAP_TAG_MASK) == ZJIT_STACK_MAP_VREG_TAG;
59
+ }
60
+
61
+ static inline size_t
62
+ ZJIT_STACK_MAP_VREG_INDEX(VALUE entry)
63
+ {
64
+ return entry >> ZJIT_STACK_MAP_SHIFT;
65
+ }
66
+
67
+ static inline bool
68
+ ZJIT_STACK_MAP_SKIP_P(VALUE entry)
69
+ {
70
+ return (entry & ZJIT_STACK_MAP_TAG_MASK) == ZJIT_STACK_MAP_SKIP_TAG;
71
+ }
72
+
73
+ static inline size_t
74
+ ZJIT_STACK_MAP_SKIP_SIZE(VALUE entry)
75
+ {
76
+ return entry >> ZJIT_STACK_MAP_SHIFT;
77
+ }
78
+
79
+ // Anchor the write cursor using the SP register the JIT saved on its native
80
+ // stack, instead of cfp->sp. cfp->sp is not a reliable starting point for a
81
+ // frame that is in the middle of a non-leaf C call, as e.g. raising
82
+ // ArgumentError can push through and move cfp->sp, then use the stack map.
83
+ // gen_prepare_non_leaf_call() emits this opcode, always as stack[0], so the
84
+ // entries after decode to the right place.
85
+ static inline bool
86
+ ZJIT_STACK_MAP_BASE_PTR_P(VALUE entry)
87
+ {
88
+ return (entry & ZJIT_STACK_MAP_TAG_MASK) == ZJIT_STACK_MAP_BASE_PTR_TAG;
89
+ }
90
+
91
+ // VALUE index from cfp->jit_return down to the native stack slot holding the
92
+ // saved SP register, i.e. base_ptr is `((VALUE **)cfp->jit_return)[-index]`.
93
+ // There is one such slot per compiled function, so the index depends on the
94
+ // frame's inlining depth.
95
+ static inline size_t
96
+ ZJIT_STACK_MAP_BASE_PTR_SLOT_INDEX(VALUE entry)
97
+ {
98
+ return (entry >> ZJIT_STACK_MAP_SHIFT) & ZJIT_STACK_MAP_BASE_PTR_INDEX_MASK;
99
+ }
100
+
101
+ // Number of VM stack slots above base_ptr, i.e. the frame's operand stack
102
+ // depth. The cursor is set to `base_ptr + this`.
103
+ static inline size_t
104
+ ZJIT_STACK_MAP_BASE_PTR_STACK_SIZE(VALUE entry)
105
+ {
106
+ return entry >> ZJIT_STACK_MAP_BASE_PTR_SIZE_SHIFT;
107
+ }
108
+
109
+ extern void *rb_zjit_entry;
110
+ extern bool rb_zjit_compiling_p;
111
+ extern const zjit_jit_frame_t rb_zjit_c_frame;
112
+ extern unsigned int rb_zjit_call_threshold;
113
+ extern unsigned int rb_zjit_profile_threshold;
114
+ void rb_zjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception);
115
+ void rb_zjit_profile_insn(uint32_t insn, rb_execution_context_t *ec);
116
+ void rb_zjit_profile_enable(const rb_iseq_t *iseq);
117
+ void rb_zjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop);
118
+ void rb_zjit_cme_invalidate(const rb_callable_method_entry_t *cme);
119
+ void rb_zjit_cme_free(const rb_callable_method_entry_t *cme);
120
+ void rb_zjit_klass_free(VALUE klass);
121
+ void rb_zjit_invalidate_no_ep_escape(const rb_iseq_t *iseq);
122
+ void rb_zjit_constant_state_changed(ID id);
123
+ void rb_zjit_iseq_mark(void *payload);
124
+ void rb_zjit_iseq_update_references(void *payload);
125
+ void rb_zjit_mark_all_writable(void);
126
+ void rb_zjit_mark_all_executable(void);
127
+ void rb_zjit_iseq_free(const rb_iseq_t *iseq);
128
+ void rb_zjit_invalidate_single_ractor(void);
129
+ void rb_zjit_tracing_invalidate_all(void);
130
+ void rb_zjit_invalidate_newobj_hook(void);
131
+ void rb_zjit_invalidate_no_singleton_class(VALUE klass);
132
+ void rb_zjit_invalidate_root_box(void);
133
+ void rb_zjit_jit_frame_update_references(zjit_jit_frame_t *jit_frame);
134
+ void rb_zjit_materialize_frames(const rb_execution_context_t *ec, rb_control_frame_t *cfp);
135
+ void rb_zjit_materialize_frames_for_longjmp(const rb_execution_context_t *ec, rb_control_frame_t *cfp);
136
+ size_t rb_zjit_hash_new_size(VALUE *flags_out, size_t size);
137
+ VALUE rb_zjit_new_obj_shape(VALUE flags, size_t alloc_size);
138
+ bool rb_zjit_class_allocate_instance_fastpath(VALUE klass, size_t *size_out, VALUE *flags_out);
139
+ bool rb_zjit_str_resurrect_fastpath(VALUE str, bool chilled, size_t *size_out, VALUE *flags_out, rb_len_t *len_out, size_t *byte_size_out);
140
+ bool rb_zjit_array_dup_can_fastpath(VALUE ary, size_t *alloc_size_out, VALUE *flags_out, rb_len_t *len_out);
141
+ bool rb_zjit_array_new_can_fastpath(rb_len_t len, size_t *alloc_size_out, VALUE *flags_out);
142
+ bool rb_zjit_hash_dup_can_fastpath(VALUE hash, size_t *alloc_size_out, VALUE *flags_out, VALUE *ifnone_out, rb_len_t *bound_out);
143
+ void rb_zjit_range_new_fastpath(bool exclude_end, size_t *alloc_size_out, VALUE *flags_out);
144
+ void rb_zjit_array_new_fastpath(size_t *alloc_size_out, VALUE *flags_out);
145
+ bool rb_zjit_newobj_hook_enabled_p(void);
146
+
147
+ // Special value for cfp->jit_return that means "this is a C method frame, use
148
+ // rb_zjit_c_frame as the JITFrame". We don't control the native stack layout
149
+ // for C frames, so there's no per-call JITFrame storage; we set this sentinel
150
+ // instead of a heap-allocated JITFrame pointer.
151
+ #define ZJIT_JIT_RETURN_C_FRAME 0x1
152
+
153
+ static inline const zjit_jit_frame_t *
154
+ CFP_ZJIT_FRAME(const rb_control_frame_t *cfp)
155
+ {
156
+ if ((VALUE)cfp->jit_return == ZJIT_JIT_RETURN_C_FRAME) {
157
+ return &rb_zjit_c_frame;
158
+ }
159
+ else {
160
+ // Read JITFrame from this frame's stack slot. cfp->jit_return points at
161
+ // the slot reserved for this frame's inlining depth, so distinct frames in
162
+ // the same JIT function read distinct slots. An initial frame describing
163
+ // the entry PC + iseq is written by gen_entry_point() for the top-level
164
+ // frame and by gen_push_inline_frame() for inlined frames. That entry
165
+ // PC is correct only at the frame's start; because the PC this frame reports
166
+ // must track where execution currently is, later gen_save_pc_for_gc() calls
167
+ // rewrite the slot with the live PC as execution advances through the frame,
168
+ // before any non-leaf C call.
169
+ return (const zjit_jit_frame_t *)((VALUE *)cfp->jit_return)[-1];
170
+ }
171
+ }
172
+ #else
173
+ #define rb_zjit_entry 0
174
+ #define rb_zjit_compiling_p false
175
+ static inline void rb_zjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception) {}
176
+ static inline void rb_zjit_profile_insn(uint32_t insn, rb_execution_context_t *ec) {}
177
+ static inline void rb_zjit_profile_enable(const rb_iseq_t *iseq) {}
178
+ static inline void rb_zjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {}
179
+ static inline void rb_zjit_cme_invalidate(const rb_callable_method_entry_t *cme) {}
180
+ static inline void rb_zjit_invalidate_no_ep_escape(const rb_iseq_t *iseq) {}
181
+ static inline void rb_zjit_constant_state_changed(ID id) {}
182
+ static inline void rb_zjit_invalidate_single_ractor(void) {}
183
+ static inline void rb_zjit_tracing_invalidate_all(void) {}
184
+ static inline void rb_zjit_invalidate_newobj_hook(void) {}
185
+ static inline void rb_zjit_invalidate_no_singleton_class(VALUE klass) {}
186
+ static inline void rb_zjit_invalidate_root_box(void) {}
187
+ static inline void rb_zjit_jit_frame_update_references(zjit_jit_frame_t *jit_frame) {}
188
+ static inline void rb_zjit_materialize_frames(const rb_execution_context_t *ec, rb_control_frame_t *cfp) {}
189
+ static inline void rb_zjit_materialize_frames_for_longjmp(const rb_execution_context_t *ec, rb_control_frame_t *cfp) {}
190
+ static inline const zjit_jit_frame_t *CFP_ZJIT_FRAME(const rb_control_frame_t *cfp) { return NULL; }
191
+ #endif // #if USE_ZJIT
192
+
193
+ #define rb_zjit_enabled_p (rb_zjit_entry != 0)
194
+
195
+ // Return true if a given CFP has ZJIT's JITFrame.
196
+ static inline bool
197
+ CFP_ZJIT_FRAME_P(const rb_control_frame_t *cfp)
198
+ {
199
+ if (!rb_zjit_enabled_p) return false;
200
+ return cfp->jit_return != NULL;
201
+ }
202
+
203
+ static inline const VALUE*
204
+ CFP_PC(const rb_control_frame_t *cfp)
205
+ {
206
+ if (CFP_ZJIT_FRAME_P(cfp)) {
207
+ return CFP_ZJIT_FRAME(cfp)->pc;
208
+ }
209
+ return cfp->pc;
210
+ }
211
+
212
+ static inline const rb_iseq_t*
213
+ CFP_ISEQ(const rb_control_frame_t *cfp)
214
+ {
215
+ if (CFP_ZJIT_FRAME_P(cfp)) {
216
+ return CFP_ZJIT_FRAME(cfp)->iseq;
217
+ }
218
+ return cfp->_iseq;
219
+ }
220
+
221
+ #endif // #ifndef ZJIT_H
@@ -1,5 +1,5 @@
1
1
  module Debase
2
2
  module RubyCoreSource
3
- VERSION = '4.0.1'
3
+ VERSION = '4.1.0.preview1'
4
4
  end
5
5
  end