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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 100 } |
101 } | 101 } |
102 return job; | 102 return job; |
103 } | 103 } |
104 | 104 |
105 void OptimizingCompileDispatcher::CompileNext(CompilationJob* job) { | 105 void OptimizingCompileDispatcher::CompileNext(CompilationJob* job) { |
106 if (!job) return; | 106 if (!job) return; |
107 | 107 |
108 // The function may have already been optimized by OSR. Simply continue. | 108 // The function may have already been optimized by OSR. Simply continue. |
109 CompilationJob::Status status = job->OptimizeGraph(); | 109 CompilationJob::Status status = job->OptimizeGraph(); |
110 USE(status); // Prevent an unused-variable error in release mode. | 110 USE(status); // Prevent an unused-variable error. |
111 DCHECK(status != CompilationJob::FAILED); | |
112 | 111 |
113 // The function may have already been optimized by OSR. Simply continue. | 112 // The function may have already been optimized by OSR. Simply continue. |
114 // Use a mutex to make sure that functions marked for install | 113 // Use a mutex to make sure that functions marked for install |
115 // are always also queued. | 114 // are always also queued. |
116 base::LockGuard<base::Mutex> access_output_queue_(&output_queue_mutex_); | 115 base::LockGuard<base::Mutex> access_output_queue_(&output_queue_mutex_); |
117 output_queue_.push(job); | 116 output_queue_.push(job); |
118 isolate_->stack_guard()->RequestInstallCode(); | 117 isolate_->stack_guard()->RequestInstallCode(); |
119 } | 118 } |
120 | 119 |
121 | 120 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 while (blocked_jobs_ > 0) { | 216 while (blocked_jobs_ > 0) { |
218 V8::GetCurrentPlatform()->CallOnBackgroundThread( | 217 V8::GetCurrentPlatform()->CallOnBackgroundThread( |
219 new CompileTask(isolate_), v8::Platform::kShortRunningTask); | 218 new CompileTask(isolate_), v8::Platform::kShortRunningTask); |
220 blocked_jobs_--; | 219 blocked_jobs_--; |
221 } | 220 } |
222 } | 221 } |
223 | 222 |
224 | 223 |
225 } // namespace internal | 224 } // namespace internal |
226 } // namespace v8 | 225 } // namespace v8 |
OLD | NEW |