v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
interface-descriptors-loong64-inl.h
Go to the documentation of this file.
1// Copyright 2021 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_CODEGEN_LOONG64_INTERFACE_DESCRIPTORS_LOONG64_INL_H_
6#define V8_CODEGEN_LOONG64_INTERFACE_DESCRIPTORS_LOONG64_INL_H_
7
8#if V8_TARGET_ARCH_LOONG64
9
12
13namespace v8 {
14namespace internal {
15
17 auto registers = RegisterArray(a0, a1, a2, a3, a4);
18 static_assert(registers.size() == kMaxBuiltinRegisterParams);
19 return registers;
20}
21
23 auto registers = DoubleRegisterArray(f0, f1, f2, f3, f4, f5, f6);
24 return registers;
25}
26
28 auto registers =
30 return registers;
31}
32
34 // Padding to have as many double return registers as GP return registers.
36 return registers;
37}
38
39#if DEBUG
40template <typename DerivedDescriptor>
41void StaticCallInterfaceDescriptor<DerivedDescriptor>::
42 VerifyArgumentRegisterCount(CallInterfaceDescriptorData* data, int argc) {
43 RegList allocatable_regs = data->allocatable_registers();
44 if (argc >= 1) DCHECK(allocatable_regs.has(a0));
45 if (argc >= 2) DCHECK(allocatable_regs.has(a1));
46 if (argc >= 3) DCHECK(allocatable_regs.has(a2));
47 if (argc >= 4) DCHECK(allocatable_regs.has(a3));
48 if (argc >= 5) DCHECK(allocatable_regs.has(a4));
49 if (argc >= 6) DCHECK(allocatable_regs.has(a5));
50 if (argc >= 7) DCHECK(allocatable_regs.has(a6));
51 if (argc >= 8) DCHECK(allocatable_regs.has(a7));
52 // Additional arguments are passed on the stack.
53}
54#endif // DEBUG
55
56// static
57constexpr auto WriteBarrierDescriptor::registers() {
58 return RegisterArray(a1, a5, a4, a2, a0, a3, kContextRegister);
59}
60
61// static
62constexpr Register LoadDescriptor::ReceiverRegister() { return a1; }
63// static
64constexpr Register LoadDescriptor::NameRegister() { return a2; }
65// static
66constexpr Register LoadDescriptor::SlotRegister() { return a0; }
67
68// static
69constexpr Register LoadWithVectorDescriptor::VectorRegister() { return a3; }
70
71// static
72constexpr Register KeyedLoadBaselineDescriptor::ReceiverRegister() {
73 return a1;
74}
75// static
78}
79// static
81
82// static
83constexpr Register KeyedLoadWithVectorDescriptor::VectorRegister() {
84 return a3;
85}
86
87// static
88constexpr Register EnumeratedKeyedLoadBaselineDescriptor::EnumIndexRegister() {
89 return a4;
90}
91
92// static
94 return a5;
95}
96
97// static
99 return a2;
100}
101
102// static
103constexpr Register KeyedHasICBaselineDescriptor::ReceiverRegister() {
105}
106// static
108// static
110
111// static
112constexpr Register KeyedHasICWithVectorDescriptor::VectorRegister() {
113 return a3;
114}
115
116// static
117constexpr Register
118LoadWithReceiverAndVectorDescriptor::LookupStartObjectRegister() {
119 return a4;
120}
121
122// static
123constexpr Register StoreDescriptor::ReceiverRegister() { return a1; }
124// static
125constexpr Register StoreDescriptor::NameRegister() { return a2; }
126// static
127constexpr Register StoreDescriptor::ValueRegister() { return a0; }
128// static
129constexpr Register StoreDescriptor::SlotRegister() { return a4; }
130
131// static
132constexpr Register StoreWithVectorDescriptor::VectorRegister() { return a3; }
133
134// static
135constexpr Register DefineKeyedOwnDescriptor::FlagsRegister() { return a5; }
136
137// static
138constexpr Register StoreTransitionDescriptor::MapRegister() { return a5; }
139
140// static
141constexpr Register ApiGetterDescriptor::HolderRegister() { return a0; }
142// static
143constexpr Register ApiGetterDescriptor::CallbackRegister() { return a3; }
144
145// static
146constexpr Register GrowArrayElementsDescriptor::ObjectRegister() { return a0; }
147// static
148constexpr Register GrowArrayElementsDescriptor::KeyRegister() { return a3; }
149
150// static
151constexpr Register BaselineLeaveFrameDescriptor::ParamsSizeRegister() {
152 return a2;
153}
154
155// static
157
158// static
160
161// static
162constexpr auto TypeofDescriptor::registers() { return RegisterArray(a0); }
163
164// static
166 // a1: target
167 // a0: number of arguments
168 return RegisterArray(a1, a0);
169}
170
171// static
173 // a1 : the source
174 // a0 : the excluded property count
175 return RegisterArray(a1, a0);
176}
177
178// static
179constexpr auto
181 // a1 : the source
182 // a0 : the excluded property count
183 // a2 : the excluded property base
184 return RegisterArray(a1, a0, a2);
185}
186
187// static
188constexpr auto CallVarargsDescriptor::registers() {
189 // a0 : number of arguments (on the stack)
190 // a1 : the target to call
191 // a4 : arguments list length (untagged)
192 // a2 : arguments list (FixedArray)
193 return RegisterArray(a1, a0, a4, a2);
194}
195
196// static
198 // a1: the target to call
199 // a0: number of arguments
200 // a2: start index (to support rest parameters)
201 return RegisterArray(a1, a0, a2);
202}
203
204// static
206 // a1 : function template info
207 // a0 : number of arguments (on the stack)
208 return RegisterArray(a1, a0);
209}
210
211// static
213 // a1 : function template info
214 // a2 : number of arguments (on the stack)
215 // a3 : topmost script-having context
216 return RegisterArray(a1, a2, a3);
217}
218
219// static
221 // a0 : number of arguments (on the stack)
222 // a1 : the target to call
223 // a2 : the object to spread
224 return RegisterArray(a1, a0, a2);
225}
226
227// static
229 // a1 : the target to call
230 // a2 : the arguments list
231 return RegisterArray(a1, a2);
232}
233
234// static
236 // a0 : number of arguments (on the stack)
237 // a1 : the target to call
238 // a3 : the new target
239 // a4 : arguments list length (untagged)
240 // a2 : arguments list (FixedArray)
241 return RegisterArray(a1, a3, a0, a4, a2);
242}
243
244// static
246 // a1: the target to call
247 // a3: new target
248 // a0: number of arguments
249 // a2: start index (to support rest parameters)
250 return RegisterArray(a1, a3, a0, a2);
251}
252
253// static
255 // a0 : number of arguments (on the stack)
256 // a1 : the target to call
257 // a3 : the new target
258 // a2 : the object to spread
259 return RegisterArray(a1, a3, a0, a2);
260}
261
262// static
264 // a1 : the target to call
265 // a3 : the new target
266 // a2 : the arguments list
267 return RegisterArray(a1, a3, a2);
268}
269
270// static
271constexpr auto ConstructStubDescriptor::registers() {
272 // a1: target
273 // a3: new target
274 // a0: number of arguments
275 return RegisterArray(a1, a3, a0);
276}
277
278// static
279constexpr auto AbortDescriptor::registers() { return RegisterArray(a0); }
280
281// static
282constexpr auto CompareDescriptor::registers() { return RegisterArray(a1, a0); }
283
284// static
286 // a1: left operand
287 // a0: right operand
288 // a2: feedback slot
289 return RegisterArray(a1, a0, a2);
290}
291
292// static
293constexpr auto BinaryOpDescriptor::registers() { return RegisterArray(a1, a0); }
294
295// static
297 // a1: left operand
298 // a0: right operand
299 // a2: feedback slot
300 return RegisterArray(a1, a0, a2);
301}
302
303// static
305 // a0: left operand
306 // a1: right operand
307 // a2: feedback slot
308 return RegisterArray(a0, a1, a2);
309}
310
311// static
312constexpr Register
313CallApiCallbackOptimizedDescriptor::ApiFunctionAddressRegister() {
314 return a1;
315}
316// static
317constexpr Register
319 return a2;
320}
321// static
322constexpr Register
324 return a1;
325}
326// static
327constexpr Register
329 return a3;
330}
331
332// static
333constexpr Register
334CallApiCallbackGenericDescriptor::ActualArgumentsCountRegister() {
335 return a2;
336}
337// static
338constexpr Register
340 return a3;
341}
342
343// static
345 return RegisterArray(
348}
349
350// static
352 // a0 : argument count (not including receiver)
353 // a2 : address of first argument
354 // a1 : the target callable to be call
355 return RegisterArray(a0, a2, a1);
356}
357
358// static
360 // a0 : argument count
361 // a4 : address of the first argument
362 // a1 : constructor to call
363 // a3 : new target
364 // a2 : allocation site feedback if available, undefined otherwise
365 return RegisterArray(a0, a4, a1, a3, a2);
366}
367
368// static
370 return RegisterArray(a1, // constructor to call
371 a3); // new target
372}
373
374// static
376 // v0 : the value to pass to the generator
377 // a1 : the JSGeneratorObject to resume
378 return RegisterArray(a0, a1);
379}
380
381// static
383 return RegisterArray(a0, a1);
384}
385
387 // Arbitrarily picked register.
388 return RegisterArray(t0);
389}
390
391} // namespace internal
392} // namespace v8
393
394#endif // V8_TARGET_ARCH_LOONG64
395
396#endif // V8_CODEGEN_LOONG64_INTERFACE_DESCRIPTORS_LOONG64_INL_H_
static DEFINE_PARAMETERS_VARARGS(kActualArgumentsCount, kTopmostScriptHavingContext, kFunctionTemplateInfo) DEFINE_PARAMETER_TYPES(MachineType constexpr Register TopmostScriptHavingContextRegister()
static DEFINE_PARAMETERS_VARARGS(kApiFunctionAddress, kActualArgumentsCount, kFunctionTemplateInfo) DEFINE_PARAMETER_TYPES(MachineType constexpr Register ActualArgumentsCountRegister()
RegListBase< RegisterT > registers
constexpr EmptyDoubleRegisterArray DoubleRegisterArray()
RegListBase< Register > RegList
Definition reglist-arm.h:14
constexpr DwVfpRegister no_dreg
constexpr EmptyRegisterArray RegisterArray()
constexpr Register kInterpreterAccumulatorRegister
constexpr DoubleRegister kFPReturnRegister0
constexpr Register kReturnRegister1
constexpr Register kReturnRegister0
constexpr Register kContextRegister
constexpr Register kInterpreterDispatchTableRegister
constexpr Register kReturnRegister2
constexpr int kMaxBuiltinRegisterParams
constexpr Register kInterpreterBytecodeOffsetRegister
constexpr Register kInterpreterBytecodeArrayRegister
#define DCHECK(condition)
Definition logging.h:482