Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/optimizing-compiler-thread.cc

Issue 953883002: We don't need a lock for the output queue on the main thread (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698