Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: src/mark-compact.cc

Issue 7970009: Merged from GC branch to bleeding_edge (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated test expectations. More passes, but not all. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mark-compact.h ('k') | src/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 66b19c8274b5a3a37671f1682b71bb1aa9fccbcc..ba9958b4ae40d53f4ab82274fca772b2b9c64237 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -295,7 +295,8 @@ void MarkCompactCollector::VerifyMarkbitsAreClean(PagedSpace* space) {
while (it.has_next()) {
Page* p = it.next();
- ASSERT(p->markbits()->IsClean());
+ CHECK(p->markbits()->IsClean());
+ CHECK_EQ(0, p->LiveBytes());
}
}
@@ -304,7 +305,8 @@ void MarkCompactCollector::VerifyMarkbitsAreClean(NewSpace* space) {
while (it.has_next()) {
NewSpacePage* p = it.next();
- ASSERT(p->markbits()->IsClean());
+ CHECK(p->markbits()->IsClean());
+ CHECK_EQ(0, p->LiveBytes());
}
}
@@ -402,7 +404,7 @@ bool Marking::TransferMark(Address old_start, Address new_start) {
}
-static const char* AllocationSpaceName(AllocationSpace space) {
+const char* AllocationSpaceName(AllocationSpace space) {
switch (space) {
case NEW_SPACE: return "NEW_SPACE";
case OLD_POINTER_SPACE: return "OLD_POINTER_SPACE";
@@ -2528,9 +2530,10 @@ void MarkCompactCollector::EvacuateNewSpace() {
MarkBit mark_bit = Marking::MarkBitFrom(object);
if (mark_bit.Get()) {
mark_bit.Clear();
+ // Don't bother decrementing live bytes count. We'll discard the
+ // entire page at the end.
int size = object->Size();
survivors_size += size;
- MemoryChunk::IncrementLiveBytes(object->address(), -size);
// Aggressively promote young survivors to the old space.
if (TryPromoteObject(object, size)) {
@@ -2621,6 +2624,7 @@ void MarkCompactCollector::EvacuateLiveObjectsFromPage(Page* p) {
// Clear marking bits for current cell.
cells[cell_index] = 0;
}
+ p->ResetLiveBytes();
}
@@ -2819,6 +2823,7 @@ static void SweepPrecisely(PagedSpace* space,
if (free_start != p->ObjectAreaEnd()) {
space->Free(free_start, static_cast<int>(p->ObjectAreaEnd() - free_start));
}
+ p->ResetLiveBytes();
}
@@ -3308,6 +3313,7 @@ intptr_t MarkCompactCollector::SweepConservatively(PagedSpace* space, Page* p) {
if (cell_index == last_cell_index) {
freed_bytes += static_cast<int>(space->Free(p->ObjectAreaStart(),
static_cast<int>(size)));
+ ASSERT_EQ(0, p->LiveBytes());
return freed_bytes;
}
// Grow the size of the start-of-page free space a little to get up to the
@@ -3364,6 +3370,7 @@ intptr_t MarkCompactCollector::SweepConservatively(PagedSpace* space, Page* p) {
static_cast<int>(block_address - free_start));
}
+ p->ResetLiveBytes();
return freed_bytes;
}
« no previous file with comments | « src/mark-compact.h ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698