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

Unified Diff: src/incremental-marking.cc

Issue 7247002: Estimate a (close) upper bound on the size of black-marked objects on each page. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Address review comments. Make compile on x64. Created 9 years, 6 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/incremental-marking.h ('k') | src/mark-compact.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/incremental-marking.cc
diff --git a/src/incremental-marking.cc b/src/incremental-marking.cc
index d2408af82387e86d1b76050b716e6c7a60e5c99c..5320f0ff8efae2018880eacb5a008e68c50b66e0 100644
--- a/src/incremental-marking.cc
+++ b/src/incremental-marking.cc
@@ -86,7 +86,10 @@ class IncrementalMarkingMarkingVisitor : public ObjectVisitor {
HeapObject* heap_object = HeapObject::cast(obj);
MarkBit mark_bit = Marking::MarkBitFrom(heap_object);
if (mark_bit.data_only()) {
- incremental_marking_->MarkBlackOrKeepGrey(mark_bit);
+ if (incremental_marking_->MarkBlackOrKeepGrey(mark_bit)) {
+ MemoryChunk::IncrementLiveBytes(heap_object->address(),
+ heap_object->Size());
+ }
} else if (Marking::IsWhite(mark_bit)) {
incremental_marking_->WhiteToGreyAndPush(heap_object, mark_bit);
}
@@ -122,7 +125,10 @@ class IncrementalMarkingRootMarkingVisitor : public ObjectVisitor {
HeapObject* heap_object = HeapObject::cast(obj);
MarkBit mark_bit = Marking::MarkBitFrom(heap_object);
if (mark_bit.data_only()) {
- incremental_marking_->MarkBlackOrKeepGrey(mark_bit);
+ if (incremental_marking_->MarkBlackOrKeepGrey(mark_bit)) {
+ MemoryChunk::IncrementLiveBytes(heap_object->address(),
+ heap_object->Size());
+ }
} else {
if (Marking::IsWhite(mark_bit)) {
incremental_marking_->WhiteToGreyAndPush(heap_object, mark_bit);
@@ -203,7 +209,7 @@ void IncrementalMarking::ClearMarkbits(PagedSpace* space) {
PageIterator it(space);
while (it.has_next()) {
Page* p = it.next();
- p->markbits()->Clear();
+ Bitmap::Clear(p);
SetOldSpacePageFlags(p, true);
}
}
@@ -213,7 +219,7 @@ void IncrementalMarking::ClearMarkbits(NewSpace* space) {
NewSpacePageIterator it(space->ToSpaceStart(), space->ToSpaceEnd());
while (it.has_next()) {
NewSpacePage* p = it.next();
- p->markbits()->Clear();
+ Bitmap::Clear(p);
SetNewSpacePageFlags(p, true);
}
}
@@ -378,7 +384,7 @@ void IncrementalMarking::PrepareForScavenge() {
NewSpacePageIterator it(heap_->new_space()->FromSpaceStart(),
heap_->new_space()->FromSpaceEnd());
while (it.has_next()) {
- it.next()->markbits()->Clear();
+ Bitmap::Clear(it.next());
}
}
@@ -438,7 +444,9 @@ void IncrementalMarking::Hurry() {
if (obj->map() != filler_map) {
obj->Iterate(&marking_visitor);
MarkBit mark_bit = Marking::MarkBitFrom(obj);
+ ASSERT(!Marking::IsBlack(mark_bit));
Marking::MarkBlack(mark_bit);
+ MemoryChunk::IncrementLiveBytes(obj->address(), obj->Size());
}
}
state_ = COMPLETE;
@@ -539,7 +547,9 @@ void IncrementalMarking::Step(intptr_t allocated_bytes) {
// TODO(gc) switch to static visitor instead of normal visitor.
obj->IterateBody(map->instance_type(), size, &marking_visitor);
MarkBit obj_mark_bit = Marking::MarkBitFrom(obj);
+ ASSERT(!Marking::IsBlack(obj_mark_bit));
Marking::MarkBlack(obj_mark_bit);
+ MemoryChunk::IncrementLiveBytes(obj->address(), size);
}
}
if (marking_deque_.IsEmpty()) MarkingComplete();
« no previous file with comments | « src/incremental-marking.h ('k') | src/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698