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/compiler-dispatcher/optimizing-compile-dispatcher.h" | 5 #include "src/compiler-dispatcher/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 return NULL; | 100 return NULL; |
101 } | 101 } |
102 } | 102 } |
103 return job; | 103 return job; |
104 } | 104 } |
105 | 105 |
106 void OptimizingCompileDispatcher::CompileNext(CompilationJob* job) { | 106 void OptimizingCompileDispatcher::CompileNext(CompilationJob* job) { |
107 if (!job) return; | 107 if (!job) return; |
108 | 108 |
109 // The function may have already been optimized by OSR. Simply continue. | 109 // The function may have already been optimized by OSR. Simply continue. |
110 CompilationJob::Status status = job->ExecuteJob(); | 110 CompilationJob::Status status = job->OptimizeGraph(); |
111 USE(status); // Prevent an unused-variable error. | 111 USE(status); // Prevent an unused-variable error. |
112 | 112 |
113 // The function may have already been optimized by OSR. Simply continue. | 113 // The function may have already been optimized by OSR. Simply continue. |
114 // Use a mutex to make sure that functions marked for install | 114 // Use a mutex to make sure that functions marked for install |
115 // are always also queued. | 115 // are always also queued. |
116 base::LockGuard<base::Mutex> access_output_queue_(&output_queue_mutex_); | 116 base::LockGuard<base::Mutex> access_output_queue_(&output_queue_mutex_); |
117 output_queue_.push(job); | 117 output_queue_.push(job); |
118 isolate_->stack_guard()->RequestInstallCode(); | 118 isolate_->stack_guard()->RequestInstallCode(); |
119 } | 119 } |
120 | 120 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 void OptimizingCompileDispatcher::Unblock() { | 211 void OptimizingCompileDispatcher::Unblock() { |
212 while (blocked_jobs_ > 0) { | 212 while (blocked_jobs_ > 0) { |
213 V8::GetCurrentPlatform()->CallOnBackgroundThread( | 213 V8::GetCurrentPlatform()->CallOnBackgroundThread( |
214 new CompileTask(isolate_), v8::Platform::kShortRunningTask); | 214 new CompileTask(isolate_), v8::Platform::kShortRunningTask); |
215 blocked_jobs_--; | 215 blocked_jobs_--; |
216 } | 216 } |
217 } | 217 } |
218 | 218 |
219 } // namespace internal | 219 } // namespace internal |
220 } // namespace v8 | 220 } // namespace v8 |
OLD | NEW |