v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
interface-descriptors-arm64-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_ARM64_INTERFACE_DESCRIPTORS_ARM64_INL_H_
6#define V8_CODEGEN_ARM64_INTERFACE_DESCRIPTORS_ARM64_INL_H_
7
8#if V8_TARGET_ARCH_ARM64
9
13
14namespace v8 {
15namespace internal {
16
18 auto registers = RegisterArray(x0, x1, x2, x3, x4);
19 static_assert(registers.size() == kMaxBuiltinRegisterParams);
20 return registers;
21}
22
24 auto registers = DoubleRegisterArray(d0, d1, d2, d3, d4, d5, d6);
25 return registers;
26}
27
29 auto registers =
31 return registers;
32}
33
35 // Padding to have as many double return registers as GP return registers.
37 return registers;
38}
39
40#if DEBUG
41template <typename DerivedDescriptor>
42void StaticCallInterfaceDescriptor<DerivedDescriptor>::
43 VerifyArgumentRegisterCount(CallInterfaceDescriptorData* data, int argc) {
44 RegList allocatable_regs = data->allocatable_registers();
45 if (argc >= 1) DCHECK(allocatable_regs.has(x0));
46 if (argc >= 2) DCHECK(allocatable_regs.has(x1));
47 if (argc >= 3) DCHECK(allocatable_regs.has(x2));
48 if (argc >= 4) DCHECK(allocatable_regs.has(x3));
49 if (argc >= 5) DCHECK(allocatable_regs.has(x4));
50 if (argc >= 6) DCHECK(allocatable_regs.has(x5));
51 if (argc >= 7) DCHECK(allocatable_regs.has(x6));
52 if (argc >= 8) DCHECK(allocatable_regs.has(x7));
53}
54#endif // DEBUG
55
56// static
57constexpr auto WriteBarrierDescriptor::registers() {
58 // TODO(leszeks): Remove x7 which is just there for padding.
59 return RegisterArray(x1, x5, x4, x2, x0, x3, kContextRegister, x7);
60}
61
62// static
63constexpr Register LoadDescriptor::ReceiverRegister() { return x1; }
64// static
65constexpr Register LoadDescriptor::NameRegister() { return x2; }
66// static
67constexpr Register LoadDescriptor::SlotRegister() { return x0; }
68
69// static
70constexpr Register LoadWithVectorDescriptor::VectorRegister() { return x3; }
71
72// static
73constexpr Register KeyedLoadBaselineDescriptor::ReceiverRegister() {
74 return x1;
75}
76// static
79}
80// static
82
83// static
84constexpr Register KeyedLoadWithVectorDescriptor::VectorRegister() {
85 return x3;
86}
87
88// static
89constexpr Register EnumeratedKeyedLoadBaselineDescriptor::EnumIndexRegister() {
90 return x4;
91}
92
93// static
95 return x5;
96}
97
98// static
100 return x2;
101}
102
103// static
104constexpr Register KeyedHasICBaselineDescriptor::ReceiverRegister() {
106}
107// static
109// static
111
112// static
113constexpr Register KeyedHasICWithVectorDescriptor::VectorRegister() {
114 return x3;
115}
116
117// static
118constexpr Register
119LoadWithReceiverAndVectorDescriptor::LookupStartObjectRegister() {
120 return x4;
121}
122
123// static
124constexpr Register StoreDescriptor::ReceiverRegister() { return x1; }
125// static
126constexpr Register StoreDescriptor::NameRegister() { return x2; }
127// static
128constexpr Register StoreDescriptor::ValueRegister() { return x0; }
129// static
130constexpr Register StoreDescriptor::SlotRegister() { return x4; }
131
132// static
133constexpr Register StoreWithVectorDescriptor::VectorRegister() { return x3; }
134
135// static
136constexpr Register DefineKeyedOwnDescriptor::FlagsRegister() { return x5; }
137
138// static
139constexpr Register StoreTransitionDescriptor::MapRegister() { return x5; }
140
141// static
142constexpr Register ApiGetterDescriptor::HolderRegister() { return x0; }
143// static
144constexpr Register ApiGetterDescriptor::CallbackRegister() { return x3; }
145
146// static
147constexpr Register GrowArrayElementsDescriptor::ObjectRegister() { return x0; }
148// static
149constexpr Register GrowArrayElementsDescriptor::KeyRegister() { return x3; }
150
151// static
152constexpr Register BaselineLeaveFrameDescriptor::ParamsSizeRegister() {
153 return x3;
154}
155// static
157
158// static
159// static
161
162// static
163constexpr Register
164MaglevOptimizeCodeOrTailCallOptimizedCodeSlotDescriptor::FlagsRegister() {
165 return x8;
166}
167// static
170 return x9;
171}
172// static
173constexpr Register
175 return x5;
176}
177
178// static
179constexpr auto TypeofDescriptor::registers() { return RegisterArray(x0); }
180
181// static
183 // x1: target
184 // x0: number of arguments
185 return RegisterArray(x1, x0);
186}
187
189 // r1 : the source
190 // r0 : the excluded property count
191 return RegisterArray(x1, x0);
192}
193
194constexpr auto
196 // r1 : the source
197 // r0 : the excluded property count
198 // x2 : the excluded property base
199 return RegisterArray(x1, x0, x2);
200}
201
202// static
203constexpr auto CallVarargsDescriptor::registers() {
204 // x0 : number of arguments (on the stack)
205 // x1 : the target to call
206 // x4 : arguments list length (untagged)
207 // x2 : arguments list (FixedArray)
208 return RegisterArray(x1, x0, x4, x2);
209}
210
211// static
213 // x1: target
214 // x0: number of arguments
215 // x2: start index (to supported rest parameters)
216 return RegisterArray(x1, x0, x2);
217}
218
219// static
221 // x1 : function template info
222 // x2 : number of arguments (on the stack)
223 return RegisterArray(x1, x2);
224}
225
226// static
228 // x1 : function template info
229 // x2 : number of arguments (on the stack)
230 // x3 : topmost script-having context
231 return RegisterArray(x1, x2, x3);
232}
233
234// static
236 // x0 : number of arguments (on the stack)
237 // x1 : the target to call
238 // x2 : the object to spread
239 return RegisterArray(x1, x0, x2);
240}
241
242// static
244 // x1 : the target to call
245 // x2 : the arguments list
246 return RegisterArray(x1, x2);
247}
248
249// static
251 // x0 : number of arguments (on the stack)
252 // x1 : the target to call
253 // x3 : the new target
254 // x4 : arguments list length (untagged)
255 // x2 : arguments list (FixedArray)
256 return RegisterArray(x1, x3, x0, x4, x2);
257}
258
259// static
261 // x3: new target
262 // x1: target
263 // x0: number of arguments
264 // x2: start index (to supported rest parameters)
265 return RegisterArray(x1, x3, x0, x2);
266}
267
268// static
270 // x0 : number of arguments (on the stack)
271 // x1 : the target to call
272 // x3 : the new target
273 // x2 : the object to spread
274 return RegisterArray(x1, x3, x0, x2);
275}
276
277// static
279 // x1 : the target to call
280 // x3 : the new target
281 // x2 : the arguments list
282 return RegisterArray(x1, x3, x2);
283}
284
285// static
286constexpr auto ConstructStubDescriptor::registers() {
287 // x3: new target
288 // x1: target
289 // x0: number of arguments
290 return RegisterArray(x1, x3, x0);
291}
292
293// static
294constexpr auto AbortDescriptor::registers() { return RegisterArray(x1); }
295
296// static
297constexpr auto CompareDescriptor::registers() {
298 // x1: left operand
299 // x0: right operand
300 return RegisterArray(x1, x0);
301}
302
303// static
305 // x1: left operand
306 // x0: right operand
307 // x2: feedback slot
308 return RegisterArray(x1, x0, x2);
309}
310
311// static
312constexpr auto BinaryOpDescriptor::registers() {
313 // x1: left operand
314 // x0: right operand
315 return RegisterArray(x1, x0);
316}
317
318// static
320 // x1: left operand
321 // x0: right operand
322 // x2: feedback slot
323 return RegisterArray(x1, x0, x2);
324}
325
326// static
328 // x0: left operand
329 // x1: right operand
330 // x2: feedback slot
331 return RegisterArray(x0, x1, x2);
332}
333
334// static
335constexpr Register
336CallApiCallbackOptimizedDescriptor::ApiFunctionAddressRegister() {
337 return x1;
338}
339// static
340constexpr Register
342 return x2;
343}
344// static
345constexpr Register
347 return x3;
348}
349
350// static
351constexpr Register
352CallApiCallbackGenericDescriptor::ActualArgumentsCountRegister() {
353 return x2;
354}
355// static
356constexpr Register
358 return x1;
359}
360// static
361constexpr Register
363 return x3;
364}
365
366// static
368 return RegisterArray(
371}
372
373// static
375 return RegisterArray(x0, // argument count
376 x2, // address of first argument
377 x1); // the target callable to be call
378}
379
380// static
382 return RegisterArray(
383 x0, // argument count
384 x4, // address of the first argument
385 x1, // constructor to call
386 x3, // new target
387 x2); // allocation site feedback if available, undefined otherwise
388}
389
390// static
392 return RegisterArray(x1, // constructor to call
393 x3); // new target
394}
395
396// static
398 return RegisterArray(x0, // the value to pass to the generator
399 x1); // the JSGeneratorObject to resume
400}
401
402// static
404 return RegisterArray(x0, x1);
405}
406
408 // Arbitrarily picked register.
409 return RegisterArray(x8);
410}
411
412} // namespace internal
413} // namespace v8
414
415#endif // V8_TARGET_ARCH_ARM64
416
417#endif // V8_CODEGEN_ARM64_INTERFACE_DESCRIPTORS_ARM64_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