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

Unified Diff: vm/heap.cc

Issue 8996011: - Trigger old-gen GCs when needed. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 9 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 | « vm/heap.h ('k') | vm/pages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/heap.cc
===================================================================
--- vm/heap.cc (revision 2587)
+++ vm/heap.cc (working copy)
@@ -54,7 +54,7 @@
if (addr != 0) {
return addr;
}
- new_space_->Scavenge();
+ CollectGarbage(kNew);
if (FLAG_verbose_gc) {
OS::PrintErr("New space (%dk) Old space (%dk) Code space (%dk)\n",
(new_space_->in_use() / KB),
@@ -73,8 +73,14 @@
ASSERT(Isolate::Current()->no_gc_scope_depth() == 0);
uword addr = old_space_->TryAllocate(size);
if (addr == 0) {
- // TODO(iposva): Support GC.
- FATAL("Exhausted heap space.");
+ CollectGarbage(kOld);
+ if (FLAG_verbose_gc) {
cshapiro 2011/12/19 17:44:48 Lines 77-82 are a copy of lines 58-63. Maybe it i
Ivan Posva 2011/12/19 19:24:23 I am planning to pull the GC stats gathering out i
+ OS::PrintErr("New space (%dk) Old space (%dk) Code space (%dk)\n",
+ (new_space_->in_use() / KB),
+ (old_space_->in_use() / KB),
+ (code_space_->in_use() / KB));
+ }
+ addr = old_space_->TryAllocate(size);
}
return addr;
}
« no previous file with comments | « vm/heap.h ('k') | vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698