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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 RawError* Compiler::CompileClass(const Class& cls) { | 275 RawError* Compiler::CompileClass(const Class& cls) { |
276 ASSERT(Thread::Current()->IsMutatorThread()); | 276 ASSERT(Thread::Current()->IsMutatorThread()); |
277 // If class is a top level class it is already parsed. | 277 // If class is a top level class it is already parsed. |
278 if (cls.IsTopLevel()) { | 278 if (cls.IsTopLevel()) { |
279 return Error::null(); | 279 return Error::null(); |
280 } | 280 } |
281 // If the class is already marked for parsing return immediately. | 281 // If the class is already marked for parsing return immediately. |
282 if (cls.is_marked_for_parsing()) { | 282 if (cls.is_marked_for_parsing()) { |
283 return Error::null(); | 283 return Error::null(); |
284 } | 284 } |
285 // If the class is a signature class there is no need to try and | 285 // If the class is a typedef class there is no need to try and |
286 // compile it. Just finalize it directly. | 286 // compile it. Just finalize it directly. |
287 if (cls.IsSignatureClass()) { | 287 if (cls.IsTypedefClass()) { |
288 #if defined(DEBUG) | 288 #if defined(DEBUG) |
289 const Type& type = Type::Handle( | 289 const Class& closure_cls = Class::Handle( |
290 Isolate::Current()->object_store()->function_impl_type()); | 290 Isolate::Current()->object_store()->closure_class()); |
291 const Class& type_cls = Class::Handle(type.type_class()); | 291 ASSERT(closure_cls.is_finalized()); |
292 ASSERT(type_cls.is_finalized()); | |
293 #endif | 292 #endif |
294 LongJumpScope jump; | 293 LongJumpScope jump; |
295 if (setjmp(*jump.Set()) == 0) { | 294 if (setjmp(*jump.Set()) == 0) { |
296 ClassFinalizer::FinalizeClass(cls); | 295 ClassFinalizer::FinalizeClass(cls); |
297 return Error::null(); | 296 return Error::null(); |
298 } else { | 297 } else { |
299 Thread* thread = Thread::Current(); | 298 Thread* thread = Thread::Current(); |
300 Isolate* isolate = thread->isolate(); | 299 Isolate* isolate = thread->isolate(); |
301 Error& error = Error::Handle(thread->zone()); | 300 Error& error = Error::Handle(thread->zone()); |
302 error = isolate->object_store()->sticky_error(); | 301 error = isolate->object_store()->sticky_error(); |
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2043 } | 2042 } |
2044 | 2043 |
2045 | 2044 |
2046 void BackgroundCompiler::EnsureInit(Thread* thread) { | 2045 void BackgroundCompiler::EnsureInit(Thread* thread) { |
2047 UNREACHABLE(); | 2046 UNREACHABLE(); |
2048 } | 2047 } |
2049 | 2048 |
2050 #endif // DART_PRECOMPILED_RUNTIME | 2049 #endif // DART_PRECOMPILED_RUNTIME |
2051 | 2050 |
2052 } // namespace dart | 2051 } // namespace dart |
OLD | NEW |