Reviewers: ulan, Erik Corry,

Description:
Fix lazy sweeping heuristics to prevent expansion.

This ensures that objects evacuated from new-space fit into old-space
without expanding it. This means we cannot take allocation limit of
old-space into account, when estimating freed bytes.

[email protected],[email protected]


Please review this at https://chromiumcodereview.appspot.com/10640002/

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

Affected files:
  M src/mark-compact.cc


Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 67f6e8e0a7556c89a1f5162ac441ec3da5b4a1c4..a42bb706b0099f2ddb0479f4d65e16802cd31afa 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -3812,12 +3812,6 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) {
   bool lazy_sweeping_active = false;
   bool unused_page_present = false;

-  intptr_t old_space_size = heap()->PromotedSpaceSizeOfObjects();
-  intptr_t space_left =
-      Min(heap()->OldGenLimit(old_space_size, Heap::kMinPromotionLimit),
-          heap()->OldGenLimit(old_space_size, Heap::kMinAllocationLimit)) -
-      old_space_size;
-
   while (it.has_next()) {
     Page* p = it.next();

@@ -3877,7 +3871,7 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) {
         }
         freed_bytes += SweepConservatively(space, p);
         pages_swept++;
-        if (space_left + freed_bytes > newspace_size) {
+        if (freed_bytes > 2 * newspace_size) {
           space->SetPagesToSweep(p->next_page());
           lazy_sweeping_active = true;
         } else {


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

Reply via email to