debase-ruby_core_source 3.2.2 → 3.3.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 (126) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/addr2line.h +3 -1
  4. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ccan/list/list.h +4 -2
  5. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/dln.h +1 -0
  6. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/eval_intern.h +4 -2
  7. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/insns.inc +2 -0
  8. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/insns_info.inc +280 -198
  9. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/array.h +8 -1
  10. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/bits.h +6 -6
  11. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/class.h +53 -3
  12. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/cmdlineopt.h +2 -0
  13. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/cont.h +3 -0
  14. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/encoding.h +3 -0
  15. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/error.h +3 -0
  16. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/gc.h +3 -0
  17. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/hash.h +1 -0
  18. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/imemo.h +0 -1
  19. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/object.h +1 -0
  20. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/parse.h +7 -32
  21. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/random.h +1 -0
  22. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/string.h +0 -1
  23. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/symbol.h +3 -0
  24. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/thread.h +4 -0
  25. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/transcode.h +3 -0
  26. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/variable.h +5 -4
  27. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/vm.h +9 -2
  28. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/iseq.h +5 -1
  29. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/method.h +7 -7
  30. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/node.h +22 -19
  31. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/node_name.inc +4 -2
  32. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/optunifs.inc +1 -1
  33. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/parse.h +16 -5
  34. data/lib/debase/ruby_core_source/ruby-3.3.0-p0/parser_node.h +32 -0
  35. data/lib/debase/ruby_core_source/ruby-3.3.0-p0/prism_compile.h +29 -0
  36. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ractor_core.h +7 -1
  37. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/regint.h +8 -0
  38. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/regparse.h +2 -1
  39. data/lib/debase/ruby_core_source/ruby-3.3.0-p0/revision.h +5 -0
  40. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/rjit.h +6 -8
  41. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/rjit_c.h +0 -1
  42. data/lib/debase/ruby_core_source/ruby-3.3.0-p0/rubyparser.h +1403 -0
  43. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/shape.h +32 -32
  44. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/symbol.h +1 -2
  45. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/thread_none.h +1 -0
  46. data/lib/debase/ruby_core_source/ruby-3.3.0-p0/thread_pthread.h +166 -0
  47. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/thread_win32.h +1 -1
  48. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/variable.h +11 -2
  49. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/version.h +8 -4
  50. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm.inc +225 -185
  51. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_callinfo.h +12 -1
  52. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_core.h +128 -16
  53. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_insnhelper.h +4 -14
  54. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vmtc.inc +2 -0
  55. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/yjit.h +10 -8
  56. data/lib/debase/ruby_core_source/version.rb +1 -1
  57. metadata +121 -120
  58. data/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_node.h +0 -133
  59. data/lib/debase/ruby_core_source/ruby-3.3.0-preview2/revision.h +0 -5
  60. data/lib/debase/ruby_core_source/ruby-3.3.0-preview2/rubyparser.h +0 -628
  61. data/lib/debase/ruby_core_source/ruby-3.3.0-preview2/thread_pthread.h +0 -126
  62. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/builtin.h +0 -0
  63. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ccan/build_assert/build_assert.h +0 -0
  64. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ccan/check_type/check_type.h +0 -0
  65. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ccan/container_of/container_of.h +0 -0
  66. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ccan/str/str.h +0 -0
  67. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/constant.h +0 -0
  68. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/darray.h +0 -0
  69. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/debug_counter.h +0 -0
  70. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/encindex.h +0 -0
  71. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/hrtime.h +0 -0
  72. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/id.h +0 -0
  73. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/id_table.h +0 -0
  74. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/basic_operators.h +0 -0
  75. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/bignum.h +0 -0
  76. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/compar.h +0 -0
  77. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/compile.h +0 -0
  78. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/compilers.h +0 -0
  79. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/complex.h +0 -0
  80. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/dir.h +0 -0
  81. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/enc.h +0 -0
  82. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/enum.h +0 -0
  83. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/enumerator.h +0 -0
  84. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/eval.h +0 -0
  85. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/file.h +0 -0
  86. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/fixnum.h +0 -0
  87. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/inits.h +0 -0
  88. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/io.h +0 -0
  89. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/load.h +0 -0
  90. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/loadpath.h +0 -0
  91. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/math.h +0 -0
  92. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/missing.h +0 -0
  93. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/numeric.h +0 -0
  94. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/proc.h +0 -0
  95. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/process.h +0 -0
  96. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/ractor.h +0 -0
  97. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/range.h +0 -0
  98. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/rational.h +0 -0
  99. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/re.h +0 -0
  100. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/ruby_parser.h +2 -2
  101. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/sanitizers.h +0 -0
  102. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/serial.h +0 -0
  103. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/signal.h +0 -0
  104. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/static_assert.h +0 -0
  105. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/struct.h +0 -0
  106. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/time.h +0 -0
  107. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/util.h +0 -0
  108. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal/warnings.h +0 -0
  109. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/internal.h +0 -0
  110. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/known_errors.inc +0 -0
  111. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/optinsn.inc +0 -0
  112. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/parser_bits.h +0 -0
  113. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/parser_st.h +0 -0
  114. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/parser_value.h +0 -0
  115. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/probes_helper.h +0 -0
  116. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/regenc.h +0 -0
  117. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ruby_assert.h +0 -0
  118. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/ruby_atomic.h +0 -0
  119. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/siphash.h +0 -0
  120. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/timev.h +0 -0
  121. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/transcode_data.h +0 -0
  122. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_call_iseq_optimized.inc +0 -0
  123. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_debug.h +0 -0
  124. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_exec.h +0 -0
  125. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_opts.h +0 -0
  126. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview2 → ruby-3.3.0-p0}/vm_sync.h +0 -0
@@ -136,9 +136,16 @@ RBIMPL_ATTR_ARTIFICIAL()
136
136
  static inline VALUE
137
137
  RARRAY_AREF(VALUE ary, long i)
138
138
  {
139
+ VALUE val;
139
140
  RBIMPL_ASSERT_TYPE(ary, RUBY_T_ARRAY);
140
141
 
141
- return RARRAY_CONST_PTR(ary)[i];
142
+ RBIMPL_WARNING_PUSH();
143
+ #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ == 13
144
+ RBIMPL_WARNING_IGNORED(-Warray-bounds);
145
+ #endif
146
+ val = RARRAY_CONST_PTR(ary)[i];
147
+ RBIMPL_WARNING_POP();
148
+ return val;
142
149
  }
143
150
 
144
151
  #endif /* INTERNAL_ARRAY_H */
@@ -398,9 +398,9 @@ rb_popcount32(uint32_t x)
398
398
  #else
399
399
  x = (x & 0x55555555) + (x >> 1 & 0x55555555);
400
400
  x = (x & 0x33333333) + (x >> 2 & 0x33333333);
401
- x = (x & 0x0f0f0f0f) + (x >> 4 & 0x0f0f0f0f);
402
- x = (x & 0x001f001f) + (x >> 8 & 0x001f001f);
403
- x = (x & 0x0000003f) + (x >>16 & 0x0000003f);
401
+ x = (x & 0x07070707) + (x >> 4 & 0x07070707);
402
+ x = (x & 0x000f000f) + (x >> 8 & 0x000f000f);
403
+ x = (x & 0x0000001f) + (x >>16 & 0x0000001f);
404
404
  return (unsigned int)x;
405
405
 
406
406
  #endif
@@ -428,9 +428,9 @@ rb_popcount64(uint64_t x)
428
428
  x = (x & 0x5555555555555555) + (x >> 1 & 0x5555555555555555);
429
429
  x = (x & 0x3333333333333333) + (x >> 2 & 0x3333333333333333);
430
430
  x = (x & 0x0707070707070707) + (x >> 4 & 0x0707070707070707);
431
- x = (x & 0x001f001f001f001f) + (x >> 8 & 0x001f001f001f001f);
432
- x = (x & 0x0000003f0000003f) + (x >>16 & 0x0000003f0000003f);
433
- x = (x & 0x000000000000007f) + (x >>32 & 0x000000000000007f);
431
+ x = (x & 0x000f000f000f000f) + (x >> 8 & 0x000f000f000f000f);
432
+ x = (x & 0x0000001f0000001f) + (x >>16 & 0x0000001f0000001f);
433
+ x = (x & 0x000000000000003f) + (x >>32 & 0x000000000000003f);
434
434
  return (unsigned int)x;
435
435
 
436
436
  #endif
@@ -19,6 +19,7 @@
19
19
  #include "shape.h"
20
20
  #include "ruby_assert.h"
21
21
  #include "vm_core.h"
22
+ #include "vm_sync.h"
22
23
  #include "method.h" /* for rb_cref_t */
23
24
 
24
25
  #ifdef RCLASS_SUPER
@@ -85,7 +86,12 @@ struct RClass {
85
86
  // Assert that classes can be embedded in size_pools[2] (which has 160B slot size)
86
87
  STATIC_ASSERT(sizeof_rb_classext_t, sizeof(struct RClass) + sizeof(rb_classext_t) <= 4 * RVALUE_SIZE);
87
88
 
88
- #define RCLASS_EXT(c) ((rb_classext_t *)((char *)(c) + sizeof(struct RClass)))
89
+ struct RClass_and_rb_classext_t {
90
+ struct RClass rclass;
91
+ rb_classext_t classext;
92
+ };
93
+
94
+ #define RCLASS_EXT(c) (&((struct RClass_and_rb_classext_t*)(c))->classext)
89
95
  #define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
90
96
  #define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
91
97
  #define RCLASS_IVPTR(c) (RCLASS_EXT(c)->iv_ptr)
@@ -106,6 +112,51 @@ STATIC_ASSERT(sizeof_rb_classext_t, sizeof(struct RClass) + sizeof(rb_classext_t
106
112
  #define RCLASS_SUPERCLASSES_INCLUDE_SELF FL_USER2
107
113
  #define RICLASS_ORIGIN_SHARED_MTBL FL_USER3
108
114
 
115
+ static inline st_table *
116
+ RCLASS_IV_HASH(VALUE obj)
117
+ {
118
+ RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE));
119
+ RUBY_ASSERT(rb_shape_obj_too_complex(obj));
120
+ return (st_table *)RCLASS_IVPTR(obj);
121
+ }
122
+
123
+ static inline void
124
+ RCLASS_SET_IV_HASH(VALUE obj, const st_table *tbl)
125
+ {
126
+ RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE));
127
+ RUBY_ASSERT(rb_shape_obj_too_complex(obj));
128
+ RCLASS_IVPTR(obj) = (VALUE *)tbl;
129
+ }
130
+
131
+ static inline uint32_t
132
+ RCLASS_IV_COUNT(VALUE obj)
133
+ {
134
+ RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE));
135
+ if (rb_shape_obj_too_complex(obj)) {
136
+ uint32_t count;
137
+
138
+ // "Too complex" classes could have their IV hash mutated in
139
+ // parallel, so lets lock around getting the hash size.
140
+ RB_VM_LOCK_ENTER();
141
+ {
142
+ count = (uint32_t)rb_st_table_size(RCLASS_IV_HASH(obj));
143
+ }
144
+ RB_VM_LOCK_LEAVE();
145
+
146
+ return count;
147
+ }
148
+ else {
149
+ return rb_shape_get_shape_by_id(RCLASS_SHAPE_ID(obj))->next_iv_index;
150
+ }
151
+ }
152
+
153
+ static inline void
154
+ RCLASS_SET_M_TBL(VALUE klass, struct rb_id_table *table)
155
+ {
156
+ RUBY_ASSERT(!RB_OBJ_PROMOTED(klass));
157
+ RCLASS_M_TBL(klass) = table;
158
+ }
159
+
109
160
  /* class.c */
110
161
  void rb_class_subclass_add(VALUE super, VALUE klass);
111
162
  void rb_class_remove_from_super_subclasses(VALUE);
@@ -119,7 +170,6 @@ VALUE rb_module_s_alloc(VALUE klass);
119
170
  void rb_module_set_initialized(VALUE module);
120
171
  void rb_module_check_initializable(VALUE module);
121
172
  VALUE rb_make_metaclass(VALUE, VALUE);
122
- VALUE rb_iclass_alloc(VALUE klass);
123
173
  VALUE rb_include_class_new(VALUE, VALUE);
124
174
  void rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE);
125
175
  void rb_class_detach_subclasses(VALUE);
@@ -206,7 +256,7 @@ RCLASS_SET_SUPER(VALUE klass, VALUE super)
206
256
  static inline void
207
257
  RCLASS_SET_CLASSPATH(VALUE klass, VALUE classpath, bool permanent)
208
258
  {
209
- assert(BUILTIN_TYPE(klass) == T_CLASS || BUILTIN_TYPE(klass) == T_MODULE || klass == rb_mRubyVMFrozenCore);
259
+ assert(BUILTIN_TYPE(klass) == T_CLASS || BUILTIN_TYPE(klass) == T_MODULE);
210
260
  assert(classpath == 0 || BUILTIN_TYPE(classpath) == T_STRING);
211
261
 
212
262
  RB_OBJ_WRITE(klass, &(RCLASS_EXT(klass)->classpath), classpath);
@@ -28,6 +28,8 @@ typedef struct ruby_cmdline_options {
28
28
  struct rb_rjit_options rjit;
29
29
  #endif
30
30
 
31
+ const char *crash_report;
32
+
31
33
  signed int sflag: 2;
32
34
  unsigned int xflag: 1;
33
35
  unsigned int warning: 1;
@@ -22,6 +22,9 @@ void rb_jit_cont_init(void);
22
22
  void rb_jit_cont_each_iseq(rb_iseq_callback callback, void *data);
23
23
  void rb_jit_cont_finish(void);
24
24
 
25
+ /* vm.c */
26
+ void rb_free_shared_fiber_pool(void);
27
+
25
28
  // Copy locals from the current execution to the specified fiber.
26
29
  VALUE rb_fiber_inherit_storage(struct rb_execution_context_struct *ec, struct rb_fiber_struct *fiber);
27
30
 
@@ -29,4 +29,7 @@ void rb_enc_set_base(const char *name, const char *orig);
29
29
  int rb_enc_set_dummy(int index);
30
30
  PUREFUNC(int rb_data_is_encoding(VALUE obj));
31
31
 
32
+ /* vm.c */
33
+ void rb_free_global_enc_table(void);
34
+
32
35
  #endif /* INTERNAL_ENCODING_H */
@@ -169,6 +169,9 @@ VALUE rb_syserr_new_path_in(const char *func_name, int n, VALUE path);
169
169
  #endif
170
170
  RUBY_SYMBOL_EXPORT_END
171
171
 
172
+ /* vm.c */
173
+ void rb_free_warning(void);
174
+
172
175
  static inline void
173
176
  rb_raise_cstr_i(VALUE etype, VALUE mesg)
174
177
  {
@@ -227,6 +227,7 @@ __attribute__((__alloc_align__(1)))
227
227
  RUBY_ATTR_MALLOC void *rb_aligned_malloc(size_t, size_t) RUBY_ATTR_ALLOC_SIZE((2));
228
228
  size_t rb_size_mul_or_raise(size_t, size_t, VALUE); /* used in compile.c */
229
229
  size_t rb_size_mul_add_or_raise(size_t, size_t, size_t, VALUE); /* used in iseq.h */
230
+ size_t rb_malloc_grow_capa(size_t current_capacity, size_t type_size);
230
231
  RUBY_ATTR_MALLOC void *rb_xmalloc_mul_add(size_t, size_t, size_t);
231
232
  RUBY_ATTR_MALLOC void *rb_xcalloc_mul_add(size_t, size_t, size_t);
232
233
  void *rb_xrealloc_mul_add(const void *, size_t, size_t, size_t);
@@ -249,6 +250,8 @@ void rb_gc_mark_and_move(VALUE *ptr);
249
250
  void rb_gc_mark_weak(VALUE *ptr);
250
251
  void rb_gc_remove_weak(VALUE parent_obj, VALUE *ptr);
251
252
 
253
+ void rb_gc_ref_update_table_values_only(st_table *tbl);
254
+
252
255
  #define rb_gc_mark_and_move_ptr(ptr) do { \
253
256
  VALUE _obj = (VALUE)*(ptr); \
254
257
  rb_gc_mark_and_move(&_obj); \
@@ -87,6 +87,7 @@ int rb_hash_stlike_delete(VALUE hash, st_data_t *pkey, st_data_t *pval);
87
87
  int rb_hash_stlike_foreach_with_replace(VALUE hash, st_foreach_check_callback_func *func, st_update_callback_func *replace, st_data_t arg);
88
88
  int rb_hash_stlike_update(VALUE hash, st_data_t key, st_update_callback_func *func, st_data_t arg);
89
89
  VALUE rb_ident_hash_new_with_size(st_index_t size);
90
+ void rb_hash_free(VALUE hash);
90
91
 
91
92
  static inline unsigned RHASH_AR_TABLE_SIZE_RAW(VALUE h);
92
93
  static inline VALUE RHASH_IFNONE(VALUE h);
@@ -129,7 +129,6 @@ struct MEMO {
129
129
  typedef struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t;
130
130
  rb_imemo_tmpbuf_t *rb_imemo_tmpbuf_parser_heap(void *buf, rb_imemo_tmpbuf_t *old_heap, size_t cnt);
131
131
  struct vm_ifunc *rb_vm_ifunc_new(rb_block_call_func_t func, const void *data, int min_argc, int max_argc);
132
- void rb_strterm_mark(VALUE obj);
133
132
  static inline enum imemo_type imemo_type(VALUE imemo);
134
133
  static inline int imemo_type_p(VALUE imemo, enum imemo_type imemo_type);
135
134
  static inline bool imemo_throw_data_p(VALUE imemo);
@@ -11,6 +11,7 @@
11
11
  #include "ruby/ruby.h" /* for VALUE */
12
12
 
13
13
  /* object.c */
14
+ size_t rb_obj_embedded_size(uint32_t numiv);
14
15
  VALUE rb_class_search_ancestor(VALUE klass, VALUE super);
15
16
  NORETURN(void rb_undefined_alloc(VALUE klass));
16
17
  double rb_num_to_dbl(VALUE val);
@@ -22,47 +22,22 @@ struct rb_iseq_struct; /* in vm_core.h */
22
22
 
23
23
  /* structs for managing terminator of string literal and heredocment */
24
24
  typedef struct rb_strterm_literal_struct {
25
- union {
26
- VALUE dummy;
27
- long nest;
28
- } u0;
29
- union {
30
- VALUE dummy;
31
- long func; /* STR_FUNC_* (e.g., STR_FUNC_ESCAPE and STR_FUNC_EXPAND) */
32
- } u1;
33
- union {
34
- VALUE dummy;
35
- long paren; /* '(' of `%q(...)` */
36
- } u2;
37
- union {
38
- VALUE dummy;
39
- long term; /* ')' of `%q(...)` */
40
- } u3;
25
+ long nest;
26
+ int func; /* STR_FUNC_* (e.g., STR_FUNC_ESCAPE and STR_FUNC_EXPAND) */
27
+ int paren; /* '(' of `%q(...)` */
28
+ int term; /* ')' of `%q(...)` */
41
29
  } rb_strterm_literal_t;
42
30
 
43
- #define HERETERM_LENGTH_BITS ((SIZEOF_VALUE - 1) * CHAR_BIT - 1)
44
-
45
31
  typedef struct rb_strterm_heredoc_struct {
46
32
  VALUE lastline; /* the string of line that contains `<<"END"` */
47
33
  long offset; /* the column of END in `<<"END"` */
48
34
  int sourceline; /* lineno of the line that contains `<<"END"` */
49
- unsigned length /* the length of END in `<<"END"` */
50
- #if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
51
- : HERETERM_LENGTH_BITS
52
- # define HERETERM_LENGTH_MAX ((1U << HERETERM_LENGTH_BITS) - 1)
53
- #else
54
- # define HERETERM_LENGTH_MAX UINT_MAX
55
- #endif
56
- ;
57
- #if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT
58
- unsigned quote: 1;
59
- unsigned func: 8;
60
- #else
35
+ unsigned length; /* the length of END in `<<"END"` */
61
36
  uint8_t quote;
62
37
  uint8_t func;
63
- #endif
64
38
  } rb_strterm_heredoc_t;
65
- STATIC_ASSERT(rb_strterm_heredoc_t, sizeof(rb_strterm_heredoc_t) <= 4 * SIZEOF_VALUE);
39
+
40
+ #define HERETERM_LENGTH_MAX UINT_MAX
66
41
 
67
42
  typedef struct rb_strterm_struct {
68
43
  VALUE flags;
@@ -12,5 +12,6 @@
12
12
 
13
13
  /* random.c */
14
14
  int ruby_fill_random_bytes(void *, size_t, int);
15
+ void rb_free_default_rand_key(void);
15
16
 
16
17
  #endif /* INTERNAL_RANDOM_H */
@@ -64,7 +64,6 @@ VALUE rb_str_upto_endless_each(VALUE, int (*each)(VALUE, VALUE), VALUE);
64
64
  void rb_str_make_embedded(VALUE);
65
65
  size_t rb_str_size_as_embedded(VALUE);
66
66
  bool rb_str_reembeddable_p(VALUE);
67
- void rb_str_update_shared_ary(VALUE str, VALUE old_root, VALUE new_root);
68
67
  RUBY_SYMBOL_EXPORT_END
69
68
 
70
69
  VALUE rb_fstring_new(const char *ptr, long len);
@@ -32,6 +32,9 @@ ID rb_make_temporary_id(size_t n);
32
32
  void rb_gc_free_dsymbol(VALUE);
33
33
  int rb_static_id_valid_p(ID id);
34
34
 
35
+ /* vm.c */
36
+ void rb_free_static_symid_str(void);
37
+
35
38
  #if __has_builtin(__builtin_constant_p)
36
39
  #define rb_sym_intern_ascii_cstr(ptr) \
37
40
  (__builtin_constant_p(ptr) ? \
@@ -50,6 +50,7 @@ void rb_mutex_allow_trap(VALUE self, int val);
50
50
  VALUE rb_uninterruptible(VALUE (*b_proc)(VALUE), VALUE data);
51
51
  VALUE rb_mutex_owned_p(VALUE self);
52
52
  VALUE rb_exec_recursive_outer_mid(VALUE (*f)(VALUE g, VALUE h, int r), VALUE g, VALUE h, ID mid);
53
+ void ruby_mn_threads_params(void);
53
54
 
54
55
  int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout);
55
56
 
@@ -62,11 +63,14 @@ int rb_notify_fd_close(int fd, struct rb_io_close_wait_list *busy);
62
63
  void rb_notify_fd_close_wait(struct rb_io_close_wait_list *busy);
63
64
 
64
65
  RUBY_SYMBOL_EXPORT_BEGIN
66
+
65
67
  /* Temporary. This API will be removed (renamed). */
66
68
  VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
69
+ VALUE rb_thread_io_blocking_call(rb_blocking_function_t *func, void *data1, int fd, int events);
67
70
 
68
71
  /* thread.c (export) */
69
72
  int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */
73
+
70
74
  RUBY_SYMBOL_EXPORT_END
71
75
 
72
76
  int rb_threadptr_execute_interrupts(struct rb_thread_struct *th, int blocking_timing);
@@ -17,4 +17,7 @@
17
17
  extern VALUE rb_cEncodingConverter;
18
18
  size_t rb_econv_memsize(rb_econv_t *);
19
19
 
20
+ /* vm.c */
21
+ void rb_free_transcoder_table(void);
22
+
20
23
  #endif /* INTERNAL_TRANSCODE_H */
@@ -47,11 +47,14 @@ VALUE rb_mod_set_temporary_name(VALUE, VALUE);
47
47
 
48
48
  struct gen_ivtbl;
49
49
  int rb_gen_ivtbl_get(VALUE obj, ID id, struct gen_ivtbl **ivtbl);
50
- int rb_obj_evacuate_ivs_to_hash_table(ID key, VALUE val, st_data_t arg);
50
+ void rb_obj_copy_ivs_to_hash_table(VALUE obj, st_table *table);
51
+ void rb_obj_convert_to_too_complex(VALUE obj, st_table *table);
52
+ void rb_evict_ivars_to_hash(VALUE obj);
51
53
 
52
54
  RUBY_SYMBOL_EXPORT_BEGIN
53
55
  /* variable.c (export) */
54
- void rb_mark_and_update_generic_ivar(VALUE);
56
+ void rb_mark_generic_ivar(VALUE obj);
57
+ void rb_ref_update_generic_ivar(VALUE);
55
58
  void rb_mv_generic_ivar(VALUE src, VALUE dst);
56
59
  VALUE rb_const_missing(VALUE klass, VALUE name);
57
60
  int rb_class_ivar_set(VALUE klass, ID vid, VALUE value);
@@ -63,9 +66,7 @@ VALUE rb_gvar_get(ID);
63
66
  VALUE rb_gvar_set(ID, VALUE);
64
67
  VALUE rb_gvar_defined(ID);
65
68
  void rb_const_warn_if_deprecated(const rb_const_entry_t *, VALUE, ID);
66
- rb_shape_t * rb_grow_iv_list(VALUE obj);
67
69
  void rb_ensure_iv_list_size(VALUE obj, uint32_t len, uint32_t newsize);
68
- struct gen_ivtbl *rb_ensure_generic_iv_list_size(VALUE obj, rb_shape_t *shape, uint32_t newsize);
69
70
  attr_index_t rb_obj_ivar_set(VALUE obj, ID id, VALUE val);
70
71
 
71
72
  #endif /* INTERNAL_VARIABLE_H */
@@ -58,6 +58,8 @@ VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements);
58
58
  VALUE ruby_vm_special_exception_copy(VALUE);
59
59
  PUREFUNC(st_table *rb_vm_fstring_table(void));
60
60
 
61
+ void rb_lastline_set_up(VALUE val, unsigned int up);
62
+
61
63
  /* vm_eval.c */
62
64
  VALUE rb_current_realfilepath(void);
63
65
  VALUE rb_check_block_call(VALUE, ID, int, const VALUE *, rb_block_call_func_t, VALUE);
@@ -81,6 +83,11 @@ void rb_check_stack_overflow(void);
81
83
  extern uint64_t rb_vm_insns_count;
82
84
  #endif
83
85
 
86
+ extern bool rb_free_at_exit;
87
+
88
+ /* miniinit.c and builtin.c */
89
+ void rb_free_loaded_builtin_table(void);
90
+
84
91
  /* vm_insnhelper.c */
85
92
  VALUE rb_equal_opt(VALUE obj1, VALUE obj2);
86
93
  VALUE rb_eql_opt(VALUE obj1, VALUE obj2);
@@ -95,7 +102,7 @@ int rb_ec_obj_respond_to(struct rb_execution_context_struct *ec, VALUE obj, ID i
95
102
  void rb_clear_constant_cache(void);
96
103
 
97
104
  /* vm_dump.c */
98
- void rb_print_backtrace(void);
105
+ void rb_print_backtrace(FILE *);
99
106
 
100
107
  /* vm_backtrace.c */
101
108
  VALUE rb_vm_thread_backtrace(int argc, const VALUE *argv, VALUE thval);
@@ -103,7 +110,7 @@ VALUE rb_vm_thread_backtrace_locations(int argc, const VALUE *argv, VALUE thval)
103
110
  VALUE rb_vm_backtrace(int argc, const VALUE * argv, struct rb_execution_context_struct * ec);
104
111
  VALUE rb_vm_backtrace_locations(int argc, const VALUE * argv, struct rb_execution_context_struct * ec);
105
112
  VALUE rb_make_backtrace(void);
106
- void rb_backtrace_print_as_bugreport(void);
113
+ void rb_backtrace_print_as_bugreport(FILE*);
107
114
  int rb_backtrace_p(VALUE obj);
108
115
  VALUE rb_backtrace_to_str_ary(VALUE obj);
109
116
  VALUE rb_backtrace_to_location_ary(VALUE obj);
@@ -13,6 +13,7 @@
13
13
  #include "internal/gc.h"
14
14
  #include "shape.h"
15
15
  #include "vm_core.h"
16
+ #include "prism_compile.h"
16
17
 
17
18
  RUBY_EXTERN const int ruby_api_version[];
18
19
  #define ISEQ_MAJOR_VERSION ((unsigned int)ruby_api_version[0])
@@ -173,6 +174,7 @@ void rb_iseq_init_trace(rb_iseq_t *iseq);
173
174
  int rb_iseq_add_local_tracepoint_recursively(const rb_iseq_t *iseq, rb_event_flag_t turnon_events, VALUE tpval, unsigned int target_line, bool target_bmethod);
174
175
  int rb_iseq_remove_local_tracepoint_recursively(const rb_iseq_t *iseq, VALUE tpval);
175
176
  const rb_iseq_t *rb_iseq_load_iseq(VALUE fname);
177
+ rb_iseq_t * rb_iseq_new_main_prism(pm_string_t *input, pm_options_t *options, VALUE path);
176
178
 
177
179
  #if VM_INSN_INFO_TABLE_IMPL == 2
178
180
  unsigned int *rb_iseq_insns_info_decode_positions(const struct rb_iseq_constant_body *body);
@@ -189,7 +191,7 @@ VALUE *rb_iseq_original_iseq(const rb_iseq_t *iseq);
189
191
  void rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc,
190
192
  VALUE locals, VALUE args,
191
193
  VALUE exception, VALUE body);
192
- void rb_iseq_mark_and_move_insn_storage(struct iseq_compile_data_storage *arena);
194
+ void rb_iseq_mark_and_pin_insn_storage(struct iseq_compile_data_storage *arena);
193
195
 
194
196
  VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
195
197
  VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
@@ -329,6 +331,8 @@ VALUE rb_iseq_local_variables(const rb_iseq_t *iseq);
329
331
 
330
332
  attr_index_t rb_estimate_iv_count(VALUE klass, const rb_iseq_t * initialize_iseq);
331
333
 
334
+ void rb_free_encoded_insn_data(void);
335
+
332
336
  RUBY_SYMBOL_EXPORT_END
333
337
 
334
338
  #endif /* RUBY_ISEQ_H */
@@ -101,8 +101,9 @@ static inline void
101
101
  METHOD_ENTRY_FLAGS_COPY(rb_method_entry_t *dst, const rb_method_entry_t *src)
102
102
  {
103
103
  dst->flags =
104
- (dst->flags & ~(IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2)) |
105
- (src->flags & (IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2));
104
+ (dst->flags & ~(IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2
105
+ |IMEMO_FL_USER3)) |
106
+ (src->flags & (IMEMO_FL_USER0|IMEMO_FL_USER1|IMEMO_FL_USER2|IMEMO_FL_USER3));
106
107
  }
107
108
 
108
109
  typedef enum {
@@ -152,7 +153,6 @@ typedef struct rb_method_alias_struct {
152
153
 
153
154
  typedef struct rb_method_refined_struct {
154
155
  struct rb_method_entry_struct * orig_me;
155
- VALUE owner;
156
156
  } rb_method_refined_t;
157
157
 
158
158
  typedef struct rb_method_bmethod_struct {
@@ -178,9 +178,9 @@ typedef struct rb_method_optimized {
178
178
  struct rb_method_definition_struct {
179
179
  BITFIELD(rb_method_type_t, type, VM_METHOD_TYPE_MINIMUM_BITS);
180
180
  unsigned int iseq_overload: 1;
181
- int alias_count : 27;
182
- int complemented_count : 28;
183
181
  unsigned int no_redef_warning: 1;
182
+ unsigned int aliased : 1;
183
+ int reference_count : 28;
184
184
 
185
185
  union {
186
186
  rb_method_iseq_t iseq;
@@ -199,7 +199,7 @@ struct rb_method_definition_struct {
199
199
  struct rb_id_table;
200
200
 
201
201
  typedef struct rb_method_definition_struct rb_method_definition_t;
202
- STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body)==8);
202
+ STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body) <= 8);
203
203
 
204
204
  #define UNDEFINED_METHOD_ENTRY_P(me) (!(me) || !(me)->def || (me)->def->type == VM_METHOD_TYPE_UNDEF)
205
205
  #define UNDEFINED_REFINED_METHOD_P(def) \
@@ -213,7 +213,7 @@ void rb_add_method_optimized(VALUE klass, ID mid, enum method_optimized_type, un
213
213
  void rb_add_refined_method_entry(VALUE refined_class, ID mid);
214
214
 
215
215
  rb_method_entry_t *rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_visibility_t noex);
216
- rb_method_entry_t *rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, const rb_method_definition_t *def);
216
+ rb_method_entry_t *rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, rb_method_definition_t *def);
217
217
 
218
218
  const rb_method_entry_t *rb_method_entry_at(VALUE obj, ID id);
219
219
 
@@ -19,12 +19,14 @@ typedef void (*bug_report_func)(const char *fmt, ...);
19
19
 
20
20
  typedef struct node_buffer_elem_struct {
21
21
  struct node_buffer_elem_struct *next;
22
- long len;
23
- NODE buf[FLEX_ARY_LEN];
22
+ long len; /* Length of nodes */
23
+ size_t allocated; /* Total memory size of allocated buf */
24
+ size_t used; /* Current usage of buf */
25
+ NODE **nodes; /* Array of node pointers */
26
+ NODE *buf[FLEX_ARY_LEN];
24
27
  } node_buffer_elem_t;
25
28
 
26
29
  typedef struct {
27
- long idx, len;
28
30
  node_buffer_elem_t *head;
29
31
  node_buffer_elem_t *last;
30
32
  } node_buffer_list_t;
@@ -50,7 +52,7 @@ RUBY_SYMBOL_EXPORT_BEGIN
50
52
  #ifdef UNIVERSAL_PARSER
51
53
  rb_ast_t *rb_ast_new(rb_parser_config_t *config);
52
54
  #else
53
- rb_ast_t *rb_ast_new();
55
+ rb_ast_t *rb_ast_new(void);
54
56
  #endif
55
57
  size_t rb_ast_memsize(const rb_ast_t*);
56
58
  void rb_ast_dispose(rb_ast_t*);
@@ -59,14 +61,15 @@ VALUE rb_ast_tokens(rb_ast_t *ast);
59
61
  void rb_ast_node_type_change(NODE *n, enum node_type type);
60
62
  #endif
61
63
  const char *ruby_node_name(int node);
62
- void rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2);
64
+ void rb_node_init(NODE *n, enum node_type type);
63
65
 
64
66
  void rb_ast_mark(rb_ast_t*);
65
67
  void rb_ast_update_references(rb_ast_t*);
66
68
  void rb_ast_free(rb_ast_t*);
67
69
  void rb_ast_add_mark_object(rb_ast_t*, VALUE);
70
+ void rb_ast_delete_mark_object(rb_ast_t*, VALUE);
68
71
  void rb_ast_set_tokens(rb_ast_t*, VALUE);
69
- NODE *rb_ast_newnode(rb_ast_t*, enum node_type type);
72
+ NODE *rb_ast_newnode(rb_ast_t*, enum node_type type, size_t size, size_t alignment);
70
73
  void rb_ast_delete_node(rb_ast_t*, NODE *n);
71
74
  rb_ast_id_table_t *rb_ast_new_local_table(rb_ast_t*, int);
72
75
  rb_ast_id_table_t *rb_ast_resize_latest_local_table(rb_ast_t*, int);
@@ -94,27 +97,27 @@ RUBY_SYMBOL_EXPORT_END
94
97
 
95
98
 
96
99
  #define NODE_SPECIAL_REQUIRED_KEYWORD ((NODE *)-1)
97
- #define NODE_REQUIRED_KEYWORD_P(node) ((node)->nd_value == NODE_SPECIAL_REQUIRED_KEYWORD)
100
+ #define NODE_REQUIRED_KEYWORD_P(node) ((node) == NODE_SPECIAL_REQUIRED_KEYWORD)
98
101
  #define NODE_SPECIAL_NO_NAME_REST ((NODE *)-1)
99
102
  #define NODE_NAMED_REST_P(node) ((node) != NODE_SPECIAL_NO_NAME_REST)
100
103
  #define NODE_SPECIAL_EXCESSIVE_COMMA ((ID)1)
101
104
  #define NODE_SPECIAL_NO_REST_KEYWORD ((NODE *)-1)
102
105
 
103
- #define nd_first_column(n) ((int)((n)->nd_loc.beg_pos.column))
104
- #define nd_set_first_column(n, v) ((n)->nd_loc.beg_pos.column = (v))
105
- #define nd_first_lineno(n) ((int)((n)->nd_loc.beg_pos.lineno))
106
- #define nd_set_first_lineno(n, v) ((n)->nd_loc.beg_pos.lineno = (v))
107
- #define nd_first_loc(n) ((n)->nd_loc.beg_pos)
106
+ #define nd_first_column(n) ((int)(RNODE(n)->nd_loc.beg_pos.column))
107
+ #define nd_set_first_column(n, v) (RNODE(n)->nd_loc.beg_pos.column = (v))
108
+ #define nd_first_lineno(n) ((int)(RNODE(n)->nd_loc.beg_pos.lineno))
109
+ #define nd_set_first_lineno(n, v) (RNODE(n)->nd_loc.beg_pos.lineno = (v))
110
+ #define nd_first_loc(n) (RNODE(n)->nd_loc.beg_pos)
108
111
  #define nd_set_first_loc(n, v) (nd_first_loc(n) = (v))
109
112
 
110
- #define nd_last_column(n) ((int)((n)->nd_loc.end_pos.column))
111
- #define nd_set_last_column(n, v) ((n)->nd_loc.end_pos.column = (v))
112
- #define nd_last_lineno(n) ((int)((n)->nd_loc.end_pos.lineno))
113
- #define nd_set_last_lineno(n, v) ((n)->nd_loc.end_pos.lineno = (v))
114
- #define nd_last_loc(n) ((n)->nd_loc.end_pos)
113
+ #define nd_last_column(n) ((int)(RNODE(n)->nd_loc.end_pos.column))
114
+ #define nd_set_last_column(n, v) (RNODE(n)->nd_loc.end_pos.column = (v))
115
+ #define nd_last_lineno(n) ((int)(RNODE(n)->nd_loc.end_pos.lineno))
116
+ #define nd_set_last_lineno(n, v) (RNODE(n)->nd_loc.end_pos.lineno = (v))
117
+ #define nd_last_loc(n) (RNODE(n)->nd_loc.end_pos)
115
118
  #define nd_set_last_loc(n, v) (nd_last_loc(n) = (v))
116
- #define nd_node_id(n) ((n)->node_id)
117
- #define nd_set_node_id(n,id) ((n)->node_id = (id))
119
+ #define nd_node_id(n) (RNODE(n)->node_id)
120
+ #define nd_set_node_id(n,id) (RNODE(n)->node_id = (id))
118
121
 
119
122
  static inline bool
120
123
  nd_type_p(const NODE *n, enum node_type t)
@@ -88,8 +88,6 @@
88
88
  return "NODE_LIST";
89
89
  case NODE_ZLIST:
90
90
  return "NODE_ZLIST";
91
- case NODE_VALUES:
92
- return "NODE_VALUES";
93
91
  case NODE_HASH:
94
92
  return "NODE_HASH";
95
93
  case NODE_RETURN:
@@ -208,3 +206,7 @@
208
206
  return "NODE_FNDPTN";
209
207
  case NODE_ERROR:
210
208
  return "NODE_ERROR";
209
+ case NODE_RIPPER:
210
+ return "NODE_RIPPER";
211
+ case NODE_RIPPER_VALUES:
212
+ return "NODE_RIPPER_VALUES";
@@ -38,6 +38,6 @@
38
38
 
39
39
  /* Let .bss section automatically initialize this variable */
40
40
  /* cf. Section 6.7.8 of ISO/IEC 9899:1999 */
41
- static const int *const *const unified_insns_data[202];
41
+ static const int *const *const unified_insns_data[204];
42
42
 
43
43
  ASSERT_VM_INSTRUCTION_SIZE(unified_insns_data);
@@ -1,4 +1,4 @@
1
- /* A Bison parser, made by Lrama 0.5.6. */
1
+ /* A Bison parser, made by Lrama 0.5.12. */
2
2
 
3
3
  /* Bison interface for Yacc-like parsers in C
4
4
 
@@ -34,17 +34,17 @@
34
34
  /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
35
35
  especially those whose name start with YY_ or yy_. They are
36
36
  private implementation details that can be changed or removed. */
37
-
38
37
  #ifndef YY_YY_PARSE_H_INCLUDED
39
38
  # define YY_YY_PARSE_H_INCLUDED
40
39
  /* Debug traces. */
41
40
  #ifndef YYDEBUG
42
41
  # define YYDEBUG 0
43
42
  #endif
44
- #if YYDEBUG
43
+ #if YYDEBUG && !defined(yydebug)
45
44
  extern int yydebug;
46
45
  #endif
47
46
 
47
+
48
48
  /* Token kinds. */
49
49
  #ifndef YYTOKENTYPE
50
50
  # define YYTOKENTYPE
@@ -190,10 +190,19 @@ extern int yydebug;
190
190
  #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
191
191
  union YYSTYPE
192
192
  {
193
- #line 1507 "parse.y"
193
+ #line 1963 "parse.y"
194
194
 
195
195
  VALUE val;
196
196
  NODE *node;
197
+ rb_node_fcall_t *node_fcall;
198
+ rb_node_args_t *node_args;
199
+ rb_node_args_aux_t *node_args_aux;
200
+ rb_node_opt_arg_t *node_opt_arg;
201
+ rb_node_kw_arg_t *node_kw_arg;
202
+ rb_node_block_pass_t *node_block_pass;
203
+ rb_node_masgn_t *node_masgn;
204
+ rb_node_def_temp_t *node_def_temp;
205
+ rb_node_exits_t *node_exits;
197
206
  ID id;
198
207
  int num;
199
208
  st_table *tbl;
@@ -201,7 +210,7 @@ union YYSTYPE
201
210
  struct rb_strterm_struct *strterm;
202
211
  struct lex_context ctxt;
203
212
 
204
- #line 205 "parse.h"
213
+ #line 214 "parse.h"
205
214
 
206
215
  };
207
216
  typedef union YYSTYPE YYSTYPE;
@@ -229,4 +238,6 @@ struct YYLTYPE
229
238
  int yyparse (struct parser_params *p);
230
239
 
231
240
 
241
+
232
242
  #endif /* !YY_YY_PARSE_H_INCLUDED */
243
+