Reviewers: Erik Corry,
Description:
Add safeguard to ensure that we don't unmap pages with live data.
[email protected]
BUG=v8:1672
Please review this at http://codereview.chromium.org/8133018/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/mark-compact.cc
M src/spaces.cc
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index
e90a23d8a497c7badda4638fb70741014599f4ee..d2590e1b0f313134d982a1e22c1d1396313bb9ec
100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -3545,7 +3545,8 @@ void MarkCompactCollector::SweepSpace(PagedSpace*
space,
}
// One unused page is kept, all further are released before sweeping
them.
- if (p->LiveBytes() == 0) {
+ // TODO(1672) We can't rely on LiveBytes value entirely yet.
+ if (p->LiveBytes() == 0 && p->markbits()->IsClean()) {
if (unused_page_present) {
if (FLAG_gc_verbose) {
PrintF("Sweeping 0x%" V8PRIxPTR " released page.\n",
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index
2aaca5b742f911d47be7816d0419a1321774f4b4..5c5de1a857317c3b0d284698d3e815fbb58c8181
100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -782,7 +782,8 @@ void PagedSpace::ReleaseAllUnusedPages() {
PageIterator it(this);
while (it.has_next()) {
Page* page = it.next();
- if (page->LiveBytes() == 0) {
+ // TODO(1672) We can't rely on LiveBytes value entirely yet.
+ if (page->LiveBytes() == 0 && page->markbits()->IsClean()) {
ReleasePage(page);
}
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev