Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Unified Diff: src/compiler/pipeline.cc

Issue 727373002: [turbofan] add ForTesting to pipeline entry points that are for testing only. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/pipeline.h ('k') | test/cctest/compiler/codegen-tester.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index de4320ae7969c42a251b8792b880c1cbbeb42215..4c767019921842f232b2bb8045960beb0629857e 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -91,15 +91,15 @@ class PipelineData {
}
// For machine graph testing entry point.
- void Initialize(Graph* graph, Schedule* schedule) {
+ void InitializeTorTesting(Graph* graph, Schedule* schedule) {
graph_ = graph;
source_positions_.Reset(new SourcePositionTable(graph));
schedule_ = schedule;
instruction_zone_ = instruction_zone_scope_.zone();
}
- // For register allocation entry point.
- void Initialize(InstructionSequence* sequence) {
+ // For register allocation testing entry point.
+ void InitializeTorTesting(InstructionSequence* sequence) {
instruction_zone_ = sequence->zone();
sequence_ = sequence;
}
@@ -778,28 +778,48 @@ Handle<Code> Pipeline::GenerateCode() {
}
-Handle<Code> Pipeline::GenerateCodeForMachineGraph(Linkage* linkage,
- Graph* graph,
- Schedule* schedule) {
- ZonePool zone_pool(isolate());
+Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
+ Graph* graph,
+ Schedule* schedule) {
+ CallDescriptor* call_descriptor =
+ Linkage::ComputeIncoming(info->zone(), info);
+ return GenerateCodeForTesting(info, call_descriptor, graph, schedule);
+}
+
+
+Handle<Code> Pipeline::GenerateCodeForTesting(CallDescriptor* call_descriptor,
+ Graph* graph,
+ Schedule* schedule) {
+ CompilationInfo info(graph->zone()->isolate(), graph->zone());
+ return GenerateCodeForTesting(&info, call_descriptor, graph, schedule);
+}
+
+
+Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
+ CallDescriptor* call_descriptor,
+ Graph* graph,
+ Schedule* schedule) {
CHECK(SupportedBackend());
- PipelineData data(&zone_pool, info());
- data.Initialize(graph, schedule);
- this->data_ = &data;
+ ZonePool zone_pool(info->isolate());
+ Pipeline pipeline(info);
+ PipelineData data(&zone_pool, info);
+ pipeline.data_ = &data;
+ data.InitializeTorTesting(graph, schedule);
if (schedule == NULL) {
// TODO(rossberg): Should this really be untyped?
- RunPrintAndVerify("Machine", true);
- Run<ComputeSchedulePhase>();
+ pipeline.RunPrintAndVerify("Machine", true);
+ pipeline.Run<ComputeSchedulePhase>();
} else {
TraceSchedule(schedule);
}
- GenerateCode(linkage);
+ Linkage linkage(info->zone(), call_descriptor);
+ pipeline.GenerateCode(&linkage);
Handle<Code> code = data.code();
#if ENABLE_DISASSEMBLER
if (!code.is_null() && FLAG_print_opt_code) {
- CodeTracer::Scope tracing_scope(isolate()->GetCodeTracer());
+ CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer());
OFStream os(tracing_scope.file());
code->Disassemble("test code", os);
}
@@ -808,13 +828,13 @@ Handle<Code> Pipeline::GenerateCodeForMachineGraph(Linkage* linkage,
}
-bool Pipeline::AllocateRegisters(const RegisterConfiguration* config,
- InstructionSequence* sequence,
- bool run_verifier) {
+bool Pipeline::AllocateRegistersForTesting(const RegisterConfiguration* config,
+ InstructionSequence* sequence,
+ bool run_verifier) {
CompilationInfo info(sequence->zone()->isolate(), sequence->zone());
ZonePool zone_pool(sequence->zone()->isolate());
PipelineData data(&zone_pool, &info);
- data.Initialize(sequence);
+ data.InitializeTorTesting(sequence);
Pipeline pipeline(&info);
pipeline.data_ = &data;
pipeline.AllocateRegisters(config, run_verifier);
« no previous file with comments | « src/compiler/pipeline.h ('k') | test/cctest/compiler/codegen-tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698