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/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
(...skipping 4349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4360 const Script& script = Script::Handle(this->script()); | 4360 const Script& script = Script::Handle(this->script()); |
4361 signature_class = Class::NewSignatureClass(signature, | 4361 signature_class = Class::NewSignatureClass(signature, |
4362 closure_function, | 4362 closure_function, |
4363 script); | 4363 script); |
4364 library.AddClass(signature_class); | 4364 library.AddClass(signature_class); |
4365 } else { | 4365 } else { |
4366 closure_function.set_signature_class(signature_class); | 4366 closure_function.set_signature_class(signature_class); |
4367 } | 4367 } |
4368 const Type& signature_type = Type::Handle(signature_class.SignatureType()); | 4368 const Type& signature_type = Type::Handle(signature_class.SignatureType()); |
4369 if (!signature_type.IsFinalized()) { | 4369 if (!signature_type.IsFinalized()) { |
4370 ClassFinalizer::FinalizeType( | 4370 // No additional malformed types can be detected during finalization. |
| 4371 ClassFinalizer class_finalizer(ClassFinalizer::kNotGeneratingSnapshot); |
| 4372 class_finalizer.FinalizeType( |
4371 signature_class, signature_type, ClassFinalizer::kCanonicalize); | 4373 signature_class, signature_type, ClassFinalizer::kCanonicalize); |
4372 } | 4374 } |
4373 ASSERT(closure_function.signature_class() == signature_class.raw()); | 4375 ASSERT(closure_function.signature_class() == signature_class.raw()); |
4374 set_implicit_closure_function(closure_function); | 4376 set_implicit_closure_function(closure_function); |
4375 ASSERT(closure_function.IsImplicitClosureFunction()); | 4377 ASSERT(closure_function.IsImplicitClosureFunction()); |
4376 return closure_function.raw(); | 4378 return closure_function.raw(); |
4377 } | 4379 } |
4378 | 4380 |
4379 | 4381 |
4380 RawString* Function::BuildSignature( | 4382 RawString* Function::BuildSignature( |
(...skipping 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6266 if (lib_url.Equals(url)) { | 6268 if (lib_url.Equals(url)) { |
6267 return lib.raw(); | 6269 return lib.raw(); |
6268 } | 6270 } |
6269 } | 6271 } |
6270 return Library::null(); | 6272 return Library::null(); |
6271 } | 6273 } |
6272 | 6274 |
6273 | 6275 |
6274 RawError* Library::Patch(const Script& script) const { | 6276 RawError* Library::Patch(const Script& script) const { |
6275 ASSERT(script.kind() == RawScript::kPatchTag); | 6277 ASSERT(script.kind() == RawScript::kPatchTag); |
6276 return Compiler::Compile(*this, script); | 6278 // Do not tolerate malformed types when patching libraries. |
| 6279 return Compiler::Compile(*this, script, ClassFinalizer::kGeneratingSnapshot); |
6277 } | 6280 } |
6278 | 6281 |
6279 | 6282 |
6280 bool Library::IsKeyUsed(intptr_t key) { | 6283 bool Library::IsKeyUsed(intptr_t key) { |
6281 intptr_t lib_key; | 6284 intptr_t lib_key; |
6282 const GrowableObjectArray& libs = GrowableObjectArray::Handle( | 6285 const GrowableObjectArray& libs = GrowableObjectArray::Handle( |
6283 Isolate::Current()->object_store()->libraries()); | 6286 Isolate::Current()->object_store()->libraries()); |
6284 Library& lib = Library::Handle(); | 6287 Library& lib = Library::Handle(); |
6285 String& lib_url = String::Handle(); | 6288 String& lib_url = String::Handle(); |
6286 for (int i = 0; i < libs.Length(); i++) { | 6289 for (int i = 0; i < libs.Length(); i++) { |
(...skipping 4855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11142 } | 11145 } |
11143 return result.raw(); | 11146 return result.raw(); |
11144 } | 11147 } |
11145 | 11148 |
11146 | 11149 |
11147 const char* WeakProperty::ToCString() const { | 11150 const char* WeakProperty::ToCString() const { |
11148 return "WeakProperty"; | 11151 return "WeakProperty"; |
11149 } | 11152 } |
11150 | 11153 |
11151 } // namespace dart | 11154 } // namespace dart |
OLD | NEW |