Chromium Code Reviews| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 | 150 |
| 151 RawError* Compiler::CompileClass(const Class& cls) { | 151 RawError* Compiler::CompileClass(const Class& cls) { |
| 152 // If class is a top level class it is already parsed. | 152 // If class is a top level class it is already parsed. |
| 153 if (cls.IsTopLevel()) { | 153 if (cls.IsTopLevel()) { |
| 154 return Error::null(); | 154 return Error::null(); |
| 155 } | 155 } |
| 156 // If the class is already marked for parsing return immediately. | 156 // If the class is already marked for parsing return immediately. |
| 157 if (cls.is_marked_for_parsing()) { | 157 if (cls.is_marked_for_parsing()) { |
| 158 return Error::null(); | 158 return Error::null(); |
| 159 } | 159 } |
| 160 // If the class is a signature class there is no need to try and | |
| 161 // compile it. Just finalize it directly. | |
| 162 if (cls.IsSignatureClass()) { | |
| 163 LongJumpScope jump; | |
|
hausner
2014/09/15 18:11:31
DBC: since you depend on the Function implementati
siva
2014/09/15 20:24:39
Done.
| |
| 164 if (setjmp(*jump.Set()) == 0) { | |
| 165 ClassFinalizer::FinalizeClass(cls); | |
| 166 return Error::null(); | |
| 167 } else { | |
| 168 Isolate* isolate = Isolate::Current(); | |
| 169 Error& error = Error::Handle(isolate); | |
| 170 error = isolate->object_store()->sticky_error(); | |
| 171 isolate->object_store()->clear_sticky_error(); | |
| 172 return error.raw(); | |
| 173 } | |
| 174 } | |
| 160 | 175 |
| 161 Isolate* isolate = Isolate::Current(); | 176 Isolate* isolate = Isolate::Current(); |
| 162 // We remember all the classes that are being compiled in these lists. This | 177 // We remember all the classes that are being compiled in these lists. This |
| 163 // also allows us to reset the marked_for_parsing state in case we see an | 178 // also allows us to reset the marked_for_parsing state in case we see an |
| 164 // error. | 179 // error. |
| 165 VMTagScope tagScope(isolate, VMTag::kCompileTopLevelTagId); | 180 VMTagScope tagScope(isolate, VMTag::kCompileTopLevelTagId); |
| 166 Class& parse_class = Class::Handle(isolate); | 181 Class& parse_class = Class::Handle(isolate); |
| 167 const GrowableObjectArray& parse_list = | 182 const GrowableObjectArray& parse_list = |
| 168 GrowableObjectArray::Handle(isolate, GrowableObjectArray::New(4)); | 183 GrowableObjectArray::Handle(isolate, GrowableObjectArray::New(4)); |
| 169 const GrowableObjectArray& patch_list = | 184 const GrowableObjectArray& patch_list = |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1032 const Object& result = | 1047 const Object& result = |
| 1033 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1048 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
| 1034 isolate->object_store()->clear_sticky_error(); | 1049 isolate->object_store()->clear_sticky_error(); |
| 1035 return result.raw(); | 1050 return result.raw(); |
| 1036 } | 1051 } |
| 1037 UNREACHABLE(); | 1052 UNREACHABLE(); |
| 1038 return Object::null(); | 1053 return Object::null(); |
| 1039 } | 1054 } |
| 1040 | 1055 |
| 1041 } // namespace dart | 1056 } // namespace dart |
| OLD | NEW |