Flush recompile jobs on last-resort GC.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 24 Sep 2013 13:39:06 +0000 (13:39 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 24 Sep 2013 13:39:06 +0000 (13:39 +0000)
R=hpayer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/24145011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16922 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/heap.cc

index 38a5dee..7b9f0d5 100644 (file)
@@ -608,6 +608,11 @@ void Heap::CollectAllAvailableGarbage(const char* gc_reason) {
   // Note: as weak callbacks can execute arbitrary code, we cannot
   // hope that eventually there will be no weak callbacks invocations.
   // Therefore stop recollecting after several attempts.
+  if (FLAG_concurrent_recompilation) {
+    // The optimizing compiler may be unnecessarily holding on to memory.
+    DisallowHeapAllocation no_recursive_gc;
+    isolate()->optimizing_compiler_thread()->Flush();
+  }
   mark_compact_collector()->SetFlags(kMakeHeapIterableMask |
                                      kReduceMemoryFootprintMask);
   isolate_->compilation_cache()->Clear();