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

Unified Diff: src/heap/heap-inl.h

Issue 2383443002: Revert of [heap] Remove border page (Closed)
Patch Set: Created 4 years, 3 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/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap-inl.h
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h
index 4ec176b51df40f25a804d541769fb06eebb78a39..d74bec0dfb6f6047c71b43822a0edb24d0e2de2d 100644
--- a/src/heap/heap-inl.h
+++ b/src/heap/heap-inl.h
@@ -482,6 +482,9 @@ bool Heap::InOldSpaceSlow(Address address) {
template <PromotionMode promotion_mode>
bool Heap::ShouldBePromoted(Address old_address, int object_size) {
+ Page* page = Page::FromAddress(old_address);
+ Address age_mark = new_space_->age_mark();
+
if (promotion_mode == PROMOTE_MARKED) {
MarkBit mark_bit = ObjectMarking::MarkBitFrom(old_address);
if (!Marking::IsWhite(mark_bit)) {
@@ -489,7 +492,8 @@ bool Heap::ShouldBePromoted(Address old_address, int object_size) {
}
}
- return Page::FromAddress(old_address)->InIntermediateGeneration();
+ return page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) &&
+ (!page->ContainsLimit(age_mark) || old_address < age_mark);
}
PromotionMode Heap::CurrentPromotionMode() {
@@ -590,8 +594,16 @@ AllocationMemento* Heap::FindAllocationMemento(HeapObject* object) {
// Bail out if the memento is below the age mark, which can happen when
// mementos survived because a page got moved within new space.
Page* object_page = Page::FromAddress(object_address);
- if (object_page->InIntermediateGeneration()) {
- return nullptr;
+ if (object_page->IsFlagSet(Page::NEW_SPACE_BELOW_AGE_MARK)) {
+ Address age_mark =
+ reinterpret_cast<SemiSpace*>(object_page->owner())->age_mark();
+ if (!object_page->Contains(age_mark)) {
+ return nullptr;
+ }
+ // Do an exact check in the case where the age mark is on the same page.
+ if (object_address < age_mark) {
+ return nullptr;
+ }
}
AllocationMemento* memento_candidate = AllocationMemento::cast(candidate);
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698