changeset 57846:ed2b8b5fe728

8237800: rewrite vmTestbase/jit/escape/LockCoarsening from shell to java Reviewed-by: roland, neliasso
author iignatyev
date Mon, 27 Jan 2020 15:35:10 -0800
parents 4491472db2e0
children ebce016b7358
files test/hotspot/jtreg/ProblemList.txt test/hotspot/jtreg/TEST.quick-groups test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening.java test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening001.java test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening001/TestDescription.java test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening002.java test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening002/TestDescription.java test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/run.sh
diffstat 8 files changed, 87 insertions(+), 161 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/ProblemList.txt	Mon Jan 27 15:34:12 2020 -0800
+++ b/test/hotspot/jtreg/ProblemList.txt	Mon Jan 27 15:35:10 2020 -0800
@@ -187,8 +187,8 @@
 
 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
--- a/test/hotspot/jtreg/TEST.quick-groups	Mon Jan 27 15:34:12 2020 -0800
+++ b/test/hotspot/jtreg/TEST.quick-groups	Mon Jan 27 15:35:10 2020 -0800
@@ -1650,7 +1650,7 @@
   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 \
--- a/test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening.java	Mon Jan 27 15:34:12 2020 -0800
+++ b/test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening.java	Mon Jan 27 15:35:10 2020 -0800
@@ -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 @@
 
 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening001.java	Mon Jan 27 15:35:10 2020 -0800
@@ -0,0 +1,41 @@
+/*
+ * 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
+ * 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
+ *
+ * @summary converted from VM Testbase jit/escape/LockCoarsening/LockCoarsening001.
+ * VM Testbase keywords: [jit, quarantine]
+ * VM Testbase comments: 8148743
+ *
+ * @requires vm.flavor == "server"
+ *
+ * @library /vmTestbase
+ *          /test/lib
+ * @run main/othervm
+ *      -XX:+DoEscapeAnalysis -XX:+EliminateLocks
+ *      -Xcomp -XX:-TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeALot
+ *      jit.escape.LockCoarsening.LockCoarsening -eliminateLocks
+ */
+
--- a/test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening001/TestDescription.java	Mon Jan 27 15:34:12 2020 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2017, 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.
- */
-
-
-/*
- * @test
- *
- * @summary converted from VM Testbase jit/escape/LockCoarsening/LockCoarsening001.
- * VM Testbase keywords: [jit, quarantine]
- * VM Testbase comments: 8148743
- *
- * @library /vmTestbase
- *          /test/lib
- * @run driver jdk.test.lib.FileInstaller . .
- * @build jit.escape.LockCoarsening.LockCoarsening
- * @run shell ../run.sh EliminateLocks
- */
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening002.java	Mon Jan 27 15:35:10 2020 -0800
@@ -0,0 +1,41 @@
+/*
+ * 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
+ * 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
+ *
+ * @summary converted from VM Testbase jit/escape/LockCoarsening/LockCoarsening002.
+ * VM Testbase keywords: [jit, quick, quarantine]
+ * VM Testbase comments: 8208259
+ *
+ * @requires vm.flavor == "server"
+ *
+ * @library /vmTestbase
+ *          /test/lib
+ * @run main/othervm
+ *      -XX:-DoEscapeAnalysis -XX:-EliminateLocks
+ *      -Xcomp -XX:-TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeALot
+ *      jit.escape.LockCoarsening.LockCoarsening
+ */
+
--- a/test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening002/TestDescription.java	Mon Jan 27 15:34:12 2020 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2017, 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.
- */
-
-
-/*
- * @test
- *
- * @summary converted from VM Testbase jit/escape/LockCoarsening/LockCoarsening002.
- * VM Testbase keywords: [jit, quick, quarantine]
- * VM Testbase comments: 8208259
- *
- * @library /vmTestbase
- *          /test/lib
- * @run driver jdk.test.lib.FileInstaller . .
- * @build jit.escape.LockCoarsening.LockCoarsening
- * @run shell ../run.sh
- */
-
--- a/test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/run.sh	Mon Jan 27 15:34:12 2020 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -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