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

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

Issue 1490753003: Revert 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 e3c637ac89bb347b892f1321639d30d86c0d79c5..980e4b3d373aeba23d242eec949edd1001a912b4 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -1417,9 +1417,8 @@
class MarkCompactWeakObjectRetainer : public WeakObjectRetainer {
public:
virtual Object* RetainAs(Object* object) {
- MarkBit mark_bit = Marking::MarkBitFrom(HeapObject::cast(object));
- DCHECK(!Marking::IsGrey(mark_bit));
- if (Marking::IsBlack(mark_bit)) {
+ if (Marking::IsBlackOrGrey(
+ Marking::MarkBitFrom(HeapObject::cast(object)))) {
return object;
} else if (object->IsAllocationSite() &&
!(AllocationSite::cast(object)->IsZombie())) {
@@ -2328,8 +2327,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::IsGrey(Marking::MarkBitFrom(map)));
- bool parent_is_alive = Marking::IsBlack(Marking::MarkBitFrom(parent));
+ DCHECK(!Marking::IsBlackOrGrey(Marking::MarkBitFrom(map)));
+ bool parent_is_alive = Marking::IsBlackOrGrey(Marking::MarkBitFrom(parent));
if (parent_is_alive) {
ClearMapTransitions(parent, map);
}
@@ -2339,8 +2338,7 @@
// 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) {
- DCHECK(!Marking::IsGrey(Marking::MarkBitFrom(target)));
- if (Marking::IsBlack(Marking::MarkBitFrom(target))) return false;
+ if (Marking::IsBlackOrGrey(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