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