534313f7d301cf5b4175d69250275776d917f2aa
[platform/upstream/v8.git] / src / interface-descriptors.h
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 #ifndef V8_CALL_INTERFACE_DESCRIPTOR_H_
6 #define V8_CALL_INTERFACE_DESCRIPTOR_H_
7
8 #include "src/assembler.h"
9 #include "src/macro-assembler.h"
10
11 namespace v8 {
12 namespace internal {
13
14 class PlatformInterfaceDescriptor;
15
16 #define INTERFACE_DESCRIPTOR_LIST(V)          \
17   V(Load)                                     \
18   V(Store)                                    \
19   V(StoreTransition)                          \
20   V(VectorStoreTransition)                    \
21   V(VectorStoreICTrampoline)                  \
22   V(VectorStoreIC)                            \
23   V(InstanceOf)                               \
24   V(LoadWithVector)                           \
25   V(FastNewClosure)                           \
26   V(FastNewContext)                           \
27   V(ToNumber)                                 \
28   V(ToString)                                 \
29   V(ToObject)                                 \
30   V(NumberToString)                           \
31   V(Typeof)                                   \
32   V(FastCloneShallowArray)                    \
33   V(FastCloneShallowObject)                   \
34   V(CreateAllocationSite)                     \
35   V(CreateWeakCell)                           \
36   V(CallFunction)                             \
37   V(CallFunctionWithFeedback)                 \
38   V(CallFunctionWithFeedbackAndVector)        \
39   V(CallConstruct)                            \
40   V(CallTrampoline)                           \
41   V(PushArgsAndCall)                          \
42   V(RegExpConstructResult)                    \
43   V(TransitionElementsKind)                   \
44   V(AllocateHeapNumber)                       \
45   V(ArrayConstructorConstantArgCount)         \
46   V(ArrayConstructor)                         \
47   V(InternalArrayConstructorConstantArgCount) \
48   V(InternalArrayConstructor)                 \
49   V(Compare)                                  \
50   V(CompareNil)                               \
51   V(ToBoolean)                                \
52   V(BinaryOp)                                 \
53   V(BinaryOpWithAllocationSite)               \
54   V(StringAdd)                                \
55   V(StringCompare)                            \
56   V(Keyed)                                    \
57   V(Named)                                    \
58   V(CallHandler)                              \
59   V(ArgumentAdaptor)                          \
60   V(ApiFunction)                              \
61   V(ApiAccessor)                              \
62   V(ApiGetter)                                \
63   V(ArgumentsAccessRead)                      \
64   V(ArgumentsAccessNew)                       \
65   V(StoreArrayLiteralElement)                 \
66   V(LoadGlobalViaContext)                     \
67   V(StoreGlobalViaContext)                    \
68   V(MathPowTagged)                            \
69   V(MathPowInteger)                           \
70   V(ContextOnly)                              \
71   V(GrowArrayElements)                        \
72   V(MathRoundVariantCallFromUnoptimizedCode)  \
73   V(MathRoundVariantCallFromOptimizedCode)
74
75
76 class CallInterfaceDescriptorData {
77  public:
78   CallInterfaceDescriptorData()
79       : register_param_count_(-1), function_type_(nullptr) {}
80
81   // A copy of the passed in registers and param_representations is made
82   // and owned by the CallInterfaceDescriptorData.
83
84   void InitializePlatformIndependent(Type::FunctionType* function_type) {
85     function_type_ = function_type;
86   }
87
88   // TODO(mvstanton): Instead of taking parallel arrays register and
89   // param_representations, how about a struct that puts the representation
90   // and register side by side (eg, RegRep(r1, Representation::Tagged()).
91   // The same should go for the CodeStubDescriptor class.
92   void InitializePlatformSpecific(
93       int register_parameter_count, Register* registers,
94       PlatformInterfaceDescriptor* platform_descriptor = NULL);
95
96   bool IsInitialized() const { return register_param_count_ >= 0; }
97
98   int param_count() const { return function_type_->Arity(); }
99   int register_param_count() const { return register_param_count_; }
100   Register register_param(int index) const { return register_params_[index]; }
101   Register* register_params() const { return register_params_.get(); }
102   Type* param_type(int index) const { return function_type_->Parameter(index); }
103   PlatformInterfaceDescriptor* platform_specific_descriptor() const {
104     return platform_specific_descriptor_;
105   }
106
107   Type::FunctionType* function_type() const { return function_type_; }
108
109  private:
110   int register_param_count_;
111
112   // The Register params are allocated dynamically by the
113   // InterfaceDescriptor, and freed on destruction. This is because static
114   // arrays of Registers cause creation of runtime static initializers
115   // which we don't want.
116   base::SmartArrayPointer<Register> register_params_;
117
118   // Specifies types for parameters and return
119   Type::FunctionType* function_type_;
120
121   PlatformInterfaceDescriptor* platform_specific_descriptor_;
122
123   DISALLOW_COPY_AND_ASSIGN(CallInterfaceDescriptorData);
124 };
125
126
127 class CallDescriptors {
128  public:
129   enum Key {
130 #define DEF_ENUM(name) name,
131     INTERFACE_DESCRIPTOR_LIST(DEF_ENUM)
132 #undef DEF_ENUM
133     NUMBER_OF_DESCRIPTORS
134   };
135 };
136
137
138 class CallInterfaceDescriptor {
139  public:
140   CallInterfaceDescriptor() : data_(NULL) {}
141   virtual ~CallInterfaceDescriptor() {}
142
143   CallInterfaceDescriptor(Isolate* isolate, CallDescriptors::Key key)
144       : data_(isolate->call_descriptor_data(key)) {}
145
146   int GetParameterCount() const { return data()->param_count(); }
147
148   int GetRegisterParameterCount() const {
149     return data()->register_param_count();
150   }
151
152   int GetStackParameterCount() const {
153     return data()->function_type()->Arity() - data()->register_param_count();
154   }
155
156   Register GetRegisterParameter(int index) const {
157     return data()->register_param(index);
158   }
159
160   Type* GetParameterType(int index) const {
161     DCHECK(index < data()->param_count());
162     return data()->param_type(index);
163   }
164
165   // Some platforms have extra information to associate with the descriptor.
166   PlatformInterfaceDescriptor* platform_specific_descriptor() const {
167     return data()->platform_specific_descriptor();
168   }
169
170   Type::FunctionType* GetFunctionType() const {
171     return data()->function_type();
172   }
173
174   static const Register ContextRegister();
175
176   const char* DebugName(Isolate* isolate) const;
177
178   static Type::FunctionType* BuildDefaultFunctionType(Isolate* isolate,
179                                                       int paramater_count);
180
181  protected:
182   const CallInterfaceDescriptorData* data() const { return data_; }
183
184   virtual Type::FunctionType* BuildCallInterfaceDescriptorFunctionType(
185       Isolate* isolate, int register_param_count) {
186     return BuildDefaultFunctionType(isolate, register_param_count);
187   }
188
189   virtual void InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
190     UNREACHABLE();
191   }
192
193   void Initialize(Isolate* isolate, CallDescriptors::Key key) {
194     if (!data()->IsInitialized()) {
195       CallInterfaceDescriptorData* d = isolate->call_descriptor_data(key);
196       InitializePlatformSpecific(d);
197       Type::FunctionType* function_type =
198           BuildCallInterfaceDescriptorFunctionType(isolate,
199                                                    d->register_param_count());
200       d->InitializePlatformIndependent(function_type);
201     }
202   }
203
204  private:
205   const CallInterfaceDescriptorData* data_;
206 };
207
208
209 #define DECLARE_DESCRIPTOR(name, base)                                         \
210   explicit name(Isolate* isolate) : base(isolate, key()) {                     \
211     Initialize(isolate, key());                                                \
212   }                                                                            \
213                                                                                \
214  protected:                                                                    \
215   void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; \
216   name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {}     \
217                                                                                \
218  public:                                                                       \
219   static inline CallDescriptors::Key key();
220
221
222 #define DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(name, base)        \
223   DECLARE_DESCRIPTOR(name, base)                                        \
224  protected:                                                             \
225   virtual Type::FunctionType* BuildCallInterfaceDescriptorFunctionType( \
226       Isolate* isolate, int register_param_count) override;             \
227                                                                         \
228  public:
229 // LoadDescriptor is used by all stubs that implement Load/KeyedLoad ICs.
230 class LoadDescriptor : public CallInterfaceDescriptor {
231  public:
232   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadDescriptor,
233                                                CallInterfaceDescriptor)
234
235   enum ParameterIndices { kReceiverIndex, kNameIndex, kSlotIndex };
236   static const Register ReceiverRegister();
237   static const Register NameRegister();
238   static const Register SlotRegister();
239 };
240
241
242 class StoreDescriptor : public CallInterfaceDescriptor {
243  public:
244   DECLARE_DESCRIPTOR(StoreDescriptor, CallInterfaceDescriptor)
245
246   enum ParameterIndices {
247     kReceiverIndex,
248     kNameIndex,
249     kValueIndex,
250     kParameterCount
251   };
252   static const Register ReceiverRegister();
253   static const Register NameRegister();
254   static const Register ValueRegister();
255 };
256
257
258 class StoreTransitionDescriptor : public StoreDescriptor {
259  public:
260   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreTransitionDescriptor,
261                                                StoreDescriptor)
262
263   // Extends StoreDescriptor with Map parameter.
264   enum ParameterIndices {
265     kReceiverIndex,
266     kNameIndex,
267     kValueIndex,
268     kMapIndex,
269     kParameterCount
270   };
271
272   static const Register MapRegister();
273 };
274
275
276 class VectorStoreTransitionDescriptor : public StoreDescriptor {
277  public:
278   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(VectorStoreTransitionDescriptor,
279                                                StoreDescriptor)
280
281   // Extends StoreDescriptor with Map parameter.
282   enum ParameterIndices {
283     kReceiverIndex,
284     kNameIndex,
285     kValueIndex,
286     kSlotIndex,
287     kVectorIndex,
288     kMapIndex,
289     kParameterCount
290   };
291
292   // These registers are no_reg for ia32, using the stack instead.
293   static const Register SlotRegister();
294   static const Register VectorRegister();
295   static const Register MapRegister();
296 };
297
298
299 class InstanceOfDescriptor final : public CallInterfaceDescriptor {
300  public:
301   DECLARE_DESCRIPTOR(InstanceOfDescriptor, CallInterfaceDescriptor)
302
303   enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount };
304   static const Register LeftRegister();
305   static const Register RightRegister();
306 };
307
308
309 class VectorStoreICTrampolineDescriptor : public StoreDescriptor {
310  public:
311   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
312       VectorStoreICTrampolineDescriptor, StoreDescriptor)
313
314   enum ParameterIndices { kReceiverIndex, kNameIndex, kValueIndex, kSlotIndex };
315
316   static const Register SlotRegister();
317 };
318
319
320 class VectorStoreICDescriptor : public VectorStoreICTrampolineDescriptor {
321  public:
322   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
323       VectorStoreICDescriptor, VectorStoreICTrampolineDescriptor)
324
325   enum ParameterIndices {
326     kReceiverIndex,
327     kNameIndex,
328     kValueIndex,
329     kSlotIndex,
330     kVectorIndex
331   };
332
333   static const Register VectorRegister();
334 };
335
336
337 class LoadWithVectorDescriptor : public LoadDescriptor {
338  public:
339   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadWithVectorDescriptor,
340                                                LoadDescriptor)
341
342   enum ParameterIndices {
343     kReceiverIndex,
344     kNameIndex,
345     kSlotIndex,
346     kVectorIndex
347   };
348
349   static const Register VectorRegister();
350 };
351
352
353 class FastNewClosureDescriptor : public CallInterfaceDescriptor {
354  public:
355   DECLARE_DESCRIPTOR(FastNewClosureDescriptor, CallInterfaceDescriptor)
356 };
357
358
359 class FastNewContextDescriptor : public CallInterfaceDescriptor {
360  public:
361   DECLARE_DESCRIPTOR(FastNewContextDescriptor, CallInterfaceDescriptor)
362 };
363
364
365 class ToNumberDescriptor : public CallInterfaceDescriptor {
366  public:
367   DECLARE_DESCRIPTOR(ToNumberDescriptor, CallInterfaceDescriptor)
368 };
369
370
371 class ToStringDescriptor : public CallInterfaceDescriptor {
372  public:
373   enum ParameterIndices { kReceiverIndex };
374
375   DECLARE_DESCRIPTOR(ToStringDescriptor, CallInterfaceDescriptor)
376
377   static const Register ReceiverRegister();
378 };
379
380
381 class ToObjectDescriptor : public CallInterfaceDescriptor {
382  public:
383   enum ParameterIndices { kReceiverIndex };
384
385   DECLARE_DESCRIPTOR(ToObjectDescriptor, CallInterfaceDescriptor)
386
387   static const Register ReceiverRegister();
388 };
389
390
391 class NumberToStringDescriptor : public CallInterfaceDescriptor {
392  public:
393   DECLARE_DESCRIPTOR(NumberToStringDescriptor, CallInterfaceDescriptor)
394 };
395
396
397 class TypeofDescriptor : public CallInterfaceDescriptor {
398  public:
399   DECLARE_DESCRIPTOR(TypeofDescriptor, CallInterfaceDescriptor)
400 };
401
402
403 class FastCloneShallowArrayDescriptor : public CallInterfaceDescriptor {
404  public:
405   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneShallowArrayDescriptor,
406                                                CallInterfaceDescriptor)
407 };
408
409
410 class FastCloneShallowObjectDescriptor : public CallInterfaceDescriptor {
411  public:
412   DECLARE_DESCRIPTOR(FastCloneShallowObjectDescriptor, CallInterfaceDescriptor)
413 };
414
415
416 class CreateAllocationSiteDescriptor : public CallInterfaceDescriptor {
417  public:
418   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateAllocationSiteDescriptor,
419                                                CallInterfaceDescriptor)
420 };
421
422
423 class CreateWeakCellDescriptor : public CallInterfaceDescriptor {
424  public:
425   enum ParameterIndices {
426     kVectorIndex,
427     kSlotIndex,
428     kValueIndex,
429     kParameterCount
430   };
431
432   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateWeakCellDescriptor,
433                                                CallInterfaceDescriptor)
434 };
435
436
437 class CallTrampolineDescriptor : public CallInterfaceDescriptor {
438  public:
439   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CallTrampolineDescriptor,
440                                                CallInterfaceDescriptor)
441 };
442
443
444 class CallFunctionDescriptor : public CallInterfaceDescriptor {
445  public:
446   DECLARE_DESCRIPTOR(CallFunctionDescriptor, CallInterfaceDescriptor)
447 };
448
449
450 class CallFunctionWithFeedbackDescriptor : public CallInterfaceDescriptor {
451  public:
452   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
453       CallFunctionWithFeedbackDescriptor, CallInterfaceDescriptor)
454 };
455
456
457 class CallFunctionWithFeedbackAndVectorDescriptor
458     : public CallInterfaceDescriptor {
459  public:
460   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
461       CallFunctionWithFeedbackAndVectorDescriptor, CallInterfaceDescriptor)
462 };
463
464
465 class CallConstructDescriptor : public CallInterfaceDescriptor {
466  public:
467   DECLARE_DESCRIPTOR(CallConstructDescriptor, CallInterfaceDescriptor)
468 };
469
470
471 class RegExpConstructResultDescriptor : public CallInterfaceDescriptor {
472  public:
473   DECLARE_DESCRIPTOR(RegExpConstructResultDescriptor, CallInterfaceDescriptor)
474 };
475
476
477 class LoadGlobalViaContextDescriptor : public CallInterfaceDescriptor {
478  public:
479   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadGlobalViaContextDescriptor,
480                                                CallInterfaceDescriptor)
481
482   static const Register SlotRegister();
483 };
484
485
486 class StoreGlobalViaContextDescriptor : public CallInterfaceDescriptor {
487  public:
488   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreGlobalViaContextDescriptor,
489                                                CallInterfaceDescriptor)
490
491   static const Register SlotRegister();
492   static const Register ValueRegister();
493 };
494
495
496 class TransitionElementsKindDescriptor : public CallInterfaceDescriptor {
497  public:
498   DECLARE_DESCRIPTOR(TransitionElementsKindDescriptor, CallInterfaceDescriptor)
499 };
500
501
502 class AllocateHeapNumberDescriptor : public CallInterfaceDescriptor {
503  public:
504   DECLARE_DESCRIPTOR(AllocateHeapNumberDescriptor, CallInterfaceDescriptor)
505 };
506
507
508 class ArrayConstructorConstantArgCountDescriptor
509     : public CallInterfaceDescriptor {
510  public:
511   DECLARE_DESCRIPTOR(ArrayConstructorConstantArgCountDescriptor,
512                      CallInterfaceDescriptor)
513 };
514
515
516 class ArrayConstructorDescriptor : public CallInterfaceDescriptor {
517  public:
518   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor,
519                                                CallInterfaceDescriptor)
520 };
521
522
523 class InternalArrayConstructorConstantArgCountDescriptor
524     : public CallInterfaceDescriptor {
525  public:
526   DECLARE_DESCRIPTOR(InternalArrayConstructorConstantArgCountDescriptor,
527                      CallInterfaceDescriptor)
528 };
529
530
531 class InternalArrayConstructorDescriptor : public CallInterfaceDescriptor {
532  public:
533   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
534       InternalArrayConstructorDescriptor, CallInterfaceDescriptor)
535 };
536
537
538 class CompareDescriptor : public CallInterfaceDescriptor {
539  public:
540   DECLARE_DESCRIPTOR(CompareDescriptor, CallInterfaceDescriptor)
541 };
542
543
544 class CompareNilDescriptor : public CallInterfaceDescriptor {
545  public:
546   DECLARE_DESCRIPTOR(CompareNilDescriptor, CallInterfaceDescriptor)
547 };
548
549
550 class ToBooleanDescriptor : public CallInterfaceDescriptor {
551  public:
552   DECLARE_DESCRIPTOR(ToBooleanDescriptor, CallInterfaceDescriptor)
553 };
554
555
556 class BinaryOpDescriptor : public CallInterfaceDescriptor {
557  public:
558   DECLARE_DESCRIPTOR(BinaryOpDescriptor, CallInterfaceDescriptor)
559 };
560
561
562 class BinaryOpWithAllocationSiteDescriptor : public CallInterfaceDescriptor {
563  public:
564   DECLARE_DESCRIPTOR(BinaryOpWithAllocationSiteDescriptor,
565                      CallInterfaceDescriptor)
566 };
567
568
569 class StringAddDescriptor : public CallInterfaceDescriptor {
570  public:
571   DECLARE_DESCRIPTOR(StringAddDescriptor, CallInterfaceDescriptor)
572 };
573
574
575 class StringCompareDescriptor : public CallInterfaceDescriptor {
576  public:
577   DECLARE_DESCRIPTOR(StringCompareDescriptor, CallInterfaceDescriptor)
578
579   enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount };
580   static const Register LeftRegister();
581   static const Register RightRegister();
582 };
583
584
585 class KeyedDescriptor : public CallInterfaceDescriptor {
586  public:
587   DECLARE_DESCRIPTOR(KeyedDescriptor, CallInterfaceDescriptor)
588 };
589
590
591 class NamedDescriptor : public CallInterfaceDescriptor {
592  public:
593   DECLARE_DESCRIPTOR(NamedDescriptor, CallInterfaceDescriptor)
594 };
595
596
597 class CallHandlerDescriptor : public CallInterfaceDescriptor {
598  public:
599   DECLARE_DESCRIPTOR(CallHandlerDescriptor, CallInterfaceDescriptor)
600 };
601
602
603 class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor {
604  public:
605   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArgumentAdaptorDescriptor,
606                                                CallInterfaceDescriptor)
607 };
608
609
610 class ApiFunctionDescriptor : public CallInterfaceDescriptor {
611  public:
612   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiFunctionDescriptor,
613                                                CallInterfaceDescriptor)
614 };
615
616
617 class ApiAccessorDescriptor : public CallInterfaceDescriptor {
618  public:
619   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiAccessorDescriptor,
620                                                CallInterfaceDescriptor)
621 };
622
623
624 class ApiGetterDescriptor : public CallInterfaceDescriptor {
625  public:
626   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiGetterDescriptor,
627                                                CallInterfaceDescriptor)
628
629   static const Register function_address();
630 };
631
632
633 class ArgumentsAccessReadDescriptor : public CallInterfaceDescriptor {
634  public:
635   DECLARE_DESCRIPTOR(ArgumentsAccessReadDescriptor, CallInterfaceDescriptor)
636
637   static const Register index();
638   static const Register parameter_count();
639 };
640
641
642 class ArgumentsAccessNewDescriptor : public CallInterfaceDescriptor {
643  public:
644   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArgumentsAccessNewDescriptor,
645                                                CallInterfaceDescriptor)
646
647   static const Register function();
648   static const Register parameter_count();
649   static const Register parameter_pointer();
650 };
651
652
653 class StoreArrayLiteralElementDescriptor : public CallInterfaceDescriptor {
654  public:
655   DECLARE_DESCRIPTOR(StoreArrayLiteralElementDescriptor,
656                      CallInterfaceDescriptor)
657 };
658
659
660 class MathPowTaggedDescriptor : public CallInterfaceDescriptor {
661  public:
662   DECLARE_DESCRIPTOR(MathPowTaggedDescriptor, CallInterfaceDescriptor)
663
664   static const Register exponent();
665 };
666
667
668 class MathPowIntegerDescriptor : public CallInterfaceDescriptor {
669  public:
670   DECLARE_DESCRIPTOR(MathPowIntegerDescriptor, CallInterfaceDescriptor)
671
672   static const Register exponent();
673 };
674
675
676 class MathRoundVariantCallFromOptimizedCodeDescriptor
677     : public CallInterfaceDescriptor {
678  public:
679   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
680       MathRoundVariantCallFromOptimizedCodeDescriptor, CallInterfaceDescriptor)
681 };
682
683
684 class MathRoundVariantCallFromUnoptimizedCodeDescriptor
685     : public CallInterfaceDescriptor {
686  public:
687   DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
688       MathRoundVariantCallFromUnoptimizedCodeDescriptor,
689       CallInterfaceDescriptor)
690 };
691
692
693 class ContextOnlyDescriptor : public CallInterfaceDescriptor {
694  public:
695   DECLARE_DESCRIPTOR(ContextOnlyDescriptor, CallInterfaceDescriptor)
696 };
697
698
699 class GrowArrayElementsDescriptor : public CallInterfaceDescriptor {
700  public:
701   DECLARE_DESCRIPTOR(GrowArrayElementsDescriptor, CallInterfaceDescriptor)
702
703   enum RegisterInfo { kObjectIndex, kKeyIndex };
704   static const Register ObjectRegister();
705   static const Register KeyRegister();
706 };
707
708
709 class PushArgsAndCallDescriptor : public CallInterfaceDescriptor {
710  public:
711   DECLARE_DESCRIPTOR(PushArgsAndCallDescriptor, CallInterfaceDescriptor)
712 };
713
714 #undef DECLARE_DESCRIPTOR
715
716
717 // We define the association between CallDescriptors::Key and the specialized
718 // descriptor here to reduce boilerplate and mistakes.
719 #define DEF_KEY(name) \
720   CallDescriptors::Key name##Descriptor::key() { return CallDescriptors::name; }
721 INTERFACE_DESCRIPTOR_LIST(DEF_KEY)
722 #undef DEF_KEY
723 }
724 }  // namespace v8::internal
725
726
727 #if V8_TARGET_ARCH_ARM64
728 #include "src/arm64/interface-descriptors-arm64.h"
729 #elif V8_TARGET_ARCH_ARM
730 #include "src/arm/interface-descriptors-arm.h"
731 #endif
732
733 #endif  // V8_CALL_INTERFACE_DESCRIPTOR_H_