Index: sdk/bin/dart2js |
diff --git a/sdk/bin/dart2js b/sdk/bin/dart2js |
index 4fe517fbbb65e9193adf205f78cd389d4d5d8255..79a857be83efe500109c4f7c760fa2a9c008f2f9 100755 |
--- a/sdk/bin/dart2js |
+++ b/sdk/bin/dart2js |
@@ -20,8 +20,13 @@ BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)" |
SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)" |
+DART2JS="$SDK_DIR/lib/_internal/compiler/implementation/dart2js.dart" |
+ |
DART="$BIN_DIR/dart" |
+SNAPSHOT_DIR="$BIN_DIR/snapshots" |
+SNAPSHOT="$SNAPSHOT_DIR/dart2js.dart.snapshot" |
+ |
unset EXTRA_OPTIONS |
declare -a EXTRA_OPTIONS |
@@ -36,6 +41,10 @@ fi |
unset EXTRA_VM_OPTIONS |
declare -a EXTRA_VM_OPTIONS |
+if test -f "$SNAPSHOT"; then |
+ EXTRA_OPTIONS+=("--library-root=$SDK_DIR") |
+fi |
+ |
# Tell the VM to grow the heap more aggressively. This should only |
# be necessary temporarily until the VM is better at detecting how |
# applications use memory. |
@@ -54,21 +63,8 @@ if [[ $DART_VM_OPTIONS ]]; then |
EXTRA_VM_OPTIONS+=("${OPTIONS[@]}") |
fi |
-DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)" |
- |
-DART2JS="$DART_ROOT/pkg/compiler/lib/src/dart2js.dart" |
- |
-if [ -z "$DART_CONFIGURATION" ]; |
-then |
- DART_CONFIGURATION="ReleaseIA32" |
-fi |
- |
-if [[ `uname` == 'Darwin' ]]; then |
- BUILD_DIR="$DART_ROOT/xcodebuild/$DART_CONFIGURATION" |
+if test -f "$SNAPSHOT"; then |
+ exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$SNAPSHOT" "${EXTRA_OPTIONS[@]}" "$@" |
else |
- BUILD_DIR="$DART_ROOT/out/$DART_CONFIGURATION" |
+ exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@" |
fi |
- |
-PACKAGE_ROOT="$BUILD_DIR/packages/" |
- |
-exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "--package-root=$PACKAGE_ROOT" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@" |