debase-ruby_core_source 3.2.1 → 3.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/addr2line.h +3 -1
  4. data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/darray.h +246 -0
  5. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/debug_counter.h +7 -10
  6. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/eval_intern.h +3 -1
  7. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/id.h +44 -0
  8. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/insns_info.inc +128 -154
  9. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/array.h +9 -20
  10. data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/internal/bits.h +568 -0
  11. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/class.h +11 -2
  12. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/cmdlineopt.h +5 -1
  13. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/compile.h +0 -1
  14. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/error.h +24 -2
  15. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/gc.h +29 -0
  16. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/hash.h +19 -44
  17. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/imemo.h +0 -1
  18. data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/internal/io.h +137 -0
  19. data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/internal/parse.h +108 -0
  20. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/process.h +0 -14
  21. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/range.h +2 -2
  22. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/re.h +1 -1
  23. data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/internal/ruby_parser.h +69 -0
  24. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/signal.h +4 -0
  25. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/string.h +15 -0
  26. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/struct.h +9 -34
  27. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/thread.h +14 -0
  28. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/variable.h +17 -35
  29. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/vm.h +9 -2
  30. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/iseq.h +4 -4
  31. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/method.h +8 -7
  32. data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/node.h +128 -0
  33. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/node_name.inc +4 -2
  34. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/parse.h +19 -6
  35. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1/internal/bits.h → ruby-3.3.0-preview3/parser_bits.h} +4 -4
  36. data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/parser_node.h +32 -0
  37. data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/parser_st.h +162 -0
  38. data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/parser_value.h +106 -0
  39. data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/prism_compile.h +18 -0
  40. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ractor_core.h +10 -4
  41. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/regint.h +8 -0
  42. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/regparse.h +2 -1
  43. data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/revision.h +5 -0
  44. data/lib/debase/ruby_core_source/ruby-3.3.0-preview3/rubyparser.h +1403 -0
  45. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/shape.h +32 -22
  46. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/symbol.h +2 -3
  47. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/thread_none.h +1 -0
  48. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/thread_pthread.h +66 -28
  49. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/thread_win32.h +1 -6
  50. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/variable.h +9 -2
  51. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/version.h +7 -3
  52. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm.inc +383 -497
  53. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_callinfo.h +54 -16
  54. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_core.h +92 -57
  55. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_exec.h +11 -10
  56. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_insnhelper.h +20 -23
  57. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_opts.h +0 -5
  58. data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/yjit.h +12 -12
  59. data/lib/debase/ruby_core_source/version.rb +1 -1
  60. metadata +120 -115
  61. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/darray.h +0 -179
  62. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/io.h +0 -38
  63. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/parse.h +0 -25
  64. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/node.h +0 -514
  65. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/opt_sc.inc +0 -109
  66. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/revision.h +0 -5
  67. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/transient_heap.h +0 -65
  68. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/builtin.h +0 -0
  69. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ccan/build_assert/build_assert.h +0 -0
  70. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ccan/check_type/check_type.h +0 -0
  71. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ccan/container_of/container_of.h +0 -0
  72. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ccan/list/list.h +0 -0
  73. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ccan/str/str.h +0 -0
  74. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/constant.h +0 -0
  75. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/dln.h +0 -0
  76. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/encindex.h +0 -0
  77. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/hrtime.h +0 -0
  78. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/id_table.h +0 -0
  79. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/insns.inc +0 -0
  80. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/basic_operators.h +0 -0
  81. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/bignum.h +0 -0
  82. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/compar.h +0 -0
  83. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/compilers.h +0 -0
  84. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/complex.h +0 -0
  85. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/cont.h +0 -0
  86. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/dir.h +0 -0
  87. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/enc.h +0 -0
  88. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/encoding.h +0 -0
  89. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/enum.h +0 -0
  90. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/enumerator.h +0 -0
  91. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/eval.h +0 -0
  92. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/file.h +0 -0
  93. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/fixnum.h +0 -0
  94. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/inits.h +0 -0
  95. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/load.h +0 -0
  96. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/loadpath.h +0 -0
  97. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/math.h +0 -0
  98. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/missing.h +0 -0
  99. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/numeric.h +0 -0
  100. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/object.h +0 -0
  101. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/proc.h +0 -0
  102. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/ractor.h +0 -0
  103. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/random.h +0 -0
  104. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/rational.h +0 -0
  105. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/sanitizers.h +0 -0
  106. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/serial.h +0 -0
  107. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/static_assert.h +0 -0
  108. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/symbol.h +0 -0
  109. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/time.h +0 -0
  110. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/transcode.h +0 -0
  111. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/util.h +0 -0
  112. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal/warnings.h +0 -0
  113. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/internal.h +0 -0
  114. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/known_errors.inc +0 -0
  115. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/optinsn.inc +0 -0
  116. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/optunifs.inc +0 -0
  117. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/probes_helper.h +0 -0
  118. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/regenc.h +0 -0
  119. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/rjit.h +0 -0
  120. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/rjit_c.h +0 -0
  121. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ruby_assert.h +0 -0
  122. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/ruby_atomic.h +0 -0
  123. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/siphash.h +0 -0
  124. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/timev.h +0 -0
  125. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/transcode_data.h +0 -0
  126. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_call_iseq_optimized.inc +0 -0
  127. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_debug.h +0 -0
  128. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vm_sync.h +0 -0
  129. /data/lib/debase/ruby_core_source/{ruby-3.3.0-preview1 → ruby-3.3.0-preview3}/vmtc.inc +0 -0
@@ -12,10 +12,9 @@
12
12
  #include "ruby/ruby.h" /* for struct RBasic */
13
13
 
14
14
  enum {
15
- RSTRUCT_EMBED_LEN_MAX = RVALUE_EMBED_LEN_MAX,
16
- RSTRUCT_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER1),
15
+ RSTRUCT_EMBED_LEN_MASK = RUBY_FL_USER7 | RUBY_FL_USER6 | RUBY_FL_USER5 | RUBY_FL_USER4 |
16
+ RUBY_FL_USER3 | RUBY_FL_USER2 | RUBY_FL_USER1,
17
17
  RSTRUCT_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+1),
18
- RSTRUCT_TRANSIENT_FLAG = FL_USER3,
19
18
  };
20
19
 
21
20
  struct RStruct {
@@ -25,7 +24,12 @@ struct RStruct {
25
24
  long len;
26
25
  const VALUE *ptr;
27
26
  } heap;
28
- const VALUE ary[RSTRUCT_EMBED_LEN_MAX];
27
+ /* This is a length 1 array because:
28
+ * 1. GCC has a bug that does not optimize C flexible array members
29
+ * (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102452)
30
+ * 2. Zero length arrays are not supported by all compilers
31
+ */
32
+ const VALUE ary[1];
29
33
  } as;
30
34
  };
31
35
 
@@ -56,9 +60,6 @@ VALUE rb_struct_init_copy(VALUE copy, VALUE s);
56
60
  VALUE rb_struct_lookup(VALUE s, VALUE idx);
57
61
  VALUE rb_struct_s_keyword_init(VALUE klass);
58
62
  static inline const VALUE *rb_struct_const_heap_ptr(VALUE st);
59
- static inline bool RSTRUCT_TRANSIENT_P(VALUE st);
60
- static inline void RSTRUCT_TRANSIENT_SET(VALUE st);
61
- static inline void RSTRUCT_TRANSIENT_UNSET(VALUE st);
62
63
  static inline long RSTRUCT_EMBED_LEN(VALUE st);
63
64
  static inline long RSTRUCT_LEN(VALUE st);
64
65
  static inline int RSTRUCT_LENINT(VALUE st);
@@ -66,32 +67,6 @@ static inline const VALUE *RSTRUCT_CONST_PTR(VALUE st);
66
67
  static inline void RSTRUCT_SET(VALUE st, long k, VALUE v);
67
68
  static inline VALUE RSTRUCT_GET(VALUE st, long k);
68
69
 
69
- static inline bool
70
- RSTRUCT_TRANSIENT_P(VALUE st)
71
- {
72
- #if USE_TRANSIENT_HEAP
73
- return FL_TEST_RAW(st, RSTRUCT_TRANSIENT_FLAG);
74
- #else
75
- return false;
76
- #endif
77
- }
78
-
79
- static inline void
80
- RSTRUCT_TRANSIENT_SET(VALUE st)
81
- {
82
- #if USE_TRANSIENT_HEAP
83
- FL_SET_RAW(st, RSTRUCT_TRANSIENT_FLAG);
84
- #endif
85
- }
86
-
87
- static inline void
88
- RSTRUCT_TRANSIENT_UNSET(VALUE st)
89
- {
90
- #if USE_TRANSIENT_HEAP
91
- FL_UNSET_RAW(st, RSTRUCT_TRANSIENT_FLAG);
92
- #endif
93
- }
94
-
95
70
  static inline long
96
71
  RSTRUCT_EMBED_LEN(VALUE st)
97
72
  {
@@ -145,7 +120,7 @@ RSTRUCT_GET(VALUE st, long k)
145
120
  static inline const VALUE *
146
121
  rb_struct_const_heap_ptr(VALUE st)
147
122
  {
148
- /* TODO: check embed on debug mode */
123
+ assert(!FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK));
149
124
  return RSTRUCT(st)->as.heap.ptr;
150
125
  }
151
126
 
@@ -10,6 +10,7 @@
10
10
  */
11
11
  #include "ruby/ruby.h" /* for VALUE */
12
12
  #include "ruby/intern.h" /* for rb_blocking_function_t */
13
+ #include "ccan/list/list.h" /* for list in rb_io_close_wait_list */
13
14
 
14
15
  struct rb_thread_struct; /* in vm_core.h */
15
16
 
@@ -29,6 +30,10 @@ struct rb_thread_struct; /* in vm_core.h */
29
30
  #define COVERAGE_TARGET_ONESHOT_LINES 8
30
31
  #define COVERAGE_TARGET_EVAL 16
31
32
 
33
+ #define RUBY_FATAL_THREAD_KILLED INT2FIX(0)
34
+ #define RUBY_FATAL_THREAD_TERMINATED INT2FIX(1)
35
+ #define RUBY_FATAL_FIBER_KILLED RB_INT2FIX(2)
36
+
32
37
  VALUE rb_obj_is_mutex(VALUE obj);
33
38
  VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
34
39
  void rb_thread_execute_interrupts(VALUE th);
@@ -45,9 +50,18 @@ void rb_mutex_allow_trap(VALUE self, int val);
45
50
  VALUE rb_uninterruptible(VALUE (*b_proc)(VALUE), VALUE data);
46
51
  VALUE rb_mutex_owned_p(VALUE self);
47
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);
48
54
 
49
55
  int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout);
50
56
 
57
+ struct rb_io_close_wait_list {
58
+ struct ccan_list_head pending_fd_users;
59
+ VALUE closing_thread;
60
+ VALUE wakeup_mutex;
61
+ };
62
+ int rb_notify_fd_close(int fd, struct rb_io_close_wait_list *busy);
63
+ void rb_notify_fd_close_wait(struct rb_io_close_wait_list *busy);
64
+
51
65
  RUBY_SYMBOL_EXPORT_BEGIN
52
66
  /* Temporary. This API will be removed (renamed). */
53
67
  VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
@@ -15,10 +15,6 @@
15
15
  #include "ruby/ruby.h" /* for VALUE */
16
16
  #include "shape.h" /* for rb_shape_t */
17
17
 
18
- /* global variable */
19
-
20
- #define ROBJECT_TRANSIENT_FLAG FL_USER2
21
-
22
18
  /* variable.c */
23
19
  void rb_gc_mark_global_tbl(void);
24
20
  void rb_gc_update_global_tbl(void);
@@ -32,13 +28,27 @@ rb_gvar_getter_t *rb_gvar_getter_function_of(ID);
32
28
  rb_gvar_setter_t *rb_gvar_setter_function_of(ID);
33
29
  void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_);
34
30
  void rb_gvar_ractor_local(const char *name);
35
- static inline bool ROBJ_TRANSIENT_P(VALUE obj);
36
- static inline void ROBJ_TRANSIENT_SET(VALUE obj);
37
- static inline void ROBJ_TRANSIENT_UNSET(VALUE obj);
31
+
32
+ /**
33
+ * Sets the name of a module.
34
+ *
35
+ * Non-permanently named classes can have a temporary name assigned (or
36
+ * cleared). In that case the name will be used for `#inspect` and `#to_s`, and
37
+ * nested classes/modules will be named with the temporary name as a prefix.
38
+ *
39
+ * After the module is assigned to a constant, the temporary name will be
40
+ * discarded, and the name will be computed based on the nesting.
41
+ *
42
+ * @param[in] mod An instance of ::rb_cModule.
43
+ * @param[in] name An instance of ::rb_cString.
44
+ * @retval mod
45
+ */
46
+ VALUE rb_mod_set_temporary_name(VALUE, VALUE);
38
47
 
39
48
  struct gen_ivtbl;
40
49
  int rb_gen_ivtbl_get(VALUE obj, ID id, struct gen_ivtbl **ivtbl);
41
50
  int rb_obj_evacuate_ivs_to_hash_table(ID key, VALUE val, st_data_t arg);
51
+ void rb_evict_ivars_to_hash(VALUE obj, rb_shape_t * shape);
42
52
 
43
53
  RUBY_SYMBOL_EXPORT_BEGIN
44
54
  /* variable.c (export) */
@@ -54,35 +64,7 @@ VALUE rb_gvar_get(ID);
54
64
  VALUE rb_gvar_set(ID, VALUE);
55
65
  VALUE rb_gvar_defined(ID);
56
66
  void rb_const_warn_if_deprecated(const rb_const_entry_t *, VALUE, ID);
57
- rb_shape_t * rb_grow_iv_list(VALUE obj);
58
67
  void rb_ensure_iv_list_size(VALUE obj, uint32_t len, uint32_t newsize);
59
- struct gen_ivtbl *rb_ensure_generic_iv_list_size(VALUE obj, rb_shape_t *shape, uint32_t newsize);
60
68
  attr_index_t rb_obj_ivar_set(VALUE obj, ID id, VALUE val);
61
69
 
62
- static inline bool
63
- ROBJ_TRANSIENT_P(VALUE obj)
64
- {
65
- #if USE_TRANSIENT_HEAP
66
- return FL_TEST_RAW(obj, ROBJECT_TRANSIENT_FLAG);
67
- #else
68
- return false;
69
- #endif
70
- }
71
-
72
- static inline void
73
- ROBJ_TRANSIENT_SET(VALUE obj)
74
- {
75
- #if USE_TRANSIENT_HEAP
76
- FL_SET_RAW(obj, ROBJECT_TRANSIENT_FLAG);
77
- #endif
78
- }
79
-
80
- static inline void
81
- ROBJ_TRANSIENT_UNSET(VALUE obj)
82
- {
83
- #if USE_TRANSIENT_HEAP
84
- FL_UNSET_RAW(obj, ROBJECT_TRANSIENT_FLAG);
85
- #endif
86
- }
87
-
88
70
  #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);
@@ -76,6 +78,11 @@ VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv,
76
78
  VALUE data2);
77
79
  void rb_check_stack_overflow(void);
78
80
 
81
+ #if USE_YJIT
82
+ /* vm_exec.c */
83
+ extern uint64_t rb_vm_insns_count;
84
+ #endif
85
+
79
86
  /* vm_insnhelper.c */
80
87
  VALUE rb_equal_opt(VALUE obj1, VALUE obj2);
81
88
  VALUE rb_eql_opt(VALUE obj1, VALUE obj2);
@@ -90,7 +97,7 @@ int rb_ec_obj_respond_to(struct rb_execution_context_struct *ec, VALUE obj, ID i
90
97
  void rb_clear_constant_cache(void);
91
98
 
92
99
  /* vm_dump.c */
93
- void rb_print_backtrace(void);
100
+ void rb_print_backtrace(FILE *);
94
101
 
95
102
  /* vm_backtrace.c */
96
103
  VALUE rb_vm_thread_backtrace(int argc, const VALUE *argv, VALUE thval);
@@ -98,7 +105,7 @@ VALUE rb_vm_thread_backtrace_locations(int argc, const VALUE *argv, VALUE thval)
98
105
  VALUE rb_vm_backtrace(int argc, const VALUE * argv, struct rb_execution_context_struct * ec);
99
106
  VALUE rb_vm_backtrace_locations(int argc, const VALUE * argv, struct rb_execution_context_struct * ec);
100
107
  VALUE rb_make_backtrace(void);
101
- void rb_backtrace_print_as_bugreport(void);
108
+ void rb_backtrace_print_as_bugreport(FILE*);
102
109
  int rb_backtrace_p(VALUE obj);
103
110
  VALUE rb_backtrace_to_str_ary(VALUE obj);
104
111
  VALUE rb_backtrace_to_location_ary(VALUE obj);
@@ -83,9 +83,10 @@ ISEQ_ORIGINAL_ISEQ_ALLOC(const rb_iseq_t *iseq, long size)
83
83
  RUBY_EVENT_CALL | \
84
84
  RUBY_EVENT_RETURN| \
85
85
  RUBY_EVENT_C_CALL| \
86
- RUBY_EVENT_C_RETURN| \
87
- RUBY_EVENT_B_CALL| \
88
- RUBY_EVENT_B_RETURN| \
86
+ RUBY_EVENT_C_RETURN | \
87
+ RUBY_EVENT_B_CALL | \
88
+ RUBY_EVENT_B_RETURN | \
89
+ RUBY_EVENT_RESCUE | \
89
90
  RUBY_EVENT_COVERAGE_LINE| \
90
91
  RUBY_EVENT_COVERAGE_BRANCH)
91
92
 
@@ -226,7 +227,6 @@ struct rb_compile_option_struct {
226
227
  unsigned int specialized_instruction: 1;
227
228
  unsigned int operands_unification: 1;
228
229
  unsigned int instructions_unification: 1;
229
- unsigned int stack_caching: 1;
230
230
  unsigned int frozen_string_literal: 1;
231
231
  unsigned int debug_frozen_string_literal: 1;
232
232
  unsigned int coverage_enabled: 1;
@@ -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 {
@@ -178,9 +179,9 @@ typedef struct rb_method_optimized {
178
179
  struct rb_method_definition_struct {
179
180
  BITFIELD(rb_method_type_t, type, VM_METHOD_TYPE_MINIMUM_BITS);
180
181
  unsigned int iseq_overload: 1;
181
- int alias_count : 27;
182
- int complemented_count : 28;
183
182
  unsigned int no_redef_warning: 1;
183
+ unsigned int aliased : 1;
184
+ int reference_count : 28;
184
185
 
185
186
  union {
186
187
  rb_method_iseq_t iseq;
@@ -199,7 +200,7 @@ struct rb_method_definition_struct {
199
200
  struct rb_id_table;
200
201
 
201
202
  typedef struct rb_method_definition_struct rb_method_definition_t;
202
- STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body)==8);
203
+ STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body) <= 8);
203
204
 
204
205
  #define UNDEFINED_METHOD_ENTRY_P(me) (!(me) || !(me)->def || (me)->def->type == VM_METHOD_TYPE_UNDEF)
205
206
  #define UNDEFINED_REFINED_METHOD_P(def) \
@@ -213,7 +214,7 @@ void rb_add_method_optimized(VALUE klass, ID mid, enum method_optimized_type, un
213
214
  void rb_add_refined_method_entry(VALUE refined_class, ID mid);
214
215
 
215
216
  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);
217
+ rb_method_entry_t *rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, rb_method_definition_t *def);
217
218
 
218
219
  const rb_method_entry_t *rb_method_entry_at(VALUE obj, ID id);
219
220
 
@@ -249,6 +250,6 @@ void rb_scope_visibility_set(rb_method_visibility_t);
249
250
  VALUE rb_unnamed_parameters(int arity);
250
251
 
251
252
  void rb_clear_method_cache(VALUE klass_or_module, ID mid);
252
- void rb_clear_method_cache_all(void);
253
+ void rb_clear_all_refinement_method_cache(void);
253
254
 
254
255
  #endif /* RUBY_METHOD_H */
@@ -0,0 +1,128 @@
1
+ #ifndef RUBY_NODE_H
2
+ #define RUBY_NODE_H 1
3
+ /**********************************************************************
4
+
5
+ node.h -
6
+
7
+ $Author$
8
+ created at: Fri May 28 15:14:02 JST 1993
9
+
10
+ Copyright (C) 1993-2007 Yukihiro Matsumoto
11
+
12
+ **********************************************************************/
13
+
14
+ #include <stdbool.h>
15
+ #include "rubyparser.h"
16
+ #include "ruby/backward/2/attributes.h"
17
+
18
+ typedef void (*bug_report_func)(const char *fmt, ...);
19
+
20
+ typedef struct node_buffer_elem_struct {
21
+ struct node_buffer_elem_struct *next;
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];
27
+ } node_buffer_elem_t;
28
+
29
+ typedef struct {
30
+ node_buffer_elem_t *head;
31
+ node_buffer_elem_t *last;
32
+ } node_buffer_list_t;
33
+
34
+ struct node_buffer_struct {
35
+ node_buffer_list_t unmarkable;
36
+ node_buffer_list_t markable;
37
+ struct rb_ast_local_table_link *local_tables;
38
+ VALUE mark_hash;
39
+ // - id (sequence number)
40
+ // - token_type
41
+ // - text of token
42
+ // - location info
43
+ // Array, whose entry is array
44
+ VALUE tokens;
45
+ #ifdef UNIVERSAL_PARSER
46
+ rb_parser_config_t *config;
47
+ #endif
48
+ };
49
+
50
+ RUBY_SYMBOL_EXPORT_BEGIN
51
+
52
+ #ifdef UNIVERSAL_PARSER
53
+ rb_ast_t *rb_ast_new(rb_parser_config_t *config);
54
+ #else
55
+ rb_ast_t *rb_ast_new(void);
56
+ #endif
57
+ size_t rb_ast_memsize(const rb_ast_t*);
58
+ void rb_ast_dispose(rb_ast_t*);
59
+ VALUE rb_ast_tokens(rb_ast_t *ast);
60
+ #if RUBY_DEBUG
61
+ void rb_ast_node_type_change(NODE *n, enum node_type type);
62
+ #endif
63
+ const char *ruby_node_name(int node);
64
+ void rb_node_init(NODE *n, enum node_type type);
65
+
66
+ void rb_ast_mark(rb_ast_t*);
67
+ void rb_ast_update_references(rb_ast_t*);
68
+ void rb_ast_free(rb_ast_t*);
69
+ void rb_ast_add_mark_object(rb_ast_t*, VALUE);
70
+ void rb_ast_delete_mark_object(rb_ast_t*, VALUE);
71
+ void rb_ast_set_tokens(rb_ast_t*, VALUE);
72
+ NODE *rb_ast_newnode(rb_ast_t*, enum node_type type, size_t size, size_t alignment);
73
+ void rb_ast_delete_node(rb_ast_t*, NODE *n);
74
+ rb_ast_id_table_t *rb_ast_new_local_table(rb_ast_t*, int);
75
+ rb_ast_id_table_t *rb_ast_resize_latest_local_table(rb_ast_t*, int);
76
+
77
+ VALUE rb_parser_dump_tree(const NODE *node, int comment);
78
+
79
+ const struct kwtable *rb_reserved_word(const char *, unsigned int);
80
+
81
+ struct parser_params;
82
+ void *rb_parser_malloc(struct parser_params *, size_t);
83
+ void *rb_parser_realloc(struct parser_params *, void *, size_t);
84
+ void *rb_parser_calloc(struct parser_params *, size_t, size_t);
85
+ void rb_parser_free(struct parser_params *, void *);
86
+ PRINTF_ARGS(void rb_parser_printf(struct parser_params *parser, const char *fmt, ...), 2, 3);
87
+ VALUE rb_node_set_type(NODE *n, enum node_type t);
88
+
89
+ RUBY_SYMBOL_EXPORT_END
90
+
91
+ #define NODE_LSHIFT (NODE_TYPESHIFT+7)
92
+ #define NODE_LMASK (((SIGNED_VALUE)1<<(sizeof(VALUE)*CHAR_BIT-NODE_LSHIFT))-1)
93
+
94
+ #define nd_line(n) (int)(((SIGNED_VALUE)(n)->flags)>>NODE_LSHIFT)
95
+ #define nd_set_line(n,l) \
96
+ (n)->flags=(((n)->flags&~((VALUE)(-1)<<NODE_LSHIFT))|((VALUE)((l)&NODE_LMASK)<<NODE_LSHIFT))
97
+
98
+
99
+ #define NODE_SPECIAL_REQUIRED_KEYWORD ((NODE *)-1)
100
+ #define NODE_REQUIRED_KEYWORD_P(node) ((node) == NODE_SPECIAL_REQUIRED_KEYWORD)
101
+ #define NODE_SPECIAL_NO_NAME_REST ((NODE *)-1)
102
+ #define NODE_NAMED_REST_P(node) ((node) != NODE_SPECIAL_NO_NAME_REST)
103
+ #define NODE_SPECIAL_EXCESSIVE_COMMA ((ID)1)
104
+ #define NODE_SPECIAL_NO_REST_KEYWORD ((NODE *)-1)
105
+
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)
111
+ #define nd_set_first_loc(n, v) (nd_first_loc(n) = (v))
112
+
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)
118
+ #define nd_set_last_loc(n, v) (nd_last_loc(n) = (v))
119
+ #define nd_node_id(n) (RNODE(n)->node_id)
120
+ #define nd_set_node_id(n,id) (RNODE(n)->node_id = (id))
121
+
122
+ static inline bool
123
+ nd_type_p(const NODE *n, enum node_type t)
124
+ {
125
+ return (enum node_type)nd_type(n) == t;
126
+ }
127
+
128
+ #endif /* RUBY_NODE_H */
@@ -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";
@@ -1,4 +1,4 @@
1
- /* A Bison parser, made by GNU Bison 3.8.2. */
1
+ /* A Bison parser, made by Lrama 0.5.9. */
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
- #ifndef YY_YY__Y_TAB_H_INCLUDED
39
- # define YY_YY__Y_TAB_H_INCLUDED
37
+ #ifndef YY_YY_PARSE_H_INCLUDED
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,9 +190,19 @@ extern int yydebug;
190
190
  #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
191
191
  union YYSTYPE
192
192
  {
193
+ #line 1947 "parse.y"
193
194
 
194
195
  VALUE val;
195
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;
196
206
  ID id;
197
207
  int num;
198
208
  st_table *tbl;
@@ -200,6 +210,7 @@ union YYSTYPE
200
210
  struct rb_strterm_struct *strterm;
201
211
  struct lex_context ctxt;
202
212
 
213
+ #line 214 "parse.h"
203
214
 
204
215
  };
205
216
  typedef union YYSTYPE YYSTYPE;
@@ -227,4 +238,6 @@ struct YYLTYPE
227
238
  int yyparse (struct parser_params *p);
228
239
 
229
240
 
230
- #endif /* !YY_YY__Y_TAB_H_INCLUDED */
241
+
242
+ #endif /* !YY_YY_PARSE_H_INCLUDED */
243
+
@@ -1,5 +1,5 @@
1
- #ifndef INTERNAL_BITS_H /*-*-C-*-vi:se ft=c:*/
2
- #define INTERNAL_BITS_H
1
+ #ifndef INTERNAL_BITS2_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_BITS2_H
3
3
  /**
4
4
  * @author Ruby developers <ruby-core@ruby-lang.org>
5
5
  * @copyright This file is a part of the programming language Ruby.
@@ -68,7 +68,7 @@
68
68
  # endif
69
69
  #endif
70
70
 
71
- #include "ruby/ruby.h" /* for VALUE */
71
+ #include "parser_value.h" /* for VALUE */
72
72
  #include "internal/static_assert.h" /* for STATIC_ASSERT */
73
73
 
74
74
  /* The most significant bit of the lower part of half-long integer.
@@ -561,4 +561,4 @@ RUBY_BIT_ROTR(VALUE v, int n)
561
561
  #endif
562
562
  }
563
563
 
564
- #endif /* INTERNAL_BITS_H */
564
+ #endif /* INTERNAL_BITS2_H */
@@ -0,0 +1,32 @@
1
+ #ifndef RUBY_PARSER_NODE_H
2
+ #define RUBY_PARSER_NODE_H 1
3
+ /*
4
+ * This is a header file used by only "parse.y"
5
+ */
6
+ #include "rubyparser.h"
7
+ #include "internal/compilers.h"
8
+
9
+ #if defined(__cplusplus)
10
+ extern "C" {
11
+ #if 0
12
+ } /* satisfy cc-mode */
13
+ #endif
14
+ #endif
15
+
16
+ static inline rb_code_location_t
17
+ code_loc_gen(const rb_code_location_t *loc1, const rb_code_location_t *loc2)
18
+ {
19
+ rb_code_location_t loc;
20
+ loc.beg_pos = loc1->beg_pos;
21
+ loc.end_pos = loc2->end_pos;
22
+ return loc;
23
+ }
24
+
25
+ #if defined(__cplusplus)
26
+ #if 0
27
+ { /* satisfy cc-mode */
28
+ #endif
29
+ } /* extern "C" { */
30
+ #endif
31
+
32
+ #endif /* RUBY_PARSER_NODE_H */