Revision: 5937
Author: [email protected]
Date: Tue Dec  7 06:51:49 2010
Log: Remove NearestNextGapPos. It is not used anymore.

Remove uses of NearestGapPos in splitting helpers. We can split at any position.

Review URL: http://codereview.chromium.org/5605004
http://code.google.com/p/v8/source/detail?r=5937

Modified:
 /branches/bleeding_edge/src/arm/lithium-arm.cc
 /branches/bleeding_edge/src/arm/lithium-arm.h
 /branches/bleeding_edge/src/ia32/lithium-ia32.cc
 /branches/bleeding_edge/src/ia32/lithium-ia32.h
 /branches/bleeding_edge/src/lithium-allocator.cc
 /branches/bleeding_edge/src/x64/lithium-x64.h

=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.cc      Tue Dec  7 03:31:57 2010
+++ /branches/bleeding_edge/src/arm/lithium-arm.cc      Tue Dec  7 06:51:49 2010
@@ -458,12 +458,6 @@
   while (!IsGapAt(index)) index--;
   return index;
 }
-
-
-int LChunk::NearestNextGapPos(int index) const {
-  while (!IsGapAt(index)) index++;
-  return index;
-}


 void LChunk::AddGapMove(int index, LOperand* from, LOperand* to) {
=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.h       Tue Dec  7 03:31:57 2010
+++ /branches/bleeding_edge/src/arm/lithium-arm.h       Tue Dec  7 06:51:49 2010
@@ -1887,7 +1887,6 @@
   LGap* GetGapAt(int index) const;
   bool IsGapAt(int index) const;
   int NearestGapPos(int index) const;
-  int NearestNextGapPos(int index) const;
   void MarkEmptyBlocks();
const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
   LLabel* GetLabel(int block_id) const {
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.cc Tue Dec 7 03:53:11 2010 +++ /branches/bleeding_edge/src/ia32/lithium-ia32.cc Tue Dec 7 06:51:49 2010
@@ -458,12 +458,6 @@
   while (!IsGapAt(index)) index--;
   return index;
 }
-
-
-int LChunk::NearestNextGapPos(int index) const {
-  while (!IsGapAt(index)) index++;
-  return index;
-}


 void LChunk::AddGapMove(int index, LOperand* from, LOperand* to) {
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.h     Tue Dec  7 03:31:57 2010
+++ /branches/bleeding_edge/src/ia32/lithium-ia32.h     Tue Dec  7 06:51:49 2010
@@ -1890,7 +1890,6 @@
   LGap* GetGapAt(int index) const;
   bool IsGapAt(int index) const;
   int NearestGapPos(int index) const;
-  int NearestNextGapPos(int index) const;
   void MarkEmptyBlocks();
const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
   LLabel* GetLabel(int block_id) const {
=======================================
--- /branches/bleeding_edge/src/lithium-allocator.cc Tue Dec 7 03:31:57 2010 +++ /branches/bleeding_edge/src/lithium-allocator.cc Tue Dec 7 06:51:49 2010
@@ -1784,11 +1784,9 @@
TraceAlloc("Assigning reg %d to live range %d\n", max_reg, current->id());
     current->set_assigned_register(max_reg, mode_ == XMM_REGISTERS);
   } else {
- // Split the interval at the nearest gap and never split an interval at its
-    // start position.
-    LifetimePosition pos =
-        LifetimePosition::FromInstructionIndex(
-            chunk_->NearestGapPos(free_pos[max_reg].InstructionIndex()));
+ // Split the interval before first use position of max_reg and never split
+    // it interval at its start position.
+    LifetimePosition pos = free_pos[max_reg];
     if (pos.Value() <= current->Start().Value()) return false;
     LiveRange* second_range = Split(current, pos);
     AddToUnhandledSorted(second_range);
@@ -1871,9 +1869,7 @@
 void LAllocator::SplitAndSpillIntersecting(LiveRange* current) {
   ASSERT(current->HasRegisterAssigned());
   int reg = current->assigned_register();
-  LifetimePosition split_pos =
-      LifetimePosition::FromInstructionIndex(
-          chunk_->NearestGapPos(current->Start().InstructionIndex()));
+  LifetimePosition split_pos = current->Start();
   for (int i = 0; i < active_live_ranges_.length(); ++i) {
     LiveRange* range = active_live_ranges_[i];
     if (range->assigned_register() == reg) {
@@ -2012,8 +2008,6 @@


 void LAllocator::SplitAndSpill(LiveRange* range, LifetimePosition at) {
-  at = LifetimePosition::FromInstructionIndex(
-      chunk_->NearestGapPos(at.InstructionIndex()));
   LiveRange* second_part = Split(range, at);
   Spill(second_part);
 }
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.h       Tue Dec  7 03:31:57 2010
+++ /branches/bleeding_edge/src/x64/lithium-x64.h       Tue Dec  7 06:51:49 2010
@@ -215,11 +215,6 @@
     UNIMPLEMENTED();
     return 0;
   }
-
-  int NearestNextGapPos(int index) const {
-    UNIMPLEMENTED();
-    return 0;
-  }

   void MarkEmptyBlocks() { UNIMPLEMENTED(); }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to