diff options
author | Andrew McDermott <andrew.mcdermott@linaro.org> | 2013-09-23 11:26:43 +0100 |
---|---|---|
committer | Andrew McDermott <andrew.mcdermott@linaro.org> | 2013-09-23 11:26:43 +0100 |
commit | 12cb87ba925b3d9445a61abd474bdc1413eef645 (patch) | |
tree | a98f6eb783cf7158fe3ae16f4861d1581862c635 | |
parent | 8c70a50e82f4ce7f65bcf389b2aee89d8203d784 (diff) |
New baseline
Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org>
73 files changed, 1556 insertions, 426 deletions
diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/com/sun/net/httpserver/log.txt b/openjdk8-aarch64-port-snapshot/JTwork/classes/com/sun/net/httpserver/log.txt index cd5bb60e..37e02695 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/com/sun/net/httpserver/log.txt +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/com/sun/net/httpserver/log.txt @@ -1 +1 @@ -Sep 17, 2013 1:59:48 AM GET /test/foo.html 200 /127.0.0.1:32929 +Sep 23, 2013 2:19:25 AM GET /test/foo.html 200 /127.0.0.1:55142 diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/BootClassPath/Agent.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/BootClassPath/Agent.jar Binary files differindex 1ca0f41b..9a27efed 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/BootClassPath/Agent.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/BootClassPath/Agent.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/A.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/A.jar Binary files differindex eadb81a2..daec9b70 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/A.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/A.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/Agent.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/Agent.jar Binary files differindex 80198718..775bb5c7 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/Agent.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/Agent.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/AgentSupport.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/AgentSupport.jar Binary files differindex d3ef686d..3899190a 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/AgentSupport.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/AgentSupport.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/BootSupport.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/BootSupport.jar Binary files differindex d1045c3d..b628540a 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/BootSupport.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/BootSupport.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.jar Binary files differindex 65b907f7..b0bf6abf 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.jar Binary files differindex 4a0ac6e6..d0deea43 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/SimpleTests.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/SimpleTests.jar Binary files differindex 6887d80a..32666410 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/SimpleTests.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/SimpleTests.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/Tracer.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/Tracer.jar Binary files differindex 4c318324..c5b33075 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/Tracer.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/Tracer.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/other/Bar.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/other/Bar.jar Binary files differindex 2aabc262..ab8ba13e 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/other/Bar.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/instrument/appendToClassLoaderSearch/other/Bar.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/invoke/lambda/LambdaSerialization.class b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/invoke/lambda/LambdaSerialization.class Binary files differindex 4613bf96..82300cc0 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/invoke/lambda/LambdaSerialization.class +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/lang/invoke/lambda/LambdaSerialization.class diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/net/URLClassLoader/closetest/foo.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/net/URLClassLoader/closetest/foo.jar Binary files differindex 4148145b..35f47e01 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/net/URLClassLoader/closetest/foo.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/net/URLClassLoader/closetest/foo.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/net/URLClassLoader/closetest/test1.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/net/URLClassLoader/closetest/test1.jar Binary files differindex b1acb2e6..d4961de0 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/net/URLClassLoader/closetest/test1.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/net/URLClassLoader/closetest/test1.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/net/URLClassLoader/closetest/test2.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/net/URLClassLoader/closetest/test2.jar Binary files differindex 017f4cc4..ee9741ee 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/net/URLClassLoader/closetest/test2.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/net/URLClassLoader/closetest/test2.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/Locale/spi/tznp.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/Locale/spi/tznp.jar Binary files differindex 845c695a..3799bcf0 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/Locale/spi/tznp.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/Locale/spi/tznp.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Bug4177489Test.class b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Bug4177489Test.class Binary files differdeleted file mode 100644 index abe3e919..00000000 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Bug4177489Test.class +++ /dev/null diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Control/test/package/Messages.properties b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Control/test/package/Messages.properties index 297c6328..9df8b8bd 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Control/test/package/Messages.properties +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Control/test/package/Messages.properties @@ -1,2 +1,2 @@ -#Tue Sep 17 02:23:25 GMT 2013 +#Mon Sep 23 03:03:08 GMT 2013 data= diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Control/test/package/de/Messages.properties b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Control/test/package/de/Messages.properties index 3df99be4..7bdfaa8c 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Control/test/package/de/Messages.properties +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Control/test/package/de/Messages.properties @@ -1,2 +1,2 @@ -#Tue Sep 17 02:23:25 GMT 2013 +#Mon Sep 23 03:03:08 GMT 2013 data=de diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Control/test/package/ja_JP/Messages.properties b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Control/test/package/ja_JP/Messages.properties index f7b3e1c1..61d4a150 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Control/test/package/ja_JP/Messages.properties +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/Control/test/package/ja_JP/Messages.properties @@ -1,2 +1,2 @@ -#Tue Sep 17 02:23:25 GMT 2013 +#Mon Sep 23 03:03:08 GMT 2013 data=ja_JP diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/FakeTestResource.properties b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/FakeTestResource.properties index 6f24fee6..c1c4a110 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/FakeTestResource.properties +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/FakeTestResource.properties @@ -1,3 +1,3 @@ #Test property list -#Tue Sep 17 02:23:53 UTC 2013 +#Mon Sep 23 03:04:21 UTC 2013 message=Hello\! diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/TestResource_es.properties b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/TestResource_es.properties index dfc8b8ac..37967e83 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/TestResource_es.properties +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/ResourceBundle/TestResource_es.properties @@ -1,6 +1,6 @@ #Test property list -#Tue Sep 17 02:23:53 UTC 2013 -Time=Time marches on... +#Mon Sep 23 03:04:21 UTC 2013 +The=The rain in Spain Is=Is there a dog? Now=How now brown cow -The=The rain in Spain +Time=Time marches on... diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/TimeZone/timezonedatetest.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/TimeZone/timezonedatetest.jar Binary files differindex cffdfd76..70dabbd6 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/TimeZone/timezonedatetest.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/TimeZone/timezonedatetest.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/TimeZone/timezonedatetest.store b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/TimeZone/timezonedatetest.store Binary files differindex 76368d63..0c74c2ec 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/TimeZone/timezonedatetest.store +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/TimeZone/timezonedatetest.store diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/logging/Application.out b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/logging/Application.out index 63ce603a..cf972d05 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/logging/Application.out +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/java/util/logging/Application.out @@ -1,4 +1,4 @@ -INFO: AnonLoggerWeakRefLeak created socket on port: 60632 +INFO: AnonLoggerWeakRefLeak created socket on port: 43036 INFO: AnonLoggerWeakRefLeak is calling doMyAppWork() INFO: using default time of 120 seconds. INFO: call count = 0 @@ -13,3 +13,10 @@ INFO: call count = 8000 INFO: call count = 9000 INFO: call count = 10000 INFO: call count = 11000 +INFO: call count = 12000 +INFO: call count = 13000 +INFO: call count = 14000 +INFO: call count = 15000 +INFO: call count = 16000 +INFO: call count = 17000 +INFO: call count = 18000 diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/javax/script/dummy.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/javax/script/dummy.jar Binary files differindex 881a848d..e819653c 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/javax/script/dummy.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/javax/script/dummy.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar1-merge.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar1-merge.jar Binary files differindex 4384a60e..8cdcf003 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar1-merge.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar1-merge.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar1.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar1.jar Binary files differindex 599a3ce0..cffcd247 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar1.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar1.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar2-merge.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar2-merge.jar Binary files differindex d9873566..8f82ed87 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar2-merge.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar2-merge.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar2.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar2.jar Binary files differindex 35b5a7b6..4420fc4a 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar2.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar2.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar3.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar3.jar Binary files differindex 37393f9b..7f7f6b5a 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar3.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/jar3.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/metaInfFilenames/a.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/metaInfFilenames/a.jar Binary files differindex c6884603..d38cc238 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/metaInfFilenames/a.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/metaInfFilenames/a.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/metaInfFilenames/b.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/metaInfFilenames/b.jar Binary files differindex b03802eb..c3504cae 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/metaInfFilenames/b.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/metaInfFilenames/b.jar diff --git a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/metaInfFilenames/c.jar b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/metaInfFilenames/c.jar Binary files differindex 2d1e7a74..38b7b0d6 100644 --- a/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/metaInfFilenames/c.jar +++ b/openjdk8-aarch64-port-snapshot/JTwork/classes/sun/misc/JarIndex/metaInfFilenames/c.jar diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/5091921/Test6890943.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/5091921/Test6890943.sh index 7ebda8f6..755f5689 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/5091921/Test6890943.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/5091921/Test6890943.sh @@ -22,26 +22,16 @@ # questions. # # - +## some tests require path to find test source dir if [ "${TESTSRC}" = "" ] then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi echo "TESTSRC=${TESTSRC}" -if [ "${TESTJAVA}" = "" ] -then - echo "TESTJAVA not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTJAVA=${TESTJAVA}" -if [ "${TESTCLASSES}" = "" ] -then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTCLASSES=${TESTCLASSES}" -echo "CLASSPATH=${CLASSPATH}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh + set -x @@ -50,7 +40,7 @@ cp ${TESTSRC}/input6890943.txt . cp ${TESTSRC}/output6890943.txt . cp ${TESTSRC}/Test6890943.sh . -${TESTJAVA}/bin/javac -d . Test6890943.java +${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test6890943.java ${TESTJAVA}/bin/java -XX:-PrintVMOptions -XX:+IgnoreUnrecognizedVMOptions ${TESTVMOPTS} Test6890943 < input6890943.txt > pretest.out 2>&1 diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/5091921/Test7005594.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/5091921/Test7005594.sh index 858e38a4..9458a16b 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/5091921/Test7005594.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/5091921/Test7005594.sh @@ -22,26 +22,15 @@ # questions. # # - +## some tests require path to find test source dir if [ "${TESTSRC}" = "" ] then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi echo "TESTSRC=${TESTSRC}" -if [ "${TESTJAVA}" = "" ] -then - echo "TESTJAVA not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTJAVA=${TESTJAVA}" -if [ "${TESTCLASSES}" = "" ] -then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTCLASSES=${TESTCLASSES}" -echo "CLASSPATH=${CLASSPATH}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh # Amount of physical memory in megabytes MEM=0 @@ -87,7 +76,7 @@ set -x cp ${TESTSRC}/Test7005594.java . cp ${TESTSRC}/Test7005594.sh . -${TESTJAVA}/bin/javac -d . Test7005594.java +${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test7005594.java ${TESTJAVA}/bin/java ${TESTVMOPTS} -Xms1600m -XX:+IgnoreUnrecognizedVMOptions -XX:-ZapUnusedHeapArea -Xcomp -XX:CompileOnly=Test7005594.test Test7005594 > test.out 2>&1 diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/6857159/Test6857159.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/6857159/Test6857159.sh index 341130e7..b73f1e2a 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/6857159/Test6857159.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/6857159/Test6857159.sh @@ -22,33 +22,22 @@ # questions. # # - +## some tests require path to find test source dir if [ "${TESTSRC}" = "" ] then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi echo "TESTSRC=${TESTSRC}" -if [ "${TESTJAVA}" = "" ] -then - echo "TESTJAVA not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTJAVA=${TESTJAVA}" -if [ "${TESTCLASSES}" = "" ] -then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTCLASSES=${TESTCLASSES}" -echo "CLASSPATH=${CLASSPATH}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh set -x cp ${TESTSRC}/Test6857159.java . cp ${TESTSRC}/Test6857159.sh . -${TESTJAVA}/bin/javac -d . Test6857159.java +${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test6857159.java ${TESTJAVA}/bin/java ${TESTVMOPTS} -Xbatch -XX:+PrintCompilation -XX:CompileOnly=Test6857159\$ct.run Test6857159 > test.out 2>&1 diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/7068051/Test7068051.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/7068051/Test7068051.sh index 3fc263b4..b1ecd453 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/7068051/Test7068051.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/7068051/Test7068051.sh @@ -22,28 +22,24 @@ # questions. # # - +## some tests require path to find test source dir if [ "${TESTSRC}" = "" ] then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi echo "TESTSRC=${TESTSRC}" -if [ "${TESTJAVA}" = "" ] -then - echo "TESTJAVA not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTJAVA=${TESTJAVA}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh set -x -${TESTJAVA}/bin/jar xf ${TESTJAVA}/jre/lib/javaws.jar -${TESTJAVA}/bin/jar cf foo.jar * +${COMPILEJAVA}/bin/jar xf ${COMPILEJAVA}/jre/lib/javaws.jar +${COMPILEJAVA}/bin/jar cf foo.jar * cp ${TESTSRC}/Test7068051.java ./ -${TESTJAVA}/bin/jar -uf0 foo.jar Test7068051.java +${COMPILEJAVA}/bin/jar -uf0 foo.jar Test7068051.java -${TESTJAVA}/bin/javac -d . Test7068051.java +${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test7068051.java ${TESTJAVA}/bin/java ${TESTVMOPTS} -showversion -Xbatch Test7068051 foo.jar diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/7070134/Test7070134.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/7070134/Test7070134.sh index cbebfbab..f11be642 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/7070134/Test7070134.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/7070134/Test7070134.sh @@ -22,33 +22,22 @@ # questions. # # - +## some tests require path to find test source dir if [ "${TESTSRC}" = "" ] then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi echo "TESTSRC=${TESTSRC}" -if [ "${TESTJAVA}" = "" ] -then - echo "TESTJAVA not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTJAVA=${TESTJAVA}" -if [ "${TESTCLASSES}" = "" ] -then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTCLASSES=${TESTCLASSES}" -echo "CLASSPATH=${CLASSPATH}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh set -x cp ${TESTSRC}/Stemmer.java . cp ${TESTSRC}/words . -${TESTJAVA}/bin/javac -d . Stemmer.java +${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Stemmer.java ${TESTJAVA}/bin/java ${TESTVMOPTS} -Xbatch Stemmer words > test.out 2>&1 diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/7200264/Test7200264.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/7200264/Test7200264.sh index 4276a8f1..1652bf3f 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/7200264/Test7200264.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/7200264/Test7200264.sh @@ -23,50 +23,15 @@ # # +## some tests require path to find test source dir if [ "${TESTSRC}" = "" ] then - echo "TESTSRC not set. Test cannot execute. Failed." - exit 1 + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi echo "TESTSRC=${TESTSRC}" -if [ "${TESTJAVA}" = "" ] -then - echo "TESTJAVA not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTJAVA=${TESTJAVA}" -if [ "${TESTCLASSES}" = "" ] -then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 -fi -echo "TESTCLASSES=${TESTCLASSES}" -echo "CLASSPATH=${CLASSPATH}" - -# set platform-dependent variables -OS=`uname -s` -case "$OS" in - SunOS | Linux | Darwin ) - NULL=/dev/null - PS=":" - FS="/" - ;; - Windows_* ) - NULL=NUL - PS=";" - FS="\\" - ;; - CYGWIN_* ) - NULL=/dev/null - PS=";" - FS="/" - ;; - * ) - echo "Unrecognized system!" - exit 1; - ;; -esac - +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion | sed 's/amd64/x86/' | grep "x86" | grep "Server VM" | grep "debug" @@ -88,7 +53,7 @@ else fi cp ${TESTSRC}${FS}TestIntVect.java . -${TESTJAVA}${FS}bin${FS}javac -d . TestIntVect.java +${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} -d . TestIntVect.java ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+PrintCompilation -XX:+TraceNewVectors TestIntVect > test.out 2>&1 diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/8009761/Test8009761.java b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/8009761/Test8009761.java new file mode 100644 index 00000000..f588b82c --- /dev/null +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/8009761/Test8009761.java @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2013, 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. + */ + +/* + * @test + * @bug 8009761 + * @summary Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates + * @run main/othervm -Xmixed -XX:-UseOnStackReplacement -XX:-BackgroundCompilation Test8009761 + * + */ + +public class Test8009761 { + + static class UnloadedClass { + volatile int i; + } + + static Object m1(boolean deopt) { + // When running interpreted, on sparc, the caller's stack is + // extended for the locals and the caller's frame is restored + // on return. + long l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, + l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, + l25, l26, l27, l28, l29, l30, l31, l32, l33, l34, l35, l36, + l37, l38, l39, l40, l41, l42, l43, l44, l45, l46, l47, l48, + l49, l50, l51, l52, l53, l54, l55, l56, l57, l58, l59, l60, + l61, l62, l63, l64, l65, l66, l67, l68, l69, l70, l71, l72, + l73, l74, l75, l76, l77, l78, l79, l80, l81, l82, l83, l84, + l85, l86, l87, l88, l89, l90, l91, l92, l93, l94, l95, l96, + l97, l98, l99, l100, l101, l102, l103, l104, l105, l106, l107, + l108, l109, l110, l111, l112, l113, l114, l115, l116, l117, + l118, l119, l120, l121, l122, l123, l124, l125, l126, l127, + l128, l129, l130, l131, l132, l133, l134, l135, l136, l137, + l138, l139, l140, l141, l142, l143, l144, l145, l146, l147, + l148, l149, l150, l151, l152, l153, l154, l155, l156, l157, + l158, l159, l160, l161, l162, l163, l164, l165, l166, l167, + l168, l169, l170, l171, l172, l173, l174, l175, l176, l177, + l178, l179, l180, l181, l182, l183, l184, l185, l186, l187, + l188, l189, l190, l191, l192, l193, l194, l195, l196, l197, + l198, l199, l200, l201, l202, l203, l204, l205, l206, l207, + l208, l209, l210, l211, l212, l213, l214, l215, l216, l217, + l218, l219, l220, l221, l222, l223, l224, l225, l226, l227, + l228, l229, l230, l231, l232, l233, l234, l235, l236, l237, + l238, l239, l240, l241, l242, l243, l244, l245, l246, l247, + l248, l249, l250, l251, l252, l253, l254, l255, l256, l257, + l258, l259, l260, l261, l262, l263, l264, l265, l266, l267, + l268, l269, l270, l271, l272, l273, l274, l275, l276, l277, + l278, l279, l280, l281, l282, l283, l284, l285, l286, l287, + l288, l289, l290, l291, l292, l293, l294, l295, l296, l297, + l298, l299, l300, l301, l302, l303, l304, l305, l306, l307, + l308, l309, l310, l311, l312, l313, l314, l315, l316, l317, + l318, l319, l320, l321, l322, l323, l324, l325, l326, l327, + l328, l329, l330, l331, l332, l333, l334, l335, l336, l337, + l338, l339, l340, l341, l342, l343, l344, l345, l346, l347, + l348, l349, l350, l351, l352, l353, l354, l355, l356, l357, + l358, l359, l360, l361, l362, l363, l364, l365, l366, l367, + l368, l369, l370, l371, l372, l373, l374, l375, l376, l377, + l378, l379, l380, l381, l382, l383, l384, l385, l386, l387, + l388, l389, l390, l391, l392, l393, l394, l395, l396, l397, + l398, l399, l400, l401, l402, l403, l404, l405, l406, l407, + l408, l409, l410, l411, l412, l413, l414, l415, l416, l417, + l418, l419, l420, l421, l422, l423, l424, l425, l426, l427, + l428, l429, l430, l431, l432, l433, l434, l435, l436, l437, + l438, l439, l440, l441, l442, l443, l444, l445, l446, l447, + l448, l449, l450, l451, l452, l453, l454, l455, l456, l457, + l458, l459, l460, l461, l462, l463, l464, l465, l466, l467, + l468, l469, l470, l471, l472, l473, l474, l475, l476, l477, + l478, l479, l480, l481, l482, l483, l484, l485, l486, l487, + l488, l489, l490, l491, l492, l493, l494, l495, l496, l497, + l498, l499, l500, l501, l502, l503, l504, l505, l506, l507, + l508, l509, l510, l511; + + long ll0, ll1, ll2, ll3, ll4, ll5, ll6, ll7, ll8, ll9, ll10, ll11, ll12, + ll13, ll14, ll15, ll16, ll17, ll18, ll19, ll20, ll21, ll22, ll23, ll24, + ll25, ll26, ll27, ll28, ll29, ll30, ll31, ll32, ll33, ll34, ll35, ll36, + ll37, ll38, ll39, ll40, ll41, ll42, ll43, ll44, ll45, ll46, ll47, ll48, + ll49, ll50, ll51, ll52, ll53, ll54, ll55, ll56, ll57, ll58, ll59, ll60, + ll61, ll62, ll63, ll64, ll65, ll66, ll67, ll68, ll69, ll70, ll71, ll72, + ll73, ll74, ll75, ll76, ll77, ll78, ll79, ll80, ll81, ll82, ll83, ll84, + ll85, ll86, ll87, ll88, ll89, ll90, ll91, ll92, ll93, ll94, ll95, ll96, + ll97, ll98, ll99, ll100, ll101, ll102, ll103, ll104, ll105, ll106, ll107, + ll108, ll109, ll110, ll111, ll112, ll113, ll114, ll115, ll116, ll117, + ll118, ll119, ll120, ll121, ll122, ll123, ll124, ll125, ll126, ll127, + ll128, ll129, ll130, ll131, ll132, ll133, ll134, ll135, ll136, ll137, + ll138, ll139, ll140, ll141, ll142, ll143, ll144, ll145, ll146, ll147, + ll148, ll149, ll150, ll151, ll152, ll153, ll154, ll155, ll156, ll157, + ll158, ll159, ll160, ll161, ll162, ll163, ll164, ll165, ll166, ll167, + ll168, ll169, ll170, ll171, ll172, ll173, ll174, ll175, ll176, ll177, + ll178, ll179, ll180, ll181, ll182, ll183, ll184, ll185, ll186, ll187, + ll188, ll189, ll190, ll191, ll192, ll193, ll194, ll195, ll196, ll197, + ll198, ll199, ll200, ll201, ll202, ll203, ll204, ll205, ll206, ll207, + ll208, ll209, ll210, ll211, ll212, ll213, ll214, ll215, ll216, ll217, + ll218, ll219, ll220, ll221, ll222, ll223, ll224, ll225, ll226, ll227, + ll228, ll229, ll230, ll231, ll232, ll233, ll234, ll235, ll236, ll237, + ll238, ll239, ll240, ll241, ll242, ll243, ll244, ll245, ll246, ll247, + ll248, ll249, ll250, ll251, ll252, ll253, ll254, ll255, ll256, ll257, + ll258, ll259, ll260, ll261, ll262, ll263, ll264, ll265, ll266, ll267, + ll268, ll269, ll270, ll271, ll272, ll273, ll274, ll275, ll276, ll277, + ll278, ll279, ll280, ll281, ll282, ll283, ll284, ll285, ll286, ll287, + ll288, ll289, ll290, ll291, ll292, ll293, ll294, ll295, ll296, ll297, + ll298, ll299, ll300, ll301, ll302, ll303, ll304, ll305, ll306, ll307, + ll308, ll309, ll310, ll311, ll312, ll313, ll314, ll315, ll316, ll317, + ll318, ll319, ll320, ll321, ll322, ll323, ll324, ll325, ll326, ll327, + ll328, ll329, ll330, ll331, ll332, ll333, ll334, ll335, ll336, ll337, + ll338, ll339, ll340, ll341, ll342, ll343, ll344, ll345, ll346, ll347, + ll348, ll349, ll350, ll351, ll352, ll353, ll354, ll355, ll356, ll357, + ll358, ll359, ll360, ll361, ll362, ll363, ll364, ll365, ll366, ll367, + ll368, ll369, ll370, ll371, ll372, ll373, ll374, ll375, ll376, ll377, + ll378, ll379, ll380, ll381, ll382, ll383, ll384, ll385, ll386, ll387, + ll388, ll389, ll390, ll391, ll392, ll393, ll394, ll395, ll396, ll397, + ll398, ll399, ll400, ll401, ll402, ll403, ll404, ll405, ll406, ll407, + ll408, ll409, ll410, ll411, ll412, ll413, ll414, ll415, ll416, ll417, + ll418, ll419, ll420, ll421, ll422, ll423, ll424, ll425, ll426, ll427, + ll428, ll429, ll430, ll431, ll432, ll433, ll434, ll435, ll436, ll437, + ll438, ll439, ll440, ll441, ll442, ll443, ll444, ll445, ll446, ll447, + ll448, ll449, ll450, ll451, ll452, ll453, ll454, ll455, ll456, ll457, + ll458, ll459, ll460, ll461, ll462, ll463, ll464, ll465, ll466, ll467, + ll468, ll469, ll470, ll471, ll472, ll473, ll474, ll475, ll476, ll477, + ll478, ll479, ll480, ll481, ll482, ll483, ll484, ll485, ll486, ll487, + ll488, ll489, ll490, ll491, ll492, ll493, ll494, ll495, ll496, ll497, + ll498, ll499, ll500, ll501, ll502, ll503, ll504, ll505, ll506, ll507, + ll508, ll509, ll510, ll511; + + if (deopt) { + UnloadedClass res = new UnloadedClass(); // sufficient to force deopt with c2 but not c1 + res.i = 0; // forces deopt with c1 + return res; + } + return null; + } + + static int count = 0; + + static void m2() { + // Will be called recursively until a stack overflow + // exception. Makes sure it has a lot of locals so that it's + // not called a sufficient number of times to trigger + // compilation. + + long l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, + l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, + l25, l26, l27, l28, l29, l30, l31, l32, l33, l34, l35, l36, + l37, l38, l39, l40, l41, l42, l43, l44, l45, l46, l47, l48, + l49, l50, l51, l52, l53, l54, l55, l56, l57, l58, l59, l60, + l61, l62, l63, l64, l65, l66, l67, l68, l69, l70, l71, l72, + l73, l74, l75, l76, l77, l78, l79, l80, l81, l82, l83, l84, + l85, l86, l87, l88, l89, l90, l91, l92, l93, l94, l95, l96, + l97, l98, l99, l100, l101, l102, l103, l104, l105, l106, l107, + l108, l109, l110, l111, l112, l113, l114, l115, l116, l117, + l118, l119, l120, l121, l122, l123, l124, l125, l126, l127, + l128, l129, l130, l131, l132, l133, l134, l135, l136, l137, + l138, l139, l140, l141, l142, l143, l144, l145, l146, l147, + l148, l149, l150, l151, l152, l153, l154, l155, l156, l157, + l158, l159, l160, l161, l162, l163, l164, l165, l166, l167, + l168, l169, l170, l171, l172, l173, l174, l175, l176, l177, + l178, l179, l180, l181, l182, l183, l184, l185, l186, l187, + l188, l189, l190, l191, l192, l193, l194, l195, l196, l197, + l198, l199, l200, l201, l202, l203, l204, l205, l206, l207, + l208, l209, l210, l211, l212, l213, l214, l215, l216, l217, + l218, l219, l220, l221, l222, l223, l224, l225, l226, l227, + l228, l229, l230, l231, l232, l233, l234, l235, l236, l237, + l238, l239, l240, l241, l242, l243, l244, l245, l246, l247, + l248, l249, l250, l251, l252, l253, l254, l255, l256, l257, + l258, l259, l260, l261, l262, l263, l264, l265, l266, l267, + l268, l269, l270, l271, l272, l273, l274, l275, l276, l277, + l278, l279, l280, l281, l282, l283, l284, l285, l286, l287, + l288, l289, l290, l291, l292, l293, l294, l295, l296, l297, + l298, l299, l300, l301, l302, l303, l304, l305, l306, l307, + l308, l309, l310, l311, l312, l313, l314, l315, l316, l317, + l318, l319, l320, l321, l322, l323, l324, l325, l326, l327, + l328, l329, l330, l331, l332, l333, l334, l335, l336, l337, + l338, l339, l340, l341, l342, l343, l344, l345, l346, l347, + l348, l349, l350, l351, l352, l353, l354, l355, l356, l357, + l358, l359, l360, l361, l362, l363, l364, l365, l366, l367, + l368, l369, l370, l371, l372, l373, l374, l375, l376, l377, + l378, l379, l380, l381, l382, l383, l384, l385, l386, l387, + l388, l389, l390, l391, l392, l393, l394, l395, l396, l397, + l398, l399, l400, l401, l402, l403, l404, l405, l406, l407, + l408, l409, l410, l411, l412, l413, l414, l415, l416, l417, + l418, l419, l420, l421, l422, l423, l424, l425, l426, l427, + l428, l429, l430, l431, l432, l433, l434, l435, l436, l437, + l438, l439, l440, l441, l442, l443, l444, l445, l446, l447, + l448, l449, l450, l451, l452, l453, l454, l455, l456, l457, + l458, l459, l460, l461, l462, l463, l464, l465, l466, l467, + l468, l469, l470, l471, l472, l473, l474, l475, l476, l477, + l478, l479, l480, l481, l482, l483, l484, l485, l486, l487, + l488, l489, l490, l491, l492, l493, l494, l495, l496, l497, + l498, l499, l500, l501, l502, l503, l504, l505, l506, l507, + l508, l509, l510, l511; + + count++; + m2(); + } + + static Object m3(boolean overflow_stack, boolean deopt) { + if (overflow_stack) { + m2(); + return null; + } + Object o = m1(deopt); + if (deopt) { + m2(); + } + return o; + } + + static public void main(String[] args) { + int c1; + // Call m2 from m3 recursively until stack overflow. Count the number of recursive calls. + try { + m3(true, false); + } catch(StackOverflowError soe) { + } + c1 = count; + // Force the compilation of m3() that will inline m1() + for (int i = 0; i < 20000; i++) { + m3(false, false); + } + count = 0; + // Force deoptimization of m3() in m1(), then return from m1() + // to m3(), call recursively m2(). If deoptimization correctly + // built the interpreter stack for m3()/m1() then we should be + // able to call m2() recursively as many times as before. + try { + m3(false, true); + } catch(StackOverflowError soe) { + } + if (c1 != count) { + System.out.println("Failed: init recursive calls: " + c1 + ". After deopt " + count); + System.exit(97); + } else { + System.out.println("PASSED"); + } + } +} diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java index ebd5a9af..02b92815 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java @@ -35,6 +35,8 @@ public abstract class CompilerWhiteBoxTest { protected static final Method METHOD = getMethod("method"); protected static final int COMPILE_THRESHOLD = Integer.parseInt(getVMOption("CompileThreshold", "10000")); + protected static final boolean BACKGROUND_COMPILATION + = Boolean.valueOf(getVMOption("BackgroundCompilation", "true")); protected static Method getMethod(String name) { try { @@ -45,11 +47,16 @@ public abstract class CompilerWhiteBoxTest { } } - protected static String getVMOption(String name, String defaultValue) { + protected static String getVMOption(String name) { String result; HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); result = diagnostic.getVMOption(name).getValue(); + return result; + } + + protected static String getVMOption(String name, String defaultValue) { + String result = getVMOption(name); return result == null ? defaultValue : result; } @@ -66,6 +73,7 @@ public abstract class CompilerWhiteBoxTest { } catch (Exception e) { System.out.printf("on exception '%s':", e.getMessage()); printInfo(METHOD); + e.printStackTrace(); throw new RuntimeException(e); } System.out.println("at test's end:"); @@ -100,6 +108,9 @@ public abstract class CompilerWhiteBoxTest { protected static void waitBackgroundCompilation(Method method) throws InterruptedException { + if (!BACKGROUND_COMPILATION) { + return; + } final Object obj = new Object(); synchronized (obj) { for (int i = 0; i < 10; ++i) { @@ -129,13 +140,14 @@ public abstract class CompilerWhiteBoxTest { protected final int compile() { int result = 0; - for (int i = 0; i < COMPILE_THRESHOLD; ++i) { + int count = Math.max(COMPILE_THRESHOLD, 150000); + for (int i = 0; i < count; ++i) { result += method(); } + System.out.println("method was invoked " + count + " times"); return result; } - protected int method() { return 42; } diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java index 7690e6a9..fdf498c3 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java @@ -32,12 +32,12 @@ public class DeoptimizeAllTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { + // to prevent inlining #method into #compile() + WHITE_BOX.setDontInlineMethod(METHOD, true); new DeoptimizeAllTest().runTest(); } protected void test() throws Exception { - // to prevent inlining #method into #compile() - WHITE_BOX.setDontInlineMethod(METHOD, true); compile(); checkCompiled(METHOD); WHITE_BOX.deoptimizeAll(); diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java index bc1c9d67..7894c524 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java @@ -32,12 +32,12 @@ public class DeoptimizeMethodTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { + // to prevent inlining #method into #compile() + WHITE_BOX.setDontInlineMethod(METHOD, true); new DeoptimizeMethodTest().runTest(); } protected void test() throws Exception { - // to prevent inlining #method into #compile() - WHITE_BOX.setDontInlineMethod(METHOD, true); compile(); checkCompiled(METHOD); WHITE_BOX.deoptimizeMethod(METHOD); diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java index d0c102f5..374d4840 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java @@ -44,6 +44,8 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest { } public static void main(String[] args) throws Exception { + // to prevent inlining #method into #compile() + WHITE_BOX.setDontInlineMethod(METHOD, true); new IsMethodCompilableTest().runTest(); } @@ -58,8 +60,6 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest { "Warning: test is not applicable if PerMethodRecompilationCutoff == Inf"); return; } - // to prevent inlining #method into #compile() - WHITE_BOX.setDontInlineMethod(METHOD, true); boolean madeNotCompilable = false; for (long i = 0; i < PER_METHOD_RECOMPILATION_CUTOFF; ++i) { diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java index ad4930b6..0b9144c4 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java @@ -32,6 +32,8 @@ public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { + // to prevent inlining #method into #compile() + WHITE_BOX.setDontInlineMethod(METHOD, true); new MakeMethodNotCompilableTest().runTest(); } diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/gc/6941923/test6941923.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/gc/6941923/test6941923.sh index 0c751de1..9b33e32f 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/gc/6941923/test6941923.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/gc/6941923/test6941923.sh @@ -5,38 +5,25 @@ ## @author yqi ## @run shell test6941923.sh ## +## some tests require path to find test source dir +if [ "${TESTSRC}" = "" ] +then + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" +fi +echo "TESTSRC=${TESTSRC}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh ## skip on windows OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) - NULL=/dev/null - PS=":" - FS="/" - ;; Windows_* | CYGWIN_* ) echo "Test skipped for Windows" exit 0 ;; - * ) - echo "Unrecognized system!" - exit 1; - ;; esac -if [ "${JAVA_HOME}" = "" ] -then - echo "JAVA_HOME not set" - exit 0 -fi - -$JAVA_HOME/bin/java ${TESTVMOPTS} -version > $NULL 2>&1 - -if [ $? != 0 ]; then - echo "Wrong JAVA_HOME? JAVA_HOME: $JAVA_HOME" - exit $? -fi - # create a small test case testname="Test" if [ -e ${testname}.java ]; then @@ -96,10 +83,10 @@ msgsuccess="succeeded" msgfail="failed" gclogsize="16K" filesize=$((16*1024)) -$JAVA_HOME/bin/javac ${testname}.java > $NULL 2>&1 +${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} ${testname}.java > $NULL 2>&1 if [ $? != 0 ]; then - echo "$JAVA_HOME/bin/javac ${testname}.java $fail" + echo "${COMPILEJAVA}/bin/javac ${testname}.java $fail" exit -1 fi @@ -119,7 +106,7 @@ fi options="-Xloggc:$logfile -XX:+UseConcMarkSweepGC -XX:+PrintGC -XX:+PrintGCDetails -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=$gclogsize" echo "Test gc log rotation in same file, wait for $tts minutes ...." -$JAVA_HOME/bin/java ${TESTVMOPTS} $options $testname $tts +${TESTJAVA}/bin/java $options $testname $tts if [ $? != 0 ]; then echo "$msgfail" exit -1 @@ -148,7 +135,7 @@ fi numoffiles=3 options="-Xloggc:$logfile -XX:+UseConcMarkSweepGC -XX:+PrintGC -XX:+PrintGCDetails -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=$numoffiles -XX:GCLogFileSize=$gclogsize" echo "Test gc log rotation in $numoffiles files, wait for $tts minutes ...." -$JAVA_HOME/bin/java ${TESTVMOPTS} $options $testname $tts +${TESTJAVA}/bin/java $options $testname $tts if [ $? != 0 ]; then echo "$msgfail" exit -1 diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/gc/TestVerifyBeforeGCDuringStartup.java b/openjdk8-aarch64-port-snapshot/hotspot/test/gc/TestVerifyBeforeGCDuringStartup.java new file mode 100644 index 00000000..109e45e4 --- /dev/null +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/gc/TestVerifyBeforeGCDuringStartup.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2013, 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. + */ + +/* @test TestVerifyBeforeGCDuringStartup.java + * @key gc + * @bug 8010463 + * @summary Simple test run with -XX:+VerifyBeforeGC -XX:-UseTLAB to verify 8010463 + * @library /testlibrary + */ + +import com.oracle.java.testlibrary.OutputAnalyzer; +import com.oracle.java.testlibrary.ProcessTools; + +public class TestVerifyBeforeGCDuringStartup { + public static void main(String args[]) throws Exception { + ProcessBuilder pb = + ProcessTools.createJavaProcessBuilder(System.getProperty("test.vm.opts"), + "-XX:-UseTLAB", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+VerifyBeforeGC", "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("[Verifying"); + output.shouldHaveExitValue(0); + } +} diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/gc/metaspace/ClassMetaspaceSizeInJmapHeap.java b/openjdk8-aarch64-port-snapshot/hotspot/test/gc/metaspace/ClassMetaspaceSizeInJmapHeap.java index 37a5f3a4..b3258466 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/gc/metaspace/ClassMetaspaceSizeInJmapHeap.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/gc/metaspace/ClassMetaspaceSizeInJmapHeap.java @@ -39,8 +39,10 @@ public class ClassMetaspaceSizeInJmapHeap { public static void main(String[] args) throws Exception { String pid = Integer.toString(ProcessTools.getProcessId()); - ProcessBuilder pb = new ProcessBuilder(); - pb.command(JDKToolFinder.getJDKTool("jmap"), "-heap", pid); + JDKToolLauncher jmap = JDKToolLauncher.create("jmap") + .addToolArg("-heap") + .addToolArg(pid); + ProcessBuilder pb = new ProcessBuilder(jmap.getCommand()); File out = new File("ClassMetaspaceSizeInJmapHeap.stdout.txt"); pb.redirectOutput(out); diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/6626217/Test6626217.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/6626217/Test6626217.sh index a8c8a239..ae340798 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/6626217/Test6626217.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/6626217/Test6626217.sh @@ -27,78 +27,29 @@ # @summary Loader-constraint table allows arrays instead of only the base-classes # @run shell Test6626217.sh # - +## some tests require path to find test source dir if [ "${TESTSRC}" = "" ] - then TESTSRC=. -fi - -if [ "${TESTJAVA}" = "" ] -then - PARENT=`dirname \`which java\`` - TESTJAVA=`dirname ${PARENT}` - echo "TESTJAVA not set, selecting " ${TESTJAVA} - echo "If this is incorrect, try setting the variable manually." -fi - -if [ "${TESTCLASSES}" = "" ] then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi - -# set platform-dependent variables -OS=`uname -s` -case "$OS" in - SunOS | Linux | Darwin ) - NULL=/dev/null - PS=":" - FS="/" - RM=/bin/rm - CP=/bin/cp - MV=/bin/mv - ;; - Windows_* ) - NULL=NUL - PS=";" - FS="\\" - RM=rm - CP=cp - MV=mv - ;; - CYGWIN_* ) - NULL=/dev/null - PS=";" - FS="/" - RM=rm - CP=cp - MV=mv - ;; - * ) - echo "Unrecognized system!" - exit 1; - ;; -esac - -JEMMYPATH=${CPAPPEND} -CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH - -THIS_DIR=`pwd` +echo "TESTSRC=${TESTSRC}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh JAVA=${TESTJAVA}${FS}bin${FS}java -JAVAC=${TESTJAVA}${FS}bin${FS}javac - -${JAVA} ${TESTVMOPTS} -version +JAVAC=${COMPILEJAVA}${FS}bin${FS}javac # Current directory is scratch directory, copy all the test source there # (for the subsequent moves to work). -${CP} ${TESTSRC}${FS}* ${THIS_DIR} +${CP} ${TESTSRC}${FS}* ${THIS_DIR} # A Clean Compile: this line will probably fail within jtreg as have a clean dir: ${RM} -f *.class *.impl many_loader.java # Compile all the usual suspects, including the default 'many_loader' ${CP} many_loader1.java.foo many_loader.java -${JAVAC} -source 1.4 -target 1.4 -Xlint *.java +${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint *.java # Rename the class files, so the custom loader (and not the system loader) will find it ${MV} from_loader2.class from_loader2.impl2 @@ -106,7 +57,7 @@ ${MV} from_loader2.class from_loader2.impl2 # Compile the next version of 'many_loader' ${MV} many_loader.class many_loader.impl1 ${CP} many_loader2.java.foo many_loader.java -${JAVAC} -source 1.4 -target 1.4 -Xlint many_loader.java +${JAVAC} ${TESTJAVACOPTS} -source 1.4 -target 1.4 -Xlint many_loader.java # Rename the class file, so the custom loader (and not the system loader) will find it ${MV} many_loader.class many_loader.impl2 diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/6878713/Test6878713.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/6878713/Test6878713.sh index a452ad58..a2b5b2d2 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/6878713/Test6878713.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/6878713/Test6878713.sh @@ -1,71 +1,137 @@ #!/bin/sh +# +# Copyright (c) 2011, 2013, 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. +# + + + ## ## @test ## @bug 6878713 +## @bug 7030610 +## @bug 7037122 +## @bug 7123945 ## @summary Verifier heap corruption, relating to backward jsrs -## @run shell/timeout=120 Test6878713.sh +## @run shell Test6878713.sh ## - +## some tests require path to find test source dir if [ "${TESTSRC}" = "" ] -then TESTSRC=. -fi - -if [ "${TESTJAVA}" = "" ] then - PARENT=`dirname \`which java\`` - TESTJAVA=`dirname ${PARENT}` - echo "TESTJAVA not set, selecting " ${TESTJAVA} - echo "If this is incorrect, try setting the variable manually." + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi +echo "TESTSRC=${TESTSRC}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh -if [ "${TESTCLASSES}" = "" ] -then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 -fi +TARGET_CLASS=OOMCrashClass1960_2 -# set platform-dependent variables -OS=`uname -s` -case "$OS" in - SunOS | Linux | Darwin ) - NULL=/dev/null - PS=":" - FS="/" - ;; - Windows_* ) - NULL=NUL - PS=";" - FS="\\" - ;; - CYGWIN_* ) - NULL=/dev/null - PS=";" - FS="/" - ;; - * ) - echo "Unrecognized system!" - exit 1; - ;; -esac +echo "INFO: extracting the target class." +${COMPILEJAVA}${FS}bin${FS}jar xvf \ + ${TESTSRC}${FS}testcase.jar ${TARGET_CLASS}.class -JEMMYPATH=${CPAPPEND} -CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH +# remove any hs_err_pid that might exist here +rm -f hs_err_pid*.log -THIS_DIR=`pwd` +echo "INFO: checking for 32-bit versus 64-bit VM." +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version 2>&1 \ + | grep "64-Bit [^ ][^ ]* VM" > /dev/null 2>&1 +status="$?" +if [ "$status" = 0 ]; then + echo "INFO: testing a 64-bit VM." + is_64_bit=true +else + echo "INFO: testing a 32-bit VM." +fi -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version +if [ "$is_64_bit" = true ]; then + # limit is 768MB in 8-byte words (1024 * 1024 * 768 / 8) == 100663296 + MALLOC_MAX=100663296 +else + # limit is 768MB in 4-byte words (1024 * 1024 * 768 / 4) == 201326592 + MALLOC_MAX=201326592 +fi +echo "INFO: MALLOC_MAX=$MALLOC_MAX" -${TESTJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar +echo "INFO: executing the target class." +# -XX:+PrintCommandLineFlags for debugging purposes +# -XX:+IgnoreUnrecognizedVMOptions so test will run on a VM without +# the new -XX:MallocMaxTestWords option +# -XX:+UnlockDiagnosticVMOptions so we can use -XX:MallocMaxTestWords +# -XX:MallocMaxTestWords limits malloc to $MALLOC_MAX +${TESTJAVA}${FS}bin${FS}java \ + -XX:+PrintCommandLineFlags \ + -XX:+IgnoreUnrecognizedVMOptions \ + -XX:+UnlockDiagnosticVMOptions \ + -XX:MallocMaxTestWords=$MALLOC_MAX \ + ${TESTVMOPTS} ${TARGET_CLASS} > test.out 2>&1 -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} OOMCrashClass1960_2 > test.out 2>&1 +echo "INFO: begin contents of test.out:" +cat test.out +echo "INFO: end contents of test.out." -if [ -s core -o -s "hs_*.log" ] -then - cat hs*.log - echo "Test Failed" - exit 1 +echo "INFO: checking for memory allocation error message." +# We are looking for this specific memory allocation failure mesg so +# we know we exercised the right allocation path with the test class: +MESG1="Native memory allocation (malloc) failed to allocate 25696531[0-9][0-9] bytes" +grep "$MESG1" test.out +status="$?" +if [ "$status" = 0 ]; then + echo "INFO: found expected memory allocation error message." else - echo "Test Passed" - exit 0 + echo "INFO: did not find expected memory allocation error message." + + # If we didn't find MESG1 above, then there are several scenarios: + # 1) -XX:MallocMaxTestWords is not supported by the current VM and we + # didn't fail TARGET_CLASS's memory allocation attempt; instead + # we failed to find TARGET_CLASS's main() method. The TARGET_CLASS + # is designed to provoke a memory allocation failure during class + # loading; we actually don't care about running the class which is + # why it doesn't have a main() method. + # 2) we failed a memory allocation, but not the one we were looking + # so it might be that TARGET_CLASS no longer tickles the same + # memory allocation code path + # 3) TARGET_CLASS reproduces the failure mode (SIGSEGV) fixed by + # 6878713 because the test is running on a pre-fix VM. + echo "INFO: checking for no main() method message." + MESG2="Error: Main method not found in class" + grep "$MESG2" test.out + status="$?" + if [ "$status" = 0 ]; then + echo "INFO: found no main() method message." + else + echo "FAIL: did not find no main() method message." + # status is non-zero for exit below + + if [ -s hs_err_pid*.log ]; then + echo "INFO: begin contents of hs_err_pid file:" + cat hs_err_pid*.log + echo "INFO: end contents of hs_err_pid file." + fi + fi +fi + +if [ "$status" = 0 ]; then + echo "PASS: test found one of the expected messages." fi +exit "$status" diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/6929067/Test6929067.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/6929067/Test6929067.sh index e4b649df..b707e096 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/6929067/Test6929067.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/6929067/Test6929067.sh @@ -7,18 +7,15 @@ ## @compile T.java ## @run shell Test6929067.sh ## - +set -x if [ "${TESTSRC}" = "" ] -then TESTSRC=. -fi - -if [ "${TESTJAVA}" = "" ] then - PARENT=`dirname \`which java\`` - TESTJAVA=`dirname ${PARENT}` - echo "TESTJAVA not set, selecting " ${TESTJAVA} - echo "If this is incorrect, try setting the variable manually." + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi +echo "TESTSRC=${TESTSRC}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh # set platform-dependent variables OS=`uname -s` @@ -107,7 +104,7 @@ then fi -LD_LIBRARY_PATH=.:${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=.:${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE}:/usr/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH cp ${TESTSRC}${FS}invoke.c . @@ -115,15 +112,16 @@ cp ${TESTSRC}${FS}invoke.c . # Copy the result of our @compile action: cp ${TESTCLASSES}${FS}T.class . -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -fullversion - echo "Architecture: ${ARCH}" echo "Compilation flag: ${COMP_FLAG}" echo "VM type: ${VMTYPE}" +# Note pthread may not be found thus invoke creation will fail to be created. +# Check to ensure you have a /usr/lib/libpthread.so if you don't please look +# for /usr/lib/`uname -m`-linux-gnu version ensure to add that path to below compilation. gcc -DLINUX ${COMP_FLAG} -o invoke \ - -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \ - -L${TESTJAVA}/jre/lib/${ARCH}/${VMTYPE} \ + -I${COMPILEJAVA}/include -I${COMPILEJAVA}/include/linux \ + -L${COMPILEJAVA}/jre/lib/${ARCH}/${VMTYPE} \ -ljvm -lpthread invoke.c ./invoke diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7020373/Test7020373.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7020373/Test7020373.sh index 83e7f4c4..83b7028c 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7020373/Test7020373.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7020373/Test7020373.sh @@ -10,55 +10,15 @@ ## if [ "${TESTSRC}" = "" ] -then TESTSRC=. -fi - -if [ "${TESTJAVA}" = "" ] -then - PARENT=`dirname \`which java\`` - TESTJAVA=`dirname ${PARENT}` - echo "TESTJAVA not set, selecting " ${TESTJAVA} - echo "If this is incorrect, try setting the variable manually." -fi - -if [ "${TESTCLASSES}" = "" ] then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi +echo "TESTSRC=${TESTSRC}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh -# set platform-dependent variables -OS=`uname -s` -case "$OS" in - SunOS | Linux | Darwin ) - NULL=/dev/null - PS=":" - FS="/" - ;; - Windows_* ) - NULL=NUL - PS=";" - FS="\\" - ;; - CYGWIN_* ) - NULL=/dev/null - PS=";" - FS="/" - ;; - * ) - echo "Unrecognized system!" - exit 1; - ;; -esac - -JEMMYPATH=${CPAPPEND} -CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH - -THIS_DIR=`pwd` - -${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version - -${TESTJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar +${COMPILEJAVA}${FS}bin${FS}jar xvf ${TESTSRC}${FS}testcase.jar ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} OOMCrashClass4000_1 > test.out 2>&1 diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7051189/Xchecksig.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7051189/Xchecksig.sh index f3eabce5..143e1445 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7051189/Xchecksig.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7051189/Xchecksig.sh @@ -29,34 +29,22 @@ # if [ "${TESTSRC}" = "" ] - then TESTSRC=. -fi - -if [ "${TESTJAVA}" = "" ] then - PARENT=`dirname \`which java\`` - TESTJAVA=`dirname ${PARENT}` - printf "TESTJAVA not set, selecting " ${TESTJAVA} - printf " If this is incorrect, try setting the variable manually.\n" + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi - +echo "TESTSRC=${TESTSRC}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh OS=`uname -s` case "$OS" in - SunOS | Linux | Darwin ) - FS="/" - ;; Windows_* | CYGWIN_* ) printf "Not testing libjsig.so on Windows. PASSED.\n " exit 0 ;; - * ) - printf "Not testing libjsig.so on unrecognised system. PASSED.\n " - exit 0 - ;; esac - JAVA=${TESTJAVA}${FS}bin${FS}java # LD_PRELOAD arch needs to match the binary we run, so run the java @@ -97,7 +85,7 @@ case $ARCH in ;; esac -LIBJSIG=${TESTJAVA}${FS}jre${FS}lib${FS}${ARCH}${FS}libjsig.so +LIBJSIG=${COMPILEJAVA}${FS}jre${FS}lib${FS}${ARCH}${FS}libjsig.so # If libjsig and binary do not match, skip test. diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7107135/Test.java b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7107135/Test.java new file mode 100644 index 00000000..84f3ab33 --- /dev/null +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7107135/Test.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2002-2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 SAP AG. 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. + */ + +class Test { + + static boolean loadLib(String libName){ + try { + System.loadLibrary(libName); + System.out.println("Loaded library "+ libName + "."); + return true; + } catch (SecurityException e) { + System.out.println("loadLibrary(\"" + libName + "\") throws: " + e + "\n"); + } catch (UnsatisfiedLinkError e) { + System.out.println("loadLibrary(\"" + libName + "\") throws: " + e + "\n"); + } + return false; + } + + public static int counter = 1; + + static int Runner() { + counter = counter * -1; + int i = counter; + if(counter < 2) counter += Runner(); + return i; + } + + public static int run() { + try{ + Runner(); + } catch (StackOverflowError e) { + System.out.println("Caught stack overflow error."); + return 0; + } catch (OutOfMemoryError e) { + return 0; + } + return 2; + } + + public static void main(String argv[]) { + loadLib(argv[0]); + System.exit(run()); + } +} diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7107135/Test7107135.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7107135/Test7107135.sh new file mode 100644 index 00000000..c2834564 --- /dev/null +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7107135/Test7107135.sh @@ -0,0 +1,91 @@ +#!/bin/sh + +# +# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011 SAP AG. 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. +# + +## +## @test Test7107135.sh +## @bug 7107135 +## @summary Stack guard pages lost after loading library with executable stack. +## @run shell Test7107135.sh +## + +if [ "${TESTSRC}" = "" ] +then + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" +fi +echo "TESTSRC=${TESTSRC}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh + +# set platform-dependent variables +OS=`uname -s` +case "$OS" in + Linux) + echo "Testing on Linux" + ;; + *) + NULL=NUL + PS=";" + FS="\\" + echo "Test passed; only valid for Linux" + exit 0; + ;; +esac + +ARCH=`uname -m` + +THIS_DIR=. + +cp ${TESTSRC}${FS}*.java ${THIS_DIR} +${TESTJAVA}${FS}bin${FS}javac *.java + +gcc -fPIC -shared -c -o test.o -I${TESTJAVA}${FS}include -I${TESTJAVA}${FS}include${FS}linux ${TESTSRC}${FS}test.c +ld -shared -z execstack -o libtest-rwx.so test.o +ld -shared -z noexecstack -o libtest-rw.so test.o + + +LD_LIBRARY_PATH=${THIS_DIR} +echo LD_LIBRARY_PATH = ${LD_LIBRARY_PATH} +export LD_LIBRARY_PATH + +# This should not fail. +echo Check testprogram. Expected to pass: +echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw +${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw + +echo +echo Test changing of stack protection: +echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rw +${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} Test test-rwx + +if [ "$?" == "0" ] +then + echo + echo ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} TestMT test-rwx + ${TESTJAVA}${FS}bin${FS}java -cp ${THIS_DIR} TestMT test-rwx +fi + +exit $? diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7107135/TestMT.java b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7107135/TestMT.java new file mode 100644 index 00000000..edea698a --- /dev/null +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7107135/TestMT.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2002-2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 SAP AG. 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. + */ + +class TestMT { + + static boolean loadLib(String libName) { + try { + System.loadLibrary(libName); + System.out.println("Loaded library "+ libName + "."); + return true; + } catch (SecurityException e) { + System.out.println("loadLibrary(\"" + libName + "\") throws: " + e + "\n"); + } catch (UnsatisfiedLinkError e) { + System.out.println("loadLibrary(\"" + libName + "\") throws: " + e + "\n"); + } + return false; + } + + public static int counter = 1; + static int Runner() { + counter = counter * -1; + int i = counter; + if (counter < 2) counter += Runner(); + return i; + } + + public static int run(String msg) { + try { + Runner(); + } catch (StackOverflowError e) { + System.out.println(msg + " caught stack overflow error."); + return 0; + } catch (OutOfMemoryError e) { + return 0; + } + return 2; + } + + public static void main(String argv[]) { + try { + for (int i = 0; i < 20; i++) { + Thread t = new DoStackOverflow("SpawnedThread " + i); + t.start(); + } + run("Main thread"); + loadLib("test-rwx"); + run("Main thread"); + } catch (Exception e) { + System.out.println(e); + } + } + + static class DoStackOverflow extends Thread { + public DoStackOverflow(String name) { + super(name); + } + public void run() { + for (int i = 0; i < 10; ++i) { + TestMT.run(getName()); + yield(); + } + } + } +} diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7107135/test.c b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7107135/test.c new file mode 100644 index 00000000..602063f6 --- /dev/null +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7107135/test.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2002-2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 SAP AG. 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. + */ + +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include "jni.h" +#ifdef __cplusplus +extern "C" { +#endif + +JNIEXPORT jint JNICALL Java_Test_someMethod(JNIEnv *env, jobject mainObject) { + return 3; +} + +#ifdef __cplusplus +} +#endif diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7110720/Test7110720.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7110720/Test7110720.sh index 0788cb56..b051266f 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7110720/Test7110720.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7110720/Test7110720.sh @@ -12,22 +12,13 @@ # if [ "${TESTSRC}" = "" ] - then TESTSRC=. -fi - -if [ "${TESTJAVA}" = "" ] -then - PARENT=`dirname \`which java\`` - TESTJAVA=`dirname ${PARENT}` - echo "TESTJAVA not set, selecting " ${TESTJAVA} - echo "If this is incorrect, try setting the variable manually." -fi - -if [ "${TESTCLASSES}" = "" ] then - echo "TESTCLASSES not set. Test cannot execute. Failed." - exit 1 + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi +echo "TESTSRC=${TESTSRC}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh # Jtreg sets TESTVMOPTS which may include -d64 which is # required to test a 64-bit JVM on some platforms. diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7116786/Test7116786.java b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7116786/Test7116786.java index 8c137ecd..b9140192 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7116786/Test7116786.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7116786/Test7116786.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, 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 @@ -338,9 +338,12 @@ class VerifyErrorCases { "invalid constant pool index in ldc", "Invalid index in ldc"), - new Case("case58", "verifier.cpp", true, "verify_switch", + /* No longer a valid test case for bytecode version >= 51. Nonzero + * padding bytes are permitted with lookupswitch and tableswitch + * bytecodes as of JVMS 3d edition */ + new Case("case58", "verifier.cpp", false, "verify_switch", "bad switch padding", - "Nonzero padding byte in lookswitch or tableswitch"), + "Nonzero padding byte in lookupswitch or tableswitch"), new Case("case59", "verifier.cpp", true, "verify_switch", "tableswitch low is greater than high", diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7158804/Test7158804.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7158804/Test7158804.sh index e7f14238..b5380ec8 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7158804/Test7158804.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7158804/Test7158804.sh @@ -10,13 +10,14 @@ ## @summary Improve config file parsing ## @run shell Test7158804.sh ## - -if [ "${TESTJAVA}" = "" ] +if [ "${TESTSRC}" = "" ] then - echo "TESTJAVA not set. Test cannot execute. Failed." - exit 1 + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi -echo "TESTJAVA=${TESTJAVA}" +echo "TESTSRC=${TESTSRC}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh rm -f .hotspotrc echo -XX:+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa >.hotspotrc diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7162488/Test7162488.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7162488/Test7162488.sh index bd70d027..0250f774 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7162488/Test7162488.sh +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/7162488/Test7162488.sh @@ -29,27 +29,13 @@ # if [ "${TESTSRC}" = "" ] - then TESTSRC=. -fi - -if [ "${TESTJAVA}" = "" ] then - PARENT=`dirname \`which java\`` - TESTJAVA=`dirname ${PARENT}` - printf "TESTJAVA not set, selecting " ${TESTJAVA} - printf " If this is incorrect, try setting the variable manually.\n" + TESTSRC=${PWD} + echo "TESTSRC not set. Using "${TESTSRC}" as default" fi - -# set platform-dependent variables -OS=`uname -s` -case "$OS" in - Windows_* ) - FS="\\" - ;; - * ) - FS="/" - ;; -esac +echo "TESTSRC=${TESTSRC}" +## Adding common setup Variables for running shell tests. +. ${TESTSRC}/../../test_env.sh JAVA=${TESTJAVA}${FS}bin${FS}java diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/8003985/Test8003985.java b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/8003985/Test8003985.java new file mode 100644 index 00000000..5e30f670 --- /dev/null +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/8003985/Test8003985.java @@ -0,0 +1,302 @@ +/* + * Copyright (c) 2013, 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 java.io.BufferedReader; +import java.io.InputStreamReader; +import java.lang.Class; +import java.lang.String; +import java.lang.System; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CyclicBarrier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import sun.misc.Unsafe; +import sun.misc.Contended; + +/* + * @test + * @bug 8003985 + * @summary Support Contended Annotation - JEP 142 + * + * @run main/othervm -XX:-RestrictContended Test8003985 + */ +public class Test8003985 { + + private static final Unsafe U; + private static int ADDRESS_SIZE; + private static int HEADER_SIZE; + + static { + // steal Unsafe + try { + Field unsafe = Unsafe.class.getDeclaredField("theUnsafe"); + unsafe.setAccessible(true); + U = (Unsafe) unsafe.get(null); + } catch (NoSuchFieldException | IllegalAccessException e) { + throw new IllegalStateException(e); + } + + // When running with CompressedOops on 64-bit platform, the address size + // reported by Unsafe is still 8, while the real reference fields are 4 bytes long. + // Try to guess the reference field size with this naive trick. + try { + long off1 = U.objectFieldOffset(CompressedOopsClass.class.getField("obj1")); + long off2 = U.objectFieldOffset(CompressedOopsClass.class.getField("obj2")); + ADDRESS_SIZE = (int) Math.abs(off2 - off1); + HEADER_SIZE = (int) Math.min(off1, off2); + } catch (NoSuchFieldException e) { + ADDRESS_SIZE = -1; + } + } + + static class CompressedOopsClass { + public Object obj1; + public Object obj2; + } + + public static boolean arePaddedPairwise(Class klass, String field1, String field2) throws Exception { + Field f1 = klass.getDeclaredField(field1); + Field f2 = klass.getDeclaredField(field2); + + if (isStatic(f1) != isStatic(f2)) { + return true; // these guys are in naturally disjoint locations + } + + int diff = offset(f1) - offset(f2); + if (diff < 0) { + // f1 is first + return (offset(f2) - (offset(f1) + getSize(f1))) > 64; + } else { + // f2 is first + return (offset(f1) - (offset(f2) + getSize(f2))) > 64; + } + } + + public static boolean isPadded(Class klass, String field1) throws Exception { + Field f1 = klass.getDeclaredField(field1); + + if (isStatic(f1)) { + return offset(f1) > 128 + 64; + } + + return offset(f1) > 64; + } + + public static boolean sameLayout(Class klass1, Class klass2) throws Exception { + for (Field f1 : klass1.getDeclaredFields()) { + Field f2 = klass2.getDeclaredField(f1.getName()); + if (offset(f1) != offset(f2)) { + return false; + } + } + + for (Field f2 : klass1.getDeclaredFields()) { + Field f1 = klass2.getDeclaredField(f2.getName()); + if (offset(f1) != offset(f2)) { + return false; + } + } + + return true; + } + + public static boolean isStatic(Field field) { + return Modifier.isStatic(field.getModifiers()); + } + + public static int offset(Field field) { + if (isStatic(field)) { + return (int) U.staticFieldOffset(field); + } else { + return (int) U.objectFieldOffset(field); + } + } + + public static int getSize(Field field) { + Class type = field.getType(); + if (type == byte.class) { return 1; } + if (type == boolean.class) { return 1; } + if (type == short.class) { return 2; } + if (type == char.class) { return 2; } + if (type == int.class) { return 4; } + if (type == float.class) { return 4; } + if (type == long.class) { return 8; } + if (type == double.class) { return 8; } + return ADDRESS_SIZE; + } + + public static void main(String[] args) throws Exception { + boolean endResult = true; + + // --------------- INSTANCE FIELDS --------------------- + + if (arePaddedPairwise(Test1.class, "int1", "int2") || + isPadded(Test1.class, "int1") || + isPadded(Test1.class, "int2")) { + System.err.println("Test1 failed"); + endResult &= false; + } + + if (!arePaddedPairwise(Test2.class, "int1", "int2") || + !isPadded(Test2.class, "int1") || + isPadded(Test2.class, "int2")) { + System.err.println("Test2 failed"); + endResult &= false; + } + + if (!arePaddedPairwise(Test3.class, "int1", "int2") || + !isPadded(Test3.class, "int1") || + !isPadded(Test3.class, "int2")) { + System.err.println("Test3 failed"); + endResult &= false; + } + + if (arePaddedPairwise(Test4.class, "int1", "int2") || + !isPadded(Test4.class, "int1") || + !isPadded(Test4.class, "int2")) { + System.err.println("Test4 failed"); + endResult &= false; + } + + if (!arePaddedPairwise(Test5.class, "int1", "int2") || + !isPadded(Test5.class, "int1") || + !isPadded(Test5.class, "int2")) { + System.err.println("Test5 failed"); + endResult &= false; + } + + if (!arePaddedPairwise(Test6.class, "int1", "int2") || + !isPadded(Test6.class, "int1") || + !isPadded(Test6.class, "int2")) { + System.err.println("Test6 failed"); + endResult &= false; + } + + if (arePaddedPairwise(Test7.class, "int1", "int2") || + !isPadded(Test7.class, "int1") || + !isPadded(Test7.class, "int2")) { + System.err.println("Test7 failed"); + endResult &= false; + } + + if (!arePaddedPairwise(Test8.class, "int1", "int2") || + !isPadded(Test8.class, "int1") || + !isPadded(Test8.class, "int2")) { + System.err.println("Test8 failed"); + endResult &= false; + } + + if (!arePaddedPairwise(Test9.class, "int1", "int2") || + !isPadded(Test9.class, "int1") || + !isPadded(Test9.class, "int2")) { + System.err.println("Test9 failed"); + endResult &= false; + } + + if (!sameLayout(Test4.class, Test7.class)) { + System.err.println("Test4 and Test7 have different layouts"); + endResult &= false; + } + + if (!sameLayout(Test5.class, Test6.class)) { + System.err.println("Test5 and Test6 have different layouts"); + endResult &= false; + } + + if (!sameLayout(Test8.class, Test9.class)) { + System.err.println("Test8 and Test9 have different layouts"); + endResult &= false; + } + + System.out.println(endResult ? "Test PASSES" : "Test FAILS"); + if (!endResult) { + throw new Error("Test failed"); + } + } + + // ----------------------------------- INSTANCE FIELDS ----------------------------------------- + + // naturally packed + public static class Test1 { + private int int1; + private int int2; + } + + // int1 is padded + public static class Test2 { + @Contended private int int1; + private int int2; + } + + // both fields are padded + public static class Test3 { + @Contended private int int1; + @Contended private int int2; + } + + // fields are padded in the singular group + public static class Test4 { + @Contended("sameGroup") private int int1; + @Contended("sameGroup") private int int2; + } + + // fields are padded in disjoint groups + public static class Test5 { + @Contended("diffGroup1") private int int1; + @Contended("diffGroup2") private int int2; + } + + // fields are padded in disjoint groups + public static class Test6 { + @Contended private int int1; + @Contended("diffGroup2") private int int2; + } + + // fields are padded in the singular group + @Contended + public static class Test7 { + private int int1; + private int int2; + } + + // all fields are padded as the group, and one field is padded specifically + @Contended + public static class Test8 { + @Contended private int int1; + private int int2; + } + + // all fields are padded as the group, and one field is padded specifically + @Contended + public static class Test9 { + @Contended("group") private int int1; + private int int2; + } + +} + diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/8007736/TestStaticIF.java b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/8010389/VMThreadDlopen.java index d3c3239e..04407233 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/8007736/TestStaticIF.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/8010389/VMThreadDlopen.java @@ -19,26 +19,26 @@ * 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 java.io.File; + /* * @test - * @bug 8007736 - * @summary Test static interface method. - * @run main/othervm -Xverify:all TestStaticIF + * @key regression + * @bug 8010389 + * @run main/othervm -Djava.library.path=. VMThreadDlopen */ -public class TestStaticIF implements StaticMethodInInterface { - - public static void main(String[] args) { - System.out.printf("main: %s%n", StaticMethodInInterface.get()); - } -} - -interface StaticMethodInInterface { - - public static String get() { - return "Hello from StaticMethodInInterface.get()"; +public class VMThreadDlopen { + public static void main(String[] args) throws Exception { + File file = new File("libbroken.so"); + file.createNewFile(); + try { + System.loadLibrary("broken"); + } catch (UnsatisfiedLinkError e) { + e.printStackTrace(); + // expected + } } } diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java index 85f533a8..be035e2c 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java @@ -33,17 +33,17 @@ import com.oracle.java.testlibrary.*; public class BooleanFlagWithInvalidValue { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+UseLargePages=8", "-version"); + "-XX:+PrintWarnings=8", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Improperly specified VM option 'UseLargePages=8'"); + output.shouldContain("Improperly specified VM option 'PrintWarnings=8'"); output.shouldHaveExitValue(1); pb = ProcessTools.createJavaProcessBuilder( - "-XX:-UseLargePages=8", "-version"); + "-XX:-PrintWarnings=8", "-version"); output = new OutputAnalyzer(pb.start()); - output.shouldContain("Improperly specified VM option 'UseLargePages=8'"); + output.shouldContain("Improperly specified VM option 'PrintWarnings=8'"); output.shouldHaveExitValue(1); } } diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java index 9d475c21..22abc53c 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java @@ -33,10 +33,10 @@ import com.oracle.java.testlibrary.*; public class FlagWithInvalidValue { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:ObjectAlignmentInBytes=v", "-version"); + "-XX:MaxRAMFraction=v", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Improperly specified VM option 'ObjectAlignmentInBytes=v'"); + output.shouldContain("Improperly specified VM option 'MaxRAMFraction=v'"); output.shouldHaveExitValue(1); } } diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java index d84570eb..7933aef1 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java @@ -33,17 +33,17 @@ import com.oracle.java.testlibrary.*; public class NonBooleanFlagWithInvalidBooleanPrefix { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:-ObjectAlignmentInBytes=16", "-version"); + "-XX:-MaxRAMFraction=16", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Unexpected +/- setting in VM option 'ObjectAlignmentInBytes=16'"); + output.shouldContain("Unexpected +/- setting in VM option 'MaxRAMFraction=16'"); output.shouldHaveExitValue(1); pb = ProcessTools.createJavaProcessBuilder( - "-XX:+ObjectAlignmentInBytes=16", "-version"); + "-XX:+MaxRAMFraction=16", "-version"); output = new OutputAnalyzer(pb.start()); - output.shouldContain("Unexpected +/- setting in VM option 'ObjectAlignmentInBytes=16'"); + output.shouldContain("Unexpected +/- setting in VM option 'MaxRAMFraction=16'"); output.shouldHaveExitValue(1); } diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/NMT/BaselineWithParameter.java b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/NMT/BaselineWithParameter.java index 594bd716..ff10b28a 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/NMT/BaselineWithParameter.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/NMT/BaselineWithParameter.java @@ -43,7 +43,7 @@ public class BaselineWithParameter { // Run 'jcmd <pid> VM.native_memory baseline=false' pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "baseline=false"}); - pb.start(); + pb.start().waitFor(); // Run 'jcmd <pid> VM.native_memory summary=false' pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary=false"}); diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/NMT/PrintNMTStatistics.java b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/NMT/PrintNMTStatistics.java index 084a8151..96bc2f32 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/NMT/PrintNMTStatistics.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/NMT/PrintNMTStatistics.java @@ -27,7 +27,9 @@ * @bug 8005936 * @summary Make sure PrintNMTStatistics works on normal JVM exit * @library /testlibrary /testlibrary/whitebox - * @run compile PrintNMTStatistics.java + * @build PrintNMTStatistics + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main PrintNMTStatistics */ import com.oracle.java.testlibrary.*; @@ -52,13 +54,15 @@ public class PrintNMTStatistics { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", + "-Xbootclasspath/a:.", + "-XX:+WhiteBoxAPI", "-XX:NativeMemoryTracking=summary", - "+XX:+PrintNMTStatistics", + "-XX:+PrintNMTStatistics", "PrintNMTStatistics", "test"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Java Heap (reserved="); + output.shouldContain("Java Heap (reserved="); output.shouldNotContain("error"); output.shouldNotContain("warning"); output.shouldHaveExitValue(0); diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/interned/SanityTest.java b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/interned/SanityTest.java new file mode 100644 index 00000000..779d3fc7 --- /dev/null +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/runtime/interned/SanityTest.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2013, 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. + */ + +/* + * @test SanityTest + * @summary Sanity check of String.intern() & GC + * @library /testlibrary /testlibrary/whitebox + * @build SanityTest + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SanityTest + */ + +import java.util.*; +import sun.hotspot.WhiteBox; + + +public class SanityTest { + public static Object tmp; + public static void main(String... args) { + + WhiteBox wb = WhiteBox.getWhiteBox(); + StringBuilder sb = new StringBuilder(); + sb.append("1234x"); sb.append("x56789"); + String str = sb.toString(); + + if (wb.isInStringTable(str)) { + throw new RuntimeException("String " + str + " is already interned"); + } + str.intern(); + if (!wb.isInStringTable(str)) { + throw new RuntimeException("String " + str + " is not interned"); + } + str = sb.toString(); + wb.fullGC(); + if (wb.isInStringTable(str)) { + throw new RuntimeException("String " + str + " is in StringTable even after GC"); + } + } +} diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/test_env.sh b/openjdk8-aarch64-port-snapshot/hotspot/test/test_env.sh new file mode 100644 index 00000000..fa912dde --- /dev/null +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/test_env.sh @@ -0,0 +1,193 @@ +#!/bin/sh +# +# Copyright (c) 2013, 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 Environment script was written to capture typically used environment +# setup for a given shell test. +# + +# TESTJAVA can be a JDK or JRE. If JRE you need to set COMPILEJAVA +if [ "${TESTJAVA}" = "" ] +then + echo "TESTJAVA not set. Test cannot execute. Failed." + exit 1 +fi +echo "TESTJAVA=${TESTJAVA}" + +# COMPILEJAVA requires a JDK, some shell test use javac,jar,etc +if [ "${COMPILEJAVA}" = "" ] +then + echo "COMPILEJAVA not set. Using TESTJAVA as default" + COMPILEJAVA=${TESTJAVA} +fi +echo "COMPILEJAVA=${COMPILEJAVA}" + +if [ "${TESTCLASSES}" = "" ] +then + echo "TESTCLASES not set. Using "." as default" + TESTCLASSES=. +fi +echo "TESTCLASSES=${TESTCLASSES}" + +# set platform-dependent variables +OS=`uname -s` +case "$OS" in + SunOS | Linux | Darwin ) + NULL=/dev/null + PS=":" + FS="/" + RM=/bin/rm + CP=/bin/cp + MV=/bin/mv + ;; + Windows_* ) + NULL=NUL + PS=";" + FS="\\" + RM=rm + CP=cp + MV=mv + ;; + CYGWIN_* ) + NULL=/dev/null + PS=";" + FS="/" + RM=rm + CP=cp + MV=mv + ;; + * ) + echo "Unrecognized system!" + exit 1; + ;; +esac + +export NULL PS FS RM CP MV +echo "NULL =${NULL}" +echo "PS =${PS}" +echo "FS =${FS}" +echo "RM =${RM}" +echo "CP =${CP}" +echo "MV =${MV}" + +# jtreg -classpathappend:<path> +JEMMYPATH=${CPAPPEND} +CLASSPATH=.${PS}${TESTCLASSES}${PS}${JEMMYPATH} ; export CLASSPATH +echo "CLASSPATH =${CLASSPATH}" + +# Current directory is scratch directory +THIS_DIR=. +echo "THIS_DIR=${THIS_DIR}" + +# Check to ensure the java defined actually works +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -version +if [ $? != 0 ]; then + echo "Wrong TESTJAVA or TESTVMOPTS:" + echo $TESTJAVA TESTVMOPTS + exit 1 +fi + +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Xinternalversion > vm_version.out 2>&1 + +VM_TYPE="unknown" +grep "Server" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_TYPE="server" +fi +grep "Client" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_TYPE="client" +fi + +VM_BITS="32" +grep "64-Bit" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_BITS="64" +fi + +VM_OS="unknown" +grep "solaris" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_OS="solaris" +fi +grep "linux" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_OS="linux" +fi +grep "windows" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_OS="windows" +fi +grep "bsd" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_OS="bsd" +fi + +VM_CPU="unknown" +grep "sparc" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_CPU="sparc" + if [ $VM_BITS = "64" ] + then + VM_CPU="sparcv9" + fi +fi +grep "x86" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_CPU="i386" +fi +grep "amd64" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_CPU="amd64" +fi +grep "arm" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_CPU="arm" +fi +grep "ppc" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_CPU="ppc" +fi +grep "ia64" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_CPU="ia64" +fi +export VM_TYPE VM_BITS VM_OS VM_CPU +echo "VM_TYPE=${VM_TYPE}" +echo "VM_BITS=${VM_BITS}" +echo "VM_OS=${VM_OS}" +echo "VM_CPU=${VM_CPU}" diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java b/openjdk8-aarch64-port-snapshot/hotspot/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java new file mode 100644 index 00000000..0f0c0a49 --- /dev/null +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2013, 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. + */ + +package com.oracle.java.testlibrary; + +import java.util.List; +import java.util.ArrayList; +import java.util.Arrays; + +import com.oracle.java.testlibrary.JDKToolFinder; +import com.oracle.java.testlibrary.ProcessTools; + +/** + * A utility for constructing command lines for starting JDK tool processes. + * + * The JDKToolLauncher can in particular be combined with a + * java.lang.ProcessBuilder to easily run a JDK tool. For example, the + * following code run {@code jmap -heap} against a process with GC logging + * turned on for the {@code jmap} process: + * + * <pre> + * {@code + * JDKToolLauncher jmap = JDKToolLauncher.create("jmap") + * .addVMArg("-XX:+PrintGC"); + * .addVMArg("-XX:+PrintGCDetails") + * .addToolArg("-heap") + * .addToolArg(pid); + * ProcessBuilder pb = new ProcessBuilder(jmap.getCommand()); + * Process p = pb.start(); + * } + * </pre> + */ +public class JDKToolLauncher { + private final String executable; + private final List<String> vmArgs = new ArrayList<String>(); + private final List<String> toolArgs = new ArrayList<String>(); + + private JDKToolLauncher(String tool) { + executable = JDKToolFinder.getJDKTool(tool); + vmArgs.addAll(Arrays.asList(ProcessTools.getPlatformSpecificVMArgs())); + } + + /** + * Creates a new JDKToolLauncher for the specified tool. + * + * @param tool The name of the tool + * @return A new JDKToolLauncher + */ + public static JDKToolLauncher create(String tool) { + return new JDKToolLauncher(tool); + } + + /** + * Adds an argument to the JVM running the tool. + * + * The JVM arguments are passed to the underlying JVM running the tool. + * Arguments will automatically be prepended with "-J". + * + * Any platform specific arguments required for running the tool are + * automatically added. + * + * + * @param arg The argument to VM running the tool + * @return The JDKToolLauncher instance + */ + public JDKToolLauncher addVMArg(String arg) { + vmArgs.add("-J" + arg); + return this; + } + + /** + * Adds an argument to the tool. + * + * @param arg The argument to the tool + * @return The JDKToolLauncher instance + */ + public JDKToolLauncher addToolArg(String arg) { + toolArgs.add(arg); + return this; + } + + /** + * Returns the command that can be used for running the tool. + * + * @return An array whose elements are the arguments of the command. + */ + public String[] getCommand() { + List<String> command = new ArrayList<String>(); + command.add(executable); + command.addAll(vmArgs); + command.addAll(toolArgs); + return command.toArray(new String[command.size()]); + } +} diff --git a/openjdk8-aarch64-port-snapshot/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java b/openjdk8-aarch64-port-snapshot/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java index c9d23ef5..d5d3ab52 100644 --- a/openjdk8-aarch64-port-snapshot/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java +++ b/openjdk8-aarch64-port-snapshot/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java @@ -94,4 +94,10 @@ public class WhiteBox { public native int getMethodCompilationLevel(Method method); public native boolean setDontInlineMethod(Method method, boolean value); public native int getCompileQueuesSize(); + + //Intered strings + public native boolean isInStringTable(String str); + + // force Full GC + public native void fullGC(); } |