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_COMPILER_PIPELINE_H_ | 5 #ifndef V8_COMPILER_PIPELINE_H_ |
6 #define V8_COMPILER_PIPELINE_H_ | 6 #define V8_COMPILER_PIPELINE_H_ |
7 | 7 |
8 // Clients of this interface shouldn't depend on lots of compiler internals. | 8 // Clients of this interface shouldn't depend on lots of compiler internals. |
9 // Do not include anything from src/compiler here! | 9 // Do not include anything from src/compiler here! |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
15 class CompilationInfo; | 15 class CompilationInfo; |
16 class OptimizedCompileJob; | 16 class OptimizedCompileJob; |
17 class RegisterConfiguration; | 17 class RegisterConfiguration; |
18 class Zone; | 18 class Zone; |
19 | 19 |
20 namespace compiler { | 20 namespace compiler { |
21 | 21 |
22 class CallDescriptor; | 22 class CallDescriptor; |
23 class Graph; | 23 class Graph; |
24 class InstructionSequence; | 24 class InstructionSequence; |
25 class Linkage; | 25 class Linkage; |
26 class PipelineData; | 26 class PipelineData; |
27 class Schedule; | 27 class Schedule; |
| 28 class SourcePositionTable; |
28 class ZonePool; | 29 class ZonePool; |
29 | 30 |
30 class Pipeline { | 31 class Pipeline { |
31 public: | 32 public: |
32 explicit Pipeline(CompilationInfo* info) : info_(info), data_(nullptr) {} | 33 explicit Pipeline(CompilationInfo* info) : info_(info), data_(nullptr) {} |
33 | 34 |
34 // Run the entire pipeline and generate a handle to a code object. | 35 // Run the entire pipeline and generate a handle to a code object. |
35 Handle<Code> GenerateCode(); | 36 Handle<Code> GenerateCode(); |
36 | 37 |
37 // Run the pipeline on a machine graph and generate code. The {schedule} must | 38 // Run the pipeline on a machine graph and generate code. The {schedule} must |
(...skipping 19 matching lines...) Expand all Loading... |
57 // {nullptr}, then compute a new schedule for code generation. | 58 // {nullptr}, then compute a new schedule for code generation. |
58 static Handle<Code> GenerateCodeForTesting(CompilationInfo* info, | 59 static Handle<Code> GenerateCodeForTesting(CompilationInfo* info, |
59 CallDescriptor* call_descriptor, | 60 CallDescriptor* call_descriptor, |
60 Graph* graph, | 61 Graph* graph, |
61 Schedule* schedule = nullptr); | 62 Schedule* schedule = nullptr); |
62 | 63 |
63 // Returns a new compilation job for the given compilation info. | 64 // Returns a new compilation job for the given compilation info. |
64 static OptimizedCompileJob* NewCompilationJob(CompilationInfo* info); | 65 static OptimizedCompileJob* NewCompilationJob(CompilationInfo* info); |
65 | 66 |
66 void InitializeWasmCompilation(Zone* pipeline_zone, ZonePool* zone_pool, | 67 void InitializeWasmCompilation(Zone* pipeline_zone, ZonePool* zone_pool, |
67 Graph* graph); | 68 Graph* graph, |
| 69 SourcePositionTable* source_positions); |
68 bool ExecuteWasmCompilation(CallDescriptor* descriptor); | 70 bool ExecuteWasmCompilation(CallDescriptor* descriptor); |
69 Handle<Code> FinalizeWasmCompilation(CallDescriptor* descriptor); | 71 Handle<Code> FinalizeWasmCompilation(CallDescriptor* descriptor); |
70 | 72 |
71 private: | 73 private: |
72 // Helpers for executing pipeline phases. | 74 // Helpers for executing pipeline phases. |
73 template <typename Phase> | 75 template <typename Phase> |
74 void Run(); | 76 void Run(); |
75 template <typename Phase, typename Arg0> | 77 template <typename Phase, typename Arg0> |
76 void Run(Arg0 arg_0); | 78 void Run(Arg0 arg_0); |
77 template <typename Phase, typename Arg0, typename Arg1> | 79 template <typename Phase, typename Arg0, typename Arg1> |
(...skipping 13 matching lines...) Expand all Loading... |
91 PipelineData* data_; | 93 PipelineData* data_; |
92 | 94 |
93 DISALLOW_COPY_AND_ASSIGN(Pipeline); | 95 DISALLOW_COPY_AND_ASSIGN(Pipeline); |
94 }; | 96 }; |
95 | 97 |
96 } // namespace compiler | 98 } // namespace compiler |
97 } // namespace internal | 99 } // namespace internal |
98 } // namespace v8 | 100 } // namespace v8 |
99 | 101 |
100 #endif // V8_COMPILER_PIPELINE_H_ | 102 #endif // V8_COMPILER_PIPELINE_H_ |
OLD | NEW |