• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #include "src/v8.h"
6 
7 #if V8_TARGET_ARCH_MIPS64
8 
9 #include "src/interface-descriptors.h"
10 
11 namespace v8 {
12 namespace internal {
13 
ContextRegister()14 const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
15 
16 
ReceiverRegister()17 const Register LoadDescriptor::ReceiverRegister() { return a1; }
NameRegister()18 const Register LoadDescriptor::NameRegister() { return a2; }
19 
20 
SlotRegister()21 const Register VectorLoadICTrampolineDescriptor::SlotRegister() { return a0; }
22 
23 
VectorRegister()24 const Register VectorLoadICDescriptor::VectorRegister() { return a3; }
25 
26 
ReceiverRegister()27 const Register StoreDescriptor::ReceiverRegister() { return a1; }
NameRegister()28 const Register StoreDescriptor::NameRegister() { return a2; }
ValueRegister()29 const Register StoreDescriptor::ValueRegister() { return a0; }
30 
31 
MapRegister()32 const Register ElementTransitionAndStoreDescriptor::MapRegister() { return a3; }
33 
34 
left()35 const Register InstanceofDescriptor::left() { return a0; }
right()36 const Register InstanceofDescriptor::right() { return a1; }
37 
38 
index()39 const Register ArgumentsAccessReadDescriptor::index() { return a1; }
parameter_count()40 const Register ArgumentsAccessReadDescriptor::parameter_count() { return a0; }
41 
42 
function_address()43 const Register ApiGetterDescriptor::function_address() { return a2; }
44 
45 
exponent()46 const Register MathPowTaggedDescriptor::exponent() { return a2; }
47 
48 
exponent()49 const Register MathPowIntegerDescriptor::exponent() {
50   return MathPowTaggedDescriptor::exponent();
51 }
52 
53 
Initialize(CallInterfaceDescriptorData * data)54 void FastNewClosureDescriptor::Initialize(CallInterfaceDescriptorData* data) {
55   Register registers[] = {cp, a2};
56   data->Initialize(arraysize(registers), registers, NULL);
57 }
58 
59 
Initialize(CallInterfaceDescriptorData * data)60 void FastNewContextDescriptor::Initialize(CallInterfaceDescriptorData* data) {
61   Register registers[] = {cp, a1};
62   data->Initialize(arraysize(registers), registers, NULL);
63 }
64 
65 
Initialize(CallInterfaceDescriptorData * data)66 void ToNumberDescriptor::Initialize(CallInterfaceDescriptorData* data) {
67   Register registers[] = {cp, a0};
68   data->Initialize(arraysize(registers), registers, NULL);
69 }
70 
71 
Initialize(CallInterfaceDescriptorData * data)72 void NumberToStringDescriptor::Initialize(CallInterfaceDescriptorData* data) {
73   Register registers[] = {cp, a0};
74   data->Initialize(arraysize(registers), registers, NULL);
75 }
76 
77 
Initialize(CallInterfaceDescriptorData * data)78 void FastCloneShallowArrayDescriptor::Initialize(
79     CallInterfaceDescriptorData* data) {
80   Register registers[] = {cp, a3, a2, a1};
81   Representation representations[] = {
82       Representation::Tagged(), Representation::Tagged(), Representation::Smi(),
83       Representation::Tagged()};
84   data->Initialize(arraysize(registers), registers, representations);
85 }
86 
87 
Initialize(CallInterfaceDescriptorData * data)88 void FastCloneShallowObjectDescriptor::Initialize(
89     CallInterfaceDescriptorData* data) {
90   Register registers[] = {cp, a3, a2, a1, a0};
91   data->Initialize(arraysize(registers), registers, NULL);
92 }
93 
94 
Initialize(CallInterfaceDescriptorData * data)95 void CreateAllocationSiteDescriptor::Initialize(
96     CallInterfaceDescriptorData* data) {
97   Register registers[] = {cp, a2, a3};
98   data->Initialize(arraysize(registers), registers, NULL);
99 }
100 
101 
Initialize(CallInterfaceDescriptorData * data)102 void StoreArrayLiteralElementDescriptor::Initialize(
103     CallInterfaceDescriptorData* data) {
104   Register registers[] = {cp, a3, a0};
105   data->Initialize(arraysize(registers), registers, NULL);
106 }
107 
108 
Initialize(CallInterfaceDescriptorData * data)109 void CallFunctionWithFeedbackDescriptor::Initialize(
110     CallInterfaceDescriptorData* data) {
111   Register registers[] = {cp, a1, a3};
112   Representation representations[] = {Representation::Tagged(),
113                                       Representation::Tagged(),
114                                       Representation::Smi()};
115   data->Initialize(arraysize(registers), registers, representations);
116 }
117 
118 
Initialize(CallInterfaceDescriptorData * data)119 void CallFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) {
120   Register registers[] = {cp, a1};
121   data->Initialize(arraysize(registers), registers, NULL);
122 }
123 
124 
Initialize(CallInterfaceDescriptorData * data)125 void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) {
126   // a0 : number of arguments
127   // a1 : the function to call
128   // a2 : feedback vector
129   // a3 : (only if a2 is not the megamorphic symbol) slot in feedback
130   //      vector (Smi)
131   // TODO(turbofan): So far we don't gather type feedback and hence skip the
132   // slot parameter, but ArrayConstructStub needs the vector to be undefined.
133   Register registers[] = {cp, a0, a1, a2};
134   data->Initialize(arraysize(registers), registers, NULL);
135 }
136 
137 
Initialize(CallInterfaceDescriptorData * data)138 void RegExpConstructResultDescriptor::Initialize(
139     CallInterfaceDescriptorData* data) {
140   Register registers[] = {cp, a2, a1, a0};
141   data->Initialize(arraysize(registers), registers, NULL);
142 }
143 
144 
Initialize(CallInterfaceDescriptorData * data)145 void TransitionElementsKindDescriptor::Initialize(
146     CallInterfaceDescriptorData* data) {
147   Register registers[] = {cp, a0, a1};
148   data->Initialize(arraysize(registers), registers, NULL);
149 }
150 
151 
Initialize(CallInterfaceDescriptorData * data)152 void ArrayConstructorConstantArgCountDescriptor::Initialize(
153     CallInterfaceDescriptorData* data) {
154   // register state
155   // cp -- context
156   // a0 -- number of arguments
157   // a1 -- function
158   // a2 -- allocation site with elements kind
159   Register registers[] = {cp, a1, a2};
160   data->Initialize(arraysize(registers), registers, NULL);
161 }
162 
163 
Initialize(CallInterfaceDescriptorData * data)164 void ArrayConstructorDescriptor::Initialize(CallInterfaceDescriptorData* data) {
165   // stack param count needs (constructor pointer, and single argument)
166   Register registers[] = {cp, a1, a2, a0};
167   Representation representations[] = {
168       Representation::Tagged(), Representation::Tagged(),
169       Representation::Tagged(), Representation::Integer32()};
170   data->Initialize(arraysize(registers), registers, representations);
171 }
172 
173 
Initialize(CallInterfaceDescriptorData * data)174 void InternalArrayConstructorConstantArgCountDescriptor::Initialize(
175     CallInterfaceDescriptorData* data) {
176   // register state
177   // cp -- context
178   // a0 -- number of arguments
179   // a1 -- constructor function
180   Register registers[] = {cp, a1};
181   data->Initialize(arraysize(registers), registers, NULL);
182 }
183 
184 
Initialize(CallInterfaceDescriptorData * data)185 void InternalArrayConstructorDescriptor::Initialize(
186     CallInterfaceDescriptorData* data) {
187   // stack param count needs (constructor pointer, and single argument)
188   Register registers[] = {cp, a1, a0};
189   Representation representations[] = {Representation::Tagged(),
190                                       Representation::Tagged(),
191                                       Representation::Integer32()};
192   data->Initialize(arraysize(registers), registers, representations);
193 }
194 
195 
Initialize(CallInterfaceDescriptorData * data)196 void CompareNilDescriptor::Initialize(CallInterfaceDescriptorData* data) {
197   Register registers[] = {cp, a0};
198   data->Initialize(arraysize(registers), registers, NULL);
199 }
200 
201 
Initialize(CallInterfaceDescriptorData * data)202 void ToBooleanDescriptor::Initialize(CallInterfaceDescriptorData* data) {
203   Register registers[] = {cp, a0};
204   data->Initialize(arraysize(registers), registers, NULL);
205 }
206 
207 
Initialize(CallInterfaceDescriptorData * data)208 void BinaryOpDescriptor::Initialize(CallInterfaceDescriptorData* data) {
209   Register registers[] = {cp, a1, a0};
210   data->Initialize(arraysize(registers), registers, NULL);
211 }
212 
213 
Initialize(CallInterfaceDescriptorData * data)214 void BinaryOpWithAllocationSiteDescriptor::Initialize(
215     CallInterfaceDescriptorData* data) {
216   Register registers[] = {cp, a2, a1, a0};
217   data->Initialize(arraysize(registers), registers, NULL);
218 }
219 
220 
Initialize(CallInterfaceDescriptorData * data)221 void StringAddDescriptor::Initialize(CallInterfaceDescriptorData* data) {
222   Register registers[] = {cp, a1, a0};
223   data->Initialize(arraysize(registers), registers, NULL);
224 }
225 
226 
Initialize(CallInterfaceDescriptorData * data)227 void KeyedDescriptor::Initialize(CallInterfaceDescriptorData* data) {
228   Register registers[] = {
229       cp,  // context
230       a2,  // key
231   };
232   Representation representations[] = {
233       Representation::Tagged(),  // context
234       Representation::Tagged(),  // key
235   };
236   data->Initialize(arraysize(registers), registers, representations);
237 }
238 
239 
Initialize(CallInterfaceDescriptorData * data)240 void NamedDescriptor::Initialize(CallInterfaceDescriptorData* data) {
241   Register registers[] = {
242       cp,  // context
243       a2,  // name
244   };
245   Representation representations[] = {
246       Representation::Tagged(),  // context
247       Representation::Tagged(),  // name
248   };
249   data->Initialize(arraysize(registers), registers, representations);
250 }
251 
252 
Initialize(CallInterfaceDescriptorData * data)253 void CallHandlerDescriptor::Initialize(CallInterfaceDescriptorData* data) {
254   Register registers[] = {
255       cp,  // context
256       a0,  // receiver
257   };
258   Representation representations[] = {
259       Representation::Tagged(),  // context
260       Representation::Tagged(),  // receiver
261   };
262   data->Initialize(arraysize(registers), registers, representations);
263 }
264 
265 
Initialize(CallInterfaceDescriptorData * data)266 void ArgumentAdaptorDescriptor::Initialize(CallInterfaceDescriptorData* data) {
267   Register registers[] = {
268       cp,  // context
269       a1,  // JSFunction
270       a0,  // actual number of arguments
271       a2,  // expected number of arguments
272   };
273   Representation representations[] = {
274       Representation::Tagged(),     // context
275       Representation::Tagged(),     // JSFunction
276       Representation::Integer32(),  // actual number of arguments
277       Representation::Integer32(),  // expected number of arguments
278   };
279   data->Initialize(arraysize(registers), registers, representations);
280 }
281 
282 
Initialize(CallInterfaceDescriptorData * data)283 void ApiFunctionDescriptor::Initialize(CallInterfaceDescriptorData* data) {
284   Register registers[] = {
285       cp,  // context
286       a0,  // callee
287       a4,  // call_data
288       a2,  // holder
289       a1,  // api_function_address
290   };
291   Representation representations[] = {
292       Representation::Tagged(),    // context
293       Representation::Tagged(),    // callee
294       Representation::Tagged(),    // call_data
295       Representation::Tagged(),    // holder
296       Representation::External(),  // api_function_address
297   };
298   data->Initialize(arraysize(registers), registers, representations);
299 }
300 }
301 }  // namespace v8::internal
302 
303 #endif  // V8_TARGET_ARCH_MIPS64
304