Commit be8564ba authored by titzer's avatar titzer Committed by Commit bot

Reduce the number of entrypoints to the compiler pipeline by one. Always...

Reduce the number of entrypoints to the compiler pipeline by one. Always require caller to provide a CompilationInfo.

R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1317113004

Cr-Commit-Position: refs/heads/master@{#30433}
parent 0302e63e
......@@ -1177,15 +1177,6 @@ Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
}
Handle<Code> Pipeline::GenerateCodeForTesting(Isolate* isolate,
CallDescriptor* call_descriptor,
Graph* graph,
Schedule* schedule) {
CompilationInfo info("testing", isolate, graph->zone());
return GenerateCodeForTesting(&info, call_descriptor, graph, schedule);
}
Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
CallDescriptor* call_descriptor,
Graph* graph,
......
......@@ -40,23 +40,19 @@ class Pipeline {
Graph* graph,
Schedule* schedule = nullptr);
// Run the pipeline on a machine graph and generate code. If {schedule} is
// {nullptr}, then compute a new schedule for code generation.
static Handle<Code> GenerateCodeForTesting(Isolate* isolate,
CallDescriptor* call_descriptor,
Graph* graph,
Schedule* schedule = nullptr);
// Run just the register allocator phases.
static bool AllocateRegistersForTesting(const RegisterConfiguration* config,
InstructionSequence* sequence,
bool run_verifier);
private:
// Run the pipeline on a machine graph and generate code. If {schedule} is
// {nullptr}, then compute a new schedule for code generation.
static Handle<Code> GenerateCodeForTesting(CompilationInfo* info,
CallDescriptor* call_descriptor,
Graph* graph, Schedule* schedule);
Graph* graph,
Schedule* schedule = nullptr);
private:
CompilationInfo* info_;
PipelineData* data_;
......
......@@ -58,8 +58,9 @@ class RawMachineAssemblerTester : public HandleAndZoneScope,
Schedule* schedule = this->Export();
CallDescriptor* call_descriptor = this->call_descriptor();
Graph* graph = this->graph();
code_ = Pipeline::GenerateCodeForTesting(this->isolate(), call_descriptor,
graph, schedule);
CompilationInfo info("testing", main_isolate(), main_zone());
code_ = Pipeline::GenerateCodeForTesting(&info, call_descriptor, graph,
schedule);
}
return this->code_.ToHandleChecked()->entry();
}
......
......@@ -273,7 +273,8 @@ class GraphBuilderTester : public HandleAndZoneScope,
Zone* zone = graph()->zone();
CallDescriptor* desc =
Linkage::GetSimplifiedCDescriptor(zone, this->csig_);
code_ = Pipeline::GenerateCodeForTesting(main_isolate(), desc, graph());
CompilationInfo info("testing", main_isolate(), main_zone());
code_ = Pipeline::GenerateCodeForTesting(&info, desc, graph());
#ifdef ENABLE_DISASSEMBLER
if (!code_.is_null() && FLAG_print_opt_code) {
OFStream os(stdout);
......
......@@ -244,8 +244,9 @@ class Int32Signature : public MachineSignature {
Handle<Code> CompileGraph(const char* name, CallDescriptor* desc, Graph* graph,
Schedule* schedule = nullptr) {
Isolate* isolate = CcTest::InitIsolateOnce();
CompilationInfo info("testing", isolate, graph->zone());
Handle<Code> code =
Pipeline::GenerateCodeForTesting(isolate, desc, graph, schedule);
Pipeline::GenerateCodeForTesting(&info, desc, graph, schedule);
CHECK(!code.is_null());
#ifdef ENABLE_DISASSEMBLER
if (FLAG_print_opt_code) {
......
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