debase-ruby_core_source 3.3.6 → 4.0.0.preview2

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 (306) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/CHANGELOG.md +10 -0
  4. data/Rakefile +3 -1
  5. data/debase-ruby_core_source.gemspec +1 -0
  6. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/builtin.h +7 -1
  7. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/darray.h +1 -3
  8. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/id.h +5 -0
  9. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/insns.inc +2 -0
  10. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/insns_info.inc +310 -175
  11. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/basic_operators.h +1 -0
  12. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/bits.h +82 -0
  13. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/encoding.h +2 -0
  14. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/error.h +26 -0
  15. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/fixnum.h +1 -0
  16. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/gc.h +14 -6
  17. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/imemo.h +6 -1
  18. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/io.h +1 -1
  19. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/parse.h +2 -1
  20. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/proc.h +1 -0
  21. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/ractor.h +4 -0
  22. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/sanitizers.h +31 -39
  23. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/string.h +22 -10
  24. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/thread.h +23 -0
  25. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/vm.h +1 -1
  26. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/method.h +1 -0
  27. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/optunifs.inc +1 -1
  28. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/parse.h +2 -2
  29. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/ast.h +427 -3
  30. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/defines.h +8 -7
  31. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/diagnostic.h +1 -0
  32. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/extension.h +1 -1
  33. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/prism.h +47 -11
  34. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/version.h +2 -2
  35. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism_compile.h +5 -5
  36. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/ractor_core.h +6 -6
  37. data/lib/debase/ruby_core_source/ruby-3.4.0-p-1/revision.h +5 -0
  38. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/rubyparser.h +3 -2
  39. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/thread_pthread.h +0 -1
  40. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/version.h +1 -1
  41. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm.inc +151 -88
  42. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm_core.h +40 -12
  43. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm_sync.h +3 -3
  44. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vmtc.inc +2 -0
  45. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/yjit.h +1 -0
  46. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/builtin.h +7 -1
  47. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/darray.h +101 -14
  48. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/debug_counter.h +6 -4
  49. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/dln.h +1 -2
  50. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/eval_intern.h +7 -0
  51. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/id.h +16 -5
  52. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/id_table.h +15 -0
  53. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/insns.inc +49 -6
  54. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/insns_info.inc +2432 -721
  55. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/array.h +3 -0
  56. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/basic_operators.h +2 -0
  57. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/bignum.h +1 -0
  58. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/bits.h +82 -0
  59. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/box.h +81 -0
  60. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/class.h +805 -0
  61. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/cmdlineopt.h +3 -4
  62. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/concurrent_set.h +21 -0
  63. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/encoding.h +4 -1
  64. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/error.h +35 -0
  65. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/eval.h +8 -0
  66. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/fixnum.h +1 -0
  67. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/gc.h +54 -30
  68. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/hash.h +3 -0
  69. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/imemo.h +94 -32
  70. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/inits.h +4 -0
  71. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/io.h +30 -7
  72. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/load.h +2 -0
  73. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/numeric.h +1 -0
  74. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/object.h +1 -1
  75. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/parse.h +18 -4
  76. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/proc.h +1 -1
  77. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/ractor.h +4 -0
  78. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/re.h +7 -2
  79. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/sanitizers.h +88 -39
  80. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/set_table.h +70 -0
  81. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/signal.h +1 -0
  82. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/st.h +1 -1
  83. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/string.h +39 -18
  84. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/struct.h +38 -5
  85. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/symbol.h +4 -3
  86. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/thread.h +42 -9
  87. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/time.h +4 -1
  88. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/variable.h +13 -11
  89. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/vm.h +6 -7
  90. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal.h +0 -3
  91. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/iseq.h +19 -2
  92. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/known_errors.inc +103 -103
  93. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/method.h +18 -2
  94. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/node.h +14 -3
  95. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/optunifs.inc +1 -3
  96. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/parse.h +37 -36
  97. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/ast.h +2495 -507
  98. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/defines.h +61 -7
  99. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/diagnostic.h +31 -6
  100. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/extension.h +5 -5
  101. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/node.h +0 -21
  102. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/options.h +186 -6
  103. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/parser.h +85 -40
  104. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/prism.h +88 -16
  105. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/regexp.h +43 -0
  106. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/static_literals.h +3 -2
  107. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_buffer.h +18 -0
  108. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_char.h +1 -2
  109. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_constant_pool.h +0 -8
  110. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_integer.h +26 -15
  111. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_list.h +6 -0
  112. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_newline_list.h +11 -0
  113. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_string.h +39 -13
  114. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/version.h +3 -3
  115. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism_compile.h +30 -12
  116. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/ractor_core.h +47 -134
  117. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/regenc.h +9 -4
  118. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/regint.h +0 -5
  119. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/regparse.h +2 -2
  120. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/revision.h +5 -0
  121. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ruby_atomic.h +66 -0
  122. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/rubyparser.h +214 -250
  123. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/shape.h +444 -0
  124. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/symbol.h +8 -10
  125. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/thread_pthread.h +36 -27
  126. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/variable.h +8 -20
  127. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm.inc +884 -344
  128. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm_callinfo.h +110 -75
  129. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm_core.h +220 -106
  130. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/vm_exec.h +15 -4
  131. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm_insnhelper.h +11 -6
  132. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm_sync.h +23 -4
  133. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vmtc.inc +42 -6
  134. data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/yjit.h +5 -3
  135. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/zjit.h +47 -0
  136. data/lib/debase/ruby_core_source/version.rb +1 -1
  137. data/lib/debase/ruby_core_source.rb +4 -2
  138. data/test/deduce_source_dir_test.rb +31 -0
  139. metadata +307 -293
  140. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/class.h +0 -283
  141. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/regexp.h +0 -33
  142. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string_list.h +0 -44
  143. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/revision.h +0 -5
  144. data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/shape.h +0 -233
  145. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/revision.h +0 -5
  146. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit.h +0 -101
  147. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit_c.h +0 -165
  148. data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_atomic.h +0 -23
  149. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/addr2line.h +0 -0
  150. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/build_assert/build_assert.h +0 -0
  151. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/check_type/check_type.h +0 -0
  152. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/container_of/container_of.h +0 -0
  153. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/list/list.h +0 -0
  154. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/str/str.h +0 -0
  155. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/constant.h +0 -0
  156. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/debug_counter.h +0 -0
  157. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/dln.h +0 -0
  158. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/encindex.h +0 -0
  159. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/eval_intern.h +0 -0
  160. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/hrtime.h +0 -0
  161. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/id_table.h +0 -0
  162. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/array.h +0 -0
  163. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/bignum.h +0 -0
  164. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/class.h +0 -0
  165. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/cmdlineopt.h +0 -0
  166. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/compar.h +0 -0
  167. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/compile.h +0 -0
  168. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/compilers.h +0 -0
  169. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/complex.h +0 -0
  170. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/cont.h +0 -0
  171. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/dir.h +0 -0
  172. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/enc.h +0 -0
  173. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/enum.h +0 -0
  174. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/enumerator.h +0 -0
  175. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/eval.h +0 -0
  176. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/file.h +0 -0
  177. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/hash.h +0 -0
  178. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/inits.h +0 -0
  179. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/load.h +0 -0
  180. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/loadpath.h +0 -0
  181. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/math.h +0 -0
  182. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/missing.h +0 -0
  183. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/numeric.h +0 -0
  184. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/object.h +0 -0
  185. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/process.h +0 -0
  186. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/random.h +0 -0
  187. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/range.h +0 -0
  188. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/rational.h +0 -0
  189. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/re.h +0 -0
  190. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/ruby_parser.h +0 -0
  191. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/serial.h +0 -0
  192. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/signal.h +0 -0
  193. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/st.h +0 -0
  194. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/static_assert.h +0 -0
  195. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/struct.h +0 -0
  196. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/symbol.h +0 -0
  197. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/time.h +0 -0
  198. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/transcode.h +0 -0
  199. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/util.h +0 -0
  200. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/variable.h +0 -0
  201. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/warnings.h +0 -0
  202. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal.h +0 -0
  203. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/iseq.h +0 -0
  204. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/known_errors.inc +0 -0
  205. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/node.h +0 -0
  206. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/node_name.inc +0 -0
  207. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/optinsn.inc +0 -0
  208. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/parser_bits.h +0 -0
  209. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/parser_node.h +0 -0
  210. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/parser_st.h +0 -0
  211. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/parser_value.h +0 -0
  212. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/encoding.h +0 -0
  213. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/node.h +0 -0
  214. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/options.h +0 -0
  215. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/pack.h +0 -0
  216. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/parser.h +0 -0
  217. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/prettyprint.h +0 -0
  218. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/regexp.h +0 -0
  219. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/static_literals.h +0 -0
  220. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_buffer.h +0 -0
  221. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_char.h +0 -0
  222. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_constant_pool.h +0 -0
  223. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_integer.h +0 -0
  224. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_list.h +0 -0
  225. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_memchr.h +0 -0
  226. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_newline_list.h +0 -0
  227. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_string.h +0 -0
  228. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_strncasecmp.h +0 -0
  229. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_strpbrk.h +0 -0
  230. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/probes_helper.h +0 -0
  231. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/regenc.h +0 -0
  232. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/regint.h +0 -0
  233. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/regparse.h +0 -0
  234. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/rjit.h +0 -0
  235. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/rjit_c.h +0 -0
  236. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ruby_assert.h +0 -0
  237. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ruby_atomic.h +0 -0
  238. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/shape.h +0 -0
  239. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/siphash.h +0 -0
  240. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/symbol.h +0 -0
  241. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/thread_none.h +0 -0
  242. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/thread_win32.h +0 -0
  243. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/timev.h +0 -0
  244. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/transcode_data.h +0 -0
  245. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/variable.h +0 -0
  246. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/vm_call_iseq_optimized.inc +0 -0
  247. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm_callinfo.h +0 -0
  248. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/vm_debug.h +0 -0
  249. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/vm_exec.h +0 -0
  250. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm_insnhelper.h +0 -0
  251. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/vm_opts.h +0 -0
  252. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/addr2line.h +0 -0
  253. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/build_assert/build_assert.h +0 -0
  254. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/check_type/check_type.h +0 -0
  255. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/container_of/container_of.h +0 -0
  256. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/list/list.h +0 -0
  257. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/str/str.h +0 -0
  258. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/constant.h +0 -0
  259. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/encindex.h +0 -0
  260. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/hrtime.h +0 -0
  261. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/compar.h +0 -0
  262. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/compile.h +0 -0
  263. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/compilers.h +0 -0
  264. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/complex.h +0 -0
  265. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/cont.h +0 -0
  266. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/dir.h +0 -0
  267. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/enc.h +0 -0
  268. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/enum.h +0 -0
  269. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/enumerator.h +0 -0
  270. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/file.h +0 -0
  271. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/loadpath.h +0 -0
  272. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/math.h +0 -0
  273. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/missing.h +0 -0
  274. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/process.h +0 -0
  275. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/random.h +0 -0
  276. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/range.h +0 -0
  277. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/rational.h +0 -0
  278. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/ruby_parser.h +0 -0
  279. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/serial.h +0 -0
  280. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/static_assert.h +0 -0
  281. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/transcode.h +0 -0
  282. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/util.h +0 -0
  283. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/warnings.h +0 -0
  284. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/node_name.inc +0 -0
  285. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/optinsn.inc +0 -0
  286. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/parser_bits.h +0 -0
  287. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/parser_node.h +0 -0
  288. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/parser_st.h +0 -0
  289. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/parser_value.h +0 -0
  290. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/encoding.h +0 -0
  291. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/pack.h +0 -0
  292. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/prettyprint.h +0 -0
  293. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_memchr.h +0 -0
  294. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_strncasecmp.h +0 -0
  295. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_strpbrk.h +0 -0
  296. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/probes_helper.h +0 -0
  297. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ruby_assert.h +0 -0
  298. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/siphash.h +0 -0
  299. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/thread_none.h +0 -0
  300. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/thread_win32.h +0 -0
  301. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/timev.h +0 -0
  302. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/transcode_data.h +0 -0
  303. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/version.h +0 -0
  304. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/vm_call_iseq_optimized.inc +0 -0
  305. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/vm_debug.h +0 -0
  306. /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/vm_opts.h +0 -0
@@ -1,7 +1,6 @@
1
1
  #ifndef INTERNAL_CMDLINEOPT_H /*-*-C-*-vi:se ft=c:*/
2
2
  #define INTERNAL_CMDLINEOPT_H
3
3
 
4
- #include "rjit.h"
5
4
  #include "yjit.h"
6
5
 
7
6
  typedef struct {
@@ -24,9 +23,6 @@ typedef struct ruby_cmdline_options {
24
23
  ruby_features_t warn;
25
24
  unsigned int dump;
26
25
  long backtrace_length_limit;
27
- #if USE_RJIT
28
- struct rb_rjit_options rjit;
29
- #endif
30
26
 
31
27
  const char *crash_report;
32
28
 
@@ -43,6 +39,9 @@ typedef struct ruby_cmdline_options {
43
39
  #if USE_YJIT
44
40
  unsigned int yjit: 1;
45
41
  #endif
42
+ #if USE_ZJIT
43
+ unsigned int zjit: 1;
44
+ #endif
46
45
  } ruby_cmdline_options_t;
47
46
 
48
47
  struct ruby_opt_message {
@@ -0,0 +1,21 @@
1
+ #ifndef RUBY_RACTOR_SAFE_TABLE_H
2
+ #define RUBY_RACTOR_SAFE_TABLE_H
3
+
4
+ #include "ruby/atomic.h"
5
+ #include "ruby/ruby.h"
6
+
7
+ struct rb_concurrent_set_funcs {
8
+ VALUE (*hash)(VALUE key);
9
+ bool (*cmp)(VALUE a, VALUE b);
10
+ VALUE (*create)(VALUE key, void *data);
11
+ void (*free)(VALUE key);
12
+ };
13
+
14
+ VALUE rb_concurrent_set_new(const struct rb_concurrent_set_funcs *funcs, int capacity);
15
+ rb_atomic_t rb_concurrent_set_size(VALUE set_obj);
16
+ VALUE rb_concurrent_set_find(VALUE *set_obj_ptr, VALUE key);
17
+ VALUE rb_concurrent_set_find_or_insert(VALUE *set_obj_ptr, VALUE key, void *data);
18
+ VALUE rb_concurrent_set_delete_by_identity(VALUE set_obj, VALUE key);
19
+ void rb_concurrent_set_foreach_with_replace(VALUE set_obj, int (*callback)(VALUE *key, void *data), void *data);
20
+
21
+ #endif
@@ -11,7 +11,6 @@
11
11
  #include "ruby/ruby.h" /* for ID */
12
12
  #include "ruby/encoding.h" /* for rb_encoding */
13
13
 
14
- #define rb_enc_autoload_p(enc) (!rb_enc_mbmaxlen(enc))
15
14
  #define rb_is_usascii_enc(enc) ((enc) == rb_usascii_encoding())
16
15
  #define rb_is_ascii8bit_enc(enc) ((enc) == rb_ascii8bit_encoding())
17
16
  #define rb_is_locale_enc(enc) ((enc) == rb_locale_encoding())
@@ -24,10 +23,14 @@ rb_encoding *rb_enc_check_str(VALUE str1, VALUE str2);
24
23
  int rb_encdb_replicate(const char *alias, const char *orig);
25
24
  int rb_encdb_alias(const char *alias, const char *orig);
26
25
  int rb_enc_autoload(rb_encoding *enc);
26
+ bool rb_enc_autoload_p(rb_encoding *enc);
27
27
  int rb_encdb_dummy(const char *name);
28
28
  void rb_encdb_declare(const char *name);
29
29
  void rb_enc_set_base(const char *name, const char *orig);
30
30
  int rb_enc_set_dummy(int index);
31
+ void rb_enc_raw_set(VALUE obj, rb_encoding *enc);
32
+ int rb_enc_registered(const char *name);
33
+
31
34
  PUREFUNC(int rb_data_is_encoding(VALUE obj));
32
35
 
33
36
  /* vm.c */
@@ -72,6 +72,7 @@ const char *rb_builtin_type_name(int t);
72
72
  const char *rb_builtin_class_name(VALUE x);
73
73
  PRINTF_ARGS(void rb_warn_deprecated(const char *fmt, const char *suggest, ...), 1, 3);
74
74
  PRINTF_ARGS(void rb_warn_deprecated_to_remove(const char *removal, const char *fmt, const char *suggest, ...), 2, 4);
75
+ PRINTF_ARGS(void rb_warn_reserved_name(const char *removal, const char *fmt, ...), 2, 3);
75
76
  #if RUBY_DEBUG
76
77
  # include "ruby/version.h"
77
78
  # define RUBY_VERSION_SINCE(major, minor) (RUBY_API_VERSION_CODE >= (major * 10000) + (minor) * 100)
@@ -110,6 +111,14 @@ rb_deprecated_method_to_be_removed(const char *removal)
110
111
  RBIMPL_ATTR_DIAGNOSE_IF(RUBY_VERSION_STRING_SINCE(removal), "deprecated method to be removed", "error")
111
112
  {
112
113
  }
114
+
115
+ RBIMPL_ATTR_FORCEINLINE()
116
+ static void
117
+ rb_diagnose_reserved_name_at(const char *coming)
118
+ RBIMPL_ATTR_DIAGNOSE_IF(!RUBY_VERSION_isdigit(coming[0]), "malformed version number", "error")
119
+ RBIMPL_ATTR_DIAGNOSE_IF(RUBY_VERSION_STRING_SINCE(coming), "reserved name already in use", "error")
120
+ {
121
+ }
113
122
  # else
114
123
  RBIMPL_ATTR_ERROR(("deprecated"))
115
124
  void rb_deprecated_method_to_be_removed(const char *);
@@ -117,16 +126,32 @@ void rb_deprecated_method_to_be_removed(const char *);
117
126
  (sizeof(char[1-2*(!RUBY_VERSION_isdigit(removal[0]) || RUBY_VERSION_STRING_SINCE(removal))])!=1 ? \
118
127
  rb_deprecated_method_to_be_removed(removal) : \
119
128
  RBIMPL_ASSERT_NOTHING)
129
+
130
+ RBIMPL_ATTR_ERROR(("deprecated"))
131
+ void rb_diagnose_reserved_name_at(const char *);
132
+ # define rb_diagnose_reserved_name_at(coming) \
133
+ (sizeof(char[1-2*(!RUBY_VERSION_isdigit(coming[0]) || RUBY_VERSION_STRING_SINCE(coming))])!=1 ? \
134
+ rb_diagnose_reserved_name_at(coming) : \
135
+ RBIMPL_ASSERT_NOTHING)
136
+
120
137
  # endif
121
138
  # define rb_warn_deprecated_to_remove_at(removal, ...) \
122
139
  (rb_deprecated_method_to_be_removed(#removal), \
123
140
  rb_warn_deprecated_to_remove(#removal, __VA_ARGS__))
141
+
142
+ # define rb_warn_reserved_name_at(coming, ...) \
143
+ (rb_diagnose_reserved_name_at(#coming), \
144
+ rb_warn_reserved_name(#coming, __VA_ARGS__))
124
145
  # endif
125
146
  #endif
126
147
  #ifndef rb_warn_deprecated_to_remove_at
127
148
  # define rb_warn_deprecated_to_remove_at(removal, ...) \
128
149
  rb_warn_deprecated_to_remove(#removal, __VA_ARGS__)
129
150
  #endif
151
+ #ifndef rb_warn_reserved_name_at
152
+ # define rb_warn_reserved_name_at(removal, ...) \
153
+ rb_warn_reserved_name(#removal, __VA_ARGS__)
154
+ #endif
130
155
  #ifndef RUBY_VERSION_SINCE
131
156
  # define RUBY_VERSION_SINCE(major, minor) 0
132
157
  #endif
@@ -142,6 +167,8 @@ VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*,
142
167
  PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3);
143
168
  PRINTF_ARGS(void rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3);
144
169
  PRINTF_ARGS(void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt, ...), 3, 4);
170
+ PRINTF_ARGS(void rb_enc_compile_warning(rb_encoding *enc, const char *file, int line, const char *fmt, ...), 4, 5);
171
+ PRINTF_ARGS(void rb_enc_compile_warn(rb_encoding *enc, const char *file, int line, const char *fmt, ...), 4, 5);
145
172
  rb_warning_category_t rb_warning_category_from_name(VALUE category);
146
173
  bool rb_warning_category_enabled_p(rb_warning_category_t category);
147
174
  VALUE rb_name_err_new(VALUE mesg, VALUE recv, VALUE method);
@@ -158,6 +185,7 @@ NORETURN(static inline void rb_key_err_raise(VALUE mesg, VALUE recv, VALUE name)
158
185
  static inline void Check_Type(VALUE v, enum ruby_value_type t);
159
186
  static inline bool rb_typeddata_is_instance_of_inline(VALUE obj, const rb_data_type_t *data_type);
160
187
  #define rb_typeddata_is_instance_of rb_typeddata_is_instance_of_inline
188
+ void rb_bug_without_die(const char *fmt, ...);
161
189
 
162
190
  RUBY_SYMBOL_EXPORT_BEGIN
163
191
  /* error.c (export) */
@@ -213,4 +241,11 @@ rb_typeddata_is_instance_of_inline(VALUE obj, const rb_data_type_t *data_type)
213
241
  return RB_TYPE_P(obj, T_DATA) && RTYPEDDATA_P(obj) && (RTYPEDDATA_TYPE(obj) == data_type);
214
242
  }
215
243
 
244
+ typedef enum {
245
+ rb_stack_overflow_prevention = 0, // VM stack overflow or about to machine stack overflow
246
+ rb_stack_overflow_signal = 1, // machine stack overflow but may be recoverable
247
+ rb_stack_overflow_fatal = 2, // fatal machine stack overflow
248
+ } ruby_stack_overflow_critical_level;
249
+ NORETURN(void rb_ec_stack_overflow(struct rb_execution_context_struct *ec, ruby_stack_overflow_critical_level crit));
250
+
216
251
  #endif /* INTERNAL_ERROR_H */
@@ -16,11 +16,19 @@
16
16
  #define id_status ruby_static_id_status
17
17
 
18
18
  /* eval.c */
19
+ struct rb_refinements_data {
20
+ VALUE refinement;
21
+ VALUE refinements;
22
+ };
23
+
19
24
  extern ID ruby_static_id_signo;
20
25
  extern ID ruby_static_id_status;
21
26
  VALUE rb_refinement_module_get_refined_class(VALUE module);
22
27
  void rb_class_modify_check(VALUE);
23
28
  NORETURN(VALUE rb_f_raise(int argc, VALUE *argv));
29
+ VALUE rb_exception_setup(int argc, VALUE *argv);
30
+ void rb_refinement_setup(struct rb_refinements_data *data, VALUE module, VALUE klass);
31
+ void rb_vm_using_module(VALUE module);
24
32
  VALUE rb_top_main_class(const char *method);
25
33
 
26
34
  /* eval_error.c */
@@ -10,6 +10,7 @@
10
10
  */
11
11
  #include "ruby/internal/config.h" /* for HAVE_LONG_LONG */
12
12
  #include <limits.h> /* for CHAR_BIT */
13
+ #include "internal/bits.h" /* for MUL_OVERFLOW_FIXNUM_P */
13
14
  #include "internal/compilers.h" /* for __has_builtin */
14
15
  #include "ruby/internal/stdbool.h" /* for bool */
15
16
  #include "ruby/intern.h" /* for rb_big_mul */
@@ -16,8 +16,8 @@
16
16
  #include "ruby/ruby.h" /* for rb_event_flag_t */
17
17
  #include "vm_core.h" /* for GET_EC() */
18
18
 
19
- #ifndef USE_SHARED_GC
20
- # define USE_SHARED_GC 0
19
+ #ifndef USE_MODULAR_GC
20
+ # define USE_MODULAR_GC 0
21
21
  #endif
22
22
 
23
23
  #if defined(__x86_64__) && !defined(_ILP32) && defined(__GNUC__)
@@ -127,7 +127,13 @@ struct rb_objspace; /* in vm_core.h */
127
127
  rb_wb_protected_newobj_of((ec ? ec : GET_EC()), (c), (f) & ~FL_WB_PROTECTED, s) : \
128
128
  rb_wb_unprotected_newobj_of((c), (f), s))
129
129
 
130
- #define RB_OBJ_GC_FLAGS_MAX 6 /* used in ext/objspace */
130
+ #ifndef RB_GC_OBJECT_METADATA_ENTRY_DEFINED
131
+ # define RB_GC_OBJECT_METADATA_ENTRY_DEFINED
132
+ struct rb_gc_object_metadata_entry {
133
+ ID name;
134
+ VALUE val;
135
+ };
136
+ #endif
131
137
 
132
138
  #ifndef USE_UNALIGNED_MEMBER_ACCESS
133
139
  # define UNALIGNED_MEMBER_ACCESS(expr) (expr)
@@ -163,12 +169,6 @@ struct rb_objspace; /* in vm_core.h */
163
169
  RB_OBJ_WRITE(old, _slot, young); \
164
170
  } while (0)
165
171
 
166
- // We use SIZE_POOL_COUNT number of shape IDs for transitions out of different size pools
167
- // The next available shape ID will be the SPECIAL_CONST_SHAPE_ID
168
- #ifndef SIZE_POOL_COUNT
169
- # define SIZE_POOL_COUNT 5
170
- #endif
171
-
172
172
  /* Used in places that could malloc during, which can cause the GC to run. We
173
173
  * need to temporarily disable the GC to allow the malloc to happen.
174
174
  * Allocating memory during GC is a bad idea, so use this only when absolutely
@@ -180,25 +180,14 @@ struct rb_objspace; /* in vm_core.h */
180
180
  #define DURING_GC_COULD_MALLOC_REGION_END() \
181
181
  if (_already_disabled == Qfalse) rb_gc_enable()
182
182
 
183
- typedef struct ractor_newobj_size_pool_cache {
184
- struct RVALUE *freelist;
185
- struct heap_page *using_page;
186
- } rb_ractor_newobj_size_pool_cache_t;
187
-
188
- typedef struct ractor_newobj_cache {
189
- size_t incremental_mark_step_allocated_slots;
190
- rb_ractor_newobj_size_pool_cache_t size_pool_caches[SIZE_POOL_COUNT];
191
- } rb_ractor_newobj_cache_t;
192
-
193
183
  /* gc.c */
194
- extern int ruby_disable_gc;
195
184
  RUBY_ATTR_MALLOC void *ruby_mimmalloc(size_t size);
196
185
  RUBY_ATTR_MALLOC void *ruby_mimcalloc(size_t num, size_t size);
197
186
  void ruby_mimfree(void *ptr);
198
187
  void rb_gc_prepare_heap(void);
199
188
  void rb_objspace_set_event_hook(const rb_event_flag_t event);
200
- VALUE rb_objspace_gc_enable(struct rb_objspace *);
201
- VALUE rb_objspace_gc_disable(struct rb_objspace *);
189
+ VALUE rb_objspace_gc_enable(void *objspace);
190
+ VALUE rb_objspace_gc_disable(void *objspace);
202
191
  void ruby_gc_set_params(void);
203
192
  void rb_gc_copy_attributes(VALUE dest, VALUE obj);
204
193
  size_t rb_size_mul_or_raise(size_t, size_t, VALUE); /* used in compile.c */
@@ -212,12 +201,14 @@ RUBY_ATTR_MALLOC void *rb_xcalloc_mul_add_mul(size_t, size_t, size_t, size_t);
212
201
  static inline void *ruby_sized_xrealloc_inlined(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
213
202
  static inline void *ruby_sized_xrealloc2_inlined(void *ptr, size_t new_count, size_t elemsiz, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3));
214
203
  static inline void ruby_sized_xfree_inlined(void *ptr, size_t size);
215
- void rb_gc_ractor_newobj_cache_clear(rb_ractor_newobj_cache_t *newobj_cache);
204
+ void rb_gc_obj_id_moved(VALUE obj);
205
+
206
+ void *rb_gc_ractor_cache_alloc(rb_ractor_t *ractor);
207
+ void rb_gc_ractor_cache_free(void *cache);
208
+
216
209
  bool rb_gc_size_allocatable_p(size_t size);
217
- size_t *rb_gc_size_pool_sizes(void);
218
- size_t rb_gc_size_pool_id_for_size(size_t size);
219
- int rb_objspace_garbage_object_p(VALUE obj);
220
- bool rb_gc_is_ptr_to_obj(const void *ptr);
210
+ size_t *rb_gc_heap_sizes(void);
211
+ size_t rb_gc_heap_id_for_size(size_t size);
221
212
 
222
213
  void rb_gc_mark_and_move(VALUE *ptr);
223
214
 
@@ -228,6 +219,9 @@ void rb_gc_ref_update_table_values_only(st_table *tbl);
228
219
 
229
220
  void rb_gc_initial_stress_set(VALUE flag);
230
221
 
222
+ void rb_gc_before_fork(void);
223
+ void rb_gc_after_fork(rb_pid_t pid);
224
+
231
225
  #define rb_gc_mark_and_move_ptr(ptr) do { \
232
226
  VALUE _obj = (VALUE)*(ptr); \
233
227
  rb_gc_mark_and_move(&_obj); \
@@ -238,8 +232,9 @@ RUBY_SYMBOL_EXPORT_BEGIN
238
232
  /* exports for objspace module */
239
233
  void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data);
240
234
  void rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *data);
241
- int rb_objspace_markable_object_p(VALUE obj);
242
235
  int rb_objspace_internal_object_p(VALUE obj);
236
+ int rb_objspace_garbage_object_p(VALUE obj);
237
+ bool rb_gc_pointer_to_heap_p(VALUE obj);
243
238
 
244
239
  void rb_objspace_each_objects(
245
240
  int (*callback)(void *start, void *end, size_t stride, void *data),
@@ -249,25 +244,50 @@ size_t rb_gc_obj_slot_size(VALUE obj);
249
244
 
250
245
  VALUE rb_gc_disable_no_rest(void);
251
246
 
247
+ #define RB_GC_MAX_NAME_LEN 20
252
248
 
253
249
  /* gc.c (export) */
254
250
  const char *rb_objspace_data_type_name(VALUE obj);
255
251
  VALUE rb_wb_protected_newobj_of(struct rb_execution_context_struct *, VALUE, VALUE, size_t);
256
252
  VALUE rb_wb_unprotected_newobj_of(VALUE, VALUE, size_t);
257
253
  size_t rb_obj_memsize_of(VALUE);
258
- void rb_gc_verify_internal_consistency(void);
259
- size_t rb_obj_gc_flags(VALUE, ID[], size_t);
254
+ struct rb_gc_object_metadata_entry *rb_gc_object_metadata(VALUE obj);
260
255
  void rb_gc_mark_values(long n, const VALUE *values);
261
256
  void rb_gc_mark_vm_stack_values(long n, const VALUE *values);
262
257
  void rb_gc_update_values(long n, VALUE *values);
263
258
  void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2));
264
259
  void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3));
265
260
  void ruby_sized_xfree(void *x, size_t size);
261
+
262
+ const char *rb_gc_active_gc_name(void);
263
+ int rb_gc_modular_gc_loaded_p(void);
264
+
266
265
  RUBY_SYMBOL_EXPORT_END
267
266
 
267
+ static inline VALUE
268
+ rb_obj_atomic_write(
269
+ VALUE a, VALUE *slot, VALUE b,
270
+ RBIMPL_ATTR_MAYBE_UNUSED()
271
+ const char *filename,
272
+ RBIMPL_ATTR_MAYBE_UNUSED()
273
+ int line)
274
+ {
275
+ #ifdef RGENGC_LOGGING_WRITE
276
+ RGENGC_LOGGING_WRITE(a, slot, b, filename, line);
277
+ #endif
278
+
279
+ RUBY_ATOMIC_VALUE_SET(*slot, b);
280
+
281
+ rb_obj_written(a, RUBY_Qundef /* ignore `oldv' now */, b, filename, line);
282
+ return a;
283
+ }
284
+ #define RB_OBJ_ATOMIC_WRITE(old, slot, young) \
285
+ RBIMPL_CAST(rb_obj_atomic_write((VALUE)(old), (VALUE *)(slot), (VALUE)(young), __FILE__, __LINE__))
286
+
268
287
  int rb_ec_stack_check(struct rb_execution_context_struct *ec);
269
288
  void rb_gc_writebarrier_remember(VALUE obj);
270
289
  const char *rb_obj_info(VALUE obj);
290
+ void ruby_annotate_mmap(const void *addr, unsigned long size, const char *name);
271
291
 
272
292
  #if defined(HAVE_MALLOC_USABLE_SIZE) || defined(HAVE_MALLOC_SIZE) || defined(_WIN32)
273
293
 
@@ -331,4 +351,8 @@ ruby_sized_realloc_n(void *ptr, size_t new_count, size_t element_size, size_t ol
331
351
  #define ruby_sized_xrealloc ruby_sized_xrealloc_inlined
332
352
  #define ruby_sized_xrealloc2 ruby_sized_xrealloc2_inlined
333
353
  #define ruby_sized_xfree ruby_sized_xfree_inlined
354
+
355
+ void rb_gc_verify_shareable(VALUE);
356
+ bool rb_gc_checking_shareable(void);
357
+
334
358
  #endif /* INTERNAL_GC_H */
@@ -72,6 +72,7 @@ struct RHash {
72
72
  /* hash.c */
73
73
  void rb_hash_st_table_set(VALUE hash, st_table *st);
74
74
  VALUE rb_hash_default_value(VALUE hash, VALUE key);
75
+ VALUE rb_hash_set_default(VALUE hash, VALUE ifnone);
75
76
  VALUE rb_hash_set_default_proc(VALUE hash, VALUE proc);
76
77
  long rb_dbl_long_hash(double d);
77
78
  st_table *rb_init_identtable(void);
@@ -86,8 +87,10 @@ VALUE rb_hash_set_pair(VALUE hash, VALUE pair);
86
87
  int rb_hash_stlike_delete(VALUE hash, st_data_t *pkey, st_data_t *pval);
87
88
  int rb_hash_stlike_foreach_with_replace(VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg);
88
89
  int rb_hash_stlike_update(VALUE hash, st_data_t key, st_update_callback_func *func, st_data_t arg);
90
+ bool rb_hash_default_unredefined(VALUE hash);
89
91
  VALUE rb_ident_hash_new_with_size(st_index_t size);
90
92
  void rb_hash_free(VALUE hash);
93
+ RUBY_EXTERN VALUE rb_cHash_empty_frozen;
91
94
 
92
95
  static inline unsigned RHASH_AR_TABLE_SIZE_RAW(VALUE h);
93
96
  static inline VALUE RHASH_IFNONE(VALUE h);
@@ -10,14 +10,11 @@
10
10
  */
11
11
  #include "ruby/internal/config.h"
12
12
  #include <stddef.h> /* for size_t */
13
+ #include "id_table.h"
13
14
  #include "internal/array.h" /* for rb_ary_hidden_new_fill */
14
15
  #include "ruby/internal/stdbool.h" /* for bool */
15
16
  #include "ruby/ruby.h" /* for rb_block_call_func_t */
16
17
 
17
- #ifndef IMEMO_DEBUG
18
- # define IMEMO_DEBUG 0
19
- #endif
20
-
21
18
  #define IMEMO_MASK 0x0f
22
19
 
23
20
  /* FL_USER0 to FL_USER3 is for type */
@@ -28,6 +25,7 @@
28
25
  #define IMEMO_FL_USER3 FL_USER7
29
26
  #define IMEMO_FL_USER4 FL_USER8
30
27
  #define IMEMO_FL_USER5 FL_USER9
28
+ #define IMEMO_FL_USER6 FL_USER10
31
29
 
32
30
  enum imemo_type {
33
31
  imemo_env = 0,
@@ -39,11 +37,10 @@ enum imemo_type {
39
37
  imemo_ment = 6,
40
38
  imemo_iseq = 7,
41
39
  imemo_tmpbuf = 8,
42
- imemo_ast = 9, // Obsolete due to the universal parser
43
- imemo_parser_strterm = 10,
44
- imemo_callinfo = 11,
45
- imemo_callcache = 12,
46
- imemo_constcache = 13,
40
+ imemo_callinfo = 10,
41
+ imemo_callcache = 11,
42
+ imemo_constcache = 12,
43
+ imemo_fields = 13,
47
44
  };
48
45
 
49
46
  /* CREF (Class REFerence) is defined in method.h */
@@ -79,7 +76,12 @@ struct vm_ifunc_argc {
79
76
  #endif
80
77
  };
81
78
 
82
- /*! IFUNC (Internal FUNCtion) */
79
+ /*! IFUNC (Internal FUNCtion)
80
+ *
81
+ * Bookkeeping for converting a C function and some closed-over data into a
82
+ * block passable to methods. Like Ruby Proc, but not directly accessible at
83
+ * Ruby level since this is an imemo. See rb_block_call() and friends.
84
+ */
83
85
  struct vm_ifunc {
84
86
  VALUE flags;
85
87
  VALUE *svar_lep;
@@ -87,12 +89,11 @@ struct vm_ifunc {
87
89
  const void *data;
88
90
  struct vm_ifunc_argc argc;
89
91
  };
92
+ #define IFUNC_YIELD_OPTIMIZABLE IMEMO_FL_USER0
90
93
 
91
94
  struct rb_imemo_tmpbuf_struct {
92
95
  VALUE flags;
93
- VALUE reserved;
94
96
  VALUE *ptr; /* malloc'ed buffer */
95
- struct rb_imemo_tmpbuf_struct *next; /* next imemo */
96
97
  size_t cnt; /* buffer size in VALUE */
97
98
  };
98
99
 
@@ -113,7 +114,8 @@ struct MEMO {
113
114
  } u3;
114
115
  };
115
116
 
116
- #define IMEMO_NEW(T, type, v0) ((T *)rb_imemo_new((type), (v0)))
117
+ #define IMEMO_NEW(T, type, v0) ((T *)rb_imemo_new((type), (v0), sizeof(T), false))
118
+ #define SHAREABLE_IMEMO_NEW(T, type, v0) ((T *)rb_imemo_new((type), (v0), sizeof(T), true))
117
119
 
118
120
  /* ment is in method.h */
119
121
 
@@ -130,32 +132,23 @@ struct MEMO {
130
132
  #ifndef RUBY_RUBYPARSER_H
131
133
  typedef struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t;
132
134
  #endif
133
- rb_imemo_tmpbuf_t *rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt);
135
+ VALUE rb_imemo_new(enum imemo_type type, VALUE v0, size_t size, bool is_shareable);
136
+ VALUE rb_imemo_tmpbuf_new(void);
134
137
  struct vm_ifunc *rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int max_argc);
135
138
  static inline enum imemo_type imemo_type(VALUE imemo);
136
139
  static inline int imemo_type_p(VALUE imemo, enum imemo_type imemo_type);
137
140
  static inline bool imemo_throw_data_p(VALUE imemo);
138
141
  static inline struct vm_ifunc *rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data);
139
- static inline VALUE rb_imemo_tmpbuf_auto_free_pointer(void);
140
142
  static inline void *RB_IMEMO_TMPBUF_PTR(VALUE v);
141
143
  static inline void *rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr);
142
- static inline VALUE rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str);
143
144
  static inline void MEMO_V1_SET(struct MEMO *m, VALUE v);
144
145
  static inline void MEMO_V2_SET(struct MEMO *m, VALUE v);
145
146
 
146
147
  size_t rb_imemo_memsize(VALUE obj);
147
- void rb_cc_table_mark(VALUE klass);
148
148
  void rb_imemo_mark_and_move(VALUE obj, bool reference_updating);
149
- void rb_cc_table_free(VALUE klass);
150
149
  void rb_imemo_free(VALUE obj);
151
150
 
152
151
  RUBY_SYMBOL_EXPORT_BEGIN
153
- #if IMEMO_DEBUG
154
- VALUE rb_imemo_new_debug(enum imemo_type type, VALUE v0, const char *file, int line);
155
- #define rb_imemo_new(type, v1, v2, v3, v0) rb_imemo_new_debug(type, v1, v2, v3, v0, __FILE__, __LINE__)
156
- #else
157
- VALUE rb_imemo_new(enum imemo_type type, VALUE v0);
158
- #endif
159
152
  const char *rb_imemo_name(enum imemo_type type);
160
153
  RUBY_SYMBOL_EXPORT_END
161
154
 
@@ -205,12 +198,6 @@ rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data)
205
198
  return rb_vm_ifunc_new(func, data, 0, UNLIMITED_ARGUMENTS);
206
199
  }
207
200
 
208
- static inline VALUE
209
- rb_imemo_tmpbuf_auto_free_pointer(void)
210
- {
211
- return rb_imemo_new(imemo_tmpbuf, 0);
212
- }
213
-
214
201
  static inline void *
215
202
  RB_IMEMO_TMPBUF_PTR(VALUE v)
216
203
  {
@@ -225,7 +212,7 @@ rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr)
225
212
  }
226
213
 
227
214
  static inline VALUE
228
- rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str)
215
+ rb_imemo_tmpbuf_new_from_an_RString(VALUE str)
229
216
  {
230
217
  const void *src;
231
218
  VALUE imemo;
@@ -235,7 +222,7 @@ rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str)
235
222
 
236
223
  StringValue(str);
237
224
  /* create tmpbuf to keep the pointer before xmalloc */
238
- imemo = rb_imemo_tmpbuf_auto_free_pointer();
225
+ imemo = rb_imemo_tmpbuf_new();
239
226
  tmpbuf = (rb_imemo_tmpbuf_t *)imemo;
240
227
  len = RSTRING_LEN(str);
241
228
  src = RSTRING_PTR(str);
@@ -257,4 +244,79 @@ MEMO_V2_SET(struct MEMO *m, VALUE v)
257
244
  RB_OBJ_WRITE(m, &m->v2, v);
258
245
  }
259
246
 
247
+ struct rb_fields {
248
+ struct RBasic basic;
249
+ union {
250
+ struct {
251
+ VALUE fields[1];
252
+ } embed;
253
+ struct {
254
+ VALUE *ptr;
255
+ } external;
256
+ struct {
257
+ // Note: the st_table could be embedded, but complex T_CLASS should be rare to
258
+ // non-existent, so not really worth the trouble.
259
+ st_table *table;
260
+ } complex;
261
+ } as;
262
+ };
263
+
264
+ // IMEMO/fields and T_OBJECT have exactly the same layout.
265
+ // This is useful for JIT and common codepaths.
266
+ #define OBJ_FIELD_HEAP ROBJECT_HEAP
267
+ STATIC_ASSERT(imemo_fields_flags, OBJ_FIELD_HEAP == IMEMO_FL_USER0);
268
+ STATIC_ASSERT(imemo_fields_embed_offset, offsetof(struct RObject, as.ary) == offsetof(struct rb_fields, as.embed.fields));
269
+ STATIC_ASSERT(imemo_fields_embed_offset, offsetof(struct RObject, as.heap.fields) == offsetof(struct rb_fields, as.external.ptr));
270
+ STATIC_ASSERT(imemo_fields_embed_offset, offsetof(struct RObject, as.heap.fields) == offsetof(struct rb_fields, as.complex.table));
271
+
272
+ #define IMEMO_OBJ_FIELDS(fields) ((struct rb_fields *)fields)
273
+
274
+ VALUE rb_imemo_fields_new(VALUE owner, size_t capa, bool shareable);
275
+ VALUE rb_imemo_fields_new_complex(VALUE owner, size_t capa, bool shareable);
276
+ VALUE rb_imemo_fields_new_complex_tbl(VALUE owner, st_table *tbl, bool shareable);
277
+ VALUE rb_imemo_fields_clone(VALUE fields_obj);
278
+ void rb_imemo_fields_clear(VALUE fields_obj);
279
+
280
+ static inline VALUE
281
+ rb_imemo_fields_owner(VALUE fields_obj)
282
+ {
283
+ RUBY_ASSERT(IMEMO_TYPE_P(fields_obj, imemo_fields));
284
+
285
+ return CLASS_OF(fields_obj);
286
+ }
287
+
288
+ static inline VALUE *
289
+ rb_imemo_fields_ptr(VALUE fields_obj)
290
+ {
291
+ if (!fields_obj) {
292
+ return NULL;
293
+ }
294
+
295
+ RUBY_ASSERT(IMEMO_TYPE_P(fields_obj, imemo_fields) || RB_TYPE_P(fields_obj, T_OBJECT));
296
+
297
+ if (UNLIKELY(FL_TEST_RAW(fields_obj, OBJ_FIELD_HEAP))) {
298
+ return IMEMO_OBJ_FIELDS(fields_obj)->as.external.ptr;
299
+ }
300
+ else {
301
+ return IMEMO_OBJ_FIELDS(fields_obj)->as.embed.fields;
302
+ }
303
+ }
304
+
305
+ static inline st_table *
306
+ rb_imemo_fields_complex_tbl(VALUE fields_obj)
307
+ {
308
+ if (!fields_obj) {
309
+ return NULL;
310
+ }
311
+
312
+ RUBY_ASSERT(IMEMO_TYPE_P(fields_obj, imemo_fields) || RB_TYPE_P(fields_obj, T_OBJECT));
313
+ RUBY_ASSERT(FL_TEST_RAW(fields_obj, OBJ_FIELD_HEAP));
314
+
315
+ // Some codepaths unconditionally access the fields_ptr, and assume it can be used as st_table if the
316
+ // shape is too_complex.
317
+ RUBY_ASSERT((st_table *)rb_imemo_fields_ptr(fields_obj) == IMEMO_OBJ_FIELDS(fields_obj)->as.complex.table);
318
+
319
+ return IMEMO_OBJ_FIELDS(fields_obj)->as.complex.table;
320
+ }
321
+
260
322
  #endif /* INTERNAL_IMEMO_H */
@@ -9,6 +9,10 @@
9
9
  * @brief Internal header aggregating init functions.
10
10
  */
11
11
 
12
+ /* box.c */
13
+ void Init_enable_box(void);
14
+ void Init_root_box(void);
15
+
12
16
  /* class.c */
13
17
  void Init_class_hierarchy(void);
14
18
 
@@ -14,10 +14,21 @@
14
14
  struct rb_io;
15
15
 
16
16
  #include "ruby/io.h" /* for rb_io_t */
17
+ #include "ccan/list/list.h"
18
+ #include "serial.h"
17
19
 
18
- #define IO_WITHOUT_GVL(func, arg) rb_thread_call_without_gvl(func, arg, RUBY_UBF_IO, 0)
20
+ #define IO_WITHOUT_GVL(func, arg) rb_nogvl(func, arg, RUBY_UBF_IO, 0, RB_NOGVL_OFFLOAD_SAFE)
19
21
  #define IO_WITHOUT_GVL_INT(func, arg) (int)(VALUE)IO_WITHOUT_GVL(func, arg)
20
22
 
23
+ // Represents an in-flight blocking operation:
24
+ struct rb_io_blocking_operation {
25
+ // The linked list data structure.
26
+ struct ccan_list_node list;
27
+
28
+ // The execution context of the blocking operation.
29
+ struct rb_execution_context_struct *ec;
30
+ };
31
+
21
32
  /** Ruby's IO, metadata and buffers. */
22
33
  struct rb_io {
23
34
 
@@ -31,7 +42,7 @@ struct rb_io {
31
42
  int fd;
32
43
 
33
44
  /** mode flags: FMODE_XXXs */
34
- int mode;
45
+ enum rb_io_mode mode;
35
46
 
36
47
  /** child's pid (for pipes) */
37
48
  rb_pid_t pid;
@@ -111,6 +122,18 @@ struct rb_io {
111
122
  * The timeout associated with this IO when performing blocking operations.
112
123
  */
113
124
  VALUE timeout;
125
+
126
+ /**
127
+ * Threads that are performing a blocking operation without the GVL using
128
+ * this IO. On calling IO#close, these threads will be interrupted so that
129
+ * the operation can be cancelled.
130
+ */
131
+ struct ccan_list_head blocking_operations;
132
+ struct rb_execution_context_struct *closing_ec;
133
+ VALUE wakeup_mutex;
134
+
135
+ // The fork generation of the blocking operations list.
136
+ rb_serial_t fork_generation;
114
137
  };
115
138
 
116
139
  /* io.c */
@@ -119,22 +142,22 @@ void rb_stdio_set_default_encoding(void);
119
142
  VALUE rb_io_flush_raw(VALUE, int);
120
143
  size_t rb_io_memsize(const rb_io_t *);
121
144
  int rb_stderr_tty_p(void);
122
- void rb_io_fptr_finalize_internal(void *ptr);
123
- #ifdef rb_io_fptr_finalize
124
- # undef rb_io_fptr_finalize
125
- #endif
126
- #define rb_io_fptr_finalize rb_io_fptr_finalize_internal
127
145
  VALUE rb_io_popen(VALUE pname, VALUE pmode, VALUE env, VALUE opt);
128
146
 
129
147
  VALUE rb_io_prep_stdin(void);
130
148
  VALUE rb_io_prep_stdout(void);
131
149
  VALUE rb_io_prep_stderr(void);
132
150
 
151
+ int rb_io_notify_close(struct rb_io *fptr);
152
+
133
153
  RUBY_SYMBOL_EXPORT_BEGIN
134
154
  /* io.c (export) */
135
155
  void rb_maygvl_fd_fix_cloexec(int fd);
136
156
  int rb_gc_for_fd(int err);
137
157
  void rb_write_error_str(VALUE mesg);
158
+
159
+ VALUE rb_io_blocking_region_wait(struct rb_io *io, rb_blocking_function_t *function, void *argument, enum rb_io_event events);
160
+ VALUE rb_io_blocking_region(struct rb_io *io, rb_blocking_function_t *function, void *argument);
138
161
  RUBY_SYMBOL_EXPORT_END
139
162
 
140
163
  #endif /* INTERNAL_IO_H */