Index: tools/android-sync.sh |
diff --git a/tools/check-static-initializers.sh b/tools/android-sync.sh |
similarity index 53% |
copy from tools/check-static-initializers.sh |
copy to tools/android-sync.sh |
index 1103a9778775dc86e8b59ee4f804670192533f70..90fa3180edcd56330869e57ef355a02a770d1b80 100755 |
--- a/tools/check-static-initializers.sh |
+++ b/tools/android-sync.sh |
@@ -26,38 +26,54 @@ |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-# Checks that the number of compilation units having at least one static |
-# initializer in d8 matches the one defined below. |
-# Note that the project must be built with SCons before running this script. |
+# This script pushes android binaries and test data to the device. |
+# The first argument can be either "android.release" or "android.debug". |
+# The second argument is a relative path to the output directory with binaries. |
+# The third argument is the absolute path to the V8 directory on the host. |
+# The fourth argument is the absolute path to the V8 directory on the device. |
-# Allow: |
-# - _GLOBAL__I__ZN2v810LineEditor6first_E |
-# - _GLOBAL__I__ZN2v88internal32AtomicOps_Internalx86CPUFeaturesE |
-# - _GLOBAL__I__ZN2v88internal8ThreadId18highest_thread_id_E |
-expected_static_init_count=3 |
- |
-v8_root=$(readlink -f $(dirname $BASH_SOURCE)/../) |
- |
-if [ -n "$1" ] ; then |
- d8="${v8_root}/$1" |
-else |
- d8="${v8_root}/d8" |
-fi |
- |
-if [ ! -f "$d8" ]; then |
- echo "d8 binary not found: $d8" |
+if [ ${#@} -lt 4 ] ; then |
+ echo "Error: need 4 arguments" |
exit 1 |
fi |
-static_inits=$(nm "$d8" | grep _GLOBAL_ | grep _I_ | awk '{ print $NF; }') |
+ARCH_MODE=$1 |
+OUTDIR=$2 |
+HOST_V8=$3 |
+ANDROID_V8=$4 |
-static_init_count=$(echo "$static_inits" | wc -l) |
+function sync_file { |
+ local FILE=$1 |
+ local ANDROID_HASH=$(adb shell "md5 \"$ANDROID_V8/$FILE\"") |
+ local HOST_HASH=$(md5sum "$HOST_V8/$FILE") |
+ if [ "${ANDROID_HASH%% *}" != "${HOST_HASH%% *}" ]; then |
+ adb push "$HOST_V8/$FILE" "$ANDROID_V8/$FILE" &> /dev/null |
+ fi |
+ echo -n "." |
+} |
-if [ $static_init_count -gt $expected_static_init_count ]; then |
- echo "Too many static initializers." |
- echo "$static_inits" |
- exit 1 |
-else |
- echo "Static initializer check passed ($static_init_count initializers)." |
- exit 0 |
-fi |
+function sync_dir { |
+ local DIR=$1 |
+ echo -n "sync to $ANDROID_V8/$DIR" |
+ for FILE in $(find "$HOST_V8/$DIR" -type f); do |
+ local RELATIVE_FILE=${FILE:${#HOST_V8}} |
+ sync_file "$RELATIVE_FILE" |
+ done |
+ echo "" |
+} |
+ |
+echo -n "sync to $ANDROID_V8/$OUTDIR/$ARCH_MODE" |
+sync_file "$OUTDIR/$ARCH_MODE/cctest" |
+sync_file "$OUTDIR/$ARCH_MODE/d8" |
+sync_file "$OUTDIR/$ARCH_MODE/preparser" |
+echo "" |
+echo -n "sync to $ANDROID_V8/tools" |
+sync_file tools/consarray.js |
+sync_file tools/codemap.js |
+sync_file tools/csvparser.js |
+sync_file tools/profile.js |
+sync_file tools/splaytree.js |
+echo "" |
+sync_dir test/message |
+sync_dir test/mjsunit |
+sync_dir test/preparser |