debase-ruby_core_source 0.10.10 → 0.10.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +6 -3
  3. data/debase-ruby_core_source.gemspec +4 -4
  4. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/addr2line.h +20 -0
  5. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/builtin.h +83 -0
  6. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/build_assert/build_assert.h +40 -0
  7. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/check_type/check_type.h +63 -0
  8. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/container_of/container_of.h +142 -0
  9. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/list/list.h +788 -0
  10. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/str/str.h +16 -0
  11. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/constant.h +55 -0
  12. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/debug_counter.h +457 -0
  13. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/dln.h +36 -0
  14. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/encindex.h +70 -0
  15. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/eval_intern.h +323 -0
  16. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/gc.h +140 -0
  17. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/hrtime.h +168 -0
  18. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/id.h +290 -0
  19. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/id_table.h +36 -0
  20. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/insns.inc +249 -0
  21. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/insns_info.inc +8983 -0
  22. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/array.h +119 -0
  23. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/bignum.h +246 -0
  24. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/bits.h +566 -0
  25. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/class.h +174 -0
  26. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compar.h +50 -0
  27. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compile.h +32 -0
  28. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compilers.h +108 -0
  29. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/complex.h +29 -0
  30. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/cont.h +25 -0
  31. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/dir.h +17 -0
  32. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enc.h +20 -0
  33. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/encoding.h +28 -0
  34. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enum.h +19 -0
  35. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enumerator.h +22 -0
  36. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/error.h +124 -0
  37. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/eval.h +33 -0
  38. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/file.h +39 -0
  39. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/fixnum.h +185 -0
  40. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/gc.h +161 -0
  41. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/hash.h +241 -0
  42. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/imemo.h +243 -0
  43. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/inits.h +51 -0
  44. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/io.h +35 -0
  45. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/load.h +19 -0
  46. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/loadpath.h +17 -0
  47. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/math.h +24 -0
  48. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/missing.h +19 -0
  49. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/numeric.h +255 -0
  50. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/object.h +83 -0
  51. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/parse.h +23 -0
  52. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/proc.h +33 -0
  53. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/process.h +136 -0
  54. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/random.h +17 -0
  55. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/range.h +41 -0
  56. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/rational.h +71 -0
  57. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/re.h +29 -0
  58. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/sanitizers.h +191 -0
  59. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/scheduler.h +44 -0
  60. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/serial.h +24 -0
  61. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/signal.h +22 -0
  62. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/static_assert.h +17 -0
  63. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/string.h +140 -0
  64. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/struct.h +154 -0
  65. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/symbol.h +41 -0
  66. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/thread.h +54 -0
  67. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/time.h +35 -0
  68. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/transcode.h +21 -0
  69. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/util.h +31 -0
  70. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/variable.h +84 -0
  71. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/vm.h +136 -0
  72. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/warnings.h +17 -0
  73. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal.h +107 -0
  74. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/iseq.h +305 -0
  75. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/known_errors.inc +791 -0
  76. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/method.h +245 -0
  77. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/mjit.h +220 -0
  78. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/mjit_compile.inc +8240 -0
  79. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/node.h +484 -0
  80. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/node_name.inc +210 -0
  81. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/opt_sc.inc +109 -0
  82. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/optinsn.inc +128 -0
  83. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/optunifs.inc +43 -0
  84. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/parse.h +211 -0
  85. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/probes_helper.h +44 -0
  86. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ractor_core.h +343 -0
  87. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/regenc.h +254 -0
  88. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/regint.h +938 -0
  89. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/regparse.h +370 -0
  90. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/revision.h +2 -0
  91. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ruby_assert.h +15 -0
  92. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ruby_atomic.h +23 -0
  93. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/siphash.h +48 -0
  94. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/symbol.h +119 -0
  95. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/thread_pthread.h +115 -0
  96. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/thread_win32.h +61 -0
  97. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/timev.h +57 -0
  98. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/transcode_data.h +138 -0
  99. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/transient_heap.h +65 -0
  100. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/variable.h +22 -0
  101. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/version.h +89 -0
  102. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm.inc +5355 -0
  103. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_call_iseq_optimized.inc +244 -0
  104. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_callinfo.h +456 -0
  105. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_core.h +2023 -0
  106. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_debug.h +116 -0
  107. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_exec.h +196 -0
  108. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_insnhelper.h +257 -0
  109. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_opts.h +73 -0
  110. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_sync.h +136 -0
  111. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vmtc.inc +243 -0
  112. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/addr2line.h +20 -0
  113. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/builtin.h +84 -0
  114. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/build_assert/build_assert.h +40 -0
  115. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/check_type/check_type.h +63 -0
  116. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/container_of/container_of.h +142 -0
  117. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/list/list.h +788 -0
  118. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ccan/str/str.h +16 -0
  119. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/constant.h +55 -0
  120. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/darray.h +198 -0
  121. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/debug_counter.h +469 -0
  122. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/dln.h +31 -0
  123. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/encindex.h +70 -0
  124. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/eval_intern.h +335 -0
  125. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/gc.h +141 -0
  126. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/hrtime.h +168 -0
  127. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/id.h +293 -0
  128. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/id_table.h +36 -0
  129. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/insns.inc +249 -0
  130. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/insns_info.inc +9063 -0
  131. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/array.h +113 -0
  132. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/bignum.h +246 -0
  133. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/bits.h +565 -0
  134. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/class.h +196 -0
  135. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/compar.h +49 -0
  136. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/compile.h +35 -0
  137. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/compilers.h +107 -0
  138. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/complex.h +29 -0
  139. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/cont.h +24 -0
  140. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/dir.h +16 -0
  141. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/enc.h +19 -0
  142. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/encoding.h +30 -0
  143. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/enum.h +18 -0
  144. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/enumerator.h +21 -0
  145. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/error.h +191 -0
  146. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/eval.h +32 -0
  147. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/file.h +38 -0
  148. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/fixnum.h +184 -0
  149. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/gc.h +186 -0
  150. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/hash.h +243 -0
  151. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/imemo.h +243 -0
  152. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/inits.h +50 -0
  153. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/io.h +38 -0
  154. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/load.h +18 -0
  155. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/loadpath.h +16 -0
  156. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/math.h +23 -0
  157. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/missing.h +18 -0
  158. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/numeric.h +271 -0
  159. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/object.h +83 -0
  160. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/parse.h +23 -0
  161. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/proc.h +32 -0
  162. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/process.h +137 -0
  163. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/random.h +16 -0
  164. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/range.h +40 -0
  165. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/rational.h +72 -0
  166. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/re.h +30 -0
  167. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/sanitizers.h +190 -0
  168. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/serial.h +23 -0
  169. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/signal.h +21 -0
  170. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/static_assert.h +16 -0
  171. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/string.h +141 -0
  172. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/struct.h +153 -0
  173. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/symbol.h +41 -0
  174. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/thread.h +53 -0
  175. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/time.h +34 -0
  176. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/transcode.h +20 -0
  177. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/util.h +27 -0
  178. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/variable.h +83 -0
  179. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/vm.h +133 -0
  180. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/warnings.h +16 -0
  181. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal.h +109 -0
  182. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/iseq.h +322 -0
  183. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/known_errors.inc +791 -0
  184. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/method.h +253 -0
  185. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/mjit.h +231 -0
  186. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/mjit_compile.inc +8322 -0
  187. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/node.h +510 -0
  188. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/node_name.inc +208 -0
  189. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/opt_sc.inc +109 -0
  190. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/optinsn.inc +128 -0
  191. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/optunifs.inc +43 -0
  192. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/parse.h +214 -0
  193. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/probes_helper.h +44 -0
  194. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ractor_core.h +346 -0
  195. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/regenc.h +254 -0
  196. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/regint.h +942 -0
  197. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/regparse.h +370 -0
  198. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/revision.h +2 -0
  199. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ruby_assert.h +14 -0
  200. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/ruby_atomic.h +23 -0
  201. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/siphash.h +48 -0
  202. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/symbol.h +119 -0
  203. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/thread_pthread.h +115 -0
  204. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/thread_win32.h +61 -0
  205. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/timev.h +57 -0
  206. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/transcode_data.h +138 -0
  207. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/transient_heap.h +65 -0
  208. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/variable.h +21 -0
  209. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/version.h +88 -0
  210. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm.inc +5470 -0
  211. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_call_iseq_optimized.inc +244 -0
  212. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_callinfo.h +487 -0
  213. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_core.h +2107 -0
  214. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_debug.h +124 -0
  215. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_exec.h +197 -0
  216. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_insnhelper.h +265 -0
  217. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_opts.h +73 -0
  218. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_sync.h +137 -0
  219. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/vmtc.inc +243 -0
  220. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit.h +73 -0
  221. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_asm.h +408 -0
  222. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_codegen.h +23 -0
  223. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_core.h +307 -0
  224. data/lib/debase/ruby_core_source/ruby-3.1.0-p0/yjit_iface.h +38 -0
  225. data/lib/debase/ruby_core_source/version.rb +1 -1
  226. metadata +235 -14
@@ -0,0 +1,244 @@
1
+ /* -*- c -*- */
2
+ #if 1 /* enable or disable this optimization */
3
+
4
+ /* DO NOT EDIT THIS FILE DIRECTLY
5
+ *
6
+ * This file is generated by tool/generic_erb.rb
7
+ * with template/call_iseq_optimized.inc.tmpl
8
+ */
9
+
10
+ static VALUE
11
+ vm_call_iseq_setup_normal_0start_0params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
12
+ {
13
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
14
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 0);
15
+ }
16
+
17
+ static VALUE
18
+ vm_call_iseq_setup_normal_0start_0params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
19
+ {
20
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
21
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 1);
22
+ }
23
+
24
+ static VALUE
25
+ vm_call_iseq_setup_normal_0start_0params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
26
+ {
27
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
28
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 2);
29
+ }
30
+
31
+ static VALUE
32
+ vm_call_iseq_setup_normal_0start_0params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
33
+ {
34
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
35
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 3);
36
+ }
37
+
38
+ static VALUE
39
+ vm_call_iseq_setup_normal_0start_0params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
40
+ {
41
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
42
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 4);
43
+ }
44
+
45
+ static VALUE
46
+ vm_call_iseq_setup_normal_0start_0params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
47
+ {
48
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
49
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 5);
50
+ }
51
+
52
+ static VALUE
53
+ vm_call_iseq_setup_normal_0start_1params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
54
+ {
55
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
56
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 0);
57
+ }
58
+
59
+ static VALUE
60
+ vm_call_iseq_setup_normal_0start_1params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
61
+ {
62
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
63
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 1);
64
+ }
65
+
66
+ static VALUE
67
+ vm_call_iseq_setup_normal_0start_1params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
68
+ {
69
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
70
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 2);
71
+ }
72
+
73
+ static VALUE
74
+ vm_call_iseq_setup_normal_0start_1params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
75
+ {
76
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
77
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 3);
78
+ }
79
+
80
+ static VALUE
81
+ vm_call_iseq_setup_normal_0start_1params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
82
+ {
83
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
84
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 4);
85
+ }
86
+
87
+ static VALUE
88
+ vm_call_iseq_setup_normal_0start_1params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
89
+ {
90
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
91
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 5);
92
+ }
93
+
94
+ static VALUE
95
+ vm_call_iseq_setup_normal_0start_2params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
96
+ {
97
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
98
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 0);
99
+ }
100
+
101
+ static VALUE
102
+ vm_call_iseq_setup_normal_0start_2params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
103
+ {
104
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
105
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 1);
106
+ }
107
+
108
+ static VALUE
109
+ vm_call_iseq_setup_normal_0start_2params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
110
+ {
111
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
112
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 2);
113
+ }
114
+
115
+ static VALUE
116
+ vm_call_iseq_setup_normal_0start_2params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
117
+ {
118
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
119
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 3);
120
+ }
121
+
122
+ static VALUE
123
+ vm_call_iseq_setup_normal_0start_2params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
124
+ {
125
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
126
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 4);
127
+ }
128
+
129
+ static VALUE
130
+ vm_call_iseq_setup_normal_0start_2params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
131
+ {
132
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
133
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 5);
134
+ }
135
+
136
+ static VALUE
137
+ vm_call_iseq_setup_normal_0start_3params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
138
+ {
139
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
140
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 0);
141
+ }
142
+
143
+ static VALUE
144
+ vm_call_iseq_setup_normal_0start_3params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
145
+ {
146
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
147
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 1);
148
+ }
149
+
150
+ static VALUE
151
+ vm_call_iseq_setup_normal_0start_3params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
152
+ {
153
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
154
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 2);
155
+ }
156
+
157
+ static VALUE
158
+ vm_call_iseq_setup_normal_0start_3params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
159
+ {
160
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
161
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 3);
162
+ }
163
+
164
+ static VALUE
165
+ vm_call_iseq_setup_normal_0start_3params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
166
+ {
167
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
168
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 4);
169
+ }
170
+
171
+ static VALUE
172
+ vm_call_iseq_setup_normal_0start_3params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
173
+ {
174
+ RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
175
+ return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 5);
176
+ }
177
+
178
+ /* vm_call_iseq_handlers[param][local] */
179
+ static const vm_call_handler vm_call_iseq_handlers[][6] = {
180
+ {
181
+ vm_call_iseq_setup_normal_0start_0params_0locals,
182
+ vm_call_iseq_setup_normal_0start_0params_1locals,
183
+ vm_call_iseq_setup_normal_0start_0params_2locals,
184
+ vm_call_iseq_setup_normal_0start_0params_3locals,
185
+ vm_call_iseq_setup_normal_0start_0params_4locals,
186
+ vm_call_iseq_setup_normal_0start_0params_5locals,
187
+ },
188
+ {
189
+ vm_call_iseq_setup_normal_0start_1params_0locals,
190
+ vm_call_iseq_setup_normal_0start_1params_1locals,
191
+ vm_call_iseq_setup_normal_0start_1params_2locals,
192
+ vm_call_iseq_setup_normal_0start_1params_3locals,
193
+ vm_call_iseq_setup_normal_0start_1params_4locals,
194
+ vm_call_iseq_setup_normal_0start_1params_5locals,
195
+ },
196
+ {
197
+ vm_call_iseq_setup_normal_0start_2params_0locals,
198
+ vm_call_iseq_setup_normal_0start_2params_1locals,
199
+ vm_call_iseq_setup_normal_0start_2params_2locals,
200
+ vm_call_iseq_setup_normal_0start_2params_3locals,
201
+ vm_call_iseq_setup_normal_0start_2params_4locals,
202
+ vm_call_iseq_setup_normal_0start_2params_5locals,
203
+ },
204
+ {
205
+ vm_call_iseq_setup_normal_0start_3params_0locals,
206
+ vm_call_iseq_setup_normal_0start_3params_1locals,
207
+ vm_call_iseq_setup_normal_0start_3params_2locals,
208
+ vm_call_iseq_setup_normal_0start_3params_3locals,
209
+ vm_call_iseq_setup_normal_0start_3params_4locals,
210
+ vm_call_iseq_setup_normal_0start_3params_5locals,
211
+ },
212
+ };
213
+
214
+ static inline vm_call_handler
215
+ vm_call_iseq_setup_func(const struct rb_callinfo *ci, const int param_size, const int local_size)
216
+ {
217
+ if (UNLIKELY(vm_ci_flag(ci) & VM_CALL_TAILCALL)) {
218
+ return &vm_call_iseq_setup_tailcall_0start;
219
+ }
220
+ else if (0) { /* to disable optimize */
221
+ return &vm_call_iseq_setup_normal_0start;
222
+ }
223
+ else if (param_size <= 3 && local_size <= 5) {
224
+ VM_ASSERT(local_size >= 0);
225
+ return vm_call_iseq_handlers[param_size][local_size];
226
+ }
227
+ else {
228
+ return &vm_call_iseq_setup_normal_0start;
229
+ }
230
+ }
231
+
232
+ #else
233
+
234
+ static inline vm_call_handler
235
+ vm_call_iseq_setup_func(const struct rb_callinfo *ci, const int param_size, const int local_size)
236
+ {
237
+ if (UNLIKELY(vm_ci_flag(ci) & VM_CALL_TAILCALL)) {
238
+ return &vm_call_iseq_setup_tailcall_0start;
239
+ }
240
+ else {
241
+ return &vm_call_iseq_setup_normal_0start;
242
+ }
243
+ }
244
+ #endif
@@ -0,0 +1,456 @@
1
+ #ifndef RUBY_VM_CALLINFO_H /*-*-C-*-vi:se ft=c:*/
2
+ #define RUBY_VM_CALLINFO_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ */
11
+
12
+ #include "debug_counter.h"
13
+
14
+ enum vm_call_flag_bits {
15
+ VM_CALL_ARGS_SPLAT_bit, /* m(*args) */
16
+ VM_CALL_ARGS_BLOCKARG_bit, /* m(&block) */
17
+ VM_CALL_FCALL_bit, /* m(...) */
18
+ VM_CALL_VCALL_bit, /* m */
19
+ VM_CALL_ARGS_SIMPLE_bit, /* (ci->flag & (SPLAT|BLOCKARG)) && blockiseq == NULL && ci->kw_arg == NULL */
20
+ VM_CALL_BLOCKISEQ_bit, /* has blockiseq */
21
+ VM_CALL_KWARG_bit, /* has kwarg */
22
+ VM_CALL_KW_SPLAT_bit, /* m(**opts) */
23
+ VM_CALL_TAILCALL_bit, /* located at tail position */
24
+ VM_CALL_SUPER_bit, /* super */
25
+ VM_CALL_ZSUPER_bit, /* zsuper */
26
+ VM_CALL_OPT_SEND_bit, /* internal flag */
27
+ VM_CALL_KW_SPLAT_MUT_bit, /* kw splat hash can be modified (to avoid allocating a new one) */
28
+ VM_CALL__END
29
+ };
30
+
31
+ #define VM_CALL_ARGS_SPLAT (0x01 << VM_CALL_ARGS_SPLAT_bit)
32
+ #define VM_CALL_ARGS_BLOCKARG (0x01 << VM_CALL_ARGS_BLOCKARG_bit)
33
+ #define VM_CALL_FCALL (0x01 << VM_CALL_FCALL_bit)
34
+ #define VM_CALL_VCALL (0x01 << VM_CALL_VCALL_bit)
35
+ #define VM_CALL_ARGS_SIMPLE (0x01 << VM_CALL_ARGS_SIMPLE_bit)
36
+ #define VM_CALL_BLOCKISEQ (0x01 << VM_CALL_BLOCKISEQ_bit)
37
+ #define VM_CALL_KWARG (0x01 << VM_CALL_KWARG_bit)
38
+ #define VM_CALL_KW_SPLAT (0x01 << VM_CALL_KW_SPLAT_bit)
39
+ #define VM_CALL_TAILCALL (0x01 << VM_CALL_TAILCALL_bit)
40
+ #define VM_CALL_SUPER (0x01 << VM_CALL_SUPER_bit)
41
+ #define VM_CALL_ZSUPER (0x01 << VM_CALL_ZSUPER_bit)
42
+ #define VM_CALL_OPT_SEND (0x01 << VM_CALL_OPT_SEND_bit)
43
+ #define VM_CALL_KW_SPLAT_MUT (0x01 << VM_CALL_KW_SPLAT_MUT_bit)
44
+
45
+ struct rb_callinfo_kwarg {
46
+ int keyword_len;
47
+ VALUE keywords[];
48
+ };
49
+
50
+ static inline size_t
51
+ rb_callinfo_kwarg_bytes(int keyword_len)
52
+ {
53
+ return rb_size_mul_add_or_raise(
54
+ keyword_len,
55
+ sizeof(VALUE),
56
+ sizeof(struct rb_callinfo_kwarg),
57
+ rb_eRuntimeError);
58
+ }
59
+
60
+ // imemo_callinfo
61
+ struct rb_callinfo {
62
+ VALUE flags;
63
+ const struct rb_callinfo_kwarg *kwarg;
64
+ VALUE mid;
65
+ VALUE flag;
66
+ VALUE argc;
67
+ };
68
+
69
+ #ifndef USE_EMBED_CI
70
+ #define USE_EMBED_CI 1
71
+ #endif
72
+
73
+ #if SIZEOF_VALUE == 8
74
+ #define CI_EMBED_TAG_bits 1
75
+ #define CI_EMBED_ARGC_bits 15
76
+ #define CI_EMBED_FLAG_bits 16
77
+ #define CI_EMBED_ID_bits 32
78
+ #elif SIZEOF_VALUE == 4
79
+ #define CI_EMBED_TAG_bits 1
80
+ #define CI_EMBED_ARGC_bits 3
81
+ #define CI_EMBED_FLAG_bits 13
82
+ #define CI_EMBED_ID_bits 15
83
+ #endif
84
+
85
+ #if (CI_EMBED_TAG_bits + CI_EMBED_ARGC_bits + CI_EMBED_FLAG_bits + CI_EMBED_ID_bits) != (SIZEOF_VALUE * 8)
86
+ #error
87
+ #endif
88
+
89
+ #define CI_EMBED_FLAG 0x01
90
+ #define CI_EMBED_ARGC_SHFT (CI_EMBED_TAG_bits)
91
+ #define CI_EMBED_ARGC_MASK ((((VALUE)1)<<CI_EMBED_ARGC_bits) - 1)
92
+ #define CI_EMBED_FLAG_SHFT (CI_EMBED_TAG_bits + CI_EMBED_ARGC_bits)
93
+ #define CI_EMBED_FLAG_MASK ((((VALUE)1)<<CI_EMBED_FLAG_bits) - 1)
94
+ #define CI_EMBED_ID_SHFT (CI_EMBED_TAG_bits + CI_EMBED_ARGC_bits + CI_EMBED_FLAG_bits)
95
+ #define CI_EMBED_ID_MASK ((((VALUE)1)<<CI_EMBED_ID_bits) - 1)
96
+
97
+ static inline bool
98
+ vm_ci_packed_p(const struct rb_callinfo *ci)
99
+ {
100
+ #if USE_EMBED_CI
101
+ if (LIKELY(((VALUE)ci) & 0x01)) {
102
+ return 1;
103
+ }
104
+ else {
105
+ VM_ASSERT(IMEMO_TYPE_P(ci, imemo_callinfo));
106
+ return 0;
107
+ }
108
+ #else
109
+ return 0;
110
+ #endif
111
+ }
112
+
113
+ static inline bool
114
+ vm_ci_p(const struct rb_callinfo *ci)
115
+ {
116
+ if (vm_ci_packed_p(ci) || IMEMO_TYPE_P(ci, imemo_callinfo)) {
117
+ return 1;
118
+ }
119
+ else {
120
+ return 0;
121
+ }
122
+ }
123
+
124
+ static inline ID
125
+ vm_ci_mid(const struct rb_callinfo *ci)
126
+ {
127
+ if (vm_ci_packed_p(ci)) {
128
+ return (((VALUE)ci) >> CI_EMBED_ID_SHFT) & CI_EMBED_ID_MASK;
129
+ }
130
+ else {
131
+ return (ID)ci->mid;
132
+ }
133
+ }
134
+
135
+ static inline unsigned int
136
+ vm_ci_flag(const struct rb_callinfo *ci)
137
+ {
138
+ if (vm_ci_packed_p(ci)) {
139
+ return (unsigned int)((((VALUE)ci) >> CI_EMBED_FLAG_SHFT) & CI_EMBED_FLAG_MASK);
140
+ }
141
+ else {
142
+ return (unsigned int)ci->flag;
143
+ }
144
+ }
145
+
146
+ static inline unsigned int
147
+ vm_ci_argc(const struct rb_callinfo *ci)
148
+ {
149
+ if (vm_ci_packed_p(ci)) {
150
+ return (unsigned int)((((VALUE)ci) >> CI_EMBED_ARGC_SHFT) & CI_EMBED_ARGC_MASK);
151
+ }
152
+ else {
153
+ return (unsigned int)ci->argc;
154
+ }
155
+ }
156
+
157
+ static inline const struct rb_callinfo_kwarg *
158
+ vm_ci_kwarg(const struct rb_callinfo *ci)
159
+ {
160
+ if (vm_ci_packed_p(ci)) {
161
+ return NULL;
162
+ }
163
+ else {
164
+ return ci->kwarg;
165
+ }
166
+ }
167
+
168
+ static inline void
169
+ vm_ci_dump(const struct rb_callinfo *ci)
170
+ {
171
+ if (vm_ci_packed_p(ci)) {
172
+ fprintf(stderr, "packed_ci ID:%s flag:%x argc:%u\n",
173
+ rb_id2name(vm_ci_mid(ci)), vm_ci_flag(ci), vm_ci_argc(ci));
174
+ }
175
+ else {
176
+ rp(ci);
177
+ }
178
+ }
179
+
180
+ #define vm_ci_new(mid, flag, argc, kwarg) vm_ci_new_(mid, flag, argc, kwarg, __FILE__, __LINE__)
181
+ #define vm_ci_new_runtime(mid, flag, argc, kwarg) vm_ci_new_runtime_(mid, flag, argc, kwarg, __FILE__, __LINE__)
182
+
183
+ #/* This is passed to STATIC_ASSERT. Cannot be an inline function. */
184
+ #define VM_CI_EMBEDDABLE_P(mid, flag, argc, kwarg) \
185
+ (((mid ) & ~CI_EMBED_ID_MASK) ? false : \
186
+ ((flag) & ~CI_EMBED_FLAG_MASK) ? false : \
187
+ ((argc) & ~CI_EMBED_ARGC_MASK) ? false : \
188
+ (kwarg) ? false : true)
189
+
190
+ #define vm_ci_new_id(mid, flag, argc, must_zero) \
191
+ ((const struct rb_callinfo *) \
192
+ ((((VALUE)(mid )) << CI_EMBED_ID_SHFT) | \
193
+ (((VALUE)(flag)) << CI_EMBED_FLAG_SHFT) | \
194
+ (((VALUE)(argc)) << CI_EMBED_ARGC_SHFT) | \
195
+ RUBY_FIXNUM_FLAG))
196
+
197
+ static inline const struct rb_callinfo *
198
+ vm_ci_new_(ID mid, unsigned int flag, unsigned int argc, const struct rb_callinfo_kwarg *kwarg, const char *file, int line)
199
+ {
200
+ #if USE_EMBED_CI
201
+ if (VM_CI_EMBEDDABLE_P(mid, flag, argc, kwarg)) {
202
+ RB_DEBUG_COUNTER_INC(ci_packed);
203
+ return vm_ci_new_id(mid, flag, argc, kwarg);
204
+ }
205
+ #endif
206
+
207
+ const bool debug = 0;
208
+ if (debug) fprintf(stderr, "%s:%d ", file, line);
209
+
210
+ // TODO: dedup
211
+ const struct rb_callinfo *ci = (const struct rb_callinfo *)
212
+ rb_imemo_new(imemo_callinfo,
213
+ (VALUE)mid,
214
+ (VALUE)flag,
215
+ (VALUE)argc,
216
+ (VALUE)kwarg);
217
+ if (debug) rp(ci);
218
+ if (kwarg) {
219
+ RB_DEBUG_COUNTER_INC(ci_kw);
220
+ }
221
+ else {
222
+ RB_DEBUG_COUNTER_INC(ci_nokw);
223
+ }
224
+
225
+ VM_ASSERT(vm_ci_flag(ci) == flag);
226
+ VM_ASSERT(vm_ci_argc(ci) == argc);
227
+
228
+ return ci;
229
+ }
230
+
231
+
232
+ static inline const struct rb_callinfo *
233
+ vm_ci_new_runtime_(ID mid, unsigned int flag, unsigned int argc, const struct rb_callinfo_kwarg *kwarg, const char *file, int line)
234
+ {
235
+ RB_DEBUG_COUNTER_INC(ci_runtime);
236
+ return vm_ci_new_(mid, flag, argc, kwarg, file, line);
237
+ }
238
+
239
+ #define VM_CALLINFO_NOT_UNDER_GC IMEMO_FL_USER0
240
+
241
+ static inline bool
242
+ vm_ci_markable(const struct rb_callinfo *ci)
243
+ {
244
+ if (! ci) {
245
+ return false; /* or true? This is Qfalse... */
246
+ }
247
+ else if (vm_ci_packed_p(ci)) {
248
+ return true;
249
+ }
250
+ else {
251
+ VM_ASSERT(IMEMO_TYPE_P(ci, imemo_callinfo));
252
+ return ! FL_ANY_RAW((VALUE)ci, VM_CALLINFO_NOT_UNDER_GC);
253
+ }
254
+ }
255
+
256
+ #define VM_CI_ON_STACK(mid_, flags_, argc_, kwarg_) \
257
+ (struct rb_callinfo) { \
258
+ .flags = T_IMEMO | \
259
+ (imemo_callinfo << FL_USHIFT) | \
260
+ VM_CALLINFO_NOT_UNDER_GC, \
261
+ .mid = mid_, \
262
+ .flag = flags_, \
263
+ .argc = argc_, \
264
+ .kwarg = kwarg_, \
265
+ }
266
+
267
+ typedef VALUE (*vm_call_handler)(
268
+ struct rb_execution_context_struct *ec,
269
+ struct rb_control_frame_struct *cfp,
270
+ struct rb_calling_info *calling);
271
+
272
+ // imemo_callcache
273
+
274
+ struct rb_callcache {
275
+ const VALUE flags;
276
+
277
+ /* inline cache: key */
278
+ const VALUE klass; // should not mark it because klass can not be free'd
279
+ // because of this marking. When klass is collected,
280
+ // cc will be cleared (cc->klass = 0) at vm_ccs_free().
281
+
282
+ /* inline cache: values */
283
+ const struct rb_callable_method_entry_struct * const cme_;
284
+ const vm_call_handler call_;
285
+
286
+ union {
287
+ const unsigned int attr_index;
288
+ const enum method_missing_reason method_missing_reason; /* used by method_missing */
289
+ VALUE v;
290
+ } aux_;
291
+ };
292
+
293
+ #define VM_CALLCACHE_UNMARKABLE IMEMO_FL_USER0
294
+
295
+ static inline const struct rb_callcache *
296
+ vm_cc_new(VALUE klass,
297
+ const struct rb_callable_method_entry_struct *cme,
298
+ vm_call_handler call)
299
+ {
300
+ const struct rb_callcache *cc = (const struct rb_callcache *)rb_imemo_new(imemo_callcache, (VALUE)cme, (VALUE)call, 0, klass);
301
+ RB_DEBUG_COUNTER_INC(cc_new);
302
+ return cc;
303
+ }
304
+
305
+ #define VM_CC_ON_STACK(clazz, call, aux, cme) \
306
+ (struct rb_callcache) { \
307
+ .flags = T_IMEMO | \
308
+ (imemo_callcache << FL_USHIFT) | \
309
+ VM_CALLCACHE_UNMARKABLE, \
310
+ .klass = clazz, \
311
+ .cme_ = cme, \
312
+ .call_ = call, \
313
+ .aux_ = aux, \
314
+ }
315
+
316
+ static inline bool
317
+ vm_cc_class_check(const struct rb_callcache *cc, VALUE klass)
318
+ {
319
+ VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
320
+ VM_ASSERT(cc->klass == 0 ||
321
+ RB_TYPE_P(cc->klass, T_CLASS) || RB_TYPE_P(cc->klass, T_ICLASS));
322
+ return cc->klass == klass;
323
+ }
324
+
325
+ static inline const struct rb_callable_method_entry_struct *
326
+ vm_cc_cme(const struct rb_callcache *cc)
327
+ {
328
+ VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
329
+ return cc->cme_;
330
+ }
331
+
332
+ static inline vm_call_handler
333
+ vm_cc_call(const struct rb_callcache *cc)
334
+ {
335
+ VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
336
+ return cc->call_;
337
+ }
338
+
339
+ static inline unsigned int
340
+ vm_cc_attr_index(const struct rb_callcache *cc)
341
+ {
342
+ VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
343
+ return cc->aux_.attr_index;
344
+ }
345
+
346
+ static inline unsigned int
347
+ vm_cc_cmethod_missing_reason(const struct rb_callcache *cc)
348
+ {
349
+ VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
350
+ return cc->aux_.method_missing_reason;
351
+ }
352
+
353
+ static inline int
354
+ vm_cc_markable(const struct rb_callcache *cc)
355
+ {
356
+ VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
357
+ return FL_TEST_RAW((VALUE)cc, VM_CALLCACHE_UNMARKABLE) == 0;
358
+ }
359
+
360
+ // For MJIT. cc_cme is supposed to have inlined `vm_cc_cme(cc)`.
361
+ static inline bool
362
+ vm_cc_valid_p(const struct rb_callcache *cc, const rb_callable_method_entry_t *cc_cme, VALUE klass)
363
+ {
364
+ VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
365
+ if (cc->klass == klass && !METHOD_ENTRY_INVALIDATED(cc_cme)) {
366
+ return 1;
367
+ }
368
+ else {
369
+ return 0;
370
+ }
371
+ }
372
+
373
+ extern const struct rb_callcache *rb_vm_empty_cc(void);
374
+ #define vm_cc_empty() rb_vm_empty_cc()
375
+
376
+ /* callcache: mutate */
377
+
378
+ static inline void
379
+ vm_cc_cme_set(const struct rb_callcache *cc, const struct rb_callable_method_entry_struct *cme)
380
+ {
381
+ VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
382
+ VM_ASSERT(cc != vm_cc_empty());
383
+ VM_ASSERT(vm_cc_cme(cc) != NULL);
384
+ VM_ASSERT(vm_cc_cme(cc)->called_id == cme->called_id);
385
+ VM_ASSERT(!vm_cc_markable(cc)); // only used for vm_eval.c
386
+
387
+ *((const struct rb_callable_method_entry_struct **)&cc->cme_) = cme;
388
+ }
389
+
390
+ static inline void
391
+ vm_cc_call_set(const struct rb_callcache *cc, vm_call_handler call)
392
+ {
393
+ VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
394
+ VM_ASSERT(cc != vm_cc_empty());
395
+ *(vm_call_handler *)&cc->call_ = call;
396
+ }
397
+
398
+ static inline void
399
+ vm_cc_attr_index_set(const struct rb_callcache *cc, int index)
400
+ {
401
+ VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
402
+ VM_ASSERT(cc != vm_cc_empty());
403
+ *(int *)&cc->aux_.attr_index = index;
404
+ }
405
+
406
+ static inline void
407
+ vm_cc_method_missing_reason_set(const struct rb_callcache *cc, enum method_missing_reason reason)
408
+ {
409
+ VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
410
+ VM_ASSERT(cc != vm_cc_empty());
411
+ *(enum method_missing_reason *)&cc->aux_.method_missing_reason = reason;
412
+ }
413
+
414
+ static inline void
415
+ vm_cc_invalidate(const struct rb_callcache *cc)
416
+ {
417
+ VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
418
+ VM_ASSERT(cc != vm_cc_empty());
419
+ VM_ASSERT(cc->klass != 0); // should be enable
420
+
421
+ *(VALUE *)&cc->klass = 0;
422
+ RB_DEBUG_COUNTER_INC(cc_ent_invalidate);
423
+ }
424
+
425
+ /* calldata */
426
+
427
+ struct rb_call_data {
428
+ const struct rb_callinfo *ci;
429
+ const struct rb_callcache *cc;
430
+ };
431
+
432
+ struct rb_class_cc_entries {
433
+ #if VM_CHECK_MODE > 0
434
+ VALUE debug_sig;
435
+ #endif
436
+ int capa;
437
+ int len;
438
+ const struct rb_callable_method_entry_struct *cme;
439
+ struct rb_class_cc_entries_entry {
440
+ const struct rb_callinfo *ci;
441
+ const struct rb_callcache *cc;
442
+ } *entries;
443
+ };
444
+
445
+ #if VM_CHECK_MODE > 0
446
+ static inline bool
447
+ vm_ccs_p(const struct rb_class_cc_entries *ccs)
448
+ {
449
+ return ccs->debug_sig == ~(VALUE)ccs;
450
+ }
451
+ #endif
452
+
453
+ // gc.c
454
+ void rb_vm_ccs_free(struct rb_class_cc_entries *ccs);
455
+
456
+ #endif /* RUBY_VM_CALLINFO_H */