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 #include "src/optimizing-compile-dispatcher.h" | 5 #include "src/optimizing-compile-dispatcher.h" |
6 | 6 |
7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
8 #include "src/full-codegen/full-codegen.h" | 8 #include "src/full-codegen/full-codegen.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 BackEdgeTable::RemoveStackCheck(code, offset); | 237 BackEdgeTable::RemoveStackCheck(code, offset); |
238 } else { | 238 } else { |
239 if (function->IsOptimized()) { | 239 if (function->IsOptimized()) { |
240 if (FLAG_trace_concurrent_recompilation) { | 240 if (FLAG_trace_concurrent_recompilation) { |
241 PrintF(" ** Aborting compilation for "); | 241 PrintF(" ** Aborting compilation for "); |
242 function->ShortPrint(); | 242 function->ShortPrint(); |
243 PrintF(" as it has already been optimized.\n"); | 243 PrintF(" as it has already been optimized.\n"); |
244 } | 244 } |
245 DisposeOptimizedCompileJob(job, false); | 245 DisposeOptimizedCompileJob(job, false); |
246 } else { | 246 } else { |
247 Handle<Code> code = Compiler::GetConcurrentlyOptimizedCode(job); | 247 MaybeHandle<Code> code = Compiler::GetConcurrentlyOptimizedCode(job); |
248 function->ReplaceCode(code.is_null() ? function->shared()->code() | 248 function->ReplaceCode(code.is_null() ? function->shared()->code() |
249 : *code); | 249 : *code.ToHandleChecked()); |
250 } | 250 } |
251 } | 251 } |
252 } | 252 } |
253 } | 253 } |
254 | 254 |
255 | 255 |
256 void OptimizingCompileDispatcher::QueueForOptimization( | 256 void OptimizingCompileDispatcher::QueueForOptimization( |
257 OptimizedCompileJob* job) { | 257 OptimizedCompileJob* job) { |
258 DCHECK(IsQueueAvailable()); | 258 DCHECK(IsQueueAvailable()); |
259 CompilationInfo* info = job->info(); | 259 CompilationInfo* info = job->info(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 info->closure()->PrintName(); | 349 info->closure()->PrintName(); |
350 PrintF(", AST id %d]\n", info->osr_ast_id().ToInt()); | 350 PrintF(", AST id %d]\n", info->osr_ast_id().ToInt()); |
351 } | 351 } |
352 DisposeOptimizedCompileJob(stale, false); | 352 DisposeOptimizedCompileJob(stale, false); |
353 } | 353 } |
354 osr_buffer_[osr_buffer_cursor_] = job; | 354 osr_buffer_[osr_buffer_cursor_] = job; |
355 osr_buffer_cursor_ = (osr_buffer_cursor_ + 1) % osr_buffer_capacity_; | 355 osr_buffer_cursor_ = (osr_buffer_cursor_ + 1) % osr_buffer_capacity_; |
356 } | 356 } |
357 } // namespace internal | 357 } // namespace internal |
358 } // namespace v8 | 358 } // namespace v8 |
OLD | NEW |