| 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 #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/atomicops.h" | 8 #include "src/base/atomicops.h" |
| 9 #include "src/flags.h" | 9 #include "src/flags.h" |
| 10 #include "src/list.h" | 10 #include "src/list.h" |
| 11 #include "src/platform.h" | 11 #include "src/platform.h" |
| 12 #include "src/platform/mutex.h" | 12 #include "src/platform/mutex.h" |
| 13 #include "src/platform/time.h" | 13 #include "src/platform/time.h" |
| 14 #include "src/unbound-queue-inl.h" | 14 #include "src/unbound-queue-inl.h" |
| 15 | 15 |
| 16 namespace v8 { | 16 namespace v8 { |
| 17 namespace internal { | 17 namespace internal { |
| 18 | 18 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 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 NoBarrier_Store(&stop_thread_, static_cast<AtomicWord>(CONTINUE)); | 41 base::NoBarrier_Store(&stop_thread_, |
| 42 static_cast<base::AtomicWord>(CONTINUE)); |
| 42 input_queue_ = NewArray<OptimizedCompileJob*>(input_queue_capacity_); | 43 input_queue_ = NewArray<OptimizedCompileJob*>(input_queue_capacity_); |
| 43 if (FLAG_concurrent_osr) { | 44 if (FLAG_concurrent_osr) { |
| 44 // Allocate and mark OSR buffer slots as empty. | 45 // Allocate and mark OSR buffer slots as empty. |
| 45 osr_buffer_ = NewArray<OptimizedCompileJob*>(osr_buffer_capacity_); | 46 osr_buffer_ = NewArray<OptimizedCompileJob*>(osr_buffer_capacity_); |
| 46 for (int i = 0; i < osr_buffer_capacity_; i++) osr_buffer_[i] = NULL; | 47 for (int i = 0; i < osr_buffer_capacity_; i++) osr_buffer_[i] = NULL; |
| 47 } | 48 } |
| 48 } | 49 } |
| 49 | 50 |
| 50 ~OptimizingCompilerThread(); | 51 ~OptimizingCompilerThread(); |
| 51 | 52 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 Mutex input_queue_mutex_; | 120 Mutex input_queue_mutex_; |
| 120 | 121 |
| 121 // Queue of recompilation tasks ready to be installed (excluding OSR). | 122 // Queue of recompilation tasks ready to be installed (excluding OSR). |
| 122 UnboundQueue<OptimizedCompileJob*> output_queue_; | 123 UnboundQueue<OptimizedCompileJob*> output_queue_; |
| 123 | 124 |
| 124 // Cyclic buffer of recompilation tasks for OSR. | 125 // Cyclic buffer of recompilation tasks for OSR. |
| 125 OptimizedCompileJob** osr_buffer_; | 126 OptimizedCompileJob** osr_buffer_; |
| 126 int osr_buffer_capacity_; | 127 int osr_buffer_capacity_; |
| 127 int osr_buffer_cursor_; | 128 int osr_buffer_cursor_; |
| 128 | 129 |
| 129 volatile AtomicWord stop_thread_; | 130 volatile base::AtomicWord stop_thread_; |
| 130 TimeDelta time_spent_compiling_; | 131 TimeDelta time_spent_compiling_; |
| 131 TimeDelta time_spent_total_; | 132 TimeDelta time_spent_total_; |
| 132 | 133 |
| 133 int osr_hits_; | 134 int osr_hits_; |
| 134 int osr_attempts_; | 135 int osr_attempts_; |
| 135 | 136 |
| 136 int blocked_jobs_; | 137 int blocked_jobs_; |
| 137 }; | 138 }; |
| 138 | 139 |
| 139 } } // namespace v8::internal | 140 } } // namespace v8::internal |
| 140 | 141 |
| 141 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_ | 142 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_ |
| OLD | NEW |