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

Unified Diff: src/heap/mark-compact.cc

Issue 1488393003: Reland of [heap] Cleanup mark bit usage. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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.h ('k') | src/heap/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 980e4b3d373aeba23d242eec949edd1001a912b4..e3c637ac89bb347b892f1321639d30d86c0d79c5 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -1417,8 +1417,9 @@
class MarkCompactWeakObjectRetainer : public WeakObjectRetainer {
public:
virtual Object* RetainAs(Object* object) {
- if (Marking::IsBlackOrGrey(
- Marking::MarkBitFrom(HeapObject::cast(object)))) {
+ MarkBit mark_bit = Marking::MarkBitFrom(HeapObject::cast(object));
+ DCHECK(!Marking::IsGrey(mark_bit));
+ if (Marking::IsBlack(mark_bit)) {
return object;
} else if (object->IsAllocationSite() &&
!(AllocationSite::cast(object)->IsZombie())) {
@@ -2327,8 +2328,8 @@
// Follow back pointer, check whether we are dealing with a map transition
// from a live map to a dead path and in case clear transitions of parent.
- DCHECK(!Marking::IsBlackOrGrey(Marking::MarkBitFrom(map)));
- bool parent_is_alive = Marking::IsBlackOrGrey(Marking::MarkBitFrom(parent));
+ DCHECK(!Marking::IsGrey(Marking::MarkBitFrom(map)));
+ bool parent_is_alive = Marking::IsBlack(Marking::MarkBitFrom(parent));
if (parent_is_alive) {
ClearMapTransitions(parent, map);
}
@@ -2338,7 +2339,8 @@
// Clear a possible back pointer in case the transition leads to a dead map.
// Return true in case a back pointer has been cleared and false otherwise.
bool MarkCompactCollector::ClearMapBackPointer(Map* target) {
- if (Marking::IsBlackOrGrey(Marking::MarkBitFrom(target))) return false;
+ DCHECK(!Marking::IsGrey(Marking::MarkBitFrom(target)));
+ if (Marking::IsBlack(Marking::MarkBitFrom(target))) return false;
target->SetBackPointer(heap_->undefined_value(), SKIP_WRITE_BARRIER);
return true;
}
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698