debase-ruby_core_source 0.10.12 → 0.10.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/addr2line.h +20 -0
  3. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/builtin.h +83 -0
  4. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ccan/build_assert/build_assert.h +40 -0
  5. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ccan/check_type/check_type.h +63 -0
  6. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ccan/container_of/container_of.h +142 -0
  7. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ccan/list/list.h +788 -0
  8. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ccan/str/str.h +16 -0
  9. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/constant.h +55 -0
  10. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/darray.h +198 -0
  11. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/debug_counter.h +467 -0
  12. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/dln.h +31 -0
  13. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/encindex.h +70 -0
  14. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/eval_intern.h +304 -0
  15. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/gc.h +142 -0
  16. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/hrtime.h +168 -0
  17. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/id.h +293 -0
  18. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/id_table.h +36 -0
  19. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/insns.inc +247 -0
  20. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/insns_info.inc +8978 -0
  21. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/array.h +113 -0
  22. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/bignum.h +246 -0
  23. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/bits.h +565 -0
  24. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/class.h +188 -0
  25. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/compar.h +49 -0
  26. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/compile.h +35 -0
  27. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/compilers.h +107 -0
  28. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/complex.h +29 -0
  29. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/cont.h +24 -0
  30. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/dir.h +16 -0
  31. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/enc.h +19 -0
  32. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/encoding.h +30 -0
  33. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/enum.h +18 -0
  34. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/enumerator.h +21 -0
  35. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/error.h +191 -0
  36. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/eval.h +32 -0
  37. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/file.h +38 -0
  38. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/fixnum.h +184 -0
  39. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/gc.h +175 -0
  40. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/hash.h +243 -0
  41. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/imemo.h +243 -0
  42. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/inits.h +50 -0
  43. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/io.h +38 -0
  44. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/load.h +18 -0
  45. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/loadpath.h +16 -0
  46. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/math.h +23 -0
  47. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/missing.h +18 -0
  48. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/numeric.h +271 -0
  49. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/object.h +83 -0
  50. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/parse.h +23 -0
  51. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/proc.h +32 -0
  52. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/process.h +137 -0
  53. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/random.h +16 -0
  54. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/range.h +40 -0
  55. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/rational.h +72 -0
  56. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/re.h +30 -0
  57. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/sanitizers.h +190 -0
  58. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/serial.h +23 -0
  59. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/signal.h +21 -0
  60. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/static_assert.h +16 -0
  61. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/string.h +141 -0
  62. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/struct.h +153 -0
  63. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/symbol.h +40 -0
  64. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/thread.h +53 -0
  65. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/time.h +34 -0
  66. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/transcode.h +20 -0
  67. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/util.h +27 -0
  68. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/variable.h +83 -0
  69. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/vm.h +132 -0
  70. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/warnings.h +16 -0
  71. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal.h +109 -0
  72. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/iseq.h +320 -0
  73. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/known_errors.inc +791 -0
  74. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/method.h +245 -0
  75. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/mjit.h +231 -0
  76. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/mjit_compile.inc +8265 -0
  77. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/node.h +499 -0
  78. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/node_name.inc +210 -0
  79. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/opt_sc.inc +107 -0
  80. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/optinsn.inc +128 -0
  81. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/optunifs.inc +43 -0
  82. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/parse.h +214 -0
  83. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/probes_helper.h +44 -0
  84. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ractor_core.h +346 -0
  85. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/regenc.h +254 -0
  86. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/regint.h +942 -0
  87. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/regparse.h +370 -0
  88. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/revision.h +2 -0
  89. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ruby_assert.h +14 -0
  90. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ruby_atomic.h +23 -0
  91. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/siphash.h +48 -0
  92. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/symbol.h +119 -0
  93. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/thread_pthread.h +115 -0
  94. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/thread_win32.h +61 -0
  95. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/timev.h +57 -0
  96. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/transcode_data.h +138 -0
  97. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/transient_heap.h +65 -0
  98. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/variable.h +21 -0
  99. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/version.h +88 -0
  100. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm.inc +5415 -0
  101. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_call_iseq_optimized.inc +244 -0
  102. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_callinfo.h +454 -0
  103. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_core.h +2103 -0
  104. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_debug.h +119 -0
  105. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_exec.h +197 -0
  106. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_insnhelper.h +265 -0
  107. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_opts.h +73 -0
  108. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_sync.h +137 -0
  109. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vmtc.inc +241 -0
  110. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit.h +63 -0
  111. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_asm.h +392 -0
  112. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_codegen.h +19 -0
  113. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_core.h +302 -0
  114. data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_iface.h +38 -0
  115. data/lib/debase/ruby_core_source/version.rb +1 -1
  116. metadata +116 -3
@@ -0,0 +1,137 @@
1
+ #ifndef RUBY_VM_SYNC_H
2
+ #define RUBY_VM_SYNC_H
3
+
4
+ #include "vm_debug.h"
5
+ #include "debug_counter.h"
6
+
7
+ #if USE_RUBY_DEBUG_LOG
8
+ #define LOCATION_ARGS const char *file, int line
9
+ #define LOCATION_PARAMS file, line
10
+ #define APPEND_LOCATION_ARGS , const char *file, int line
11
+ #define APPEND_LOCATION_PARAMS , file, line
12
+ #else
13
+ #define LOCATION_ARGS void
14
+ #define LOCATION_PARAMS
15
+ #define APPEND_LOCATION_ARGS
16
+ #define APPEND_LOCATION_PARAMS
17
+ #endif
18
+
19
+ bool rb_vm_locked_p(void);
20
+ void rb_vm_lock_body(LOCATION_ARGS);
21
+ void rb_vm_unlock_body(LOCATION_ARGS);
22
+
23
+ struct rb_ractor_struct;
24
+ void rb_vm_lock_enter_body_cr(struct rb_ractor_struct *cr, unsigned int *lev APPEND_LOCATION_ARGS);
25
+ void rb_vm_lock_enter_body_nb(unsigned int *lev APPEND_LOCATION_ARGS);
26
+ void rb_vm_lock_enter_body(unsigned int *lev APPEND_LOCATION_ARGS);
27
+ void rb_vm_lock_leave_body(unsigned int *lev APPEND_LOCATION_ARGS);
28
+ void rb_vm_barrier(void);
29
+
30
+ #if RUBY_DEBUG
31
+ // GET_VM()
32
+ #include "vm_core.h"
33
+ #endif
34
+
35
+ RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c
36
+
37
+ static inline bool
38
+ rb_multi_ractor_p(void)
39
+ {
40
+ if (LIKELY(ruby_single_main_ractor)) {
41
+ // 0 on boot time.
42
+ RUBY_ASSERT(GET_VM()->ractor.cnt <= 1);
43
+ return false;
44
+ }
45
+ else {
46
+ // multi-ractor mode can run ractor.cnt == 1
47
+ return true;
48
+ }
49
+ }
50
+
51
+ static inline void
52
+ rb_vm_lock(const char *file, int line)
53
+ {
54
+ RB_DEBUG_COUNTER_INC(vm_sync_lock);
55
+
56
+ if (rb_multi_ractor_p()) {
57
+ rb_vm_lock_body(LOCATION_PARAMS);
58
+ }
59
+ }
60
+
61
+ static inline void
62
+ rb_vm_unlock(const char *file, int line)
63
+ {
64
+ if (rb_multi_ractor_p()) {
65
+ rb_vm_unlock_body(LOCATION_PARAMS);
66
+ }
67
+ }
68
+
69
+ static inline void
70
+ rb_vm_lock_enter(unsigned int *lev, const char *file, int line)
71
+ {
72
+ RB_DEBUG_COUNTER_INC(vm_sync_lock_enter);
73
+
74
+ if (rb_multi_ractor_p()) {
75
+ rb_vm_lock_enter_body(lev APPEND_LOCATION_PARAMS);
76
+ }
77
+ }
78
+
79
+ static inline void
80
+ rb_vm_lock_enter_nb(unsigned int *lev, const char *file, int line)
81
+ {
82
+ RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_nb);
83
+
84
+ if (rb_multi_ractor_p()) {
85
+ rb_vm_lock_enter_body_nb(lev APPEND_LOCATION_PARAMS);
86
+ }
87
+ }
88
+
89
+ static inline void
90
+ rb_vm_lock_leave(unsigned int *lev, const char *file, int line)
91
+ {
92
+ if (rb_multi_ractor_p()) {
93
+ rb_vm_lock_leave_body(lev APPEND_LOCATION_PARAMS);
94
+ }
95
+ }
96
+
97
+ static inline void
98
+ rb_vm_lock_enter_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
99
+ {
100
+ RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_cr);
101
+ rb_vm_lock_enter_body_cr(cr, levp APPEND_LOCATION_PARAMS);
102
+ }
103
+
104
+ static inline void
105
+ rb_vm_lock_leave_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
106
+ {
107
+ rb_vm_lock_leave_body(levp APPEND_LOCATION_PARAMS);
108
+ }
109
+
110
+ #define RB_VM_LOCKED_P() rb_vm_locked_p()
111
+
112
+ #define RB_VM_LOCK() rb_vm_lock(__FILE__, __LINE__)
113
+ #define RB_VM_UNLOCK() rb_vm_unlock(__FILE__, __LINE__)
114
+
115
+ #define RB_VM_LOCK_ENTER_CR_LEV(cr, levp) rb_vm_lock_enter_cr(cr, levp, __FILE__, __LINE__)
116
+ #define RB_VM_LOCK_LEAVE_CR_LEV(cr, levp) rb_vm_lock_leave_cr(cr, levp, __FILE__, __LINE__)
117
+ #define RB_VM_LOCK_ENTER_LEV(levp) rb_vm_lock_enter(levp, __FILE__, __LINE__)
118
+ #define RB_VM_LOCK_LEAVE_LEV(levp) rb_vm_lock_leave(levp, __FILE__, __LINE__)
119
+
120
+ #define RB_VM_LOCK_ENTER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV(&_lev);
121
+ #define RB_VM_LOCK_LEAVE() RB_VM_LOCK_LEAVE_LEV(&_lev); }
122
+
123
+ #define RB_VM_LOCK_ENTER_LEV_NB(levp) rb_vm_lock_enter_nb(levp, __FILE__, __LINE__)
124
+ #define RB_VM_LOCK_ENTER_NO_BARRIER() { unsigned int _lev; RB_VM_LOCK_ENTER_LEV_NB(&_lev);
125
+ #define RB_VM_LOCK_LEAVE_NO_BARRIER() RB_VM_LOCK_LEAVE_LEV(&_lev); }
126
+
127
+ #if RUBY_DEBUG > 0
128
+ void RUBY_ASSERT_vm_locking(void);
129
+ void RUBY_ASSERT_vm_unlocking(void);
130
+ #define ASSERT_vm_locking() RUBY_ASSERT_vm_locking()
131
+ #define ASSERT_vm_unlocking() RUBY_ASSERT_vm_unlocking()
132
+ #else
133
+ #define ASSERT_vm_locking()
134
+ #define ASSERT_vm_unlocking()
135
+ #endif
136
+
137
+ #endif // RUBY_VM_SYNC_H
@@ -0,0 +1,241 @@
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(topn),
78
+ LABEL_PTR(setn),
79
+ LABEL_PTR(adjuststack),
80
+ LABEL_PTR(defined),
81
+ LABEL_PTR(checkmatch),
82
+ LABEL_PTR(checkkeyword),
83
+ LABEL_PTR(checktype),
84
+ LABEL_PTR(defineclass),
85
+ LABEL_PTR(definemethod),
86
+ LABEL_PTR(definesmethod),
87
+ LABEL_PTR(send),
88
+ LABEL_PTR(opt_send_without_block),
89
+ LABEL_PTR(opt_str_freeze),
90
+ LABEL_PTR(opt_nil_p),
91
+ LABEL_PTR(opt_str_uminus),
92
+ LABEL_PTR(opt_newarray_max),
93
+ LABEL_PTR(opt_newarray_min),
94
+ LABEL_PTR(invokesuper),
95
+ LABEL_PTR(invokeblock),
96
+ LABEL_PTR(leave),
97
+ LABEL_PTR(throw),
98
+ LABEL_PTR(jump),
99
+ LABEL_PTR(branchif),
100
+ LABEL_PTR(branchunless),
101
+ LABEL_PTR(branchnil),
102
+ LABEL_PTR(opt_getinlinecache),
103
+ LABEL_PTR(opt_setinlinecache),
104
+ LABEL_PTR(once),
105
+ LABEL_PTR(opt_case_dispatch),
106
+ LABEL_PTR(opt_plus),
107
+ LABEL_PTR(opt_minus),
108
+ LABEL_PTR(opt_mult),
109
+ LABEL_PTR(opt_div),
110
+ LABEL_PTR(opt_mod),
111
+ LABEL_PTR(opt_eq),
112
+ LABEL_PTR(opt_neq),
113
+ LABEL_PTR(opt_lt),
114
+ LABEL_PTR(opt_le),
115
+ LABEL_PTR(opt_gt),
116
+ LABEL_PTR(opt_ge),
117
+ LABEL_PTR(opt_ltlt),
118
+ LABEL_PTR(opt_and),
119
+ LABEL_PTR(opt_or),
120
+ LABEL_PTR(opt_aref),
121
+ LABEL_PTR(opt_aset),
122
+ LABEL_PTR(opt_aset_with),
123
+ LABEL_PTR(opt_aref_with),
124
+ LABEL_PTR(opt_length),
125
+ LABEL_PTR(opt_size),
126
+ LABEL_PTR(opt_empty_p),
127
+ LABEL_PTR(opt_succ),
128
+ LABEL_PTR(opt_not),
129
+ LABEL_PTR(opt_regexpmatch2),
130
+ LABEL_PTR(invokebuiltin),
131
+ LABEL_PTR(opt_invokebuiltin_delegate),
132
+ LABEL_PTR(opt_invokebuiltin_delegate_leave),
133
+ LABEL_PTR(getlocal_WC_0),
134
+ LABEL_PTR(getlocal_WC_1),
135
+ LABEL_PTR(setlocal_WC_0),
136
+ LABEL_PTR(setlocal_WC_1),
137
+ LABEL_PTR(putobject_INT2FIX_0_),
138
+ LABEL_PTR(putobject_INT2FIX_1_),
139
+ LABEL_PTR(trace_nop),
140
+ LABEL_PTR(trace_getlocal),
141
+ LABEL_PTR(trace_setlocal),
142
+ LABEL_PTR(trace_getblockparam),
143
+ LABEL_PTR(trace_setblockparam),
144
+ LABEL_PTR(trace_getblockparamproxy),
145
+ LABEL_PTR(trace_getspecial),
146
+ LABEL_PTR(trace_setspecial),
147
+ LABEL_PTR(trace_getinstancevariable),
148
+ LABEL_PTR(trace_setinstancevariable),
149
+ LABEL_PTR(trace_getclassvariable),
150
+ LABEL_PTR(trace_setclassvariable),
151
+ LABEL_PTR(trace_getconstant),
152
+ LABEL_PTR(trace_setconstant),
153
+ LABEL_PTR(trace_getglobal),
154
+ LABEL_PTR(trace_setglobal),
155
+ LABEL_PTR(trace_putnil),
156
+ LABEL_PTR(trace_putself),
157
+ LABEL_PTR(trace_putobject),
158
+ LABEL_PTR(trace_putspecialobject),
159
+ LABEL_PTR(trace_putstring),
160
+ LABEL_PTR(trace_concatstrings),
161
+ LABEL_PTR(trace_tostring),
162
+ LABEL_PTR(trace_toregexp),
163
+ LABEL_PTR(trace_intern),
164
+ LABEL_PTR(trace_newarray),
165
+ LABEL_PTR(trace_newarraykwsplat),
166
+ LABEL_PTR(trace_duparray),
167
+ LABEL_PTR(trace_duphash),
168
+ LABEL_PTR(trace_expandarray),
169
+ LABEL_PTR(trace_concatarray),
170
+ LABEL_PTR(trace_splatarray),
171
+ LABEL_PTR(trace_newhash),
172
+ LABEL_PTR(trace_newrange),
173
+ LABEL_PTR(trace_pop),
174
+ LABEL_PTR(trace_dup),
175
+ LABEL_PTR(trace_dupn),
176
+ LABEL_PTR(trace_swap),
177
+ LABEL_PTR(trace_topn),
178
+ LABEL_PTR(trace_setn),
179
+ LABEL_PTR(trace_adjuststack),
180
+ LABEL_PTR(trace_defined),
181
+ LABEL_PTR(trace_checkmatch),
182
+ LABEL_PTR(trace_checkkeyword),
183
+ LABEL_PTR(trace_checktype),
184
+ LABEL_PTR(trace_defineclass),
185
+ LABEL_PTR(trace_definemethod),
186
+ LABEL_PTR(trace_definesmethod),
187
+ LABEL_PTR(trace_send),
188
+ LABEL_PTR(trace_opt_send_without_block),
189
+ LABEL_PTR(trace_opt_str_freeze),
190
+ LABEL_PTR(trace_opt_nil_p),
191
+ LABEL_PTR(trace_opt_str_uminus),
192
+ LABEL_PTR(trace_opt_newarray_max),
193
+ LABEL_PTR(trace_opt_newarray_min),
194
+ LABEL_PTR(trace_invokesuper),
195
+ LABEL_PTR(trace_invokeblock),
196
+ LABEL_PTR(trace_leave),
197
+ LABEL_PTR(trace_throw),
198
+ LABEL_PTR(trace_jump),
199
+ LABEL_PTR(trace_branchif),
200
+ LABEL_PTR(trace_branchunless),
201
+ LABEL_PTR(trace_branchnil),
202
+ LABEL_PTR(trace_opt_getinlinecache),
203
+ LABEL_PTR(trace_opt_setinlinecache),
204
+ LABEL_PTR(trace_once),
205
+ LABEL_PTR(trace_opt_case_dispatch),
206
+ LABEL_PTR(trace_opt_plus),
207
+ LABEL_PTR(trace_opt_minus),
208
+ LABEL_PTR(trace_opt_mult),
209
+ LABEL_PTR(trace_opt_div),
210
+ LABEL_PTR(trace_opt_mod),
211
+ LABEL_PTR(trace_opt_eq),
212
+ LABEL_PTR(trace_opt_neq),
213
+ LABEL_PTR(trace_opt_lt),
214
+ LABEL_PTR(trace_opt_le),
215
+ LABEL_PTR(trace_opt_gt),
216
+ LABEL_PTR(trace_opt_ge),
217
+ LABEL_PTR(trace_opt_ltlt),
218
+ LABEL_PTR(trace_opt_and),
219
+ LABEL_PTR(trace_opt_or),
220
+ LABEL_PTR(trace_opt_aref),
221
+ LABEL_PTR(trace_opt_aset),
222
+ LABEL_PTR(trace_opt_aset_with),
223
+ LABEL_PTR(trace_opt_aref_with),
224
+ LABEL_PTR(trace_opt_length),
225
+ LABEL_PTR(trace_opt_size),
226
+ LABEL_PTR(trace_opt_empty_p),
227
+ LABEL_PTR(trace_opt_succ),
228
+ LABEL_PTR(trace_opt_not),
229
+ LABEL_PTR(trace_opt_regexpmatch2),
230
+ LABEL_PTR(trace_invokebuiltin),
231
+ LABEL_PTR(trace_opt_invokebuiltin_delegate),
232
+ LABEL_PTR(trace_opt_invokebuiltin_delegate_leave),
233
+ LABEL_PTR(trace_getlocal_WC_0),
234
+ LABEL_PTR(trace_getlocal_WC_1),
235
+ LABEL_PTR(trace_setlocal_WC_0),
236
+ LABEL_PTR(trace_setlocal_WC_1),
237
+ LABEL_PTR(trace_putobject_INT2FIX_0_),
238
+ LABEL_PTR(trace_putobject_INT2FIX_1_),
239
+ };
240
+
241
+ ASSERT_VM_INSTRUCTION_SIZE(insns_address_table);
@@ -0,0 +1,63 @@
1
+ #ifndef YJIT_H
2
+ #define YJIT_H 1
3
+ //
4
+ // This file contains definitions YJIT exposes to the CRuby codebase
5
+ //
6
+
7
+ #include "ruby/internal/config.h"
8
+ #include "ruby_assert.h" // for RUBY_DEBUG
9
+ #include "vm_core.h"
10
+ #include "method.h"
11
+
12
+ // YJIT_STATS controls whether to support runtime counters in generated code
13
+ // and in the interpreter.
14
+ #ifndef YJIT_STATS
15
+ # define YJIT_STATS RUBY_DEBUG
16
+ #endif
17
+
18
+ struct rb_yjit_options {
19
+ // Enable compilation with YJIT
20
+ bool yjit_enabled;
21
+
22
+ // Size of the executable memory block to allocate in MiB
23
+ unsigned exec_mem_size;
24
+
25
+ // Number of method calls after which to start generating code
26
+ // Threshold==1 means compile on first execution
27
+ unsigned call_threshold;
28
+
29
+ // Generate versions greedily until the limit is hit
30
+ bool greedy_versioning;
31
+
32
+ // Maximum number of versions per block
33
+ // 1 means always create generic versions
34
+ unsigned max_versions;
35
+
36
+ // Capture and print out stats
37
+ bool gen_stats;
38
+
39
+ // Run backend tests
40
+ bool test_backend;
41
+ };
42
+
43
+ bool rb_yjit_enabled_p(void);
44
+ unsigned rb_yjit_call_threshold(void);
45
+
46
+ void rb_yjit_invalidate_all_method_lookup_assumptions(void);
47
+ void rb_yjit_method_lookup_change(VALUE klass, ID mid);
48
+ void rb_yjit_cme_invalidate(VALUE cme);
49
+ void rb_yjit_collect_vm_usage_insn(int insn);
50
+ void rb_yjit_collect_binding_alloc(void);
51
+ void rb_yjit_collect_binding_set(void);
52
+ bool rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec);
53
+ void rb_yjit_init(struct rb_yjit_options *options);
54
+ void rb_yjit_bop_redefined(VALUE klass, const rb_method_entry_t *me, enum ruby_basic_operators bop);
55
+ void rb_yjit_constant_state_changed(void);
56
+ void rb_yjit_iseq_mark(const struct rb_iseq_constant_body *body);
57
+ void rb_yjit_iseq_update_references(const struct rb_iseq_constant_body *body);
58
+ void rb_yjit_iseq_free(const struct rb_iseq_constant_body *body);
59
+ void rb_yjit_before_ractor_spawn(void);
60
+ void rb_yjit_constant_ic_update(const rb_iseq_t *iseq, IC ic);
61
+ void rb_yjit_tracing_invalidate_all(void);
62
+
63
+ #endif // #ifndef YJIT_H