debase-ruby_core_source 0.10.9 → 0.10.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +1 -1
  4. data/Rakefile +6 -3
  5. data/debase-ruby_core_source.gemspec +2 -1
  6. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/addr2line.h +2 -3
  7. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/builtin.h +17 -2
  8. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/ccan/build_assert/build_assert.h +0 -0
  9. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/ccan/check_type/check_type.h +0 -0
  10. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/ccan/container_of/container_of.h +0 -0
  11. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/ccan/list/list.h +0 -0
  12. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/ccan/str/str.h +0 -0
  13. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/constant.h +10 -5
  14. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/debug_counter.h +127 -48
  15. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/dln.h +3 -18
  16. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/encindex.h +3 -2
  17. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/eval_intern.h +16 -7
  18. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/gc.h +13 -2
  19. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/hrtime.h +0 -0
  20. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/id.h +0 -0
  21. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/id_table.h +2 -0
  22. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/insns.inc +0 -4
  23. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/insns_info.inc +323 -536
  24. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/array.h +119 -0
  25. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/bignum.h +246 -0
  26. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/bits.h +566 -0
  27. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/class.h +174 -0
  28. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compar.h +50 -0
  29. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compile.h +32 -0
  30. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compilers.h +108 -0
  31. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/complex.h +29 -0
  32. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/cont.h +25 -0
  33. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/dir.h +17 -0
  34. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enc.h +20 -0
  35. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/encoding.h +28 -0
  36. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enum.h +19 -0
  37. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enumerator.h +22 -0
  38. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/error.h +124 -0
  39. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/eval.h +33 -0
  40. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/file.h +39 -0
  41. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/fixnum.h +185 -0
  42. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/gc.h +161 -0
  43. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/hash.h +241 -0
  44. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/imemo.h +243 -0
  45. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/inits.h +51 -0
  46. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/io.h +35 -0
  47. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/load.h +19 -0
  48. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/loadpath.h +17 -0
  49. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/math.h +24 -0
  50. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/missing.h +19 -0
  51. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/numeric.h +255 -0
  52. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/object.h +83 -0
  53. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/parse.h +23 -0
  54. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/proc.h +33 -0
  55. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/process.h +136 -0
  56. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/random.h +17 -0
  57. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/range.h +41 -0
  58. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/rational.h +71 -0
  59. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/re.h +29 -0
  60. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/sanitizers.h +191 -0
  61. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/scheduler.h +44 -0
  62. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/serial.h +24 -0
  63. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/signal.h +22 -0
  64. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/static_assert.h +17 -0
  65. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/string.h +140 -0
  66. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/struct.h +154 -0
  67. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/symbol.h +41 -0
  68. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/thread.h +54 -0
  69. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/time.h +35 -0
  70. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/transcode.h +21 -0
  71. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/util.h +31 -0
  72. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/variable.h +84 -0
  73. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/vm.h +136 -0
  74. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/warnings.h +17 -0
  75. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal.h +107 -0
  76. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/iseq.h +11 -18
  77. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/known_errors.inc +0 -0
  78. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/method.h +21 -8
  79. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/mjit.h +89 -48
  80. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/mjit_compile.inc +2746 -2288
  81. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/node.h +32 -24
  82. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/node_name.inc +2 -2
  83. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/opt_sc.inc +0 -0
  84. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/optinsn.inc +0 -0
  85. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/optunifs.inc +0 -0
  86. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/parse.h +1 -0
  87. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/probes_helper.h +2 -0
  88. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ractor_core.h +343 -0
  89. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/regenc.h +0 -0
  90. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/regint.h +1 -1
  91. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/regparse.h +0 -0
  92. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/revision.h +2 -0
  93. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ruby_assert.h +15 -0
  94. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ruby_atomic.h +23 -0
  95. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/siphash.h +0 -0
  96. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/symbol.h +4 -4
  97. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/thread_pthread.h +45 -5
  98. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/thread_win32.h +28 -3
  99. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/timev.h +1 -0
  100. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/transcode_data.h +2 -3
  101. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/transient_heap.h +6 -3
  102. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/variable.h +22 -0
  103. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/version.h +23 -11
  104. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/vm.inc +707 -671
  105. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/vm_call_iseq_optimized.inc +93 -86
  106. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_callinfo.h +456 -0
  107. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/vm_core.h +262 -194
  108. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_debug.h +116 -0
  109. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/vm_exec.h +9 -6
  110. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/vm_insnhelper.h +28 -26
  111. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/vm_opts.h +6 -5
  112. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_sync.h +136 -0
  113. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.0.0-p0}/vmtc.inc +0 -4
  114. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/addr2line.h +2 -3
  115. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/builtin.h +83 -0
  116. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/ccan/build_assert/build_assert.h +13 -13
  117. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/ccan/check_type/check_type.h +17 -17
  118. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/ccan/container_of/container_of.h +63 -63
  119. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/ccan/list/list.h +262 -262
  120. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/ccan/str/str.h +4 -4
  121. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/constant.h +10 -9
  122. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/darray.h +198 -0
  123. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/debug_counter.h +137 -48
  124. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/dln.h +3 -23
  125. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/encindex.h +3 -2
  126. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/eval_intern.h +34 -41
  127. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/gc.h +24 -11
  128. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/hrtime.h +9 -9
  129. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/id.h +4 -3
  130. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/id_table.h +3 -1
  131. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/insns.inc +6 -8
  132. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/insns_info.inc +1907 -2543
  133. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/array.h +113 -0
  134. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/bignum.h +246 -0
  135. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/bits.h +565 -0
  136. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/class.h +188 -0
  137. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/compar.h +49 -0
  138. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/compile.h +35 -0
  139. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/compilers.h +107 -0
  140. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/complex.h +29 -0
  141. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/cont.h +24 -0
  142. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/dir.h +16 -0
  143. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/enc.h +19 -0
  144. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/encoding.h +30 -0
  145. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/enum.h +18 -0
  146. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/enumerator.h +21 -0
  147. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/error.h +191 -0
  148. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/eval.h +32 -0
  149. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/file.h +38 -0
  150. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/fixnum.h +184 -0
  151. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/gc.h +175 -0
  152. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/hash.h +243 -0
  153. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/imemo.h +243 -0
  154. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/inits.h +50 -0
  155. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/io.h +38 -0
  156. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/load.h +18 -0
  157. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/loadpath.h +16 -0
  158. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/math.h +23 -0
  159. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/missing.h +18 -0
  160. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/numeric.h +271 -0
  161. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/object.h +83 -0
  162. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/parse.h +23 -0
  163. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/proc.h +32 -0
  164. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/process.h +137 -0
  165. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/random.h +16 -0
  166. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/range.h +40 -0
  167. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/rational.h +72 -0
  168. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/re.h +30 -0
  169. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/sanitizers.h +190 -0
  170. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/serial.h +23 -0
  171. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/signal.h +21 -0
  172. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/static_assert.h +16 -0
  173. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/string.h +141 -0
  174. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/struct.h +153 -0
  175. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/symbol.h +40 -0
  176. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/thread.h +53 -0
  177. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/time.h +34 -0
  178. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/transcode.h +20 -0
  179. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/util.h +27 -0
  180. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/variable.h +83 -0
  181. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/vm.h +132 -0
  182. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/warnings.h +16 -0
  183. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal.h +109 -0
  184. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/iseq.h +44 -35
  185. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/known_errors.inc +0 -0
  186. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/method.h +21 -4
  187. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/mjit.h +231 -0
  188. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/mjit_compile.inc +3322 -2940
  189. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/node.h +39 -23
  190. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/node_name.inc +210 -0
  191. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/opt_sc.inc +0 -2
  192. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/optinsn.inc +7 -7
  193. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/optunifs.inc +1 -1
  194. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/parse.h +9 -5
  195. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/probes_helper.h +9 -7
  196. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ractor_core.h +346 -0
  197. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/regenc.h +8 -8
  198. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/regint.h +16 -12
  199. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/regparse.h +2 -2
  200. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/revision.h +2 -0
  201. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ruby_assert.h +14 -0
  202. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ruby_atomic.h +23 -0
  203. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/siphash.h +0 -0
  204. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/symbol.h +14 -14
  205. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/thread_pthread.h +45 -5
  206. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/thread_win32.h +30 -5
  207. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/timev.h +1 -0
  208. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/transcode_data.h +49 -50
  209. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/transient_heap.h +6 -3
  210. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/variable.h +21 -0
  211. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/version.h +15 -4
  212. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/vm.inc +1033 -887
  213. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_call_iseq_optimized.inc +244 -0
  214. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_callinfo.h +454 -0
  215. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/vm_core.h +508 -362
  216. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_debug.h +119 -0
  217. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/vm_exec.h +22 -18
  218. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview3 → ruby-3.1.0-preview1}/vm_insnhelper.h +42 -32
  219. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/vm_opts.h +8 -5
  220. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_sync.h +137 -0
  221. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.1.0-preview1}/vmtc.inc +6 -8
  222. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit.h +63 -0
  223. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_asm.h +392 -0
  224. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_codegen.h +19 -0
  225. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_core.h +302 -0
  226. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_iface.h +38 -0
  227. data/lib/debase/ruby_core_source/version.rb +1 -1
  228. data/lib/debase/ruby_core_source.rb +0 -2
  229. metadata +240 -110
  230. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/internal.h +0 -2682
  231. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/revision.h +0 -2
  232. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ruby_assert.h +0 -15
  233. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ruby_atomic.h +0 -244
  234. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_call_iseq_optimized.inc +0 -237
  235. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_debug.h +0 -34
  236. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/internal.h +0 -2657
  237. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/mjit.h +0 -175
  238. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/node_name.inc +0 -208
  239. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/revision.h +0 -2
  240. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/ruby_assert.h +0 -15
  241. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/ruby_atomic.h +0 -244
  242. data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/vm_debug.h +0 -34
@@ -0,0 +1,243 @@
1
+ #ifndef INTERNAL_IMEMO_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_IMEMO_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
+ * @brief IMEMO: Internal memo object.
11
+ */
12
+ #include "ruby/internal/config.h"
13
+ #include <stddef.h> /* for size_t */
14
+ #include "internal/array.h" /* for rb_ary_tmp_new_fill */
15
+ #include "internal/gc.h" /* for RB_OBJ_WRITE */
16
+ #include "ruby/internal/stdbool.h" /* for bool */
17
+ #include "ruby/ruby.h" /* for rb_block_call_func_t */
18
+
19
+ #ifndef IMEMO_DEBUG
20
+ # define IMEMO_DEBUG 0
21
+ #endif
22
+
23
+ #define IMEMO_MASK 0x0f
24
+
25
+ /* FL_USER0 to FL_USER3 is for type */
26
+ #define IMEMO_FL_USHIFT (FL_USHIFT + 4)
27
+ #define IMEMO_FL_USER0 FL_USER4
28
+ #define IMEMO_FL_USER1 FL_USER5
29
+ #define IMEMO_FL_USER2 FL_USER6
30
+ #define IMEMO_FL_USER3 FL_USER7
31
+ #define IMEMO_FL_USER4 FL_USER8
32
+ #define IMEMO_FL_USER5 FL_USER9
33
+
34
+ enum imemo_type {
35
+ imemo_env = 0,
36
+ imemo_cref = 1, /*!< class reference */
37
+ imemo_svar = 2, /*!< special variable */
38
+ imemo_throw_data = 3,
39
+ imemo_ifunc = 4, /*!< iterator function */
40
+ imemo_memo = 5,
41
+ imemo_ment = 6,
42
+ imemo_iseq = 7,
43
+ imemo_tmpbuf = 8,
44
+ imemo_ast = 9,
45
+ imemo_parser_strterm = 10,
46
+ imemo_callinfo = 11,
47
+ imemo_callcache = 12,
48
+ };
49
+
50
+ /* CREF (Class REFerence) is defined in method.h */
51
+
52
+ /*! SVAR (Special VARiable) */
53
+ struct vm_svar {
54
+ VALUE flags;
55
+ const VALUE cref_or_me; /*!< class reference or rb_method_entry_t */
56
+ const VALUE lastline;
57
+ const VALUE backref;
58
+ const VALUE others;
59
+ };
60
+
61
+ /*! THROW_DATA */
62
+ struct vm_throw_data {
63
+ VALUE flags;
64
+ VALUE reserved;
65
+ const VALUE throw_obj;
66
+ const struct rb_control_frame_struct *catch_frame;
67
+ int throw_state;
68
+ };
69
+
70
+ #define THROW_DATA_CONSUMED IMEMO_FL_USER0
71
+
72
+ /* IFUNC (Internal FUNCtion) */
73
+
74
+ struct vm_ifunc_argc {
75
+ #if SIZEOF_INT * 2 > SIZEOF_VALUE
76
+ signed int min: (SIZEOF_VALUE * CHAR_BIT) / 2;
77
+ signed int max: (SIZEOF_VALUE * CHAR_BIT) / 2;
78
+ #else
79
+ int min, max;
80
+ #endif
81
+ };
82
+
83
+ /*! IFUNC (Internal FUNCtion) */
84
+ struct vm_ifunc {
85
+ VALUE flags;
86
+ VALUE reserved;
87
+ rb_block_call_func_t func;
88
+ const void *data;
89
+ struct vm_ifunc_argc argc;
90
+ };
91
+
92
+ struct rb_imemo_tmpbuf_struct {
93
+ VALUE flags;
94
+ VALUE reserved;
95
+ VALUE *ptr; /* malloc'ed buffer */
96
+ struct rb_imemo_tmpbuf_struct *next; /* next imemo */
97
+ size_t cnt; /* buffer size in VALUE */
98
+ };
99
+
100
+ /*! MEMO
101
+ *
102
+ * @see imemo_type
103
+ * */
104
+ struct MEMO {
105
+ VALUE flags;
106
+ VALUE reserved;
107
+ const VALUE v1;
108
+ const VALUE v2;
109
+ union {
110
+ long cnt;
111
+ long state;
112
+ const VALUE value;
113
+ void (*func)(void);
114
+ } u3;
115
+ };
116
+
117
+ /* ment is in method.h */
118
+
119
+ #define THROW_DATA_P(err) imemo_throw_data_p((VALUE)err)
120
+ #define MEMO_CAST(m) ((struct MEMO *)(m))
121
+ #define MEMO_NEW(a, b, c) ((struct MEMO *)rb_imemo_new(imemo_memo, (VALUE)(a), (VALUE)(b), (VALUE)(c), 0))
122
+ #define MEMO_FOR(type, value) ((type *)RARRAY_PTR(value))
123
+ #define NEW_MEMO_FOR(type, value) \
124
+ ((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), MEMO_FOR(type, value))
125
+ #define NEW_PARTIAL_MEMO_FOR(type, value, member) \
126
+ ((value) = rb_ary_tmp_new_fill(type_roomof(type, VALUE)), \
127
+ rb_ary_set_len((value), offsetof(type, member) / sizeof(VALUE)), \
128
+ MEMO_FOR(type, value))
129
+
130
+ typedef struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t;
131
+ VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0);
132
+ rb_imemo_tmpbuf_t *rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt);
133
+ struct vm_ifunc *rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int max_argc);
134
+ void rb_strterm_mark(VALUE obj);
135
+ static inline enum imemo_type imemo_type(VALUE imemo);
136
+ static inline int imemo_type_p(VALUE imemo, enum imemo_type imemo_type);
137
+ static inline bool imemo_throw_data_p(VALUE imemo);
138
+ static inline struct vm_ifunc *rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data);
139
+ static inline VALUE rb_imemo_tmpbuf_auto_free_pointer(void);
140
+ static inline void *RB_IMEMO_TMPBUF_PTR(VALUE v);
141
+ static inline void *rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr);
142
+ static inline VALUE rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str);
143
+ static inline void MEMO_V1_SET(struct MEMO *m, VALUE v);
144
+ static inline void MEMO_V2_SET(struct MEMO *m, VALUE v);
145
+
146
+ RUBY_SYMBOL_EXPORT_BEGIN
147
+ #if IMEMO_DEBUG
148
+ VALUE rb_imemo_new_debug(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0, const char *file, int line);
149
+ #define rb_imemo_new(type, v1, v2, v3, v0) rb_imemo_new_debug(type, v1, v2, v3, v0, __FILE__, __LINE__)
150
+ #else
151
+ VALUE rb_imemo_new(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0);
152
+ #endif
153
+ const char *rb_imemo_name(enum imemo_type type);
154
+ RUBY_SYMBOL_EXPORT_END
155
+
156
+ static inline enum imemo_type
157
+ imemo_type(VALUE imemo)
158
+ {
159
+ return (RBASIC(imemo)->flags >> FL_USHIFT) & IMEMO_MASK;
160
+ }
161
+
162
+ static inline int
163
+ imemo_type_p(VALUE imemo, enum imemo_type imemo_type)
164
+ {
165
+ if (LIKELY(!RB_SPECIAL_CONST_P(imemo))) {
166
+ /* fixed at compile time if imemo_type is given. */
167
+ const VALUE mask = (IMEMO_MASK << FL_USHIFT) | RUBY_T_MASK;
168
+ const VALUE expected_type = (imemo_type << FL_USHIFT) | T_IMEMO;
169
+ /* fixed at runtime. */
170
+ return expected_type == (RBASIC(imemo)->flags & mask);
171
+ }
172
+ else {
173
+ return 0;
174
+ }
175
+ }
176
+
177
+ #define IMEMO_TYPE_P(v, t) imemo_type_p((VALUE)v, t)
178
+
179
+ static inline bool
180
+ imemo_throw_data_p(VALUE imemo)
181
+ {
182
+ return RB_TYPE_P(imemo, T_IMEMO);
183
+ }
184
+
185
+ static inline struct vm_ifunc *
186
+ rb_vm_ifunc_proc_new(rb_block_call_func_t func, const void *data)
187
+ {
188
+ return rb_vm_ifunc_new(func, data, 0, UNLIMITED_ARGUMENTS);
189
+ }
190
+
191
+ static inline VALUE
192
+ rb_imemo_tmpbuf_auto_free_pointer(void)
193
+ {
194
+ return rb_imemo_new(imemo_tmpbuf, 0, 0, 0, 0);
195
+ }
196
+
197
+ static inline void *
198
+ RB_IMEMO_TMPBUF_PTR(VALUE v)
199
+ {
200
+ const struct rb_imemo_tmpbuf_struct *p = (const void *)v;
201
+ return p->ptr;
202
+ }
203
+
204
+ static inline void *
205
+ rb_imemo_tmpbuf_set_ptr(VALUE v, void *ptr)
206
+ {
207
+ return ((rb_imemo_tmpbuf_t *)v)->ptr = ptr;
208
+ }
209
+
210
+ static inline VALUE
211
+ rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString(VALUE str)
212
+ {
213
+ const void *src;
214
+ VALUE imemo;
215
+ rb_imemo_tmpbuf_t *tmpbuf;
216
+ void *dst;
217
+ size_t len;
218
+
219
+ SafeStringValue(str);
220
+ /* create tmpbuf to keep the pointer before xmalloc */
221
+ imemo = rb_imemo_tmpbuf_auto_free_pointer();
222
+ tmpbuf = (rb_imemo_tmpbuf_t *)imemo;
223
+ len = RSTRING_LEN(str);
224
+ src = RSTRING_PTR(str);
225
+ dst = ruby_xmalloc(len);
226
+ memcpy(dst, src, len);
227
+ tmpbuf->ptr = dst;
228
+ return imemo;
229
+ }
230
+
231
+ static inline void
232
+ MEMO_V1_SET(struct MEMO *m, VALUE v)
233
+ {
234
+ RB_OBJ_WRITE(m, &m->v1, v);
235
+ }
236
+
237
+ static inline void
238
+ MEMO_V2_SET(struct MEMO *m, VALUE v)
239
+ {
240
+ RB_OBJ_WRITE(m, &m->v2, v);
241
+ }
242
+
243
+ #endif /* INTERNAL_IMEMO_H */
@@ -0,0 +1,51 @@
1
+ #ifndef INTERNAL_INITS_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_INITS_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
+ * @brief Internal header aggregating init functions.
11
+ */
12
+
13
+ /* class.c */
14
+ void Init_class_hierarchy(void);
15
+
16
+ /* dmyext.c */
17
+ void Init_enc(void);
18
+ void Init_ext(void);
19
+
20
+ /* file.c */
21
+ void Init_File(void);
22
+
23
+ /* gc.c */
24
+ void Init_heap(void);
25
+
26
+ /* localeinit.c */
27
+ int Init_enc_set_filesystem_encoding(void);
28
+
29
+ /* newline.c */
30
+ void Init_newline(void);
31
+
32
+ /* vm.c */
33
+ void Init_BareVM(void);
34
+ void Init_vm_objects(void);
35
+
36
+ /* vm_backtrace.c */
37
+ void Init_vm_backtrace(void);
38
+
39
+ /* vm_eval.c */
40
+ void Init_vm_eval(void);
41
+
42
+ /* vm_insnhelper.c */
43
+ void Init_vm_stack_canary(void);
44
+
45
+ /* vm_method.c */
46
+ void Init_eval_method(void);
47
+
48
+ /* inits.c */
49
+ void rb_call_inits(void);
50
+
51
+ #endif /* INTERNAL_INITS_H */
@@ -0,0 +1,35 @@
1
+ #ifndef INTERNAL_IO_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_IO_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
+ * @brief Internal header for IO.
11
+ */
12
+ #include "ruby/ruby.h" /* for VALUE */
13
+ #include "ruby/io.h" /* for rb_io_t */
14
+
15
+ /* io.c */
16
+ void ruby_set_inplace_mode(const char *);
17
+ void rb_stdio_set_default_encoding(void);
18
+ VALUE rb_io_flush_raw(VALUE, int);
19
+ size_t rb_io_memsize(const rb_io_t *);
20
+ int rb_stderr_tty_p(void);
21
+ void rb_io_fptr_finalize_internal(void *ptr);
22
+ #ifdef rb_io_fptr_finalize
23
+ # undef rb_io_fptr_finalize
24
+ #endif
25
+ #define rb_io_fptr_finalize rb_io_fptr_finalize_internal
26
+ VALUE rb_io_popen(VALUE pname, VALUE pmode, VALUE env, VALUE opt);
27
+
28
+ RUBY_SYMBOL_EXPORT_BEGIN
29
+ /* io.c (export) */
30
+ void rb_maygvl_fd_fix_cloexec(int fd);
31
+ int rb_gc_for_fd(int err);
32
+ void rb_write_error_str(VALUE mesg);
33
+ RUBY_SYMBOL_EXPORT_END
34
+
35
+ #endif /* INTERNAL_IO_H */
@@ -0,0 +1,19 @@
1
+ #ifndef INTERNAL_LOAD_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_LOAD_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
+ * @brief Internal header for require.
11
+ */
12
+ #include "ruby/ruby.h" /* for VALUE */
13
+
14
+ /* load.c */
15
+ VALUE rb_get_expanded_load_path(void);
16
+ int rb_require_internal(VALUE fname);
17
+ NORETURN(void rb_load_fail(VALUE, const char*));
18
+
19
+ #endif /* INTERNAL_LOAD_H */
@@ -0,0 +1,17 @@
1
+ #ifndef INTERNAL_LOADPATH_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_LOADPATH_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
+ * @brief Internal header for $LOAD_PATH.
11
+ */
12
+
13
+ /* loadpath.c */
14
+ extern const char ruby_exec_prefix[];
15
+ extern const char ruby_initial_load_paths[];
16
+
17
+ #endif /* INTERNAL_LOADPATH_H */
@@ -0,0 +1,24 @@
1
+ #ifndef INTERNAL_MATH_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_MATH_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
+ * @brief Internal header for Math.
11
+ */
12
+ #include "ruby/ruby.h" /* for VALUE */
13
+
14
+ /* math.c */
15
+ VALUE rb_math_atan2(VALUE, VALUE);
16
+ VALUE rb_math_cos(VALUE);
17
+ VALUE rb_math_cosh(VALUE);
18
+ VALUE rb_math_exp(VALUE);
19
+ VALUE rb_math_hypot(VALUE, VALUE);
20
+ VALUE rb_math_log(int argc, const VALUE *argv);
21
+ VALUE rb_math_sin(VALUE);
22
+ VALUE rb_math_sinh(VALUE);
23
+
24
+ #endif /* INTERNAL_MATH_H */
@@ -0,0 +1,19 @@
1
+ #ifndef INTERNAL_MISSING_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_MISSING_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
+ * @brief Internal header corresponding missing.
11
+ */
12
+ #include "ruby/internal/config.h" /* for HAVE_SETPROCTITLE */
13
+
14
+ /* missing/setproctitle.c */
15
+ #ifndef HAVE_SETPROCTITLE
16
+ extern void ruby_init_setproctitle(int argc, char *argv[]);
17
+ #endif
18
+
19
+ #endif /* INTERNAL_MISSING_H */
@@ -0,0 +1,255 @@
1
+ #ifndef INTERNAL_NUMERIC_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_NUMERIC_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
+ * @brief Internal header for Numeric.
11
+ */
12
+ #include "internal/bignum.h" /* for BIGNUM_POSITIVE_P */
13
+ #include "internal/bits.h" /* for RUBY_BIT_ROTL */
14
+ #include "internal/fixnum.h" /* for FIXNUM_POSITIVE_P */
15
+ #include "internal/vm.h" /* for rb_method_basic_definition_p */
16
+ #include "ruby/intern.h" /* for rb_cmperr */
17
+ #include "ruby/ruby.h" /* for USE_FLONUM */
18
+
19
+ #define ROUND_TO(mode, even, up, down) \
20
+ ((mode) == RUBY_NUM_ROUND_HALF_EVEN ? even : \
21
+ (mode) == RUBY_NUM_ROUND_HALF_UP ? up : down)
22
+ #define ROUND_FUNC(mode, name) \
23
+ ROUND_TO(mode, name##_half_even, name##_half_up, name##_half_down)
24
+ #define ROUND_CALL(mode, name, args) \
25
+ ROUND_TO(mode, name##_half_even args, \
26
+ name##_half_up args, name##_half_down args)
27
+
28
+ #ifndef ROUND_DEFAULT
29
+ # define ROUND_DEFAULT RUBY_NUM_ROUND_HALF_UP
30
+ #endif
31
+
32
+ enum ruby_num_rounding_mode {
33
+ RUBY_NUM_ROUND_HALF_UP,
34
+ RUBY_NUM_ROUND_HALF_EVEN,
35
+ RUBY_NUM_ROUND_HALF_DOWN,
36
+ RUBY_NUM_ROUND_DEFAULT = ROUND_DEFAULT,
37
+ };
38
+
39
+ struct RFloat {
40
+ struct RBasic basic;
41
+ double float_value;
42
+ };
43
+
44
+ #define RFLOAT(obj) ((struct RFloat *)(obj))
45
+
46
+ /* numeric.c */
47
+ int rb_num_to_uint(VALUE val, unsigned int *ret);
48
+ VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl);
49
+ double ruby_float_step_size(double beg, double end, double unit, int excl);
50
+ int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless);
51
+ int rb_num_negative_p(VALUE);
52
+ VALUE rb_int_succ(VALUE num);
53
+ VALUE rb_float_uminus(VALUE num);
54
+ VALUE rb_int_plus(VALUE x, VALUE y);
55
+ VALUE rb_float_plus(VALUE x, VALUE y);
56
+ VALUE rb_int_minus(VALUE x, VALUE y);
57
+ VALUE rb_float_minus(VALUE x, VALUE y);
58
+ VALUE rb_int_mul(VALUE x, VALUE y);
59
+ VALUE rb_float_mul(VALUE x, VALUE y);
60
+ VALUE rb_float_div(VALUE x, VALUE y);
61
+ VALUE rb_int_idiv(VALUE x, VALUE y);
62
+ VALUE rb_int_modulo(VALUE x, VALUE y);
63
+ VALUE rb_int2str(VALUE num, int base);
64
+ VALUE rb_fix_plus(VALUE x, VALUE y);
65
+ VALUE rb_int_gt(VALUE x, VALUE y);
66
+ VALUE rb_float_gt(VALUE x, VALUE y);
67
+ VALUE rb_int_ge(VALUE x, VALUE y);
68
+ enum ruby_num_rounding_mode rb_num_get_rounding_option(VALUE opts);
69
+ double rb_int_fdiv_double(VALUE x, VALUE y);
70
+ VALUE rb_int_pow(VALUE x, VALUE y);
71
+ VALUE rb_float_pow(VALUE x, VALUE y);
72
+ VALUE rb_int_cmp(VALUE x, VALUE y);
73
+ VALUE rb_int_equal(VALUE x, VALUE y);
74
+ VALUE rb_int_divmod(VALUE x, VALUE y);
75
+ VALUE rb_int_and(VALUE x, VALUE y);
76
+ VALUE rb_int_lshift(VALUE x, VALUE y);
77
+ VALUE rb_int_div(VALUE x, VALUE y);
78
+ int rb_int_positive_p(VALUE num);
79
+ int rb_int_negative_p(VALUE num);
80
+ VALUE rb_num_pow(VALUE x, VALUE y);
81
+ VALUE rb_float_ceil(VALUE num, int ndigits);
82
+ VALUE rb_float_floor(VALUE x, int ndigits);
83
+ VALUE rb_float_abs(VALUE flt);
84
+ static inline VALUE rb_num_compare_with_zero(VALUE num, ID mid);
85
+ static inline int rb_num_positive_int_p(VALUE num);
86
+ static inline int rb_num_negative_int_p(VALUE num);
87
+ static inline double rb_float_flonum_value(VALUE v);
88
+ static inline double rb_float_noflonum_value(VALUE v);
89
+ static inline double rb_float_value_inline(VALUE v);
90
+ static inline VALUE rb_float_new_inline(double d);
91
+ static inline bool INT_POSITIVE_P(VALUE num);
92
+ static inline bool INT_NEGATIVE_P(VALUE num);
93
+ static inline bool FLOAT_ZERO_P(VALUE num);
94
+ #define rb_float_value rb_float_value_inline
95
+ #define rb_float_new rb_float_new_inline
96
+
97
+ RUBY_SYMBOL_EXPORT_BEGIN
98
+ /* numeric.c (export) */
99
+ VALUE rb_int_positive_pow(long x, unsigned long y);
100
+ RUBY_SYMBOL_EXPORT_END
101
+
102
+ MJIT_SYMBOL_EXPORT_BEGIN
103
+ VALUE rb_flo_div_flo(VALUE x, VALUE y);
104
+ double ruby_float_mod(double x, double y);
105
+ VALUE rb_float_equal(VALUE x, VALUE y);
106
+ int rb_float_cmp(VALUE x, VALUE y);
107
+ VALUE rb_float_eql(VALUE x, VALUE y);
108
+ VALUE rb_fix_aref(VALUE fix, VALUE idx);
109
+ VALUE rb_int_zero_p(VALUE num);
110
+ VALUE rb_int_even_p(VALUE num);
111
+ VALUE rb_int_odd_p(VALUE num);
112
+ VALUE rb_int_abs(VALUE num);
113
+ VALUE rb_int_bit_length(VALUE num);
114
+ VALUE rb_int_uminus(VALUE num);
115
+ VALUE rb_int_comp(VALUE num);
116
+ MJIT_SYMBOL_EXPORT_END
117
+
118
+ static inline bool
119
+ INT_POSITIVE_P(VALUE num)
120
+ {
121
+ if (FIXNUM_P(num)) {
122
+ return FIXNUM_POSITIVE_P(num);
123
+ }
124
+ else {
125
+ return BIGNUM_POSITIVE_P(num);
126
+ }
127
+ }
128
+
129
+ static inline bool
130
+ INT_NEGATIVE_P(VALUE num)
131
+ {
132
+ if (FIXNUM_P(num)) {
133
+ return FIXNUM_NEGATIVE_P(num);
134
+ }
135
+ else {
136
+ return BIGNUM_NEGATIVE_P(num);
137
+ }
138
+ }
139
+
140
+ static inline bool
141
+ FLOAT_ZERO_P(VALUE num)
142
+ {
143
+ return RFLOAT_VALUE(num) == 0.0;
144
+ }
145
+
146
+ static inline VALUE
147
+ rb_num_compare_with_zero(VALUE num, ID mid)
148
+ {
149
+ VALUE zero = INT2FIX(0);
150
+ VALUE r = rb_check_funcall(num, mid, 1, &zero);
151
+ if (r == Qundef) {
152
+ rb_cmperr(num, zero);
153
+ }
154
+ return r;
155
+ }
156
+
157
+ static inline int
158
+ rb_num_positive_int_p(VALUE num)
159
+ {
160
+ const ID mid = '>';
161
+
162
+ if (FIXNUM_P(num)) {
163
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
164
+ return FIXNUM_POSITIVE_P(num);
165
+ }
166
+ else if (RB_TYPE_P(num, T_BIGNUM)) {
167
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
168
+ return BIGNUM_POSITIVE_P(num);
169
+ }
170
+ return RTEST(rb_num_compare_with_zero(num, mid));
171
+ }
172
+
173
+ static inline int
174
+ rb_num_negative_int_p(VALUE num)
175
+ {
176
+ const ID mid = '<';
177
+
178
+ if (FIXNUM_P(num)) {
179
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
180
+ return FIXNUM_NEGATIVE_P(num);
181
+ }
182
+ else if (RB_TYPE_P(num, T_BIGNUM)) {
183
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
184
+ return BIGNUM_NEGATIVE_P(num);
185
+ }
186
+ return RTEST(rb_num_compare_with_zero(num, mid));
187
+ }
188
+
189
+ static inline double
190
+ rb_float_flonum_value(VALUE v)
191
+ {
192
+ #if USE_FLONUM
193
+ if (v != (VALUE)0x8000000000000002) { /* LIKELY */
194
+ union {
195
+ double d;
196
+ VALUE v;
197
+ } t;
198
+
199
+ VALUE b63 = (v >> 63);
200
+ /* e: xx1... -> 011... */
201
+ /* xx0... -> 100... */
202
+ /* ^b63 */
203
+ t.v = RUBY_BIT_ROTR((2 - b63) | (v & ~(VALUE)0x03), 3);
204
+ return t.d;
205
+ }
206
+ #endif
207
+ return 0.0;
208
+ }
209
+
210
+ static inline double
211
+ rb_float_noflonum_value(VALUE v)
212
+ {
213
+ return RFLOAT(v)->float_value;
214
+ }
215
+
216
+ static inline double
217
+ rb_float_value_inline(VALUE v)
218
+ {
219
+ if (FLONUM_P(v)) {
220
+ return rb_float_flonum_value(v);
221
+ }
222
+ return rb_float_noflonum_value(v);
223
+ }
224
+
225
+ static inline VALUE
226
+ rb_float_new_inline(double d)
227
+ {
228
+ #if USE_FLONUM
229
+ union {
230
+ double d;
231
+ VALUE v;
232
+ } t;
233
+ int bits;
234
+
235
+ t.d = d;
236
+ bits = (int)((VALUE)(t.v >> 60) & 0x7);
237
+ /* bits contains 3 bits of b62..b60. */
238
+ /* bits - 3 = */
239
+ /* b011 -> b000 */
240
+ /* b100 -> b001 */
241
+
242
+ if (t.v != 0x3000000000000000 /* 1.72723e-77 */ &&
243
+ !((bits-3) & ~0x01)) {
244
+ return (RUBY_BIT_ROTL(t.v, 3) & ~(VALUE)0x01) | 0x02;
245
+ }
246
+ else if (t.v == (VALUE)0) {
247
+ /* +0.0 */
248
+ return 0x8000000000000002;
249
+ }
250
+ /* out of range */
251
+ #endif
252
+ return rb_float_new_in_heap(d);
253
+ }
254
+
255
+ #endif /* INTERNAL_NUMERIC_H */