hotspot/test/compiler/aot/scripts/build-bootmodules.sh
author iveresov
Mon, 26 Jun 2017 16:10:31 -0700
changeset 46566 231c681fa946
parent 46441 514c0eddaccc
child 46640 70bdce04c59b
permissions -rw-r--r--
8182883: Update Graal Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46441
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
     1
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
     2
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
     3
#
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
     4
# This code is free software; you can redistribute it and/or modify it
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
     5
# under the terms of the GNU General Public License version 2 only, as
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
     6
# published by the Free Software Foundation.
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
     7
#
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
     8
# This code is distributed in the hope that it will be useful, but WITHOUT
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
     9
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    10
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    11
# version 2 for more details (a copy is included in the LICENSE file that
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    12
# accompanied this code).
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    13
#
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    14
# You should have received a copy of the GNU General Public License version
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    15
# 2 along with this work; if not, write to the Free Software Foundation,
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    16
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    17
#
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    18
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    19
# or visit www.oracle.com if you need additional information or have any
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    20
# questions.
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    21
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    22
pushd `dirname $0` > /dev/null
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    23
DIR=`pwd`
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    24
popd > /dev/null
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    25
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    26
# set env variables
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    27
. $DIR/test-env.sh
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    28
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    29
MODULES="java.base"
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    30
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    31
TEST=HelloWorld
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    32
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    33
for m in $MODULES; do
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    34
    rm -f $JAVA_HOME/lib/lib$m*.$SO_TYPE
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    35
done
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    36
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    37
$JAVA_HOME/bin/javac -d . $DIR/$TEST.java
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    38
46566
231c681fa946 8182883: Update Graal
iveresov
parents: 46441
diff changeset
    39
JAOTC_OPTS="-J-Xmx4g -J-ea --compile-for-tiered --info"
46441
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    40
JAVA_OPTS="-Xmx4g -XX:+UseAOT -XX:+UnlockDiagnosticVMOptions -XX:+UseAOTStrictLoading"
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    41
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    42
# Compile with: +UseCompressedOops +UseG1GC
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    43
LIBRARIES=""
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    44
for m in $MODULES; do
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    45
    if [ -f $DIR/$m-list.txt ]; then
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    46
	LIST="--compile-commands $DIR/$m-list.txt"
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    47
    else
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    48
	LIST=""
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    49
    fi
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    50
    $JAVA_HOME/bin/jaotc -J-XX:+UseCompressedOops -J-XX:+UseG1GC $JAOTC_OPTS $LIST --output lib$m-coop.$SO_TYPE --module $m || exit 1
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    51
    LIBRARIES="$LIBRARIES$PWD/lib$m-coop.$SO_TYPE:"
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    52
done
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    53
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+UseCompressedOops -XX:+UseG1GC -XX:AOTLibrary=$LIBRARIES $TEST || exit 1
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    54
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    55
# Compile with: +UseCompressedOops +UseParallelGC
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    56
LIBRARIES=""
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    57
for m in $MODULES; do
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    58
    if [ -f $DIR/$m-list.txt ]; then
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    59
	LIST="--compile-commands $DIR/$m-list.txt"
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    60
    else
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    61
	LIST=""
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    62
    fi
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    63
    $JAVA_HOME/bin/jaotc -J-XX:+UseCompressedOops -J-XX:+UseParallelGC $JAOTC_OPTS $LIST --output lib$m-coop-nong1.$SO_TYPE --module $m || exit 1
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    64
    LIBRARIES="$LIBRARIES$PWD/lib$m-coop-nong1.$SO_TYPE:"
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    65
done
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    66
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+UseCompressedOops -XX:+UseParallelGC -XX:AOTLibrary=$LIBRARIES $TEST || exit 1
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    67
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    68
# Compile with: -UseCompressedOops +UseG1GC
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    69
LIBRARIES=""
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    70
for m in $MODULES; do
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    71
    if [ -f $DIR/$m-list.txt ]; then
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    72
	LIST="--compile-commands $DIR/$m-list.txt"
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    73
    else
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    74
	LIST=""
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    75
    fi
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    76
    $JAVA_HOME/bin/jaotc -J-XX:-UseCompressedOops -J-XX:+UseG1GC $JAOTC_OPTS $LIST --output lib$m.$SO_TYPE --module $m || exit 1
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    77
    LIBRARIES="$LIBRARIES$PWD/lib$m.$SO_TYPE:"
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    78
done
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    79
$JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseCompressedOops -XX:+UseG1GC -XX:AOTLibrary=$LIBRARIES $TEST || exit 1
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    80
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    81
# Compile with: -UseCompressedOops +UseParallelGC
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    82
LIBRARIES=""
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    83
for m in $MODULES; do
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    84
    if [ -f $DIR/$m-list.txt ]; then
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    85
	LIST="--compile-commands $DIR/$m-list.txt"
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    86
    else
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    87
	LIST=""
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    88
    fi
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    89
    $JAVA_HOME/bin/jaotc -J-XX:-UseCompressedOops -J-XX:+UseParallelGC $JAOTC_OPTS $LIST --output lib$m-nong1.$SO_TYPE --module $m || exit 1
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    90
    LIBRARIES="$LIBRARIES$PWD/lib$m-nong1.$SO_TYPE:"
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    91
done
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    92
$JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseCompressedOops -XX:+UseParallelGC -XX:AOTLibrary=$LIBRARIES $TEST || exit 1
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    93
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    94
echo "Installing shared libraries in: $JAVA_HOME/lib/"
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    95
for m in $MODULES; do
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    96
    mv -f lib$m*.$SO_TYPE $JAVA_HOME/lib/
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    97
done
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    98
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
    99
# Test installed libraries.
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
   100
$JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseCompressedOops -XX:+UseG1GC       -XX:+PrintAOT $TEST | grep "aot library" || exit 1
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
   101
$JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseCompressedOops -XX:+UseParallelGC -XX:+PrintAOT $TEST | grep "aot library" || exit 1
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
   102
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+UseCompressedOops -XX:+UseG1GC       -XX:+PrintAOT $TEST | grep "aot library" || exit 1
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
   103
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+UseCompressedOops -XX:+UseParallelGC -XX:+PrintAOT $TEST | grep "aot library" || exit 1
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
   104
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
   105
rm -f $TEST.class
514c0eddaccc 8179656: [AOT] Add AOT manual test scripts
kvn
parents:
diff changeset
   106