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

Unified Diff: src/heap/spaces.h

Issue 2090013002: [heap] Fix check in AdvancePage (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/mjsunit/regress/regress-620750.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index 29a0b66d9de1ae4ea8b4614ba970eaaa1e68eb52..eec533f9a1e01a4c470fc274c809ddde59234923 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -2459,7 +2459,11 @@ class SemiSpace : public Space {
bool AdvancePage() {
Page* next_page = current_page_->next_page();
- if (next_page == anchor() || pages_used_ == max_pages()) {
+ // We cannot expand if we reached the maximum number of pages already. Note
+ // that we need to account for the next page already for this check as we
+ // could potentially fill the whole page after advancing.
+ const bool reached_max_pages = (pages_used_ + 1) == max_pages();
+ if (next_page == anchor() || reached_max_pages) {
return false;
}
current_page_ = next_page;
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-620750.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698