Commit d3faef86 authored by hpayer's avatar hpayer Committed by Commit bot

Revert of [heap] Cleanup mark bit usage. (patchset #1 id:1 of...

Revert of [heap] Cleanup mark bit usage. (patchset #1 id:1 of https://codereview.chromium.org/1474203003/ )

Reason for revert:
Still investigating bad canary.

Original issue's description:
> [heap] Cleanup mark bit usage.
>
> BUG=
>
> Committed: https://crrev.com/5874ac783ff9bc4bb4b2fda81f5077f06619f96c
> Cr-Commit-Position: refs/heads/master@{#32362}

TBR=mlippautz@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1490753003

Cr-Commit-Position: refs/heads/master@{#32461}
parent 9c60ddc6
......@@ -1437,9 +1437,8 @@ typedef StringTableCleaner<true> ExternalStringTableCleaner;
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())) {
......@@ -2348,8 +2347,8 @@ void MarkCompactCollector::ClearNonLiveMapTransitions(Map* map) {
// 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);
}
......@@ -2359,8 +2358,7 @@ void MarkCompactCollector::ClearNonLiveMapTransitions(Map* map) {
// 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;
}
......
......@@ -83,6 +83,12 @@ class Marking : public AllStatic {
markbit.Clear();
}
INLINE(static void GreyToWhite(MarkBit markbit)) {
DCHECK(IsGrey(markbit));
markbit.Clear();
markbit.Next().Clear();
}
INLINE(static void BlackToGrey(MarkBit markbit)) {
DCHECK(IsBlack(markbit));
markbit.Next().Set();
......
......@@ -3146,7 +3146,7 @@ void LargeObjectSpace::ClearMarkingStateOfLiveObjects() {
while (current != NULL) {
HeapObject* object = current->GetObject();
MarkBit mark_bit = Marking::MarkBitFrom(object);
DCHECK(Marking::IsBlack(mark_bit));
DCHECK(Marking::IsBlackOrGrey(mark_bit));
Marking::BlackToWhite(mark_bit);
Page::FromAddress(object->address())->ResetProgressBar();
Page::FromAddress(object->address())->ResetLiveBytes();
......@@ -3161,8 +3161,7 @@ void LargeObjectSpace::FreeUnmarkedObjects() {
while (current != NULL) {
HeapObject* object = current->GetObject();
MarkBit mark_bit = Marking::MarkBitFrom(object);
DCHECK(!Marking::IsGrey(mark_bit));
if (Marking::IsBlack(mark_bit)) {
if (Marking::IsBlackOrGrey(mark_bit)) {
previous = current;
current = current->next_page();
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment