v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
interface-descriptors-ppc-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_PPC_INTERFACE_DESCRIPTORS_PPC_INL_H_
6#define V8_CODEGEN_PPC_INTERFACE_DESCRIPTORS_PPC_INL_H_
7
8#if V8_TARGET_ARCH_PPC64
9
12
13namespace v8 {
14namespace internal {
15
17 auto registers = RegisterArray(r3, r4, r5, r6, r7);
18 static_assert(registers.size() == kMaxBuiltinRegisterParams);
19 return registers;
20}
21
23 auto registers = DoubleRegisterArray(d1, d2, d3, d4, d5, d6, d7);
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(r3));
45 if (argc >= 2) DCHECK(allocatable_regs.has(r4));
46 if (argc >= 3) DCHECK(allocatable_regs.has(r5));
47 if (argc >= 4) DCHECK(allocatable_regs.has(r6));
48 if (argc >= 5) DCHECK(allocatable_regs.has(r7));
49 if (argc >= 6) DCHECK(allocatable_regs.has(r8));
50 if (argc >= 7) DCHECK(allocatable_regs.has(r9));
51 if (argc >= 8) DCHECK(allocatable_regs.has(r10));
52 // Additional arguments are passed on the stack.
53}
54#endif // DEBUG
55
56// static
57constexpr auto WriteBarrierDescriptor::registers() {
58 return RegisterArray(r4, r8, r7, r5, r3, r6, kContextRegister);
59}
60
61// static
62constexpr Register LoadDescriptor::ReceiverRegister() { return r4; }
63// static
64constexpr Register LoadDescriptor::NameRegister() { return r5; }
65// static
66constexpr Register LoadDescriptor::SlotRegister() { return r3; }
67
68// static
69constexpr Register LoadWithVectorDescriptor::VectorRegister() { return r6; }
70
71// static
72constexpr Register KeyedLoadBaselineDescriptor::ReceiverRegister() {
73 return r4;
74}
75// static
78}
79// static
81
82// static
83constexpr Register KeyedLoadWithVectorDescriptor::VectorRegister() {
84 return r6;
85}
86
87// static
88constexpr Register EnumeratedKeyedLoadBaselineDescriptor::EnumIndexRegister() {
89 return r7;
90}
91
92// static
94 return r8;
95}
96
97// static
99 return r5;
100}
101
102// static
103constexpr Register KeyedHasICBaselineDescriptor::ReceiverRegister() {
105}
106// static
108// static
110
111// static
112constexpr Register KeyedHasICWithVectorDescriptor::VectorRegister() {
113 return r6;
114}
115
116// static
117constexpr Register
118LoadWithReceiverAndVectorDescriptor::LookupStartObjectRegister() {
119 return r7;
120}
121
122// static
123constexpr Register StoreDescriptor::ReceiverRegister() { return r4; }
124// static
125constexpr Register StoreDescriptor::NameRegister() { return r5; }
126// static
127constexpr Register StoreDescriptor::ValueRegister() { return r3; }
128// static
129constexpr Register StoreDescriptor::SlotRegister() { return r7; }
130
131// static
132constexpr Register StoreWithVectorDescriptor::VectorRegister() { return r6; }
133
134// static
135constexpr Register DefineKeyedOwnDescriptor::FlagsRegister() { return r8; }
136
137// static
138constexpr Register StoreTransitionDescriptor::MapRegister() { return r8; }
139
140// static
141constexpr Register ApiGetterDescriptor::HolderRegister() { return r3; }
142// static
143constexpr Register ApiGetterDescriptor::CallbackRegister() { return r6; }
144
145// static
146constexpr Register GrowArrayElementsDescriptor::ObjectRegister() { return r3; }
147// static
148constexpr Register GrowArrayElementsDescriptor::KeyRegister() { return r6; }
149
150// static
151constexpr Register BaselineLeaveFrameDescriptor::ParamsSizeRegister() {
152 return r6;
153}
154// static
156
157// static
158// static
160
161// static
162constexpr auto TypeofDescriptor::registers() { return RegisterArray(r3); }
163
164// static
166 // r3 : number of arguments
167 // r4 : the target to call
168 return RegisterArray(r4, r3);
169}
170
171// static
173 // r4 : the source
174 // r3 : the excluded property count
175 return RegisterArray(r4, r3);
176}
177
178// static
179constexpr auto
181 // r4 : the source
182 // r3 : the excluded property count
183 // r5 : the excluded property base
184 return RegisterArray(r4, r3, r5);
185}
186
187// static
188constexpr auto CallVarargsDescriptor::registers() {
189 // r3 : number of arguments (on the stack)
190 // r4 : the target to call
191 // r7 : arguments list length (untagged)
192 // r5 : arguments list (FixedArray)
193 return RegisterArray(r4, r3, r7, r5);
194}
195
196// static
198 // r3 : number of arguments
199 // r5 : start index (to support rest parameters)
200 // r4 : the target to call
201 return RegisterArray(r4, r3, r5);
202}
203
204// static
206 // r4 : function template info
207 // r5 : number of arguments (on the stack)
208 return RegisterArray(r4, r5);
209}
210
211// static
213 // r4 : function template info
214 // r5 : number of arguments (on the stack)
215 // r6 : topmost script-having context
216 return RegisterArray(r4, r5, r6);
217}
218
219// static
221 // r3 : number of arguments (on the stack)
222 // r4 : the target to call
223 // r5 : the object to spread
224 return RegisterArray(r4, r3, r5);
225}
226
227// static
229 // r4 : the target to call
230 // r5 : the arguments list
231 return RegisterArray(r4, r5);
232}
233
234// static
236 // r3 : number of arguments (on the stack)
237 // r4 : the target to call
238 // r6 : the new target
239 // r7 : arguments list length (untagged)
240 // r5 : arguments list (FixedArray)
241 return RegisterArray(r4, r6, r3, r7, r5);
242}
243
244// static
246 // r3 : number of arguments
247 // r6 : the new target
248 // r5 : start index (to support rest parameters)
249 // r4 : the target to call
250 return RegisterArray(r4, r6, r3, r5);
251}
252
253// static
255 // r3 : number of arguments (on the stack)
256 // r4 : the target to call
257 // r6 : the new target
258 // r5 : the object to spread
259 return RegisterArray(r4, r6, r3, r5);
260}
261
262// static
264 // r4 : the target to call
265 // r6 : the new target
266 // r5 : the arguments list
267 return RegisterArray(r4, r6, r5);
268}
269
270// static
271constexpr auto ConstructStubDescriptor::registers() {
272 // r3 : number of arguments
273 // r4 : the target to call
274 // r6 : the new target
275 return RegisterArray(r4, r6, r3);
276}
277
278// static
279constexpr auto AbortDescriptor::registers() { return RegisterArray(r4); }
280
281// static
282constexpr auto CompareDescriptor::registers() { return RegisterArray(r4, r3); }
283
284// static
286 return RegisterArray(r4, r3, r5);
287}
288
289// static
290constexpr auto BinaryOpDescriptor::registers() { return RegisterArray(r4, r3); }
291
292// static
294 return RegisterArray(r4, r3, r5);
295}
296
297// static
299 return RegisterArray(r3, r4, r5);
300}
301
302// static
303constexpr Register
304CallApiCallbackOptimizedDescriptor::ApiFunctionAddressRegister() {
305 return r4;
306}
307// static
308constexpr Register
310 return r5;
311}
312// static
313constexpr Register
315 return r6;
316}
317
318// static
319constexpr Register
320CallApiCallbackGenericDescriptor::ActualArgumentsCountRegister() {
321 return r5;
322}
323// static
324constexpr Register
326 return r4;
327}
328// static
329constexpr Register
331 return r6;
332}
333
334// static
336 return RegisterArray(
339}
340
341// static
343 return RegisterArray(r3, // argument count
344 r5, // address of first argument
345 r4); // the target callable to be call
346}
347
348// static
350 return RegisterArray(
351 r3, // argument count
352 r7, // address of the first argument
353 r4, // constructor to call
354 r6, // new target
355 r5); // allocation site feedback if available, undefined otherwise
356}
357
358// static
360 return RegisterArray(r4, // constructor to call
361 r6); // new target
362}
363
364// static
366 return RegisterArray(r3, // the value to pass to the generator
367 r4); // the JSGeneratorObject to resume
368}
369
370// static
372 return RegisterArray(r3, r4);
373}
374
376 // Arbitrarily picked register.
377 return RegisterArray(r14);
378}
379} // namespace internal
380} // namespace v8
381
382#endif // V8_TARGET_ARCH_PPC64
383
384#endif // V8_CODEGEN_PPC_INTERFACE_DESCRIPTORS_PPC_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