debase-ruby_core_source 0.10.17 → 0.10.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/addr2line.h +20 -0
  4. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/builtin.h +121 -0
  5. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/ccan/build_assert/build_assert.h +40 -0
  6. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/ccan/check_type/check_type.h +63 -0
  7. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/ccan/container_of/container_of.h +142 -0
  8. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/ccan/list/list.h +789 -0
  9. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/ccan/str/str.h +17 -0
  10. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/constant.h +55 -0
  11. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/darray.h +179 -0
  12. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/debug_counter.h +468 -0
  13. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/dln.h +31 -0
  14. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/encindex.h +70 -0
  15. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/eval_intern.h +339 -0
  16. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/gc.h +147 -0
  17. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/hrtime.h +227 -0
  18. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/id.h +295 -0
  19. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/id_table.h +36 -0
  20. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/insns.inc +249 -0
  21. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/insns_info.inc +9061 -0
  22. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/array.h +163 -0
  23. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/bignum.h +246 -0
  24. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/bits.h +565 -0
  25. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/class.h +181 -0
  26. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/cmdlineopt.h +61 -0
  27. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/compar.h +49 -0
  28. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/compile.h +35 -0
  29. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/compilers.h +107 -0
  30. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/complex.h +29 -0
  31. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/cont.h +29 -0
  32. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/dir.h +16 -0
  33. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/enc.h +19 -0
  34. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/encoding.h +29 -0
  35. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/enum.h +18 -0
  36. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/enumerator.h +21 -0
  37. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/error.h +191 -0
  38. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/eval.h +32 -0
  39. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/file.h +38 -0
  40. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/fixnum.h +184 -0
  41. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/gc.h +191 -0
  42. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/hash.h +243 -0
  43. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/imemo.h +242 -0
  44. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/inits.h +50 -0
  45. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/io.h +38 -0
  46. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/load.h +18 -0
  47. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/loadpath.h +16 -0
  48. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/math.h +23 -0
  49. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/missing.h +18 -0
  50. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/numeric.h +275 -0
  51. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/object.h +61 -0
  52. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/parse.h +24 -0
  53. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/proc.h +32 -0
  54. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/process.h +137 -0
  55. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/ractor.h +6 -0
  56. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/random.h +16 -0
  57. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/range.h +40 -0
  58. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/rational.h +72 -0
  59. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/re.h +30 -0
  60. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/sanitizers.h +190 -0
  61. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/serial.h +23 -0
  62. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/signal.h +21 -0
  63. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/static_assert.h +16 -0
  64. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/string.h +147 -0
  65. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/struct.h +153 -0
  66. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/symbol.h +42 -0
  67. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/thread.h +55 -0
  68. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/time.h +34 -0
  69. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/transcode.h +20 -0
  70. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/util.h +27 -0
  71. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/variable.h +88 -0
  72. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/vm.h +134 -0
  73. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal/warnings.h +16 -0
  74. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/internal.h +113 -0
  75. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/iseq.h +329 -0
  76. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/known_errors.inc +791 -0
  77. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/method.h +254 -0
  78. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/mjit.h +132 -0
  79. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/mjit_compile_attr.inc +430 -0
  80. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/mjit_compiler.h +58 -0
  81. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/mjit_unit.h +29 -0
  82. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/node.h +511 -0
  83. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/node_name.inc +210 -0
  84. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/opt_sc.inc +109 -0
  85. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/optinsn.inc +128 -0
  86. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/optunifs.inc +43 -0
  87. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/parse.h +215 -0
  88. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/probes_helper.h +44 -0
  89. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/ractor_core.h +343 -0
  90. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/regenc.h +254 -0
  91. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/regint.h +984 -0
  92. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/regparse.h +370 -0
  93. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/revision.h +5 -0
  94. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/ruby_assert.h +14 -0
  95. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/ruby_atomic.h +23 -0
  96. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/shape.h +194 -0
  97. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/siphash.h +48 -0
  98. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/symbol.h +119 -0
  99. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/thread_none.h +20 -0
  100. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/thread_pthread.h +132 -0
  101. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/thread_win32.h +63 -0
  102. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/timev.h +57 -0
  103. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/transcode_data.h +138 -0
  104. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/transient_heap.h +65 -0
  105. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/variable.h +29 -0
  106. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/version.h +65 -0
  107. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/vm.inc +5476 -0
  108. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/vm_call_iseq_optimized.inc +244 -0
  109. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/vm_callinfo.h +550 -0
  110. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/vm_core.h +2137 -0
  111. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/vm_debug.h +122 -0
  112. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/vm_exec.h +197 -0
  113. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/vm_insnhelper.h +266 -0
  114. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/vm_opts.h +73 -0
  115. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/vm_sync.h +137 -0
  116. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/vmtc.inc +243 -0
  117. data/lib/debase/ruby_core_source/ruby-3.2.0-preview3/yjit.h +72 -0
  118. data/lib/debase/ruby_core_source/version.rb +1 -1
  119. metadata +118 -3
@@ -0,0 +1,30 @@
1
+ #ifndef INTERNAL_RE_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_RE_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for Regexp.
10
+ */
11
+ #include "ruby/internal/stdbool.h" /* for bool */
12
+ #include "ruby/ruby.h" /* for VALUE */
13
+
14
+ /* re.c */
15
+ VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
16
+ VALUE rb_reg_check_preprocess(VALUE);
17
+ long rb_reg_search0(VALUE, VALUE, long, int, int);
18
+ VALUE rb_reg_match_p(VALUE re, VALUE str, long pos);
19
+ bool rb_reg_start_with_p(VALUE re, VALUE str);
20
+ VALUE rb_reg_hash(VALUE re);
21
+ VALUE rb_reg_equal(VALUE re1, VALUE re2);
22
+ void rb_backref_set_string(VALUE string, long pos, long len);
23
+ void rb_match_unbusy(VALUE);
24
+ int rb_match_count(VALUE match);
25
+ int rb_match_nth_defined(int nth, VALUE match);
26
+ MJIT_SYMBOL_EXPORT_BEGIN
27
+ VALUE rb_reg_new_ary(VALUE ary, int options);
28
+ MJIT_SYMBOL_EXPORT_END
29
+
30
+ #endif /* INTERNAL_RE_H */
@@ -0,0 +1,190 @@
1
+ #ifndef INTERNAL_SANITIZERS_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_SANITIZERS_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for ASAN / MSAN / etc.
10
+ */
11
+ #include "ruby/internal/config.h"
12
+ #include "internal/compilers.h" /* for __has_feature */
13
+
14
+ #ifdef HAVE_VALGRIND_MEMCHECK_H
15
+ # include <valgrind/memcheck.h>
16
+ #endif
17
+
18
+ #ifdef HAVE_SANITIZER_ASAN_INTERFACE_H
19
+ # include <sanitizer/asan_interface.h>
20
+ #endif
21
+
22
+ #ifdef HAVE_SANITIZER_MSAN_INTERFACE_H
23
+ # if __has_feature(memory_sanitizer)
24
+ # include <sanitizer/msan_interface.h>
25
+ # endif
26
+ #endif
27
+
28
+ #include "ruby/internal/stdbool.h" /* for bool */
29
+ #include "ruby/ruby.h" /* for VALUE */
30
+
31
+ #if 0
32
+ #elif __has_feature(memory_sanitizer) && __has_feature(address_sanitizer)
33
+ # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
34
+ __attribute__((__no_sanitize__("memory, address"), __noinline__)) x
35
+ #elif __has_feature(address_sanitizer)
36
+ # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
37
+ __attribute__((__no_sanitize__("address"), __noinline__)) x
38
+ #elif defined(NO_SANITIZE_ADDRESS)
39
+ # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
40
+ NO_SANITIZE_ADDRESS(NOINLINE(x))
41
+ #elif defined(NO_ADDRESS_SAFETY_ANALYSIS)
42
+ # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
43
+ NO_ADDRESS_SAFETY_ANALYSIS(NOINLINE(x))
44
+ #else
45
+ # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) x
46
+ #endif
47
+
48
+ #if defined(NO_SANITIZE) && RBIMPL_COMPILER_IS(GCC)
49
+ /* GCC warns about unknown sanitizer, which is annoying. */
50
+ # include "internal/warnings.h"
51
+ # undef NO_SANITIZE
52
+ # define NO_SANITIZE(x, y) \
53
+ COMPILER_WARNING_PUSH; \
54
+ COMPILER_WARNING_IGNORED(-Wattributes); \
55
+ __attribute__((__no_sanitize__(x))) y; \
56
+ COMPILER_WARNING_POP
57
+ #endif
58
+
59
+ #ifndef NO_SANITIZE
60
+ # define NO_SANITIZE(x, y) y
61
+ #endif
62
+
63
+ #if !__has_feature(address_sanitizer)
64
+ # define __asan_poison_memory_region(x, y)
65
+ # define __asan_unpoison_memory_region(x, y)
66
+ # define __asan_region_is_poisoned(x, y) 0
67
+ #endif
68
+
69
+ #if !__has_feature(memory_sanitizer)
70
+ # define __msan_allocated_memory(x, y) ((void)(x), (void)(y))
71
+ # define __msan_poison(x, y) ((void)(x), (void)(y))
72
+ # define __msan_unpoison(x, y) ((void)(x), (void)(y))
73
+ # define __msan_unpoison_string(x) ((void)(x))
74
+ #endif
75
+
76
+ #ifdef VALGRIND_MAKE_READABLE
77
+ # define VALGRIND_MAKE_MEM_DEFINED(p, n) VALGRIND_MAKE_READABLE((p), (n))
78
+ #endif
79
+
80
+ #ifdef VALGRIND_MAKE_WRITABLE
81
+ # define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE((p), (n))
82
+ #endif
83
+
84
+ #ifndef VALGRIND_MAKE_MEM_DEFINED
85
+ # define VALGRIND_MAKE_MEM_DEFINED(p, n) 0
86
+ #endif
87
+
88
+ #ifndef VALGRIND_MAKE_MEM_UNDEFINED
89
+ # define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
90
+ #endif
91
+
92
+ #ifndef MJIT_HEADER
93
+
94
+ /*!
95
+ * This function asserts that a (continuous) memory region from ptr to size
96
+ * being "poisoned". Both read / write access to such memory region are
97
+ * prohibited until properly unpoisoned. The region must be previously
98
+ * allocated (do not pass a freed pointer here), but not necessarily be an
99
+ * entire object that the malloc returns. You can punch hole a part of a
100
+ * gigantic heap arena. This is handy when you do not free an allocated memory
101
+ * region to reuse later: poison when you keep it unused, and unpoison when you
102
+ * reuse.
103
+ *
104
+ * \param[in] ptr pointer to the beginning of the memory region to poison.
105
+ * \param[in] size the length of the memory region to poison.
106
+ */
107
+ static inline void
108
+ asan_poison_memory_region(const volatile void *ptr, size_t size)
109
+ {
110
+ __msan_poison(ptr, size);
111
+ __asan_poison_memory_region(ptr, size);
112
+ }
113
+
114
+ /*!
115
+ * This is a variant of asan_poison_memory_region that takes a VALUE.
116
+ *
117
+ * \param[in] obj target object.
118
+ */
119
+ static inline void
120
+ asan_poison_object(VALUE obj)
121
+ {
122
+ MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj;
123
+ asan_poison_memory_region(ptr, SIZEOF_VALUE);
124
+ }
125
+
126
+ #if !__has_feature(address_sanitizer)
127
+ #define asan_poison_object_if(ptr, obj) ((void)(ptr), (void)(obj))
128
+ #else
129
+ #define asan_poison_object_if(ptr, obj) do { \
130
+ if (ptr) asan_poison_object(obj); \
131
+ } while (0)
132
+ #endif
133
+
134
+ /*!
135
+ * This function predicates if the given object is fully addressable or not.
136
+ *
137
+ * \param[in] obj target object.
138
+ * \retval 0 the given object is fully addressable.
139
+ * \retval otherwise pointer to first such byte who is poisoned.
140
+ */
141
+ static inline void *
142
+ asan_poisoned_object_p(VALUE obj)
143
+ {
144
+ MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj;
145
+ return __asan_region_is_poisoned(ptr, SIZEOF_VALUE);
146
+ }
147
+
148
+ /*!
149
+ * This function asserts that a (formally poisoned) memory region from ptr to
150
+ * size is now addressable. Write access to such memory region gets allowed.
151
+ * However read access might or might not be possible depending on situations,
152
+ * because the region can have contents of previous usages. That information
153
+ * should be passed by the malloc_p flag. If that is true, the contents of the
154
+ * region is _not_ fully defined (like the return value of malloc behaves).
155
+ * Reading from there is NG; write something first. If malloc_p is false on
156
+ * the other hand, that memory region is fully defined and can be read
157
+ * immediately.
158
+ *
159
+ * \param[in] ptr pointer to the beginning of the memory region to unpoison.
160
+ * \param[in] size the length of the memory region.
161
+ * \param[in] malloc_p if the memory region is like a malloc's return value or not.
162
+ */
163
+ static inline void
164
+ asan_unpoison_memory_region(const volatile void *ptr, size_t size, bool malloc_p)
165
+ {
166
+ __asan_unpoison_memory_region(ptr, size);
167
+ if (malloc_p) {
168
+ __msan_allocated_memory(ptr, size);
169
+ }
170
+ else {
171
+ __msan_unpoison(ptr, size);
172
+ }
173
+ }
174
+
175
+ /*!
176
+ * This is a variant of asan_unpoison_memory_region that takes a VALUE.
177
+ *
178
+ * \param[in] obj target object.
179
+ * \param[in] malloc_p if the memory region is like a malloc's return value or not.
180
+ */
181
+ static inline void
182
+ asan_unpoison_object(VALUE obj, bool newobj_p)
183
+ {
184
+ MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj;
185
+ asan_unpoison_memory_region(ptr, SIZEOF_VALUE, newobj_p);
186
+ }
187
+
188
+ #endif /* MJIT_HEADER */
189
+
190
+ #endif /* INTERNAL_SANITIZERS_H */
@@ -0,0 +1,23 @@
1
+ #ifndef INTERNAL_SERIAL_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_SERIAL_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for rb_serial_t.
10
+ */
11
+ #include "ruby/internal/config.h" /* for HAVE_LONG_LONG */
12
+ #include "ruby/defines.h" /* for LONG_LONG */
13
+
14
+ #ifndef HAVE_LONG_LONG
15
+ # error need C99+
16
+ #endif
17
+
18
+ typedef unsigned LONG_LONG rb_serial_t;
19
+ #define SERIALT2NUM ULL2NUM
20
+ #define PRI_SERIALT_PREFIX PRI_LL_PREFIX
21
+ #define SIZEOF_SERIAL_T SIZEOF_LONG_LONG
22
+
23
+ #endif /* INTERNAL_SERIAL_H */
@@ -0,0 +1,21 @@
1
+ #ifndef INTERNAL_SIGNAL_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_SIGNAL_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for SignalException.
10
+ */
11
+
12
+ /* signal.c */
13
+ extern int ruby_enable_coredump;
14
+ int rb_get_next_signal(void);
15
+
16
+ RUBY_SYMBOL_EXPORT_BEGIN
17
+ /* signal.c (export) */
18
+ int rb_grantpt(int fd);
19
+ RUBY_SYMBOL_EXPORT_END
20
+
21
+ #endif /* INTERNAL_SIGNAL_H */
@@ -0,0 +1,16 @@
1
+ #ifndef INTERNAL_STATIC_ASSERT_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_STATIC_ASSERT_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief C11 shim for _Static_assert.
10
+ */
11
+ #include "ruby/internal/static_assert.h"
12
+ #ifndef STATIC_ASSERT
13
+ # define STATIC_ASSERT RBIMPL_STATIC_ASSERT
14
+ #endif
15
+
16
+ #endif /* INTERNAL_STATIC_ASSERT_H */
@@ -0,0 +1,147 @@
1
+ #ifndef INTERNAL_STRING_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_STRING_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for String.
10
+ */
11
+ #include "ruby/internal/config.h"
12
+ #include <stddef.h> /* for size_t */
13
+ #include "internal/compilers.h" /* for __has_builtin */
14
+ #include "ruby/internal/stdbool.h" /* for bool */
15
+ #include "ruby/encoding.h" /* for rb_encoding */
16
+ #include "ruby/ruby.h" /* for VALUE */
17
+
18
+ #define STR_NOEMBED FL_USER1
19
+ #define STR_SHARED FL_USER2 /* = ELTS_SHARED */
20
+
21
+ #ifdef rb_fstring_cstr
22
+ # undef rb_fstring_cstr
23
+ #endif
24
+
25
+ /* string.c */
26
+ VALUE rb_fstring(VALUE);
27
+ VALUE rb_fstring_cstr(const char *str);
28
+ VALUE rb_fstring_enc_new(const char *ptr, long len, rb_encoding *enc);
29
+ int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
30
+ int rb_str_symname_p(VALUE);
31
+ VALUE rb_str_quote_unprintable(VALUE);
32
+ char *rb_str_fill_terminator(VALUE str, const int termlen);
33
+ void rb_str_change_terminator_length(VALUE str, const int oldtermlen, const int termlen);
34
+ VALUE rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg);
35
+ VALUE rb_str_chomp_string(VALUE str, VALUE chomp);
36
+ VALUE rb_external_str_with_enc(VALUE str, rb_encoding *eenc);
37
+ VALUE rb_str_cat_conv_enc_opts(VALUE newstr, long ofs, const char *ptr, long len,
38
+ rb_encoding *from, int ecflags, VALUE ecopts);
39
+ VALUE rb_enc_str_scrub(rb_encoding *enc, VALUE str, VALUE repl);
40
+ VALUE rb_str_escape(VALUE str);
41
+ size_t rb_str_memsize(VALUE);
42
+ char *rb_str_to_cstr(VALUE str);
43
+ const char *ruby_escaped_char(int c);
44
+ void rb_str_make_independent(VALUE str);
45
+ int rb_enc_str_coderange_scan(VALUE str, rb_encoding *enc);
46
+ int rb_ascii8bit_appendable_encoding_index(rb_encoding *enc, unsigned int code);
47
+ VALUE rb_str_include(VALUE str, VALUE arg);
48
+
49
+ static inline bool STR_EMBED_P(VALUE str);
50
+ static inline bool STR_SHARED_P(VALUE str);
51
+ static inline VALUE QUOTE(VALUE v);
52
+ static inline VALUE QUOTE_ID(ID v);
53
+ static inline bool is_ascii_string(VALUE str);
54
+ static inline bool is_broken_string(VALUE str);
55
+ static inline VALUE rb_str_eql_internal(const VALUE str1, const VALUE str2);
56
+
57
+ RUBY_SYMBOL_EXPORT_BEGIN
58
+ /* string.c (export) */
59
+ VALUE rb_str_tmp_frozen_acquire(VALUE str);
60
+ void rb_str_tmp_frozen_release(VALUE str, VALUE tmp);
61
+ VALUE rb_setup_fake_str(struct RString *fake_str, const char *name, long len, rb_encoding *enc);
62
+ VALUE rb_str_upto_each(VALUE, VALUE, int, int (*each)(VALUE, VALUE), VALUE);
63
+ VALUE rb_str_upto_endless_each(VALUE, int (*each)(VALUE, VALUE), VALUE);
64
+ void rb_str_make_embedded(VALUE);
65
+ size_t rb_str_size_as_embedded(VALUE);
66
+ bool rb_str_reembeddable_p(VALUE);
67
+ void rb_str_update_shared_ary(VALUE str, VALUE old_root, VALUE new_root);
68
+ RUBY_SYMBOL_EXPORT_END
69
+
70
+ MJIT_SYMBOL_EXPORT_BEGIN
71
+ VALUE rb_fstring_new(const char *ptr, long len);
72
+ VALUE rb_obj_as_string_result(VALUE str, VALUE obj);
73
+ VALUE rb_str_opt_plus(VALUE x, VALUE y);
74
+ VALUE rb_str_concat_literals(size_t num, const VALUE *strary);
75
+ VALUE rb_str_eql(VALUE str1, VALUE str2);
76
+ VALUE rb_id_quote_unprintable(ID);
77
+ VALUE rb_sym_proc_call(ID mid, int argc, const VALUE *argv, int kw_splat, VALUE passed_proc);
78
+
79
+ struct rb_execution_context_struct;
80
+ VALUE rb_ec_str_resurrect(struct rb_execution_context_struct *ec, VALUE str);
81
+ MJIT_SYMBOL_EXPORT_END
82
+
83
+ #define rb_fstring_lit(str) rb_fstring_new((str), rb_strlen_lit(str))
84
+ #define rb_fstring_literal(str) rb_fstring_lit(str)
85
+ #define rb_fstring_enc_lit(str, enc) rb_fstring_enc_new((str), rb_strlen_lit(str), (enc))
86
+ #define rb_fstring_enc_literal(str, enc) rb_fstring_enc_lit(str, enc)
87
+
88
+ static inline VALUE
89
+ QUOTE(VALUE v)
90
+ {
91
+ return rb_str_quote_unprintable(v);
92
+ }
93
+
94
+ static inline VALUE
95
+ QUOTE_ID(ID i)
96
+ {
97
+ return rb_id_quote_unprintable(i);
98
+ }
99
+
100
+ static inline bool
101
+ STR_EMBED_P(VALUE str)
102
+ {
103
+ return ! FL_TEST_RAW(str, STR_NOEMBED);
104
+ }
105
+
106
+ static inline bool
107
+ STR_SHARED_P(VALUE str)
108
+ {
109
+ return FL_ALL_RAW(str, STR_NOEMBED | STR_SHARED);
110
+ }
111
+
112
+ static inline bool
113
+ is_ascii_string(VALUE str)
114
+ {
115
+ return rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT;
116
+ }
117
+
118
+ static inline bool
119
+ is_broken_string(VALUE str)
120
+ {
121
+ return rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN;
122
+ }
123
+
124
+ /* expect tail call optimization */
125
+ // YJIT needs this function to never allocate and never raise
126
+ static inline VALUE
127
+ rb_str_eql_internal(const VALUE str1, const VALUE str2)
128
+ {
129
+ const long len = RSTRING_LEN(str1);
130
+ const char *ptr1, *ptr2;
131
+
132
+ if (len != RSTRING_LEN(str2)) return Qfalse;
133
+ if (!rb_str_comparable(str1, str2)) return Qfalse;
134
+ if ((ptr1 = RSTRING_PTR(str1)) == (ptr2 = RSTRING_PTR(str2)))
135
+ return Qtrue;
136
+ if (memcmp(ptr1, ptr2, len) == 0)
137
+ return Qtrue;
138
+ return Qfalse;
139
+ }
140
+
141
+ #if __has_builtin(__builtin_constant_p)
142
+ # define rb_fstring_cstr(str) \
143
+ (__builtin_constant_p(str) ? \
144
+ rb_fstring_new((str), (long)strlen(str)) : \
145
+ (rb_fstring_cstr)(str))
146
+ #endif
147
+ #endif /* INTERNAL_STRING_H */
@@ -0,0 +1,153 @@
1
+ #ifndef INTERNAL_STRUCT_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_STRUCT_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for Struct.
10
+ */
11
+ #include "ruby/internal/stdbool.h" /* for bool */
12
+ #include "internal/gc.h" /* for RB_OBJ_WRITE */
13
+ #include "ruby/ruby.h" /* for struct RBasic */
14
+
15
+ enum {
16
+ RSTRUCT_EMBED_LEN_MAX = RVALUE_EMBED_LEN_MAX,
17
+ RSTRUCT_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER1),
18
+ RSTRUCT_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+1),
19
+ RSTRUCT_TRANSIENT_FLAG = FL_USER3,
20
+ };
21
+
22
+ struct RStruct {
23
+ struct RBasic basic;
24
+ union {
25
+ struct {
26
+ long len;
27
+ const VALUE *ptr;
28
+ } heap;
29
+ const VALUE ary[RSTRUCT_EMBED_LEN_MAX];
30
+ } as;
31
+ };
32
+
33
+ #define RSTRUCT(obj) ((struct RStruct *)(obj))
34
+
35
+ #ifdef RSTRUCT_LEN
36
+ # undef RSTRUCT_LEN
37
+ #endif
38
+
39
+ #ifdef RSTRUCT_PTR
40
+ # undef RSTRUCT_PTR
41
+ #endif
42
+
43
+ #ifdef RSTRUCT_SET
44
+ # undef RSTRUCT_SET
45
+ #endif
46
+
47
+ #ifdef RSTRUCT_GET
48
+ # undef RSTRUCT_GET
49
+ #endif
50
+
51
+ #define RSTRUCT_LEN internal_RSTRUCT_LEN
52
+ #define RSTRUCT_SET internal_RSTRUCT_SET
53
+ #define RSTRUCT_GET internal_RSTRUCT_GET
54
+
55
+ /* struct.c */
56
+ VALUE rb_struct_init_copy(VALUE copy, VALUE s);
57
+ VALUE rb_struct_lookup(VALUE s, VALUE idx);
58
+ VALUE rb_struct_s_keyword_init(VALUE klass);
59
+ static inline const VALUE *rb_struct_const_heap_ptr(VALUE st);
60
+ static inline bool RSTRUCT_TRANSIENT_P(VALUE st);
61
+ static inline void RSTRUCT_TRANSIENT_SET(VALUE st);
62
+ static inline void RSTRUCT_TRANSIENT_UNSET(VALUE st);
63
+ static inline long RSTRUCT_EMBED_LEN(VALUE st);
64
+ static inline long RSTRUCT_LEN(VALUE st);
65
+ static inline int RSTRUCT_LENINT(VALUE st);
66
+ static inline const VALUE *RSTRUCT_CONST_PTR(VALUE st);
67
+ static inline void RSTRUCT_SET(VALUE st, long k, VALUE v);
68
+ static inline VALUE RSTRUCT_GET(VALUE st, long k);
69
+
70
+ static inline bool
71
+ RSTRUCT_TRANSIENT_P(VALUE st)
72
+ {
73
+ #if USE_TRANSIENT_HEAP
74
+ return FL_TEST_RAW(st, RSTRUCT_TRANSIENT_FLAG);
75
+ #else
76
+ return false;
77
+ #endif
78
+ }
79
+
80
+ static inline void
81
+ RSTRUCT_TRANSIENT_SET(VALUE st)
82
+ {
83
+ #if USE_TRANSIENT_HEAP
84
+ FL_SET_RAW(st, RSTRUCT_TRANSIENT_FLAG);
85
+ #endif
86
+ }
87
+
88
+ static inline void
89
+ RSTRUCT_TRANSIENT_UNSET(VALUE st)
90
+ {
91
+ #if USE_TRANSIENT_HEAP
92
+ FL_UNSET_RAW(st, RSTRUCT_TRANSIENT_FLAG);
93
+ #endif
94
+ }
95
+
96
+ static inline long
97
+ RSTRUCT_EMBED_LEN(VALUE st)
98
+ {
99
+ long ret = FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK);
100
+ ret >>= RSTRUCT_EMBED_LEN_SHIFT;
101
+ return ret;
102
+ }
103
+
104
+ static inline long
105
+ RSTRUCT_LEN(VALUE st)
106
+ {
107
+ if (FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK)) {
108
+ return RSTRUCT_EMBED_LEN(st);
109
+ }
110
+ else {
111
+ return RSTRUCT(st)->as.heap.len;
112
+ }
113
+ }
114
+
115
+ static inline int
116
+ RSTRUCT_LENINT(VALUE st)
117
+ {
118
+ return rb_long2int(RSTRUCT_LEN(st));
119
+ }
120
+
121
+ static inline const VALUE *
122
+ RSTRUCT_CONST_PTR(VALUE st)
123
+ {
124
+ const struct RStruct *p = RSTRUCT(st);
125
+
126
+ if (FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK)) {
127
+ return p->as.ary;
128
+ }
129
+ else {
130
+ return p->as.heap.ptr;
131
+ }
132
+ }
133
+
134
+ static inline void
135
+ RSTRUCT_SET(VALUE st, long k, VALUE v)
136
+ {
137
+ RB_OBJ_WRITE(st, &RSTRUCT_CONST_PTR(st)[k], v);
138
+ }
139
+
140
+ static inline VALUE
141
+ RSTRUCT_GET(VALUE st, long k)
142
+ {
143
+ return RSTRUCT_CONST_PTR(st)[k];
144
+ }
145
+
146
+ static inline const VALUE *
147
+ rb_struct_const_heap_ptr(VALUE st)
148
+ {
149
+ /* TODO: check embed on debug mode */
150
+ return RSTRUCT(st)->as.heap.ptr;
151
+ }
152
+
153
+ #endif /* INTERNAL_STRUCT_H */
@@ -0,0 +1,42 @@
1
+ #ifndef INTERNAL_SYMBOL_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_SYMBOL_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for Symbol.
10
+ */
11
+ #include "ruby/ruby.h" /* for VALUE */
12
+ #include "ruby/encoding.h" /* for rb_encoding */
13
+ #include "internal/compilers.h" /* for __has_builtin */
14
+
15
+ #ifdef rb_sym_intern_ascii_cstr
16
+ # undef rb_sym_intern_ascii_cstr
17
+ #endif
18
+
19
+ /* symbol.c */
20
+ VALUE rb_to_symbol_type(VALUE obj);
21
+ VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc);
22
+ VALUE rb_sym_intern_ascii(const char *ptr, long len);
23
+ VALUE rb_sym_intern_ascii_cstr(const char *ptr);
24
+ int rb_is_const_name(VALUE name);
25
+ int rb_is_class_name(VALUE name);
26
+ int rb_is_instance_name(VALUE name);
27
+ int rb_is_local_name(VALUE name);
28
+ PUREFUNC(int rb_is_const_sym(VALUE sym));
29
+ PUREFUNC(int rb_is_attrset_sym(VALUE sym));
30
+ ID rb_make_internal_id(void);
31
+ ID rb_make_temporary_id(size_t n);
32
+ void rb_gc_free_dsymbol(VALUE);
33
+ int rb_static_id_valid_p(ID id);
34
+
35
+ #if __has_builtin(__builtin_constant_p)
36
+ #define rb_sym_intern_ascii_cstr(ptr) \
37
+ (__builtin_constant_p(ptr) ? \
38
+ rb_sym_intern_ascii((ptr), (long)strlen(ptr)) : \
39
+ rb_sym_intern_ascii_cstr(ptr))
40
+ #endif
41
+
42
+ #endif /* INTERNAL_SYMBOL_H */
@@ -0,0 +1,55 @@
1
+ #ifndef INTERNAL_THREAD_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_THREAD_H
3
+ /**
4
+ * @author Ruby developers <ruby-core@ruby-lang.org>
5
+ * @copyright This file is a part of the programming language Ruby.
6
+ * Permission is hereby granted, to either redistribute and/or
7
+ * modify this file, provided that the conditions mentioned in the
8
+ * file COPYING are met. Consult the file for details.
9
+ * @brief Internal header for Thread.
10
+ */
11
+ #include "ruby/ruby.h" /* for VALUE */
12
+ #include "ruby/intern.h" /* for rb_blocking_function_t */
13
+
14
+ struct rb_thread_struct; /* in vm_core.h */
15
+
16
+ /* thread.c */
17
+ #define COVERAGE_INDEX_LINES 0
18
+ #define COVERAGE_INDEX_BRANCHES 1
19
+ #define COVERAGE_TARGET_LINES 1
20
+ #define COVERAGE_TARGET_BRANCHES 2
21
+ #define COVERAGE_TARGET_METHODS 4
22
+ #define COVERAGE_TARGET_ONESHOT_LINES 8
23
+ #define COVERAGE_TARGET_EVAL 16
24
+
25
+ VALUE rb_obj_is_mutex(VALUE obj);
26
+ VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
27
+ void rb_thread_execute_interrupts(VALUE th);
28
+ VALUE rb_get_coverages(void);
29
+ int rb_get_coverage_mode(void);
30
+ VALUE rb_default_coverage(int);
31
+ VALUE rb_thread_shield_new(void);
32
+ VALUE rb_thread_shield_wait(VALUE self);
33
+ VALUE rb_thread_shield_release(VALUE self);
34
+ VALUE rb_thread_shield_destroy(VALUE self);
35
+ int rb_thread_to_be_killed(VALUE thread);
36
+ void rb_mutex_allow_trap(VALUE self, int val);
37
+ VALUE rb_uninterruptible(VALUE (*b_proc)(VALUE), VALUE data);
38
+ VALUE rb_mutex_owned_p(VALUE self);
39
+ VALUE rb_exec_recursive_outer_mid(VALUE (*f)(VALUE g, VALUE h, int r), VALUE g, VALUE h, ID mid);
40
+
41
+ int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout);
42
+
43
+ RUBY_SYMBOL_EXPORT_BEGIN
44
+ /* Temporary. This API will be removed (renamed). */
45
+ VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
46
+
47
+ /* thread.c (export) */
48
+ int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */
49
+ RUBY_SYMBOL_EXPORT_END
50
+
51
+ MJIT_SYMBOL_EXPORT_BEGIN
52
+ int rb_threadptr_execute_interrupts(struct rb_thread_struct *th, int blocking_timing);
53
+ MJIT_SYMBOL_EXPORT_END
54
+
55
+ #endif /* INTERNAL_THREAD_H */