Revision: 6917
Author: [email protected]
Date: Wed Feb 23 07:25:04 2011
Log: Fix debug tracing of live ranges and remove unused code.

When printing the sub-parts of a live range, only print the use intervals
belonging to each part.

Add a flag to print all use positions (incl. environment uses)


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

Modified:
 /branches/bleeding_edge/src/flag-definitions.h
 /branches/bleeding_edge/src/hydrogen.cc
 /branches/bleeding_edge/src/lithium-allocator.cc
 /branches/bleeding_edge/src/lithium-allocator.h

=======================================
--- /branches/bleeding_edge/src/flag-definitions.h      Wed Feb 23 03:25:27 2011
+++ /branches/bleeding_edge/src/flag-definitions.h      Wed Feb 23 07:25:04 2011
@@ -120,6 +120,7 @@
 DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file")
 DEFINE_bool(trace_inlining, false, "trace inlining decisions")
 DEFINE_bool(trace_alloc, false, "trace register allocator")
+DEFINE_bool(trace_all_uses, false, "trace all use positions")
 DEFINE_bool(trace_range, false, "trace range analysis")
 DEFINE_bool(trace_gvn, false, "trace global value numbering")
 DEFINE_bool(trace_representation, false, "trace representation types")
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Wed Feb 23 03:59:18 2011
+++ /branches/bleeding_edge/src/hydrogen.cc     Wed Feb 23 07:25:04 2011
@@ -6016,7 +6016,7 @@
if (op != NULL && op->IsUnallocated()) hint_index = op->VirtualRegister();
     trace_.Add(" %d %d", parent_index, hint_index);
     UseInterval* cur_interval = range->first_interval();
-    while (cur_interval != NULL) {
+    while (cur_interval != NULL && range->Covers(cur_interval->start())) {
       trace_.Add(" [%d, %d[",
                  cur_interval->start().Value(),
                  cur_interval->end().Value());
@@ -6025,7 +6025,7 @@

     UsePosition* current_pos = range->first_pos();
     while (current_pos != NULL) {
-      if (current_pos->RegisterIsBeneficial()) {
+      if (current_pos->RegisterIsBeneficial() || FLAG_trace_all_uses) {
         trace_.Add(" %d M", current_pos->pos().Value());
       }
       current_pos = current_pos->next();
=======================================
--- /branches/bleeding_edge/src/lithium-allocator.cc Fri Feb 18 08:29:41 2011 +++ /branches/bleeding_edge/src/lithium-allocator.cc Wed Feb 23 07:25:04 2011
@@ -476,11 +476,6 @@
     use_pos = use_pos->next();
   }
 }
-
-
-UsePosition* LiveRange::AddUsePosition(LifetimePosition pos) {
-  return AddUsePosition(pos, CreateAssignedOperand());
-}


 bool LiveRange::CanCover(LifetimePosition position) const {
=======================================
--- /branches/bleeding_edge/src/lithium-allocator.h     Fri Feb  4 05:28:23 2011
+++ /branches/bleeding_edge/src/lithium-allocator.h     Wed Feb 23 07:25:04 2011
@@ -286,7 +286,6 @@
   LiveRange* TopLevel() { return (parent_ == NULL) ? this : parent_; }
   LiveRange* next() const { return next_; }
   bool IsChild() const { return parent() != NULL; }
-  bool IsParent() const { return parent() == NULL; }
   int id() const { return id_; }
   bool IsFixed() const { return id_ < 0; }
   bool IsEmpty() const { return first_interval() == NULL; }
@@ -360,7 +359,6 @@
   void EnsureInterval(LifetimePosition start, LifetimePosition end);
   void AddUseInterval(LifetimePosition start, LifetimePosition end);
   UsePosition* AddUsePosition(LifetimePosition pos, LOperand* operand);
-  UsePosition* AddUsePosition(LifetimePosition pos);

   // Shorten the most recently added interval by setting a new start.
   void ShortenTo(LifetimePosition start);

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

Reply via email to