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

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

Issue 1988623002: Ensure black and gray objects are kept around by scavenger (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup Created 4 years, 7 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/incremental-marking.cc ('k') | src/heap/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.h
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h
index d6adb038ea95764286f3a24bcdfb3003050ec7ec..c9e867e1f4eac39e1cfd6c959c6ab3ffdc8956e8 100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -157,17 +157,24 @@ class Marking : public AllStatic {
}
#endif
- // Returns true if the transferred color is black.
+ // Returns true if the transferred color is black. Clears the color of the
+ // from object.
INLINE(static bool TransferColor(HeapObject* from, HeapObject* to)) {
- if (Page::FromAddress(to->address())->IsFlagSet(Page::BLACK_PAGE))
- return true;
MarkBit from_mark_bit = MarkBitFrom(from);
+ if (Page::FromAddress(to->address())->IsFlagSet(Page::BLACK_PAGE)) {
+ if (!Marking::IsWhite(from_mark_bit)) {
+ Marking::MarkWhite(from_mark_bit);
+ }
+ return true;
+ }
MarkBit to_mark_bit = MarkBitFrom(to);
DCHECK(Marking::IsWhite(to_mark_bit));
if (from_mark_bit.Get()) {
to_mark_bit.Set();
+ from_mark_bit.Clear();
if (from_mark_bit.Next().Get()) {
to_mark_bit.Next().Set();
+ from_mark_bit.Next().Clear();
return true;
}
}
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698