Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: runtime/vm/bootstrap.cc

Issue 2852943003: Move the Kernel string offsets into the VM's heap. (Closed)
Patch Set: Incorporate review comments. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/bootstrap_nocore.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/bootstrap_nocore.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698