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/tracing/trace-event.h" | 10 #include "src/tracing/trace-event.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 CompilationInfo* info = job->info(); | 191 CompilationInfo* info = job->info(); |
192 Handle<JSFunction> function(*info->closure()); | 192 Handle<JSFunction> function(*info->closure()); |
193 if (function->IsOptimized()) { | 193 if (function->IsOptimized()) { |
194 if (FLAG_trace_concurrent_recompilation) { | 194 if (FLAG_trace_concurrent_recompilation) { |
195 PrintF(" ** Aborting compilation for "); | 195 PrintF(" ** Aborting compilation for "); |
196 function->ShortPrint(); | 196 function->ShortPrint(); |
197 PrintF(" as it has already been optimized.\n"); | 197 PrintF(" as it has already been optimized.\n"); |
198 } | 198 } |
199 DisposeOptimizedCompileJob(job, false); | 199 DisposeOptimizedCompileJob(job, false); |
200 } else { | 200 } else { |
201 MaybeHandle<Code> code = Compiler::GetConcurrentlyOptimizedCode(job); | 201 Compiler::FinalizeOptimizedCompileJob(job); |
202 function->ReplaceCode(code.is_null() ? function->shared()->code() | |
203 : *code.ToHandleChecked()); | |
204 } | 202 } |
205 } | 203 } |
206 } | 204 } |
207 | 205 |
208 | 206 |
209 void OptimizingCompileDispatcher::QueueForOptimization( | 207 void OptimizingCompileDispatcher::QueueForOptimization( |
210 OptimizedCompileJob* job) { | 208 OptimizedCompileJob* job) { |
211 DCHECK(IsQueueAvailable()); | 209 DCHECK(IsQueueAvailable()); |
212 { | 210 { |
213 // Add job to the back of the input queue. | 211 // Add job to the back of the input queue. |
(...skipping 15 matching lines...) Expand all Loading... |
229 while (blocked_jobs_ > 0) { | 227 while (blocked_jobs_ > 0) { |
230 V8::GetCurrentPlatform()->CallOnBackgroundThread( | 228 V8::GetCurrentPlatform()->CallOnBackgroundThread( |
231 new CompileTask(isolate_), v8::Platform::kShortRunningTask); | 229 new CompileTask(isolate_), v8::Platform::kShortRunningTask); |
232 blocked_jobs_--; | 230 blocked_jobs_--; |
233 } | 231 } |
234 } | 232 } |
235 | 233 |
236 | 234 |
237 } // namespace internal | 235 } // namespace internal |
238 } // namespace v8 | 236 } // namespace v8 |
OLD | NEW |