debase-ruby_core_source 3.4.1 → 4.0.0.preview2

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 (149) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/addr2line.h +22 -0
  4. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/builtin.h +125 -0
  5. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ccan/build_assert/build_assert.h +40 -0
  6. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ccan/check_type/check_type.h +63 -0
  7. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ccan/container_of/container_of.h +142 -0
  8. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ccan/list/list.h +791 -0
  9. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ccan/str/str.h +17 -0
  10. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/constant.h +53 -0
  11. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/darray.h +278 -0
  12. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/debug_counter.h +425 -0
  13. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/dln.h +33 -0
  14. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/encindex.h +70 -0
  15. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/eval_intern.h +331 -0
  16. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/hrtime.h +237 -0
  17. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/id.h +354 -0
  18. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/id_table.h +54 -0
  19. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/insns.inc +302 -0
  20. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/insns_info.inc +11241 -0
  21. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/array.h +154 -0
  22. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/basic_operators.h +65 -0
  23. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/bignum.h +245 -0
  24. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/bits.h +650 -0
  25. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/box.h +81 -0
  26. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/class.h +805 -0
  27. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/cmdlineopt.h +64 -0
  28. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/compar.h +29 -0
  29. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/compile.h +34 -0
  30. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/compilers.h +107 -0
  31. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/complex.h +29 -0
  32. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/concurrent_set.h +21 -0
  33. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/cont.h +35 -0
  34. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/dir.h +16 -0
  35. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/enc.h +19 -0
  36. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/encoding.h +39 -0
  37. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/enum.h +18 -0
  38. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/enumerator.h +21 -0
  39. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/error.h +251 -0
  40. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/eval.h +41 -0
  41. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/file.h +38 -0
  42. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/fixnum.h +185 -0
  43. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/gc.h +358 -0
  44. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/hash.h +194 -0
  45. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/imemo.h +322 -0
  46. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/inits.h +51 -0
  47. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/io.h +163 -0
  48. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/load.h +20 -0
  49. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/loadpath.h +16 -0
  50. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/math.h +23 -0
  51. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/missing.h +19 -0
  52. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/numeric.h +275 -0
  53. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/object.h +63 -0
  54. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/parse.h +131 -0
  55. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/proc.h +30 -0
  56. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/process.h +124 -0
  57. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/ractor.h +10 -0
  58. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/random.h +17 -0
  59. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/range.h +40 -0
  60. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/rational.h +71 -0
  61. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/re.h +33 -0
  62. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/ruby_parser.h +102 -0
  63. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/sanitizers.h +346 -0
  64. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/serial.h +23 -0
  65. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/set_table.h +70 -0
  66. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/signal.h +25 -0
  67. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/st.h +11 -0
  68. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/static_assert.h +16 -0
  69. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/string.h +203 -0
  70. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/struct.h +160 -0
  71. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/symbol.h +46 -0
  72. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/thread.h +112 -0
  73. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/time.h +37 -0
  74. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/transcode.h +23 -0
  75. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/util.h +27 -0
  76. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/variable.h +74 -0
  77. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/vm.h +136 -0
  78. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/warnings.h +16 -0
  79. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal.h +105 -0
  80. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/iseq.h +357 -0
  81. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/known_errors.inc +1419 -0
  82. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/method.h +271 -0
  83. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/node.h +122 -0
  84. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/node_name.inc +224 -0
  85. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/optinsn.inc +128 -0
  86. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/optunifs.inc +41 -0
  87. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/parse.h +244 -0
  88. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/parser_bits.h +564 -0
  89. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/parser_node.h +32 -0
  90. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/parser_st.h +162 -0
  91. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/parser_value.h +106 -0
  92. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/ast.h +8233 -0
  93. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/defines.h +260 -0
  94. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/diagnostic.h +458 -0
  95. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/encoding.h +283 -0
  96. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/extension.h +19 -0
  97. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/node.h +129 -0
  98. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/options.h +485 -0
  99. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/pack.h +163 -0
  100. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/parser.h +936 -0
  101. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/prettyprint.h +34 -0
  102. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/prism.h +408 -0
  103. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/regexp.h +43 -0
  104. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/static_literals.h +121 -0
  105. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_buffer.h +236 -0
  106. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_char.h +204 -0
  107. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_constant_pool.h +218 -0
  108. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_integer.h +130 -0
  109. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_list.h +103 -0
  110. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_memchr.h +29 -0
  111. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_newline_list.h +113 -0
  112. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_string.h +200 -0
  113. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_strncasecmp.h +32 -0
  114. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_strpbrk.h +46 -0
  115. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/version.h +29 -0
  116. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism_compile.h +106 -0
  117. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/probes_helper.h +42 -0
  118. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ractor_core.h +306 -0
  119. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/regenc.h +259 -0
  120. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/regint.h +1005 -0
  121. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/regparse.h +371 -0
  122. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/revision.h +5 -0
  123. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ruby_assert.h +14 -0
  124. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ruby_atomic.h +66 -0
  125. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/rubyparser.h +1394 -0
  126. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/shape.h +444 -0
  127. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/siphash.h +48 -0
  128. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/symbol.h +116 -0
  129. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/thread_none.h +21 -0
  130. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/thread_pthread.h +175 -0
  131. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/thread_win32.h +58 -0
  132. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/timev.h +58 -0
  133. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/transcode_data.h +138 -0
  134. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/variable.h +27 -0
  135. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/version.h +69 -0
  136. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm.inc +6183 -0
  137. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_call_iseq_optimized.inc +244 -0
  138. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_callinfo.h +640 -0
  139. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_core.h +2350 -0
  140. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_debug.h +124 -0
  141. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_exec.h +210 -0
  142. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_insnhelper.h +277 -0
  143. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_opts.h +67 -0
  144. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_sync.h +156 -0
  145. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vmtc.inc +289 -0
  146. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/yjit.h +81 -0
  147. data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/zjit.h +47 -0
  148. data/lib/debase/ruby_core_source/version.rb +1 -1
  149. metadata +148 -3
@@ -0,0 +1,156 @@
1
+ #ifndef RUBY_VM_SYNC_H
2
+ #define RUBY_VM_SYNC_H
3
+
4
+ #include "vm_debug.h"
5
+ #include "debug_counter.h"
6
+
7
+ #if USE_RUBY_DEBUG_LOG
8
+ #define LOCATION_ARGS const char *file, int line
9
+ #define LOCATION_PARAMS file, line
10
+ #define APPEND_LOCATION_ARGS , const char *file, int line
11
+ #define APPEND_LOCATION_PARAMS , file, line
12
+ #else
13
+ #define LOCATION_ARGS void
14
+ #define LOCATION_PARAMS
15
+ #define APPEND_LOCATION_ARGS
16
+ #define APPEND_LOCATION_PARAMS
17
+ #endif
18
+
19
+ bool rb_vm_locked_p(void);
20
+ void rb_vm_lock_body(LOCATION_ARGS);
21
+ void rb_vm_unlock_body(LOCATION_ARGS);
22
+
23
+ struct rb_ractor_struct;
24
+ NOINLINE(void rb_vm_lock_enter_body_cr(struct rb_ractor_struct *cr, unsigned int *lev APPEND_LOCATION_ARGS));
25
+ NOINLINE(void rb_vm_lock_enter_body_nb(unsigned int *lev APPEND_LOCATION_ARGS));
26
+ NOINLINE(void rb_vm_lock_enter_body(unsigned int *lev APPEND_LOCATION_ARGS));
27
+ void rb_vm_lock_leave_body_nb(unsigned int *lev APPEND_LOCATION_ARGS);
28
+ void rb_vm_lock_leave_body(unsigned int *lev APPEND_LOCATION_ARGS);
29
+ void rb_vm_barrier(void);
30
+
31
+ #if RUBY_DEBUG
32
+ // GET_VM()
33
+ #include "vm_core.h"
34
+ #endif
35
+
36
+ RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c
37
+
38
+ static inline bool
39
+ rb_multi_ractor_p(void)
40
+ {
41
+ if (LIKELY(ruby_single_main_ractor)) {
42
+ // 0 on boot time.
43
+ RUBY_ASSERT(GET_VM()->ractor.cnt <= 1);
44
+ return false;
45
+ }
46
+ else {
47
+ // multi-ractor mode can run ractor.cnt == 1
48
+ return true;
49
+ }
50
+ }
51
+
52
+ static inline void
53
+ rb_vm_lock(const char *file, int line)
54
+ {
55
+ RB_DEBUG_COUNTER_INC(vm_sync_lock);
56
+
57
+ if (rb_multi_ractor_p()) {
58
+ rb_vm_lock_body(LOCATION_PARAMS);
59
+ }
60
+ }
61
+
62
+ static inline void
63
+ rb_vm_unlock(const char *file, int line)
64
+ {
65
+ if (rb_multi_ractor_p()) {
66
+ rb_vm_unlock_body(LOCATION_PARAMS);
67
+ }
68
+ }
69
+
70
+ static inline void
71
+ rb_vm_lock_enter(unsigned int *lev, const char *file, int line)
72
+ {
73
+ RB_DEBUG_COUNTER_INC(vm_sync_lock_enter);
74
+
75
+ if (rb_multi_ractor_p()) {
76
+ rb_vm_lock_enter_body(lev APPEND_LOCATION_PARAMS);
77
+ }
78
+ }
79
+
80
+ static inline void
81
+ rb_vm_lock_enter_nb(unsigned int *lev, const char *file, int line)
82
+ {
83
+ RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_nb);
84
+
85
+ if (rb_multi_ractor_p()) {
86
+ rb_vm_lock_enter_body_nb(lev APPEND_LOCATION_PARAMS);
87
+ }
88
+ }
89
+
90
+ static inline void
91
+ rb_vm_lock_leave_nb(unsigned int *lev, const char *file, int line)
92
+ {
93
+ if (rb_multi_ractor_p()) {
94
+ rb_vm_lock_leave_body_nb(lev APPEND_LOCATION_PARAMS);
95
+ }
96
+ }
97
+
98
+ static inline void
99
+ rb_vm_lock_leave(unsigned int *lev, const char *file, int line)
100
+ {
101
+ if (rb_multi_ractor_p()) {
102
+ rb_vm_lock_leave_body(lev APPEND_LOCATION_PARAMS);
103
+ }
104
+ }
105
+
106
+ static inline void
107
+ rb_vm_lock_enter_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
108
+ {
109
+ RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_cr);
110
+ rb_vm_lock_enter_body_cr(cr, levp APPEND_LOCATION_PARAMS);
111
+ }
112
+
113
+ static inline void
114
+ rb_vm_lock_leave_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
115
+ {
116
+ rb_vm_lock_leave_body(levp APPEND_LOCATION_PARAMS);
117
+ }
118
+
119
+ #define RB_VM_LOCKED_P() rb_vm_locked_p()
120
+
121
+ #define RB_VM_LOCK() rb_vm_lock(__FILE__, __LINE__)
122
+ #define RB_VM_UNLOCK() rb_vm_unlock(__FILE__, __LINE__)
123
+
124
+ #define RB_VM_LOCK_ENTER_CR_LEV(cr, levp) rb_vm_lock_enter_cr(cr, levp, __FILE__, __LINE__)
125
+ #define RB_VM_LOCK_LEAVE_CR_LEV(cr, levp) rb_vm_lock_leave_cr(cr, levp, __FILE__, __LINE__)
126
+ #define RB_VM_LOCK_ENTER_LEV(levp) rb_vm_lock_enter(levp, __FILE__, __LINE__)
127
+ #define RB_VM_LOCK_LEAVE_LEV(levp) rb_vm_lock_leave(levp, __FILE__, __LINE__)
128
+
129
+ #define RB_VM_LOCK_ENTER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV(&_lev);
130
+ #define RB_VM_LOCK_LEAVE() RB_VM_LOCK_LEAVE_LEV(&_lev); }
131
+ #define RB_VM_LOCKING() \
132
+ for (unsigned int vm_locking_level, vm_locking_do = (RB_VM_LOCK_ENTER_LEV(&vm_locking_level), 1); \
133
+ vm_locking_do; RB_VM_LOCK_LEAVE_LEV(&vm_locking_level), vm_locking_do = 0)
134
+
135
+ #define RB_VM_LOCK_ENTER_LEV_NB(levp) rb_vm_lock_enter_nb(levp, __FILE__, __LINE__)
136
+ #define RB_VM_LOCK_LEAVE_LEV_NB(levp) rb_vm_lock_leave_nb(levp, __FILE__, __LINE__)
137
+ #define RB_VM_LOCK_ENTER_NO_BARRIER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV_NB(&_lev);
138
+ #define RB_VM_LOCK_LEAVE_NO_BARRIER() RB_VM_LOCK_LEAVE_LEV_NB(&_lev); }
139
+ #define RB_VM_LOCKING_NO_BARRIER() \
140
+ for (unsigned int vm_locking_level, vm_locking_do = (RB_VM_LOCK_ENTER_LEV_NB(&vm_locking_level), 1); \
141
+ vm_locking_do; RB_VM_LOCK_LEAVE_LEV_NB(&vm_locking_level), vm_locking_do = 0)
142
+
143
+ #if RUBY_DEBUG > 0
144
+ void RUBY_ASSERT_vm_locking(void);
145
+ void RUBY_ASSERT_vm_locking_with_barrier(void);
146
+ void RUBY_ASSERT_vm_unlocking(void);
147
+ #define ASSERT_vm_locking() RUBY_ASSERT_vm_locking()
148
+ #define ASSERT_vm_locking_with_barrier() RUBY_ASSERT_vm_locking_with_barrier()
149
+ #define ASSERT_vm_unlocking() RUBY_ASSERT_vm_unlocking()
150
+ #else
151
+ #define ASSERT_vm_locking()
152
+ #define ASSERT_vm_locking_with_barrier()
153
+ #define ASSERT_vm_unlocking()
154
+ #endif
155
+
156
+ #endif // RUBY_VM_SYNC_H
@@ -0,0 +1,289 @@
1
+ /* -*- C -*- */
2
+
3
+ /* This is an auto-generated file and is a part of the programming language
4
+ * Ruby. The person who created a program to generate this file (``I''
5
+ * hereafter) would like to refrain from defining licensing of this generated
6
+ * source code.
7
+ *
8
+ * This file consists of many small parts of codes copyrighted by each author,
9
+ * not only the ``I'' person. Those original authors agree with some
10
+ * open-source license. I believe that the license we agree is the condition
11
+ * mentioned in the file COPYING. It states "4. You may modify and include
12
+ * the part of the software into any other software ...". But the problem is,
13
+ * the license never makes it clear if such modified parts still remain in the
14
+ * same license, or not. The fact that we agree with the source code's
15
+ * licensing terms does not automatically define that of generated ones. This
16
+ * is the reason why this file is under an unclear situation. All what I know
17
+ * is that above provision guarantees this file to exist.
18
+ *
19
+ * Please let me hesitate to declare something about this nuanced contract. I
20
+ * am not in the position to take over other authors' license to merge into my
21
+ * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday
22
+ * it might turn out to be okay to say this file is under a license. I wish
23
+ * the situation would become more clear in the future. */
24
+ /*******************************************************************/
25
+ /*******************************************************************/
26
+ /*******************************************************************/
27
+ /**
28
+ This file is for threaded code.
29
+
30
+ ----
31
+ This file is auto generated by insns2vm.rb
32
+ DO NOT TOUCH!
33
+
34
+ If you want to fix something, you must edit "tool/ruby_vm/views/vmtc.inc.erb"
35
+ or tool/insns2vm.rb
36
+ */
37
+
38
+ static const void *const insns_address_table[] = {
39
+ LABEL_PTR(nop),
40
+ LABEL_PTR(getlocal),
41
+ LABEL_PTR(setlocal),
42
+ LABEL_PTR(getblockparam),
43
+ LABEL_PTR(setblockparam),
44
+ LABEL_PTR(getblockparamproxy),
45
+ LABEL_PTR(getspecial),
46
+ LABEL_PTR(setspecial),
47
+ LABEL_PTR(getinstancevariable),
48
+ LABEL_PTR(setinstancevariable),
49
+ LABEL_PTR(getclassvariable),
50
+ LABEL_PTR(setclassvariable),
51
+ LABEL_PTR(opt_getconstant_path),
52
+ LABEL_PTR(getconstant),
53
+ LABEL_PTR(setconstant),
54
+ LABEL_PTR(getglobal),
55
+ LABEL_PTR(setglobal),
56
+ LABEL_PTR(putnil),
57
+ LABEL_PTR(putself),
58
+ LABEL_PTR(putobject),
59
+ LABEL_PTR(putspecialobject),
60
+ LABEL_PTR(putstring),
61
+ LABEL_PTR(putchilledstring),
62
+ LABEL_PTR(concatstrings),
63
+ LABEL_PTR(anytostring),
64
+ LABEL_PTR(toregexp),
65
+ LABEL_PTR(intern),
66
+ LABEL_PTR(newarray),
67
+ LABEL_PTR(pushtoarraykwsplat),
68
+ LABEL_PTR(duparray),
69
+ LABEL_PTR(duphash),
70
+ LABEL_PTR(expandarray),
71
+ LABEL_PTR(concatarray),
72
+ LABEL_PTR(concattoarray),
73
+ LABEL_PTR(pushtoarray),
74
+ LABEL_PTR(splatarray),
75
+ LABEL_PTR(splatkw),
76
+ LABEL_PTR(newhash),
77
+ LABEL_PTR(newrange),
78
+ LABEL_PTR(pop),
79
+ LABEL_PTR(dup),
80
+ LABEL_PTR(dupn),
81
+ LABEL_PTR(swap),
82
+ LABEL_PTR(opt_reverse),
83
+ LABEL_PTR(topn),
84
+ LABEL_PTR(setn),
85
+ LABEL_PTR(adjuststack),
86
+ LABEL_PTR(defined),
87
+ LABEL_PTR(definedivar),
88
+ LABEL_PTR(checkmatch),
89
+ LABEL_PTR(checkkeyword),
90
+ LABEL_PTR(checktype),
91
+ LABEL_PTR(defineclass),
92
+ LABEL_PTR(definemethod),
93
+ LABEL_PTR(definesmethod),
94
+ LABEL_PTR(send),
95
+ LABEL_PTR(sendforward),
96
+ LABEL_PTR(opt_send_without_block),
97
+ LABEL_PTR(opt_new),
98
+ LABEL_PTR(objtostring),
99
+ LABEL_PTR(opt_ary_freeze),
100
+ LABEL_PTR(opt_hash_freeze),
101
+ LABEL_PTR(opt_str_freeze),
102
+ LABEL_PTR(opt_nil_p),
103
+ LABEL_PTR(opt_str_uminus),
104
+ LABEL_PTR(opt_duparray_send),
105
+ LABEL_PTR(opt_newarray_send),
106
+ LABEL_PTR(invokesuper),
107
+ LABEL_PTR(invokesuperforward),
108
+ LABEL_PTR(invokeblock),
109
+ LABEL_PTR(leave),
110
+ LABEL_PTR(throw),
111
+ LABEL_PTR(jump),
112
+ LABEL_PTR(branchif),
113
+ LABEL_PTR(branchunless),
114
+ LABEL_PTR(branchnil),
115
+ LABEL_PTR(once),
116
+ LABEL_PTR(opt_case_dispatch),
117
+ LABEL_PTR(opt_plus),
118
+ LABEL_PTR(opt_minus),
119
+ LABEL_PTR(opt_mult),
120
+ LABEL_PTR(opt_div),
121
+ LABEL_PTR(opt_mod),
122
+ LABEL_PTR(opt_eq),
123
+ LABEL_PTR(opt_neq),
124
+ LABEL_PTR(opt_lt),
125
+ LABEL_PTR(opt_le),
126
+ LABEL_PTR(opt_gt),
127
+ LABEL_PTR(opt_ge),
128
+ LABEL_PTR(opt_ltlt),
129
+ LABEL_PTR(opt_and),
130
+ LABEL_PTR(opt_or),
131
+ LABEL_PTR(opt_aref),
132
+ LABEL_PTR(opt_aset),
133
+ LABEL_PTR(opt_length),
134
+ LABEL_PTR(opt_size),
135
+ LABEL_PTR(opt_empty_p),
136
+ LABEL_PTR(opt_succ),
137
+ LABEL_PTR(opt_not),
138
+ LABEL_PTR(opt_regexpmatch2),
139
+ LABEL_PTR(invokebuiltin),
140
+ LABEL_PTR(opt_invokebuiltin_delegate),
141
+ LABEL_PTR(opt_invokebuiltin_delegate_leave),
142
+ LABEL_PTR(getlocal_WC_0),
143
+ LABEL_PTR(getlocal_WC_1),
144
+ LABEL_PTR(setlocal_WC_0),
145
+ LABEL_PTR(setlocal_WC_1),
146
+ LABEL_PTR(putobject_INT2FIX_0_),
147
+ LABEL_PTR(putobject_INT2FIX_1_),
148
+ LABEL_PTR(trace_nop),
149
+ LABEL_PTR(trace_getlocal),
150
+ LABEL_PTR(trace_setlocal),
151
+ LABEL_PTR(trace_getblockparam),
152
+ LABEL_PTR(trace_setblockparam),
153
+ LABEL_PTR(trace_getblockparamproxy),
154
+ LABEL_PTR(trace_getspecial),
155
+ LABEL_PTR(trace_setspecial),
156
+ LABEL_PTR(trace_getinstancevariable),
157
+ LABEL_PTR(trace_setinstancevariable),
158
+ LABEL_PTR(trace_getclassvariable),
159
+ LABEL_PTR(trace_setclassvariable),
160
+ LABEL_PTR(trace_opt_getconstant_path),
161
+ LABEL_PTR(trace_getconstant),
162
+ LABEL_PTR(trace_setconstant),
163
+ LABEL_PTR(trace_getglobal),
164
+ LABEL_PTR(trace_setglobal),
165
+ LABEL_PTR(trace_putnil),
166
+ LABEL_PTR(trace_putself),
167
+ LABEL_PTR(trace_putobject),
168
+ LABEL_PTR(trace_putspecialobject),
169
+ LABEL_PTR(trace_putstring),
170
+ LABEL_PTR(trace_putchilledstring),
171
+ LABEL_PTR(trace_concatstrings),
172
+ LABEL_PTR(trace_anytostring),
173
+ LABEL_PTR(trace_toregexp),
174
+ LABEL_PTR(trace_intern),
175
+ LABEL_PTR(trace_newarray),
176
+ LABEL_PTR(trace_pushtoarraykwsplat),
177
+ LABEL_PTR(trace_duparray),
178
+ LABEL_PTR(trace_duphash),
179
+ LABEL_PTR(trace_expandarray),
180
+ LABEL_PTR(trace_concatarray),
181
+ LABEL_PTR(trace_concattoarray),
182
+ LABEL_PTR(trace_pushtoarray),
183
+ LABEL_PTR(trace_splatarray),
184
+ LABEL_PTR(trace_splatkw),
185
+ LABEL_PTR(trace_newhash),
186
+ LABEL_PTR(trace_newrange),
187
+ LABEL_PTR(trace_pop),
188
+ LABEL_PTR(trace_dup),
189
+ LABEL_PTR(trace_dupn),
190
+ LABEL_PTR(trace_swap),
191
+ LABEL_PTR(trace_opt_reverse),
192
+ LABEL_PTR(trace_topn),
193
+ LABEL_PTR(trace_setn),
194
+ LABEL_PTR(trace_adjuststack),
195
+ LABEL_PTR(trace_defined),
196
+ LABEL_PTR(trace_definedivar),
197
+ LABEL_PTR(trace_checkmatch),
198
+ LABEL_PTR(trace_checkkeyword),
199
+ LABEL_PTR(trace_checktype),
200
+ LABEL_PTR(trace_defineclass),
201
+ LABEL_PTR(trace_definemethod),
202
+ LABEL_PTR(trace_definesmethod),
203
+ LABEL_PTR(trace_send),
204
+ LABEL_PTR(trace_sendforward),
205
+ LABEL_PTR(trace_opt_send_without_block),
206
+ LABEL_PTR(trace_opt_new),
207
+ LABEL_PTR(trace_objtostring),
208
+ LABEL_PTR(trace_opt_ary_freeze),
209
+ LABEL_PTR(trace_opt_hash_freeze),
210
+ LABEL_PTR(trace_opt_str_freeze),
211
+ LABEL_PTR(trace_opt_nil_p),
212
+ LABEL_PTR(trace_opt_str_uminus),
213
+ LABEL_PTR(trace_opt_duparray_send),
214
+ LABEL_PTR(trace_opt_newarray_send),
215
+ LABEL_PTR(trace_invokesuper),
216
+ LABEL_PTR(trace_invokesuperforward),
217
+ LABEL_PTR(trace_invokeblock),
218
+ LABEL_PTR(trace_leave),
219
+ LABEL_PTR(trace_throw),
220
+ LABEL_PTR(trace_jump),
221
+ LABEL_PTR(trace_branchif),
222
+ LABEL_PTR(trace_branchunless),
223
+ LABEL_PTR(trace_branchnil),
224
+ LABEL_PTR(trace_once),
225
+ LABEL_PTR(trace_opt_case_dispatch),
226
+ LABEL_PTR(trace_opt_plus),
227
+ LABEL_PTR(trace_opt_minus),
228
+ LABEL_PTR(trace_opt_mult),
229
+ LABEL_PTR(trace_opt_div),
230
+ LABEL_PTR(trace_opt_mod),
231
+ LABEL_PTR(trace_opt_eq),
232
+ LABEL_PTR(trace_opt_neq),
233
+ LABEL_PTR(trace_opt_lt),
234
+ LABEL_PTR(trace_opt_le),
235
+ LABEL_PTR(trace_opt_gt),
236
+ LABEL_PTR(trace_opt_ge),
237
+ LABEL_PTR(trace_opt_ltlt),
238
+ LABEL_PTR(trace_opt_and),
239
+ LABEL_PTR(trace_opt_or),
240
+ LABEL_PTR(trace_opt_aref),
241
+ LABEL_PTR(trace_opt_aset),
242
+ LABEL_PTR(trace_opt_length),
243
+ LABEL_PTR(trace_opt_size),
244
+ LABEL_PTR(trace_opt_empty_p),
245
+ LABEL_PTR(trace_opt_succ),
246
+ LABEL_PTR(trace_opt_not),
247
+ LABEL_PTR(trace_opt_regexpmatch2),
248
+ LABEL_PTR(trace_invokebuiltin),
249
+ LABEL_PTR(trace_opt_invokebuiltin_delegate),
250
+ LABEL_PTR(trace_opt_invokebuiltin_delegate_leave),
251
+ LABEL_PTR(trace_getlocal_WC_0),
252
+ LABEL_PTR(trace_getlocal_WC_1),
253
+ LABEL_PTR(trace_setlocal_WC_0),
254
+ LABEL_PTR(trace_setlocal_WC_1),
255
+ LABEL_PTR(trace_putobject_INT2FIX_0_),
256
+ LABEL_PTR(trace_putobject_INT2FIX_1_),
257
+ #if USE_ZJIT
258
+ LABEL_PTR(zjit_getinstancevariable),
259
+ LABEL_PTR(zjit_send),
260
+ LABEL_PTR(zjit_opt_send_without_block),
261
+ LABEL_PTR(zjit_objtostring),
262
+ LABEL_PTR(zjit_opt_nil_p),
263
+ LABEL_PTR(zjit_invokeblock),
264
+ LABEL_PTR(zjit_opt_plus),
265
+ LABEL_PTR(zjit_opt_minus),
266
+ LABEL_PTR(zjit_opt_mult),
267
+ LABEL_PTR(zjit_opt_div),
268
+ LABEL_PTR(zjit_opt_mod),
269
+ LABEL_PTR(zjit_opt_eq),
270
+ LABEL_PTR(zjit_opt_neq),
271
+ LABEL_PTR(zjit_opt_lt),
272
+ LABEL_PTR(zjit_opt_le),
273
+ LABEL_PTR(zjit_opt_gt),
274
+ LABEL_PTR(zjit_opt_ge),
275
+ LABEL_PTR(zjit_opt_ltlt),
276
+ LABEL_PTR(zjit_opt_and),
277
+ LABEL_PTR(zjit_opt_or),
278
+ LABEL_PTR(zjit_opt_aref),
279
+ LABEL_PTR(zjit_opt_aset),
280
+ LABEL_PTR(zjit_opt_length),
281
+ LABEL_PTR(zjit_opt_size),
282
+ LABEL_PTR(zjit_opt_empty_p),
283
+ LABEL_PTR(zjit_opt_succ),
284
+ LABEL_PTR(zjit_opt_not),
285
+ LABEL_PTR(zjit_opt_regexpmatch2),
286
+ #endif
287
+ };
288
+
289
+ ASSERT_VM_INSTRUCTION_SIZE(insns_address_table);
@@ -0,0 +1,81 @@
1
+ #ifndef YJIT_H
2
+ #define YJIT_H 1
3
+ //
4
+ // This file contains definitions YJIT exposes to the CRuby codebase
5
+ //
6
+
7
+ #include "ruby/internal/config.h"
8
+ #include "ruby_assert.h" // for RUBY_DEBUG
9
+ #include "vm_core.h"
10
+ #include "method.h"
11
+
12
+ // YJIT_STATS controls whether to support runtime counters in the interpreter
13
+ #ifndef YJIT_STATS
14
+ # define YJIT_STATS (USE_YJIT && RUBY_DEBUG)
15
+ #endif
16
+
17
+ #if USE_YJIT
18
+
19
+ // We generate x86 or arm64 assembly
20
+ #if defined(_WIN32) ? defined(_M_AMD64) : (defined(__x86_64__) || defined(__aarch64__))
21
+ // x86_64 platforms without mingw/msys or x64-mswin
22
+ #else
23
+ # error YJIT unsupported platform
24
+ #endif
25
+
26
+ // Expose these as declarations since we are building YJIT.
27
+ extern uint64_t rb_yjit_call_threshold;
28
+ extern uint64_t rb_yjit_cold_threshold;
29
+ extern uint64_t rb_yjit_live_iseq_count;
30
+ extern uint64_t rb_yjit_iseq_alloc_count;
31
+ extern bool rb_yjit_enabled_p;
32
+ void rb_yjit_incr_counter(const char *counter_name);
33
+ void rb_yjit_invalidate_all_method_lookup_assumptions(void);
34
+ void rb_yjit_cme_invalidate(rb_callable_method_entry_t *cme);
35
+ void rb_yjit_collect_binding_alloc(void);
36
+ void rb_yjit_collect_binding_set(void);
37
+ void rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception);
38
+ void rb_yjit_init(bool yjit_enabled);
39
+ void rb_yjit_free_at_exit(void);
40
+ void rb_yjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop);
41
+ void rb_yjit_constant_state_changed(ID id);
42
+ void rb_yjit_iseq_mark(void *payload);
43
+ void rb_yjit_iseq_update_references(const rb_iseq_t *iseq);
44
+ void rb_yjit_iseq_free(const rb_iseq_t *iseq);
45
+ void rb_yjit_before_ractor_spawn(void);
46
+ void rb_yjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx);
47
+ void rb_yjit_tracing_invalidate_all(void);
48
+ void rb_yjit_show_usage(int help, int highlight, unsigned int width, int columns);
49
+ void rb_yjit_lazy_push_frame(const VALUE *pc);
50
+ void rb_yjit_invalidate_no_singleton_class(VALUE klass);
51
+ void rb_yjit_invalidate_ep_is_bp(const rb_iseq_t *iseq);
52
+ void rb_yjit_mark_all_writeable(void);
53
+ void rb_yjit_mark_all_executable(void);
54
+
55
+ #else
56
+ // !USE_YJIT
57
+ // In these builds, YJIT could never be turned on. Provide dummy implementations.
58
+
59
+ #define rb_yjit_enabled_p false
60
+ static inline void rb_yjit_incr_counter(const char *counter_name) {}
61
+ static inline void rb_yjit_invalidate_all_method_lookup_assumptions(void) {}
62
+ static inline void rb_yjit_cme_invalidate(rb_callable_method_entry_t *cme) {}
63
+ static inline void rb_yjit_collect_binding_alloc(void) {}
64
+ static inline void rb_yjit_collect_binding_set(void) {}
65
+ static inline void rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception) {}
66
+ static inline void rb_yjit_init(bool yjit_enabled) {}
67
+ static inline void rb_yjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {}
68
+ static inline void rb_yjit_constant_state_changed(ID id) {}
69
+ static inline void rb_yjit_iseq_mark(void *payload) {}
70
+ static inline void rb_yjit_iseq_update_references(const rb_iseq_t *iseq) {}
71
+ static inline void rb_yjit_iseq_free(const rb_iseq_t *iseq) {}
72
+ static inline void rb_yjit_before_ractor_spawn(void) {}
73
+ static inline void rb_yjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx) {}
74
+ static inline void rb_yjit_tracing_invalidate_all(void) {}
75
+ static inline void rb_yjit_lazy_push_frame(const VALUE *pc) {}
76
+ static inline void rb_yjit_invalidate_no_singleton_class(VALUE klass) {}
77
+ static inline void rb_yjit_invalidate_ep_is_bp(const rb_iseq_t *iseq) {}
78
+
79
+ #endif // #if USE_YJIT
80
+
81
+ #endif // #ifndef YJIT_H
@@ -0,0 +1,47 @@
1
+ #ifndef ZJIT_H
2
+ #define ZJIT_H 1
3
+ //
4
+ // This file contains definitions ZJIT exposes to the CRuby codebase
5
+ //
6
+
7
+ // ZJIT_STATS controls whether to support runtime counters in the interpreter
8
+ #ifndef ZJIT_STATS
9
+ # define ZJIT_STATS (USE_ZJIT && RUBY_DEBUG)
10
+ #endif
11
+
12
+ #if USE_ZJIT
13
+ extern void *rb_zjit_entry;
14
+ extern uint64_t rb_zjit_call_threshold;
15
+ extern uint64_t rb_zjit_profile_threshold;
16
+ void rb_zjit_compile_iseq(const rb_iseq_t *iseq, bool jit_exception);
17
+ void rb_zjit_profile_insn(uint32_t insn, rb_execution_context_t *ec);
18
+ void rb_zjit_profile_enable(const rb_iseq_t *iseq);
19
+ void rb_zjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop);
20
+ void rb_zjit_cme_invalidate(const rb_callable_method_entry_t *cme);
21
+ void rb_zjit_cme_free(const rb_callable_method_entry_t *cme);
22
+ void rb_zjit_klass_free(VALUE klass);
23
+ void rb_zjit_invalidate_no_ep_escape(const rb_iseq_t *iseq);
24
+ void rb_zjit_constant_state_changed(ID id);
25
+ void rb_zjit_iseq_mark(void *payload);
26
+ void rb_zjit_iseq_update_references(void *payload);
27
+ void rb_zjit_iseq_free(const rb_iseq_t *iseq);
28
+ void rb_zjit_before_ractor_spawn(void);
29
+ void rb_zjit_tracing_invalidate_all(void);
30
+ void rb_zjit_invalidate_no_singleton_class(VALUE klass);
31
+ #else
32
+ #define rb_zjit_entry 0
33
+ static inline void rb_zjit_compile_iseq(const rb_iseq_t *iseq, bool jit_exception) {}
34
+ static inline void rb_zjit_profile_insn(uint32_t insn, rb_execution_context_t *ec) {}
35
+ static inline void rb_zjit_profile_enable(const rb_iseq_t *iseq) {}
36
+ static inline void rb_zjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {}
37
+ static inline void rb_zjit_cme_invalidate(const rb_callable_method_entry_t *cme) {}
38
+ static inline void rb_zjit_invalidate_no_ep_escape(const rb_iseq_t *iseq) {}
39
+ static inline void rb_zjit_constant_state_changed(ID id) {}
40
+ static inline void rb_zjit_before_ractor_spawn(void) {}
41
+ static inline void rb_zjit_tracing_invalidate_all(void) {}
42
+ static inline void rb_zjit_invalidate_no_singleton_class(VALUE klass) {}
43
+ #endif // #if USE_ZJIT
44
+
45
+ #define rb_zjit_enabled_p (rb_zjit_entry != 0)
46
+
47
+ #endif // #ifndef ZJIT_H
@@ -1,5 +1,5 @@
1
1
  module Debase
2
2
  module RubyCoreSource
3
- VERSION = '3.4.1'
3
+ VERSION = '4.0.0.preview2'
4
4
  end
5
5
  end