debase-ruby_core_source 0.10.10 → 0.10.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +6 -3
  3. data/debase-ruby_core_source.gemspec +4 -4
  4. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/addr2line.h +20 -0
  5. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/builtin.h +83 -0
  6. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/build_assert/build_assert.h +40 -0
  7. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/check_type/check_type.h +63 -0
  8. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/container_of/container_of.h +142 -0
  9. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/list/list.h +788 -0
  10. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/str/str.h +16 -0
  11. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/constant.h +55 -0
  12. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/debug_counter.h +423 -0
  13. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/dln.h +36 -0
  14. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/encindex.h +70 -0
  15. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/eval_intern.h +312 -0
  16. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/gc.h +140 -0
  17. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/hrtime.h +168 -0
  18. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/id.h +290 -0
  19. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/id_table.h +36 -0
  20. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/insns.inc +249 -0
  21. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/insns_info.inc +8979 -0
  22. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal.h +107 -0
  23. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/array.h +114 -0
  24. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/bignum.h +246 -0
  25. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/bits.h +566 -0
  26. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/class.h +168 -0
  27. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/compar.h +50 -0
  28. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/compile.h +32 -0
  29. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/compilers.h +108 -0
  30. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/complex.h +29 -0
  31. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/cont.h +25 -0
  32. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/dir.h +17 -0
  33. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/enc.h +20 -0
  34. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/encoding.h +28 -0
  35. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/enum.h +19 -0
  36. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/enumerator.h +22 -0
  37. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/error.h +131 -0
  38. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/eval.h +33 -0
  39. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/file.h +39 -0
  40. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/fixnum.h +185 -0
  41. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/gc.h +154 -0
  42. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/hash.h +240 -0
  43. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/imemo.h +243 -0
  44. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/inits.h +51 -0
  45. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/io.h +35 -0
  46. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/load.h +19 -0
  47. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/loadpath.h +17 -0
  48. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/math.h +24 -0
  49. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/missing.h +19 -0
  50. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/mjit.h +29 -0
  51. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/numeric.h +252 -0
  52. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/object.h +83 -0
  53. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/parse.h +23 -0
  54. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/proc.h +32 -0
  55. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/process.h +136 -0
  56. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/random.h +17 -0
  57. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/range.h +37 -0
  58. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/rational.h +69 -0
  59. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/re.h +29 -0
  60. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/sanitizers.h +191 -0
  61. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/scheduler.h +35 -0
  62. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/serial.h +24 -0
  63. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/signal.h +22 -0
  64. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/static_assert.h +17 -0
  65. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/string.h +135 -0
  66. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/struct.h +154 -0
  67. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/symbol.h +41 -0
  68. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/thread.h +60 -0
  69. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/time.h +35 -0
  70. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/transcode.h +21 -0
  71. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/util.h +31 -0
  72. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/variable.h +83 -0
  73. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/vm.h +135 -0
  74. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/warnings.h +17 -0
  75. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/iseq.h +304 -0
  76. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/known_errors.inc +791 -0
  77. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/method.h +245 -0
  78. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/mjit.h +197 -0
  79. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/mjit_compile.inc +8082 -0
  80. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/node.h +484 -0
  81. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/node_name.inc +210 -0
  82. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/opt_sc.inc +109 -0
  83. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/optinsn.inc +128 -0
  84. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/optunifs.inc +43 -0
  85. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/parse.h +211 -0
  86. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/probes_helper.h +44 -0
  87. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ractor.h +271 -0
  88. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ractor_pub.h +50 -0
  89. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/regenc.h +254 -0
  90. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/regint.h +938 -0
  91. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/regparse.h +370 -0
  92. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/revision.h +2 -0
  93. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ruby_assert.h +15 -0
  94. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ruby_atomic.h +236 -0
  95. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/siphash.h +48 -0
  96. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/symbol.h +119 -0
  97. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/thread_pthread.h +106 -0
  98. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/thread_win32.h +66 -0
  99. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/timev.h +57 -0
  100. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/transcode_data.h +138 -0
  101. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/transient_heap.h +61 -0
  102. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/variable.h +21 -0
  103. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/version.h +89 -0
  104. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm.inc +5360 -0
  105. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_call_iseq_optimized.inc +244 -0
  106. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_callinfo.h +457 -0
  107. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_core.h +1952 -0
  108. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_debug.h +116 -0
  109. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_exec.h +196 -0
  110. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_insnhelper.h +260 -0
  111. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_opts.h +73 -0
  112. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_sync.h +97 -0
  113. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vmtc.inc +243 -0
  114. data/lib/debase/ruby_core_source/version.rb +1 -1
  115. metadata +123 -13
@@ -0,0 +1,168 @@
1
+ #ifndef INTERNAL_CLASS_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_CLASS_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Class.
11
+ */
12
+ #include "id_table.h" /* for struct rb_id_table */
13
+ #include "internal/gc.h" /* for RB_OBJ_WRITE */
14
+ #include "internal/serial.h" /* for rb_serial_t */
15
+ #include "ruby/internal/stdbool.h" /* for bool */
16
+ #include "ruby/intern.h" /* for rb_alloc_func_t */
17
+ #include "ruby/ruby.h" /* for struct RBasic */
18
+
19
+ #ifdef RCLASS_SUPER
20
+ # undef RCLASS_SUPER
21
+ #endif
22
+
23
+ struct rb_subclass_entry {
24
+ VALUE klass;
25
+ struct rb_subclass_entry *next;
26
+ };
27
+
28
+ struct rb_classext_struct {
29
+ struct st_table *iv_index_tbl;
30
+ struct st_table *iv_tbl;
31
+ #if SIZEOF_SERIAL_T == SIZEOF_VALUE /* otherwise m_tbl is in struct RClass */
32
+ struct rb_id_table *m_tbl;
33
+ #endif
34
+ struct rb_id_table *const_tbl;
35
+ struct rb_id_table *callable_m_tbl;
36
+ struct rb_id_table *cc_tbl; /* ID -> [[ci, cc1], cc2, ...] */
37
+ struct rb_subclass_entry *subclasses;
38
+ struct rb_subclass_entry **parent_subclasses;
39
+ /**
40
+ * In the case that this is an `ICLASS`, `module_subclasses` points to the link
41
+ * in the module's `subclasses` list that indicates that the klass has been
42
+ * included. Hopefully that makes sense.
43
+ */
44
+ struct rb_subclass_entry **module_subclasses;
45
+ #if SIZEOF_SERIAL_T != SIZEOF_VALUE /* otherwise class_serial is in struct RClass */
46
+ rb_serial_t class_serial;
47
+ #endif
48
+ const VALUE origin_;
49
+ const VALUE refined_class;
50
+ rb_alloc_func_t allocator;
51
+ const VALUE includer;
52
+ };
53
+
54
+ struct RClass {
55
+ struct RBasic basic;
56
+ VALUE super;
57
+ struct rb_classext_struct *ptr;
58
+ #if SIZEOF_SERIAL_T == SIZEOF_VALUE
59
+ /* Class serial is as wide as VALUE. Place it here. */
60
+ rb_serial_t class_serial;
61
+ #else
62
+ /* Class serial does not fit into struct RClass. Place m_tbl instead. */
63
+ struct rb_id_table *m_tbl;
64
+ #endif
65
+ };
66
+
67
+ typedef struct rb_subclass_entry rb_subclass_entry_t;
68
+ typedef struct rb_classext_struct rb_classext_t;
69
+
70
+ #define RCLASS_EXT(c) (RCLASS(c)->ptr)
71
+ #define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
72
+ #define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
73
+ #if SIZEOF_SERIAL_T == SIZEOF_VALUE
74
+ # define RCLASS_M_TBL(c) (RCLASS_EXT(c)->m_tbl)
75
+ #else
76
+ # define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
77
+ #endif
78
+ #define RCLASS_CALLABLE_M_TBL(c) (RCLASS_EXT(c)->callable_m_tbl)
79
+ #define RCLASS_CC_TBL(c) (RCLASS_EXT(c)->cc_tbl)
80
+ #define RCLASS_IV_INDEX_TBL(c) (RCLASS_EXT(c)->iv_index_tbl)
81
+ #define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin_)
82
+ #define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class)
83
+ #if SIZEOF_SERIAL_T == SIZEOF_VALUE
84
+ # define RCLASS_SERIAL(c) (RCLASS(c)->class_serial)
85
+ #else
86
+ # define RCLASS_SERIAL(c) (RCLASS_EXT(c)->class_serial)
87
+ #endif
88
+ #define RCLASS_INCLUDER(c) (RCLASS_EXT(c)->includer)
89
+
90
+ #define RICLASS_IS_ORIGIN FL_USER5
91
+ #define RCLASS_CLONED FL_USER6
92
+ #define RICLASS_ORIGIN_SHARED_MTBL FL_USER8
93
+
94
+ /* class.c */
95
+ void rb_class_subclass_add(VALUE super, VALUE klass);
96
+ void rb_class_remove_from_super_subclasses(VALUE);
97
+ int rb_singleton_class_internal_p(VALUE sklass);
98
+ VALUE rb_class_boot(VALUE);
99
+ VALUE rb_make_metaclass(VALUE, VALUE);
100
+ VALUE rb_include_class_new(VALUE, VALUE);
101
+ void rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE);
102
+ void rb_class_detach_subclasses(VALUE);
103
+ void rb_class_detach_module_subclasses(VALUE);
104
+ void rb_class_remove_from_module_subclasses(VALUE);
105
+ VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj);
106
+ VALUE rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj);
107
+ VALUE rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj);
108
+ VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj);
109
+ VALUE rb_special_singleton_class(VALUE);
110
+ VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach);
111
+ VALUE rb_singleton_class_get(VALUE obj);
112
+ int rb_class_has_methods(VALUE c);
113
+ void rb_undef_methods_from(VALUE klass, VALUE super);
114
+
115
+ static inline void RCLASS_SET_ORIGIN(VALUE klass, VALUE origin);
116
+ static inline void RICLASS_SET_ORIGIN_SHARED_MTBL(VALUE iclass);
117
+ static inline VALUE RCLASS_SUPER(VALUE klass);
118
+ static inline VALUE RCLASS_SET_SUPER(VALUE klass, VALUE super);
119
+ static inline void RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass);
120
+
121
+ MJIT_SYMBOL_EXPORT_BEGIN
122
+ VALUE rb_class_inherited(VALUE, VALUE);
123
+ VALUE rb_keyword_error_new(const char *, VALUE);
124
+ MJIT_SYMBOL_EXPORT_END
125
+
126
+ static inline void
127
+ RCLASS_SET_ORIGIN(VALUE klass, VALUE origin)
128
+ {
129
+ RB_OBJ_WRITE(klass, &RCLASS_ORIGIN(klass), origin);
130
+ if (klass != origin) FL_SET(origin, RICLASS_IS_ORIGIN);
131
+ }
132
+
133
+ static inline void
134
+ RICLASS_SET_ORIGIN_SHARED_MTBL(VALUE iclass)
135
+ {
136
+ FL_SET(iclass, RICLASS_ORIGIN_SHARED_MTBL);
137
+ }
138
+
139
+ static inline bool
140
+ RICLASS_OWNS_M_TBL_P(VALUE iclass)
141
+ {
142
+ return FL_TEST_RAW(iclass, RICLASS_IS_ORIGIN | RICLASS_ORIGIN_SHARED_MTBL) == RICLASS_IS_ORIGIN;
143
+ }
144
+
145
+ static inline void
146
+ RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass)
147
+ {
148
+ RB_OBJ_WRITE(iclass, &RCLASS_INCLUDER(iclass), klass);
149
+ }
150
+
151
+ static inline VALUE
152
+ RCLASS_SUPER(VALUE klass)
153
+ {
154
+ return RCLASS(klass)->super;
155
+ }
156
+
157
+ static inline VALUE
158
+ RCLASS_SET_SUPER(VALUE klass, VALUE super)
159
+ {
160
+ if (super) {
161
+ rb_class_remove_from_super_subclasses(klass);
162
+ rb_class_subclass_add(super, klass);
163
+ }
164
+ RB_OBJ_WRITE(klass, &RCLASS(klass)->super, super);
165
+ return super;
166
+ }
167
+
168
+ #endif /* INTERNAL_CLASS_H */
@@ -0,0 +1,50 @@
1
+ #ifndef INTERNAL_COMPAR_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_COMPAR_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Comparable.
11
+ */
12
+ #include "internal/vm.h" /* for rb_method_basic_definition_p */
13
+
14
+ #define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString)
15
+
16
+ enum {
17
+ cmp_opt_Integer,
18
+ cmp_opt_String,
19
+ cmp_opt_Float,
20
+ cmp_optimizable_count
21
+ };
22
+
23
+ struct cmp_opt_data {
24
+ unsigned int opt_methods;
25
+ unsigned int opt_inited;
26
+ };
27
+
28
+ #define NEW_CMP_OPT_MEMO(type, value) \
29
+ NEW_PARTIAL_MEMO_FOR(type, value, cmp_opt)
30
+ #define CMP_OPTIMIZABLE_BIT(type) (1U << TOKEN_PASTE(cmp_opt_,type))
31
+ #define CMP_OPTIMIZABLE(data, type) \
32
+ (((data).opt_inited & CMP_OPTIMIZABLE_BIT(type)) ? \
33
+ ((data).opt_methods & CMP_OPTIMIZABLE_BIT(type)) : \
34
+ (((data).opt_inited |= CMP_OPTIMIZABLE_BIT(type)), \
35
+ rb_method_basic_definition_p(TOKEN_PASTE(rb_c,type), id_cmp) && \
36
+ ((data).opt_methods |= CMP_OPTIMIZABLE_BIT(type))))
37
+
38
+ #define OPTIMIZED_CMP(a, b, data) \
39
+ ((FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data, Integer)) ? \
40
+ (((long)a > (long)b) ? 1 : ((long)a < (long)b) ? -1 : 0) : \
41
+ (STRING_P(a) && STRING_P(b) && CMP_OPTIMIZABLE(data, String)) ? \
42
+ rb_str_cmp(a, b) : \
43
+ (RB_FLOAT_TYPE_P(a) && RB_FLOAT_TYPE_P(b) && CMP_OPTIMIZABLE(data, Float)) ? \
44
+ rb_float_cmp(a, b) : \
45
+ rb_cmpint(rb_funcallv(a, id_cmp, 1, &b), a, b))
46
+
47
+ /* compar.c */
48
+ VALUE rb_invcmp(VALUE, VALUE);
49
+
50
+ #endif /* INTERNAL_COMPAR_H */
@@ -0,0 +1,32 @@
1
+ #ifndef INTERNAL_COMPILE_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_COMPILE_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for the compiler.
11
+ */
12
+ #include "ruby/internal/config.h"
13
+ #include <stddef.h> /* for size_t */
14
+ #include "ruby/ruby.h" /* for rb_event_flag_t */
15
+
16
+ struct rb_iseq_struct; /* in vm_core.h */
17
+
18
+ /* compile.c */
19
+ int rb_dvar_defined(ID, const struct rb_iseq_struct *);
20
+ int rb_local_defined(ID, const struct rb_iseq_struct *);
21
+ const char *rb_insns_name(int i);
22
+ VALUE rb_insns_name_array(void);
23
+
24
+ /* iseq.c */
25
+ int rb_vm_insn_addr2insn(const void *);
26
+
27
+ MJIT_SYMBOL_EXPORT_BEGIN
28
+ /* iseq.c (export) */
29
+ rb_event_flag_t rb_iseq_event_flags(const struct rb_iseq_struct *iseq, size_t pos);
30
+ MJIT_SYMBOL_EXPORT_END
31
+
32
+ #endif /* INTERNAL_COMPILE_H */
@@ -0,0 +1,108 @@
1
+ #ifndef INTERNAL_COMPILERS_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_COMPILERS_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header absorbing C compipler differences.
11
+ */
12
+ #include "ruby/internal/compiler_since.h"
13
+ #include "ruby/internal/has/attribute.h"
14
+ #include "ruby/internal/has/builtin.h"
15
+ #include "ruby/internal/has/c_attribute.h"
16
+ #include "ruby/internal/has/declspec_attribute.h"
17
+ #include "ruby/internal/has/extension.h"
18
+ #include "ruby/internal/has/feature.h"
19
+ #include "ruby/internal/has/warning.h"
20
+ #include "ruby/backward/2/gcc_version_since.h"
21
+
22
+ #define MSC_VERSION_SINCE(_) RBIMPL_COMPILER_SINCE(MSVC, (_) / 100, (_) % 100, 0)
23
+ #define MSC_VERSION_BEFORE(_) RBIMPL_COMPILER_BEFORE(MSVC, (_) / 100, (_) % 100, 0)
24
+
25
+ #ifndef __has_attribute
26
+ # define __has_attribute(...) RBIMPL_HAS_ATTRIBUTE(__VA_ARGS__)
27
+ #endif
28
+
29
+ #ifndef __has_c_attribute
30
+ # /* As of writing everything that lacks __has_c_attribute also completely
31
+ # * lacks C2x attributes as well. Might change in future? */
32
+ # define __has_c_attribute(...) 0
33
+ #endif
34
+
35
+ #ifndef __has_declspec_attribute
36
+ # define __has_declspec_attribute(...) RBIMPL_HAS_DECLSPEC_ATTRIBUTE(__VA_ARGS__)
37
+ #endif
38
+
39
+ #ifndef __has_builtin
40
+ # define __has_builtin(...) RBIMPL_HAS_BUILTIN(__VA_ARGS__)
41
+ #endif
42
+
43
+ #ifndef __has_feature
44
+ # define __has_feature(...) RBIMPL_HAS_FEATURE(__VA_ARGS__)
45
+ #endif
46
+
47
+ #ifndef __has_extension
48
+ # define __has_extension(...) RBIMPL_HAS_EXTENSION(__VA_ARGS__)
49
+ #endif
50
+
51
+ #ifndef __has_warning
52
+ # define __has_warning(...) RBIMPL_HAS_WARNING(__VA_ARGS__)
53
+ #endif
54
+
55
+ #ifndef __GNUC__
56
+ # define __extension__ /* void */
57
+ #endif
58
+
59
+ #ifndef MAYBE_UNUSED
60
+ # define MAYBE_UNUSED(x) x
61
+ #endif
62
+
63
+ #ifndef WARN_UNUSED_RESULT
64
+ # define WARN_UNUSED_RESULT(x) x
65
+ #endif
66
+
67
+ #define RB_OBJ_BUILTIN_TYPE(obj) rb_obj_builtin_type(obj)
68
+ #define OBJ_BUILTIN_TYPE(obj) RB_OBJ_BUILTIN_TYPE(obj)
69
+ #ifdef __GNUC__
70
+ #define rb_obj_builtin_type(obj) \
71
+ __extension__({ \
72
+ VALUE arg_obj = (obj); \
73
+ RB_SPECIAL_CONST_P(arg_obj) ? -1 : \
74
+ (int)RB_BUILTIN_TYPE(arg_obj); \
75
+ })
76
+ #else
77
+ # include "ruby/ruby.h"
78
+ static inline int
79
+ rb_obj_builtin_type(VALUE obj)
80
+ {
81
+ return RB_SPECIAL_CONST_P(obj) ? -1 :
82
+ (int)RB_BUILTIN_TYPE(obj);
83
+ }
84
+ #endif
85
+
86
+ /* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */
87
+ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
88
+ # define FLEX_ARY_LEN /* VALUE ary[]; */
89
+ #elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
90
+ # define FLEX_ARY_LEN 0 /* VALUE ary[0]; */
91
+ #else
92
+ # define FLEX_ARY_LEN 1 /* VALUE ary[1]; */
93
+ #endif
94
+
95
+ /*
96
+ * For declaring bitfields out of non-unsigned int types:
97
+ * struct date {
98
+ * BITFIELD(enum months, month, 4);
99
+ * ...
100
+ * };
101
+ */
102
+ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
103
+ # define BITFIELD(type, name, size) type name : size
104
+ #else
105
+ # define BITFIELD(type, name, size) unsigned int name : size
106
+ #endif
107
+
108
+ #endif /* INTERNAL_COMPILERS_H */
@@ -0,0 +1,29 @@
1
+ #ifndef INTERNAL_COMPLEX_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_COMPLEX_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Complex.
11
+ */
12
+ #include "ruby/internal/value.h" /* for struct RBasic */
13
+
14
+ struct RComplex {
15
+ struct RBasic basic;
16
+ VALUE real;
17
+ VALUE imag;
18
+ };
19
+
20
+ #define RCOMPLEX(obj) ((struct RComplex *)(obj))
21
+
22
+ /* shortcut macro for internal only */
23
+ #define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->real, (r))
24
+ #define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->imag, (i))
25
+
26
+ /* complex.c */
27
+ VALUE rb_dbl_complex_new_polar_pi(double abs, double ang);
28
+
29
+ #endif /* INTERNAL_COMPLEX_H */
@@ -0,0 +1,25 @@
1
+ #ifndef INTERNAL_CONT_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_CONT_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Fiber.
11
+ */
12
+ #include "ruby/ruby.h" /* for VALUE */
13
+
14
+ struct rb_thread_struct; /* in vm_core.h */
15
+ struct rb_fiber_struct; /* in cont.c */
16
+
17
+ /* cont.c */
18
+ VALUE rb_obj_is_fiber(VALUE);
19
+ void rb_fiber_reset_root_local_storage(struct rb_thread_struct *);
20
+ void ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(VALUE), VALUE (*rollback_func)(VALUE));
21
+ void rb_fiber_init_mjit_cont(struct rb_fiber_struct *fiber);
22
+
23
+ VALUE rb_fiberptr_self(struct rb_fiber_struct *fiber);
24
+
25
+ #endif /* INTERNAL_CONT_H */
@@ -0,0 +1,17 @@
1
+ #ifndef INTERNAL_DIR_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_DIR_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Dir.
11
+ */
12
+ #include "ruby/ruby.h" /* for VALUE */
13
+
14
+ /* dir.c */
15
+ VALUE rb_dir_getwd_ospath(void);
16
+
17
+ #endif /* INTERNAL_DIR_H */
@@ -0,0 +1,20 @@
1
+ #ifndef INTERNAL_ENC_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_ENC_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Encoding.
11
+ */
12
+ #include "ruby/encoding.h" /* for rb_encoding */
13
+
14
+ /* us_ascii.c */
15
+ extern rb_encoding OnigEncodingUS_ASCII;
16
+
17
+ /* utf_8.c */
18
+ extern rb_encoding OnigEncodingUTF_8;
19
+
20
+ #endif /* INTERNAL_ENC_H */