[turbofan] Free TurboFan from the claws of ZoneList.
authormstarzinger <mstarzinger@chromium.org>
Mon, 4 May 2015 12:54:08 +0000 (05:54 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 4 May 2015 12:54:15 +0000 (12:54 +0000)
This removes the last occurence of the hand-written ZoneList from the
compiler directory and uses ZoneVector everywhere instead.

R=bmeurer@chromium.org

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

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

src/compiler/scheduler.cc

index 589094c..3a2af02 100644 (file)
@@ -627,7 +627,7 @@ class SpecialRPONumberer : public ZoneObject {
 #endif
   }
 
-  const ZoneList<BasicBlock*>& GetOutgoingBlocks(BasicBlock* block) {
+  const ZoneVector<BasicBlock*>& GetOutgoingBlocks(BasicBlock* block) {
     if (HasLoopNumber(block)) {
       LoopInfo const& loop = loops_[GetLoopNumber(block)];
       if (loop.outgoing) return *loop.outgoing;
@@ -652,7 +652,7 @@ class SpecialRPONumberer : public ZoneObject {
 
   struct LoopInfo {
     BasicBlock* header;
-    ZoneList<BasicBlock*>* outgoing;
+    ZoneVector<BasicBlock*>* outgoing;
     BitVector* members;
     LoopInfo* prev;
     BasicBlock* end;
@@ -660,9 +660,10 @@ class SpecialRPONumberer : public ZoneObject {
 
     void AddOutgoing(Zone* zone, BasicBlock* block) {
       if (outgoing == NULL) {
-        outgoing = new (zone) ZoneList<BasicBlock*>(2, zone);
+        outgoing = new (zone->New(sizeof(ZoneVector<BasicBlock*>)))
+            ZoneVector<BasicBlock*>(zone);
       }
-      outgoing->Add(block, zone);
+      outgoing->push_back(block);
     }
   };
 
@@ -791,12 +792,11 @@ class SpecialRPONumberer : public ZoneObject {
           }
 
           // Use the next outgoing edge if there are any.
-          int outgoing_index =
-              static_cast<int>(frame->index - block->SuccessorCount());
+          size_t outgoing_index = frame->index - block->SuccessorCount();
           LoopInfo* info = &loops_[GetLoopNumber(block)];
           DCHECK(loop != info);
           if (block != entry && info->outgoing != NULL &&
-              outgoing_index < info->outgoing->length()) {
+              outgoing_index < info->outgoing->size()) {
             succ = info->outgoing->at(outgoing_index);
             frame->index++;
           }
@@ -1055,7 +1055,7 @@ class SpecialRPONumberer : public ZoneObject {
   ZoneVector<Backedge> backedges_;
   ZoneVector<SpecialRPOStackFrame> stack_;
   size_t previous_block_count_;
-  ZoneList<BasicBlock*> const empty_;
+  ZoneVector<BasicBlock*> const empty_;
 };