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,
return pipeline_statistics;
}
} // namespace
class PipelineCompilationJob final : public CompilationJob {
public:
PipelineCompilationJob(Isolate* isolate, Handle<JSFunction> function)
......@@ -587,8 +589,6 @@ PipelineCompilationJob::Status PipelineCompilationJob::GenerateCodeImpl() {
return SUCCEEDED;
}
} // namespace
class PipelineWasmCompilationJob final : public CompilationJob {
public:
explicit PipelineWasmCompilationJob(CompilationInfo* info, Graph* graph,
......
......@@ -28,19 +28,13 @@ class SourcePositionTable;
class Pipeline {
public:
explicit Pipeline(PipelineData* data) : data_(data) {}
// 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);
// Returns a new compilation job for the given function.
static CompilationJob* NewCompilationJob(Handle<JSFunction> function);
// Run the entire pipeline and generate a handle to a code object.
Handle<Code> GenerateCode();
// Returns a new compilation job for the WebAssembly compilation info.
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
// be valid, hence the given {graph} does not need to be schedulable.
......@@ -72,19 +66,12 @@ class Pipeline {
Graph* graph,
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:
// The wasm compilation job calls ScheduleAndSelectInstructions and
// RunPrintAndVerify, so we make it a member class.
friend class PipelineCompilationJob;
friend class PipelineWasmCompilationJob;
explicit Pipeline(PipelineData* data) : data_(data) {}
// Helpers for executing pipeline phases.
template <typename Phase>
void Run();
......@@ -93,6 +80,18 @@ class Pipeline {
template <typename Phase, typename Arg0, typename Arg1>
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 EndPhaseKind();
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