debase-ruby_core_source 3.3.1 → 3.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (289) hide show
  1. checksums.yaml +4 -4
  2. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/addr2line.h +22 -0
  3. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/builtin.h +117 -0
  4. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/build_assert/build_assert.h +40 -0
  5. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/check_type/check_type.h +63 -0
  6. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/container_of/container_of.h +142 -0
  7. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/list/list.h +791 -0
  8. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ccan/str/str.h +17 -0
  9. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/constant.h +53 -0
  10. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/darray.h +246 -0
  11. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/debug_counter.h +423 -0
  12. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/dln.h +32 -0
  13. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/encindex.h +70 -0
  14. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/eval_intern.h +343 -0
  15. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/hrtime.h +227 -0
  16. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/id.h +343 -0
  17. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/id_table.h +39 -0
  18. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/insns.inc +251 -0
  19. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/insns_info.inc +9215 -0
  20. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/array.h +151 -0
  21. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/basic_operators.h +63 -0
  22. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/bignum.h +244 -0
  23. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/bits.h +568 -0
  24. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/class.h +277 -0
  25. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/cmdlineopt.h +65 -0
  26. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/compar.h +29 -0
  27. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/compile.h +34 -0
  28. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/compilers.h +107 -0
  29. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/complex.h +29 -0
  30. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/cont.h +35 -0
  31. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/dir.h +16 -0
  32. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/enc.h +19 -0
  33. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/encoding.h +35 -0
  34. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/enum.h +18 -0
  35. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/enumerator.h +21 -0
  36. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/error.h +216 -0
  37. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/eval.h +33 -0
  38. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/file.h +38 -0
  39. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/fixnum.h +184 -0
  40. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/gc.h +364 -0
  41. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/hash.h +191 -0
  42. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/imemo.h +240 -0
  43. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/inits.h +50 -0
  44. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/io.h +137 -0
  45. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/load.h +18 -0
  46. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/loadpath.h +16 -0
  47. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/math.h +23 -0
  48. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/missing.h +18 -0
  49. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/numeric.h +273 -0
  50. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/object.h +62 -0
  51. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/parse.h +108 -0
  52. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/proc.h +30 -0
  53. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/process.h +124 -0
  54. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/ractor.h +6 -0
  55. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/random.h +17 -0
  56. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/range.h +40 -0
  57. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/rational.h +71 -0
  58. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/re.h +28 -0
  59. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/ruby_parser.h +69 -0
  60. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/sanitizers.h +186 -0
  61. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/serial.h +23 -0
  62. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/signal.h +25 -0
  63. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/static_assert.h +16 -0
  64. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/string.h +160 -0
  65. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/struct.h +127 -0
  66. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/symbol.h +45 -0
  67. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/thread.h +78 -0
  68. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/time.h +34 -0
  69. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/transcode.h +23 -0
  70. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/util.h +27 -0
  71. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/variable.h +72 -0
  72. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/vm.h +136 -0
  73. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal/warnings.h +16 -0
  74. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/internal.h +112 -0
  75. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/iseq.h +338 -0
  76. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/known_errors.inc +791 -0
  77. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/method.h +254 -0
  78. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/node.h +128 -0
  79. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/node_name.inc +212 -0
  80. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/optinsn.inc +128 -0
  81. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/optunifs.inc +43 -0
  82. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parse.h +243 -0
  83. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parser_bits.h +564 -0
  84. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parser_node.h +32 -0
  85. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parser_st.h +162 -0
  86. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/parser_value.h +106 -0
  87. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/ast.h +4612 -0
  88. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/defines.h +94 -0
  89. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/diagnostic.h +297 -0
  90. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/encoding.h +248 -0
  91. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/extension.h +18 -0
  92. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/node.h +57 -0
  93. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/options.h +204 -0
  94. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/pack.h +152 -0
  95. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/parser.h +716 -0
  96. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/prettyprint.h +26 -0
  97. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/prism.h +272 -0
  98. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/regexp.h +33 -0
  99. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_buffer.h +146 -0
  100. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_char.h +205 -0
  101. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_constant_pool.h +191 -0
  102. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_list.h +97 -0
  103. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_memchr.h +29 -0
  104. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_newline_list.h +104 -0
  105. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_state_stack.h +42 -0
  106. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_string.h +150 -0
  107. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_string_list.h +44 -0
  108. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_strncasecmp.h +32 -0
  109. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_strpbrk.h +43 -0
  110. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism/version.h +29 -0
  111. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/prism_compile.h +29 -0
  112. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/probes_helper.h +42 -0
  113. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ractor_core.h +393 -0
  114. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/regenc.h +254 -0
  115. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/regint.h +1006 -0
  116. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/regparse.h +371 -0
  117. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/revision.h +5 -0
  118. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/rjit.h +101 -0
  119. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/rjit_c.h +164 -0
  120. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ruby_assert.h +14 -0
  121. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/ruby_atomic.h +23 -0
  122. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/rubyparser.h +1405 -0
  123. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/shape.h +233 -0
  124. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/siphash.h +48 -0
  125. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/symbol.h +118 -0
  126. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/thread_none.h +21 -0
  127. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/thread_pthread.h +166 -0
  128. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/thread_win32.h +58 -0
  129. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/timev.h +58 -0
  130. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/transcode_data.h +138 -0
  131. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/variable.h +39 -0
  132. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/version.h +69 -0
  133. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm.inc +5436 -0
  134. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_call_iseq_optimized.inc +244 -0
  135. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_callinfo.h +614 -0
  136. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_core.h +2202 -0
  137. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_debug.h +122 -0
  138. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_exec.h +199 -0
  139. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_insnhelper.h +261 -0
  140. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_opts.h +67 -0
  141. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vm_sync.h +137 -0
  142. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/vmtc.inc +245 -0
  143. data/lib/debase/ruby_core_source/ruby-3.3.5-p100/yjit.h +72 -0
  144. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/addr2line.h +22 -0
  145. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/builtin.h +119 -0
  146. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/build_assert/build_assert.h +40 -0
  147. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/check_type/check_type.h +63 -0
  148. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/container_of/container_of.h +142 -0
  149. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/list/list.h +791 -0
  150. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ccan/str/str.h +17 -0
  151. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/constant.h +53 -0
  152. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/darray.h +191 -0
  153. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/debug_counter.h +423 -0
  154. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/dln.h +34 -0
  155. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/encindex.h +70 -0
  156. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/eval_intern.h +324 -0
  157. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/hrtime.h +237 -0
  158. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id.h +343 -0
  159. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/id_table.h +39 -0
  160. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns.inc +259 -0
  161. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/insns_info.inc +9530 -0
  162. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/array.h +151 -0
  163. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/basic_operators.h +63 -0
  164. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bignum.h +244 -0
  165. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/bits.h +568 -0
  166. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/class.h +283 -0
  167. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cmdlineopt.h +65 -0
  168. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compar.h +29 -0
  169. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compile.h +34 -0
  170. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/compilers.h +107 -0
  171. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/complex.h +29 -0
  172. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/cont.h +35 -0
  173. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/dir.h +16 -0
  174. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enc.h +19 -0
  175. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/encoding.h +36 -0
  176. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enum.h +18 -0
  177. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/enumerator.h +21 -0
  178. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/error.h +216 -0
  179. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/eval.h +33 -0
  180. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/file.h +38 -0
  181. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/fixnum.h +184 -0
  182. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/gc.h +334 -0
  183. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/hash.h +191 -0
  184. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/imemo.h +260 -0
  185. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/inits.h +47 -0
  186. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/io.h +140 -0
  187. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/load.h +18 -0
  188. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/loadpath.h +16 -0
  189. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/math.h +23 -0
  190. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/missing.h +19 -0
  191. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/numeric.h +274 -0
  192. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/object.h +63 -0
  193. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/parse.h +117 -0
  194. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/proc.h +30 -0
  195. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/process.h +124 -0
  196. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/ractor.h +6 -0
  197. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/random.h +17 -0
  198. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/range.h +40 -0
  199. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/rational.h +71 -0
  200. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/re.h +28 -0
  201. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/ruby_parser.h +102 -0
  202. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/sanitizers.h +297 -0
  203. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/serial.h +23 -0
  204. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/signal.h +24 -0
  205. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/st.h +11 -0
  206. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/static_assert.h +16 -0
  207. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/string.h +182 -0
  208. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/struct.h +127 -0
  209. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/symbol.h +45 -0
  210. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/thread.h +79 -0
  211. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/time.h +34 -0
  212. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/transcode.h +23 -0
  213. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/util.h +27 -0
  214. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/variable.h +72 -0
  215. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/vm.h +137 -0
  216. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/warnings.h +16 -0
  217. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal.h +108 -0
  218. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/iseq.h +340 -0
  219. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/known_errors.inc +1419 -0
  220. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/method.h +255 -0
  221. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/node.h +111 -0
  222. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/node_name.inc +224 -0
  223. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optinsn.inc +128 -0
  224. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/optunifs.inc +43 -0
  225. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parse.h +243 -0
  226. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_bits.h +564 -0
  227. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_node.h +32 -0
  228. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_st.h +162 -0
  229. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/parser_value.h +106 -0
  230. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/ast.h +6245 -0
  231. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/defines.h +206 -0
  232. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/diagnostic.h +433 -0
  233. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/encoding.h +283 -0
  234. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/extension.h +19 -0
  235. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/node.h +150 -0
  236. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/options.h +305 -0
  237. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/pack.h +163 -0
  238. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/parser.h +891 -0
  239. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prettyprint.h +34 -0
  240. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/prism.h +347 -0
  241. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/regexp.h +33 -0
  242. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/static_literals.h +120 -0
  243. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_buffer.h +218 -0
  244. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_char.h +205 -0
  245. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_constant_pool.h +226 -0
  246. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_integer.h +119 -0
  247. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_list.h +97 -0
  248. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_memchr.h +29 -0
  249. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_newline_list.h +102 -0
  250. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string.h +174 -0
  251. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string_list.h +44 -0
  252. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strncasecmp.h +32 -0
  253. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strpbrk.h +46 -0
  254. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/version.h +29 -0
  255. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism_compile.h +88 -0
  256. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/probes_helper.h +42 -0
  257. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ractor_core.h +393 -0
  258. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regenc.h +254 -0
  259. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regint.h +1010 -0
  260. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/regparse.h +371 -0
  261. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/revision.h +5 -0
  262. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit.h +101 -0
  263. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rjit_c.h +165 -0
  264. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_assert.h +14 -0
  265. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/ruby_atomic.h +23 -0
  266. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/rubyparser.h +1430 -0
  267. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/shape.h +233 -0
  268. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/siphash.h +48 -0
  269. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/symbol.h +118 -0
  270. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_none.h +21 -0
  271. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_pthread.h +166 -0
  272. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/thread_win32.h +58 -0
  273. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/timev.h +58 -0
  274. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/transcode_data.h +138 -0
  275. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/variable.h +39 -0
  276. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/version.h +69 -0
  277. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm.inc +5643 -0
  278. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_call_iseq_optimized.inc +244 -0
  279. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_callinfo.h +605 -0
  280. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_core.h +2236 -0
  281. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_debug.h +124 -0
  282. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_exec.h +199 -0
  283. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_insnhelper.h +272 -0
  284. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_opts.h +67 -0
  285. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vm_sync.h +137 -0
  286. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/vmtc.inc +253 -0
  287. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/yjit.h +79 -0
  288. data/lib/debase/ruby_core_source/version.rb +1 -1
  289. metadata +289 -3
@@ -0,0 +1,218 @@
1
+ /**
2
+ * @file pm_buffer.h
3
+ *
4
+ * A wrapper around a contiguous block of allocated memory.
5
+ */
6
+ #ifndef PRISM_BUFFER_H
7
+ #define PRISM_BUFFER_H
8
+
9
+ #include "prism/defines.h"
10
+ #include "prism/util/pm_char.h"
11
+
12
+ #include <assert.h>
13
+ #include <stdbool.h>
14
+ #include <stdint.h>
15
+ #include <stdlib.h>
16
+ #include <string.h>
17
+
18
+ /**
19
+ * A pm_buffer_t is a simple memory buffer that stores data in a contiguous
20
+ * block of memory.
21
+ */
22
+ typedef struct {
23
+ /** The length of the buffer in bytes. */
24
+ size_t length;
25
+
26
+ /** The capacity of the buffer in bytes that has been allocated. */
27
+ size_t capacity;
28
+
29
+ /** A pointer to the start of the buffer. */
30
+ char *value;
31
+ } pm_buffer_t;
32
+
33
+ /**
34
+ * Return the size of the pm_buffer_t struct.
35
+ *
36
+ * @returns The size of the pm_buffer_t struct.
37
+ */
38
+ PRISM_EXPORTED_FUNCTION size_t pm_buffer_sizeof(void);
39
+
40
+ /**
41
+ * Initialize a pm_buffer_t with the given capacity.
42
+ *
43
+ * @param buffer The buffer to initialize.
44
+ * @param capacity The capacity of the buffer.
45
+ * @returns True if the buffer was initialized successfully, false otherwise.
46
+ */
47
+ bool pm_buffer_init_capacity(pm_buffer_t *buffer, size_t capacity);
48
+
49
+ /**
50
+ * Initialize a pm_buffer_t with its default values.
51
+ *
52
+ * @param buffer The buffer to initialize.
53
+ * @returns True if the buffer was initialized successfully, false otherwise.
54
+ */
55
+ PRISM_EXPORTED_FUNCTION bool pm_buffer_init(pm_buffer_t *buffer);
56
+
57
+ /**
58
+ * Return the value of the buffer.
59
+ *
60
+ * @param buffer The buffer to get the value of.
61
+ * @returns The value of the buffer.
62
+ */
63
+ PRISM_EXPORTED_FUNCTION char * pm_buffer_value(const pm_buffer_t *buffer);
64
+
65
+ /**
66
+ * Return the length of the buffer.
67
+ *
68
+ * @param buffer The buffer to get the length of.
69
+ * @returns The length of the buffer.
70
+ */
71
+ PRISM_EXPORTED_FUNCTION size_t pm_buffer_length(const pm_buffer_t *buffer);
72
+
73
+ /**
74
+ * Append the given amount of space as zeroes to the buffer.
75
+ *
76
+ * @param buffer The buffer to append to.
77
+ * @param length The amount of space to append and zero.
78
+ */
79
+ void pm_buffer_append_zeroes(pm_buffer_t *buffer, size_t length);
80
+
81
+ /**
82
+ * Append a formatted string to the buffer.
83
+ *
84
+ * @param buffer The buffer to append to.
85
+ * @param format The format string to append.
86
+ * @param ... The arguments to the format string.
87
+ */
88
+ void pm_buffer_append_format(pm_buffer_t *buffer, const char *format, ...) PRISM_ATTRIBUTE_FORMAT(2, 3);
89
+
90
+ /**
91
+ * Append a string to the buffer.
92
+ *
93
+ * @param buffer The buffer to append to.
94
+ * @param value The string to append.
95
+ * @param length The length of the string to append.
96
+ */
97
+ void pm_buffer_append_string(pm_buffer_t *buffer, const char *value, size_t length);
98
+
99
+ /**
100
+ * Append a list of bytes to the buffer.
101
+ *
102
+ * @param buffer The buffer to append to.
103
+ * @param value The bytes to append.
104
+ * @param length The length of the bytes to append.
105
+ */
106
+ void pm_buffer_append_bytes(pm_buffer_t *buffer, const uint8_t *value, size_t length);
107
+
108
+ /**
109
+ * Append a single byte to the buffer.
110
+ *
111
+ * @param buffer The buffer to append to.
112
+ * @param value The byte to append.
113
+ */
114
+ void pm_buffer_append_byte(pm_buffer_t *buffer, uint8_t value);
115
+
116
+ /**
117
+ * Append a 32-bit unsigned integer to the buffer as a variable-length integer.
118
+ *
119
+ * @param buffer The buffer to append to.
120
+ * @param value The integer to append.
121
+ */
122
+ void pm_buffer_append_varuint(pm_buffer_t *buffer, uint32_t value);
123
+
124
+ /**
125
+ * Append a 32-bit signed integer to the buffer as a variable-length integer.
126
+ *
127
+ * @param buffer The buffer to append to.
128
+ * @param value The integer to append.
129
+ */
130
+ void pm_buffer_append_varsint(pm_buffer_t *buffer, int32_t value);
131
+
132
+ /**
133
+ * Append a double to the buffer.
134
+ *
135
+ * @param buffer The buffer to append to.
136
+ * @param value The double to append.
137
+ */
138
+ void pm_buffer_append_double(pm_buffer_t *buffer, double value);
139
+
140
+ /**
141
+ * The different types of escaping that can be performed by the buffer when
142
+ * appending a slice of Ruby source code.
143
+ */
144
+ typedef enum {
145
+ PM_BUFFER_ESCAPING_RUBY,
146
+ PM_BUFFER_ESCAPING_JSON
147
+ } pm_buffer_escaping_t;
148
+
149
+ /**
150
+ * Append a slice of source code to the buffer.
151
+ *
152
+ * @param buffer The buffer to append to.
153
+ * @param source The source code to append.
154
+ * @param length The length of the source code to append.
155
+ * @param escaping The type of escaping to perform.
156
+ */
157
+ void pm_buffer_append_source(pm_buffer_t *buffer, const uint8_t *source, size_t length, pm_buffer_escaping_t escaping);
158
+
159
+ /**
160
+ * Prepend the given string to the buffer.
161
+ *
162
+ * @param buffer The buffer to prepend to.
163
+ * @param value The string to prepend.
164
+ * @param length The length of the string to prepend.
165
+ */
166
+ void pm_buffer_prepend_string(pm_buffer_t *buffer, const char *value, size_t length);
167
+
168
+ /**
169
+ * Concatenate one buffer onto another.
170
+ *
171
+ * @param destination The buffer to concatenate onto.
172
+ * @param source The buffer to concatenate.
173
+ */
174
+ void pm_buffer_concat(pm_buffer_t *destination, const pm_buffer_t *source);
175
+
176
+ /**
177
+ * Clear the buffer by reducing its size to 0. This does not free the allocated
178
+ * memory, but it does allow the buffer to be reused.
179
+ *
180
+ * @param buffer The buffer to clear.
181
+ */
182
+ void pm_buffer_clear(pm_buffer_t *buffer);
183
+
184
+ /**
185
+ * Strip the whitespace from the end of the buffer.
186
+ *
187
+ * @param buffer The buffer to strip.
188
+ */
189
+ void pm_buffer_rstrip(pm_buffer_t *buffer);
190
+
191
+ /**
192
+ * Checks if the buffer includes the given value.
193
+ *
194
+ * @param buffer The buffer to check.
195
+ * @param value The value to check for.
196
+ * @returns The index of the first occurrence of the value in the buffer, or
197
+ * SIZE_MAX if the value is not found.
198
+ */
199
+ size_t pm_buffer_index(const pm_buffer_t *buffer, char value);
200
+
201
+ /**
202
+ * Insert the given string into the buffer at the given index.
203
+ *
204
+ * @param buffer The buffer to insert into.
205
+ * @param index The index to insert at.
206
+ * @param value The string to insert.
207
+ * @param length The length of the string to insert.
208
+ */
209
+ void pm_buffer_insert(pm_buffer_t *buffer, size_t index, const char *value, size_t length);
210
+
211
+ /**
212
+ * Free the memory associated with the buffer.
213
+ *
214
+ * @param buffer The buffer to free.
215
+ */
216
+ PRISM_EXPORTED_FUNCTION void pm_buffer_free(pm_buffer_t *buffer);
217
+
218
+ #endif
@@ -0,0 +1,205 @@
1
+ /**
2
+ * @file pm_char.h
3
+ *
4
+ * Functions for working with characters and strings.
5
+ */
6
+ #ifndef PRISM_CHAR_H
7
+ #define PRISM_CHAR_H
8
+
9
+ #include "prism/defines.h"
10
+ #include "prism/util/pm_newline_list.h"
11
+
12
+ #include <stdbool.h>
13
+ #include <stddef.h>
14
+
15
+ /**
16
+ * Returns the number of characters at the start of the string that are
17
+ * whitespace. Disallows searching past the given maximum number of characters.
18
+ *
19
+ * @param string The string to search.
20
+ * @param length The maximum number of characters to search.
21
+ * @return The number of characters at the start of the string that are
22
+ * whitespace.
23
+ */
24
+ size_t pm_strspn_whitespace(const uint8_t *string, ptrdiff_t length);
25
+
26
+ /**
27
+ * Returns the number of characters at the start of the string that are
28
+ * whitespace while also tracking the location of each newline. Disallows
29
+ * searching past the given maximum number of characters.
30
+ *
31
+ * @param string The string to search.
32
+ * @param length The maximum number of characters to search.
33
+ * @param newline_list The list of newlines to populate.
34
+ * @return The number of characters at the start of the string that are
35
+ * whitespace.
36
+ */
37
+ size_t
38
+ pm_strspn_whitespace_newlines(const uint8_t *string, ptrdiff_t length, pm_newline_list_t *newline_list);
39
+
40
+ /**
41
+ * Returns the number of characters at the start of the string that are inline
42
+ * whitespace. Disallows searching past the given maximum number of characters.
43
+ *
44
+ * @param string The string to search.
45
+ * @param length The maximum number of characters to search.
46
+ * @return The number of characters at the start of the string that are inline
47
+ * whitespace.
48
+ */
49
+ size_t pm_strspn_inline_whitespace(const uint8_t *string, ptrdiff_t length);
50
+
51
+ /**
52
+ * Returns the number of characters at the start of the string that are decimal
53
+ * digits. Disallows searching past the given maximum number of characters.
54
+ *
55
+ * @param string The string to search.
56
+ * @param length The maximum number of characters to search.
57
+ * @return The number of characters at the start of the string that are decimal
58
+ * digits.
59
+ */
60
+ size_t pm_strspn_decimal_digit(const uint8_t *string, ptrdiff_t length);
61
+
62
+ /**
63
+ * Returns the number of characters at the start of the string that are
64
+ * hexadecimal digits. Disallows searching past the given maximum number of
65
+ * characters.
66
+ *
67
+ * @param string The string to search.
68
+ * @param length The maximum number of characters to search.
69
+ * @return The number of characters at the start of the string that are
70
+ * hexadecimal digits.
71
+ */
72
+ size_t pm_strspn_hexadecimal_digit(const uint8_t *string, ptrdiff_t length);
73
+
74
+ /**
75
+ * Returns the number of characters at the start of the string that are octal
76
+ * digits or underscores. Disallows searching past the given maximum number of
77
+ * characters.
78
+ *
79
+ * If multiple underscores are found in a row or if an underscore is
80
+ * found at the end of the number, then the invalid pointer is set to the index
81
+ * of the first invalid underscore.
82
+ *
83
+ * @param string The string to search.
84
+ * @param length The maximum number of characters to search.
85
+ * @param invalid The pointer to set to the index of the first invalid
86
+ * underscore.
87
+ * @return The number of characters at the start of the string that are octal
88
+ * digits or underscores.
89
+ */
90
+ size_t pm_strspn_octal_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid);
91
+
92
+ /**
93
+ * Returns the number of characters at the start of the string that are decimal
94
+ * digits or underscores. Disallows searching past the given maximum number of
95
+ * characters.
96
+ *
97
+ * If multiple underscores are found in a row or if an underscore is
98
+ * found at the end of the number, then the invalid pointer is set to the index
99
+ * of the first invalid underscore.
100
+ *
101
+ * @param string The string to search.
102
+ * @param length The maximum number of characters to search.
103
+ * @param invalid The pointer to set to the index of the first invalid
104
+ * underscore.
105
+ * @return The number of characters at the start of the string that are decimal
106
+ * digits or underscores.
107
+ */
108
+ size_t pm_strspn_decimal_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid);
109
+
110
+ /**
111
+ * Returns the number of characters at the start of the string that are
112
+ * hexadecimal digits or underscores. Disallows searching past the given maximum
113
+ * number of characters.
114
+ *
115
+ * If multiple underscores are found in a row or if an underscore is
116
+ * found at the end of the number, then the invalid pointer is set to the index
117
+ * of the first invalid underscore.
118
+ *
119
+ * @param string The string to search.
120
+ * @param length The maximum number of characters to search.
121
+ * @param invalid The pointer to set to the index of the first invalid
122
+ * underscore.
123
+ * @return The number of characters at the start of the string that are
124
+ * hexadecimal digits or underscores.
125
+ */
126
+ size_t pm_strspn_hexadecimal_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid);
127
+
128
+ /**
129
+ * Returns the number of characters at the start of the string that are regexp
130
+ * options. Disallows searching past the given maximum number of characters.
131
+ *
132
+ * @param string The string to search.
133
+ * @param length The maximum number of characters to search.
134
+ * @return The number of characters at the start of the string that are regexp
135
+ * options.
136
+ */
137
+ size_t pm_strspn_regexp_option(const uint8_t *string, ptrdiff_t length);
138
+
139
+ /**
140
+ * Returns the number of characters at the start of the string that are binary
141
+ * digits or underscores. Disallows searching past the given maximum number of
142
+ * characters.
143
+ *
144
+ * If multiple underscores are found in a row or if an underscore is
145
+ * found at the end of the number, then the invalid pointer is set to the index
146
+ * of the first invalid underscore.
147
+ *
148
+ * @param string The string to search.
149
+ * @param length The maximum number of characters to search.
150
+ * @param invalid The pointer to set to the index of the first invalid
151
+ * underscore.
152
+ * @return The number of characters at the start of the string that are binary
153
+ * digits or underscores.
154
+ */
155
+ size_t pm_strspn_binary_number(const uint8_t *string, ptrdiff_t length, const uint8_t **invalid);
156
+
157
+ /**
158
+ * Returns true if the given character is a whitespace character.
159
+ *
160
+ * @param b The character to check.
161
+ * @return True if the given character is a whitespace character.
162
+ */
163
+ bool pm_char_is_whitespace(const uint8_t b);
164
+
165
+ /**
166
+ * Returns true if the given character is an inline whitespace character.
167
+ *
168
+ * @param b The character to check.
169
+ * @return True if the given character is an inline whitespace character.
170
+ */
171
+ bool pm_char_is_inline_whitespace(const uint8_t b);
172
+
173
+ /**
174
+ * Returns true if the given character is a binary digit.
175
+ *
176
+ * @param b The character to check.
177
+ * @return True if the given character is a binary digit.
178
+ */
179
+ bool pm_char_is_binary_digit(const uint8_t b);
180
+
181
+ /**
182
+ * Returns true if the given character is an octal digit.
183
+ *
184
+ * @param b The character to check.
185
+ * @return True if the given character is an octal digit.
186
+ */
187
+ bool pm_char_is_octal_digit(const uint8_t b);
188
+
189
+ /**
190
+ * Returns true if the given character is a decimal digit.
191
+ *
192
+ * @param b The character to check.
193
+ * @return True if the given character is a decimal digit.
194
+ */
195
+ bool pm_char_is_decimal_digit(const uint8_t b);
196
+
197
+ /**
198
+ * Returns true if the given character is a hexadecimal digit.
199
+ *
200
+ * @param b The character to check.
201
+ * @return True if the given character is a hexadecimal digit.
202
+ */
203
+ bool pm_char_is_hexadecimal_digit(const uint8_t b);
204
+
205
+ #endif
@@ -0,0 +1,226 @@
1
+ /**
2
+ * @file pm_constant_pool.h
3
+ *
4
+ * A data structure that stores a set of strings.
5
+ *
6
+ * Each string is assigned a unique id, which can be used to compare strings for
7
+ * equality. This comparison ends up being much faster than strcmp, since it
8
+ * only requires a single integer comparison.
9
+ */
10
+ #ifndef PRISM_CONSTANT_POOL_H
11
+ #define PRISM_CONSTANT_POOL_H
12
+
13
+ #include "prism/defines.h"
14
+
15
+ #include <assert.h>
16
+ #include <stdbool.h>
17
+ #include <stdint.h>
18
+ #include <stdlib.h>
19
+ #include <string.h>
20
+
21
+ /**
22
+ * When we allocate constants into the pool, we reserve 0 to mean that the slot
23
+ * is not yet filled. This constant is reused in other places to indicate the
24
+ * lack of a constant id.
25
+ */
26
+ #define PM_CONSTANT_ID_UNSET 0
27
+
28
+ /**
29
+ * A constant id is a unique identifier for a constant in the constant pool.
30
+ */
31
+ typedef uint32_t pm_constant_id_t;
32
+
33
+ /**
34
+ * A list of constant IDs. Usually used to represent a set of locals.
35
+ */
36
+ typedef struct {
37
+ /** The number of constant ids in the list. */
38
+ size_t size;
39
+
40
+ /** The number of constant ids that have been allocated in the list. */
41
+ size_t capacity;
42
+
43
+ /** The constant ids in the list. */
44
+ pm_constant_id_t *ids;
45
+ } pm_constant_id_list_t;
46
+
47
+ /**
48
+ * Initialize a list of constant ids.
49
+ *
50
+ * @param list The list to initialize.
51
+ */
52
+ void pm_constant_id_list_init(pm_constant_id_list_t *list);
53
+
54
+ /**
55
+ * Initialize a list of constant ids with a given capacity.
56
+ *
57
+ * @param list The list to initialize.
58
+ * @param capacity The initial capacity of the list.
59
+ */
60
+ void pm_constant_id_list_init_capacity(pm_constant_id_list_t *list, size_t capacity);
61
+
62
+ /**
63
+ * Append a constant id to a list of constant ids. Returns false if any
64
+ * potential reallocations fail.
65
+ *
66
+ * @param list The list to append to.
67
+ * @param id The id to append.
68
+ * @return Whether the append succeeded.
69
+ */
70
+ bool pm_constant_id_list_append(pm_constant_id_list_t *list, pm_constant_id_t id);
71
+
72
+ /**
73
+ * Insert a constant id into a list of constant ids at the specified index.
74
+ *
75
+ * @param list The list to insert into.
76
+ * @param index The index at which to insert.
77
+ * @param id The id to insert.
78
+ */
79
+ void pm_constant_id_list_insert(pm_constant_id_list_t *list, size_t index, pm_constant_id_t id);
80
+
81
+ /**
82
+ * Checks if the current constant id list includes the given constant id.
83
+ *
84
+ * @param list The list to check.
85
+ * @param id The id to check for.
86
+ * @return Whether the list includes the given id.
87
+ */
88
+ bool pm_constant_id_list_includes(pm_constant_id_list_t *list, pm_constant_id_t id);
89
+
90
+ /**
91
+ * Get the memory size of a list of constant ids.
92
+ *
93
+ * @param list The list to get the memory size of.
94
+ * @return The memory size of the list.
95
+ */
96
+ size_t pm_constant_id_list_memsize(pm_constant_id_list_t *list);
97
+
98
+ /**
99
+ * Free the memory associated with a list of constant ids.
100
+ *
101
+ * @param list The list to free.
102
+ */
103
+ void pm_constant_id_list_free(pm_constant_id_list_t *list);
104
+
105
+ /**
106
+ * The type of bucket in the constant pool hash map. This determines how the
107
+ * bucket should be freed.
108
+ */
109
+ typedef unsigned int pm_constant_pool_bucket_type_t;
110
+
111
+ /** By default, each constant is a slice of the source. */
112
+ static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_DEFAULT = 0;
113
+
114
+ /** An owned constant is one for which memory has been allocated. */
115
+ static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_OWNED = 1;
116
+
117
+ /** A constant constant is known at compile time. */
118
+ static const pm_constant_pool_bucket_type_t PM_CONSTANT_POOL_BUCKET_CONSTANT = 2;
119
+
120
+ /** A bucket in the hash map. */
121
+ typedef struct {
122
+ /** The incremental ID used for indexing back into the pool. */
123
+ unsigned int id: 30;
124
+
125
+ /** The type of the bucket, which determines how to free it. */
126
+ pm_constant_pool_bucket_type_t type: 2;
127
+
128
+ /** The hash of the bucket. */
129
+ uint32_t hash;
130
+ } pm_constant_pool_bucket_t;
131
+
132
+ /** A constant in the pool which effectively stores a string. */
133
+ typedef struct {
134
+ /** A pointer to the start of the string. */
135
+ const uint8_t *start;
136
+
137
+ /** The length of the string. */
138
+ size_t length;
139
+ } pm_constant_t;
140
+
141
+ /** The overall constant pool, which stores constants found while parsing. */
142
+ typedef struct {
143
+ /** The buckets in the hash map. */
144
+ pm_constant_pool_bucket_t *buckets;
145
+
146
+ /** The constants that are stored in the buckets. */
147
+ pm_constant_t *constants;
148
+
149
+ /** The number of buckets in the hash map. */
150
+ uint32_t size;
151
+
152
+ /** The number of buckets that have been allocated in the hash map. */
153
+ uint32_t capacity;
154
+ } pm_constant_pool_t;
155
+
156
+ /**
157
+ * Initialize a new constant pool with a given capacity.
158
+ *
159
+ * @param pool The pool to initialize.
160
+ * @param capacity The initial capacity of the pool.
161
+ * @return Whether the initialization succeeded.
162
+ */
163
+ bool pm_constant_pool_init(pm_constant_pool_t *pool, uint32_t capacity);
164
+
165
+ /**
166
+ * Return a pointer to the constant indicated by the given constant id.
167
+ *
168
+ * @param pool The pool to get the constant from.
169
+ * @param constant_id The id of the constant to get.
170
+ * @return A pointer to the constant.
171
+ */
172
+ pm_constant_t * pm_constant_pool_id_to_constant(const pm_constant_pool_t *pool, pm_constant_id_t constant_id);
173
+
174
+ /**
175
+ * Find a constant in a constant pool. Returns the id of the constant, or 0 if
176
+ * the constant is not found.
177
+ *
178
+ * @param pool The pool to find the constant in.
179
+ * @param start A pointer to the start of the constant.
180
+ * @param length The length of the constant.
181
+ * @return The id of the constant.
182
+ */
183
+ pm_constant_id_t pm_constant_pool_find(const pm_constant_pool_t *pool, const uint8_t *start, size_t length);
184
+
185
+ /**
186
+ * Insert a constant into a constant pool that is a slice of a source string.
187
+ * Returns the id of the constant, or 0 if any potential calls to resize fail.
188
+ *
189
+ * @param pool The pool to insert the constant into.
190
+ * @param start A pointer to the start of the constant.
191
+ * @param length The length of the constant.
192
+ * @return The id of the constant.
193
+ */
194
+ pm_constant_id_t pm_constant_pool_insert_shared(pm_constant_pool_t *pool, const uint8_t *start, size_t length);
195
+
196
+ /**
197
+ * Insert a constant into a constant pool from memory that is now owned by the
198
+ * constant pool. Returns the id of the constant, or 0 if any potential calls to
199
+ * resize fail.
200
+ *
201
+ * @param pool The pool to insert the constant into.
202
+ * @param start A pointer to the start of the constant.
203
+ * @param length The length of the constant.
204
+ * @return The id of the constant.
205
+ */
206
+ pm_constant_id_t pm_constant_pool_insert_owned(pm_constant_pool_t *pool, uint8_t *start, size_t length);
207
+
208
+ /**
209
+ * Insert a constant into a constant pool from memory that is constant. Returns
210
+ * the id of the constant, or 0 if any potential calls to resize fail.
211
+ *
212
+ * @param pool The pool to insert the constant into.
213
+ * @param start A pointer to the start of the constant.
214
+ * @param length The length of the constant.
215
+ * @return The id of the constant.
216
+ */
217
+ pm_constant_id_t pm_constant_pool_insert_constant(pm_constant_pool_t *pool, const uint8_t *start, size_t length);
218
+
219
+ /**
220
+ * Free the memory associated with a constant pool.
221
+ *
222
+ * @param pool The pool to free.
223
+ */
224
+ void pm_constant_pool_free(pm_constant_pool_t *pool);
225
+
226
+ #endif