Commit 3394e889 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Make Pipeline more private.

By now the Pipeline class can no longer be used to construct instances
from the outside. The constructor and all non-exposed helpers can be
made private.

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/1943243003
Cr-Commit-Position: refs/heads/master@{#35978}
parent 6df9379c
...@@ -505,6 +505,8 @@ PipelineStatistics* CreatePipelineStatistics(CompilationInfo* info, ...@@ -505,6 +505,8 @@ PipelineStatistics* CreatePipelineStatistics(CompilationInfo* info,
return pipeline_statistics; return pipeline_statistics;
} }
} // namespace
class PipelineCompilationJob final : public CompilationJob { class PipelineCompilationJob final : public CompilationJob {
public: public:
PipelineCompilationJob(Isolate* isolate, Handle<JSFunction> function) PipelineCompilationJob(Isolate* isolate, Handle<JSFunction> function)
...@@ -587,8 +589,6 @@ PipelineCompilationJob::Status PipelineCompilationJob::GenerateCodeImpl() { ...@@ -587,8 +589,6 @@ PipelineCompilationJob::Status PipelineCompilationJob::GenerateCodeImpl() {
return SUCCEEDED; return SUCCEEDED;
} }
} // namespace
class PipelineWasmCompilationJob final : public CompilationJob { class PipelineWasmCompilationJob final : public CompilationJob {
public: public:
explicit PipelineWasmCompilationJob(CompilationInfo* info, Graph* graph, explicit PipelineWasmCompilationJob(CompilationInfo* info, Graph* graph,
......
...@@ -28,19 +28,13 @@ class SourcePositionTable; ...@@ -28,19 +28,13 @@ class SourcePositionTable;
class Pipeline { class Pipeline {
public: public:
explicit Pipeline(PipelineData* data) : data_(data) {} // Returns a new compilation job for the given function.
static CompilationJob* NewCompilationJob(Handle<JSFunction> function);
// Run the graph creation and initial optimization passes.
bool CreateGraph();
// Run the concurrent optimization passes.
bool OptimizeGraph(Linkage* linkage);
// Perform the actual code generation and return handle to a code object.
Handle<Code> GenerateCode(Linkage* linkage);
// Run the entire pipeline and generate a handle to a code object. // Returns a new compilation job for the WebAssembly compilation info.
Handle<Code> GenerateCode(); static CompilationJob* NewWasmCompilationJob(
CompilationInfo* info, Graph* graph, CallDescriptor* descriptor,
SourcePositionTable* source_positions);
// Run the pipeline on a machine graph and generate code. The {schedule} must // Run the pipeline on a machine graph and generate code. The {schedule} must
// be valid, hence the given {graph} does not need to be schedulable. // be valid, hence the given {graph} does not need to be schedulable.
...@@ -72,19 +66,12 @@ class Pipeline { ...@@ -72,19 +66,12 @@ class Pipeline {
Graph* graph, Graph* graph,
Schedule* schedule = nullptr); Schedule* schedule = nullptr);
// Returns a new compilation job for the given function.
static CompilationJob* NewCompilationJob(Handle<JSFunction> function);
// Returns a new compilation job for the WebAssembly compilation info.
static CompilationJob* NewWasmCompilationJob(
CompilationInfo* info, Graph* graph, CallDescriptor* descriptor,
SourcePositionTable* source_positions);
private: private:
// The wasm compilation job calls ScheduleAndSelectInstructions and friend class PipelineCompilationJob;
// RunPrintAndVerify, so we make it a member class.
friend class PipelineWasmCompilationJob; friend class PipelineWasmCompilationJob;
explicit Pipeline(PipelineData* data) : data_(data) {}
// Helpers for executing pipeline phases. // Helpers for executing pipeline phases.
template <typename Phase> template <typename Phase>
void Run(); void Run();
...@@ -93,6 +80,18 @@ class Pipeline { ...@@ -93,6 +80,18 @@ class Pipeline {
template <typename Phase, typename Arg0, typename Arg1> template <typename Phase, typename Arg0, typename Arg1>
void Run(Arg0 arg_0, Arg1 arg_1); void Run(Arg0 arg_0, Arg1 arg_1);
// Run the graph creation and initial optimization passes.
bool CreateGraph();
// Run the concurrent optimization passes.
bool OptimizeGraph(Linkage* linkage);
// Perform the actual code generation and return handle to a code object.
Handle<Code> GenerateCode(Linkage* linkage);
// Run the entire pipeline and generate a handle to a code object.
Handle<Code> GenerateCode();
void BeginPhaseKind(const char* phase_kind); void BeginPhaseKind(const char* phase_kind);
void EndPhaseKind(); void EndPhaseKind();
bool ScheduleAndSelectInstructions(Linkage* linkage); bool ScheduleAndSelectInstructions(Linkage* linkage);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment