OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_CALL_INTERFACE_DESCRIPTOR_H_ | 5 #ifndef V8_CALL_INTERFACE_DESCRIPTOR_H_ |
6 #define V8_CALL_INTERFACE_DESCRIPTOR_H_ | 6 #define V8_CALL_INTERFACE_DESCRIPTOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 V(CallForwardVarargs) \ | 47 V(CallForwardVarargs) \ |
48 V(CallConstruct) \ | 48 V(CallConstruct) \ |
49 V(CallTrampoline) \ | 49 V(CallTrampoline) \ |
50 V(ConstructStub) \ | 50 V(ConstructStub) \ |
51 V(ConstructTrampoline) \ | 51 V(ConstructTrampoline) \ |
52 V(TransitionElementsKind) \ | 52 V(TransitionElementsKind) \ |
53 V(AllocateHeapNumber) \ | 53 V(AllocateHeapNumber) \ |
54 V(Builtin) \ | 54 V(Builtin) \ |
55 V(ArrayConstructor) \ | 55 V(ArrayConstructor) \ |
56 V(IteratingArrayBuiltin) \ | 56 V(IteratingArrayBuiltin) \ |
| 57 V(IteratingArrayBuiltinLoopContinuation) \ |
57 V(ArrayNoArgumentConstructor) \ | 58 V(ArrayNoArgumentConstructor) \ |
58 V(ArraySingleArgumentConstructor) \ | 59 V(ArraySingleArgumentConstructor) \ |
59 V(ArrayNArgumentsConstructor) \ | 60 V(ArrayNArgumentsConstructor) \ |
60 V(Compare) \ | 61 V(Compare) \ |
61 V(BinaryOp) \ | 62 V(BinaryOp) \ |
62 V(BinaryOpWithAllocationSite) \ | 63 V(BinaryOpWithAllocationSite) \ |
63 V(BinaryOpWithVector) \ | 64 V(BinaryOpWithVector) \ |
64 V(CountOp) \ | 65 V(CountOp) \ |
65 V(StringAdd) \ | 66 V(StringAdd) \ |
66 V(StringCharAt) \ | 67 V(StringCharAt) \ |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 const CallInterfaceDescriptorData* data_; | 219 const CallInterfaceDescriptorData* data_; |
219 }; | 220 }; |
220 | 221 |
221 #define DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ | 222 #define DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ |
222 public: \ | 223 public: \ |
223 explicit name(Isolate* isolate) : base(isolate, key()) { \ | 224 explicit name(Isolate* isolate) : base(isolate, key()) { \ |
224 Initialize(isolate, key()); \ | 225 Initialize(isolate, key()); \ |
225 } \ | 226 } \ |
226 static inline CallDescriptors::Key key(); | 227 static inline CallDescriptors::Key key(); |
227 | 228 |
228 static const int kMaxBuiltinRegisterParams = 5; | 229 #define DECLARE_DEFAULT_DESCRIPTOR(name, base, parameter_count) \ |
229 | 230 DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ |
230 #define DECLARE_DEFAULT_DESCRIPTOR(name, base, parameter_count) \ | 231 protected: \ |
231 DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ | 232 void InitializePlatformSpecific(CallInterfaceDescriptorData* data) \ |
232 protected: \ | 233 override { \ |
233 static const int kRegisterParams = \ | 234 DefaultInitializePlatformSpecific(data, parameter_count); \ |
234 parameter_count > kMaxBuiltinRegisterParams ? kMaxBuiltinRegisterParams \ | 235 } \ |
235 : parameter_count; \ | 236 name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \ |
236 static const int kStackParams = parameter_count - kRegisterParams; \ | 237 \ |
237 void InitializePlatformSpecific(CallInterfaceDescriptorData* data) \ | |
238 override { \ | |
239 DefaultInitializePlatformSpecific(data, kRegisterParams); \ | |
240 } \ | |
241 void InitializePlatformIndependent(CallInterfaceDescriptorData* data) \ | |
242 override { \ | |
243 data->InitializePlatformIndependent(kRegisterParams, kStackParams, NULL); \ | |
244 } \ | |
245 name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \ | |
246 \ | |
247 public: | 238 public: |
248 | 239 |
249 #define DECLARE_DESCRIPTOR(name, base) \ | 240 #define DECLARE_DESCRIPTOR(name, base) \ |
250 DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ | 241 DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ |
251 protected: \ | 242 protected: \ |
252 void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; \ | 243 void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; \ |
253 name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \ | 244 name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \ |
254 \ | 245 \ |
255 public: | 246 public: |
256 | 247 |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 static const Register NewTargetRegister(); | 635 static const Register NewTargetRegister(); |
645 static const Register TargetRegister(); | 636 static const Register TargetRegister(); |
646 }; | 637 }; |
647 | 638 |
648 class IteratingArrayBuiltinDescriptor : public BuiltinDescriptor { | 639 class IteratingArrayBuiltinDescriptor : public BuiltinDescriptor { |
649 public: | 640 public: |
650 DEFINE_BUILTIN_PARAMETERS(kCallback, kThisArg) | 641 DEFINE_BUILTIN_PARAMETERS(kCallback, kThisArg) |
651 DECLARE_BUILTIN_DESCRIPTOR(IteratingArrayBuiltinDescriptor) | 642 DECLARE_BUILTIN_DESCRIPTOR(IteratingArrayBuiltinDescriptor) |
652 }; | 643 }; |
653 | 644 |
| 645 class IteratingArrayBuiltinLoopContinuationDescriptor |
| 646 : public BuiltinDescriptor { |
| 647 public: |
| 648 DEFINE_BUILTIN_PARAMETERS(kCallback, kThisArg, kArray, kObject, kInitialK, |
| 649 kLength, kTo) |
| 650 DECLARE_BUILTIN_DESCRIPTOR(IteratingArrayBuiltinLoopContinuationDescriptor) |
| 651 }; |
| 652 |
654 class ArrayConstructorDescriptor : public CallInterfaceDescriptor { | 653 class ArrayConstructorDescriptor : public CallInterfaceDescriptor { |
655 public: | 654 public: |
656 DEFINE_PARAMETERS(kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite) | 655 DEFINE_PARAMETERS(kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite) |
657 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor, | 656 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor, |
658 CallInterfaceDescriptor) | 657 CallInterfaceDescriptor) |
659 }; | 658 }; |
660 | 659 |
661 class ArrayNoArgumentConstructorDescriptor : public CallInterfaceDescriptor { | 660 class ArrayNoArgumentConstructorDescriptor : public CallInterfaceDescriptor { |
662 public: | 661 public: |
663 DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount, | 662 DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount, |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 } // namespace v8 | 900 } // namespace v8 |
902 | 901 |
903 | 902 |
904 #if V8_TARGET_ARCH_ARM64 | 903 #if V8_TARGET_ARCH_ARM64 |
905 #include "src/arm64/interface-descriptors-arm64.h" | 904 #include "src/arm64/interface-descriptors-arm64.h" |
906 #elif V8_TARGET_ARCH_ARM | 905 #elif V8_TARGET_ARCH_ARM |
907 #include "src/arm/interface-descriptors-arm.h" | 906 #include "src/arm/interface-descriptors-arm.h" |
908 #endif | 907 #endif |
909 | 908 |
910 #endif // V8_CALL_INTERFACE_DESCRIPTOR_H_ | 909 #endif // V8_CALL_INTERFACE_DESCRIPTOR_H_ |
OLD | NEW |