Commit 88feffc2 authored by jochen's avatar jochen Committed by Commit bot

Implement missing functionality for job based recompilation

BUG=v8:3608
R=bmeurer@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/816363003

Cr-Commit-Position: refs/heads/master@{#25925}
parent 1ec1f595
......@@ -356,7 +356,6 @@ DEFINE_BOOL(job_based_recompilation, false,
"post tasks to v8::Platform instead of using a thread for "
"concurrent recompilation")
DEFINE_IMPLICATION(job_based_recompilation, concurrent_recompilation)
DEFINE_NEG_IMPLICATION(job_based_recompilation, block_concurrent_recompilation)
DEFINE_BOOL(trace_concurrent_recompilation, false,
"track concurrent recompilation")
DEFINE_INT(concurrent_recompilation_queue_length, 8,
......
This diff is collapsed.
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment