Fix Heap::Shrink to ensure that it does not free pages that are still in use.
authorvegorov@chromium.org <vegorov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 10 Nov 2011 13:24:00 +0000 (13:24 +0000)
committervegorov@chromium.org <vegorov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 10 Nov 2011 13:24:00 +0000 (13:24 +0000)
commitb8dc77ab9a6d22d1164180f16d0e7ea0ecd74be2
treefc8b0c6b6839c6bfbbc2e5860d4e4e611b54a09e
parent33682c6b349deb25ba46c6da2e2955c3e5a9d4e9
Fix Heap::Shrink to ensure that it does not free pages that are still in use.

Heap::Shrink is called from EnsureFromSpaceIsCommitted at the very start of the GC. At this moment live bytes counts on pages are in inconsistent states. Some pages might have been already swept but have not been yet reached by an incremental marker (or incremental marker is not in progress) and have live bytes count set to 0. Thus we can't rely only on LiveBytes to determine which pages can be released to the OS.

R=mstarzinger@chromium.org
BUG=100414

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9953 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/heap.cc
src/mark-compact.cc
src/spaces.cc
src/spaces.h