Chromium Code Reviews| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 const CallInterfaceDescriptorData* data_; | 219 const CallInterfaceDescriptorData* data_; |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 #define DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ | 222 #define DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ |
| 223 public: \ | 223 public: \ |
| 224 explicit name(Isolate* isolate) : base(isolate, key()) { \ | 224 explicit name(Isolate* isolate) : base(isolate, key()) { \ |
| 225 Initialize(isolate, key()); \ | 225 Initialize(isolate, key()); \ |
| 226 } \ | 226 } \ |
| 227 static inline CallDescriptors::Key key(); | 227 static inline CallDescriptors::Key key(); |
| 228 | 228 |
| 229 #define DECLARE_DEFAULT_DESCRIPTOR(name, base, parameter_count) \ | 229 static const int kMaxBuiltinRegisterParams = 5; |
| 230 DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ | 230 |
| 231 protected: \ | 231 #define DECLARE_DEFAULT_DESCRIPTOR(name, base, parameter_count) \ |
| 232 void InitializePlatformSpecific(CallInterfaceDescriptorData* data) \ | 232 DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ |
| 233 override { \ | 233 protected: \ |
| 234 DefaultInitializePlatformSpecific(data, parameter_count); \ | 234 static const int kRegisterParams = \ |
| 235 } \ | 235 parameter_count > kMaxBuiltinRegisterParams ? kMaxBuiltinRegisterParams \ |
| 236 name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \ | 236 : parameter_count; \ |
| 237 \ | 237 static const int kStackParams = parameter_count - kRegisterParams; \ |
| 238 void InitializePlatformSpecific(CallInterfaceDescriptorData* data) \ | |
| 239 override { \ | |
| 240 DefaultInitializePlatformSpecific(data, kRegisterParams); \ | |
| 241 } \ | |
| 242 void InitializePlatformIndependent(CallInterfaceDescriptorData* data) \ | |
| 243 override { \ | |
| 244 data->InitializePlatformIndependent(kRegisterParams, kStackParams, NULL); \ | |
| 245 } \ | |
| 246 name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \ | |
| 247 \ | |
| 238 public: | 248 public: |
| 239 | 249 |
| 240 #define DECLARE_DESCRIPTOR(name, base) \ | 250 #define DECLARE_DESCRIPTOR(name, base) \ |
| 241 DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ | 251 DECLARE_DESCRIPTOR_WITH_BASE(name, base) \ |
| 242 protected: \ | 252 protected: \ |
| 243 void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; \ | 253 void InitializePlatformSpecific(CallInterfaceDescriptorData* data) override; \ |
| 244 name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \ | 254 name(Isolate* isolate, CallDescriptors::Key key) : base(isolate, key) {} \ |
| 245 \ | 255 \ |
| 246 public: | 256 public: |
| 247 | 257 |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 636 static const Register TargetRegister(); | 646 static const Register TargetRegister(); |
| 637 }; | 647 }; |
| 638 | 648 |
| 639 class IteratingArrayBuiltinDescriptor : public BuiltinDescriptor { | 649 class IteratingArrayBuiltinDescriptor : public BuiltinDescriptor { |
| 640 public: | 650 public: |
| 641 DEFINE_BUILTIN_PARAMETERS(kCallback, kThisArg) | 651 DEFINE_BUILTIN_PARAMETERS(kCallback, kThisArg) |
| 642 DECLARE_BUILTIN_DESCRIPTOR(IteratingArrayBuiltinDescriptor) | 652 DECLARE_BUILTIN_DESCRIPTOR(IteratingArrayBuiltinDescriptor) |
| 643 }; | 653 }; |
| 644 | 654 |
| 645 class IteratingArrayBuiltinLoopContinuationDescriptor | 655 class IteratingArrayBuiltinLoopContinuationDescriptor |
| 646 : public BuiltinDescriptor { | 656 : public CallInterfaceDescriptor { |
| 647 public: | 657 public: |
| 648 DEFINE_BUILTIN_PARAMETERS(kCallback, kThisArg, kArray, kObject, kInitialK, | 658 DEFINE_PARAMETERS(kReceiver, kCallback, kThisArg, kArray, kObject, kInitialK, |
|
Igor Sheludko
2017/04/27 10:38:05
While you are here, please fix all the builtins th
danno
2017/04/28 06:58:10
Done.
| |
| 649 kLength, kTo) | 659 kLength, kTo) |
| 650 DECLARE_BUILTIN_DESCRIPTOR(IteratingArrayBuiltinLoopContinuationDescriptor) | 660 DECLARE_DEFAULT_DESCRIPTOR(IteratingArrayBuiltinLoopContinuationDescriptor, |
| 661 CallInterfaceDescriptor, kParameterCount) | |
| 651 }; | 662 }; |
| 652 | 663 |
| 653 class ArrayConstructorDescriptor : public CallInterfaceDescriptor { | 664 class ArrayConstructorDescriptor : public CallInterfaceDescriptor { |
| 654 public: | 665 public: |
| 655 DEFINE_PARAMETERS(kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite) | 666 DEFINE_PARAMETERS(kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite) |
| 656 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor, | 667 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor, |
| 657 CallInterfaceDescriptor) | 668 CallInterfaceDescriptor) |
| 658 }; | 669 }; |
| 659 | 670 |
| 660 class ArrayNoArgumentConstructorDescriptor : public CallInterfaceDescriptor { | 671 class ArrayNoArgumentConstructorDescriptor : public CallInterfaceDescriptor { |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 900 } // namespace v8 | 911 } // namespace v8 |
| 901 | 912 |
| 902 | 913 |
| 903 #if V8_TARGET_ARCH_ARM64 | 914 #if V8_TARGET_ARCH_ARM64 |
| 904 #include "src/arm64/interface-descriptors-arm64.h" | 915 #include "src/arm64/interface-descriptors-arm64.h" |
| 905 #elif V8_TARGET_ARCH_ARM | 916 #elif V8_TARGET_ARCH_ARM |
| 906 #include "src/arm/interface-descriptors-arm.h" | 917 #include "src/arm/interface-descriptors-arm.h" |
| 907 #endif | 918 #endif |
| 908 | 919 |
| 909 #endif // V8_CALL_INTERFACE_DESCRIPTOR_H_ | 920 #endif // V8_CALL_INTERFACE_DESCRIPTOR_H_ |
| OLD | NEW |