Revision: 9561
Author:   [email protected]
Date:     Mon Oct 10 03:35:08 2011
Log: Disable short-circuiting of cons-strings when compaction is pending.

Otherwise fast path of scavenger gets a bit too complicated and heavy.

[email protected]

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

Modified:
 /branches/bleeding_edge/src/heap.cc
 /branches/bleeding_edge/src/objects-visiting.h

=======================================
--- /branches/bleeding_edge/src/heap.cc Mon Oct 10 02:21:48 2011
+++ /branches/bleeding_edge/src/heap.cc Mon Oct 10 03:35:08 2011
@@ -1662,6 +1662,17 @@
           ScavengingVisitor<TRANSFER_MARKS,
                             LOGGING_AND_PROFILING_ENABLED>::GetTable());
     }
+
+    if (incremental_marking()->IsCompacting()) {
+      // When compacting forbid short-circuiting of cons-strings.
+      // Scavenging code relies on the fact that new space object
+      // can't be evacuated into evacuation candidate but
+      // short-circuiting violates this assumption.
+      scavenging_visitors_table_.Register(
+          StaticVisitorBase::kVisitShortcutCandidate,
+          scavenging_visitors_table_.GetVisitorById(
+              StaticVisitorBase::kVisitConsString));
+    }
   }
 }

=======================================
--- /branches/bleeding_edge/src/objects-visiting.h      Mon Sep 19 11:36:47 2011
+++ /branches/bleeding_edge/src/objects-visiting.h      Mon Oct 10 03:35:08 2011
@@ -156,6 +156,10 @@
       NoBarrier_Store(&callbacks_[i], other->callbacks_[i]);
     }
   }
+
+  inline Callback GetVisitorById(StaticVisitorBase::VisitorId id) {
+    return reinterpret_cast<Callback>(callbacks_[id]);
+  }

   inline Callback GetVisitor(Map* map) {
     return reinterpret_cast<Callback>(callbacks_[map->visitor_id()]);

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

Reply via email to