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

Unified Diff: src/heap/incremental-marking.cc

Issue 2644523002: [heap] Provide ObjectMarking with marking transitions (Closed)
Patch Set: Created 3 years, 11 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
Index: src/heap/incremental-marking.cc
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc
index fd58ef06a08f78fca205de119a38453bb51f3249..7b6457a513e2f6abe4c3bbee6bca6487407d0f60 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -120,7 +120,7 @@ void IncrementalMarking::RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo,
void IncrementalMarking::WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit) {
Hannes Payer (out of office) 2017/01/18 14:43:35 mark_bit is now not used anymore. That was an opti
Michael Lippautz 2017/01/18 15:58:07 Done.
- Marking::WhiteToGrey(mark_bit);
+ ObjectMarking::WhiteToGrey(obj);
heap_->mark_compact_collector()->marking_deque()->Push(obj);
}
@@ -128,16 +128,13 @@ void IncrementalMarking::WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit) {
static void MarkObjectGreyDoNotEnqueue(Object* obj) {
if (obj->IsHeapObject()) {
HeapObject* heap_obj = HeapObject::cast(obj);
- MarkBit mark_bit = ObjectMarking::MarkBitFrom(HeapObject::cast(obj));
- if (Marking::IsBlack(mark_bit)) {
- MemoryChunk::IncrementLiveBytes(heap_obj, -heap_obj->Size());
- }
- Marking::AnyToGrey(mark_bit);
+ ObjectMarking::AnyToGrey(heap_obj);
}
}
void IncrementalMarking::TransferMark(Heap* heap, HeapObject* from,
HeapObject* to) {
+ DCHECK(MemoryChunk::FromAddress(from->address())->SweepingDone());
// This is only used when resizing an object.
DCHECK(MemoryChunk::FromAddress(from->address()) ==
MemoryChunk::FromAddress(to->address()));
@@ -158,11 +155,12 @@ void IncrementalMarking::TransferMark(Heap* heap, HeapObject* from,
if (Marking::IsBlack(old_mark_bit)) {
Marking::BlackToWhite(old_mark_bit);
- Marking::MarkBlack(new_mark_bit);
+ Marking::WhiteToBlack(new_mark_bit);
return;
} else if (Marking::IsGrey(old_mark_bit)) {
Marking::GreyToWhite(old_mark_bit);
- heap->incremental_marking()->WhiteToGreyAndPush(to, new_mark_bit);
+ Marking::WhiteToGrey(new_mark_bit);
Hannes Payer (out of office) 2017/01/18 14:43:35 Why not calling WhiteToGreyAndPush?
Michael Lippautz 2017/01/18 15:58:07 WhiteToGreyAndPush uses ObjectMarking which potent
+ heap->mark_compact_collector()->marking_deque()->Push(to);
heap->incremental_marking()->RestartIfNotMarking();
}
@@ -267,8 +265,7 @@ class IncrementalMarkingMarkingVisitor
HeapObject* heap_object = HeapObject::cast(obj);
MarkBit mark_bit = ObjectMarking::MarkBitFrom(heap_object);
if (Marking::IsWhite(mark_bit)) {
- Marking::MarkBlack(mark_bit);
- MemoryChunk::IncrementLiveBytes(heap_object, heap_object->Size());
+ ObjectMarking::WhiteToBlack(heap_object);
return true;
}
return false;
@@ -863,8 +860,7 @@ void IncrementalMarking::MarkGrey(Heap* heap, HeapObject* object) {
void IncrementalMarking::MarkBlack(HeapObject* obj, int size) {
MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
if (Marking::IsBlack(mark_bit)) return;
- Marking::GreyToBlack(mark_bit);
- MemoryChunk::IncrementLiveBytes(obj, size);
+ ObjectMarking::GreyToBlack(obj);
}
intptr_t IncrementalMarking::ProcessMarkingDeque(
@@ -937,8 +933,7 @@ void IncrementalMarking::Hurry() {
if (!cache->IsUndefined(heap_->isolate())) {
MarkBit mark_bit = ObjectMarking::MarkBitFrom(cache);
if (Marking::IsGrey(mark_bit)) {
- Marking::GreyToBlack(mark_bit);
- MemoryChunk::IncrementLiveBytes(cache, cache->Size());
+ ObjectMarking::GreyToBlack(cache);
}
}
context = Context::cast(context)->next_context_link();
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.h » ('j') | src/heap/mark-compact.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698