interface-descriptors.h 23.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_CALL_INTERFACE_DESCRIPTOR_H_
#define V8_CALL_INTERFACE_DESCRIPTOR_H_

#include "src/assembler.h"
#include "src/macro-assembler.h"

namespace v8 {
namespace internal {

class PlatformInterfaceDescriptor;

16 17 18
#define INTERFACE_DESCRIPTOR_LIST(V)          \
  V(Load)                                     \
  V(Store)                                    \
19
  V(StoreTransition)                          \
20
  V(VectorStoreTransition)                    \
21 22
  V(VectorStoreICTrampoline)                  \
  V(VectorStoreIC)                            \
23
  V(InstanceOf)                               \
24
  V(LoadWithVector)                           \
25 26 27
  V(FastNewClosure)                           \
  V(FastNewContext)                           \
  V(ToNumber)                                 \
28
  V(ToLength)                                 \
29
  V(ToString)                                 \
30
  V(ToObject)                                 \
31
  V(NumberToString)                           \
32
  V(Typeof)                                   \
33
  V(FastCloneRegExp)                          \
34 35 36
  V(FastCloneShallowArray)                    \
  V(FastCloneShallowObject)                   \
  V(CreateAllocationSite)                     \
37
  V(CreateWeakCell)                           \
38
  V(CallFunction)                             \
39
  V(CallFunctionWithFeedback)                 \
40
  V(CallFunctionWithFeedbackAndVector)        \
41
  V(CallConstruct)                            \
42
  V(CallTrampoline)                           \
43
  V(ConstructTrampoline)                      \
44 45
  V(RegExpConstructResult)                    \
  V(TransitionElementsKind)                   \
46
  V(AllocateHeapNumber)                       \
47
  V(AllocateMutableHeapNumber)                \
48
  V(AllocateInNewSpace)                       \
49 50 51 52
  V(ArrayConstructorConstantArgCount)         \
  V(ArrayConstructor)                         \
  V(InternalArrayConstructorConstantArgCount) \
  V(InternalArrayConstructor)                 \
53
  V(Compare)                                  \
54 55 56 57 58
  V(CompareNil)                               \
  V(ToBoolean)                                \
  V(BinaryOp)                                 \
  V(BinaryOpWithAllocationSite)               \
  V(StringAdd)                                \
59
  V(StringCompare)                            \
60 61 62 63
  V(Keyed)                                    \
  V(Named)                                    \
  V(CallHandler)                              \
  V(ArgumentAdaptor)                          \
64
  V(ApiFunction)                              \
65 66
  V(ApiAccessor)                              \
  V(ApiGetter)                                \
67
  V(ArgumentsAccessRead)                      \
68
  V(ArgumentsAccessNew)                       \
69
  V(StoreArrayLiteralElement)                 \
70 71
  V(LoadGlobalViaContext)                     \
  V(StoreGlobalViaContext)                    \
72 73
  V(MathPowTagged)                            \
  V(MathPowInteger)                           \
74
  V(ContextOnly)                              \
75
  V(GrowArrayElements)                        \
76
  V(MathRoundVariantCallFromUnoptimizedCode)  \
77 78
  V(MathRoundVariantCallFromOptimizedCode)    \
  V(InterpreterPushArgsAndCall)               \
79
  V(InterpreterPushArgsAndConstruct)          \
80
  V(InterpreterCEntry)
81 82 83


class CallInterfaceDescriptorData {
84
 public:
85
  CallInterfaceDescriptorData()
86
      : register_param_count_(-1), function_type_(nullptr) {}
87 88

  // A copy of the passed in registers and param_representations is made
89
  // and owned by the CallInterfaceDescriptorData.
90

91
  void InitializePlatformIndependent(Type::FunctionType* function_type) {
92 93 94
    function_type_ = function_type;
  }

95 96 97
  // TODO(mvstanton): Instead of taking parallel arrays register and
  // param_representations, how about a struct that puts the representation
  // and register side by side (eg, RegRep(r1, Representation::Tagged()).
98
  // The same should go for the CodeStubDescriptor class.
99 100 101
  void InitializePlatformSpecific(
      int register_parameter_count, Register* registers,
      PlatformInterfaceDescriptor* platform_descriptor = NULL);
102

103 104
  bool IsInitialized() const { return register_param_count_ >= 0; }

105
  int param_count() const { return function_type_->Arity(); }
106 107 108
  int register_param_count() const { return register_param_count_; }
  Register register_param(int index) const { return register_params_[index]; }
  Register* register_params() const { return register_params_.get(); }
109
  Type* param_type(int index) const { return function_type_->Parameter(index); }
110 111 112 113
  PlatformInterfaceDescriptor* platform_specific_descriptor() const {
    return platform_specific_descriptor_;
  }

114 115
  Type::FunctionType* function_type() const { return function_type_; }

116 117 118 119 120 121 122
 private:
  int register_param_count_;

  // The Register params are allocated dynamically by the
  // InterfaceDescriptor, and freed on destruction. This is because static
  // arrays of Registers cause creation of runtime static initializers
  // which we don't want.
rmcilroy's avatar
rmcilroy committed
123
  base::SmartArrayPointer<Register> register_params_;
124 125 126

  // Specifies types for parameters and return
  Type::FunctionType* function_type_;
127

128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
  PlatformInterfaceDescriptor* platform_specific_descriptor_;

  DISALLOW_COPY_AND_ASSIGN(CallInterfaceDescriptorData);
};


class CallDescriptors {
 public:
  enum Key {
#define DEF_ENUM(name) name,
    INTERFACE_DESCRIPTOR_LIST(DEF_ENUM)
#undef DEF_ENUM
    NUMBER_OF_DESCRIPTORS
  };
};


class CallInterfaceDescriptor {
 public:
  CallInterfaceDescriptor() : data_(NULL) {}
148
  virtual ~CallInterfaceDescriptor() {}
149 150 151 152

  CallInterfaceDescriptor(Isolate* isolate, CallDescriptors::Key key)
      : data_(isolate->call_descriptor_data(key)) {}

153 154
  int GetParameterCount() const { return data()->param_count(); }

155 156 157
  int GetRegisterParameterCount() const {
    return data()->register_param_count();
  }
158

159 160 161 162 163
  int GetStackParameterCount() const {
    return data()->function_type()->Arity() - data()->register_param_count();
  }

  Register GetRegisterParameter(int index) const {
164
    return data()->register_param(index);
165 166
  }

167
  Type* GetParameterType(int index) const {
168 169
    DCHECK(index < data()->param_count());
    return data()->param_type(index);
170 171 172 173
  }

  // Some platforms have extra information to associate with the descriptor.
  PlatformInterfaceDescriptor* platform_specific_descriptor() const {
174
    return data()->platform_specific_descriptor();
175 176
  }

177 178 179 180
  Type::FunctionType* GetFunctionType() const {
    return data()->function_type();
  }

181 182
  static const Register ContextRegister();

183
  const char* DebugName(Isolate* isolate) const;
184

185 186 187
  static Type::FunctionType* BuildDefaultFunctionType(Isolate* isolate,
                                                      int paramater_count);

188 189 190
 protected:
  const CallInterfaceDescriptorData* data() const { return data_; }

191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
  virtual Type::FunctionType* BuildCallInterfaceDescriptorFunctionType(
      Isolate* isolate, int register_param_count) {
    return BuildDefaultFunctionType(isolate, register_param_count);
  }

  virtual void InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
    UNREACHABLE();
  }

  void Initialize(Isolate* isolate, CallDescriptors::Key key) {
    if (!data()->IsInitialized()) {
      CallInterfaceDescriptorData* d = isolate->call_descriptor_data(key);
      InitializePlatformSpecific(d);
      Type::FunctionType* function_type =
          BuildCallInterfaceDescriptorFunctionType(isolate,
                                                   d->register_param_count());
207
      d->InitializePlatformIndependent(function_type);
208 209 210
    }
  }

211
 private:
212 213
  const CallInterfaceDescriptorData* data_;
};
214 215


216 217 218 219 220 221 222 223 224 225
#define DECLARE_DESCRIPTOR(name, base)                                         \
  explicit name(Isolate* isolate) : base(isolate, key()) {                     \
    Initialize(isolate, key());                                                \
  }                                                                            \
                                                                               \
 protected:                                                                    \
  void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; \
  name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {}     \
                                                                               \
 public:                                                                       \
226
  static inline CallDescriptors::Key key();
227

228

229 230 231 232 233 234
#define DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(name, base) \
  DECLARE_DESCRIPTOR(name, base)                                 \
 protected:                                                      \
  Type::FunctionType* BuildCallInterfaceDescriptorFunctionType(  \
      Isolate* isolate, int register_param_count) override;      \
                                                                 \
235
 public:
236
// LoadDescriptor is used by all stubs that implement Load/KeyedLoad ICs.
237 238
class LoadDescriptor : public CallInterfaceDescriptor {
 public:
239 240
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadDescriptor,
                                               CallInterfaceDescriptor)
241

242
  enum ParameterIndices { kReceiverIndex, kNameIndex, kSlotIndex };
243 244
  static const Register ReceiverRegister();
  static const Register NameRegister();
245
  static const Register SlotRegister();
246 247 248
};


249
class StoreDescriptor : public CallInterfaceDescriptor {
250
 public:
251
  DECLARE_DESCRIPTOR(StoreDescriptor, CallInterfaceDescriptor)
252

253 254 255 256 257 258 259 260 261
  enum ParameterIndices {
    kReceiverIndex,
    kNameIndex,
    kValueIndex,
    kParameterCount
  };
  static const Register ReceiverRegister();
  static const Register NameRegister();
  static const Register ValueRegister();
262
};
263 264


265
class StoreTransitionDescriptor : public StoreDescriptor {
266
 public:
267 268
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreTransitionDescriptor,
                                               StoreDescriptor)
269 270 271 272 273 274 275 276 277

  // Extends StoreDescriptor with Map parameter.
  enum ParameterIndices {
    kReceiverIndex,
    kNameIndex,
    kValueIndex,
    kMapIndex,
    kParameterCount
  };
278

279 280 281 282 283 284 285 286 287 288 289
  static const Register MapRegister();
};


class VectorStoreTransitionDescriptor : public StoreDescriptor {
 public:
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(VectorStoreTransitionDescriptor,
                                               StoreDescriptor)

  // Extends StoreDescriptor with Map parameter.
  enum ParameterIndices {
290 291 292 293 294 295 296 297 298 299
    kReceiverIndex = 0,
    kNameIndex = 1,
    kValueIndex = 2,

    kMapIndex = 3,

    kSlotIndex = 4,  // not present on ia32.
    kVirtualSlotVectorIndex = 4,

    kVectorIndex = 5
300 301
  };

302
  static const Register MapRegister();
303 304
  static const Register SlotRegister();
  static const Register VectorRegister();
305 306 307
};


308
class InstanceOfDescriptor final : public CallInterfaceDescriptor {
309
 public:
310
  DECLARE_DESCRIPTOR(InstanceOfDescriptor, CallInterfaceDescriptor)
311 312

  enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount };
313 314
  static const Register LeftRegister();
  static const Register RightRegister();
315 316 317
};


318 319
class VectorStoreICTrampolineDescriptor : public StoreDescriptor {
 public:
320 321
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
      VectorStoreICTrampolineDescriptor, StoreDescriptor)
322 323 324 325 326 327 328 329 330

  enum ParameterIndices { kReceiverIndex, kNameIndex, kValueIndex, kSlotIndex };

  static const Register SlotRegister();
};


class VectorStoreICDescriptor : public VectorStoreICTrampolineDescriptor {
 public:
331 332
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
      VectorStoreICDescriptor, VectorStoreICTrampolineDescriptor)
333 334 335 336 337 338 339 340 341 342 343 344 345

  enum ParameterIndices {
    kReceiverIndex,
    kNameIndex,
    kValueIndex,
    kSlotIndex,
    kVectorIndex
  };

  static const Register VectorRegister();
};


346
class LoadWithVectorDescriptor : public LoadDescriptor {
347
 public:
348 349
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadWithVectorDescriptor,
                                               LoadDescriptor)
350 351 352 353 354

  enum ParameterIndices {
    kReceiverIndex,
    kNameIndex,
    kSlotIndex,
355
    kVectorIndex
356 357 358 359 360 361 362 363
  };

  static const Register VectorRegister();
};


class FastNewClosureDescriptor : public CallInterfaceDescriptor {
 public:
364
  DECLARE_DESCRIPTOR(FastNewClosureDescriptor, CallInterfaceDescriptor)
365 366 367 368 369
};


class FastNewContextDescriptor : public CallInterfaceDescriptor {
 public:
370
  DECLARE_DESCRIPTOR(FastNewContextDescriptor, CallInterfaceDescriptor)
371 372 373 374 375
};


class ToNumberDescriptor : public CallInterfaceDescriptor {
 public:
376
  DECLARE_DESCRIPTOR(ToNumberDescriptor, CallInterfaceDescriptor)
377 378 379
};


380 381 382 383 384 385 386 387 388 389
class ToLengthDescriptor : public CallInterfaceDescriptor {
 public:
  enum ParameterIndices { kReceiverIndex };

  DECLARE_DESCRIPTOR(ToLengthDescriptor, CallInterfaceDescriptor)

  static const Register ReceiverRegister();
};


390 391 392 393 394 395 396 397 398 399
class ToStringDescriptor : public CallInterfaceDescriptor {
 public:
  enum ParameterIndices { kReceiverIndex };

  DECLARE_DESCRIPTOR(ToStringDescriptor, CallInterfaceDescriptor)

  static const Register ReceiverRegister();
};


400 401 402 403 404 405 406 407 408 409
class ToObjectDescriptor : public CallInterfaceDescriptor {
 public:
  enum ParameterIndices { kReceiverIndex };

  DECLARE_DESCRIPTOR(ToObjectDescriptor, CallInterfaceDescriptor)

  static const Register ReceiverRegister();
};


410 411
class NumberToStringDescriptor : public CallInterfaceDescriptor {
 public:
412
  DECLARE_DESCRIPTOR(NumberToStringDescriptor, CallInterfaceDescriptor)
413 414 415
};


416 417 418 419 420
class TypeofDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(TypeofDescriptor, CallInterfaceDescriptor)
};

421 422 423 424 425 426 427

class FastCloneRegExpDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneRegExpDescriptor,
                                               CallInterfaceDescriptor)
};

428

429 430
class FastCloneShallowArrayDescriptor : public CallInterfaceDescriptor {
 public:
431 432
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(FastCloneShallowArrayDescriptor,
                                               CallInterfaceDescriptor)
433 434 435 436 437
};


class FastCloneShallowObjectDescriptor : public CallInterfaceDescriptor {
 public:
438
  DECLARE_DESCRIPTOR(FastCloneShallowObjectDescriptor, CallInterfaceDescriptor)
439 440 441 442 443
};


class CreateAllocationSiteDescriptor : public CallInterfaceDescriptor {
 public:
444 445
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateAllocationSiteDescriptor,
                                               CallInterfaceDescriptor)
446 447 448
};


449 450 451 452 453 454 455 456 457
class CreateWeakCellDescriptor : public CallInterfaceDescriptor {
 public:
  enum ParameterIndices {
    kVectorIndex,
    kSlotIndex,
    kValueIndex,
    kParameterCount
  };

458 459
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CreateWeakCellDescriptor,
                                               CallInterfaceDescriptor)
460 461 462
};


463 464 465 466 467 468 469
class CallTrampolineDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(CallTrampolineDescriptor,
                                               CallInterfaceDescriptor)
};


470 471 472 473 474 475 476
class ConstructTrampolineDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ConstructTrampolineDescriptor,
                                               CallInterfaceDescriptor)
};


477 478
class CallFunctionDescriptor : public CallInterfaceDescriptor {
 public:
479 480 481 482 483 484
  DECLARE_DESCRIPTOR(CallFunctionDescriptor, CallInterfaceDescriptor)
};


class CallFunctionWithFeedbackDescriptor : public CallInterfaceDescriptor {
 public:
485 486
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
      CallFunctionWithFeedbackDescriptor, CallInterfaceDescriptor)
487 488 489
};


490 491 492
class CallFunctionWithFeedbackAndVectorDescriptor
    : public CallInterfaceDescriptor {
 public:
493 494
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
      CallFunctionWithFeedbackAndVectorDescriptor, CallInterfaceDescriptor)
495 496 497
};


498 499
class CallConstructDescriptor : public CallInterfaceDescriptor {
 public:
500
  DECLARE_DESCRIPTOR(CallConstructDescriptor, CallInterfaceDescriptor)
501 502 503 504 505
};


class RegExpConstructResultDescriptor : public CallInterfaceDescriptor {
 public:
506
  DECLARE_DESCRIPTOR(RegExpConstructResultDescriptor, CallInterfaceDescriptor)
507 508 509
};


510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528
class LoadGlobalViaContextDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(LoadGlobalViaContextDescriptor,
                                               CallInterfaceDescriptor)

  static const Register SlotRegister();
};


class StoreGlobalViaContextDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(StoreGlobalViaContextDescriptor,
                                               CallInterfaceDescriptor)

  static const Register SlotRegister();
  static const Register ValueRegister();
};


529 530
class TransitionElementsKindDescriptor : public CallInterfaceDescriptor {
 public:
531
  DECLARE_DESCRIPTOR(TransitionElementsKindDescriptor, CallInterfaceDescriptor)
532 533 534
};


535 536 537 538 539 540
class AllocateHeapNumberDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(AllocateHeapNumberDescriptor, CallInterfaceDescriptor)
};


541 542 543 544 545 546 547
class AllocateMutableHeapNumberDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(AllocateMutableHeapNumberDescriptor,
                     CallInterfaceDescriptor)
};


548 549 550 551 552 553
class AllocateInNewSpaceDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(AllocateInNewSpaceDescriptor, CallInterfaceDescriptor)
};


554 555 556
class ArrayConstructorConstantArgCountDescriptor
    : public CallInterfaceDescriptor {
 public:
557 558
  DECLARE_DESCRIPTOR(ArrayConstructorConstantArgCountDescriptor,
                     CallInterfaceDescriptor)
559 560 561 562 563
};


class ArrayConstructorDescriptor : public CallInterfaceDescriptor {
 public:
564 565
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor,
                                               CallInterfaceDescriptor)
566 567 568 569 570 571
};


class InternalArrayConstructorConstantArgCountDescriptor
    : public CallInterfaceDescriptor {
 public:
572 573
  DECLARE_DESCRIPTOR(InternalArrayConstructorConstantArgCountDescriptor,
                     CallInterfaceDescriptor)
574 575 576 577 578
};


class InternalArrayConstructorDescriptor : public CallInterfaceDescriptor {
 public:
579 580
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
      InternalArrayConstructorDescriptor, CallInterfaceDescriptor)
581 582 583
};


584 585 586 587 588 589
class CompareDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(CompareDescriptor, CallInterfaceDescriptor)
};


590 591
class CompareNilDescriptor : public CallInterfaceDescriptor {
 public:
592
  DECLARE_DESCRIPTOR(CompareNilDescriptor, CallInterfaceDescriptor)
593 594 595 596 597
};


class ToBooleanDescriptor : public CallInterfaceDescriptor {
 public:
598
  DECLARE_DESCRIPTOR(ToBooleanDescriptor, CallInterfaceDescriptor)
599 600 601 602 603
};


class BinaryOpDescriptor : public CallInterfaceDescriptor {
 public:
604
  DECLARE_DESCRIPTOR(BinaryOpDescriptor, CallInterfaceDescriptor)
605 606 607 608 609
};


class BinaryOpWithAllocationSiteDescriptor : public CallInterfaceDescriptor {
 public:
610 611
  DECLARE_DESCRIPTOR(BinaryOpWithAllocationSiteDescriptor,
                     CallInterfaceDescriptor)
612 613 614 615 616
};


class StringAddDescriptor : public CallInterfaceDescriptor {
 public:
617
  DECLARE_DESCRIPTOR(StringAddDescriptor, CallInterfaceDescriptor)
618 619 620
};


621 622 623 624 625 626 627 628 629 630
class StringCompareDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(StringCompareDescriptor, CallInterfaceDescriptor)

  enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount };
  static const Register LeftRegister();
  static const Register RightRegister();
};


631 632
class KeyedDescriptor : public CallInterfaceDescriptor {
 public:
633
  DECLARE_DESCRIPTOR(KeyedDescriptor, CallInterfaceDescriptor)
634 635 636 637 638
};


class NamedDescriptor : public CallInterfaceDescriptor {
 public:
639
  DECLARE_DESCRIPTOR(NamedDescriptor, CallInterfaceDescriptor)
640 641 642 643 644
};


class CallHandlerDescriptor : public CallInterfaceDescriptor {
 public:
645
  DECLARE_DESCRIPTOR(CallHandlerDescriptor, CallInterfaceDescriptor)
646 647 648 649 650
};


class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor {
 public:
651 652
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArgumentAdaptorDescriptor,
                                               CallInterfaceDescriptor)
653 654 655 656 657
};


class ApiFunctionDescriptor : public CallInterfaceDescriptor {
 public:
658 659
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiFunctionDescriptor,
                                               CallInterfaceDescriptor)
660 661 662
};


663 664
class ApiAccessorDescriptor : public CallInterfaceDescriptor {
 public:
665 666
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiAccessorDescriptor,
                                               CallInterfaceDescriptor)
667 668 669
};


670 671
class ApiGetterDescriptor : public CallInterfaceDescriptor {
 public:
672 673
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ApiGetterDescriptor,
                                               CallInterfaceDescriptor)
674 675 676 677 678 679 680 681 682 683 684 685 686 687

  static const Register function_address();
};


class ArgumentsAccessReadDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(ArgumentsAccessReadDescriptor, CallInterfaceDescriptor)

  static const Register index();
  static const Register parameter_count();
};


688 689 690 691 692 693 694 695 696 697 698
class ArgumentsAccessNewDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArgumentsAccessNewDescriptor,
                                               CallInterfaceDescriptor)

  static const Register function();
  static const Register parameter_count();
  static const Register parameter_pointer();
};


699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721
class StoreArrayLiteralElementDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(StoreArrayLiteralElementDescriptor,
                     CallInterfaceDescriptor)
};


class MathPowTaggedDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(MathPowTaggedDescriptor, CallInterfaceDescriptor)

  static const Register exponent();
};


class MathPowIntegerDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(MathPowIntegerDescriptor, CallInterfaceDescriptor)

  static const Register exponent();
};


722 723
class MathRoundVariantCallFromOptimizedCodeDescriptor
    : public CallInterfaceDescriptor {
724
 public:
725 726 727 728 729 730 731 732 733 734 735
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
      MathRoundVariantCallFromOptimizedCodeDescriptor, CallInterfaceDescriptor)
};


class MathRoundVariantCallFromUnoptimizedCodeDescriptor
    : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
      MathRoundVariantCallFromUnoptimizedCodeDescriptor,
      CallInterfaceDescriptor)
736 737 738
};


739 740 741
class ContextOnlyDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(ContextOnlyDescriptor, CallInterfaceDescriptor)
742 743
};

744 745 746 747 748

class GrowArrayElementsDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(GrowArrayElementsDescriptor, CallInterfaceDescriptor)

749
  enum RegisterInfo { kObjectIndex, kKeyIndex };
750 751 752 753
  static const Register ObjectRegister();
  static const Register KeyRegister();
};

754

755
class InterpreterPushArgsAndCallDescriptor : public CallInterfaceDescriptor {
756
 public:
757 758 759 760 761
  DECLARE_DESCRIPTOR(InterpreterPushArgsAndCallDescriptor,
                     CallInterfaceDescriptor)
};


762 763 764 765 766 767 768 769
class InterpreterPushArgsAndConstructDescriptor
    : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(InterpreterPushArgsAndConstructDescriptor,
                     CallInterfaceDescriptor)
};


770 771 772
class InterpreterCEntryDescriptor : public CallInterfaceDescriptor {
 public:
  DECLARE_DESCRIPTOR(InterpreterCEntryDescriptor, CallInterfaceDescriptor)
773 774
};

775

776 777 778 779 780 781 782 783 784
#undef DECLARE_DESCRIPTOR


// We define the association between CallDescriptors::Key and the specialized
// descriptor here to reduce boilerplate and mistakes.
#define DEF_KEY(name) \
  CallDescriptors::Key name##Descriptor::key() { return CallDescriptors::name; }
INTERFACE_DESCRIPTOR_LIST(DEF_KEY)
#undef DEF_KEY
785 786
}  // namespace internal
}  // namespace v8
787

788

789 790 791 792 793 794 795
#if V8_TARGET_ARCH_ARM64
#include "src/arm64/interface-descriptors-arm64.h"
#elif V8_TARGET_ARCH_ARM
#include "src/arm/interface-descriptors-arm.h"
#endif

#endif  // V8_CALL_INTERFACE_DESCRIPTOR_H_