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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 if (!parse_class.IsNull()) { | 259 if (!parse_class.IsNull()) { |
260 if (!parse_class.is_finalized() && !parse_class.is_marked_for_parsing()) { | 260 if (!parse_class.is_finalized() && !parse_class.is_marked_for_parsing()) { |
261 patch_list->Add(parse_class); | 261 patch_list->Add(parse_class); |
262 parse_class.set_is_marked_for_parsing(); | 262 parse_class.set_is_marked_for_parsing(); |
263 } | 263 } |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 | 267 |
268 RawError* Compiler::CompileClass(const Class& cls) { | 268 RawError* Compiler::CompileClass(const Class& cls) { |
| 269 ASSERT(Thread::Current()->IsMutatorThread()); |
269 // If class is a top level class it is already parsed. | 270 // If class is a top level class it is already parsed. |
270 if (cls.IsTopLevel()) { | 271 if (cls.IsTopLevel()) { |
271 return Error::null(); | 272 return Error::null(); |
272 } | 273 } |
273 // If the class is already marked for parsing return immediately. | 274 // If the class is already marked for parsing return immediately. |
274 if (cls.is_marked_for_parsing()) { | 275 if (cls.is_marked_for_parsing()) { |
275 return Error::null(); | 276 return Error::null(); |
276 } | 277 } |
277 // If the class is a signature class there is no need to try and | 278 // If the class is a signature class there is no need to try and |
278 // compile it. Just finalize it directly. | 279 // compile it. Just finalize it directly. |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1826 task->set_compilation_result_queue(a); | 1827 task->set_compilation_result_queue(a); |
1827 start_task = true; | 1828 start_task = true; |
1828 } | 1829 } |
1829 } | 1830 } |
1830 if (start_task) { | 1831 if (start_task) { |
1831 Dart::thread_pool()->Run(isolate->background_compiler()); | 1832 Dart::thread_pool()->Run(isolate->background_compiler()); |
1832 } | 1833 } |
1833 } | 1834 } |
1834 | 1835 |
1835 } // namespace dart | 1836 } // namespace dart |
OLD | NEW |