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
3 // found in the LICENSE file.
5 #ifndef V8_COMPILER_PIPELINE_H_
6 #define V8_COMPILER_PIPELINE_H_
10 #include "src/compiler.h"
12 // Note: TODO(turbofan) implies a performance improvement opportunity,
13 // and TODO(name) implies an incomplete implementation
19 // Clients of this interface shouldn't depend on lots of compiler internals.
23 class SourcePositionTable;
28 explicit Pipeline(CompilationInfo* info) : info_(info) {}
30 // Run the entire pipeline and generate a handle to a code object.
31 Handle<Code> GenerateCode();
33 // Run the pipeline on a machine graph and generate code. If {schedule}
34 // is {NULL}, then compute a new schedule for code generation.
35 Handle<Code> GenerateCodeForMachineGraph(Linkage* linkage, Graph* graph,
36 Schedule* schedule = NULL);
38 CompilationInfo* info() const { return info_; }
39 Zone* zone() { return info_->zone(); }
40 Isolate* isolate() { return info_->isolate(); }
42 static inline bool SupportedBackend() { return V8_TURBOFAN_BACKEND != 0; }
43 static inline bool SupportedTarget() { return V8_TURBOFAN_TARGET != 0; }
45 static inline bool VerifyGraphs() {
49 return FLAG_turbo_verify;
54 static void TearDown();
57 CompilationInfo* info_;
59 Schedule* ComputeSchedule(Graph* graph);
60 void VerifyAndPrintGraph(Graph* graph, const char* phase);
61 Handle<Code> GenerateCode(Linkage* linkage, Graph* graph, Schedule* schedule,
62 SourcePositionTable* source_positions);
66 } // namespace v8::internal::compiler
68 #endif // V8_COMPILER_PIPELINE_H_