debase-ruby_core_source 0.10.2 → 0.10.11

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 (339) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +6 -2
  4. data/Rakefile +6 -3
  5. data/debase-ruby_core_source.gemspec +2 -1
  6. data/lib/debase/ruby_core_source.rb +6 -5
  7. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/addr2line.h +0 -0
  8. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/ccan/build_assert/build_assert.h +0 -0
  9. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/ccan/check_type/check_type.h +0 -0
  10. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/ccan/container_of/container_of.h +0 -0
  11. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/ccan/list/list.h +0 -0
  12. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/ccan/str/str.h +0 -0
  13. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/constant.h +1 -0
  14. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/debug_counter.h +0 -0
  15. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/dln.h +0 -0
  16. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/encindex.h +2 -0
  17. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/eval_intern.h +0 -0
  18. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/gc.h +0 -0
  19. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/id.h +0 -0
  20. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/id_table.h +0 -0
  21. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/insns.inc +2 -2
  22. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/insns_info.inc +157 -157
  23. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/internal.h +5 -4
  24. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/iseq.h +2 -2
  25. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/known_errors.inc +0 -0
  26. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/method.h +0 -0
  27. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/node.h +0 -0
  28. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/node_name.inc +0 -0
  29. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/opt_sc.inc +0 -0
  30. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/optinsn.inc +0 -0
  31. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/optunifs.inc +0 -0
  32. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/parse.h +0 -0
  33. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/probes_helper.h +0 -0
  34. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/regenc.h +0 -0
  35. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/regint.h +0 -0
  36. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/regparse.h +0 -0
  37. data/lib/debase/ruby_core_source/ruby-2.5.1-p57/revision.h +1 -0
  38. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/ruby_assert.h +0 -0
  39. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/ruby_atomic.h +0 -0
  40. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/siphash.h +0 -0
  41. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/symbol.h +0 -0
  42. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/thread_pthread.h +0 -0
  43. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/thread_win32.h +0 -0
  44. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/timev.h +0 -0
  45. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/transcode_data.h +0 -0
  46. data/lib/debase/ruby_core_source/ruby-2.5.1-p57/version.h +73 -0
  47. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/vm.inc +13 -13
  48. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/vm_call_iseq_optimized.inc +0 -0
  49. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/vm_core.h +3 -4
  50. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.5.1-p57}/vm_debug.h +0 -0
  51. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/vm_exec.h +0 -0
  52. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/vm_insnhelper.h +0 -0
  53. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/vm_opts.h +1 -2
  54. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.5.1-p57}/vmtc.inc +2 -2
  55. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/addr2line.h +1 -1
  56. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/ccan/build_assert/build_assert.h +0 -0
  57. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/ccan/check_type/check_type.h +0 -0
  58. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/ccan/container_of/container_of.h +0 -0
  59. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/ccan/list/list.h +20 -5
  60. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/ccan/str/str.h +0 -0
  61. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/constant.h +1 -0
  62. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/debug_counter.h +283 -0
  63. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/dln.h +0 -0
  64. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/encindex.h +2 -0
  65. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.6.0-p0}/eval_intern.h +45 -53
  66. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.6.0-p0}/gc.h +2 -3
  67. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/hrtime.h +168 -0
  68. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/id.h +4 -2
  69. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/id_table.h +0 -0
  70. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/insns.inc +249 -0
  71. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/insns_info.inc +9374 -0
  72. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.6.0-p0}/internal.h +608 -100
  73. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.6.0-p0}/iseq.h +127 -91
  74. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/known_errors.inc +477 -432
  75. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.6.0-p0}/method.h +28 -15
  76. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/mjit.h +148 -0
  77. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/mjit_compile.inc +4224 -0
  78. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/node.h +449 -0
  79. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.6.0-p0}/node_name.inc +6 -18
  80. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/opt_sc.inc +109 -0
  81. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/optinsn.inc +128 -0
  82. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/optunifs.inc +43 -0
  83. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/parse.h +210 -0
  84. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/probes_helper.h +42 -0
  85. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/regenc.h +1 -1
  86. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/regint.h +0 -0
  87. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/regparse.h +1 -1
  88. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/revision.h +1 -0
  89. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/ruby_assert.h +6 -0
  90. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/ruby_atomic.h +14 -3
  91. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/siphash.h +1 -1
  92. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/symbol.h +1 -1
  93. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/thread_pthread.h +75 -0
  94. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/thread_win32.h +0 -0
  95. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/timev.h +53 -0
  96. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/transcode_data.h +0 -0
  97. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/transient_heap.h +60 -0
  98. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/version.h +7 -7
  99. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/vm.inc +4502 -0
  100. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/vm_call_iseq_optimized.inc +213 -0
  101. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.6.0-p0}/vm_core.h +385 -182
  102. data/lib/debase/ruby_core_source/{ruby-2.5.0-rc1 → ruby-2.6.0-p0}/vm_debug.h +0 -0
  103. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.6.0-p0}/vm_exec.h +33 -13
  104. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/vm_insnhelper.h +316 -0
  105. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.6.0-p0}/vm_opts.h +18 -5
  106. data/lib/debase/ruby_core_source/ruby-2.6.0-p0/vmtc.inc +243 -0
  107. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/addr2line.h +21 -0
  108. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/build_assert/build_assert.h +40 -0
  109. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/check_type/check_type.h +63 -0
  110. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/container_of/container_of.h +142 -0
  111. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/list/list.h +788 -0
  112. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/str/str.h +16 -0
  113. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/constant.h +51 -0
  114. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/debug_counter.h +283 -0
  115. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/dln.h +51 -0
  116. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/encindex.h +69 -0
  117. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/eval_intern.h +333 -0
  118. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/gc.h +116 -0
  119. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/hrtime.h +168 -0
  120. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/id.h +252 -0
  121. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/id_table.h +31 -0
  122. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/insns.inc +249 -0
  123. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/insns_info.inc +9374 -0
  124. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/internal.h +2470 -0
  125. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/iseq.h +304 -0
  126. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/known_errors.inc +791 -0
  127. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/method.h +229 -0
  128. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/mjit.h +148 -0
  129. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/mjit_compile.inc +4226 -0
  130. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/node.h +449 -0
  131. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/node_name.inc +200 -0
  132. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/opt_sc.inc +109 -0
  133. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/optinsn.inc +128 -0
  134. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/optunifs.inc +43 -0
  135. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.6.5-p114}/parse.h +47 -31
  136. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/probes_helper.h +42 -0
  137. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/regenc.h +254 -0
  138. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/regint.h +938 -0
  139. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/regparse.h +370 -0
  140. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/revision.h +1 -0
  141. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h +60 -0
  142. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_atomic.h +244 -0
  143. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/siphash.h +48 -0
  144. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/symbol.h +112 -0
  145. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/thread_pthread.h +75 -0
  146. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/thread_win32.h +36 -0
  147. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/timev.h +53 -0
  148. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/transcode_data.h +139 -0
  149. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/transient_heap.h +60 -0
  150. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.6.5-p114}/version.h +7 -7
  151. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm.inc +4504 -0
  152. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_call_iseq_optimized.inc +213 -0
  153. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_core.h +1910 -0
  154. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_debug.h +37 -0
  155. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_exec.h +202 -0
  156. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_insnhelper.h +316 -0
  157. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_opts.h +70 -0
  158. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vmtc.inc +243 -0
  159. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/addr2line.h +21 -0
  160. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/builtin.h +78 -0
  161. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/build_assert/build_assert.h +40 -0
  162. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/check_type/check_type.h +63 -0
  163. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/container_of/container_of.h +142 -0
  164. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/list/list.h +788 -0
  165. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/str/str.h +16 -0
  166. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/constant.h +50 -0
  167. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/debug_counter.h +390 -0
  168. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/dln.h +51 -0
  169. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/encindex.h +69 -0
  170. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/eval_intern.h +312 -0
  171. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/gc.h +131 -0
  172. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/hrtime.h +168 -0
  173. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/id.h +290 -0
  174. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/id_table.h +34 -0
  175. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/insns.inc +253 -0
  176. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/insns_info.inc +9197 -0
  177. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/internal.h +2697 -0
  178. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/iseq.h +312 -0
  179. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/known_errors.inc +791 -0
  180. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/method.h +229 -0
  181. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/mjit.h +177 -0
  182. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/mjit_compile.inc +7779 -0
  183. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/node.h +476 -0
  184. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/node_name.inc +208 -0
  185. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/opt_sc.inc +109 -0
  186. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/optinsn.inc +128 -0
  187. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/optunifs.inc +43 -0
  188. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/parse.h +210 -0
  189. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/probes_helper.h +42 -0
  190. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/regenc.h +254 -0
  191. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/regint.h +938 -0
  192. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/regparse.h +370 -0
  193. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/revision.h +2 -0
  194. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ruby_assert.h +15 -0
  195. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ruby_atomic.h +244 -0
  196. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/siphash.h +48 -0
  197. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/symbol.h +119 -0
  198. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/thread_pthread.h +75 -0
  199. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/thread_win32.h +36 -0
  200. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/timev.h +56 -0
  201. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/transcode_data.h +139 -0
  202. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/transient_heap.h +62 -0
  203. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/variable.h +9 -0
  204. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/version.h +77 -0
  205. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm.inc +5466 -0
  206. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_call_iseq_optimized.inc +237 -0
  207. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_core.h +1968 -0
  208. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_debug.h +34 -0
  209. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_exec.h +193 -0
  210. data/lib/debase/ruby_core_source/{ruby-2.5.0-preview1 → ruby-2.7.0-p0}/vm_insnhelper.h +81 -64
  211. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_opts.h +72 -0
  212. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vmtc.inc +247 -0
  213. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/addr2line.h +20 -0
  214. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/builtin.h +83 -0
  215. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/build_assert/build_assert.h +40 -0
  216. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/check_type/check_type.h +63 -0
  217. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/container_of/container_of.h +142 -0
  218. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/list/list.h +788 -0
  219. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/str/str.h +16 -0
  220. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/constant.h +55 -0
  221. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/debug_counter.h +423 -0
  222. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/dln.h +36 -0
  223. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/encindex.h +70 -0
  224. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/eval_intern.h +312 -0
  225. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/gc.h +140 -0
  226. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/hrtime.h +168 -0
  227. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/id.h +290 -0
  228. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/id_table.h +36 -0
  229. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/insns.inc +249 -0
  230. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/insns_info.inc +8979 -0
  231. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal.h +107 -0
  232. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/array.h +114 -0
  233. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/bignum.h +246 -0
  234. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/bits.h +566 -0
  235. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/class.h +168 -0
  236. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/compar.h +50 -0
  237. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/compile.h +32 -0
  238. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/compilers.h +108 -0
  239. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/complex.h +29 -0
  240. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/cont.h +25 -0
  241. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/dir.h +17 -0
  242. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/enc.h +20 -0
  243. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/encoding.h +28 -0
  244. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/enum.h +19 -0
  245. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/enumerator.h +22 -0
  246. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/error.h +131 -0
  247. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/eval.h +33 -0
  248. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/file.h +39 -0
  249. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/fixnum.h +185 -0
  250. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/gc.h +154 -0
  251. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/hash.h +240 -0
  252. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/imemo.h +243 -0
  253. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/inits.h +51 -0
  254. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/io.h +35 -0
  255. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/load.h +19 -0
  256. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/loadpath.h +17 -0
  257. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/math.h +24 -0
  258. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/missing.h +19 -0
  259. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/mjit.h +29 -0
  260. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/numeric.h +252 -0
  261. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/object.h +83 -0
  262. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/parse.h +23 -0
  263. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/proc.h +32 -0
  264. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/process.h +136 -0
  265. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/random.h +17 -0
  266. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/range.h +37 -0
  267. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/rational.h +69 -0
  268. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/re.h +29 -0
  269. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/sanitizers.h +191 -0
  270. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/scheduler.h +35 -0
  271. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/serial.h +24 -0
  272. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/signal.h +22 -0
  273. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/static_assert.h +17 -0
  274. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/string.h +135 -0
  275. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/struct.h +154 -0
  276. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/symbol.h +41 -0
  277. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/thread.h +60 -0
  278. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/time.h +35 -0
  279. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/transcode.h +21 -0
  280. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/util.h +31 -0
  281. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/variable.h +83 -0
  282. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/vm.h +135 -0
  283. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/warnings.h +17 -0
  284. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/iseq.h +304 -0
  285. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/known_errors.inc +791 -0
  286. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/method.h +245 -0
  287. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/mjit.h +197 -0
  288. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/mjit_compile.inc +8082 -0
  289. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/node.h +484 -0
  290. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/node_name.inc +210 -0
  291. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/opt_sc.inc +109 -0
  292. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/optinsn.inc +128 -0
  293. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/optunifs.inc +43 -0
  294. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/parse.h +211 -0
  295. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/probes_helper.h +44 -0
  296. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ractor.h +271 -0
  297. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ractor_pub.h +50 -0
  298. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/regenc.h +254 -0
  299. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/regint.h +938 -0
  300. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/regparse.h +370 -0
  301. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/revision.h +2 -0
  302. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ruby_assert.h +15 -0
  303. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ruby_atomic.h +236 -0
  304. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/siphash.h +48 -0
  305. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/symbol.h +119 -0
  306. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/thread_pthread.h +106 -0
  307. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/thread_win32.h +66 -0
  308. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/timev.h +57 -0
  309. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/transcode_data.h +138 -0
  310. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/transient_heap.h +61 -0
  311. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/variable.h +21 -0
  312. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/version.h +89 -0
  313. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm.inc +5360 -0
  314. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_call_iseq_optimized.inc +244 -0
  315. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_callinfo.h +457 -0
  316. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_core.h +1952 -0
  317. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_debug.h +116 -0
  318. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_exec.h +196 -0
  319. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_insnhelper.h +260 -0
  320. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_opts.h +73 -0
  321. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_sync.h +97 -0
  322. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vmtc.inc +243 -0
  323. data/lib/debase/ruby_core_source/version.rb +1 -1
  324. metadata +335 -102
  325. data/lib/debase/ruby_core_source/ruby-2.5.0-preview1/insns.inc +0 -118
  326. data/lib/debase/ruby_core_source/ruby-2.5.0-preview1/insns_info.inc +0 -827
  327. data/lib/debase/ruby_core_source/ruby-2.5.0-preview1/node.h +0 -523
  328. data/lib/debase/ruby_core_source/ruby-2.5.0-preview1/opt_sc.inc +0 -809
  329. data/lib/debase/ruby_core_source/ruby-2.5.0-preview1/optinsn.inc +0 -77
  330. data/lib/debase/ruby_core_source/ruby-2.5.0-preview1/optunifs.inc +0 -49
  331. data/lib/debase/ruby_core_source/ruby-2.5.0-preview1/probes_helper.h +0 -43
  332. data/lib/debase/ruby_core_source/ruby-2.5.0-preview1/revision.h +0 -1
  333. data/lib/debase/ruby_core_source/ruby-2.5.0-preview1/vm.inc +0 -2935
  334. data/lib/debase/ruby_core_source/ruby-2.5.0-preview1/vm_call_iseq_optimized.inc +0 -212
  335. data/lib/debase/ruby_core_source/ruby-2.5.0-preview1/vmtc.inc +0 -115
  336. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/debug_counter.h +0 -109
  337. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/revision.h +0 -1
  338. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/thread_pthread.h +0 -54
  339. data/lib/debase/ruby_core_source/ruby-2.5.0-rc1/timev.h +0 -42
@@ -13,8 +13,6 @@
13
13
  #define RUBY_INTERNAL_H 1
14
14
 
15
15
  #include "ruby.h"
16
- #include "ruby/encoding.h"
17
- #include "ruby/io.h"
18
16
 
19
17
  #if defined(__cplusplus)
20
18
  extern "C" {
@@ -39,6 +37,12 @@ extern "C" {
39
37
  # endif
40
38
  #endif
41
39
 
40
+ /* The most significant bit of the lower part of half-long integer.
41
+ * If sizeof(long) == 4, this is 0x8000.
42
+ * If sizeof(long) == 8, this is 0x80000000.
43
+ */
44
+ #define HALF_LONG_MSB ((SIGNED_VALUE)1<<((SIZEOF_LONG*CHAR_BIT-1)/2))
45
+
42
46
  #define LIKELY(x) RB_LIKELY(x)
43
47
  #define UNLIKELY(x) RB_UNLIKELY(x)
44
48
 
@@ -50,6 +54,34 @@ extern "C" {
50
54
  # define WARN_UNUSED_RESULT(x) x
51
55
  #endif
52
56
 
57
+ #if 0
58
+ #elif defined(NO_SANITIZE)
59
+ # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
60
+ NO_SANITIZE("address", NOINLINE(x))
61
+ #elif defined(NO_SANITIZE_ADDRESS)
62
+ # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
63
+ NO_SANITIZE_ADDRESS(NOINLINE(x))
64
+ #elif defined(NO_ADDRESS_SAFETY_ANALYSIS)
65
+ # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
66
+ NO_ADDRESS_SAFETY_ANALYSIS(NOINLINE(x))
67
+ #else
68
+ # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) x
69
+ #endif
70
+
71
+ #if defined(NO_SANITIZE) && defined(__GNUC__) &&! defined(__clang__)
72
+ /* GCC warns about unknown sanitizer, which is annoying. */
73
+ #undef NO_SANITIZE
74
+ #define NO_SANITIZE(x, y) \
75
+ COMPILER_WARNING_PUSH; \
76
+ COMPILER_WARNING_IGNORED(-Wattributes); \
77
+ __attribute__((__no_sanitize__(x))) y; \
78
+ COMPILER_WARNING_POP
79
+ #endif
80
+
81
+ #ifndef NO_SANITIZE
82
+ # define NO_SANITIZE(x, y) y
83
+ #endif
84
+
53
85
  #ifdef HAVE_VALGRIND_MEMCHECK_H
54
86
  # include <valgrind/memcheck.h>
55
87
  # ifndef VALGRIND_MAKE_MEM_DEFINED
@@ -73,8 +105,71 @@ extern "C" {
73
105
  # define __has_extension __has_feature
74
106
  #endif
75
107
 
76
- #if GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)
108
+ #ifndef MJIT_HEADER
109
+
110
+ #ifdef HAVE_SANITIZER_ASAN_INTERFACE_H
111
+ # include <sanitizer/asan_interface.h>
112
+ #endif
113
+
114
+ #if !__has_feature(address_sanitizer)
115
+ # define __asan_poison_memory_region(x, y)
116
+ # define __asan_unpoison_memory_region(x, y)
117
+ # define __asan_region_is_poisoned(x, y) 0
118
+ #endif
119
+
120
+ #ifdef HAVE_SANITIZER_MSAN_INTERFACE_H
121
+ # include <sanitizer/msan_interface.h>
122
+ #endif
123
+
124
+ #if !__has_feature(memory_sanitizer)
125
+ # define __msan_allocated_memory(x, y)
126
+ # define __msan_poison(x, y)
127
+ # define __msan_unpoison(x, y)
128
+ # define __msan_unpoison_string(x)
129
+ #endif
130
+
131
+ static inline void
132
+ poison_memory_region(const volatile void *ptr, size_t size)
133
+ {
134
+ __msan_poison(ptr, size);
135
+ __asan_poison_memory_region(ptr, size);
136
+ }
137
+
138
+ static inline void
139
+ poison_object(VALUE obj)
140
+ {
141
+ struct RVALUE *ptr = (void *)obj;
142
+ poison_memory_region(ptr, SIZEOF_VALUE);
143
+ }
144
+
145
+ static inline void
146
+ unpoison_memory_region(const volatile void *ptr, size_t size, bool malloc_p)
147
+ {
148
+ __asan_unpoison_memory_region(ptr, size);
149
+ if (malloc_p) {
150
+ __msan_allocated_memory(ptr, size);
151
+ }
152
+ else {
153
+ __msan_unpoison(ptr, size);
154
+ }
155
+ }
156
+
157
+ static inline void
158
+ unpoison_object(VALUE obj, bool newobj_p)
159
+ {
160
+ struct RVALUE *ptr = (void *)obj;
161
+ unpoison_memory_region(ptr, SIZEOF_VALUE, newobj_p);
162
+ }
163
+
164
+ #endif
165
+
166
+ /* Prevent compiler from reordering access */
167
+ #define ACCESS_ONCE(type,x) (*((volatile type *)&(x)))
168
+
169
+ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
77
170
  # define STATIC_ASSERT(name, expr) _Static_assert(expr, #name ": " #expr)
171
+ #elif GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)
172
+ # define STATIC_ASSERT(name, expr) RB_GNUC_EXTENSION _Static_assert(expr, #name ": " #expr)
78
173
  #else
79
174
  # define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
80
175
  #endif
@@ -101,7 +196,7 @@ extern "C" {
101
196
  __builtin_mul_overflow_p((a), (b), (__typeof__(a * b))0)
102
197
  #elif defined HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
103
198
  #define MUL_OVERFLOW_P(a, b) \
104
- ({__typeof__(a) c; __builtin_mul_overflow((a), (b), &c);})
199
+ RB_GNUC_EXTENSION_BLOCK(__typeof__(a) c; __builtin_mul_overflow((a), (b), &c))
105
200
  #endif
106
201
 
107
202
  #define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \
@@ -114,10 +209,10 @@ extern "C" {
114
209
  #ifdef HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P
115
210
  /* __builtin_mul_overflow_p can take bitfield */
116
211
  /* and GCC permits bitfields for integers other than int */
117
- #define MUL_OVERFLOW_FIXNUM_P(a, b) ({ \
212
+ #define MUL_OVERFLOW_FIXNUM_P(a, b) RB_GNUC_EXTENSION_BLOCK( \
118
213
  struct { long fixnum : SIZEOF_LONG * CHAR_BIT - 1; } c; \
119
214
  __builtin_mul_overflow_p((a), (b), c.fixnum); \
120
- })
215
+ )
121
216
  #else
122
217
  #define MUL_OVERFLOW_FIXNUM_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX)
123
218
  #endif
@@ -287,10 +382,15 @@ nlz_int128(uint128_t x)
287
382
  static inline unsigned int
288
383
  nlz_intptr(uintptr_t x)
289
384
  {
290
- #if SIZEOF_VOIDP == 8
291
- return nlz_long_long(x);
292
- #elif SIZEOF_VOIDP == 4
385
+ #if SIZEOF_UINTPTR_T == SIZEOF_INT
293
386
  return nlz_int(x);
387
+ #elif SIZEOF_UINTPTR_T == SIZEOF_LONG
388
+ return nlz_long(x);
389
+ #elif SIZEOF_UINTPTR_T == SIZEOF_LONG_LONG
390
+ return nlz_long_long(x);
391
+ #else
392
+ #error no known integer type corresponds uintptr_t
393
+ return /* sane compiler */ ~0;
294
394
  #endif
295
395
  }
296
396
 
@@ -501,13 +601,19 @@ rb_fix_mod_fix(VALUE x, VALUE y)
501
601
  return mod;
502
602
  }
503
603
 
504
- #if defined(HAVE_UINT128_T)
604
+ #if defined(HAVE_UINT128_T) && defined(HAVE_LONG_LONG)
505
605
  # define bit_length(x) \
506
606
  (unsigned int) \
507
607
  (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
508
608
  sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)) : \
509
609
  sizeof(x) <= SIZEOF_LONG_LONG ? SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)(x)) : \
510
610
  SIZEOF_INT128_T * CHAR_BIT - nlz_int128((uint128_t)(x)))
611
+ #elif defined(HAVE_UINT128_T)
612
+ # define bit_length(x) \
613
+ (unsigned int) \
614
+ (sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)(x)) : \
615
+ sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)(x)) : \
616
+ SIZEOF_INT128_T * CHAR_BIT - nlz_int128((uint128_t)(x)))
511
617
  #elif defined(HAVE_LONG_LONG)
512
618
  # define bit_length(x) \
513
619
  (unsigned int) \
@@ -605,8 +711,10 @@ struct RBignum {
605
711
  #define BIGNUM_NEGATE(b) (RBASIC(b)->flags ^= BIGNUM_SIGN_BIT)
606
712
 
607
713
  #define BIGNUM_EMBED_FLAG ((VALUE)FL_USER2)
608
- #define BIGNUM_EMBED_LEN_MASK ((VALUE)(FL_USER5|FL_USER4|FL_USER3))
609
- #define BIGNUM_EMBED_LEN_SHIFT (FL_USHIFT+BIGNUM_EMBED_LEN_NUMBITS)
714
+ #define BIGNUM_EMBED_LEN_MASK \
715
+ (~(~(VALUE)0U << BIGNUM_EMBED_LEN_NUMBITS) << BIGNUM_EMBED_LEN_SHIFT)
716
+ #define BIGNUM_EMBED_LEN_SHIFT \
717
+ (FL_USHIFT+3) /* bit offset of BIGNUM_EMBED_LEN_MASK */
610
718
  #define BIGNUM_LEN(b) \
611
719
  ((RBASIC(b)->flags & BIGNUM_EMBED_FLAG) ? \
612
720
  (size_t)((RBASIC(b)->flags >> BIGNUM_EMBED_LEN_SHIFT) & \
@@ -646,30 +754,103 @@ struct RComplex {
646
754
 
647
755
  #define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
648
756
 
649
- #ifdef RCOMPLEX_SET_REAL /* shortcut macro for internal only */
650
- #undef RCOMPLEX_SET_REAL
651
- #undef RCOMPLEX_SET_IMAG
757
+ /* shortcut macro for internal only */
652
758
  #define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->real,(r))
653
759
  #define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->imag,(i))
760
+
761
+ enum ruby_rhash_flags {
762
+ RHASH_ST_TABLE_FLAG = FL_USER3,
763
+ RHASH_AR_TABLE_MAX_SIZE = 8,
764
+ RHASH_AR_TABLE_SIZE_MASK = (FL_USER4|FL_USER5|FL_USER6|FL_USER7),
765
+ RHASH_AR_TABLE_SIZE_SHIFT = (FL_USHIFT+4),
766
+ RHASH_AR_TABLE_BOUND_MASK = (FL_USER8|FL_USER9|FL_USER10|FL_USER11),
767
+ RHASH_AR_TABLE_BOUND_SHIFT = (FL_USHIFT+8),
768
+
769
+ RHASH_ENUM_END
770
+ };
771
+
772
+ #define HASH_PROC_DEFAULT FL_USER2
773
+
774
+ #define RHASH_AR_TABLE_SIZE_RAW(h) \
775
+ ((unsigned int)((RBASIC(h)->flags & RHASH_AR_TABLE_SIZE_MASK) >> RHASH_AR_TABLE_SIZE_SHIFT))
776
+
777
+ int rb_hash_ar_table_p(VALUE hash);
778
+ struct ar_table_struct *rb_hash_ar_table(VALUE hash);
779
+ st_table *rb_hash_st_table(VALUE hash);
780
+ void rb_hash_st_table_set(VALUE hash, st_table *st);
781
+
782
+ #if 0 /* for debug */
783
+ #define RHASH_AR_TABLE_P(hash) rb_hash_ar_table_p(hash)
784
+ #define RHASH_AR_TABLE(h) rb_hash_ar_table(h)
785
+ #define RHASH_ST_TABLE(h) rb_hash_st_table(h)
786
+ #else
787
+ #define RHASH_AR_TABLE_P(hash) (!FL_TEST_RAW((hash), RHASH_ST_TABLE_FLAG))
788
+ #define RHASH_AR_TABLE(hash) (RHASH(hash)->as.ar)
789
+ #define RHASH_ST_TABLE(hash) (RHASH(hash)->as.st)
790
+ #endif
791
+
792
+ #define RHASH(obj) (R_CAST(RHash)(obj))
793
+ #define RHASH_ST_SIZE(h) (RHASH_ST_TABLE(h)->num_entries)
794
+ #define RHASH_ST_TABLE_P(h) (!RHASH_AR_TABLE_P(h))
795
+ #define RHASH_ST_CLEAR(h) (FL_UNSET_RAW(h, RHASH_ST_TABLE_FLAG), RHASH(h)->as.ar = NULL)
796
+
797
+ #define RHASH_AR_TABLE_SIZE_MASK (VALUE)RHASH_AR_TABLE_SIZE_MASK
798
+ #define RHASH_AR_TABLE_SIZE_SHIFT RHASH_AR_TABLE_SIZE_SHIFT
799
+ #define RHASH_AR_TABLE_BOUND_MASK (VALUE)RHASH_AR_TABLE_BOUND_MASK
800
+ #define RHASH_AR_TABLE_BOUND_SHIFT RHASH_AR_TABLE_BOUND_SHIFT
801
+
802
+ #if USE_TRANSIENT_HEAP
803
+ #define RHASH_TRANSIENT_FLAG FL_USER14
804
+ #define RHASH_TRANSIENT_P(hash) FL_TEST_RAW((hash), RHASH_TRANSIENT_FLAG)
805
+ #define RHASH_SET_TRANSIENT_FLAG(h) FL_SET_RAW(h, RHASH_TRANSIENT_FLAG)
806
+ #define RHASH_UNSET_TRANSIENT_FLAG(h) FL_UNSET_RAW(h, RHASH_TRANSIENT_FLAG)
807
+ #else
808
+ #define RHASH_TRANSIENT_P(hash) 0
809
+ #define RHASH_SET_TRANSIENT_FLAG(h) ((void)0)
810
+ #define RHASH_UNSET_TRANSIENT_FLAG(h) ((void)0)
654
811
  #endif
655
812
 
813
+ #define RHASH_AR_TABLE_MAX_SIZE 8
814
+ #define RHASH_AR_TABLE_MAX_BOUND RHASH_AR_TABLE_MAX_SIZE
815
+
816
+ typedef struct ar_table_entry {
817
+ VALUE hash;
818
+ VALUE key;
819
+ VALUE record;
820
+ } ar_table_entry;
821
+
822
+ typedef struct ar_table_struct {
823
+ ar_table_entry entries[RHASH_AR_TABLE_MAX_SIZE];
824
+ } ar_table;
825
+
826
+ /*
827
+ * RHASH_AR_TABLE_P(h):
828
+ * * as.ar == NULL or
829
+ * as.ar points ar_table.
830
+ * * as.ar is allocated by transient heap or xmalloc.
831
+ *
832
+ * !RHASH_AR_TABLE_P(h):
833
+ * * as.st points st_table.
834
+ */
656
835
  struct RHash {
657
836
  struct RBasic basic;
658
- struct st_table *ntbl; /* possibly 0 */
837
+ union {
838
+ st_table *st;
839
+ ar_table *ar; /* possibly 0 */
840
+ } as;
659
841
  int iter_lev;
660
842
  const VALUE ifnone;
661
843
  };
662
844
 
663
- #define RHASH(obj) (R_CAST(RHash)(obj))
664
-
665
845
  #ifdef RHASH_ITER_LEV
666
- #undef RHASH_ITER_LEV
667
- #undef RHASH_IFNONE
668
- #undef RHASH_SIZE
669
- #define RHASH_ITER_LEV(h) (RHASH(h)->iter_lev)
670
- #define RHASH_IFNONE(h) (RHASH(h)->ifnone)
671
- #define RHASH_SIZE(h) (RHASH(h)->ntbl ? RHASH(h)->ntbl->num_entries : (st_index_t)0)
672
- #endif
846
+ # undef RHASH_ITER_LEV
847
+ # undef RHASH_IFNONE
848
+ # undef RHASH_SIZE
849
+
850
+ # define RHASH_ITER_LEV(h) (RHASH(h)->iter_lev)
851
+ # define RHASH_IFNONE(h) (RHASH(h)->ifnone)
852
+ # define RHASH_SIZE(h) (RHASH_AR_TABLE_P(h) ? RHASH_AR_TABLE_SIZE_RAW(h) : RHASH_ST_SIZE(h))
853
+ #endif /* #ifdef RHASH_ITER_LEV */
673
854
 
674
855
  /* missing/setproctitle.c */
675
856
  #ifndef HAVE_SETPROCTITLE
@@ -679,14 +860,26 @@ extern void ruby_init_setproctitle(int argc, char *argv[]);
679
860
  #define RSTRUCT_EMBED_LEN_MAX RSTRUCT_EMBED_LEN_MAX
680
861
  #define RSTRUCT_EMBED_LEN_MASK RSTRUCT_EMBED_LEN_MASK
681
862
  #define RSTRUCT_EMBED_LEN_SHIFT RSTRUCT_EMBED_LEN_SHIFT
863
+
682
864
  enum {
683
865
  RSTRUCT_EMBED_LEN_MAX = 3,
684
866
  RSTRUCT_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER1),
685
867
  RSTRUCT_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+1),
868
+ RSTRUCT_TRANSIENT_FLAG = FL_USER3,
686
869
 
687
870
  RSTRUCT_ENUM_END
688
871
  };
689
872
 
873
+ #if USE_TRANSIENT_HEAP
874
+ #define RSTRUCT_TRANSIENT_P(st) FL_TEST_RAW((obj), RSTRUCT_TRANSIENT_FLAG)
875
+ #define RSTRUCT_TRANSIENT_SET(st) FL_SET_RAW((st), RSTRUCT_TRANSIENT_FLAG)
876
+ #define RSTRUCT_TRANSIENT_UNSET(st) FL_UNSET_RAW((st), RSTRUCT_TRANSIENT_FLAG)
877
+ #else
878
+ #define RSTRUCT_TRANSIENT_P(st) 0
879
+ #define RSTRUCT_TRANSIENT_SET(st) ((void)0)
880
+ #define RSTRUCT_TRANSIENT_UNSET(st) ((void)0)
881
+ #endif
882
+
690
883
  struct RStruct {
691
884
  struct RBasic basic;
692
885
  union {
@@ -727,6 +920,13 @@ rb_struct_const_ptr(VALUE st)
727
920
  RSTRUCT(st)->as.ary : RSTRUCT(st)->as.heap.ptr);
728
921
  }
729
922
 
923
+ static inline const VALUE *
924
+ rb_struct_const_heap_ptr(VALUE st)
925
+ {
926
+ /* TODO: check embed on debug mode */
927
+ return RSTRUCT(st)->as.heap.ptr;
928
+ }
929
+
730
930
  /* class.c */
731
931
 
732
932
  struct rb_deprecated_classext_struct {
@@ -744,12 +944,15 @@ struct rb_subclass_entry {
744
944
  #if defined(HAVE_LONG_LONG)
745
945
  typedef unsigned LONG_LONG rb_serial_t;
746
946
  #define SERIALT2NUM ULL2NUM
947
+ #define PRI_SERIALT_PREFIX PRI_LL_PREFIX
747
948
  #elif defined(HAVE_UINT64_T)
748
949
  typedef uint64_t rb_serial_t;
749
950
  #define SERIALT2NUM SIZET2NUM
951
+ #define PRI_SERIALT_PREFIX PRI_64_PREFIX
750
952
  #else
751
953
  typedef unsigned long rb_serial_t;
752
954
  #define SERIALT2NUM ULONG2NUM
955
+ #define PRI_SERIALT_PREFIX PRI_LONG_PREFIX
753
956
  #endif
754
957
 
755
958
  struct rb_classext_struct {
@@ -836,21 +1039,24 @@ struct RIMemo {
836
1039
  };
837
1040
 
838
1041
  enum imemo_type {
839
- imemo_env = 0,
840
- imemo_cref = 1,
841
- imemo_svar = 2,
842
- imemo_throw_data = 3,
843
- imemo_ifunc = 4,
844
- imemo_memo = 5,
845
- imemo_ment = 6,
846
- imemo_iseq = 7,
847
- imemo_mask = 0x07
1042
+ imemo_env = 0,
1043
+ imemo_cref = 1, /*!< class reference */
1044
+ imemo_svar = 2, /*!< special variable */
1045
+ imemo_throw_data = 3,
1046
+ imemo_ifunc = 4, /*!< iterator function */
1047
+ imemo_memo = 5,
1048
+ imemo_ment = 6,
1049
+ imemo_iseq = 7,
1050
+ imemo_tmpbuf = 8,
1051
+ imemo_ast = 9,
1052
+ imemo_parser_strterm = 10
848
1053
  };
1054
+ #define IMEMO_MASK 0x0f
849
1055
 
850
1056
  static inline enum imemo_type
851
1057
  imemo_type(VALUE imemo)
852
1058
  {
853
- return (RBASIC(imemo)->flags >> FL_USHIFT) & imemo_mask;
1059
+ return (RBASIC(imemo)->flags >> FL_USHIFT) & IMEMO_MASK;
854
1060
  }
855
1061
 
856
1062
  static inline int
@@ -858,7 +1064,7 @@ imemo_type_p(VALUE imemo, enum imemo_type imemo_type)
858
1064
  {
859
1065
  if (LIKELY(!RB_SPECIAL_CONST_P(imemo))) {
860
1066
  /* fixed at compile time if imemo_type is given. */
861
- const VALUE mask = (imemo_mask << FL_USHIFT) | RUBY_T_MASK;
1067
+ const VALUE mask = (IMEMO_MASK << FL_USHIFT) | RUBY_T_MASK;
862
1068
  const VALUE expected_type = (imemo_type << FL_USHIFT) | T_IMEMO;
863
1069
  /* fixed at runtime. */
864
1070
  return expected_type == (RBASIC(imemo)->flags & mask);
@@ -868,30 +1074,29 @@ imemo_type_p(VALUE imemo, enum imemo_type imemo_type)
868
1074
  }
869
1075
  }
870
1076
 
871
- /* FL_USER0 to FL_USER2 is for type */
872
- #define IMEMO_FL_USHIFT (FL_USHIFT + 3)
873
- #define IMEMO_FL_USER0 FL_USER3
874
- #define IMEMO_FL_USER1 FL_USER4
875
- #define IMEMO_FL_USER2 FL_USER5
876
- #define IMEMO_FL_USER3 FL_USER6
877
- #define IMEMO_FL_USER4 FL_USER7
1077
+ /* FL_USER0 to FL_USER3 is for type */
1078
+ #define IMEMO_FL_USHIFT (FL_USHIFT + 4)
1079
+ #define IMEMO_FL_USER0 FL_USER4
1080
+ #define IMEMO_FL_USER1 FL_USER5
1081
+ #define IMEMO_FL_USER2 FL_USER6
1082
+ #define IMEMO_FL_USER3 FL_USER7
1083
+ #define IMEMO_FL_USER4 FL_USER8
878
1084
 
879
- /* CREF in method.h */
880
-
881
- /* SVAR */
1085
+ /* CREF (Class REFerence) is defined in method.h */
882
1086
 
1087
+ /*! SVAR (Special VARiable) */
883
1088
  struct vm_svar {
884
1089
  VALUE flags;
885
- const VALUE cref_or_me;
1090
+ const VALUE cref_or_me; /*!< class reference or rb_method_entry_t */
886
1091
  const VALUE lastline;
887
1092
  const VALUE backref;
888
1093
  const VALUE others;
889
1094
  };
890
1095
 
891
- /* THROW_DATA */
892
1096
 
893
1097
  #define THROW_DATA_CONSUMED IMEMO_FL_USER0
894
1098
 
1099
+ /*! THROW_DATA */
895
1100
  struct vm_throw_data {
896
1101
  VALUE flags;
897
1102
  VALUE reserved;
@@ -902,17 +1107,18 @@ struct vm_throw_data {
902
1107
 
903
1108
  #define THROW_DATA_P(err) RB_TYPE_P((VALUE)(err), T_IMEMO)
904
1109
 
905
- /* IFUNC */
1110
+ /* IFUNC (Internal FUNCtion) */
906
1111
 
907
1112
  struct vm_ifunc_argc {
908
1113
  #if SIZEOF_INT * 2 > SIZEOF_VALUE
909
- int min: (SIZEOF_VALUE * CHAR_BIT) / 2;
910
- int max: (SIZEOF_VALUE * CHAR_BIT) / 2;
1114
+ signed int min: (SIZEOF_VALUE * CHAR_BIT) / 2;
1115
+ signed int max: (SIZEOF_VALUE * CHAR_BIT) / 2;
911
1116
  #else
912
1117
  int min, max;
913
1118
  #endif
914
1119
  };
915
1120
 
1121
+ /*! IFUNC (Internal FUNCtion) */
916
1122
  struct vm_ifunc {
917
1123
  VALUE flags;
918
1124
  VALUE reserved;
@@ -929,8 +1135,42 @@ rb_vm_ifunc_proc_new(VALUE (*func)(ANYARGS), const void *data)
929
1135
  return rb_vm_ifunc_new(func, data, 0, UNLIMITED_ARGUMENTS);
930
1136
  }
931
1137
 
932
- /* MEMO */
1138
+ typedef struct rb_imemo_tmpbuf_struct {
1139
+ VALUE flags;
1140
+ VALUE reserved;
1141
+ VALUE *ptr; /* malloc'ed buffer */
1142
+ struct rb_imemo_tmpbuf_struct *next; /* next imemo */
1143
+ size_t cnt; /* buffer size in VALUE */
1144
+ } rb_imemo_tmpbuf_t;
1145
+
1146
+ VALUE rb_imemo_tmpbuf_auto_free_pointer(void *buf);
1147
+ VALUE rb_imemo_tmpbuf_auto_free_maybe_mark_buffer(void *buf, size_t cnt);
1148
+ rb_imemo_tmpbuf_t *rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt);
1149
+
1150
+ #define RB_IMEMO_TMPBUF_PTR(v) \
1151
+ ((void *)(((const struct rb_imemo_tmpbuf_struct *)(v))->ptr))
1152
+
1153
+ static inline VALUE
1154
+ rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str)
1155
+ {
1156
+ const void *src;
1157
+ void *dst;
1158
+ size_t len;
1159
+
1160
+ SafeStringValue(str);
1161
+ len = RSTRING_LEN(str);
1162
+ src = RSTRING_PTR(str);
1163
+ dst = ruby_xmalloc(len);
1164
+ memcpy(dst, src, len);
1165
+ return rb_imemo_tmpbuf_auto_free_pointer(dst);
1166
+ }
1167
+
1168
+ void rb_strterm_mark(VALUE obj);
933
1169
 
1170
+ /*! MEMO
1171
+ *
1172
+ * @see imemo_type
1173
+ * */
934
1174
  struct MEMO {
935
1175
  VALUE flags;
936
1176
  VALUE reserved;
@@ -1013,16 +1253,50 @@ VALUE rb_gvar_get(struct rb_global_entry *);
1013
1253
  VALUE rb_gvar_set(struct rb_global_entry *, VALUE);
1014
1254
  VALUE rb_gvar_defined(struct rb_global_entry *);
1015
1255
 
1016
- struct vtm; /* defined by timev.h */
1017
-
1018
1256
  /* array.c */
1257
+
1258
+ #ifndef ARRAY_DEBUG
1259
+ #define ARRAY_DEBUG 0
1260
+ #endif
1261
+
1262
+ #ifdef ARRAY_DEBUG
1263
+ #define RARRAY_PTR_IN_USE_FLAG FL_USER14
1264
+ #define ARY_PTR_USING_P(ary) FL_TEST_RAW((ary), RARRAY_PTR_IN_USE_FLAG)
1265
+ #else
1266
+
1267
+ /* disable debug function */
1268
+ #undef RARRAY_PTR_USE_START_TRANSIENT
1269
+ #undef RARRAY_PTR_USE_END_TRANSIENT
1270
+ #define RARRAY_PTR_USE_START_TRANSIENT(a) ((VALUE *)RARRAY_CONST_PTR_TRANSIENT(a))
1271
+ #define RARRAY_PTR_USE_END_TRANSIENT(a)
1272
+ #define ARY_PTR_USING_P(ary) 0
1273
+
1274
+ #endif
1275
+
1276
+ #if USE_TRANSIENT_HEAP
1277
+ #define RARY_TRANSIENT_SET(ary) FL_SET_RAW((ary), RARRAY_TRANSIENT_FLAG);
1278
+ #define RARY_TRANSIENT_UNSET(ary) FL_UNSET_RAW((ary), RARRAY_TRANSIENT_FLAG);
1279
+ #else
1280
+ #undef RARRAY_TRANSIENT_P
1281
+ #define RARRAY_TRANSIENT_P(a) 0
1282
+ #define RARY_TRANSIENT_SET(ary) ((void)0)
1283
+ #define RARY_TRANSIENT_UNSET(ary) ((void)0)
1284
+ #endif
1285
+
1286
+
1019
1287
  VALUE rb_ary_last(int, const VALUE *, VALUE);
1020
1288
  void rb_ary_set_len(VALUE, long);
1021
1289
  void rb_ary_delete_same(VALUE, VALUE);
1022
1290
  VALUE rb_ary_tmp_new_fill(long capa);
1023
1291
  VALUE rb_ary_at(VALUE, VALUE);
1292
+ VALUE rb_ary_aref1(VALUE ary, VALUE i);
1293
+ VALUE rb_ary_aref2(VALUE ary, VALUE b, VALUE e);
1024
1294
  size_t rb_ary_memsize(VALUE);
1025
- #ifdef __GNUC__
1295
+ VALUE rb_to_array_type(VALUE obj);
1296
+ VALUE rb_check_to_array(VALUE ary);
1297
+ VALUE rb_ary_tmp_new_from_values(VALUE, long, const VALUE *);
1298
+ VALUE rb_ary_behead(VALUE, long);
1299
+ #if defined(__GNUC__) && defined(HAVE_VA_ARGS_MACRO)
1026
1300
  #define rb_ary_new_from_args(n, ...) \
1027
1301
  __extension__ ({ \
1028
1302
  const VALUE args_to_new_ary[] = {__VA_ARGS__}; \
@@ -1033,6 +1307,22 @@ size_t rb_ary_memsize(VALUE);
1033
1307
  })
1034
1308
  #endif
1035
1309
 
1310
+ static inline VALUE
1311
+ rb_ary_entry_internal(VALUE ary, long offset)
1312
+ {
1313
+ long len = RARRAY_LEN(ary);
1314
+ const VALUE *ptr = RARRAY_CONST_PTR_TRANSIENT(ary);
1315
+ if (len == 0) return Qnil;
1316
+ if (offset < 0) {
1317
+ offset += len;
1318
+ if (offset < 0) return Qnil;
1319
+ }
1320
+ else if (len <= offset) {
1321
+ return Qnil;
1322
+ }
1323
+ return ptr[offset];
1324
+ }
1325
+
1036
1326
  /* bignum.c */
1037
1327
  extern const char ruby_digitmap[];
1038
1328
  double rb_big_fdiv_double(VALUE x, VALUE y);
@@ -1044,6 +1334,7 @@ size_t rb_big_size(VALUE);
1044
1334
  VALUE rb_integer_float_cmp(VALUE x, VALUE y);
1045
1335
  VALUE rb_integer_float_eq(VALUE x, VALUE y);
1046
1336
  VALUE rb_cstr_parse_inum(const char *str, ssize_t len, char **endp, int base);
1337
+ VALUE rb_str_convert_to_inum(VALUE str, int base, int badcheck, int raise_exception);
1047
1338
  VALUE rb_big_comp(VALUE x);
1048
1339
  VALUE rb_big_aref(VALUE x, VALUE y);
1049
1340
  VALUE rb_big_abs(VALUE x);
@@ -1054,6 +1345,7 @@ VALUE rb_big_gt(VALUE x, VALUE y);
1054
1345
  VALUE rb_big_ge(VALUE x, VALUE y);
1055
1346
  VALUE rb_big_lt(VALUE x, VALUE y);
1056
1347
  VALUE rb_big_le(VALUE x, VALUE y);
1348
+ VALUE rb_int_powm(int const argc, VALUE * const argv, VALUE const num);
1057
1349
 
1058
1350
  /* class.c */
1059
1351
  VALUE rb_class_boot(VALUE);
@@ -1083,18 +1375,17 @@ VALUE rb_invcmp(VALUE, VALUE);
1083
1375
  struct rb_block;
1084
1376
  int rb_dvar_defined(ID, const struct rb_block *);
1085
1377
  int rb_local_defined(ID, const struct rb_block *);
1086
- CONSTFUNC(const char * rb_insns_name(int i));
1378
+ const char * rb_insns_name(int i);
1087
1379
  VALUE rb_insns_name_array(void);
1380
+ int rb_vm_insn_addr2insn(const void *);
1088
1381
 
1089
1382
  /* complex.c */
1090
- VALUE rb_complex_plus(VALUE, VALUE);
1091
- VALUE rb_complex_mul(VALUE, VALUE);
1092
- VALUE rb_complex_abs(VALUE x);
1093
- VALUE rb_complex_sqrt(VALUE x);
1383
+ VALUE rb_dbl_complex_new_polar_pi(double abs, double ang);
1094
1384
 
1385
+ struct rb_thread_struct;
1095
1386
  /* cont.c */
1096
1387
  VALUE rb_obj_is_fiber(VALUE);
1097
- void rb_fiber_reset_root_local_storage(VALUE);
1388
+ void rb_fiber_reset_root_local_storage(struct rb_thread_struct *);
1098
1389
  void ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(ANYARGS), VALUE (*rollback_func)(ANYARGS));
1099
1390
 
1100
1391
  /* debug.c */
@@ -1109,9 +1400,10 @@ void Init_ext(void);
1109
1400
 
1110
1401
  /* encoding.c */
1111
1402
  ID rb_id_encoding(void);
1112
- CONSTFUNC(void rb_gc_mark_encodings(void));
1403
+ #ifdef RUBY_ENCODING_H
1113
1404
  rb_encoding *rb_enc_get_from_index(int index);
1114
1405
  rb_encoding *rb_enc_check_str(VALUE str1, VALUE str2);
1406
+ #endif
1115
1407
  int rb_encdb_replicate(const char *alias, const char *orig);
1116
1408
  int rb_encdb_alias(const char *alias, const char *orig);
1117
1409
  int rb_encdb_dummy(const char *name);
@@ -1122,6 +1414,7 @@ void rb_encdb_set_unicode(int index);
1122
1414
  PUREFUNC(int rb_data_is_encoding(VALUE obj));
1123
1415
 
1124
1416
  /* enum.c */
1417
+ extern VALUE rb_cArithSeq;
1125
1418
  VALUE rb_f_send(int argc, VALUE *argv, VALUE recv);
1126
1419
  VALUE rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary);
1127
1420
 
@@ -1130,21 +1423,23 @@ extern VALUE rb_eEAGAIN;
1130
1423
  extern VALUE rb_eEWOULDBLOCK;
1131
1424
  extern VALUE rb_eEINPROGRESS;
1132
1425
  void rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args);
1133
- VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list);
1134
1426
  VALUE rb_check_backtrace(VALUE);
1135
1427
  NORETURN(void rb_async_bug_errno(const char *,int));
1136
1428
  const char *rb_builtin_type_name(int t);
1137
1429
  const char *rb_builtin_class_name(VALUE x);
1138
1430
  PRINTF_ARGS(void rb_sys_warn(const char *fmt, ...), 1, 2);
1139
1431
  PRINTF_ARGS(void rb_syserr_warn(int err, const char *fmt, ...), 2, 3);
1432
+ PRINTF_ARGS(void rb_sys_warning(const char *fmt, ...), 1, 2);
1433
+ PRINTF_ARGS(void rb_syserr_warning(int err, const char *fmt, ...), 2, 3);
1434
+ #ifdef RUBY_ENCODING_H
1435
+ VALUE rb_syntax_error_append(VALUE, VALUE, int, int, rb_encoding*, const char*, va_list);
1140
1436
  PRINTF_ARGS(void rb_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3);
1141
1437
  PRINTF_ARGS(void rb_sys_enc_warn(rb_encoding *enc, const char *fmt, ...), 2, 3);
1142
1438
  PRINTF_ARGS(void rb_syserr_enc_warn(int err, rb_encoding *enc, const char *fmt, ...), 3, 4);
1143
- PRINTF_ARGS(void rb_sys_warning(const char *fmt, ...), 1, 2);
1144
- PRINTF_ARGS(void rb_syserr_warning(int err, const char *fmt, ...), 2, 3);
1145
1439
  PRINTF_ARGS(void rb_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3);
1146
1440
  PRINTF_ARGS(void rb_sys_enc_warning(rb_encoding *enc, const char *fmt, ...), 2, 3);
1147
1441
  PRINTF_ARGS(void rb_syserr_enc_warning(int err, rb_encoding *enc, const char *fmt, ...), 3, 4);
1442
+ #endif
1148
1443
 
1149
1444
  #define rb_raise_cstr(etype, mesg) \
1150
1445
  rb_exc_raise(rb_exc_new_str(etype, rb_str_new_cstr(mesg)))
@@ -1156,6 +1451,7 @@ VALUE rb_name_err_new(VALUE mesg, VALUE recv, VALUE method);
1156
1451
  rb_exc_raise(rb_name_err_new(mesg, recv, name))
1157
1452
  #define rb_name_err_raise(mesg, recv, name) \
1158
1453
  rb_name_err_raise_str(rb_fstring_cstr(mesg), (recv), (name))
1454
+ VALUE rb_nomethod_err_new(VALUE mesg, VALUE recv, VALUE method, VALUE args, int priv);
1159
1455
  VALUE rb_key_err_new(VALUE mesg, VALUE recv, VALUE name);
1160
1456
  #define rb_key_err_raise(mesg, recv, name) \
1161
1457
  rb_exc_raise(rb_key_err_new(mesg, recv, name))
@@ -1163,10 +1459,14 @@ NORETURN(void ruby_deprecated_internal_feature(const char *));
1163
1459
  #define DEPRECATED_INTERNAL_FEATURE(func) \
1164
1460
  (ruby_deprecated_internal_feature(func), UNREACHABLE)
1165
1461
  VALUE rb_warning_warn(VALUE mod, VALUE str);
1166
- VALUE rb_warning_string(const char *fmt, ...);
1462
+ PRINTF_ARGS(VALUE rb_warning_string(const char *fmt, ...), 1, 2);
1167
1463
 
1168
1464
  /* eval.c */
1169
1465
  VALUE rb_refinement_module_get_refined_class(VALUE module);
1466
+ extern ID ruby_static_id_signo, ruby_static_id_status;
1467
+ void rb_class_modify_check(VALUE);
1468
+ #define id_signo ruby_static_id_signo
1469
+ #define id_status ruby_static_id_status
1170
1470
 
1171
1471
  /* eval_error.c */
1172
1472
  VALUE rb_get_backtrace(VALUE info);
@@ -1176,6 +1476,7 @@ void rb_call_end_proc(VALUE data);
1176
1476
  void rb_mark_end_proc(void);
1177
1477
 
1178
1478
  /* file.c */
1479
+ extern const char ruby_null_device[];
1179
1480
  VALUE rb_home_dir_of(VALUE user, VALUE result);
1180
1481
  VALUE rb_default_home_dir(VALUE result);
1181
1482
  VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
@@ -1227,9 +1528,11 @@ void rb_copy_wb_protected_attribute(VALUE dest, VALUE obj);
1227
1528
  #define ruby_sized_xfree(ptr, size) ruby_xfree(ptr)
1228
1529
  #define SIZED_REALLOC_N(var,type,n,old_n) REALLOC_N(var, type, n)
1229
1530
  #else
1531
+ RUBY_SYMBOL_EXPORT_BEGIN
1230
1532
  void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_ALLOC_SIZE((2));
1231
1533
  void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_ALLOC_SIZE((2, 3));
1232
1534
  void ruby_sized_xfree(void *x, size_t size);
1535
+ RUBY_SYMBOL_EXPORT_END
1233
1536
  #define SIZED_REALLOC_N(var,type,n,old_n) ((var)=(type*)ruby_sized_xrealloc((char*)(var), (n) * sizeof(type), (old_n) * sizeof(type)))
1234
1537
  #endif
1235
1538
 
@@ -1242,9 +1545,22 @@ void ruby_sized_xfree(void *x, size_t size);
1242
1545
  rb_wb_unprotected_newobj_of(klass, flags))
1243
1546
  #define NEWOBJ_OF(obj,type,klass,flags) RB_NEWOBJ_OF(obj,type,klass,flags)
1244
1547
 
1548
+ void *rb_aligned_malloc(size_t, size_t);
1549
+ void rb_aligned_free(void *);
1550
+
1245
1551
  /* hash.c */
1552
+ #if RHASH_CONVERT_TABLE_DEBUG
1553
+ struct st_table *rb_hash_tbl_raw(VALUE hash, const char *file, int line);
1554
+ #define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h, __FILE__, __LINE__)
1555
+ #else
1246
1556
  struct st_table *rb_hash_tbl_raw(VALUE hash);
1557
+ #define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h)
1558
+ #endif
1559
+
1247
1560
  VALUE rb_hash_new_with_size(st_index_t size);
1561
+ RUBY_SYMBOL_EXPORT_BEGIN
1562
+ VALUE rb_hash_new_compare_by_id(void);
1563
+ RUBY_SYMBOL_EXPORT_END
1248
1564
  VALUE rb_hash_has_key(VALUE hash, VALUE key);
1249
1565
  VALUE rb_hash_default_value(VALUE hash, VALUE key);
1250
1566
  VALUE rb_hash_set_default_proc(VALUE hash, VALUE proc);
@@ -1253,13 +1569,20 @@ long rb_dbl_long_hash(double d);
1253
1569
  st_table *rb_init_identtable(void);
1254
1570
  st_table *rb_init_identtable_with_size(st_index_t size);
1255
1571
  VALUE rb_hash_compare_by_id_p(VALUE hash);
1256
-
1257
- #define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h)
1572
+ VALUE rb_to_hash_type(VALUE obj);
1573
+ VALUE rb_hash_key_str(VALUE);
1258
1574
  VALUE rb_hash_keys(VALUE hash);
1259
1575
  VALUE rb_hash_values(VALUE hash);
1260
1576
  VALUE rb_hash_rehash(VALUE hash);
1577
+ VALUE rb_hash_resurrect(VALUE hash);
1261
1578
  int rb_hash_add_new_element(VALUE hash, VALUE key, VALUE val);
1262
- #define HASH_PROC_DEFAULT FL_USER2
1579
+ VALUE rb_hash_set_pair(VALUE hash, VALUE pair);
1580
+ void rb_hash_bulk_insert(long, const VALUE *, VALUE);
1581
+
1582
+ int rb_hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval);
1583
+ int rb_hash_stlike_delete(VALUE hash, st_data_t *pkey, st_data_t *pval);
1584
+ int rb_hash_stlike_foreach(VALUE hash, int (*func)(ANYARGS), st_data_t arg);
1585
+ int rb_hash_stlike_update(VALUE hash, st_data_t key, st_update_callback_func func, st_data_t arg);
1263
1586
 
1264
1587
  /* inits.c */
1265
1588
  void rb_call_inits(void);
@@ -1270,8 +1593,12 @@ void ruby_set_inplace_mode(const char *);
1270
1593
  ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
1271
1594
  void rb_stdio_set_default_encoding(void);
1272
1595
  VALUE rb_io_flush_raw(VALUE, int);
1596
+ #ifdef RUBY_IO_H
1273
1597
  size_t rb_io_memsize(const rb_io_t *);
1598
+ #endif
1274
1599
  int rb_stderr_tty_p(void);
1600
+ void rb_io_fptr_finalize_internal(void *ptr);
1601
+ #define rb_io_fptr_finalize rb_io_fptr_finalize_internal
1275
1602
 
1276
1603
  /* load.c */
1277
1604
  VALUE rb_get_load_path(void);
@@ -1297,6 +1624,20 @@ VALUE rb_math_sin(VALUE);
1297
1624
  VALUE rb_math_sinh(VALUE);
1298
1625
  VALUE rb_math_sqrt(VALUE);
1299
1626
 
1627
+ /* mjit.c */
1628
+
1629
+ #if USE_MJIT
1630
+ extern int mjit_enabled;
1631
+ VALUE mjit_pause(int wait_p);
1632
+ VALUE mjit_resume(void);
1633
+ void mjit_finish(int close_handle_p);
1634
+ #else
1635
+ #define mjit_enabled 0
1636
+ static inline VALUE mjit_pause(int wait_p){ return Qnil; } /* unreachable */
1637
+ static inline VALUE mjit_resume(void){ return Qnil; } /* unreachable */
1638
+ static inline void mjit_finish(int close_handle_p){}
1639
+ #endif
1640
+
1300
1641
  /* newline.c */
1301
1642
  void Init_newline(void);
1302
1643
 
@@ -1328,7 +1669,7 @@ enum ruby_num_rounding_mode {
1328
1669
 
1329
1670
  int rb_num_to_uint(VALUE val, unsigned int *ret);
1330
1671
  VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl);
1331
- int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
1672
+ int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless);
1332
1673
  double ruby_float_mod(double x, double y);
1333
1674
  int rb_num_negative_p(VALUE);
1334
1675
  VALUE rb_int_succ(VALUE num);
@@ -1359,9 +1700,60 @@ VALUE rb_int_and(VALUE x, VALUE y);
1359
1700
  VALUE rb_int_lshift(VALUE x, VALUE y);
1360
1701
  VALUE rb_int_div(VALUE x, VALUE y);
1361
1702
  VALUE rb_int_abs(VALUE num);
1703
+ VALUE rb_int_odd_p(VALUE num);
1704
+ int rb_int_positive_p(VALUE num);
1705
+ int rb_int_negative_p(VALUE num);
1706
+ VALUE rb_num_pow(VALUE x, VALUE y);
1707
+
1708
+ static inline VALUE
1709
+ rb_num_compare_with_zero(VALUE num, ID mid)
1710
+ {
1711
+ VALUE zero = INT2FIX(0);
1712
+ VALUE r = rb_check_funcall(num, mid, 1, &zero);
1713
+ if (r == Qundef) {
1714
+ rb_cmperr(num, zero);
1715
+ }
1716
+ return r;
1717
+ }
1718
+
1719
+ static inline int
1720
+ rb_num_positive_int_p(VALUE num)
1721
+ {
1722
+ const ID mid = '>';
1723
+
1724
+ if (FIXNUM_P(num)) {
1725
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
1726
+ return FIXNUM_POSITIVE_P(num);
1727
+ }
1728
+ else if (RB_TYPE_P(num, T_BIGNUM)) {
1729
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
1730
+ return BIGNUM_POSITIVE_P(num);
1731
+ }
1732
+ return RTEST(rb_num_compare_with_zero(num, mid));
1733
+ }
1734
+
1735
+
1736
+ static inline int
1737
+ rb_num_negative_int_p(VALUE num)
1738
+ {
1739
+ const ID mid = '<';
1740
+
1741
+ if (FIXNUM_P(num)) {
1742
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
1743
+ return FIXNUM_NEGATIVE_P(num);
1744
+ }
1745
+ else if (RB_TYPE_P(num, T_BIGNUM)) {
1746
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
1747
+ return BIGNUM_NEGATIVE_P(num);
1748
+ }
1749
+ return RTEST(rb_num_compare_with_zero(num, mid));
1750
+ }
1751
+
1752
+
1362
1753
  VALUE rb_float_abs(VALUE flt);
1363
1754
  VALUE rb_float_equal(VALUE x, VALUE y);
1364
1755
  VALUE rb_float_eql(VALUE x, VALUE y);
1756
+ VALUE rb_flo_div_flo(VALUE x, VALUE y);
1365
1757
 
1366
1758
  #if USE_FLONUM
1367
1759
  #define RUBY_BIT_ROTL(v, n) (((v) << (n)) | ((v) >> ((sizeof(v) * 8) - n)))
@@ -1468,7 +1860,9 @@ struct RBasicRaw {
1468
1860
  #endif
1469
1861
  VALUE rb_parser_get_yydebug(VALUE);
1470
1862
  VALUE rb_parser_set_yydebug(VALUE, VALUE);
1863
+ RUBY_SYMBOL_EXPORT_BEGIN
1471
1864
  VALUE rb_parser_set_context(VALUE, const struct rb_block *, int);
1865
+ RUBY_SYMBOL_EXPORT_END
1472
1866
  void *rb_parser_load_file(VALUE parser, VALUE name);
1473
1867
  int rb_is_const_name(VALUE name);
1474
1868
  int rb_is_class_name(VALUE name);
@@ -1502,6 +1896,7 @@ VALUE rb_block_to_s(VALUE self, const struct rb_block *block, const char *additi
1502
1896
  /* process.c */
1503
1897
  #define RB_MAX_GROUPS (65536)
1504
1898
 
1899
+ struct waitpid_state;
1505
1900
  struct rb_execarg {
1506
1901
  union {
1507
1902
  struct {
@@ -1530,6 +1925,8 @@ struct rb_execarg {
1530
1925
  unsigned new_pgroup_flag : 1;
1531
1926
  unsigned uid_given : 1;
1532
1927
  unsigned gid_given : 1;
1928
+ unsigned exception : 1;
1929
+ struct waitpid_state *waitpid_state; /* for async process management */
1533
1930
  rb_pid_t pgroup_pgid; /* asis(-1), new pgroup(0), specified pgroup (0<V). */
1534
1931
  VALUE rlimit_limits; /* Qfalse or [[rtype, softlim, hardlim], ...] */
1535
1932
  mode_t umask_mask;
@@ -1549,13 +1946,28 @@ struct rb_execarg {
1549
1946
  * The beginning one is for /bin/sh used by exec_with_sh.
1550
1947
  * The last one for terminating NULL used by execve.
1551
1948
  * See rb_exec_fillarg() in process.c. */
1552
- #define ARGVSTR2ARGC(argv_str) (RSTRING_LEN(argv_str) / sizeof(char *) - 2)
1553
- #define ARGVSTR2ARGV(argv_str) ((char **)RSTRING_PTR(argv_str) + 1)
1949
+ #define ARGVSTR2ARGV(argv_str) ((char **)RB_IMEMO_TMPBUF_PTR(argv_str) + 1)
1950
+
1951
+ static inline size_t
1952
+ ARGVSTR2ARGC(VALUE argv_str)
1953
+ {
1954
+ size_t i = 0;
1955
+ char *const *p = ARGVSTR2ARGV(argv_str);
1956
+ while (p[i++])
1957
+ ;
1958
+ return i - 1;
1959
+ }
1554
1960
 
1555
1961
  rb_pid_t rb_fork_ruby(int *status);
1556
1962
  void rb_last_status_clear(void);
1557
1963
 
1964
+ /* range.c */
1965
+ #define RANGE_BEG(r) (RSTRUCT(r)->as.ary[0])
1966
+ #define RANGE_END(r) (RSTRUCT(r)->as.ary[1])
1967
+ #define RANGE_EXCL(r) (RSTRUCT(r)->as.ary[2])
1968
+
1558
1969
  /* rational.c */
1970
+ VALUE rb_rational_canonicalize(VALUE x);
1559
1971
  VALUE rb_rational_uminus(VALUE self);
1560
1972
  VALUE rb_rational_plus(VALUE self, VALUE other);
1561
1973
  VALUE rb_lcm(VALUE x, VALUE y);
@@ -1563,6 +1975,7 @@ VALUE rb_rational_reciprocal(VALUE x);
1563
1975
  VALUE rb_cstr_to_rat(const char *, int);
1564
1976
  VALUE rb_rational_abs(VALUE self);
1565
1977
  VALUE rb_rational_cmp(VALUE self, VALUE other);
1978
+ VALUE rb_rational_pow(VALUE self, VALUE other);
1566
1979
  VALUE rb_numeric_quo(VALUE x, VALUE y);
1567
1980
 
1568
1981
  /* re.c */
@@ -1570,25 +1983,15 @@ VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourcel
1570
1983
  VALUE rb_reg_check_preprocess(VALUE);
1571
1984
  long rb_reg_search0(VALUE, VALUE, long, int, int);
1572
1985
  VALUE rb_reg_match_p(VALUE re, VALUE str, long pos);
1986
+ bool rb_reg_start_with_p(VALUE re, VALUE str);
1573
1987
  void rb_backref_set_string(VALUE string, long pos, long len);
1574
1988
  int rb_match_count(VALUE match);
1575
1989
  int rb_match_nth_defined(int nth, VALUE match);
1990
+ VALUE rb_reg_new_ary(VALUE ary, int options);
1576
1991
 
1577
1992
  /* signal.c */
1578
1993
  extern int ruby_enable_coredump;
1579
1994
  int rb_get_next_signal(void);
1580
- int rb_sigaltstack_size(void);
1581
-
1582
- /* st.c */
1583
- extern void rb_hash_bulk_insert(long, const VALUE *, VALUE);
1584
-
1585
- /* strftime.c */
1586
- #ifdef RUBY_ENCODING_H
1587
- VALUE rb_strftime_timespec(const char *format, size_t format_len, rb_encoding *enc,
1588
- const struct vtm *vtm, struct timespec *ts, int gmt);
1589
- VALUE rb_strftime(const char *format, size_t format_len, rb_encoding *enc,
1590
- const struct vtm *vtm, VALUE timev, int gmt);
1591
- #endif
1592
1995
 
1593
1996
  /* string.c */
1594
1997
  VALUE rb_fstring(VALUE);
@@ -1646,6 +2049,7 @@ VALUE rb_sym_proc_call(ID mid, int argc, const VALUE *argv, VALUE passed_proc);
1646
2049
  VALUE rb_sym_to_proc(VALUE sym);
1647
2050
  char *rb_str_to_cstr(VALUE str);
1648
2051
  VALUE rb_str_eql(VALUE str1, VALUE str2);
2052
+ VALUE rb_obj_as_string_result(VALUE str, VALUE obj);
1649
2053
 
1650
2054
  /* symbol.c */
1651
2055
  #ifdef RUBY_ENCODING_H
@@ -1670,10 +2074,12 @@ VALUE rb_sym_intern_ascii_cstr(const char *ptr);
1670
2074
  rb_sym_intern_ascii_cstr(ptr); \
1671
2075
  })
1672
2076
  #endif
2077
+ VALUE rb_to_symbol_type(VALUE obj);
1673
2078
 
1674
2079
  /* struct.c */
1675
2080
  VALUE rb_struct_init_copy(VALUE copy, VALUE s);
1676
2081
  VALUE rb_struct_lookup(VALUE s, VALUE idx);
2082
+ VALUE rb_struct_s_keyword_init(VALUE klass);
1677
2083
 
1678
2084
  /* time.c */
1679
2085
  struct timeval rb_time_timeval(VALUE);
@@ -1681,16 +2087,17 @@ struct timeval rb_time_timeval(VALUE);
1681
2087
  /* thread.c */
1682
2088
  #define COVERAGE_INDEX_LINES 0
1683
2089
  #define COVERAGE_INDEX_BRANCHES 1
1684
- #define COVERAGE_INDEX_METHODS 2
1685
2090
  #define COVERAGE_TARGET_LINES 1
1686
2091
  #define COVERAGE_TARGET_BRANCHES 2
1687
2092
  #define COVERAGE_TARGET_METHODS 4
2093
+ #define COVERAGE_TARGET_ONESHOT_LINES 8
1688
2094
 
1689
2095
  VALUE rb_obj_is_mutex(VALUE obj);
1690
2096
  VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
1691
2097
  void rb_thread_execute_interrupts(VALUE th);
1692
2098
  void rb_clear_trace_func(void);
1693
2099
  VALUE rb_get_coverages(void);
2100
+ int rb_get_coverage_mode(void);
1694
2101
  VALUE rb_default_coverage(int);
1695
2102
  VALUE rb_thread_shield_new(void);
1696
2103
  VALUE rb_thread_shield_wait(VALUE self);
@@ -1701,25 +2108,37 @@ void rb_mutex_allow_trap(VALUE self, int val);
1701
2108
  VALUE rb_uninterruptible(VALUE (*b_proc)(ANYARGS), VALUE data);
1702
2109
  VALUE rb_mutex_owned_p(VALUE self);
1703
2110
 
1704
- /* thread_pthread.c, thread_win32.c */
1705
- void Init_native_thread(void);
1706
- int rb_divert_reserved_fd(int fd);
1707
-
1708
2111
  /* transcode.c */
1709
2112
  extern VALUE rb_cEncodingConverter;
2113
+ #ifdef RUBY_ENCODING_H
1710
2114
  size_t rb_econv_memsize(rb_econv_t *);
2115
+ #endif
1711
2116
 
1712
2117
  /* us_ascii.c */
2118
+ #ifdef RUBY_ENCODING_H
1713
2119
  extern rb_encoding OnigEncodingUS_ASCII;
2120
+ #endif
1714
2121
 
1715
2122
  /* util.c */
1716
2123
  char *ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve);
1717
2124
  char *ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign, char **rve);
1718
2125
 
1719
2126
  /* utf_8.c */
2127
+ #ifdef RUBY_ENCODING_H
1720
2128
  extern rb_encoding OnigEncodingUTF_8;
2129
+ #endif
1721
2130
 
1722
2131
  /* variable.c */
2132
+ #if USE_TRANSIENT_HEAP
2133
+ #define ROBJECT_TRANSIENT_FLAG FL_USER13
2134
+ #define ROBJ_TRANSIENT_P(obj) FL_TEST_RAW((obj), ROBJECT_TRANSIENT_FLAG)
2135
+ #define ROBJ_TRANSIENT_SET(obj) FL_SET_RAW((obj), ROBJECT_TRANSIENT_FLAG)
2136
+ #define ROBJ_TRANSIENT_UNSET(obj) FL_UNSET_RAW((obj), ROBJECT_TRANSIENT_FLAG)
2137
+ #else
2138
+ #define ROBJ_TRANSIENT_P(obj) 0
2139
+ #define ROBJ_TRANSIENT_SET(obj) ((void)0)
2140
+ #define ROBJ_TRANSIENT_UNSET(obj) ((void)0)
2141
+ #endif
1723
2142
  void rb_gc_mark_global_tbl(void);
1724
2143
  size_t rb_generic_ivar_memsize(VALUE);
1725
2144
  VALUE rb_search_class_path(VALUE);
@@ -1727,9 +2146,10 @@ VALUE rb_attr_delete(VALUE, ID);
1727
2146
  VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef);
1728
2147
  void rb_autoload_str(VALUE mod, ID id, VALUE file);
1729
2148
  void rb_deprecate_constant(VALUE mod, const char *name);
1730
-
1731
- /* version.c */
1732
- extern const char ruby_engine[];
2149
+ NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE));
2150
+ rb_gvar_getter_t *rb_gvar_getter_function_of(const struct rb_global_entry *);
2151
+ rb_gvar_setter_t *rb_gvar_setter_function_of(const struct rb_global_entry *);
2152
+ bool rb_gvar_is_traced(const struct rb_global_entry *);
1733
2153
 
1734
2154
  /* vm_insnhelper.h */
1735
2155
  rb_serial_t rb_next_class_serial(void);
@@ -1741,17 +2161,17 @@ void Init_BareVM(void);
1741
2161
  void Init_vm_objects(void);
1742
2162
  PUREFUNC(VALUE rb_vm_top_self(void));
1743
2163
  void rb_thread_recycle_stack_release(VALUE *);
2164
+ VALUE *rb_thread_recycle_stack(size_t);
1744
2165
  void rb_vm_change_state(void);
1745
2166
  void rb_vm_inc_const_missing_count(void);
1746
2167
  const void **rb_vm_get_insns_address_table(void);
1747
- VALUE rb_sourcefilename(void);
1748
2168
  VALUE rb_source_location(int *pline);
1749
- const char *rb_source_loc(int *pline);
1750
- void rb_vm_pop_cfunc_frame(void);
2169
+ const char *rb_source_location_cstr(int *pline);
2170
+ MJIT_STATIC void rb_vm_pop_cfunc_frame(void);
1751
2171
  int rb_vm_add_root_module(ID id, VALUE module);
1752
2172
  void rb_vm_check_redefinition_by_prepend(VALUE klass);
1753
2173
  VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements);
1754
- VALUE ruby_vm_special_exception_copy(VALUE);
2174
+ MJIT_STATIC VALUE ruby_vm_special_exception_copy(VALUE);
1755
2175
  PUREFUNC(st_table *rb_vm_fstring_table(void));
1756
2176
 
1757
2177
 
@@ -1765,6 +2185,7 @@ VALUE rb_check_block_call(VALUE, ID, int, const VALUE *, rb_block_call_func_t, V
1765
2185
  typedef void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE);
1766
2186
  VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv,
1767
2187
  rb_check_funcall_hook *hook, VALUE arg);
2188
+ const char *rb_type_str(enum ruby_value_type type);
1768
2189
  VALUE rb_check_funcall_default(VALUE, ID, int, const VALUE *, VALUE);
1769
2190
  VALUE rb_yield_1(VALUE val);
1770
2191
  VALUE rb_yield_force_blockarg(VALUE values);
@@ -1775,6 +2196,7 @@ VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv,
1775
2196
  /* vm_insnhelper.c */
1776
2197
  VALUE rb_equal_opt(VALUE obj1, VALUE obj2);
1777
2198
  VALUE rb_eql_opt(VALUE obj1, VALUE obj2);
2199
+ void Init_vm_stack_canary(void);
1778
2200
 
1779
2201
  /* vm_method.c */
1780
2202
  void Init_eval_method(void);
@@ -1801,6 +2223,11 @@ const char *rb_objspace_data_type_name(VALUE obj);
1801
2223
  /* Temporary. This API will be removed (renamed). */
1802
2224
  VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
1803
2225
 
2226
+ /* array.c (export) */
2227
+ void rb_ary_detransient(VALUE a);
2228
+ VALUE *rb_ary_ptr_use_start(VALUE ary);
2229
+ void rb_ary_ptr_use_end(VALUE ary);
2230
+
1804
2231
  /* bignum.c (export) */
1805
2232
  VALUE rb_big_mul_normal(VALUE x, VALUE y);
1806
2233
  VALUE rb_big_mul_balance(VALUE x, VALUE y);
@@ -1828,6 +2255,11 @@ enum rb_int_parse_flags {
1828
2255
  };
1829
2256
  VALUE rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits, int base, int flags);
1830
2257
 
2258
+ /* enumerator.c (export) */
2259
+ VALUE rb_arith_seq_new(VALUE obj, VALUE meth, int argc, VALUE const *argv,
2260
+ rb_enumerator_size_func *size_fn,
2261
+ VALUE beg, VALUE end, VALUE step, int excl);
2262
+
1831
2263
  /* error.c (export) */
1832
2264
  int rb_bug_reporter_add(void (*func)(FILE *, void *), void *data);
1833
2265
  NORETURN(void rb_unexpected_type(VALUE,int));
@@ -1837,8 +2269,15 @@ NORETURN(void rb_unexpected_type(VALUE,int));
1837
2269
  ((t) == RUBY_T_DATA && RTYPEDDATA_P(v)) ? \
1838
2270
  rb_unexpected_type((VALUE)(v), (t)) : (void)0)
1839
2271
 
2272
+ static inline int
2273
+ rb_typeddata_is_instance_of_inline(VALUE obj, const rb_data_type_t *data_type)
2274
+ {
2275
+ return RB_TYPE_P(obj, T_DATA) && RTYPEDDATA_P(obj) && (RTYPEDDATA_TYPE(obj) == data_type);
2276
+ }
2277
+ #define rb_typeddata_is_instance_of rb_typeddata_is_instance_of_inline
2278
+
1840
2279
  /* file.c (export) */
1841
- #ifdef HAVE_READLINK
2280
+ #if defined HAVE_READLINK && defined RUBY_ENCODING_H
1842
2281
  VALUE rb_readlink(VALUE path, rb_encoding *enc);
1843
2282
  #endif
1844
2283
  #ifdef __APPLE__
@@ -1860,9 +2299,8 @@ VALUE rb_int_positive_pow(long x, unsigned long y);
1860
2299
  /* process.c (export) */
1861
2300
  int rb_exec_async_signal_safe(const struct rb_execarg *e, char *errmsg, size_t errmsg_buflen);
1862
2301
  rb_pid_t rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds, char *errmsg, size_t errmsg_buflen);
1863
- VALUE rb_execarg_new(int argc, const VALUE *argv, int accept_shell);
2302
+ VALUE rb_execarg_new(int argc, const VALUE *argv, int accept_shell, int allow_exc_opt);
1864
2303
  struct rb_execarg *rb_execarg_get(VALUE execarg_obj); /* dangerous. needs GC guard. */
1865
- VALUE rb_execarg_init(int argc, const VALUE *argv, int accept_shell, VALUE execarg_obj);
1866
2304
  int rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val);
1867
2305
  void rb_execarg_parent_start(VALUE execarg_obj);
1868
2306
  void rb_execarg_parent_end(VALUE execarg_obj);
@@ -1877,15 +2315,23 @@ VALUE rb_gcd_normal(VALUE self, VALUE other);
1877
2315
  VALUE rb_gcd_gmp(VALUE x, VALUE y);
1878
2316
  #endif
1879
2317
 
2318
+ /* signal.c (export) */
2319
+ int rb_grantpt(int fd);
2320
+
1880
2321
  /* string.c (export) */
1881
2322
  #ifdef RUBY_ENCODING_H
1882
2323
  /* internal use */
1883
2324
  VALUE rb_setup_fake_str(struct RString *fake_str, const char *name, long len, rb_encoding *enc);
1884
2325
  #endif
2326
+ VALUE rb_str_upto_each(VALUE, VALUE, int, int (*each)(VALUE, VALUE), VALUE);
2327
+ VALUE rb_str_upto_endless_each(VALUE, int (*each)(VALUE, VALUE), VALUE);
1885
2328
 
1886
2329
  /* thread.c (export) */
1887
2330
  int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */
1888
2331
 
2332
+ /* time.c (export) */
2333
+ void ruby_reset_leap_second_info(void);
2334
+
1889
2335
  /* util.c (export) */
1890
2336
  extern const signed char ruby_digit36_to_number_table[];
1891
2337
  extern const char ruby_hexdigits[];
@@ -1915,6 +2361,9 @@ VALUE rb_imemo_new_debug(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VAL
1915
2361
  VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0);
1916
2362
  #endif
1917
2363
 
2364
+ /* random.c */
2365
+ int ruby_fill_random_bytes(void *, size_t, int);
2366
+
1918
2367
  RUBY_SYMBOL_EXPORT_END
1919
2368
 
1920
2369
  #define RUBY_DTRACE_CREATE_HOOK(name, arg) \
@@ -1923,7 +2372,7 @@ RUBY_SYMBOL_EXPORT_END
1923
2372
  do { \
1924
2373
  if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \
1925
2374
  int dtrace_line; \
1926
- const char *dtrace_file = rb_source_loc(&dtrace_line); \
2375
+ const char *dtrace_file = rb_source_location_cstr(&dtrace_line); \
1927
2376
  if (!dtrace_file) dtrace_file = ""; \
1928
2377
  RUBY_DTRACE_##name(arg, dtrace_file, dtrace_line); \
1929
2378
  } \
@@ -1947,6 +2396,65 @@ rb_obj_builtin_type(VALUE obj)
1947
2396
  }
1948
2397
  #endif
1949
2398
 
2399
+ /* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */
2400
+ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
2401
+ # define FLEX_ARY_LEN /* VALUE ary[]; */
2402
+ #elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
2403
+ # define FLEX_ARY_LEN 0 /* VALUE ary[0]; */
2404
+ #else
2405
+ # define FLEX_ARY_LEN 1 /* VALUE ary[1]; */
2406
+ #endif
2407
+
2408
+ /*
2409
+ * For declaring bitfields out of non-unsigned int types:
2410
+ * struct date {
2411
+ * BITFIELD(enum months, month, 4);
2412
+ * ...
2413
+ * };
2414
+ */
2415
+ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
2416
+ # define BITFIELD(type, name, size) type name : size
2417
+ #else
2418
+ # define BITFIELD(type, name, size) unsigned int name : size
2419
+ #endif
2420
+
2421
+ #if defined(_MSC_VER)
2422
+ # define COMPILER_WARNING_PUSH __pragma(warning(push))
2423
+ # define COMPILER_WARNING_POP __pragma(warning(pop))
2424
+ # define COMPILER_WARNING_ERROR(flag) __pragma(warning(error: flag)))
2425
+ # define COMPILER_WARNING_IGNORED(flag) __pragma(warning(suppress: flag)))
2426
+
2427
+ #elif defined(__clang__) /* clang 2.6 already had this feature */
2428
+ # define COMPILER_WARNING_PUSH _Pragma("clang diagnostic push")
2429
+ # define COMPILER_WARNING_POP _Pragma("clang diagnostic pop")
2430
+ # define COMPILER_WARNING_SPECIFIER(kind, msg) \
2431
+ clang diagnostic kind # msg
2432
+ # define COMPILER_WARNING_ERROR(flag) \
2433
+ COMPILER_WARNING_PRAGMA(COMPILER_WARNING_SPECIFIER(error, flag))
2434
+ # define COMPILER_WARNING_IGNORED(flag) \
2435
+ COMPILER_WARNING_PRAGMA(COMPILER_WARNING_SPECIFIER(ignored, flag))
2436
+
2437
+ #elif GCC_VERSION_SINCE(4, 2, 0)
2438
+ /* https://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Diagnostic-Pragmas.html */
2439
+ # define COMPILER_WARNING_PUSH _Pragma("GCC diagnostic push")
2440
+ # define COMPILER_WARNING_POP _Pragma("GCC diagnostic pop")
2441
+ # define COMPILER_WARNING_SPECIFIER(kind, msg) \
2442
+ GCC diagnostic kind # msg
2443
+ # define COMPILER_WARNING_ERROR(flag) \
2444
+ COMPILER_WARNING_PRAGMA(COMPILER_WARNING_SPECIFIER(error, flag))
2445
+ # define COMPILER_WARNING_IGNORED(flag) \
2446
+ COMPILER_WARNING_PRAGMA(COMPILER_WARNING_SPECIFIER(ignored, flag))
2447
+
2448
+ #else /* other compilers to follow? */
2449
+ # define COMPILER_WARNING_PUSH /* nop */
2450
+ # define COMPILER_WARNING_POP /* nop */
2451
+ # define COMPILER_WARNING_ERROR(flag) /* nop */
2452
+ # define COMPILER_WARNING_IGNORED(flag) /* nop */
2453
+ #endif
2454
+
2455
+ #define COMPILER_WARNING_PRAGMA(str) COMPILER_WARNING_PRAGMA_(str)
2456
+ #define COMPILER_WARNING_PRAGMA_(str) _Pragma(#str)
2457
+
1950
2458
  #if defined(__cplusplus)
1951
2459
  #if 0
1952
2460
  { /* satisfy cc-mode */