debase-ruby_core_source 4.0.0.preview2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/id.h +3 -0
  4. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/insns.inc +2 -0
  5. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/insns_info.inc +234 -218
  6. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/basic_operators.h +1 -0
  7. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/bignum.h +21 -10
  8. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/bits.h +14 -17
  9. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/box.h +3 -1
  10. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/class.h +3 -2
  11. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/cont.h +0 -1
  12. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/eval.h +2 -0
  13. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/gc.h +7 -5
  14. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/numeric.h +48 -0
  15. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/thread.h +2 -2
  16. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/time.h +2 -5
  17. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/vm.h +2 -0
  18. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/iseq.h +3 -1
  19. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/method.h +7 -2
  20. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/parse.h +5 -3
  21. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/parser_bits.h +108 -25
  22. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/ast.h +38 -17
  23. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/extension.h +1 -1
  24. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/options.h +4 -1
  25. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/prism.h +1 -1
  26. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/version.h +2 -2
  27. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/ractor_core.h +25 -0
  28. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/regint.h +1 -16
  29. data/lib/debase/ruby_core_source/ruby-4.0.0-p0/revision.h +5 -0
  30. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/ruby_atomic.h +7 -0
  31. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/rubyparser.h +0 -1
  32. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/shape.h +30 -10
  33. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/thread_pthread.h +3 -1
  34. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/version.h +2 -2
  35. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/vm.inc +115 -91
  36. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/vm_callinfo.h +19 -6
  37. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/vm_core.h +68 -12
  38. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/vm_exec.h +1 -1
  39. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/vm_sync.h +4 -0
  40. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/vmtc.inc +2 -0
  41. data/lib/debase/ruby_core_source/version.rb +1 -1
  42. metadata +147 -147
  43. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/revision.h +0 -5
  44. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/addr2line.h +0 -0
  45. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/builtin.h +0 -0
  46. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/ccan/build_assert/build_assert.h +0 -0
  47. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/ccan/check_type/check_type.h +0 -0
  48. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/ccan/container_of/container_of.h +0 -0
  49. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/ccan/list/list.h +0 -0
  50. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/ccan/str/str.h +0 -0
  51. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/constant.h +0 -0
  52. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/darray.h +0 -0
  53. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/debug_counter.h +0 -0
  54. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/dln.h +0 -0
  55. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/encindex.h +0 -0
  56. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/eval_intern.h +0 -0
  57. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/hrtime.h +0 -0
  58. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/id_table.h +0 -0
  59. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/array.h +0 -0
  60. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/cmdlineopt.h +0 -0
  61. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/compar.h +0 -0
  62. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/compile.h +0 -0
  63. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/compilers.h +0 -0
  64. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/complex.h +0 -0
  65. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/concurrent_set.h +0 -0
  66. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/dir.h +0 -0
  67. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/enc.h +0 -0
  68. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/encoding.h +0 -0
  69. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/enum.h +0 -0
  70. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/enumerator.h +0 -0
  71. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/error.h +0 -0
  72. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/file.h +0 -0
  73. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/fixnum.h +0 -0
  74. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/hash.h +0 -0
  75. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/imemo.h +0 -0
  76. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/inits.h +0 -0
  77. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/io.h +0 -0
  78. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/load.h +0 -0
  79. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/loadpath.h +0 -0
  80. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/math.h +0 -0
  81. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/missing.h +0 -0
  82. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/object.h +0 -0
  83. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/parse.h +0 -0
  84. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/proc.h +0 -0
  85. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/process.h +0 -0
  86. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/ractor.h +0 -0
  87. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/random.h +0 -0
  88. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/range.h +0 -0
  89. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/rational.h +0 -0
  90. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/re.h +0 -0
  91. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/ruby_parser.h +0 -0
  92. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/sanitizers.h +0 -0
  93. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/serial.h +0 -0
  94. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/set_table.h +0 -0
  95. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/signal.h +0 -0
  96. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/st.h +0 -0
  97. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/static_assert.h +0 -0
  98. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/string.h +0 -0
  99. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/struct.h +0 -0
  100. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/symbol.h +0 -0
  101. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/transcode.h +0 -0
  102. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/util.h +0 -0
  103. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/variable.h +0 -0
  104. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal/warnings.h +0 -0
  105. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/internal.h +0 -0
  106. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/known_errors.inc +0 -0
  107. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/node.h +0 -0
  108. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/node_name.inc +0 -0
  109. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/optinsn.inc +0 -0
  110. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/optunifs.inc +0 -0
  111. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/parser_node.h +0 -0
  112. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/parser_st.h +0 -0
  113. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/parser_value.h +0 -0
  114. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/defines.h +0 -0
  115. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/diagnostic.h +0 -0
  116. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/encoding.h +0 -0
  117. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/node.h +0 -0
  118. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/pack.h +0 -0
  119. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/parser.h +0 -0
  120. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/prettyprint.h +0 -0
  121. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/regexp.h +0 -0
  122. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/static_literals.h +0 -0
  123. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/util/pm_buffer.h +0 -0
  124. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/util/pm_char.h +0 -0
  125. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/util/pm_constant_pool.h +0 -0
  126. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/util/pm_integer.h +0 -0
  127. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/util/pm_list.h +0 -0
  128. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/util/pm_memchr.h +0 -0
  129. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/util/pm_newline_list.h +0 -0
  130. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/util/pm_string.h +0 -0
  131. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/util/pm_strncasecmp.h +0 -0
  132. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism/util/pm_strpbrk.h +0 -0
  133. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/prism_compile.h +0 -0
  134. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/probes_helper.h +0 -0
  135. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/regenc.h +0 -0
  136. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/regparse.h +0 -0
  137. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/ruby_assert.h +0 -0
  138. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/siphash.h +0 -0
  139. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/symbol.h +0 -0
  140. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/thread_none.h +0 -0
  141. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/thread_win32.h +0 -0
  142. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/timev.h +0 -0
  143. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/transcode_data.h +0 -0
  144. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/variable.h +0 -0
  145. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/vm_call_iseq_optimized.inc +0 -0
  146. data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/vm_debug.h +4 -4
  147. /data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/vm_insnhelper.h +0 -0
  148. /data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/vm_opts.h +0 -0
  149. /data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/yjit.h +0 -0
  150. /data/lib/debase/ruby_core_source/{ruby-4.0.0-preview2 → ruby-4.0.0-p0}/zjit.h +0 -0
@@ -30,13 +30,13 @@
30
30
  #include <stdint.h> /* for uintptr_t */
31
31
  #include "internal/compilers.h" /* for MSC_VERSION_SINCE */
32
32
 
33
- #if MSC_VERSION_SINCE(1310)
33
+ #ifdef _MSC_VER
34
34
  # include <stdlib.h> /* for _byteswap_uint64 */
35
35
  #endif
36
36
 
37
37
  #if defined(HAVE_X86INTRIN_H)
38
38
  # include <x86intrin.h> /* for _lzcnt_u64 */
39
- #elif MSC_VERSION_SINCE(1310)
39
+ #elif defined(_MSC_VER)
40
40
  # include <intrin.h> /* for the following intrinsics */
41
41
  #endif
42
42
 
@@ -50,16 +50,13 @@
50
50
  # pragma intrinsic(__lzcnt64)
51
51
  #endif
52
52
 
53
- #if MSC_VERSION_SINCE(1310)
53
+ #if defined(_MSC_VER)
54
54
  # pragma intrinsic(_rotl)
55
55
  # pragma intrinsic(_rotr)
56
56
  # ifdef _WIN64
57
57
  # pragma intrinsic(_rotl64)
58
58
  # pragma intrinsic(_rotr64)
59
59
  # endif
60
- #endif
61
-
62
- #if MSC_VERSION_SINCE(1400)
63
60
  # pragma intrinsic(_BitScanForward)
64
61
  # pragma intrinsic(_BitScanReverse)
65
62
  # ifdef _WIN64
@@ -90,6 +87,7 @@
90
87
 
91
88
  #define UNSIGNED_INTEGER_MAX(T) ((T)~(T)0)
92
89
 
90
+ #ifndef MUL_OVERFLOW_SIGNED_INTEGER_P
93
91
  #if __has_builtin(__builtin_mul_overflow_p)
94
92
  # define MUL_OVERFLOW_P(a, b) \
95
93
  __builtin_mul_overflow_p((a), (b), (__typeof__(a * b))0)
@@ -118,15 +116,100 @@
118
116
  MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX)
119
117
  #endif
120
118
 
121
- #ifdef MUL_OVERFLOW_P
119
+ #if defined(MUL_OVERFLOW_P) && defined(USE___BUILTIN_MUL_OVERFLOW_LONG_LONG)
122
120
  # define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_P(a, b)
121
+ #else
122
+ # define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX)
123
+ #endif
124
+
125
+ #ifdef MUL_OVERFLOW_P
123
126
  # define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_P(a, b)
124
127
  # define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_P(a, b)
125
128
  #else
126
- # define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX)
127
129
  # define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX)
128
130
  # define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX)
129
131
  #endif
132
+ #endif
133
+
134
+ #ifndef ADD_OVERFLOW_SIGNED_INTEGER_P
135
+ #if __has_builtin(__builtin_add_overflow_p)
136
+ # define ADD_OVERFLOW_P(a, b) \
137
+ __builtin_add_overflow_p((a), (b), (__typeof__(a * b))0)
138
+ #elif __has_builtin(__builtin_add_overflow)
139
+ # define ADD_OVERFLOW_P(a, b) \
140
+ __extension__ ({ __typeof__(a) c; __builtin_add_overflow((a), (b), &c); })
141
+ #endif
142
+
143
+ #define ADD_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \
144
+ (a) > 0 ? (b) > (max) - (a) : (b) < (min) - (a))
145
+
146
+ #if __has_builtin(__builtin_add_overflow_p)
147
+ /* __builtin_add_overflow_p can take bitfield */
148
+ /* and GCC permits bitfields for integers other than int */
149
+ # define ADD_OVERFLOW_FIXNUM_P(a, b) \
150
+ __extension__ ({ \
151
+ struct { long fixnum : sizeof(long) * CHAR_BIT - 1; } c = { 0 }; \
152
+ __builtin_add_overflow_p((a), (b), c.fixnum); \
153
+ })
154
+ #else
155
+ # define ADD_OVERFLOW_FIXNUM_P(a, b) \
156
+ ADD_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX)
157
+ #endif
158
+
159
+ #if defined(ADD_OVERFLOW_P) && defined(USE___BUILTIN_ADD_OVERFLOW_LONG_LONG)
160
+ # define ADD_OVERFLOW_LONG_LONG_P(a, b) ADD_OVERFLOW_P(a, b)
161
+ #else
162
+ # define ADD_OVERFLOW_LONG_LONG_P(a, b) ADD_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX)
163
+ #endif
164
+
165
+ #ifdef ADD_OVERFLOW_P
166
+ # define ADD_OVERFLOW_LONG_P(a, b) ADD_OVERFLOW_P(a, b)
167
+ # define ADD_OVERFLOW_INT_P(a, b) ADD_OVERFLOW_P(a, b)
168
+ #else
169
+ # define ADD_OVERFLOW_LONG_P(a, b) ADD_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX)
170
+ # define ADD_OVERFLOW_INT_P(a, b) ADD_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX)
171
+ #endif
172
+ #endif
173
+
174
+ #ifndef SUB_OVERFLOW_SIGNED_INTEGER_P
175
+ #if __has_builtin(__builtin_sub_overflow_p)
176
+ # define SUB_OVERFLOW_P(a, b) \
177
+ __builtin_sub_overflow_p((a), (b), (__typeof__(a * b))0)
178
+ #elif __has_builtin(__builtin_sub_overflow)
179
+ # define SUB_OVERFLOW_P(a, b) \
180
+ __extension__ ({ __typeof__(a) c; __builtin_sub_overflow((a), (b), &c); })
181
+ #endif
182
+
183
+ #define SUB_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \
184
+ (b) > 0 ? (a) < (min) + (b) : (a) > (max) + (b))
185
+
186
+ #if __has_builtin(__builtin_sub_overflow_p)
187
+ /* __builtin_sub_overflow_p can take bitfield */
188
+ /* and GCC permits bitfields for integers other than int */
189
+ # define SUB_OVERFLOW_FIXNUM_P(a, b) \
190
+ __extension__ ({ \
191
+ struct { long fixnum : sizeof(long) * CHAR_BIT - 1; } c = { 0 }; \
192
+ __builtin_sub_overflow_p((a), (b), c.fixnum); \
193
+ })
194
+ #else
195
+ # define SUB_OVERFLOW_FIXNUM_P(a, b) \
196
+ SUB_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX)
197
+ #endif
198
+
199
+ #if defined(SUB_OVERFLOW_P) && defined(USE___BUILTIN_SUB_OVERFLOW_LONG_LONG)
200
+ # define SUB_OVERFLOW_LONG_LONG_P(a, b) SUB_OVERFLOW_P(a, b)
201
+ #else
202
+ # define SUB_OVERFLOW_LONG_LONG_P(a, b) SUB_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX)
203
+ #endif
204
+
205
+ #ifdef SUB_OVERFLOW_P
206
+ # define SUB_OVERFLOW_LONG_P(a, b) SUB_OVERFLOW_P(a, b)
207
+ # define SUB_OVERFLOW_INT_P(a, b) SUB_OVERFLOW_P(a, b)
208
+ #else
209
+ # define SUB_OVERFLOW_LONG_P(a, b) SUB_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX)
210
+ # define SUB_OVERFLOW_INT_P(a, b) SUB_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX)
211
+ #endif
212
+ #endif
130
213
 
131
214
  #ifdef HAVE_UINT128_T
132
215
  # define bit_length(x) \
@@ -180,7 +263,7 @@ ruby_swap16(uint16_t x)
180
263
  #if __has_builtin(__builtin_bswap16)
181
264
  return __builtin_bswap16(x);
182
265
 
183
- #elif MSC_VERSION_SINCE(1310)
266
+ #elif defined(_MSC_VER)
184
267
  return _byteswap_ushort(x);
185
268
 
186
269
  #else
@@ -195,7 +278,7 @@ ruby_swap32(uint32_t x)
195
278
  #if __has_builtin(__builtin_bswap32)
196
279
  return __builtin_bswap32(x);
197
280
 
198
- #elif MSC_VERSION_SINCE(1310)
281
+ #elif defined(_MSC_VER)
199
282
  return _byteswap_ulong(x);
200
283
 
201
284
  #else
@@ -212,7 +295,7 @@ ruby_swap64(uint64_t x)
212
295
  #if __has_builtin(__builtin_bswap64)
213
296
  return __builtin_bswap64(x);
214
297
 
215
- #elif MSC_VERSION_SINCE(1310)
298
+ #elif defined(_MSC_VER)
216
299
  return _byteswap_uint64(x);
217
300
 
218
301
  #else
@@ -237,7 +320,7 @@ nlz_int32(uint32_t x)
237
320
  #elif defined(__x86_64__) && defined(__LZCNT__)
238
321
  return (unsigned int)_lzcnt_u32(x);
239
322
 
240
- #elif MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */
323
+ #elif defined(_MSC_VER) /* &&! defined(__AVX2__) */
241
324
  unsigned long r;
242
325
  return _BitScanReverse(&r, x) ? (31 - (int)r) : 32;
243
326
 
@@ -266,7 +349,7 @@ nlz_int64(uint64_t x)
266
349
  #elif defined(__x86_64__) && defined(__LZCNT__)
267
350
  return (unsigned int)_lzcnt_u64(x);
268
351
 
269
- #elif defined(_WIN64) && MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */
352
+ #elif defined(_WIN64) && defined(_MSC_VER) /* &&! defined(__AVX2__) */
270
353
  unsigned long r;
271
354
  return _BitScanReverse64(&r, x) ? (63u - (unsigned int)r) : 64;
272
355
 
@@ -394,9 +477,9 @@ rb_popcount32(uint32_t x)
394
477
  #else
395
478
  x = (x & 0x55555555) + (x >> 1 & 0x55555555);
396
479
  x = (x & 0x33333333) + (x >> 2 & 0x33333333);
397
- x = (x & 0x0f0f0f0f) + (x >> 4 & 0x0f0f0f0f);
398
- x = (x & 0x001f001f) + (x >> 8 & 0x001f001f);
399
- x = (x & 0x0000003f) + (x >>16 & 0x0000003f);
480
+ x = (x & 0x07070707) + (x >> 4 & 0x07070707);
481
+ x = (x & 0x000f000f) + (x >> 8 & 0x000f000f);
482
+ x = (x & 0x0000001f) + (x >>16 & 0x0000001f);
400
483
  return (unsigned int)x;
401
484
 
402
485
  #endif
@@ -424,9 +507,9 @@ rb_popcount64(uint64_t x)
424
507
  x = (x & 0x5555555555555555) + (x >> 1 & 0x5555555555555555);
425
508
  x = (x & 0x3333333333333333) + (x >> 2 & 0x3333333333333333);
426
509
  x = (x & 0x0707070707070707) + (x >> 4 & 0x0707070707070707);
427
- x = (x & 0x001f001f001f001f) + (x >> 8 & 0x001f001f001f001f);
428
- x = (x & 0x0000003f0000003f) + (x >>16 & 0x0000003f0000003f);
429
- x = (x & 0x000000000000007f) + (x >>32 & 0x000000000000007f);
510
+ x = (x & 0x000f000f000f000f) + (x >> 8 & 0x000f000f000f000f);
511
+ x = (x & 0x0000001f0000001f) + (x >>16 & 0x0000001f0000001f);
512
+ x = (x & 0x000000000000003f) + (x >>32 & 0x000000000000003f);
430
513
  return (unsigned int)x;
431
514
 
432
515
  #endif
@@ -452,7 +535,7 @@ ntz_int32(uint32_t x)
452
535
  #if defined(__x86_64__) && defined(__BMI__)
453
536
  return (unsigned)_tzcnt_u32(x);
454
537
 
455
- #elif MSC_VERSION_SINCE(1400)
538
+ #elif defined(_MSC_VER)
456
539
  /* :FIXME: Is there any way to issue TZCNT instead of BSF, apart from using
457
540
  * assembly? Because issuing LZCNT seems possible (see nlz.h). */
458
541
  unsigned long r;
@@ -474,7 +557,7 @@ ntz_int64(uint64_t x)
474
557
  #if defined(__x86_64__) && defined(__BMI__)
475
558
  return (unsigned)_tzcnt_u64(x);
476
559
 
477
- #elif defined(_WIN64) && MSC_VERSION_SINCE(1400)
560
+ #elif defined(_WIN64) && defined(_MSC_VER)
478
561
  unsigned long r;
479
562
  return _BitScanForward64(&r, x) ? (int)r : 64;
480
563
 
@@ -522,10 +605,10 @@ RUBY_BIT_ROTL(VALUE v, int n)
522
605
  #elif __has_builtin(__builtin_rotateleft64) && (SIZEOF_VALUE * CHAR_BIT == 64)
523
606
  return __builtin_rotateleft64(v, n);
524
607
 
525
- #elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32)
608
+ #elif defined(_MSC_VER) && (SIZEOF_VALUE * CHAR_BIT == 32)
526
609
  return _rotl(v, n);
527
610
 
528
- #elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64)
611
+ #elif defined(_MSC_VER) && (SIZEOF_VALUE * CHAR_BIT == 64)
529
612
  return _rotl64(v, n);
530
613
 
531
614
  #elif defined(_lrotl) && (SIZEOF_VALUE == SIZEOF_LONG)
@@ -546,10 +629,10 @@ RUBY_BIT_ROTR(VALUE v, int n)
546
629
  #elif __has_builtin(__builtin_rotateright64) && (SIZEOF_VALUE * CHAR_BIT == 64)
547
630
  return __builtin_rotateright64(v, n);
548
631
 
549
- #elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32)
632
+ #elif defined(_MSC_VER) && (SIZEOF_VALUE * CHAR_BIT == 32)
550
633
  return _rotr(v, n);
551
634
 
552
- #elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64)
635
+ #elif defined(_MSC_VER) && (SIZEOF_VALUE * CHAR_BIT == 64)
553
636
  return _rotr64(v, n);
554
637
 
555
638
  #elif defined(_lrotr) && (SIZEOF_VALUE == SIZEOF_LONG)
@@ -1050,22 +1050,6 @@ typedef uint16_t pm_node_flags_t;
1050
1050
  static const pm_node_flags_t PM_NODE_FLAG_NEWLINE = 0x1;
1051
1051
  static const pm_node_flags_t PM_NODE_FLAG_STATIC_LITERAL = 0x2;
1052
1052
 
1053
- /**
1054
- * Cast the type to an enum to allow the compiler to provide exhaustiveness
1055
- * checking.
1056
- */
1057
- #define PM_NODE_TYPE(node) ((enum pm_node_type) (node)->type)
1058
-
1059
- /**
1060
- * Return true if the type of the given node matches the given type.
1061
- */
1062
- #define PM_NODE_TYPE_P(node, type) (PM_NODE_TYPE(node) == (type))
1063
-
1064
- /**
1065
- * Return true if the given flag is set on the given node.
1066
- */
1067
- #define PM_NODE_FLAG_P(node, flag) ((((pm_node_t *)(node))->flags & (flag)) != 0)
1068
-
1069
1053
  /**
1070
1054
  * This is the base structure that represents a node in the syntax tree. It is
1071
1055
  * embedded into every node type.
@@ -1096,6 +1080,32 @@ typedef struct pm_node {
1096
1080
  pm_location_t location;
1097
1081
  } pm_node_t;
1098
1082
 
1083
+ /**
1084
+ * Cast the given node to the base pm_node_t type.
1085
+ */
1086
+ #define PM_NODE_UPCAST(node_) ((pm_node_t *) (node_))
1087
+
1088
+ /**
1089
+ * Cast the type to an enum to allow the compiler to provide exhaustiveness
1090
+ * checking.
1091
+ */
1092
+ #define PM_NODE_TYPE(node_) ((enum pm_node_type) (node_)->type)
1093
+
1094
+ /**
1095
+ * Return true if the type of the given node matches the given type.
1096
+ */
1097
+ #define PM_NODE_TYPE_P(node_, type_) (PM_NODE_TYPE(node_) == (type_))
1098
+
1099
+ /**
1100
+ * Return the flags associated with the given node.
1101
+ */
1102
+ #define PM_NODE_FLAGS(node_) (PM_NODE_UPCAST(node_)->flags)
1103
+
1104
+ /**
1105
+ * Return true if the given flag is set on the given node.
1106
+ */
1107
+ #define PM_NODE_FLAG_P(node_, flag_) ((PM_NODE_FLAGS(node_) & (flag_)) != 0)
1108
+
1099
1109
  /**
1100
1110
  * AliasGlobalVariableNode
1101
1111
  *
@@ -4097,11 +4107,16 @@ typedef struct pm_forwarding_parameter_node {
4097
4107
  /**
4098
4108
  * ForwardingSuperNode
4099
4109
  *
4100
- * Represents the use of the `super` keyword without parentheses or arguments.
4110
+ * Represents the use of the `super` keyword without parentheses or arguments, but which might have a block.
4101
4111
  *
4102
4112
  * super
4103
4113
  * ^^^^^
4104
4114
  *
4115
+ * super { 123 }
4116
+ * ^^^^^^^^^^^^^
4117
+ *
4118
+ * If it has any other arguments, it would be a `SuperNode` instead.
4119
+ *
4105
4120
  * Type: ::PM_FORWARDING_SUPER_NODE
4106
4121
  *
4107
4122
  * @extends pm_node_t
@@ -4113,6 +4128,8 @@ typedef struct pm_forwarding_super_node {
4113
4128
 
4114
4129
  /**
4115
4130
  * ForwardingSuperNode#block
4131
+ *
4132
+ * All other arguments are forwarded as normal, except the original block is replaced with the new block.
4116
4133
  */
4117
4134
  struct pm_block_node *block;
4118
4135
  } pm_forwarding_super_node_t;
@@ -7552,6 +7569,8 @@ typedef struct pm_string_node {
7552
7569
  * super foo, bar
7553
7570
  * ^^^^^^^^^^^^^^
7554
7571
  *
7572
+ * If no arguments are provided (except for a block), it would be a `ForwardingSuperNode` instead.
7573
+ *
7555
7574
  * Type: ::PM_SUPER_NODE
7556
7575
  *
7557
7576
  * @extends pm_node_t
@@ -7573,6 +7592,8 @@ typedef struct pm_super_node {
7573
7592
 
7574
7593
  /**
7575
7594
  * SuperNode#arguments
7595
+ *
7596
+ * Can be only `nil` when there are empty parentheses, like `super()`.
7576
7597
  */
7577
7598
  struct pm_arguments_node *arguments;
7578
7599
 
@@ -1,7 +1,7 @@
1
1
  #ifndef PRISM_EXT_NODE_H
2
2
  #define PRISM_EXT_NODE_H
3
3
 
4
- #define EXPECTED_PRISM_VERSION "1.6.0"
4
+ #define EXPECTED_PRISM_VERSION "1.7.0"
5
5
 
6
6
  #include <ruby.h>
7
7
  #include <ruby/encoding.h>
@@ -97,8 +97,11 @@ typedef enum {
97
97
  /** The vendored version of prism in CRuby 4.0.x. */
98
98
  PM_OPTIONS_VERSION_CRUBY_4_0 = 3,
99
99
 
100
+ /** The vendored version of prism in CRuby 4.1.x. */
101
+ PM_OPTIONS_VERSION_CRUBY_4_1 = 4,
102
+
100
103
  /** The current version of prism. */
101
- PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_4_0
104
+ PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_4_1
102
105
  } pm_options_version_t;
103
106
 
104
107
  /**
@@ -314,7 +314,7 @@ PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_method_name(const uint
314
314
  * dependencies. It is currently being integrated into
315
315
  * [CRuby](https://github.com/ruby/ruby),
316
316
  * [JRuby](https://github.com/jruby/jruby),
317
- * [TruffleRuby](https://github.com/oracle/truffleruby),
317
+ * [TruffleRuby](https://github.com/truffleruby/truffleruby),
318
318
  * [Sorbet](https://github.com/sorbet/sorbet), and
319
319
  * [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree).
320
320
  *
@@ -14,7 +14,7 @@
14
14
  /**
15
15
  * The minor version of the Prism library as an int.
16
16
  */
17
- #define PRISM_VERSION_MINOR 6
17
+ #define PRISM_VERSION_MINOR 7
18
18
 
19
19
  /**
20
20
  * The patch version of the Prism library as an int.
@@ -24,6 +24,6 @@
24
24
  /**
25
25
  * The version of the Prism library as a constant string.
26
26
  */
27
- #define PRISM_VERSION "1.6.0"
27
+ #define PRISM_VERSION "1.7.0"
28
28
 
29
29
  #endif
@@ -9,6 +9,9 @@
9
9
  #define RACTOR_CHECK_MODE (VM_CHECK_MODE || RUBY_DEBUG) && (SIZEOF_UINT64_T == SIZEOF_VALUE)
10
10
  #endif
11
11
 
12
+ // experimental flag because it is not sure it is the common pattern
13
+ #define RUBY_TYPED_FROZEN_SHAREABLE_NO_REC RUBY_FL_FINALIZE
14
+
12
15
  struct rb_ractor_sync {
13
16
  // ractor lock
14
17
  rb_nativethread_lock_t lock;
@@ -88,6 +91,8 @@ struct rb_ractor_struct {
88
91
 
89
92
  // ractor local data
90
93
 
94
+ rb_serial_t next_ec_serial;
95
+
91
96
  st_table *local_storage;
92
97
  struct rb_id_table *idkey_local_storage;
93
98
  VALUE local_storage_store_lock;
@@ -139,6 +144,7 @@ VALUE rb_ractor_require(VALUE feature, bool silent);
139
144
  VALUE rb_ractor_autoload_load(VALUE space, ID id);
140
145
 
141
146
  VALUE rb_ractor_ensure_shareable(VALUE obj, VALUE name);
147
+ st_table *rb_ractor_targeted_hooks(rb_ractor_t *cr);
142
148
 
143
149
  RUBY_SYMBOL_EXPORT_BEGIN
144
150
  void rb_ractor_finish_marking(void);
@@ -245,6 +251,25 @@ rb_ractor_id(const rb_ractor_t *r)
245
251
  return r->pub.id;
246
252
  }
247
253
 
254
+ static inline void
255
+ rb_ractor_targeted_hooks_incr(rb_ractor_t *cr)
256
+ {
257
+ cr->pub.targeted_hooks_cnt++;
258
+ }
259
+
260
+ static inline void
261
+ rb_ractor_targeted_hooks_decr(rb_ractor_t *cr)
262
+ {
263
+ RUBY_ASSERT(cr->pub.targeted_hooks_cnt > 0);
264
+ cr->pub.targeted_hooks_cnt--;
265
+ }
266
+
267
+ static inline unsigned int
268
+ rb_ractor_targeted_hooks_cnt(rb_ractor_t *cr)
269
+ {
270
+ return cr->pub.targeted_hooks_cnt;
271
+ }
272
+
248
273
  #if RACTOR_CHECK_MODE > 0
249
274
  # define RACTOR_BELONGING_ID(obj) (*(uint32_t *)(((uintptr_t)(obj)) + rb_gc_obj_slot_size(obj)))
250
275
 
@@ -215,9 +215,7 @@
215
215
  #define xmemcpy memcpy
216
216
  #define xmemmove memmove
217
217
 
218
- #if ((defined(RUBY_MSVCRT_VERSION) && RUBY_MSVCRT_VERSION >= 90) \
219
- || (!defined(RUBY_MSVCRT_VERSION) && defined(_WIN32))) \
220
- && !defined(__GNUC__)
218
+ #if defined(_WIN32) && !defined(__GNUC__)
221
219
  # define xalloca _alloca
222
220
  # define xvsnprintf(buf,size,fmt,args) _vsnprintf_s(buf,size,_TRUNCATE,fmt,args)
223
221
  # define xsnprintf sprintf_s
@@ -266,19 +264,6 @@
266
264
  # include <stdio.h>
267
265
  #endif
268
266
 
269
- #ifdef _WIN32
270
- # if defined(_MSC_VER) && (_MSC_VER < 1300)
271
- # ifndef _INTPTR_T_DEFINED
272
- # define _INTPTR_T_DEFINED
273
- typedef int intptr_t;
274
- # endif
275
- # ifndef _UINTPTR_T_DEFINED
276
- # define _UINTPTR_T_DEFINED
277
- typedef unsigned int uintptr_t;
278
- # endif
279
- # endif
280
- #endif /* _WIN32 */
281
-
282
267
  #ifndef PRIdPTR
283
268
  # ifdef _WIN64
284
269
  # define PRIdPTR "I64d"
@@ -0,0 +1,5 @@
1
+ #define RUBY_REVISION "553f1675f3"
2
+ #define RUBY_FULL_REVISION "553f1675f3a9cece340b90f374a4245dccac2272"
3
+ #define RUBY_RELEASE_YEAR 2025
4
+ #define RUBY_RELEASE_MONTH 12
5
+ #define RUBY_RELEASE_DAY 25
@@ -2,6 +2,9 @@
2
2
  #define INTERNAL_ATOMIC_H
3
3
 
4
4
  #include "ruby/atomic.h"
5
+ #ifdef HAVE_STDATOMIC_H
6
+ # include <stdatomic.h>
7
+ #endif
5
8
 
6
9
  #define RUBY_ATOMIC_VALUE_LOAD(x) rbimpl_atomic_value_load(&(x), RBIMPL_ATOMIC_SEQ_CST)
7
10
 
@@ -43,6 +46,8 @@ rbimpl_atomic_u64_load_relaxed(const volatile rbimpl_atomic_uint64_t *value)
43
46
  uint64_t val = *value;
44
47
  return atomic_cas_64(value, val, val);
45
48
  #else
49
+ // TODO: stdatomic
50
+
46
51
  return *value;
47
52
  #endif
48
53
  }
@@ -58,6 +63,8 @@ rbimpl_atomic_u64_set_relaxed(volatile rbimpl_atomic_uint64_t *address, uint64_t
58
63
  #elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx))
59
64
  atomic_swap_64(address, value);
60
65
  #else
66
+ // TODO: stdatomic
67
+
61
68
  *address = value;
62
69
  #endif
63
70
  }
@@ -782,7 +782,6 @@ struct rb_args_info {
782
782
 
783
783
  struct RNode_OPT_ARG *opt_args;
784
784
  unsigned int no_kwarg: 1;
785
- unsigned int ruby2_keywords: 1;
786
785
  unsigned int forwarding: 1;
787
786
  };
788
787
 
@@ -163,10 +163,8 @@ bool rb_shape_verify_consistency(VALUE obj, shape_id_t shape_id);
163
163
  #endif
164
164
 
165
165
  static inline void
166
- RBASIC_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id)
166
+ RBASIC_SET_SHAPE_ID_NO_CHECKS(VALUE obj, shape_id_t shape_id)
167
167
  {
168
- RUBY_ASSERT(!RB_SPECIAL_CONST_P(obj));
169
- RUBY_ASSERT(!RB_TYPE_P(obj, T_IMEMO) || IMEMO_TYPE_P(obj, imemo_fields));
170
168
  #if RBASIC_SHAPE_ID_FIELD
171
169
  RBASIC(obj)->shape_id = (VALUE)shape_id;
172
170
  #else
@@ -174,6 +172,16 @@ RBASIC_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id)
174
172
  RBASIC(obj)->flags &= SHAPE_FLAG_MASK;
175
173
  RBASIC(obj)->flags |= ((VALUE)(shape_id) << SHAPE_FLAG_SHIFT);
176
174
  #endif
175
+ }
176
+
177
+ static inline void
178
+ RBASIC_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id)
179
+ {
180
+ RUBY_ASSERT(!RB_SPECIAL_CONST_P(obj));
181
+ RUBY_ASSERT(!RB_TYPE_P(obj, T_IMEMO) || IMEMO_TYPE_P(obj, imemo_fields));
182
+
183
+ RBASIC_SET_SHAPE_ID_NO_CHECKS(obj, shape_id);
184
+
177
185
  RUBY_ASSERT(rb_shape_verify_consistency(obj, shape_id));
178
186
  }
179
187
 
@@ -217,7 +225,7 @@ shape_id_t rb_shape_transition_frozen(VALUE obj);
217
225
  shape_id_t rb_shape_transition_complex(VALUE obj);
218
226
  shape_id_t rb_shape_transition_remove_ivar(VALUE obj, ID id, shape_id_t *removed_shape_id);
219
227
  shape_id_t rb_shape_transition_add_ivar(VALUE obj, ID id);
220
- shape_id_t rb_shape_transition_add_ivar_no_warnings(VALUE obj, ID id);
228
+ shape_id_t rb_shape_transition_add_ivar_no_warnings(VALUE klass, shape_id_t original_shape_id, ID id);
221
229
  shape_id_t rb_shape_transition_object_id(VALUE obj);
222
230
  shape_id_t rb_shape_transition_heap(VALUE obj, size_t heap_index);
223
231
  shape_id_t rb_shape_object_id(shape_id_t original_shape_id);
@@ -367,23 +375,35 @@ ROBJECT_SET_FIELDS_HASH(VALUE obj, const st_table *tbl)
367
375
  ROBJECT(obj)->as.heap.fields = (VALUE *)tbl;
368
376
  }
369
377
 
378
+ static inline uint32_t
379
+ ROBJECT_FIELDS_COUNT_COMPLEX(VALUE obj)
380
+ {
381
+ return (uint32_t)rb_st_table_size(ROBJECT_FIELDS_HASH(obj));
382
+ }
383
+
384
+ static inline uint32_t
385
+ ROBJECT_FIELDS_COUNT_NOT_COMPLEX(VALUE obj)
386
+ {
387
+ RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);
388
+ RUBY_ASSERT(!rb_shape_obj_too_complex_p(obj));
389
+ return RSHAPE(RBASIC_SHAPE_ID(obj))->next_field_index;
390
+ }
391
+
370
392
  static inline uint32_t
371
393
  ROBJECT_FIELDS_COUNT(VALUE obj)
372
394
  {
373
395
  if (rb_shape_obj_too_complex_p(obj)) {
374
- return (uint32_t)rb_st_table_size(ROBJECT_FIELDS_HASH(obj));
396
+ return ROBJECT_FIELDS_COUNT_COMPLEX(obj);
375
397
  }
376
398
  else {
377
- RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);
378
- RUBY_ASSERT(!rb_shape_obj_too_complex_p(obj));
379
- return RSHAPE(RBASIC_SHAPE_ID(obj))->next_field_index;
399
+ return ROBJECT_FIELDS_COUNT_NOT_COMPLEX(obj);
380
400
  }
381
401
  }
382
402
 
383
403
  static inline uint32_t
384
404
  RBASIC_FIELDS_COUNT(VALUE obj)
385
405
  {
386
- return RSHAPE(rb_obj_shape_id(obj))->next_field_index;
406
+ return RSHAPE(RBASIC_SHAPE_ID(obj))->next_field_index;
387
407
  }
388
408
 
389
409
  static inline bool
@@ -417,7 +437,7 @@ rb_shape_obj_has_fields(VALUE obj)
417
437
  }
418
438
 
419
439
  static inline bool
420
- rb_obj_exivar_p(VALUE obj)
440
+ rb_obj_gen_fields_p(VALUE obj)
421
441
  {
422
442
  switch (TYPE(obj)) {
423
443
  case T_NONE:
@@ -39,6 +39,7 @@ struct rb_thread_sched_waiting {
39
39
  #else
40
40
  uint64_t timeout;
41
41
  #endif
42
+ uint32_t event_serial;
42
43
  int fd; // -1 for timeout only
43
44
  int result;
44
45
  } data;
@@ -47,7 +48,7 @@ struct rb_thread_sched_waiting {
47
48
  struct ccan_list_node node;
48
49
  };
49
50
 
50
- // per-Thead scheduler helper data
51
+ // per-Thread scheduler helper data
51
52
  struct rb_thread_sched_item {
52
53
  struct {
53
54
  struct ccan_list_node ubf;
@@ -69,6 +70,7 @@ struct rb_thread_sched_item {
69
70
  } node;
70
71
 
71
72
  struct rb_thread_sched_waiting waiting_reason;
73
+ uint32_t event_serial;
72
74
 
73
75
  bool finished;
74
76
  bool malloc_stack;
@@ -11,7 +11,7 @@
11
11
  # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
12
12
  #define RUBY_VERSION_TEENY 0
13
13
  #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
14
- #define RUBY_PATCHLEVEL -1
14
+ #define RUBY_PATCHLEVEL 0
15
15
 
16
16
  #include "ruby/version.h"
17
17
  #include "ruby/internal/abi.h"
@@ -58,7 +58,7 @@
58
58
  # ifdef RUBY_PATCHLEVEL_NAME
59
59
  # define RUBY_PATCHLEVEL_STR STRINGIZE(RUBY_PATCHLEVEL_NAME)
60
60
  # else
61
- # define RUBY_PATCHLEVEL_STR "preview2"
61
+ # define RUBY_PATCHLEVEL_STR "dev"
62
62
  # endif
63
63
  #elif defined RUBY_ABI_VERSION
64
64
  # error RUBY_ABI_VERSION is defined in non-development branch