| 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();
|
|
|