1 // Copyright 2012 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.
5 #if V8_TARGET_ARCH_MIPS
7 #include "src/interface-descriptors.h"
12 const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
15 const Register LoadDescriptor::ReceiverRegister() { return a1; }
16 const Register LoadDescriptor::NameRegister() { return a2; }
17 const Register LoadDescriptor::SlotRegister() { return a0; }
20 const Register LoadWithVectorDescriptor::VectorRegister() { return a3; }
23 const Register StoreDescriptor::ReceiverRegister() { return a1; }
24 const Register StoreDescriptor::NameRegister() { return a2; }
25 const Register StoreDescriptor::ValueRegister() { return a0; }
28 const Register VectorStoreICTrampolineDescriptor::SlotRegister() { return t0; }
31 const Register VectorStoreICDescriptor::VectorRegister() { return a3; }
34 const Register VectorStoreTransitionDescriptor::SlotRegister() { return t0; }
35 const Register VectorStoreTransitionDescriptor::VectorRegister() { return a3; }
36 const Register VectorStoreTransitionDescriptor::MapRegister() { return t1; }
39 const Register StoreTransitionDescriptor::MapRegister() { return a3; }
42 const Register LoadGlobalViaContextDescriptor::SlotRegister() { return a2; }
45 const Register StoreGlobalViaContextDescriptor::SlotRegister() { return a2; }
46 const Register StoreGlobalViaContextDescriptor::ValueRegister() { return a0; }
49 const Register InstanceOfDescriptor::LeftRegister() { return a1; }
50 const Register InstanceOfDescriptor::RightRegister() { return a0; }
53 const Register StringCompareDescriptor::LeftRegister() { return a1; }
54 const Register StringCompareDescriptor::RightRegister() { return a0; }
57 const Register ArgumentsAccessReadDescriptor::index() { return a1; }
58 const Register ArgumentsAccessReadDescriptor::parameter_count() { return a0; }
61 const Register ApiGetterDescriptor::function_address() { return a2; }
64 const Register MathPowTaggedDescriptor::exponent() { return a2; }
67 const Register MathPowIntegerDescriptor::exponent() {
68 return MathPowTaggedDescriptor::exponent();
72 const Register GrowArrayElementsDescriptor::ObjectRegister() { return a0; }
73 const Register GrowArrayElementsDescriptor::KeyRegister() { return a3; }
76 void VectorStoreTransitionDescriptor::InitializePlatformSpecific(
77 CallInterfaceDescriptorData* data) {
78 Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(),
79 SlotRegister(), VectorRegister(), MapRegister()};
80 data->InitializePlatformSpecific(arraysize(registers), registers);
84 void FastNewClosureDescriptor::InitializePlatformSpecific(
85 CallInterfaceDescriptorData* data) {
86 Register registers[] = {a2};
87 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
91 void FastNewContextDescriptor::InitializePlatformSpecific(
92 CallInterfaceDescriptorData* data) {
93 Register registers[] = {a1};
94 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
98 void ToNumberDescriptor::InitializePlatformSpecific(
99 CallInterfaceDescriptorData* data) {
100 Register registers[] = {a0};
101 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
106 const Register ToStringDescriptor::ReceiverRegister() { return a0; }
110 const Register ToObjectDescriptor::ReceiverRegister() { return a0; }
113 void NumberToStringDescriptor::InitializePlatformSpecific(
114 CallInterfaceDescriptorData* data) {
115 Register registers[] = {a0};
116 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
120 void TypeofDescriptor::InitializePlatformSpecific(
121 CallInterfaceDescriptorData* data) {
122 Register registers[] = {a3};
123 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
127 void FastCloneShallowArrayDescriptor::InitializePlatformSpecific(
128 CallInterfaceDescriptorData* data) {
129 Register registers[] = {a3, a2, a1};
130 data->InitializePlatformSpecific(arraysize(registers), registers);
134 void FastCloneShallowObjectDescriptor::InitializePlatformSpecific(
135 CallInterfaceDescriptorData* data) {
136 Register registers[] = {a3, a2, a1, a0};
137 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
141 void CreateAllocationSiteDescriptor::InitializePlatformSpecific(
142 CallInterfaceDescriptorData* data) {
143 Register registers[] = {a2, a3};
144 data->InitializePlatformSpecific(arraysize(registers), registers);
148 void CreateWeakCellDescriptor::InitializePlatformSpecific(
149 CallInterfaceDescriptorData* data) {
150 Register registers[] = {a2, a3, a1};
151 data->InitializePlatformSpecific(arraysize(registers), registers);
155 void StoreArrayLiteralElementDescriptor::InitializePlatformSpecific(
156 CallInterfaceDescriptorData* data) {
157 Register registers[] = {a3, a0};
158 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
162 void CallFunctionDescriptor::InitializePlatformSpecific(
163 CallInterfaceDescriptorData* data) {
164 Register registers[] = {a1};
165 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
169 void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific(
170 CallInterfaceDescriptorData* data) {
171 Register registers[] = {a1, a3};
172 data->InitializePlatformSpecific(arraysize(registers), registers);
176 void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific(
177 CallInterfaceDescriptorData* data) {
178 Register registers[] = {a1, a3, a2};
179 data->InitializePlatformSpecific(arraysize(registers), registers);
183 void CallConstructDescriptor::InitializePlatformSpecific(
184 CallInterfaceDescriptorData* data) {
185 // a0 : number of arguments
186 // a1 : the function to call
187 // a2 : feedback vector
188 // a3 : slot in feedback vector (Smi, for RecordCallTarget)
189 // t0 : original constructor (for IsSuperConstructorCall)
190 // TODO(turbofan): So far we don't gather type feedback and hence skip the
191 // slot parameter, but ArrayConstructStub needs the vector to be undefined.
192 Register registers[] = {a0, a1, t0, a2};
193 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
197 void CallTrampolineDescriptor::InitializePlatformSpecific(
198 CallInterfaceDescriptorData* data) {
200 // a0: number of arguments
201 Register registers[] = {a1, a0};
202 data->InitializePlatformSpecific(arraysize(registers), registers);
206 void RegExpConstructResultDescriptor::InitializePlatformSpecific(
207 CallInterfaceDescriptorData* data) {
208 Register registers[] = {a2, a1, a0};
209 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
213 void TransitionElementsKindDescriptor::InitializePlatformSpecific(
214 CallInterfaceDescriptorData* data) {
215 Register registers[] = {a0, a1};
216 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
220 void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
221 CallInterfaceDescriptorData* data) {
223 data->InitializePlatformSpecific(0, nullptr, nullptr);
227 void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific(
228 CallInterfaceDescriptorData* data) {
230 // a0 -- number of arguments
232 // a2 -- allocation site with elements kind
233 Register registers[] = {a1, a2};
234 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
238 void ArrayConstructorDescriptor::InitializePlatformSpecific(
239 CallInterfaceDescriptorData* data) {
240 // stack param count needs (constructor pointer, and single argument)
241 Register registers[] = {a1, a2, a0};
242 data->InitializePlatformSpecific(arraysize(registers), registers);
246 void InternalArrayConstructorConstantArgCountDescriptor::
247 InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
249 // a0 -- number of arguments
250 // a1 -- constructor function
251 Register registers[] = {a1};
252 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
256 void InternalArrayConstructorDescriptor::InitializePlatformSpecific(
257 CallInterfaceDescriptorData* data) {
258 // stack param count needs (constructor pointer, and single argument)
259 Register registers[] = {a1, a0};
260 data->InitializePlatformSpecific(arraysize(registers), registers);
264 void CompareDescriptor::InitializePlatformSpecific(
265 CallInterfaceDescriptorData* data) {
266 Register registers[] = {a1, a0};
267 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
271 void CompareNilDescriptor::InitializePlatformSpecific(
272 CallInterfaceDescriptorData* data) {
273 Register registers[] = {a0};
274 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
278 void ToBooleanDescriptor::InitializePlatformSpecific(
279 CallInterfaceDescriptorData* data) {
280 Register registers[] = {a0};
281 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
285 void BinaryOpDescriptor::InitializePlatformSpecific(
286 CallInterfaceDescriptorData* data) {
287 Register registers[] = {a1, a0};
288 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
292 void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific(
293 CallInterfaceDescriptorData* data) {
294 Register registers[] = {a2, a1, a0};
295 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
299 void StringAddDescriptor::InitializePlatformSpecific(
300 CallInterfaceDescriptorData* data) {
301 Register registers[] = {a1, a0};
302 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
306 void KeyedDescriptor::InitializePlatformSpecific(
307 CallInterfaceDescriptorData* data) {
308 Register registers[] = {
311 data->InitializePlatformSpecific(arraysize(registers), registers);
315 void NamedDescriptor::InitializePlatformSpecific(
316 CallInterfaceDescriptorData* data) {
317 Register registers[] = {
320 data->InitializePlatformSpecific(arraysize(registers), registers);
324 void CallHandlerDescriptor::InitializePlatformSpecific(
325 CallInterfaceDescriptorData* data) {
326 Register registers[] = {
329 data->InitializePlatformSpecific(arraysize(registers), registers);
333 void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
334 CallInterfaceDescriptorData* data) {
335 Register registers[] = {
337 a0, // actual number of arguments
338 a2, // expected number of arguments
340 data->InitializePlatformSpecific(arraysize(registers), registers);
344 void ApiFunctionDescriptor::InitializePlatformSpecific(
345 CallInterfaceDescriptorData* data) {
346 Register registers[] = {
350 a1, // api_function_address
351 a3, // actual number of arguments
353 data->InitializePlatformSpecific(arraysize(registers), registers);
357 void ApiAccessorDescriptor::InitializePlatformSpecific(
358 CallInterfaceDescriptorData* data) {
359 Register registers[] = {
363 a1, // api_function_address
365 data->InitializePlatformSpecific(arraysize(registers), registers);
369 void MathRoundVariantCallFromUnoptimizedCodeDescriptor::
370 InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
371 Register registers[] = {
372 a1, // math rounding function
373 a3, // vector slot id
375 data->InitializePlatformSpecific(arraysize(registers), registers);
379 void MathRoundVariantCallFromOptimizedCodeDescriptor::
380 InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
381 Register registers[] = {
382 a1, // math rounding function
383 a3, // vector slot id
386 data->InitializePlatformSpecific(arraysize(registers), registers);
390 void PushArgsAndCallDescriptor::InitializePlatformSpecific(
391 CallInterfaceDescriptorData* data) {
392 Register registers[] = {
393 a0, // argument count (including receiver)
394 a2, // address of first argument
395 a1 // the target callable to be call
397 data->InitializePlatformSpecific(arraysize(registers), registers);
400 } // namespace internal
403 #endif // V8_TARGET_ARCH_MIPS