Clean up queued compilation tasks when quitting.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 21 Jun 2013 08:37:05 +0000 (08:37 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 21 Jun 2013 08:37:05 +0000 (08:37 +0000)
R=jkummerow@chromium.org
BUG=

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

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

src/optimizing-compiler-thread.cc

index e092248..99f7bc6 100644 (file)
@@ -106,12 +106,15 @@ void OptimizingCompilerThread::Stop() {
   stop_semaphore_->Wait();
 
   if (FLAG_parallel_recompilation_delay != 0) {
-    InstallOptimizedFunctions();
     // Barrier when loading queue length is not necessary since the write
     // happens in CompileNext on the same thread.
-    while (NoBarrier_Load(&queue_length_) > 0) {
-      CompileNext();
-      InstallOptimizedFunctions();
+    while (NoBarrier_Load(&queue_length_) > 0) CompileNext();
+    InstallOptimizedFunctions();
+  } else {
+    OptimizingCompiler* optimizing_compiler;
+    while (input_queue_.Dequeue(&optimizing_compiler)) {
+      // The optimizing compiler is allocated in the CompilationInfo's zone.
+      delete optimizing_compiler->info();
     }
   }