Reduce the number of entrypoints to the compiler pipeline by one. Always require...
authortitzer <titzer@chromium.org>
Fri, 28 Aug 2015 09:02:09 +0000 (02:02 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 28 Aug 2015 09:02:19 +0000 (09:02 +0000)
R=mstarzinger@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#30433}

src/compiler/pipeline.cc
src/compiler/pipeline.h
test/cctest/compiler/codegen-tester.h
test/cctest/compiler/graph-builder-tester.h
test/cctest/compiler/test-run-native-calls.cc

index 50d14959213381bdd4da5514cac40f75d635a45d..1cbd1594195c198882cd305a0e58e02729b43479 100644 (file)
@@ -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,
index 4e3635d0f69c5b98009b1f3063c4a61c421a1958..90c223f67ea6ef0529f934d264d1cd706a40cb9a 100644 (file)
@@ -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_;
 
index d8ecc02fc24ca1af9542be2e3c856578cf0efd51..41a19a15320bba6c5da9b60a4de2993e0da715c1 100644 (file)
@@ -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();
   }
index 41c1e384be72f646bd9e331c8e56ac5080373287..de7d20c34b4d2f59d7a6682df05019eb81be1122 100644 (file)
@@ -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);
index 2e255c7729c6c400be1b82def3891103bb327fce..9ab15c4578bd660f83dea977cbc5115bbc135130 100644 (file)
@@ -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) {