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

Unified Diff: runtime/bin/main.cc

Issue 1689953003: Fixes for running a full application snapshot: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 6be11f0cc2cb8bf01044760242a257486fd10e48..fbee6fa1d7fa0c41a9abdc95a5e0421d618c4b33 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -1109,15 +1109,19 @@ static void ReadSnapshotFile(const char* snapshot_directory,
void* file = DartUtils::OpenFile(qualified_filename, false);
if (file == NULL) {
- ErrorExit(kErrorExitCode,
- "Error: Unable to open file %s for reading snapshot\n",
- qualified_filename);
+ fprintf(stderr,
+ "Error: Unable to open file %s for reading snapshot\n",
+ qualified_filename);
+ fflush(stderr);
+ Platform::Exit(kErrorExitCode);
}
intptr_t len = -1;
DartUtils::ReadFile(buffer, &len, file);
if (*buffer == NULL || len == -1) {
- ErrorExit(kErrorExitCode,
- "Error: Unable to read snapshot file %s\n", qualified_filename);
+ fprintf(stderr,
+ "Error: Unable to read snapshot file %s\n", qualified_filename);
+ fflush(stderr);
+ Platform::Exit(kErrorExitCode);
}
DartUtils::CloseFile(file);
if (concat != NULL) {
@@ -1382,12 +1386,14 @@ bool RunMainIsolate(const char* script_name,
// Keep handling messages until the last active receive port is closed.
result = Dart_RunLoop();
- CHECK_RESULT(result);
-
// Generate a full snapshot after execution if specified.
if (generate_full_snapshot_after_run) {
- GenerateFullSnapshot();
+ if (!Dart_IsCompilationError(result) &&
+ !Dart_IsVMRestartRequest(result)) {
+ GenerateFullSnapshot();
+ }
}
+ CHECK_RESULT(result);
}
}
@@ -1536,7 +1542,9 @@ void main(int argc, char** argv) {
Platform::Exit(kErrorExitCode);
}
- if (generate_script_snapshot || generate_full_snapshot_after_run) {
+ if (generate_script_snapshot ||
+ generate_full_snapshot_after_run ||
+ run_full_snapshot) {
vm_options.AddArgument("--load_deferred_eagerly");
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698