| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 Graph* graph, | 45 Graph* graph, |
| 46 Schedule* schedule = nullptr); | 46 Schedule* schedule = nullptr); |
| 47 | 47 |
| 48 // Run just the register allocator phases. | 48 // Run just the register allocator phases. |
| 49 static bool AllocateRegistersForTesting(const RegisterConfiguration* config, | 49 static bool AllocateRegistersForTesting(const RegisterConfiguration* config, |
| 50 InstructionSequence* sequence, | 50 InstructionSequence* sequence, |
| 51 bool run_verifier); | 51 bool run_verifier); |
| 52 | 52 |
| 53 // Run the pipeline on a machine graph and generate code. If {schedule} is | 53 // Run the pipeline on a machine graph and generate code. If {schedule} is |
| 54 // {nullptr}, then compute a new schedule for code generation. | 54 // {nullptr}, then compute a new schedule for code generation. |
| 55 static Handle<Code> GenerateCodeForTesting(CompilationInfo* info, | 55 static Handle<Code> GenerateCodeForTesting( |
| 56 CallDescriptor* call_descriptor, | 56 CompilationInfo* info, const CallDescriptor* call_descriptor, |
| 57 Graph* graph, | 57 Graph* graph, Schedule* schedule = nullptr); |
| 58 Schedule* schedule = nullptr); | |
| 59 | 58 |
| 60 private: | 59 private: |
| 61 // Helpers for executing pipeline phases. | 60 // Helpers for executing pipeline phases. |
| 62 template <typename Phase> | 61 template <typename Phase> |
| 63 void Run(); | 62 void Run(); |
| 64 template <typename Phase, typename Arg0> | 63 template <typename Phase, typename Arg0> |
| 65 void Run(Arg0 arg_0); | 64 void Run(Arg0 arg_0); |
| 66 template <typename Phase, typename Arg0, typename Arg1> | 65 template <typename Phase, typename Arg0, typename Arg1> |
| 67 void Run(Arg0 arg_0, Arg1 arg_1); | 66 void Run(Arg0 arg_0, Arg1 arg_1); |
| 68 | 67 |
| 69 void BeginPhaseKind(const char* phase_kind); | 68 void BeginPhaseKind(const char* phase_kind); |
| 70 void RunPrintAndVerify(const char* phase, bool untyped = false); | 69 void RunPrintAndVerify(const char* phase, bool untyped = false); |
| 71 Handle<Code> ScheduleAndGenerateCode(CallDescriptor* call_descriptor); | 70 Handle<Code> ScheduleAndGenerateCode(const CallDescriptor* call_descriptor); |
| 72 void AllocateRegisters(const RegisterConfiguration* config, | 71 void AllocateRegisters(const RegisterConfiguration* config, |
| 73 CallDescriptor* descriptor, bool run_verifier); | 72 const CallDescriptor* descriptor, bool run_verifier); |
| 74 | 73 |
| 75 CompilationInfo* info() const { return info_; } | 74 CompilationInfo* info() const { return info_; } |
| 76 Isolate* isolate() const; | 75 Isolate* isolate() const; |
| 77 | 76 |
| 78 CompilationInfo* const info_; | 77 CompilationInfo* const info_; |
| 79 PipelineData* data_; | 78 PipelineData* data_; |
| 80 | 79 |
| 81 DISALLOW_COPY_AND_ASSIGN(Pipeline); | 80 DISALLOW_COPY_AND_ASSIGN(Pipeline); |
| 82 }; | 81 }; |
| 83 | 82 |
| 84 } // namespace compiler | 83 } // namespace compiler |
| 85 } // namespace internal | 84 } // namespace internal |
| 86 } // namespace v8 | 85 } // namespace v8 |
| 87 | 86 |
| 88 #endif // V8_COMPILER_PIPELINE_H_ | 87 #endif // V8_COMPILER_PIPELINE_H_ |
| OLD | NEW |