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 #include <fstream> // NOLINT(readability/streams) | 8 #include <fstream> // NOLINT(readability/streams) |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
11 | 11 |
12 #include "src/compiler.h" | 12 #include "src/compiler.h" |
13 | 13 |
14 // Note: TODO(turbofan) implies a performance improvement opportunity, | 14 // Note: TODO(turbofan) implies a performance improvement opportunity, |
15 // and TODO(name) implies an incomplete implementation | 15 // and TODO(name) implies an incomplete implementation |
16 | 16 |
17 namespace v8 { | 17 namespace v8 { |
18 namespace internal { | 18 namespace internal { |
19 namespace compiler { | 19 namespace compiler { |
20 | 20 |
21 // Clients of this interface shouldn't depend on lots of compiler internals. | 21 // Clients of this interface shouldn't depend on lots of compiler internals. |
22 class Graph; | 22 class Graph; |
23 class InstructionSequence; | 23 class InstructionSequence; |
24 class Linkage; | 24 class Linkage; |
25 class PipelineStatistics; | 25 class PipelineStatistics; |
26 class RegisterAllocator; | 26 class RegisterAllocator; |
27 class Schedule; | 27 class Schedule; |
28 class SourcePositionTable; | 28 class SourcePositionTable; |
29 class ZonePool; | 29 class PipelineData; |
Michael Starzinger
2014/10/23 12:18:36
nit: Please alpha-sort.
| |
30 | 30 |
31 class Pipeline { | 31 class Pipeline { |
32 public: | 32 public: |
33 explicit Pipeline(CompilationInfo* info) : info_(info) {} | 33 explicit Pipeline(CompilationInfo* info) : info_(info) {} |
34 | 34 |
35 // 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. |
36 Handle<Code> GenerateCode(); | 36 Handle<Code> GenerateCode(); |
37 | 37 |
38 // Run the pipeline on a machine graph and generate code. If {schedule} | 38 // Run the pipeline on a machine graph and generate code. If {schedule} |
39 // is {NULL}, then compute a new schedule for code generation. | 39 // is {NULL}, then compute a new schedule for code generation. |
40 Handle<Code> GenerateCodeForMachineGraph(Linkage* linkage, Graph* graph, | 40 Handle<Code> GenerateCodeForMachineGraph(Linkage* linkage, Graph* graph, |
41 Schedule* schedule = NULL); | 41 Schedule* schedule = NULL); |
42 | 42 |
43 static inline bool SupportedBackend() { return V8_TURBOFAN_BACKEND != 0; } | 43 static inline bool SupportedBackend() { return V8_TURBOFAN_BACKEND != 0; } |
44 static inline bool SupportedTarget() { return V8_TURBOFAN_TARGET != 0; } | 44 static inline bool SupportedTarget() { return V8_TURBOFAN_TARGET != 0; } |
45 | 45 |
46 static void SetUp(); | 46 static void SetUp(); |
47 static void TearDown(); | 47 static void TearDown(); |
48 | 48 |
49 private: | 49 private: |
50 CompilationInfo* info_; | 50 CompilationInfo* info_; |
51 | 51 |
52 CompilationInfo* info() const { return info_; } | 52 CompilationInfo* info() const { return info_; } |
53 Isolate* isolate() { return info_->isolate(); } | 53 Isolate* isolate() { return info_->isolate(); } |
54 Zone* zone() { return info_->zone(); } | |
55 | 54 |
56 Schedule* ComputeSchedule(ZonePool* zone_pool, Graph* graph); | 55 void ComputeSchedule(PipelineData* data); |
57 void OpenTurboCfgFile(std::ofstream* stream); | 56 void OpenTurboCfgFile(std::ofstream* stream); |
58 void PrintCompilationStart(); | 57 void PrintCompilationStart(); |
59 void PrintScheduleAndInstructions(const char* phase, const Schedule* schedule, | 58 void PrintScheduleAndInstructions(const char* phase, const Schedule* schedule, |
60 const SourcePositionTable* positions, | 59 const SourcePositionTable* positions, |
61 const InstructionSequence* instructions); | 60 const InstructionSequence* instructions); |
62 void PrintAllocator(const char* phase, const RegisterAllocator* allocator); | 61 void PrintAllocator(const char* phase, const RegisterAllocator* allocator); |
63 void VerifyAndPrintGraph(Graph* graph, const char* phase, | 62 void VerifyAndPrintGraph(Graph* graph, const char* phase, |
64 bool untyped = false); | 63 bool untyped = false); |
65 Handle<Code> GenerateCode(PipelineStatistics* pipeline_statistics, | 64 Handle<Code> GenerateCode(Linkage* linkage, PipelineData* data); |
66 ZonePool* zone_pool, Linkage* linkage, Graph* graph, | |
67 Schedule* schedule, | |
68 SourcePositionTable* source_positions); | |
69 }; | 65 }; |
70 } | 66 } |
71 } | 67 } |
72 } // namespace v8::internal::compiler | 68 } // namespace v8::internal::compiler |
73 | 69 |
74 #endif // V8_COMPILER_PIPELINE_H_ | 70 #endif // V8_COMPILER_PIPELINE_H_ |
OLD | NEW |