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

Unified Diff: sdk/bin/dartanalyzer

Issue 628363002: Modify dartanalyzer scripts to look more like dart2js scripts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move code inside else clause Created 6 years, 2 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 | « editor/tools/analyzer ('k') | sdk/bin/dartanalyzer.bat » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/bin/dartanalyzer
diff --git a/sdk/bin/dartanalyzer b/sdk/bin/dartanalyzer
index cc49a5c8293165d323178d90213af08683af46d2..1122bedcd533439380a33d5dd8383c6a164e8c9f 100755
--- a/sdk/bin/dartanalyzer
+++ b/sdk/bin/dartanalyzer
@@ -24,8 +24,51 @@ SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
SDK_ARG="--dart-sdk=$SDK_DIR"
+DART="$BIN_DIR/dart"
+
SNAPSHOT="$BIN_DIR/snapshots/dartanalyzer.dart.snapshot"
-# We are running the snapshot in the built SDK.
-DART="$BIN_DIR/dart"
-exec "$DART" "$SNAPSHOT" "$SDK_ARG" "$@"
+unset EXTRA_VM_OPTIONS
+declare -a EXTRA_VM_OPTIONS
+
+# Set some optimization options that speed up analysis.
+# TODO(paulberry): are these needed? Could the VM be improved so that
+# they are unnecessary?
+EXTRA_VM_OPTIONS+=("--heap_growth_rate=512")
Ivan Posva 2014/10/08 04:52:31 Please do not use any of these flags unless you kn
+EXTRA_VM_OPTIONS+=("--inlining_hotness=90")
+EXTRA_VM_OPTIONS+=("--optimization_counter_threshold=5000")
+
+case $0 in
+ *_developer)
+ EXTRA_VM_OPTIONS+=('--checked')
+ ;;
+esac
+
+# We allow extra vm options to be passed in through an environment variable.
+if [[ $DART_VM_OPTIONS ]]; then
+ read -a OPTIONS <<< "$DART_VM_OPTIONS"
+ EXTRA_VM_OPTIONS+=("${OPTIONS[@]}")
+fi
+
+if test -f "$SNAPSHOT"; then
+ exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "$SDK_ARG" "$@"
+else
+ DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
+
+ ANALYZER="$DART_ROOT/pkg/analyzer/bin/analyzer.dart"
+
+ if [ -z "$DART_CONFIGURATION" ];
+ then
+ DART_CONFIGURATION="ReleaseIA32"
+ fi
+
+ if [[ `uname` == 'Darwin' ]]; then
+ BUILD_DIR="$DART_ROOT/xcodebuild/$DART_CONFIGURATION"
+ else
+ BUILD_DIR="$DART_ROOT/out/$DART_CONFIGURATION"
+ fi
+
+ PACKAGE_ROOT="$BUILD_DIR/packages/"
+
+ exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "--package-root=$PACKAGE_ROOT" "$ANALYZER" "$SDK_ARG" "$@"
+fi
« no previous file with comments | « editor/tools/analyzer ('k') | sdk/bin/dartanalyzer.bat » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698