8237800: rewrite vmTestbase/jit/escape/LockCoarsening from shell to java

Reviewed-by: roland, neliasso
This commit is contained in:
Igor Ignatyev 2020-01-27 15:35:10 -08:00
parent fc8d71b119
commit e5a99b29f1
6 changed files with 19 additions and 93 deletions

@ -187,8 +187,8 @@ vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219
vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8208243,8192647 generic-all
vmTestbase/jit/escape/LockCoarsening/LockCoarsening001/TestDescription.java 8148743 generic-all
vmTestbase/jit/escape/LockCoarsening/LockCoarsening002/TestDescription.java 8208259 generic-all
vmTestbase/jit/escape/LockCoarsening/LockCoarsening001.java 8148743 generic-all
vmTestbase/jit/escape/LockCoarsening/LockCoarsening002.java 8208259 generic-all
vmTestbase/vm/mlvm/indy/func/jvmti/redefineClassInBootstrap/TestDescription.java 8013267 generic-all
vmTestbase/vm/mlvm/meth/func/java/throwException/Test.java 8058176 generic-all

@ -1650,7 +1650,7 @@ vmTestbase_vm_compiler_quick = \
vmTestbase/jit/deoptimization/test08/test08.java \
vmTestbase/jit/escape/AdaptiveBlocking/AdaptiveBlocking001/AdaptiveBlocking001.java \
vmTestbase/jit/escape/LockElision/MatMul/MatMul.java \
vmTestbase/jit/escape/LockCoarsening/LockCoarsening002/TestDescription.java \
vmTestbase/jit/escape/LockCoarsening/LockCoarsening002.java \
vmTestbase/jit/exception/exception.java \
vmTestbase/jit/graph/cgt0.java \
vmTestbase/jit/graph/cgt1.java \

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, 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
@ -24,7 +24,7 @@ package jit.escape.LockCoarsening;
import nsk.share.TestFailure;
class LockCoarsening {
public class LockCoarsening {
// JVM option '-XX:+EliminateLocks' specified
public static boolean eliminateLocks = false;
// Number of chances Thread 2 has to acquire the lock

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, 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
@ -29,10 +29,13 @@
* VM Testbase keywords: [jit, quarantine]
* VM Testbase comments: 8148743
*
* @requires vm.flavor == "server"
*
* @library /vmTestbase
* /test/lib
* @run driver jdk.test.lib.FileInstaller . .
* @build jit.escape.LockCoarsening.LockCoarsening
* @run shell ../run.sh EliminateLocks
* @run main/othervm
* -XX:+DoEscapeAnalysis -XX:+EliminateLocks
* -Xcomp -XX:-TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeALot
* jit.escape.LockCoarsening.LockCoarsening -eliminateLocks
*/

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, 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
@ -29,10 +29,13 @@
* VM Testbase keywords: [jit, quick, quarantine]
* VM Testbase comments: 8208259
*
* @requires vm.flavor == "server"
*
* @library /vmTestbase
* /test/lib
* @run driver jdk.test.lib.FileInstaller . .
* @build jit.escape.LockCoarsening.LockCoarsening
* @run shell ../run.sh
* @run main/othervm
* -XX:-DoEscapeAnalysis -XX:-EliminateLocks
* -Xcomp -XX:-TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeALot
* jit.escape.LockCoarsening.LockCoarsening
*/

@ -1,80 +0,0 @@
#!/bin/sh
#
# Copyright (c) 2014, 2018, 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.
#
EXECUTE_CLASS=jit.escape.LockCoarsening.LockCoarsening
JAVA="$TESTJAVA/bin/java"
JAVA_OPTS="-cp $TESTCLASSPATH $TESTJAVAOPTS $TESTVMOPTS"
#
# Run the test in EA mode if -server and -Xcomp JVM options specified
# Set EliminateLocks commandline option to enable -XX:+EliminateLocks
#
if [ "$1" = "EliminateLocks" ]; then
EA_OPTS="-XX:+DoEscapeAnalysis -XX:+EliminateLocks"
TEST_ARGS="$TEST_ARGS -eliminateLocks"
else
EA_OPTS="-XX:-DoEscapeAnalysis -XX:-EliminateLocks"
fi
# Additional VM options
ADD_OPTS="-XX:-TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeALot"
echo "Check if EscapeAnalysis is supported"
$JAVA $JAVA_OPTS $EA_OPTS -version
if [ "$?" = 0 ]; then
echo "EA options '$EA_OPTS' are supported"
b1=0
b2=0
for param in $JAVA_OPTS; do
case "$param" in
-server )
b1=1
;;
-Xcomp )
b2=1
;;
esac
done
if [ "$b1$b2" = 11 ]; then
JAVA_OPTS="$JAVA_OPTS $ADD_OPTS $EA_OPTS"
echo "Java options: $JAVA_OPTS"
$JAVA $JAVA_OPTS $EXECUTE_CLASS $TEST_ARGS
exit $?
else
echo "JVM options '-server -Xcomp' not specified"
exit 0
fi
fi
echo "EA not supported, passing test"
exit 0