Flush watermarks after compacting map space on mark-sweep collection.
authorvegorov@chromium.org <vegorov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 25 Feb 2011 15:00:46 +0000 (15:00 +0000)
committervegorov@chromium.org <vegorov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 25 Feb 2011 15:00:46 +0000 (15:00 +0000)
MapCompact does not use MC-allocation routines so watermarks are not updated automatically and might become inconsistent.

BUG=http://crbug.com/59688

Review URL: http://codereview.chromium.org/6588007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6954 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/spaces.h

index 4f2d07b..6165255 100644 (file)
@@ -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;