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

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: Fix for black pages 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
Index: src/heap/mark-compact.h
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h
index d6f10e601326f92dbf716735b1a69fc8e9a5eea9..aa3df2de77529a59beac81a2ec0d711b39893471 100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -159,15 +159,21 @@ class Marking : public AllStatic {
// Returns true if the transferred color is black.
Hannes Payer (out of office) 2016/05/20 07:34:41 Mention that this function clears the color of the
Marcel Hlopko 2016/05/20 14:31:41 Done.
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;
}
}
« src/heap/heap.cc ('K') | « 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