| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 OptimizedCompileJob* OptimizingCompilerThread::NextInput( | 162 OptimizedCompileJob* OptimizingCompilerThread::NextInput( |
| 163 bool check_if_flushing) { | 163 bool check_if_flushing) { |
| 164 base::LockGuard<base::Mutex> access_input_queue_(&input_queue_mutex_); | 164 base::LockGuard<base::Mutex> access_input_queue_(&input_queue_mutex_); |
| 165 if (input_queue_length_ == 0) return NULL; | 165 if (input_queue_length_ == 0) return NULL; |
| 166 OptimizedCompileJob* job = input_queue_[InputQueueIndex(0)]; | 166 OptimizedCompileJob* job = input_queue_[InputQueueIndex(0)]; |
| 167 DCHECK_NOT_NULL(job); | 167 DCHECK_NOT_NULL(job); |
| 168 input_queue_shift_ = InputQueueIndex(1); | 168 input_queue_shift_ = InputQueueIndex(1); |
| 169 input_queue_length_--; | 169 input_queue_length_--; |
| 170 if (check_if_flushing) { | 170 if (check_if_flushing) { |
| 171 if (static_cast<StopFlag>(base::Acquire_Load(&stop_thread_)) != CONTINUE) { | 171 if (static_cast<StopFlag>(base::Acquire_Load(&stop_thread_)) != CONTINUE) { |
| 172 if (!job->info()->is_osr()) DisposeOptimizedCompileJob(job, true); | 172 if (!job->info()->is_osr()) { |
| 173 AllowHandleDereference allow_handle_dereference; |
| 174 DisposeOptimizedCompileJob(job, true); |
| 175 } |
| 173 return NULL; | 176 return NULL; |
| 174 } | 177 } |
| 175 } | 178 } |
| 176 return job; | 179 return job; |
| 177 } | 180 } |
| 178 | 181 |
| 179 | 182 |
| 180 void OptimizingCompilerThread::CompileNext(OptimizedCompileJob* job) { | 183 void OptimizingCompilerThread::CompileNext(OptimizedCompileJob* job) { |
| 181 if (!job) return; | 184 if (!job) return; |
| 182 | 185 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 454 |
| 452 | 455 |
| 453 bool OptimizingCompilerThread::IsOptimizerThread() { | 456 bool OptimizingCompilerThread::IsOptimizerThread() { |
| 454 base::LockGuard<base::Mutex> lock_guard(&thread_id_mutex_); | 457 base::LockGuard<base::Mutex> lock_guard(&thread_id_mutex_); |
| 455 return ThreadId::Current().ToInteger() == thread_id_; | 458 return ThreadId::Current().ToInteger() == thread_id_; |
| 456 } | 459 } |
| 457 #endif | 460 #endif |
| 458 | 461 |
| 459 | 462 |
| 460 } } // namespace v8::internal | 463 } } // namespace v8::internal |
| OLD | NEW |