Reviewers: Sven Panne,

Description:
Remove obsolete LiveRange::FirstPosWithHint helper.

R=svenpa...@chromium.org

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

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/lithium-allocator.h
  M src/lithium-allocator.cc


Index: src/lithium-allocator.cc
diff --git a/src/lithium-allocator.cc b/src/lithium-allocator.cc
index c80c4670e40a01cd210cc1260c030699e4212a1b..5eb95e5e9fae7c74c9f116e793ce5c6b747513d5 100644
--- a/src/lithium-allocator.cc
+++ b/src/lithium-allocator.cc
@@ -229,13 +229,6 @@ bool LiveRange::CanBeSpilled(LifetimePosition pos) {
 }


-UsePosition* LiveRange::FirstPosWithHint() const {
-  UsePosition* pos = first_pos_;
-  while (pos != NULL && !pos->HasHint()) pos = pos->next();
-  return pos;
-}
-
-
 LOperand* LiveRange::CreateAssignedOperand(Zone* zone) {
   LOperand* op = NULL;
   if (HasRegisterAssigned()) {
@@ -1813,26 +1806,23 @@ bool LAllocator::TryAllocateFreeReg(LiveRange* current) { free_until_pos[cur_reg] = Min(free_until_pos[cur_reg], next_intersection);
   }

-  UsePosition* hinted_use = current->FirstPosWithHint();
-  if (hinted_use != NULL) {
-    LOperand* hint = hinted_use->hint();
-    if (hint->IsRegister() || hint->IsDoubleRegister()) {
-      int register_index = hint->index();
-      TraceAlloc(
- "Found reg hint %s (free until [%d) for live range %d (end %d[).\n",
-          RegisterName(register_index),
-          free_until_pos[register_index].Value(),
-          current->id(),
-          current->End().Value());
-
- // The desired register is free until the end of the current live range. - if (free_until_pos[register_index].Value() >= current->End().Value()) {
-        TraceAlloc("Assigning preferred reg %s to live range %d\n",
-                   RegisterName(register_index),
-                   current->id());
- SetLiveRangeAssignedRegister(current, register_index, mode_, zone_);
-        return true;
-      }
+  LOperand* hint = current->FirstHint();
+  if (hint != NULL && (hint->IsRegister() || hint->IsDoubleRegister())) {
+    int register_index = hint->index();
+    TraceAlloc(
+ "Found reg hint %s (free until [%d) for live range %d (end %d[).\n",
+        RegisterName(register_index),
+        free_until_pos[register_index].Value(),
+        current->id(),
+        current->End().Value());
+
+ // The desired register is free until the end of the current live range.
+    if (free_until_pos[register_index].Value() >= current->End().Value()) {
+      TraceAlloc("Assigning preferred reg %s to live range %d\n",
+                 RegisterName(register_index),
+                 current->id());
+      SetLiveRangeAssignedRegister(current, register_index, mode_, zone_);
+      return true;
     }
   }

Index: src/lithium-allocator.h
diff --git a/src/lithium-allocator.h b/src/lithium-allocator.h
index 0cd5ae0e8e803c5fed7d256c357a91fa00a58413..0300212f3103bdc23f8f2372e8a51da3a86ad903 100644
--- a/src/lithium-allocator.h
+++ b/src/lithium-allocator.h
@@ -328,10 +328,10 @@ class LiveRange: public ZoneObject {
     return assigned_register_ != kInvalidAssignment;
   }
   bool IsSpilled() const { return spilled_; }
-  UsePosition* FirstPosWithHint() const;

   LOperand* FirstHint() const {
-    UsePosition* pos = FirstPosWithHint();
+    UsePosition* pos = first_pos_;
+    while (pos != NULL && !pos->HasHint()) pos = pos->next();
     if (pos != NULL) return pos->hint();
     return NULL;
   }


--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to