| 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 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 #endif | 1148 #endif |
| 1149 return Error::null(); | 1149 return Error::null(); |
| 1150 } else { | 1150 } else { |
| 1151 Thread* const thread = Thread::Current(); | 1151 Thread* const thread = Thread::Current(); |
| 1152 Isolate* const isolate = thread->isolate(); | 1152 Isolate* const isolate = thread->isolate(); |
| 1153 StackZone stack_zone(thread); | 1153 StackZone stack_zone(thread); |
| 1154 Error& error = Error::Handle(); | 1154 Error& error = Error::Handle(); |
| 1155 // We got an error during compilation. | 1155 // We got an error during compilation. |
| 1156 error = isolate->object_store()->sticky_error(); | 1156 error = isolate->object_store()->sticky_error(); |
| 1157 isolate->object_store()->clear_sticky_error(); | 1157 isolate->object_store()->clear_sticky_error(); |
| 1158 ASSERT(!optimized); | 1158 // Unoptimized compilation or precompilation may encounter compile-time |
| 1159 // errors, but regular optimized compilation should not. |
| 1160 ASSERT(!optimized || Compiler::always_optimize()); |
| 1159 // Do not attempt to optimize functions that can cause errors. | 1161 // Do not attempt to optimize functions that can cause errors. |
| 1160 function.set_is_optimizable(false); | 1162 function.set_is_optimizable(false); |
| 1161 return error.raw(); | 1163 return error.raw(); |
| 1162 } | 1164 } |
| 1163 UNREACHABLE(); | 1165 UNREACHABLE(); |
| 1164 return Error::null(); | 1166 return Error::null(); |
| 1165 } | 1167 } |
| 1166 | 1168 |
| 1167 | 1169 |
| 1168 RawError* Compiler::CompileFunction(Thread* thread, | 1170 RawError* Compiler::CompileFunction(Thread* thread, |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1943 isolate->set_background_compiler(task); | 1945 isolate->set_background_compiler(task); |
| 1944 start_task = true; | 1946 start_task = true; |
| 1945 } | 1947 } |
| 1946 } | 1948 } |
| 1947 if (start_task) { | 1949 if (start_task) { |
| 1948 Dart::thread_pool()->Run(isolate->background_compiler()); | 1950 Dart::thread_pool()->Run(isolate->background_compiler()); |
| 1949 } | 1951 } |
| 1950 } | 1952 } |
| 1951 | 1953 |
| 1952 } // namespace dart | 1954 } // namespace dart |
| OLD | NEW |