From 46f57beaa64354376e6af3efdd895ccf1763ffc4 Mon Sep 17 00:00:00 2001 From: "vegorov@chromium.org" Date: Fri, 25 Feb 2011 15:00:46 +0000 Subject: [PATCH] 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 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/spaces.h b/src/spaces.h index 4f2d07b..6165255 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; -- 2.7.4