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

Unified Diff: runtime/bin/gen_snapshot.cc

Issue 543623003: Don't use async loading in gen_snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/gen_snapshot.cc
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index 5dd431bb4d4ac530c9c496ebb52ea5cc3cf371f1..ff2d3b877dea73a4c35fa688fa2f6faa5127a185 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -351,17 +351,17 @@ static Dart_Handle CreateSnapshotLibraryTagHandler(Dart_LibraryTag tag,
if (Dart_IsError(file_path)) {
return file_path;
}
-
- Dart_Handle builtin_lib =
- Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
- Dart_Handle result = DartUtils::LoadSourceAsync(library,
- url,
- tag,
- builtin_lib);
- if (Dart_IsError(result)) {
- return result;
+ const char* raw_path = DartUtils::GetStringValue(file_path);
+ Dart_Handle source = DartUtils::ReadStringFromFile(raw_path);
+ if (Dart_IsError(source)) {
+ return source;
+ }
+ if (tag == Dart_kImportTag) {
+ return Dart_LoadLibrary(url, source, 0, 0);
+ } else {
+ ASSERT(tag == Dart_kSourceTag);
+ return Dart_LoadSource(library, url, source, 0, 0);
}
- return Dart_RunLoop();
}
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698