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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 | 360 |
361 // Load the bootstrap libraries in order (see object_store.h). | 361 // Load the bootstrap libraries in order (see object_store.h). |
362 Library& library = Library::Handle(zone); | 362 Library& library = Library::Handle(zone); |
363 String& dart_name = String::Handle(zone); | 363 String& dart_name = String::Handle(zone); |
364 for (intptr_t i = 0; i < kBootstrapLibraryCount; ++i) { | 364 for (intptr_t i = 0; i < kBootstrapLibraryCount; ++i) { |
365 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; | 365 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; |
366 library = isolate->object_store()->bootstrap_library(id); | 366 library = isolate->object_store()->bootstrap_library(id); |
367 dart_name = library.url(); | 367 dart_name = library.url(); |
368 for (intptr_t j = 0; j < program->libraries().length(); ++j) { | 368 for (intptr_t j = 0; j < program->libraries().length(); ++j) { |
369 kernel::Library* kernel_library = program->libraries()[j]; | 369 kernel::Library* kernel_library = program->libraries()[j]; |
370 kernel::String* uri = kernel_library->import_uri(); | 370 intptr_t uri_index = kernel_library->import_uri(); |
371 const String& kernel_name = reader.DartSymbol(uri); | 371 const String& kernel_name = reader.DartSymbol(uri_index); |
372 if (kernel_name.Equals(dart_name)) { | 372 if (kernel_name.Equals(dart_name)) { |
373 reader.ReadLibrary(kernel_library); | 373 reader.ReadLibrary(kernel_library); |
374 library.SetLoaded(); | 374 library.SetLoaded(); |
375 break; | 375 break; |
376 } | 376 } |
377 } | 377 } |
378 } | 378 } |
379 | 379 |
380 // Finish bootstrapping, including class finalization. | 380 // Finish bootstrapping, including class finalization. |
381 Finish(thread, /*from_kernel=*/true); | 381 Finish(thread, /*from_kernel=*/true); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 lib.Register(thread); | 420 lib.Register(thread); |
421 isolate->object_store()->set_bootstrap_library(id, lib); | 421 isolate->object_store()->set_bootstrap_library(id, lib); |
422 } | 422 } |
423 } | 423 } |
424 | 424 |
425 return (kernel_program == NULL) ? BootstrapFromSource(thread) | 425 return (kernel_program == NULL) ? BootstrapFromSource(thread) |
426 : BootstrapFromKernel(thread, kernel_program); | 426 : BootstrapFromKernel(thread, kernel_program); |
427 } | 427 } |
428 | 428 |
429 } // namespace dart | 429 } // namespace dart |
OLD | NEW |