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

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

Issue 2820363002: Move Kernel strings into the VM's heap. (Closed)
Patch Set: Created 3 years, 8 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
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 GrowableObjectArray& pending_classes = GrowableObjectArray::Handle( 81 GrowableObjectArray& pending_classes = GrowableObjectArray::Handle(
82 zone, isolate->object_store()->pending_classes()); 82 zone, isolate->object_store()->pending_classes());
83 dart::Class& pending = dart::Class::Handle(zone); 83 dart::Class& pending = dart::Class::Handle(zone);
84 for (intptr_t i = 0; i < pending_classes.Length(); ++i) { 84 for (intptr_t i = 0; i < pending_classes.Length(); ++i) {
85 pending ^= pending_classes.At(i); 85 pending ^= pending_classes.At(i);
86 pending.set_is_marked_for_parsing(); 86 pending.set_is_marked_for_parsing();
87 } 87 }
88 88
89 Library& library = Library::Handle(zone); 89 Library& library = Library::Handle(zone);
90 String& dart_name = String::Handle(zone); 90 String& dart_name = String::Handle(zone);
91 String& kernel_name = String::Handle(zone);
92 for (intptr_t i = 0; i < bootstrap_library_count; ++i) { 91 for (intptr_t i = 0; i < bootstrap_library_count; ++i) {
93 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index; 92 ObjectStore::BootstrapLibraryId id = bootstrap_libraries[i].index;
94 library = isolate->object_store()->bootstrap_library(id); 93 library = isolate->object_store()->bootstrap_library(id);
95 dart_name = library.url(); 94 dart_name = library.url();
96 for (intptr_t j = 0; j < program->libraries().length(); ++j) { 95 for (intptr_t j = 0; j < program->libraries().length(); ++j) {
97 kernel::Library* kernel_library = program->libraries()[j]; 96 kernel::Library* kernel_library = program->libraries()[j];
98 kernel::String* uri = kernel_library->import_uri(); 97 kernel::String* uri = kernel_library->import_uri();
99 kernel_name = Symbols::FromUTF8(thread, uri->buffer(), uri->size()); 98 const String& kernel_name = reader.DartSymbol(uri);
100 if (kernel_name.Equals(dart_name)) { 99 if (kernel_name.Equals(dart_name)) {
101 reader.ReadLibrary(kernel_library); 100 reader.ReadLibrary(kernel_library);
102 library.SetLoaded(); 101 library.SetLoaded();
103 break; 102 break;
104 } 103 }
105 } 104 }
106 } 105 }
107 106
108 Finish(thread, /*from_kernel=*/true); 107 Finish(thread, /*from_kernel=*/true);
109 return Error::null(); 108 return Error::null();
(...skipping 26 matching lines...) Expand all
136 return BootstrapFromKernel(thread, program); 135 return BootstrapFromKernel(thread, program);
137 } 136 }
138 #else 137 #else
139 RawError* Bootstrap::DoBootstrapping(kernel::Program* program) { 138 RawError* Bootstrap::DoBootstrapping(kernel::Program* program) {
140 UNREACHABLE(); 139 UNREACHABLE();
141 return Error::null(); 140 return Error::null();
142 } 141 }
143 #endif // !defined(DART_PRECOMPILED_RUNTIME) 142 #endif // !defined(DART_PRECOMPILED_RUNTIME)
144 143
145 } // namespace dart 144 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap.cc ('k') | runtime/vm/kernel.h » ('j') | runtime/vm/kernel_binary.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698