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