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

Unified Diff: runtime/bin/vmservice_impl.cc

Issue 2485993002: VM: Support bootstrapping core libraries from Kernel binaries instead of source. (Closed)
Patch Set: Done Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/vmservice_impl.cc
diff --git a/runtime/bin/vmservice_impl.cc b/runtime/bin/vmservice_impl.cc
index da2dd8deeb0bb6175e737a958604ee182d5914e9..acbcba918a1d453625e339b2a9484c182f7368b6 100644
--- a/runtime/bin/vmservice_impl.cc
+++ b/runtime/bin/vmservice_impl.cc
@@ -155,7 +155,8 @@ char VmService::server_uri_[kServerUriStringBufferSize];
bool VmService::LoadForGenPrecompiled() {
Dart_Handle result;
Dart_SetLibraryTagHandler(LibraryTagHandler);
- Dart_Handle library = LoadLibrary(kVMServiceIOLibraryScriptResourceName);
+ Dart_Handle library =
+ LookupOrLoadLibrary(kVMServiceIOLibraryScriptResourceName);
ASSERT(library != Dart_Null());
SHUTDOWN_ON_ERROR(library);
result = Dart_SetNativeResolver(library, VmServiceIONativeResolver, NULL);
@@ -314,10 +315,14 @@ Dart_Handle VmService::LoadScript(const char* name) {
}
-Dart_Handle VmService::LoadLibrary(const char* name) {
+Dart_Handle VmService::LookupOrLoadLibrary(const char* name) {
Dart_Handle uri = Dart_NewStringFromCString(kVMServiceIOLibraryUri);
- Dart_Handle source = GetSource(name);
- return Dart_LoadLibrary(uri, Dart_Null(), source, 0, 0);
+ Dart_Handle library = Dart_LookupLibrary(uri);
+ if (!Dart_IsLibrary(library)) {
+ Dart_Handle source = GetSource(name);
+ library = Dart_LoadLibrary(uri, Dart_Null(), source, 0, 0);
+ }
+ return library;
}

Powered by Google App Engine
This is Rietveld 408576698