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.
7 #if V8_TARGET_ARCH_MIPS
9 #include "src/interface-descriptors.h"
14 const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
17 const Register LoadDescriptor::ReceiverRegister() { return a1; }
18 const Register LoadDescriptor::NameRegister() { return a2; }
19 const Register LoadDescriptor::SlotRegister() { return a0; }
22 const Register LoadWithVectorDescriptor::VectorRegister() { return a3; }
25 const Register StoreDescriptor::ReceiverRegister() { return a1; }
26 const Register StoreDescriptor::NameRegister() { return a2; }
27 const Register StoreDescriptor::ValueRegister() { return a0; }
30 const Register VectorStoreICTrampolineDescriptor::SlotRegister() { return t0; }
33 const Register VectorStoreICDescriptor::VectorRegister() { return a3; }
36 const Register StoreTransitionDescriptor::MapRegister() { return a3; }
39 const Register LoadGlobalViaContextDescriptor::SlotRegister() { return a2; }
42 const Register StoreGlobalViaContextDescriptor::SlotRegister() { return a2; }
43 const Register StoreGlobalViaContextDescriptor::ValueRegister() { return a0; }
46 const Register InstanceofDescriptor::left() { return a0; }
47 const Register InstanceofDescriptor::right() { return a1; }
50 const Register ArgumentsAccessReadDescriptor::index() { return a1; }
51 const Register ArgumentsAccessReadDescriptor::parameter_count() { return a0; }
54 const Register ApiGetterDescriptor::function_address() { return a2; }
57 const Register MathPowTaggedDescriptor::exponent() { return a2; }
60 const Register MathPowIntegerDescriptor::exponent() {
61 return MathPowTaggedDescriptor::exponent();
65 const Register GrowArrayElementsDescriptor::ObjectRegister() { return a0; }
66 const Register GrowArrayElementsDescriptor::KeyRegister() { return a3; }
69 void StoreTransitionDescriptor::InitializePlatformSpecific(
70 CallInterfaceDescriptorData* data) {
71 Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(),
73 data->InitializePlatformSpecific(arraysize(registers), registers);
77 void FastNewClosureDescriptor::InitializePlatformSpecific(
78 CallInterfaceDescriptorData* data) {
79 Register registers[] = {a2};
80 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
84 void FastNewContextDescriptor::InitializePlatformSpecific(
85 CallInterfaceDescriptorData* data) {
86 Register registers[] = {a1};
87 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
91 void ToNumberDescriptor::InitializePlatformSpecific(
92 CallInterfaceDescriptorData* data) {
93 Register registers[] = {a0};
94 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
98 void NumberToStringDescriptor::InitializePlatformSpecific(
99 CallInterfaceDescriptorData* data) {
100 Register registers[] = {a0};
101 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
105 void TypeofDescriptor::InitializePlatformSpecific(
106 CallInterfaceDescriptorData* data) {
107 Register registers[] = {a3};
108 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
112 void FastCloneShallowArrayDescriptor::InitializePlatformSpecific(
113 CallInterfaceDescriptorData* data) {
114 Register registers[] = {a3, a2, a1};
115 data->InitializePlatformSpecific(arraysize(registers), registers);
119 void FastCloneShallowObjectDescriptor::InitializePlatformSpecific(
120 CallInterfaceDescriptorData* data) {
121 Register registers[] = {a3, a2, a1, a0};
122 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
126 void CreateAllocationSiteDescriptor::InitializePlatformSpecific(
127 CallInterfaceDescriptorData* data) {
128 Register registers[] = {a2, a3};
129 data->InitializePlatformSpecific(arraysize(registers), registers);
133 void CreateWeakCellDescriptor::InitializePlatformSpecific(
134 CallInterfaceDescriptorData* data) {
135 Register registers[] = {a2, a3, a1};
136 data->InitializePlatformSpecific(arraysize(registers), registers);
140 void StoreArrayLiteralElementDescriptor::InitializePlatformSpecific(
141 CallInterfaceDescriptorData* data) {
142 Register registers[] = {a3, a0};
143 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
147 void CallFunctionDescriptor::InitializePlatformSpecific(
148 CallInterfaceDescriptorData* data) {
149 Register registers[] = {a1};
150 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
154 void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific(
155 CallInterfaceDescriptorData* data) {
156 Register registers[] = {a1, a3};
157 data->InitializePlatformSpecific(arraysize(registers), registers);
161 void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific(
162 CallInterfaceDescriptorData* data) {
163 Register registers[] = {a1, a3, a2};
164 data->InitializePlatformSpecific(arraysize(registers), registers);
168 void CallConstructDescriptor::InitializePlatformSpecific(
169 CallInterfaceDescriptorData* data) {
170 // a0 : number of arguments
171 // a1 : the function to call
172 // a2 : feedback vector
173 // a3 : slot in feedback vector (Smi, for RecordCallTarget)
174 // t0 : original constructor (for IsSuperConstructorCall)
175 // TODO(turbofan): So far we don't gather type feedback and hence skip the
176 // slot parameter, but ArrayConstructStub needs the vector to be undefined.
177 Register registers[] = {a0, a1, t0, a2};
178 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
182 void RegExpConstructResultDescriptor::InitializePlatformSpecific(
183 CallInterfaceDescriptorData* data) {
184 Register registers[] = {a2, a1, a0};
185 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
189 void TransitionElementsKindDescriptor::InitializePlatformSpecific(
190 CallInterfaceDescriptorData* data) {
191 Register registers[] = {a0, a1};
192 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
196 void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
197 CallInterfaceDescriptorData* data) {
199 data->InitializePlatformSpecific(0, nullptr, nullptr);
203 void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific(
204 CallInterfaceDescriptorData* data) {
206 // a0 -- number of arguments
208 // a2 -- allocation site with elements kind
209 Register registers[] = {a1, a2};
210 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
214 void ArrayConstructorDescriptor::InitializePlatformSpecific(
215 CallInterfaceDescriptorData* data) {
216 // stack param count needs (constructor pointer, and single argument)
217 Register registers[] = {a1, a2, a0};
218 data->InitializePlatformSpecific(arraysize(registers), registers);
222 void InternalArrayConstructorConstantArgCountDescriptor::
223 InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
225 // a0 -- number of arguments
226 // a1 -- constructor function
227 Register registers[] = {a1};
228 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
232 void InternalArrayConstructorDescriptor::InitializePlatformSpecific(
233 CallInterfaceDescriptorData* data) {
234 // stack param count needs (constructor pointer, and single argument)
235 Register registers[] = {a1, a0};
236 data->InitializePlatformSpecific(arraysize(registers), registers);
240 void CompareDescriptor::InitializePlatformSpecific(
241 CallInterfaceDescriptorData* data) {
242 Register registers[] = {a1, a0};
243 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
247 void CompareNilDescriptor::InitializePlatformSpecific(
248 CallInterfaceDescriptorData* data) {
249 Register registers[] = {a0};
250 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
254 void ToBooleanDescriptor::InitializePlatformSpecific(
255 CallInterfaceDescriptorData* data) {
256 Register registers[] = {a0};
257 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
261 void BinaryOpDescriptor::InitializePlatformSpecific(
262 CallInterfaceDescriptorData* data) {
263 Register registers[] = {a1, a0};
264 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
268 void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific(
269 CallInterfaceDescriptorData* data) {
270 Register registers[] = {a2, a1, a0};
271 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
275 void StringAddDescriptor::InitializePlatformSpecific(
276 CallInterfaceDescriptorData* data) {
277 Register registers[] = {a1, a0};
278 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
282 void KeyedDescriptor::InitializePlatformSpecific(
283 CallInterfaceDescriptorData* data) {
284 Register registers[] = {
287 data->InitializePlatformSpecific(arraysize(registers), registers);
291 void NamedDescriptor::InitializePlatformSpecific(
292 CallInterfaceDescriptorData* data) {
293 Register registers[] = {
296 data->InitializePlatformSpecific(arraysize(registers), registers);
300 void CallHandlerDescriptor::InitializePlatformSpecific(
301 CallInterfaceDescriptorData* data) {
302 Register registers[] = {
305 data->InitializePlatformSpecific(arraysize(registers), registers);
309 void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
310 CallInterfaceDescriptorData* data) {
311 Register registers[] = {
313 a0, // actual number of arguments
314 a2, // expected number of arguments
316 data->InitializePlatformSpecific(arraysize(registers), registers);
320 void ApiFunctionDescriptor::InitializePlatformSpecific(
321 CallInterfaceDescriptorData* data) {
322 Register registers[] = {
326 a1, // api_function_address
327 a3, // actual number of arguments
329 data->InitializePlatformSpecific(arraysize(registers), registers);
333 void ApiAccessorDescriptor::InitializePlatformSpecific(
334 CallInterfaceDescriptorData* data) {
335 Register registers[] = {
339 a1, // api_function_address
341 data->InitializePlatformSpecific(arraysize(registers), registers);
345 void MathRoundVariantCallFromUnoptimizedCodeDescriptor::
346 InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
347 Register registers[] = {
348 a1, // math rounding function
349 a3, // vector slot id
351 data->InitializePlatformSpecific(arraysize(registers), registers);
355 void MathRoundVariantCallFromOptimizedCodeDescriptor::
356 InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
357 Register registers[] = {
358 a1, // math rounding function
359 a3, // vector slot id
362 data->InitializePlatformSpecific(arraysize(registers), registers);
364 } // namespace internal
367 #endif // V8_TARGET_ARCH_MIPS