Reviewers: Mads Ager,

Description:
Flush watermarks after compacting map space on mark-sweep collection.

MapCompact does not use MC-allocation routines so watermarks are not updated
automatically and might become inconsistent.

BUG=http://crbug.com/59688

Please review this at http://codereview.chromium.org/6588007/

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

Affected files:
  M src/spaces.h


Index: src/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index 4f2d07b0c8176118fca2722d135e6da097a50b34..6165255fd47a27c89b8db68325f38e404edbb94d 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -2121,6 +2121,12 @@ class MapSpace : public FixedSpace {
     accounting_stats_.DeallocateBytes(accounting_stats_.Size());
     accounting_stats_.AllocateBytes(new_size);

+    // Flush allocation watermarks.
+    for (Page* p = first_page_; p != top_page; p = p->next_page()) {
+      p->SetAllocationWatermark(p->AllocationTop());
+    }
+    top_page->SetAllocationWatermark(new_top);
+
 #ifdef DEBUG
     if (FLAG_enable_slow_asserts) {
       intptr_t actual_size = 0;


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

Reply via email to