| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 String& dart_name = String::Handle(zone); | 91 String& dart_name = String::Handle(zone); |
| 92 for (intptr_t i = 0; i < bootstrap_library_count; ++i) { | 92 for (intptr_t i = 0; i < bootstrap_library_count; ++i) { |
| 93 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; | 93 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; |
| 94 library = isolate->object_store()->bootstrap_library(id); | 94 library = isolate->object_store()->bootstrap_library(id); |
| 95 dart_name = library.url(); | 95 dart_name = library.url(); |
| 96 for (intptr_t j = 0; j < program->libraries().length(); ++j) { | 96 for (intptr_t j = 0; j < program->libraries().length(); ++j) { |
| 97 kernel::Library* kernel_library = program->libraries()[j]; | 97 kernel::Library* kernel_library = program->libraries()[j]; |
| 98 kernel::StringIndex uri_index = kernel_library->import_uri(); | 98 kernel::StringIndex uri_index = kernel_library->import_uri(); |
| 99 const String& kernel_name = reader.DartSymbol(uri_index); | 99 const String& kernel_name = reader.DartSymbol(uri_index); |
| 100 if (kernel_name.Equals(dart_name)) { | 100 if (kernel_name.Equals(dart_name)) { |
| 101 reader.ReadLibrary(kernel_library); | 101 reader.ReadLibrary(kernel_library->kernel_offset()); |
| 102 library.SetLoaded(); | 102 library.SetLoaded(); |
| 103 break; | 103 break; |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 | 107 |
| 108 // Finish bootstrapping, including class finalization. | 108 // Finish bootstrapping, including class finalization. |
| 109 Finish(thread, /*from_kernel=*/true); | 109 Finish(thread, /*from_kernel=*/true); |
| 110 | 110 |
| 111 // The platform binary may contain other libraries (e.g., dart:_builtin or | 111 // The platform binary may contain other libraries (e.g., dart:_builtin or |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 return BootstrapFromKernel(thread, program); | 147 return BootstrapFromKernel(thread, program); |
| 148 } | 148 } |
| 149 #else | 149 #else |
| 150 RawError* Bootstrap::DoBootstrapping(kernel::Program* program) { | 150 RawError* Bootstrap::DoBootstrapping(kernel::Program* program) { |
| 151 UNREACHABLE(); | 151 UNREACHABLE(); |
| 152 return Error::null(); | 152 return Error::null(); |
| 153 } | 153 } |
| 154 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 154 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| 155 | 155 |
| 156 } // namespace dart | 156 } // namespace dart |
| OLD | NEW |