Commit 165186f2 authored by mlippautz's avatar mlippautz Committed by Commit bot

[heap] Fix Heap::EnsureFillerObjectAtTop for non-contiguous new space

R=hpayer@chromium.org
BUG=chromium:601014, chromium:601329, chromium:581412
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35327}
parent 51d39325
...@@ -943,21 +943,15 @@ void Heap::ReportExternalMemoryPressure(const char* gc_reason) { ...@@ -943,21 +943,15 @@ void Heap::ReportExternalMemoryPressure(const char* gc_reason) {
void Heap::EnsureFillerObjectAtTop() { void Heap::EnsureFillerObjectAtTop() {
// There may be an allocation memento behind every object in new space. // There may be an allocation memento behind objects in new space. Upon
// If we evacuate a not full new space or if we are on the last page of // evacuation of a non-full new space (or if we are on the last page) there
// the new space, then there may be uninitialized memory behind the top // may be uninitialized memory behind top. We fill the remainder of the page
// pointer of the new space page. We store a filler object there to // with a filler.
// identify the unused space. Address to_top = new_space_.top();
Address from_top = new_space_.top(); NewSpacePage* page = NewSpacePage::FromAddress(to_top - kPointerSize);
// Check that from_top is inside its page (i.e., not at the end). if (page->Contains(to_top)) {
Address space_end = new_space_.ToSpaceEnd(); int remaining_in_page = static_cast<int>(page->area_end() - to_top);
if (from_top < space_end) { CreateFillerObjectAt(to_top, remaining_in_page, ClearRecordedSlots::kNo);
Page* page = Page::FromAddress(from_top);
if (page->Contains(from_top)) {
int remaining_in_page = static_cast<int>(page->area_end() - from_top);
CreateFillerObjectAt(from_top, remaining_in_page,
ClearRecordedSlots::kNo);
}
} }
} }
......
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