Reviewers: Michael Starzinger,

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

[email protected]
BUG=

Please review this at https://codereview.chromium.org/1317113004/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+12, -22 lines):
  M src/compiler/pipeline.h
  M src/compiler/pipeline.cc
  M test/cctest/compiler/codegen-tester.h
  M test/cctest/compiler/graph-builder-tester.h
  M test/cctest/compiler/test-run-native-calls.cc


Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index 978aeee94a8c3ba922a619b697c00477887b4d11..0acde111e33870376821e1b97bf1a6fdadf05989 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -1176,15 +1176,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: src/compiler/pipeline.h
diff --git a/src/compiler/pipeline.h b/src/compiler/pipeline.h
index 4e3635d0f69c5b98009b1f3063c4a61c421a1958..90c223f67ea6ef0529f934d264d1cd706a40cb9a 100644
--- a/src/compiler/pipeline.h
+++ b/src/compiler/pipeline.h
@@ -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: test/cctest/compiler/codegen-tester.h
diff --git a/test/cctest/compiler/codegen-tester.h b/test/cctest/compiler/codegen-tester.h index d8ecc02fc24ca1af9542be2e3c856578cf0efd51..41a19a15320bba6c5da9b60a4de2993e0da715c1 100644
--- a/test/cctest/compiler/codegen-tester.h
+++ b/test/cctest/compiler/codegen-tester.h
@@ -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: test/cctest/compiler/graph-builder-tester.h
diff --git a/test/cctest/compiler/graph-builder-tester.h b/test/cctest/compiler/graph-builder-tester.h index 41c1e384be72f646bd9e331c8e56ac5080373287..de7d20c34b4d2f59d7a6682df05019eb81be1122 100644
--- a/test/cctest/compiler/graph-builder-tester.h
+++ b/test/cctest/compiler/graph-builder-tester.h
@@ -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: test/cctest/compiler/test-run-native-calls.cc
diff --git a/test/cctest/compiler/test-run-native-calls.cc b/test/cctest/compiler/test-run-native-calls.cc index 2e255c7729c6c400be1b82def3891103bb327fce..9ab15c4578bd660f83dea977cbc5115bbc135130 100644
--- a/test/cctest/compiler/test-run-native-calls.cc
+++ b/test/cctest/compiler/test-run-native-calls.cc
@@ -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) {


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to