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

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

Issue 639353002: Store local copies of flags needed on the background thread (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/optimizing-compiler-thread.cc » ('j') | 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 #ifndef V8_OPTIMIZING_COMPILER_THREAD_H_ 5 #ifndef V8_OPTIMIZING_COMPILER_THREAD_H_
6 #define V8_OPTIMIZING_COMPILER_THREAD_H_ 6 #define V8_OPTIMIZING_COMPILER_THREAD_H_
7 7
8 #include "src/base/atomicops.h" 8 #include "src/base/atomicops.h"
9 #include "src/base/platform/mutex.h" 9 #include "src/base/platform/mutex.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 19 matching lines...) Expand all
30 isolate_(isolate), 30 isolate_(isolate),
31 stop_semaphore_(0), 31 stop_semaphore_(0),
32 input_queue_semaphore_(0), 32 input_queue_semaphore_(0),
33 input_queue_capacity_(FLAG_concurrent_recompilation_queue_length), 33 input_queue_capacity_(FLAG_concurrent_recompilation_queue_length),
34 input_queue_length_(0), 34 input_queue_length_(0),
35 input_queue_shift_(0), 35 input_queue_shift_(0),
36 osr_buffer_capacity_(FLAG_concurrent_recompilation_queue_length + 4), 36 osr_buffer_capacity_(FLAG_concurrent_recompilation_queue_length + 4),
37 osr_buffer_cursor_(0), 37 osr_buffer_cursor_(0),
38 osr_hits_(0), 38 osr_hits_(0),
39 osr_attempts_(0), 39 osr_attempts_(0),
40 blocked_jobs_(0) { 40 blocked_jobs_(0),
41 tracing_enabled_(FLAG_trace_concurrent_recompilation),
42 job_based_recompilation_(FLAG_job_based_recompilation) {
41 base::NoBarrier_Store(&stop_thread_, 43 base::NoBarrier_Store(&stop_thread_,
42 static_cast<base::AtomicWord>(CONTINUE)); 44 static_cast<base::AtomicWord>(CONTINUE));
43 input_queue_ = NewArray<OptimizedCompileJob*>(input_queue_capacity_); 45 input_queue_ = NewArray<OptimizedCompileJob*>(input_queue_capacity_);
44 if (FLAG_concurrent_osr) { 46 if (FLAG_concurrent_osr) {
45 // Allocate and mark OSR buffer slots as empty. 47 // Allocate and mark OSR buffer slots as empty.
46 osr_buffer_ = NewArray<OptimizedCompileJob*>(osr_buffer_capacity_); 48 osr_buffer_ = NewArray<OptimizedCompileJob*>(osr_buffer_capacity_);
47 for (int i = 0; i < osr_buffer_capacity_; i++) osr_buffer_[i] = NULL; 49 for (int i = 0; i < osr_buffer_capacity_; i++) osr_buffer_[i] = NULL;
48 } 50 }
49 } 51 }
50 52
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 int osr_buffer_cursor_; 135 int osr_buffer_cursor_;
134 136
135 volatile base::AtomicWord stop_thread_; 137 volatile base::AtomicWord stop_thread_;
136 base::TimeDelta time_spent_compiling_; 138 base::TimeDelta time_spent_compiling_;
137 base::TimeDelta time_spent_total_; 139 base::TimeDelta time_spent_total_;
138 140
139 int osr_hits_; 141 int osr_hits_;
140 int osr_attempts_; 142 int osr_attempts_;
141 143
142 int blocked_jobs_; 144 int blocked_jobs_;
145
146 // Copies of FLAG_trace_concurrent_recompilation and
147 // FLAG_job_based_recompilation that will be used from the background thread.
148 //
149 // Since flags might get modified while the background thread is running, it
150 // is not safe to access them directly.
151 bool tracing_enabled_;
152 bool job_based_recompilation_;
143 }; 153 };
144 154
145 } } // namespace v8::internal 155 } } // namespace v8::internal
146 156
147 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_ 157 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_
OLDNEW
« no previous file with comments | « no previous file | src/optimizing-compiler-thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698