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

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

Issue 2770253002: [heap] Enforce explicit MarkingState (Closed)
Patch Set: rebase Created 3 years, 9 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/object-stats.cc » ('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 9fe262d426b1a6bad880c4c86dac51955eb7d909..509b3947e348f79d74cd75bd9dba5c44045bd6e4 100644
--- a/src/heap/mark-compact-inl.h
+++ b/src/heap/mark-compact-inl.h
@@ -13,37 +13,44 @@ namespace v8 {
namespace internal {
void MarkCompactCollector::PushBlack(HeapObject* obj) {
- DCHECK((ObjectMarking::IsBlack<MarkBit::NON_ATOMIC>(obj)));
+ DCHECK((ObjectMarking::IsBlack<MarkBit::NON_ATOMIC>(
+ obj, MarkingState::Internal(obj))));
if (!marking_deque()->Push(obj)) {
- ObjectMarking::BlackToGrey<MarkBit::NON_ATOMIC>(obj);
+ ObjectMarking::BlackToGrey<MarkBit::NON_ATOMIC>(
+ obj, MarkingState::Internal(obj));
}
}
void MinorMarkCompactCollector::PushBlack(HeapObject* obj) {
- DCHECK(
- (ObjectMarking::IsBlack<MarkBit::NON_ATOMIC>(obj, StateForObject(obj))));
+ DCHECK((ObjectMarking::IsBlack<MarkBit::NON_ATOMIC>(
+ obj, MarkingState::External(obj))));
if (!marking_deque()->Push(obj)) {
- ObjectMarking::BlackToGrey<MarkBit::NON_ATOMIC>(obj, StateForObject(obj));
+ ObjectMarking::BlackToGrey<MarkBit::NON_ATOMIC>(
+ obj, MarkingState::External(obj));
}
}
void MarkCompactCollector::UnshiftBlack(HeapObject* obj) {
- DCHECK(ObjectMarking::IsBlack(obj));
+ DCHECK(ObjectMarking::IsBlack(obj, MarkingState::Internal(obj)));
if (!marking_deque()->Unshift(obj)) {
- ObjectMarking::BlackToGrey(obj);
+ ObjectMarking::BlackToGrey(obj, MarkingState::Internal(obj));
}
}
void MarkCompactCollector::MarkObject(HeapObject* obj) {
- if (ObjectMarking::IsWhite<MarkBit::NON_ATOMIC>(obj)) {
- ObjectMarking::WhiteToBlack<MarkBit::NON_ATOMIC>(obj);
+ if (ObjectMarking::IsWhite<MarkBit::NON_ATOMIC>(
+ obj, MarkingState::Internal(obj))) {
+ ObjectMarking::WhiteToBlack<MarkBit::NON_ATOMIC>(
+ obj, MarkingState::Internal(obj));
PushBlack(obj);
}
}
void MinorMarkCompactCollector::MarkObject(HeapObject* obj) {
- if (ObjectMarking::IsWhite<MarkBit::NON_ATOMIC>(obj, StateForObject(obj))) {
- ObjectMarking::WhiteToBlack<MarkBit::NON_ATOMIC>(obj, StateForObject(obj));
+ if (ObjectMarking::IsWhite<MarkBit::NON_ATOMIC>(
+ obj, MarkingState::External(obj))) {
+ ObjectMarking::WhiteToBlack<MarkBit::NON_ATOMIC>(
+ obj, MarkingState::External(obj));
PushBlack(obj);
}
}
@@ -54,7 +61,8 @@ void MarkCompactCollector::RecordSlot(HeapObject* object, Object** slot,
Page* source_page = Page::FromAddress(reinterpret_cast<Address>(object));
if (target_page->IsEvacuationCandidate() &&
!ShouldSkipEvacuationSlotRecording(object)) {
- DCHECK(ObjectMarking::IsBlackOrGrey(object));
+ DCHECK(
+ ObjectMarking::IsBlackOrGrey(object, MarkingState::Internal(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/object-stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698