Chromium Code Reviews| Index: src/heap/heap-inl.h |
| diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h |
| index f9c9235320b25df45a116cd08fd04fe7b4692451..9ac05590c8ababfa31357354a3fc2bfa6bcd417e 100644 |
| --- a/src/heap/heap-inl.h |
| +++ b/src/heap/heap-inl.h |
| @@ -393,10 +393,18 @@ bool Heap::OldGenerationAllocationLimitReached() { |
| return OldGenerationSpaceAvailable() < 0; |
| } |
| - |
| +template <MarksHandling marks_handling> |
| bool Heap::ShouldBePromoted(Address old_address, int object_size) { |
| Page* page = Page::FromAddress(old_address); |
| Address age_mark = new_space_.age_mark(); |
| + |
| + if (marks_handling == TRANSFER_MARKS) { |
|
Michael Lippautz
2016/05/24 11:54:51
TRANSFER_MARKS is a confusing name for this one as
|
| + MarkBit mark_bit = Marking::MarkBitFrom(old_address); |
| + if (!Marking::IsWhite(mark_bit)) { |
| + return true; |
| + } |
| + } |
| + |
| return page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) && |
| (!page->ContainsLimit(age_mark) || old_address < age_mark); |
| } |