| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/optimizing-compiler-thread.h" | 5 #include "src/optimizing-compiler-thread.h" |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
| 10 #include "src/full-codegen.h" | 10 #include "src/full-codegen.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 input_queue_semaphore_.Wait(); | 239 input_queue_semaphore_.Wait(); |
| 240 // OSR jobs are dealt with separately. | 240 // OSR jobs are dealt with separately. |
| 241 if (!job->info()->is_osr()) { | 241 if (!job->info()->is_osr()) { |
| 242 DisposeOptimizedCompileJob(job, restore_function_code); | 242 DisposeOptimizedCompileJob(job, restore_function_code); |
| 243 } | 243 } |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| 247 | 247 |
| 248 void OptimizingCompilerThread::FlushOutputQueue(bool restore_function_code) { | 248 void OptimizingCompilerThread::FlushOutputQueue(bool restore_function_code) { |
| 249 base::LockGuard<base::Mutex> access_output_queue_(&output_queue_mutex_); | |
| 250 OptimizedCompileJob* job; | 249 OptimizedCompileJob* job; |
| 251 while (output_queue_.Dequeue(&job)) { | 250 while (output_queue_.Dequeue(&job)) { |
| 252 // OSR jobs are dealt with separately. | 251 // OSR jobs are dealt with separately. |
| 253 if (!job->info()->is_osr()) { | 252 if (!job->info()->is_osr()) { |
| 254 DisposeOptimizedCompileJob(job, restore_function_code); | 253 DisposeOptimizedCompileJob(job, restore_function_code); |
| 255 } | 254 } |
| 256 } | 255 } |
| 257 } | 256 } |
| 258 | 257 |
| 259 | 258 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 | 500 |
| 502 | 501 |
| 503 bool OptimizingCompilerThread::IsOptimizerThread() { | 502 bool OptimizingCompilerThread::IsOptimizerThread() { |
| 504 base::LockGuard<base::Mutex> lock_guard(&thread_id_mutex_); | 503 base::LockGuard<base::Mutex> lock_guard(&thread_id_mutex_); |
| 505 return ThreadId::Current().ToInteger() == thread_id_; | 504 return ThreadId::Current().ToInteger() == thread_id_; |
| 506 } | 505 } |
| 507 #endif | 506 #endif |
| 508 | 507 |
| 509 | 508 |
| 510 } } // namespace v8::internal | 509 } } // namespace v8::internal |
| OLD | NEW |