debase-ruby_core_source 0.10.9 → 0.10.13

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 (242) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +1 -1
  4. data/Rakefile +6 -3
  5. data/debase-ruby_core_source.gemspec +2 -1
  6. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/addr2line.h +2 -3
  7. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/builtin.h +17 -2
  8. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/ccan/build_assert/build_assert.h +0 -0
  9. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/ccan/check_type/check_type.h +0 -0
  10. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/ccan/container_of/container_of.h +0 -0
  11. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/ccan/list/list.h +0 -0
  12. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/ccan/str/str.h +0 -0
  13. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/constant.h +10 -5
  14. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/debug_counter.h +127 -48
  15. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/dln.h +3 -18
  16. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/encindex.h +3 -2
  17. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/eval_intern.h +16 -7
  18. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/gc.h +13 -2
  19. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/hrtime.h +0 -0
  20. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/id.h +0 -0
  21. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/id_table.h +2 -0
  22. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/insns.inc +0 -4
  23. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/insns_info.inc +323 -536
  24. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/array.h +119 -0
  25. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/bignum.h +246 -0
  26. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/bits.h +566 -0
  27. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/class.h +174 -0
  28. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compar.h +50 -0
  29. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compile.h +32 -0
  30. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compilers.h +108 -0
  31. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/complex.h +29 -0
  32. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/cont.h +25 -0
  33. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/dir.h +17 -0
  34. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enc.h +20 -0
  35. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/encoding.h +28 -0
  36. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enum.h +19 -0
  37. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enumerator.h +22 -0
  38. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/error.h +124 -0
  39. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/eval.h +33 -0
  40. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/file.h +39 -0
  41. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/fixnum.h +185 -0
  42. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/gc.h +161 -0
  43. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/hash.h +241 -0
  44. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/imemo.h +243 -0
  45. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/inits.h +51 -0
  46. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/io.h +35 -0
  47. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/load.h +19 -0
  48. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/loadpath.h +17 -0
  49. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/math.h +24 -0
  50. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/missing.h +19 -0
  51. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/numeric.h +255 -0
  52. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/object.h +83 -0
  53. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/parse.h +23 -0
  54. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/proc.h +33 -0
  55. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/process.h +136 -0
  56. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/random.h +17 -0
  57. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/range.h +41 -0
  58. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/rational.h +71 -0
  59. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/re.h +29 -0
  60. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/sanitizers.h +191 -0
  61. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/scheduler.h +44 -0
  62. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/serial.h +24 -0
  63. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/signal.h +22 -0
  64. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/static_assert.h +17 -0
  65. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/string.h +140 -0
  66. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/struct.h +154 -0
  67. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/symbol.h +41 -0
  68. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/thread.h +54 -0
  69. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/time.h +35 -0
  70. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/transcode.h +21 -0
  71. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/util.h +31 -0
  72. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/variable.h +84 -0
  73. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/vm.h +136 -0
  74. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/warnings.h +17 -0
  75. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal.h +107 -0
  76. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/iseq.h +11 -18
  77. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/known_errors.inc +0 -0
  78. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/method.h +21 -8
  79. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/mjit.h +89 -48
  80. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/mjit_compile.inc +2746 -2288
  81. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/node.h +32 -24
  82. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/node_name.inc +2 -2
  83. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/opt_sc.inc +0 -0
  84. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/optinsn.inc +0 -0
  85. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/optunifs.inc +0 -0
  86. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/parse.h +1 -0
  87. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/probes_helper.h +2 -0
  88. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ractor_core.h +343 -0
  89. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/regenc.h +0 -0
  90. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/regint.h +1 -1
  91. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/regparse.h +0 -0
  92. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/revision.h +2 -0
  93. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ruby_assert.h +15 -0
  94. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ruby_atomic.h +23 -0
  95. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/siphash.h +0 -0
  96. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/symbol.h +4 -4
  97. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/thread_pthread.h +45 -5
  98. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/thread_win32.h +28 -3
  99. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/timev.h +1 -0
  100. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/transcode_data.h +2 -3
  101. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/transient_heap.h +6 -3
  102. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/variable.h +22 -0
  103. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/version.h +23 -11
  104. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/vm.inc +707 -671
  105. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/vm_call_iseq_optimized.inc +93 -86
  106. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_callinfo.h +456 -0
  107. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/vm_core.h +262 -194
  108. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_debug.h +116 -0
  109. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/vm_exec.h +9 -6
  110. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/vm_insnhelper.h +28 -26
  111. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/vm_opts.h +6 -5
  112. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_sync.h +136 -0
  113. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/vmtc.inc +0 -4
  114. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/addr2line.h +2 -3
  115. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/builtin.h +83 -0
  116. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/ccan/build_assert/build_assert.h +13 -13
  117. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/ccan/check_type/check_type.h +17 -17
  118. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/ccan/container_of/container_of.h +63 -63
  119. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/ccan/list/list.h +262 -262
  120. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/ccan/str/str.h +4 -4
  121. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/constant.h +10 -9
  122. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/darray.h +198 -0
  123. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/debug_counter.h +137 -48
  124. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/dln.h +3 -23
  125. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/encindex.h +3 -2
  126. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/eval_intern.h +34 -41
  127. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/gc.h +24 -11
  128. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/hrtime.h +9 -9
  129. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/id.h +4 -3
  130. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/id_table.h +3 -1
  131. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/insns.inc +6 -8
  132. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/insns_info.inc +1907 -2543
  133. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/array.h +113 -0
  134. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/bignum.h +246 -0
  135. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/bits.h +565 -0
  136. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/class.h +188 -0
  137. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/compar.h +49 -0
  138. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/compile.h +35 -0
  139. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/compilers.h +107 -0
  140. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/complex.h +29 -0
  141. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/cont.h +24 -0
  142. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/dir.h +16 -0
  143. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/enc.h +19 -0
  144. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/encoding.h +30 -0
  145. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/enum.h +18 -0
  146. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/enumerator.h +21 -0
  147. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/error.h +191 -0
  148. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/eval.h +32 -0
  149. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/file.h +38 -0
  150. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/fixnum.h +184 -0
  151. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/gc.h +175 -0
  152. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/hash.h +243 -0
  153. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/imemo.h +243 -0
  154. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/inits.h +50 -0
  155. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/io.h +38 -0
  156. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/load.h +18 -0
  157. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/loadpath.h +16 -0
  158. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/math.h +23 -0
  159. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/missing.h +18 -0
  160. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/numeric.h +271 -0
  161. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/object.h +83 -0
  162. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/parse.h +23 -0
  163. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/proc.h +32 -0
  164. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/process.h +137 -0
  165. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/random.h +16 -0
  166. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/range.h +40 -0
  167. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/rational.h +72 -0
  168. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/re.h +30 -0
  169. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/sanitizers.h +190 -0
  170. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/serial.h +23 -0
  171. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/signal.h +21 -0
  172. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/static_assert.h +16 -0
  173. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/string.h +141 -0
  174. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/struct.h +153 -0
  175. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/symbol.h +40 -0
  176. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/thread.h +53 -0
  177. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/time.h +34 -0
  178. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/transcode.h +20 -0
  179. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/util.h +27 -0
  180. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/variable.h +83 -0
  181. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/vm.h +132 -0
  182. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/warnings.h +16 -0
  183. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal.h +109 -0
  184. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/iseq.h +44 -35
  185. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/known_errors.inc +0 -0
  186. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/method.h +21 -4
  187. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/mjit.h +231 -0
  188. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/mjit_compile.inc +3322 -2940
  189. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/node.h +39 -23
  190. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/node_name.inc +210 -0
  191. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/opt_sc.inc +0 -2
  192. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/optinsn.inc +7 -7
  193. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/optunifs.inc +1 -1
  194. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/parse.h +9 -5
  195. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/probes_helper.h +9 -7
  196. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ractor_core.h +346 -0
  197. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/regenc.h +8 -8
  198. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/regint.h +16 -12
  199. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/regparse.h +2 -2
  200. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/revision.h +2 -0
  201. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ruby_assert.h +14 -0
  202. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ruby_atomic.h +23 -0
  203. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/siphash.h +0 -0
  204. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/symbol.h +14 -14
  205. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/thread_pthread.h +45 -5
  206. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/thread_win32.h +30 -5
  207. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/timev.h +1 -0
  208. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/transcode_data.h +49 -50
  209. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/transient_heap.h +6 -3
  210. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/variable.h +21 -0
  211. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/version.h +15 -4
  212. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/vm.inc +1033 -887
  213. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_call_iseq_optimized.inc +244 -0
  214. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_callinfo.h +454 -0
  215. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/vm_core.h +508 -362
  216. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_debug.h +119 -0
  217. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/vm_exec.h +22 -18
  218. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/vm_insnhelper.h +42 -32
  219. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/vm_opts.h +8 -5
  220. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_sync.h +137 -0
  221. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/vmtc.inc +6 -8
  222. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit.h +63 -0
  223. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_asm.h +392 -0
  224. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_codegen.h +19 -0
  225. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_core.h +302 -0
  226. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_iface.h +38 -0
  227. data/lib/debase/ruby_core_source/version.rb +1 -1
  228. data/lib/debase/ruby_core_source.rb +0 -2
  229. metadata +240 -110
  230. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/internal.h +0 -2682
  231. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/revision.h +0 -2
  232. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ruby_assert.h +0 -15
  233. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ruby_atomic.h +0 -244
  234. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_call_iseq_optimized.inc +0 -237
  235. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_debug.h +0 -34
  236. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/internal.h +0 -2657
  237. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/mjit.h +0 -175
  238. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/node_name.inc +0 -208
  239. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/revision.h +0 -2
  240. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/ruby_assert.h +0 -15
  241. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/ruby_atomic.h +0 -244
  242. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/vm_debug.h +0 -34
@@ -1,3 +1,5 @@
1
+ #ifndef RUBY_VM_CORE_H
2
+ #define RUBY_VM_CORE_H
1
3
  /**********************************************************************
2
4
 
3
5
  vm_core.h -
@@ -9,9 +11,6 @@
9
11
 
10
12
  **********************************************************************/
11
13
 
12
- #ifndef RUBY_VM_CORE_H
13
- #define RUBY_VM_CORE_H
14
-
15
14
  /*
16
15
  * Enable check mode.
17
16
  * 1: enable local assertions.
@@ -46,6 +45,12 @@
46
45
  #define VMDEBUG 3
47
46
  #endif
48
47
 
48
+ #include "ruby/internal/config.h"
49
+
50
+ #include <stddef.h>
51
+ #include <signal.h>
52
+ #include <stdarg.h>
53
+
49
54
  #include "ruby_assert.h"
50
55
 
51
56
  #if VM_CHECK_MODE > 0
@@ -57,27 +62,21 @@
57
62
  #define VM_UNREACHABLE(func) UNREACHABLE
58
63
  #endif
59
64
 
60
- #define RUBY_VM_THREAD_MODEL 2
61
-
62
- /*
63
- * implementation selector of get_insn_info algorithm
64
- * 0: linear search
65
- * 1: binary search
66
- * 2: succinct bitvector
67
- */
68
- #ifndef VM_INSN_INFO_TABLE_IMPL
69
- # define VM_INSN_INFO_TABLE_IMPL 2
70
- #endif
71
-
72
- #include "ruby/ruby.h"
73
- #include "ruby/st.h"
65
+ #include <setjmp.h>
74
66
 
75
- #include "node.h"
76
- #include "vm_opts.h"
67
+ #include "ruby/internal/stdbool.h"
68
+ #include "ccan/list/list.h"
77
69
  #include "id.h"
70
+ #include "internal.h"
71
+ #include "internal/array.h"
72
+ #include "internal/serial.h"
73
+ #include "internal/vm.h"
78
74
  #include "method.h"
75
+ #include "node.h"
76
+ #include "ruby/ruby.h"
77
+ #include "ruby/st.h"
79
78
  #include "ruby_atomic.h"
80
- #include "ccan/list/list.h"
79
+ #include "vm_opts.h"
81
80
 
82
81
  #include "ruby/thread_native.h"
83
82
  #if defined(_WIN32)
@@ -86,8 +85,17 @@
86
85
  #include "thread_pthread.h"
87
86
  #endif
88
87
 
89
- #include <setjmp.h>
90
- #include <signal.h>
88
+ #define RUBY_VM_THREAD_MODEL 2
89
+
90
+ /*
91
+ * implementation selector of get_insn_info algorithm
92
+ * 0: linear search
93
+ * 1: binary search
94
+ * 2: succinct bitvector
95
+ */
96
+ #ifndef VM_INSN_INFO_TABLE_IMPL
97
+ # define VM_INSN_INFO_TABLE_IMPL 2
98
+ #endif
91
99
 
92
100
  #if defined(NSIG_MAX) /* POSIX issue 8 */
93
101
  # undef NSIG
@@ -123,22 +131,15 @@
123
131
  /* define to 0 to test old code path */
124
132
  #define WAITPID_USE_SIGCHLD (RUBY_SIGCHLD || SIGCHLD_LOSSY)
125
133
 
126
- #ifdef HAVE_STDARG_PROTOTYPES
127
- #include <stdarg.h>
128
- #define va_init_list(a,b) va_start((a),(b))
129
- #else
130
- #include <varargs.h>
131
- #define va_init_list(a,b) va_start((a))
132
- #endif
133
-
134
134
  #if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__)
135
135
  # define USE_SIGALTSTACK
136
- void *rb_register_sigaltstack(void);
137
- # define RB_ALTSTACK_INIT(var) var = rb_register_sigaltstack()
136
+ void *rb_allocate_sigaltstack(void);
137
+ void *rb_register_sigaltstack(void *);
138
+ # define RB_ALTSTACK_INIT(var, altstack) var = rb_register_sigaltstack(altstack)
138
139
  # define RB_ALTSTACK_FREE(var) xfree(var)
139
140
  # define RB_ALTSTACK(var) var
140
141
  #else /* noop */
141
- # define RB_ALTSTACK_INIT(var)
142
+ # define RB_ALTSTACK_INIT(var, altstack)
142
143
  # define RB_ALTSTACK_FREE(var)
143
144
  # define RB_ALTSTACK(var) (0)
144
145
  #endif
@@ -220,10 +221,11 @@ typedef struct rb_compile_option_struct rb_compile_option_t;
220
221
  struct iseq_inline_cache_entry {
221
222
  rb_serial_t ic_serial;
222
223
  const rb_cref_t *ic_cref;
223
- union {
224
- size_t index;
225
- VALUE value;
226
- } ic_value;
224
+ VALUE value;
225
+ };
226
+
227
+ struct iseq_inline_iv_cache_entry {
228
+ struct rb_iv_index_tbl_entry *entry;
227
229
  };
228
230
 
229
231
  union iseq_inline_storage_entry {
@@ -232,26 +234,12 @@ union iseq_inline_storage_entry {
232
234
  VALUE value;
233
235
  } once;
234
236
  struct iseq_inline_cache_entry cache;
235
- };
236
-
237
- struct rb_call_info {
238
- /* fixed at compile time */
239
- ID mid;
240
- unsigned int flag;
241
- int orig_argc;
242
- };
243
-
244
- struct rb_call_info_kw_arg {
245
- int keyword_len;
246
- VALUE keywords[1];
247
- };
248
-
249
- struct rb_call_info_with_kwarg {
250
- struct rb_call_info ci;
251
- struct rb_call_info_kw_arg *kw_arg;
237
+ struct iseq_inline_iv_cache_entry iv_cache;
252
238
  };
253
239
 
254
240
  struct rb_calling_info {
241
+ const struct rb_callinfo *ci;
242
+ const struct rb_callcache *cc;
255
243
  VALUE block_handler;
256
244
  VALUE recv;
257
245
  int argc;
@@ -259,7 +247,6 @@ struct rb_calling_info {
259
247
  };
260
248
 
261
249
  struct rb_execution_context_struct;
262
- typedef VALUE (*vm_call_handler)(struct rb_execution_context_struct *ec, struct rb_control_frame_struct *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
263
250
 
264
251
  #if 1
265
252
  #define CoreDataFromValue(obj, type) (type*)DATA_PTR(obj)
@@ -417,12 +404,7 @@ struct rb_iseq_constant_body {
417
404
  struct rb_iseq_struct *local_iseq; /* local_iseq->flip_cnt can be modified */
418
405
 
419
406
  union iseq_inline_storage_entry *is_entries;
420
- struct rb_call_info *ci_entries; /* struct rb_call_info ci_entries[ci_size];
421
- * struct rb_call_info_with_kwarg cikw_entries[ci_kw_size];
422
- * So that:
423
- * struct rb_call_info_with_kwarg *cikw_entries = &body->ci_entries[ci_size];
424
- */
425
- struct rb_call_cache *cc_entries; /* size is ci_size + ci_kw_size */
407
+ struct rb_call_data *call_data; //struct rb_call_data calls[ci_size];
426
408
 
427
409
  struct {
428
410
  rb_snum_t flip_count;
@@ -434,10 +416,11 @@ struct rb_iseq_constant_body {
434
416
  unsigned int local_table_size;
435
417
  unsigned int is_size;
436
418
  unsigned int ci_size;
437
- unsigned int ci_kw_size;
438
419
  unsigned int stack_max; /* for stack overflow check */
439
420
 
440
421
  char catch_except_p; /* If a frame of this ISeq may catch exception, set TRUE */
422
+ bool builtin_inline_p; // This ISeq's builtin func is safe to be inlined by MJIT
423
+ struct rb_id_table *outer_variables;
441
424
 
442
425
  #if USE_MJIT
443
426
  /* The following fields are MJIT related info. */
@@ -493,6 +476,7 @@ rb_iseq_check(const rb_iseq_t *iseq)
493
476
  static inline const rb_iseq_t *
494
477
  def_iseq_ptr(rb_method_definition_t *def)
495
478
  {
479
+ //TODO: re-visit. to check the bug, enable this assertion.
496
480
  #if VM_CHECK_MODE > 0
497
481
  if (def->type != VM_METHOD_TYPE_ISEQ) rb_bug("def_iseq_ptr: not iseq (%d)", def->type);
498
482
  #endif
@@ -565,15 +549,37 @@ typedef struct rb_hook_list_struct {
565
549
  unsigned int running;
566
550
  } rb_hook_list_t;
567
551
 
552
+
553
+ // see builtin.h for definition
554
+ typedef const struct rb_builtin_function *RB_BUILTIN;
555
+
568
556
  typedef struct rb_vm_struct {
569
557
  VALUE self;
570
558
 
571
- rb_global_vm_lock_t gvl;
559
+ struct {
560
+ struct list_head set;
561
+ unsigned int cnt;
562
+ unsigned int blocking_cnt;
572
563
 
573
- struct rb_thread_struct *main_thread;
564
+ struct rb_ractor_struct *main_ractor;
565
+ struct rb_thread_struct *main_thread; // == vm->ractor.main_ractor->threads.main
574
566
 
575
- /* persists across uncontended GVL release/acquire for time slice */
576
- const struct rb_thread_struct *running_thread;
567
+ struct {
568
+ // monitor
569
+ rb_nativethread_lock_t lock;
570
+ struct rb_ractor_struct *lock_owner;
571
+ unsigned int lock_rec;
572
+
573
+ // barrier
574
+ bool barrier_waiting;
575
+ unsigned int barrier_cnt;
576
+ rb_nativethread_cond_t barrier_cond;
577
+
578
+ // join at exit
579
+ rb_nativethread_cond_t terminate_cond;
580
+ bool terminate_waiting;
581
+ } sync;
582
+ } ractor;
577
583
 
578
584
  #ifdef USE_SIGALTSTACK
579
585
  void *main_altstack;
@@ -584,9 +590,6 @@ typedef struct rb_vm_struct {
584
590
  struct list_head waiting_pids; /* PID > 0: <=> struct waitpid_state */
585
591
  struct list_head waiting_grps; /* PID <= 0: <=> struct waitpid_state */
586
592
  struct list_head waiting_fds; /* <=> struct waiting_fd */
587
- struct list_head living_threads;
588
- VALUE thgroup_default;
589
- int living_thread_num;
590
593
 
591
594
  /* set in single-threaded processes only: */
592
595
  volatile int ubf_async_safe;
@@ -594,9 +597,7 @@ typedef struct rb_vm_struct {
594
597
  unsigned int running: 1;
595
598
  unsigned int thread_abort_on_exception: 1;
596
599
  unsigned int thread_report_on_exception: 1;
597
-
598
- unsigned int safe_level_: 1;
599
- int sleeper;
600
+ unsigned int thread_ignore_deadlock: 1;
600
601
 
601
602
  /* object management */
602
603
  VALUE mark_object_ary;
@@ -616,18 +617,14 @@ typedef struct rb_vm_struct {
616
617
  /* signal */
617
618
  struct {
618
619
  VALUE cmd[RUBY_NSIG];
619
- unsigned char safe[RUBY_NSIG];
620
620
  } trap_list;
621
621
 
622
- /* hook */
623
- rb_hook_list_t global_hooks;
624
-
625
622
  /* relation table of ensure - rollback for callcc */
626
623
  struct st_table *ensure_rollback_table;
627
624
 
628
625
  /* postponed_job (async-signal-safe, NOT thread-safe) */
629
626
  struct rb_postponed_job_struct *postponed_job_buffer;
630
- int postponed_job_index;
627
+ rb_atomic_t postponed_job_index;
631
628
 
632
629
  int src_encoding_index;
633
630
 
@@ -635,7 +632,7 @@ typedef struct rb_vm_struct {
635
632
  struct list_head workqueue; /* <=> rb_workqueue_job.jnode */
636
633
  rb_nativethread_lock_t workqueue_lock;
637
634
 
638
- VALUE verbose, debug, orig_progname, progname;
635
+ VALUE orig_progname, progname;
639
636
  VALUE coverages;
640
637
  int coverage_mode;
641
638
 
@@ -648,6 +645,15 @@ typedef struct rb_vm_struct {
648
645
  VALUE *defined_strings;
649
646
  st_table *frozen_strings;
650
647
 
648
+ const struct rb_builtin_function *builtin_function_table;
649
+ int builtin_inline_index;
650
+
651
+ struct rb_id_table *negative_cme_table;
652
+
653
+ #if USE_VM_CLOCK
654
+ uint32_t clock;
655
+ #endif
656
+
651
657
  /* params */
652
658
  struct { /* size in byte */
653
659
  size_t thread_vm_stack_size;
@@ -753,7 +759,7 @@ typedef struct rb_control_frame_struct {
753
759
  const rb_iseq_t *iseq; /* cfp[2] */
754
760
  VALUE self; /* cfp[3] / block[0] */
755
761
  const VALUE *ep; /* cfp[4] / block[1] */
756
- const void *block_code; /* cfp[5] / block[2] */ /* iseq or ifunc */
762
+ const void *block_code; /* cfp[5] / block[2] */ /* iseq or ifunc or forwarded block handler */
757
763
  VALUE *__bp__; /* cfp[6] */ /* outside vm_push_frame, use vm_base_ptr instead. */
758
764
 
759
765
  #if VM_DEBUG_BP_CHECK
@@ -792,6 +798,7 @@ struct rb_vm_tag {
792
798
  rb_jmpbuf_t buf;
793
799
  struct rb_vm_tag *prev;
794
800
  enum ruby_tag_type state;
801
+ unsigned int lock_rec;
795
802
  };
796
803
 
797
804
  STATIC_ASSERT(rb_vm_tag_buf_offset, offsetof(struct rb_vm_tag, buf) > 0);
@@ -810,11 +817,6 @@ struct rb_unblock_callback {
810
817
 
811
818
  struct rb_mutex_struct;
812
819
 
813
- typedef struct rb_thread_list_struct{
814
- struct rb_thread_list_struct *next;
815
- struct rb_thread_struct *th;
816
- } rb_thread_list_t;
817
-
818
820
  typedef struct rb_ensure_entry {
819
821
  VALUE marker;
820
822
  VALUE (*e_proc)(VALUE);
@@ -830,7 +832,13 @@ typedef char rb_thread_id_string_t[sizeof(rb_nativethread_id_t) * 2 + 3];
830
832
 
831
833
  typedef struct rb_fiber_struct rb_fiber_t;
832
834
 
833
- typedef struct rb_execution_context_struct {
835
+ struct rb_waiting_list {
836
+ struct rb_waiting_list *next;
837
+ struct rb_thread_struct *thread;
838
+ struct rb_fiber_struct *fiber;
839
+ };
840
+
841
+ struct rb_execution_context_struct {
834
842
  /* execution information */
835
843
  VALUE *vm_stack; /* must free, must mark */
836
844
  size_t vm_stack_size; /* size in word (byte size / sizeof(VALUE)) */
@@ -842,12 +850,15 @@ typedef struct rb_execution_context_struct {
842
850
  /* interrupt flags */
843
851
  rb_atomic_t interrupt_flag;
844
852
  rb_atomic_t interrupt_mask; /* size should match flag */
853
+ #if USE_VM_CLOCK
854
+ uint32_t checked_clock;
855
+ #endif
845
856
 
846
857
  rb_fiber_t *fiber_ptr;
847
858
  struct rb_thread_struct *thread_ptr;
848
859
 
849
860
  /* storage (ec (fiber) local) */
850
- st_table *local_storage;
861
+ struct rb_id_table *local_storage;
851
862
  VALUE local_storage_recursive_hash;
852
863
  VALUE local_storage_recursive_hash_for_trace;
853
864
 
@@ -879,7 +890,15 @@ typedef struct rb_execution_context_struct {
879
890
  size_t stack_maxsize;
880
891
  RUBY_ALIGNAS(SIZEOF_VALUE) jmp_buf regs;
881
892
  } machine;
882
- } rb_execution_context_t;
893
+ };
894
+
895
+ #ifndef rb_execution_context_t
896
+ typedef struct rb_execution_context_struct rb_execution_context_t;
897
+ #define rb_execution_context_t rb_execution_context_t
898
+ #endif
899
+
900
+ // for builtin.h
901
+ #define VM_CORE_H_EC_DEFINED 1
883
902
 
884
903
  // Set the vm_stack pointer in the execution context.
885
904
  void rb_ec_set_vm_stack(rb_execution_context_t *ec, VALUE *stack, size_t size);
@@ -894,9 +913,16 @@ void rb_ec_initialize_vm_stack(rb_execution_context_t *ec, VALUE *stack, size_t
894
913
  // @param ec the execution context to update.
895
914
  void rb_ec_clear_vm_stack(rb_execution_context_t *ec);
896
915
 
916
+ struct rb_ext_config {
917
+ bool ractor_safe;
918
+ };
919
+
920
+ typedef struct rb_ractor_struct rb_ractor_t;
921
+
897
922
  typedef struct rb_thread_struct {
898
- struct list_node vmlt_node;
923
+ struct list_node lt_node; // managed by a ractor
899
924
  VALUE self;
925
+ rb_ractor_t *ractor;
900
926
  rb_vm_t *vm;
901
927
 
902
928
  rb_execution_context_t *ec;
@@ -945,7 +971,7 @@ typedef struct rb_thread_struct {
945
971
  VALUE locking_mutex;
946
972
  struct rb_mutex_struct *keeping_mutexes;
947
973
 
948
- rb_thread_list_t *join_list;
974
+ struct rb_waiting_list *join_list;
949
975
 
950
976
  union {
951
977
  struct {
@@ -959,9 +985,10 @@ typedef struct rb_thread_struct {
959
985
  } func;
960
986
  } invoke_arg;
961
987
 
962
- enum {
988
+ enum thread_invoke_type {
963
989
  thread_invoke_type_none = 0,
964
990
  thread_invoke_type_proc,
991
+ thread_invoke_type_ractor_proc,
965
992
  thread_invoke_type_func
966
993
  } invoke_type;
967
994
 
@@ -972,9 +999,17 @@ typedef struct rb_thread_struct {
972
999
  rb_fiber_t *root_fiber;
973
1000
  rb_jmpbuf_t root_jmpbuf;
974
1001
 
1002
+ VALUE scheduler;
1003
+ unsigned blocking;
1004
+
975
1005
  /* misc */
976
1006
  VALUE name;
977
1007
 
1008
+ struct rb_ext_config ext_config;
1009
+
1010
+ #ifdef USE_SIGALTSTACK
1011
+ void *altstack;
1012
+ #endif
978
1013
  } rb_thread_t;
979
1014
 
980
1015
  typedef enum {
@@ -996,11 +1031,13 @@ typedef enum {
996
1031
  RUBY_SYMBOL_EXPORT_BEGIN
997
1032
 
998
1033
  /* node -> iseq */
999
- rb_iseq_t *rb_iseq_new (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum iseq_type);
1000
- rb_iseq_t *rb_iseq_new_top (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent);
1001
- rb_iseq_t *rb_iseq_new_main (const rb_ast_body_t *ast, VALUE path, VALUE realpath, const rb_iseq_t *parent);
1002
- rb_iseq_t *rb_iseq_new_with_opt(const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, VALUE first_lineno,
1003
- const rb_iseq_t *parent, enum iseq_type, const rb_compile_option_t*);
1034
+ rb_iseq_t *rb_iseq_new (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum iseq_type);
1035
+ rb_iseq_t *rb_iseq_new_top (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent);
1036
+ rb_iseq_t *rb_iseq_new_main (const rb_ast_body_t *ast, VALUE path, VALUE realpath, const rb_iseq_t *parent);
1037
+ rb_iseq_t *rb_iseq_new_eval (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, VALUE first_lineno, const rb_iseq_t *parent, int isolated_depth);
1038
+ rb_iseq_t *rb_iseq_new_with_opt(const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, VALUE first_lineno, const rb_iseq_t *parent, int isolated_depth,
1039
+ enum iseq_type, const rb_compile_option_t*);
1040
+
1004
1041
  struct iseq_link_anchor;
1005
1042
  struct rb_iseq_new_with_callback_callback_func {
1006
1043
  VALUE flags;
@@ -1019,10 +1056,6 @@ rb_iseq_t *rb_iseq_new_with_callback(const struct rb_iseq_new_with_callback_call
1019
1056
  VALUE name, VALUE path, VALUE realpath, VALUE first_lineno,
1020
1057
  const rb_iseq_t *parent, enum iseq_type, const rb_compile_option_t*);
1021
1058
 
1022
- /* src -> iseq */
1023
- rb_iseq_t *rb_iseq_compile(VALUE src, VALUE file, VALUE line);
1024
- rb_iseq_t *rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE realpath, VALUE line, VALUE opt);
1025
-
1026
1059
  VALUE rb_iseq_disasm(const rb_iseq_t *iseq);
1027
1060
  int rb_iseq_disasm_insn(VALUE str, const VALUE *iseqval, size_t pos, const rb_iseq_t *iseq, VALUE child);
1028
1061
 
@@ -1041,8 +1074,13 @@ typedef struct {
1041
1074
  const struct rb_block block;
1042
1075
  unsigned int is_from_method: 1; /* bool */
1043
1076
  unsigned int is_lambda: 1; /* bool */
1077
+ unsigned int is_isolated: 1; /* bool */
1044
1078
  } rb_proc_t;
1045
1079
 
1080
+ VALUE rb_proc_isolate(VALUE self);
1081
+ VALUE rb_proc_isolate_bang(VALUE self);
1082
+ VALUE rb_proc_ractor_make_shareable(VALUE self);
1083
+
1046
1084
  typedef struct {
1047
1085
  VALUE flags; /* imemo header */
1048
1086
  rb_iseq_t *iseq;
@@ -1073,35 +1111,6 @@ enum vm_check_match_type {
1073
1111
  #define VM_CHECKMATCH_TYPE_MASK 0x03
1074
1112
  #define VM_CHECKMATCH_ARRAY 0x04
1075
1113
 
1076
- enum vm_call_flag_bits {
1077
- VM_CALL_ARGS_SPLAT_bit, /* m(*args) */
1078
- VM_CALL_ARGS_BLOCKARG_bit, /* m(&block) */
1079
- VM_CALL_FCALL_bit, /* m(...) */
1080
- VM_CALL_VCALL_bit, /* m */
1081
- VM_CALL_ARGS_SIMPLE_bit, /* (ci->flag & (SPLAT|BLOCKARG)) && blockiseq == NULL && ci->kw_arg == NULL */
1082
- VM_CALL_BLOCKISEQ_bit, /* has blockiseq */
1083
- VM_CALL_KWARG_bit, /* has kwarg */
1084
- VM_CALL_KW_SPLAT_bit, /* m(**opts) */
1085
- VM_CALL_TAILCALL_bit, /* located at tail position */
1086
- VM_CALL_SUPER_bit, /* super */
1087
- VM_CALL_ZSUPER_bit, /* zsuper */
1088
- VM_CALL_OPT_SEND_bit, /* internal flag */
1089
- VM_CALL__END
1090
- };
1091
-
1092
- #define VM_CALL_ARGS_SPLAT (0x01 << VM_CALL_ARGS_SPLAT_bit)
1093
- #define VM_CALL_ARGS_BLOCKARG (0x01 << VM_CALL_ARGS_BLOCKARG_bit)
1094
- #define VM_CALL_FCALL (0x01 << VM_CALL_FCALL_bit)
1095
- #define VM_CALL_VCALL (0x01 << VM_CALL_VCALL_bit)
1096
- #define VM_CALL_ARGS_SIMPLE (0x01 << VM_CALL_ARGS_SIMPLE_bit)
1097
- #define VM_CALL_BLOCKISEQ (0x01 << VM_CALL_BLOCKISEQ_bit)
1098
- #define VM_CALL_KWARG (0x01 << VM_CALL_KWARG_bit)
1099
- #define VM_CALL_KW_SPLAT (0x01 << VM_CALL_KW_SPLAT_bit)
1100
- #define VM_CALL_TAILCALL (0x01 << VM_CALL_TAILCALL_bit)
1101
- #define VM_CALL_SUPER (0x01 << VM_CALL_SUPER_bit)
1102
- #define VM_CALL_ZSUPER (0x01 << VM_CALL_ZSUPER_bit)
1103
- #define VM_CALL_OPT_SEND (0x01 << VM_CALL_OPT_SEND_bit)
1104
-
1105
1114
  enum vm_special_object_type {
1106
1115
  VM_SPECIAL_OBJECT_VMCORE = 1,
1107
1116
  VM_SPECIAL_OBJECT_CBASE,
@@ -1118,11 +1127,11 @@ enum vm_svar_index {
1118
1127
 
1119
1128
  /* inline cache */
1120
1129
  typedef struct iseq_inline_cache_entry *IC;
1130
+ typedef struct iseq_inline_iv_cache_entry *IVC;
1121
1131
  typedef union iseq_inline_storage_entry *ISE;
1122
- typedef struct rb_call_info *CALL_INFO;
1123
- typedef struct rb_call_cache *CALL_CACHE;
1124
-
1125
- void rb_vm_change_state(void);
1132
+ typedef const struct rb_callinfo *CALL_INFO;
1133
+ typedef const struct rb_callcache *CALL_CACHE;
1134
+ typedef struct rb_call_data *CALL_DATA;
1126
1135
 
1127
1136
  typedef VALUE CDHASH;
1128
1137
 
@@ -1142,11 +1151,11 @@ typedef rb_control_frame_t *
1142
1151
 
1143
1152
  enum {
1144
1153
  /* Frame/Environment flag bits:
1145
- * MMMM MMMM MMMM MMMM ____ FFFF FFFF EEEX (LSB)
1154
+ * MMMM MMMM MMMM MMMM ____ _FFF FFFF EEEX (LSB)
1146
1155
  *
1147
1156
  * X : tag for GC marking (It seems as Fixnum)
1148
1157
  * EEE : 3 bits Env flags
1149
- * FF..: 8 bits Frame flags
1158
+ * FF..: 7 bits Frame flags
1150
1159
  * MM..: 15 bits frame magic (to check frame corruption)
1151
1160
  */
1152
1161
 
@@ -1164,19 +1173,19 @@ enum {
1164
1173
  VM_FRAME_MAGIC_MASK = 0x7fff0001,
1165
1174
 
1166
1175
  /* frame flag */
1167
- VM_FRAME_FLAG_PASSED = 0x0010,
1168
1176
  VM_FRAME_FLAG_FINISH = 0x0020,
1169
1177
  VM_FRAME_FLAG_BMETHOD = 0x0040,
1170
1178
  VM_FRAME_FLAG_CFRAME = 0x0080,
1171
1179
  VM_FRAME_FLAG_LAMBDA = 0x0100,
1172
1180
  VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM = 0x0200,
1173
1181
  VM_FRAME_FLAG_CFRAME_KW = 0x0400,
1174
- VM_FRAME_FLAG_CFRAME_EMPTY_KW = 0x0800, /* -- Remove In 3.0 -- */
1182
+ VM_FRAME_FLAG_PASSED = 0x0800,
1175
1183
 
1176
1184
  /* env flag */
1177
1185
  VM_ENV_FLAG_LOCAL = 0x0002,
1178
1186
  VM_ENV_FLAG_ESCAPED = 0x0004,
1179
- VM_ENV_FLAG_WB_REQUIRED = 0x0008
1187
+ VM_ENV_FLAG_WB_REQUIRED = 0x0008,
1188
+ VM_ENV_FLAG_ISOLATED = 0x0010,
1180
1189
  };
1181
1190
 
1182
1191
  #define VM_ENV_DATA_SIZE ( 3)
@@ -1232,13 +1241,6 @@ VM_FRAME_CFRAME_KW_P(const rb_control_frame_t *cfp)
1232
1241
  return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_CFRAME_KW) != 0;
1233
1242
  }
1234
1243
 
1235
- /* -- Remove In 3.0 -- */
1236
- static inline int
1237
- VM_FRAME_CFRAME_EMPTY_KW_P(const rb_control_frame_t *cfp)
1238
- {
1239
- return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_CFRAME_EMPTY_KW) != 0;
1240
- }
1241
-
1242
1244
  static inline int
1243
1245
  VM_FRAME_FINISHED_P(const rb_control_frame_t *cfp)
1244
1246
  {
@@ -1485,6 +1487,12 @@ vm_block_handler_verify(MAYBE_UNUSED(VALUE block_handler))
1485
1487
  (vm_block_handler_type(block_handler), 1));
1486
1488
  }
1487
1489
 
1490
+ static inline int
1491
+ vm_cfp_forwarded_bh_p(const rb_control_frame_t *cfp, VALUE block_handler)
1492
+ {
1493
+ return ((VALUE) cfp->block_code) == block_handler;
1494
+ }
1495
+
1488
1496
  static inline enum rb_block_type
1489
1497
  vm_block_type(const struct rb_block *block)
1490
1498
  {
@@ -1624,7 +1632,7 @@ extern void rb_vmdebug_debug_print_post(const rb_execution_context_t *ec, const
1624
1632
  #define SDR() rb_vmdebug_stack_dump_raw(GET_EC(), GET_EC()->cfp)
1625
1633
  #define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_EC(), (cfp))
1626
1634
  void rb_vm_bugreport(const void *);
1627
- typedef RETSIGTYPE (*ruby_sighandler_t)(int);
1635
+ typedef void (*ruby_sighandler_t)(int);
1628
1636
  NORETURN(void rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int sig, const void *, const char *fmt, ...));
1629
1637
 
1630
1638
  /* functions about thread/vm execution */
@@ -1661,13 +1669,12 @@ VALUE rb_vm_env_local_variables(const rb_env_t *env);
1661
1669
  const rb_env_t *rb_vm_env_prev_env(const rb_env_t *env);
1662
1670
  const VALUE *rb_binding_add_dynavars(VALUE bindval, rb_binding_t *bind, int dyncount, const ID *dynvars);
1663
1671
  void rb_vm_inc_const_missing_count(void);
1664
- void rb_vm_gvl_destroy(rb_vm_t *vm);
1665
- VALUE rb_vm_call(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc,
1666
- const VALUE *argv, const rb_callable_method_entry_t *me);
1667
1672
  VALUE rb_vm_call_kw(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc,
1668
1673
  const VALUE *argv, const rb_callable_method_entry_t *me, int kw_splat);
1669
1674
  MJIT_STATIC void rb_vm_pop_frame(rb_execution_context_t *ec);
1670
1675
 
1676
+ void rb_gvl_destroy(rb_global_vm_lock_t *gvl);
1677
+
1671
1678
  void rb_thread_start_timer_thread(void);
1672
1679
  void rb_thread_stop_timer_thread(void);
1673
1680
  void rb_thread_reset_timer_thread(void);
@@ -1680,29 +1687,13 @@ rb_vm_living_threads_init(rb_vm_t *vm)
1680
1687
  list_head_init(&vm->waiting_pids);
1681
1688
  list_head_init(&vm->workqueue);
1682
1689
  list_head_init(&vm->waiting_grps);
1683
- list_head_init(&vm->living_threads);
1684
- vm->living_thread_num = 0;
1685
- }
1686
-
1687
- static inline void
1688
- rb_vm_living_threads_insert(rb_vm_t *vm, rb_thread_t *th)
1689
- {
1690
- list_add_tail(&vm->living_threads, &th->vmlt_node);
1691
- vm->living_thread_num++;
1692
- }
1693
-
1694
- static inline void
1695
- rb_vm_living_threads_remove(rb_vm_t *vm, rb_thread_t *th)
1696
- {
1697
- list_del(&th->vmlt_node);
1698
- vm->living_thread_num--;
1690
+ list_head_init(&vm->ractor.set);
1699
1691
  }
1700
1692
 
1701
1693
  typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE);
1702
1694
  rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp);
1703
1695
  rb_control_frame_t *rb_vm_get_binding_creatable_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp);
1704
1696
  int rb_vm_get_sourceline(const rb_control_frame_t *);
1705
- VALUE rb_name_err_mesg_new(VALUE mesg, VALUE recv, VALUE method);
1706
1697
  void rb_vm_stack_to_heap(rb_execution_context_t *ec);
1707
1698
  void ruby_thread_init_stack(rb_thread_t *th);
1708
1699
  int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, ID *called_idp, VALUE *klassp);
@@ -1722,27 +1713,29 @@ MJIT_STATIC const rb_callable_method_entry_t *rb_vm_frame_method_entry(const rb_
1722
1713
 
1723
1714
  #define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]
1724
1715
 
1725
- #define RUBY_CONST_ASSERT(expr) (1/!!(expr)) /* expr must be a compile-time constant */
1726
- #define VM_STACK_OVERFLOWED_P(cfp, sp, margin) \
1727
- (!RUBY_CONST_ASSERT(sizeof(*(sp)) == sizeof(VALUE)) || \
1728
- !RUBY_CONST_ASSERT(sizeof(*(cfp)) == sizeof(rb_control_frame_t)) || \
1729
- ((rb_control_frame_t *)((sp) + (margin)) + 1) >= (cfp))
1730
- #define WHEN_VM_STACK_OVERFLOWED(cfp, sp, margin) \
1731
- if (LIKELY(!VM_STACK_OVERFLOWED_P(cfp, sp, margin))) {(void)0;} else /* overflowed */
1732
- #define CHECK_VM_STACK_OVERFLOW0(cfp, sp, margin) \
1733
- WHEN_VM_STACK_OVERFLOWED(cfp, sp, margin) vm_stackoverflow()
1716
+ #define CHECK_VM_STACK_OVERFLOW0(cfp, sp, margin) do { \
1717
+ STATIC_ASSERT(sizeof_sp, sizeof(*(sp)) == sizeof(VALUE)); \
1718
+ STATIC_ASSERT(sizeof_cfp, sizeof(*(cfp)) == sizeof(rb_control_frame_t)); \
1719
+ const struct rb_control_frame_struct *bound = (void *)&(sp)[(margin)]; \
1720
+ if (UNLIKELY((cfp) <= &bound[1])) { \
1721
+ vm_stackoverflow(); \
1722
+ } \
1723
+ } while (0)
1724
+
1734
1725
  #define CHECK_VM_STACK_OVERFLOW(cfp, margin) \
1735
- WHEN_VM_STACK_OVERFLOWED(cfp, (cfp)->sp, margin) vm_stackoverflow()
1726
+ CHECK_VM_STACK_OVERFLOW0((cfp), (cfp)->sp, (margin))
1736
1727
 
1737
1728
  VALUE rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, enum ruby_tag_type *stateptr);
1738
1729
 
1730
+ rb_execution_context_t *rb_vm_main_ractor_ec(rb_vm_t *vm); // ractor.c
1731
+
1739
1732
  /* for thread */
1740
1733
 
1741
1734
  #if RUBY_VM_THREAD_MODEL == 2
1742
1735
  RUBY_SYMBOL_EXPORT_BEGIN
1743
1736
 
1737
+ RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c
1744
1738
  RUBY_EXTERN rb_vm_t *ruby_current_vm_ptr;
1745
- RUBY_EXTERN rb_execution_context_t *ruby_current_execution_context_ptr;
1746
1739
  RUBY_EXTERN rb_event_flag_t ruby_vm_event_flags;
1747
1740
  RUBY_EXTERN rb_event_flag_t ruby_vm_event_enabled_global_flags;
1748
1741
  RUBY_EXTERN unsigned int ruby_vm_event_local_num;
@@ -1750,6 +1743,7 @@ RUBY_EXTERN unsigned int ruby_vm_event_local_num;
1750
1743
  RUBY_SYMBOL_EXPORT_END
1751
1744
 
1752
1745
  #define GET_VM() rb_current_vm()
1746
+ #define GET_RACTOR() rb_current_ractor()
1753
1747
  #define GET_THREAD() rb_current_thread()
1754
1748
  #define GET_EC() rb_current_execution_context()
1755
1749
 
@@ -1759,6 +1753,19 @@ rb_ec_thread_ptr(const rb_execution_context_t *ec)
1759
1753
  return ec->thread_ptr;
1760
1754
  }
1761
1755
 
1756
+ static inline rb_ractor_t *
1757
+ rb_ec_ractor_ptr(const rb_execution_context_t *ec)
1758
+ {
1759
+ const rb_thread_t *th = rb_ec_thread_ptr(ec);
1760
+ if (th) {
1761
+ VM_ASSERT(th->ractor != NULL);
1762
+ return th->ractor;
1763
+ }
1764
+ else {
1765
+ return NULL;
1766
+ }
1767
+ }
1768
+
1762
1769
  static inline rb_vm_t *
1763
1770
  rb_ec_vm_ptr(const rb_execution_context_t *ec)
1764
1771
  {
@@ -1774,7 +1781,17 @@ rb_ec_vm_ptr(const rb_execution_context_t *ec)
1774
1781
  static inline rb_execution_context_t *
1775
1782
  rb_current_execution_context(void)
1776
1783
  {
1777
- return ruby_current_execution_context_ptr;
1784
+ #ifdef RB_THREAD_LOCAL_SPECIFIER
1785
+ #if __APPLE__
1786
+ rb_execution_context_t *ec = rb_current_ec();
1787
+ #else
1788
+ rb_execution_context_t *ec = ruby_current_ec;
1789
+ #endif
1790
+ #else
1791
+ rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key);
1792
+ #endif
1793
+ VM_ASSERT(ec != NULL);
1794
+ return ec;
1778
1795
  }
1779
1796
 
1780
1797
  static inline rb_thread_t *
@@ -1784,30 +1801,47 @@ rb_current_thread(void)
1784
1801
  return rb_ec_thread_ptr(ec);
1785
1802
  }
1786
1803
 
1804
+ static inline rb_ractor_t *
1805
+ rb_current_ractor(void)
1806
+ {
1807
+ if (ruby_single_main_ractor) {
1808
+ return ruby_single_main_ractor;
1809
+ }
1810
+ else {
1811
+ const rb_execution_context_t *ec = GET_EC();
1812
+ return rb_ec_ractor_ptr(ec);
1813
+ }
1814
+ }
1815
+
1787
1816
  static inline rb_vm_t *
1788
1817
  rb_current_vm(void)
1789
1818
  {
1819
+ #if 0 // TODO: reconsider the assertions
1790
1820
  VM_ASSERT(ruby_current_vm_ptr == NULL ||
1791
1821
  ruby_current_execution_context_ptr == NULL ||
1792
1822
  rb_ec_thread_ptr(GET_EC()) == NULL ||
1823
+ rb_ec_thread_ptr(GET_EC())->status == THREAD_KILLED ||
1793
1824
  rb_ec_vm_ptr(GET_EC()) == ruby_current_vm_ptr);
1825
+ #endif
1826
+
1794
1827
  return ruby_current_vm_ptr;
1795
1828
  }
1796
1829
 
1797
- static inline void
1798
- rb_thread_set_current_raw(const rb_thread_t *th)
1799
- {
1800
- ruby_current_execution_context_ptr = th->ec;
1801
- }
1830
+ void rb_ec_vm_lock_rec_release(const rb_execution_context_t *ec,
1831
+ unsigned int recorded_lock_rec,
1832
+ unsigned int current_lock_rec);
1802
1833
 
1803
- static inline void
1804
- rb_thread_set_current(rb_thread_t *th)
1834
+ static inline unsigned int
1835
+ rb_ec_vm_lock_rec(const rb_execution_context_t *ec)
1805
1836
  {
1806
- if (th->vm->running_thread != th) {
1807
- th->running_time_us = 0;
1837
+ rb_vm_t *vm = rb_ec_vm_ptr(ec);
1838
+
1839
+ if (vm->ractor.sync.lock_owner != rb_ec_ractor_ptr(ec)) {
1840
+ return 0;
1841
+ }
1842
+ else {
1843
+ return vm->ractor.sync.lock_rec;
1808
1844
  }
1809
- rb_thread_set_current_raw(th);
1810
- th->vm->running_thread = th;
1811
1845
  }
1812
1846
 
1813
1847
  #else
@@ -1818,16 +1852,33 @@ enum {
1818
1852
  TIMER_INTERRUPT_MASK = 0x01,
1819
1853
  PENDING_INTERRUPT_MASK = 0x02,
1820
1854
  POSTPONED_JOB_INTERRUPT_MASK = 0x04,
1821
- TRAP_INTERRUPT_MASK = 0x08
1855
+ TRAP_INTERRUPT_MASK = 0x08,
1856
+ TERMINATE_INTERRUPT_MASK = 0x10,
1857
+ VM_BARRIER_INTERRUPT_MASK = 0x20,
1822
1858
  };
1823
1859
 
1824
1860
  #define RUBY_VM_SET_TIMER_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TIMER_INTERRUPT_MASK)
1825
1861
  #define RUBY_VM_SET_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, PENDING_INTERRUPT_MASK)
1826
1862
  #define RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, POSTPONED_JOB_INTERRUPT_MASK)
1827
1863
  #define RUBY_VM_SET_TRAP_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TRAP_INTERRUPT_MASK)
1864
+ #define RUBY_VM_SET_TERMINATE_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TERMINATE_INTERRUPT_MASK)
1865
+ #define RUBY_VM_SET_VM_BARRIER_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, VM_BARRIER_INTERRUPT_MASK)
1828
1866
  #define RUBY_VM_INTERRUPTED(ec) ((ec)->interrupt_flag & ~(ec)->interrupt_mask & \
1829
1867
  (PENDING_INTERRUPT_MASK|TRAP_INTERRUPT_MASK))
1830
- #define RUBY_VM_INTERRUPTED_ANY(ec) ((ec)->interrupt_flag & ~(ec)->interrupt_mask)
1868
+
1869
+ static inline bool
1870
+ RUBY_VM_INTERRUPTED_ANY(rb_execution_context_t *ec)
1871
+ {
1872
+ #if USE_VM_CLOCK
1873
+ uint32_t current_clock = rb_ec_vm_ptr(ec)->clock;
1874
+
1875
+ if (current_clock != ec->checked_clock) {
1876
+ ec->checked_clock = current_clock;
1877
+ RUBY_VM_SET_TIMER_INTERRUPT(ec);
1878
+ }
1879
+ #endif
1880
+ return ec->interrupt_flag & ~(ec)->interrupt_mask;
1881
+ }
1831
1882
 
1832
1883
  VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt);
1833
1884
  int rb_signal_buff_size(void);
@@ -1840,11 +1891,17 @@ void rb_threadptr_interrupt(rb_thread_t *th);
1840
1891
  void rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th);
1841
1892
  void rb_threadptr_pending_interrupt_clear(rb_thread_t *th);
1842
1893
  void rb_threadptr_pending_interrupt_enque(rb_thread_t *th, VALUE v);
1894
+ VALUE rb_ec_get_errinfo(const rb_execution_context_t *ec);
1843
1895
  void rb_ec_error_print(rb_execution_context_t * volatile ec, volatile VALUE errinfo);
1844
1896
  void rb_execution_context_update(const rb_execution_context_t *ec);
1845
1897
  void rb_execution_context_mark(const rb_execution_context_t *ec);
1846
1898
  void rb_fiber_close(rb_fiber_t *fib);
1847
1899
  void Init_native_thread(rb_thread_t *th);
1900
+ int rb_vm_check_ints_blocking(rb_execution_context_t *ec);
1901
+
1902
+ // vm_sync.h
1903
+ void rb_vm_cond_wait(rb_vm_t *vm, rb_nativethread_cond_t *cond);
1904
+ void rb_vm_cond_timedwait(rb_vm_t *vm, rb_nativethread_cond_t *cond, unsigned long msec);
1848
1905
 
1849
1906
  #define RUBY_VM_CHECK_INTS(ec) rb_vm_check_ints(ec)
1850
1907
  static inline void
@@ -1913,17 +1970,24 @@ rb_exec_event_hook_orig(rb_execution_context_t *ec, rb_hook_list_t *hooks, rb_ev
1913
1970
  rb_exec_event_hooks(&trace_arg, hooks, pop_p);
1914
1971
  }
1915
1972
 
1973
+ struct rb_ractor_pub {
1974
+ VALUE self;
1975
+ uint32_t id;
1976
+ rb_hook_list_t hooks;
1977
+ };
1978
+
1916
1979
  static inline rb_hook_list_t *
1917
- rb_vm_global_hooks(const rb_execution_context_t *ec)
1980
+ rb_ec_ractor_hooks(const rb_execution_context_t *ec)
1918
1981
  {
1919
- return &rb_ec_vm_ptr(ec)->global_hooks;
1982
+ struct rb_ractor_pub *cr_pub = (struct rb_ractor_pub *)rb_ec_ractor_ptr(ec);
1983
+ return &cr_pub->hooks;
1920
1984
  }
1921
1985
 
1922
1986
  #define EXEC_EVENT_HOOK(ec_, flag_, self_, id_, called_id_, klass_, data_) \
1923
- EXEC_EVENT_HOOK_ORIG(ec_, rb_vm_global_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 0)
1987
+ EXEC_EVENT_HOOK_ORIG(ec_, rb_ec_ractor_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 0)
1924
1988
 
1925
1989
  #define EXEC_EVENT_HOOK_AND_POP_FRAME(ec_, flag_, self_, id_, called_id_, klass_, data_) \
1926
- EXEC_EVENT_HOOK_ORIG(ec_, rb_vm_global_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 1)
1990
+ EXEC_EVENT_HOOK_ORIG(ec_, rb_ec_ractor_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 1)
1927
1991
 
1928
1992
  static inline void
1929
1993
  rb_exec_event_hook_script_compiled(rb_execution_context_t *ec, const rb_iseq_t *iseq, VALUE eval_script)
@@ -1950,6 +2014,10 @@ extern void rb_reset_coverages(void);
1950
2014
 
1951
2015
  void rb_postponed_job_flush(rb_vm_t *vm);
1952
2016
 
2017
+ // ractor.c
2018
+ RUBY_EXTERN VALUE rb_eRactorUnsafeError;
2019
+ RUBY_EXTERN VALUE rb_eRactorIsolationError;
2020
+
1953
2021
  RUBY_SYMBOL_EXPORT_END
1954
2022
 
1955
2023
  #endif /* RUBY_VM_CORE_H */