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

Unified Diff: runtime/vm/heap.cc

Issue 10442073: Implement growth policy for old space using time and space signals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 8 years, 7 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 | « runtime/vm/heap.h ('k') | runtime/vm/pages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index 1a4df3c328eb4f54527af2524f8d398937bea608..0b2ea80c2eff93382b996fb09d923f2f2a47e668 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -77,7 +77,6 @@ uword Heap::AllocateOld(intptr_t size) {
}
addr = old_space_->TryAllocate(size);
if (addr == 0) {
- // TODO(cshapiro): Support possible heap growth and OOM exception.
OS::PrintErr("Exhausted heap space, trying to allocate %d bytes.\n",
size);
}
@@ -143,6 +142,9 @@ void Heap::CollectGarbage(Space space, ApiCallbacks api_callbacks) {
switch (space) {
case kNew:
new_space_->Scavenge(invoke_api_callbacks);
+ if (new_space_->HadPromotionFailure()) {
+ old_space_->MarkSweep(true);
+ }
break;
case kOld:
old_space_->MarkSweep(invoke_api_callbacks);
@@ -176,6 +178,11 @@ void Heap::CollectAllGarbage() {
}
+void Heap::EnableGrowthControl() {
+ old_space_->EnableGrowthControl();
+}
+
+
uword Heap::TopAddress() {
return reinterpret_cast<uword>(new_space_->TopAddress());
}
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698