datadog-ruby_core_source 3.4.1 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. checksums.yaml +4 -4
  2. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/id.h +357 -0
  3. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/id_table.h +15 -0
  4. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/array.h +2 -0
  5. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/basic_operators.h +66 -0
  6. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/bignum.h +256 -0
  7. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/bits.h +647 -0
  8. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/box.h +83 -0
  9. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/class.h +806 -0
  10. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/cmdlineopt.h +3 -0
  11. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/concurrent_set.h +21 -0
  12. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/cont.h +34 -0
  13. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/encoding.h +2 -1
  14. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/error.h +7 -0
  15. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/eval.h +43 -0
  16. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/gc.h +360 -0
  17. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/hash.h +1 -0
  18. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/imemo.h +87 -22
  19. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/inits.h +4 -0
  20. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/io.h +25 -5
  21. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/load.h +2 -0
  22. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/numeric.h +323 -0
  23. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/object.h +1 -1
  24. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/re.h +5 -0
  25. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/sanitizers.h +16 -0
  26. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/set_table.h +70 -0
  27. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/signal.h +1 -0
  28. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/st.h +1 -1
  29. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/string.h +4 -0
  30. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/struct.h +41 -0
  31. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/symbol.h +4 -5
  32. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/thread.h +112 -0
  33. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/time.h +34 -0
  34. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/variable.h +13 -9
  35. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/internal/vm.h +138 -0
  36. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal.h +0 -3
  37. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/iseq.h +359 -0
  38. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/method.h +276 -0
  39. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/prism/ast.h +8254 -0
  40. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/diagnostic.h +7 -0
  41. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/extension.h +1 -1
  42. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/prism/options.h +488 -0
  43. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/parser.h +3 -0
  44. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/prism/prism.h +408 -0
  45. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/regexp.h +2 -2
  46. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_buffer.h +8 -0
  47. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_integer.h +4 -0
  48. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_list.h +6 -0
  49. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_string.h +12 -2
  50. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/version.h +2 -2
  51. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism_compile.h +1 -0
  52. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ractor_core.h +63 -114
  53. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/ruby_atomic.h +73 -0
  54. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/rubyparser.h +1393 -0
  55. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/shape.h +464 -0
  56. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/thread_pthread.h +177 -0
  57. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/vm_core.h +2406 -0
  58. data/lib/datadog/ruby_core_source/ruby-4.0.0-p0/vm_debug.h +124 -0
  59. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/build_assert/build_assert.h +40 -0
  60. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/check_type/check_type.h +63 -0
  61. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/container_of/container_of.h +142 -0
  62. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/list/list.h +791 -0
  63. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/str/str.h +17 -0
  64. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/id.h +7 -5
  65. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/id_table.h +54 -0
  66. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/array.h +154 -0
  67. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/bignum.h +1 -0
  68. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/box.h +81 -0
  69. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/class.h +805 -0
  70. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/cmdlineopt.h +64 -0
  71. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/compar.h +29 -0
  72. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/compile.h +34 -0
  73. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/compilers.h +107 -0
  74. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/complex.h +29 -0
  75. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/concurrent_set.h +21 -0
  76. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/dir.h +16 -0
  77. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/enc.h +19 -0
  78. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/encoding.h +39 -0
  79. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/enum.h +18 -0
  80. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/enumerator.h +21 -0
  81. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/error.h +251 -0
  82. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/eval.h +8 -0
  83. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/file.h +38 -0
  84. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/fixnum.h +185 -0
  85. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/gc.h +25 -0
  86. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/hash.h +194 -0
  87. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/imemo.h +322 -0
  88. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/inits.h +51 -0
  89. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/io.h +163 -0
  90. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/load.h +20 -0
  91. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/loadpath.h +16 -0
  92. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/math.h +23 -0
  93. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/missing.h +19 -0
  94. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/numeric.h +1 -0
  95. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/object.h +63 -0
  96. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/parse.h +131 -0
  97. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/proc.h +30 -0
  98. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/process.h +124 -0
  99. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/ractor.h +10 -0
  100. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/random.h +17 -0
  101. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/range.h +40 -0
  102. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/rational.h +71 -0
  103. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/re.h +33 -0
  104. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/ruby_parser.h +102 -0
  105. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/sanitizers.h +346 -0
  106. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/serial.h +23 -0
  107. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/set_table.h +70 -0
  108. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/signal.h +25 -0
  109. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/st.h +11 -0
  110. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/static_assert.h +16 -0
  111. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/string.h +203 -0
  112. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/struct.h +160 -0
  113. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/symbol.h +46 -0
  114. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/thread.h +14 -10
  115. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/transcode.h +23 -0
  116. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/util.h +27 -0
  117. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/variable.h +74 -0
  118. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/vm.h +3 -4
  119. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/warnings.h +16 -0
  120. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal.h +105 -0
  121. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/iseq.h +7 -1
  122. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/method.h +14 -1
  123. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/node.h +122 -0
  124. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/parser_st.h +162 -0
  125. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/parser_value.h +106 -0
  126. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/prism/ast.h +322 -53
  127. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/defines.h +260 -0
  128. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/diagnostic.h +458 -0
  129. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/encoding.h +283 -0
  130. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/extension.h +19 -0
  131. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/node.h +129 -0
  132. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/prism/options.h +46 -3
  133. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/pack.h +163 -0
  134. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/parser.h +936 -0
  135. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/prettyprint.h +34 -0
  136. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/prism/prism.h +39 -14
  137. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/regexp.h +43 -0
  138. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/static_literals.h +121 -0
  139. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_buffer.h +236 -0
  140. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_char.h +204 -0
  141. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_constant_pool.h +218 -0
  142. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_integer.h +130 -0
  143. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_list.h +103 -0
  144. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_memchr.h +29 -0
  145. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_newline_list.h +113 -0
  146. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_string.h +200 -0
  147. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_strncasecmp.h +32 -0
  148. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_strpbrk.h +46 -0
  149. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/version.h +29 -0
  150. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism_compile.h +106 -0
  151. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ractor_core.h +306 -0
  152. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ruby_assert.h +14 -0
  153. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ruby_atomic.h +66 -0
  154. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/rubyparser.h +15 -1
  155. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/shape.h +444 -0
  156. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/thread_none.h +21 -0
  157. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/thread_pthread.h +10 -2
  158. data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/vm_core.h +160 -45
  159. data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/vm_opts.h +67 -0
  160. data/lib/datadog/ruby_core_source/version.rb +1 -1
  161. data/lib/datadog/ruby_core_source.rb +1 -1
  162. metadata +214 -106
  163. data/CHANGELOG.datadog.md +0 -19
  164. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/internal/class.h +0 -283
  165. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/ruby_atomic.h +0 -23
  166. data/lib/datadog/ruby_core_source/ruby-3.5.0-preview1/shape.h +0 -234
  167. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/build_assert/build_assert.h +0 -0
  168. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/check_type/check_type.h +0 -0
  169. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/container_of/container_of.h +0 -0
  170. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/list/list.h +0 -0
  171. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ccan/str/str.h +0 -0
  172. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compar.h +0 -0
  173. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compile.h +0 -0
  174. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/compilers.h +0 -0
  175. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/complex.h +0 -0
  176. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/dir.h +0 -0
  177. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enc.h +0 -0
  178. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enum.h +0 -0
  179. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/enumerator.h +0 -0
  180. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/file.h +0 -0
  181. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/fixnum.h +0 -0
  182. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/loadpath.h +0 -0
  183. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/math.h +0 -0
  184. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/missing.h +0 -0
  185. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/parse.h +0 -0
  186. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/proc.h +0 -0
  187. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/process.h +0 -0
  188. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/ractor.h +0 -0
  189. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/random.h +0 -0
  190. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/range.h +0 -0
  191. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/rational.h +0 -0
  192. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/ruby_parser.h +0 -0
  193. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/serial.h +0 -0
  194. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/static_assert.h +0 -0
  195. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/transcode.h +0 -0
  196. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/util.h +0 -0
  197. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/internal/warnings.h +0 -0
  198. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/node.h +0 -0
  199. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/parser_st.h +0 -0
  200. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/parser_value.h +0 -0
  201. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/defines.h +0 -0
  202. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/encoding.h +0 -0
  203. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/node.h +0 -0
  204. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/pack.h +0 -0
  205. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/prettyprint.h +0 -0
  206. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/static_literals.h +0 -0
  207. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_char.h +0 -0
  208. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_constant_pool.h +0 -0
  209. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_memchr.h +0 -0
  210. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_newline_list.h +0 -0
  211. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_strncasecmp.h +0 -0
  212. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/prism/util/pm_strpbrk.h +0 -0
  213. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/ruby_assert.h +0 -0
  214. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/thread_none.h +0 -0
  215. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-p0}/vm_opts.h +0 -0
  216. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/basic_operators.h +0 -0
  217. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/bits.h +0 -0
  218. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/cont.h +0 -0
  219. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/internal/time.h +0 -0
  220. /data/lib/datadog/ruby_core_source/{ruby-3.5.0-preview1 → ruby-4.0.0-preview2}/vm_debug.h +0 -0
@@ -0,0 +1,359 @@
1
+ #ifndef RUBY_ISEQ_H
2
+ #define RUBY_ISEQ_H 1
3
+ /**********************************************************************
4
+
5
+ iseq.h -
6
+
7
+ $Author$
8
+ created at: 04/01/01 23:36:57 JST
9
+
10
+ Copyright (C) 2004-2008 Koichi Sasada
11
+
12
+ **********************************************************************/
13
+ #include "internal/gc.h"
14
+ #include "shape.h"
15
+ #include "vm_core.h"
16
+ #include "prism_compile.h"
17
+
18
+ RUBY_EXTERN const int ruby_api_version[];
19
+ #define ISEQ_MAJOR_VERSION ((unsigned int)ruby_api_version[0])
20
+ #define ISEQ_MINOR_VERSION ((unsigned int)ruby_api_version[1])
21
+
22
+ #define ISEQ_MBITS_SIZE sizeof(iseq_bits_t)
23
+ #define ISEQ_MBITS_BITLENGTH (ISEQ_MBITS_SIZE * CHAR_BIT)
24
+ #define ISEQ_MBITS_SET(buf, i) (buf[(i) / ISEQ_MBITS_BITLENGTH] |= ((iseq_bits_t)1 << ((i) % ISEQ_MBITS_BITLENGTH)))
25
+ #define ISEQ_MBITS_SET_P(buf, i) ((buf[(i) / ISEQ_MBITS_BITLENGTH] >> ((i) % ISEQ_MBITS_BITLENGTH)) & 0x1)
26
+ #define ISEQ_MBITS_BUFLEN(size) roomof(size, ISEQ_MBITS_BITLENGTH)
27
+
28
+ #ifndef USE_ISEQ_NODE_ID
29
+ #define USE_ISEQ_NODE_ID 1
30
+ #endif
31
+
32
+ #ifndef rb_iseq_t
33
+ typedef struct rb_iseq_struct rb_iseq_t;
34
+ #define rb_iseq_t rb_iseq_t
35
+ #endif
36
+ typedef void (*rb_iseq_callback)(const rb_iseq_t *, void *);
37
+
38
+ extern const ID rb_iseq_shared_exc_local_tbl[];
39
+
40
+ #define ISEQ_COVERAGE(iseq) ISEQ_BODY(iseq)->variable.coverage
41
+ #define ISEQ_COVERAGE_SET(iseq, cov) RB_OBJ_WRITE(iseq, &ISEQ_BODY(iseq)->variable.coverage, cov)
42
+ #define ISEQ_LINE_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_LINES)
43
+ #define ISEQ_BRANCH_COVERAGE(iseq) RARRAY_AREF(ISEQ_COVERAGE(iseq), COVERAGE_INDEX_BRANCHES)
44
+
45
+ #define ISEQ_PC2BRANCHINDEX(iseq) ISEQ_BODY(iseq)->variable.pc2branchindex
46
+ #define ISEQ_PC2BRANCHINDEX_SET(iseq, h) RB_OBJ_WRITE(iseq, &ISEQ_BODY(iseq)->variable.pc2branchindex, h)
47
+
48
+ #define ISEQ_FLIP_CNT(iseq) ISEQ_BODY(iseq)->variable.flip_count
49
+
50
+ #define ISEQ_FROZEN_STRING_LITERAL_ENABLED 1
51
+ #define ISEQ_FROZEN_STRING_LITERAL_DISABLED 0
52
+ #define ISEQ_FROZEN_STRING_LITERAL_UNSET -1
53
+
54
+ static inline rb_snum_t
55
+ ISEQ_FLIP_CNT_INCREMENT(const rb_iseq_t *iseq)
56
+ {
57
+ rb_snum_t cnt = ISEQ_BODY(iseq)->variable.flip_count;
58
+ ISEQ_BODY(iseq)->variable.flip_count += 1;
59
+ return cnt;
60
+ }
61
+
62
+ static inline VALUE *
63
+ ISEQ_ORIGINAL_ISEQ(const rb_iseq_t *iseq)
64
+ {
65
+ return ISEQ_BODY(iseq)->variable.original_iseq;
66
+ }
67
+
68
+ static inline void
69
+ ISEQ_ORIGINAL_ISEQ_CLEAR(const rb_iseq_t *iseq)
70
+ {
71
+ void *ptr = ISEQ_BODY(iseq)->variable.original_iseq;
72
+ ISEQ_BODY(iseq)->variable.original_iseq = NULL;
73
+ ruby_xfree(ptr);
74
+ }
75
+
76
+ static inline VALUE *
77
+ ISEQ_ORIGINAL_ISEQ_ALLOC(const rb_iseq_t *iseq, long size)
78
+ {
79
+ return ISEQ_BODY(iseq)->variable.original_iseq =
80
+ ALLOC_N(VALUE, size);
81
+ }
82
+
83
+ #define ISEQ_TRACE_EVENTS (RUBY_EVENT_LINE | \
84
+ RUBY_EVENT_CLASS | \
85
+ RUBY_EVENT_END | \
86
+ RUBY_EVENT_CALL | \
87
+ RUBY_EVENT_RETURN| \
88
+ RUBY_EVENT_C_CALL| \
89
+ RUBY_EVENT_C_RETURN | \
90
+ RUBY_EVENT_B_CALL | \
91
+ RUBY_EVENT_B_RETURN | \
92
+ RUBY_EVENT_RESCUE | \
93
+ RUBY_EVENT_COVERAGE_LINE| \
94
+ RUBY_EVENT_COVERAGE_BRANCH)
95
+
96
+ #define ISEQ_NOT_LOADED_YET IMEMO_FL_USER1
97
+ #define ISEQ_USE_COMPILE_DATA IMEMO_FL_USER2
98
+ #define ISEQ_TRANSLATED IMEMO_FL_USER3
99
+
100
+ #define ISEQ_EXECUTABLE_P(iseq) (FL_TEST_RAW(((VALUE)iseq), ISEQ_NOT_LOADED_YET | ISEQ_USE_COMPILE_DATA) == 0)
101
+
102
+ struct iseq_compile_data {
103
+ /* GC is needed */
104
+ const VALUE err_info;
105
+ const VALUE catch_table_ary; /* Array */
106
+
107
+ /* Mirror fields from ISEQ_BODY so they are accessible during iseq setup */
108
+ unsigned int iseq_size;
109
+ VALUE *iseq_encoded; /* half-encoded iseq (insn addr and operands) */
110
+ bool is_single_mark_bit; /* identifies whether mark bits are single or a list */
111
+
112
+ union {
113
+ iseq_bits_t * list; /* Find references for GC */
114
+ iseq_bits_t single;
115
+ } mark_bits;
116
+
117
+ /* GC is not needed */
118
+ struct iseq_label_data *start_label;
119
+ struct iseq_label_data *end_label;
120
+ struct iseq_label_data *redo_label;
121
+ const rb_iseq_t *current_block;
122
+ struct iseq_compile_data_ensure_node_stack *ensure_node_stack;
123
+ struct {
124
+ struct iseq_compile_data_storage *storage_head;
125
+ struct iseq_compile_data_storage *storage_current;
126
+ } node;
127
+ struct {
128
+ struct iseq_compile_data_storage *storage_head;
129
+ struct iseq_compile_data_storage *storage_current;
130
+ } insn;
131
+ bool in_rescue;
132
+ bool in_masgn;
133
+ int loopval_popped; /* used by NODE_BREAK */
134
+ int last_line;
135
+ int label_no;
136
+ int node_level;
137
+ int isolated_depth;
138
+ unsigned int ci_index;
139
+ unsigned int ic_index;
140
+ const rb_compile_option_t *option;
141
+ struct rb_id_table *ivar_cache_table;
142
+ const struct rb_builtin_function *builtin_function_table;
143
+ const NODE *root_node;
144
+ bool catch_except_p; // If a frame of this ISeq may catch exception, set true.
145
+ #if OPT_SUPPORT_JOKE
146
+ st_table *labels_table;
147
+ #endif
148
+ };
149
+
150
+ static inline struct iseq_compile_data *
151
+ ISEQ_COMPILE_DATA(const rb_iseq_t *iseq)
152
+ {
153
+ if (iseq->flags & ISEQ_USE_COMPILE_DATA) {
154
+ return iseq->aux.compile_data;
155
+ }
156
+ else {
157
+ return NULL;
158
+ }
159
+ }
160
+
161
+ static inline void
162
+ ISEQ_COMPILE_DATA_ALLOC(rb_iseq_t *iseq)
163
+ {
164
+ iseq->aux.compile_data = ZALLOC(struct iseq_compile_data);
165
+ iseq->flags |= ISEQ_USE_COMPILE_DATA;
166
+ }
167
+
168
+ static inline void
169
+ ISEQ_COMPILE_DATA_CLEAR(rb_iseq_t *iseq)
170
+ {
171
+ iseq->flags &= ~ISEQ_USE_COMPILE_DATA;
172
+ iseq->aux.compile_data = NULL;
173
+ }
174
+
175
+ static inline rb_iseq_t *
176
+ iseq_imemo_alloc(void)
177
+ {
178
+ rb_iseq_t *iseq = SHAREABLE_IMEMO_NEW(rb_iseq_t, imemo_iseq, 0);
179
+
180
+ // Clear out the whole iseq except for the flags.
181
+ memset((char *)iseq + sizeof(VALUE), 0, sizeof(rb_iseq_t) - sizeof(VALUE));
182
+
183
+ return iseq;
184
+ }
185
+
186
+ VALUE rb_iseq_ibf_dump(const rb_iseq_t *iseq, VALUE opt);
187
+ void rb_ibf_load_iseq_complete(rb_iseq_t *iseq);
188
+ const rb_iseq_t *rb_iseq_ibf_load(VALUE str);
189
+ const rb_iseq_t *rb_iseq_ibf_load_bytes(const char *cstr, size_t);
190
+ VALUE rb_iseq_ibf_load_extra_data(VALUE str);
191
+ void rb_iseq_init_trace(rb_iseq_t *iseq);
192
+ int rb_iseq_add_local_tracepoint_recursively(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line, bool target_bmethod);
193
+ int rb_iseq_remove_local_tracepoint_recursively(const rb_iseq_t *iseq, VALUE tpval, rb_ractor_t *r);
194
+ const rb_iseq_t *rb_iseq_load_iseq(VALUE fname);
195
+ const rb_iseq_t *rb_iseq_compile_iseq(VALUE str, VALUE fname);
196
+ int rb_iseq_opt_frozen_string_literal(void);
197
+ rb_hook_list_t *rb_iseq_local_hooks(const rb_iseq_t *iseq, rb_ractor_t *r, bool create);
198
+
199
+
200
+ #if VM_INSN_INFO_TABLE_IMPL == 2
201
+ unsigned int *rb_iseq_insns_info_decode_positions(const struct rb_iseq_constant_body *body);
202
+ #endif
203
+
204
+ int rb_vm_insn_addr2opcode(const void *addr);
205
+
206
+ RUBY_SYMBOL_EXPORT_BEGIN
207
+
208
+ /* compile.c */
209
+ VALUE rb_iseq_compile_node(rb_iseq_t *iseq, const NODE *node);
210
+ VALUE rb_iseq_compile_callback(rb_iseq_t *iseq, const struct rb_iseq_new_with_callback_callback_func * ifunc);
211
+ VALUE *rb_iseq_original_iseq(const rb_iseq_t *iseq);
212
+ void rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc,
213
+ VALUE locals, VALUE args,
214
+ VALUE exception, VALUE body);
215
+ void rb_iseq_mark_and_move_insn_storage(struct iseq_compile_data_storage *arena);
216
+
217
+ VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
218
+ VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
219
+ unsigned int rb_iseq_line_no(const rb_iseq_t *iseq, size_t pos);
220
+ #ifdef USE_ISEQ_NODE_ID
221
+ int rb_iseq_node_id(const rb_iseq_t *iseq, size_t pos);
222
+ #endif
223
+ void rb_iseq_trace_set(const rb_iseq_t *iseq, rb_event_flag_t turnon_events);
224
+ void rb_iseq_trace_set_all(rb_event_flag_t turnon_events);
225
+ void rb_iseq_insns_info_encode_positions(const rb_iseq_t *iseq);
226
+
227
+ struct rb_iseq_constant_body *rb_iseq_constant_body_alloc(void);
228
+ VALUE rb_iseqw_new(const rb_iseq_t *iseq);
229
+ const rb_iseq_t *rb_iseqw_to_iseq(VALUE iseqw);
230
+
231
+ VALUE rb_iseq_absolute_path(const rb_iseq_t *iseq); /* obsolete */
232
+ int rb_iseq_from_eval_p(const rb_iseq_t *iseq);
233
+ VALUE rb_iseq_type(const rb_iseq_t *iseq);
234
+ VALUE rb_iseq_label(const rb_iseq_t *iseq);
235
+ VALUE rb_iseq_base_label(const rb_iseq_t *iseq);
236
+ VALUE rb_iseq_first_lineno(const rb_iseq_t *iseq);
237
+ VALUE rb_iseq_method_name(const rb_iseq_t *iseq);
238
+ void rb_iseq_code_location(const rb_iseq_t *iseq, int *first_lineno, int *first_column, int *last_lineno, int *last_column);
239
+
240
+ void rb_iseq_remove_coverage_all(void);
241
+
242
+ /* proc.c */
243
+ const rb_iseq_t *rb_method_iseq(VALUE body);
244
+ const rb_iseq_t *rb_proc_get_iseq(VALUE proc, int *is_proc);
245
+
246
+ struct rb_compile_option_struct {
247
+ unsigned int inline_const_cache: 1;
248
+ unsigned int peephole_optimization: 1;
249
+ unsigned int tailcall_optimization: 1;
250
+ unsigned int specialized_instruction: 1;
251
+ unsigned int operands_unification: 1;
252
+ unsigned int instructions_unification: 1;
253
+ signed int frozen_string_literal: 2; /* -1: not specified, 0: false, 1: true */
254
+ unsigned int debug_frozen_string_literal: 1;
255
+ unsigned int coverage_enabled: 1;
256
+ int debug_level;
257
+ };
258
+
259
+ struct iseq_insn_info_entry {
260
+ int line_no;
261
+ #ifdef USE_ISEQ_NODE_ID
262
+ int node_id;
263
+ #endif
264
+ rb_event_flag_t events;
265
+ };
266
+
267
+ /*
268
+ * iseq type:
269
+ * CATCH_TYPE_RESCUE, CATCH_TYPE_ENSURE:
270
+ * use iseq as continuation.
271
+ *
272
+ * CATCH_TYPE_BREAK (iter):
273
+ * use iseq as key.
274
+ *
275
+ * CATCH_TYPE_BREAK (while), CATCH_TYPE_RETRY,
276
+ * CATCH_TYPE_REDO, CATCH_TYPE_NEXT:
277
+ * NULL.
278
+ */
279
+ enum rb_catch_type {
280
+ CATCH_TYPE_RESCUE = INT2FIX(1),
281
+ CATCH_TYPE_ENSURE = INT2FIX(2),
282
+ CATCH_TYPE_RETRY = INT2FIX(3),
283
+ CATCH_TYPE_BREAK = INT2FIX(4),
284
+ CATCH_TYPE_REDO = INT2FIX(5),
285
+ CATCH_TYPE_NEXT = INT2FIX(6)
286
+ };
287
+
288
+ struct iseq_catch_table_entry {
289
+ enum rb_catch_type type;
290
+ rb_iseq_t *iseq;
291
+
292
+ unsigned int start;
293
+ unsigned int end;
294
+ unsigned int cont;
295
+ unsigned int sp;
296
+ };
297
+
298
+ RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_BEGIN()
299
+ struct iseq_catch_table {
300
+ unsigned int size;
301
+ struct iseq_catch_table_entry entries[FLEX_ARY_LEN];
302
+ } RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_END();
303
+
304
+ static inline int
305
+ iseq_catch_table_bytes(int n)
306
+ {
307
+ enum {
308
+ catch_table_entry_size = sizeof(struct iseq_catch_table_entry),
309
+ catch_table_entries_max = (INT_MAX - offsetof(struct iseq_catch_table, entries)) / catch_table_entry_size
310
+ };
311
+ if (n > catch_table_entries_max) rb_fatal("too large iseq_catch_table - %d", n);
312
+ return (int)(offsetof(struct iseq_catch_table, entries) +
313
+ n * catch_table_entry_size);
314
+ }
315
+
316
+ #define INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE (512)
317
+
318
+ struct iseq_compile_data_storage {
319
+ struct iseq_compile_data_storage *next;
320
+ unsigned int pos;
321
+ unsigned int size;
322
+ char buff[FLEX_ARY_LEN];
323
+ };
324
+
325
+ /* defined? */
326
+
327
+ enum defined_type {
328
+ DEFINED_NOT_DEFINED,
329
+ DEFINED_NIL = 1,
330
+ DEFINED_IVAR,
331
+ DEFINED_LVAR,
332
+ DEFINED_GVAR,
333
+ DEFINED_CVAR,
334
+ DEFINED_CONST,
335
+ DEFINED_METHOD,
336
+ DEFINED_YIELD,
337
+ DEFINED_ZSUPER,
338
+ DEFINED_SELF,
339
+ DEFINED_TRUE,
340
+ DEFINED_FALSE,
341
+ DEFINED_ASGN,
342
+ DEFINED_EXPR,
343
+ DEFINED_REF,
344
+ DEFINED_FUNC,
345
+ DEFINED_CONST_FROM
346
+ };
347
+
348
+ VALUE rb_iseq_defined_string(enum defined_type type);
349
+
350
+ /* vm.c */
351
+ VALUE rb_iseq_local_variables(const rb_iseq_t *iseq);
352
+
353
+ attr_index_t rb_estimate_iv_count(VALUE klass, const rb_iseq_t * initialize_iseq);
354
+
355
+ void rb_free_encoded_insn_data(void);
356
+
357
+ RUBY_SYMBOL_EXPORT_END
358
+
359
+ #endif /* RUBY_ISEQ_H */
@@ -0,0 +1,276 @@
1
+ #ifndef RUBY_METHOD_H
2
+ #define RUBY_METHOD_H 1
3
+ /**********************************************************************
4
+
5
+ method.h -
6
+
7
+ $Author$
8
+ created at: Wed Jul 15 20:02:33 2009
9
+
10
+ Copyright (C) 2009 Koichi Sasada
11
+
12
+ **********************************************************************/
13
+
14
+ #include "internal.h"
15
+ #include "internal/imemo.h"
16
+ #include "internal/compilers.h"
17
+ #include "internal/static_assert.h"
18
+ #include "ruby/atomic.h"
19
+
20
+ #ifndef END_OF_ENUMERATION
21
+ # if defined(__GNUC__) &&! defined(__STRICT_ANSI__)
22
+ # define END_OF_ENUMERATION(key)
23
+ # else
24
+ # define END_OF_ENUMERATION(key) END_OF_##key##_PLACEHOLDER = 0
25
+ # endif
26
+ #endif
27
+
28
+ /* cref */
29
+
30
+ typedef enum {
31
+ METHOD_VISI_UNDEF = 0x00,
32
+ METHOD_VISI_PUBLIC = 0x01,
33
+ METHOD_VISI_PRIVATE = 0x02,
34
+ METHOD_VISI_PROTECTED = 0x03,
35
+
36
+ METHOD_VISI_MASK = 0x03
37
+ } rb_method_visibility_t;
38
+
39
+ typedef struct rb_scope_visi_struct {
40
+ BITFIELD(rb_method_visibility_t, method_visi, 3);
41
+ unsigned int module_func : 1;
42
+ } rb_scope_visibility_t;
43
+
44
+ /*! CREF (Class REFerence) */
45
+ typedef struct rb_cref_struct {
46
+ VALUE flags;
47
+ VALUE refinements;
48
+ VALUE klass_or_self;
49
+ struct rb_cref_struct * next;
50
+ const rb_scope_visibility_t scope_visi;
51
+ } rb_cref_t;
52
+
53
+ /* method data type */
54
+
55
+ typedef struct rb_method_entry_struct {
56
+ VALUE flags;
57
+ VALUE defined_class;
58
+ struct rb_method_definition_struct * const def;
59
+ ID called_id;
60
+ VALUE owner;
61
+ } rb_method_entry_t;
62
+
63
+ typedef struct rb_callable_method_entry_struct { /* same fields with rb_method_entry_t */
64
+ VALUE flags;
65
+ const VALUE defined_class;
66
+ struct rb_method_definition_struct * const def;
67
+ ID called_id;
68
+ const VALUE owner;
69
+ } rb_callable_method_entry_t;
70
+
71
+ #define METHOD_ENTRY_VISI(me) (rb_method_visibility_t)(((me)->flags & (IMEMO_FL_USER0 | IMEMO_FL_USER1)) >> (IMEMO_FL_USHIFT+0))
72
+ #define METHOD_ENTRY_BASIC(me) (int) (((me)->flags & (IMEMO_FL_USER2 )) >> (IMEMO_FL_USHIFT+2))
73
+ #define METHOD_ENTRY_COMPLEMENTED(me) ((me)->flags & IMEMO_FL_USER3)
74
+ #define METHOD_ENTRY_COMPLEMENTED_SET(me) ((me)->flags |= IMEMO_FL_USER3)
75
+ #define METHOD_ENTRY_CACHED(me) ((me)->flags & IMEMO_FL_USER4)
76
+ #define METHOD_ENTRY_INVALIDATED(me) ((me)->flags & IMEMO_FL_USER5)
77
+ #define METHOD_ENTRY_INVALIDATED_SET(me) ((me)->flags |= IMEMO_FL_USER5)
78
+
79
+ static inline void
80
+ METHOD_ENTRY_CACHED_SET(rb_callable_method_entry_t *me)
81
+ {
82
+ if (!METHOD_ENTRY_CACHED(me)) {
83
+ me->flags |= IMEMO_FL_USER4;
84
+ }
85
+ }
86
+
87
+ static inline void
88
+ METHOD_ENTRY_VISI_SET(rb_method_entry_t *me, rb_method_visibility_t visi)
89
+ {
90
+ VM_ASSERT((int)visi >= 0 && visi <= 3);
91
+ me->flags = (me->flags & ~(IMEMO_FL_USER0 | IMEMO_FL_USER1)) | (visi << (IMEMO_FL_USHIFT+0));
92
+ }
93
+ static inline void
94
+ METHOD_ENTRY_BASIC_SET(rb_method_entry_t *me, unsigned int basic)
95
+ {
96
+ VM_ASSERT(basic <= 1);
97
+ me->flags = (me->flags & ~(IMEMO_FL_USER2 )) | (basic << (IMEMO_FL_USHIFT+2));
98
+ }
99
+ static inline void
100
+ METHOD_ENTRY_FLAGS_SET(rb_method_entry_t *me, rb_method_visibility_t visi, unsigned int basic)
101
+ {
102
+ VM_ASSERT((int)visi >= 0 && visi <= 3);
103
+ VM_ASSERT(basic <= 1);
104
+ me->flags =
105
+ (me->flags & ~(IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2)) |
106
+ ((visi << (IMEMO_FL_USHIFT+0)) | (basic << (IMEMO_FL_USHIFT+2)));
107
+ }
108
+ static inline void
109
+ METHOD_ENTRY_FLAGS_COPY(rb_method_entry_t *dst, const rb_method_entry_t *src)
110
+ {
111
+ dst->flags =
112
+ (dst->flags & ~(IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2
113
+ |IMEMO_FL_USER3)) |
114
+ (src->flags & (IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2|IMEMO_FL_USER3));
115
+ }
116
+
117
+ typedef enum {
118
+ VM_METHOD_TYPE_ISEQ, /*!< Ruby method */
119
+ VM_METHOD_TYPE_CFUNC, /*!< C method */
120
+ VM_METHOD_TYPE_ATTRSET, /*!< attr_writer or attr_accessor */
121
+ VM_METHOD_TYPE_IVAR, /*!< attr_reader or attr_accessor */
122
+ VM_METHOD_TYPE_BMETHOD,
123
+ VM_METHOD_TYPE_ZSUPER,
124
+ VM_METHOD_TYPE_ALIAS,
125
+ VM_METHOD_TYPE_UNDEF,
126
+ VM_METHOD_TYPE_NOTIMPLEMENTED,
127
+ VM_METHOD_TYPE_OPTIMIZED, /*!< Kernel#send, Proc#call, etc */
128
+ VM_METHOD_TYPE_MISSING, /*!< wrapper for method_missing(id) */
129
+ VM_METHOD_TYPE_REFINED, /*!< refinement */
130
+
131
+ END_OF_ENUMERATION(VM_METHOD_TYPE)
132
+ } rb_method_type_t;
133
+ #define VM_METHOD_TYPE_MINIMUM_BITS 4
134
+ STATIC_ASSERT(VM_METHOD_TYPE_MINIMUM_BITS,
135
+ VM_METHOD_TYPE_REFINED <= (1<<VM_METHOD_TYPE_MINIMUM_BITS));
136
+
137
+ #ifndef rb_iseq_t
138
+ typedef struct rb_iseq_struct rb_iseq_t;
139
+ #define rb_iseq_t rb_iseq_t
140
+ #endif
141
+
142
+ typedef struct rb_method_iseq_struct {
143
+ const rb_iseq_t * iseqptr; /*!< iseq pointer, should be separated from iseqval */
144
+ rb_cref_t * cref; /*!< class reference, should be marked */
145
+ } rb_method_iseq_t; /* check rb_add_method_iseq() when modify the fields */
146
+
147
+ typedef VALUE (*rb_cfunc_t)(ANYARGS);
148
+ typedef struct rb_method_cfunc_struct {
149
+ rb_cfunc_t func;
150
+ VALUE (*invoker)(VALUE recv, int argc, const VALUE *argv, VALUE (*func)(ANYARGS));
151
+ int argc;
152
+ } rb_method_cfunc_t;
153
+
154
+ typedef struct rb_method_attr_struct {
155
+ ID id;
156
+ VALUE location; /* should be marked */
157
+ } rb_method_attr_t;
158
+
159
+ typedef struct rb_method_alias_struct {
160
+ struct rb_method_entry_struct * original_me; /* original_me->klass is original owner */
161
+ } rb_method_alias_t;
162
+
163
+ typedef struct rb_method_refined_struct {
164
+ struct rb_method_entry_struct * orig_me;
165
+ } rb_method_refined_t;
166
+
167
+ typedef struct rb_method_bmethod_struct {
168
+ VALUE proc; /* should be marked */
169
+ rb_serial_t defined_ractor_id;
170
+ unsigned int local_hooks_cnt;
171
+ } rb_method_bmethod_t;
172
+
173
+ enum method_optimized_type {
174
+ OPTIMIZED_METHOD_TYPE_SEND,
175
+ OPTIMIZED_METHOD_TYPE_CALL,
176
+ OPTIMIZED_METHOD_TYPE_BLOCK_CALL,
177
+ OPTIMIZED_METHOD_TYPE_STRUCT_AREF,
178
+ OPTIMIZED_METHOD_TYPE_STRUCT_ASET,
179
+ OPTIMIZED_METHOD_TYPE__MAX
180
+ };
181
+
182
+ typedef struct rb_method_optimized {
183
+ enum method_optimized_type type;
184
+ unsigned int index;
185
+ } rb_method_optimized_t;
186
+
187
+ struct rb_method_definition_struct {
188
+ BITFIELD(rb_method_type_t, type, VM_METHOD_TYPE_MINIMUM_BITS);
189
+ unsigned int iseq_overload: 1;
190
+ unsigned int no_redef_warning: 1;
191
+ unsigned int aliased : 1;
192
+
193
+ rb_atomic_t reference_count;
194
+
195
+ union {
196
+ rb_method_iseq_t iseq;
197
+ rb_method_cfunc_t cfunc;
198
+ rb_method_attr_t attr;
199
+ rb_method_alias_t alias;
200
+ rb_method_refined_t refined;
201
+ rb_method_bmethod_t bmethod;
202
+ rb_method_optimized_t optimized;
203
+ } body;
204
+
205
+ ID original_id;
206
+ uintptr_t method_serial;
207
+ const rb_box_t *box;
208
+ };
209
+
210
+ struct rb_id_table;
211
+ struct rb_ractor_struct;
212
+ struct rb_hook_list_struct;
213
+
214
+ typedef struct rb_method_definition_struct rb_method_definition_t;
215
+ STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body) <= 8);
216
+
217
+ #define UNDEFINED_METHOD_ENTRY_P(me) (!(me) || !(me)->def || (me)->def->type == VM_METHOD_TYPE_UNDEF)
218
+ #define UNDEFINED_REFINED_METHOD_P(def) \
219
+ ((def)->type == VM_METHOD_TYPE_REFINED && \
220
+ UNDEFINED_METHOD_ENTRY_P((def)->body.refined.orig_me))
221
+
222
+ void rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_visibility_t visi);
223
+ void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_visibility_t visi);
224
+ void rb_add_method_iseq(VALUE klass, ID mid, const rb_iseq_t *iseq, rb_cref_t *cref, rb_method_visibility_t visi);
225
+ void rb_add_method_optimized(VALUE klass, ID mid, enum method_optimized_type, unsigned int index, rb_method_visibility_t visi);
226
+ void rb_add_refined_method_entry(VALUE refined_class, ID mid);
227
+
228
+ rb_method_entry_t *rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_visibility_t noex);
229
+ rb_method_entry_t *rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, rb_method_definition_t *def);
230
+
231
+ const rb_method_entry_t *rb_method_entry_at(VALUE obj, ID id);
232
+
233
+ const rb_method_entry_t *rb_method_entry(VALUE klass, ID id);
234
+ const rb_method_entry_t *rb_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class);
235
+ const rb_method_entry_t *rb_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class);
236
+ const rb_method_entry_t *rb_resolve_refined_method(VALUE refinements, const rb_method_entry_t *me);
237
+ RUBY_SYMBOL_EXPORT_BEGIN
238
+ const rb_method_entry_t *rb_resolve_me_location(const rb_method_entry_t *, VALUE[5]);
239
+ RUBY_SYMBOL_EXPORT_END
240
+
241
+ const rb_callable_method_entry_t *rb_callable_method_entry(VALUE klass, ID id);
242
+ const rb_callable_method_entry_t *rb_callable_method_entry_or_negative(VALUE klass, ID id);
243
+ const rb_callable_method_entry_t *rb_callable_method_entry_with_refinements(VALUE klass, ID id, VALUE *defined_class);
244
+ const rb_callable_method_entry_t *rb_callable_method_entry_without_refinements(VALUE klass, ID id, VALUE *defined_class);
245
+
246
+ int rb_method_entry_arity(const rb_method_entry_t *me);
247
+ int rb_method_entry_eq(const rb_method_entry_t *m1, const rb_method_entry_t *m2);
248
+ st_index_t rb_hash_method_entry(st_index_t hash, const rb_method_entry_t *me);
249
+
250
+ VALUE rb_method_entry_location(const rb_method_entry_t *me);
251
+
252
+ void rb_free_method_entry_vm_weak_references(const rb_method_entry_t *me);
253
+ void rb_free_method_entry(const rb_method_entry_t *me);
254
+
255
+ const rb_method_entry_t *rb_method_entry_clone(const rb_method_entry_t *me);
256
+ const rb_callable_method_entry_t *rb_method_entry_complement_defined_class(const rb_method_entry_t *src_me, ID called_id, VALUE defined_class);
257
+ void rb_method_entry_copy(rb_method_entry_t *dst, const rb_method_entry_t *src);
258
+
259
+ void rb_method_table_insert(VALUE klass, struct rb_id_table *table, ID method_id, const rb_method_entry_t *me);
260
+ void rb_method_table_insert0(VALUE klass, struct rb_id_table *table, ID method_id, const rb_method_entry_t *me, bool iclass_shared_mtbl);
261
+
262
+ void rb_scope_visibility_set(rb_method_visibility_t);
263
+
264
+ VALUE rb_unnamed_parameters(int arity);
265
+
266
+ void rb_vm_insert_cc_refinement(const struct rb_callcache *cc);
267
+ void rb_vm_delete_cc_refinement(const struct rb_callcache *cc);
268
+
269
+ void rb_clear_method_cache(VALUE klass_or_module, ID mid);
270
+ void rb_clear_all_refinement_method_cache(void);
271
+ void rb_invalidate_method_caches(struct rb_id_table *cm_tbl, VALUE cc_tbl);
272
+ struct rb_hook_list_struct *rb_method_def_local_hooks(rb_method_definition_t *def, struct rb_ractor_struct *cr, bool create);
273
+ void rb_method_definition_addref(rb_method_definition_t *def);
274
+ void rb_method_definition_release(rb_method_definition_t *def);
275
+
276
+ #endif /* RUBY_METHOD_H */