debase-ruby_core_source 3.2.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +5 -0
  4. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/addr2line.h +20 -0
  5. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/builtin.h +117 -0
  6. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/build_assert/build_assert.h +40 -0
  7. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/check_type/check_type.h +63 -0
  8. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/container_of/container_of.h +142 -0
  9. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/list/list.h +789 -0
  10. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/str/str.h +17 -0
  11. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/constant.h +53 -0
  12. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/darray.h +179 -0
  13. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/debug_counter.h +426 -0
  14. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/dln.h +31 -0
  15. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/encindex.h +70 -0
  16. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/eval_intern.h +339 -0
  17. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/hrtime.h +227 -0
  18. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/id.h +299 -0
  19. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/id_table.h +39 -0
  20. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/insns.inc +249 -0
  21. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/insns_info.inc +9159 -0
  22. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/array.h +162 -0
  23. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/basic_operators.h +63 -0
  24. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/bignum.h +244 -0
  25. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/bits.h +564 -0
  26. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/class.h +221 -0
  27. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/cmdlineopt.h +61 -0
  28. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compar.h +29 -0
  29. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compile.h +35 -0
  30. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compilers.h +107 -0
  31. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/complex.h +29 -0
  32. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/cont.h +32 -0
  33. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/dir.h +16 -0
  34. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/enc.h +19 -0
  35. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/encoding.h +32 -0
  36. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/enum.h +18 -0
  37. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/enumerator.h +21 -0
  38. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/error.h +191 -0
  39. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/eval.h +32 -0
  40. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/file.h +38 -0
  41. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/fixnum.h +184 -0
  42. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/gc.h +333 -0
  43. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/hash.h +216 -0
  44. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/imemo.h +241 -0
  45. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/inits.h +50 -0
  46. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/io.h +38 -0
  47. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/load.h +18 -0
  48. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/loadpath.h +16 -0
  49. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/math.h +23 -0
  50. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/missing.h +18 -0
  51. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/numeric.h +273 -0
  52. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/object.h +59 -0
  53. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/parse.h +25 -0
  54. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/proc.h +30 -0
  55. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/process.h +138 -0
  56. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/ractor.h +6 -0
  57. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/random.h +16 -0
  58. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/range.h +40 -0
  59. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/rational.h +71 -0
  60. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/re.h +28 -0
  61. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/sanitizers.h +186 -0
  62. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/serial.h +23 -0
  63. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/signal.h +21 -0
  64. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/static_assert.h +16 -0
  65. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/string.h +145 -0
  66. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/struct.h +152 -0
  67. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/symbol.h +42 -0
  68. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/thread.h +61 -0
  69. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/time.h +34 -0
  70. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/transcode.h +20 -0
  71. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/util.h +27 -0
  72. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/variable.h +88 -0
  73. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/vm.h +124 -0
  74. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/warnings.h +16 -0
  75. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal.h +112 -0
  76. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/iseq.h +334 -0
  77. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/known_errors.inc +791 -0
  78. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/method.h +254 -0
  79. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/node.h +514 -0
  80. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/node_name.inc +210 -0
  81. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/opt_sc.inc +109 -0
  82. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/optinsn.inc +128 -0
  83. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/optunifs.inc +43 -0
  84. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/parse.h +230 -0
  85. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/probes_helper.h +42 -0
  86. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ractor_core.h +387 -0
  87. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/regenc.h +254 -0
  88. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/regint.h +996 -0
  89. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/regparse.h +370 -0
  90. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/revision.h +5 -0
  91. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/rjit.h +103 -0
  92. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/rjit_c.h +165 -0
  93. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ruby_assert.h +14 -0
  94. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ruby_atomic.h +23 -0
  95. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/shape.h +232 -0
  96. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/siphash.h +48 -0
  97. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/symbol.h +119 -0
  98. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/thread_none.h +20 -0
  99. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/thread_pthread.h +128 -0
  100. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/thread_win32.h +63 -0
  101. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/timev.h +58 -0
  102. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/transcode_data.h +138 -0
  103. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/transient_heap.h +65 -0
  104. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/variable.h +30 -0
  105. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/version.h +65 -0
  106. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm.inc +5497 -0
  107. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_call_iseq_optimized.inc +244 -0
  108. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_callinfo.h +574 -0
  109. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_core.h +2107 -0
  110. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_debug.h +122 -0
  111. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_exec.h +198 -0
  112. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_insnhelper.h +274 -0
  113. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_opts.h +72 -0
  114. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_sync.h +137 -0
  115. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vmtc.inc +243 -0
  116. data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/yjit.h +72 -0
  117. data/lib/debase/ruby_core_source/version.rb +1 -1
  118. metadata +116 -3
@@ -0,0 +1,145 @@
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
+ VALUE rb_fstring_new(const char *ptr, long len);
71
+ VALUE rb_obj_as_string_result(VALUE str, VALUE obj);
72
+ VALUE rb_str_opt_plus(VALUE x, VALUE y);
73
+ VALUE rb_str_concat_literals(size_t num, const VALUE *strary);
74
+ VALUE rb_str_eql(VALUE str1, VALUE str2);
75
+ VALUE rb_id_quote_unprintable(ID);
76
+ VALUE rb_sym_proc_call(ID mid, int argc, const VALUE *argv, int kw_splat, VALUE passed_proc);
77
+
78
+ struct rb_execution_context_struct;
79
+ VALUE rb_ec_str_resurrect(struct rb_execution_context_struct *ec, VALUE str);
80
+
81
+ #define rb_fstring_lit(str) rb_fstring_new((str), rb_strlen_lit(str))
82
+ #define rb_fstring_literal(str) rb_fstring_lit(str)
83
+ #define rb_fstring_enc_lit(str, enc) rb_fstring_enc_new((str), rb_strlen_lit(str), (enc))
84
+ #define rb_fstring_enc_literal(str, enc) rb_fstring_enc_lit(str, enc)
85
+
86
+ static inline VALUE
87
+ QUOTE(VALUE v)
88
+ {
89
+ return rb_str_quote_unprintable(v);
90
+ }
91
+
92
+ static inline VALUE
93
+ QUOTE_ID(ID i)
94
+ {
95
+ return rb_id_quote_unprintable(i);
96
+ }
97
+
98
+ static inline bool
99
+ STR_EMBED_P(VALUE str)
100
+ {
101
+ return ! FL_TEST_RAW(str, STR_NOEMBED);
102
+ }
103
+
104
+ static inline bool
105
+ STR_SHARED_P(VALUE str)
106
+ {
107
+ return FL_ALL_RAW(str, STR_NOEMBED | STR_SHARED);
108
+ }
109
+
110
+ static inline bool
111
+ is_ascii_string(VALUE str)
112
+ {
113
+ return rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT;
114
+ }
115
+
116
+ static inline bool
117
+ is_broken_string(VALUE str)
118
+ {
119
+ return rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN;
120
+ }
121
+
122
+ /* expect tail call optimization */
123
+ // YJIT needs this function to never allocate and never raise
124
+ static inline VALUE
125
+ rb_str_eql_internal(const VALUE str1, const VALUE str2)
126
+ {
127
+ const long len = RSTRING_LEN(str1);
128
+ const char *ptr1, *ptr2;
129
+
130
+ if (len != RSTRING_LEN(str2)) return Qfalse;
131
+ if (!rb_str_comparable(str1, str2)) return Qfalse;
132
+ if ((ptr1 = RSTRING_PTR(str1)) == (ptr2 = RSTRING_PTR(str2)))
133
+ return Qtrue;
134
+ if (memcmp(ptr1, ptr2, len) == 0)
135
+ return Qtrue;
136
+ return Qfalse;
137
+ }
138
+
139
+ #if __has_builtin(__builtin_constant_p)
140
+ # define rb_fstring_cstr(str) \
141
+ (__builtin_constant_p(str) ? \
142
+ rb_fstring_new((str), (long)strlen(str)) : \
143
+ (rb_fstring_cstr)(str))
144
+ #endif
145
+ #endif /* INTERNAL_STRING_H */
@@ -0,0 +1,152 @@
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 "ruby/ruby.h" /* for struct RBasic */
13
+
14
+ enum {
15
+ RSTRUCT_EMBED_LEN_MAX = RVALUE_EMBED_LEN_MAX,
16
+ RSTRUCT_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER1),
17
+ RSTRUCT_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+1),
18
+ RSTRUCT_TRANSIENT_FLAG = FL_USER3,
19
+ };
20
+
21
+ struct RStruct {
22
+ struct RBasic basic;
23
+ union {
24
+ struct {
25
+ long len;
26
+ const VALUE *ptr;
27
+ } heap;
28
+ const VALUE ary[RSTRUCT_EMBED_LEN_MAX];
29
+ } as;
30
+ };
31
+
32
+ #define RSTRUCT(obj) ((struct RStruct *)(obj))
33
+
34
+ #ifdef RSTRUCT_LEN
35
+ # undef RSTRUCT_LEN
36
+ #endif
37
+
38
+ #ifdef RSTRUCT_PTR
39
+ # undef RSTRUCT_PTR
40
+ #endif
41
+
42
+ #ifdef RSTRUCT_SET
43
+ # undef RSTRUCT_SET
44
+ #endif
45
+
46
+ #ifdef RSTRUCT_GET
47
+ # undef RSTRUCT_GET
48
+ #endif
49
+
50
+ #define RSTRUCT_LEN internal_RSTRUCT_LEN
51
+ #define RSTRUCT_SET internal_RSTRUCT_SET
52
+ #define RSTRUCT_GET internal_RSTRUCT_GET
53
+
54
+ /* struct.c */
55
+ VALUE rb_struct_init_copy(VALUE copy, VALUE s);
56
+ VALUE rb_struct_lookup(VALUE s, VALUE idx);
57
+ VALUE rb_struct_s_keyword_init(VALUE klass);
58
+ 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
+ static inline long RSTRUCT_EMBED_LEN(VALUE st);
63
+ static inline long RSTRUCT_LEN(VALUE st);
64
+ static inline int RSTRUCT_LENINT(VALUE st);
65
+ static inline const VALUE *RSTRUCT_CONST_PTR(VALUE st);
66
+ static inline void RSTRUCT_SET(VALUE st, long k, VALUE v);
67
+ static inline VALUE RSTRUCT_GET(VALUE st, long k);
68
+
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
+ static inline long
96
+ RSTRUCT_EMBED_LEN(VALUE st)
97
+ {
98
+ long ret = FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK);
99
+ ret >>= RSTRUCT_EMBED_LEN_SHIFT;
100
+ return ret;
101
+ }
102
+
103
+ static inline long
104
+ RSTRUCT_LEN(VALUE st)
105
+ {
106
+ if (FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK)) {
107
+ return RSTRUCT_EMBED_LEN(st);
108
+ }
109
+ else {
110
+ return RSTRUCT(st)->as.heap.len;
111
+ }
112
+ }
113
+
114
+ static inline int
115
+ RSTRUCT_LENINT(VALUE st)
116
+ {
117
+ return rb_long2int(RSTRUCT_LEN(st));
118
+ }
119
+
120
+ static inline const VALUE *
121
+ RSTRUCT_CONST_PTR(VALUE st)
122
+ {
123
+ const struct RStruct *p = RSTRUCT(st);
124
+
125
+ if (FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK)) {
126
+ return p->as.ary;
127
+ }
128
+ else {
129
+ return p->as.heap.ptr;
130
+ }
131
+ }
132
+
133
+ static inline void
134
+ RSTRUCT_SET(VALUE st, long k, VALUE v)
135
+ {
136
+ RB_OBJ_WRITE(st, &RSTRUCT_CONST_PTR(st)[k], v);
137
+ }
138
+
139
+ static inline VALUE
140
+ RSTRUCT_GET(VALUE st, long k)
141
+ {
142
+ return RSTRUCT_CONST_PTR(st)[k];
143
+ }
144
+
145
+ static inline const VALUE *
146
+ rb_struct_const_heap_ptr(VALUE st)
147
+ {
148
+ /* TODO: check embed on debug mode */
149
+ return RSTRUCT(st)->as.heap.ptr;
150
+ }
151
+
152
+ #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,61 @@
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
+ #define RB_VM_SAVE_MACHINE_CONTEXT(th) \
17
+ do { \
18
+ FLUSH_REGISTER_WINDOWS; \
19
+ setjmp((th)->ec->machine.regs); \
20
+ SET_MACHINE_STACK_END(&(th)->ec->machine.stack_end); \
21
+ } while (0)
22
+
23
+ /* thread.c */
24
+ #define COVERAGE_INDEX_LINES 0
25
+ #define COVERAGE_INDEX_BRANCHES 1
26
+ #define COVERAGE_TARGET_LINES 1
27
+ #define COVERAGE_TARGET_BRANCHES 2
28
+ #define COVERAGE_TARGET_METHODS 4
29
+ #define COVERAGE_TARGET_ONESHOT_LINES 8
30
+ #define COVERAGE_TARGET_EVAL 16
31
+
32
+ VALUE rb_obj_is_mutex(VALUE obj);
33
+ VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
34
+ void rb_thread_execute_interrupts(VALUE th);
35
+ VALUE rb_get_coverages(void);
36
+ int rb_get_coverage_mode(void);
37
+ VALUE rb_default_coverage(int);
38
+ VALUE rb_thread_shield_new(void);
39
+ bool rb_thread_shield_owned(VALUE self);
40
+ VALUE rb_thread_shield_wait(VALUE self);
41
+ VALUE rb_thread_shield_release(VALUE self);
42
+ VALUE rb_thread_shield_destroy(VALUE self);
43
+ int rb_thread_to_be_killed(VALUE thread);
44
+ void rb_mutex_allow_trap(VALUE self, int val);
45
+ VALUE rb_uninterruptible(VALUE (*b_proc)(VALUE), VALUE data);
46
+ VALUE rb_mutex_owned_p(VALUE self);
47
+ VALUE rb_exec_recursive_outer_mid(VALUE (*f)(VALUE g, VALUE h, int r), VALUE g, VALUE h, ID mid);
48
+
49
+ int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout);
50
+
51
+ RUBY_SYMBOL_EXPORT_BEGIN
52
+ /* Temporary. This API will be removed (renamed). */
53
+ VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
54
+
55
+ /* thread.c (export) */
56
+ int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */
57
+ RUBY_SYMBOL_EXPORT_END
58
+
59
+ int rb_threadptr_execute_interrupts(struct rb_thread_struct *th, int blocking_timing);
60
+
61
+ #endif /* INTERNAL_THREAD_H */
@@ -0,0 +1,34 @@
1
+ #ifndef INTERNAL_TIME_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_TIME_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 Time.
10
+ */
11
+ #include "ruby/internal/config.h" /* for SIGNEDNESS_OF_TIME_T */
12
+ #include "internal/bits.h" /* for SIGNED_INTEGER_MAX */
13
+ #include "ruby/ruby.h" /* for VALUE */
14
+
15
+ #if SIGNEDNESS_OF_TIME_T < 0 /* signed */
16
+ # define TIMET_MAX SIGNED_INTEGER_MAX(time_t)
17
+ # define TIMET_MIN SIGNED_INTEGER_MIN(time_t)
18
+ #elif SIGNEDNESS_OF_TIME_T > 0 /* unsigned */
19
+ # define TIMET_MAX UNSIGNED_INTEGER_MAX(time_t)
20
+ # define TIMET_MIN ((time_t)0)
21
+ #endif
22
+
23
+ struct timeval; /* <- in <sys/time.h> or <winsock2.h> */
24
+
25
+ /* time.c */
26
+ struct timeval rb_time_timeval(VALUE);
27
+
28
+ RUBY_SYMBOL_EXPORT_BEGIN
29
+ /* time.c (export) */
30
+ void ruby_reset_leap_second_info(void);
31
+ void ruby_reset_timezone(void);
32
+ RUBY_SYMBOL_EXPORT_END
33
+
34
+ #endif /* INTERNAL_TIME_H */
@@ -0,0 +1,20 @@
1
+ #ifndef INTERNAL_TRANSCODE_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_TRANSCODE_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 Encoding::Converter.
10
+ */
11
+ #include "ruby/internal/config.h"
12
+ #include <stddef.h> /* for size_t */
13
+ #include "ruby/ruby.h" /* for VALUE */
14
+ #include "ruby/encoding.h" /* for rb_econv_t */
15
+
16
+ /* transcode.c */
17
+ extern VALUE rb_cEncodingConverter;
18
+ size_t rb_econv_memsize(rb_econv_t *);
19
+
20
+ #endif /* INTERNAL_TRANSCODE_H */
@@ -0,0 +1,27 @@
1
+ #ifndef INTERNAL_UTIL_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_UTIL_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 corresponding util.c.
10
+ * @warning DO NOT ADD RANDOM GARBAGE HERE THIS FILE IS FOR util.c
11
+ */
12
+ #include "ruby/internal/config.h"
13
+ #include <stddef.h> /* for size_t */
14
+
15
+ #ifdef HAVE_SYS_TYPES_H
16
+ # include <sys/types.h> /* for ssize_t (note: on Windows ssize_t is */
17
+ #endif /* `#define`d in ruby/config.h) */
18
+
19
+ /* util.c */
20
+ char *ruby_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, char **rve);
21
+ char *ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign, char **rve);
22
+
23
+ RUBY_SYMBOL_EXPORT_BEGIN
24
+ /* util.c (export) */
25
+ RUBY_SYMBOL_EXPORT_END
26
+
27
+ #endif /* INTERNAL_UTIL_H */
@@ -0,0 +1,88 @@
1
+ #ifndef INTERNAL_VARIABLE_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_VARIABLE_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 variables.
10
+ */
11
+ #include "ruby/internal/config.h"
12
+ #include <stddef.h> /* for size_t */
13
+ #include "constant.h" /* for rb_const_entry_t */
14
+ #include "ruby/internal/stdbool.h" /* for bool */
15
+ #include "ruby/ruby.h" /* for VALUE */
16
+ #include "shape.h" /* for rb_shape_t */
17
+
18
+ /* global variable */
19
+
20
+ #define ROBJECT_TRANSIENT_FLAG FL_USER2
21
+
22
+ /* variable.c */
23
+ void rb_gc_mark_global_tbl(void);
24
+ void rb_gc_update_global_tbl(void);
25
+ size_t rb_generic_ivar_memsize(VALUE);
26
+ VALUE rb_search_class_path(VALUE);
27
+ VALUE rb_attr_delete(VALUE, ID);
28
+ void rb_autoload_str(VALUE mod, ID id, VALUE file);
29
+ VALUE rb_autoload_at_p(VALUE, ID, int);
30
+ NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE));
31
+ rb_gvar_getter_t *rb_gvar_getter_function_of(ID);
32
+ rb_gvar_setter_t *rb_gvar_setter_function_of(ID);
33
+ void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_);
34
+ 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);
38
+
39
+ struct gen_ivtbl;
40
+ int rb_gen_ivtbl_get(VALUE obj, ID id, struct gen_ivtbl **ivtbl);
41
+ int rb_obj_evacuate_ivs_to_hash_table(ID key, VALUE val, st_data_t arg);
42
+
43
+ RUBY_SYMBOL_EXPORT_BEGIN
44
+ /* variable.c (export) */
45
+ void rb_mark_and_update_generic_ivar(VALUE);
46
+ void rb_mv_generic_ivar(VALUE src, VALUE dst);
47
+ VALUE rb_const_missing(VALUE klass, VALUE name);
48
+ int rb_class_ivar_set(VALUE klass, ID vid, VALUE value);
49
+ void rb_iv_tbl_copy(VALUE dst, VALUE src);
50
+ RUBY_SYMBOL_EXPORT_END
51
+
52
+ VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef);
53
+ VALUE rb_gvar_get(ID);
54
+ VALUE rb_gvar_set(ID, VALUE);
55
+ VALUE rb_gvar_defined(ID);
56
+ void rb_const_warn_if_deprecated(const rb_const_entry_t *, VALUE, ID);
57
+ rb_shape_t * rb_grow_iv_list(VALUE obj);
58
+ 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
+ attr_index_t rb_obj_ivar_set(VALUE obj, ID id, VALUE val);
61
+
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
+ #endif /* INTERNAL_VARIABLE_H */