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 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1131 #endif | 1131 #endif |
1132 return Error::null(); | 1132 return Error::null(); |
1133 } else { | 1133 } else { |
1134 Thread* const thread = Thread::Current(); | 1134 Thread* const thread = Thread::Current(); |
1135 Isolate* const isolate = thread->isolate(); | 1135 Isolate* const isolate = thread->isolate(); |
1136 StackZone stack_zone(thread); | 1136 StackZone stack_zone(thread); |
1137 Error& error = Error::Handle(); | 1137 Error& error = Error::Handle(); |
1138 // We got an error during compilation. | 1138 // We got an error during compilation. |
1139 error = isolate->object_store()->sticky_error(); | 1139 error = isolate->object_store()->sticky_error(); |
1140 isolate->object_store()->clear_sticky_error(); | 1140 isolate->object_store()->clear_sticky_error(); |
1141 ASSERT(!optimized); | 1141 ASSERT(!optimized || Compiler::always_optimize()); |
srdjan
2015/11/09 23:17:32
Maybe add comment: precompilation can have errors.
rmacnak
2015/11/10 02:19:40
Added
| |
1142 // Do not attempt to optimize functions that can cause errors. | 1142 // Do not attempt to optimize functions that can cause errors. |
1143 function.set_is_optimizable(false); | 1143 function.set_is_optimizable(false); |
1144 return error.raw(); | 1144 return error.raw(); |
1145 } | 1145 } |
1146 UNREACHABLE(); | 1146 UNREACHABLE(); |
1147 return Error::null(); | 1147 return Error::null(); |
1148 } | 1148 } |
1149 | 1149 |
1150 | 1150 |
1151 RawError* Compiler::CompileFunction(Thread* thread, | 1151 RawError* Compiler::CompileFunction(Thread* thread, |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1828 isolate->set_background_compiler(task); | 1828 isolate->set_background_compiler(task); |
1829 start_task = true; | 1829 start_task = true; |
1830 } | 1830 } |
1831 } | 1831 } |
1832 if (start_task) { | 1832 if (start_task) { |
1833 Dart::thread_pool()->Run(isolate->background_compiler()); | 1833 Dart::thread_pool()->Run(isolate->background_compiler()); |
1834 } | 1834 } |
1835 } | 1835 } |
1836 | 1836 |
1837 } // namespace dart | 1837 } // namespace dart |
OLD | NEW |