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.
- checksums.yaml +4 -4
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/addr2line.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/builtin.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ccan/list/list.h +788 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ccan/str/str.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/constant.h +55 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/darray.h +198 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/debug_counter.h +467 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/dln.h +31 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/encindex.h +70 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/eval_intern.h +304 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/gc.h +142 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/hrtime.h +168 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/id.h +293 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/id_table.h +36 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/insns.inc +247 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/insns_info.inc +8978 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/array.h +113 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/bignum.h +246 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/bits.h +565 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/class.h +188 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/compar.h +49 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/compile.h +35 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/compilers.h +107 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/complex.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/cont.h +24 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/dir.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/enc.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/encoding.h +30 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/enum.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/enumerator.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/error.h +191 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/eval.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/file.h +38 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/fixnum.h +184 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/gc.h +175 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/hash.h +243 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/imemo.h +243 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/inits.h +50 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/io.h +38 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/load.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/loadpath.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/math.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/missing.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/numeric.h +271 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/object.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/parse.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/proc.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/process.h +137 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/random.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/range.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/rational.h +72 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/re.h +30 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/sanitizers.h +190 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/serial.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/signal.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/static_assert.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/string.h +141 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/struct.h +153 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/symbol.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/thread.h +53 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/time.h +34 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/transcode.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/util.h +27 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/variable.h +83 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/vm.h +132 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal/warnings.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/internal.h +109 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/iseq.h +320 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/known_errors.inc +791 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/method.h +245 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/mjit.h +231 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/mjit_compile.inc +8265 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/node.h +499 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/node_name.inc +210 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/opt_sc.inc +107 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/optinsn.inc +128 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/optunifs.inc +43 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/parse.h +214 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/probes_helper.h +44 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ractor_core.h +346 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/regenc.h +254 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/regint.h +942 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/regparse.h +370 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/revision.h +2 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ruby_assert.h +14 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/ruby_atomic.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/symbol.h +119 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/thread_pthread.h +115 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/thread_win32.h +61 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/timev.h +57 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/transcode_data.h +138 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/transient_heap.h +65 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/variable.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/version.h +88 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm.inc +5415 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_call_iseq_optimized.inc +244 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_callinfo.h +454 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_core.h +2103 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_debug.h +119 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_exec.h +197 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_insnhelper.h +265 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_opts.h +73 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vm_sync.h +137 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/vmtc.inc +241 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit.h +63 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_asm.h +392 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_codegen.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_core.h +302 -0
- data/lib/debase/ruby_core_source/ruby-3.1.0-preview1/yjit_iface.h +38 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +116 -3
@@ -0,0 +1,244 @@
|
|
1
|
+
/* -*- c -*- */
|
2
|
+
#if 1 /* enable or disable this optimization */
|
3
|
+
|
4
|
+
/* DO NOT EDIT THIS FILE DIRECTLY
|
5
|
+
*
|
6
|
+
* This file is generated by tool/generic_erb.rb
|
7
|
+
* with template/call_iseq_optimized.inc.tmpl
|
8
|
+
*/
|
9
|
+
|
10
|
+
static VALUE
|
11
|
+
vm_call_iseq_setup_normal_0start_0params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
12
|
+
{
|
13
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
14
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 0);
|
15
|
+
}
|
16
|
+
|
17
|
+
static VALUE
|
18
|
+
vm_call_iseq_setup_normal_0start_0params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
19
|
+
{
|
20
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
21
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 1);
|
22
|
+
}
|
23
|
+
|
24
|
+
static VALUE
|
25
|
+
vm_call_iseq_setup_normal_0start_0params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
26
|
+
{
|
27
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
28
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 2);
|
29
|
+
}
|
30
|
+
|
31
|
+
static VALUE
|
32
|
+
vm_call_iseq_setup_normal_0start_0params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
33
|
+
{
|
34
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
35
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 3);
|
36
|
+
}
|
37
|
+
|
38
|
+
static VALUE
|
39
|
+
vm_call_iseq_setup_normal_0start_0params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
40
|
+
{
|
41
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
42
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 4);
|
43
|
+
}
|
44
|
+
|
45
|
+
static VALUE
|
46
|
+
vm_call_iseq_setup_normal_0start_0params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
47
|
+
{
|
48
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
49
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 0, 5);
|
50
|
+
}
|
51
|
+
|
52
|
+
static VALUE
|
53
|
+
vm_call_iseq_setup_normal_0start_1params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
54
|
+
{
|
55
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
56
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 0);
|
57
|
+
}
|
58
|
+
|
59
|
+
static VALUE
|
60
|
+
vm_call_iseq_setup_normal_0start_1params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
61
|
+
{
|
62
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
63
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 1);
|
64
|
+
}
|
65
|
+
|
66
|
+
static VALUE
|
67
|
+
vm_call_iseq_setup_normal_0start_1params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
68
|
+
{
|
69
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
70
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 2);
|
71
|
+
}
|
72
|
+
|
73
|
+
static VALUE
|
74
|
+
vm_call_iseq_setup_normal_0start_1params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
75
|
+
{
|
76
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
77
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 3);
|
78
|
+
}
|
79
|
+
|
80
|
+
static VALUE
|
81
|
+
vm_call_iseq_setup_normal_0start_1params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
82
|
+
{
|
83
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
84
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 4);
|
85
|
+
}
|
86
|
+
|
87
|
+
static VALUE
|
88
|
+
vm_call_iseq_setup_normal_0start_1params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
89
|
+
{
|
90
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
91
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 1, 5);
|
92
|
+
}
|
93
|
+
|
94
|
+
static VALUE
|
95
|
+
vm_call_iseq_setup_normal_0start_2params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
96
|
+
{
|
97
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
98
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 0);
|
99
|
+
}
|
100
|
+
|
101
|
+
static VALUE
|
102
|
+
vm_call_iseq_setup_normal_0start_2params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
103
|
+
{
|
104
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
105
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 1);
|
106
|
+
}
|
107
|
+
|
108
|
+
static VALUE
|
109
|
+
vm_call_iseq_setup_normal_0start_2params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
110
|
+
{
|
111
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
112
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 2);
|
113
|
+
}
|
114
|
+
|
115
|
+
static VALUE
|
116
|
+
vm_call_iseq_setup_normal_0start_2params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
117
|
+
{
|
118
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
119
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 3);
|
120
|
+
}
|
121
|
+
|
122
|
+
static VALUE
|
123
|
+
vm_call_iseq_setup_normal_0start_2params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
124
|
+
{
|
125
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
126
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 4);
|
127
|
+
}
|
128
|
+
|
129
|
+
static VALUE
|
130
|
+
vm_call_iseq_setup_normal_0start_2params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
131
|
+
{
|
132
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
133
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 2, 5);
|
134
|
+
}
|
135
|
+
|
136
|
+
static VALUE
|
137
|
+
vm_call_iseq_setup_normal_0start_3params_0locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
138
|
+
{
|
139
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
140
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 0);
|
141
|
+
}
|
142
|
+
|
143
|
+
static VALUE
|
144
|
+
vm_call_iseq_setup_normal_0start_3params_1locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
145
|
+
{
|
146
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
147
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 1);
|
148
|
+
}
|
149
|
+
|
150
|
+
static VALUE
|
151
|
+
vm_call_iseq_setup_normal_0start_3params_2locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
152
|
+
{
|
153
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
154
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 2);
|
155
|
+
}
|
156
|
+
|
157
|
+
static VALUE
|
158
|
+
vm_call_iseq_setup_normal_0start_3params_3locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
159
|
+
{
|
160
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
161
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 3);
|
162
|
+
}
|
163
|
+
|
164
|
+
static VALUE
|
165
|
+
vm_call_iseq_setup_normal_0start_3params_4locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
166
|
+
{
|
167
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
168
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 4);
|
169
|
+
}
|
170
|
+
|
171
|
+
static VALUE
|
172
|
+
vm_call_iseq_setup_normal_0start_3params_5locals(rb_execution_context_t *ec, rb_control_frame_t *cfp, struct rb_calling_info *calling)
|
173
|
+
{
|
174
|
+
RB_DEBUG_COUNTER_INC(ccf_iseq_fix);
|
175
|
+
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(calling->cc), 0, 3, 5);
|
176
|
+
}
|
177
|
+
|
178
|
+
/* vm_call_iseq_handlers[param][local] */
|
179
|
+
static const vm_call_handler vm_call_iseq_handlers[][6] = {
|
180
|
+
{
|
181
|
+
vm_call_iseq_setup_normal_0start_0params_0locals,
|
182
|
+
vm_call_iseq_setup_normal_0start_0params_1locals,
|
183
|
+
vm_call_iseq_setup_normal_0start_0params_2locals,
|
184
|
+
vm_call_iseq_setup_normal_0start_0params_3locals,
|
185
|
+
vm_call_iseq_setup_normal_0start_0params_4locals,
|
186
|
+
vm_call_iseq_setup_normal_0start_0params_5locals,
|
187
|
+
},
|
188
|
+
{
|
189
|
+
vm_call_iseq_setup_normal_0start_1params_0locals,
|
190
|
+
vm_call_iseq_setup_normal_0start_1params_1locals,
|
191
|
+
vm_call_iseq_setup_normal_0start_1params_2locals,
|
192
|
+
vm_call_iseq_setup_normal_0start_1params_3locals,
|
193
|
+
vm_call_iseq_setup_normal_0start_1params_4locals,
|
194
|
+
vm_call_iseq_setup_normal_0start_1params_5locals,
|
195
|
+
},
|
196
|
+
{
|
197
|
+
vm_call_iseq_setup_normal_0start_2params_0locals,
|
198
|
+
vm_call_iseq_setup_normal_0start_2params_1locals,
|
199
|
+
vm_call_iseq_setup_normal_0start_2params_2locals,
|
200
|
+
vm_call_iseq_setup_normal_0start_2params_3locals,
|
201
|
+
vm_call_iseq_setup_normal_0start_2params_4locals,
|
202
|
+
vm_call_iseq_setup_normal_0start_2params_5locals,
|
203
|
+
},
|
204
|
+
{
|
205
|
+
vm_call_iseq_setup_normal_0start_3params_0locals,
|
206
|
+
vm_call_iseq_setup_normal_0start_3params_1locals,
|
207
|
+
vm_call_iseq_setup_normal_0start_3params_2locals,
|
208
|
+
vm_call_iseq_setup_normal_0start_3params_3locals,
|
209
|
+
vm_call_iseq_setup_normal_0start_3params_4locals,
|
210
|
+
vm_call_iseq_setup_normal_0start_3params_5locals,
|
211
|
+
},
|
212
|
+
};
|
213
|
+
|
214
|
+
static inline vm_call_handler
|
215
|
+
vm_call_iseq_setup_func(const struct rb_callinfo *ci, const int param_size, const int local_size)
|
216
|
+
{
|
217
|
+
if (UNLIKELY(vm_ci_flag(ci) & VM_CALL_TAILCALL)) {
|
218
|
+
return &vm_call_iseq_setup_tailcall_0start;
|
219
|
+
}
|
220
|
+
else if (0) { /* to disable optimize */
|
221
|
+
return &vm_call_iseq_setup_normal_0start;
|
222
|
+
}
|
223
|
+
else if (param_size <= 3 && local_size <= 5) {
|
224
|
+
VM_ASSERT(local_size >= 0);
|
225
|
+
return vm_call_iseq_handlers[param_size][local_size];
|
226
|
+
}
|
227
|
+
else {
|
228
|
+
return &vm_call_iseq_setup_normal_0start;
|
229
|
+
}
|
230
|
+
}
|
231
|
+
|
232
|
+
#else
|
233
|
+
|
234
|
+
static inline vm_call_handler
|
235
|
+
vm_call_iseq_setup_func(const struct rb_callinfo *ci, const int param_size, const int local_size)
|
236
|
+
{
|
237
|
+
if (UNLIKELY(vm_ci_flag(ci) & VM_CALL_TAILCALL)) {
|
238
|
+
return &vm_call_iseq_setup_tailcall_0start;
|
239
|
+
}
|
240
|
+
else {
|
241
|
+
return &vm_call_iseq_setup_normal_0start;
|
242
|
+
}
|
243
|
+
}
|
244
|
+
#endif
|
@@ -0,0 +1,454 @@
|
|
1
|
+
#ifndef RUBY_VM_CALLINFO_H /*-*-C-*-vi:se ft=c:*/
|
2
|
+
#define RUBY_VM_CALLINFO_H
|
3
|
+
/**
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
8
|
+
* file COPYING are met. Consult the file for details.
|
9
|
+
*/
|
10
|
+
|
11
|
+
#include "debug_counter.h"
|
12
|
+
|
13
|
+
enum vm_call_flag_bits {
|
14
|
+
VM_CALL_ARGS_SPLAT_bit, /* m(*args) */
|
15
|
+
VM_CALL_ARGS_BLOCKARG_bit, /* m(&block) */
|
16
|
+
VM_CALL_FCALL_bit, /* m(...) */
|
17
|
+
VM_CALL_VCALL_bit, /* m */
|
18
|
+
VM_CALL_ARGS_SIMPLE_bit, /* (ci->flag & (SPLAT|BLOCKARG)) && blockiseq == NULL && ci->kw_arg == NULL */
|
19
|
+
VM_CALL_BLOCKISEQ_bit, /* has blockiseq */
|
20
|
+
VM_CALL_KWARG_bit, /* has kwarg */
|
21
|
+
VM_CALL_KW_SPLAT_bit, /* m(**opts) */
|
22
|
+
VM_CALL_TAILCALL_bit, /* located at tail position */
|
23
|
+
VM_CALL_SUPER_bit, /* super */
|
24
|
+
VM_CALL_ZSUPER_bit, /* zsuper */
|
25
|
+
VM_CALL_OPT_SEND_bit, /* internal flag */
|
26
|
+
VM_CALL_KW_SPLAT_MUT_bit, /* kw splat hash can be modified (to avoid allocating a new one) */
|
27
|
+
VM_CALL__END
|
28
|
+
};
|
29
|
+
|
30
|
+
#define VM_CALL_ARGS_SPLAT (0x01 << VM_CALL_ARGS_SPLAT_bit)
|
31
|
+
#define VM_CALL_ARGS_BLOCKARG (0x01 << VM_CALL_ARGS_BLOCKARG_bit)
|
32
|
+
#define VM_CALL_FCALL (0x01 << VM_CALL_FCALL_bit)
|
33
|
+
#define VM_CALL_VCALL (0x01 << VM_CALL_VCALL_bit)
|
34
|
+
#define VM_CALL_ARGS_SIMPLE (0x01 << VM_CALL_ARGS_SIMPLE_bit)
|
35
|
+
#define VM_CALL_BLOCKISEQ (0x01 << VM_CALL_BLOCKISEQ_bit)
|
36
|
+
#define VM_CALL_KWARG (0x01 << VM_CALL_KWARG_bit)
|
37
|
+
#define VM_CALL_KW_SPLAT (0x01 << VM_CALL_KW_SPLAT_bit)
|
38
|
+
#define VM_CALL_TAILCALL (0x01 << VM_CALL_TAILCALL_bit)
|
39
|
+
#define VM_CALL_SUPER (0x01 << VM_CALL_SUPER_bit)
|
40
|
+
#define VM_CALL_ZSUPER (0x01 << VM_CALL_ZSUPER_bit)
|
41
|
+
#define VM_CALL_OPT_SEND (0x01 << VM_CALL_OPT_SEND_bit)
|
42
|
+
#define VM_CALL_KW_SPLAT_MUT (0x01 << VM_CALL_KW_SPLAT_MUT_bit)
|
43
|
+
|
44
|
+
struct rb_callinfo_kwarg {
|
45
|
+
int keyword_len;
|
46
|
+
VALUE keywords[];
|
47
|
+
};
|
48
|
+
|
49
|
+
static inline size_t
|
50
|
+
rb_callinfo_kwarg_bytes(int keyword_len)
|
51
|
+
{
|
52
|
+
return rb_size_mul_add_or_raise(
|
53
|
+
keyword_len,
|
54
|
+
sizeof(VALUE),
|
55
|
+
sizeof(struct rb_callinfo_kwarg),
|
56
|
+
rb_eRuntimeError);
|
57
|
+
}
|
58
|
+
|
59
|
+
// imemo_callinfo
|
60
|
+
struct rb_callinfo {
|
61
|
+
VALUE flags;
|
62
|
+
const struct rb_callinfo_kwarg *kwarg;
|
63
|
+
VALUE mid;
|
64
|
+
VALUE flag;
|
65
|
+
VALUE argc;
|
66
|
+
};
|
67
|
+
|
68
|
+
#ifndef USE_EMBED_CI
|
69
|
+
#define USE_EMBED_CI 1
|
70
|
+
#endif
|
71
|
+
|
72
|
+
#if SIZEOF_VALUE == 8
|
73
|
+
#define CI_EMBED_TAG_bits 1
|
74
|
+
#define CI_EMBED_ARGC_bits 15
|
75
|
+
#define CI_EMBED_FLAG_bits 16
|
76
|
+
#define CI_EMBED_ID_bits 32
|
77
|
+
#elif SIZEOF_VALUE == 4
|
78
|
+
#define CI_EMBED_TAG_bits 1
|
79
|
+
#define CI_EMBED_ARGC_bits 3
|
80
|
+
#define CI_EMBED_FLAG_bits 13
|
81
|
+
#define CI_EMBED_ID_bits 15
|
82
|
+
#endif
|
83
|
+
|
84
|
+
#if (CI_EMBED_TAG_bits + CI_EMBED_ARGC_bits + CI_EMBED_FLAG_bits + CI_EMBED_ID_bits) != (SIZEOF_VALUE * 8)
|
85
|
+
#error
|
86
|
+
#endif
|
87
|
+
|
88
|
+
#define CI_EMBED_FLAG 0x01
|
89
|
+
#define CI_EMBED_ARGC_SHFT (CI_EMBED_TAG_bits)
|
90
|
+
#define CI_EMBED_ARGC_MASK ((((VALUE)1)<<CI_EMBED_ARGC_bits) - 1)
|
91
|
+
#define CI_EMBED_FLAG_SHFT (CI_EMBED_TAG_bits + CI_EMBED_ARGC_bits)
|
92
|
+
#define CI_EMBED_FLAG_MASK ((((VALUE)1)<<CI_EMBED_FLAG_bits) - 1)
|
93
|
+
#define CI_EMBED_ID_SHFT (CI_EMBED_TAG_bits + CI_EMBED_ARGC_bits + CI_EMBED_FLAG_bits)
|
94
|
+
#define CI_EMBED_ID_MASK ((((VALUE)1)<<CI_EMBED_ID_bits) - 1)
|
95
|
+
|
96
|
+
static inline bool
|
97
|
+
vm_ci_packed_p(const struct rb_callinfo *ci)
|
98
|
+
{
|
99
|
+
#if USE_EMBED_CI
|
100
|
+
if (LIKELY(((VALUE)ci) & 0x01)) {
|
101
|
+
return 1;
|
102
|
+
}
|
103
|
+
else {
|
104
|
+
VM_ASSERT(IMEMO_TYPE_P(ci, imemo_callinfo));
|
105
|
+
return 0;
|
106
|
+
}
|
107
|
+
#else
|
108
|
+
return 0;
|
109
|
+
#endif
|
110
|
+
}
|
111
|
+
|
112
|
+
static inline bool
|
113
|
+
vm_ci_p(const struct rb_callinfo *ci)
|
114
|
+
{
|
115
|
+
if (vm_ci_packed_p(ci) || IMEMO_TYPE_P(ci, imemo_callinfo)) {
|
116
|
+
return 1;
|
117
|
+
}
|
118
|
+
else {
|
119
|
+
return 0;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
static inline ID
|
124
|
+
vm_ci_mid(const struct rb_callinfo *ci)
|
125
|
+
{
|
126
|
+
if (vm_ci_packed_p(ci)) {
|
127
|
+
return (((VALUE)ci) >> CI_EMBED_ID_SHFT) & CI_EMBED_ID_MASK;
|
128
|
+
}
|
129
|
+
else {
|
130
|
+
return (ID)ci->mid;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
static inline unsigned int
|
135
|
+
vm_ci_flag(const struct rb_callinfo *ci)
|
136
|
+
{
|
137
|
+
if (vm_ci_packed_p(ci)) {
|
138
|
+
return (unsigned int)((((VALUE)ci) >> CI_EMBED_FLAG_SHFT) & CI_EMBED_FLAG_MASK);
|
139
|
+
}
|
140
|
+
else {
|
141
|
+
return (unsigned int)ci->flag;
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
145
|
+
static inline unsigned int
|
146
|
+
vm_ci_argc(const struct rb_callinfo *ci)
|
147
|
+
{
|
148
|
+
if (vm_ci_packed_p(ci)) {
|
149
|
+
return (unsigned int)((((VALUE)ci) >> CI_EMBED_ARGC_SHFT) & CI_EMBED_ARGC_MASK);
|
150
|
+
}
|
151
|
+
else {
|
152
|
+
return (unsigned int)ci->argc;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
static inline const struct rb_callinfo_kwarg *
|
157
|
+
vm_ci_kwarg(const struct rb_callinfo *ci)
|
158
|
+
{
|
159
|
+
if (vm_ci_packed_p(ci)) {
|
160
|
+
return NULL;
|
161
|
+
}
|
162
|
+
else {
|
163
|
+
return ci->kwarg;
|
164
|
+
}
|
165
|
+
}
|
166
|
+
|
167
|
+
static inline void
|
168
|
+
vm_ci_dump(const struct rb_callinfo *ci)
|
169
|
+
{
|
170
|
+
if (vm_ci_packed_p(ci)) {
|
171
|
+
ruby_debug_printf("packed_ci ID:%s flag:%x argc:%u\n",
|
172
|
+
rb_id2name(vm_ci_mid(ci)), vm_ci_flag(ci), vm_ci_argc(ci));
|
173
|
+
}
|
174
|
+
else {
|
175
|
+
rp(ci);
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
#define vm_ci_new(mid, flag, argc, kwarg) vm_ci_new_(mid, flag, argc, kwarg, __FILE__, __LINE__)
|
180
|
+
#define vm_ci_new_runtime(mid, flag, argc, kwarg) vm_ci_new_runtime_(mid, flag, argc, kwarg, __FILE__, __LINE__)
|
181
|
+
|
182
|
+
#/* This is passed to STATIC_ASSERT. Cannot be an inline function. */
|
183
|
+
#define VM_CI_EMBEDDABLE_P(mid, flag, argc, kwarg) \
|
184
|
+
(((mid ) & ~CI_EMBED_ID_MASK) ? false : \
|
185
|
+
((flag) & ~CI_EMBED_FLAG_MASK) ? false : \
|
186
|
+
((argc) & ~CI_EMBED_ARGC_MASK) ? false : \
|
187
|
+
(kwarg) ? false : true)
|
188
|
+
|
189
|
+
#define vm_ci_new_id(mid, flag, argc, must_zero) \
|
190
|
+
((const struct rb_callinfo *) \
|
191
|
+
((((VALUE)(mid )) << CI_EMBED_ID_SHFT) | \
|
192
|
+
(((VALUE)(flag)) << CI_EMBED_FLAG_SHFT) | \
|
193
|
+
(((VALUE)(argc)) << CI_EMBED_ARGC_SHFT) | \
|
194
|
+
RUBY_FIXNUM_FLAG))
|
195
|
+
|
196
|
+
static inline const struct rb_callinfo *
|
197
|
+
vm_ci_new_(ID mid, unsigned int flag, unsigned int argc, const struct rb_callinfo_kwarg *kwarg, const char *file, int line)
|
198
|
+
{
|
199
|
+
#if USE_EMBED_CI
|
200
|
+
if (VM_CI_EMBEDDABLE_P(mid, flag, argc, kwarg)) {
|
201
|
+
RB_DEBUG_COUNTER_INC(ci_packed);
|
202
|
+
return vm_ci_new_id(mid, flag, argc, kwarg);
|
203
|
+
}
|
204
|
+
#endif
|
205
|
+
|
206
|
+
const bool debug = 0;
|
207
|
+
if (debug) ruby_debug_printf("%s:%d ", file, line);
|
208
|
+
|
209
|
+
// TODO: dedup
|
210
|
+
const struct rb_callinfo *ci = (const struct rb_callinfo *)
|
211
|
+
rb_imemo_new(imemo_callinfo,
|
212
|
+
(VALUE)mid,
|
213
|
+
(VALUE)flag,
|
214
|
+
(VALUE)argc,
|
215
|
+
(VALUE)kwarg);
|
216
|
+
if (debug) rp(ci);
|
217
|
+
if (kwarg) {
|
218
|
+
RB_DEBUG_COUNTER_INC(ci_kw);
|
219
|
+
}
|
220
|
+
else {
|
221
|
+
RB_DEBUG_COUNTER_INC(ci_nokw);
|
222
|
+
}
|
223
|
+
|
224
|
+
VM_ASSERT(vm_ci_flag(ci) == flag);
|
225
|
+
VM_ASSERT(vm_ci_argc(ci) == argc);
|
226
|
+
|
227
|
+
return ci;
|
228
|
+
}
|
229
|
+
|
230
|
+
|
231
|
+
static inline const struct rb_callinfo *
|
232
|
+
vm_ci_new_runtime_(ID mid, unsigned int flag, unsigned int argc, const struct rb_callinfo_kwarg *kwarg, const char *file, int line)
|
233
|
+
{
|
234
|
+
RB_DEBUG_COUNTER_INC(ci_runtime);
|
235
|
+
return vm_ci_new_(mid, flag, argc, kwarg, file, line);
|
236
|
+
}
|
237
|
+
|
238
|
+
#define VM_CALLINFO_NOT_UNDER_GC IMEMO_FL_USER0
|
239
|
+
|
240
|
+
static inline bool
|
241
|
+
vm_ci_markable(const struct rb_callinfo *ci)
|
242
|
+
{
|
243
|
+
if (! ci) {
|
244
|
+
return false; /* or true? This is Qfalse... */
|
245
|
+
}
|
246
|
+
else if (vm_ci_packed_p(ci)) {
|
247
|
+
return true;
|
248
|
+
}
|
249
|
+
else {
|
250
|
+
VM_ASSERT(IMEMO_TYPE_P(ci, imemo_callinfo));
|
251
|
+
return ! FL_ANY_RAW((VALUE)ci, VM_CALLINFO_NOT_UNDER_GC);
|
252
|
+
}
|
253
|
+
}
|
254
|
+
|
255
|
+
#define VM_CI_ON_STACK(mid_, flags_, argc_, kwarg_) \
|
256
|
+
(struct rb_callinfo) { \
|
257
|
+
.flags = T_IMEMO | \
|
258
|
+
(imemo_callinfo << FL_USHIFT) | \
|
259
|
+
VM_CALLINFO_NOT_UNDER_GC, \
|
260
|
+
.mid = mid_, \
|
261
|
+
.flag = flags_, \
|
262
|
+
.argc = argc_, \
|
263
|
+
.kwarg = kwarg_, \
|
264
|
+
}
|
265
|
+
|
266
|
+
typedef VALUE (*vm_call_handler)(
|
267
|
+
struct rb_execution_context_struct *ec,
|
268
|
+
struct rb_control_frame_struct *cfp,
|
269
|
+
struct rb_calling_info *calling);
|
270
|
+
|
271
|
+
// imemo_callcache
|
272
|
+
|
273
|
+
struct rb_callcache {
|
274
|
+
const VALUE flags;
|
275
|
+
|
276
|
+
/* inline cache: key */
|
277
|
+
const VALUE klass; // should not mark it because klass can not be free'd
|
278
|
+
// because of this marking. When klass is collected,
|
279
|
+
// cc will be cleared (cc->klass = 0) at vm_ccs_free().
|
280
|
+
|
281
|
+
/* inline cache: values */
|
282
|
+
const struct rb_callable_method_entry_struct * const cme_;
|
283
|
+
const vm_call_handler call_;
|
284
|
+
|
285
|
+
union {
|
286
|
+
const unsigned int attr_index;
|
287
|
+
const enum method_missing_reason method_missing_reason; /* used by method_missing */
|
288
|
+
VALUE v;
|
289
|
+
} aux_;
|
290
|
+
};
|
291
|
+
|
292
|
+
#define VM_CALLCACHE_UNMARKABLE IMEMO_FL_USER0
|
293
|
+
|
294
|
+
static inline const struct rb_callcache *
|
295
|
+
vm_cc_new(VALUE klass,
|
296
|
+
const struct rb_callable_method_entry_struct *cme,
|
297
|
+
vm_call_handler call)
|
298
|
+
{
|
299
|
+
const struct rb_callcache *cc = (const struct rb_callcache *)rb_imemo_new(imemo_callcache, (VALUE)cme, (VALUE)call, 0, klass);
|
300
|
+
RB_DEBUG_COUNTER_INC(cc_new);
|
301
|
+
return cc;
|
302
|
+
}
|
303
|
+
|
304
|
+
#define VM_CC_ON_STACK(clazz, call, aux, cme) \
|
305
|
+
(struct rb_callcache) { \
|
306
|
+
.flags = T_IMEMO | \
|
307
|
+
(imemo_callcache << FL_USHIFT) | \
|
308
|
+
VM_CALLCACHE_UNMARKABLE, \
|
309
|
+
.klass = clazz, \
|
310
|
+
.cme_ = cme, \
|
311
|
+
.call_ = call, \
|
312
|
+
.aux_ = aux, \
|
313
|
+
}
|
314
|
+
|
315
|
+
static inline bool
|
316
|
+
vm_cc_class_check(const struct rb_callcache *cc, VALUE klass)
|
317
|
+
{
|
318
|
+
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
319
|
+
VM_ASSERT(cc->klass == 0 ||
|
320
|
+
RB_TYPE_P(cc->klass, T_CLASS) || RB_TYPE_P(cc->klass, T_ICLASS));
|
321
|
+
return cc->klass == klass;
|
322
|
+
}
|
323
|
+
|
324
|
+
static inline const struct rb_callable_method_entry_struct *
|
325
|
+
vm_cc_cme(const struct rb_callcache *cc)
|
326
|
+
{
|
327
|
+
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
328
|
+
return cc->cme_;
|
329
|
+
}
|
330
|
+
|
331
|
+
static inline vm_call_handler
|
332
|
+
vm_cc_call(const struct rb_callcache *cc)
|
333
|
+
{
|
334
|
+
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
335
|
+
return cc->call_;
|
336
|
+
}
|
337
|
+
|
338
|
+
static inline unsigned int
|
339
|
+
vm_cc_attr_index(const struct rb_callcache *cc)
|
340
|
+
{
|
341
|
+
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
342
|
+
return cc->aux_.attr_index;
|
343
|
+
}
|
344
|
+
|
345
|
+
static inline unsigned int
|
346
|
+
vm_cc_cmethod_missing_reason(const struct rb_callcache *cc)
|
347
|
+
{
|
348
|
+
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
349
|
+
return cc->aux_.method_missing_reason;
|
350
|
+
}
|
351
|
+
|
352
|
+
static inline int
|
353
|
+
vm_cc_markable(const struct rb_callcache *cc)
|
354
|
+
{
|
355
|
+
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
356
|
+
return FL_TEST_RAW((VALUE)cc, VM_CALLCACHE_UNMARKABLE) == 0;
|
357
|
+
}
|
358
|
+
|
359
|
+
static inline bool
|
360
|
+
vm_cc_invalidated_p(const struct rb_callcache *cc)
|
361
|
+
{
|
362
|
+
if (cc->klass && !METHOD_ENTRY_INVALIDATED(vm_cc_cme(cc))) {
|
363
|
+
return false;
|
364
|
+
}
|
365
|
+
else {
|
366
|
+
return true;
|
367
|
+
}
|
368
|
+
}
|
369
|
+
|
370
|
+
// For MJIT. cc_cme is supposed to have inlined `vm_cc_cme(cc)`.
|
371
|
+
static inline bool
|
372
|
+
vm_cc_valid_p(const struct rb_callcache *cc, const rb_callable_method_entry_t *cc_cme, VALUE klass)
|
373
|
+
{
|
374
|
+
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
375
|
+
if (cc->klass == klass && !METHOD_ENTRY_INVALIDATED(cc_cme)) {
|
376
|
+
return 1;
|
377
|
+
}
|
378
|
+
else {
|
379
|
+
return 0;
|
380
|
+
}
|
381
|
+
}
|
382
|
+
|
383
|
+
extern const struct rb_callcache *rb_vm_empty_cc(void);
|
384
|
+
#define vm_cc_empty() rb_vm_empty_cc()
|
385
|
+
|
386
|
+
/* callcache: mutate */
|
387
|
+
|
388
|
+
static inline void
|
389
|
+
vm_cc_call_set(const struct rb_callcache *cc, vm_call_handler call)
|
390
|
+
{
|
391
|
+
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
392
|
+
VM_ASSERT(cc != vm_cc_empty());
|
393
|
+
*(vm_call_handler *)&cc->call_ = call;
|
394
|
+
}
|
395
|
+
|
396
|
+
static inline void
|
397
|
+
vm_cc_attr_index_set(const struct rb_callcache *cc, int index)
|
398
|
+
{
|
399
|
+
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
400
|
+
VM_ASSERT(cc != vm_cc_empty());
|
401
|
+
*(int *)&cc->aux_.attr_index = index;
|
402
|
+
}
|
403
|
+
|
404
|
+
static inline void
|
405
|
+
vm_cc_method_missing_reason_set(const struct rb_callcache *cc, enum method_missing_reason reason)
|
406
|
+
{
|
407
|
+
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
408
|
+
VM_ASSERT(cc != vm_cc_empty());
|
409
|
+
*(enum method_missing_reason *)&cc->aux_.method_missing_reason = reason;
|
410
|
+
}
|
411
|
+
|
412
|
+
static inline void
|
413
|
+
vm_cc_invalidate(const struct rb_callcache *cc)
|
414
|
+
{
|
415
|
+
VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache));
|
416
|
+
VM_ASSERT(cc != vm_cc_empty());
|
417
|
+
VM_ASSERT(cc->klass != 0); // should be enable
|
418
|
+
|
419
|
+
*(VALUE *)&cc->klass = 0;
|
420
|
+
RB_DEBUG_COUNTER_INC(cc_ent_invalidate);
|
421
|
+
}
|
422
|
+
|
423
|
+
/* calldata */
|
424
|
+
|
425
|
+
struct rb_call_data {
|
426
|
+
const struct rb_callinfo *ci;
|
427
|
+
const struct rb_callcache *cc;
|
428
|
+
};
|
429
|
+
|
430
|
+
struct rb_class_cc_entries {
|
431
|
+
#if VM_CHECK_MODE > 0
|
432
|
+
VALUE debug_sig;
|
433
|
+
#endif
|
434
|
+
int capa;
|
435
|
+
int len;
|
436
|
+
const struct rb_callable_method_entry_struct *cme;
|
437
|
+
struct rb_class_cc_entries_entry {
|
438
|
+
const struct rb_callinfo *ci;
|
439
|
+
const struct rb_callcache *cc;
|
440
|
+
} *entries;
|
441
|
+
};
|
442
|
+
|
443
|
+
#if VM_CHECK_MODE > 0
|
444
|
+
static inline bool
|
445
|
+
vm_ccs_p(const struct rb_class_cc_entries *ccs)
|
446
|
+
{
|
447
|
+
return ccs->debug_sig == ~(VALUE)ccs;
|
448
|
+
}
|
449
|
+
#endif
|
450
|
+
|
451
|
+
// gc.c
|
452
|
+
void rb_vm_ccs_free(struct rb_class_cc_entries *ccs);
|
453
|
+
|
454
|
+
#endif /* RUBY_VM_CALLINFO_H */
|