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/interface-descriptors.h"
6 
7 namespace v8 {
8 namespace internal {
9 
10 
InitializePlatformSpecific(int register_parameter_count,const Register * registers,PlatformInterfaceDescriptor * platform_descriptor)11 void CallInterfaceDescriptorData::InitializePlatformSpecific(
12     int register_parameter_count, const Register* registers,
13     PlatformInterfaceDescriptor* platform_descriptor) {
14   platform_specific_descriptor_ = platform_descriptor;
15   register_param_count_ = register_parameter_count;
16 
17   // InterfaceDescriptor owns a copy of the registers array.
18   register_params_.reset(NewArray<Register>(register_parameter_count));
19   for (int i = 0; i < register_parameter_count; i++) {
20     register_params_[i] = registers[i];
21   }
22 }
23 
InitializePlatformIndependent(int parameter_count,int extra_parameter_count,const MachineType * machine_types)24 void CallInterfaceDescriptorData::InitializePlatformIndependent(
25     int parameter_count, int extra_parameter_count,
26     const MachineType* machine_types) {
27   // InterfaceDescriptor owns a copy of the MachineType array.
28   // We only care about parameters, not receiver and result.
29   param_count_ = parameter_count + extra_parameter_count;
30   machine_types_.reset(NewArray<MachineType>(param_count_));
31   for (int i = 0; i < param_count_; i++) {
32     if (machine_types == NULL || i >= parameter_count) {
33       machine_types_[i] = MachineType::AnyTagged();
34     } else {
35       machine_types_[i] = machine_types[i];
36     }
37   }
38 }
39 
DebugName(Isolate * isolate) const40 const char* CallInterfaceDescriptor::DebugName(Isolate* isolate) const {
41   CallInterfaceDescriptorData* start = isolate->call_descriptor_data(0);
42   size_t index = data_ - start;
43   DCHECK(index < CallDescriptors::NUMBER_OF_DESCRIPTORS);
44   CallDescriptors::Key key = static_cast<CallDescriptors::Key>(index);
45   switch (key) {
46 #define DEF_CASE(NAME)        \
47   case CallDescriptors::NAME: \
48     return #NAME " Descriptor";
49     INTERFACE_DESCRIPTOR_LIST(DEF_CASE)
50 #undef DEF_CASE
51     case CallDescriptors::NUMBER_OF_DESCRIPTORS:
52       break;
53   }
54   return "";
55 }
56 
57 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)58 void VoidDescriptor::InitializePlatformSpecific(
59     CallInterfaceDescriptorData* data) {
60   data->InitializePlatformSpecific(0, nullptr);
61 }
62 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)63 void FastNewFunctionContextDescriptor::InitializePlatformIndependent(
64     CallInterfaceDescriptorData* data) {
65   MachineType machine_types[] = {MachineType::AnyTagged(),
66                                  MachineType::Int32()};
67   data->InitializePlatformIndependent(arraysize(machine_types), 0,
68                                       machine_types);
69 }
70 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)71 void FastNewFunctionContextDescriptor::InitializePlatformSpecific(
72     CallInterfaceDescriptorData* data) {
73   Register registers[] = {FunctionRegister(), SlotsRegister()};
74   data->InitializePlatformSpecific(arraysize(registers), registers);
75 }
76 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)77 void LoadDescriptor::InitializePlatformIndependent(
78     CallInterfaceDescriptorData* data) {
79   // kReceiver, kName, kSlot
80   MachineType machine_types[] = {MachineType::AnyTagged(),
81                                  MachineType::AnyTagged(),
82                                  MachineType::TaggedSigned()};
83   data->InitializePlatformIndependent(arraysize(machine_types), 0,
84                                       machine_types);
85 }
86 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)87 void LoadDescriptor::InitializePlatformSpecific(
88     CallInterfaceDescriptorData* data) {
89   Register registers[] = {ReceiverRegister(), NameRegister(), SlotRegister()};
90   data->InitializePlatformSpecific(arraysize(registers), registers);
91 }
92 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)93 void LoadGlobalDescriptor::InitializePlatformIndependent(
94     CallInterfaceDescriptorData* data) {
95   // kSlot
96   MachineType machine_types[] = {MachineType::TaggedSigned()};
97   data->InitializePlatformIndependent(arraysize(machine_types), 0,
98                                       machine_types);
99 }
100 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)101 void LoadGlobalDescriptor::InitializePlatformSpecific(
102     CallInterfaceDescriptorData* data) {
103   Register registers[] = {LoadWithVectorDescriptor::SlotRegister()};
104   data->InitializePlatformSpecific(arraysize(registers), registers);
105 }
106 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)107 void LoadGlobalWithVectorDescriptor::InitializePlatformIndependent(
108     CallInterfaceDescriptorData* data) {
109   // kSlot, kVector
110   MachineType machine_types[] = {MachineType::TaggedSigned(),
111                                  MachineType::AnyTagged()};
112   data->InitializePlatformIndependent(arraysize(machine_types), 0,
113                                       machine_types);
114 }
115 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)116 void LoadGlobalWithVectorDescriptor::InitializePlatformSpecific(
117     CallInterfaceDescriptorData* data) {
118   Register registers[] = {LoadWithVectorDescriptor::SlotRegister(),
119                           LoadWithVectorDescriptor::VectorRegister()};
120   data->InitializePlatformSpecific(arraysize(registers), registers);
121 }
122 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)123 void StoreDescriptor::InitializePlatformIndependent(
124     CallInterfaceDescriptorData* data) {
125   // kReceiver, kName, kValue, kSlot
126   MachineType machine_types[] = {
127       MachineType::AnyTagged(), MachineType::AnyTagged(),
128       MachineType::AnyTagged(), MachineType::TaggedSigned()};
129   data->InitializePlatformIndependent(arraysize(machine_types), 0,
130                                       machine_types);
131 }
132 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)133 void StoreDescriptor::InitializePlatformSpecific(
134     CallInterfaceDescriptorData* data) {
135   Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(),
136                           SlotRegister()};
137 
138   int len = arraysize(registers) - kStackArgumentsCount;
139   data->InitializePlatformSpecific(len, registers);
140 }
141 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)142 void StoreTransitionDescriptor::InitializePlatformSpecific(
143     CallInterfaceDescriptorData* data) {
144   Register registers[] = {
145       ReceiverRegister(), NameRegister(), MapRegister(),
146       ValueRegister(),    SlotRegister(), VectorRegister(),
147   };
148   int len = arraysize(registers) - kStackArgumentsCount;
149   data->InitializePlatformSpecific(len, registers);
150 }
151 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)152 void StoreTransitionDescriptor::InitializePlatformIndependent(
153     CallInterfaceDescriptorData* data) {
154   // kReceiver, kName, kMap, kValue, kSlot, kVector
155   MachineType machine_types[] = {
156       MachineType::AnyTagged(),    MachineType::AnyTagged(),
157       MachineType::AnyTagged(),    MachineType::AnyTagged(),
158       MachineType::TaggedSigned(), MachineType::AnyTagged()};
159   data->InitializePlatformIndependent(arraysize(machine_types), 0,
160                                       machine_types);
161 }
162 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)163 void StoreNamedTransitionDescriptor::InitializePlatformIndependent(
164     CallInterfaceDescriptorData* data) {
165   // kReceiver, kFieldOffset, kMap, kValue, kSlot, kVector, kName
166   MachineType machine_types[] = {
167       MachineType::AnyTagged(),    MachineType::TaggedSigned(),
168       MachineType::AnyTagged(),    MachineType::AnyTagged(),
169       MachineType::TaggedSigned(), MachineType::AnyTagged(),
170       MachineType::AnyTagged()};
171   data->InitializePlatformIndependent(arraysize(machine_types), 0,
172                                       machine_types);
173 }
174 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)175 void StoreNamedTransitionDescriptor::InitializePlatformSpecific(
176     CallInterfaceDescriptorData* data) {
177   Register registers[] = {
178       ReceiverRegister(), FieldOffsetRegister(), MapRegister(),
179       ValueRegister(),    SlotRegister(),        VectorRegister(),
180       NameRegister(),
181   };
182   int len = arraysize(registers) - kStackArgumentsCount;
183   data->InitializePlatformSpecific(len, registers);
184 }
185 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)186 void StringCompareDescriptor::InitializePlatformSpecific(
187     CallInterfaceDescriptorData* data) {
188   Register registers[] = {LeftRegister(), RightRegister()};
189   data->InitializePlatformSpecific(arraysize(registers), registers);
190 }
191 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)192 void TypeConversionDescriptor::InitializePlatformSpecific(
193     CallInterfaceDescriptorData* data) {
194   Register registers[] = {ArgumentRegister()};
195   data->InitializePlatformSpecific(arraysize(registers), registers);
196 }
197 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)198 void MathPowTaggedDescriptor::InitializePlatformSpecific(
199     CallInterfaceDescriptorData* data) {
200   Register registers[] = {exponent()};
201   data->InitializePlatformSpecific(arraysize(registers), registers);
202 }
203 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)204 void MathPowIntegerDescriptor::InitializePlatformSpecific(
205     CallInterfaceDescriptorData* data) {
206   Register registers[] = {exponent()};
207   data->InitializePlatformSpecific(arraysize(registers), registers);
208 }
209 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)210 void LoadWithVectorDescriptor::InitializePlatformIndependent(
211     CallInterfaceDescriptorData* data) {
212   // kReceiver, kName, kSlot, kVector
213   MachineType machine_types[] = {
214       MachineType::AnyTagged(), MachineType::AnyTagged(),
215       MachineType::TaggedSigned(), MachineType::AnyTagged()};
216   data->InitializePlatformIndependent(arraysize(machine_types), 0,
217                                       machine_types);
218 }
219 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)220 void LoadWithVectorDescriptor::InitializePlatformSpecific(
221     CallInterfaceDescriptorData* data) {
222   Register registers[] = {ReceiverRegister(), NameRegister(), SlotRegister(),
223                           VectorRegister()};
224   data->InitializePlatformSpecific(arraysize(registers), registers);
225 }
226 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)227 void LoadICProtoArrayDescriptor::InitializePlatformIndependent(
228     CallInterfaceDescriptorData* data) {
229   // kReceiver, kName, kSlot, kVector, kHandler
230   MachineType machine_types[] = {
231       MachineType::AnyTagged(), MachineType::AnyTagged(),
232       MachineType::TaggedSigned(), MachineType::AnyTagged(),
233       MachineType::AnyTagged()};
234   data->InitializePlatformIndependent(arraysize(machine_types), 0,
235                                       machine_types);
236 }
237 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)238 void LoadICProtoArrayDescriptor::InitializePlatformSpecific(
239     CallInterfaceDescriptorData* data) {
240   Register registers[] = {ReceiverRegister(), NameRegister(), SlotRegister(),
241                           VectorRegister(), HandlerRegister()};
242   data->InitializePlatformSpecific(arraysize(registers), registers);
243 }
244 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)245 void StoreWithVectorDescriptor::InitializePlatformIndependent(
246     CallInterfaceDescriptorData* data) {
247   // kReceiver, kName, kValue, kSlot, kVector
248   MachineType machine_types[] = {
249       MachineType::AnyTagged(), MachineType::AnyTagged(),
250       MachineType::AnyTagged(), MachineType::TaggedSigned(),
251       MachineType::AnyTagged()};
252   data->InitializePlatformIndependent(arraysize(machine_types), 0,
253                                       machine_types);
254 }
255 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)256 void StoreWithVectorDescriptor::InitializePlatformSpecific(
257     CallInterfaceDescriptorData* data) {
258   Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(),
259                           SlotRegister(), VectorRegister()};
260   int len = arraysize(registers) - kStackArgumentsCount;
261   data->InitializePlatformSpecific(len, registers);
262 }
263 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)264 void BinaryOpWithVectorDescriptor::InitializePlatformIndependent(
265     CallInterfaceDescriptorData* data) {
266   // kLeft, kRight, kSlot, kVector
267   MachineType machine_types[] = {MachineType::AnyTagged(),
268                                  MachineType::AnyTagged(), MachineType::Int32(),
269                                  MachineType::AnyTagged()};
270   data->InitializePlatformIndependent(arraysize(machine_types), 0,
271                                       machine_types);
272 }
273 
ReceiverRegister()274 const Register ApiGetterDescriptor::ReceiverRegister() {
275   return LoadDescriptor::ReceiverRegister();
276 }
277 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)278 void ApiGetterDescriptor::InitializePlatformSpecific(
279     CallInterfaceDescriptorData* data) {
280   Register registers[] = {ReceiverRegister(), HolderRegister(),
281                           CallbackRegister()};
282   data->InitializePlatformSpecific(arraysize(registers), registers);
283 }
284 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)285 void ContextOnlyDescriptor::InitializePlatformSpecific(
286     CallInterfaceDescriptorData* data) {
287   data->InitializePlatformSpecific(0, nullptr);
288 }
289 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)290 void GrowArrayElementsDescriptor::InitializePlatformSpecific(
291     CallInterfaceDescriptorData* data) {
292   Register registers[] = {ObjectRegister(), KeyRegister()};
293   data->InitializePlatformSpecific(arraysize(registers), registers);
294 }
295 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)296 void VarArgFunctionDescriptor::InitializePlatformIndependent(
297     CallInterfaceDescriptorData* data) {
298   // kActualArgumentsCount
299   MachineType machine_types[] = {MachineType::Int32()};
300   data->InitializePlatformIndependent(arraysize(machine_types), 0,
301                                       machine_types);
302 }
303 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)304 void FastCloneRegExpDescriptor::InitializePlatformIndependent(
305     CallInterfaceDescriptorData* data) {
306   // kClosure, kLiteralIndex, kPattern, kFlags
307   MachineType machine_types[] = {
308       MachineType::AnyTagged(), MachineType::TaggedSigned(),
309       MachineType::AnyTagged(), MachineType::AnyTagged()};
310   data->InitializePlatformIndependent(arraysize(machine_types), 0,
311                                       machine_types);
312 }
313 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)314 void FastCloneShallowArrayDescriptor::InitializePlatformIndependent(
315     CallInterfaceDescriptorData* data) {
316   // kClosure, kLiteralIndex, kConstantElements
317   MachineType machine_types[] = {MachineType::AnyTagged(),
318                                  MachineType::TaggedSigned(),
319                                  MachineType::AnyTagged()};
320   data->InitializePlatformIndependent(arraysize(machine_types), 0,
321                                       machine_types);
322 }
323 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)324 void CreateAllocationSiteDescriptor::InitializePlatformIndependent(
325     CallInterfaceDescriptorData* data) {
326   // kVector, kSlot
327   MachineType machine_types[] = {MachineType::AnyTagged(),
328                                  MachineType::TaggedSigned()};
329   data->InitializePlatformIndependent(arraysize(machine_types), 0,
330                                       machine_types);
331 }
332 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)333 void CreateWeakCellDescriptor::InitializePlatformIndependent(
334     CallInterfaceDescriptorData* data) {
335   // kVector, kSlot, kValue
336   MachineType machine_types[] = {MachineType::AnyTagged(),
337                                  MachineType::TaggedSigned(),
338                                  MachineType::AnyTagged()};
339   data->InitializePlatformIndependent(arraysize(machine_types), 0,
340                                       machine_types);
341 }
342 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)343 void CallTrampolineDescriptor::InitializePlatformIndependent(
344     CallInterfaceDescriptorData* data) {
345   // kFunction, kActualArgumentsCount
346   MachineType machine_types[] = {MachineType::AnyTagged(),
347                                  MachineType::Int32()};
348   data->InitializePlatformIndependent(arraysize(machine_types), 0,
349                                       machine_types);
350 }
351 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)352 void ConstructStubDescriptor::InitializePlatformIndependent(
353     CallInterfaceDescriptorData* data) {
354   // kFunction, kNewTarget, kActualArgumentsCount, kAllocationSite
355   MachineType machine_types[] = {MachineType::AnyTagged(),
356                                  MachineType::AnyTagged(), MachineType::Int32(),
357                                  MachineType::AnyTagged()};
358   data->InitializePlatformIndependent(arraysize(machine_types), 0,
359                                       machine_types);
360 }
361 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)362 void ConstructTrampolineDescriptor::InitializePlatformIndependent(
363     CallInterfaceDescriptorData* data) {
364   // kFunction, kNewTarget, kActualArgumentsCount
365   MachineType machine_types[] = {
366       MachineType::AnyTagged(), MachineType::AnyTagged(), MachineType::Int32()};
367   data->InitializePlatformIndependent(arraysize(machine_types), 0,
368                                       machine_types);
369 }
370 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)371 void CallFunctionWithFeedbackDescriptor::InitializePlatformIndependent(
372     CallInterfaceDescriptorData* data) {
373   // kFunction, kSlot
374   MachineType machine_types[] = {MachineType::AnyTagged(),
375                                  MachineType::TaggedSigned()};
376   data->InitializePlatformIndependent(arraysize(machine_types), 0,
377                                       machine_types);
378 }
379 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)380 void CallFunctionWithFeedbackAndVectorDescriptor::InitializePlatformIndependent(
381     CallInterfaceDescriptorData* data) {
382   // kFunction, kActualArgumentsCount, kSlot, kVector
383   MachineType machine_types[] = {
384       MachineType::TaggedPointer(), MachineType::Int32(),
385       MachineType::TaggedSigned(), MachineType::AnyTagged()};
386   data->InitializePlatformIndependent(arraysize(machine_types), 0,
387                                       machine_types);
388 }
389 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)390 void BuiltinDescriptor::InitializePlatformIndependent(
391     CallInterfaceDescriptorData* data) {
392   MachineType machine_types[] = {MachineType::AnyTagged(),
393                                  MachineType::Int32()};
394   data->InitializePlatformIndependent(arraysize(machine_types), 0,
395                                       machine_types);
396 }
397 
InitializePlatformSpecific(CallInterfaceDescriptorData * data)398 void BuiltinDescriptor::InitializePlatformSpecific(
399     CallInterfaceDescriptorData* data) {
400   Register registers[] = {NewTargetRegister(), ArgumentsCountRegister()};
401   data->InitializePlatformSpecific(arraysize(registers), registers);
402 }
403 
ArgumentsCountRegister()404 const Register BuiltinDescriptor::ArgumentsCountRegister() {
405   return kJavaScriptCallArgCountRegister;
406 }
NewTargetRegister()407 const Register BuiltinDescriptor::NewTargetRegister() {
408   return kJavaScriptCallNewTargetRegister;
409 }
410 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)411 void ArrayNoArgumentConstructorDescriptor::InitializePlatformIndependent(
412     CallInterfaceDescriptorData* data) {
413   // kFunction, kAllocationSite, kActualArgumentsCount, kFunctionParameter
414   MachineType machine_types[] = {MachineType::TaggedPointer(),
415                                  MachineType::AnyTagged(), MachineType::Int32(),
416                                  MachineType::AnyTagged()};
417   data->InitializePlatformIndependent(arraysize(machine_types), 0,
418                                       machine_types);
419 }
420 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)421 void ArraySingleArgumentConstructorDescriptor::InitializePlatformIndependent(
422     CallInterfaceDescriptorData* data) {
423   // kFunction, kAllocationSite, kActualArgumentsCount, kFunctionParameter,
424   // kArraySizeSmiParameter
425   MachineType machine_types[] = {
426       MachineType::TaggedPointer(), MachineType::AnyTagged(),
427       MachineType::Int32(), MachineType::AnyTagged(), MachineType::AnyTagged()};
428   data->InitializePlatformIndependent(arraysize(machine_types), 0,
429                                       machine_types);
430 }
431 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)432 void ArrayNArgumentsConstructorDescriptor::InitializePlatformIndependent(
433     CallInterfaceDescriptorData* data) {
434   // kFunction, kAllocationSite, kActualArgumentsCount
435   MachineType machine_types[] = {MachineType::TaggedPointer(),
436                                  MachineType::AnyTagged(),
437                                  MachineType::Int32()};
438   data->InitializePlatformIndependent(arraysize(machine_types), 0,
439                                       machine_types);
440 }
441 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)442 void ArgumentAdaptorDescriptor::InitializePlatformIndependent(
443     CallInterfaceDescriptorData* data) {
444   // kFunction, kNewTarget, kActualArgumentsCount, kExpectedArgumentsCount
445   MachineType machine_types[] = {MachineType::TaggedPointer(),
446                                  MachineType::AnyTagged(), MachineType::Int32(),
447                                  MachineType::Int32()};
448   data->InitializePlatformIndependent(arraysize(machine_types), 0,
449                                       machine_types);
450 }
451 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)452 void ApiCallbackDescriptor::InitializePlatformIndependent(
453     CallInterfaceDescriptorData* data) {
454   // kFunction, kCallData, kHolder, kApiFunctionAddress
455   MachineType machine_types[] = {
456       MachineType::AnyTagged(), MachineType::AnyTagged(),
457       MachineType::AnyTagged(), MachineType::Pointer()};
458   data->InitializePlatformIndependent(arraysize(machine_types), 0,
459                                       machine_types);
460 }
461 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)462 void InterpreterDispatchDescriptor::InitializePlatformIndependent(
463     CallInterfaceDescriptorData* data) {
464   // kAccumulator, kBytecodeOffset, kBytecodeArray, kDispatchTable
465   MachineType machine_types[] = {
466       MachineType::AnyTagged(), MachineType::IntPtr(), MachineType::AnyTagged(),
467       MachineType::AnyTagged()};
468   data->InitializePlatformIndependent(arraysize(machine_types), 0,
469                                       machine_types);
470 }
471 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)472 void InterpreterPushArgsAndCallDescriptor::InitializePlatformIndependent(
473     CallInterfaceDescriptorData* data) {
474   // kNumberOfArguments, kFirstArgument, kFunction
475   MachineType machine_types[] = {MachineType::Int32(), MachineType::Pointer(),
476                                  MachineType::AnyTagged()};
477   data->InitializePlatformIndependent(arraysize(machine_types), 0,
478                                       machine_types);
479 }
480 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)481 void InterpreterPushArgsAndConstructDescriptor::InitializePlatformIndependent(
482     CallInterfaceDescriptorData* data) {
483   // kNumberOfArguments, kNewTarget, kConstructor, kFeedbackElement,
484   // kFirstArgument
485   MachineType machine_types[] = {
486       MachineType::Int32(), MachineType::AnyTagged(), MachineType::AnyTagged(),
487       MachineType::AnyTagged(), MachineType::Pointer()};
488   data->InitializePlatformIndependent(arraysize(machine_types), 0,
489                                       machine_types);
490 }
491 
492 void InterpreterPushArgsAndConstructArrayDescriptor::
InitializePlatformIndependent(CallInterfaceDescriptorData * data)493     InitializePlatformIndependent(CallInterfaceDescriptorData* data) {
494   // kNumberOfArguments, kFunction, kFeedbackElement, kFirstArgument
495   MachineType machine_types[] = {MachineType::Int32(), MachineType::AnyTagged(),
496                                  MachineType::AnyTagged(),
497                                  MachineType::Pointer()};
498   data->InitializePlatformIndependent(arraysize(machine_types), 0,
499                                       machine_types);
500 }
501 
InitializePlatformIndependent(CallInterfaceDescriptorData * data)502 void InterpreterCEntryDescriptor::InitializePlatformIndependent(
503     CallInterfaceDescriptorData* data) {
504   // kNumberOfArguments, kFirstArgument, kFunctionEntry
505   MachineType machine_types[] = {MachineType::Int32(), MachineType::Pointer(),
506                                  MachineType::Pointer()};
507   data->InitializePlatformIndependent(arraysize(machine_types), 0,
508                                       machine_types);
509 }
510 
511 }  // namespace internal
512 }  // namespace v8
513