• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 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 #if V8_TARGET_ARCH_PPC
6 
7 #include "src/interface-descriptors.h"
8 
9 namespace v8 {
10 namespace internal {
11 
ContextRegister()12 const Register CallInterfaceDescriptor::ContextRegister() { return cp; }
13 
14 
ReceiverRegister()15 const Register LoadDescriptor::ReceiverRegister() { return r4; }
NameRegister()16 const Register LoadDescriptor::NameRegister() { return r5; }
SlotRegister()17 const Register LoadDescriptor::SlotRegister() { return r3; }
18 
19 
VectorRegister()20 const Register LoadWithVectorDescriptor::VectorRegister() { return r6; }
21 
22 
ReceiverRegister()23 const Register StoreDescriptor::ReceiverRegister() { return r4; }
NameRegister()24 const Register StoreDescriptor::NameRegister() { return r5; }
ValueRegister()25 const Register StoreDescriptor::ValueRegister() { return r3; }
26 
27 
SlotRegister()28 const Register VectorStoreICTrampolineDescriptor::SlotRegister() { return r7; }
29 
30 
VectorRegister()31 const Register VectorStoreICDescriptor::VectorRegister() { return r6; }
32 
33 
SlotRegister()34 const Register VectorStoreTransitionDescriptor::SlotRegister() { return r7; }
VectorRegister()35 const Register VectorStoreTransitionDescriptor::VectorRegister() { return r6; }
MapRegister()36 const Register VectorStoreTransitionDescriptor::MapRegister() { return r8; }
37 
38 
MapRegister()39 const Register StoreTransitionDescriptor::MapRegister() { return r6; }
40 
41 
SlotRegister()42 const Register LoadGlobalViaContextDescriptor::SlotRegister() { return r5; }
43 
44 
SlotRegister()45 const Register StoreGlobalViaContextDescriptor::SlotRegister() { return r5; }
ValueRegister()46 const Register StoreGlobalViaContextDescriptor::ValueRegister() { return r3; }
47 
48 
LeftRegister()49 const Register InstanceOfDescriptor::LeftRegister() { return r4; }
RightRegister()50 const Register InstanceOfDescriptor::RightRegister() { return r3; }
51 
52 
LeftRegister()53 const Register StringCompareDescriptor::LeftRegister() { return r4; }
RightRegister()54 const Register StringCompareDescriptor::RightRegister() { return r3; }
55 
56 
index()57 const Register ArgumentsAccessReadDescriptor::index() { return r4; }
parameter_count()58 const Register ArgumentsAccessReadDescriptor::parameter_count() { return r3; }
59 
60 
function()61 const Register ArgumentsAccessNewDescriptor::function() { return r4; }
parameter_count()62 const Register ArgumentsAccessNewDescriptor::parameter_count() { return r5; }
parameter_pointer()63 const Register ArgumentsAccessNewDescriptor::parameter_pointer() { return r6; }
64 
65 
parameter_count()66 const Register RestParamAccessDescriptor::parameter_count() { return r5; }
parameter_pointer()67 const Register RestParamAccessDescriptor::parameter_pointer() { return r6; }
rest_parameter_index()68 const Register RestParamAccessDescriptor::rest_parameter_index() { return r7; }
69 
70 
function_address()71 const Register ApiGetterDescriptor::function_address() { return r5; }
72 
73 
exponent()74 const Register MathPowTaggedDescriptor::exponent() { return r5; }
75 
76 
exponent()77 const Register MathPowIntegerDescriptor::exponent() {
78   return MathPowTaggedDescriptor::exponent();
79 }
80 
81 
ObjectRegister()82 const Register GrowArrayElementsDescriptor::ObjectRegister() { return r3; }
KeyRegister()83 const Register GrowArrayElementsDescriptor::KeyRegister() { return r6; }
84 
85 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)86 void FastNewClosureDescriptor::InitializePlatformSpecific(
87     CallInterfaceDescriptorData* data) {
88   Register registers[] = {r5};
89   data->InitializePlatformSpecific(arraysize(registers), registers);
90 }
91 
92 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)93 void FastNewContextDescriptor::InitializePlatformSpecific(
94     CallInterfaceDescriptorData* data) {
95   Register registers[] = {r4};
96   data->InitializePlatformSpecific(arraysize(registers), registers);
97 }
98 
99 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)100 void ToNumberDescriptor::InitializePlatformSpecific(
101     CallInterfaceDescriptorData* data) {
102   Register registers[] = {r3};
103   data->InitializePlatformSpecific(arraysize(registers), registers);
104 }
105 
106 
107 // static
ReceiverRegister()108 const Register ToLengthDescriptor::ReceiverRegister() { return r3; }
109 
110 
111 // static
ReceiverRegister()112 const Register ToStringDescriptor::ReceiverRegister() { return r3; }
113 
114 
115 // static
ReceiverRegister()116 const Register ToObjectDescriptor::ReceiverRegister() { return r3; }
117 
118 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)119 void NumberToStringDescriptor::InitializePlatformSpecific(
120     CallInterfaceDescriptorData* data) {
121   Register registers[] = {r3};
122   data->InitializePlatformSpecific(arraysize(registers), registers);
123 }
124 
125 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)126 void TypeofDescriptor::InitializePlatformSpecific(
127     CallInterfaceDescriptorData* data) {
128   Register registers[] = {r6};
129   data->InitializePlatformSpecific(arraysize(registers), registers);
130 }
131 
132 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)133 void FastCloneRegExpDescriptor::InitializePlatformSpecific(
134     CallInterfaceDescriptorData* data) {
135   Register registers[] = {r6, r5, r4, r3};
136   data->InitializePlatformSpecific(arraysize(registers), registers);
137 }
138 
139 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)140 void FastCloneShallowArrayDescriptor::InitializePlatformSpecific(
141     CallInterfaceDescriptorData* data) {
142   Register registers[] = {r6, r5, r4};
143   data->InitializePlatformSpecific(arraysize(registers), registers);
144 }
145 
146 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)147 void FastCloneShallowObjectDescriptor::InitializePlatformSpecific(
148     CallInterfaceDescriptorData* data) {
149   Register registers[] = {r6, r5, r4, r3};
150   data->InitializePlatformSpecific(arraysize(registers), registers);
151 }
152 
153 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)154 void CreateAllocationSiteDescriptor::InitializePlatformSpecific(
155     CallInterfaceDescriptorData* data) {
156   Register registers[] = {r5, r6};
157   data->InitializePlatformSpecific(arraysize(registers), registers);
158 }
159 
160 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)161 void CreateWeakCellDescriptor::InitializePlatformSpecific(
162     CallInterfaceDescriptorData* data) {
163   Register registers[] = {r5, r6, r4};
164   data->InitializePlatformSpecific(arraysize(registers), registers);
165 }
166 
167 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)168 void StoreArrayLiteralElementDescriptor::InitializePlatformSpecific(
169     CallInterfaceDescriptorData* data) {
170   Register registers[] = {r6, r3};
171   data->InitializePlatformSpecific(arraysize(registers), registers);
172 }
173 
174 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)175 void CallFunctionDescriptor::InitializePlatformSpecific(
176     CallInterfaceDescriptorData* data) {
177   Register registers[] = {r4};
178   data->InitializePlatformSpecific(arraysize(registers), registers);
179 }
180 
181 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)182 void CallFunctionWithFeedbackDescriptor::InitializePlatformSpecific(
183     CallInterfaceDescriptorData* data) {
184   Register registers[] = {r4, r6};
185   data->InitializePlatformSpecific(arraysize(registers), registers);
186 }
187 
188 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)189 void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformSpecific(
190     CallInterfaceDescriptorData* data) {
191   Register registers[] = {r4, r6, r5};
192   data->InitializePlatformSpecific(arraysize(registers), registers);
193 }
194 
195 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)196 void CallConstructDescriptor::InitializePlatformSpecific(
197     CallInterfaceDescriptorData* data) {
198   // r3 : number of arguments
199   // r4 : the function to call
200   // r5 : feedback vector
201   // r6 : slot in feedback vector (Smi, for RecordCallTarget)
202   // r7 : new target (for IsSuperConstructorCall)
203   // TODO(turbofan): So far we don't gather type feedback and hence skip the
204   // slot parameter, but ArrayConstructStub needs the vector to be undefined.
205   Register registers[] = {r3, r4, r7, r5};
206   data->InitializePlatformSpecific(arraysize(registers), registers);
207 }
208 
209 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)210 void CallTrampolineDescriptor::InitializePlatformSpecific(
211     CallInterfaceDescriptorData* data) {
212   // r3 : number of arguments
213   // r4 : the target to call
214   Register registers[] = {r4, r3};
215   data->InitializePlatformSpecific(arraysize(registers), registers);
216 }
217 
218 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)219 void ConstructStubDescriptor::InitializePlatformSpecific(
220     CallInterfaceDescriptorData* data) {
221   // r3 : number of arguments
222   // r4 : the target to call
223   // r6 : the new target
224   // r5 : allocation site or undefined
225   Register registers[] = {r4, r6, r3, r5};
226   data->InitializePlatformSpecific(arraysize(registers), registers);
227 }
228 
229 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)230 void ConstructTrampolineDescriptor::InitializePlatformSpecific(
231     CallInterfaceDescriptorData* data) {
232   // r3 : number of arguments
233   // r4 : the target to call
234   // r6 : the new target
235   Register registers[] = {r4, r6, r3};
236   data->InitializePlatformSpecific(arraysize(registers), registers);
237 }
238 
239 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)240 void RegExpConstructResultDescriptor::InitializePlatformSpecific(
241     CallInterfaceDescriptorData* data) {
242   Register registers[] = {r5, r4, r3};
243   data->InitializePlatformSpecific(arraysize(registers), registers);
244 }
245 
246 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)247 void TransitionElementsKindDescriptor::InitializePlatformSpecific(
248     CallInterfaceDescriptorData* data) {
249   Register registers[] = {r3, r4};
250   data->InitializePlatformSpecific(arraysize(registers), registers);
251 }
252 
253 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)254 void AllocateHeapNumberDescriptor::InitializePlatformSpecific(
255     CallInterfaceDescriptorData* data) {
256   data->InitializePlatformSpecific(0, nullptr, nullptr);
257 }
258 
259 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)260 void AllocateInNewSpaceDescriptor::InitializePlatformSpecific(
261     CallInterfaceDescriptorData* data) {
262   Register registers[] = {r3};
263   data->InitializePlatformSpecific(arraysize(registers), registers);
264 }
265 
266 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)267 void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific(
268     CallInterfaceDescriptorData* data) {
269   // register state
270   // r3 -- number of arguments
271   // r4 -- function
272   // r5 -- allocation site with elements kind
273   Register registers[] = {r4, r5};
274   data->InitializePlatformSpecific(arraysize(registers), registers);
275 }
276 
277 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)278 void ArrayConstructorDescriptor::InitializePlatformSpecific(
279     CallInterfaceDescriptorData* data) {
280   // stack param count needs (constructor pointer, and single argument)
281   Register registers[] = {r4, r5, r3};
282   data->InitializePlatformSpecific(arraysize(registers), registers);
283 }
284 
285 
286 void InternalArrayConstructorConstantArgCountDescriptor::
InitializePlatformSpecific(CallInterfaceDescriptorData * data)287     InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
288   // register state
289   // r3 -- number of arguments
290   // r4 -- constructor function
291   Register registers[] = {r4};
292   data->InitializePlatformSpecific(arraysize(registers), registers);
293 }
294 
295 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)296 void InternalArrayConstructorDescriptor::InitializePlatformSpecific(
297     CallInterfaceDescriptorData* data) {
298   // stack param count needs (constructor pointer, and single argument)
299   Register registers[] = {r4, r3};
300   data->InitializePlatformSpecific(arraysize(registers), registers);
301 }
302 
303 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)304 void CompareDescriptor::InitializePlatformSpecific(
305     CallInterfaceDescriptorData* data) {
306   Register registers[] = {r4, r3};
307   data->InitializePlatformSpecific(arraysize(registers), registers);
308 }
309 
310 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)311 void CompareNilDescriptor::InitializePlatformSpecific(
312     CallInterfaceDescriptorData* data) {
313   Register registers[] = {r3};
314   data->InitializePlatformSpecific(arraysize(registers), registers);
315 }
316 
317 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)318 void ToBooleanDescriptor::InitializePlatformSpecific(
319     CallInterfaceDescriptorData* data) {
320   Register registers[] = {r3};
321   data->InitializePlatformSpecific(arraysize(registers), registers);
322 }
323 
324 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)325 void BinaryOpDescriptor::InitializePlatformSpecific(
326     CallInterfaceDescriptorData* data) {
327   Register registers[] = {r4, r3};
328   data->InitializePlatformSpecific(arraysize(registers), registers);
329 }
330 
331 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)332 void BinaryOpWithAllocationSiteDescriptor::InitializePlatformSpecific(
333     CallInterfaceDescriptorData* data) {
334   Register registers[] = {r5, r4, r3};
335   data->InitializePlatformSpecific(arraysize(registers), registers);
336 }
337 
338 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)339 void StringAddDescriptor::InitializePlatformSpecific(
340     CallInterfaceDescriptorData* data) {
341   Register registers[] = {r4, r3};
342   data->InitializePlatformSpecific(arraysize(registers), registers);
343 }
344 
345 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)346 void KeyedDescriptor::InitializePlatformSpecific(
347     CallInterfaceDescriptorData* data) {
348   Register registers[] = {
349       r5,  // key
350   };
351   data->InitializePlatformSpecific(arraysize(registers), registers);
352 }
353 
354 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)355 void NamedDescriptor::InitializePlatformSpecific(
356     CallInterfaceDescriptorData* data) {
357   Register registers[] = {
358       r5,  // name
359   };
360   data->InitializePlatformSpecific(arraysize(registers), registers);
361 }
362 
363 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)364 void CallHandlerDescriptor::InitializePlatformSpecific(
365     CallInterfaceDescriptorData* data) {
366   Register registers[] = {
367       r3,  // receiver
368   };
369   data->InitializePlatformSpecific(arraysize(registers), registers);
370 }
371 
372 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)373 void ArgumentAdaptorDescriptor::InitializePlatformSpecific(
374     CallInterfaceDescriptorData* data) {
375   Register registers[] = {
376       r4,  // JSFunction
377       r6,  // the new target
378       r3,  // actual number of arguments
379       r5,  // expected number of arguments
380   };
381   data->InitializePlatformSpecific(arraysize(registers), registers);
382 }
383 
384 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)385 void ApiFunctionDescriptor::InitializePlatformSpecific(
386     CallInterfaceDescriptorData* data) {
387   Register registers[] = {
388       r3,  // callee
389       r7,  // call_data
390       r5,  // holder
391       r4,  // api_function_address
392       r6,  // actual number of arguments
393   };
394   data->InitializePlatformSpecific(arraysize(registers), registers);
395 }
396 
397 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)398 void ApiAccessorDescriptor::InitializePlatformSpecific(
399     CallInterfaceDescriptorData* data) {
400   Register registers[] = {
401       r3,  // callee
402       r7,  // call_data
403       r5,  // holder
404       r4,  // api_function_address
405   };
406   data->InitializePlatformSpecific(arraysize(registers), registers);
407 }
408 
409 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)410 void InterpreterPushArgsAndCallDescriptor::InitializePlatformSpecific(
411     CallInterfaceDescriptorData* data) {
412   Register registers[] = {
413       r3,  // argument count (not including receiver)
414       r5,  // address of first argument
415       r4   // the target callable to be call
416   };
417   data->InitializePlatformSpecific(arraysize(registers), registers);
418 }
419 
420 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)421 void InterpreterPushArgsAndConstructDescriptor::InitializePlatformSpecific(
422     CallInterfaceDescriptorData* data) {
423   Register registers[] = {
424       r3,  // argument count (not including receiver)
425       r6,  // new target
426       r4,  // constructor to call
427       r5   // address of the first argument
428   };
429   data->InitializePlatformSpecific(arraysize(registers), registers);
430 }
431 
432 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)433 void InterpreterCEntryDescriptor::InitializePlatformSpecific(
434     CallInterfaceDescriptorData* data) {
435   Register registers[] = {
436       r3,  // argument count (argc)
437       r5,  // address of first argument (argv)
438       r4   // the runtime function to call
439   };
440   data->InitializePlatformSpecific(arraysize(registers), registers);
441 }
442 }  // namespace internal
443 }  // namespace v8
444 
445 #endif  // V8_TARGET_ARCH_PPC
446