21 if (FLAG_concurrent_osr) {
34 { base::LockGuard<base::Mutex> lock_guard(&thread_id_mutex_);
43 base::ElapsedTimer total_timer;
44 if (FLAG_trace_concurrent_recompilation) total_timer.Start();
50 if (FLAG_concurrent_recompilation_delay != 0) {
58 if (FLAG_trace_concurrent_recompilation) {
75 base::ElapsedTimer compiling_timer;
76 if (FLAG_trace_concurrent_recompilation) compiling_timer.Start();
80 if (FLAG_trace_concurrent_recompilation) {
116 bool restore_function_code) {
119 if (restore_function_code) {
129 function->ReplaceCode(function->shared()->code());
172 DCHECK(!IsOptimizerThread());
174 if (FLAG_block_concurrent_recompilation)
Unblock();
179 if (FLAG_trace_concurrent_recompilation) {
180 PrintF(
" ** Flushed concurrent recompilation queues.\n");
186 DCHECK(!IsOptimizerThread());
188 if (FLAG_block_concurrent_recompilation)
Unblock();
192 if (FLAG_concurrent_recompilation_delay != 0) {
204 if (FLAG_trace_concurrent_recompilation) {
206 PrintF(
" ** Compiler thread did %.2f%% useful work\n", percentage);
209 if ((FLAG_trace_osr || FLAG_trace_concurrent_recompilation) &&
210 FLAG_concurrent_osr) {
219 DCHECK(!IsOptimizerThread());
227 if (FLAG_trace_osr) {
229 function->ShortPrint();
230 PrintF(
" is ready for install and entry at AST id %d]\n",
239 if (function->IsOptimized()) {
240 if (FLAG_trace_concurrent_recompilation) {
241 PrintF(
" ** Aborting compilation for ");
242 function->ShortPrint();
243 PrintF(
" as it has already been optimized.\n");
248 function->ReplaceCode(
249 code.
is_null() ? function->shared()->code() : *code);
258 DCHECK(!IsOptimizerThread());
277 if (FLAG_block_concurrent_recompilation) {
286 DCHECK(!IsOptimizerThread());
296 DCHECK(!IsOptimizerThread());
299 if (current !=
NULL &&
313 DCHECK(!IsOptimizerThread());
316 if (current !=
NULL &&
326 DCHECK(!IsOptimizerThread());
338 DCHECK(!IsOptimizerThread());
351 if (FLAG_trace_osr) {
352 PrintF(
"[COSR - Discarded ");
364 bool OptimizingCompilerThread::IsOptimizerThread(
Isolate* isolate) {
370 bool OptimizingCompilerThread::IsOptimizerThread() {
371 base::LockGuard<base::Mutex> lock_guard(&thread_id_mutex_);
static void Sleep(const int milliseconds)
static void RemoveStackCheck(Handle< Code > code, uint32_t pc_offset)
BailoutId osr_ast_id() const
Handle< Code > unoptimized_code() const
bool HasSameOsrEntry(Handle< JSFunction > function, BailoutId osr_ast_id)
Handle< JSFunction > closure() const
static Handle< Code > GetConcurrentlyOptimizedCode(OptimizedCompileJob *job)
StackGuard * stack_guard()
static void SetIsolateThreadLocals(Isolate *isolate, PerIsolateThreadData *data)
OptimizingCompilerThread * optimizing_compiler_thread()
bool concurrent_recompilation_enabled()
MUST_USE_RESULT Status OptimizeGraph()
CompilationInfo * info() const
bool IsWaitingForInstall()
OptimizedCompileJob ** input_queue_
base::TimeDelta time_spent_total_
int input_queue_capacity_
base::Semaphore input_queue_semaphore_
void InstallOptimizedFunctions()
void FlushInputQueue(bool restore_function_code)
OptimizedCompileJob ** osr_buffer_
UnboundQueue< OptimizedCompileJob * > output_queue_
void AddToOsrBuffer(OptimizedCompileJob *compiler)
OptimizedCompileJob * NextInput()
bool IsQueuedForOSR(Handle< JSFunction > function, BailoutId osr_ast_id)
void FlushOsrBuffer(bool restore_function_code)
volatile base::AtomicWord stop_thread_
void FlushOutputQueue(bool restore_function_code)
base::Semaphore stop_semaphore_
OptimizedCompileJob * FindReadyOSRCandidate(Handle< JSFunction > function, BailoutId osr_ast_id)
base::TimeDelta time_spent_compiling_
void QueueForOptimization(OptimizedCompileJob *optimizing_compiler)
~OptimizingCompilerThread()
int InputQueueIndex(int i)
base::Mutex input_queue_mutex_
static ThreadId Current()
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define CHECK_EQ(expected, value)
#define DCHECK_NE(v1, v2)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)
Atomic32 Acquire_Load(volatile const Atomic32 *ptr)
void Release_Store(volatile Atomic32 *ptr, Atomic32 value)
void DeleteArray(T *array)
void PrintF(const char *format,...)
static void DisposeOptimizedCompileJob(OptimizedCompileJob *job, bool restore_function_code)
Debugger support for the V8 JavaScript engine.