OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef V8_COMPILER_PIPELINE_H_ |
| 6 #define V8_COMPILER_PIPELINE_H_ |
| 7 |
| 8 #include "src/v8.h" |
| 9 |
| 10 #include "src/compiler.h" |
| 11 |
| 12 // Note: TODO(turbofan) implies a performance improvement opportunity, |
| 13 // and TODO(name) implies an incomplete implementation |
| 14 |
| 15 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64 || \ |
| 16 V8_TARGET_ARCH_ARM |
| 17 #define V8_TURBOFAN_TARGET 1 |
| 18 #else |
| 19 #define V8_TURBOFAN_TARGET 0 |
| 20 #endif |
| 21 |
| 22 namespace v8 { |
| 23 namespace internal { |
| 24 namespace compiler { |
| 25 |
| 26 // Clients of this interface shouldn't depend on lots of compiler internals. |
| 27 class CallDescriptor; |
| 28 class Graph; |
| 29 class Schedule; |
| 30 class SourcePositionTable; |
| 31 class Linkage; |
| 32 |
| 33 class Pipeline { |
| 34 public: |
| 35 explicit Pipeline(CompilationInfo* info) : info_(info) {} |
| 36 |
| 37 // Run the entire pipeline and generate a handle to a code object. |
| 38 Handle<Code> GenerateCode(); |
| 39 |
| 40 // Run the pipeline on a machine graph and generate code. If {schedule} |
| 41 // is {NULL}, then compute a new schedule for code generation. |
| 42 Handle<Code> GenerateCodeForMachineGraph(Linkage* linkage, Graph* graph, |
| 43 Schedule* schedule = NULL); |
| 44 |
| 45 CompilationInfo* info() const { return info_; } |
| 46 Zone* zone() { return info_->zone(); } |
| 47 Isolate* isolate() { return info_->isolate(); } |
| 48 |
| 49 static inline bool SupportedTarget() { return V8_TURBOFAN_TARGET != 0; } |
| 50 |
| 51 static inline bool VerifyGraphs() { |
| 52 #ifdef DEBUG |
| 53 return true; |
| 54 #else |
| 55 return FLAG_turbo_verify; |
| 56 #endif |
| 57 } |
| 58 |
| 59 private: |
| 60 CompilationInfo* info_; |
| 61 |
| 62 Schedule* ComputeSchedule(Graph* graph); |
| 63 void VerifyAndPrintGraph(Graph* graph, const char* phase); |
| 64 Handle<Code> GenerateCode(Linkage* linkage, Graph* graph, Schedule* schedule, |
| 65 SourcePositionTable* source_positions); |
| 66 }; |
| 67 } |
| 68 } |
| 69 } // namespace v8::internal::compiler |
| 70 |
| 71 #endif // V8_COMPILER_PIPELINE_H_ |
OLD | NEW |