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

Unified Diff: src/heap/heap.cc

Issue 1862263003: [heap] Fix Heap::EnsureFillerObjectAtTop for non-contiguous new space (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index a2daab0925c8aed2c30842bf041bdf4583d60bdd..8d560b8d1703b39afe785bdfbaade4c2797c9dd1 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -943,21 +943,15 @@ void Heap::ReportExternalMemoryPressure(const char* gc_reason) {
void Heap::EnsureFillerObjectAtTop() {
- // There may be an allocation memento behind every object in new space.
- // If we evacuate a not full new space or if we are on the last page of
- // the new space, then there may be uninitialized memory behind the top
- // pointer of the new space page. We store a filler object there to
- // identify the unused space.
- Address from_top = new_space_.top();
- // Check that from_top is inside its page (i.e., not at the end).
- Address space_end = new_space_.ToSpaceEnd();
- if (from_top < space_end) {
- 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);
- }
+ // There may be an allocation memento behind objects in new space. Upon
+ // evacuation of a non-full new space (or if we are on the last page) there
+ // may be uninitialized memory behind top. We fill the remainder of the page
+ // with a filler.
+ Address to_top = new_space_.top();
+ NewSpacePage* page = NewSpacePage::FromAddress(to_top - kPointerSize);
+ if (page->Contains(to_top)) {
+ int remaining_in_page = static_cast<int>(page->area_end() - to_top);
+ CreateFillerObjectAt(to_top, remaining_in_page, ClearRecordedSlots::kNo);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698