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

Unified Diff: runtime/bin/main.cc

Issue 1667263002: VM: Small clean up in main.cc after introducing dart_noopt. (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 77625d80cb43adcef525d7e9007e74761c9d2d7b..4e9c58ce0c113561e9cce6ca28da157aa6b6c8f4 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -80,7 +80,12 @@ static const char* precompiled_snapshot_directory = NULL;
// Global flag that is used to indicate that we want to compile everything in
// the same way as precompilation before main, then continue running in the
// same process.
-static bool has_noopt = false;
+// Always set this with dart_noopt.
+#if defined(DART_PRECOMPILER) && !defined(DART_NO_SNAPSHOT)
+static const bool has_noopt = true;
+#else
+static const bool has_noopt = false;
+#endif
extern const char* kPrecompiledLibraryName;
@@ -597,12 +602,12 @@ static int ParseArguments(int argc,
}
if (has_noopt) {
if (has_gen_precompiled_snapshot) {
- Log::PrintErr("Specifying --noopt and --gen_precompiled_snapshot"
+ Log::PrintErr("Running dart_noopt with --gen_precompiled_snapshot"
" is invalid.\n");
return -1;
}
if (has_run_precompiled_snapshot) {
- Log::PrintErr("Specifying --noopt and --run_precompiled_snapshot"
+ Log::PrintErr("Running dart_noopt with --run_precompiled_snapshot"
" is invalid.\n");
return -1;
}
@@ -1445,13 +1450,9 @@ void main(int argc, char** argv) {
}
#if defined(DART_PRECOMPILER) && !defined(DART_NO_SNAPSHOT)
- // Always set --precompilation with dart_noopt, unless already set by these
- // command line options.
- if (!has_gen_precompiled_snapshot &&
- !has_run_precompiled_snapshot) {
- has_noopt = true;
- vm_options.AddArgument("--precompilation");
- }
+ // Always set --precompilation with dart_noopt.
+ ASSERT(!has_gen_precompiled_snapshot && !has_run_precompiled_snapshot);
+ vm_options.AddArgument("--precompilation");
#endif
Dart_SetVMFlags(vm_options.count(), vm_options.arguments());
« 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