28 #ifndef V8_OPTIMIZING_COMPILER_THREAD_H_
29 #define V8_OPTIMIZING_COMPILER_THREAD_H_
42 class HOptimizedGraphBuilder;
43 class OptimizedCompileJob;
44 class SharedFunctionInfo;
49 Thread(
"OptimizingCompilerThread"),
55 input_queue_semaphore_(0),
56 input_queue_capacity_(FLAG_concurrent_recompilation_queue_length),
57 input_queue_length_(0),
58 input_queue_shift_(0),
59 osr_buffer_capacity_(FLAG_concurrent_recompilation_queue_length + 4),
60 osr_buffer_cursor_(0),
65 input_queue_ = NewArray<OptimizedCompileJob*>(input_queue_capacity_);
66 if (FLAG_concurrent_osr) {
68 osr_buffer_ = NewArray<OptimizedCompileJob*>(osr_buffer_capacity_);
69 for (
int i = 0; i < osr_buffer_capacity_; i++) osr_buffer_[i] =
NULL;
88 LockGuard<Mutex> access_input_queue(&input_queue_mutex_);
89 return input_queue_length_ < input_queue_capacity_;
100 return (FLAG_concurrent_recompilation && max_available > 1);
104 static bool IsOptimizerThread(
Isolate* isolate);
105 bool IsOptimizerThread();
109 enum StopFlag { CONTINUE, STOP, FLUSH };
111 void FlushInputQueue(
bool restore_function_code);
112 void FlushOutputQueue(
bool restore_function_code);
113 void FlushOsrBuffer(
bool restore_function_code);
115 OptimizedCompileJob* NextInput();
119 void AddToOsrBuffer(OptimizedCompileJob* compiler);
121 inline int InputQueueIndex(
int i) {
122 int result = (i + input_queue_shift_) % input_queue_capacity_;
124 ASSERT_LT(result, input_queue_capacity_);
130 Mutex thread_id_mutex_;
134 Semaphore stop_semaphore_;
135 Semaphore input_queue_semaphore_;
138 OptimizedCompileJob** input_queue_;
139 int input_queue_capacity_;
140 int input_queue_length_;
141 int input_queue_shift_;
142 Mutex input_queue_mutex_;
145 UnboundQueue<OptimizedCompileJob*> output_queue_;
148 OptimizedCompileJob** osr_buffer_;
149 int osr_buffer_capacity_;
150 int osr_buffer_cursor_;
153 TimeDelta time_spent_compiling_;
154 TimeDelta time_spent_total_;
164 #endif // V8_OPTIMIZING_COMPILER_THREAD_H_
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
void InstallOptimizedFunctions()
void AgeBufferedOsrJobs()
OptimizedCompileJob * FindReadyOSRCandidate(Handle< JSFunction > function, BailoutId osr_ast_id)
void NoBarrier_Store(volatile Atomic32 *ptr, Atomic32 value)
~OptimizingCompilerThread()
void QueueForOptimization(OptimizedCompileJob *optimizing_compiler)
#define ASSERT_LE(v1, v2)
static bool Enabled(int max_available)
#define ASSERT_LT(v1, v2)
OptimizingCompilerThread(Isolate *isolate)
bool IsQueuedForOSR(Handle< JSFunction > function, BailoutId osr_ast_id)