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" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 static Handle<Code> GenerateCodeForTesting(CompilationInfo* info, | 58 static Handle<Code> GenerateCodeForTesting(CompilationInfo* info, |
59 CallDescriptor* call_descriptor, | 59 CallDescriptor* call_descriptor, |
60 Graph* graph, | 60 Graph* graph, |
61 Schedule* schedule = nullptr); | 61 Schedule* schedule = nullptr); |
62 | 62 |
63 // Returns a new compilation job for the given compilation info. | 63 // Returns a new compilation job for the given compilation info. |
64 static OptimizedCompileJob* NewCompilationJob(CompilationInfo* info); | 64 static OptimizedCompileJob* NewCompilationJob(CompilationInfo* info); |
65 | 65 |
66 void InitializeWasmCompilation(Zone* pipeline_zone, ZonePool* zone_pool, | 66 void InitializeWasmCompilation(Zone* pipeline_zone, ZonePool* zone_pool, |
67 Graph* graph); | 67 Graph* graph); |
68 void FinalizeWasmCompilation(); | 68 bool ExecuteWasmCompilation(CallDescriptor* descriptor); |
69 | 69 Handle<Code> FinalizeWasmCompilation(CallDescriptor* descriptor); |
70 Handle<Code> ScheduleAndGenerateCode(CallDescriptor* call_descriptor); | |
71 | 70 |
72 private: | 71 private: |
73 // Helpers for executing pipeline phases. | 72 // Helpers for executing pipeline phases. |
74 template <typename Phase> | 73 template <typename Phase> |
75 void Run(); | 74 void Run(); |
76 template <typename Phase, typename Arg0> | 75 template <typename Phase, typename Arg0> |
77 void Run(Arg0 arg_0); | 76 void Run(Arg0 arg_0); |
78 template <typename Phase, typename Arg0, typename Arg1> | 77 template <typename Phase, typename Arg0, typename Arg1> |
79 void Run(Arg0 arg_0, Arg1 arg_1); | 78 void Run(Arg0 arg_0, Arg1 arg_1); |
80 | 79 |
81 void BeginPhaseKind(const char* phase_kind); | 80 void BeginPhaseKind(const char* phase_kind); |
82 void RunPrintAndVerify(const char* phase, bool untyped = false); | 81 void RunPrintAndVerify(const char* phase, bool untyped = false); |
83 void AllocateRegisters(const RegisterConfiguration* config, | 82 void AllocateRegisters(const RegisterConfiguration* config, |
84 CallDescriptor* descriptor, bool run_verifier); | 83 CallDescriptor* descriptor, bool run_verifier); |
85 | 84 bool ScheduleGraph(CallDescriptor* call_descriptor); |
| 85 Handle<Code> GenerateCode(CallDescriptor* descriptor); |
| 86 Handle<Code> ScheduleAndGenerateCode(CallDescriptor* call_descriptor); |
86 CompilationInfo* info() const { return info_; } | 87 CompilationInfo* info() const { return info_; } |
87 Isolate* isolate() const; | 88 Isolate* isolate() const; |
88 | 89 |
89 CompilationInfo* const info_; | 90 CompilationInfo* const info_; |
90 PipelineData* data_; | 91 PipelineData* data_; |
91 | 92 |
92 DISALLOW_COPY_AND_ASSIGN(Pipeline); | 93 DISALLOW_COPY_AND_ASSIGN(Pipeline); |
93 }; | 94 }; |
94 | 95 |
95 } // namespace compiler | 96 } // namespace compiler |
96 } // namespace internal | 97 } // namespace internal |
97 } // namespace v8 | 98 } // namespace v8 |
98 | 99 |
99 #endif // V8_COMPILER_PIPELINE_H_ | 100 #endif // V8_COMPILER_PIPELINE_H_ |
OLD | NEW |