OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include "src/compiler/code-assembler.h" | 5 #include "src/compiler/code-assembler.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #define REPEAT_1_TO_3(V, T) REPEAT_1_TO_2(V, T) V(T, T, T) | 27 #define REPEAT_1_TO_3(V, T) REPEAT_1_TO_2(V, T) V(T, T, T) |
28 #define REPEAT_1_TO_4(V, T) REPEAT_1_TO_3(V, T) V(T, T, T, T) | 28 #define REPEAT_1_TO_4(V, T) REPEAT_1_TO_3(V, T) V(T, T, T, T) |
29 #define REPEAT_1_TO_5(V, T) REPEAT_1_TO_4(V, T) V(T, T, T, T, T) | 29 #define REPEAT_1_TO_5(V, T) REPEAT_1_TO_4(V, T) V(T, T, T, T, T) |
30 #define REPEAT_1_TO_6(V, T) REPEAT_1_TO_5(V, T) V(T, T, T, T, T, T) | 30 #define REPEAT_1_TO_6(V, T) REPEAT_1_TO_5(V, T) V(T, T, T, T, T, T) |
31 #define REPEAT_1_TO_7(V, T) REPEAT_1_TO_6(V, T) V(T, T, T, T, T, T, T) | 31 #define REPEAT_1_TO_7(V, T) REPEAT_1_TO_6(V, T) V(T, T, T, T, T, T, T) |
32 #define REPEAT_1_TO_8(V, T) REPEAT_1_TO_7(V, T) V(T, T, T, T, T, T, T, T) | 32 #define REPEAT_1_TO_8(V, T) REPEAT_1_TO_7(V, T) V(T, T, T, T, T, T, T, T) |
33 #define REPEAT_1_TO_9(V, T) REPEAT_1_TO_8(V, T) V(T, T, T, T, T, T, T, T, T) | 33 #define REPEAT_1_TO_9(V, T) REPEAT_1_TO_8(V, T) V(T, T, T, T, T, T, T, T, T) |
34 #define REPEAT_1_TO_10(V, T) REPEAT_1_TO_9(V, T) V(T, T, T, T, T, T, T, T, T, T) | 34 #define REPEAT_1_TO_10(V, T) REPEAT_1_TO_9(V, T) V(T, T, T, T, T, T, T, T, T, T) |
35 #define REPEAT_1_TO_11(V, T) \ | 35 #define REPEAT_1_TO_11(V, T) \ |
36 REPEAT_1_TO_10(V, T) V(T, T, T, T, T, T, T, T, T, T, T) | 36 REPEAT_1_TO_10(V, T) V(T, T, T, T, T, T, T, T, T, T, T) |
| 37 #define REPEAT_1_TO_12(V, T) \ |
| 38 REPEAT_1_TO_11(V, T) V(T, T, T, T, T, T, T, T, T, T, T, T) |
37 | 39 |
38 namespace v8 { | 40 namespace v8 { |
39 namespace internal { | 41 namespace internal { |
40 namespace compiler { | 42 namespace compiler { |
41 | 43 |
42 CodeAssemblerState::CodeAssemblerState( | 44 CodeAssemblerState::CodeAssemblerState( |
43 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, | 45 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, |
44 Code::Flags flags, const char* name, size_t result_size) | 46 Code::Flags flags, const char* name, size_t result_size) |
45 : CodeAssemblerState( | 47 : CodeAssemblerState( |
46 isolate, zone, | 48 isolate, zone, |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 | 625 |
624 Node* nodes[] = {target, args..., context}; | 626 Node* nodes[] = {target, args..., context}; |
625 CHECK_EQ(descriptor.GetParameterCount() + 2, arraysize(nodes)); | 627 CHECK_EQ(descriptor.GetParameterCount() + 2, arraysize(nodes)); |
626 return raw_assembler()->TailCallN(desc, arraysize(nodes), nodes); | 628 return raw_assembler()->TailCallN(desc, arraysize(nodes), nodes); |
627 } | 629 } |
628 | 630 |
629 // Instantiate TailCallStub() for argument counts used by CSA-generated code | 631 // Instantiate TailCallStub() for argument counts used by CSA-generated code |
630 #define INSTANTIATE(...) \ | 632 #define INSTANTIATE(...) \ |
631 template V8_EXPORT_PRIVATE Node* CodeAssembler::TailCallStub( \ | 633 template V8_EXPORT_PRIVATE Node* CodeAssembler::TailCallStub( \ |
632 const CallInterfaceDescriptor& descriptor, Node*, __VA_ARGS__); | 634 const CallInterfaceDescriptor& descriptor, Node*, __VA_ARGS__); |
633 REPEAT_1_TO_11(INSTANTIATE, Node*) | 635 REPEAT_1_TO_12(INSTANTIATE, Node*) |
634 #undef INSTANTIATE | 636 #undef INSTANTIATE |
635 | 637 |
636 template <class... TArgs> | 638 template <class... TArgs> |
637 Node* CodeAssembler::TailCallBytecodeDispatch( | 639 Node* CodeAssembler::TailCallBytecodeDispatch( |
638 const CallInterfaceDescriptor& descriptor, Node* target, TArgs... args) { | 640 const CallInterfaceDescriptor& descriptor, Node* target, TArgs... args) { |
639 DCHECK_EQ(descriptor.GetParameterCount(), sizeof...(args)); | 641 DCHECK_EQ(descriptor.GetParameterCount(), sizeof...(args)); |
640 CallDescriptor* desc = Linkage::GetBytecodeDispatchCallDescriptor( | 642 CallDescriptor* desc = Linkage::GetBytecodeDispatchCallDescriptor( |
641 isolate(), zone(), descriptor, descriptor.GetStackParameterCount()); | 643 isolate(), zone(), descriptor, descriptor.GetStackParameterCount()); |
642 | 644 |
643 Node* nodes[] = {target, args...}; | 645 Node* nodes[] = {target, args...}; |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 } | 884 } |
883 } | 885 } |
884 } | 886 } |
885 | 887 |
886 bound_ = true; | 888 bound_ = true; |
887 } | 889 } |
888 | 890 |
889 } // namespace compiler | 891 } // namespace compiler |
890 } // namespace internal | 892 } // namespace internal |
891 } // namespace v8 | 893 } // namespace v8 |
OLD | NEW |