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 #include "vm/bootstrap_natives.h" | 9 #include "vm/bootstrap_natives.h" |
10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 String& dart_name = String::Handle(zone); | 332 String& dart_name = String::Handle(zone); |
333 for (intptr_t i = 0; i < kBootstrapLibraryCount; ++i) { | 333 for (intptr_t i = 0; i < kBootstrapLibraryCount; ++i) { |
334 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; | 334 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; |
335 library = isolate->object_store()->bootstrap_library(id); | 335 library = isolate->object_store()->bootstrap_library(id); |
336 dart_name = library.url(); | 336 dart_name = library.url(); |
337 for (intptr_t j = 0; j < program->libraries().length(); ++j) { | 337 for (intptr_t j = 0; j < program->libraries().length(); ++j) { |
338 kernel::Library* kernel_library = program->libraries()[j]; | 338 kernel::Library* kernel_library = program->libraries()[j]; |
339 kernel::StringIndex uri_index = kernel_library->import_uri(); | 339 kernel::StringIndex uri_index = kernel_library->import_uri(); |
340 const String& kernel_name = reader.DartSymbol(uri_index); | 340 const String& kernel_name = reader.DartSymbol(uri_index); |
341 if (kernel_name.Equals(dart_name)) { | 341 if (kernel_name.Equals(dart_name)) { |
342 reader.ReadLibrary(kernel_library); | 342 reader.ReadLibrary(kernel_library->kernel_offset()); |
343 library.SetLoaded(); | 343 library.SetLoaded(); |
344 break; | 344 break; |
345 } | 345 } |
346 } | 346 } |
347 } | 347 } |
348 | 348 |
349 // Finish bootstrapping, including class finalization. | 349 // Finish bootstrapping, including class finalization. |
350 Finish(thread, /*from_kernel=*/true); | 350 Finish(thread, /*from_kernel=*/true); |
351 | 351 |
352 // The platform binary may contain other libraries (e.g., dart:_builtin or | 352 // The platform binary may contain other libraries (e.g., dart:_builtin or |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 lib.Register(thread); | 389 lib.Register(thread); |
390 isolate->object_store()->set_bootstrap_library(id, lib); | 390 isolate->object_store()->set_bootstrap_library(id, lib); |
391 } | 391 } |
392 } | 392 } |
393 | 393 |
394 return (kernel_program == NULL) ? BootstrapFromSource(thread) | 394 return (kernel_program == NULL) ? BootstrapFromSource(thread) |
395 : BootstrapFromKernel(thread, kernel_program); | 395 : BootstrapFromKernel(thread, kernel_program); |
396 } | 396 } |
397 | 397 |
398 } // namespace dart | 398 } // namespace dart |
OLD | NEW |