Remove unnecessary mutex.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 30 Sep 2013 11:41:30 +0000 (11:41 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 30 Sep 2013 11:41:30 +0000 (11:41 +0000)
The heap leak has since been solved.

R=mstarzinger@chromium.org
BUG=291236

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

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

src/optimizing-compiler-thread.cc
src/optimizing-compiler-thread.h

index d9c82ce..202e6e5 100644 (file)
@@ -108,7 +108,6 @@ void OptimizingCompilerThread::CompileNext() {
   // The function may have already been optimized by OSR.  Simply continue.
   // Use a mutex to make sure that functions marked for install
   // are always also queued.
-  LockGuard<Mutex> access_queue(&queue_mutex_);
   output_queue_.Enqueue(job);
   isolate_->stack_guard()->RequestInstallCode();
 }
@@ -147,10 +146,7 @@ void OptimizingCompilerThread::FlushInputQueue(bool restore_function_code) {
 
 void OptimizingCompilerThread::FlushOutputQueue(bool restore_function_code) {
   RecompileJob* job;
-  while (true) {
-    { LockGuard<Mutex> access_queue(&queue_mutex_);
-      if (!output_queue_.Dequeue(&job)) break;
-    }
+  while (output_queue_.Dequeue(&job)) {
     // OSR jobs are dealt with separately.
     if (!job->info()->is_osr()) {
       DisposeRecompileJob(job, restore_function_code);
@@ -220,10 +216,7 @@ void OptimizingCompilerThread::InstallOptimizedFunctions() {
   HandleScope handle_scope(isolate_);
 
   RecompileJob* job;
-  while (true) {
-    { LockGuard<Mutex> access_queue(&queue_mutex_);
-      if (!output_queue_.Dequeue(&job)) break;
-    }
+  while (output_queue_.Dequeue(&job)) {
     CompilationInfo* info = job->info();
     if (info->is_osr()) {
       if (FLAG_trace_osr) {
index 2165a4f..d98a8b2 100644 (file)
@@ -139,8 +139,6 @@ class OptimizingCompilerThread : public Thread {
   TimeDelta time_spent_compiling_;
   TimeDelta time_spent_total_;
 
-  // TODO(yangguo): remove this once the memory leak has been figured out.
-  Mutex queue_mutex_;
   int osr_hits_;
   int osr_attempts_;
 };