| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/class_finalizer.h" | 5 #include "vm/class_finalizer.h" |
| 6 | 6 |
| 7 #include "vm/code_generator.h" | 7 #include "vm/code_generator.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 Class& interface_class = Class::Handle(); | 176 Class& interface_class = Class::Handle(); |
| 177 for (intptr_t i = 0; i < interface_array.Length(); i++) { | 177 for (intptr_t i = 0; i < interface_array.Length(); i++) { |
| 178 interface ^= interface_array.At(i); | 178 interface ^= interface_array.At(i); |
| 179 interface_class = interface.type_class(); | 179 interface_class = interface.type_class(); |
| 180 collected.Add(interface_class); | 180 collected.Add(interface_class); |
| 181 CollectInterfaces(interface_class, collected); | 181 CollectInterfaces(interface_class, collected); |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 | 184 |
| 185 | 185 |
| 186 #if defined(DART_NO_SNAPSHOT) |
| 186 void ClassFinalizer::VerifyBootstrapClasses() { | 187 void ClassFinalizer::VerifyBootstrapClasses() { |
| 187 if (FLAG_trace_class_finalization) { | 188 if (FLAG_trace_class_finalization) { |
| 188 OS::Print("VerifyBootstrapClasses START.\n"); | 189 OS::Print("VerifyBootstrapClasses START.\n"); |
| 189 } | 190 } |
| 190 ObjectStore* object_store = Isolate::Current()->object_store(); | 191 ObjectStore* object_store = Isolate::Current()->object_store(); |
| 191 | 192 |
| 192 Class& cls = Class::Handle(); | 193 Class& cls = Class::Handle(); |
| 193 #if defined(DEBUG) | 194 #if defined(DEBUG) |
| 194 // Basic checking. | 195 // Basic checking. |
| 195 cls = object_store->object_class(); | 196 cls = object_store->object_class(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 const Error& err = Error::Handle(object_store->sticky_error()); | 240 const Error& err = Error::Handle(object_store->sticky_error()); |
| 240 OS::PrintErr("Could not verify bootstrap classes : %s\n", | 241 OS::PrintErr("Could not verify bootstrap classes : %s\n", |
| 241 err.ToErrorCString()); | 242 err.ToErrorCString()); |
| 242 OS::Exit(255); | 243 OS::Exit(255); |
| 243 } | 244 } |
| 244 if (FLAG_trace_class_finalization) { | 245 if (FLAG_trace_class_finalization) { |
| 245 OS::Print("VerifyBootstrapClasses END.\n"); | 246 OS::Print("VerifyBootstrapClasses END.\n"); |
| 246 } | 247 } |
| 247 Isolate::Current()->heap()->Verify(); | 248 Isolate::Current()->heap()->Verify(); |
| 248 } | 249 } |
| 250 #endif // defined(DART_NO_SNAPSHOT). |
| 249 | 251 |
| 250 | 252 |
| 251 // Resolve unresolved_class in the library of cls, or return null. | 253 // Resolve unresolved_class in the library of cls, or return null. |
| 252 RawClass* ClassFinalizer::ResolveClass( | 254 RawClass* ClassFinalizer::ResolveClass( |
| 253 const Class& cls, | 255 const Class& cls, |
| 254 const UnresolvedClass& unresolved_class) { | 256 const UnresolvedClass& unresolved_class) { |
| 255 const String& class_name = String::Handle(unresolved_class.ident()); | 257 const String& class_name = String::Handle(unresolved_class.ident()); |
| 256 Library& lib = Library::Handle(); | 258 Library& lib = Library::Handle(); |
| 257 Class& resolved_class = Class::Handle(); | 259 Class& resolved_class = Class::Handle(); |
| 258 if (unresolved_class.library_prefix() == LibraryPrefix::null()) { | 260 if (unresolved_class.library_prefix() == LibraryPrefix::null()) { |
| (...skipping 2919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3178 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); | 3180 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); |
| 3179 field ^= fields_array.At(0); | 3181 field ^= fields_array.At(0); |
| 3180 ASSERT(field.Offset() == ByteBuffer::data_offset()); | 3182 ASSERT(field.Offset() == ByteBuffer::data_offset()); |
| 3181 name ^= field.name(); | 3183 name ^= field.name(); |
| 3182 expected_name ^= String::New("_data"); | 3184 expected_name ^= String::New("_data"); |
| 3183 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 3185 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
| 3184 #endif | 3186 #endif |
| 3185 } | 3187 } |
| 3186 | 3188 |
| 3187 } // namespace dart | 3189 } // namespace dart |
| OLD | NEW |