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

Unified Diff: src/heap/heap.cc

Issue 1066653003: Insert a filler at the new space top even if the top is at the limit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | test/cctest/test-mementos.cc » ('j') | 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 274d9ef0c22e83a5cc1f92ad8a03da6e7b9c6244..9aef842684ed248f5544121b02aa1566a998078e 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -794,10 +794,14 @@ void Heap::EnsureFillerObjectAtTop() {
// pointer of the new space page. We store a filler object there to
// identify the unused space.
Address from_top = new_space_.top();
- Address from_limit = new_space_.limit();
- if (from_top < from_limit) {
- int remaining_in_page = static_cast<int>(from_limit - from_top);
- CreateFillerObjectAt(from_top, remaining_in_page);
+ // 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);
+ }
}
}
« no previous file with comments | « no previous file | test/cctest/test-mementos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698