[turbofan] pass zone to InstructionSequence
authordcarney@chromium.org <dcarney@chromium.org>
Mon, 20 Oct 2014 11:18:07 +0000 (11:18 +0000)
committerdcarney@chromium.org <dcarney@chromium.org>
Mon, 20 Oct 2014 11:18:07 +0000 (11:18 +0000)
R=bmeurer@chromium.org

BUG=

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24728 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/compiler/instruction.cc
src/compiler/instruction.h
src/compiler/pipeline.cc
test/cctest/compiler/test-codegen-deopt.cc
test/cctest/compiler/test-instruction.cc
test/unittests/compiler/instruction-selector-unittest.cc

index 4efa6e8..0f041af 100644 (file)
@@ -380,9 +380,10 @@ static void InitializeInstructionBlocks(Zone* zone, const Schedule* schedule,
 }
 
 
-InstructionSequence::InstructionSequence(Linkage* linkage, const Graph* graph,
+InstructionSequence::InstructionSequence(Zone* instruction_zone,
+                                         Linkage* linkage, const Graph* graph,
                                          const Schedule* schedule)
-    : zone_(schedule->zone()),
+    : zone_(instruction_zone),
       node_count_(graph->NodeCount()),
       node_map_(zone()->NewArray<int>(node_count_)),
       instruction_blocks_(static_cast<int>(schedule->rpo_order()->size()), NULL,
index c3e83fa..7359356 100644 (file)
@@ -844,7 +844,7 @@ typedef ZoneVector<InstructionBlock*> InstructionBlocks;
 // TODO(titzer): s/IsDouble/IsFloat64/
 class InstructionSequence FINAL {
  public:
-  InstructionSequence(Linkage* linkage, const Graph* graph,
+  InstructionSequence(Zone* zone, Linkage* linkage, const Graph* graph,
                       const Schedule* schedule);
 
   int NextVirtualRegister() { return next_virtual_register_++; }
index 3a3460f..f38065e 100644 (file)
@@ -453,7 +453,8 @@ Handle<Code> Pipeline::GenerateCode(Linkage* linkage, Graph* graph,
     profiler_data = BasicBlockInstrumentor::Instrument(info_, graph, schedule);
   }
 
-  InstructionSequence sequence(linkage, graph, schedule);
+  Zone* instruction_zone = schedule->zone();
+  InstructionSequence sequence(instruction_zone, linkage, graph, schedule);
 
   // Select and schedule instructions covering the scheduled graph.
   {
index 301ef70..d682986 100644 (file)
@@ -65,8 +65,8 @@ class DeoptCodegenTester {
 
     // Initialize the codegen and generate code.
     Linkage* linkage = new (scope_->main_zone()) Linkage(&info);
-    code = new v8::internal::compiler::InstructionSequence(linkage, graph,
-                                                           schedule);
+    code = new v8::internal::compiler::InstructionSequence(
+        scope_->main_zone(), linkage, graph, schedule);
     SourcePositionTable source_positions(graph);
     InstructionSelector selector(code, schedule, &source_positions);
     selector.SelectInstructions();
index 6d86bf9..cde475b 100644 (file)
@@ -54,7 +54,7 @@ class InstructionTester : public HandleAndZoneScope {
       Scheduler::ComputeSpecialRPO(&schedule);
       DCHECK(schedule.rpo_order()->size() > 0);
     }
-    code = new TestInstrSeq(&linkage, &graph, &schedule);
+    code = new TestInstrSeq(main_zone(), &linkage, &graph, &schedule);
   }
 
   Node* Int32Constant(int32_t val) {
index 97ae5b4..b1288d1 100644 (file)
@@ -38,7 +38,7 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build(
   int initial_node_count = graph()->NodeCount();
   CompilationInfo info(test_->isolate(), test_->zone());
   Linkage linkage(&info, call_descriptor());
-  InstructionSequence sequence(&linkage, graph(), schedule);
+  InstructionSequence sequence(test_->zone(), &linkage, graph(), schedule);
   SourcePositionTable source_position_table(graph());
   InstructionSelector selector(&sequence, schedule, &source_position_table,
                                features);