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/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 static Handle<Code> GenerateCodeForTesting(Isolate* isolate, | 39 static Handle<Code> GenerateCodeForTesting(Isolate* isolate, |
40 CallDescriptor* call_descriptor, | 40 CallDescriptor* call_descriptor, |
41 Graph* graph, | 41 Graph* graph, |
42 Schedule* schedule = nullptr); | 42 Schedule* schedule = nullptr); |
43 | 43 |
44 // Run just the register allocator phases. | 44 // Run just the register allocator phases. |
45 static bool AllocateRegistersForTesting(const RegisterConfiguration* config, | 45 static bool AllocateRegistersForTesting(const RegisterConfiguration* config, |
46 InstructionSequence* sequence, | 46 InstructionSequence* sequence, |
47 bool run_verifier); | 47 bool run_verifier); |
48 | 48 |
49 static inline bool SupportedBackend() { return V8_TURBOFAN_BACKEND != 0; } | |
50 static inline bool SupportedTarget() { return V8_TURBOFAN_TARGET != 0; } | |
51 | |
52 private: | 49 private: |
53 static Handle<Code> GenerateCodeForTesting(CompilationInfo* info, | 50 static Handle<Code> GenerateCodeForTesting(CompilationInfo* info, |
54 CallDescriptor* call_descriptor, | 51 CallDescriptor* call_descriptor, |
55 Graph* graph, Schedule* schedule); | 52 Graph* graph, Schedule* schedule); |
56 | 53 |
57 CompilationInfo* info_; | 54 CompilationInfo* info_; |
58 PipelineData* data_; | 55 PipelineData* data_; |
59 | 56 |
60 // Helpers for executing pipeline phases. | 57 // Helpers for executing pipeline phases. |
61 template <typename Phase> | 58 template <typename Phase> |
62 void Run(); | 59 void Run(); |
63 template <typename Phase, typename Arg0> | 60 template <typename Phase, typename Arg0> |
64 void Run(Arg0 arg_0); | 61 void Run(Arg0 arg_0); |
65 | 62 |
66 CompilationInfo* info() const { return info_; } | 63 CompilationInfo* info() const { return info_; } |
67 Isolate* isolate() { return info_->isolate(); } | 64 Isolate* isolate() { return info_->isolate(); } |
68 | 65 |
69 void BeginPhaseKind(const char* phase_kind); | 66 void BeginPhaseKind(const char* phase_kind); |
70 void RunPrintAndVerify(const char* phase, bool untyped = false); | 67 void RunPrintAndVerify(const char* phase, bool untyped = false); |
71 Handle<Code> ScheduleAndGenerateCode(CallDescriptor* call_descriptor); | 68 Handle<Code> ScheduleAndGenerateCode(CallDescriptor* call_descriptor); |
72 void AllocateRegisters(const RegisterConfiguration* config, | 69 void AllocateRegisters(const RegisterConfiguration* config, |
73 bool run_verifier); | 70 bool run_verifier); |
74 }; | 71 }; |
75 | 72 |
76 } // namespace compiler | 73 } // namespace compiler |
77 } // namespace internal | 74 } // namespace internal |
78 } // namespace v8 | 75 } // namespace v8 |
79 | 76 |
80 #endif // V8_COMPILER_PIPELINE_H_ | 77 #endif // V8_COMPILER_PIPELINE_H_ |
OLD | NEW |