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

Side by Side Diff: runtime/vm/bootstrap_nocore.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 | « runtime/vm/bootstrap.cc ('k') | runtime/vm/kernel.h » ('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 #if !defined(DART_PRECOMPILED_RUNTIME) 9 #if !defined(DART_PRECOMPILED_RUNTIME)
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 // Load the bootstrap libraries in order (see object_store.h). 89 // Load the bootstrap libraries in order (see object_store.h).
90 Library& library = Library::Handle(zone); 90 Library& library = Library::Handle(zone);
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::String* uri = kernel_library->import_uri(); 98 intptr_t uri_index = kernel_library->import_uri();
99 const String& kernel_name = reader.DartSymbol(uri); 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);
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);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap.cc ('k') | runtime/vm/kernel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698