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

Unified Diff: src/runtime.cc

Issue 8873: Allow three runtime call attempts before throwing an out of... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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 | « src/handles.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 636)
+++ src/runtime.cc (working copy)
@@ -5770,9 +5770,15 @@
void Runtime::PerformGC(Object* result) {
Failure* failure = Failure::cast(result);
- // Try to do a garbage collection; ignore it if it fails. The C
- // entry stub will throw an out-of-memory exception in that case.
- Heap::CollectGarbage(failure->requested(), failure->allocation_space());
+ if (failure->IsRetryAfterGC()) {
+ // Try to do a garbage collection; ignore it if it fails. The C
+ // entry stub will throw an out-of-memory exception in that case.
+ Heap::CollectGarbage(failure->requested(), failure->allocation_space());
+ } else {
+ // Handle last resort GC and make sure to allow future allocations
+ // to grow the heap without causing GCs (if possible).
+ Heap::CollectAllGarbage();
+ }
}
« no previous file with comments | « src/handles.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698