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

Unified Diff: src/heap/mark-compact-inl.h

Issue 2139133003: [heap] Untangle Marking and friends from heap dependencies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix comment formatting Created 4 years, 5 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/heap/mark-compact.cc ('k') | src/heap/marking.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact-inl.h
diff --git a/src/heap/mark-compact-inl.h b/src/heap/mark-compact-inl.h
index 8ecdd62588deab6740668384993265fb8b5c6239..ceca4c4d8ce7c1ccd5b3c04486aca391b157dfc9 100644
--- a/src/heap/mark-compact-inl.h
+++ b/src/heap/mark-compact-inl.h
@@ -13,26 +13,28 @@ namespace v8 {
namespace internal {
void MarkCompactCollector::PushBlack(HeapObject* obj) {
- DCHECK(Marking::IsBlack(Marking::MarkBitFrom(obj)));
+ DCHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(obj)));
if (marking_deque_.Push(obj)) {
MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size());
} else {
- Marking::BlackToGrey(obj);
+ MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
+ Marking::BlackToGrey(mark_bit);
}
}
void MarkCompactCollector::UnshiftBlack(HeapObject* obj) {
- DCHECK(Marking::IsBlack(Marking::MarkBitFrom(obj)));
+ DCHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(obj)));
if (!marking_deque_.Unshift(obj)) {
MemoryChunk::IncrementLiveBytesFromGC(obj, -obj->Size());
- Marking::BlackToGrey(obj);
+ MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
+ Marking::BlackToGrey(mark_bit);
}
}
void MarkCompactCollector::MarkObject(HeapObject* obj, MarkBit mark_bit) {
- DCHECK(Marking::MarkBitFrom(obj) == mark_bit);
+ DCHECK(ObjectMarking::MarkBitFrom(obj) == mark_bit);
if (Marking::IsWhite(mark_bit)) {
Marking::WhiteToBlack(mark_bit);
DCHECK(obj->GetIsolate()->heap()->Contains(obj));
@@ -43,7 +45,7 @@ void MarkCompactCollector::MarkObject(HeapObject* obj, MarkBit mark_bit) {
void MarkCompactCollector::SetMark(HeapObject* obj, MarkBit mark_bit) {
DCHECK(Marking::IsWhite(mark_bit));
- DCHECK(Marking::MarkBitFrom(obj) == mark_bit);
+ DCHECK(ObjectMarking::MarkBitFrom(obj) == mark_bit);
Marking::WhiteToBlack(mark_bit);
MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size());
}
@@ -52,7 +54,7 @@ void MarkCompactCollector::SetMark(HeapObject* obj, MarkBit mark_bit) {
bool MarkCompactCollector::IsMarked(Object* obj) {
DCHECK(obj->IsHeapObject());
HeapObject* heap_object = HeapObject::cast(obj);
- return Marking::IsBlackOrGrey(Marking::MarkBitFrom(heap_object));
+ return Marking::IsBlackOrGrey(ObjectMarking::MarkBitFrom(heap_object));
}
@@ -62,7 +64,7 @@ void MarkCompactCollector::RecordSlot(HeapObject* object, Object** slot,
Page* source_page = Page::FromAddress(reinterpret_cast<Address>(object));
if (target_page->IsEvacuationCandidate() &&
!ShouldSkipEvacuationSlotRecording(object)) {
- DCHECK(Marking::IsBlackOrGrey(Marking::MarkBitFrom(object)));
+ DCHECK(Marking::IsBlackOrGrey(ObjectMarking::MarkBitFrom(object)));
RememberedSet<OLD_TO_OLD>::Insert(source_page,
reinterpret_cast<Address>(slot));
}
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/marking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698