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

Unified Diff: runtime/vm/pages.cc

Issue 11434056: - Consider the growth policy even when allocating large pages. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 | « runtime/vm/pages.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
===================================================================
--- runtime/vm/pages.cc (revision 16265)
+++ runtime/vm/pages.cc (working copy)
@@ -233,7 +233,9 @@
// On overflow we fail to allocate.
return 0;
}
- if (CanIncreaseCapacity(page_size)) {
+ if ((page_space_controller_.CanGrowPageSpace(size) ||
+ growth_policy == kForceGrowth) &&
+ CanIncreaseCapacity(page_size)) {
HeapPage* page = AllocateLargePage(size, type);
if (page != NULL) {
result = page->object_start();
@@ -584,16 +586,12 @@
}
OS::PrintErr("\n");
}
- if (!enough_free_space) {
- intptr_t growth_target = static_cast<intptr_t>(in_use_after /
- desired_utilization_);
- intptr_t growth_in_bytes = Utils::RoundUp(growth_target - in_use_after,
- PageSpace::kPageSize);
- int growth_in_pages = growth_in_bytes / PageSpace::kPageSize;
- grow_heap_ = Utils::Maximum(growth_in_pages, heap_growth_rate_);
- } else {
- grow_heap_ = heap_growth_rate_;
- }
+ intptr_t growth_target = static_cast<intptr_t>(in_use_after /
+ desired_utilization_);
+ intptr_t growth_in_bytes = Utils::RoundUp(growth_target - in_use_after,
+ PageSpace::kPageSize);
+ int growth_in_pages = growth_in_bytes / PageSpace::kPageSize;
+ grow_heap_ = Utils::Maximum(growth_in_pages, heap_growth_rate_);
}
}
« no previous file with comments | « runtime/vm/pages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698