| 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/bootstrap.h" | 5 #include "vm/bootstrap.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #if !defined(DART_PRECOMPILED_RUNTIME) | 9 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 GrowableObjectArray& pending_classes = GrowableObjectArray::Handle( | 81 GrowableObjectArray& pending_classes = GrowableObjectArray::Handle( |
| 82 zone, isolate->object_store()->pending_classes()); | 82 zone, isolate->object_store()->pending_classes()); |
| 83 dart::Class& pending = dart::Class::Handle(zone); | 83 dart::Class& pending = dart::Class::Handle(zone); |
| 84 for (intptr_t i = 0; i < pending_classes.Length(); ++i) { | 84 for (intptr_t i = 0; i < pending_classes.Length(); ++i) { |
| 85 pending ^= pending_classes.At(i); | 85 pending ^= pending_classes.At(i); |
| 86 pending.set_is_marked_for_parsing(); | 86 pending.set_is_marked_for_parsing(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 Library& library = Library::Handle(zone); | 89 Library& library = Library::Handle(zone); |
| 90 String& dart_name = String::Handle(zone); | 90 String& dart_name = String::Handle(zone); |
| 91 String& kernel_name = String::Handle(zone); | |
| 92 for (intptr_t i = 0; i < bootstrap_library_count; ++i) { | 91 for (intptr_t i = 0; i < bootstrap_library_count; ++i) { |
| 93 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; | 92 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; |
| 94 library = isolate->object_store()->bootstrap_library(id); | 93 library = isolate->object_store()->bootstrap_library(id); |
| 95 dart_name = library.url(); | 94 dart_name = library.url(); |
| 96 for (intptr_t j = 0; j < program->libraries().length(); ++j) { | 95 for (intptr_t j = 0; j < program->libraries().length(); ++j) { |
| 97 kernel::Library* kernel_library = program->libraries()[j]; | 96 kernel::Library* kernel_library = program->libraries()[j]; |
| 98 kernel::String* uri = kernel_library->import_uri(); | 97 kernel::String* uri = kernel_library->import_uri(); |
| 99 kernel_name = Symbols::FromUTF8(thread, uri->buffer(), uri->size()); | 98 const String& kernel_name = reader.DartSymbol(uri); |
| 100 if (kernel_name.Equals(dart_name)) { | 99 if (kernel_name.Equals(dart_name)) { |
| 101 reader.ReadLibrary(kernel_library); | 100 reader.ReadLibrary(kernel_library); |
| 102 library.SetLoaded(); | 101 library.SetLoaded(); |
| 103 break; | 102 break; |
| 104 } | 103 } |
| 105 } | 104 } |
| 106 } | 105 } |
| 107 | 106 |
| 108 Finish(thread, /*from_kernel=*/true); | 107 Finish(thread, /*from_kernel=*/true); |
| 109 return Error::null(); | 108 return Error::null(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 136 return BootstrapFromKernel(thread, program); | 135 return BootstrapFromKernel(thread, program); |
| 137 } | 136 } |
| 138 #else | 137 #else |
| 139 RawError* Bootstrap::DoBootstrapping(kernel::Program* program) { | 138 RawError* Bootstrap::DoBootstrapping(kernel::Program* program) { |
| 140 UNREACHABLE(); | 139 UNREACHABLE(); |
| 141 return Error::null(); | 140 return Error::null(); |
| 142 } | 141 } |
| 143 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 142 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| 144 | 143 |
| 145 } // namespace dart | 144 } // namespace dart |
| OLD | NEW |