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,73 @@
1
+ #ifndef RUBY_VM_OPTS_H/*-*-c-*-*/
2
+ #define RUBY_VM_OPTS_H
3
+ /**********************************************************************
4
+
5
+ vm_opts.h - VM optimize option
6
+
7
+ $Author$
8
+
9
+ Copyright (C) 2004-2007 Koichi Sasada
10
+
11
+ **********************************************************************/
12
+
13
+ /* Compile options.
14
+ * You can change these options at runtime by VM::CompileOption.
15
+ * Following definitions are default values.
16
+ */
17
+
18
+ #define OPT_TAILCALL_OPTIMIZATION 0
19
+ #define OPT_PEEPHOLE_OPTIMIZATION 1
20
+ #define OPT_SPECIALISED_INSTRUCTION 1
21
+ #define OPT_INLINE_CONST_CACHE 1
22
+ #define OPT_FROZEN_STRING_LITERAL 0
23
+ #define OPT_DEBUG_FROZEN_STRING_LITERAL 0
24
+
25
+ /* Build Options.
26
+ * You can't change these options at runtime.
27
+ */
28
+
29
+ /* C compiler dependent */
30
+
31
+ /*
32
+ * 0: direct (using labeled goto using GCC special)
33
+ * 1: token (switch/case)
34
+ * 2: call (function call for each insn dispatch)
35
+ */
36
+ #ifndef OPT_THREADED_CODE
37
+ #define OPT_THREADED_CODE 0
38
+ #endif
39
+
40
+ #define OPT_DIRECT_THREADED_CODE (OPT_THREADED_CODE == 0)
41
+ #define OPT_TOKEN_THREADED_CODE (OPT_THREADED_CODE == 1)
42
+ #define OPT_CALL_THREADED_CODE (OPT_THREADED_CODE == 2)
43
+
44
+ /* VM running option */
45
+ #define OPT_CHECKED_RUN 1
46
+ #define OPT_INLINE_METHOD_CACHE 1
47
+ #define OPT_GLOBAL_METHOD_CACHE 1
48
+ #define OPT_BLOCKINLINING 0
49
+
50
+ #ifndef OPT_IC_FOR_IVAR
51
+ #define OPT_IC_FOR_IVAR 1
52
+ #endif
53
+
54
+ /* architecture independent, affects generated code */
55
+ #define OPT_OPERANDS_UNIFICATION 1
56
+ #define OPT_INSTRUCTIONS_UNIFICATION 0
57
+ #define OPT_UNIFY_ALL_COMBINATION 0
58
+ #define OPT_STACK_CACHING 0
59
+
60
+ /* misc */
61
+ #ifndef OPT_SUPPORT_JOKE
62
+ #define OPT_SUPPORT_JOKE 0
63
+ #endif
64
+
65
+ #ifndef OPT_SUPPORT_CALL_C_FUNCTION
66
+ #define OPT_SUPPORT_CALL_C_FUNCTION 0
67
+ #endif
68
+
69
+ #ifndef VM_COLLECT_USAGE_DETAILS
70
+ #define VM_COLLECT_USAGE_DETAILS 0
71
+ #endif
72
+
73
+ #endif /* RUBY_VM_OPTS_H */
@@ -0,0 +1,136 @@
1
+
2
+ #ifndef RUBY_VM_SYNC_H
3
+ #define RUBY_VM_SYNC_H
4
+
5
+ #include "vm_debug.h"
6
+ #include "debug_counter.h"
7
+
8
+ #if USE_RUBY_DEBUG_LOG
9
+ #define LOCATION_ARGS const char *file, int line
10
+ #define LOCATION_PARAMS file, line
11
+ #define APPEND_LOCATION_ARGS , const char *file, int line
12
+ #define APPEND_LOCATION_PARAMS , file, line
13
+ #else
14
+ #define LOCATION_ARGS void
15
+ #define LOCATION_PARAMS
16
+ #define APPEND_LOCATION_ARGS
17
+ #define APPEND_LOCATION_PARAMS
18
+ #endif
19
+
20
+ bool rb_vm_locked_p(void);
21
+ void rb_vm_lock_body(LOCATION_ARGS);
22
+ void rb_vm_unlock_body(LOCATION_ARGS);
23
+
24
+ struct rb_ractor_struct;
25
+ void rb_vm_lock_enter_body_cr(struct rb_ractor_struct *cr, unsigned int *lev APPEND_LOCATION_ARGS);
26
+ void rb_vm_lock_enter_body_nb(unsigned int *lev APPEND_LOCATION_ARGS);
27
+ void rb_vm_lock_enter_body(unsigned int *lev APPEND_LOCATION_ARGS);
28
+ void rb_vm_lock_leave_body(unsigned int *lev APPEND_LOCATION_ARGS);
29
+ void rb_vm_barrier(void);
30
+
31
+ #if RUBY_DEBUG
32
+ // GET_VM()
33
+ #include "vm_core.h"
34
+ #endif
35
+
36
+ RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c
37
+
38
+ static inline bool
39
+ rb_multi_ractor_p(void)
40
+ {
41
+ if (LIKELY(ruby_single_main_ractor)) {
42
+ // 0 on boot time.
43
+ RUBY_ASSERT(GET_VM()->ractor.cnt <= 1);
44
+ return false;
45
+ }
46
+ else {
47
+ // multi-ractor mode can run ractor.cnt == 1
48
+ return true;
49
+ }
50
+ }
51
+
52
+ static inline void
53
+ rb_vm_lock(const char *file, int line)
54
+ {
55
+ RB_DEBUG_COUNTER_INC(vm_sync_lock);
56
+
57
+ if (rb_multi_ractor_p()) {
58
+ rb_vm_lock_body(LOCATION_PARAMS);
59
+ }
60
+ }
61
+
62
+ static inline void
63
+ rb_vm_unlock(const char *file, int line)
64
+ {
65
+ if (rb_multi_ractor_p()) {
66
+ rb_vm_unlock_body(LOCATION_PARAMS);
67
+ }
68
+ }
69
+
70
+ static inline void
71
+ rb_vm_lock_enter(unsigned int *lev, const char *file, int line)
72
+ {
73
+ RB_DEBUG_COUNTER_INC(vm_sync_lock_enter);
74
+
75
+ if (rb_multi_ractor_p()) {
76
+ rb_vm_lock_enter_body(lev APPEND_LOCATION_PARAMS);
77
+ }
78
+ }
79
+
80
+ static inline void
81
+ rb_vm_lock_enter_nb(unsigned int *lev, const char *file, int line)
82
+ {
83
+ RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_nb);
84
+
85
+ if (rb_multi_ractor_p()) {
86
+ rb_vm_lock_enter_body_nb(lev APPEND_LOCATION_PARAMS);
87
+ }
88
+ }
89
+
90
+ static inline void
91
+ rb_vm_lock_leave(unsigned int *lev, const char *file, int line)
92
+ {
93
+ if (rb_multi_ractor_p()) {
94
+ rb_vm_lock_leave_body(lev APPEND_LOCATION_PARAMS);
95
+ }
96
+ }
97
+
98
+ static inline void
99
+ rb_vm_lock_enter_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
100
+ {
101
+ RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_cr);
102
+ rb_vm_lock_enter_body_cr(cr, levp APPEND_LOCATION_PARAMS);
103
+ }
104
+
105
+ static inline void
106
+ rb_vm_lock_leave_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
107
+ {
108
+ rb_vm_lock_leave_body(levp APPEND_LOCATION_PARAMS);
109
+ }
110
+
111
+ #define RB_VM_LOCKED_P() rb_vm_locked_p()
112
+
113
+ #define RB_VM_LOCK() rb_vm_lock(__FILE__, __LINE__)
114
+ #define RB_VM_UNLOCK() rb_vm_unlock(__FILE__, __LINE__)
115
+
116
+ #define RB_VM_LOCK_ENTER_CR_LEV(cr, levp) rb_vm_lock_enter_cr(cr, levp, __FILE__, __LINE__)
117
+ #define RB_VM_LOCK_LEAVE_CR_LEV(cr, levp) rb_vm_lock_leave_cr(cr, levp, __FILE__, __LINE__)
118
+ #define RB_VM_LOCK_ENTER_LEV(levp) rb_vm_lock_enter(levp, __FILE__, __LINE__)
119
+ #define RB_VM_LOCK_LEAVE_LEV(levp) rb_vm_lock_leave(levp, __FILE__, __LINE__)
120
+
121
+ #define RB_VM_LOCK_ENTER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV(&_lev);
122
+ #define RB_VM_LOCK_LEAVE() RB_VM_LOCK_LEAVE_LEV(&_lev); }
123
+
124
+ #define RB_VM_LOCK_ENTER_LEV_NB(levp) rb_vm_lock_enter_nb(levp, __FILE__, __LINE__)
125
+ #define RB_VM_LOCK_ENTER_NO_BARRIER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV_NB(&_lev);
126
+ #define RB_VM_LOCK_LEAVE_NO_BARRIER() RB_VM_LOCK_LEAVE_LEV(&_lev); }
127
+
128
+ #if RUBY_DEBUG > 0
129
+ void ASSERT_vm_locking(void);
130
+ void ASSERT_vm_unlocking(void);
131
+ #else
132
+ #define ASSERT_vm_locking()
133
+ #define ASSERT_vm_unlocking()
134
+ #endif
135
+
136
+ #endif // RUBY_VM_SYNC_H
@@ -0,0 +1,243 @@
1
+ /* -*- C -*- */
2
+
3
+ /* This is an auto-generated file and is a part of the programming language
4
+ * Ruby. The person who created a program to generate this file (``I''
5
+ * hereafter) would like to refrain from defining licensing of this generated
6
+ * source code.
7
+ *
8
+ * This file consists of many small parts of codes copyrighted by each author,
9
+ * not only the ``I'' person. Those original authors agree with some
10
+ * open-source license. I believe that the license we agree is the condition
11
+ * mentioned in the file COPYING. It states "4. You may modify and include
12
+ * the part of the software into any other software ...". But the problem is,
13
+ * the license never makes it clear if such modified parts still remain in the
14
+ * same license, or not. The fact that we agree with the source code's
15
+ * licensing terms does not automatically define that of generated ones. This
16
+ * is the reason why this file is under an unclear situation. All what I know
17
+ * is that above provision guarantees this file to exist.
18
+ *
19
+ * Please let me hesitate to declare something about this nuanced contract. I
20
+ * am not in the position to take over other authors' license to merge into my
21
+ * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday
22
+ * it might turn out to be okay to say this file is under a license. I wish
23
+ * the situation would become more clear in the future. */
24
+ /*******************************************************************/
25
+ /*******************************************************************/
26
+ /*******************************************************************/
27
+ /**
28
+ This file is for threaded code.
29
+
30
+ ----
31
+ This file is auto generated by insns2vm.rb
32
+ DO NOT TOUCH!
33
+
34
+ If you want to fix something, you must edit "tool/ruby_vm/views/vmtc.inc.erb"
35
+ or tool/insns2vm.rb
36
+ */
37
+
38
+ static const void *const insns_address_table[] = {
39
+ LABEL_PTR(nop),
40
+ LABEL_PTR(getlocal),
41
+ LABEL_PTR(setlocal),
42
+ LABEL_PTR(getblockparam),
43
+ LABEL_PTR(setblockparam),
44
+ LABEL_PTR(getblockparamproxy),
45
+ LABEL_PTR(getspecial),
46
+ LABEL_PTR(setspecial),
47
+ LABEL_PTR(getinstancevariable),
48
+ LABEL_PTR(setinstancevariable),
49
+ LABEL_PTR(getclassvariable),
50
+ LABEL_PTR(setclassvariable),
51
+ LABEL_PTR(getconstant),
52
+ LABEL_PTR(setconstant),
53
+ LABEL_PTR(getglobal),
54
+ LABEL_PTR(setglobal),
55
+ LABEL_PTR(putnil),
56
+ LABEL_PTR(putself),
57
+ LABEL_PTR(putobject),
58
+ LABEL_PTR(putspecialobject),
59
+ LABEL_PTR(putstring),
60
+ LABEL_PTR(concatstrings),
61
+ LABEL_PTR(tostring),
62
+ LABEL_PTR(toregexp),
63
+ LABEL_PTR(intern),
64
+ LABEL_PTR(newarray),
65
+ LABEL_PTR(newarraykwsplat),
66
+ LABEL_PTR(duparray),
67
+ LABEL_PTR(duphash),
68
+ LABEL_PTR(expandarray),
69
+ LABEL_PTR(concatarray),
70
+ LABEL_PTR(splatarray),
71
+ LABEL_PTR(newhash),
72
+ LABEL_PTR(newrange),
73
+ LABEL_PTR(pop),
74
+ LABEL_PTR(dup),
75
+ LABEL_PTR(dupn),
76
+ LABEL_PTR(swap),
77
+ LABEL_PTR(reverse),
78
+ LABEL_PTR(topn),
79
+ LABEL_PTR(setn),
80
+ LABEL_PTR(adjuststack),
81
+ LABEL_PTR(defined),
82
+ LABEL_PTR(checkmatch),
83
+ LABEL_PTR(checkkeyword),
84
+ LABEL_PTR(checktype),
85
+ LABEL_PTR(defineclass),
86
+ LABEL_PTR(definemethod),
87
+ LABEL_PTR(definesmethod),
88
+ LABEL_PTR(send),
89
+ LABEL_PTR(opt_send_without_block),
90
+ LABEL_PTR(opt_str_freeze),
91
+ LABEL_PTR(opt_nil_p),
92
+ LABEL_PTR(opt_str_uminus),
93
+ LABEL_PTR(opt_newarray_max),
94
+ LABEL_PTR(opt_newarray_min),
95
+ LABEL_PTR(invokesuper),
96
+ LABEL_PTR(invokeblock),
97
+ LABEL_PTR(leave),
98
+ LABEL_PTR(throw),
99
+ LABEL_PTR(jump),
100
+ LABEL_PTR(branchif),
101
+ LABEL_PTR(branchunless),
102
+ LABEL_PTR(branchnil),
103
+ LABEL_PTR(opt_getinlinecache),
104
+ LABEL_PTR(opt_setinlinecache),
105
+ LABEL_PTR(once),
106
+ LABEL_PTR(opt_case_dispatch),
107
+ LABEL_PTR(opt_plus),
108
+ LABEL_PTR(opt_minus),
109
+ LABEL_PTR(opt_mult),
110
+ LABEL_PTR(opt_div),
111
+ LABEL_PTR(opt_mod),
112
+ LABEL_PTR(opt_eq),
113
+ LABEL_PTR(opt_neq),
114
+ LABEL_PTR(opt_lt),
115
+ LABEL_PTR(opt_le),
116
+ LABEL_PTR(opt_gt),
117
+ LABEL_PTR(opt_ge),
118
+ LABEL_PTR(opt_ltlt),
119
+ LABEL_PTR(opt_and),
120
+ LABEL_PTR(opt_or),
121
+ LABEL_PTR(opt_aref),
122
+ LABEL_PTR(opt_aset),
123
+ LABEL_PTR(opt_aset_with),
124
+ LABEL_PTR(opt_aref_with),
125
+ LABEL_PTR(opt_length),
126
+ LABEL_PTR(opt_size),
127
+ LABEL_PTR(opt_empty_p),
128
+ LABEL_PTR(opt_succ),
129
+ LABEL_PTR(opt_not),
130
+ LABEL_PTR(opt_regexpmatch2),
131
+ LABEL_PTR(invokebuiltin),
132
+ LABEL_PTR(opt_invokebuiltin_delegate),
133
+ LABEL_PTR(opt_invokebuiltin_delegate_leave),
134
+ LABEL_PTR(getlocal_WC_0),
135
+ LABEL_PTR(getlocal_WC_1),
136
+ LABEL_PTR(setlocal_WC_0),
137
+ LABEL_PTR(setlocal_WC_1),
138
+ LABEL_PTR(putobject_INT2FIX_0_),
139
+ LABEL_PTR(putobject_INT2FIX_1_),
140
+ LABEL_PTR(trace_nop),
141
+ LABEL_PTR(trace_getlocal),
142
+ LABEL_PTR(trace_setlocal),
143
+ LABEL_PTR(trace_getblockparam),
144
+ LABEL_PTR(trace_setblockparam),
145
+ LABEL_PTR(trace_getblockparamproxy),
146
+ LABEL_PTR(trace_getspecial),
147
+ LABEL_PTR(trace_setspecial),
148
+ LABEL_PTR(trace_getinstancevariable),
149
+ LABEL_PTR(trace_setinstancevariable),
150
+ LABEL_PTR(trace_getclassvariable),
151
+ LABEL_PTR(trace_setclassvariable),
152
+ LABEL_PTR(trace_getconstant),
153
+ LABEL_PTR(trace_setconstant),
154
+ LABEL_PTR(trace_getglobal),
155
+ LABEL_PTR(trace_setglobal),
156
+ LABEL_PTR(trace_putnil),
157
+ LABEL_PTR(trace_putself),
158
+ LABEL_PTR(trace_putobject),
159
+ LABEL_PTR(trace_putspecialobject),
160
+ LABEL_PTR(trace_putstring),
161
+ LABEL_PTR(trace_concatstrings),
162
+ LABEL_PTR(trace_tostring),
163
+ LABEL_PTR(trace_toregexp),
164
+ LABEL_PTR(trace_intern),
165
+ LABEL_PTR(trace_newarray),
166
+ LABEL_PTR(trace_newarraykwsplat),
167
+ LABEL_PTR(trace_duparray),
168
+ LABEL_PTR(trace_duphash),
169
+ LABEL_PTR(trace_expandarray),
170
+ LABEL_PTR(trace_concatarray),
171
+ LABEL_PTR(trace_splatarray),
172
+ LABEL_PTR(trace_newhash),
173
+ LABEL_PTR(trace_newrange),
174
+ LABEL_PTR(trace_pop),
175
+ LABEL_PTR(trace_dup),
176
+ LABEL_PTR(trace_dupn),
177
+ LABEL_PTR(trace_swap),
178
+ LABEL_PTR(trace_reverse),
179
+ LABEL_PTR(trace_topn),
180
+ LABEL_PTR(trace_setn),
181
+ LABEL_PTR(trace_adjuststack),
182
+ LABEL_PTR(trace_defined),
183
+ LABEL_PTR(trace_checkmatch),
184
+ LABEL_PTR(trace_checkkeyword),
185
+ LABEL_PTR(trace_checktype),
186
+ LABEL_PTR(trace_defineclass),
187
+ LABEL_PTR(trace_definemethod),
188
+ LABEL_PTR(trace_definesmethod),
189
+ LABEL_PTR(trace_send),
190
+ LABEL_PTR(trace_opt_send_without_block),
191
+ LABEL_PTR(trace_opt_str_freeze),
192
+ LABEL_PTR(trace_opt_nil_p),
193
+ LABEL_PTR(trace_opt_str_uminus),
194
+ LABEL_PTR(trace_opt_newarray_max),
195
+ LABEL_PTR(trace_opt_newarray_min),
196
+ LABEL_PTR(trace_invokesuper),
197
+ LABEL_PTR(trace_invokeblock),
198
+ LABEL_PTR(trace_leave),
199
+ LABEL_PTR(trace_throw),
200
+ LABEL_PTR(trace_jump),
201
+ LABEL_PTR(trace_branchif),
202
+ LABEL_PTR(trace_branchunless),
203
+ LABEL_PTR(trace_branchnil),
204
+ LABEL_PTR(trace_opt_getinlinecache),
205
+ LABEL_PTR(trace_opt_setinlinecache),
206
+ LABEL_PTR(trace_once),
207
+ LABEL_PTR(trace_opt_case_dispatch),
208
+ LABEL_PTR(trace_opt_plus),
209
+ LABEL_PTR(trace_opt_minus),
210
+ LABEL_PTR(trace_opt_mult),
211
+ LABEL_PTR(trace_opt_div),
212
+ LABEL_PTR(trace_opt_mod),
213
+ LABEL_PTR(trace_opt_eq),
214
+ LABEL_PTR(trace_opt_neq),
215
+ LABEL_PTR(trace_opt_lt),
216
+ LABEL_PTR(trace_opt_le),
217
+ LABEL_PTR(trace_opt_gt),
218
+ LABEL_PTR(trace_opt_ge),
219
+ LABEL_PTR(trace_opt_ltlt),
220
+ LABEL_PTR(trace_opt_and),
221
+ LABEL_PTR(trace_opt_or),
222
+ LABEL_PTR(trace_opt_aref),
223
+ LABEL_PTR(trace_opt_aset),
224
+ LABEL_PTR(trace_opt_aset_with),
225
+ LABEL_PTR(trace_opt_aref_with),
226
+ LABEL_PTR(trace_opt_length),
227
+ LABEL_PTR(trace_opt_size),
228
+ LABEL_PTR(trace_opt_empty_p),
229
+ LABEL_PTR(trace_opt_succ),
230
+ LABEL_PTR(trace_opt_not),
231
+ LABEL_PTR(trace_opt_regexpmatch2),
232
+ LABEL_PTR(trace_invokebuiltin),
233
+ LABEL_PTR(trace_opt_invokebuiltin_delegate),
234
+ LABEL_PTR(trace_opt_invokebuiltin_delegate_leave),
235
+ LABEL_PTR(trace_getlocal_WC_0),
236
+ LABEL_PTR(trace_getlocal_WC_1),
237
+ LABEL_PTR(trace_setlocal_WC_0),
238
+ LABEL_PTR(trace_setlocal_WC_1),
239
+ LABEL_PTR(trace_putobject_INT2FIX_0_),
240
+ LABEL_PTR(trace_putobject_INT2FIX_1_),
241
+ };
242
+
243
+ ASSERT_VM_INSTRUCTION_SIZE(insns_address_table);