8179656: [AOT] Add AOT manual test scripts

Reviewed-by: iveresov
This commit is contained in:
Vladimir Kozlov 2017-05-06 09:36:01 -07:00
parent 7a8af5acc8
commit 4865e72a94
16 changed files with 859 additions and 7 deletions

View file

@ -79,7 +79,7 @@ public class AOTCompilationTask implements Runnable, Comparable<Object> {
public AOTCompilationTask(Main main, OptionValues graalOptions, AOTCompiledClass holder, ResolvedJavaMethod method, AOTBackend aotBackend) {
this.main = main;
this.graalOptions = graalOptions;
this.id = ids.getAndIncrement();
this.id = ids.incrementAndGet();
this.holder = holder;
this.method = method;
this.aotBackend = aotBackend;
@ -127,11 +127,7 @@ public class AOTCompilationTask implements Runnable, Comparable<Object> {
final long allocatedBytesAfter = threadMXBean.getThreadAllocatedBytes(threadId);
final long allocatedBytes = (allocatedBytesAfter - allocatedBytesBefore) / 1024;
if (printAfterCompilation) {
TTY.println(getMethodDescription() + String.format(" | %4dms %5dB %5dkB", stop - start, targetCodeSize, allocatedBytes));
} else if (printCompilation) {
TTY.println(String.format("%-6d JVMCI %-70s %-45s %-50s | %4dms %5dB %5dkB", getId(), "", "", "", stop - start, targetCodeSize, allocatedBytes));
}
TTY.println(getMethodDescription() + String.format(" | %4dms %5dB %5dkB", stop - start, targetCodeSize, allocatedBytes));
}
if (compResult == null) {
@ -149,7 +145,7 @@ public class AOTCompilationTask implements Runnable, Comparable<Object> {
}
private String getMethodDescription() {
return String.format("%-6d JVMCI %-70s %-45s %-50s %s", getId(), method.getDeclaringClass().getName(), method.getName(), method.getSignature().toMethodDescriptor(),
return String.format("%-6d aot %s %s", getId(), MiscUtils.uniqueMethodName(method),
getEntryBCI() == JVMCICompiler.INVOCATION_ENTRY_BCI ? "" : "(OSR@" + getEntryBCI() + ") ");
}

View file

@ -0,0 +1,5 @@
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import jdk.vm.ci.hotspot.*;
public class InitGraal {
public static void main(String[] args) throws Throwable {
HotSpotJVMCIRuntime.runtime().getCompiler();
}
}

View file

@ -0,0 +1,32 @@
Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation.
This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).
You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
--------------------------------------------
This directory contains scripts to test AOT.
JAVA_HOME should point to local JDK (scripts will install AOT libraries into it) which supports AOT.
Use 'bash' shell to run scripts.
Execute build-bootmodules.sh first before running test* scripts.
Download dacapo-9.12-bach.jar and execute build-jdk.vm-modules.sh before running test-graal.sh

View file

@ -0,0 +1,106 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
pushd `dirname $0` > /dev/null
DIR=`pwd`
popd > /dev/null
# set env variables
. $DIR/test-env.sh
MODULES="java.base"
TEST=HelloWorld
for m in $MODULES; do
rm -f $JAVA_HOME/lib/lib$m*.$SO_TYPE
done
$JAVA_HOME/bin/javac -d . $DIR/$TEST.java
JAOTC_OPTS="-J-Xmx4g --compile-for-tiered --info"
JAVA_OPTS="-Xmx4g -XX:+UseAOT -XX:+UnlockDiagnosticVMOptions -XX:+UseAOTStrictLoading"
# Compile with: +UseCompressedOops +UseG1GC
LIBRARIES=""
for m in $MODULES; do
if [ -f $DIR/$m-list.txt ]; then
LIST="--compile-commands $DIR/$m-list.txt"
else
LIST=""
fi
$JAVA_HOME/bin/jaotc -J-XX:+UseCompressedOops -J-XX:+UseG1GC $JAOTC_OPTS $LIST --output lib$m-coop.$SO_TYPE --module $m || exit 1
LIBRARIES="$LIBRARIES$PWD/lib$m-coop.$SO_TYPE:"
done
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+UseCompressedOops -XX:+UseG1GC -XX:AOTLibrary=$LIBRARIES $TEST || exit 1
# Compile with: +UseCompressedOops +UseParallelGC
LIBRARIES=""
for m in $MODULES; do
if [ -f $DIR/$m-list.txt ]; then
LIST="--compile-commands $DIR/$m-list.txt"
else
LIST=""
fi
$JAVA_HOME/bin/jaotc -J-XX:+UseCompressedOops -J-XX:+UseParallelGC $JAOTC_OPTS $LIST --output lib$m-coop-nong1.$SO_TYPE --module $m || exit 1
LIBRARIES="$LIBRARIES$PWD/lib$m-coop-nong1.$SO_TYPE:"
done
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+UseCompressedOops -XX:+UseParallelGC -XX:AOTLibrary=$LIBRARIES $TEST || exit 1
# Compile with: -UseCompressedOops +UseG1GC
LIBRARIES=""
for m in $MODULES; do
if [ -f $DIR/$m-list.txt ]; then
LIST="--compile-commands $DIR/$m-list.txt"
else
LIST=""
fi
$JAVA_HOME/bin/jaotc -J-XX:-UseCompressedOops -J-XX:+UseG1GC $JAOTC_OPTS $LIST --output lib$m.$SO_TYPE --module $m || exit 1
LIBRARIES="$LIBRARIES$PWD/lib$m.$SO_TYPE:"
done
$JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseCompressedOops -XX:+UseG1GC -XX:AOTLibrary=$LIBRARIES $TEST || exit 1
# Compile with: -UseCompressedOops +UseParallelGC
LIBRARIES=""
for m in $MODULES; do
if [ -f $DIR/$m-list.txt ]; then
LIST="--compile-commands $DIR/$m-list.txt"
else
LIST=""
fi
$JAVA_HOME/bin/jaotc -J-XX:-UseCompressedOops -J-XX:+UseParallelGC $JAOTC_OPTS $LIST --output lib$m-nong1.$SO_TYPE --module $m || exit 1
LIBRARIES="$LIBRARIES$PWD/lib$m-nong1.$SO_TYPE:"
done
$JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseCompressedOops -XX:+UseParallelGC -XX:AOTLibrary=$LIBRARIES $TEST || exit 1
echo "Installing shared libraries in: $JAVA_HOME/lib/"
for m in $MODULES; do
mv -f lib$m*.$SO_TYPE $JAVA_HOME/lib/
done
# Test installed libraries.
$JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseCompressedOops -XX:+UseG1GC -XX:+PrintAOT $TEST | grep "aot library" || exit 1
$JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseCompressedOops -XX:+UseParallelGC -XX:+PrintAOT $TEST | grep "aot library" || exit 1
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+UseCompressedOops -XX:+UseG1GC -XX:+PrintAOT $TEST | grep "aot library" || exit 1
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+UseCompressedOops -XX:+UseParallelGC -XX:+PrintAOT $TEST | grep "aot library" || exit 1
rm -f $TEST.class

View file

@ -0,0 +1,110 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
pushd `dirname $0` > /dev/null
DIR=`pwd`
popd > /dev/null
# set env variables
. $DIR/test-env.sh
MODULES="jdk.internal.vm.ci jdk.internal.vm.compiler"
TEST=InitGraal
for m in $MODULES; do
rm -f $JAVA_HOME/lib/lib$m*.$SO_TYPE
done
$JAVA_HOME/bin/javac --add-modules jdk.internal.vm.ci --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED $DIR/$TEST.java
# AOT compile non-tiered code version.
JAOTC_OPTS="-J-Xmx4g --info"
JAVA_OPTS="-Xmx4g -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseAOT -XX:+UnlockDiagnosticVMOptions -XX:+UseAOTStrictLoading --add-modules jdk.internal.vm.ci --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED"
# Compile with: +UseCompressedOops +UseG1GC
RT_OPTS="-J-XX:+UseCompressedOops -J-XX:+UseG1GC"
LIBRARIES=""
for m in $MODULES; do
if [ -f $DIR/$m-list.txt ]; then
LIST="--compile-commands $DIR/$m-list.txt"
else
LIST=""
fi
$JAVA_HOME/bin/jaotc $RT_OPTS $JAOTC_OPTS $LIST --output lib$m-coop.$SO_TYPE --module $m -J-XX:AOTLibrary=$LIBRARIES || exit 1
LIBRARIES="$LIBRARIES$PWD/lib$m-coop.$SO_TYPE:"
done
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+UseCompressedOops -XX:+UseG1GC -XX:+PrintAOT -XX:AOTLibrary=$LIBRARIES $TEST | grep "aot library" || exit 1
# Compile with: +UseCompressedOops +UseParallelGC
RT_OPTS="-J-XX:+UseCompressedOops -J-XX:+UseParallelGC"
LIBRARIES=""
for m in $MODULES; do
if [ -f $DIR/$m-list.txt ]; then
LIST="--compile-commands $DIR/$m-list.txt"
else
LIST=""
fi
$JAVA_HOME/bin/jaotc $RT_OPTS $JAOTC_OPTS $LIST --output lib$m-coop-nong1.$SO_TYPE --module $m -J-XX:AOTLibrary=$LIBRARIES || exit 1
LIBRARIES="$LIBRARIES$PWD/lib$m-coop-nong1.$SO_TYPE:"
done
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+UseCompressedOops -XX:+UseParallelGC -XX:+PrintAOT -XX:AOTLibrary=$LIBRARIES $TEST | grep "aot library" || exit 1
# Compile with: -UseCompressedOops +UseG1GC
RT_OPTS="-J-XX:-UseCompressedOops -J-XX:+UseG1GC"
LIBRARIES=""
for m in $MODULES; do
if [ -f $DIR/$m-list.txt ]; then
LIST="--compile-commands $DIR/$m-list.txt"
else
LIST=""
fi
$JAVA_HOME/bin/jaotc $RT_OPTS $JAOTC_OPTS $LIST --output lib$m.$SO_TYPE --module $m -J-XX:AOTLibrary=$LIBRARIES || exit 1
LIBRARIES="$LIBRARIES$PWD/lib$m.$SO_TYPE:"
done
$JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseCompressedOops -XX:+UseG1GC -XX:+PrintAOT -XX:AOTLibrary=$LIBRARIES $TEST | grep "aot library" || exit 1
# Compile with: -UseCompressedOops +UseParallelGC
RT_OPTS="-J-XX:-UseCompressedOops -J-XX:+UseParallelGC"
LIBRARIES=""
for m in $MODULES; do
if [ -f $DIR/$m-list.txt ]; then
LIST="--compile-commands $DIR/$m-list.txt"
else
LIST=""
fi
$JAVA_HOME/bin/jaotc $RT_OPTS $JAOTC_OPTS $LIST --output lib$m-nong1.$SO_TYPE --module $m -J-XX:AOTLibrary=$LIBRARIES || exit 1
LIBRARIES="$LIBRARIES$PWD/lib$m-nong1.$SO_TYPE:"
done
$JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseCompressedOops -XX:+UseParallelGC -XX:+PrintAOT -XX:AOTLibrary=$LIBRARIES $TEST | grep "aot library" || exit 1
echo "Installing shared libraries in: $JAVA_HOME/lib/"
for m in $MODULES; do
mv -f lib$m*.$SO_TYPE $JAVA_HOME/lib/
done
# Test installed libraries.
$JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseCompressedOops -XX:+UseG1GC -XX:+PrintAOT $TEST | grep "aot library" || exit 1
$JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseCompressedOops -XX:+UseParallelGC -XX:+PrintAOT $TEST | grep "aot library" || exit 1
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+UseCompressedOops -XX:+UseG1GC -XX:+PrintAOT $TEST | grep "aot library" || exit 1
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+UseCompressedOops -XX:+UseParallelGC -XX:+PrintAOT $TEST | grep "aot library" || exit 1
rm -f $TEST.class

View file

@ -0,0 +1 @@
i = 0;

View file

@ -0,0 +1,36 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
# jaotc: java.lang.StackOverflowError
exclude sun.util.resources.LocaleNames.getContents()[[Ljava/lang/Object;
exclude sun.util.resources.TimeZoneNames.getContents()[[Ljava/lang/Object;
exclude sun.util.resources.cldr.LocaleNames.getContents()[[Ljava/lang/Object;
exclude sun.util.resources..*.LocaleNames_.*.getContents\(\)\[\[Ljava/lang/Object;
exclude sun.util.resources..*.LocaleNames_.*_.*.getContents\(\)\[\[Ljava/lang/Object;
exclude sun.util.resources..*.TimeZoneNames_.*.getContents\(\)\[\[Ljava/lang/Object;
exclude sun.util.resources..*.TimeZoneNames_.*_.*.getContents\(\)\[\[Ljava/lang/Object;
# java.lang.Error: Trampoline must not be defined by the bootstrap classloader
exclude sun.reflect.misc.Trampoline.<clinit>()V
exclude sun.reflect.misc.Trampoline.invoke(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
# assert(referenceMask != -1) failed: must not be a derived reference type
exclude com.sun.crypto.provider.AESWrapCipher.engineUnwrap([BLjava/lang/String;I)Ljava/security/Key;
exclude sun.security.ssl.*
exclude sun.net.RegisteredDomain.<clinit>()V

View file

@ -0,0 +1,38 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
exclude org.graalvm.compiler.hotspot.replacements.arraycopy.ArrayCopyCallNode.*
exclude org.graalvm.compiler.hotspot.replacements.AESCryptSubstitutions.*
exclude org.graalvm.compiler.hotspot.replacements.CipherBlockChainingSubstitutions.crypt(Ljava/lang/Object;[BII[BILjava/lang/Object;ZZ)V
exclude org.graalvm.compiler.hotspot.stubs.StubUtil.printf(.*).*
exclude org.graalvm.compiler.hotspot.stubs.StubUtil.decipher(J)V
exclude org.graalvm.compiler.hotspot.stubs.StubUtil.fatal(.*).*
#
exclude org.graalvm.compiler.replacements.nodes.ArrayEqualsNode.equals(.*).*
exclude org.graalvm.compiler.replacements.Log.print.*
exclude org.graalvm.compiler.replacements.ReplacementsUtil.*
exclude org.graalvm.compiler.replacements.SnippetCounter.*
exclude org.graalvm.compiler.replacements.SnippetCounterNode.*
#
exclude org.graalvm.compiler.nodes.java.NewArrayNode.newUninitializedArray(Ljava/lang/Class;I)Ljava/lang/Object;
exclude org.graalvm.compiler.nodes.java.DynamicNewArrayNode.newUninitializedArray(Ljava/lang/Class;ILjdk/vm/ci/meta/JavaKind;)Ljava/lang/Object;
exclude org.graalvm.compiler.nodes.java.DynamicNewArrayNode.newArray(Ljava/lang/Class;ILjdk/vm/ci/meta/JavaKind;)Ljava/lang/Object;
exclude org.graalvm.compiler.nodes.PiNode.piCastNonNull(Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;

View file

@ -0,0 +1,23 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
exclude jdk.nashorn.internal.objects.*
exclude jdk.nashorn.internal.ir.debug.*

View file

@ -0,0 +1,42 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
# set platform-dependent variables
OS=`uname -s`
case "$OS" in
Linux | SunOS )
SO_TYPE=so
;;
Darwin )
SO_TYPE=dylib
;;
Windows_* )
SO_TYPE=dll
;;
CYGWIN_* )
SO_TYPE=dll
;;
* )
echo "Unrecognized system!"
exit 1;
;;
esac

View file

@ -0,0 +1,62 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
JAR="dacapo-9.12-bach.jar"
if [ ! -f $JAR ]; then
echo "$JAR not found."
exit 1
fi
pushd `dirname $0` > /dev/null
DIR=`pwd`
popd > /dev/null
APP="-jar $JAR -s small -n 5"
JAVA_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI -XX:-TieredCompilation -Xmx4g -XX:+UseCompressedOops -XX:+UseG1GC"
MODULE_OPTS="--add-modules jdk.internal.vm.ci --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED"
$JAVA_HOME/bin/java $JAVA_OPTS -version || exit 1
$JAVA_HOME/bin/javac $MODULE_OPTS InitGraal.java || exit 1
PATTERN="(aot library|DONE:.*HotSpotVMConfig|DONE:.*HotSpotJVMCIRuntime|DONE:.*HotSpotGraalRuntime)"
echo "----------"
$JAVA_HOME/bin/java $JAVA_OPTS $MODULE_OPTS -XX:+TieredCompilation -XX:-UseAOT -XX:+PrintAOT -Djvmci.InitTimer=true InitGraal | grep -E "$PATTERN" || exit 1
echo "----------"
$JAVA_HOME/bin/java $JAVA_OPTS $MODULE_OPTS -XX:+TieredCompilation -XX:+PrintAOT -Djvmci.InitTimer=true InitGraal | grep -E "$PATTERN" || exit 1
echo "----------"
$JAVA_HOME/bin/java $JAVA_OPTS $MODULE_OPTS -XX:+PrintAOT -Djvmci.InitTimer=true InitGraal | grep -E "$PATTERN" || exit 1
echo "----------"
rm -f InitGraal.class
# eclipse started to fail again with JDK 9.
#BENCHMARKS="avrora batik eclipse fop jython h2 luindex lusearch pmd sunflow tradebeans tradesoap xalan"
BENCHMARKS="avrora batik fop jython h2 luindex lusearch pmd sunflow xalan"
for i in $BENCHMARKS; do
$JAVA_HOME/bin/java $JAVA_OPTS $APP $i || exit 1
rm -rf ./scratch
done

View file

@ -0,0 +1,97 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
pushd `dirname $0` > /dev/null
DIR=`pwd`
popd > /dev/null
# set env variables
. $DIR/test-env.sh
rm -f libHelloWorld*.$SO_TYPE HelloWorld.class
$JAVA_HOME/bin/javac -d . $DIR/HelloWorld.java
# Run once with non-compressed oops.
OPTS="-J-Xmx4g -J-XX:-UseCompressedOops --info --verbose"
$JAVA_HOME/bin/jaotc $OPTS --output libHelloWorld.$SO_TYPE HelloWorld.class || exit 1
JAVA_OPTS="-Xmx4g -XX:-UseCompressedOops -XX:+UnlockDiagnosticVMOptions -XX:+UseAOTStrictLoading -XX:AOTLibrary=./libHelloWorld.$SO_TYPE"
$JAVA_HOME/bin/java $JAVA_OPTS -XX:+PrintAOT -version | grep "aot library" || exit 1
$JAVA_HOME/bin/java $JAVA_OPTS HelloWorld || exit 1
TIMEFORMAT="%3R"
N=5
LIBRARY=libHelloWorld-coop.$SO_TYPE
for gc in UseG1GC UseParallelGC; do
# Now with compressed oops.
OPTS="-J-XX:+UseCompressedOops -J-XX:+$gc --info --verbose"
$JAVA_HOME/bin/jaotc $OPTS --output $LIBRARY HelloWorld.class
# Dump CDS archive.
$JAVA_HOME/bin/java -Xshare:dump -XX:-UseAOT -XX:+$gc || exit 1
JAVA_OPTS="-Xmx256m"
echo "Tiered C1 $gc:"
for i in `seq 1 $N`; do
OUT=`time $JAVA_HOME/bin/java -XX:+$gc -XX:-UseCompressedOops -XX:-UseAOT -XX:TieredStopAtLevel=1 $JAVA_OPTS HelloWorld`
if [ "$OUT" != "Hello, world!" ]; then
echo $OUT
exit 1
fi
done
echo "Tiered C1/C2 $gc:"
for i in `seq 1 $N`; do
OUT=`time $JAVA_HOME/bin/java -XX:+$gc -XX:-UseCompressedOops -XX:-UseAOT $JAVA_OPTS HelloWorld`
if [ "$OUT" != "Hello, world!" ]; then
echo $OUT
exit 1
fi
done
JAVA_OPTS="-Xmx256m -XX:+UseCompressedOops -XX:+UnlockDiagnosticVMOptions -XX:+UseAOTStrictLoading -XX:AOTLibrary=./$LIBRARY"
echo "AOT $gc:"
for i in `seq 1 $N`; do
OUT=`time $JAVA_HOME/bin/java -XX:+$gc $JAVA_OPTS HelloWorld`
if [ "$OUT" != "Hello, world!" ]; then
echo $OUT
exit 1
fi
done
echo "AOT -Xshare:on $gc:"
for i in `seq 1 $N`; do
OUT=`time $JAVA_HOME/bin/java -Xshare:on -XX:+$gc $JAVA_OPTS HelloWorld`
if [ "$OUT" != "Hello, world!" ]; then
echo $OUT
exit 1
fi
done
done
rm -f libHelloWorld*.$SO_TYPE HelloWorld.class

View file

@ -0,0 +1,43 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
pushd `dirname $0` > /dev/null
DIR=`pwd`
popd > /dev/null
# set env variables
. $DIR/test-env.sh
JAOTC_OPTS="-J-Xmx4g -J-XX:-UseCompressedOops"
rm -f libjdk.aot.$SO_TYPE
$JAVA_HOME/bin/jaotc $JAOTC_OPTS --info --module jdk.aot --output libjdk.aot.$SO_TYPE || exit 1
rm -f libjava.base-aot.$SO_TYPE
$JAVA_HOME/bin/jaotc $JAOTC_OPTS -J-XX:AOTLibrary=./libjdk.aot.$SO_TYPE --info --compile-commands $DIR/java.base-list.txt --output libjava.base-aot.$SO_TYPE --module java.base || exit 1
$JAVA_HOME/bin/javac -d . $DIR/HelloWorld.java
$JAVA_HOME/bin/java -XX:-UseCompressedOops -XX:AOTLibrary=./libjava.base-aot.$SO_TYPE HelloWorld
rm -f HelloWorld.class libjdk.aot.$SO_TYPE libjava.base-aot.$SO_TYPE

View file

@ -0,0 +1,157 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
pushd `dirname $0` > /dev/null
DIR=`pwd`
popd > /dev/null
AOT_OPTS="-XX:+UseAOT"
$JAVA_HOME/bin/java $AOT_OPTS -XX:+PrintAOT -version | grep "aot library" || exit 1
# Dump CDS archive.
$JAVA_HOME/bin/java $AOT_OPTS -Xshare:dump || exit 1
FILE="HelloWorld"
APP="com.sun.tools.javac.Main"
JAVA_OPTS="-XX:-UseCompressedOops"
rm -f $FILE.class
$JAVA_HOME/bin/java $JAVA_OPTS $AOT_OPTS $APP -verbose $FILE.java || exit 1
$JAVA_HOME/bin/java $AOT_OPTS $FILE || exit 1
JAVA_OPTS="-XX:+UseCompressedOops"
rm -f $FILE.class
$JAVA_HOME/bin/java $JAVA_OPTS $AOT_OPTS $APP -verbose $FILE.java || exit 1
$JAVA_HOME/bin/java $AOT_OPTS $FILE || exit 1
rm -f $FILE.class
TIMEFORMAT="%3R"
N=5
#echo "-Xint:"
#for i in `seq 1 10`; do
# time $JAVA_HOME/bin/java -Xint $JAVA_OPTS $APP $FILE.java
# if [ $? -ne 0 ]; then
# exit 1
# fi
# rm -f $FILE.class
#done
echo "Tiered C1:"
for i in `seq 1 $N`; do
time $JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseAOT -XX:TieredStopAtLevel=1 $APP $FILE.java
if [ $? -ne 0 ]; then
exit 1
fi
rm -f $FILE.class
done
echo "Tiered C1/C2:"
for i in `seq 1 $N`; do
time $JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseAOT $APP $FILE.java
if [ $? -ne 0 ]; then
exit 1
fi
rm -f $FILE.class
done
echo "Tiered C1/C2 -Xshare:on:"
for i in `seq 1 $N`; do
time $JAVA_HOME/bin/java $JAVA_OPTS -XX:-UseAOT -Xshare:on $APP $FILE.java
if [ $? -ne 0 ]; then
exit 1
fi
rm -f $FILE.class
done
echo "Tiered AOT:"
for i in `seq 1 $N`; do
time $JAVA_HOME/bin/java $JAVA_OPTS $AOT_OPTS $APP $FILE.java
if [ $? -ne 0 ]; then
exit 1
fi
rm -f $FILE.class
done
echo "Tiered AOT -Xshare:on:"
for i in `seq 1 $N`; do
time $JAVA_HOME/bin/java $JAVA_OPTS $AOT_OPTS -Xshare:on $APP $FILE.java
if [ $? -ne 0 ]; then
exit 1
fi
rm -f $FILE.class
done
NAME="jvmci"
DIR="$DIR/../../../../src/jdk.internal.vm.ci"
FILES=`find $DIR -type f -name '*.java'`
COUNT=`find $DIR -type f -name '*.java' | wc -l`
rm -rf tmp
echo "Tiered C1 (compiling $NAME: $COUNT classes):"
for i in `seq 1 $N`; do
mkdir tmp
time $JAVA_HOME/bin/javac -J-XX:-UseAOT -J-XX:TieredStopAtLevel=1 -XDignore.symbol.file -d tmp $FILES
if [ $? -ne 0 ]; then
exit 1
fi
rm -rf tmp
done
echo "Tiered C1/C2 (compiling $NAME: $COUNT classes):"
for i in `seq 1 $N`; do
mkdir tmp
time $JAVA_HOME/bin/javac -J-XX:-UseAOT -XDignore.symbol.file -cp /java/devtools/share/junit/latest/junit.jar -d tmp $FILES
if [ $? -ne 0 ]; then
exit 1
fi
rm -rf tmp
done
echo "Tiered AOT (compiling $NAME: $COUNT classes):"
for i in `seq 1 $N`; do
mkdir tmp
time $JAVA_HOME/bin/javac -J-XX:+UseAOT -XDignore.symbol.file -cp /java/devtools/share/junit/latest/junit.jar -d tmp $FILES
if [ $? -ne 0 ]; then
exit 1
fi
rm -rf tmp
done
echo "Tiered AOT -Xshare:on (compiling $NAME: $COUNT classes):"
for i in `seq 1 $N`; do
mkdir tmp
time $JAVA_HOME/bin/javac -J-Xshare:on -J-XX:+UseAOT -XDignore.symbol.file -cp /java/devtools/share/junit/latest/junit.jar -d tmp $FILES
if [ $? -ne 0 ]; then
exit 1
fi
rm -rf tmp
done

View file

@ -0,0 +1,74 @@
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
pushd `dirname $0` > /dev/null
DIR=`pwd`
popd > /dev/null
# set env variables
. $DIR/test-env.sh
$JAVA_HOME/bin/java -XX:+UnlockDiagnosticVMOptions -XX:+UseAOTStrictLoading -XX:+PrintAOT -version | grep "aot library" || exit 1
# Dump CDS archive.
$JAVA_HOME/bin/java -Xshare:dump || exit 1
FILE="empty.js"
TIMEFORMAT="%3R"
N=5
rm -f libjdk.nashorn.$SO_TYPE
$JAVA_HOME/bin/jaotc --info --compile-commands jdk.scripting.nashorn-list.txt --module jdk.scripting.nashorn --output libjdk.nashorn.$SO_TYPE || exit 1
echo "Tiered C1:"
for i in `seq 1 $N`; do
time $JAVA_HOME/bin/jjs $JAVA_OPTS -J-XX:-UseAOT -J-XX:TieredStopAtLevel=1 $FILE
if [ $? -ne 0 ]; then
exit 1
fi
done
echo "Tiered C1/C2:"
for i in `seq 1 $N`; do
time $JAVA_HOME/bin/jjs $JAVA_OPTS -J-XX:-UseAOT $FILE
if [ $? -ne 0 ]; then
exit 1
fi
done
echo "Tiered AOT:"
for i in `seq 1 $N`; do
time $JAVA_HOME/bin/jjs $JAVA_OPTS -J-XX:+UnlockDiagnosticVMOptions -J-XX:+UseAOTStrictLoading -J-XX:AOTLibrary=./libjdk.nashorn.$SO_TYPE $FILE
if [ $? -ne 0 ]; then
exit 1
fi
done
echo "Tiered AOT -Xshare:on:"
for i in `seq 1 $N`; do
time $JAVA_HOME/bin/jjs $JAVA_OPTS -J-Xshare:on -J-XX:+UnlockDiagnosticVMOptions -J-XX:+UseAOTStrictLoading -J-XX:AOTLibrary=./libjdk.nashorn.$SO_TYPE $FILE
if [ $? -ne 0 ]; then
exit 1
fi
done
rm -f libjdk.nashorn.$SO_TYPE