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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 V(AllocateUint32x4) \ | 60 V(AllocateUint32x4) \ |
61 V(AllocateBool32x4) \ | 61 V(AllocateBool32x4) \ |
62 V(AllocateInt16x8) \ | 62 V(AllocateInt16x8) \ |
63 V(AllocateUint16x8) \ | 63 V(AllocateUint16x8) \ |
64 V(AllocateBool16x8) \ | 64 V(AllocateBool16x8) \ |
65 V(AllocateInt8x16) \ | 65 V(AllocateInt8x16) \ |
66 V(AllocateUint8x16) \ | 66 V(AllocateUint8x16) \ |
67 V(AllocateBool8x16) \ | 67 V(AllocateBool8x16) \ |
68 V(Builtin) \ | 68 V(Builtin) \ |
69 V(ArrayConstructor) \ | 69 V(ArrayConstructor) \ |
| 70 V(ForEach) \ |
70 V(ArrayNoArgumentConstructor) \ | 71 V(ArrayNoArgumentConstructor) \ |
71 V(ArraySingleArgumentConstructor) \ | 72 V(ArraySingleArgumentConstructor) \ |
72 V(ArrayNArgumentsConstructor) \ | 73 V(ArrayNArgumentsConstructor) \ |
73 V(Compare) \ | 74 V(Compare) \ |
74 V(BinaryOp) \ | 75 V(BinaryOp) \ |
75 V(BinaryOpWithAllocationSite) \ | 76 V(BinaryOpWithAllocationSite) \ |
76 V(BinaryOpWithVector) \ | 77 V(BinaryOpWithVector) \ |
77 V(CountOp) \ | 78 V(CountOp) \ |
78 V(StringAdd) \ | 79 V(StringAdd) \ |
79 V(StringCharAt) \ | 80 V(StringCharAt) \ |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 public: | 286 public: |
286 | 287 |
287 #define DEFINE_PARAMETERS(...) \ | 288 #define DEFINE_PARAMETERS(...) \ |
288 enum ParameterIndices { \ | 289 enum ParameterIndices { \ |
289 __VA_ARGS__, \ | 290 __VA_ARGS__, \ |
290 \ | 291 \ |
291 kParameterCount, \ | 292 kParameterCount, \ |
292 kContext = kParameterCount /* implicit parameter */ \ | 293 kContext = kParameterCount /* implicit parameter */ \ |
293 }; | 294 }; |
294 | 295 |
| 296 #define DECLARE_BUILTIN_DESCRIPTOR(name) \ |
| 297 DECLARE_DESCRIPTOR_WITH_BASE(name, BuiltinDescriptor) \ |
| 298 protected: \ |
| 299 void InitializePlatformIndependent(CallInterfaceDescriptorData* data) \ |
| 300 override { \ |
| 301 MachineType machine_types[] = {MachineType::AnyTagged(), \ |
| 302 MachineType::AnyTagged(), \ |
| 303 MachineType::Int32()}; \ |
| 304 int argc = kStackParameterCount + 1 - arraysize(machine_types); \ |
| 305 data->InitializePlatformIndependent(arraysize(machine_types), argc, \ |
| 306 machine_types); \ |
| 307 } \ |
| 308 void InitializePlatformSpecific(CallInterfaceDescriptorData* data) \ |
| 309 override { \ |
| 310 Register registers[] = {TargetRegister(), NewTargetRegister(), \ |
| 311 ArgumentsCountRegister()}; \ |
| 312 data->InitializePlatformSpecific(arraysize(registers), registers); \ |
| 313 } \ |
| 314 \ |
| 315 public: |
| 316 |
| 317 #define DEFINE_BUILTIN_PARAMETERS(...) \ |
| 318 enum ParameterIndices { \ |
| 319 kReceiver, \ |
| 320 kBeforeFirstStackParameter = kReceiver, \ |
| 321 __VA_ARGS__, \ |
| 322 kAfterLastStackParameter, \ |
| 323 kNewTarget = kAfterLastStackParameter, \ |
| 324 kArgumentsCount, \ |
| 325 kContext, /* implicit parameter */ \ |
| 326 kParameterCount = kContext, \ |
| 327 kStackParameterCount = \ |
| 328 kAfterLastStackParameter - kBeforeFirstStackParameter - 1, \ |
| 329 }; |
| 330 |
295 class VoidDescriptor : public CallInterfaceDescriptor { | 331 class VoidDescriptor : public CallInterfaceDescriptor { |
296 public: | 332 public: |
297 DECLARE_DESCRIPTOR(VoidDescriptor, CallInterfaceDescriptor) | 333 DECLARE_DESCRIPTOR(VoidDescriptor, CallInterfaceDescriptor) |
298 }; | 334 }; |
299 | 335 |
300 class ContextOnlyDescriptor : public CallInterfaceDescriptor { | 336 class ContextOnlyDescriptor : public CallInterfaceDescriptor { |
301 public: | 337 public: |
302 DECLARE_DESCRIPTOR(ContextOnlyDescriptor, CallInterfaceDescriptor) | 338 DECLARE_DESCRIPTOR(ContextOnlyDescriptor, CallInterfaceDescriptor) |
303 }; | 339 }; |
304 | 340 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 public: | 686 public: |
651 // TODO(ishell): Where is kFunction?? | 687 // TODO(ishell): Where is kFunction?? |
652 DEFINE_PARAMETERS(kNewTarget, kArgumentsCount) | 688 DEFINE_PARAMETERS(kNewTarget, kArgumentsCount) |
653 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(BuiltinDescriptor, | 689 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(BuiltinDescriptor, |
654 CallInterfaceDescriptor) | 690 CallInterfaceDescriptor) |
655 static const Register ArgumentsCountRegister(); | 691 static const Register ArgumentsCountRegister(); |
656 static const Register NewTargetRegister(); | 692 static const Register NewTargetRegister(); |
657 static const Register TargetRegister(); | 693 static const Register TargetRegister(); |
658 }; | 694 }; |
659 | 695 |
| 696 class ForEachDescriptor : public BuiltinDescriptor { |
| 697 public: |
| 698 DEFINE_BUILTIN_PARAMETERS(kCallback, kThisArg) |
| 699 DECLARE_BUILTIN_DESCRIPTOR(ForEachDescriptor) |
| 700 }; |
| 701 |
660 class ArrayConstructorDescriptor : public CallInterfaceDescriptor { | 702 class ArrayConstructorDescriptor : public CallInterfaceDescriptor { |
661 public: | 703 public: |
662 DEFINE_PARAMETERS(kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite) | 704 DEFINE_PARAMETERS(kTarget, kNewTarget, kActualArgumentsCount, kAllocationSite) |
663 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor, | 705 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor, |
664 CallInterfaceDescriptor) | 706 CallInterfaceDescriptor) |
665 }; | 707 }; |
666 | 708 |
667 class ArrayNoArgumentConstructorDescriptor : public CallInterfaceDescriptor { | 709 class ArrayNoArgumentConstructorDescriptor : public CallInterfaceDescriptor { |
668 public: | 710 public: |
669 DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount, | 711 DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount, |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 } // namespace v8 | 966 } // namespace v8 |
925 | 967 |
926 | 968 |
927 #if V8_TARGET_ARCH_ARM64 | 969 #if V8_TARGET_ARCH_ARM64 |
928 #include "src/arm64/interface-descriptors-arm64.h" | 970 #include "src/arm64/interface-descriptors-arm64.h" |
929 #elif V8_TARGET_ARCH_ARM | 971 #elif V8_TARGET_ARCH_ARM |
930 #include "src/arm/interface-descriptors-arm.h" | 972 #include "src/arm/interface-descriptors-arm.h" |
931 #endif | 973 #endif |
932 | 974 |
933 #endif // V8_CALL_INTERFACE_DESCRIPTOR_H_ | 975 #endif // V8_CALL_INTERFACE_DESCRIPTOR_H_ |
OLD | NEW |