datadog-ruby_core_source 3.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (732) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/publish.yml +18 -0
  3. data/.gitignore +7 -0
  4. data/.idea/vcs.xml +28 -0
  5. data/CHANGELOG.datadog.md +4 -0
  6. data/CHANGELOG.md +284 -0
  7. data/CONTRIBUTING.md +2 -0
  8. data/Gemfile +4 -0
  9. data/LEGAL +534 -0
  10. data/LICENSE.txt +22 -0
  11. data/README.md +39 -0
  12. data/RUBY_LICENSE +56 -0
  13. data/Rakefile +73 -0
  14. data/datadog-ruby_core_source.gemspec +21 -0
  15. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/addr2line.h +21 -0
  16. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/ccan/build_assert/build_assert.h +40 -0
  17. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/ccan/check_type/check_type.h +63 -0
  18. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/ccan/container_of/container_of.h +142 -0
  19. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/ccan/list/list.h +773 -0
  20. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/ccan/str/str.h +16 -0
  21. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/constant.h +50 -0
  22. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/debug_counter.h +109 -0
  23. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/dln.h +51 -0
  24. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/encindex.h +69 -0
  25. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/eval_intern.h +334 -0
  26. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/gc.h +116 -0
  27. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/id.h +250 -0
  28. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/id_table.h +31 -0
  29. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/insns.inc +217 -0
  30. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/insns_info.inc +1570 -0
  31. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/internal.h +2035 -0
  32. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/iseq.h +307 -0
  33. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/known_errors.inc +746 -0
  34. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/method.h +218 -0
  35. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/node.h +540 -0
  36. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/node_name.inc +198 -0
  37. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/opt_sc.inc +1601 -0
  38. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/optinsn.inc +103 -0
  39. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/optunifs.inc +61 -0
  40. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/parse.h +206 -0
  41. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/probes_helper.h +43 -0
  42. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/regenc.h +254 -0
  43. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/regint.h +938 -0
  44. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/regparse.h +370 -0
  45. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/revision.h +1 -0
  46. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/ruby_assert.h +54 -0
  47. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/ruby_atomic.h +233 -0
  48. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/siphash.h +48 -0
  49. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/symbol.h +108 -0
  50. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/thread_pthread.h +54 -0
  51. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/thread_win32.h +36 -0
  52. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/timev.h +42 -0
  53. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/transcode_data.h +139 -0
  54. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/version.h +73 -0
  55. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/vm.inc +3667 -0
  56. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/vm_call_iseq_optimized.inc +213 -0
  57. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/vm_core.h +1769 -0
  58. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/vm_debug.h +37 -0
  59. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/vm_exec.h +192 -0
  60. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/vm_insnhelper.h +255 -0
  61. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/vm_opts.h +56 -0
  62. data/lib/datadog/ruby_core_source/ruby-2.5.0-p0/vmtc.inc +214 -0
  63. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/addr2line.h +21 -0
  64. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/ccan/build_assert/build_assert.h +40 -0
  65. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/ccan/check_type/check_type.h +63 -0
  66. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/ccan/container_of/container_of.h +142 -0
  67. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/ccan/list/list.h +773 -0
  68. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/ccan/str/str.h +16 -0
  69. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/constant.h +51 -0
  70. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/debug_counter.h +109 -0
  71. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/dln.h +51 -0
  72. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/encindex.h +69 -0
  73. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/eval_intern.h +334 -0
  74. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/gc.h +116 -0
  75. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/id.h +250 -0
  76. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/id_table.h +31 -0
  77. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/insns.inc +217 -0
  78. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/insns_info.inc +1570 -0
  79. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/internal.h +2036 -0
  80. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/iseq.h +307 -0
  81. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/known_errors.inc +746 -0
  82. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/method.h +218 -0
  83. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/node.h +540 -0
  84. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/node_name.inc +198 -0
  85. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/opt_sc.inc +1601 -0
  86. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/optinsn.inc +103 -0
  87. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/optunifs.inc +61 -0
  88. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/parse.h +206 -0
  89. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/probes_helper.h +43 -0
  90. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/regenc.h +254 -0
  91. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/regint.h +938 -0
  92. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/regparse.h +370 -0
  93. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/revision.h +1 -0
  94. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/ruby_assert.h +54 -0
  95. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/ruby_atomic.h +233 -0
  96. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/siphash.h +48 -0
  97. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/symbol.h +108 -0
  98. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/thread_pthread.h +54 -0
  99. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/thread_win32.h +36 -0
  100. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/timev.h +42 -0
  101. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/transcode_data.h +139 -0
  102. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/version.h +73 -0
  103. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/vm.inc +3667 -0
  104. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/vm_call_iseq_optimized.inc +213 -0
  105. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/vm_core.h +1767 -0
  106. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/vm_debug.h +37 -0
  107. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/vm_exec.h +192 -0
  108. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/vm_insnhelper.h +255 -0
  109. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/vm_opts.h +56 -0
  110. data/lib/datadog/ruby_core_source/ruby-2.5.1-p57/vmtc.inc +214 -0
  111. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/addr2line.h +21 -0
  112. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/ccan/build_assert/build_assert.h +40 -0
  113. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/ccan/check_type/check_type.h +63 -0
  114. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/ccan/container_of/container_of.h +142 -0
  115. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/ccan/list/list.h +773 -0
  116. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/ccan/str/str.h +16 -0
  117. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/constant.h +51 -0
  118. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/debug_counter.h +109 -0
  119. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/dln.h +51 -0
  120. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/encindex.h +69 -0
  121. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/eval_intern.h +334 -0
  122. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/gc.h +116 -0
  123. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/id.h +250 -0
  124. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/id_table.h +31 -0
  125. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/insns.inc +217 -0
  126. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/insns_info.inc +1570 -0
  127. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/internal.h +2036 -0
  128. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/iseq.h +308 -0
  129. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/known_errors.inc +746 -0
  130. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/method.h +218 -0
  131. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/node.h +540 -0
  132. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/node_name.inc +198 -0
  133. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/opt_sc.inc +1601 -0
  134. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/optinsn.inc +103 -0
  135. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/optunifs.inc +61 -0
  136. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/parse.h +200 -0
  137. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/probes_helper.h +43 -0
  138. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/regenc.h +254 -0
  139. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/regint.h +938 -0
  140. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/regparse.h +370 -0
  141. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/revision.h +1 -0
  142. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/ruby_assert.h +54 -0
  143. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/ruby_atomic.h +233 -0
  144. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/siphash.h +48 -0
  145. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/symbol.h +108 -0
  146. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/thread_pthread.h +54 -0
  147. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/thread_win32.h +36 -0
  148. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/timev.h +42 -0
  149. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/transcode_data.h +139 -0
  150. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/version.h +73 -0
  151. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/vm.inc +3667 -0
  152. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/vm_call_iseq_optimized.inc +213 -0
  153. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/vm_core.h +1768 -0
  154. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/vm_debug.h +37 -0
  155. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/vm_exec.h +192 -0
  156. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/vm_insnhelper.h +255 -0
  157. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/vm_opts.h +56 -0
  158. data/lib/datadog/ruby_core_source/ruby-2.5.4-p155/vmtc.inc +214 -0
  159. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/addr2line.h +22 -0
  160. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/builtin.h +117 -0
  161. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/ccan/build_assert/build_assert.h +40 -0
  162. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/ccan/check_type/check_type.h +63 -0
  163. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/ccan/container_of/container_of.h +142 -0
  164. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/ccan/list/list.h +791 -0
  165. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/ccan/str/str.h +17 -0
  166. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/constant.h +53 -0
  167. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/darray.h +246 -0
  168. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/debug_counter.h +423 -0
  169. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/dln.h +32 -0
  170. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/encindex.h +70 -0
  171. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/eval_intern.h +343 -0
  172. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/hrtime.h +227 -0
  173. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/id.h +343 -0
  174. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/id_table.h +39 -0
  175. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/insns.inc +251 -0
  176. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/insns_info.inc +9215 -0
  177. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/array.h +151 -0
  178. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/basic_operators.h +63 -0
  179. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/bignum.h +244 -0
  180. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/bits.h +568 -0
  181. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/class.h +276 -0
  182. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/cmdlineopt.h +65 -0
  183. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/compar.h +29 -0
  184. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/compile.h +34 -0
  185. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/compilers.h +107 -0
  186. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/complex.h +29 -0
  187. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/cont.h +35 -0
  188. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/dir.h +16 -0
  189. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/enc.h +19 -0
  190. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/encoding.h +35 -0
  191. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/enum.h +18 -0
  192. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/enumerator.h +21 -0
  193. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/error.h +216 -0
  194. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/eval.h +32 -0
  195. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/file.h +38 -0
  196. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/fixnum.h +184 -0
  197. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/gc.h +364 -0
  198. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/hash.h +191 -0
  199. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/imemo.h +240 -0
  200. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/inits.h +50 -0
  201. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/io.h +137 -0
  202. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/load.h +18 -0
  203. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/loadpath.h +16 -0
  204. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/math.h +23 -0
  205. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/missing.h +18 -0
  206. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/numeric.h +273 -0
  207. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/object.h +60 -0
  208. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/parse.h +108 -0
  209. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/proc.h +30 -0
  210. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/process.h +124 -0
  211. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/ractor.h +6 -0
  212. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/random.h +17 -0
  213. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/range.h +40 -0
  214. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/rational.h +71 -0
  215. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/re.h +28 -0
  216. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/ruby_parser.h +69 -0
  217. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/sanitizers.h +186 -0
  218. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/serial.h +23 -0
  219. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/signal.h +25 -0
  220. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/static_assert.h +16 -0
  221. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/string.h +159 -0
  222. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/struct.h +127 -0
  223. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/symbol.h +45 -0
  224. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/thread.h +78 -0
  225. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/time.h +34 -0
  226. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/transcode.h +23 -0
  227. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/util.h +27 -0
  228. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/variable.h +72 -0
  229. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/vm.h +136 -0
  230. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal/warnings.h +16 -0
  231. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/internal.h +112 -0
  232. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/iseq.h +338 -0
  233. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/known_errors.inc +791 -0
  234. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/method.h +254 -0
  235. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/node.h +128 -0
  236. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/node_name.inc +212 -0
  237. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/optinsn.inc +128 -0
  238. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/optunifs.inc +43 -0
  239. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/parse.h +243 -0
  240. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/parser_bits.h +564 -0
  241. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/parser_node.h +32 -0
  242. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/parser_st.h +162 -0
  243. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/parser_value.h +106 -0
  244. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/ast.h +4612 -0
  245. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/defines.h +94 -0
  246. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/diagnostic.h +297 -0
  247. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/encoding.h +248 -0
  248. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/extension.h +18 -0
  249. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/node.h +57 -0
  250. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/options.h +204 -0
  251. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/pack.h +152 -0
  252. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/parser.h +716 -0
  253. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/prettyprint.h +26 -0
  254. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/prism.h +272 -0
  255. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/regexp.h +33 -0
  256. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/util/pm_buffer.h +146 -0
  257. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/util/pm_char.h +205 -0
  258. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/util/pm_constant_pool.h +191 -0
  259. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/util/pm_list.h +97 -0
  260. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/util/pm_memchr.h +29 -0
  261. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/util/pm_newline_list.h +104 -0
  262. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/util/pm_state_stack.h +42 -0
  263. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/util/pm_string.h +150 -0
  264. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/util/pm_string_list.h +44 -0
  265. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/util/pm_strncasecmp.h +32 -0
  266. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/util/pm_strpbrk.h +43 -0
  267. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism/version.h +29 -0
  268. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/prism_compile.h +29 -0
  269. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/probes_helper.h +42 -0
  270. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/ractor_core.h +393 -0
  271. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/regenc.h +254 -0
  272. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/regint.h +1004 -0
  273. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/regparse.h +371 -0
  274. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/revision.h +5 -0
  275. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/rjit.h +101 -0
  276. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/rjit_c.h +164 -0
  277. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/ruby_assert.h +14 -0
  278. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/ruby_atomic.h +23 -0
  279. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/rubyparser.h +1403 -0
  280. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/shape.h +232 -0
  281. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/siphash.h +48 -0
  282. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/symbol.h +118 -0
  283. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/thread_none.h +21 -0
  284. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/thread_pthread.h +166 -0
  285. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/thread_win32.h +58 -0
  286. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/timev.h +58 -0
  287. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/transcode_data.h +138 -0
  288. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/variable.h +39 -0
  289. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/version.h +69 -0
  290. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/vm.inc +5436 -0
  291. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/vm_call_iseq_optimized.inc +244 -0
  292. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/vm_callinfo.h +619 -0
  293. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/vm_core.h +2201 -0
  294. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/vm_debug.h +122 -0
  295. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/vm_exec.h +199 -0
  296. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/vm_insnhelper.h +261 -0
  297. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/vm_opts.h +67 -0
  298. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/vm_sync.h +137 -0
  299. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/vmtc.inc +245 -0
  300. data/lib/datadog/ruby_core_source/ruby-3.3.0-p0/yjit.h +72 -0
  301. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/addr2line.h +22 -0
  302. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/builtin.h +117 -0
  303. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/ccan/build_assert/build_assert.h +40 -0
  304. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/ccan/check_type/check_type.h +63 -0
  305. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/ccan/container_of/container_of.h +142 -0
  306. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/ccan/list/list.h +791 -0
  307. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/ccan/str/str.h +17 -0
  308. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/constant.h +53 -0
  309. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/darray.h +246 -0
  310. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/debug_counter.h +423 -0
  311. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/dln.h +32 -0
  312. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/encindex.h +70 -0
  313. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/eval_intern.h +343 -0
  314. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/hrtime.h +227 -0
  315. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/id.h +343 -0
  316. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/id_table.h +39 -0
  317. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/insns.inc +251 -0
  318. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/insns_info.inc +9215 -0
  319. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/array.h +151 -0
  320. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/basic_operators.h +63 -0
  321. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/bignum.h +244 -0
  322. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/bits.h +568 -0
  323. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/class.h +277 -0
  324. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/cmdlineopt.h +65 -0
  325. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/compar.h +29 -0
  326. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/compile.h +34 -0
  327. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/compilers.h +107 -0
  328. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/complex.h +29 -0
  329. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/cont.h +35 -0
  330. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/dir.h +16 -0
  331. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/enc.h +19 -0
  332. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/encoding.h +35 -0
  333. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/enum.h +18 -0
  334. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/enumerator.h +21 -0
  335. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/error.h +216 -0
  336. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/eval.h +33 -0
  337. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/file.h +38 -0
  338. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/fixnum.h +184 -0
  339. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/gc.h +364 -0
  340. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/hash.h +191 -0
  341. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/imemo.h +240 -0
  342. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/inits.h +50 -0
  343. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/io.h +137 -0
  344. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/load.h +18 -0
  345. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/loadpath.h +16 -0
  346. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/math.h +23 -0
  347. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/missing.h +18 -0
  348. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/numeric.h +273 -0
  349. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/object.h +62 -0
  350. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/parse.h +108 -0
  351. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/proc.h +30 -0
  352. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/process.h +124 -0
  353. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/ractor.h +6 -0
  354. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/random.h +17 -0
  355. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/range.h +40 -0
  356. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/rational.h +71 -0
  357. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/re.h +28 -0
  358. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/ruby_parser.h +69 -0
  359. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/sanitizers.h +186 -0
  360. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/serial.h +23 -0
  361. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/signal.h +25 -0
  362. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/static_assert.h +16 -0
  363. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/string.h +160 -0
  364. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/struct.h +127 -0
  365. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/symbol.h +45 -0
  366. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/thread.h +78 -0
  367. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/time.h +34 -0
  368. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/transcode.h +23 -0
  369. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/util.h +27 -0
  370. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/variable.h +72 -0
  371. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/vm.h +136 -0
  372. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal/warnings.h +16 -0
  373. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/internal.h +112 -0
  374. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/iseq.h +338 -0
  375. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/known_errors.inc +791 -0
  376. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/method.h +254 -0
  377. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/node.h +128 -0
  378. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/node_name.inc +212 -0
  379. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/optinsn.inc +128 -0
  380. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/optunifs.inc +43 -0
  381. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/parse.h +243 -0
  382. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/parser_bits.h +564 -0
  383. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/parser_node.h +32 -0
  384. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/parser_st.h +162 -0
  385. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/parser_value.h +106 -0
  386. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/ast.h +4612 -0
  387. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/defines.h +94 -0
  388. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/diagnostic.h +297 -0
  389. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/encoding.h +248 -0
  390. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/extension.h +18 -0
  391. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/node.h +57 -0
  392. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/options.h +204 -0
  393. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/pack.h +152 -0
  394. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/parser.h +716 -0
  395. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/prettyprint.h +26 -0
  396. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/prism.h +272 -0
  397. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/regexp.h +33 -0
  398. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_buffer.h +146 -0
  399. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_char.h +205 -0
  400. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_constant_pool.h +191 -0
  401. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_list.h +97 -0
  402. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_memchr.h +29 -0
  403. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_newline_list.h +104 -0
  404. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_state_stack.h +42 -0
  405. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_string.h +150 -0
  406. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_string_list.h +44 -0
  407. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_strncasecmp.h +32 -0
  408. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/util/pm_strpbrk.h +43 -0
  409. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism/version.h +29 -0
  410. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/prism_compile.h +29 -0
  411. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/probes_helper.h +42 -0
  412. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/ractor_core.h +393 -0
  413. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/regenc.h +254 -0
  414. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/regint.h +1006 -0
  415. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/regparse.h +371 -0
  416. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/revision.h +5 -0
  417. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/rjit.h +101 -0
  418. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/rjit_c.h +164 -0
  419. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/ruby_assert.h +14 -0
  420. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/ruby_atomic.h +23 -0
  421. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/rubyparser.h +1405 -0
  422. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/shape.h +233 -0
  423. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/siphash.h +48 -0
  424. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/symbol.h +118 -0
  425. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/thread_none.h +21 -0
  426. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/thread_pthread.h +166 -0
  427. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/thread_win32.h +58 -0
  428. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/timev.h +58 -0
  429. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/transcode_data.h +138 -0
  430. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/variable.h +39 -0
  431. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/version.h +69 -0
  432. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/vm.inc +5436 -0
  433. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/vm_call_iseq_optimized.inc +244 -0
  434. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/vm_callinfo.h +614 -0
  435. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/vm_core.h +2202 -0
  436. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/vm_debug.h +122 -0
  437. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/vm_exec.h +199 -0
  438. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/vm_insnhelper.h +261 -0
  439. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/vm_opts.h +67 -0
  440. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/vm_sync.h +137 -0
  441. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/vmtc.inc +245 -0
  442. data/lib/datadog/ruby_core_source/ruby-3.3.5-p100/yjit.h +72 -0
  443. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/addr2line.h +22 -0
  444. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/builtin.h +119 -0
  445. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/ccan/build_assert/build_assert.h +40 -0
  446. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/ccan/check_type/check_type.h +63 -0
  447. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/ccan/container_of/container_of.h +142 -0
  448. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/ccan/list/list.h +791 -0
  449. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/ccan/str/str.h +17 -0
  450. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/constant.h +53 -0
  451. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/darray.h +191 -0
  452. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/debug_counter.h +423 -0
  453. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/dln.h +34 -0
  454. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/encindex.h +70 -0
  455. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/eval_intern.h +324 -0
  456. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/hrtime.h +237 -0
  457. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/id.h +343 -0
  458. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/id_table.h +39 -0
  459. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/insns.inc +259 -0
  460. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/insns_info.inc +9530 -0
  461. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/array.h +151 -0
  462. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/basic_operators.h +63 -0
  463. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/bignum.h +244 -0
  464. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/bits.h +568 -0
  465. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/class.h +283 -0
  466. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/cmdlineopt.h +65 -0
  467. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/compar.h +29 -0
  468. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/compile.h +34 -0
  469. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/compilers.h +107 -0
  470. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/complex.h +29 -0
  471. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/cont.h +35 -0
  472. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/dir.h +16 -0
  473. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/enc.h +19 -0
  474. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/encoding.h +36 -0
  475. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/enum.h +18 -0
  476. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/enumerator.h +21 -0
  477. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/error.h +216 -0
  478. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/eval.h +33 -0
  479. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/file.h +38 -0
  480. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/fixnum.h +184 -0
  481. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/gc.h +334 -0
  482. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/hash.h +191 -0
  483. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/imemo.h +260 -0
  484. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/inits.h +47 -0
  485. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/io.h +140 -0
  486. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/load.h +18 -0
  487. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/loadpath.h +16 -0
  488. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/math.h +23 -0
  489. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/missing.h +19 -0
  490. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/numeric.h +274 -0
  491. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/object.h +63 -0
  492. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/parse.h +117 -0
  493. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/proc.h +30 -0
  494. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/process.h +124 -0
  495. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/ractor.h +6 -0
  496. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/random.h +17 -0
  497. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/range.h +40 -0
  498. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/rational.h +71 -0
  499. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/re.h +28 -0
  500. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/ruby_parser.h +102 -0
  501. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/sanitizers.h +297 -0
  502. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/serial.h +23 -0
  503. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/signal.h +24 -0
  504. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/st.h +11 -0
  505. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/static_assert.h +16 -0
  506. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/string.h +182 -0
  507. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/struct.h +127 -0
  508. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/symbol.h +45 -0
  509. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/thread.h +79 -0
  510. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/time.h +34 -0
  511. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/transcode.h +23 -0
  512. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/util.h +27 -0
  513. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/variable.h +72 -0
  514. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/vm.h +137 -0
  515. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal/warnings.h +16 -0
  516. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/internal.h +108 -0
  517. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/iseq.h +340 -0
  518. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/known_errors.inc +1419 -0
  519. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/method.h +255 -0
  520. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/node.h +111 -0
  521. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/node_name.inc +224 -0
  522. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/optinsn.inc +128 -0
  523. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/optunifs.inc +43 -0
  524. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/parse.h +243 -0
  525. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/parser_bits.h +564 -0
  526. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/parser_node.h +32 -0
  527. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/parser_st.h +162 -0
  528. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/parser_value.h +106 -0
  529. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/ast.h +6245 -0
  530. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/defines.h +206 -0
  531. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/diagnostic.h +433 -0
  532. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/encoding.h +283 -0
  533. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/extension.h +19 -0
  534. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/node.h +150 -0
  535. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/options.h +305 -0
  536. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/pack.h +163 -0
  537. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/parser.h +891 -0
  538. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/prettyprint.h +34 -0
  539. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/prism.h +347 -0
  540. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/regexp.h +33 -0
  541. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/static_literals.h +120 -0
  542. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_buffer.h +218 -0
  543. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_char.h +205 -0
  544. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_constant_pool.h +226 -0
  545. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_integer.h +119 -0
  546. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_list.h +97 -0
  547. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_memchr.h +29 -0
  548. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_newline_list.h +102 -0
  549. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string.h +174 -0
  550. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string_list.h +44 -0
  551. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strncasecmp.h +32 -0
  552. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_strpbrk.h +46 -0
  553. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism/version.h +29 -0
  554. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/prism_compile.h +88 -0
  555. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/probes_helper.h +42 -0
  556. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/ractor_core.h +393 -0
  557. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/regenc.h +254 -0
  558. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/regint.h +1010 -0
  559. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/regparse.h +371 -0
  560. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/revision.h +5 -0
  561. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/rjit.h +101 -0
  562. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/rjit_c.h +165 -0
  563. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/ruby_assert.h +14 -0
  564. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/ruby_atomic.h +23 -0
  565. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/rubyparser.h +1430 -0
  566. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/shape.h +233 -0
  567. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/siphash.h +48 -0
  568. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/symbol.h +118 -0
  569. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/thread_none.h +21 -0
  570. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/thread_pthread.h +166 -0
  571. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/thread_win32.h +58 -0
  572. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/timev.h +58 -0
  573. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/transcode_data.h +138 -0
  574. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/variable.h +39 -0
  575. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/version.h +69 -0
  576. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/vm.inc +5643 -0
  577. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/vm_call_iseq_optimized.inc +244 -0
  578. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/vm_callinfo.h +605 -0
  579. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/vm_core.h +2236 -0
  580. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/vm_debug.h +124 -0
  581. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/vm_exec.h +199 -0
  582. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/vm_insnhelper.h +272 -0
  583. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/vm_opts.h +67 -0
  584. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/vm_sync.h +137 -0
  585. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/vmtc.inc +253 -0
  586. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview1/yjit.h +79 -0
  587. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/addr2line.h +22 -0
  588. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/builtin.h +119 -0
  589. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/ccan/build_assert/build_assert.h +40 -0
  590. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/ccan/check_type/check_type.h +63 -0
  591. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/ccan/container_of/container_of.h +142 -0
  592. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/ccan/list/list.h +791 -0
  593. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/ccan/str/str.h +17 -0
  594. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/constant.h +53 -0
  595. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/darray.h +209 -0
  596. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/debug_counter.h +423 -0
  597. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/dln.h +32 -0
  598. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/encindex.h +70 -0
  599. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/eval_intern.h +324 -0
  600. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/hrtime.h +237 -0
  601. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/id.h +347 -0
  602. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/id_table.h +39 -0
  603. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/insns.inc +265 -0
  604. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/insns_info.inc +9902 -0
  605. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/array.h +152 -0
  606. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/basic_operators.h +64 -0
  607. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/bignum.h +244 -0
  608. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/bits.h +568 -0
  609. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/class.h +283 -0
  610. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/cmdlineopt.h +65 -0
  611. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/compar.h +29 -0
  612. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/compile.h +34 -0
  613. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/compilers.h +107 -0
  614. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/complex.h +29 -0
  615. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/cont.h +35 -0
  616. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/dir.h +16 -0
  617. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/enc.h +19 -0
  618. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/encoding.h +36 -0
  619. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/enum.h +18 -0
  620. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/enumerator.h +21 -0
  621. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/error.h +218 -0
  622. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/eval.h +33 -0
  623. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/file.h +38 -0
  624. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/fixnum.h +184 -0
  625. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/gc.h +322 -0
  626. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/hash.h +192 -0
  627. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/imemo.h +261 -0
  628. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/inits.h +47 -0
  629. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/io.h +143 -0
  630. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/load.h +18 -0
  631. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/loadpath.h +16 -0
  632. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/math.h +23 -0
  633. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/missing.h +19 -0
  634. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/numeric.h +274 -0
  635. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/object.h +63 -0
  636. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/parse.h +129 -0
  637. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/proc.h +30 -0
  638. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/process.h +124 -0
  639. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/ractor.h +6 -0
  640. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/random.h +17 -0
  641. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/range.h +40 -0
  642. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/rational.h +71 -0
  643. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/re.h +28 -0
  644. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/ruby_parser.h +102 -0
  645. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/sanitizers.h +326 -0
  646. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/serial.h +23 -0
  647. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/signal.h +24 -0
  648. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/st.h +11 -0
  649. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/static_assert.h +16 -0
  650. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/string.h +186 -0
  651. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/struct.h +127 -0
  652. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/symbol.h +45 -0
  653. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/thread.h +85 -0
  654. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/time.h +34 -0
  655. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/transcode.h +23 -0
  656. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/util.h +27 -0
  657. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/variable.h +72 -0
  658. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/vm.h +137 -0
  659. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal/warnings.h +16 -0
  660. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/internal.h +108 -0
  661. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/iseq.h +340 -0
  662. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/known_errors.inc +1419 -0
  663. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/method.h +255 -0
  664. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/node.h +111 -0
  665. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/node_name.inc +224 -0
  666. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/optinsn.inc +128 -0
  667. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/optunifs.inc +43 -0
  668. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/parse.h +244 -0
  669. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/parser_bits.h +564 -0
  670. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/parser_node.h +32 -0
  671. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/parser_st.h +162 -0
  672. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/parser_value.h +106 -0
  673. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/ast.h +7524 -0
  674. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/defines.h +242 -0
  675. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/diagnostic.h +450 -0
  676. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/encoding.h +283 -0
  677. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/extension.h +19 -0
  678. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/node.h +129 -0
  679. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/options.h +396 -0
  680. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/pack.h +163 -0
  681. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/parser.h +933 -0
  682. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/prettyprint.h +34 -0
  683. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/prism.h +336 -0
  684. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/regexp.h +43 -0
  685. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/static_literals.h +121 -0
  686. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_buffer.h +218 -0
  687. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_char.h +204 -0
  688. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_constant_pool.h +218 -0
  689. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_integer.h +126 -0
  690. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_list.h +97 -0
  691. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_memchr.h +29 -0
  692. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_newline_list.h +113 -0
  693. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_string.h +190 -0
  694. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strncasecmp.h +32 -0
  695. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/util/pm_strpbrk.h +46 -0
  696. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism/version.h +29 -0
  697. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/prism_compile.h +99 -0
  698. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/probes_helper.h +42 -0
  699. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/ractor_core.h +382 -0
  700. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/regenc.h +254 -0
  701. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/regint.h +1006 -0
  702. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/regparse.h +371 -0
  703. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/revision.h +5 -0
  704. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/rjit.h +101 -0
  705. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/rjit_c.h +165 -0
  706. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/ruby_assert.h +14 -0
  707. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/ruby_atomic.h +23 -0
  708. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/rubyparser.h +1350 -0
  709. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/shape.h +234 -0
  710. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/siphash.h +48 -0
  711. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/symbol.h +123 -0
  712. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/thread_none.h +21 -0
  713. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/thread_pthread.h +168 -0
  714. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/thread_win32.h +58 -0
  715. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/timev.h +58 -0
  716. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/transcode_data.h +138 -0
  717. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/variable.h +39 -0
  718. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/version.h +69 -0
  719. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/vm.inc +5840 -0
  720. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/vm_call_iseq_optimized.inc +244 -0
  721. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/vm_callinfo.h +627 -0
  722. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/vm_core.h +2222 -0
  723. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/vm_debug.h +124 -0
  724. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/vm_exec.h +199 -0
  725. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/vm_insnhelper.h +277 -0
  726. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/vm_opts.h +67 -0
  727. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/vm_sync.h +137 -0
  728. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/vmtc.inc +259 -0
  729. data/lib/datadog/ruby_core_source/ruby-3.4.0-preview2/yjit.h +79 -0
  730. data/lib/datadog/ruby_core_source/version.rb +5 -0
  731. data/lib/datadog/ruby_core_source.rb +93 -0
  732. metadata +817 -0
@@ -0,0 +1,2201 @@
1
+ #ifndef RUBY_VM_CORE_H
2
+ #define RUBY_VM_CORE_H
3
+ /**********************************************************************
4
+
5
+ vm_core.h -
6
+
7
+ $Author$
8
+ created at: 04/01/01 19:41:38 JST
9
+
10
+ Copyright (C) 2004-2007 Koichi Sasada
11
+
12
+ **********************************************************************/
13
+
14
+ /*
15
+ * Enable check mode.
16
+ * 1: enable local assertions.
17
+ */
18
+ #ifndef VM_CHECK_MODE
19
+
20
+ // respect RUBY_DUBUG: if given n is 0, then use RUBY_DEBUG
21
+ #define N_OR_RUBY_DEBUG(n) (((n) > 0) ? (n) : RUBY_DEBUG)
22
+
23
+ #define VM_CHECK_MODE N_OR_RUBY_DEBUG(0)
24
+ #endif
25
+
26
+ /**
27
+ * VM Debug Level
28
+ *
29
+ * debug level:
30
+ * 0: no debug output
31
+ * 1: show instruction name
32
+ * 2: show stack frame when control stack frame is changed
33
+ * 3: show stack status
34
+ * 4: show register
35
+ * 5:
36
+ * 10: gc check
37
+ */
38
+
39
+ #ifndef VMDEBUG
40
+ #define VMDEBUG 0
41
+ #endif
42
+
43
+ #if 0
44
+ #undef VMDEBUG
45
+ #define VMDEBUG 3
46
+ #endif
47
+
48
+ #include "ruby/internal/config.h"
49
+
50
+ #include <stddef.h>
51
+ #include <signal.h>
52
+ #include <stdarg.h>
53
+
54
+ #include "ruby_assert.h"
55
+
56
+ #define RVALUE_SIZE (sizeof(struct RBasic) + sizeof(VALUE[RBIMPL_RVALUE_EMBED_LEN_MAX]))
57
+
58
+ #if VM_CHECK_MODE > 0
59
+ #define VM_ASSERT(expr) RUBY_ASSERT_MESG_WHEN(VM_CHECK_MODE > 0, expr, #expr)
60
+ #define VM_UNREACHABLE(func) rb_bug(#func ": unreachable")
61
+ #define RUBY_ASSERT_CRITICAL_SECTION
62
+ #define RUBY_DEBUG_THREAD_SCHEDULE() rb_thread_schedule()
63
+ #else
64
+ #define VM_ASSERT(expr) ((void)0)
65
+ #define VM_UNREACHABLE(func) UNREACHABLE
66
+ #define RUBY_DEBUG_THREAD_SCHEDULE()
67
+ #endif
68
+
69
+ #define RUBY_ASSERT_MUTEX_OWNED(mutex) VM_ASSERT(rb_mutex_owned_p(mutex))
70
+
71
+ #if defined(RUBY_ASSERT_CRITICAL_SECTION)
72
+ // TODO add documentation
73
+ extern int ruby_assert_critical_section_entered;
74
+ #define RUBY_ASSERT_CRITICAL_SECTION_ENTER() do{ruby_assert_critical_section_entered += 1;}while(false)
75
+ #define RUBY_ASSERT_CRITICAL_SECTION_LEAVE() do{VM_ASSERT(ruby_assert_critical_section_entered > 0);ruby_assert_critical_section_entered -= 1;}while(false)
76
+ #else
77
+ #define RUBY_ASSERT_CRITICAL_SECTION_ENTER()
78
+ #define RUBY_ASSERT_CRITICAL_SECTION_LEAVE()
79
+ #endif
80
+
81
+ #if defined(__wasm__) && !defined(__EMSCRIPTEN__)
82
+ # include "wasm/setjmp.h"
83
+ #else
84
+ # include <setjmp.h>
85
+ #endif
86
+
87
+ #if defined(__linux__) || defined(__FreeBSD__)
88
+ # define RB_THREAD_T_HAS_NATIVE_ID
89
+ #endif
90
+
91
+ #include "ruby/internal/stdbool.h"
92
+ #include "ccan/list/list.h"
93
+ #include "id.h"
94
+ #include "internal.h"
95
+ #include "internal/array.h"
96
+ #include "internal/basic_operators.h"
97
+ #include "internal/serial.h"
98
+ #include "internal/vm.h"
99
+ #include "method.h"
100
+ #include "node.h"
101
+ #include "ruby/ruby.h"
102
+ #include "ruby/st.h"
103
+ #include "ruby_atomic.h"
104
+ #include "vm_opts.h"
105
+
106
+ #include "ruby/thread_native.h"
107
+
108
+ /*
109
+ * implementation selector of get_insn_info algorithm
110
+ * 0: linear search
111
+ * 1: binary search
112
+ * 2: succinct bitvector
113
+ */
114
+ #ifndef VM_INSN_INFO_TABLE_IMPL
115
+ # define VM_INSN_INFO_TABLE_IMPL 2
116
+ #endif
117
+
118
+ #if defined(NSIG_MAX) /* POSIX issue 8 */
119
+ # undef NSIG
120
+ # define NSIG NSIG_MAX
121
+ #elif defined(_SIG_MAXSIG) /* FreeBSD */
122
+ # undef NSIG
123
+ # define NSIG _SIG_MAXSIG
124
+ #elif defined(_SIGMAX) /* QNX */
125
+ # define NSIG (_SIGMAX + 1)
126
+ #elif defined(NSIG) /* 99% of everything else */
127
+ # /* take it */
128
+ #else /* Last resort */
129
+ # define NSIG (sizeof(sigset_t) * CHAR_BIT + 1)
130
+ #endif
131
+
132
+ #define RUBY_NSIG NSIG
133
+
134
+ #if defined(SIGCLD)
135
+ # define RUBY_SIGCHLD (SIGCLD)
136
+ #elif defined(SIGCHLD)
137
+ # define RUBY_SIGCHLD (SIGCHLD)
138
+ #endif
139
+
140
+ #if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__)
141
+ # define USE_SIGALTSTACK
142
+ void *rb_allocate_sigaltstack(void);
143
+ void *rb_register_sigaltstack(void *);
144
+ # define RB_ALTSTACK_INIT(var, altstack) var = rb_register_sigaltstack(altstack)
145
+ # define RB_ALTSTACK_FREE(var) free(var)
146
+ # define RB_ALTSTACK(var) var
147
+ #else /* noop */
148
+ # define RB_ALTSTACK_INIT(var, altstack)
149
+ # define RB_ALTSTACK_FREE(var)
150
+ # define RB_ALTSTACK(var) (0)
151
+ #endif
152
+
153
+ #include THREAD_IMPL_H
154
+ #define RUBY_VM_THREAD_MODEL 2
155
+
156
+ /*****************/
157
+ /* configuration */
158
+ /*****************/
159
+
160
+ /* gcc ver. check */
161
+ #if defined(__GNUC__) && __GNUC__ >= 2
162
+
163
+ #if OPT_TOKEN_THREADED_CODE
164
+ #if OPT_DIRECT_THREADED_CODE
165
+ #undef OPT_DIRECT_THREADED_CODE
166
+ #endif
167
+ #endif
168
+
169
+ #else /* defined(__GNUC__) && __GNUC__ >= 2 */
170
+
171
+ /* disable threaded code options */
172
+ #if OPT_DIRECT_THREADED_CODE
173
+ #undef OPT_DIRECT_THREADED_CODE
174
+ #endif
175
+ #if OPT_TOKEN_THREADED_CODE
176
+ #undef OPT_TOKEN_THREADED_CODE
177
+ #endif
178
+ #endif
179
+
180
+ /* call threaded code */
181
+ #if OPT_CALL_THREADED_CODE
182
+ #if OPT_DIRECT_THREADED_CODE
183
+ #undef OPT_DIRECT_THREADED_CODE
184
+ #endif /* OPT_DIRECT_THREADED_CODE */
185
+ #endif /* OPT_CALL_THREADED_CODE */
186
+
187
+ void rb_vm_encoded_insn_data_table_init(void);
188
+ typedef unsigned long rb_num_t;
189
+ typedef signed long rb_snum_t;
190
+
191
+ enum ruby_tag_type {
192
+ RUBY_TAG_NONE = 0x0,
193
+ RUBY_TAG_RETURN = 0x1,
194
+ RUBY_TAG_BREAK = 0x2,
195
+ RUBY_TAG_NEXT = 0x3,
196
+ RUBY_TAG_RETRY = 0x4,
197
+ RUBY_TAG_REDO = 0x5,
198
+ RUBY_TAG_RAISE = 0x6,
199
+ RUBY_TAG_THROW = 0x7,
200
+ RUBY_TAG_FATAL = 0x8,
201
+ RUBY_TAG_MASK = 0xf
202
+ };
203
+
204
+ #define TAG_NONE RUBY_TAG_NONE
205
+ #define TAG_RETURN RUBY_TAG_RETURN
206
+ #define TAG_BREAK RUBY_TAG_BREAK
207
+ #define TAG_NEXT RUBY_TAG_NEXT
208
+ #define TAG_RETRY RUBY_TAG_RETRY
209
+ #define TAG_REDO RUBY_TAG_REDO
210
+ #define TAG_RAISE RUBY_TAG_RAISE
211
+ #define TAG_THROW RUBY_TAG_THROW
212
+ #define TAG_FATAL RUBY_TAG_FATAL
213
+ #define TAG_MASK RUBY_TAG_MASK
214
+
215
+ enum ruby_vm_throw_flags {
216
+ VM_THROW_NO_ESCAPE_FLAG = 0x8000,
217
+ VM_THROW_STATE_MASK = 0xff
218
+ };
219
+
220
+ /* forward declarations */
221
+ struct rb_thread_struct;
222
+ struct rb_control_frame_struct;
223
+
224
+ /* iseq data type */
225
+ typedef struct rb_compile_option_struct rb_compile_option_t;
226
+
227
+ union ic_serial_entry {
228
+ rb_serial_t raw;
229
+ VALUE data[2];
230
+ };
231
+
232
+ // imemo_constcache
233
+ struct iseq_inline_constant_cache_entry {
234
+ VALUE flags;
235
+
236
+ VALUE value; // v0
237
+ VALUE _unused1; // v1
238
+ VALUE _unused2; // v2
239
+ const rb_cref_t *ic_cref; // v3
240
+ };
241
+ STATIC_ASSERT(sizeof_iseq_inline_constant_cache_entry,
242
+ (offsetof(struct iseq_inline_constant_cache_entry, ic_cref) +
243
+ sizeof(const rb_cref_t *)) <= RVALUE_SIZE);
244
+
245
+ struct iseq_inline_constant_cache {
246
+ struct iseq_inline_constant_cache_entry *entry;
247
+
248
+ /**
249
+ * A null-terminated list of ids, used to represent a constant's path
250
+ * idNULL is used to represent the :: prefix, and 0 is used to donate the end
251
+ * of the list.
252
+ *
253
+ * For example
254
+ * FOO {rb_intern("FOO"), 0}
255
+ * FOO::BAR {rb_intern("FOO"), rb_intern("BAR"), 0}
256
+ * ::FOO {idNULL, rb_intern("FOO"), 0}
257
+ * ::FOO::BAR {idNULL, rb_intern("FOO"), rb_intern("BAR"), 0}
258
+ */
259
+ const ID *segments;
260
+ };
261
+
262
+ struct iseq_inline_iv_cache_entry {
263
+ uintptr_t value; // attr_index in lower bits, dest_shape_id in upper bits
264
+ ID iv_set_name;
265
+ };
266
+
267
+ struct iseq_inline_cvar_cache_entry {
268
+ struct rb_cvar_class_tbl_entry *entry;
269
+ };
270
+
271
+ union iseq_inline_storage_entry {
272
+ struct {
273
+ struct rb_thread_struct *running_thread;
274
+ VALUE value;
275
+ } once;
276
+ struct iseq_inline_constant_cache ic_cache;
277
+ struct iseq_inline_iv_cache_entry iv_cache;
278
+ };
279
+
280
+ struct rb_calling_info {
281
+ const struct rb_call_data *cd;
282
+ const struct rb_callcache *cc;
283
+ VALUE block_handler;
284
+ VALUE recv;
285
+ int argc;
286
+ bool kw_splat;
287
+ VALUE heap_argv;
288
+ };
289
+
290
+ #ifndef VM_ARGC_STACK_MAX
291
+ #define VM_ARGC_STACK_MAX 128
292
+ #endif
293
+
294
+ # define CALLING_ARGC(calling) ((calling)->heap_argv ? RARRAY_LENINT((calling)->heap_argv) : (calling)->argc)
295
+
296
+ struct rb_execution_context_struct;
297
+
298
+ #if 1
299
+ #define CoreDataFromValue(obj, type) (type*)DATA_PTR(obj)
300
+ #else
301
+ #define CoreDataFromValue(obj, type) (type*)rb_data_object_get(obj)
302
+ #endif
303
+ #define GetCoreDataFromValue(obj, type, ptr) ((ptr) = CoreDataFromValue((obj), type))
304
+
305
+ typedef struct rb_iseq_location_struct {
306
+ VALUE pathobj; /* String (path) or Array [path, realpath]. Frozen. */
307
+ VALUE base_label; /* String */
308
+ VALUE label; /* String */
309
+ int first_lineno;
310
+ int node_id;
311
+ rb_code_location_t code_location;
312
+ } rb_iseq_location_t;
313
+
314
+ #define PATHOBJ_PATH 0
315
+ #define PATHOBJ_REALPATH 1
316
+
317
+ static inline VALUE
318
+ pathobj_path(VALUE pathobj)
319
+ {
320
+ if (RB_TYPE_P(pathobj, T_STRING)) {
321
+ return pathobj;
322
+ }
323
+ else {
324
+ VM_ASSERT(RB_TYPE_P(pathobj, T_ARRAY));
325
+ return RARRAY_AREF(pathobj, PATHOBJ_PATH);
326
+ }
327
+ }
328
+
329
+ static inline VALUE
330
+ pathobj_realpath(VALUE pathobj)
331
+ {
332
+ if (RB_TYPE_P(pathobj, T_STRING)) {
333
+ return pathobj;
334
+ }
335
+ else {
336
+ VM_ASSERT(RB_TYPE_P(pathobj, T_ARRAY));
337
+ return RARRAY_AREF(pathobj, PATHOBJ_REALPATH);
338
+ }
339
+ }
340
+
341
+ /* Forward declarations */
342
+ struct rb_rjit_unit;
343
+
344
+ typedef uintptr_t iseq_bits_t;
345
+
346
+ #define ISEQ_IS_SIZE(body) (body->ic_size + body->ivc_size + body->ise_size + body->icvarc_size)
347
+
348
+ /* [ TS_IVC | TS_ICVARC | TS_ISE | TS_IC ] */
349
+ #define ISEQ_IS_IC_ENTRY(body, idx) (body->is_entries[(idx) + body->ise_size + body->icvarc_size + body->ivc_size].ic_cache);
350
+
351
+ /* instruction sequence type */
352
+ enum rb_iseq_type {
353
+ ISEQ_TYPE_TOP,
354
+ ISEQ_TYPE_METHOD,
355
+ ISEQ_TYPE_BLOCK,
356
+ ISEQ_TYPE_CLASS,
357
+ ISEQ_TYPE_RESCUE,
358
+ ISEQ_TYPE_ENSURE,
359
+ ISEQ_TYPE_EVAL,
360
+ ISEQ_TYPE_MAIN,
361
+ ISEQ_TYPE_PLAIN
362
+ };
363
+
364
+ // Attributes specified by Primitive.attr!
365
+ enum rb_builtin_attr {
366
+ // The iseq does not call methods.
367
+ BUILTIN_ATTR_LEAF = 0x01,
368
+ // The iseq does not allocate objects.
369
+ BUILTIN_ATTR_NO_GC = 0x02,
370
+ // This iseq only contains single `opt_invokebuiltin_delegate_leave` instruction with 0 arguments.
371
+ BUILTIN_ATTR_SINGLE_NOARG_INLINE = 0x04,
372
+ };
373
+
374
+ typedef VALUE (*rb_jit_func_t)(struct rb_execution_context_struct *, struct rb_control_frame_struct *);
375
+
376
+ struct rb_iseq_constant_body {
377
+ enum rb_iseq_type type;
378
+
379
+ unsigned int iseq_size;
380
+ VALUE *iseq_encoded; /* encoded iseq (insn addr and operands) */
381
+
382
+ /**
383
+ * parameter information
384
+ *
385
+ * def m(a1, a2, ..., aM, # mandatory
386
+ * b1=(...), b2=(...), ..., bN=(...), # optional
387
+ * *c, # rest
388
+ * d1, d2, ..., dO, # post
389
+ * e1:(...), e2:(...), ..., eK:(...), # keyword
390
+ * **f, # keyword_rest
391
+ * &g) # block
392
+ * =>
393
+ *
394
+ * lead_num = M
395
+ * opt_num = N
396
+ * rest_start = M+N
397
+ * post_start = M+N+(*1)
398
+ * post_num = O
399
+ * keyword_num = K
400
+ * block_start = M+N+(*1)+O+K
401
+ * keyword_bits = M+N+(*1)+O+K+(&1)
402
+ * size = M+N+O+(*1)+K+(&1)+(**1) // parameter size.
403
+ */
404
+
405
+ struct {
406
+ struct {
407
+ unsigned int has_lead : 1;
408
+ unsigned int has_opt : 1;
409
+ unsigned int has_rest : 1;
410
+ unsigned int has_post : 1;
411
+ unsigned int has_kw : 1;
412
+ unsigned int has_kwrest : 1;
413
+ unsigned int has_block : 1;
414
+
415
+ unsigned int ambiguous_param0 : 1; /* {|a|} */
416
+ unsigned int accepts_no_kwarg : 1;
417
+ unsigned int ruby2_keywords: 1;
418
+ } flags;
419
+
420
+ unsigned int size;
421
+
422
+ int lead_num;
423
+ int opt_num;
424
+ int rest_start;
425
+ int post_start;
426
+ int post_num;
427
+ int block_start;
428
+
429
+ const VALUE *opt_table; /* (opt_num + 1) entries. */
430
+ /* opt_num and opt_table:
431
+ *
432
+ * def foo o1=e1, o2=e2, ..., oN=eN
433
+ * #=>
434
+ * # prologue code
435
+ * A1: e1
436
+ * A2: e2
437
+ * ...
438
+ * AN: eN
439
+ * AL: body
440
+ * opt_num = N
441
+ * opt_table = [A1, A2, ..., AN, AL]
442
+ */
443
+
444
+ const struct rb_iseq_param_keyword {
445
+ int num;
446
+ int required_num;
447
+ int bits_start;
448
+ int rest_start;
449
+ const ID *table;
450
+ VALUE *default_values;
451
+ } *keyword;
452
+ } param;
453
+
454
+ rb_iseq_location_t location;
455
+
456
+ /* insn info, must be freed */
457
+ struct iseq_insn_info {
458
+ const struct iseq_insn_info_entry *body;
459
+ unsigned int *positions;
460
+ unsigned int size;
461
+ #if VM_INSN_INFO_TABLE_IMPL == 2
462
+ struct succ_index_table *succ_index_table;
463
+ #endif
464
+ } insns_info;
465
+
466
+ const ID *local_table; /* must free */
467
+
468
+ /* catch table */
469
+ struct iseq_catch_table *catch_table;
470
+
471
+ /* for child iseq */
472
+ const struct rb_iseq_struct *parent_iseq;
473
+ struct rb_iseq_struct *local_iseq; /* local_iseq->flip_cnt can be modified */
474
+
475
+ union iseq_inline_storage_entry *is_entries; /* [ TS_IVC | TS_ICVARC | TS_ISE | TS_IC ] */
476
+ struct rb_call_data *call_data; //struct rb_call_data calls[ci_size];
477
+
478
+ struct {
479
+ rb_snum_t flip_count;
480
+ VALUE script_lines;
481
+ VALUE coverage;
482
+ VALUE pc2branchindex;
483
+ VALUE *original_iseq;
484
+ } variable;
485
+
486
+ unsigned int local_table_size;
487
+ unsigned int ic_size; // Number of IC caches
488
+ unsigned int ise_size; // Number of ISE caches
489
+ unsigned int ivc_size; // Number of IVC caches
490
+ unsigned int icvarc_size; // Number of ICVARC caches
491
+ unsigned int ci_size;
492
+ unsigned int stack_max; /* for stack overflow check */
493
+
494
+ unsigned int builtin_attrs; // Union of rb_builtin_attr
495
+
496
+ union {
497
+ iseq_bits_t * list; /* Find references for GC */
498
+ iseq_bits_t single;
499
+ } mark_bits;
500
+
501
+ struct rb_id_table *outer_variables;
502
+
503
+ const rb_iseq_t *mandatory_only_iseq;
504
+
505
+ #if USE_RJIT || USE_YJIT
506
+ // Function pointer for JIT code on jit_exec()
507
+ rb_jit_func_t jit_entry;
508
+ // Number of calls on jit_exec()
509
+ long unsigned jit_entry_calls;
510
+ #endif
511
+
512
+ #if USE_YJIT
513
+ // Function pointer for JIT code on jit_exec_exception()
514
+ rb_jit_func_t jit_exception;
515
+ // Number of calls on jit_exec_exception()
516
+ long unsigned jit_exception_calls;
517
+ #endif
518
+
519
+ #if USE_RJIT
520
+ // RJIT stores some data on each iseq.
521
+ VALUE rjit_blocks;
522
+ #endif
523
+
524
+ #if USE_YJIT
525
+ // YJIT stores some data on each iseq.
526
+ void *yjit_payload;
527
+ // Used to estimate how frequently this ISEQ gets called
528
+ uint64_t yjit_calls_at_interv;
529
+ #endif
530
+ };
531
+
532
+ /* T_IMEMO/iseq */
533
+ /* typedef rb_iseq_t is in method.h */
534
+ struct rb_iseq_struct {
535
+ VALUE flags; /* 1 */
536
+ VALUE wrapper; /* 2 */
537
+
538
+ struct rb_iseq_constant_body *body; /* 3 */
539
+
540
+ union { /* 4, 5 words */
541
+ struct iseq_compile_data *compile_data; /* used at compile time */
542
+
543
+ struct {
544
+ VALUE obj;
545
+ int index;
546
+ } loader;
547
+
548
+ struct {
549
+ struct rb_hook_list_struct *local_hooks;
550
+ rb_event_flag_t global_trace_events;
551
+ } exec;
552
+ } aux;
553
+ };
554
+
555
+ #define ISEQ_BODY(iseq) ((iseq)->body)
556
+
557
+ #if !defined(USE_LAZY_LOAD) || !(USE_LAZY_LOAD+0)
558
+ #define USE_LAZY_LOAD 0
559
+ #endif
560
+
561
+ #if !USE_LAZY_LOAD
562
+ static inline const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq) {return 0;}
563
+ #endif
564
+ const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq);
565
+
566
+ static inline const rb_iseq_t *
567
+ rb_iseq_check(const rb_iseq_t *iseq)
568
+ {
569
+ if (USE_LAZY_LOAD && ISEQ_BODY(iseq) == NULL) {
570
+ rb_iseq_complete((rb_iseq_t *)iseq);
571
+ }
572
+ return iseq;
573
+ }
574
+
575
+ static inline const rb_iseq_t *
576
+ def_iseq_ptr(rb_method_definition_t *def)
577
+ {
578
+ //TODO: re-visit. to check the bug, enable this assertion.
579
+ #if VM_CHECK_MODE > 0
580
+ if (def->type != VM_METHOD_TYPE_ISEQ) rb_bug("def_iseq_ptr: not iseq (%d)", def->type);
581
+ #endif
582
+ return rb_iseq_check(def->body.iseq.iseqptr);
583
+ }
584
+
585
+ enum ruby_special_exceptions {
586
+ ruby_error_reenter,
587
+ ruby_error_nomemory,
588
+ ruby_error_sysstack,
589
+ ruby_error_stackfatal,
590
+ ruby_error_stream_closed,
591
+ ruby_special_error_count
592
+ };
593
+
594
+ #define GetVMPtr(obj, ptr) \
595
+ GetCoreDataFromValue((obj), rb_vm_t, (ptr))
596
+
597
+ struct rb_vm_struct;
598
+ typedef void rb_vm_at_exit_func(struct rb_vm_struct*);
599
+
600
+ typedef struct rb_at_exit_list {
601
+ rb_vm_at_exit_func *func;
602
+ struct rb_at_exit_list *next;
603
+ } rb_at_exit_list;
604
+
605
+ struct rb_objspace;
606
+ struct rb_objspace *rb_objspace_alloc(void);
607
+ void rb_objspace_free(struct rb_objspace *);
608
+ void rb_objspace_call_finalizer(struct rb_objspace *);
609
+
610
+ typedef struct rb_hook_list_struct {
611
+ struct rb_event_hook_struct *hooks;
612
+ rb_event_flag_t events;
613
+ unsigned int running;
614
+ bool need_clean;
615
+ bool is_local;
616
+ } rb_hook_list_t;
617
+
618
+
619
+ // see builtin.h for definition
620
+ typedef const struct rb_builtin_function *RB_BUILTIN;
621
+
622
+ typedef struct rb_vm_struct {
623
+ VALUE self;
624
+
625
+ struct {
626
+ struct ccan_list_head set;
627
+ unsigned int cnt;
628
+ unsigned int blocking_cnt;
629
+
630
+ struct rb_ractor_struct *main_ractor;
631
+ struct rb_thread_struct *main_thread; // == vm->ractor.main_ractor->threads.main
632
+
633
+ struct {
634
+ // monitor
635
+ rb_nativethread_lock_t lock;
636
+ struct rb_ractor_struct *lock_owner;
637
+ unsigned int lock_rec;
638
+
639
+ // join at exit
640
+ rb_nativethread_cond_t terminate_cond;
641
+ bool terminate_waiting;
642
+
643
+ #ifndef RUBY_THREAD_PTHREAD_H
644
+ bool barrier_waiting;
645
+ unsigned int barrier_cnt;
646
+ rb_nativethread_cond_t barrier_cond;
647
+ #endif
648
+ } sync;
649
+
650
+ // ractor scheduling
651
+ struct {
652
+ rb_nativethread_lock_t lock;
653
+ struct rb_ractor_struct *lock_owner;
654
+ bool locked;
655
+
656
+ rb_nativethread_cond_t cond; // GRQ
657
+ unsigned int snt_cnt; // count of shared NTs
658
+ unsigned int dnt_cnt; // count of dedicated NTs
659
+
660
+ unsigned int running_cnt;
661
+
662
+ unsigned int max_cpu;
663
+ struct ccan_list_head grq; // // Global Ready Queue
664
+ unsigned int grq_cnt;
665
+
666
+ // running threads
667
+ struct ccan_list_head running_threads;
668
+
669
+ // threads which switch context by timeslice
670
+ struct ccan_list_head timeslice_threads;
671
+
672
+ struct ccan_list_head zombie_threads;
673
+
674
+ // true if timeslice timer is not enable
675
+ bool timeslice_wait_inf;
676
+
677
+ // barrier
678
+ rb_nativethread_cond_t barrier_complete_cond;
679
+ rb_nativethread_cond_t barrier_release_cond;
680
+ bool barrier_waiting;
681
+ unsigned int barrier_waiting_cnt;
682
+ unsigned int barrier_serial;
683
+ } sched;
684
+ } ractor;
685
+
686
+ #ifdef USE_SIGALTSTACK
687
+ void *main_altstack;
688
+ #endif
689
+
690
+ rb_serial_t fork_gen;
691
+ struct ccan_list_head waiting_fds; /* <=> struct waiting_fd */
692
+
693
+ /* set in single-threaded processes only: */
694
+ volatile int ubf_async_safe;
695
+
696
+ unsigned int running: 1;
697
+ unsigned int thread_abort_on_exception: 1;
698
+ unsigned int thread_report_on_exception: 1;
699
+ unsigned int thread_ignore_deadlock: 1;
700
+
701
+ /* object management */
702
+ VALUE mark_object_ary;
703
+ const VALUE special_exceptions[ruby_special_error_count];
704
+
705
+ /* load */
706
+ VALUE top_self;
707
+ VALUE load_path;
708
+ VALUE load_path_snapshot;
709
+ VALUE load_path_check_cache;
710
+ VALUE expanded_load_path;
711
+ VALUE loaded_features;
712
+ VALUE loaded_features_snapshot;
713
+ VALUE loaded_features_realpaths;
714
+ VALUE loaded_features_realpath_map;
715
+ struct st_table *loaded_features_index;
716
+ struct st_table *loading_table;
717
+ // For running the init function of statically linked
718
+ // extensions when they are loaded
719
+ struct st_table *static_ext_inits;
720
+
721
+ /* signal */
722
+ struct {
723
+ VALUE cmd[RUBY_NSIG];
724
+ } trap_list;
725
+
726
+ /* relation table of ensure - rollback for callcc */
727
+ struct st_table *ensure_rollback_table;
728
+
729
+ /* postponed_job (async-signal-safe, and thread-safe) */
730
+ struct rb_postponed_job_queue *postponed_job_queue;
731
+
732
+ int src_encoding_index;
733
+
734
+ /* workqueue (thread-safe, NOT async-signal-safe) */
735
+ struct ccan_list_head workqueue; /* <=> rb_workqueue_job.jnode */
736
+ rb_nativethread_lock_t workqueue_lock;
737
+
738
+ VALUE orig_progname, progname;
739
+ VALUE coverages, me2counter;
740
+ int coverage_mode;
741
+
742
+ st_table * defined_module_hash;
743
+
744
+ struct rb_objspace *objspace;
745
+
746
+ rb_at_exit_list *at_exit;
747
+
748
+ st_table *frozen_strings;
749
+
750
+ const struct rb_builtin_function *builtin_function_table;
751
+ int builtin_inline_index;
752
+
753
+ struct rb_id_table *negative_cme_table;
754
+ st_table *overloaded_cme_table; // cme -> overloaded_cme
755
+
756
+ // This id table contains a mapping from ID to ICs. It does this with ID
757
+ // keys and nested st_tables as values. The nested tables have ICs as keys
758
+ // and Qtrue as values. It is used when inline constant caches need to be
759
+ // invalidated or ISEQs are being freed.
760
+ struct rb_id_table *constant_cache;
761
+
762
+ #ifndef VM_GLOBAL_CC_CACHE_TABLE_SIZE
763
+ #define VM_GLOBAL_CC_CACHE_TABLE_SIZE 1023
764
+ #endif
765
+ const struct rb_callcache *global_cc_cache_table[VM_GLOBAL_CC_CACHE_TABLE_SIZE]; // vm_eval.c
766
+
767
+ #if defined(USE_VM_CLOCK) && USE_VM_CLOCK
768
+ uint32_t clock;
769
+ #endif
770
+
771
+ /* params */
772
+ struct { /* size in byte */
773
+ size_t thread_vm_stack_size;
774
+ size_t thread_machine_stack_size;
775
+ size_t fiber_vm_stack_size;
776
+ size_t fiber_machine_stack_size;
777
+ } default_params;
778
+
779
+ } rb_vm_t;
780
+
781
+ /* default values */
782
+
783
+ #define RUBY_VM_SIZE_ALIGN 4096
784
+
785
+ #define RUBY_VM_THREAD_VM_STACK_SIZE ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */
786
+ #define RUBY_VM_THREAD_VM_STACK_SIZE_MIN ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */
787
+ #define RUBY_VM_THREAD_MACHINE_STACK_SIZE ( 128 * 1024 * sizeof(VALUE)) /* 512 KB or 1024 KB */
788
+ #define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
789
+
790
+ #define RUBY_VM_FIBER_VM_STACK_SIZE ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
791
+ #define RUBY_VM_FIBER_VM_STACK_SIZE_MIN ( 2 * 1024 * sizeof(VALUE)) /* 8 KB or 16 KB */
792
+ #define RUBY_VM_FIBER_MACHINE_STACK_SIZE ( 64 * 1024 * sizeof(VALUE)) /* 256 KB or 512 KB */
793
+ #if defined(__powerpc64__) || defined(__ppc64__) // macOS has __ppc64__
794
+ #define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 32 * 1024 * sizeof(VALUE)) /* 128 KB or 256 KB */
795
+ #else
796
+ #define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
797
+ #endif
798
+
799
+ #if __has_feature(memory_sanitizer) || __has_feature(address_sanitizer)
800
+ /* It seems sanitizers consume A LOT of machine stacks */
801
+ #undef RUBY_VM_THREAD_MACHINE_STACK_SIZE
802
+ #define RUBY_VM_THREAD_MACHINE_STACK_SIZE (1024 * 1024 * sizeof(VALUE))
803
+ #undef RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN
804
+ #define RUBY_VM_THREAD_MACHINE_STACK_SIZE_MIN ( 512 * 1024 * sizeof(VALUE))
805
+ #undef RUBY_VM_FIBER_MACHINE_STACK_SIZE
806
+ #define RUBY_VM_FIBER_MACHINE_STACK_SIZE ( 256 * 1024 * sizeof(VALUE))
807
+ #undef RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN
808
+ #define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 128 * 1024 * sizeof(VALUE))
809
+ #endif
810
+
811
+ #ifndef VM_DEBUG_BP_CHECK
812
+ #define VM_DEBUG_BP_CHECK 0
813
+ #endif
814
+
815
+ #ifndef VM_DEBUG_VERIFY_METHOD_CACHE
816
+ #define VM_DEBUG_VERIFY_METHOD_CACHE (VMDEBUG != 0)
817
+ #endif
818
+
819
+ struct rb_captured_block {
820
+ VALUE self;
821
+ const VALUE *ep;
822
+ union {
823
+ const rb_iseq_t *iseq;
824
+ const struct vm_ifunc *ifunc;
825
+ VALUE val;
826
+ } code;
827
+ };
828
+
829
+ enum rb_block_handler_type {
830
+ block_handler_type_iseq,
831
+ block_handler_type_ifunc,
832
+ block_handler_type_symbol,
833
+ block_handler_type_proc
834
+ };
835
+
836
+ enum rb_block_type {
837
+ block_type_iseq,
838
+ block_type_ifunc,
839
+ block_type_symbol,
840
+ block_type_proc
841
+ };
842
+
843
+ struct rb_block {
844
+ union {
845
+ struct rb_captured_block captured;
846
+ VALUE symbol;
847
+ VALUE proc;
848
+ } as;
849
+ enum rb_block_type type;
850
+ };
851
+
852
+ typedef struct rb_control_frame_struct {
853
+ const VALUE *pc; // cfp[0]
854
+ VALUE *sp; // cfp[1]
855
+ const rb_iseq_t *iseq; // cfp[2]
856
+ VALUE self; // cfp[3] / block[0]
857
+ const VALUE *ep; // cfp[4] / block[1]
858
+ const void *block_code; // cfp[5] / block[2] -- iseq, ifunc, or forwarded block handler
859
+ void *jit_return; // cfp[6] -- return address for JIT code
860
+ #if VM_DEBUG_BP_CHECK
861
+ VALUE *bp_check; // cfp[7]
862
+ #endif
863
+ } rb_control_frame_t;
864
+
865
+ extern const rb_data_type_t ruby_threadptr_data_type;
866
+
867
+ static inline struct rb_thread_struct *
868
+ rb_thread_ptr(VALUE thval)
869
+ {
870
+ return (struct rb_thread_struct *)rb_check_typeddata(thval, &ruby_threadptr_data_type);
871
+ }
872
+
873
+ enum rb_thread_status {
874
+ THREAD_RUNNABLE,
875
+ THREAD_STOPPED,
876
+ THREAD_STOPPED_FOREVER,
877
+ THREAD_KILLED
878
+ };
879
+
880
+ #ifdef RUBY_JMP_BUF
881
+ typedef RUBY_JMP_BUF rb_jmpbuf_t;
882
+ #else
883
+ typedef void *rb_jmpbuf_t[5];
884
+ #endif
885
+
886
+ /*
887
+ `rb_vm_tag_jmpbuf_t` type represents a buffer used to
888
+ long jump to a C frame associated with `rb_vm_tag`.
889
+
890
+ Use-site of `rb_vm_tag_jmpbuf_t` is responsible for calling the
891
+ following functions:
892
+ - `rb_vm_tag_jmpbuf_init` once `rb_vm_tag_jmpbuf_t` is allocated.
893
+ - `rb_vm_tag_jmpbuf_deinit` once `rb_vm_tag_jmpbuf_t` is no longer necessary.
894
+
895
+ `RB_VM_TAG_JMPBUF_GET` transforms a `rb_vm_tag_jmpbuf_t` into a
896
+ `rb_jmpbuf_t` to be passed to `rb_setjmp/rb_longjmp`.
897
+ */
898
+ #if defined(__wasm__) && !defined(__EMSCRIPTEN__)
899
+ /*
900
+ WebAssembly target with Asyncify-based SJLJ needs
901
+ to capture the execution context by unwind/rewind-ing
902
+ call frames into a jump buffer. The buffer space tends
903
+ to be considerably large unlike other architectures'
904
+ register-based buffers.
905
+ Therefore, we allocates the buffer on the heap on such
906
+ environments.
907
+ */
908
+ typedef rb_jmpbuf_t *rb_vm_tag_jmpbuf_t;
909
+
910
+ #define RB_VM_TAG_JMPBUF_GET(buf) (*buf)
911
+
912
+ static inline void
913
+ rb_vm_tag_jmpbuf_init(rb_vm_tag_jmpbuf_t *jmpbuf)
914
+ {
915
+ *jmpbuf = ruby_xmalloc(sizeof(rb_jmpbuf_t));
916
+ }
917
+
918
+ static inline void
919
+ rb_vm_tag_jmpbuf_deinit(const rb_vm_tag_jmpbuf_t *jmpbuf)
920
+ {
921
+ ruby_xfree(*jmpbuf);
922
+ }
923
+ #else
924
+ typedef rb_jmpbuf_t rb_vm_tag_jmpbuf_t;
925
+
926
+ #define RB_VM_TAG_JMPBUF_GET(buf) (buf)
927
+
928
+ static inline void
929
+ rb_vm_tag_jmpbuf_init(rb_vm_tag_jmpbuf_t *jmpbuf)
930
+ {
931
+ // no-op
932
+ }
933
+
934
+ static inline void
935
+ rb_vm_tag_jmpbuf_deinit(const rb_vm_tag_jmpbuf_t *jmpbuf)
936
+ {
937
+ // no-op
938
+ }
939
+ #endif
940
+
941
+ /*
942
+ the members which are written in EC_PUSH_TAG() should be placed at
943
+ the beginning and the end, so that entire region is accessible.
944
+ */
945
+ struct rb_vm_tag {
946
+ VALUE tag;
947
+ VALUE retval;
948
+ rb_vm_tag_jmpbuf_t buf;
949
+ struct rb_vm_tag *prev;
950
+ enum ruby_tag_type state;
951
+ unsigned int lock_rec;
952
+ };
953
+
954
+ STATIC_ASSERT(rb_vm_tag_buf_offset, offsetof(struct rb_vm_tag, buf) > 0);
955
+ STATIC_ASSERT(rb_vm_tag_buf_end,
956
+ offsetof(struct rb_vm_tag, buf) + sizeof(rb_vm_tag_jmpbuf_t) <
957
+ sizeof(struct rb_vm_tag));
958
+
959
+ struct rb_unblock_callback {
960
+ rb_unblock_function_t *func;
961
+ void *arg;
962
+ };
963
+
964
+ struct rb_mutex_struct;
965
+
966
+ typedef struct rb_ensure_entry {
967
+ VALUE marker;
968
+ VALUE (*e_proc)(VALUE);
969
+ VALUE data2;
970
+ } rb_ensure_entry_t;
971
+
972
+ typedef struct rb_ensure_list {
973
+ struct rb_ensure_list *next;
974
+ struct rb_ensure_entry entry;
975
+ } rb_ensure_list_t;
976
+
977
+ typedef struct rb_fiber_struct rb_fiber_t;
978
+
979
+ struct rb_waiting_list {
980
+ struct rb_waiting_list *next;
981
+ struct rb_thread_struct *thread;
982
+ struct rb_fiber_struct *fiber;
983
+ };
984
+
985
+ struct rb_execution_context_struct {
986
+ /* execution information */
987
+ VALUE *vm_stack; /* must free, must mark */
988
+ size_t vm_stack_size; /* size in word (byte size / sizeof(VALUE)) */
989
+ rb_control_frame_t *cfp;
990
+
991
+ struct rb_vm_tag *tag;
992
+
993
+ /* interrupt flags */
994
+ rb_atomic_t interrupt_flag;
995
+ rb_atomic_t interrupt_mask; /* size should match flag */
996
+ #if defined(USE_VM_CLOCK) && USE_VM_CLOCK
997
+ uint32_t checked_clock;
998
+ #endif
999
+
1000
+ rb_fiber_t *fiber_ptr;
1001
+ struct rb_thread_struct *thread_ptr;
1002
+
1003
+ /* storage (ec (fiber) local) */
1004
+ struct rb_id_table *local_storage;
1005
+ VALUE local_storage_recursive_hash;
1006
+ VALUE local_storage_recursive_hash_for_trace;
1007
+
1008
+ /* Inheritable fiber storage. */
1009
+ VALUE storage;
1010
+
1011
+ /* eval env */
1012
+ const VALUE *root_lep;
1013
+ VALUE root_svar;
1014
+
1015
+ /* ensure & callcc */
1016
+ rb_ensure_list_t *ensure_list;
1017
+
1018
+ /* trace information */
1019
+ struct rb_trace_arg_struct *trace_arg;
1020
+
1021
+ /* temporary places */
1022
+ VALUE errinfo;
1023
+ VALUE passed_block_handler; /* for rb_iterate */
1024
+
1025
+ uint8_t raised_flag; /* only 3 bits needed */
1026
+
1027
+ /* n.b. only 7 bits needed, really: */
1028
+ BITFIELD(enum method_missing_reason, method_missing_reason, 8);
1029
+
1030
+ VALUE private_const_reference;
1031
+
1032
+ /* for GC */
1033
+ struct {
1034
+ VALUE *stack_start;
1035
+ VALUE *stack_end;
1036
+ size_t stack_maxsize;
1037
+ RUBY_ALIGNAS(SIZEOF_VALUE) jmp_buf regs;
1038
+ } machine;
1039
+ };
1040
+
1041
+ #ifndef rb_execution_context_t
1042
+ typedef struct rb_execution_context_struct rb_execution_context_t;
1043
+ #define rb_execution_context_t rb_execution_context_t
1044
+ #endif
1045
+
1046
+ // for builtin.h
1047
+ #define VM_CORE_H_EC_DEFINED 1
1048
+
1049
+ // Set the vm_stack pointer in the execution context.
1050
+ void rb_ec_set_vm_stack(rb_execution_context_t *ec, VALUE *stack, size_t size);
1051
+
1052
+ // Initialize the vm_stack pointer in the execution context and push the initial stack frame.
1053
+ // @param ec the execution context to update.
1054
+ // @param stack a pointer to the stack to use.
1055
+ // @param size the size of the stack, as in `VALUE stack[size]`.
1056
+ void rb_ec_initialize_vm_stack(rb_execution_context_t *ec, VALUE *stack, size_t size);
1057
+
1058
+ // Clear (set to `NULL`) the vm_stack pointer.
1059
+ // @param ec the execution context to update.
1060
+ void rb_ec_clear_vm_stack(rb_execution_context_t *ec);
1061
+
1062
+ struct rb_ext_config {
1063
+ bool ractor_safe;
1064
+ };
1065
+
1066
+ typedef struct rb_ractor_struct rb_ractor_t;
1067
+
1068
+ struct rb_native_thread;
1069
+
1070
+ typedef struct rb_thread_struct {
1071
+ struct ccan_list_node lt_node; // managed by a ractor
1072
+ VALUE self;
1073
+ rb_ractor_t *ractor;
1074
+ rb_vm_t *vm;
1075
+ struct rb_native_thread *nt;
1076
+ rb_execution_context_t *ec;
1077
+
1078
+ struct rb_thread_sched_item sched;
1079
+ rb_atomic_t serial; // only for RUBY_DEBUG_LOG()
1080
+
1081
+ VALUE last_status; /* $? */
1082
+
1083
+ /* for cfunc */
1084
+ struct rb_calling_info *calling;
1085
+
1086
+ /* for load(true) */
1087
+ VALUE top_self;
1088
+ VALUE top_wrapper;
1089
+
1090
+ /* thread control */
1091
+
1092
+ BITFIELD(enum rb_thread_status, status, 2);
1093
+ /* bit flags */
1094
+ unsigned int has_dedicated_nt : 1;
1095
+ unsigned int to_kill : 1;
1096
+ unsigned int abort_on_exception: 1;
1097
+ unsigned int report_on_exception: 1;
1098
+ unsigned int pending_interrupt_queue_checked: 1;
1099
+ int8_t priority; /* -3 .. 3 (RUBY_THREAD_PRIORITY_{MIN,MAX}) */
1100
+ uint32_t running_time_us; /* 12500..800000 */
1101
+
1102
+ void *blocking_region_buffer;
1103
+
1104
+ VALUE thgroup;
1105
+ VALUE value;
1106
+
1107
+ /* temporary place of retval on OPT_CALL_THREADED_CODE */
1108
+ #if OPT_CALL_THREADED_CODE
1109
+ VALUE retval;
1110
+ #endif
1111
+
1112
+ /* async errinfo queue */
1113
+ VALUE pending_interrupt_queue;
1114
+ VALUE pending_interrupt_mask_stack;
1115
+
1116
+ /* interrupt management */
1117
+ rb_nativethread_lock_t interrupt_lock;
1118
+ struct rb_unblock_callback unblock;
1119
+ VALUE locking_mutex;
1120
+ struct rb_mutex_struct *keeping_mutexes;
1121
+
1122
+ struct rb_waiting_list *join_list;
1123
+
1124
+ union {
1125
+ struct {
1126
+ VALUE proc;
1127
+ VALUE args;
1128
+ int kw_splat;
1129
+ } proc;
1130
+ struct {
1131
+ VALUE (*func)(void *);
1132
+ void *arg;
1133
+ } func;
1134
+ } invoke_arg;
1135
+
1136
+ enum thread_invoke_type {
1137
+ thread_invoke_type_none = 0,
1138
+ thread_invoke_type_proc,
1139
+ thread_invoke_type_ractor_proc,
1140
+ thread_invoke_type_func
1141
+ } invoke_type;
1142
+
1143
+ /* statistics data for profiler */
1144
+ VALUE stat_insn_usage;
1145
+
1146
+ /* fiber */
1147
+ rb_fiber_t *root_fiber;
1148
+
1149
+ VALUE scheduler;
1150
+ unsigned int blocking;
1151
+
1152
+ /* misc */
1153
+ VALUE name;
1154
+ void **specific_storage;
1155
+
1156
+ struct rb_ext_config ext_config;
1157
+ } rb_thread_t;
1158
+
1159
+ static inline unsigned int
1160
+ rb_th_serial(const rb_thread_t *th)
1161
+ {
1162
+ return th ? (unsigned int)th->serial : 0;
1163
+ }
1164
+
1165
+ typedef enum {
1166
+ VM_DEFINECLASS_TYPE_CLASS = 0x00,
1167
+ VM_DEFINECLASS_TYPE_SINGLETON_CLASS = 0x01,
1168
+ VM_DEFINECLASS_TYPE_MODULE = 0x02,
1169
+ /* 0x03..0x06 is reserved */
1170
+ VM_DEFINECLASS_TYPE_MASK = 0x07
1171
+ } rb_vm_defineclass_type_t;
1172
+
1173
+ #define VM_DEFINECLASS_TYPE(x) ((rb_vm_defineclass_type_t)(x) & VM_DEFINECLASS_TYPE_MASK)
1174
+ #define VM_DEFINECLASS_FLAG_SCOPED 0x08
1175
+ #define VM_DEFINECLASS_FLAG_HAS_SUPERCLASS 0x10
1176
+ #define VM_DEFINECLASS_SCOPED_P(x) ((x) & VM_DEFINECLASS_FLAG_SCOPED)
1177
+ #define VM_DEFINECLASS_HAS_SUPERCLASS_P(x) \
1178
+ ((x) & VM_DEFINECLASS_FLAG_HAS_SUPERCLASS)
1179
+
1180
+ /* iseq.c */
1181
+ RUBY_SYMBOL_EXPORT_BEGIN
1182
+
1183
+ /* node -> iseq */
1184
+ rb_iseq_t *rb_iseq_new (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum rb_iseq_type);
1185
+ rb_iseq_t *rb_iseq_new_top (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent);
1186
+ rb_iseq_t *rb_iseq_new_main (const rb_ast_body_t *ast, VALUE path, VALUE realpath, const rb_iseq_t *parent, int opt);
1187
+ rb_iseq_t *rb_iseq_new_eval (const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth);
1188
+ rb_iseq_t *rb_iseq_new_with_opt(const rb_ast_body_t *ast, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth,
1189
+ enum rb_iseq_type, const rb_compile_option_t*);
1190
+
1191
+ struct iseq_link_anchor;
1192
+ struct rb_iseq_new_with_callback_callback_func {
1193
+ VALUE flags;
1194
+ VALUE reserved;
1195
+ void (*func)(rb_iseq_t *, struct iseq_link_anchor *, const void *);
1196
+ const void *data;
1197
+ };
1198
+ static inline struct rb_iseq_new_with_callback_callback_func *
1199
+ rb_iseq_new_with_callback_new_callback(
1200
+ void (*func)(rb_iseq_t *, struct iseq_link_anchor *, const void *), const void *ptr)
1201
+ {
1202
+ VALUE memo = rb_imemo_new(imemo_ifunc, (VALUE)func, (VALUE)ptr, Qundef, Qfalse);
1203
+ return (struct rb_iseq_new_with_callback_callback_func *)memo;
1204
+ }
1205
+ rb_iseq_t *rb_iseq_new_with_callback(const struct rb_iseq_new_with_callback_callback_func * ifunc,
1206
+ VALUE name, VALUE path, VALUE realpath, int first_lineno,
1207
+ const rb_iseq_t *parent, enum rb_iseq_type, const rb_compile_option_t*);
1208
+
1209
+ VALUE rb_iseq_disasm(const rb_iseq_t *iseq);
1210
+ int rb_iseq_disasm_insn(VALUE str, const VALUE *iseqval, size_t pos, const rb_iseq_t *iseq, VALUE child);
1211
+
1212
+ VALUE rb_iseq_coverage(const rb_iseq_t *iseq);
1213
+
1214
+ RUBY_EXTERN VALUE rb_cISeq;
1215
+ RUBY_EXTERN VALUE rb_cRubyVM;
1216
+ RUBY_EXTERN VALUE rb_mRubyVMFrozenCore;
1217
+ RUBY_EXTERN VALUE rb_block_param_proxy;
1218
+ RUBY_SYMBOL_EXPORT_END
1219
+
1220
+ #define GetProcPtr(obj, ptr) \
1221
+ GetCoreDataFromValue((obj), rb_proc_t, (ptr))
1222
+
1223
+ typedef struct {
1224
+ const struct rb_block block;
1225
+ unsigned int is_from_method: 1; /* bool */
1226
+ unsigned int is_lambda: 1; /* bool */
1227
+ unsigned int is_isolated: 1; /* bool */
1228
+ } rb_proc_t;
1229
+
1230
+ RUBY_SYMBOL_EXPORT_BEGIN
1231
+ VALUE rb_proc_isolate(VALUE self);
1232
+ VALUE rb_proc_isolate_bang(VALUE self);
1233
+ VALUE rb_proc_ractor_make_shareable(VALUE self);
1234
+ RUBY_SYMBOL_EXPORT_END
1235
+
1236
+ typedef struct {
1237
+ VALUE flags; /* imemo header */
1238
+ rb_iseq_t *iseq;
1239
+ const VALUE *ep;
1240
+ const VALUE *env;
1241
+ unsigned int env_size;
1242
+ } rb_env_t;
1243
+
1244
+ extern const rb_data_type_t ruby_binding_data_type;
1245
+
1246
+ #define GetBindingPtr(obj, ptr) \
1247
+ GetCoreDataFromValue((obj), rb_binding_t, (ptr))
1248
+
1249
+ typedef struct {
1250
+ const struct rb_block block;
1251
+ const VALUE pathobj;
1252
+ int first_lineno;
1253
+ } rb_binding_t;
1254
+
1255
+ /* used by compile time and send insn */
1256
+
1257
+ enum vm_check_match_type {
1258
+ VM_CHECKMATCH_TYPE_WHEN = 1,
1259
+ VM_CHECKMATCH_TYPE_CASE = 2,
1260
+ VM_CHECKMATCH_TYPE_RESCUE = 3
1261
+ };
1262
+
1263
+ #define VM_CHECKMATCH_TYPE_MASK 0x03
1264
+ #define VM_CHECKMATCH_ARRAY 0x04
1265
+
1266
+ enum vm_special_object_type {
1267
+ VM_SPECIAL_OBJECT_VMCORE = 1,
1268
+ VM_SPECIAL_OBJECT_CBASE,
1269
+ VM_SPECIAL_OBJECT_CONST_BASE
1270
+ };
1271
+
1272
+ enum vm_svar_index {
1273
+ VM_SVAR_LASTLINE = 0, /* $_ */
1274
+ VM_SVAR_BACKREF = 1, /* $~ */
1275
+
1276
+ VM_SVAR_EXTRA_START = 2,
1277
+ VM_SVAR_FLIPFLOP_START = 2 /* flipflop */
1278
+ };
1279
+
1280
+ /* inline cache */
1281
+ typedef struct iseq_inline_constant_cache *IC;
1282
+ typedef struct iseq_inline_iv_cache_entry *IVC;
1283
+ typedef struct iseq_inline_cvar_cache_entry *ICVARC;
1284
+ typedef union iseq_inline_storage_entry *ISE;
1285
+ typedef const struct rb_callinfo *CALL_INFO;
1286
+ typedef const struct rb_callcache *CALL_CACHE;
1287
+ typedef struct rb_call_data *CALL_DATA;
1288
+
1289
+ typedef VALUE CDHASH;
1290
+
1291
+ #ifndef FUNC_FASTCALL
1292
+ #define FUNC_FASTCALL(x) x
1293
+ #endif
1294
+
1295
+ typedef rb_control_frame_t *
1296
+ (FUNC_FASTCALL(*rb_insn_func_t))(rb_execution_context_t *, rb_control_frame_t *);
1297
+
1298
+ #define VM_TAGGED_PTR_SET(p, tag) ((VALUE)(p) | (tag))
1299
+ #define VM_TAGGED_PTR_REF(v, mask) ((void *)((v) & ~mask))
1300
+
1301
+ #define GC_GUARDED_PTR(p) VM_TAGGED_PTR_SET((p), 0x01)
1302
+ #define GC_GUARDED_PTR_REF(p) VM_TAGGED_PTR_REF((p), 0x03)
1303
+ #define GC_GUARDED_PTR_P(p) (((VALUE)(p)) & 0x01)
1304
+
1305
+ enum vm_frame_env_flags {
1306
+ /* Frame/Environment flag bits:
1307
+ * MMMM MMMM MMMM MMMM ____ FFFF FFFE EEEX (LSB)
1308
+ *
1309
+ * X : tag for GC marking (It seems as Fixnum)
1310
+ * EEE : 4 bits Env flags
1311
+ * FF..: 7 bits Frame flags
1312
+ * MM..: 15 bits frame magic (to check frame corruption)
1313
+ */
1314
+
1315
+ /* frame types */
1316
+ VM_FRAME_MAGIC_METHOD = 0x11110001,
1317
+ VM_FRAME_MAGIC_BLOCK = 0x22220001,
1318
+ VM_FRAME_MAGIC_CLASS = 0x33330001,
1319
+ VM_FRAME_MAGIC_TOP = 0x44440001,
1320
+ VM_FRAME_MAGIC_CFUNC = 0x55550001,
1321
+ VM_FRAME_MAGIC_IFUNC = 0x66660001,
1322
+ VM_FRAME_MAGIC_EVAL = 0x77770001,
1323
+ VM_FRAME_MAGIC_RESCUE = 0x78880001,
1324
+ VM_FRAME_MAGIC_DUMMY = 0x79990001,
1325
+
1326
+ VM_FRAME_MAGIC_MASK = 0x7fff0001,
1327
+
1328
+ /* frame flag */
1329
+ VM_FRAME_FLAG_FINISH = 0x0020,
1330
+ VM_FRAME_FLAG_BMETHOD = 0x0040,
1331
+ VM_FRAME_FLAG_CFRAME = 0x0080,
1332
+ VM_FRAME_FLAG_LAMBDA = 0x0100,
1333
+ VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM = 0x0200,
1334
+ VM_FRAME_FLAG_CFRAME_KW = 0x0400,
1335
+ VM_FRAME_FLAG_PASSED = 0x0800,
1336
+
1337
+ /* env flag */
1338
+ VM_ENV_FLAG_LOCAL = 0x0002,
1339
+ VM_ENV_FLAG_ESCAPED = 0x0004,
1340
+ VM_ENV_FLAG_WB_REQUIRED = 0x0008,
1341
+ VM_ENV_FLAG_ISOLATED = 0x0010,
1342
+ };
1343
+
1344
+ #define VM_ENV_DATA_SIZE ( 3)
1345
+
1346
+ #define VM_ENV_DATA_INDEX_ME_CREF (-2) /* ep[-2] */
1347
+ #define VM_ENV_DATA_INDEX_SPECVAL (-1) /* ep[-1] */
1348
+ #define VM_ENV_DATA_INDEX_FLAGS ( 0) /* ep[ 0] */
1349
+ #define VM_ENV_DATA_INDEX_ENV ( 1) /* ep[ 1] */
1350
+
1351
+ #define VM_ENV_INDEX_LAST_LVAR (-VM_ENV_DATA_SIZE)
1352
+
1353
+ static inline void VM_FORCE_WRITE_SPECIAL_CONST(const VALUE *ptr, VALUE special_const_value);
1354
+
1355
+ static inline void
1356
+ VM_ENV_FLAGS_SET(const VALUE *ep, VALUE flag)
1357
+ {
1358
+ VALUE flags = ep[VM_ENV_DATA_INDEX_FLAGS];
1359
+ VM_ASSERT(FIXNUM_P(flags));
1360
+ VM_FORCE_WRITE_SPECIAL_CONST(&ep[VM_ENV_DATA_INDEX_FLAGS], flags | flag);
1361
+ }
1362
+
1363
+ static inline void
1364
+ VM_ENV_FLAGS_UNSET(const VALUE *ep, VALUE flag)
1365
+ {
1366
+ VALUE flags = ep[VM_ENV_DATA_INDEX_FLAGS];
1367
+ VM_ASSERT(FIXNUM_P(flags));
1368
+ VM_FORCE_WRITE_SPECIAL_CONST(&ep[VM_ENV_DATA_INDEX_FLAGS], flags & ~flag);
1369
+ }
1370
+
1371
+ static inline unsigned long
1372
+ VM_ENV_FLAGS(const VALUE *ep, long flag)
1373
+ {
1374
+ VALUE flags = ep[VM_ENV_DATA_INDEX_FLAGS];
1375
+ VM_ASSERT(FIXNUM_P(flags));
1376
+ return flags & flag;
1377
+ }
1378
+
1379
+ static inline unsigned long
1380
+ VM_FRAME_TYPE(const rb_control_frame_t *cfp)
1381
+ {
1382
+ return VM_ENV_FLAGS(cfp->ep, VM_FRAME_MAGIC_MASK);
1383
+ }
1384
+
1385
+ static inline int
1386
+ VM_FRAME_LAMBDA_P(const rb_control_frame_t *cfp)
1387
+ {
1388
+ return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_LAMBDA) != 0;
1389
+ }
1390
+
1391
+ static inline int
1392
+ VM_FRAME_CFRAME_KW_P(const rb_control_frame_t *cfp)
1393
+ {
1394
+ return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_CFRAME_KW) != 0;
1395
+ }
1396
+
1397
+ static inline int
1398
+ VM_FRAME_FINISHED_P(const rb_control_frame_t *cfp)
1399
+ {
1400
+ return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_FINISH) != 0;
1401
+ }
1402
+
1403
+ static inline int
1404
+ VM_FRAME_BMETHOD_P(const rb_control_frame_t *cfp)
1405
+ {
1406
+ return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_BMETHOD) != 0;
1407
+ }
1408
+
1409
+ static inline int
1410
+ rb_obj_is_iseq(VALUE iseq)
1411
+ {
1412
+ return imemo_type_p(iseq, imemo_iseq);
1413
+ }
1414
+
1415
+ #if VM_CHECK_MODE > 0
1416
+ #define RUBY_VM_NORMAL_ISEQ_P(iseq) rb_obj_is_iseq((VALUE)iseq)
1417
+ #endif
1418
+
1419
+ static inline int
1420
+ VM_FRAME_CFRAME_P(const rb_control_frame_t *cfp)
1421
+ {
1422
+ int cframe_p = VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_CFRAME) != 0;
1423
+ VM_ASSERT(RUBY_VM_NORMAL_ISEQ_P(cfp->iseq) != cframe_p ||
1424
+ (VM_FRAME_TYPE(cfp) & VM_FRAME_MAGIC_MASK) == VM_FRAME_MAGIC_DUMMY);
1425
+ return cframe_p;
1426
+ }
1427
+
1428
+ static inline int
1429
+ VM_FRAME_RUBYFRAME_P(const rb_control_frame_t *cfp)
1430
+ {
1431
+ return !VM_FRAME_CFRAME_P(cfp);
1432
+ }
1433
+
1434
+ #define RUBYVM_CFUNC_FRAME_P(cfp) \
1435
+ (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC)
1436
+
1437
+ #define VM_GUARDED_PREV_EP(ep) GC_GUARDED_PTR(ep)
1438
+ #define VM_BLOCK_HANDLER_NONE 0
1439
+
1440
+ static inline int
1441
+ VM_ENV_LOCAL_P(const VALUE *ep)
1442
+ {
1443
+ return VM_ENV_FLAGS(ep, VM_ENV_FLAG_LOCAL) ? 1 : 0;
1444
+ }
1445
+
1446
+ static inline const VALUE *
1447
+ VM_ENV_PREV_EP(const VALUE *ep)
1448
+ {
1449
+ VM_ASSERT(VM_ENV_LOCAL_P(ep) == 0);
1450
+ return GC_GUARDED_PTR_REF(ep[VM_ENV_DATA_INDEX_SPECVAL]);
1451
+ }
1452
+
1453
+ static inline VALUE
1454
+ VM_ENV_BLOCK_HANDLER(const VALUE *ep)
1455
+ {
1456
+ VM_ASSERT(VM_ENV_LOCAL_P(ep));
1457
+ return ep[VM_ENV_DATA_INDEX_SPECVAL];
1458
+ }
1459
+
1460
+ #if VM_CHECK_MODE > 0
1461
+ int rb_vm_ep_in_heap_p(const VALUE *ep);
1462
+ #endif
1463
+
1464
+ static inline int
1465
+ VM_ENV_ESCAPED_P(const VALUE *ep)
1466
+ {
1467
+ VM_ASSERT(rb_vm_ep_in_heap_p(ep) == !!VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED));
1468
+ return VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED) ? 1 : 0;
1469
+ }
1470
+
1471
+ #if VM_CHECK_MODE > 0
1472
+ static inline int
1473
+ vm_assert_env(VALUE obj)
1474
+ {
1475
+ VM_ASSERT(imemo_type_p(obj, imemo_env));
1476
+ return 1;
1477
+ }
1478
+ #endif
1479
+
1480
+ RBIMPL_ATTR_NONNULL((1))
1481
+ static inline VALUE
1482
+ VM_ENV_ENVVAL(const VALUE *ep)
1483
+ {
1484
+ VALUE envval = ep[VM_ENV_DATA_INDEX_ENV];
1485
+ VM_ASSERT(VM_ENV_ESCAPED_P(ep));
1486
+ VM_ASSERT(vm_assert_env(envval));
1487
+ return envval;
1488
+ }
1489
+
1490
+ RBIMPL_ATTR_NONNULL((1))
1491
+ static inline const rb_env_t *
1492
+ VM_ENV_ENVVAL_PTR(const VALUE *ep)
1493
+ {
1494
+ return (const rb_env_t *)VM_ENV_ENVVAL(ep);
1495
+ }
1496
+
1497
+ static inline const rb_env_t *
1498
+ vm_env_new(VALUE *env_ep, VALUE *env_body, unsigned int env_size, const rb_iseq_t *iseq)
1499
+ {
1500
+ rb_env_t *env = (rb_env_t *)rb_imemo_new(imemo_env, (VALUE)env_ep, (VALUE)env_body, 0, (VALUE)iseq);
1501
+ env->env_size = env_size;
1502
+ env_ep[VM_ENV_DATA_INDEX_ENV] = (VALUE)env;
1503
+ return env;
1504
+ }
1505
+
1506
+ static inline void
1507
+ VM_FORCE_WRITE(const VALUE *ptr, VALUE v)
1508
+ {
1509
+ *((VALUE *)ptr) = v;
1510
+ }
1511
+
1512
+ static inline void
1513
+ VM_FORCE_WRITE_SPECIAL_CONST(const VALUE *ptr, VALUE special_const_value)
1514
+ {
1515
+ VM_ASSERT(RB_SPECIAL_CONST_P(special_const_value));
1516
+ VM_FORCE_WRITE(ptr, special_const_value);
1517
+ }
1518
+
1519
+ static inline void
1520
+ VM_STACK_ENV_WRITE(const VALUE *ep, int index, VALUE v)
1521
+ {
1522
+ VM_ASSERT(VM_ENV_FLAGS(ep, VM_ENV_FLAG_WB_REQUIRED) == 0);
1523
+ VM_FORCE_WRITE(&ep[index], v);
1524
+ }
1525
+
1526
+ const VALUE *rb_vm_ep_local_ep(const VALUE *ep);
1527
+ const VALUE *rb_vm_proc_local_ep(VALUE proc);
1528
+ void rb_vm_block_ep_update(VALUE obj, const struct rb_block *dst, const VALUE *ep);
1529
+ void rb_vm_block_copy(VALUE obj, const struct rb_block *dst, const struct rb_block *src);
1530
+
1531
+ VALUE rb_vm_frame_block_handler(const rb_control_frame_t *cfp);
1532
+
1533
+ #define RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp) ((cfp)+1)
1534
+ #define RUBY_VM_NEXT_CONTROL_FRAME(cfp) ((cfp)-1)
1535
+
1536
+ #define RUBY_VM_VALID_CONTROL_FRAME_P(cfp, ecfp) \
1537
+ ((void *)(ecfp) > (void *)(cfp))
1538
+
1539
+ static inline const rb_control_frame_t *
1540
+ RUBY_VM_END_CONTROL_FRAME(const rb_execution_context_t *ec)
1541
+ {
1542
+ return (rb_control_frame_t *)(ec->vm_stack + ec->vm_stack_size);
1543
+ }
1544
+
1545
+ static inline int
1546
+ RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(const rb_execution_context_t *ec, const rb_control_frame_t *cfp)
1547
+ {
1548
+ return !RUBY_VM_VALID_CONTROL_FRAME_P(cfp, RUBY_VM_END_CONTROL_FRAME(ec));
1549
+ }
1550
+
1551
+ static inline int
1552
+ VM_BH_ISEQ_BLOCK_P(VALUE block_handler)
1553
+ {
1554
+ if ((block_handler & 0x03) == 0x01) {
1555
+ #if VM_CHECK_MODE > 0
1556
+ struct rb_captured_block *captured = VM_TAGGED_PTR_REF(block_handler, 0x03);
1557
+ VM_ASSERT(imemo_type_p(captured->code.val, imemo_iseq));
1558
+ #endif
1559
+ return 1;
1560
+ }
1561
+ else {
1562
+ return 0;
1563
+ }
1564
+ }
1565
+
1566
+ static inline VALUE
1567
+ VM_BH_FROM_ISEQ_BLOCK(const struct rb_captured_block *captured)
1568
+ {
1569
+ VALUE block_handler = VM_TAGGED_PTR_SET(captured, 0x01);
1570
+ VM_ASSERT(VM_BH_ISEQ_BLOCK_P(block_handler));
1571
+ return block_handler;
1572
+ }
1573
+
1574
+ static inline const struct rb_captured_block *
1575
+ VM_BH_TO_ISEQ_BLOCK(VALUE block_handler)
1576
+ {
1577
+ struct rb_captured_block *captured = VM_TAGGED_PTR_REF(block_handler, 0x03);
1578
+ VM_ASSERT(VM_BH_ISEQ_BLOCK_P(block_handler));
1579
+ return captured;
1580
+ }
1581
+
1582
+ static inline int
1583
+ VM_BH_IFUNC_P(VALUE block_handler)
1584
+ {
1585
+ if ((block_handler & 0x03) == 0x03) {
1586
+ #if VM_CHECK_MODE > 0
1587
+ struct rb_captured_block *captured = (void *)(block_handler & ~0x03);
1588
+ VM_ASSERT(imemo_type_p(captured->code.val, imemo_ifunc));
1589
+ #endif
1590
+ return 1;
1591
+ }
1592
+ else {
1593
+ return 0;
1594
+ }
1595
+ }
1596
+
1597
+ static inline VALUE
1598
+ VM_BH_FROM_IFUNC_BLOCK(const struct rb_captured_block *captured)
1599
+ {
1600
+ VALUE block_handler = VM_TAGGED_PTR_SET(captured, 0x03);
1601
+ VM_ASSERT(VM_BH_IFUNC_P(block_handler));
1602
+ return block_handler;
1603
+ }
1604
+
1605
+ static inline const struct rb_captured_block *
1606
+ VM_BH_TO_IFUNC_BLOCK(VALUE block_handler)
1607
+ {
1608
+ struct rb_captured_block *captured = VM_TAGGED_PTR_REF(block_handler, 0x03);
1609
+ VM_ASSERT(VM_BH_IFUNC_P(block_handler));
1610
+ return captured;
1611
+ }
1612
+
1613
+ static inline const struct rb_captured_block *
1614
+ VM_BH_TO_CAPT_BLOCK(VALUE block_handler)
1615
+ {
1616
+ struct rb_captured_block *captured = VM_TAGGED_PTR_REF(block_handler, 0x03);
1617
+ VM_ASSERT(VM_BH_IFUNC_P(block_handler) || VM_BH_ISEQ_BLOCK_P(block_handler));
1618
+ return captured;
1619
+ }
1620
+
1621
+ static inline enum rb_block_handler_type
1622
+ vm_block_handler_type(VALUE block_handler)
1623
+ {
1624
+ if (VM_BH_ISEQ_BLOCK_P(block_handler)) {
1625
+ return block_handler_type_iseq;
1626
+ }
1627
+ else if (VM_BH_IFUNC_P(block_handler)) {
1628
+ return block_handler_type_ifunc;
1629
+ }
1630
+ else if (SYMBOL_P(block_handler)) {
1631
+ return block_handler_type_symbol;
1632
+ }
1633
+ else {
1634
+ VM_ASSERT(rb_obj_is_proc(block_handler));
1635
+ return block_handler_type_proc;
1636
+ }
1637
+ }
1638
+
1639
+ static inline void
1640
+ vm_block_handler_verify(MAYBE_UNUSED(VALUE block_handler))
1641
+ {
1642
+ VM_ASSERT(block_handler == VM_BLOCK_HANDLER_NONE ||
1643
+ (vm_block_handler_type(block_handler), 1));
1644
+ }
1645
+
1646
+ static inline enum rb_block_type
1647
+ vm_block_type(const struct rb_block *block)
1648
+ {
1649
+ #if VM_CHECK_MODE > 0
1650
+ switch (block->type) {
1651
+ case block_type_iseq:
1652
+ VM_ASSERT(imemo_type_p(block->as.captured.code.val, imemo_iseq));
1653
+ break;
1654
+ case block_type_ifunc:
1655
+ VM_ASSERT(imemo_type_p(block->as.captured.code.val, imemo_ifunc));
1656
+ break;
1657
+ case block_type_symbol:
1658
+ VM_ASSERT(SYMBOL_P(block->as.symbol));
1659
+ break;
1660
+ case block_type_proc:
1661
+ VM_ASSERT(rb_obj_is_proc(block->as.proc));
1662
+ break;
1663
+ }
1664
+ #endif
1665
+ return block->type;
1666
+ }
1667
+
1668
+ static inline void
1669
+ vm_block_type_set(const struct rb_block *block, enum rb_block_type type)
1670
+ {
1671
+ struct rb_block *mb = (struct rb_block *)block;
1672
+ mb->type = type;
1673
+ }
1674
+
1675
+ static inline const struct rb_block *
1676
+ vm_proc_block(VALUE procval)
1677
+ {
1678
+ VM_ASSERT(rb_obj_is_proc(procval));
1679
+ return &((rb_proc_t *)RTYPEDDATA_DATA(procval))->block;
1680
+ }
1681
+
1682
+ static inline const rb_iseq_t *vm_block_iseq(const struct rb_block *block);
1683
+ static inline const VALUE *vm_block_ep(const struct rb_block *block);
1684
+
1685
+ static inline const rb_iseq_t *
1686
+ vm_proc_iseq(VALUE procval)
1687
+ {
1688
+ return vm_block_iseq(vm_proc_block(procval));
1689
+ }
1690
+
1691
+ static inline const VALUE *
1692
+ vm_proc_ep(VALUE procval)
1693
+ {
1694
+ return vm_block_ep(vm_proc_block(procval));
1695
+ }
1696
+
1697
+ static inline const rb_iseq_t *
1698
+ vm_block_iseq(const struct rb_block *block)
1699
+ {
1700
+ switch (vm_block_type(block)) {
1701
+ case block_type_iseq: return rb_iseq_check(block->as.captured.code.iseq);
1702
+ case block_type_proc: return vm_proc_iseq(block->as.proc);
1703
+ case block_type_ifunc:
1704
+ case block_type_symbol: return NULL;
1705
+ }
1706
+ VM_UNREACHABLE(vm_block_iseq);
1707
+ return NULL;
1708
+ }
1709
+
1710
+ static inline const VALUE *
1711
+ vm_block_ep(const struct rb_block *block)
1712
+ {
1713
+ switch (vm_block_type(block)) {
1714
+ case block_type_iseq:
1715
+ case block_type_ifunc: return block->as.captured.ep;
1716
+ case block_type_proc: return vm_proc_ep(block->as.proc);
1717
+ case block_type_symbol: return NULL;
1718
+ }
1719
+ VM_UNREACHABLE(vm_block_ep);
1720
+ return NULL;
1721
+ }
1722
+
1723
+ static inline VALUE
1724
+ vm_block_self(const struct rb_block *block)
1725
+ {
1726
+ switch (vm_block_type(block)) {
1727
+ case block_type_iseq:
1728
+ case block_type_ifunc:
1729
+ return block->as.captured.self;
1730
+ case block_type_proc:
1731
+ return vm_block_self(vm_proc_block(block->as.proc));
1732
+ case block_type_symbol:
1733
+ return Qundef;
1734
+ }
1735
+ VM_UNREACHABLE(vm_block_self);
1736
+ return Qundef;
1737
+ }
1738
+
1739
+ static inline VALUE
1740
+ VM_BH_TO_SYMBOL(VALUE block_handler)
1741
+ {
1742
+ VM_ASSERT(SYMBOL_P(block_handler));
1743
+ return block_handler;
1744
+ }
1745
+
1746
+ static inline VALUE
1747
+ VM_BH_FROM_SYMBOL(VALUE symbol)
1748
+ {
1749
+ VM_ASSERT(SYMBOL_P(symbol));
1750
+ return symbol;
1751
+ }
1752
+
1753
+ static inline VALUE
1754
+ VM_BH_TO_PROC(VALUE block_handler)
1755
+ {
1756
+ VM_ASSERT(rb_obj_is_proc(block_handler));
1757
+ return block_handler;
1758
+ }
1759
+
1760
+ static inline VALUE
1761
+ VM_BH_FROM_PROC(VALUE procval)
1762
+ {
1763
+ VM_ASSERT(rb_obj_is_proc(procval));
1764
+ return procval;
1765
+ }
1766
+
1767
+ /* VM related object allocate functions */
1768
+ VALUE rb_thread_alloc(VALUE klass);
1769
+ VALUE rb_binding_alloc(VALUE klass);
1770
+ VALUE rb_proc_alloc(VALUE klass);
1771
+ VALUE rb_proc_dup(VALUE self);
1772
+
1773
+ /* for debug */
1774
+ extern bool rb_vmdebug_stack_dump_raw(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, FILE *);
1775
+ extern bool rb_vmdebug_debug_print_pre(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, const VALUE *_pc, FILE *);
1776
+ extern bool rb_vmdebug_debug_print_post(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, FILE *);
1777
+
1778
+ #define SDR() rb_vmdebug_stack_dump_raw(GET_EC(), GET_EC()->cfp, stderr)
1779
+ #define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_EC(), (cfp), stderr)
1780
+ bool rb_vm_bugreport(const void *, FILE *);
1781
+ typedef void (*ruby_sighandler_t)(int);
1782
+ RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 4, 5)
1783
+ NORETURN(void rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int sig, const void *, const char *fmt, ...));
1784
+
1785
+ /* functions about thread/vm execution */
1786
+ RUBY_SYMBOL_EXPORT_BEGIN
1787
+ VALUE rb_iseq_eval(const rb_iseq_t *iseq);
1788
+ VALUE rb_iseq_eval_main(const rb_iseq_t *iseq);
1789
+ VALUE rb_iseq_path(const rb_iseq_t *iseq);
1790
+ VALUE rb_iseq_realpath(const rb_iseq_t *iseq);
1791
+ RUBY_SYMBOL_EXPORT_END
1792
+
1793
+ VALUE rb_iseq_pathobj_new(VALUE path, VALUE realpath);
1794
+ void rb_iseq_pathobj_set(const rb_iseq_t *iseq, VALUE path, VALUE realpath);
1795
+
1796
+ int rb_ec_frame_method_id_and_class(const rb_execution_context_t *ec, ID *idp, ID *called_idp, VALUE *klassp);
1797
+ void rb_ec_setup_exception(const rb_execution_context_t *ec, VALUE mesg, VALUE cause);
1798
+
1799
+ VALUE rb_vm_invoke_proc(rb_execution_context_t *ec, rb_proc_t *proc, int argc, const VALUE *argv, int kw_splat, VALUE block_handler);
1800
+
1801
+ VALUE rb_vm_make_proc_lambda(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass, int8_t is_lambda);
1802
+ static inline VALUE
1803
+ rb_vm_make_proc(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass)
1804
+ {
1805
+ return rb_vm_make_proc_lambda(ec, captured, klass, 0);
1806
+ }
1807
+
1808
+ static inline VALUE
1809
+ rb_vm_make_lambda(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass)
1810
+ {
1811
+ return rb_vm_make_proc_lambda(ec, captured, klass, 1);
1812
+ }
1813
+
1814
+ VALUE rb_vm_make_binding(const rb_execution_context_t *ec, const rb_control_frame_t *src_cfp);
1815
+ VALUE rb_vm_env_local_variables(const rb_env_t *env);
1816
+ const rb_env_t *rb_vm_env_prev_env(const rb_env_t *env);
1817
+ const VALUE *rb_binding_add_dynavars(VALUE bindval, rb_binding_t *bind, int dyncount, const ID *dynvars);
1818
+ void rb_vm_inc_const_missing_count(void);
1819
+ VALUE rb_vm_call_kw(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc,
1820
+ const VALUE *argv, const rb_callable_method_entry_t *me, int kw_splat);
1821
+ void rb_vm_pop_frame_no_int(rb_execution_context_t *ec);
1822
+ void rb_vm_pop_frame(rb_execution_context_t *ec);
1823
+
1824
+ void rb_thread_start_timer_thread(void);
1825
+ void rb_thread_stop_timer_thread(void);
1826
+ void rb_thread_reset_timer_thread(void);
1827
+ void rb_thread_wakeup_timer_thread(int);
1828
+
1829
+ static inline void
1830
+ rb_vm_living_threads_init(rb_vm_t *vm)
1831
+ {
1832
+ ccan_list_head_init(&vm->waiting_fds);
1833
+ ccan_list_head_init(&vm->workqueue);
1834
+ ccan_list_head_init(&vm->ractor.set);
1835
+ ccan_list_head_init(&vm->ractor.sched.zombie_threads);
1836
+ }
1837
+
1838
+ typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE);
1839
+ rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp);
1840
+ rb_control_frame_t *rb_vm_get_binding_creatable_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp);
1841
+ VALUE *rb_vm_svar_lep(const rb_execution_context_t *ec, const rb_control_frame_t *cfp);
1842
+ int rb_vm_get_sourceline(const rb_control_frame_t *);
1843
+ void rb_vm_stack_to_heap(rb_execution_context_t *ec);
1844
+ void ruby_thread_init_stack(rb_thread_t *th);
1845
+ rb_thread_t * ruby_thread_from_native(void);
1846
+ int ruby_thread_set_native(rb_thread_t *th);
1847
+ int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, ID *called_idp, VALUE *klassp);
1848
+ void rb_vm_rewind_cfp(rb_execution_context_t *ec, rb_control_frame_t *cfp);
1849
+ void rb_vm_env_write(const VALUE *ep, int index, VALUE v);
1850
+ VALUE rb_vm_bh_to_procval(const rb_execution_context_t *ec, VALUE block_handler);
1851
+
1852
+ void rb_vm_register_special_exception_str(enum ruby_special_exceptions sp, VALUE exception_class, VALUE mesg);
1853
+
1854
+ #define rb_vm_register_special_exception(sp, e, m) \
1855
+ rb_vm_register_special_exception_str(sp, e, rb_usascii_str_new_static((m), (long)rb_strlen_lit(m)))
1856
+
1857
+ void rb_gc_mark_machine_stack(const rb_execution_context_t *ec);
1858
+
1859
+ void rb_vm_rewrite_cref(rb_cref_t *node, VALUE old_klass, VALUE new_klass, rb_cref_t **new_cref_ptr);
1860
+
1861
+ const rb_callable_method_entry_t *rb_vm_frame_method_entry(const rb_control_frame_t *cfp);
1862
+
1863
+ #define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]
1864
+
1865
+ #define CHECK_VM_STACK_OVERFLOW0(cfp, sp, margin) do { \
1866
+ STATIC_ASSERT(sizeof_sp, sizeof(*(sp)) == sizeof(VALUE)); \
1867
+ STATIC_ASSERT(sizeof_cfp, sizeof(*(cfp)) == sizeof(rb_control_frame_t)); \
1868
+ const struct rb_control_frame_struct *bound = (void *)&(sp)[(margin)]; \
1869
+ if (UNLIKELY((cfp) <= &bound[1])) { \
1870
+ vm_stackoverflow(); \
1871
+ } \
1872
+ } while (0)
1873
+
1874
+ #define CHECK_VM_STACK_OVERFLOW(cfp, margin) \
1875
+ CHECK_VM_STACK_OVERFLOW0((cfp), (cfp)->sp, (margin))
1876
+
1877
+ VALUE rb_catch_protect(VALUE t, rb_block_call_func *func, VALUE data, enum ruby_tag_type *stateptr);
1878
+
1879
+ rb_execution_context_t *rb_vm_main_ractor_ec(rb_vm_t *vm); // ractor.c
1880
+
1881
+ /* for thread */
1882
+
1883
+ #if RUBY_VM_THREAD_MODEL == 2
1884
+
1885
+ RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c
1886
+ RUBY_EXTERN rb_vm_t *ruby_current_vm_ptr;
1887
+ RUBY_EXTERN rb_event_flag_t ruby_vm_event_flags;
1888
+ RUBY_EXTERN rb_event_flag_t ruby_vm_event_enabled_global_flags;
1889
+ RUBY_EXTERN unsigned int ruby_vm_event_local_num;
1890
+
1891
+ #define GET_VM() rb_current_vm()
1892
+ #define GET_RACTOR() rb_current_ractor()
1893
+ #define GET_THREAD() rb_current_thread()
1894
+ #define GET_EC() rb_current_execution_context(true)
1895
+
1896
+ static inline rb_thread_t *
1897
+ rb_ec_thread_ptr(const rb_execution_context_t *ec)
1898
+ {
1899
+ return ec->thread_ptr;
1900
+ }
1901
+
1902
+ static inline rb_ractor_t *
1903
+ rb_ec_ractor_ptr(const rb_execution_context_t *ec)
1904
+ {
1905
+ const rb_thread_t *th = rb_ec_thread_ptr(ec);
1906
+ if (th) {
1907
+ VM_ASSERT(th->ractor != NULL);
1908
+ return th->ractor;
1909
+ }
1910
+ else {
1911
+ return NULL;
1912
+ }
1913
+ }
1914
+
1915
+ static inline rb_vm_t *
1916
+ rb_ec_vm_ptr(const rb_execution_context_t *ec)
1917
+ {
1918
+ const rb_thread_t *th = rb_ec_thread_ptr(ec);
1919
+ if (th) {
1920
+ return th->vm;
1921
+ }
1922
+ else {
1923
+ return NULL;
1924
+ }
1925
+ }
1926
+
1927
+ static inline rb_execution_context_t *
1928
+ rb_current_execution_context(bool expect_ec)
1929
+ {
1930
+ #ifdef RB_THREAD_LOCAL_SPECIFIER
1931
+ #ifdef __APPLE__
1932
+ rb_execution_context_t *ec = rb_current_ec();
1933
+ #else
1934
+ rb_execution_context_t *ec = ruby_current_ec;
1935
+ #endif
1936
+
1937
+ /* On the shared objects, `__tls_get_addr()` is used to access the TLS
1938
+ * and the address of the `ruby_current_ec` can be stored on a function
1939
+ * frame. However, this address can be mis-used after native thread
1940
+ * migration of a coroutine.
1941
+ * 1) Get `ptr =&ruby_current_ec` op NT1 and store it on the frame.
1942
+ * 2) Context switch and resume it on the NT2.
1943
+ * 3) `ptr` is used on NT2 but it accesses to the TLS on NT1.
1944
+ * This assertion checks such misusage.
1945
+ *
1946
+ * To avoid accidents, `GET_EC()` should be called once on the frame.
1947
+ * Note that inlining can produce the problem.
1948
+ */
1949
+ VM_ASSERT(ec == rb_current_ec_noinline());
1950
+ #else
1951
+ rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key);
1952
+ #endif
1953
+ VM_ASSERT(!expect_ec || ec != NULL);
1954
+ return ec;
1955
+ }
1956
+
1957
+ static inline rb_thread_t *
1958
+ rb_current_thread(void)
1959
+ {
1960
+ const rb_execution_context_t *ec = GET_EC();
1961
+ return rb_ec_thread_ptr(ec);
1962
+ }
1963
+
1964
+ static inline rb_ractor_t *
1965
+ rb_current_ractor_raw(bool expect)
1966
+ {
1967
+ if (ruby_single_main_ractor) {
1968
+ return ruby_single_main_ractor;
1969
+ }
1970
+ else {
1971
+ const rb_execution_context_t *ec = rb_current_execution_context(expect);
1972
+ return (expect || ec) ? rb_ec_ractor_ptr(ec) : NULL;
1973
+ }
1974
+ }
1975
+
1976
+ static inline rb_ractor_t *
1977
+ rb_current_ractor(void)
1978
+ {
1979
+ return rb_current_ractor_raw(true);
1980
+ }
1981
+
1982
+ static inline rb_vm_t *
1983
+ rb_current_vm(void)
1984
+ {
1985
+ #if 0 // TODO: reconsider the assertions
1986
+ VM_ASSERT(ruby_current_vm_ptr == NULL ||
1987
+ ruby_current_execution_context_ptr == NULL ||
1988
+ rb_ec_thread_ptr(GET_EC()) == NULL ||
1989
+ rb_ec_thread_ptr(GET_EC())->status == THREAD_KILLED ||
1990
+ rb_ec_vm_ptr(GET_EC()) == ruby_current_vm_ptr);
1991
+ #endif
1992
+
1993
+ return ruby_current_vm_ptr;
1994
+ }
1995
+
1996
+ void rb_ec_vm_lock_rec_release(const rb_execution_context_t *ec,
1997
+ unsigned int recorded_lock_rec,
1998
+ unsigned int current_lock_rec);
1999
+
2000
+ static inline unsigned int
2001
+ rb_ec_vm_lock_rec(const rb_execution_context_t *ec)
2002
+ {
2003
+ rb_vm_t *vm = rb_ec_vm_ptr(ec);
2004
+
2005
+ if (vm->ractor.sync.lock_owner != rb_ec_ractor_ptr(ec)) {
2006
+ return 0;
2007
+ }
2008
+ else {
2009
+ return vm->ractor.sync.lock_rec;
2010
+ }
2011
+ }
2012
+
2013
+ #else
2014
+ #error "unsupported thread model"
2015
+ #endif
2016
+
2017
+ enum {
2018
+ TIMER_INTERRUPT_MASK = 0x01,
2019
+ PENDING_INTERRUPT_MASK = 0x02,
2020
+ POSTPONED_JOB_INTERRUPT_MASK = 0x04,
2021
+ TRAP_INTERRUPT_MASK = 0x08,
2022
+ TERMINATE_INTERRUPT_MASK = 0x10,
2023
+ VM_BARRIER_INTERRUPT_MASK = 0x20,
2024
+ };
2025
+
2026
+ #define RUBY_VM_SET_TIMER_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TIMER_INTERRUPT_MASK)
2027
+ #define RUBY_VM_SET_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, PENDING_INTERRUPT_MASK)
2028
+ #define RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, POSTPONED_JOB_INTERRUPT_MASK)
2029
+ #define RUBY_VM_SET_TRAP_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TRAP_INTERRUPT_MASK)
2030
+ #define RUBY_VM_SET_TERMINATE_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TERMINATE_INTERRUPT_MASK)
2031
+ #define RUBY_VM_SET_VM_BARRIER_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, VM_BARRIER_INTERRUPT_MASK)
2032
+ #define RUBY_VM_INTERRUPTED(ec) ((ec)->interrupt_flag & ~(ec)->interrupt_mask & \
2033
+ (PENDING_INTERRUPT_MASK|TRAP_INTERRUPT_MASK))
2034
+
2035
+ static inline bool
2036
+ RUBY_VM_INTERRUPTED_ANY(rb_execution_context_t *ec)
2037
+ {
2038
+ #if defined(USE_VM_CLOCK) && USE_VM_CLOCK
2039
+ uint32_t current_clock = rb_ec_vm_ptr(ec)->clock;
2040
+
2041
+ if (current_clock != ec->checked_clock) {
2042
+ ec->checked_clock = current_clock;
2043
+ RUBY_VM_SET_TIMER_INTERRUPT(ec);
2044
+ }
2045
+ #endif
2046
+ return ec->interrupt_flag & ~(ec)->interrupt_mask;
2047
+ }
2048
+
2049
+ VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt);
2050
+ int rb_signal_buff_size(void);
2051
+ int rb_signal_exec(rb_thread_t *th, int sig);
2052
+ void rb_threadptr_check_signal(rb_thread_t *mth);
2053
+ void rb_threadptr_signal_raise(rb_thread_t *th, int sig);
2054
+ void rb_threadptr_signal_exit(rb_thread_t *th);
2055
+ int rb_threadptr_execute_interrupts(rb_thread_t *, int);
2056
+ void rb_threadptr_interrupt(rb_thread_t *th);
2057
+ void rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th);
2058
+ void rb_threadptr_pending_interrupt_clear(rb_thread_t *th);
2059
+ void rb_threadptr_pending_interrupt_enque(rb_thread_t *th, VALUE v);
2060
+ VALUE rb_ec_get_errinfo(const rb_execution_context_t *ec);
2061
+ void rb_ec_error_print(rb_execution_context_t * volatile ec, volatile VALUE errinfo);
2062
+ void rb_execution_context_update(rb_execution_context_t *ec);
2063
+ void rb_execution_context_mark(const rb_execution_context_t *ec);
2064
+ void rb_fiber_close(rb_fiber_t *fib);
2065
+ void Init_native_thread(rb_thread_t *th);
2066
+ int rb_vm_check_ints_blocking(rb_execution_context_t *ec);
2067
+
2068
+ // vm_sync.h
2069
+ void rb_vm_cond_wait(rb_vm_t *vm, rb_nativethread_cond_t *cond);
2070
+ void rb_vm_cond_timedwait(rb_vm_t *vm, rb_nativethread_cond_t *cond, unsigned long msec);
2071
+
2072
+ #define RUBY_VM_CHECK_INTS(ec) rb_vm_check_ints(ec)
2073
+ static inline void
2074
+ rb_vm_check_ints(rb_execution_context_t *ec)
2075
+ {
2076
+ #ifdef RUBY_ASSERT_CRITICAL_SECTION
2077
+ VM_ASSERT(ruby_assert_critical_section_entered == 0);
2078
+ #endif
2079
+
2080
+ VM_ASSERT(ec == GET_EC());
2081
+
2082
+ if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(ec))) {
2083
+ rb_threadptr_execute_interrupts(rb_ec_thread_ptr(ec), 0);
2084
+ }
2085
+ }
2086
+
2087
+ /* tracer */
2088
+
2089
+ struct rb_trace_arg_struct {
2090
+ rb_event_flag_t event;
2091
+ rb_execution_context_t *ec;
2092
+ const rb_control_frame_t *cfp;
2093
+ VALUE self;
2094
+ ID id;
2095
+ ID called_id;
2096
+ VALUE klass;
2097
+ VALUE data;
2098
+
2099
+ int klass_solved;
2100
+
2101
+ /* calc from cfp */
2102
+ int lineno;
2103
+ VALUE path;
2104
+ };
2105
+
2106
+ void rb_hook_list_mark(rb_hook_list_t *hooks);
2107
+ void rb_hook_list_mark_and_update(rb_hook_list_t *hooks);
2108
+ void rb_hook_list_free(rb_hook_list_t *hooks);
2109
+ void rb_hook_list_connect_tracepoint(VALUE target, rb_hook_list_t *list, VALUE tpval, unsigned int target_line);
2110
+ void rb_hook_list_remove_tracepoint(rb_hook_list_t *list, VALUE tpval);
2111
+
2112
+ void rb_exec_event_hooks(struct rb_trace_arg_struct *trace_arg, rb_hook_list_t *hooks, int pop_p);
2113
+
2114
+ #define EXEC_EVENT_HOOK_ORIG(ec_, hooks_, flag_, self_, id_, called_id_, klass_, data_, pop_p_) do { \
2115
+ const rb_event_flag_t flag_arg_ = (flag_); \
2116
+ rb_hook_list_t *hooks_arg_ = (hooks_); \
2117
+ if (UNLIKELY((hooks_arg_)->events & (flag_arg_))) { \
2118
+ /* defer evaluating the other arguments */ \
2119
+ rb_exec_event_hook_orig(ec_, hooks_arg_, flag_arg_, self_, id_, called_id_, klass_, data_, pop_p_); \
2120
+ } \
2121
+ } while (0)
2122
+
2123
+ static inline void
2124
+ rb_exec_event_hook_orig(rb_execution_context_t *ec, rb_hook_list_t *hooks, rb_event_flag_t flag,
2125
+ VALUE self, ID id, ID called_id, VALUE klass, VALUE data, int pop_p)
2126
+ {
2127
+ struct rb_trace_arg_struct trace_arg;
2128
+
2129
+ VM_ASSERT((hooks->events & flag) != 0);
2130
+
2131
+ trace_arg.event = flag;
2132
+ trace_arg.ec = ec;
2133
+ trace_arg.cfp = ec->cfp;
2134
+ trace_arg.self = self;
2135
+ trace_arg.id = id;
2136
+ trace_arg.called_id = called_id;
2137
+ trace_arg.klass = klass;
2138
+ trace_arg.data = data;
2139
+ trace_arg.path = Qundef;
2140
+ trace_arg.klass_solved = 0;
2141
+
2142
+ rb_exec_event_hooks(&trace_arg, hooks, pop_p);
2143
+ }
2144
+
2145
+ struct rb_ractor_pub {
2146
+ VALUE self;
2147
+ uint32_t id;
2148
+ rb_hook_list_t hooks;
2149
+ };
2150
+
2151
+ static inline rb_hook_list_t *
2152
+ rb_ec_ractor_hooks(const rb_execution_context_t *ec)
2153
+ {
2154
+ struct rb_ractor_pub *cr_pub = (struct rb_ractor_pub *)rb_ec_ractor_ptr(ec);
2155
+ return &cr_pub->hooks;
2156
+ }
2157
+
2158
+ #define EXEC_EVENT_HOOK(ec_, flag_, self_, id_, called_id_, klass_, data_) \
2159
+ EXEC_EVENT_HOOK_ORIG(ec_, rb_ec_ractor_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 0)
2160
+
2161
+ #define EXEC_EVENT_HOOK_AND_POP_FRAME(ec_, flag_, self_, id_, called_id_, klass_, data_) \
2162
+ EXEC_EVENT_HOOK_ORIG(ec_, rb_ec_ractor_hooks(ec_), flag_, self_, id_, called_id_, klass_, data_, 1)
2163
+
2164
+ static inline void
2165
+ rb_exec_event_hook_script_compiled(rb_execution_context_t *ec, const rb_iseq_t *iseq, VALUE eval_script)
2166
+ {
2167
+ EXEC_EVENT_HOOK(ec, RUBY_EVENT_SCRIPT_COMPILED, ec->cfp->self, 0, 0, 0,
2168
+ NIL_P(eval_script) ? (VALUE)iseq :
2169
+ rb_ary_new_from_args(2, eval_script, (VALUE)iseq));
2170
+ }
2171
+
2172
+ void rb_vm_trap_exit(rb_vm_t *vm);
2173
+ void rb_vm_postponed_job_atfork(void); /* vm_trace.c */
2174
+ void rb_vm_postponed_job_free(void); /* vm_trace.c */
2175
+ size_t rb_vm_memsize_postponed_job_queue(void); /* vm_trace.c */
2176
+ void rb_vm_postponed_job_queue_init(rb_vm_t *vm); /* vm_trace.c */
2177
+
2178
+ RUBY_SYMBOL_EXPORT_BEGIN
2179
+
2180
+ int rb_thread_check_trap_pending(void);
2181
+
2182
+ /* #define RUBY_EVENT_RESERVED_FOR_INTERNAL_USE 0x030000 */ /* from vm_core.h */
2183
+ #define RUBY_EVENT_COVERAGE_LINE 0x010000
2184
+ #define RUBY_EVENT_COVERAGE_BRANCH 0x020000
2185
+
2186
+ extern VALUE rb_get_coverages(void);
2187
+ extern void rb_set_coverages(VALUE, int, VALUE);
2188
+ extern void rb_clear_coverages(void);
2189
+ extern void rb_reset_coverages(void);
2190
+ extern void rb_resume_coverages(void);
2191
+ extern void rb_suspend_coverages(void);
2192
+
2193
+ void rb_postponed_job_flush(rb_vm_t *vm);
2194
+
2195
+ // ractor.c
2196
+ RUBY_EXTERN VALUE rb_eRactorUnsafeError;
2197
+ RUBY_EXTERN VALUE rb_eRactorIsolationError;
2198
+
2199
+ RUBY_SYMBOL_EXPORT_END
2200
+
2201
+ #endif /* RUBY_VM_CORE_H */