OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/compiler.h" | 5 #include "vm/compiler.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 | 8 |
9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
10 #include "vm/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 RawError* Compiler::CompileOptimizedFunction(Thread* thread, | 1158 RawError* Compiler::CompileOptimizedFunction(Thread* thread, |
1159 const Function& function, | 1159 const Function& function, |
1160 intptr_t osr_id) { | 1160 intptr_t osr_id) { |
1161 VMTagScope tagScope(thread, VMTag::kCompileOptimizedTagId); | 1161 VMTagScope tagScope(thread, VMTag::kCompileOptimizedTagId); |
1162 TIMELINE_FUNCTION_COMPILATION_DURATION(thread, | 1162 TIMELINE_FUNCTION_COMPILATION_DURATION(thread, |
1163 "OptimizedFunction", function); | 1163 "OptimizedFunction", function); |
1164 | 1164 |
1165 // Optimization must happen in non-mutator/Dart thread if background | 1165 // Optimization must happen in non-mutator/Dart thread if background |
1166 // compilation is on. OSR compilation still occurs in the main thread. | 1166 // compilation is on. OSR compilation still occurs in the main thread. |
1167 ASSERT((osr_id != Thread::kNoDeoptId) || !FLAG_background_compilation || | 1167 ASSERT((osr_id != Thread::kNoDeoptId) || !FLAG_background_compilation || |
1168 !thread->isolate()->MutatorThreadIsCurrentThread()); | 1168 !thread->IsMutatorThread()); |
1169 CompilationPipeline* pipeline = | 1169 CompilationPipeline* pipeline = |
1170 CompilationPipeline::New(thread->zone(), function); | 1170 CompilationPipeline::New(thread->zone(), function); |
1171 return CompileFunctionHelper(pipeline, function, true, osr_id); | 1171 return CompileFunctionHelper(pipeline, function, true, osr_id); |
1172 } | 1172 } |
1173 | 1173 |
1174 | 1174 |
1175 // This is only used from unit tests. | 1175 // This is only used from unit tests. |
1176 RawError* Compiler::CompileParsedFunction( | 1176 RawError* Compiler::CompileParsedFunction( |
1177 ParsedFunction* parsed_function) { | 1177 ParsedFunction* parsed_function) { |
1178 LongJumpScope jump; | 1178 LongJumpScope jump; |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1583 thread->zone(), GrowableObjectArray::New())); | 1583 thread->zone(), GrowableObjectArray::New())); |
1584 start_task = true; | 1584 start_task = true; |
1585 } | 1585 } |
1586 } | 1586 } |
1587 if (start_task) { | 1587 if (start_task) { |
1588 Dart::thread_pool()->Run(isolate->background_compiler()); | 1588 Dart::thread_pool()->Run(isolate->background_compiler()); |
1589 } | 1589 } |
1590 } | 1590 } |
1591 | 1591 |
1592 } // namespace dart | 1592 } // namespace dart |
OLD | NEW |