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" |
11 #include "src/v8.h" | 11 #include "src/v8.h" |
12 | 12 |
13 namespace v8 { | 13 namespace v8 { |
14 namespace internal { | 14 namespace internal { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 void DisposeCompilationJob(CompilationJob* job, bool restore_function_code) { | 18 void DisposeCompilationJob(CompilationJob* job, bool restore_function_code) { |
19 if (restore_function_code) { | 19 if (restore_function_code) { |
20 Handle<JSFunction> function = job->info()->closure(); | 20 Handle<JSFunction> function = job->info()->closure(); |
21 function->ReplaceCode(function->shared()->code()); | 21 function->ReplaceCode(function->shared()->code()); |
| 22 // TODO(mvstanton): We can't call ensureliterals here due to allocation, |
| 23 // but we probably shouldn't call ReplaceCode either, as this |
| 24 // sometimes runs on the worker thread! |
| 25 // JSFunction::EnsureLiterals(function); |
22 } | 26 } |
23 delete job; | 27 delete job; |
24 } | 28 } |
25 | 29 |
26 } // namespace | 30 } // namespace |
27 | 31 |
28 | 32 |
29 class OptimizingCompileDispatcher::CompileTask : public v8::Task { | 33 class OptimizingCompileDispatcher::CompileTask : public v8::Task { |
30 public: | 34 public: |
31 explicit CompileTask(Isolate* isolate) : isolate_(isolate) { | 35 explicit CompileTask(Isolate* isolate) : isolate_(isolate) { |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 while (blocked_jobs_ > 0) { | 217 while (blocked_jobs_ > 0) { |
214 V8::GetCurrentPlatform()->CallOnBackgroundThread( | 218 V8::GetCurrentPlatform()->CallOnBackgroundThread( |
215 new CompileTask(isolate_), v8::Platform::kShortRunningTask); | 219 new CompileTask(isolate_), v8::Platform::kShortRunningTask); |
216 blocked_jobs_--; | 220 blocked_jobs_--; |
217 } | 221 } |
218 } | 222 } |
219 | 223 |
220 | 224 |
221 } // namespace internal | 225 } // namespace internal |
222 } // namespace v8 | 226 } // namespace v8 |
OLD | NEW |