Index: src/optimizing-compiler-thread.h |
diff --git a/src/optimizing-compiler-thread.h b/src/optimizing-compiler-thread.h |
index 60f95f4ea44ee4c89cc84f89a53ecdb5d9a3b2ee..3088843309fbe31b3eed34d8d079719f2431241b 100644 |
--- a/src/optimizing-compiler-thread.h |
+++ b/src/optimizing-compiler-thread.h |
@@ -35,11 +35,13 @@ class OptimizingCompilerThread : public base::Thread { |
input_queue_shift_(0), |
osr_buffer_capacity_(FLAG_concurrent_recompilation_queue_length + 4), |
osr_buffer_cursor_(0), |
+ task_count_(0), |
osr_hits_(0), |
osr_attempts_(0), |
blocked_jobs_(0), |
tracing_enabled_(FLAG_trace_concurrent_recompilation), |
- job_based_recompilation_(FLAG_job_based_recompilation) { |
+ job_based_recompilation_(FLAG_job_based_recompilation), |
+ recompilation_delay_(FLAG_concurrent_recompilation_delay) { |
base::NoBarrier_Store(&stop_thread_, |
static_cast<base::AtomicWord>(CONTINUE)); |
input_queue_ = NewArray<OptimizedCompileJob*>(input_queue_capacity_); |
@@ -93,8 +95,8 @@ class OptimizingCompilerThread : public base::Thread { |
void FlushInputQueue(bool restore_function_code); |
void FlushOutputQueue(bool restore_function_code); |
void FlushOsrBuffer(bool restore_function_code); |
- void CompileNext(); |
- OptimizedCompileJob* NextInput(); |
+ void CompileNext(OptimizedCompileJob* job); |
+ OptimizedCompileJob* NextInput(StopFlag* flag = NULL); |
// Add a recompilation task for OSR to the cyclic buffer, awaiting OSR entry. |
// Tasks evicted from the cyclic buffer are discarded. |
@@ -138,18 +140,27 @@ class OptimizingCompilerThread : public base::Thread { |
base::TimeDelta time_spent_compiling_; |
base::TimeDelta time_spent_total_; |
+ int task_count_; |
+ // TODO(jochen): This is currently a RecursiveMutex since both Flush/Stop and |
+ // Unblock try to get it, but the former methods both can call Unblock. Once |
+ // job based recompilation is on by default, and the dedicated thread can be |
+ // removed, this should be refactored to not use a RecursiveMutex. |
+ base::RecursiveMutex task_count_mutex_; |
+ |
int osr_hits_; |
int osr_attempts_; |
int blocked_jobs_; |
- // Copies of FLAG_trace_concurrent_recompilation and |
+ // Copies of FLAG_trace_concurrent_recompilation, |
+ // FLAG_concurrent_recompilation_delay and |
// FLAG_job_based_recompilation that will be used from the background thread. |
// |
// Since flags might get modified while the background thread is running, it |
// is not safe to access them directly. |
bool tracing_enabled_; |
bool job_based_recompilation_; |
+ int recompilation_delay_; |
}; |
} } // namespace v8::internal |