debase-ruby_core_source 0.10.7 → 0.10.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +1 -1
  4. data/Rakefile +6 -3
  5. data/debase-ruby_core_source.gemspec +2 -1
  6. data/lib/debase/ruby_core_source.rb +0 -1
  7. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/addr2line.h +0 -0
  8. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/builtin.h +78 -0
  9. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/build_assert/build_assert.h +0 -0
  10. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/check_type/check_type.h +0 -0
  11. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/container_of/container_of.h +0 -0
  12. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/list/list.h +0 -0
  13. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ccan/str/str.h +0 -0
  14. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/constant.h +0 -4
  15. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/debug_counter.h +21 -9
  16. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/dln.h +0 -0
  17. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/encindex.h +0 -0
  18. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/eval_intern.h +1 -3
  19. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/gc.h +2 -0
  20. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/hrtime.h +0 -0
  21. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/id.h +1 -3
  22. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/id_table.h +0 -0
  23. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/insns.inc +6 -2
  24. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/insns_info.inc +1471 -1888
  25. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/internal.h +106 -91
  26. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/iseq.h +5 -5
  27. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/known_errors.inc +0 -0
  28. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/method.h +1 -4
  29. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/mjit.h +3 -5
  30. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/mjit_compile.inc +768 -872
  31. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/node.h +4 -11
  32. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/node_name.inc +0 -2
  33. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/opt_sc.inc +109 -0
  34. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/optinsn.inc +0 -0
  35. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/optunifs.inc +43 -0
  36. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/parse.h +1 -1
  37. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/probes_helper.h +0 -0
  38. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/regenc.h +0 -0
  39. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/regint.h +0 -0
  40. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/regparse.h +0 -0
  41. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/revision.h +2 -0
  42. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ruby_assert.h +0 -0
  43. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/ruby_atomic.h +0 -0
  44. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/siphash.h +0 -0
  45. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/symbol.h +0 -0
  46. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/thread_pthread.h +0 -0
  47. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/thread_win32.h +0 -0
  48. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/timev.h +0 -0
  49. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/transcode_data.h +0 -0
  50. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/transient_heap.h +0 -0
  51. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/variable.h +9 -0
  52. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/version.h +4 -4
  53. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm.inc +604 -407
  54. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_call_iseq_optimized.inc +49 -49
  55. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_core.h +42 -29
  56. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_debug.h +0 -0
  57. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_exec.h +0 -0
  58. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_insnhelper.h +16 -4
  59. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vm_opts.h +2 -0
  60. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-2.7.0-p0}/vmtc.inc +6 -2
  61. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/addr2line.h +20 -0
  62. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/builtin.h +83 -0
  63. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/build_assert/build_assert.h +40 -0
  64. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/check_type/check_type.h +63 -0
  65. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/container_of/container_of.h +142 -0
  66. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/list/list.h +788 -0
  67. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ccan/str/str.h +16 -0
  68. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/constant.h +55 -0
  69. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/debug_counter.h +457 -0
  70. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/dln.h +36 -0
  71. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/encindex.h +70 -0
  72. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/eval_intern.h +323 -0
  73. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/gc.h +140 -0
  74. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/hrtime.h +168 -0
  75. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/id.h +290 -0
  76. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/id_table.h +36 -0
  77. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/insns.inc +249 -0
  78. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/insns_info.inc +8983 -0
  79. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal.h +107 -0
  80. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/array.h +119 -0
  81. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/bignum.h +246 -0
  82. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/bits.h +566 -0
  83. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/class.h +174 -0
  84. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compar.h +50 -0
  85. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compile.h +32 -0
  86. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/compilers.h +108 -0
  87. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/complex.h +29 -0
  88. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/cont.h +25 -0
  89. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/dir.h +17 -0
  90. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enc.h +20 -0
  91. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/encoding.h +28 -0
  92. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enum.h +19 -0
  93. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/enumerator.h +22 -0
  94. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/error.h +124 -0
  95. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/eval.h +33 -0
  96. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/file.h +39 -0
  97. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/fixnum.h +185 -0
  98. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/gc.h +161 -0
  99. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/hash.h +241 -0
  100. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/imemo.h +243 -0
  101. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/inits.h +51 -0
  102. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/io.h +35 -0
  103. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/load.h +19 -0
  104. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/loadpath.h +17 -0
  105. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/math.h +24 -0
  106. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/missing.h +19 -0
  107. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/numeric.h +255 -0
  108. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/object.h +83 -0
  109. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/parse.h +23 -0
  110. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/proc.h +33 -0
  111. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/process.h +136 -0
  112. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/random.h +17 -0
  113. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/range.h +41 -0
  114. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/rational.h +71 -0
  115. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/re.h +29 -0
  116. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/sanitizers.h +191 -0
  117. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/scheduler.h +44 -0
  118. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/serial.h +24 -0
  119. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/signal.h +22 -0
  120. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/static_assert.h +17 -0
  121. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/string.h +140 -0
  122. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/struct.h +154 -0
  123. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/symbol.h +41 -0
  124. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/thread.h +54 -0
  125. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/time.h +35 -0
  126. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/transcode.h +21 -0
  127. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/util.h +31 -0
  128. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/variable.h +84 -0
  129. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/vm.h +136 -0
  130. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/internal/warnings.h +17 -0
  131. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/iseq.h +305 -0
  132. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/known_errors.inc +791 -0
  133. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/method.h +245 -0
  134. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/mjit.h +220 -0
  135. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/mjit_compile.inc +8240 -0
  136. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/node.h +484 -0
  137. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/node_name.inc +210 -0
  138. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/opt_sc.inc +0 -0
  139. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/optinsn.inc +128 -0
  140. data/lib/debase/ruby_core_source/{ruby-2.7.0-preview2 → ruby-3.0.0-p0}/optunifs.inc +0 -0
  141. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/parse.h +211 -0
  142. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/probes_helper.h +44 -0
  143. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ractor_core.h +343 -0
  144. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/regenc.h +254 -0
  145. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/regint.h +938 -0
  146. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/regparse.h +370 -0
  147. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/revision.h +2 -0
  148. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ruby_assert.h +15 -0
  149. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/ruby_atomic.h +23 -0
  150. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/siphash.h +48 -0
  151. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/symbol.h +119 -0
  152. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/thread_pthread.h +115 -0
  153. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/thread_win32.h +61 -0
  154. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/timev.h +57 -0
  155. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/transcode_data.h +138 -0
  156. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/transient_heap.h +65 -0
  157. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/variable.h +22 -0
  158. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/version.h +89 -0
  159. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm.inc +5355 -0
  160. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_call_iseq_optimized.inc +244 -0
  161. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_callinfo.h +456 -0
  162. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_core.h +2023 -0
  163. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_debug.h +116 -0
  164. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_exec.h +196 -0
  165. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_insnhelper.h +257 -0
  166. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_opts.h +73 -0
  167. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vm_sync.h +136 -0
  168. data/lib/debase/ruby_core_source/ruby-3.0.0-p0/vmtc.inc +243 -0
  169. data/lib/debase/ruby_core_source/version.rb +1 -1
  170. metadata +181 -57
  171. data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/revision.h +0 -2
@@ -0,0 +1,174 @@
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_iv_index_tbl_entry {
29
+ uint32_t index;
30
+ rb_serial_t class_serial;
31
+ VALUE class_value;
32
+ };
33
+
34
+ struct rb_classext_struct {
35
+ struct st_table *iv_index_tbl; // ID -> struct rb_iv_index_tbl_entry
36
+ struct st_table *iv_tbl;
37
+ #if SIZEOF_SERIAL_T == SIZEOF_VALUE /* otherwise m_tbl is in struct RClass */
38
+ struct rb_id_table *m_tbl;
39
+ #endif
40
+ struct rb_id_table *const_tbl;
41
+ struct rb_id_table *callable_m_tbl;
42
+ struct rb_id_table *cc_tbl; /* ID -> [[ci, cc1], cc2, ...] */
43
+ struct rb_subclass_entry *subclasses;
44
+ struct rb_subclass_entry **parent_subclasses;
45
+ /**
46
+ * In the case that this is an `ICLASS`, `module_subclasses` points to the link
47
+ * in the module's `subclasses` list that indicates that the klass has been
48
+ * included. Hopefully that makes sense.
49
+ */
50
+ struct rb_subclass_entry **module_subclasses;
51
+ #if SIZEOF_SERIAL_T != SIZEOF_VALUE /* otherwise class_serial is in struct RClass */
52
+ rb_serial_t class_serial;
53
+ #endif
54
+ const VALUE origin_;
55
+ const VALUE refined_class;
56
+ rb_alloc_func_t allocator;
57
+ const VALUE includer;
58
+ };
59
+
60
+ struct RClass {
61
+ struct RBasic basic;
62
+ VALUE super;
63
+ struct rb_classext_struct *ptr;
64
+ #if SIZEOF_SERIAL_T == SIZEOF_VALUE
65
+ /* Class serial is as wide as VALUE. Place it here. */
66
+ rb_serial_t class_serial;
67
+ #else
68
+ /* Class serial does not fit into struct RClass. Place m_tbl instead. */
69
+ struct rb_id_table *m_tbl;
70
+ #endif
71
+ };
72
+
73
+ typedef struct rb_subclass_entry rb_subclass_entry_t;
74
+ typedef struct rb_classext_struct rb_classext_t;
75
+
76
+ #define RCLASS_EXT(c) (RCLASS(c)->ptr)
77
+ #define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
78
+ #define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
79
+ #if SIZEOF_SERIAL_T == SIZEOF_VALUE
80
+ # define RCLASS_M_TBL(c) (RCLASS_EXT(c)->m_tbl)
81
+ #else
82
+ # define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
83
+ #endif
84
+ #define RCLASS_CALLABLE_M_TBL(c) (RCLASS_EXT(c)->callable_m_tbl)
85
+ #define RCLASS_CC_TBL(c) (RCLASS_EXT(c)->cc_tbl)
86
+ #define RCLASS_IV_INDEX_TBL(c) (RCLASS_EXT(c)->iv_index_tbl)
87
+ #define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin_)
88
+ #define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class)
89
+ #if SIZEOF_SERIAL_T == SIZEOF_VALUE
90
+ # define RCLASS_SERIAL(c) (RCLASS(c)->class_serial)
91
+ #else
92
+ # define RCLASS_SERIAL(c) (RCLASS_EXT(c)->class_serial)
93
+ #endif
94
+ #define RCLASS_INCLUDER(c) (RCLASS_EXT(c)->includer)
95
+
96
+ #define RICLASS_IS_ORIGIN FL_USER5
97
+ #define RCLASS_CLONED FL_USER6
98
+ #define RICLASS_ORIGIN_SHARED_MTBL FL_USER8
99
+
100
+ /* class.c */
101
+ void rb_class_subclass_add(VALUE super, VALUE klass);
102
+ void rb_class_remove_from_super_subclasses(VALUE);
103
+ int rb_singleton_class_internal_p(VALUE sklass);
104
+ VALUE rb_class_boot(VALUE);
105
+ VALUE rb_make_metaclass(VALUE, VALUE);
106
+ VALUE rb_include_class_new(VALUE, VALUE);
107
+ void rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE);
108
+ void rb_class_detach_subclasses(VALUE);
109
+ void rb_class_detach_module_subclasses(VALUE);
110
+ void rb_class_remove_from_module_subclasses(VALUE);
111
+ VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj);
112
+ VALUE rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj);
113
+ VALUE rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj);
114
+ VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj);
115
+ VALUE rb_special_singleton_class(VALUE);
116
+ VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach);
117
+ VALUE rb_singleton_class_get(VALUE obj);
118
+ int rb_class_has_methods(VALUE c);
119
+ void rb_undef_methods_from(VALUE klass, VALUE super);
120
+
121
+ static inline void RCLASS_SET_ORIGIN(VALUE klass, VALUE origin);
122
+ static inline void RICLASS_SET_ORIGIN_SHARED_MTBL(VALUE iclass);
123
+ static inline VALUE RCLASS_SUPER(VALUE klass);
124
+ static inline VALUE RCLASS_SET_SUPER(VALUE klass, VALUE super);
125
+ static inline void RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass);
126
+
127
+ MJIT_SYMBOL_EXPORT_BEGIN
128
+ VALUE rb_class_inherited(VALUE, VALUE);
129
+ VALUE rb_keyword_error_new(const char *, VALUE);
130
+ MJIT_SYMBOL_EXPORT_END
131
+
132
+ static inline void
133
+ RCLASS_SET_ORIGIN(VALUE klass, VALUE origin)
134
+ {
135
+ RB_OBJ_WRITE(klass, &RCLASS_ORIGIN(klass), origin);
136
+ if (klass != origin) FL_SET(origin, RICLASS_IS_ORIGIN);
137
+ }
138
+
139
+ static inline void
140
+ RICLASS_SET_ORIGIN_SHARED_MTBL(VALUE iclass)
141
+ {
142
+ FL_SET(iclass, RICLASS_ORIGIN_SHARED_MTBL);
143
+ }
144
+
145
+ static inline bool
146
+ RICLASS_OWNS_M_TBL_P(VALUE iclass)
147
+ {
148
+ return FL_TEST_RAW(iclass, RICLASS_IS_ORIGIN | RICLASS_ORIGIN_SHARED_MTBL) == RICLASS_IS_ORIGIN;
149
+ }
150
+
151
+ static inline void
152
+ RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass)
153
+ {
154
+ RB_OBJ_WRITE(iclass, &RCLASS_INCLUDER(iclass), klass);
155
+ }
156
+
157
+ static inline VALUE
158
+ RCLASS_SUPER(VALUE klass)
159
+ {
160
+ return RCLASS(klass)->super;
161
+ }
162
+
163
+ static inline VALUE
164
+ RCLASS_SET_SUPER(VALUE klass, VALUE super)
165
+ {
166
+ if (super) {
167
+ rb_class_remove_from_super_subclasses(klass);
168
+ rb_class_subclass_add(super, klass);
169
+ }
170
+ RB_OBJ_WRITE(klass, &RCLASS(klass)->super, super);
171
+ return super;
172
+ }
173
+
174
+ #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 */