# HG changeset patch # User iignatyev # Date 1467222919 0 # Wed Jun 29 17:55:19 2016 +0000 # Node ID 72fc461d111f0bbe247cb9311a8df7129d9a0ec0 # Parent acfb19913bf3f3ea3491b69fdf1264f79929283f 8132919: use package in compiler tests Reviewed-by: duke diff --git a/make/test/JtregNative.gmk b/make/test/JtregNative.gmk --- a/make/test/JtregNative.gmk +++ b/make/test/JtregNative.gmk @@ -50,7 +50,6 @@ $(HOTSPOT_TOPDIR)/test/runtime/BoolReturn \ $(HOTSPOT_TOPDIR)/test/compiler/floatingpoint/ \ $(HOTSPOT_TOPDIR)/test/compiler/calls \ - $(HOTSPOT_TOPDIR)/test/compiler/native \ $(HOTSPOT_TOPDIR)/test/testlibrary/jvmti \ # diff --git a/test/TEST.groups b/test/TEST.groups --- a/test/TEST.groups +++ b/test/TEST.groups @@ -130,8 +130,8 @@ # Tests that require the full JRE # needs_jre = \ - compiler/c2/6852078/Test6852078.java \ - compiler/c2/7047069/Test7047069.java \ + compiler/c2/Test6852078.java \ + compiler/c2/Test7047069.java \ runtime/6294277/SourceDebugExtension.java \ runtime/ClassFile/JsrRewriting.java \ runtime/ClassFile/OomWhileParsingRepeatedJsr.java \ @@ -277,16 +277,16 @@ compiler/arraycopy/ \ compiler/c1/ \ compiler/c2/ \ - -compiler/c2/5091921/Test6850611.java \ - -compiler/c2/5091921/Test6890943.java \ - -compiler/c2/5091921/Test6905845.java \ - -compiler/c2/6340864 \ - -compiler/c2/6589834 \ - -compiler/c2/6603011 \ - -compiler/c2/6912517 \ - -compiler/c2/6792161 \ - -compiler/c2/7070134 \ - -compiler/c2/8004867 + -compiler/c2/Test6850611.java \ + -compiler/c2/cr6890943/Test6890943.java \ + -compiler/c2/Test6905845.java \ + -compiler/c2/cr6340864 \ + -compiler/c2/cr6589834 \ + -compiler/c2/cr8004867 + -compiler/c2/stemmer \ + -compiler/c2/Test6792161.java \ + -compiler/c2/Test6603011.java \ + -compiler/c2/Test6912517.java \ hotspot_fast_compiler_2 = \ compiler/classUnloading/ \ @@ -303,7 +303,7 @@ compiler/integerArithmetic/ \ compiler/interpreter/ \ compiler/jvmci/ \ - -compiler/codegen/7184394 \ + -compiler/codegen/aes \ -compiler/codecache/stress \ -compiler/gcbarriers/PreserveFPRegistersTest.java @@ -320,13 +320,13 @@ compiler/types/ \ compiler/uncommontrap/ \ compiler/unsafe/ \ - -compiler/intrinsics/adler32 \ -compiler/intrinsics/bmi \ -compiler/intrinsics/mathexact \ - -compiler/intrinsics/multiplytolen \ -compiler/intrinsics/sha \ - -compiler/loopopts/7052494 \ - -compiler/runtime/6826736 + -compiler/intrinsics/bigInteger/TestMultiplyToLen.java \ + -compiler/intrinsics/zip/TestAdler32.java \ + -compiler/loopopts/Test7052494.java \ + -compiler/runtime/Test6826736.java hotspot_fast_compiler_closed = \ sanity/ExecuteInternalVMTests.java diff --git a/test/compiler/arguments/BMICommandLineOptionTestBase.java b/test/compiler/arguments/BMICommandLineOptionTestBase.java --- a/test/compiler/arguments/BMICommandLineOptionTestBase.java +++ b/test/compiler/arguments/BMICommandLineOptionTestBase.java @@ -21,7 +21,10 @@ * questions. */ -import jdk.test.lib.cli.*; +package compiler.arguments; + +import jdk.test.lib.cli.CPUSpecificCommandLineOptionTest; +import jdk.test.lib.cli.CommandLineOptionTest; /** * Base class for all X86 bit manipulation related command line options. diff --git a/test/compiler/arguments/BMISupportedCPUTest.java b/test/compiler/arguments/BMISupportedCPUTest.java --- a/test/compiler/arguments/BMISupportedCPUTest.java +++ b/test/compiler/arguments/BMISupportedCPUTest.java @@ -21,8 +21,10 @@ * questions. */ -import jdk.test.lib.*; -import jdk.test.lib.cli.*; +package compiler.arguments; + +import jdk.test.lib.ExitCode; +import jdk.test.lib.cli.CommandLineOptionTest; /** * Test on bit manipulation related command line options, diff --git a/test/compiler/arguments/BMIUnsupportedCPUTest.java b/test/compiler/arguments/BMIUnsupportedCPUTest.java --- a/test/compiler/arguments/BMIUnsupportedCPUTest.java +++ b/test/compiler/arguments/BMIUnsupportedCPUTest.java @@ -21,8 +21,11 @@ * questions. */ -import jdk.test.lib.*; -import jdk.test.lib.cli.*; +package compiler.arguments; + +import jdk.test.lib.ExitCode; +import jdk.test.lib.Platform; +import jdk.test.lib.cli.CommandLineOptionTest; /** * Test on bit manipulation related command line options, diff --git a/test/compiler/arguments/CheckCICompilerCount.java b/test/compiler/arguments/CheckCICompilerCount.java --- a/test/compiler/arguments/CheckCICompilerCount.java +++ b/test/compiler/arguments/CheckCICompilerCount.java @@ -21,19 +21,22 @@ * questions. */ -import jdk.test.lib.*; - /* * @test CheckCheckCICompilerCount * @bug 8130858 * @bug 8132525 * @summary Check that correct range of values for CICompilerCount are allowed depending on whether tiered is enabled or not - * @library /testlibrary + * @library /testlibrary / * @modules java.base/jdk.internal.misc * java.management - * @run main CheckCICompilerCount + * @run driver compiler.arguments.CheckCICompilerCount */ +package compiler.arguments; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + public class CheckCICompilerCount { private static final String[][] NON_TIERED_ARGUMENTS = { { diff --git a/test/compiler/arguments/CheckCompileThresholdScaling.java b/test/compiler/arguments/CheckCompileThresholdScaling.java --- a/test/compiler/arguments/CheckCompileThresholdScaling.java +++ b/test/compiler/arguments/CheckCompileThresholdScaling.java @@ -21,18 +21,21 @@ * questions. */ -import jdk.test.lib.*; - /* * @test CheckCompileThresholdScaling * @bug 8059604 - * @summary "Add CompileThresholdScaling flag to control when methods are first compiled (with +/-TieredCompilation)" + * @summary Add CompileThresholdScaling flag to control when methods are first compiled (with +/-TieredCompilation) * @library /testlibrary * @modules java.base/jdk.internal.misc * java.management - * @run main CheckCompileThresholdScaling + * @run driver compiler.arguments.CheckCompileThresholdScaling */ +package compiler.arguments; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + public class CheckCompileThresholdScaling { // The flag CompileThresholdScaling scales compilation thresholds diff --git a/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java b/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java --- a/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java +++ b/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java @@ -26,19 +26,19 @@ * @bug 8031321 * @summary Verify processing of UseBMI1Instructions option on CPU with * BMI1 feature support. - * @library /testlibrary /test/lib + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management * @build TestUseBMI1InstructionsOnSupportedCPU * BMISupportedCPUTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseBMI1InstructionsOnSupportedCPU + * -XX:+WhiteBoxAPI + * compiler.arguments.TestUseBMI1InstructionsOnSupportedCPU */ -import sun.hotspot.cpuinfo.CPUInfo; -import jdk.test.lib.*; +package compiler.arguments; public class TestUseBMI1InstructionsOnSupportedCPU extends BMISupportedCPUTest { diff --git a/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java b/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java --- a/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java +++ b/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java @@ -26,20 +26,19 @@ * @bug 8031321 * @summary Verify processing of UseBMI1Instructions option on CPU without * BMI1 feature support. - * @library /testlibrary /test/lib + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management * @build TestUseBMI1InstructionsOnUnsupportedCPU * BMIUnsupportedCPUTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseBMI1InstructionsOnUnsupportedCPU + * -XX:+WhiteBoxAPI + * compiler.arguments.TestUseBMI1InstructionsOnUnsupportedCPU */ -import sun.hotspot.cpuinfo.CPUInfo; -import jdk.test.lib.*; -import jdk.test.lib.cli.*; +package compiler.arguments; public class TestUseBMI1InstructionsOnUnsupportedCPU extends BMIUnsupportedCPUTest { diff --git a/test/compiler/arguments/TestUseCompiler.java b/test/compiler/arguments/TestUseCompiler.java --- a/test/compiler/arguments/TestUseCompiler.java +++ b/test/compiler/arguments/TestUseCompiler.java @@ -25,10 +25,13 @@ * @test TestUseCompiler * @bug 8086068 * @summary Tests execution with inconsistent UseCompiler flag combination. - * @run main/othervm -Xint -XX:+UseCompiler TestUseCompiler - * @run main/othervm -XX:+UseCompiler -Xint TestUseCompiler + * + * @run main/othervm -Xint -XX:+UseCompiler compiler.arguments.TestUseCompiler + * @run main/othervm -XX:+UseCompiler -Xint compiler.arguments.TestUseCompiler */ +package compiler.arguments; + public class TestUseCompiler { public static void main(String args[]) { diff --git a/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java b/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java --- a/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java +++ b/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java @@ -26,20 +26,19 @@ * @bug 8031321 * @summary Verify processing of UseCountLeadingZerosInstruction option * on CPU with LZCNT support. - * @library /testlibrary /test/lib + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseCountLeadingZerosInstructionOnSupportedCPU - * BMISupportedCPUTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission + * + * @build compiler.arguments.TestUseCountLeadingZerosInstructionOnSupportedCPU + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestUseCountLeadingZerosInstructionOnSupportedCPU + * compiler.arguments.TestUseCountLeadingZerosInstructionOnSupportedCPU */ -import sun.hotspot.cpuinfo.CPUInfo; -import jdk.test.lib.*; +package compiler.arguments; public class TestUseCountLeadingZerosInstructionOnSupportedCPU extends BMISupportedCPUTest { diff --git a/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java b/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java --- a/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java +++ b/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java @@ -26,20 +26,19 @@ * @bug 8031321 * @summary Verify processing of UseCountLeadingZerosInstruction option * on CPU without LZCNT support. - * @library /testlibrary /test/lib + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseCountLeadingZerosInstructionOnUnsupportedCPU - * BMIUnsupportedCPUTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission + * + * @build compiler.arguments.TestUseCountLeadingZerosInstructionOnUnsupportedCPU + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestUseCountLeadingZerosInstructionOnUnsupportedCPU + * compiler.arguments.TestUseCountLeadingZerosInstructionOnUnsupportedCPU */ -import sun.hotspot.cpuinfo.CPUInfo; -import jdk.test.lib.*; +package compiler.arguments; public class TestUseCountLeadingZerosInstructionOnUnsupportedCPU extends BMIUnsupportedCPUTest { diff --git a/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java b/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java --- a/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java +++ b/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java @@ -26,21 +26,21 @@ * @bug 8031321 * @summary Verify processing of UseCountTrailingZerosInstruction option * on CPU with TZCNT (BMI1 feature) support. - * @library /testlibrary /test/lib + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseCountTrailingZerosInstructionOnSupportedCPU - * BMISupportedCPUTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission + * + * @build compiler.arguments.TestUseCountTrailingZerosInstructionOnSupportedCPU + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestUseCountTrailingZerosInstructionOnSupportedCPU + * compiler.arguments.TestUseCountTrailingZerosInstructionOnSupportedCPU */ -import sun.hotspot.cpuinfo.CPUInfo; -import jdk.test.lib.*; -import jdk.test.lib.cli.*; +package compiler.arguments; + +import jdk.test.lib.cli.CommandLineOptionTest; public class TestUseCountTrailingZerosInstructionOnSupportedCPU extends BMISupportedCPUTest { diff --git a/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java b/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java --- a/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java +++ b/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java @@ -26,21 +26,21 @@ * @bug 8031321 * @summary Verify processing of UseCountTrailingZerosInstruction option * on CPU without TZCNT instruction (BMI1 feature) support. - * @library /testlibrary /test/lib + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseCountTrailingZerosInstructionOnUnsupportedCPU - * BMIUnsupportedCPUTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission + * + * @build compiler.arguments.TestUseCountTrailingZerosInstructionOnUnsupportedCPU + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestUseCountTrailingZerosInstructionOnUnsupportedCPU + * compiler.arguments.TestUseCountTrailingZerosInstructionOnUnsupportedCPU */ -import sun.hotspot.cpuinfo.CPUInfo; -import jdk.test.lib.*; -import jdk.test.lib.cli.*; +package compiler.arguments; + +import jdk.test.lib.cli.CommandLineOptionTest; public class TestUseCountTrailingZerosInstructionOnUnsupportedCPU extends BMIUnsupportedCPUTest { diff --git a/test/compiler/arraycopy/TestArrayCloneBadAssert.java b/test/compiler/arraycopy/TestArrayCloneBadAssert.java --- a/test/compiler/arraycopy/TestArrayCloneBadAssert.java +++ b/test/compiler/arraycopy/TestArrayCloneBadAssert.java @@ -25,10 +25,14 @@ * @test * @bug 8073792 * @summary assert broken when array size becomes known during igvn - * @run main/othervm -Xcomp -XX:CompileOnly=TestArrayCloneBadAssert.m TestArrayCloneBadAssert * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.arraycopy.TestArrayCloneBadAssert::m + * compiler.arraycopy.TestArrayCloneBadAssert */ +package compiler.arraycopy; + public class TestArrayCloneBadAssert { static final int[] array = new int[5]; diff --git a/test/compiler/arraycopy/TestArrayCopyAsLoadsStores.java b/test/compiler/arraycopy/TestArrayCopyAsLoadsStores.java --- a/test/compiler/arraycopy/TestArrayCopyAsLoadsStores.java +++ b/test/compiler/arraycopy/TestArrayCopyAsLoadsStores.java @@ -25,13 +25,22 @@ * @test * @bug 6912521 * @summary small array copy as loads/stores - * @compile TestArrayCopyAsLoadsStores.java TestArrayCopyUtils.java - * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestArrayCopyAsLoadsStores::m* -XX:TypeProfileLevel=200 TestArrayCopyAsLoadsStores - * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestArrayCopyAsLoadsStores::m* -XX:+IgnoreUnrecognizedVMOptions -XX:+StressArrayCopyMacroNode -XX:TypeProfileLevel=200 TestArrayCopyAsLoadsStores + * @library / * + * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:CompileCommand=dontinline,compiler.arraycopy.TestArrayCopyAsLoadsStores::m* + * -XX:TypeProfileLevel=200 + * compiler.arraycopy.TestArrayCopyAsLoadsStores + * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:CompileCommand=dontinline,compiler.arraycopy.TestArrayCopyAsLoadsStores::m* + * -XX:TypeProfileLevel=200 + * -XX:+IgnoreUnrecognizedVMOptions -XX:+StressArrayCopyMacroNode + * compiler.arraycopy.TestArrayCopyAsLoadsStores */ -import java.util.*; +package compiler.arraycopy; + +import java.util.Arrays; public class TestArrayCopyAsLoadsStores extends TestArrayCopyUtils { diff --git a/test/compiler/arraycopy/TestArrayCopyBadReexec.java b/test/compiler/arraycopy/TestArrayCopyBadReexec.java --- a/test/compiler/arraycopy/TestArrayCopyBadReexec.java +++ b/test/compiler/arraycopy/TestArrayCopyBadReexec.java @@ -25,10 +25,13 @@ * @test * @bug 8073866 * @summary Fix for 8064703 may also cause stores between the allocation and arraycopy to be rexecuted after a deoptimization - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyBadReexec * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.arraycopy.TestArrayCopyBadReexec */ +package compiler.arraycopy; + public class TestArrayCopyBadReexec { static int val; diff --git a/test/compiler/arraycopy/TestArrayCopyMacro.java b/test/compiler/arraycopy/TestArrayCopyMacro.java --- a/test/compiler/arraycopy/TestArrayCopyMacro.java +++ b/test/compiler/arraycopy/TestArrayCopyMacro.java @@ -25,10 +25,13 @@ * @test * @bug 7173584 * @summary arraycopy as macro node - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyMacro * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.arraycopy.TestArrayCopyMacro */ +package compiler.arraycopy; + public class TestArrayCopyMacro { static class A { } diff --git a/test/compiler/arraycopy/TestArrayCopyNoInit.java b/test/compiler/arraycopy/TestArrayCopyNoInit.java --- a/test/compiler/arraycopy/TestArrayCopyNoInit.java +++ b/test/compiler/arraycopy/TestArrayCopyNoInit.java @@ -25,10 +25,13 @@ * @test * @bug 8064703 * @summary Deoptimization between array allocation and arraycopy may result in non initialized array - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=020 TestArrayCopyNoInit * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=020 + * compiler.arraycopy.TestArrayCopyNoInit */ +package compiler.arraycopy; + public class TestArrayCopyNoInit { static int[] m1(int[] src) { diff --git a/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java b/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java --- a/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java +++ b/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java @@ -28,19 +28,22 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestArrayCopyNoInitDeopt - * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * + * @build compiler.arraycopy.TestArrayCopyNoInitDeopt + * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission * jdk.test.lib.Platform * @run main/othervm -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=020 - * TestArrayCopyNoInitDeopt + * compiler.arraycopy.TestArrayCopyNoInitDeopt */ +package compiler.arraycopy; + +import compiler.whitebox.CompilerWhiteBoxTest; +import jdk.test.lib.Platform; import sun.hotspot.WhiteBox; -import sun.hotspot.code.NMethod; -import jdk.test.lib.Platform; -import java.lang.reflect.*; -import compiler.whitebox.CompilerWhiteBoxTest; + +import java.lang.reflect.Method; public class TestArrayCopyNoInitDeopt { diff --git a/test/compiler/arraycopy/TestArrayCopyOfStopped.java b/test/compiler/arraycopy/TestArrayCopyOfStopped.java --- a/test/compiler/arraycopy/TestArrayCopyOfStopped.java +++ b/test/compiler/arraycopy/TestArrayCopyOfStopped.java @@ -25,10 +25,13 @@ * @test * @bug 8074676 * @summary after guards in Arrays.copyOf() intrinsic, control may become top - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyOfStopped * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.arraycopy.TestArrayCopyOfStopped */ +package compiler.arraycopy; + import java.util.Arrays; public class TestArrayCopyOfStopped { diff --git a/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java b/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java --- a/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java +++ b/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java @@ -28,10 +28,13 @@ * are properly sign extended to 64 bit (e.g., PPC64, s390x). This can fail * if slow_arraycopy_C() is commpiled by the C compiler without any imlicit * casts (as spill stores to the stack that are done with 4-byte instruction). - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyOverflowArguments * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.arraycopy.TestArrayCopyOverflowArguments */ +package compiler.arraycopy; + public class TestArrayCopyOverflowArguments { // Without volatile the overflowing computation was moved up and then diff --git a/test/compiler/arraycopy/TestArrayCopyOverflowInBoundChecks.java b/test/compiler/arraycopy/TestArrayCopyOverflowInBoundChecks.java --- a/test/compiler/arraycopy/TestArrayCopyOverflowInBoundChecks.java +++ b/test/compiler/arraycopy/TestArrayCopyOverflowInBoundChecks.java @@ -25,9 +25,13 @@ * @test * @bug 8134468 * @summary test that checks whether an array load falls into the range of an arraycopy is incorrect on 32bits - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyOverflowInBoundChecks * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.arraycopy.TestArrayCopyOverflowInBoundChecks */ + +package compiler.arraycopy; + public class TestArrayCopyOverflowInBoundChecks { static byte[] src_array = { 'a', 'b', 'c', 'd', 'e' }; diff --git a/test/compiler/arraycopy/TestArrayCopyStoppedAfterGuards.java b/test/compiler/arraycopy/TestArrayCopyStoppedAfterGuards.java --- a/test/compiler/arraycopy/TestArrayCopyStoppedAfterGuards.java +++ b/test/compiler/arraycopy/TestArrayCopyStoppedAfterGuards.java @@ -25,10 +25,16 @@ * @test * @bug 8075921 * @summary control becomes top after arraycopy guards and confuses tighly coupled allocation logic - * @run main/othervm -Xcomp -XX:CompileOnly=TestArrayCopyStoppedAfterGuards.test,System.arraycopy TestArrayCopyStoppedAfterGuards + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,java.lang.System::arraycopy + * -XX:CompileCommand=compileonly,compiler.arraycopy.TestArrayCopyStoppedAfterGuards::test + * compiler.arraycopy.TestArrayCopyStoppedAfterGuards * */ +package compiler.arraycopy; + public class TestArrayCopyStoppedAfterGuards { static void test() { diff --git a/test/compiler/arraycopy/TestArrayCopyUtils.java b/test/compiler/arraycopy/TestArrayCopyUtils.java --- a/test/compiler/arraycopy/TestArrayCopyUtils.java +++ b/test/compiler/arraycopy/TestArrayCopyUtils.java @@ -21,9 +21,13 @@ * questions. */ -import java.lang.annotation.*; -import java.lang.reflect.*; -import java.util.*; +package compiler.arraycopy; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.HashMap; abstract class TestArrayCopyUtils { public enum ArraySrc { diff --git a/test/compiler/arraycopy/TestArraysCopyOfNoTypeCheck.java b/test/compiler/arraycopy/TestArraysCopyOfNoTypeCheck.java --- a/test/compiler/arraycopy/TestArraysCopyOfNoTypeCheck.java +++ b/test/compiler/arraycopy/TestArraysCopyOfNoTypeCheck.java @@ -25,10 +25,13 @@ * @test * @bug 8055910 * @summary Arrays.copyOf doesn't perform subtype check - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArraysCopyOfNoTypeCheck * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.arraycopy.TestArraysCopyOfNoTypeCheck */ +package compiler.arraycopy; + import java.util.Arrays; public class TestArraysCopyOfNoTypeCheck { diff --git a/test/compiler/arraycopy/TestDeadArrayCopyOnMemChain.java b/test/compiler/arraycopy/TestDeadArrayCopyOnMemChain.java --- a/test/compiler/arraycopy/TestDeadArrayCopyOnMemChain.java +++ b/test/compiler/arraycopy/TestDeadArrayCopyOnMemChain.java @@ -25,10 +25,13 @@ * @test * @bug 8080699 * @summary eliminated arraycopy node still reachable through exception edges - * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestDeadArrayCopyOnMemChain * + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * compiler.arraycopy.TestDeadArrayCopyOnMemChain */ +package compiler.arraycopy; + public class TestDeadArrayCopyOnMemChain { static class A { int f; diff --git a/test/compiler/arraycopy/TestEliminateArrayCopy.java b/test/compiler/arraycopy/TestEliminateArrayCopy.java --- a/test/compiler/arraycopy/TestEliminateArrayCopy.java +++ b/test/compiler/arraycopy/TestEliminateArrayCopy.java @@ -25,11 +25,16 @@ * @test * @bug 8076188 * @summary arraycopy to non escaping destination may be eliminated - * @compile TestEliminateArrayCopy.java TestArrayCopyUtils.java - * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestEliminateArrayCopy*::m* TestEliminateArrayCopy + * @library / + * + * @run main/othervm -ea -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:CompileCommand=dontinline,compiler.arraycopy.TestEliminateArrayCopy*::m* + * compiler.arraycopy.TestEliminateArrayCopy * */ +package compiler.arraycopy; + public class TestEliminateArrayCopy { static class CloneTests extends TestInstanceCloneUtils { diff --git a/test/compiler/arraycopy/TestEliminatedArrayCopyDeopt.java b/test/compiler/arraycopy/TestEliminatedArrayCopyDeopt.java --- a/test/compiler/arraycopy/TestEliminatedArrayCopyDeopt.java +++ b/test/compiler/arraycopy/TestEliminatedArrayCopyDeopt.java @@ -25,8 +25,12 @@ * @test * @bug 8130847 8156760 * @summary Eliminated instance/array written to by an array copy variant must be correctly initialized when reallocated at a deopt - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestEliminatedArrayCopyDeopt - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+IgnoreUnrecognizedVMOptions -XX:-ReduceInitialCardMarks TestEliminatedArrayCopyDeopt + * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.arraycopy.TestEliminatedArrayCopyDeopt + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:+IgnoreUnrecognizedVMOptions -XX:-ReduceInitialCardMarks + * compiler.arraycopy.TestEliminatedArrayCopyDeopt */ // Test that if an ArrayCopy node is eliminated because it doesn't @@ -34,6 +38,8 @@ // on a deoptimization, when the object/array is reallocated, it is // correctly initialized +package compiler.arraycopy; + public class TestEliminatedArrayCopyDeopt { static class A implements Cloneable { diff --git a/test/compiler/arraycopy/TestEliminatedArrayCopyPhi.java b/test/compiler/arraycopy/TestEliminatedArrayCopyPhi.java --- a/test/compiler/arraycopy/TestEliminatedArrayCopyPhi.java +++ b/test/compiler/arraycopy/TestEliminatedArrayCopyPhi.java @@ -25,10 +25,13 @@ * @test * @bug 8134321 * @summary Code that capture field values of eliminated allocation at a safepoint when there's an arraycopy behind a Phi is broken - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestEliminatedArrayCopyPhi * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.arraycopy.TestEliminatedArrayCopyPhi */ +package compiler.arraycopy; + public class TestEliminatedArrayCopyPhi { static int[] escaped; diff --git a/test/compiler/arraycopy/TestEliminatedArrayLoopPredicateCopyDeopt.java b/test/compiler/arraycopy/TestEliminatedArrayLoopPredicateCopyDeopt.java --- a/test/compiler/arraycopy/TestEliminatedArrayLoopPredicateCopyDeopt.java +++ b/test/compiler/arraycopy/TestEliminatedArrayLoopPredicateCopyDeopt.java @@ -25,10 +25,13 @@ * @test * @bug 8134974 * @summary Cannot pin eliminated arraycopy loads for deopt state in uncommon trap path if it is a loop predicate unc - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestEliminatedArrayLoopPredicateCopyDeopt * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.arraycopy.TestEliminatedArrayLoopPredicateCopyDeopt */ +package compiler.arraycopy; + public class TestEliminatedArrayLoopPredicateCopyDeopt { static boolean test(int[] array_src) { diff --git a/test/compiler/arraycopy/TestInstanceCloneAsLoadsStores.java b/test/compiler/arraycopy/TestInstanceCloneAsLoadsStores.java --- a/test/compiler/arraycopy/TestInstanceCloneAsLoadsStores.java +++ b/test/compiler/arraycopy/TestInstanceCloneAsLoadsStores.java @@ -25,12 +25,23 @@ * @test * @bug 6700100 8156760 * @summary small instance clone as loads/stores - * @compile TestInstanceCloneAsLoadsStores.java TestInstanceCloneUtils.java - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestInstanceCloneAsLoadsStores::m* TestInstanceCloneAsLoadsStores - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestInstanceCloneAsLoadsStores::m* -XX:+IgnoreUnrecognizedVMOptions -XX:+StressArrayCopyMacroNode TestInstanceCloneAsLoadsStores - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestInstanceCloneAsLoadsStores::m* -XX:+IgnoreUnrecognizedVMOptions -XX:-ReduceInitialCardMarks TestInstanceCloneAsLoadsStores + * @library / + * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:CompileCommand=dontinline,compiler.arraycopy.TestInstanceCloneAsLoadsStores::m* + * compiler.arraycopy.TestInstanceCloneAsLoadsStores + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:CompileCommand=dontinline,compiler.arraycopy.TestInstanceCloneAsLoadsStores::m* + * -XX:+IgnoreUnrecognizedVMOptions -XX:+StressArrayCopyMacroNode + * compiler.arraycopy.TestInstanceCloneAsLoadsStores + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:CompileCommand=dontinline,compiler.arraycopy.TestInstanceCloneAsLoadsStores::m* + * -XX:+IgnoreUnrecognizedVMOptions -XX:-ReduceInitialCardMarks + * compiler.arraycopy.TestInstanceCloneAsLoadsStores */ +package compiler.arraycopy; + public class TestInstanceCloneAsLoadsStores extends TestInstanceCloneUtils { // Should be compiled as loads/stores diff --git a/test/compiler/arraycopy/TestInstanceCloneUtils.java b/test/compiler/arraycopy/TestInstanceCloneUtils.java --- a/test/compiler/arraycopy/TestInstanceCloneUtils.java +++ b/test/compiler/arraycopy/TestInstanceCloneUtils.java @@ -21,8 +21,12 @@ * questions. */ -import java.lang.reflect.*; -import java.util.*; +package compiler.arraycopy; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.HashMap; abstract class TestInstanceCloneUtils { static class Base implements Cloneable { diff --git a/test/compiler/arraycopy/TestLoadBypassArrayCopy.java b/test/compiler/arraycopy/TestLoadBypassArrayCopy.java --- a/test/compiler/arraycopy/TestLoadBypassArrayCopy.java +++ b/test/compiler/arraycopy/TestLoadBypassArrayCopy.java @@ -25,10 +25,15 @@ * @test * @bug 8086046 * @summary load bypasses arraycopy that sets the value after the ArrayCopyNode is expanded - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestLoadBypassArrayCopy::test_helper -XX:-TieredCompilation TestLoadBypassArrayCopy * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:CompileCommand=dontinline,compiler.arraycopy.TestLoadBypassArrayCopy::test_helper + * -XX:-TieredCompilation + * compiler.arraycopy.TestLoadBypassArrayCopy */ +package compiler.arraycopy; + public class TestLoadBypassArrayCopy { static long i; diff --git a/test/compiler/arraycopy/TestMissingControl.java b/test/compiler/arraycopy/TestMissingControl.java --- a/test/compiler/arraycopy/TestMissingControl.java +++ b/test/compiler/arraycopy/TestMissingControl.java @@ -25,9 +25,14 @@ * @test * @bug 8055153 * @summary missing control on LoadRange and LoadKlass when array copy macro node is expanded - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-TieredCompilation TestMissingControl + * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-TieredCompilation + * compiler.arraycopy.TestMissingControl * */ + +package compiler.arraycopy; + public class TestMissingControl { static int[] m1(int[] a2) { diff --git a/test/compiler/arraycopy/TestObjectArrayClone.java b/test/compiler/arraycopy/TestObjectArrayClone.java --- a/test/compiler/arraycopy/TestObjectArrayClone.java +++ b/test/compiler/arraycopy/TestObjectArrayClone.java @@ -25,8 +25,14 @@ * @test * @bug 8155643 * @summary Test Object.clone() intrinsic if ReduceInitialCardMarks is disabled. - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:CompileOnly=TestObjectArrayClone.test -XX:-ReduceInitialCardMarks TestObjectArrayClone + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-ReduceInitialCardMarks + * -XX:CompileCommand=compileonly,compiler.arraycopy.TestObjectArrayClone::test + * compiler.arraycopy.TestObjectArrayClone */ + +package compiler.arraycopy; + public class TestObjectArrayClone { public static TestObjectArrayClone[] test(TestObjectArrayClone[] arr) { diff --git a/test/compiler/arraycopy/TestReduceBulkZeroingDisabled.java b/test/compiler/arraycopy/TestReduceBulkZeroingDisabled.java --- a/test/compiler/arraycopy/TestReduceBulkZeroingDisabled.java +++ b/test/compiler/arraycopy/TestReduceBulkZeroingDisabled.java @@ -25,8 +25,13 @@ * @test * @bug 8155241 * @summary Test arraycopy elimination with ReduceBulkZeroing disabled. - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-ReduceBulkZeroing TestReduceBulkZeroingDisabled + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-ReduceBulkZeroing + * compiler.arraycopy.TestReduceBulkZeroingDisabled */ + +package compiler.arraycopy; + public class TestReduceBulkZeroingDisabled { static public void main(String[] args) { diff --git a/test/compiler/c1/CanonicalizeArrayLength.java b/test/compiler/c1/CanonicalizeArrayLength.java --- a/test/compiler/c1/CanonicalizeArrayLength.java +++ b/test/compiler/c1/CanonicalizeArrayLength.java @@ -25,11 +25,29 @@ * @test * @bug 8150102 8150514 8150534 * @summary C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102 - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation CanonicalizeArrayLength - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:+PatchALot CanonicalizeArrayLength - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:ScavengeRootsInCode=0 CanonicalizeArrayLength - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:ScavengeRootsInCode=1 CanonicalizeArrayLength + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 + * -XX:-BackgroundCompilation + * compiler.c1.CanonicalizeArrayLength + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 + * -XX:-BackgroundCompilation + * -XX:+PatchALot + * compiler.c1.CanonicalizeArrayLength + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 + * -XX:-BackgroundCompilation + * -XX:ScavengeRootsInCode=0 + * compiler.c1.CanonicalizeArrayLength + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:CompileThreshold=100 -XX:+TieredCompilation -XX:TieredStopAtLevel=1 + * -XX:-BackgroundCompilation -XX:ScavengeRootsInCode=1 + * compiler.c1.CanonicalizeArrayLength */ + +package compiler.c1; + public class CanonicalizeArrayLength { int[] arr = new int[42]; int[] arrNull = null; diff --git a/test/compiler/c1/6478991/NullCheckTest.java b/test/compiler/c1/NullCheckTest.java rename from test/compiler/c1/6478991/NullCheckTest.java rename to test/compiler/c1/NullCheckTest.java --- a/test/compiler/c1/6478991/NullCheckTest.java +++ b/test/compiler/c1/NullCheckTest.java @@ -27,46 +27,51 @@ * @bug 6478991 * @summary C1 NullCheckEliminator yields incorrect exceptions * - * @run main/othervm -XX:CompileOnly=NullCheckTest.test,NullCheckTest.inlined -Xcomp NullCheckTest + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c1.NullCheckTest::test + * -XX:CompileCommand=compileonly,compiler.c1.NullCheckTest::inlined + * compiler.c1.NullCheckTest */ +package compiler.c1; + public class NullCheckTest { - static class A { - int f; + static class A { + int f; - public final void inlined(A a) { - // This cast is intended to fail. - B b = ((B) a); - } + public final void inlined(A a) { + // This cast is intended to fail. + B b = ((B) a); } + } - static class B extends A { + static class B extends A { + } + + + private static void test(A a1, A a2) { + // Inlined call must do a null check on a1. + // However, the exlipcit NullCheck instruction is eliminated and + // the null check is folded into the field load below, so the + // exception in the inlined method is thrown before the null check + // and the NullPointerException is not thrown. + a1.inlined(a2); + + int x = a1.f; + } + + public static void main(String[] args) { + // load classes + new B(); + try { + test(null, new A()); + + throw new InternalError("FAILURE: no exception"); + } catch (NullPointerException ex) { + System.out.println("CORRECT: NullPointerException"); + } catch (ClassCastException ex) { + System.out.println("FAILURE: ClassCastException"); + throw ex; } - - - private static void test(A a1, A a2) { - // Inlined call must do a null check on a1. - // However, the exlipcit NullCheck instruction is eliminated and - // the null check is folded into the field load below, so the - // exception in the inlined method is thrown before the null check - // and the NullPointerException is not thrown. - a1.inlined(a2); - - int x = a1.f; - } - - public static void main(String[] args) { - // load classes - new B(); - try { - test(null, new A()); - - throw new InternalError("FAILURE: no exception"); - } catch (NullPointerException ex) { - System.out.println("CORRECT: NullPointerException"); - } catch (ClassCastException ex) { - System.out.println("FAILURE: ClassCastException"); - throw ex; - } - } + } } diff --git a/test/compiler/c1/6579789/Test6579789.java b/test/compiler/c1/Test6579789.java rename from test/compiler/c1/6579789/Test6579789.java rename to test/compiler/c1/Test6579789.java --- a/test/compiler/c1/6579789/Test6579789.java +++ b/test/compiler/c1/Test6579789.java @@ -26,9 +26,14 @@ * @test * @bug 6579789 * @summary Internal error "c1_LinearScan.cpp:1429 Error: assert(false,"")" in debuggee with fastdebug VM - * @run main/othervm -Xcomp -XX:UseSSE=0 -XX:CompileOnly=Test6579789.bug Test6579789 + * + * @run main/othervm -Xcomp -XX:UseSSE=0 + * -XX:CompileCommand=compileonly,compiler.c1.Test6579789::bug + * compiler.c1.Test6579789 */ +package compiler.c1; + public class Test6579789 { public static void main(String[] args) { bug(4); diff --git a/test/compiler/c1/6756768/Test6756768.java b/test/compiler/c1/Test6756768.java rename from test/compiler/c1/6756768/Test6756768.java rename to test/compiler/c1/Test6756768.java --- a/test/compiler/c1/6756768/Test6756768.java +++ b/test/compiler/c1/Test6756768.java @@ -26,9 +26,11 @@ * @bug 6756768 * @summary C1 generates invalid code * - * @run main/othervm -Xcomp Test6756768 + * @run main/othervm -Xcomp compiler.c1.Test6756768 */ +package compiler.c1; + class Test6756768a { static boolean var_1 = true; diff --git a/test/compiler/c1/6756768/Test6756768_2.java b/test/compiler/c1/Test6756768_2.java rename from test/compiler/c1/6756768/Test6756768_2.java rename to test/compiler/c1/Test6756768_2.java --- a/test/compiler/c1/6756768/Test6756768_2.java +++ b/test/compiler/c1/Test6756768_2.java @@ -26,9 +26,11 @@ * @bug 6756768 * @summary C1 generates invalid code * - * @run main/othervm -Xcomp Test6756768_2 + * @run main/othervm -Xcomp compiler.c1.Test6756768_2 */ +package compiler.c1; + class Test6756768_2a { static int var = ++Test6756768_2.var; } diff --git a/test/compiler/c1/6757316/Test6757316.java b/test/compiler/c1/Test6757316.java rename from test/compiler/c1/6757316/Test6757316.java rename to test/compiler/c1/Test6757316.java --- a/test/compiler/c1/6757316/Test6757316.java +++ b/test/compiler/c1/Test6757316.java @@ -25,9 +25,12 @@ * @test * @bug 6757316 * @summary load_constant() produces a wrong long constant, with high a low words swapped - * @run main/othervm -Xcomp Test6757316 + * + * @run main/othervm -Xcomp compiler.c1.Test6757316 */ +package compiler.c1; + public class Test6757316 { public static void main(String[] args) { long[] arr = { diff --git a/test/compiler/c1/6758234/Test6758234.java b/test/compiler/c1/Test6758234.java rename from test/compiler/c1/6758234/Test6758234.java rename to test/compiler/c1/Test6758234.java --- a/test/compiler/c1/6758234/Test6758234.java +++ b/test/compiler/c1/Test6758234.java @@ -25,9 +25,14 @@ * @test * @bug 6758234 * @summary if (k cond (a ? : b: c)) returns reversed answer if k is constant and b and c are longs - * @run main/othervm -Xcomp -XX:CompileOnly=Test6758234.main Test6758234 + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c1.Test6758234::main + * compiler.c1.Test6758234 */ +package compiler.c1; + public class Test6758234 { static int x = 0; static int y = 1; diff --git a/test/compiler/c1/6795465/Test6795465.java b/test/compiler/c1/Test6795465.java rename from test/compiler/c1/6795465/Test6795465.java rename to test/compiler/c1/Test6795465.java --- a/test/compiler/c1/6795465/Test6795465.java +++ b/test/compiler/c1/Test6795465.java @@ -27,9 +27,11 @@ * @bug 6795465 * @summary Crash in assembler_sparc.cpp with client compiler on solaris-sparc * - * @run main Test6795465 + * @run main compiler.c1.Test6795465 */ +package compiler.c1; + public class Test6795465 { static long var_1 = -1; diff --git a/test/compiler/c1/6849574/Test.java b/test/compiler/c1/Test6849574.java rename from test/compiler/c1/6849574/Test.java rename to test/compiler/c1/Test6849574.java --- a/test/compiler/c1/6849574/Test.java +++ b/test/compiler/c1/Test6849574.java @@ -27,12 +27,15 @@ * @bug 6849574 * @summary VM crash using NonBlockingHashMap (high_scale_lib) * - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+VerifyBeforeGC Test + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+VerifyBeforeGC + * compiler.c1.Test6849574 */ -import java.util.concurrent.atomic.*; +package compiler.c1; -public class Test extends Thread { +import java.util.concurrent.atomic.AtomicReferenceArray; + +public class Test6849574 extends Thread { public static void main(String[] args) { AtomicReferenceArray a = new AtomicReferenceArray(10000); diff --git a/test/compiler/c1/6855215/Test6855215.java b/test/compiler/c1/Test6855215.java rename from test/compiler/c1/6855215/Test6855215.java rename to test/compiler/c1/Test6855215.java --- a/test/compiler/c1/6855215/Test6855215.java +++ b/test/compiler/c1/Test6855215.java @@ -27,9 +27,11 @@ * @bug 6855215 * @summary Calculation error (NaN) after about 1500 calculations * - * @run main/othervm -Xbatch -XX:UseSSE=0 Test6855215 + * @run main/othervm -Xbatch -XX:UseSSE=0 compiler.c1.Test6855215 */ +package compiler.c1; + public class Test6855215 { private double m; private double b; diff --git a/test/compiler/c1/6932496/Test6932496.java b/test/compiler/c1/Test6932496.java rename from test/compiler/c1/6932496/Test6932496.java rename to test/compiler/c1/Test6932496.java --- a/test/compiler/c1/6932496/Test6932496.java +++ b/test/compiler/c1/Test6932496.java @@ -27,19 +27,25 @@ * @bug 6932496 * @summary incorrect deopt of jsr subroutine on 64 bit c1 * @modules java.base/jdk.internal.org.objectweb.asm - * @run main/othervm -Xcomp -XX:CompileOnly=Test.test Test6932496 + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c1.Test6932496::test + * compiler.c1.Test6932496 */ + +package compiler.c1; + +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.FieldVisitor; +import jdk.internal.org.objectweb.asm.Label; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.org.objectweb.asm.Opcodes; +import jdk.internal.org.objectweb.asm.Type; + +import java.io.IOException; import java.lang.reflect.Method; import java.nio.file.Files; import java.nio.file.Paths; -import java.io.IOException; - -import jdk.internal.org.objectweb.asm.ClassWriter; -import jdk.internal.org.objectweb.asm.MethodVisitor; -import jdk.internal.org.objectweb.asm.FieldVisitor; -import jdk.internal.org.objectweb.asm.Opcodes; -import jdk.internal.org.objectweb.asm.Type; -import jdk.internal.org.objectweb.asm.Label; public class Test6932496 extends ClassLoader { private static final int CLASS_FILE_VERSION = 49; diff --git a/test/compiler/c1/7042153/Test7042153.java b/test/compiler/c1/Test7042153.java rename from test/compiler/c1/7042153/Test7042153.java rename to test/compiler/c1/Test7042153.java --- a/test/compiler/c1/7042153/Test7042153.java +++ b/test/compiler/c1/Test7042153.java @@ -27,19 +27,19 @@ * @bug 7042153 * @summary Bad folding of IfOps with unloaded constant arguments in C1 * - * @run main/othervm -Xcomp Test7042153 + * @run main/othervm -Xcomp compiler.c1.Test7042153 */ -import java.lang.reflect.*; +package compiler.c1; public class Test7042153 { - static public class Bar { } - static public class Foo { } + static public class Bar { } + static public class Foo { } - static volatile boolean z; - public static void main(String [] args) { - Class cx = Bar.class; - Class cy = Foo.class; - z = (cx == cy); - } + static volatile boolean z; + public static void main(String [] args) { + Class cx = Bar.class; + Class cy = Foo.class; + z = (cx == cy); + } } diff --git a/test/compiler/c1/7090976/Test7090976.java b/test/compiler/c1/Test7090976.java rename from test/compiler/c1/7090976/Test7090976.java rename to test/compiler/c1/Test7090976.java --- a/test/compiler/c1/7090976/Test7090976.java +++ b/test/compiler/c1/Test7090976.java @@ -27,9 +27,12 @@ * @bug 7090976 * @summary Eclipse/CDT causes a JVM crash while indexing C++ code * - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement Test7090976 + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.c1.Test7090976 */ +package compiler.c1; + public class Test7090976 { static interface I1 { diff --git a/test/compiler/c1/7103261/Test7103261.java b/test/compiler/c1/Test7103261.java rename from test/compiler/c1/7103261/Test7103261.java rename to test/compiler/c1/Test7103261.java --- a/test/compiler/c1/7103261/Test7103261.java +++ b/test/compiler/c1/Test7103261.java @@ -27,9 +27,11 @@ * @bug 7103261 * @summary crash with jittester on sparc * - * @run main Test7103261 + * @run main compiler.c1.Test7103261 */ +package compiler.c1; + // exercise implicit null checking in the compiler for various field types public class Test7103261 { static Test7103261 null_value; diff --git a/test/compiler/c1/7123108/Test7123108.java b/test/compiler/c1/Test7123108.java rename from test/compiler/c1/7123108/Test7123108.java rename to test/compiler/c1/Test7123108.java --- a/test/compiler/c1/7123108/Test7123108.java +++ b/test/compiler/c1/Test7123108.java @@ -27,9 +27,11 @@ * @bug 7123108 * @summary C1 crashes with assert(if_state != NULL) failed: states do not match up * - * @run main/othervm -Xcomp Test7123108 + * @run main/othervm -Xcomp compiler.c1.Test7123108 */ +package compiler.c1; + public class Test7123108 { static class Test_Class_0 { diff --git a/test/compiler/c1/8004051/Test8004051.java b/test/compiler/c1/Test8004051.java rename from test/compiler/c1/8004051/Test8004051.java rename to test/compiler/c1/Test8004051.java --- a/test/compiler/c1/8004051/Test8004051.java +++ b/test/compiler/c1/Test8004051.java @@ -28,9 +28,11 @@ * @bug 8005722 * @summary assert(_oprs_len[mode] < maxNumberOfOperands) failed: array overflow * - * @run main/othervm -Xcomp Test8004051 + * @run main/othervm -Xcomp compiler.c1.Test8004051 */ +package compiler.c1; + public class Test8004051 { public static void main(String[] argv) { Object o = new Object(); diff --git a/test/compiler/c1/8011706/Test8011706.java b/test/compiler/c1/Test8011706.java rename from test/compiler/c1/8011706/Test8011706.java rename to test/compiler/c1/Test8011706.java --- a/test/compiler/c1/8011706/Test8011706.java +++ b/test/compiler/c1/Test8011706.java @@ -25,10 +25,13 @@ * @test * @bug 8011706 * @summary loop invariant code motion may move load before store to the same field - * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation Test8011706 * + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * compiler.c1.Test8011706 */ +package compiler.c1; + public class Test8011706 { int[] array; diff --git a/test/compiler/c1/8011771/Test8011771.java b/test/compiler/c1/Test8011771.java rename from test/compiler/c1/8011771/Test8011771.java rename to test/compiler/c1/Test8011771.java --- a/test/compiler/c1/8011771/Test8011771.java +++ b/test/compiler/c1/Test8011771.java @@ -25,10 +25,12 @@ * @test * @bug 8011771 * @summary Array bound check elimination's in block motion doesn't always reset its data structures from one step to the other. - * @run main/othervm -XX:-BackgroundCompilation Test8011771 * + * @run main/othervm -XX:-BackgroundCompilation compiler.c1.Test8011771 */ +package compiler.c1; + public class Test8011771 { static void m(int[] a, int[] b, int j) { diff --git a/test/compiler/c1/6769124/TestArrayCopy6769124.java b/test/compiler/c1/TestArrayCopy.java rename from test/compiler/c1/6769124/TestArrayCopy6769124.java rename to test/compiler/c1/TestArrayCopy.java --- a/test/compiler/c1/6769124/TestArrayCopy6769124.java +++ b/test/compiler/c1/TestArrayCopy.java @@ -26,9 +26,13 @@ * @test * @bug 6769124 * @summary arraycopy may crash the VM with c1 on 64 bit + * + * @run main compiler.c1.TestArrayCopy */ -public class TestArrayCopy6769124 { +package compiler.c1; + +public class TestArrayCopy { public static void main(String[] args) { diff --git a/test/compiler/c1/6769124/TestDeoptInt6769124.java b/test/compiler/c1/TestDeoptInt.java rename from test/compiler/c1/6769124/TestDeoptInt6769124.java rename to test/compiler/c1/TestDeoptInt.java --- a/test/compiler/c1/6769124/TestDeoptInt6769124.java +++ b/test/compiler/c1/TestDeoptInt.java @@ -27,10 +27,14 @@ * @bug 6769124 * @summary int value might not be correctly decoded on deopt with c1 on 64 bit * - * @run main/othervm -Xcomp -XX:CompileOnly=TestDeoptInt6769124.m TestDeoptInt6769124 + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c1.TestDeoptInt::m + * compiler.c1.TestDeoptInt */ -public class TestDeoptInt6769124 { +package compiler.c1; + +public class TestDeoptInt { static class A { volatile int vl; diff --git a/test/compiler/c1/6769124/TestUnalignedLoad6769124.java b/test/compiler/c1/TestUnalignedLoad.java rename from test/compiler/c1/6769124/TestUnalignedLoad6769124.java rename to test/compiler/c1/TestUnalignedLoad.java --- a/test/compiler/c1/6769124/TestUnalignedLoad6769124.java +++ b/test/compiler/c1/TestUnalignedLoad.java @@ -26,9 +26,13 @@ * @test * @bug 6769124 * @summary unaligned load may fail with c1 on 64 bit + * + * @run main compiler.c1.TestUnalignedLoad */ -public class TestUnalignedLoad6769124 { +package compiler.c1; + +public class TestUnalignedLoad { static long l1v = 0x200000003L; static long l2v = 0x400000005L; diff --git a/test/compiler/c2/FloatingPointFoldingTest.java b/test/compiler/c2/FloatingPointFoldingTest.java --- a/test/compiler/c2/FloatingPointFoldingTest.java +++ b/test/compiler/c2/FloatingPointFoldingTest.java @@ -26,9 +26,19 @@ * @test * @bug 8073670 * @summary Test that causes C2 to fold two NaNs with different values into a single NaN. - * @run main/othervm -XX:-TieredCompilation -Xcomp -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_double_inf -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_double_zero -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_double_nan -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_float_inf -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_float_zero -XX:CompileCommand=compileonly,FloatingPointFoldingTest.test_float_nan FloatingPointFoldingTest + * + * @run main/othervm -XX:-TieredCompilation -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.FloatingPointFoldingTest::test_double_inf + * -XX:CompileCommand=compileonly,compiler.c2.FloatingPointFoldingTest::test_double_zero + * -XX:CompileCommand=compileonly,compiler.c2.FloatingPointFoldingTest::test_double_nan + * -XX:CompileCommand=compileonly,compiler.c2.FloatingPointFoldingTest::test_float_inf + * -XX:CompileCommand=compileonly,compiler.c2.FloatingPointFoldingTest::test_float_zero + * -XX:CompileCommand=compileonly,compiler.c2.FloatingPointFoldingTest::test_float_nan + * compiler.c2.FloatingPointFoldingTest */ +package compiler.c2; + public class FloatingPointFoldingTest { // Double values. public static final long MINUS_INF_LONGBITS = 0xfff0000000000000L; diff --git a/test/compiler/c2/6663621/IVTest.java b/test/compiler/c2/IVTest.java rename from test/compiler/c2/6663621/IVTest.java rename to test/compiler/c2/IVTest.java --- a/test/compiler/c2/6663621/IVTest.java +++ b/test/compiler/c2/IVTest.java @@ -26,8 +26,12 @@ * @test * @bug 6663621 * @summary JVM crashes while trying to execute api/java_security/Signature/SignatureTests.html#initSign tests. + * + * @run main compiler.c2.IVTest */ +package compiler.c2; + public class IVTest { static int paddedSize; diff --git a/test/compiler/c2/6772683/InterruptedTest.java b/test/compiler/c2/InterruptedTest.java rename from test/compiler/c2/6772683/InterruptedTest.java rename to test/compiler/c2/InterruptedTest.java --- a/test/compiler/c2/6772683/InterruptedTest.java +++ b/test/compiler/c2/InterruptedTest.java @@ -26,9 +26,12 @@ * @test * @bug 6772683 * @summary Thread.isInterrupted() fails to return true on multiprocessor PC - * @run main/othervm InterruptedTest 100 + * + * @run main/othervm compiler.c2.InterruptedTest 100 */ +package compiler.c2; + public class InterruptedTest { public static void main(String[] args) throws Exception { diff --git a/test/compiler/c2/6894807/IsInstanceTest.java b/test/compiler/c2/IsInstanceTest.java rename from test/compiler/c2/6894807/IsInstanceTest.java rename to test/compiler/c2/IsInstanceTest.java --- a/test/compiler/c2/6894807/IsInstanceTest.java +++ b/test/compiler/c2/IsInstanceTest.java @@ -25,9 +25,12 @@ * @test * @bug 6894807 * @summary No ClassCastException for HashAttributeSet constructors if run with -Xcomp - * @run main IsInstanceTest + * + * @run main compiler.c2.IsInstanceTest */ +package compiler.c2; + public class IsInstanceTest { public static void main(String[] args) { diff --git a/test/compiler/c2/8005956/PolynomialRoot.java b/test/compiler/c2/PolynomialRoot.java rename from test/compiler/c2/8005956/PolynomialRoot.java rename to test/compiler/c2/PolynomialRoot.java --- a/test/compiler/c2/8005956/PolynomialRoot.java +++ b/test/compiler/c2/PolynomialRoot.java @@ -10,16 +10,20 @@ */ /** -* @test -* @bug 8005956 -* @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block -* @library /testlibrary -* @modules java.base/jdk.internal.misc -* java.management -* @run main/timeout=300 PolynomialRoot -*/ + * @test + * @bug 8005956 + * @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block + * @library /testlibrary + * @modules java.base/jdk.internal.misc + * java.management + * + * @run main/timeout=300 compiler.c2.PolynomialRoot + */ + +package compiler.c2; import jdk.test.lib.Utils; + import java.util.Arrays; import java.util.Random; diff --git a/test/compiler/c2/5057225/Test5057225.java b/test/compiler/c2/Test5057225.java rename from test/compiler/c2/5057225/Test5057225.java rename to test/compiler/c2/Test5057225.java --- a/test/compiler/c2/5057225/Test5057225.java +++ b/test/compiler/c2/Test5057225.java @@ -27,9 +27,13 @@ * @summary Remove useless I2L conversions * @modules java.base/jdk.internal.misc * @library /testlibrary - * @run main/othervm -Xcomp -XX:CompileOnly=Test5057225.doload Test5057225 + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test5057225::doload + * compiler.c2.Test5057225 */ +package compiler.c2; import jdk.test.lib.Utils; public class Test5057225 { @@ -69,17 +73,17 @@ public static void main(String[] args) throws Exception { for (int i = 0; i < BYTE_MASKS.length; i++) { System.setProperty("value", "" + BYTE_MASKS[i]); - loadAndRunClass("Test5057225$loadUB2L"); + loadAndRunClass(Test5057225.class.getName() + "$loadUB2L"); } for (int i = 0; i < SHORT_MASKS.length; i++) { System.setProperty("value", "" + SHORT_MASKS[i]); - loadAndRunClass("Test5057225$loadUS2L"); + loadAndRunClass(Test5057225.class.getName() + "$loadUS2L"); } for (int i = 0; i < INT_MASKS.length; i++) { System.setProperty("value", "" + INT_MASKS[i]); - loadAndRunClass("Test5057225$loadUI2L"); + loadAndRunClass(Test5057225.class.getName() + "$loadUI2L"); } } diff --git a/test/compiler/c2/5091921/Test5091921.java b/test/compiler/c2/Test5091921.java rename from test/compiler/c2/5091921/Test5091921.java rename to test/compiler/c2/Test5091921.java --- a/test/compiler/c2/5091921/Test5091921.java +++ b/test/compiler/c2/Test5091921.java @@ -27,9 +27,13 @@ * @bug 5091921 * @summary Sign flip issues in loop optimizer * - * @run main/othervm -Xcomp -XX:CompileOnly=Test5091921 -XX:MaxInlineSize=1 Test5091921 + * @run main/othervm -Xcomp -XX:MaxInlineSize=1 + * -XX:CompileCommand=compileonly,compiler.c2.Test5091921::* + * compiler.c2.Test5091921 */ +package compiler.c2; + public class Test5091921 { private static int result = 0; diff --git a/test/compiler/c2/5091921/Test6186134.java b/test/compiler/c2/Test6186134.java rename from test/compiler/c2/5091921/Test6186134.java rename to test/compiler/c2/Test6186134.java --- a/test/compiler/c2/5091921/Test6186134.java +++ b/test/compiler/c2/Test6186134.java @@ -27,45 +27,48 @@ * @bug 6186134 * @summary Server virtual machine produces/exeutes incorrect code. * - * @run main Test6186134 100000 + * @run main compiler.c2.Test6186134 100000 */ + +package compiler.c2; + import java.util.ArrayList; public class Test6186134 { - int num = 0; + int num = 0; - public Test6186134(int n) { - num = n; - } + public Test6186134(int n) { + num = n; + } - public boolean more() { - return num-- > 0; - } + public boolean more() { + return num-- > 0; + } - public ArrayList test1() { - ArrayList res = new ArrayList(); - int maxResults = Integer.MAX_VALUE; - int n = 0; - boolean more = more(); - while ((n++ < maxResults) && more) { - res.add(new Object()); - more = more(); + public ArrayList test1() { + ArrayList res = new ArrayList(); + int maxResults = Integer.MAX_VALUE; + int n = 0; + boolean more = more(); + while ((n++ < maxResults) && more) { + res.add(new Object()); + more = more(); + } + return res; } - return res; - } - public static void main(String[] pars) { - int n = Integer.parseInt(pars[0]); - for (int i=0; i 0; i--){ - int tmp = src[i]; - src[i] = src[i-1]; - src[i-1] = tmp; - } + public static void shift(int src[]) { + //left-shift the array + for (int i = src.length - 1; i > 0; i--) { + int tmp = src[i]; + src[i] = src[i - 1]; + src[i - 1] = tmp; + } } public static void verify(int src[]) { - for (int i = 0; i < src.length; i++){ - int value = (i-1 + src.length)%src.length; // correct value after shifting - if (src[i] != value) { - System.out.println("Error: src["+i+"] should be "+ value + " instead of " + src[i]); - System.exit(97); - } + for (int i = 0; i < src.length; i++) { + int value = (i - 1 + src.length) % src.length; // correct value after shifting + if (src[i] != value) { + System.out.println("Error: src[" + i + "] should be " + value + " instead of " + src[i]); + System.exit(97); + } } } @@ -64,7 +68,7 @@ } public static void main(String[] args) { - for (int i=0; i< 2000; i++) + for (int i = 0; i < 2000; i++) test(); } -} +} \ No newline at end of file diff --git a/test/compiler/c2/6646019/Test.java b/test/compiler/c2/Test6646019.java rename from test/compiler/c2/6646019/Test.java rename to test/compiler/c2/Test6646019.java --- a/test/compiler/c2/6646019/Test.java +++ b/test/compiler/c2/Test6646019.java @@ -25,27 +25,32 @@ * @test * @bug 6646019 * @summary array subscript expressions become top() with -d64 - * @run main/othervm -Xcomp -XX:CompileOnly=Test.test Test + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6646019::test + * compiler.c2.Test6646019 */ +package compiler.c2; -public class Test { - final static int i = 2076285318; - long l = 2; - short s; +public class Test6646019 { + final static int i = 2076285318; + long l = 2; + short s; - public static void main(String[] args) { - Test t = new Test(); - try { t.test(); } - catch (Throwable e) { - if (t.l != 5) { - System.out.println("Fails: " + t.l + " != 5"); - } + public static void main(String[] args) { + Test6646019 t = new Test6646019(); + try { + t.test(); + } catch (Throwable e) { + if (t.l != 5) { + System.out.println("Fails: " + t.l + " != 5"); + } + } } - } - private void test() { - l = 5; - l = (new short[(byte)-2])[(byte)(l = i)]; - } + private void test() { + l = 5; + l = (new short[(byte) -2])[(byte) (l = i)]; + } } diff --git a/test/compiler/c2/6661247/Test.java b/test/compiler/c2/Test6661247.java rename from test/compiler/c2/6661247/Test.java rename to test/compiler/c2/Test6661247.java --- a/test/compiler/c2/6661247/Test.java +++ b/test/compiler/c2/Test6661247.java @@ -26,16 +26,20 @@ * @test * @bug 6661247 * @summary Internal bug in 32-bit HotSpot optimizer while bit manipulations + * + * @run main compiler.c2.Test6661247 */ +package compiler.c2; + +import java.nio.LongBuffer; import java.util.Random; -import java.nio.*; // This isn't a completely reliable test for 6661247 since the results // depend on what the local schedule looks like but it does reproduce // the issue in current builds. -public class Test { +public class Test6661247 { public static void test(boolean[] src, int srcPos, LongBuffer dest, long destPos, int count) { int countStart = (destPos & 63) == 0 ? 0 : 64 - (int)(destPos & 63); diff --git a/test/compiler/c2/6695810/Test.java b/test/compiler/c2/Test6695810.java rename from test/compiler/c2/6695810/Test.java rename to test/compiler/c2/Test6695810.java --- a/test/compiler/c2/6695810/Test.java +++ b/test/compiler/c2/Test6695810.java @@ -25,13 +25,16 @@ * @test * @bug 6695810 * @summary null oop passed to encode_heap_oop_not_null - * @run main/othervm -Xbatch Test + * + * @run main/othervm -Xbatch compiler.c2.Test6695810 */ -public class Test { - Test _t; +package compiler.c2; - static void test(Test t1, Test t2) { +public class Test6695810 { + Test6695810 _t; + + static void test(Test6695810 t1, Test6695810 t2) { if (t2 != null) t1._t = t2; @@ -40,7 +43,7 @@ } public static void main(String[] args) { - Test t = new Test(); + Test6695810 t = new Test6695810(); for (int i = 0; i < 50; i++) { for (int j = 0; j < 100; j++) { test(t, t); diff --git a/test/compiler/c2/6700047/Test6700047.java b/test/compiler/c2/Test6700047.java rename from test/compiler/c2/6700047/Test6700047.java rename to test/compiler/c2/Test6700047.java --- a/test/compiler/c2/6700047/Test6700047.java +++ b/test/compiler/c2/Test6700047.java @@ -25,9 +25,12 @@ * @test * @bug 6700047 * @summary C2 failed in idom_no_update - * @run main Test6700047 + * + * @run main compiler.c2.Test6700047 */ +package compiler.c2; + public class Test6700047 { static byte[] dummy = new byte[256]; diff --git a/test/compiler/c2/6711100/Test.java b/test/compiler/c2/Test6711100.java rename from test/compiler/c2/6711100/Test.java rename to test/compiler/c2/Test6711100.java --- a/test/compiler/c2/6711100/Test.java +++ b/test/compiler/c2/Test6711100.java @@ -25,16 +25,21 @@ * @test * @bug 6711100 * @summary 64bit fastdebug server vm crashes with assert(_base == Int,"Not an Int") - * @run main/othervm -Xcomp -XX:CompileOnly=Test. Test + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6711100:: + * compiler.c2.Test6711100 */ -public class Test { +package compiler.c2; + +public class Test6711100 { static byte b; // The server compiler chokes on compiling // this method when f() is not inlined - public Test() { + public Test6711100() { b = (new byte[1])[(new byte[f()])[-1]]; } @@ -44,7 +49,7 @@ public static void main(String[] args) { try { - Test t = new Test(); + Test6711100 t = new Test6711100(); } catch (ArrayIndexOutOfBoundsException e) { } } diff --git a/test/compiler/c2/6724218/Test.java b/test/compiler/c2/Test6724218.java rename from test/compiler/c2/6724218/Test.java rename to test/compiler/c2/Test6724218.java --- a/test/compiler/c2/6724218/Test.java +++ b/test/compiler/c2/Test6724218.java @@ -25,21 +25,26 @@ * @test * @bug 6724218 * @summary Fix raise_LCA_above_marks() early termination - * @run main/othervm -Xbatch -XX:CompileCommand=exclude,Test.update Test + * + * @run main/othervm -Xbatch + * -XX:CompileCommand=exclude,compiler.c2.Test6724218::update + * compiler.c2.Test6724218 */ -public class Test { - Test next = null; +package compiler.c2; + +public class Test6724218 { + Test6724218 next = null; Object value = null; static boolean _closed = false; static int size = 0; - static Test list = null; + static Test6724218 list = null; static int cache_size = 0; - static Test cache = null; + static Test6724218 cache = null; Object get(int i) { - Test t = list; + Test6724218 t = list; list = t.next; size -= 1; Object o = t.value; @@ -55,13 +60,13 @@ void update() { // Exclude compilation of this one. if (size == 0) { - Test t; + Test6724218 t; if (cache_size > 0) { t = cache; cache = t.next; cache_size = -1; } else { - t = new Test(); + t = new Test6724218(); } t.value = new Object(); t.next = list; @@ -82,7 +87,7 @@ } public static void main(String argv[]) throws Exception { - Test t = new Test(); + Test6724218 t = new Test6724218(); int lim = 500000; Object o; for (int j = 0; j < lim; j++) { diff --git a/test/compiler/c2/6732154/Test6732154.java b/test/compiler/c2/Test6732154.java rename from test/compiler/c2/6732154/Test6732154.java rename to test/compiler/c2/Test6732154.java --- a/test/compiler/c2/6732154/Test6732154.java +++ b/test/compiler/c2/Test6732154.java @@ -27,8 +27,13 @@ * @bug 6732154 * @summary REG: Printing an Image using image/gif doc flavor crashes the VM, Solsparc * - * @run main/othervm -Xcomp -XX:CompileOnly="Test6732154::ascii85Encode" Test6732154 + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6732154::ascii85Encode + * compiler.c2.Test6732154 */ + +package compiler.c2; + public class Test6732154 { // Exact copy of sun.print.PSPrinterJob.ascii85Encode([b)[b diff --git a/test/compiler/c2/6741738/Tester.java b/test/compiler/c2/Test6741738.java rename from test/compiler/c2/6741738/Tester.java rename to test/compiler/c2/Test6741738.java --- a/test/compiler/c2/6741738/Tester.java +++ b/test/compiler/c2/Test6741738.java @@ -25,26 +25,31 @@ * @test * @bug 6741738 * @summary TypePtr::add_offset() set incorrect offset when the add overflows - * @run main/othervm -Xcomp -XX:CompileOnly=Tester.foo Tester + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6741738::foo + * compiler.c2.Test6741738 */ -public class Tester { - private String[] values; - private int count; +package compiler.c2; - String foo() { - int i = Integer.MAX_VALUE-1; - String s; - try { - s = values[i]; - } catch (Throwable e) { - s = ""; - } - return s; +public class Test6741738 { + private String[] values; + private int count; + + String foo() { + int i = Integer.MAX_VALUE - 1; + String s; + try { + s = values[i]; + } catch (Throwable e) { + s = ""; } + return s; + } - public static void main(String[] args) { - Tester t = new Tester(); - String s = t.foo(); - } + public static void main(String[] args) { + Test6741738 t = new Test6741738(); + String s = t.foo(); + } } diff --git a/test/compiler/c2/5091921/Test6753639.java b/test/compiler/c2/Test6753639.java rename from test/compiler/c2/5091921/Test6753639.java rename to test/compiler/c2/Test6753639.java --- a/test/compiler/c2/5091921/Test6753639.java +++ b/test/compiler/c2/Test6753639.java @@ -27,9 +27,11 @@ * @bug 6753639 * @summary Strange optimisation in for loop with cyclic integer condition * - * @run main/othervm -Xbatch Test6753639 + * @run main/othervm -Xbatch compiler.c2.Test6753639 */ +package compiler.c2; + public class Test6753639 { public static void main(String[] args) throws InterruptedException { int END = Integer.MAX_VALUE; diff --git a/test/compiler/c2/6792161/Test6792161.java b/test/compiler/c2/Test6792161.java rename from test/compiler/c2/6792161/Test6792161.java rename to test/compiler/c2/Test6792161.java --- a/test/compiler/c2/6792161/Test6792161.java +++ b/test/compiler/c2/Test6792161.java @@ -27,10 +27,13 @@ * @bug 6792161 * @summary assert("No dead instructions after post-alloc") * - * @run main/othervm/timeout=600 -Xcomp -XX:MaxInlineSize=120 Test6792161 + * @run main/othervm/timeout=600 -Xcomp -XX:MaxInlineSize=120 compiler.c2.Test6792161 */ +package compiler.c2; + import java.lang.reflect.Constructor; + public class Test6792161 { static Constructor test(Class cls) throws Exception { Class[] args= { String.class }; @@ -42,7 +45,7 @@ public static void main(final String[] args) throws Exception { try { for (int i = 0; i < 100000; i++) { - Constructor ctor = test(Class.forName("Test6792161")); + Constructor ctor = test(Class.forName("compiler.c2.Test6792161")); } } catch (NoSuchMethodException e) {} } diff --git a/test/compiler/c2/6795362/Test6795362.java b/test/compiler/c2/Test6795362.java rename from test/compiler/c2/6795362/Test6795362.java rename to test/compiler/c2/Test6795362.java --- a/test/compiler/c2/6795362/Test6795362.java +++ b/test/compiler/c2/Test6795362.java @@ -26,9 +26,13 @@ * @bug 6795362 * @summary 32bit server compiler leads to wrong results on solaris-x86 * - * @run main/othervm -Xcomp -XX:CompileOnly=Test6795362.sub Test6795362 + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6795362::sub + * compiler.c2.Test6795362 */ +package compiler.c2; + public class Test6795362 { public static void main(String[] args) { diff --git a/test/compiler/c2/6796786/Test6796786.java b/test/compiler/c2/Test6796786.java rename from test/compiler/c2/6796786/Test6796786.java rename to test/compiler/c2/Test6796786.java --- a/test/compiler/c2/6796786/Test6796786.java +++ b/test/compiler/c2/Test6796786.java @@ -27,9 +27,11 @@ * @bug 6796786 * @summary invalid FP identity transform - (a - b) -> b - a * - * @run main/othervm -Xbatch Test6796786 + * @run main/othervm -Xbatch compiler.c2.Test6796786 */ +package compiler.c2; + public class Test6796786 { static volatile float d1; static volatile float d2; diff --git a/test/compiler/c2/6799693/Test.java b/test/compiler/c2/Test6799693.java rename from test/compiler/c2/6799693/Test.java rename to test/compiler/c2/Test6799693.java --- a/test/compiler/c2/6799693/Test.java +++ b/test/compiler/c2/Test6799693.java @@ -26,22 +26,27 @@ * @test * @bug 6799693 * @summary Server compiler leads to data corruption when expression throws an Exception - * @run main/othervm -Xcomp -XX:CompileOnly=Test Test + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6799693::* + * compiler.c2.Test6799693 */ -public class Test { - static int var_bad = 1; +package compiler.c2; - public static void main(String[] args) - { - var_bad++; +public class Test6799693 { + static int var_bad = 1; - try { - for (int i = 0; i < 10; i++) (new byte[((byte)-1 << i)])[0] = 0; - } - catch (Exception e) { System.out.println("Got " + e); } + public static void main(String[] args) { + var_bad++; - System.out.println("Test.var_bad = " + var_bad + " (expected 2)\n"); - } + try { + for (int i = 0; i < 10; i++) (new byte[((byte) -1 << i)])[0] = 0; + } catch (Exception e) { + System.out.println("Got " + e); + } + + System.out.println("Test.var_bad = " + var_bad + " (expected 2)\n"); + } } diff --git a/test/compiler/c2/6800154/Test6800154.java b/test/compiler/c2/Test6800154.java rename from test/compiler/c2/6800154/Test6800154.java rename to test/compiler/c2/Test6800154.java --- a/test/compiler/c2/6800154/Test6800154.java +++ b/test/compiler/c2/Test6800154.java @@ -27,9 +27,15 @@ * @summary Add comments to long_by_long_mulhi() for better understandability * @modules java.base/jdk.internal.misc * @library /testlibrary - * @run main/othervm -Xcomp -XX:CompileOnly=Test6800154.divcomp Test6800154 + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6800154::divcomp + * compiler.c2.Test6800154 */ + +package compiler.c2; + import jdk.test.lib.Utils; public class Test6800154 implements Runnable { @@ -78,7 +84,7 @@ public static void main(String[] args) throws Exception { - Class cl = Class.forName("Test6800154"); + Class cl = Test6800154.class; ClassLoader apploader = cl.getClassLoader(); // Iterate over all divisors. @@ -86,7 +92,7 @@ System.setProperty("divisor", "" + DIVISORS[i]); ClassLoader loader = Utils.getTestClassPathURLClassLoader(apploader.getParent()); - Class c = loader.loadClass("Test6800154"); + Class c = loader.loadClass(Test6800154.class.getName()); Runnable r = (Runnable) c.newInstance(); r.run(); } diff --git a/test/compiler/c2/6805724/Test6805724.java b/test/compiler/c2/Test6805724.java rename from test/compiler/c2/6805724/Test6805724.java rename to test/compiler/c2/Test6805724.java --- a/test/compiler/c2/6805724/Test6805724.java +++ b/test/compiler/c2/Test6805724.java @@ -28,9 +28,14 @@ * when divisor is any (2^k-1) constant. * @modules java.base/jdk.internal.misc * @library /testlibrary - * @run main/othervm -Xcomp -XX:CompileOnly=Test6805724.fcomp Test6805724 + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6805724::fcomp + * compiler.c2.Test6805724 */ +package compiler.c2; + import jdk.test.lib.Utils; public class Test6805724 implements Runnable { @@ -66,7 +71,7 @@ } public static void main(String args[]) throws Exception { - Class cl = Class.forName("Test6805724"); + Class cl = Test6805724.class; ClassLoader apploader = cl.getClassLoader(); // Iterate over all 2^k-1 divisors. @@ -75,7 +80,7 @@ System.setProperty("divisor", "" + divisor); ClassLoader loader = Utils.getTestClassPathURLClassLoader(apploader.getParent()); - Class c = loader.loadClass("Test6805724"); + Class c = loader.loadClass(Test6805724.class.getName()); Runnable r = (Runnable) c.newInstance(); r.run(); } diff --git a/test/compiler/c2/6823453/Test.java b/test/compiler/c2/Test6823453.java rename from test/compiler/c2/6823453/Test.java rename to test/compiler/c2/Test6823453.java --- a/test/compiler/c2/6823453/Test.java +++ b/test/compiler/c2/Test6823453.java @@ -26,71 +26,84 @@ * @test * @bug 6823453 * @summary DeoptimizeALot causes fastdebug server jvm to fail with assert(false,"unscheduable graph") - * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:CompileOnly=Test -XX:+DeoptimizeALot Test + * + * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot + * -XX:CompileCommand=compileonly,compiler.c2.Test6823453::* + * compiler.c2.Test6823453 */ -public class Test { +package compiler.c2; - static long vara_1 = 1L; +public class Test6823453 { - static void testa() { - short var_2 = (byte) 1.0E10; + static long vara_1 = 1L; - for ( Object temp = new byte[(byte)1.0E10]; true ; - var_2 = "1".equals("0") ? ((byte) vara_1) : 1 ) {} - } + static void testa() { + short var_2 = (byte) 1.0E10; - static void testb() { - long var_1 = -1L; + for (Object temp = new byte[(byte) 1.0E10]; true; + var_2 = "1".equals("0") ? ((byte) vara_1) : 1) { + } + } - short var_2 = (byte) 1.0E10; + static void testb() { + long var_1 = -1L; - for ( Object temp = new byte[(byte)1.0E10]; true ; - var_2 = "1".equals("0") ? ((byte) var_1) : 1 ) {} - } + short var_2 = (byte) 1.0E10; - static void testc() { - long var_1 = -1L; - if (vara_1 > 0) var_1 = 1L; + for (Object temp = new byte[(byte) 1.0E10]; true; + var_2 = "1".equals("0") ? ((byte) var_1) : 1) { + } + } - int var_2 = (byte)var_1 - 128; + static void testc() { + long var_1 = -1L; + if (vara_1 > 0) var_1 = 1L; - for ( Object temp = new byte[var_2]; true ; - var_2 = "1".equals("0") ? 2 : 1 ) {} - } + int var_2 = (byte) var_1 - 128; - static void testd() { - long var_1 = 0L; + for (Object temp = new byte[var_2]; true; + var_2 = "1".equals("0") ? 2 : 1) { + } + } - int var_2 = (byte)var_1 + 1; - for (int i=0; i<2 ; i++) var_2 = var_2 - 1; + static void testd() { + long var_1 = 0L; - for ( Object temp = new byte[var_2]; true ; - var_2 = "1".equals("0") ? 2 : 1 ) {} - } + int var_2 = (byte) var_1 + 1; + for (int i = 0; i < 2; i++) var_2 = var_2 - 1; - public static void main(String[] args) throws Exception { - int nex = 0; + for (Object temp = new byte[var_2]; true; + var_2 = "1".equals("0") ? 2 : 1) { + } + } - try { - testa(); - } - catch (java.lang.NegativeArraySizeException ex) { nex++; } - try { - testb(); - } - catch (java.lang.NegativeArraySizeException ex) { nex++; } - try { - testc(); - } - catch (java.lang.NegativeArraySizeException ex) { nex++; } - try { - testd(); - } - catch (java.lang.NegativeArraySizeException ex) { nex++; } + public static void main(String[] args) throws Exception { + int nex = 0; - if (nex != 4) - System.exit(97); - } + try { + testa(); + } catch (java.lang.NegativeArraySizeException ex) { + nex++; + } + try { + testb(); + } catch (java.lang.NegativeArraySizeException ex) { + nex++; + } + try { + testc(); + } catch (java.lang.NegativeArraySizeException ex) { + nex++; + } + try { + testd(); + } catch (java.lang.NegativeArraySizeException ex) { + nex++; + } + + if (nex != 4) + System.exit(97); + } } diff --git a/test/compiler/c2/6832293/Test.java b/test/compiler/c2/Test6832293.java rename from test/compiler/c2/6832293/Test.java rename to test/compiler/c2/Test6832293.java --- a/test/compiler/c2/6832293/Test.java +++ b/test/compiler/c2/Test6832293.java @@ -26,52 +26,57 @@ * @test * @bug 6832293 * @summary JIT compiler got wrong result in type checking with -server - * @run main/othervm -Xcomp -XX:CompileOnly=Test.run Test + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6832293::run + * compiler.c2.Test6832293 */ +package compiler.c2; + import java.io.PrintStream; -interface SomeInterface { - int SEVENS = 777; -} +public class Test6832293 { + static interface SomeInterface { + int SEVENS = 777; + } -interface AnotherInterface { - int THIRDS = 33; -} + static interface AnotherInterface { + int THIRDS = 33; + } -class SomeClass implements SomeInterface { - int i; + static class SomeClass implements SomeInterface { + int i; - SomeClass(int i) { - this.i = i; + SomeClass(int i) { + this.i = i; + } } -} -class ImmediateSubclass extends SomeClass implements SomeInterface { - float f; + static class ImmediateSubclass extends SomeClass implements SomeInterface { + float f; - ImmediateSubclass(int i, float f) { - super(i); - this.f = f; + ImmediateSubclass(int i, float f) { + super(i); + this.f = f; + } } -} -final class FinalSubclass extends ImmediateSubclass implements AnotherInterface { - double d; + static final class FinalSubclass extends ImmediateSubclass implements AnotherInterface { + double d; - FinalSubclass(int i, float f, double d) { - super(i, f); - this.d = d; + FinalSubclass(int i, float f, double d) { + super(i, f); + this.d = d; + } } -} - -public class Test { public static void main(String args[]) throws Exception{ /* try to pre initialize */ SomeClass[] a=new SomeClass[10]; - Class.forName("ImmediateSubclass"); - Class.forName("FinalSubclass"); + String className = Test6832293.class.getName(); + Class.forName(className + "$ImmediateSubclass"); + Class.forName(className + "$FinalSubclass"); System.exit(run(args, System.out) + 95/*STATUS_TEMP*/); } diff --git a/test/compiler/c2/6837011/Test6837011.java b/test/compiler/c2/Test6837011.java rename from test/compiler/c2/6837011/Test6837011.java rename to test/compiler/c2/Test6837011.java --- a/test/compiler/c2/6837011/Test6837011.java +++ b/test/compiler/c2/Test6837011.java @@ -26,9 +26,13 @@ * @bug 6837011 * @summary SIGSEGV in PhaseIdealLoop in 32bit jvm * - * @run main/othervm -Xcomp -XX:CompileOnly=Test6837011.main Test6837011 + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6837011::main + * compiler.c2.Test6837011 */ +package compiler.c2; + public class Test6837011 { static boolean var_3 = true; diff --git a/test/compiler/c2/6837094/Test.java b/test/compiler/c2/Test6837094.java rename from test/compiler/c2/6837094/Test.java rename to test/compiler/c2/Test6837094.java --- a/test/compiler/c2/6837094/Test.java +++ b/test/compiler/c2/Test6837094.java @@ -27,13 +27,19 @@ * @bug 6837094 * @summary False positive for "meet not symmetric" failure * - * @run main/othervm -Xbatch -XX:CompileOnly=Test.collectIs,Test$Factory$1.getArray,Test$Factory$2.getArray Test + * @run main/othervm -Xbatch + * -XX:CompileCommand=compileonly,compiler.c2.Test6837094::collectIs + * -XX:CompileCommand=compileonly,compiler.c2.Test6837094$Factory$1::getArray + * -XX:CompileCommand=compileonly,compiler.c2.Test6837094$Factory$2::getArray + * compiler.c2.Test6837094 */ +package compiler.c2; + +import java.util.HashSet; import java.util.Set; -import java.util.HashSet; -public class Test { +public class Test6837094 { private interface Factory { Factory Zero = new Factory() { @@ -72,23 +78,25 @@ collectIs(Factory.One, s); } } + + /** + * Establish necessary class hierarchy + */ + + static interface Interface { + } + + static class Parent { + } + + static class Child0 extends Parent implements Interface { + } + + static class Child1 extends Parent implements Interface { + } + + static class Child2 extends Parent implements Interface { + } + } -/** - * Establish necessary class hierarchy - */ - -interface Interface { -} - -class Parent { -} - -class Child0 extends Parent implements Interface { -} - -class Child1 extends Parent implements Interface { -} - -class Child2 extends Parent implements Interface { -} diff --git a/test/compiler/c2/6843752/Test.java b/test/compiler/c2/Test6843752.java rename from test/compiler/c2/6843752/Test.java rename to test/compiler/c2/Test6843752.java --- a/test/compiler/c2/6843752/Test.java +++ b/test/compiler/c2/Test6843752.java @@ -25,10 +25,13 @@ * @test * @bug 6843752 * @summary missing code for an anti-dependent Phi in GCM - * @run main/othervm -Xbatch Test + * + * @run main/othervm -Xbatch compiler.c2.Test6843752 */ -public class Test { +package compiler.c2; + +public class Test6843752 { Item list; @@ -97,7 +100,7 @@ static public void main(String[] args) { int caseCnt = 0; - Test bj = new Test(); + Test6843752 bj = new Test6843752(); try { for (; caseCnt < 500000;) { int numItems = (++caseCnt % 2); diff --git a/test/compiler/c2/5091921/Test6850611.java b/test/compiler/c2/Test6850611.java rename from test/compiler/c2/5091921/Test6850611.java rename to test/compiler/c2/Test6850611.java --- a/test/compiler/c2/5091921/Test6850611.java +++ b/test/compiler/c2/Test6850611.java @@ -27,9 +27,11 @@ * @bug 6850611 * @summary int / long arithmetic seems to be broken in 1.6.0_14 HotSpot Server VM (Win XP) * - * @run main/timeout=480 Test6850611 + * @run main/timeout=480 compiler.c2.Test6850611 */ +package compiler.c2; + public class Test6850611 { public static void main(String[] args) { diff --git a/test/compiler/c2/6851282/Test.java b/test/compiler/c2/Test6851282.java rename from test/compiler/c2/6851282/Test.java rename to test/compiler/c2/Test6851282.java --- a/test/compiler/c2/6851282/Test.java +++ b/test/compiler/c2/Test6851282.java @@ -27,13 +27,16 @@ * @bug 6851282 * @summary JIT miscompilation results in null entry in array when using CompressedOops * - * @run main/othervm/timeout=600 -Xmx256m -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops Test + * @run main/othervm/timeout=600 -Xmx256m -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops + * compiler.c2.Test6851282 */ +package compiler.c2; + import java.util.ArrayList; import java.util.List; -public class Test { +public class Test6851282 { void foo(A a, A[] as) { for (A a1 : as) { B[] filtered = a.c(a1); @@ -54,71 +57,72 @@ bs.add(new B(j)); as.add(new A(bs.toArray(new B[0]))); } - new Test().foo(as.get(0), as.subList(1, as.size()).toArray(new A[0])); + new Test6851282().foo(as.get(0), as.subList(1, as.size()).toArray(new A[0])); + } + + static class A { + final B[] bs; + + public A(B[] bs) { + this.bs = bs; + } + + final B[] c(final A a) { + return new BoxedArray(bs).filter(new Function() { + public Boolean apply(B arg) { + for (B b : a.bs) { + if (b.d == arg.d) + return true; + } + return false; + } + }); + } + } + + static class BoxedArray { + + private final T[] array; + + BoxedArray(T[] array) { + this.array = array; + } + + public T[] filter(Function function) { + boolean[] include = new boolean[array.length]; + int len = 0; + int i = 0; + while (i < array.length) { + if (function.apply(array[i])) { + include[i] = true; + len += 1; + } + i += 1; + } + T[] result = (T[]) java.lang.reflect.Array.newInstance(array.getClass().getComponentType(), len); + len = 0; + i = 0; + while (len < result.length) { + if (include[i]) { + result[len] = array[i]; + len += 1; + } + i += 1; + } + return result; + } + } + + static interface Function { + R apply(T arg); + } + + static class B { + final int d; + + public B(int d) { + this.d = d; + } } } -class A { - final B[] bs; - - public A(B[] bs) { - this.bs = bs; - } - - final B[] c(final A a) { - return new BoxedArray(bs).filter(new Function() { - public Boolean apply(B arg) { - for (B b : a.bs) { - if (b.d == arg.d) - return true; - } - return false; - } - }); - } -} - -class BoxedArray { - - private final T[] array; - - BoxedArray(T[] array) { - this.array = array; - } - - public T[] filter(Function function) { - boolean[] include = new boolean[array.length]; - int len = 0; - int i = 0; - while (i < array.length) { - if (function.apply(array[i])) { - include[i] = true; - len += 1; - } - i += 1; - } - T[] result = (T[]) java.lang.reflect.Array.newInstance(array.getClass().getComponentType(), len); - len = 0; - i = 0; - while (len < result.length) { - if (include[i]) { - result[len] = array[i]; - len += 1; - } - i += 1; - } - return result; - } -} - -interface Function { - R apply(T arg); -} - -class B { - final int d; - public B(int d) { - this.d = d; - } -} - diff --git a/test/compiler/c2/6852078/Test6852078.java b/test/compiler/c2/Test6852078.java rename from test/compiler/c2/6852078/Test6852078.java rename to test/compiler/c2/Test6852078.java --- a/test/compiler/c2/6852078/Test6852078.java +++ b/test/compiler/c2/Test6852078.java @@ -26,17 +26,20 @@ * @test * @bug 6852078 * @summary Disable SuperWord optimization for unsafe read/write - * * @modules java.corba/com.sun.corba.se.impl.encoding * java.corba/com.sun.jndi.toolkit.corba - * @run main Test6852078 + * + * @run main compiler.c2.Test6852078 */ -import java.util.*; -import java.nio.ByteBuffer; +package compiler.c2; + import com.sun.corba.se.impl.encoding.ByteBufferWithInfo; import com.sun.jndi.toolkit.corba.CorbaUtils; +import java.nio.ByteBuffer; +import java.util.Hashtable; + public class Test6852078 { public Test6852078(String [] args) { diff --git a/test/compiler/c2/6857159/Test6857159.java b/test/compiler/c2/Test6857159.java rename from test/compiler/c2/6857159/Test6857159.java rename to test/compiler/c2/Test6857159.java --- a/test/compiler/c2/6857159/Test6857159.java +++ b/test/compiler/c2/Test6857159.java @@ -29,47 +29,66 @@ * @library /testlibrary * @modules java.base/jdk.internal.misc * java.management + * + * @run driver compiler.c2.Test6857159 */ -import jdk.test.lib.*; +package compiler.c2; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; public class Test6857159 { public static void main(String[] args) throws Throwable { + String className = Test.class.getName(); OutputAnalyzer analyzer = ProcessTools.executeTestJvm("-Xbatch", - "-XX:+PrintCompilation", "-XX:CompileOnly=Test$ct.run", "Test"); + "-XX:+PrintCompilation", + "-XX:CompileOnly="+ className + "$ct::run", + className); analyzer.shouldNotContain("COMPILE SKIPPED"); - analyzer.shouldContain("Test$ct0::run (16 bytes)"); + analyzer.shouldContain(className + "$ct0::run (16 bytes)"); analyzer.shouldHaveExitValue(0); } -} -class Test extends Thread { - static class ct0 extends Test { - public void message() { } + static class Test extends Thread { + static class ct0 extends Test { + public void message() { + } - public void run() { - message(); - ct0 ct = (ct0) Thread.currentThread(); - ct.message(); + public void run() { + message(); + ct0 ct = (ct0) Thread.currentThread(); + ct.message(); + } } - } - static class ct1 extends ct0 { - public void message() { } - } - static class ct2 extends ct0 { - public void message() { } - } - public static void main(String[] args) throws Exception { - for (int i = 0; i < 20000; i++) { - Thread t = null; - switch (i % 3) { - case 0: t = new ct0(); break; - case 1: t = new ct1(); break; - case 2: t = new ct2(); break; + static class ct1 extends ct0 { + public void message() { } - t.start(); - t.join(); + } + + static class ct2 extends ct0 { + public void message() { + } + } + + public static void main(String[] args) throws Exception { + for (int i = 0; i < 20000; i++) { + Thread t = null; + switch (i % 3) { + case 0: + t = new ct0(); + break; + case 1: + t = new ct1(); + break; + case 2: + t = new ct2(); + break; + } + t.start(); + t.join(); + } } } } diff --git a/test/compiler/c2/6863155/Test6863155.java b/test/compiler/c2/Test6863155.java rename from test/compiler/c2/6863155/Test6863155.java rename to test/compiler/c2/Test6863155.java --- a/test/compiler/c2/6863155/Test6863155.java +++ b/test/compiler/c2/Test6863155.java @@ -26,9 +26,13 @@ * @bug 6863155 * @summary Server compiler generates incorrect code (x86, long, bitshift, bitmask) * - * @run main/othervm -Xcomp -XX:CompileOnly=Test6863155.test Test6863155 + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6863155::test + * compiler.c2.Test6863155 */ +package compiler.c2; + public class Test6863155 { private static long test(byte b) { return b << 24 & 0xff000000L; diff --git a/test/compiler/c2/6866651/Test.java b/test/compiler/c2/Test6866651.java rename from test/compiler/c2/6866651/Test.java rename to test/compiler/c2/Test6866651.java --- a/test/compiler/c2/6866651/Test.java +++ b/test/compiler/c2/Test6866651.java @@ -26,10 +26,12 @@ * @bug 6866651 * @summary delay dead node elimination in set_req_X to prevent killing the current node when it is in use * - * @run main Test + * @run main compiler.c2.Test6866651 */ -public class Test { +package compiler.c2; + +public class Test6866651 { static int sum() { int s = 0; diff --git a/test/compiler/c2/6877254/Test.java b/test/compiler/c2/Test6877254.java rename from test/compiler/c2/6877254/Test.java rename to test/compiler/c2/Test6877254.java --- a/test/compiler/c2/6877254/Test.java +++ b/test/compiler/c2/Test6877254.java @@ -26,10 +26,12 @@ * @bug 6877254 * @summary Implement StoreCMNode::Ideal to promote its OopStore above the MergeMem * - * @run main/othervm -Xcomp Test + * @run main/othervm -Xcomp compiler.c2.Test6877254 */ -public class Test { +package compiler.c2; + +public class Test6877254 { static byte var_1; static String var_2 = ""; static byte var_3; diff --git a/test/compiler/c2/6880034/Test6880034.java b/test/compiler/c2/Test6880034.java rename from test/compiler/c2/6880034/Test6880034.java rename to test/compiler/c2/Test6880034.java --- a/test/compiler/c2/6880034/Test6880034.java +++ b/test/compiler/c2/Test6880034.java @@ -26,10 +26,13 @@ * @bug 6880034 * @summary SIGBUS during deoptimisation at a safepoint on 64bit-SPARC * - * @run main/othervm -Xcomp -Xbatch -XX:CompileCommand=compileonly,Test6880034,deopt_compiledframe_at_safepoint -XX:+PrintCompilation Test6880034 + * @run main/othervm -Xcomp -Xbatch + * -XX:+PrintCompilation + * -XX:CompileCommand=compileonly,compiler.c2.Test6880034::deopt_compiledframe_at_safepoint + * compiler.c2.Test6880034 */ - +package compiler.c2; // This test provokes a deoptimisation at a safepoint. // @@ -61,39 +64,38 @@ // // Author: Volker H. Simonis -class A { - public int doSomething() { - return 0; - } -} - -class B extends A { - public B() {} - // override 'A::doSomething()' - public int doSomething() { - return 1; - } -} - -class G { - public static volatile A a = new A(); - - // Change 'a' to point to a 'B' object - public static void setAtoB() { - try { - a = (A) ClassLoader. - getSystemClassLoader(). - loadClass("B"). - getConstructor(new Class[] {}). - newInstance(new Object[] {}); - } - catch (Exception e) { - System.out.println(e); +public class Test6880034 { + static class A { + public int doSomething() { + return 0; } } -} -public class Test6880034 { + static class B extends A { + public B() {} + // override 'A::doSomething()' + public int doSomething() { + return 1; + } + } + + static class G { + public static volatile A a = new A(); + + // Change 'a' to point to a 'B' object + public static void setAtoB() { + try { + a = (A) ClassLoader. + getSystemClassLoader(). + loadClass("B"). + getConstructor(new Class[] {}). + newInstance(new Object[] {}); + } + catch (Exception e) { + System.out.println(e); + } + } + } public static volatile boolean is_in_loop = false; public static volatile boolean stop_while_loop = false; diff --git a/test/compiler/c2/6885584/Test6885584.java b/test/compiler/c2/Test6885584.java rename from test/compiler/c2/6885584/Test6885584.java rename to test/compiler/c2/Test6885584.java --- a/test/compiler/c2/6885584/Test6885584.java +++ b/test/compiler/c2/Test6885584.java @@ -27,10 +27,10 @@ * @bug 6885584 * @summary A particular class structure causes large allocation spike for jit * - * @run main/othervm -Xbatch Test6885584 + * @run main/othervm -Xbatch compiler.c2.Test6885584 */ - +package compiler.c2; public class Test6885584 { static private int i1; diff --git a/test/compiler/c2/5091921/Test6897150.java b/test/compiler/c2/Test6897150.java rename from test/compiler/c2/5091921/Test6897150.java rename to test/compiler/c2/Test6897150.java --- a/test/compiler/c2/5091921/Test6897150.java +++ b/test/compiler/c2/Test6897150.java @@ -27,9 +27,11 @@ * @bug 6897150 * @summary Hotspot optimises away a valid loop * - * @run main Test6897150 + * @run main compiler.c2.Test6897150 */ +package compiler.c2; + // Should be compiled with javac from JDK1.3 to get bytecode which shows the problem. public class Test6897150 { public static void main(String[] args) { diff --git a/test/compiler/c2/6901572/Test.java b/test/compiler/c2/Test6901572.java rename from test/compiler/c2/6901572/Test.java rename to test/compiler/c2/Test6901572.java --- a/test/compiler/c2/6901572/Test.java +++ b/test/compiler/c2/Test6901572.java @@ -26,11 +26,12 @@ * @bug 6901572 * @summary JVM 1.6.16 crash on loops: assert(has_node(i),"") * - * @run main/othervm Test + * @run main/othervm compiler.c2.Test6901572 */ +package compiler.c2; -public class Test { +public class Test6901572 { public static void main(String[] args) { for (int i = 0; i < 2; i++) diff --git a/test/compiler/c2/5091921/Test6905845.java b/test/compiler/c2/Test6905845.java rename from test/compiler/c2/5091921/Test6905845.java rename to test/compiler/c2/Test6905845.java --- a/test/compiler/c2/5091921/Test6905845.java +++ b/test/compiler/c2/Test6905845.java @@ -27,50 +27,52 @@ * @bug 6905845 * @summary Server VM improperly optimizing away loop. * - * @run main/timeout=480 Test6905845 + * @run main/timeout=480 compiler.c2.Test6905845 */ +package compiler.c2; + public class Test6905845 { - public static void main(String[] args){ - for (int asdf = 0; asdf < 5; asdf++){ - //test block - { - StringBuilder strBuf1 = new StringBuilder(65); - long start = System.currentTimeMillis(); - int count = 0; + public static void main(String[] args) { + for (int asdf = 0; asdf < 5; asdf++) { + //test block + { + StringBuilder strBuf1 = new StringBuilder(65); + long start = System.currentTimeMillis(); + int count = 0; - for (int i = Integer.MIN_VALUE; i < (Integer.MAX_VALUE - 80); i += 79){ - strBuf1.append(i); - count++; - strBuf1.delete(0, 65); + for (int i = Integer.MIN_VALUE; i < (Integer.MAX_VALUE - 80); i += 79) { + strBuf1.append(i); + count++; + strBuf1.delete(0, 65); + } + + System.out.println(count); + if (count != 54366674) { + System.out.println("wrong count: " + count + ", should be 54366674"); + System.exit(97); + } } + //test block + { + StringBuilder strBuf1 = new StringBuilder(65); + long start = System.currentTimeMillis(); + int count = 0; - System.out.println(count); - if (count != 54366674) { - System.out.println("wrong count: " + count +", should be 54366674"); - System.exit(97); + for (int i = Integer.MIN_VALUE; i < (Integer.MAX_VALUE - 80); i += 79) { + strBuf1.append(i); + count++; + strBuf1.delete(0, 65); + } + + System.out.println(count); + if (count != 54366674) { + System.out.println("wrong count: " + count + ", should be 54366674"); + System.exit(97); + } } - } - //test block - { - StringBuilder strBuf1 = new StringBuilder(65); - long start = System.currentTimeMillis(); - int count = 0; - - for (int i = Integer.MIN_VALUE; i < (Integer.MAX_VALUE - 80); i += 79){ - strBuf1.append(i); - count++; - strBuf1.delete(0, 65); - } - - System.out.println(count); - if (count != 54366674) { - System.out.println("wrong count: " + count +", should be 54366674"); - System.exit(97); - } - } - } - } + } + } } diff --git a/test/compiler/c2/6910484/Test.java b/test/compiler/c2/Test6910484.java rename from test/compiler/c2/6910484/Test.java rename to test/compiler/c2/Test6910484.java --- a/test/compiler/c2/6910484/Test.java +++ b/test/compiler/c2/Test6910484.java @@ -26,10 +26,12 @@ * @bug 6910484 * @summary incorrect integer optimization (loosing and op-r in a given example) * - * @run main/othervm -Xbatch Test + * @run main/othervm -Xbatch compiler.c2.Test6910484 */ -public class Test { +package compiler.c2; + +public class Test6910484 { public static void main(String[] args) { long iteration = 0; diff --git a/test/compiler/c2/6910605/Test.java b/test/compiler/c2/Test6910605_1.java rename from test/compiler/c2/6910605/Test.java rename to test/compiler/c2/Test6910605_1.java --- a/test/compiler/c2/6910605/Test.java +++ b/test/compiler/c2/Test6910605_1.java @@ -26,15 +26,16 @@ * @test * @bug 6910605 * @summary C2: NullPointerException/ClassCaseException is thrown when C2 with DeoptimizeALot is used + * original test: nsk/coverage/runtime/runtime007 * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -Xbatch Test - * - * original test: nsk/coverage/runtime/runtime007 + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -Xbatch compiler.c2.Test6910605_1 */ -import java.io.*; +package compiler.c2; -public class Test { +import java.io.PrintStream; + +public class Test6910605_1 { public static int buf=0; public static void main( String argv[] ) { diff --git a/test/compiler/c2/6910618/Test.java b/test/compiler/c2/Test6910605_2.java rename from test/compiler/c2/6910618/Test.java rename to test/compiler/c2/Test6910605_2.java --- a/test/compiler/c2/6910618/Test.java +++ b/test/compiler/c2/Test6910605_2.java @@ -27,48 +27,52 @@ * @bug 6910605 * @summary C2: NullPointerException/ClassCaseException is thrown when C2 with DeoptimizeALot is used * - * @run main/othervm -Xmx64m -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot -XX:+DoEscapeAnalysis -Xbatch -XX:InlineSmallCode=2000 Test - * + * @run main/othervm -Xmx64m -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot + * -XX:+DoEscapeAnalysis -Xbatch -XX:InlineSmallCode=2000 + * compiler.c2.Test6910605_2 */ +package compiler.c2; + /* * Added InlineSmallCode=2000 to guaranty inlining of StringBuilder::append() to allow scalar replace StringBuilder object. * * original test: gc/gctests/StringGC */ -public class Test { - private final String toAdd = "0123456789abcdef"; - private int maxLength; - private static final int numberOfThreads = 8; +public class Test6910605_2 { + private final String toAdd = "0123456789abcdef"; + private int maxLength; + private static final int numberOfThreads = 8; - private class StringAdder extends Thread { - private String s; + private class StringAdder extends Thread { + private String s; - public void test() { - s = s + toAdd; - } - public void run() { - do { - test(); - } while (s.length() < maxLength); - } + public void test() { + s = s + toAdd; } - public void test() throws InterruptedException { - maxLength = toAdd.length() * 15000/ numberOfThreads; - StringAdder[] sa = new StringAdder[numberOfThreads]; - for (int i = 0; i < numberOfThreads; i++) { - sa[i] = new StringAdder(); - sa[i].start(); - } - for (int i = 0; i < numberOfThreads; i++) { - sa[i].join(); - } + public void run() { + do { + test(); + } while (s.length() < maxLength); } + } - public static void main(String[] args) throws InterruptedException { - Test t = new Test(); - t.test(); + public void test() throws InterruptedException { + maxLength = toAdd.length() * 15000 / numberOfThreads; + StringAdder[] sa = new StringAdder[numberOfThreads]; + for (int i = 0; i < numberOfThreads; i++) { + sa[i] = new StringAdder(); + sa[i].start(); } + for (int i = 0; i < numberOfThreads; i++) { + sa[i].join(); + } + } + + public static void main(String[] args) throws InterruptedException { + Test6910605_2 t = new Test6910605_2(); + t.test(); + } } diff --git a/test/compiler/c2/6912517/Test.java b/test/compiler/c2/Test6912517.java rename from test/compiler/c2/6912517/Test.java rename to test/compiler/c2/Test6912517.java --- a/test/compiler/c2/6912517/Test.java +++ b/test/compiler/c2/Test6912517.java @@ -26,14 +26,17 @@ * @bug 6912517 * @summary JIT bug compiles out (and stops running) code that needs to be run. Causes NPE. * - * @run main/othervm -Xbatch -XX:CompileThreshold=100 -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops Test + * @run main/othervm -Xbatch -XX:CompileThreshold=100 -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops + * compiler.c2.Test6912517 */ +package compiler.c2; + /** * Highlights a bug with the JIT compiler. * @author Matt Bruce m b r u c e __\at/__ g m a i l DOT c o m */ -public class Test implements Runnable +public class Test6912517 implements Runnable { private final Thread myThread; private Thread myInitialThread; @@ -42,7 +45,7 @@ /** * Sets up the running thread, and starts it. */ - public Test(int id) + public Test6912517(int id) { myThread = new Thread(this); myThread.setName("Runner: " + id); @@ -69,7 +72,7 @@ // let this run for a bit, so the "run" below is JITTed. for (int id = 0; id < 20; id++) { System.out.println("Starting thread: " + id); - Test bug = new Test(id); + Test6912517 bug = new Test6912517(id); bug.setShouldCheckThreads(true); Thread.sleep(2500); } diff --git a/test/compiler/c2/6916644/Test6916644.java b/test/compiler/c2/Test6916644.java rename from test/compiler/c2/6916644/Test6916644.java rename to test/compiler/c2/Test6916644.java --- a/test/compiler/c2/6916644/Test6916644.java +++ b/test/compiler/c2/Test6916644.java @@ -27,9 +27,13 @@ * @bug 6916644 * @summary C2 compiler crash on x86 * - * @run main/othervm -Xcomp -XX:CompileOnly=Test6916644.test Test6916644 + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6916644::test + * compiler.c2.Test6916644 */ +package compiler.c2; + public class Test6916644 { static int result; static int i1; diff --git a/test/compiler/c2/6930043/Test6930043.java b/test/compiler/c2/Test6930043.java rename from test/compiler/c2/6930043/Test6930043.java rename to test/compiler/c2/Test6930043.java --- a/test/compiler/c2/6930043/Test6930043.java +++ b/test/compiler/c2/Test6930043.java @@ -27,10 +27,10 @@ * @bug 6930043 * @summary C2: SIGSEGV in javasoft.sqe.tests.lang.arr017.arr01702.arr01702.loop_forw(II)I * - * @run main Test6930043 + * @run main compiler.c2.Test6930043 */ -import java.io.PrintStream; +package compiler.c2; public class Test6930043 { int[] a; diff --git a/test/compiler/c2/5091921/Test6931567.java b/test/compiler/c2/Test6931567.java rename from test/compiler/c2/5091921/Test6931567.java rename to test/compiler/c2/Test6931567.java --- a/test/compiler/c2/5091921/Test6931567.java +++ b/test/compiler/c2/Test6931567.java @@ -27,9 +27,11 @@ * @bug 6931567 * @summary JIT Error (on class file compiled with eclipse) on JVM x64 (but not on x32!). * - * @run main Test6931567 + * @run main compiler.c2.Test6931567 */ +package compiler.c2; + // Should be compiled with javac from JDK1.3 to get bytecode which shows the problem. public class Test6931567 { diff --git a/test/compiler/c2/5091921/Test6935022.java b/test/compiler/c2/Test6935022.java rename from test/compiler/c2/5091921/Test6935022.java rename to test/compiler/c2/Test6935022.java --- a/test/compiler/c2/5091921/Test6935022.java +++ b/test/compiler/c2/Test6935022.java @@ -27,9 +27,11 @@ * @bug 6935022 * @summary Server VM incorrectly breaks out of while loop * - * @run main Test6935022 + * @run main compiler.c2.Test6935022 */ +package compiler.c2; + public class Test6935022 { public static final void main(String[] args) throws Exception { Test6935022 test = new Test6935022(); diff --git a/test/compiler/c2/6956668/Test6956668.java b/test/compiler/c2/Test6956668.java rename from test/compiler/c2/6956668/Test6956668.java rename to test/compiler/c2/Test6956668.java --- a/test/compiler/c2/6956668/Test6956668.java +++ b/test/compiler/c2/Test6956668.java @@ -27,9 +27,10 @@ * @bug 6956668 * @summary misbehavior of XOR operator (^) with int * - * @run main/othervm -Xbatch Test6956668 + * @run main/othervm -Xbatch compiler.c2.Test6956668 */ +package compiler.c2; public class Test6956668 { diff --git a/test/compiler/c2/6958485/Test.java b/test/compiler/c2/Test6958485.java rename from test/compiler/c2/6958485/Test.java rename to test/compiler/c2/Test6958485.java --- a/test/compiler/c2/6958485/Test.java +++ b/test/compiler/c2/Test6958485.java @@ -26,10 +26,14 @@ * @bug 6958485 * @summary fix for 6879921 was insufficient * - * @run main/othervm -Xbatch -XX:CompileOnly=Test.init Test + * @run main/othervm -Xbatch + * -XX:CompileCommand=compileonly,compiler.c2.Test6958485::init + * compiler.c2.Test6958485 */ -public class Test { +package compiler.c2; + +public class Test6958485 { public static void init(Object src[], boolean[] dst) { // initialize the arrays diff --git a/test/compiler/c2/5091921/Test6959129.java b/test/compiler/c2/Test6959129.java rename from test/compiler/c2/5091921/Test6959129.java rename to test/compiler/c2/Test6959129.java --- a/test/compiler/c2/5091921/Test6959129.java +++ b/test/compiler/c2/Test6959129.java @@ -27,9 +27,11 @@ * @bug 6959129 * @summary COMPARISON WITH INTEGER.MAX_INT DOES NOT WORK CORRECTLY IN THE CLIENT VM. * - * @run main/othervm -ea Test6959129 + * @run main/othervm -ea compiler.c2.Test6959129 */ +package compiler.c2; + public class Test6959129 { public static void main(String[] args) { diff --git a/test/compiler/c2/6968348/Test6968348.java b/test/compiler/c2/Test6968348.java rename from test/compiler/c2/6968348/Test6968348.java rename to test/compiler/c2/Test6968348.java --- a/test/compiler/c2/6968348/Test6968348.java +++ b/test/compiler/c2/Test6968348.java @@ -26,13 +26,16 @@ * @test * @bug 6968348 * @summary Byteswapped memory access can point to wrong location after JIT + * @modules java.base/jdk.internal.misc * - * @modules java.base/jdk.internal.misc - * @run main Test6968348 + * @run main compiler.c2.Test6968348 */ +package compiler.c2; + import jdk.internal.misc.Unsafe; -import java.lang.reflect.*; + +import java.lang.reflect.Field; public class Test6968348 { static Unsafe unsafe; diff --git a/test/compiler/c2/6973329/Test.java b/test/compiler/c2/Test6973329.java rename from test/compiler/c2/6973329/Test.java rename to test/compiler/c2/Test6973329.java --- a/test/compiler/c2/6973329/Test.java +++ b/test/compiler/c2/Test6973329.java @@ -26,38 +26,42 @@ * @bug 6973329 * @summary C2 with Zero based COOP produces code with broken anti-dependency on x86 * - * @run main/othervm -Xbatch -Xcomp -XX:CompileOnly=Test Test + * @run main/othervm -Xbatch -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test6973329::* + * compiler.c2.Test6973329 */ -class A { - A next; - int n; +package compiler.c2; - public int get_n() { - return n+1; - } -} -public class Test { +public class Test6973329 { + static class A { + A next; + int n; - A a; + public int get_n() { + return n + 1; + } + } - void test (A new_next) { - A prev_next = a.next; - a.next = new_next; - if (prev_next == null) { - a.n = a.get_n(); + A a; + + void test(A new_next) { + A prev_next = a.next; + a.next = new_next; + if (prev_next == null) { + a.n = a.get_n(); + } } - } - public static void main(String args[]) { - Test t = new Test(); - t.a = new A(); - t.a.n = 1; - t.test(new A()); - if (t.a.n != 2) { - System.out.println("Wrong value: " + t.a.n + " expected: 2"); - System.exit(97); + public static void main(String args[]) { + Test6973329 t = new Test6973329(); + t.a = new A(); + t.a.n = 1; + t.test(new A()); + if (t.a.n != 2) { + System.out.println("Wrong value: " + t.a.n + " expected: 2"); + System.exit(97); + } } - } } diff --git a/test/compiler/c2/5091921/Test6985295.java b/test/compiler/c2/Test6985295.java rename from test/compiler/c2/5091921/Test6985295.java rename to test/compiler/c2/Test6985295.java --- a/test/compiler/c2/5091921/Test6985295.java +++ b/test/compiler/c2/Test6985295.java @@ -27,9 +27,11 @@ * @bug 6985295 * @summary JVM fails to evaluate condition randomly * - * @run main/othervm -Xbatch Test6985295 + * @run main/othervm -Xbatch compiler.c2.Test6985295 */ +package compiler.c2; + public class Test6985295 { public static void main(String[] args) { diff --git a/test/compiler/c2/5091921/Test6992759.java b/test/compiler/c2/Test6992759.java rename from test/compiler/c2/5091921/Test6992759.java rename to test/compiler/c2/Test6992759.java --- a/test/compiler/c2/5091921/Test6992759.java +++ b/test/compiler/c2/Test6992759.java @@ -27,9 +27,11 @@ * @bug 6992759 * @summary Bad code generated for integer <= comparison, fails for Integer.MAX_VALUE * - * @run main/timeout=240 Test6992759 + * @run main/timeout=240 compiler.c2.Test6992759 */ +package compiler.c2; + public class Test6992759 { static final int N_TESTS = 1000000000; diff --git a/test/compiler/c2/7002666/Test7002666.java b/test/compiler/c2/Test7002666.java rename from test/compiler/c2/7002666/Test7002666.java rename to test/compiler/c2/Test7002666.java --- a/test/compiler/c2/7002666/Test7002666.java +++ b/test/compiler/c2/Test7002666.java @@ -27,8 +27,14 @@ * @bug 7002666 * @summary eclipse CDT projects crash with compressed oops * - * @run main/othervm -Xbatch -XX:CompileOnly=Test7002666.test,java/lang/reflect/Array Test7002666 - * + * @run main/othervm -Xbatch + * -XX:CompileCommand=compileonly,compiler.c2.Test7002666::test + * -XX:CompileCommand=compileonly,java.lang.reflect.Array::* + * compiler.c2.Test7002666 + */ + +package compiler.c2; +/* * This will only reliably fail with a fastdebug build since it relies * on seeing garbage in the heap to die. It could be made more * reliable in product mode but that would require greatly increasing diff --git a/test/compiler/c2/7009359/Test7009359.java b/test/compiler/c2/Test7009359.java rename from test/compiler/c2/7009359/Test7009359.java rename to test/compiler/c2/Test7009359.java --- a/test/compiler/c2/7009359/Test7009359.java +++ b/test/compiler/c2/Test7009359.java @@ -27,10 +27,13 @@ * @bug 7009359 * @summary HS with -XX:+AggressiveOpts optimize new StringBuffer(null) so it does not throw NPE as expected * - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+OptimizeStringConcat -XX:CompileCommand=dontinline,Test7009359,stringmakerBUG Test7009359 - * + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+OptimizeStringConcat + * -XX:CompileCommand=dontinline,compiler.c2.Test7009359::stringmakerBUG + * compiler.c2.Test7009359 */ +package compiler.c2; + public class Test7009359 { public static void main (String[] args) { for(int i = 0; i < 100000; i++) { diff --git a/test/compiler/c2/7017746/Test.java b/test/compiler/c2/Test7017746.java rename from test/compiler/c2/7017746/Test.java rename to test/compiler/c2/Test7017746.java --- a/test/compiler/c2/7017746/Test.java +++ b/test/compiler/c2/Test7017746.java @@ -26,25 +26,27 @@ * @bug 7017746 * @summary Regression : C2 compiler crash due to SIGSEGV in PhaseCFG::schedule_early() * - * @run main/othervm -Xbatch Test + * @run main/othervm -Xbatch compiler.c2.Test7017746 */ -public class Test { +package compiler.c2; - int i; +public class Test7017746 { - static int test(Test t, int a, int b) { - int j = t.i; - int x = a - b; - if (a < b) x = x + j; - return x - j; - } + int i; - public static void main(String args[]) { - Test t = new Test(); - for (int n = 0; n < 1000000; n++) { - int i = test(t, 1, 2); + static int test(Test7017746 t, int a, int b) { + int j = t.i; + int x = a - b; + if (a < b) x = x + j; + return x - j; } - } + + public static void main(String args[]) { + Test7017746 t = new Test7017746(); + for (int n = 0; n < 1000000; n++) { + int i = test(t, 1, 2); + } + } } diff --git a/test/compiler/c2/5091921/Test7020614.java b/test/compiler/c2/Test7020614.java rename from test/compiler/c2/5091921/Test7020614.java rename to test/compiler/c2/Test7020614.java --- a/test/compiler/c2/5091921/Test7020614.java +++ b/test/compiler/c2/Test7020614.java @@ -27,9 +27,11 @@ * @bug 7020614 * @summary "-server" mode optimizer makes code hang * - * @run main/othervm/timeout=30 -Xbatch Test7020614 + * @run main/othervm/timeout=30 -Xbatch compiler.c2.Test7020614 */ +package compiler.c2; + public class Test7020614 { private static final int ITERATIONS = 1000; diff --git a/test/compiler/c2/7024475/Test7024475.java b/test/compiler/c2/Test7024475.java rename from test/compiler/c2/7024475/Test7024475.java rename to test/compiler/c2/Test7024475.java --- a/test/compiler/c2/7024475/Test7024475.java +++ b/test/compiler/c2/Test7024475.java @@ -27,9 +27,11 @@ * @bug 7024475 * @summary loop doesn't terminate when compiled * - * @run main Test7024475 + * @run main compiler.c2.Test7024475 */ +package compiler.c2; + public class Test7024475 { static int i; diff --git a/test/compiler/c2/7029152/Test.java b/test/compiler/c2/Test7029152.java rename from test/compiler/c2/7029152/Test.java rename to test/compiler/c2/Test7029152.java --- a/test/compiler/c2/7029152/Test.java +++ b/test/compiler/c2/Test7029152.java @@ -26,24 +26,26 @@ * @bug 7029152 * @summary Ideal nodes for String intrinsics miss memory edge optimization * - * @run main/othervm -Xbatch Test + * @run main/othervm -Xbatch compiler.c2.Test7029152 */ -public class Test { +package compiler.c2; - static final String str = "11111xx11111xx1x"; - static int idx = 0; +public class Test7029152 { - static int IndexOfTest(String str) { - return str.indexOf("11111xx1x"); - } + static final String str = "11111xx11111xx1x"; + static int idx = 0; - public static void main(String args[]) { - final int ITERS=2000000; + static int IndexOfTest(String str) { + return str.indexOf("11111xx1x"); + } - for (int i=0; i 1) - return "bad"; + String test(String str) { + for (int i = 0; i < first; i++) { + if (i > 1) + return "bad"; + } + return add(str + "456"); } - return add(str+"456"); - } - public static void main(String [] args) { - Test7046096 t = new Test7046096(); - for (int i = 0; i < 11000; i++) { - String str = t.test("123"); - if (!str.equals("123456789")) { - System.out.println("FAILED: " + str + " != \"123456789\""); - System.exit(97); - } + public static void main(String[] args) { + Test7046096 t = new Test7046096(); + for (int i = 0; i < 11000; i++) { + String str = t.test("123"); + if (!str.equals("123456789")) { + System.out.println("FAILED: " + str + " != \"123456789\""); + System.exit(97); + } + } } - } } diff --git a/test/compiler/c2/7047069/Test7047069.java b/test/compiler/c2/Test7047069.java rename from test/compiler/c2/7047069/Test7047069.java rename to test/compiler/c2/Test7047069.java --- a/test/compiler/c2/7047069/Test7047069.java +++ b/test/compiler/c2/Test7047069.java @@ -26,13 +26,14 @@ * @test * @bug 7047069 * @summary Array can dynamically change size when assigned to an object field + * @modules java.desktop * - * @modules java.desktop - * @run main/othervm -Xbatch Test7047069 + * @run main/othervm -Xbatch compiler.c2.Test7047069 */ -import java.util.*; -import java.awt.geom.*; +package compiler.c2; + +import java.awt.geom.Line2D; public class Test7047069 { static boolean verbose; diff --git a/test/compiler/c2/7048332/Test7048332.java b/test/compiler/c2/Test7048332.java rename from test/compiler/c2/7048332/Test7048332.java rename to test/compiler/c2/Test7048332.java --- a/test/compiler/c2/7048332/Test7048332.java +++ b/test/compiler/c2/Test7048332.java @@ -27,34 +27,35 @@ * @bug 7048332 * @summary Cadd_cmpLTMask doesn't handle 64-bit tmp register properly * - * @run main/othervm -Xbatch Test7048332 + * @run main/othervm -Xbatch compiler.c2.Test7048332 */ +package compiler.c2; public class Test7048332 { - static int capacity = 2; - static int first = 1; - static int last = 2; + static int capacity = 2; + static int first = 1; + static int last = 2; - static int test(int i1, int i2, int i3, int i4, int i5, int i6) { - final int result; - if (last >= first) { - result = last - first; - } else { - result = last - first + capacity; + static int test(int i1, int i2, int i3, int i4, int i5, int i6) { + final int result; + if (last >= first) { + result = last - first; + } else { + result = last - first + capacity; + } + return result; } - return result; - } - public static void main(String [] args) { - for (int i = 0; i < 11000; i++) { - last = (i & 1) << 1; // 0 or 2 - int k = test(1, 2, 3, 4, 5, 6); - if (k != 1) { - System.out.println("FAILED: " + k + " != 1"); - System.exit(97); - } + public static void main(String[] args) { + for (int i = 0; i < 11000; i++) { + last = (i & 1) << 1; // 0 or 2 + int k = test(1, 2, 3, 4, 5, 6); + if (k != 1) { + System.out.println("FAILED: " + k + " != 1"); + System.exit(97); + } + } } - } } diff --git a/test/compiler/c2/7068051/Test7068051.java b/test/compiler/c2/Test7068051.java rename from test/compiler/c2/7068051/Test7068051.java rename to test/compiler/c2/Test7068051.java --- a/test/compiler/c2/7068051/Test7068051.java +++ b/test/compiler/c2/Test7068051.java @@ -27,12 +27,14 @@ * @bug 7068051 * @summary SIGSEGV in PhaseIdealLoop::build_loop_late_post on T5440 * @library /testlibrary - * * @modules java.base/jdk.internal.misc * java.management - * @run main/othervm -showversion -Xbatch Test7068051 + * + * @run main/othervm -showversion -Xbatch compiler.c2.Test7068051 */ +package compiler.c2; + import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.OutputAnalyzer; diff --git a/test/compiler/c2/7110586/Test7110586.java b/test/compiler/c2/Test7110586.java rename from test/compiler/c2/7110586/Test7110586.java rename to test/compiler/c2/Test7110586.java --- a/test/compiler/c2/7110586/Test7110586.java +++ b/test/compiler/c2/Test7110586.java @@ -27,9 +27,11 @@ * @bug 7110586 * @summary C2 generates icorrect results * - * @run main/othervm -Xbatch Test7110586 + * @run main/othervm -Xbatch compiler.c2.Test7110586 */ +package compiler.c2; + public class Test7110586 { static int test1() { int i = 0; diff --git a/test/compiler/c2/7125879/Test7125879.java b/test/compiler/c2/Test7125879.java rename from test/compiler/c2/7125879/Test7125879.java rename to test/compiler/c2/Test7125879.java --- a/test/compiler/c2/7125879/Test7125879.java +++ b/test/compiler/c2/Test7125879.java @@ -27,9 +27,11 @@ * @bug 7125879 * @summary assert(proj != NULL) failed: must be found * - * @run main/othervm -Xcomp Test7125879 + * @run main/othervm -Xcomp compiler.c2.Test7125879 */ +package compiler.c2; + public class Test7125879 { String var_1 = "abc"; diff --git a/test/compiler/c2/7160610/Test7160610.java b/test/compiler/c2/Test7160610.java rename from test/compiler/c2/7160610/Test7160610.java rename to test/compiler/c2/Test7160610.java --- a/test/compiler/c2/7160610/Test7160610.java +++ b/test/compiler/c2/Test7160610.java @@ -27,9 +27,11 @@ * @bug 7160610 * @summary Unknown Native Code compilation issue. * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-OptimizeFill Test7160610 + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-OptimizeFill compiler.c2.Test7160610 */ +package compiler.c2; + public class Test7160610 { private static final byte[] BYTE_ARRAY = new byte[7]; private static int[] anIntArray1190 = new int[32768]; diff --git a/test/compiler/c2/7169782/Test7169782.java b/test/compiler/c2/Test7169782.java rename from test/compiler/c2/7169782/Test7169782.java rename to test/compiler/c2/Test7169782.java --- a/test/compiler/c2/7169782/Test7169782.java +++ b/test/compiler/c2/Test7169782.java @@ -27,9 +27,13 @@ * @bug 7169782 * @summary C2: SIGSEGV in LShiftLNode::Ideal(PhaseGVN*, bool) * - * @run main/othervm -Xcomp -XX:CompileOnly="Test7169782::" Test7169782 + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.c2.Test7169782:: + * compiler.c2.Test7169782 */ +package compiler.c2; + public class Test7169782 { static long var_8; diff --git a/test/compiler/c2/7174363/Test7174363.java b/test/compiler/c2/Test7174363.java rename from test/compiler/c2/7174363/Test7174363.java rename to test/compiler/c2/Test7174363.java --- a/test/compiler/c2/7174363/Test7174363.java +++ b/test/compiler/c2/Test7174363.java @@ -27,10 +27,12 @@ * @bug 7174363 * @summary crash with Arrays.copyOfRange(original, from, to) when from > original.length * - * @run main/othervm -XX:-BackgroundCompilation Test7174363 + * @run main/othervm -XX:-BackgroundCompilation compiler.c2.Test7174363 */ -import java.util.*; +package compiler.c2; + +import java.util.Arrays; public class Test7174363 { @@ -43,7 +45,8 @@ for (int i = 0; i < 20000; i++) { try { m(orig, 15, 20); - } catch(ArrayIndexOutOfBoundsException excp) {} + } catch (ArrayIndexOutOfBoundsException excp) { + } } } } diff --git a/test/compiler/c2/7177917/Test7177917.java b/test/compiler/c2/Test7177917.java rename from test/compiler/c2/7177917/Test7177917.java rename to test/compiler/c2/Test7177917.java --- a/test/compiler/c2/7177917/Test7177917.java +++ b/test/compiler/c2/Test7177917.java @@ -22,11 +22,20 @@ * */ -/* - * Micro-benchmark for Math.pow() and Math.exp() +/** + * @test + * @bug 7177917 + * @summary Micro-benchmark for Math.pow() and Math.exp() + * @modules java.base/jdk.internal.misc + * @library /testlibrary + * + * @run main compiler.c2.Test7177917 */ +package compiler.c2; + import jdk.test.lib.Utils; + import java.util.Random; public class Test7177917 { diff --git a/test/compiler/c2/7179138/Test7179138_1.java b/test/compiler/c2/Test7179138_1.java rename from test/compiler/c2/7179138/Test7179138_1.java rename to test/compiler/c2/Test7179138_1.java --- a/test/compiler/c2/7179138/Test7179138_1.java +++ b/test/compiler/c2/Test7179138_1.java @@ -25,11 +25,15 @@ * @test * @bug 7179138 * @summary Incorrect result with String concatenation optimization - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation Test7179138_1 + * + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * compiler.c2.Test7179138_1 * * @author Skip Balk */ +package compiler.c2; + public class Test7179138_1 { public static void main(String[] args) throws Exception { System.out.println("Java Version: " + System.getProperty("java.vm.version")); diff --git a/test/compiler/c2/7179138/Test7179138_2.java b/test/compiler/c2/Test7179138_2.java rename from test/compiler/c2/7179138/Test7179138_2.java rename to test/compiler/c2/Test7179138_2.java --- a/test/compiler/c2/7179138/Test7179138_2.java +++ b/test/compiler/c2/Test7179138_2.java @@ -25,11 +25,15 @@ * @test * @bug 7179138 * @summary Incorrect result with String concatenation optimization - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation Test7179138_2 + * + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * compiler.c2.Test7179138_2 * * @author Skip Balk */ +package compiler.c2; + public class Test7179138_2 { public static void main(String[] args) throws Exception { System.out.println("Java Version: " + System.getProperty("java.vm.version")); diff --git a/test/compiler/c2/7190310/Test7190310.java b/test/compiler/c2/Test7190310.java rename from test/compiler/c2/7190310/Test7190310.java rename to test/compiler/c2/Test7190310.java --- a/test/compiler/c2/7190310/Test7190310.java +++ b/test/compiler/c2/Test7190310.java @@ -26,7 +26,8 @@ * @test * @bug 7190310 * @summary Inlining WeakReference.get(), and hoisting $referent may lead to non-terminating loops - * @run main/othervm/timeout=600 -Xbatch Test7190310 + * + * @run main/othervm/timeout=600 -Xbatch compiler.c2.Test7190310 */ /* @@ -34,54 +35,57 @@ * It should normally finish pretty quickly, but on some especially slow machines * it may not. The companion _unsafe test lacks a timeout, but that is okay. */ +package compiler.c2; -import java.lang.ref.*; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; public class Test7190310 { - private static Object str = new Object() { - public String toString() { - return "The Object"; + private static Object str = new Object() { + public String toString() { + return "The Object"; + } + + protected void finalize() throws Throwable { + System.out.println("The Object is being finalized"); + super.finalize(); + } + }; + private final static ReferenceQueue rq = + new ReferenceQueue(); + private final static WeakReference wr = + new WeakReference(str, rq); + + public static void main(String[] args) + throws InterruptedException { + Thread reader = new Thread() { + public void run() { + while (wr.get() != null) { + } + System.out.println("wr.get() returned null"); + } + }; + + Thread queueReader = new Thread() { + public void run() { + try { + Reference ref = rq.remove(); + System.out.println(ref); + System.out.println("queueReader returned, ref==wr is " + + (ref == wr)); + } catch (InterruptedException e) { + System.err.println("Sleep interrupted - exiting"); + } + } + }; + + reader.start(); + queueReader.start(); + + Thread.sleep(1000); + str = null; + System.gc(); } - - protected void finalize() throws Throwable { - System.out.println("The Object is being finalized"); - super.finalize(); - } - }; - private final static ReferenceQueue rq = - new ReferenceQueue(); - private final static WeakReference wr = - new WeakReference(str, rq); - - public static void main(String[] args) - throws InterruptedException { - Thread reader = new Thread() { - public void run() { - while (wr.get() != null) { - } - System.out.println("wr.get() returned null"); - } - }; - - Thread queueReader = new Thread() { - public void run() { - try { - Reference ref = rq.remove(); - System.out.println(ref); - System.out.println("queueReader returned, ref==wr is " - + (ref == wr)); - } catch (InterruptedException e) { - System.err.println("Sleep interrupted - exiting"); - } - } - }; - - reader.start(); - queueReader.start(); - - Thread.sleep(1000); - str = null; - System.gc(); - } } diff --git a/test/compiler/c2/7190310/Test7190310_unsafe.java b/test/compiler/c2/Test7190310_unsafe.java rename from test/compiler/c2/7190310/Test7190310_unsafe.java rename to test/compiler/c2/Test7190310_unsafe.java --- a/test/compiler/c2/7190310/Test7190310_unsafe.java +++ b/test/compiler/c2/Test7190310_unsafe.java @@ -27,117 +27,128 @@ * @bug 7190310 * @summary Inlining WeakReference.get(), and hoisting $referent may lead to non-terminating loops * @modules java.base/jdk.internal.misc - * @run main/othervm -Xbatch Test7190310_unsafe + * + * @run main/othervm -Xbatch compiler.c2.Test7190310_unsafe */ -import java.lang.ref.*; -import java.lang.reflect.*; +package compiler.c2; + import jdk.internal.misc.Unsafe; +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; +import java.lang.reflect.Field; + public class Test7190310_unsafe { - static class TestObject { - public String toString() { - return "TestObject"; - } - }; - - private static TestObject str = new TestObject(); - private static final WeakReference ref = new WeakReference(str); - - private TestObject obj; - - public static void main(String[] args) throws Exception { - Class c = Test7190310_unsafe.class.getClassLoader().loadClass("jdk.internal.misc.Unsafe"); - Field f = c.getDeclaredField("theUnsafe"); - f.setAccessible(true); - Unsafe unsafe = (Unsafe)f.get(c); - - f = Reference.class.getDeclaredField("referent"); - f.setAccessible(true); - long referent_offset = unsafe.objectFieldOffset(f); - - Test7190310_unsafe t = new Test7190310_unsafe(); - TestObject o = new TestObject(); - t.obj = o; - - // Warmup (compile methods) - System.err.println("Warmup"); - Object obj = null; - for (int i = 0; i < 11000; i++) { - obj = getRef0(ref); - } - for (int i = 0; i < 11000; i++) { - obj = getRef1(unsafe, ref, referent_offset); - } - for (int i = 0; i < 11000; i++) { - obj = getRef2(unsafe, ref, referent_offset); - } - for (int i = 0; i < 11000; i++) { - obj = getRef3(unsafe, ref, referent_offset); - } - for (int i = 0; i < 11000; i++) { - obj = getRef4(unsafe, t, referent_offset); + static class TestObject { + public String toString() { + return "TestObject"; + } } - // Access verification - System.err.println("Verification"); - if (!verifyGet(referent_offset, unsafe)) { - System.exit(97); + ; + + private static TestObject str = new TestObject(); + private static final WeakReference ref = new WeakReference(str); + + private TestObject obj; + + public static void main(String[] args) throws Exception { + Class c = Test7190310_unsafe.class.getClassLoader().loadClass("jdk.internal.misc.Unsafe"); + Field f = c.getDeclaredField("theUnsafe"); + f.setAccessible(true); + Unsafe unsafe = (Unsafe) f.get(c); + + f = Reference.class.getDeclaredField("referent"); + f.setAccessible(true); + long referent_offset = unsafe.objectFieldOffset(f); + + Test7190310_unsafe t = new Test7190310_unsafe(); + TestObject o = new TestObject(); + t.obj = o; + + // Warmup (compile methods) + System.err.println("Warmup"); + Object obj = null; + for (int i = 0; i < 11000; i++) { + obj = getRef0(ref); + } + for (int i = 0; i < 11000; i++) { + obj = getRef1(unsafe, ref, referent_offset); + } + for (int i = 0; i < 11000; i++) { + obj = getRef2(unsafe, ref, referent_offset); + } + for (int i = 0; i < 11000; i++) { + obj = getRef3(unsafe, ref, referent_offset); + } + for (int i = 0; i < 11000; i++) { + obj = getRef4(unsafe, t, referent_offset); + } + + // Access verification + System.err.println("Verification"); + if (!verifyGet(referent_offset, unsafe)) { + System.exit(97); + } + + obj = getRef3(unsafe, t, referent_offset); + if (obj != o) { + System.out.println("FAILED: unsafe.getObject(Object, " + referent_offset + ") " + obj + " != " + o); + System.exit(97); + } + obj = getRef4(unsafe, t, referent_offset); + if (obj != o) { + System.out.println("FAILED: unsafe.getObject(Test7190310, " + referent_offset + ") " + obj + " != " + o); + System.exit(97); + } } - obj = getRef3(unsafe, t, referent_offset); - if (obj != o) { - System.out.println("FAILED: unsafe.getObject(Object, " + referent_offset + ") " + obj + " != " + o); - System.exit(97); + static boolean verifyGet(long referent_offset, Unsafe unsafe) throws Exception { + // Access verification + System.out.println("referent: " + str); + Object obj = getRef0(ref); + if (obj != str) { + System.out.println("FAILED: weakRef.get() " + obj + " != " + str); + return false; + } + obj = getRef1(unsafe, ref, referent_offset); + if (obj != str) { + System.out.println("FAILED: unsafe.getObject(weakRef, " + referent_offset + ") " + obj + " != " + str); + return false; + } + obj = getRef2(unsafe, ref, referent_offset); + if (obj != str) { + System.out.println("FAILED: unsafe.getObject(abstRef, " + referent_offset + ") " + obj + " != " + str); + return false; + } + obj = getRef3(unsafe, ref, referent_offset); + if (obj != str) { + System.out.println("FAILED: unsafe.getObject(Object, " + referent_offset + ") " + obj + " != " + str); + return false; + } + return true; } - obj = getRef4(unsafe, t, referent_offset); - if (obj != o) { - System.out.println("FAILED: unsafe.getObject(Test7190310, " + referent_offset + ") " + obj + " != " + o); - System.exit(97); + + static Object getRef0(WeakReference ref) throws Exception { + return ref.get(); } - } - static boolean verifyGet(long referent_offset, Unsafe unsafe) throws Exception { - // Access verification - System.out.println("referent: " + str); - Object obj = getRef0(ref); - if (obj != str) { - System.out.println("FAILED: weakRef.get() " + obj + " != " + str); - return false; + static Object getRef1(Unsafe unsafe, WeakReference ref, long referent_offset) throws Exception { + return unsafe.getObject(ref, referent_offset); } - obj = getRef1(unsafe, ref, referent_offset); - if (obj != str) { - System.out.println("FAILED: unsafe.getObject(weakRef, " + referent_offset + ") " + obj + " != " + str); - return false; + + static Object getRef2(Unsafe unsafe, Reference ref, long referent_offset) throws Exception { + return unsafe.getObject(ref, referent_offset); } - obj = getRef2(unsafe, ref, referent_offset); - if (obj != str) { - System.out.println("FAILED: unsafe.getObject(abstRef, " + referent_offset + ") " + obj + " != " + str); - return false; + + static Object getRef3(Unsafe unsafe, Object ref, long referent_offset) throws Exception { + return unsafe.getObject(ref, referent_offset); } - obj = getRef3(unsafe, ref, referent_offset); - if (obj != str) { - System.out.println("FAILED: unsafe.getObject(Object, " + referent_offset + ") " + obj + " != " + str); - return false; + + static Object getRef4(Unsafe unsafe, Test7190310_unsafe ref, long referent_offset) throws Exception { + return unsafe.getObject(ref, referent_offset); } - return true; - } - - static Object getRef0(WeakReference ref) throws Exception { - return ref.get(); - } - static Object getRef1(Unsafe unsafe, WeakReference ref, long referent_offset) throws Exception { - return unsafe.getObject(ref, referent_offset); - } - static Object getRef2(Unsafe unsafe, Reference ref, long referent_offset) throws Exception { - return unsafe.getObject(ref, referent_offset); - } - static Object getRef3(Unsafe unsafe, Object ref, long referent_offset) throws Exception { - return unsafe.getObject(ref, referent_offset); - } - static Object getRef4(Unsafe unsafe, Test7190310_unsafe ref, long referent_offset) throws Exception { - return unsafe.getObject(ref, referent_offset); - } } diff --git a/test/compiler/c2/7199742/Test7199742.java b/test/compiler/c2/Test7199742.java rename from test/compiler/c2/7199742/Test7199742.java rename to test/compiler/c2/Test7199742.java --- a/test/compiler/c2/7199742/Test7199742.java +++ b/test/compiler/c2/Test7199742.java @@ -27,28 +27,32 @@ * @bug 7199742 * @summary A lot of C2 OSR compilations of the same method's bci * - * @run main/othervm -Xmx32m -Xbatch Test7199742 + * @run main/othervm -Xmx32m -Xbatch compiler.c2.Test7199742 */ +package compiler.c2; + public class Test7199742 { - private static final int ITERS = 10000000; - public static void main(String args[]) { - Test7199742 t = new Test7199742(); - for (int i=0; i<10; i++) { - test(t, 7); + private static final int ITERS = 10000000; + + public static void main(String args[]) { + Test7199742 t = new Test7199742(); + for (int i = 0; i < 10; i++) { + test(t, 7); + } } - } - static Test7199742 test(Test7199742 t, int m) { - int i = -(ITERS/2); - if (i == 0) return null; - Test7199742 v = null; - while(i < ITERS) { - if ((i&m) == 0) { - v = t; - } - i++; + + static Test7199742 test(Test7199742 t, int m) { + int i = -(ITERS / 2); + if (i == 0) return null; + Test7199742 v = null; + while (i < ITERS) { + if ((i & m) == 0) { + v = t; + } + i++; + } + return v; } - return v; - } } diff --git a/test/compiler/c2/8000805/Test8000805.java b/test/compiler/c2/Test8000805.java rename from test/compiler/c2/8000805/Test8000805.java rename to test/compiler/c2/Test8000805.java --- a/test/compiler/c2/8000805/Test8000805.java +++ b/test/compiler/c2/Test8000805.java @@ -26,31 +26,35 @@ * @bug 8000805 * @summary JMM issue: short loads are non-atomic * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -Xcomp -XX:+PrintCompilation -XX:CompileOnly=Test8000805.loadS2LmaskFF,Test8000805.loadS2Lmask16,Test8000805.loadS2Lmask13,Test8000805.loadUS_signExt,Test8000805.loadB2L_mask8 Test8000805 + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -Xcomp + * -XX:+PrintCompilation + * -XX:CompileCommand=compileonly,compiler.c2.Test8000805::load* + * compiler.c2.Test8000805 */ +package compiler.c2; public class Test8000805 { - static long loadS2LmaskFF (short[] sa) { return sa[0] & 0xFF; } - static long loadS2LmaskFF_1 (short[] sa) { return sa[0] & 0xFF; } + static long loadS2LmaskFF (short[] sa) { return sa[0] & 0xFF; } + static long _loadS2LmaskFF (short[] sa) { return sa[0] & 0xFF; } - static long loadS2Lmask16 (short[] sa) { return sa[0] & 0xFFFE; } - static long loadS2Lmask16_1 (short[] sa) { return sa[0] & 0xFFFE; } + static long loadS2Lmask16 (short[] sa) { return sa[0] & 0xFFFE; } + static long _loadS2Lmask16 (short[] sa) { return sa[0] & 0xFFFE; } - static long loadS2Lmask13 (short[] sa) { return sa[0] & 0x0FFF; } - static long loadS2Lmask13_1 (short[] sa) { return sa[0] & 0x0FFF; } + static long loadS2Lmask13 (short[] sa) { return sa[0] & 0x0FFF; } + static long _loadS2Lmask13 (short[] sa) { return sa[0] & 0x0FFF; } - static int loadUS_signExt (char[] ca) { return (ca[0] << 16) >> 16; } - static int loadUS_signExt_1 (char[] ca) { return (ca[0] << 16) >> 16; } + static int loadUS_signExt (char[] ca) { return (ca[0] << 16) >> 16; } + static int _loadUS_signExt (char[] ca) { return (ca[0] << 16) >> 16; } - static long loadB2L_mask8 (byte[] ba) { return ba[0] & 0x55; } - static long loadB2L_mask8_1 (byte[] ba) { return ba[0] & 0x55; } + static long loadB2L_mask8 (byte[] ba) { return ba[0] & 0x55; } + static long _loadB2L_mask8 (byte[] ba) { return ba[0] & 0x55; } public static void main(String[] args) { for (int i = Byte.MIN_VALUE; i < Byte.MAX_VALUE; i++) { byte[] ba = new byte[] { (byte) i}; - { long v1 = loadB2L_mask8(ba); - long v2 = loadB2L_mask8_1(ba); + { long v1 = loadB2L_mask8(ba); + long v2 = _loadB2L_mask8(ba); if (v1 != v2) throw new InternalError(String.format("loadB2L_mask8 failed: %x != %x", v1, v2)); } } @@ -59,23 +63,23 @@ short[] sa = new short[] { (short)i }; char[] ca = new char[] { (char)i }; - { long v1 = loadS2LmaskFF(sa); - long v2 = loadS2LmaskFF_1(sa); + { long v1 = loadS2LmaskFF(sa); + long v2 = _loadS2LmaskFF(sa); if (v1 != v2) throw new InternalError(String.format("loadS2LmaskFF failed: %x != %x", v1, v2)); } - { long v1 = loadS2Lmask16(sa); - long v2 = loadS2Lmask16_1(sa); + { long v1 = loadS2Lmask16(sa); + long v2 = _loadS2Lmask16(sa); if (v1 != v2) throw new InternalError(String.format("loadS2Lmask16 failed: %x != %x", v1, v2)); } - { long v1 = loadS2Lmask13(sa); - long v2 = loadS2Lmask13_1(sa); + { long v1 = loadS2Lmask13(sa); + long v2 = _loadS2Lmask13(sa); if (v1 != v2) throw new InternalError(String.format("loadS2Lmask13 failed: %x != %x", v1, v2)); } - { int v1 = loadUS_signExt(ca); - int v2 = loadUS_signExt_1(ca); + { int v1 = loadUS_signExt(ca); + int v2 = _loadUS_signExt(ca); if (v1 != v2) throw new InternalError(String.format("loadUS_signExt failed: %x != %x", v1, v2)); } } diff --git a/test/compiler/c2/8002069/Test8002069.java b/test/compiler/c2/Test8002069.java rename from test/compiler/c2/8002069/Test8002069.java rename to test/compiler/c2/Test8002069.java --- a/test/compiler/c2/8002069/Test8002069.java +++ b/test/compiler/c2/Test8002069.java @@ -27,72 +27,87 @@ * @bug 8002069 * @summary Assert failed in C2: assert(field->edge_count() > 0) failed: sanity * - * @run main/othervm -Xmx32m -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:CompileCommand=exclude,Test8002069.dummy Test8002069 + * @run main/othervm -Xmx32m -XX:+IgnoreUnrecognizedVMOptions -Xbatch + * -XX:CompileCommand=exclude,compiler.c2.Test8002069::dummy + * compiler.c2.Test8002069 */ -abstract class O { - int f; - public O() { f = 5; } - abstract void put(int i); - public int foo(int i) { - put(i); - return i; - } -}; +package compiler.c2; -class A extends O { - int[] a; - public A(int s) { - a = new int[s]; - } - public void put(int i) { - a[i%a.length] = i; - } +public class Test8002069 { + static abstract class O { + int f; + + public O() { + f = 5; + } + + abstract void put(int i); + + public int foo(int i) { + put(i); + return i; + } + } + + static class A extends O { + int[] a; + + public A(int s) { + a = new int[s]; + } + + public void put(int i) { + a[i % a.length] = i; + } + } + + static class B extends O { + int sz; + int[] a; + + public B(int s) { + sz = s; + a = new int[s]; + } + + public void put(int i) { + a[i % sz] = i; + } + } + + public static void main(String args[]) { + int sum = 0; + for (int i = 0; i < 8000; i++) { + sum += test1(i); + } + for (int i = 0; i < 100000; i++) { + sum += test2(i); + } + System.out.println("PASSED. sum = " + sum); + } + + private O o; + + private int foo(int i) { + return o.foo(i); + } + + static int test1(int i) { + Test8002069 t = new Test8002069(); + t.o = new A(5); + return t.foo(i); + } + + static int test2(int i) { + Test8002069 t = new Test8002069(); + t.o = new B(5); + dummy(i); + return t.foo(i); + } + + static int dummy(int i) { + return i * 2; + } } -class B extends O { - int sz; - int[] a; - public B(int s) { - sz = s; - a = new int[s]; - } - public void put(int i) { - a[i%sz] = i; - } -} - -public class Test8002069 { - public static void main(String args[]) { - int sum = 0; - for (int i=0; i<8000; i++) { - sum += test1(i); - } - for (int i=0; i<100000; i++) { - sum += test2(i); - } - System.out.println("PASSED. sum = " + sum); - } - - private O o; - - private int foo(int i) { - return o.foo(i); - } - static int test1(int i) { - Test8002069 t = new Test8002069(); - t.o = new A(5); - return t.foo(i); - } - static int test2(int i) { - Test8002069 t = new Test8002069(); - t.o = new B(5); - dummy(i); - return t.foo(i); - } - - static int dummy(int i) { - return i*2; - } -} - diff --git a/test/compiler/c2/8004741/Test8004741.java b/test/compiler/c2/Test8004741.java rename from test/compiler/c2/8004741/Test8004741.java rename to test/compiler/c2/Test8004741.java --- a/test/compiler/c2/8004741/Test8004741.java +++ b/test/compiler/c2/Test8004741.java @@ -25,11 +25,17 @@ * @test Test8004741.java * @bug 8004741 * @summary Missing compiled exception handle table entry for multidimensional array allocation - * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100 Test8004741 - * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers Test8004741 + * + * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers + * -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100 + * compiler.c2.Test8004741 + * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers + * compiler.c2.Test8004741 */ -import java.util.*; +package compiler.c2; public class Test8004741 extends Thread { diff --git a/test/compiler/c2/8007294/Test8007294.java b/test/compiler/c2/Test8007294.java rename from test/compiler/c2/8007294/Test8007294.java rename to test/compiler/c2/Test8007294.java --- a/test/compiler/c2/8007294/Test8007294.java +++ b/test/compiler/c2/Test8007294.java @@ -26,10 +26,14 @@ * @bug 8007294 * @bug 8146999 * @summary ReduceFieldZeroing doesn't check for dependent load and can lead to incorrect execution - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline -XX:-UseOnStackReplacement -XX:-BackgroundCompilation Test8007294 * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline + * -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * compiler.c2.Test8007294 */ +package compiler.c2; + public class Test8007294 { int i1; diff --git a/test/compiler/c2/8007722/Test8007722.java b/test/compiler/c2/Test8007722.java rename from test/compiler/c2/8007722/Test8007722.java rename to test/compiler/c2/Test8007722.java --- a/test/compiler/c2/8007722/Test8007722.java +++ b/test/compiler/c2/Test8007722.java @@ -25,11 +25,14 @@ * @test * @bug 8007722 * @summary GetAndSetP's MachNode should capture bottom type - * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation Test8007722 * + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * compiler.c2.Test8007722 */ -import java.util.concurrent.atomic.*; +package compiler.c2; + +import java.util.concurrent.atomic.AtomicReference; public class Test8007722 { diff --git a/test/compiler/c2/6946040/TestCharShortByteSwap.java b/test/compiler/c2/TestCharShortByteSwap.java rename from test/compiler/c2/6946040/TestCharShortByteSwap.java rename to test/compiler/c2/TestCharShortByteSwap.java --- a/test/compiler/c2/6946040/TestCharShortByteSwap.java +++ b/test/compiler/c2/TestCharShortByteSwap.java @@ -26,9 +26,15 @@ * @test * @bug 6946040 * @summary Tests Character/Short.reverseBytes and their intrinsics implementation in the server compiler - * @run main/othervm -Xbatch -XX:CompileOnly=.testChar,.testShort TestCharShortByteSwap + * + * @run main/othervm -Xbatch + * -XX:CompileCommand=compileonly,compiler.c2.TestCharShortByteSwap::testChar + * -XX:CompileCommand=compileonly,compiler.c2.TestCharShortByteSwap::testShort + * compiler.c2.TestCharShortByteSwap */ +package compiler.c2; + // This test must run without any command line arguments. public class TestCharShortByteSwap { diff --git a/test/compiler/c2/TestDominatingDeadCheckCast.java b/test/compiler/c2/TestDominatingDeadCheckCast.java --- a/test/compiler/c2/TestDominatingDeadCheckCast.java +++ b/test/compiler/c2/TestDominatingDeadCheckCast.java @@ -26,10 +26,15 @@ * @test * @bug 8149797 * @summary node replaced by dominating dead cast during parsing - * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:TypeProfileLevel=200 -XX:CompileCommand=dontinline,TestDominatingDeadCheckCast::not_inlined TestDominatingDeadCheckCast * + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * -XX:TypeProfileLevel=200 + * -XX:CompileCommand=dontinline,compiler.c2.TestDominatingDeadCheckCast::not_inlined + * compiler.c2.TestDominatingDeadCheckCast */ +package compiler.c2; + public class TestDominatingDeadCheckCast { static class A { diff --git a/test/compiler/c2/6921969/TestMultiplyLongHiZero.java b/test/compiler/c2/TestMultiplyLongHiZero.java rename from test/compiler/c2/6921969/TestMultiplyLongHiZero.java rename to test/compiler/c2/TestMultiplyLongHiZero.java --- a/test/compiler/c2/6921969/TestMultiplyLongHiZero.java +++ b/test/compiler/c2/TestMultiplyLongHiZero.java @@ -26,11 +26,20 @@ * @test * @bug 6921969 * @summary Tests shorter long multiply sequences when the high 32 bits of long operands are known to be zero on x86_32 - * @run main/othervm -Xbatch -XX:-Inline -XX:CompileOnly=.testNormal,.testLeftOptimized,.testRightOptimized,.testOptimized,.testLeftOptimized_LoadUI2L,.testRightOptimized_LoadUI2L,.testOptimized_LoadUI2L TestMultiplyLongHiZero + * @run main/othervm -Xbatch -XX:-Inline + * -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testNormal + * -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testLeftOptimized + * -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testRightOptimized + * -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testOptimized + * -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testLeftOptimized_LoadUI2L + * -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testRightOptimized_LoadUI2L + * -XX:CompileCommand=compileonly,compiler.c2.TestMultiplyLongHiZero::testOptimized_LoadUI2L + * compiler.c2.TestMultiplyLongHiZero */ +package compiler.c2; + // This test must run without any command line arguments. - public class TestMultiplyLongHiZero { private static void check(long leftFactor, long rightFactor, long optimizedProduct, long constantProduct) { diff --git a/test/compiler/c2/6340864/TestByteVect.java b/test/compiler/c2/cr6340864/TestByteVect.java rename from test/compiler/c2/6340864/TestByteVect.java rename to test/compiler/c2/cr6340864/TestByteVect.java --- a/test/compiler/c2/6340864/TestByteVect.java +++ b/test/compiler/c2/cr6340864/TestByteVect.java @@ -27,9 +27,11 @@ * @bug 6340864 * @summary Implement vectorization optimizations in hotspot-server * - * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestByteVect + * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr6340864.TestByteVect */ +package compiler.c2.cr6340864; + public class TestByteVect { private static final int ARRLEN = 997; private static final int ITERS = 11000; diff --git a/test/compiler/c2/6340864/TestDoubleVect.java b/test/compiler/c2/cr6340864/TestDoubleVect.java rename from test/compiler/c2/6340864/TestDoubleVect.java rename to test/compiler/c2/cr6340864/TestDoubleVect.java --- a/test/compiler/c2/6340864/TestDoubleVect.java +++ b/test/compiler/c2/cr6340864/TestDoubleVect.java @@ -27,9 +27,11 @@ * @bug 6340864 * @summary Implement vectorization optimizations in hotspot-server * - * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestDoubleVect + * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr6340864.TestDoubleVect */ +package compiler.c2.cr6340864; + public class TestDoubleVect { private static final int ARRLEN = 997; private static final int ITERS = 11000; diff --git a/test/compiler/c2/6340864/TestFloatVect.java b/test/compiler/c2/cr6340864/TestFloatVect.java rename from test/compiler/c2/6340864/TestFloatVect.java rename to test/compiler/c2/cr6340864/TestFloatVect.java --- a/test/compiler/c2/6340864/TestFloatVect.java +++ b/test/compiler/c2/cr6340864/TestFloatVect.java @@ -27,9 +27,11 @@ * @bug 6340864 * @summary Implement vectorization optimizations in hotspot-server * - * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestFloatVect + * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr6340864.TestFloatVect */ +package compiler.c2.cr6340864; + public class TestFloatVect { private static final int ARRLEN = 997; private static final int ITERS = 11000; diff --git a/test/compiler/c2/6340864/TestIntVect.java b/test/compiler/c2/cr6340864/TestIntVect.java rename from test/compiler/c2/6340864/TestIntVect.java rename to test/compiler/c2/cr6340864/TestIntVect.java --- a/test/compiler/c2/6340864/TestIntVect.java +++ b/test/compiler/c2/cr6340864/TestIntVect.java @@ -27,9 +27,11 @@ * @bug 6340864 * @summary Implement vectorization optimizations in hotspot-server * - * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestIntVect + * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr6340864.TestIntVect */ +package compiler.c2.cr6340864; + public class TestIntVect { private static final int ARRLEN = 997; private static final int ITERS = 11000; diff --git a/test/compiler/c2/6340864/TestLongVect.java b/test/compiler/c2/cr6340864/TestLongVect.java rename from test/compiler/c2/6340864/TestLongVect.java rename to test/compiler/c2/cr6340864/TestLongVect.java --- a/test/compiler/c2/6340864/TestLongVect.java +++ b/test/compiler/c2/cr6340864/TestLongVect.java @@ -27,9 +27,11 @@ * @bug 6340864 * @summary Implement vectorization optimizations in hotspot-server * - * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestLongVect + * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr6340864.TestLongVect */ +package compiler.c2.cr6340864; + public class TestLongVect { private static final int ARRLEN = 997; private static final int ITERS = 11000; diff --git a/test/compiler/c2/6340864/TestShortVect.java b/test/compiler/c2/cr6340864/TestShortVect.java rename from test/compiler/c2/6340864/TestShortVect.java rename to test/compiler/c2/cr6340864/TestShortVect.java --- a/test/compiler/c2/6340864/TestShortVect.java +++ b/test/compiler/c2/cr6340864/TestShortVect.java @@ -27,9 +27,11 @@ * @bug 6340864 * @summary Implement vectorization optimizations in hotspot-server * - * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestShortVect + * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr6340864.TestShortVect */ +package compiler.c2.cr6340864; + public class TestShortVect { private static final int ARRLEN = 997; private static final int ITERS = 11000; diff --git a/test/compiler/c2/6589834/InlinedArrayCloneTestCase.java b/test/compiler/c2/cr6589834/InlinedArrayCloneTestCase.java rename from test/compiler/c2/6589834/InlinedArrayCloneTestCase.java rename to test/compiler/c2/cr6589834/InlinedArrayCloneTestCase.java --- a/test/compiler/c2/6589834/InlinedArrayCloneTestCase.java +++ b/test/compiler/c2/cr6589834/InlinedArrayCloneTestCase.java @@ -21,6 +21,8 @@ * questions. */ +package compiler.c2.cr6589834; + public class InlinedArrayCloneTestCase implements Runnable { private Test_ia32 executionController; diff --git a/test/compiler/c2/6589834/Test_ia32.java b/test/compiler/c2/cr6589834/Test_ia32.java rename from test/compiler/c2/6589834/Test_ia32.java rename to test/compiler/c2/cr6589834/Test_ia32.java --- a/test/compiler/c2/6589834/Test_ia32.java +++ b/test/compiler/c2/cr6589834/Test_ia32.java @@ -26,27 +26,32 @@ * @bug 6589834 * @summary Safepoint placed between stack pointer increment and decrement leads * to interpreter's stack corruption after deoptimization. - * @library /testlibrary /test/lib + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor + * * @build ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.* - * Test_ia32 InlinedArrayCloneTestCase - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission + * compiler.c2.cr6589834.Test_ia32 + * compiler.c2.cr6589834.InlinedArrayCloneTestCase + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:CompileOnly=InlinedArrayCloneTestCase - * -XX:CompileCommand=dontinline,InlinedArrayCloneTestCase.invokeArrayClone - * -XX:CompileCommand=inline,InlinedArrayCloneTestCase.verifyArguments - * -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyStack Test_ia32 + * -XX:+WhiteBoxAPI -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyStack + * -XX:CompileCommand=compileonly,compiler.c2.cr6589834.InlinedArrayCloneTestCase::* + * -XX:CompileCommand=dontinline,compiler.c2.cr6589834.InlinedArrayCloneTestCase::invokeArrayClone + * -XX:CompileCommand=inline,compiler.c2.cr6589834.InlinedArrayCloneTestCase::verifyArguments + * compiler.c2.cr6589834.Test_ia32 */ -import java.lang.reflect.Method; +package compiler.c2.cr6589834; import jdk.test.lib.Asserts; import sun.hotspot.WhiteBox; +import java.lang.reflect.Method; + public class Test_ia32 { private static final int NUM_THREADS = Math.min(100, 2 * Runtime.getRuntime().availableProcessors()); @@ -111,7 +116,7 @@ * dependency. */ try { - Class.forName("NotLoadedClass"); + Class.forName(Test_ia32.class.getPackage().getName() + ".NotLoadedClass"); } catch (ClassNotFoundException e) { throw new Error("Unable to load class that invalidates " + "CHA-dependency for method " + method.getName(), e); diff --git a/test/compiler/c2/6646020/Tester.java b/test/compiler/c2/cr6646020/Tester.java rename from test/compiler/c2/6646020/Tester.java rename to test/compiler/c2/cr6646020/Tester.java --- a/test/compiler/c2/6646020/Tester.java +++ b/test/compiler/c2/cr6646020/Tester.java @@ -25,8 +25,12 @@ * @test * @bug 6646020 * @summary assert(in_bb(n),"must be in block") in -Xcomp mode + * + * @run main compiler.c2.cr6646020.Tester */ +package compiler.c2.cr6646020; + /* Complexity upper bound: 3361 ops */ class Tester_Class_0 { diff --git a/test/compiler/c2/6663848/Tester.java b/test/compiler/c2/cr6663848/Tester.java rename from test/compiler/c2/6663848/Tester.java rename to test/compiler/c2/cr6663848/Tester.java --- a/test/compiler/c2/6663848/Tester.java +++ b/test/compiler/c2/cr6663848/Tester.java @@ -25,8 +25,11 @@ * @test * @bug 6663848 * @summary assert(i < Max(),"oob") + * + * @run main compiler.c2.cr6663848.Tester */ +package compiler.c2.cr6663848; /* Complexity upper bound: 296055 ops */ final class Tester_Class_0 { diff --git a/test/compiler/c2/6663854/Test6663854.java b/test/compiler/c2/cr6663854/Test6663854.java rename from test/compiler/c2/6663854/Test6663854.java rename to test/compiler/c2/cr6663854/Test6663854.java --- a/test/compiler/c2/6663854/Test6663854.java +++ b/test/compiler/c2/cr6663854/Test6663854.java @@ -27,9 +27,10 @@ * @bug 6663854 * @summary assert(n != __null,"Bad immediate dominator info.") in C2 with -Xcomp * - * @run main/othervm -Xcomp Test6663854 + * @run main/othervm -Xcomp compiler.c2.cr6663854.Test6663854 */ +package compiler.c2.cr6663854; // This is a randomly generated test that exposed a crash so don't try // to make sense of what's it's doing. The output produced is likely // to be stable but it is not being checked as part of this test. diff --git a/test/compiler/c2/6711117/Test.java b/test/compiler/c2/cr6711117/Test.java rename from test/compiler/c2/6711117/Test.java rename to test/compiler/c2/cr6711117/Test.java --- a/test/compiler/c2/6711117/Test.java +++ b/test/compiler/c2/cr6711117/Test.java @@ -26,9 +26,14 @@ * @test * @bug 6711117 * @summary Assertion in 64bit server vm (flat != TypePtr::BOTTOM,"cannot alias-analyze an untyped ptr") - * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+AggressiveOpts -XX:+UseCompressedOops Test + * + * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+AggressiveOpts + * -XX:+UseCompressedOops + * compiler.c2.cr6711117.Test */ +package compiler.c2.cr6711117; + final class Test_Class_0 { final static char var_1 = 'E'; short var_2 = 16213; diff --git a/test/compiler/c2/6712835/Test6712835.java b/test/compiler/c2/cr6712835/Test6712835.java rename from test/compiler/c2/6712835/Test6712835.java rename to test/compiler/c2/cr6712835/Test6712835.java --- a/test/compiler/c2/6712835/Test6712835.java +++ b/test/compiler/c2/cr6712835/Test6712835.java @@ -25,9 +25,12 @@ * @test * @bug 6712835 * @summary Server compiler fails with assertion (loop_count < K,"infinite loop in PhaseIterGVN::transform") - * @run main/othervm -Xcomp Test6712835 + * + * @run main/othervm -Xcomp compiler.c2.cr6712835.Test6712835 */ +package compiler.c2.cr6712835; + /* Complexity upper bound: 349851 ops */ abstract class Tester_Class_0 { diff --git a/test/compiler/c2/6714694/Tester.java b/test/compiler/c2/cr6714694/Tester.java rename from test/compiler/c2/6714694/Tester.java rename to test/compiler/c2/cr6714694/Tester.java --- a/test/compiler/c2/6714694/Tester.java +++ b/test/compiler/c2/cr6714694/Tester.java @@ -25,9 +25,11 @@ * @test * @bug 6714694 * @summary assertion in 64bit server vm (store->find_edge(load) != -1,"missing precedence edge") with COOPs - * @run main/othervm -Xcomp Tester + * + * @run main/othervm -Xcomp compiler.c2.cr6714694.Tester */ +package compiler.c2.cr6714694; /* Complexity upper bound: 38602 ops */ interface Tester_Interface_0 { diff --git a/test/compiler/c2/6865031/Test.java b/test/compiler/c2/cr6865031/Test.java rename from test/compiler/c2/6865031/Test.java rename to test/compiler/c2/cr6865031/Test.java --- a/test/compiler/c2/6865031/Test.java +++ b/test/compiler/c2/cr6865031/Test.java @@ -26,9 +26,15 @@ * @test * @bug 6865031 * @summary Application gives bad result (throws bad exception) with compressed oops - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:HeapBaseMinAddress=32g -XX:-LoopUnswitching -XX:CompileCommand=inline,AbstractMemoryEfficientList.equals Test hello goodbye + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops + * -XX:HeapBaseMinAddress=32g -XX:-LoopUnswitching + * -XX:CompileCommand=inline,compiler.c2.cr6865031.AbstractMemoryEfficientList::equals + * compiler.c2.cr6865031.Test hello goodbye */ +package compiler.c2.cr6865031; + import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.ArrayList; diff --git a/test/compiler/c2/5091921/Test6890943.java b/test/compiler/c2/cr6890943/Test6890943.java rename from test/compiler/c2/5091921/Test6890943.java rename to test/compiler/c2/cr6890943/Test6890943.java --- a/test/compiler/c2/5091921/Test6890943.java +++ b/test/compiler/c2/cr6890943/Test6890943.java @@ -27,10 +27,13 @@ * @bug 6890943 * @summary JVM mysteriously gives wrong result on 64-bit 1.6 VMs in hotspot mode. * - * @run main/othervm/timeout=240 Test6890943 + * @run main/othervm/timeout=240 compiler.c2.cr6890943.Test6890943 */ -import java.io.*; +package compiler.c2.cr6890943; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.HashMap; diff --git a/test/compiler/c2/5091921/input6890943.txt b/test/compiler/c2/cr6890943/input6890943.txt rename from test/compiler/c2/5091921/input6890943.txt rename to test/compiler/c2/cr6890943/input6890943.txt diff --git a/test/compiler/c2/5091921/output6890943.txt b/test/compiler/c2/cr6890943/output6890943.txt rename from test/compiler/c2/5091921/output6890943.txt rename to test/compiler/c2/cr6890943/output6890943.txt diff --git a/test/compiler/c2/5091921/Test7005594.java b/test/compiler/c2/cr7005594/Test7005594.java rename from test/compiler/c2/5091921/Test7005594.java rename to test/compiler/c2/cr7005594/Test7005594.java --- a/test/compiler/c2/5091921/Test7005594.java +++ b/test/compiler/c2/cr7005594/Test7005594.java @@ -30,6 +30,8 @@ * @run shell Test7005594.sh */ +package compiler.c2.cr7005594; + public class Test7005594 { static int test(byte a[]){ diff --git a/test/compiler/c2/5091921/Test7005594.sh b/test/compiler/c2/cr7005594/Test7005594.sh rename from test/compiler/c2/5091921/Test7005594.sh rename to test/compiler/c2/cr7005594/Test7005594.sh --- a/test/compiler/c2/5091921/Test7005594.sh +++ b/test/compiler/c2/cr7005594/Test7005594.sh @@ -78,7 +78,10 @@ ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test7005594.java -${TESTJAVA}/bin/java ${TESTOPTS} -Xmx1600m -Xms1600m -XX:+IgnoreUnrecognizedVMOptions -XX:-ZapUnusedHeapArea -Xcomp -XX:CompileOnly=Test7005594.test -XX:CompileCommand=quiet Test7005594 > test.out 2>&1 +${TESTJAVA}/bin/java ${TESTOPTS} -Xmx1600m -Xms1600m -XX:+IgnoreUnrecognizedVMOptions \ + -XX:-ZapUnusedHeapArea -Xcomp -XX:CompileCommand=quiet \ + -XX:CompileOnly=compiler.c2.cr7005594.Test7005594::test \ + compiler.c2.cr7005594.Test7005594 > test.out 2>&1 result=$? diff --git a/test/compiler/c2/7192963/TestByteVect.java b/test/compiler/c2/cr7192963/TestByteVect.java rename from test/compiler/c2/7192963/TestByteVect.java rename to test/compiler/c2/cr7192963/TestByteVect.java --- a/test/compiler/c2/7192963/TestByteVect.java +++ b/test/compiler/c2/cr7192963/TestByteVect.java @@ -27,9 +27,11 @@ * @bug 7192963 * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new' * - * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestByteVect + * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr7192963.TestByteVect */ +package compiler.c2.cr7192963; + public class TestByteVect { private static final int ARRLEN = 997; private static final int ITERS = 11000; diff --git a/test/compiler/c2/7192963/TestDoubleVect.java b/test/compiler/c2/cr7192963/TestDoubleVect.java rename from test/compiler/c2/7192963/TestDoubleVect.java rename to test/compiler/c2/cr7192963/TestDoubleVect.java --- a/test/compiler/c2/7192963/TestDoubleVect.java +++ b/test/compiler/c2/cr7192963/TestDoubleVect.java @@ -27,9 +27,11 @@ * @bug 7192963 * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new' * - * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestDoubleVect + * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr7192963.TestDoubleVect */ +package compiler.c2.cr7192963; + public class TestDoubleVect { private static final int ARRLEN = 997; private static final int ITERS = 11000; diff --git a/test/compiler/c2/7192963/TestFloatVect.java b/test/compiler/c2/cr7192963/TestFloatVect.java rename from test/compiler/c2/7192963/TestFloatVect.java rename to test/compiler/c2/cr7192963/TestFloatVect.java --- a/test/compiler/c2/7192963/TestFloatVect.java +++ b/test/compiler/c2/cr7192963/TestFloatVect.java @@ -27,9 +27,11 @@ * @bug 7192963 * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new' * - * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestFloatVect + * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr7192963.TestFloatVect */ +package compiler.c2.cr7192963; + public class TestFloatVect { private static final int ARRLEN = 997; private static final int ITERS = 11000; diff --git a/test/compiler/c2/7192963/TestIntVect.java b/test/compiler/c2/cr7192963/TestIntVect.java rename from test/compiler/c2/7192963/TestIntVect.java rename to test/compiler/c2/cr7192963/TestIntVect.java --- a/test/compiler/c2/7192963/TestIntVect.java +++ b/test/compiler/c2/cr7192963/TestIntVect.java @@ -27,9 +27,11 @@ * @bug 7192963 * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new' * - * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestIntVect + * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr7192963.TestIntVect */ +package compiler.c2.cr7192963; + public class TestIntVect { private static final int ARRLEN = 997; private static final int ITERS = 11000; diff --git a/test/compiler/c2/7192963/TestLongVect.java b/test/compiler/c2/cr7192963/TestLongVect.java rename from test/compiler/c2/7192963/TestLongVect.java rename to test/compiler/c2/cr7192963/TestLongVect.java --- a/test/compiler/c2/7192963/TestLongVect.java +++ b/test/compiler/c2/cr7192963/TestLongVect.java @@ -27,9 +27,11 @@ * @bug 7192963 * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new' * - * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestLongVect + * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr7192963.TestLongVect */ +package compiler.c2.cr7192963; + public class TestLongVect { private static final int ARRLEN = 997; private static final int ITERS = 11000; diff --git a/test/compiler/c2/7192963/TestShortVect.java b/test/compiler/c2/cr7192963/TestShortVect.java rename from test/compiler/c2/7192963/TestShortVect.java rename to test/compiler/c2/cr7192963/TestShortVect.java --- a/test/compiler/c2/7192963/TestShortVect.java +++ b/test/compiler/c2/cr7192963/TestShortVect.java @@ -27,9 +27,11 @@ * @bug 7192963 * @summary assert(_in[req-1] == this) failed: Must pass arg count to 'new' * - * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestShortVect + * @run main/othervm/timeout=400 -Xbatch -Xmx64m compiler.c2.cr7192963.TestShortVect */ +package compiler.c2.cr7192963; + public class TestShortVect { private static final int ARRLEN = 997; private static final int ITERS = 11000; diff --git a/test/compiler/c2/7200264/Test7200264.sh b/test/compiler/c2/cr7200264/Test7200264.sh rename from test/compiler/c2/7200264/Test7200264.sh rename to test/compiler/c2/cr7200264/Test7200264.sh --- a/test/compiler/c2/7200264/Test7200264.sh +++ b/test/compiler/c2/cr7200264/Test7200264.sh @@ -56,7 +56,9 @@ ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} -d . TestIntVect.java # CICompilerCount must be at least 2 with -TieredCompilation -${TESTJAVA}${FS}bin${FS}java ${TESTOPTS} -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=2 -XX:+PrintCompilation -XX:+TraceNewVectors TestIntVect > test.out 2>&1 +${TESTJAVA}${FS}bin${FS}java ${TESTOPTS} -Xbatch -XX:-TieredCompilation \ + -XX:CICompilerCount=2 -XX:+PrintCompilation -XX:+TraceNewVectors \ + compiler.c2.cr7200264.TestIntVect > test.out 2>&1 COUNT=`grep AddVI test.out | wc -l | awk '{print $1}'` if [ $COUNT -lt 4 ] diff --git a/test/compiler/c2/7200264/TestIntVect.java b/test/compiler/c2/cr7200264/TestIntVect.java rename from test/compiler/c2/7200264/TestIntVect.java rename to test/compiler/c2/cr7200264/TestIntVect.java --- a/test/compiler/c2/7200264/TestIntVect.java +++ b/test/compiler/c2/cr7200264/TestIntVect.java @@ -30,6 +30,7 @@ * @run shell Test7200264.sh */ +package compiler.c2.cr7200264; /* * Copy of test/compiler/6340864/TestIntVect.java without performance tests. */ diff --git a/test/compiler/c2/8004867/TestIntAtomicCAS.java b/test/compiler/c2/cr8004867/TestIntAtomicCAS.java rename from test/compiler/c2/8004867/TestIntAtomicCAS.java rename to test/compiler/c2/cr8004867/TestIntAtomicCAS.java --- a/test/compiler/c2/8004867/TestIntAtomicCAS.java +++ b/test/compiler/c2/cr8004867/TestIntAtomicCAS.java @@ -27,10 +27,16 @@ * @bug 8004867 * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob" * - * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntAtomicCAS - * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntAtomicCAS + * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:-OptimizeFill + * compiler.c2.cr8004867.TestIntAtomicCAS + * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:+OptimizeFill + * compiler.c2.cr8004867.TestIntAtomicCAS */ +package compiler.c2.cr8004867; + import java.util.concurrent.atomic.AtomicIntegerArray; public class TestIntAtomicCAS { diff --git a/test/compiler/c2/8004867/TestIntAtomicOrdered.java b/test/compiler/c2/cr8004867/TestIntAtomicOrdered.java rename from test/compiler/c2/8004867/TestIntAtomicOrdered.java rename to test/compiler/c2/cr8004867/TestIntAtomicOrdered.java --- a/test/compiler/c2/8004867/TestIntAtomicOrdered.java +++ b/test/compiler/c2/cr8004867/TestIntAtomicOrdered.java @@ -27,10 +27,16 @@ * @bug 8004867 * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob" * - * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntAtomicOrdered - * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntAtomicOrdered + * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:-OptimizeFill + * compiler.c2.cr8004867.TestIntAtomicOrdered + * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:+OptimizeFill + * compiler.c2.cr8004867.TestIntAtomicOrdered */ +package compiler.c2.cr8004867; + import java.util.concurrent.atomic.AtomicIntegerArray; public class TestIntAtomicOrdered { diff --git a/test/compiler/c2/8004867/TestIntAtomicVolatile.java b/test/compiler/c2/cr8004867/TestIntAtomicVolatile.java rename from test/compiler/c2/8004867/TestIntAtomicVolatile.java rename to test/compiler/c2/cr8004867/TestIntAtomicVolatile.java --- a/test/compiler/c2/8004867/TestIntAtomicVolatile.java +++ b/test/compiler/c2/cr8004867/TestIntAtomicVolatile.java @@ -27,10 +27,16 @@ * @bug 8004867 * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob" * - * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntAtomicVolatile - * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntAtomicVolatile + * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:-OptimizeFill + * compiler.c2.cr8004867.TestIntAtomicVolatile + * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:+OptimizeFill + * compiler.c2.cr8004867.TestIntAtomicVolatile */ +package compiler.c2.cr8004867; + import java.util.concurrent.atomic.AtomicIntegerArray; public class TestIntAtomicVolatile { diff --git a/test/compiler/c2/8004867/TestIntUnsafeCAS.java b/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java rename from test/compiler/c2/8004867/TestIntUnsafeCAS.java rename to test/compiler/c2/cr8004867/TestIntUnsafeCAS.java --- a/test/compiler/c2/8004867/TestIntUnsafeCAS.java +++ b/test/compiler/c2/cr8004867/TestIntUnsafeCAS.java @@ -26,14 +26,21 @@ * @test * @bug 8004867 * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob" + * @modules java.base/jdk.internal.misc * - * @modules java.base/jdk.internal.misc - * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntUnsafeCAS - * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntUnsafeCAS + * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:-OptimizeFill + * compiler.c2.cr8004867.TestIntUnsafeCAS + * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:+OptimizeFill + * compiler.c2.cr8004867.TestIntUnsafeCAS */ +package compiler.c2.cr8004867; + import jdk.internal.misc.Unsafe; -import java.lang.reflect.*; + +import java.lang.reflect.Field; public class TestIntUnsafeCAS { private static final int ARRLEN = 97; diff --git a/test/compiler/c2/8004867/TestIntUnsafeOrdered.java b/test/compiler/c2/cr8004867/TestIntUnsafeOrdered.java rename from test/compiler/c2/8004867/TestIntUnsafeOrdered.java rename to test/compiler/c2/cr8004867/TestIntUnsafeOrdered.java --- a/test/compiler/c2/8004867/TestIntUnsafeOrdered.java +++ b/test/compiler/c2/cr8004867/TestIntUnsafeOrdered.java @@ -26,13 +26,20 @@ * @test * @bug 8004867 * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob" + * @modules java.base/jdk.internal.misc * - * @modules java.base/jdk.internal.misc - * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntUnsafeOrdered - * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntUnsafeOrdered + * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:-OptimizeFill + * compiler.c2.cr8004867.TestIntUnsafeOrdered + * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:+OptimizeFill + * compiler.c2.cr8004867.TestIntUnsafeOrdered */ +package compiler.c2.cr8004867; + import jdk.internal.misc.Unsafe; + import java.lang.reflect.Field; public class TestIntUnsafeOrdered { diff --git a/test/compiler/c2/8004867/TestIntUnsafeVolatile.java b/test/compiler/c2/cr8004867/TestIntUnsafeVolatile.java rename from test/compiler/c2/8004867/TestIntUnsafeVolatile.java rename to test/compiler/c2/cr8004867/TestIntUnsafeVolatile.java --- a/test/compiler/c2/8004867/TestIntUnsafeVolatile.java +++ b/test/compiler/c2/cr8004867/TestIntUnsafeVolatile.java @@ -26,14 +26,21 @@ * @test * @bug 8004867 * @summary VM crashing with assert "share/vm/opto/node.hpp:357 - assert(i < _max) failed: oob" + * @modules java.base/jdk.internal.misc * - * @modules java.base/jdk.internal.misc - * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestIntUnsafeVolatile - * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+OptimizeFill TestIntUnsafeVolatile + * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:-OptimizeFill + * compiler.c2.cr8004867.TestIntUnsafeVolatile + * @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:+OptimizeFill + * compiler.c2.cr8004867.TestIntUnsafeVolatile */ +package compiler.c2.cr8004867; + import jdk.internal.misc.Unsafe; -import java.lang.reflect.*; + +import java.lang.reflect.Field; public class TestIntUnsafeVolatile { private static final int ARRLEN = 97; diff --git a/test/compiler/c2/7070134/Stemmer.java b/test/compiler/c2/stemmer/Stemmer.java rename from test/compiler/c2/7070134/Stemmer.java rename to test/compiler/c2/stemmer/Stemmer.java --- a/test/compiler/c2/7070134/Stemmer.java +++ b/test/compiler/c2/stemmer/Stemmer.java @@ -4,8 +4,9 @@ * @summary Hotspot crashes with sigsegv from PorterStemmer * @modules java.base/jdk.internal.misc * @library /testlibrary + * * @run driver jdk.test.lib.FileInstaller words words - * @run main/othervm -Xbatch Stemmer words + * @run main/othervm -Xbatch compiler.c2.stemmer.Stemmer words */ /* @@ -53,7 +54,11 @@ */ -import java.io.*; +package compiler.c2.stemmer; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; /** * Stemmer, implementing the Porter Stemming Algorithm diff --git a/test/compiler/c2/7070134/words b/test/compiler/c2/stemmer/words rename from test/compiler/c2/7070134/words rename to test/compiler/c2/stemmer/words diff --git a/test/compiler/native/TestDirtyInt.java b/test/compiler/calls/TestDirtyInt.java rename from test/compiler/native/TestDirtyInt.java rename to test/compiler/calls/TestDirtyInt.java --- a/test/compiler/native/TestDirtyInt.java +++ b/test/compiler/calls/TestDirtyInt.java @@ -22,8 +22,12 @@ */ /* @test - * @run main/native TestDirtyInt + + * @run main/native compiler.calls.TestDirtyInt */ + +package compiler.calls; + public class TestDirtyInt { static { System.loadLibrary("TestDirtyInt"); diff --git a/test/compiler/calls/common/CallsBase.java b/test/compiler/calls/common/CallsBase.java --- a/test/compiler/calls/common/CallsBase.java +++ b/test/compiler/calls/common/CallsBase.java @@ -24,10 +24,11 @@ package compiler.calls.common; import compiler.testlibrary.CompilerUtils; +import jdk.test.lib.Asserts; +import sun.hotspot.WhiteBox; + import java.lang.reflect.Method; import java.util.Arrays; -import jdk.test.lib.Asserts; -import sun.hotspot.WhiteBox; /** * A common class for Invoke* classes diff --git a/test/compiler/calls/common/InvokeDynamicPatcher.java b/test/compiler/calls/common/InvokeDynamicPatcher.java --- a/test/compiler/calls/common/InvokeDynamicPatcher.java +++ b/test/compiler/calls/common/InvokeDynamicPatcher.java @@ -23,6 +23,14 @@ package compiler.calls.common; +import jdk.internal.org.objectweb.asm.ClassReader; +import jdk.internal.org.objectweb.asm.ClassVisitor; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.Handle; +import jdk.internal.org.objectweb.asm.Label; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.org.objectweb.asm.Opcodes; + import java.io.FileInputStream; import java.io.IOException; import java.lang.invoke.CallSite; @@ -33,13 +41,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; -import jdk.internal.org.objectweb.asm.ClassReader; -import jdk.internal.org.objectweb.asm.ClassVisitor; -import jdk.internal.org.objectweb.asm.ClassWriter; -import jdk.internal.org.objectweb.asm.Handle; -import jdk.internal.org.objectweb.asm.Label; -import jdk.internal.org.objectweb.asm.MethodVisitor; -import jdk.internal.org.objectweb.asm.Opcodes; /** * A class which patch InvokeDynamic class bytecode with invokydynamic diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java @@ -23,11 +23,13 @@ /* * @test + * @summary check calls from compiled to compiled using InvokeDynamic * @library /test/lib /testlibrary / * @modules java.base/jdk.internal.misc - * @modules java.base/jdk.internal.org.objectweb.asm + * java.base/jdk.internal.org.objectweb.asm + * * @build compiler.calls.common.InvokeDynamic - * @build compiler.calls.common.InvokeDynamicPatcher + * compiler.calls.common.InvokeDynamicPatcher * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -43,5 +45,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeDynamic * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 - * @summary check calls from compiled to compiled using InvokeDynamic */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java @@ -23,9 +23,11 @@ /* * @test + * @summary check calls from compiled to interpreted using InvokeDynamic * @library /test/lib /testlibrary / * @modules java.base/jdk.internal.misc - * @modules java.base/jdk.internal.org.objectweb.asm + * java.base/jdk.internal.org.objectweb.asm + * * @build compiler.calls.common.InvokeDynamic * @build compiler.calls.common.InvokeDynamicPatcher * @run main compiler.calls.common.InvokeDynamicPatcher @@ -37,5 +39,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 - * @summary check calls from compiled to interpreted using InvokeDynamic */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java @@ -23,11 +23,13 @@ /* * @test + * @summary check calls from compiled to native using InvokeDynamic * @library /test/lib /testlibrary / * @modules java.base/jdk.internal.misc - * @modules java.base/jdk.internal.org.objectweb.asm + * java.base/jdk.internal.org.objectweb.asm + * * @build compiler.calls.common.InvokeDynamic - * @build compiler.calls.common.InvokeDynamicPatcher + * compiler.calls.common.InvokeDynamicPatcher * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -37,5 +39,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeDynamic * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee - * @summary check calls from compiled to native using InvokeDynamic */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java @@ -24,7 +24,9 @@ /* * @test * @modules java.base/jdk.internal.misc + * @summary check calls from compiled to compiled using InvokeInterface * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeInterface * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -40,5 +42,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeInterface * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 - * @summary check calls from compiled to compiled using InvokeInterface */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from compiled to interpreted using InvokeInterface * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeInterface * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 - * @summary check calls from compiled to interpreted using InvokeInterface */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from compiled to native using InvokeInterface * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeInterface * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeInterface * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee - * @summary check calls from compiled to native using InvokeInterface */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from compiled to compiled using InvokeSpecial * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeSpecial * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -40,5 +42,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeSpecial * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 - * @summary check calls from compiled to compiled using InvokeSpecial */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from compiled to interpreted using InvokeSpecial * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeSpecial * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 - * @summary check calls from compiled to interpreted using InvokeSpecial */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from compiled to native using InvokeSpecial * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeSpecial * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeSpecial * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee - * @summary check calls from compiled to native using InvokeSpecial */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from compiled to compiled using InvokeStatic * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeStatic * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -40,5 +42,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeStatic * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 - * @summary check calls from compiled to compiled using InvokeStatic */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from compiled to interpreted using InvokeStatic * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeStatic * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 - * @summary check calls from compiled to interpreted using InvokeStatic */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from compiled to native using InvokeStatic * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeStatic * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeStatic * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee - * @summary check calls from compiled to native using InvokeStatic */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from compiled to compiled using InvokeVirtual * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeVirtual * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -40,5 +42,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeVirtual * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 - * @summary check calls from compiled to compiled using InvokeVirtual */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from compiled to interpreted using InvokeVirtual * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeVirtual * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 - * @summary check calls from compiled to interpreted using InvokeVirtual */ diff --git a/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java b/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java --- a/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java +++ b/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from compiled to native using InvokeVirtual * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeVirtual * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeVirtual * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee - * @summary check calls from compiled to native using InvokeVirtual */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java @@ -23,11 +23,13 @@ /* * @test + * @summary check calls from interpreted to compiled using InvokeDynamic * @library /test/lib /testlibrary / * @modules java.base/jdk.internal.misc - * @modules java.base/jdk.internal.org.objectweb.asm + * java.base/jdk.internal.org.objectweb.asm + * * @build compiler.calls.common.InvokeDynamic - * @build compiler.calls.common.InvokeDynamicPatcher + * compiler.calls.common.InvokeDynamicPatcher * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -37,5 +39,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -Xbatch compiler.calls.common.InvokeDynamic * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 - * @summary check calls from interpreted to compiled using InvokeDynamic */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java @@ -23,16 +23,17 @@ /* * @test + * @summary check calls from interpreted to interpreted using InvokeDynamic * @library /test/lib /testlibrary / * @modules java.base/jdk.internal.misc - * @modules java.base/jdk.internal.org.objectweb.asm + * java.base/jdk.internal.org.objectweb.asm + * * @build compiler.calls.common.InvokeDynamic - * @build compiler.calls.common.InvokeDynamicPatcher + * compiler.calls.common.InvokeDynamicPatcher * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 - * @summary check calls from interpreted to interpreted using InvokeDynamic */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java @@ -23,16 +23,17 @@ /* * @test + * @summary check calls from interpreted to native using InvokeDynamic * @library /test/lib /testlibrary / * @modules java.base/jdk.internal.misc - * @modules java.base/jdk.internal.org.objectweb.asm + * java.base/jdk.internal.org.objectweb.asm + * * @build compiler.calls.common.InvokeDynamic - * @build compiler.calls.common.InvokeDynamicPatcher + * compiler.calls.common.InvokeDynamicPatcher * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller compiler.calls.common.InvokeDynamic * -checkCallerCompileLevel 0 -nativeCallee - * @summary check calls from interpreted to native using InvokeDynamic */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from interpreted to compiled using InvokeInterface * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeInterface * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -Xbatch compiler.calls.common.InvokeInterface * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 - * @summary check calls from interpreted to compiled using InvokeInterface */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from interpreted to interpreted using InvokeInterface * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeInterface * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 - * @summary check calls from interpreted to interpreted using InvokeInterface */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from interpreted to native using InvokeInterface * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeInterface * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller compiler.calls.common.InvokeInterface * -checkCallerCompileLevel 0 -nativeCallee - * @summary check calls from interpreted to native using InvokeInterface */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from interpreted to interpreted using InvokeSpecial * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeSpecial * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 - * @summary check calls from interpreted to interpreted using InvokeSpecial */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from interpreted to native using InvokeSpecial * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeSpecial * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller compiler.calls.common.InvokeSpecial * -checkCallerCompileLevel 0 -nativeCallee - * @summary check calls from interpreted to native using InvokeSpecial */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from interpreted to compiled using InvokeStatic * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeStatic * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -Xbatch compiler.calls.common.InvokeStatic * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 - * @summary check calls from interpreted to compiled using InvokeStatic */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from interpreted to interpreted using InvokeStatic * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeStatic * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 - * @summary check calls from interpreted to interpreted using InvokeStatic */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from interpreted to native using InvokeStatic * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeStatic * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller compiler.calls.common.InvokeStatic * -checkCallerCompileLevel 0 -nativeCallee - * @summary check calls from interpreted to native using InvokeStatic */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from interpreted to compiled using InvokeVirtual * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeVirtual * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -Xbatch compiler.calls.common.InvokeVirtual * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 - * @summary check calls from interpreted to compiled using InvokeVirtual */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from interpreted to interpreted using InvokeVirtual * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeVirtual * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 - * @summary check calls from interpreted to interpreted using InvokeVirtual */ diff --git a/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java b/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java --- a/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java +++ b/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from interpreted to native using InvokeVirtual * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeVirtual * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller compiler.calls.common.InvokeVirtual * -checkCallerCompileLevel 0 -nativeCallee - * @summary check calls from interpreted to native using InvokeVirtual */ diff --git a/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java b/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java --- a/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java +++ b/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from native to compiled using InvokeSpecial * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeSpecial * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeSpecial * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4 - * @summary check calls from native to compiled using InvokeSpecial */ diff --git a/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java b/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java --- a/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java +++ b/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from native to interpreted using InvokeSpecial * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeSpecial * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial * -nativeCaller -checkCalleeCompileLevel 0 - * @summary check calls from native to interpreted using InvokeSpecial */ diff --git a/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java b/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java --- a/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java +++ b/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from native to native using InvokeSpecial * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeSpecial * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * compiler.calls.common.InvokeSpecial * -nativeCaller -nativeCallee - * @summary check calls from native to native using InvokeSpecial */ diff --git a/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java b/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java --- a/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java +++ b/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from native to compiled using InvokeStatic * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeStatic * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeStatic * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4 - * @summary check calls from native to compiled using InvokeStatic */ diff --git a/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java b/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java --- a/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java +++ b/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from native to interpreted using InvokeStatic * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeStatic * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic * -nativeCaller -checkCalleeCompileLevel 0 - * @summary check calls from native to interpreted using InvokeStatic */ diff --git a/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java b/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java --- a/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java +++ b/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from native to native using InvokeStatic * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeStatic * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * compiler.calls.common.InvokeStatic * -nativeCaller -nativeCallee - * @summary check calls from native to native using InvokeStatic */ diff --git a/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java b/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java --- a/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java +++ b/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java @@ -23,8 +23,10 @@ /* * @test + * @summary check calls from native to compiled using InvokeVirtual * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeVirtual * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -34,5 +36,4 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeVirtual * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4 - * @summary check calls from native to compiled using InvokeVirtual */ diff --git a/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java b/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java --- a/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java +++ b/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from native to interpreted using InvokeVirtual * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / * @build compiler.calls.common.InvokeVirtual + * * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual * -nativeCaller -checkCalleeCompileLevel 0 - * @summary check calls from native to interpreted using InvokeVirtual */ diff --git a/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java b/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java --- a/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java +++ b/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java @@ -23,13 +23,14 @@ /* * @test + * @summary check calls from native to native using InvokeVirtual * @modules java.base/jdk.internal.misc * @library /test/lib /testlibrary / + * * @build compiler.calls.common.InvokeVirtual * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * compiler.calls.common.InvokeVirtual * -nativeCaller -nativeCallee - * @summary check calls from native to native using InvokeVirtual */ diff --git a/test/compiler/native/libTestDirtyInt.c b/test/compiler/calls/libTestDirtyInt.c rename from test/compiler/native/libTestDirtyInt.c rename to test/compiler/calls/libTestDirtyInt.c --- a/test/compiler/native/libTestDirtyInt.c +++ b/test/compiler/calls/libTestDirtyInt.c @@ -26,7 +26,7 @@ static int array = 0x42; -JNIEXPORT jint JNICALL Java_TestDirtyInt_test(JNIEnv* env, jclass jclazz, jint v) +JNIEXPORT jint JNICALL Java_compiler_calls_TestDirtyInt_test(JNIEnv* env, jclass jclazz, jint v) { int* ptr = &array + v + 4; return *ptr; diff --git a/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java b/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java --- a/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java +++ b/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java @@ -21,26 +21,28 @@ * questions. */ +/* + * @test TestAnonymousClassUnloading + * @bug 8054402 + * @summary "Tests unloading of anonymous classes." + * @library /testlibrary /test/lib / + * @modules java.base/jdk.internal.misc + * + * @run main/othervm/bootclasspath -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:-BackgroundCompilation + * compiler.classUnloading.anonymousClass.TestAnonymousClassUnloading + */ + +package compiler.classUnloading.anonymousClass; + +import jdk.internal.misc.Unsafe; import sun.hotspot.WhiteBox; -import jdk.internal.misc.Unsafe; import java.io.IOException; import java.lang.reflect.Method; import java.net.URL; import java.net.URLConnection; -/* - * @test TestAnonymousClassUnloading - * @bug 8054402 - * @summary "Tests unloading of anonymous classes." - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * @compile TestAnonymousClassUnloading.java - * @run main ClassFileInstaller TestAnonymousClassUnloading - * sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-BackgroundCompilation TestAnonymousClassUnloading - */ public class TestAnonymousClassUnloading { private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); private static final Unsafe UNSAFE = Unsafe.getUnsafe(); @@ -107,7 +109,8 @@ */ static public void main(String[] args) throws Exception { // (1) Load an anonymous version of this class using the corresponding Unsafe method - URL classUrl = TestAnonymousClassUnloading.class.getResource("TestAnonymousClassUnloading.class"); + URL classUrl = TestAnonymousClassUnloading.class.getResource( + TestAnonymousClassUnloading.class.getName().replace('.', '/') + ".class"); URLConnection connection = classUrl.openConnection(); int length = connection.getContentLength(); diff --git a/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java b/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java --- a/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java +++ b/test/compiler/classUnloading/methodUnloading/TestMethodUnloading.java @@ -21,26 +21,34 @@ * questions. */ +/* + * @test MethodUnloadingTest + * @bug 8029443 + * @summary Tests the unloading of methods to to class unloading + * @modules java.base/jdk.internal.misc + * @library /testlibrary /test/lib / + * + * @build compiler.classUnloading.methodUnloading.TestMethodUnloading + * compiler.classUnloading.methodUnloading.WorkerClass + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:-BackgroundCompilation -XX:-UseCompressedOops + * -XX:CompileCommand=compileonly,compiler.classUnloading.methodUnloading.TestMethodUnloading::doWork + * compiler.classUnloading.methodUnloading.TestMethodUnloading + */ + +package compiler.classUnloading.methodUnloading; + import sun.hotspot.WhiteBox; import java.lang.reflect.Method; import java.net.URL; import java.net.URLClassLoader; -/* - * @test MethodUnloadingTest - * @bug 8029443 - * @summary "Tests the unloading of methods to to class unloading" - * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build TestMethodUnloading - * @build WorkerClass - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-BackgroundCompilation -XX:-UseCompressedOops -XX:CompileOnly=TestMethodUnloading::doWork TestMethodUnloading - */ public class TestMethodUnloading { - private static final String workerClassName = "WorkerClass"; + private static final String workerClassName = "compiler.classUnloading.methodUnloading.WorkerClass"; private static int work = -1; private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); diff --git a/test/compiler/classUnloading/methodUnloading/WorkerClass.java b/test/compiler/classUnloading/methodUnloading/WorkerClass.java --- a/test/compiler/classUnloading/methodUnloading/WorkerClass.java +++ b/test/compiler/classUnloading/methodUnloading/WorkerClass.java @@ -24,6 +24,9 @@ /** * Worker class that is dynamically loaded/unloaded by TestMethodUnloading. */ + +package compiler.classUnloading.methodUnloading; + public class WorkerClass { /** * We override hashCode here to be able to access this implementation diff --git a/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java b/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java --- a/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java +++ b/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java @@ -27,29 +27,34 @@ * @summary Test checks that the order in which ReversedCodeCacheSize and * InitialCodeCacheSize are passed to the VM is irrelevant. * @library /testlibrary - * * @modules java.base/jdk.internal.misc * java.management + * + * @run driver compiler.codecache.CheckReservedInitialCodeCacheSizeArgOrder */ -import jdk.test.lib.*; + +package compiler.codecache; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; public class CheckReservedInitialCodeCacheSizeArgOrder { - public static void main(String[] args) throws Exception { - ProcessBuilder pb1, pb2; - OutputAnalyzer out1, out2; + public static void main(String[] args) throws Exception { + ProcessBuilder pb1, pb2; + OutputAnalyzer out1, out2; - pb1 = ProcessTools.createJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version"); - pb2 = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version"); + pb1 = ProcessTools.createJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version"); + pb2 = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version"); - out1 = new OutputAnalyzer(pb1.start()); - out2 = new OutputAnalyzer(pb2.start()); + out1 = new OutputAnalyzer(pb1.start()); + out2 = new OutputAnalyzer(pb2.start()); - // Check that the outputs are equal - if (out1.getStdout().compareTo(out2.getStdout()) != 0) { - throw new RuntimeException("Test failed"); + // Check that the outputs are equal + if (out1.getStdout().compareTo(out2.getStdout()) != 0) { + throw new RuntimeException("Test failed"); + } + + out1.shouldHaveExitValue(0); + out2.shouldHaveExitValue(0); } - - out1.shouldHaveExitValue(0); - out2.shouldHaveExitValue(0); - } } diff --git a/test/compiler/codecache/CheckSegmentedCodeCache.java b/test/compiler/codecache/CheckSegmentedCodeCache.java --- a/test/compiler/codecache/CheckSegmentedCodeCache.java +++ b/test/compiler/codecache/CheckSegmentedCodeCache.java @@ -21,131 +21,139 @@ * questions. */ -import jdk.test.lib.*; -import sun.hotspot.WhiteBox; - /* * @test CheckSegmentedCodeCache * @bug 8015774 + * @summary Checks VM options related to the segmented code cache * @library /testlibrary /test/lib - * @summary "Checks VM options related to the segmented code cache" * @modules java.base/jdk.internal.misc * java.management - * @build CheckSegmentedCodeCache - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI CheckSegmentedCodeCache + * + * @build compiler.codecache.CheckSegmentedCodeCache + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * compiler.codecache.CheckSegmentedCodeCache */ + +package compiler.codecache; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.Platform; +import jdk.test.lib.ProcessTools; +import sun.hotspot.WhiteBox; + public class CheckSegmentedCodeCache { - private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); - // Code heap names - private static final String NON_METHOD = "CodeHeap 'non-nmethods'"; - private static final String PROFILED = "CodeHeap 'profiled nmethods'"; - private static final String NON_PROFILED = "CodeHeap 'non-profiled nmethods'"; + private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); + // Code heap names + private static final String NON_METHOD = "CodeHeap 'non-nmethods'"; + private static final String PROFILED = "CodeHeap 'profiled nmethods'"; + private static final String NON_PROFILED = "CodeHeap 'non-profiled nmethods'"; - private static void verifySegmentedCodeCache(ProcessBuilder pb, boolean enabled) throws Exception { - OutputAnalyzer out = new OutputAnalyzer(pb.start()); - out.shouldHaveExitValue(0); - if (enabled) { - try { - // Non-nmethod code heap should be always available with the segmented code cache - out.shouldContain(NON_METHOD); - } catch (RuntimeException e) { - // Check if TieredCompilation is disabled (in a client VM) - if(!out.getOutput().contains("-XX:+TieredCompilation not supported in this VM")) { - // Code cache is not segmented - throw new RuntimeException("No code cache segmentation."); + private static void verifySegmentedCodeCache(ProcessBuilder pb, boolean enabled) throws Exception { + OutputAnalyzer out = new OutputAnalyzer(pb.start()); + out.shouldHaveExitValue(0); + if (enabled) { + try { + // Non-nmethod code heap should be always available with the segmented code cache + out.shouldContain(NON_METHOD); + } catch (RuntimeException e) { + // Check if TieredCompilation is disabled (in a client VM) + if(!out.getOutput().contains("-XX:+TieredCompilation not supported in this VM")) { + // Code cache is not segmented + throw new RuntimeException("No code cache segmentation."); + } + } + } else { + out.shouldNotContain(NON_METHOD); } - } - } else { - out.shouldNotContain(NON_METHOD); } - } - private static void verifyCodeHeapNotExists(ProcessBuilder pb, String... heapNames) throws Exception { - OutputAnalyzer out = new OutputAnalyzer(pb.start()); - out.shouldHaveExitValue(0); - for (String name : heapNames) { - out.shouldNotContain(name); + private static void verifyCodeHeapNotExists(ProcessBuilder pb, String... heapNames) throws Exception { + OutputAnalyzer out = new OutputAnalyzer(pb.start()); + out.shouldHaveExitValue(0); + for (String name : heapNames) { + out.shouldNotContain(name); + } } - } - private static void failsWith(ProcessBuilder pb, String message) throws Exception { - OutputAnalyzer out = new OutputAnalyzer(pb.start()); - out.shouldContain(message); - out.shouldHaveExitValue(1); - } + private static void failsWith(ProcessBuilder pb, String message) throws Exception { + OutputAnalyzer out = new OutputAnalyzer(pb.start()); + out.shouldContain(message); + out.shouldHaveExitValue(1); + } - /** - * Check the result of segmented code cache related VM options. - */ - public static void main(String[] args) throws Exception { - ProcessBuilder pb; + /** + * Check the result of segmented code cache related VM options. + */ + public static void main(String[] args) throws Exception { + ProcessBuilder pb; - // Disabled with ReservedCodeCacheSize < 240MB - pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=239m", - "-XX:+PrintCodeCache", "-version"); - verifySegmentedCodeCache(pb, false); + // Disabled with ReservedCodeCacheSize < 240MB + pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=239m", + "-XX:+PrintCodeCache", "-version"); + verifySegmentedCodeCache(pb, false); - // Disabled without TieredCompilation - pb = ProcessTools.createJavaProcessBuilder("-XX:-TieredCompilation", - "-XX:+PrintCodeCache", "-version"); - verifySegmentedCodeCache(pb, false); + // Disabled without TieredCompilation + pb = ProcessTools.createJavaProcessBuilder("-XX:-TieredCompilation", + "-XX:+PrintCodeCache", "-version"); + verifySegmentedCodeCache(pb, false); - // Enabled with TieredCompilation and ReservedCodeCacheSize >= 240MB - pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation", - "-XX:ReservedCodeCacheSize=240m", - "-XX:+PrintCodeCache", "-version"); - verifySegmentedCodeCache(pb, true); - pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation", - "-XX:ReservedCodeCacheSize=400m", - "-XX:+PrintCodeCache", "-version"); - verifySegmentedCodeCache(pb, true); + // Enabled with TieredCompilation and ReservedCodeCacheSize >= 240MB + pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation", + "-XX:ReservedCodeCacheSize=240m", + "-XX:+PrintCodeCache", "-version"); + verifySegmentedCodeCache(pb, true); + pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation", + "-XX:ReservedCodeCacheSize=400m", + "-XX:+PrintCodeCache", "-version"); + verifySegmentedCodeCache(pb, true); - // Always enabled if SegmentedCodeCache is set - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:-TieredCompilation", - "-XX:ReservedCodeCacheSize=239m", - "-XX:+PrintCodeCache", "-version"); - verifySegmentedCodeCache(pb, true); + // Always enabled if SegmentedCodeCache is set + pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:-TieredCompilation", + "-XX:ReservedCodeCacheSize=239m", + "-XX:+PrintCodeCache", "-version"); + verifySegmentedCodeCache(pb, true); - // The profiled and non-profiled code heaps should not be available in - // interpreter-only mode - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-Xint", - "-XX:+PrintCodeCache", "-version"); - verifyCodeHeapNotExists(pb, PROFILED, NON_PROFILED); + // The profiled and non-profiled code heaps should not be available in + // interpreter-only mode + pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-Xint", + "-XX:+PrintCodeCache", "-version"); + verifyCodeHeapNotExists(pb, PROFILED, NON_PROFILED); - // If we stop compilation at CompLevel_none or CompLevel_simple we - // don't need a profiled code heap. - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:TieredStopAtLevel=0", - "-XX:+PrintCodeCache", "-version"); - verifyCodeHeapNotExists(pb, PROFILED); - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:TieredStopAtLevel=1", - "-XX:+PrintCodeCache", "-version"); - verifyCodeHeapNotExists(pb, PROFILED); + // If we stop compilation at CompLevel_none or CompLevel_simple we + // don't need a profiled code heap. + pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:TieredStopAtLevel=0", + "-XX:+PrintCodeCache", "-version"); + verifyCodeHeapNotExists(pb, PROFILED); + pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:TieredStopAtLevel=1", + "-XX:+PrintCodeCache", "-version"); + verifyCodeHeapNotExists(pb, PROFILED); - // Fails with too small non-nmethod code heap size - pb = ProcessTools.createJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K"); - failsWith(pb, "Invalid NonNMethodCodeHeapSize"); + // Fails with too small non-nmethod code heap size + pb = ProcessTools.createJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K"); + failsWith(pb, "Invalid NonNMethodCodeHeapSize"); - // Fails if code heap sizes do not add up - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:ReservedCodeCacheSize=10M", - "-XX:NonNMethodCodeHeapSize=5M", - "-XX:ProfiledCodeHeapSize=5M", - "-XX:NonProfiledCodeHeapSize=5M"); - failsWith(pb, "Invalid code heap sizes"); + // Fails if code heap sizes do not add up + pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:ReservedCodeCacheSize=10M", + "-XX:NonNMethodCodeHeapSize=5M", + "-XX:ProfiledCodeHeapSize=5M", + "-XX:NonProfiledCodeHeapSize=5M"); + failsWith(pb, "Invalid code heap sizes"); - // Fails if not enough space for VM internal code - long minUseSpace = WHITE_BOX.getUintxVMFlag("CodeCacheMinimumUseSpace"); - // minimum size: CodeCacheMinimumUseSpace DEBUG_ONLY(* 3) - long minSize = (Platform.isDebugBuild() ? 3 : 1) * minUseSpace; - pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", - "-XX:ReservedCodeCacheSize=" + minSize, - "-XX:InitialCodeCacheSize=100K"); - failsWith(pb, "Not enough space in non-nmethod code heap to run VM"); - } + // Fails if not enough space for VM internal code + long minUseSpace = WHITE_BOX.getUintxVMFlag("CodeCacheMinimumUseSpace"); + // minimum size: CodeCacheMinimumUseSpace DEBUG_ONLY(* 3) + long minSize = (Platform.isDebugBuild() ? 3 : 1) * minUseSpace; + pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", + "-XX:ReservedCodeCacheSize=" + minSize, + "-XX:InitialCodeCacheSize=100K"); + failsWith(pb, "Not enough space in non-nmethod code heap to run VM"); + } } diff --git a/test/compiler/codecache/CheckUpperLimit.java b/test/compiler/codecache/CheckUpperLimit.java --- a/test/compiler/codecache/CheckUpperLimit.java +++ b/test/compiler/codecache/CheckUpperLimit.java @@ -26,20 +26,25 @@ * @bug 8015635 * @summary Test ensures that the ReservedCodeCacheSize is at most MAXINT * @library /testlibrary - * * @modules java.base/jdk.internal.misc * java.management + * + * @run driver compiler.codecache.CheckUpperLimit */ -import jdk.test.lib.*; + +package compiler.codecache; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; public class CheckUpperLimit { - public static void main(String[] args) throws Exception { - ProcessBuilder pb; - OutputAnalyzer out; + public static void main(String[] args) throws Exception { + ProcessBuilder pb; + OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version"); - out = new OutputAnalyzer(pb.start()); - out.shouldContain("Invalid ReservedCodeCacheSize="); - out.shouldHaveExitValue(1); - } + pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version"); + out = new OutputAnalyzer(pb.start()); + out.shouldContain("Invalid ReservedCodeCacheSize="); + out.shouldHaveExitValue(1); + } } diff --git a/test/compiler/codecache/OverflowCodeCacheTest.java b/test/compiler/codecache/OverflowCodeCacheTest.java --- a/test/compiler/codecache/OverflowCodeCacheTest.java +++ b/test/compiler/codecache/OverflowCodeCacheTest.java @@ -22,32 +22,38 @@ * */ -import java.lang.management.MemoryPoolMXBean; -import java.util.EnumSet; -import java.util.ArrayList; +/* + * @test OverflowCodeCacheTest + * @bug 8059550 + * @summary testing of code cache segments overflow + * @library /testlibrary /test/lib + * @modules java.base/jdk.internal.misc + * java.management + * + * @build compiler.codecache.OverflowCodeCacheTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:-SegmentedCodeCache + * compiler.codecache.OverflowCodeCacheTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:+SegmentedCodeCache + * compiler.codecache.OverflowCodeCacheTest + */ +package compiler.codecache; + +import jdk.test.lib.Asserts; import sun.hotspot.WhiteBox; import sun.hotspot.code.BlobType; import sun.hotspot.code.CodeBlob; -import jdk.test.lib.Asserts; -/* - * @test OverflowCodeCacheTest - * @bug 8059550 - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * @modules java.management - * @build OverflowCodeCacheTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* - * -XX:-SegmentedCodeCache OverflowCodeCacheTest - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* - * -XX:+SegmentedCodeCache OverflowCodeCacheTest - * @summary testing of code cache segments overflow - */ +import java.lang.management.MemoryPoolMXBean; +import java.util.ArrayList; +import java.util.EnumSet; + public class OverflowCodeCacheTest { private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); diff --git a/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java b/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java --- a/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java +++ b/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java @@ -20,24 +20,29 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -import jdk.test.lib.ExitCode; -import jdk.test.lib.Platform; -import jdk.test.lib.cli.CommandLineOptionTest; -import common.CodeCacheOptions; -import sun.hotspot.code.BlobType; /** * @test * @bug 8015774 * @summary Verify SegmentedCodeCache option's processing - * @library /testlibrary /test/lib + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build TestSegmentedCodeCacheOption jdk.test.lib.* - * @run main TestSegmentedCodeCacheOption + * + * @build jdk.test.lib.* + * @run driver compiler.codecache.cli.TestSegmentedCodeCacheOption */ + +package compiler.codecache.cli; + +import compiler.codecache.cli.common.CodeCacheOptions; +import jdk.test.lib.ExitCode; +import jdk.test.lib.Platform; +import jdk.test.lib.cli.CommandLineOptionTest; +import sun.hotspot.code.BlobType; + public class TestSegmentedCodeCacheOption { private static final String INT_MODE = "-Xint"; private static final String TIERED_COMPILATION = "TieredCompilation"; diff --git a/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java b/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java --- a/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java +++ b/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java @@ -20,13 +20,14 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package codeheapsize; +package compiler.codecache.cli.codeheapsize; + +import compiler.codecache.cli.common.CodeCacheCLITestCase; +import compiler.codecache.cli.common.CodeCacheOptions; import jdk.test.lib.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; -import common.CodeCacheCLITestCase; -import common.CodeCacheOptions; import sun.hotspot.code.BlobType; /** diff --git a/test/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java b/test/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java --- a/test/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java +++ b/test/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java @@ -20,11 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package codeheapsize; +package compiler.codecache.cli.codeheapsize; + +import compiler.codecache.cli.common.CodeCacheCLITestCase; +import compiler.codecache.cli.common.CodeCacheOptions; import jdk.test.lib.cli.CommandLineOptionTest; -import common.CodeCacheCLITestCase; -import common.CodeCacheOptions; import sun.hotspot.code.BlobType; /** diff --git a/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java b/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java --- a/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java +++ b/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java @@ -20,14 +20,16 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package codeheapsize; -import common.CodeCacheCLITestCase; -import common.CodeCacheOptions; +package compiler.codecache.cli.codeheapsize; + +import compiler.codecache.cli.common.CodeCacheCLITestCase; +import compiler.codecache.cli.common.CodeCacheOptions; import jdk.test.lib.ExitCode; import jdk.test.lib.Utils; import jdk.test.lib.cli.CommandLineOptionTest; import sun.hotspot.code.BlobType; + import java.util.Random; /** diff --git a/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java b/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java --- a/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java +++ b/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java @@ -20,26 +20,30 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package codeheapsize; -import jdk.test.lib.Platform; -import common.CodeCacheCLITestBase; -import common.CodeCacheCLITestCase; -import sun.hotspot.code.BlobType; -import java.util.EnumSet; /** * @test * @bug 8015774 * @summary Verify processing of options related to code heaps sizing. - * @library /testlibrary .. /test/lib + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build TestCodeHeapSizeOptions jdk.test.lib.* codeheapsize.* - * common.* - * @run main/timeout=240 codeheapsize.TestCodeHeapSizeOptions + * + * @build compiler.codecache.cli.codeheapsize.TestCodeHeapSizeOptions jdk.test.lib.* + * @run driver/timeout=240 compiler.codecache.cli.codeheapsize.TestCodeHeapSizeOptions */ + +package compiler.codecache.cli.codeheapsize; + +import compiler.codecache.cli.common.CodeCacheCLITestBase; +import compiler.codecache.cli.common.CodeCacheCLITestCase; +import jdk.test.lib.Platform; +import sun.hotspot.code.BlobType; + +import java.util.EnumSet; + public class TestCodeHeapSizeOptions extends CodeCacheCLITestBase { private static final CodeCacheCLITestCase JVM_STARTUP = new CodeCacheCLITestCase(new CodeCacheCLITestCase.Description( diff --git a/test/compiler/codecache/cli/common/CodeCacheCLITestBase.java b/test/compiler/codecache/cli/common/CodeCacheCLITestBase.java --- a/test/compiler/codecache/cli/common/CodeCacheCLITestBase.java +++ b/test/compiler/codecache/cli/common/CodeCacheCLITestBase.java @@ -20,7 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package common; + +package compiler.codecache.cli.common; /** * Base for code cache related command line options tests. diff --git a/test/compiler/codecache/cli/common/CodeCacheCLITestCase.java b/test/compiler/codecache/cli/common/CodeCacheCLITestCase.java --- a/test/compiler/codecache/cli/common/CodeCacheCLITestCase.java +++ b/test/compiler/codecache/cli/common/CodeCacheCLITestCase.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package common; +package compiler.codecache.cli.common; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; diff --git a/test/compiler/codecache/cli/common/CodeCacheInfoFormatter.java b/test/compiler/codecache/cli/common/CodeCacheInfoFormatter.java --- a/test/compiler/codecache/cli/common/CodeCacheInfoFormatter.java +++ b/test/compiler/codecache/cli/common/CodeCacheInfoFormatter.java @@ -20,9 +20,10 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package common; +package compiler.codecache.cli.common; import sun.hotspot.code.BlobType; + import java.util.Arrays; public class CodeCacheInfoFormatter { diff --git a/test/compiler/codecache/cli/common/CodeCacheOptions.java b/test/compiler/codecache/cli/common/CodeCacheOptions.java --- a/test/compiler/codecache/cli/common/CodeCacheOptions.java +++ b/test/compiler/codecache/cli/common/CodeCacheOptions.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package common; +package compiler.codecache.cli.common; import jdk.test.lib.cli.CommandLineOptionTest; import sun.hotspot.code.BlobType; diff --git a/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java b/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java --- a/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java +++ b/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java @@ -20,13 +20,14 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package printcodecache; +package compiler.codecache.cli.printcodecache; + +import compiler.codecache.cli.common.CodeCacheCLITestCase; +import compiler.codecache.cli.common.CodeCacheInfoFormatter; +import compiler.codecache.cli.common.CodeCacheOptions; import jdk.test.lib.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; -import common.CodeCacheCLITestCase; -import common.CodeCacheInfoFormatter; -import common.CodeCacheOptions; import sun.hotspot.code.BlobType; import java.util.EnumSet; diff --git a/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java b/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java --- a/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java +++ b/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java @@ -20,25 +20,29 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package printcodecache; -import common.CodeCacheCLITestBase; -import common.CodeCacheCLITestCase; -import sun.hotspot.code.BlobType; -import java.util.EnumSet; /** * @test * @bug 8015774 * @summary Verify that PrintCodeCache option print correct information. - * @library /testlibrary .. /test/lib + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build TestPrintCodeCacheOption jdk.test.lib.* - * printcodecache.* common.* - * @run main/timeout=240 printcodecache.TestPrintCodeCacheOption + * + * @build jdk.test.lib.* compiler.codecache.cli.common.* + * @run main/timeout=240 compiler.codecache.cli.printcodecache.TestPrintCodeCacheOption */ + +package compiler.codecache.cli.printcodecache; + +import compiler.codecache.cli.common.CodeCacheCLITestBase; +import compiler.codecache.cli.common.CodeCacheCLITestCase; +import sun.hotspot.code.BlobType; + +import java.util.EnumSet; + public class TestPrintCodeCacheOption extends CodeCacheCLITestBase { private static final CodeCacheCLITestCase DISABLED_PRINT_CODE_CACHE = new CodeCacheCLITestCase(new CodeCacheCLITestCase.Description( diff --git a/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java b/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java --- a/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java +++ b/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java @@ -21,6 +21,24 @@ * questions. */ +/* + * @test SegmentedCodeCacheDtraceTest + * @bug 8015774 + * @summary testing of dtrace for segmented code cache + * @requires os.family=="solaris" + * @modules java.base/jdk.internal.misc + * @library /testlibrary /test/lib / + * + * @build compiler.codecache.dtrace.SegmentedCodeCacheDtraceTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm/timeout=600 -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * compiler.codecache.dtrace.SegmentedCodeCacheDtraceTest + */ + +package compiler.codecache.dtrace; + import compiler.testlibrary.CompilerUtils; import jdk.test.lib.Asserts; import jdk.test.lib.JDKToolFinder; @@ -28,6 +46,7 @@ import jdk.test.lib.Utils; import jdk.test.lib.dtrace.DtraceResultsAnalyzer; import jdk.test.lib.dtrace.DtraceRunner; + import java.io.IOException; import java.lang.reflect.Executable; import java.nio.file.Files; @@ -44,20 +63,6 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -/* - * @test SegmentedCodeCacheDtraceTest - * @bug 8015774 - * @requires os.family=="solaris" - * @modules java.base/jdk.internal.misc - * @library /testlibrary / /test/lib - * @build SegmentedCodeCacheDtraceTestWorker - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+TieredCompilation - * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * SegmentedCodeCacheDtraceTest - * @summary testing of dtrace for segmented code cache - */ public class SegmentedCodeCacheDtraceTest { private static final String WORKER_CLASS_NAME diff --git a/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTestWorker.java b/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTestWorker.java --- a/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTestWorker.java +++ b/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTestWorker.java @@ -21,13 +21,16 @@ * questions. */ +package compiler.codecache.dtrace; + import jdk.test.lib.Utils; +import sun.hotspot.WhiteBox; + import java.lang.reflect.Executable; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import sun.hotspot.WhiteBox; public class SegmentedCodeCacheDtraceTestWorker { diff --git a/test/compiler/codecache/jmx/BeanTypeTest.java b/test/compiler/codecache/jmx/BeanTypeTest.java --- a/test/compiler/codecache/jmx/BeanTypeTest.java +++ b/test/compiler/codecache/jmx/BeanTypeTest.java @@ -21,24 +21,33 @@ * questions. */ +/** + * @test BeanTypeTest + * @summary verify types of code cache memory pool bean + * @modules java.base/jdk.internal.misc + * java.management + * @library /testlibrary /test/lib + * + * @build compiler.codecache.jmx.BeanTypeTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.BeanTypeTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:-SegmentedCodeCache + * compiler.codecache.jmx.BeanTypeTest + */ + +package compiler.codecache.jmx; + import jdk.test.lib.Asserts; -import java.lang.management.MemoryType; import sun.hotspot.code.BlobType; -/** - * @test BeanTypeTest - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * @modules java.management - * @build BeanTypeTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache BeanTypeTest - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache BeanTypeTest - * @summary verify types of code cache memory pool bean - */ +import java.lang.management.MemoryType; + public class BeanTypeTest { public static void main(String args[]) { diff --git a/test/compiler/codecache/jmx/CodeCacheUtils.java b/test/compiler/codecache/jmx/CodeCacheUtils.java --- a/test/compiler/codecache/jmx/CodeCacheUtils.java +++ b/test/compiler/codecache/jmx/CodeCacheUtils.java @@ -21,14 +21,17 @@ * questions. */ +package compiler.codecache.jmx; + import jdk.test.lib.Asserts; import jdk.test.lib.Utils; -import java.lang.management.MemoryPoolMXBean; -import javax.management.Notification; import sun.hotspot.WhiteBox; import sun.hotspot.code.BlobType; import sun.hotspot.code.CodeBlob; +import javax.management.Notification; +import java.lang.management.MemoryPoolMXBean; + public final class CodeCacheUtils { /** diff --git a/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java b/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java --- a/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java +++ b/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java @@ -21,24 +21,33 @@ * questions. */ +/** + * @test CodeHeapBeanPresenceTest + * @summary verify CodeHeap bean presence + * @modules java.base/jdk.internal.misc + * java.management + * @library /testlibrary /test/lib + * + * @build compiler.codecache.jmx.CodeHeapBeanPresenceTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:-SegmentedCodeCache + * compiler.codecache.jmx.CodeHeapBeanPresenceTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.CodeHeapBeanPresenceTest + */ + +package compiler.codecache.jmx; + import jdk.test.lib.Asserts; -import java.util.EnumSet; import sun.hotspot.code.BlobType; -/** - * @test CodeHeapBeanPresenceTest - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * @modules java.management - * @build CodeHeapBeanPresenceTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache CodeHeapBeanPresenceTest - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache CodeHeapBeanPresenceTest - * @summary verify CodeHeap bean presence - */ +import java.util.EnumSet; + public class CodeHeapBeanPresenceTest { public static void main(String args[]) { diff --git a/test/compiler/codecache/jmx/GetUsageTest.java b/test/compiler/codecache/jmx/GetUsageTest.java --- a/test/compiler/codecache/jmx/GetUsageTest.java +++ b/test/compiler/codecache/jmx/GetUsageTest.java @@ -21,25 +21,37 @@ * questions. */ +/* + * @test GetUsageTest + * @summary testing of getUsage() for segmented code cache + * @modules java.base/jdk.internal.misc + * java.management + * @library /testlibrary /test/lib / + * + * @build compiler.codecache.jmx.GetUsageTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.GetUsageTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:-SegmentedCodeCache + * compiler.codecache.jmx.GetUsageTest + */ + +package compiler.codecache.jmx; + import jdk.test.lib.Asserts; +import sun.hotspot.code.BlobType; + import java.lang.management.MemoryPoolMXBean; import java.util.HashMap; import java.util.Map; -import sun.hotspot.code.BlobType; -/* - * @test GetUsageTest - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @build GetUsageTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:CompileCommand=compileonly,null::* - * -XX:-UseCodeCacheFlushing -XX:-MethodFlushing -XX:+SegmentedCodeCache - * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI GetUsageTest - * @summary testing of getUsage() for segmented code cache - */ public class GetUsageTest { private final BlobType btype; diff --git a/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java b/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java --- a/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java +++ b/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java @@ -21,26 +21,32 @@ * questions. */ +/* + * @test InitialAndMaxUsageTest + * @summary testing of initial and max usage + * @modules java.base/jdk.internal.misc + * java.management + * @library /testlibrary /test/lib / + * + * @build compiler.codecache.jmx.InitialAndMaxUsageTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing + * -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:CompileCommand=compileonly,null::* -XX:-UseLargePages + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.InitialAndMaxUsageTest + */ + +package compiler.codecache.jmx; + import jdk.test.lib.Asserts; +import sun.hotspot.code.BlobType; + import java.lang.management.MemoryPoolMXBean; import java.util.ArrayList; import java.util.List; -import sun.hotspot.code.BlobType; -/* - * @test InitialAndMaxUsageTest - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @build InitialAndMaxUsageTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing - * -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:+SegmentedCodeCache -XX:CompileCommand=compileonly,null::* - * -XX:-UseLargePages InitialAndMaxUsageTest - * @summary testing of initial and max usage - */ public class InitialAndMaxUsageTest { private static final double CACHE_USAGE_COEF = 0.95d; diff --git a/test/compiler/codecache/jmx/ManagerNamesTest.java b/test/compiler/codecache/jmx/ManagerNamesTest.java --- a/test/compiler/codecache/jmx/ManagerNamesTest.java +++ b/test/compiler/codecache/jmx/ManagerNamesTest.java @@ -21,24 +21,33 @@ * questions. */ +/** + * @test ManagerNamesTest + * @summary verify getMemoryManageNames calls in case of segmented code cache + * @modules java.base/jdk.internal.misc + * java.management + * @library /testlibrary /test/lib + * + * @build compiler.codecache.jmx.ManagerNamesTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.ManagerNamesTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:-SegmentedCodeCache + * compiler.codecache.jmx.ManagerNamesTest + */ + +package compiler.codecache.jmx; + import jdk.test.lib.Asserts; -import java.lang.management.MemoryPoolMXBean; import sun.hotspot.code.BlobType; -/** - * @test ManagerNamesTest - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * @modules java.management - * @build ManagerNamesTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache ManagerNamesTest - * * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache ManagerNamesTest - * @summary verify getMemoryManageNames calls in case of segmented code cache - */ +import java.lang.management.MemoryPoolMXBean; + public class ManagerNamesTest { private final MemoryPoolMXBean bean; diff --git a/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java b/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java --- a/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java +++ b/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java @@ -21,29 +21,38 @@ * questions. */ +/** + * @test MemoryPoolsPresenceTest + * @summary verify that MemoryManagerMXBean exists for every code cache segment + * @modules java.base/jdk.internal.misc + * java.management + * @library /testlibrary /test/lib + * + * @build compiler.codecache.jmx.MemoryPoolsPresenceTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.MemoryPoolsPresenceTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:-SegmentedCodeCache + * compiler.codecache.jmx.MemoryPoolsPresenceTest + */ + +package compiler.codecache.jmx; + import jdk.test.lib.Asserts; +import sun.hotspot.code.BlobType; + import java.lang.management.ManagementFactory; import java.lang.management.MemoryManagerMXBean; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; -import sun.hotspot.code.BlobType; -/** - * @test MemoryPoolsPresenceTest - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * @modules java.management - * @build MemoryPoolsPresenceTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache MemoryPoolsPresenceTest - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache MemoryPoolsPresenceTest - * @summary verify that MemoryManagerMXBean exists for every code cache segment - */ public class MemoryPoolsPresenceTest { private static final String CC_MANAGER = "CodeCacheManager"; diff --git a/test/compiler/codecache/jmx/PeakUsageTest.java b/test/compiler/codecache/jmx/PeakUsageTest.java --- a/test/compiler/codecache/jmx/PeakUsageTest.java +++ b/test/compiler/codecache/jmx/PeakUsageTest.java @@ -21,28 +21,35 @@ * questions. */ -import jdk.test.lib.Asserts; -import java.lang.management.MemoryPoolMXBean; -import sun.hotspot.code.BlobType; - /* * @test PeakUsageTest - * @library /testlibrary /test/lib - * @ignore 8151345 + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build PeakUsageTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox + * + * @ignore 8151345 + * @build ompiler.codecache.jmx.PeakUsageTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache - * -XX:CompileCommand=compileonly,null::* PeakUsageTest + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.PeakUsageTest * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache - * -XX:CompileCommand=compileonly,null::* PeakUsageTest + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:-SegmentedCodeCache + * compiler.codecache.jmx.PeakUsageTest * @summary testing of getPeakUsage() and resetPeakUsage for * segmented code cache */ + +package compiler.codecache.jmx; + +import sun.hotspot.code.BlobType; + +import java.lang.management.MemoryPoolMXBean; + + public class PeakUsageTest { private final BlobType btype; diff --git a/test/compiler/codecache/jmx/PoolsIndependenceTest.java b/test/compiler/codecache/jmx/PoolsIndependenceTest.java --- a/test/compiler/codecache/jmx/PoolsIndependenceTest.java +++ b/test/compiler/codecache/jmx/PoolsIndependenceTest.java @@ -21,33 +21,43 @@ * questions. */ +/* + * @test PoolsIndependenceTest + * @summary testing of getUsageThreshold() + * @modules java.base/jdk.internal.misc + * java.management + * @library /testlibrary /test/lib / + * + * @build compiler.codecache.jmx.PoolsIndependenceTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.PoolsIndependenceTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:-SegmentedCodeCache + * compiler.codecache.jmx.PoolsIndependenceTest + */ + +package compiler.codecache.jmx; + import jdk.test.lib.Asserts; import jdk.test.lib.Utils; +import sun.hotspot.code.BlobType; + +import javax.management.ListenerNotFoundException; +import javax.management.Notification; +import javax.management.NotificationEmitter; +import javax.management.NotificationListener; import java.lang.management.ManagementFactory; import java.lang.management.MemoryNotificationInfo; import java.lang.management.MemoryPoolMXBean; import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; -import javax.management.ListenerNotFoundException; -import javax.management.Notification; -import javax.management.NotificationEmitter; -import javax.management.NotificationListener; -import sun.hotspot.code.BlobType; -/* - * @test PoolsIndependenceTest - * @modules java.base/jdk.internal.misc - * java.management - * @library /testlibrary /test/lib - * @build PoolsIndependenceTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing - * -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:+SegmentedCodeCache PoolsIndependenceTest - * @summary testing of getUsageThreshold() - */ public class PoolsIndependenceTest implements NotificationListener { private final Map counters; diff --git a/test/compiler/codecache/jmx/ThresholdNotificationsTest.java b/test/compiler/codecache/jmx/ThresholdNotificationsTest.java --- a/test/compiler/codecache/jmx/ThresholdNotificationsTest.java +++ b/test/compiler/codecache/jmx/ThresholdNotificationsTest.java @@ -21,31 +21,40 @@ * questions. */ +/* + * @test ThresholdNotificationsTest + * @summary testing of getUsageThreshold() + * @library /testlibrary /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @build compiler.codecache.jmx.ThresholdNotificationsTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing + * -XX:+WhiteBoxAPI -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::* + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.ThresholdNotificationsTest + * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing + * -XX:+WhiteBoxAPI -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::* + * -XX:-SegmentedCodeCache + * compiler.codecache.jmx.ThresholdNotificationsTest + */ + +package compiler.codecache.jmx; + import jdk.test.lib.Asserts; import jdk.test.lib.Utils; -import java.lang.management.ManagementFactory; -import java.lang.management.MemoryNotificationInfo; -import java.lang.management.MemoryPoolMXBean; +import sun.hotspot.code.BlobType; + import javax.management.ListenerNotFoundException; import javax.management.Notification; import javax.management.NotificationEmitter; import javax.management.NotificationListener; -import sun.hotspot.code.BlobType; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryNotificationInfo; +import java.lang.management.MemoryPoolMXBean; -/* - * @test ThresholdNotificationsTest - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @build ThresholdNotificationsTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing - * -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:+SegmentedCodeCache -XX:CompileCommand=compileonly,null::* - * ThresholdNotificationsTest - * @summary testing of getUsageThreshold() - */ public class ThresholdNotificationsTest implements NotificationListener { private final static long WAIT_TIME = 10000L; @@ -80,8 +89,8 @@ } protected void runTest() { - int iterationsCount = - Integer.getInteger("jdk.test.lib.iterations", 1); + int iterationsCount + = Integer.getInteger("jdk.test.lib.iterations", 1); MemoryPoolMXBean bean = btype.getMemoryPool(); ((NotificationEmitter) ManagementFactory.getMemoryMXBean()). addNotificationListener(this, null, null); diff --git a/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java b/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java --- a/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java +++ b/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java @@ -23,16 +23,23 @@ /* * @test UsageThresholdExceededSeveralTimesTest - * @library /testlibrary /test/lib + * @summary verifying that getUsageThresholdCount() returns correct value + * after threshold has been hit several times + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build UsageThresholdExceededTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing - * -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:+SegmentedCodeCache -XX:CompileCommand=compileonly,null::* - * -Djdk.test.lib.iterations=10 UsageThresholdExceededTest - * @summary verifying that getUsageThresholdCount() returns correct value - * after threshold has been hit several times + * + * @build compiler.codecache.jmx.UsageThresholdExceededTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* -Djdk.test.lib.iterations=10 + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.UsageThresholdExceededTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* -Djdk.test.lib.iterations=10 + * -XX:-SegmentedCodeCache + * compiler.codecache.jmx.UsageThresholdExceededTest */ diff --git a/test/compiler/codecache/jmx/UsageThresholdExceededTest.java b/test/compiler/codecache/jmx/UsageThresholdExceededTest.java --- a/test/compiler/codecache/jmx/UsageThresholdExceededTest.java +++ b/test/compiler/codecache/jmx/UsageThresholdExceededTest.java @@ -21,25 +21,35 @@ * questions. */ -import jdk.test.lib.Asserts; -import java.lang.management.MemoryPoolMXBean; +/* + * @test UsageThresholdExceededTest + * @summary verifying that getUsageThresholdCount() returns correct value + * after threshold has been hit + * @library /testlibrary /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @build compiler.codecache.jmx.UsageThresholdExceededTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.UsageThresholdExceededTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* + * -XX:-SegmentedCodeCache + * compiler.codecache.jmx.UsageThresholdExceededTest + */ + +package compiler.codecache.jmx; + import sun.hotspot.code.BlobType; -/* - * @test UsageThresholdExceededTest - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @build UsageThresholdExceededTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache -XX:-UseCodeCacheFlushing - * -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::* - * UsageThresholdExceededTest - * @summary verifying that getUsageThresholdCount() returns correct value - * after threshold has been hit - */ +import java.lang.management.MemoryPoolMXBean; + public class UsageThresholdExceededTest { protected final int iterations; diff --git a/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java b/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java --- a/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java +++ b/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java @@ -21,25 +21,35 @@ * questions. */ -import jdk.test.lib.Asserts; -import java.lang.management.MemoryPoolMXBean; +/* + * @test UsageThresholdIncreasedTest + * @summary verifying that threshold hasn't been hit after allocation smaller + * than threshold value and that threshold value can be changed + * @library /testlibrary /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @build compiler.codecache.jmx.UsageThresholdIncreasedTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* + * -XX:-SegmentedCodeCache + * compiler.codecache.jmx.UsageThresholdIncreasedTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.UsageThresholdIncreasedTest + */ + +package compiler.codecache.jmx; + import sun.hotspot.code.BlobType; -/* - * @test UsageThresholdIncreasedTest - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @build UsageThresholdIncreasedTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache -XX:-UseCodeCacheFlushing - * -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::* - * UsageThresholdIncreasedTest - * @summary verifying that threshold hasn't been hit after allocation smaller - * than threshold value and that threshold value can be changed - */ +import java.lang.management.MemoryPoolMXBean; + public class UsageThresholdIncreasedTest { private static final int ALLOCATION_STEP = 5; diff --git a/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java b/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java --- a/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java +++ b/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java @@ -21,25 +21,35 @@ * questions. */ -import jdk.test.lib.Asserts; -import java.lang.management.MemoryPoolMXBean; +/* + * @test UsageThresholdNotExceededTest + * @summary verifying that usage threshold not exceeded while allocating less + * than usage threshold + * @library /testlibrary /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @build compiler.codecache.jmx.UsageThresholdNotExceededTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* + * -XX:+SegmentedCodeCache + * compiler.codecache.jmx.UsageThresholdNotExceededTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing + * -XX:CompileCommand=compileonly,null::* + * -XX:-SegmentedCodeCache + * compiler.codecache.jmx.UsageThresholdNotExceededTest + */ + +package compiler.codecache.jmx; + import sun.hotspot.code.BlobType; -/* - * @test UsageThresholdNotExceededTest - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @build UsageThresholdNotExceededTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing - * -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:+SegmentedCodeCache -XX:CompileCommand=compileonly,null::* - * UsageThresholdNotExceededTest - * @summary verifying that usage threshold not exceeded while allocating less - * than usage threshold - */ +import java.lang.management.MemoryPoolMXBean; + public class UsageThresholdNotExceededTest { private final BlobType btype; diff --git a/test/compiler/codecache/stress/CodeCacheStressRunner.java b/test/compiler/codecache/stress/CodeCacheStressRunner.java --- a/test/compiler/codecache/stress/CodeCacheStressRunner.java +++ b/test/compiler/codecache/stress/CodeCacheStressRunner.java @@ -22,6 +22,8 @@ * */ +package compiler.codecache.stress; + import jdk.test.lib.TimeLimitedRunner; import jdk.test.lib.Utils; diff --git a/test/compiler/codecache/stress/Helper.java b/test/compiler/codecache/stress/Helper.java --- a/test/compiler/codecache/stress/Helper.java +++ b/test/compiler/codecache/stress/Helper.java @@ -22,11 +22,7 @@ * */ -import java.io.BufferedInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.concurrent.Callable; -import java.util.Random; +package compiler.codecache.stress; import jdk.test.lib.Asserts; import jdk.test.lib.ByteCodeLoader; @@ -34,18 +30,24 @@ import jdk.test.lib.Utils; import sun.hotspot.WhiteBox; +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.Random; +import java.util.concurrent.Callable; + public final class Helper { public static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); public static final Random RNG = Utils.getRandomInstance(); private static final long THRESHOLD = WHITE_BOX.getIntxVMFlag("CompileThreshold"); - private static final String TEST_CASE_IMPL_CLASS_NAME = "Helper$TestCaseImpl"; + private static final String TEST_CASE_IMPL_CLASS_NAME = "compiler.codecache.stress.Helper$TestCaseImpl"; private static byte[] CLASS_DATA; static { try { CLASS_DATA = loadClassData(TEST_CASE_IMPL_CLASS_NAME); } catch (IOException e) { - throw new Error("TESTBUG: cannot load class byte code", e); + throw new Error("TESTBUG: cannot load class byte code " + TEST_CASE_IMPL_CLASS_NAME, e); } } diff --git a/test/compiler/codecache/stress/OverloadCompileQueueTest.java b/test/compiler/codecache/stress/OverloadCompileQueueTest.java --- a/test/compiler/codecache/stress/OverloadCompileQueueTest.java +++ b/test/compiler/codecache/stress/OverloadCompileQueueTest.java @@ -22,28 +22,36 @@ * */ +/* + * @test OverloadCompileQueueTest + * @summary stressing code cache by overloading compile queues + * @library /testlibrary /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @ignore 8071905 + * @build compiler.codecache.stress.OverloadCompileQueueTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method + * -XX:-SegmentedCodeCache + * compiler.codecache.stress.OverloadCompileQueueTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method + * -XX:+SegmentedCodeCache + * compiler.codecache.stress.OverloadCompileQueueTest + */ + +package compiler.codecache.stress; + +import jdk.test.lib.Platform; + import java.lang.reflect.Method; import java.util.stream.IntStream; -import jdk.test.lib.Platform; - -/* - * @test OverloadCompileQueueTest - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @ignore 8071905 - * @build OverloadCompileQueueTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:CompileCommand=dontinline,Helper$TestCase::method - * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache OverloadCompileQueueTest - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:CompileCommand=dontinline,Helper$TestCase::method - * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache OverloadCompileQueueTest - * @summary stressing code cache by overloading compile queues - */ public class OverloadCompileQueueTest implements Runnable { private static final int MAX_SLEEP = 10000; private static final String METHOD_TO_ENQUEUE = "method"; diff --git a/test/compiler/codecache/stress/RandomAllocationTest.java b/test/compiler/codecache/stress/RandomAllocationTest.java --- a/test/compiler/codecache/stress/RandomAllocationTest.java +++ b/test/compiler/codecache/stress/RandomAllocationTest.java @@ -22,26 +22,34 @@ * */ -import java.util.ArrayList; +/* + * @test RandomAllocationTest + * @summary stressing code cache by allocating randomly sized "dummy" code blobs + * @library /testlibrary /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @build compiler.codecache.stress.RandomAllocationTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method + * -XX:-SegmentedCodeCache + * compiler.codecache.stress.RandomAllocationTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method + * -XX:+SegmentedCodeCache + * compiler.codecache.stress.RandomAllocationTest + */ + +package compiler.codecache.stress; import sun.hotspot.code.BlobType; -/* - * @test RandomAllocationTest - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @build RandomAllocationTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:CompileCommand=dontinline,Helper$TestCase::method - * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache RandomAllocationTest - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:CompileCommand=dontinline,Helper$TestCase::method - * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache RandomAllocationTest - * @summary stressing code cache by allocating randomly sized "dummy" code blobs - */ +import java.util.ArrayList; + public class RandomAllocationTest implements Runnable { private static final long CODE_CACHE_SIZE = Helper.WHITE_BOX.getUintxVMFlag("ReservedCodeCacheSize"); diff --git a/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java b/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java --- a/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java +++ b/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java @@ -24,22 +24,28 @@ /* * @test UnexpectedDeoptimizationTest - * @library /testlibrary /test/lib + * @summary stressing code cache by forcing unexpected deoptimizations + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build UnexpectedDeoptimizationTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission + * + * @build compiler.codecache.stress.UnexpectedDeoptimizationTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:CompileCommand=dontinline,Helper$TestCase::method - * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache -XX:-DeoptimizeRandom - * UnexpectedDeoptimizationTest + * -XX:+WhiteBoxAPI -XX:-DeoptimizeRandom + * -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method + * -XX:-SegmentedCodeCache + * compiler.codecache.stress.UnexpectedDeoptimizationTest * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:CompileCommand=dontinline,Helper$TestCase::method - * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache -XX:-DeoptimizeRandom - * UnexpectedDeoptimizationTest - * @summary stressing code cache by forcing unexpected deoptimizations + * -XX:+WhiteBoxAPI -XX:-DeoptimizeRandom + * -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method + * -XX:+SegmentedCodeCache + * compiler.codecache.stress.UnexpectedDeoptimizationTest */ + +package compiler.codecache.stress; + public class UnexpectedDeoptimizationTest implements Runnable { public static void main(String[] args) { diff --git a/test/compiler/codegen/BMI1.java b/test/compiler/codegen/BMI1.java --- a/test/compiler/codegen/BMI1.java +++ b/test/compiler/codegen/BMI1.java @@ -25,277 +25,306 @@ * @test * @bug 8031321 * @summary Support BMI1 instructions on x86/x64 - * @run main/othervm -Xbatch -XX:-TieredCompilation -XX:CompileCommand=compileonly,BMITests.* BMI1 * + * @run main/othervm -Xbatch -XX:-TieredCompilation + * -XX:CompileCommand=compileonly,compiler.codegen.BMI1$BMITests::* + * compiler.codegen.BMI1 */ -class MemI { - public int x; - public MemI(int x) { this.x = x; } -} - -class MemL { - public long x; - public MemL(long x) { this.x = x; } -} - -class BMITests { - static int andnl(int src1, int src2) { - return ~src1 & src2; - } - static long andnq(long src1, long src2) { - return ~src1 & src2; - } - static int andnl(int src1, MemI src2) { - return ~src1 & src2.x; - } - static long andnq(long src1, MemL src2) { - return ~src1 & src2.x; - } - static int blsil(int src1) { - return src1 & -src1; - } - static long blsiq(long src1) { - return src1 & -src1; - } - static int blsil(MemI src1) { - return src1.x & -src1.x; - } - static long blsiq(MemL src1) { - return src1.x & -src1.x; - } - static int blsmskl(int src1) { - return (src1 - 1) ^ src1; - } - static long blsmskq(long src1) { - return (src1 - 1) ^ src1; - } - static int blsmskl(MemI src1) { - return (src1.x - 1) ^ src1.x; - } - static long blsmskq(MemL src1) { - return (src1.x - 1) ^ src1.x; - } - static int blsrl(int src1) { - return (src1 - 1) & src1; - } - static long blsrq(long src1) { - return (src1 - 1) & src1; - } - static int blsrl(MemI src1) { - return (src1.x - 1) & src1.x; - } - static long blsrq(MemL src1) { - return (src1.x - 1) & src1.x; - } - static int lzcntl(int src1) { - return Integer.numberOfLeadingZeros(src1); - } - static int lzcntq(long src1) { - return Long.numberOfLeadingZeros(src1); - } - static int tzcntl(int src1) { - return Integer.numberOfTrailingZeros(src1); - } - static int tzcntq(long src1) { - return Long.numberOfTrailingZeros(src1); - } -} +package compiler.codegen; public class BMI1 { - private final static int ITERATIONS = 1000000; + private final static int ITERATIONS = 1000000; - public static void main(String[] args) { - int ix = 0x01234567; - int iy = 0x89abcdef; - MemI imy = new MemI(iy); - long lx = 0x0123456701234567L; - long ly = 0x89abcdef89abcdefL; - MemL lmy = new MemL(ly); + public static void main(String[] args) { + int ix = 0x01234567; + int iy = 0x89abcdef; + MemI imy = new MemI(iy); + long lx = 0x0123456701234567L; + long ly = 0x89abcdef89abcdefL; + MemL lmy = new MemL(ly); - { // match(Set dst (AndI (XorI src1 minus_1) src2)) - int z = BMITests.andnl(ix, iy); - for (int i = 0; i < ITERATIONS; i++) { - int ii = BMITests.andnl(ix, iy); - if (ii != z) { - throw new Error("andnl with register failed"); + { // match(Set dst (AndI (XorI src1 minus_1) src2)) + int z = BMITests.andnl(ix, iy); + for (int i = 0; i < ITERATIONS; i++) { + int ii = BMITests.andnl(ix, iy); + if (ii != z) { + throw new Error("andnl with register failed"); + } + } } - } - } - { // match(Set dst (AndL (XorL src1 minus_1) src2)) - long z = BMITests.andnq(lx, ly); - for (int i = 0; i < ITERATIONS; i++) { - long ll = BMITests.andnq(lx, ly); - if (ll != z) { - throw new Error("andnq with register failed"); + { // match(Set dst (AndL (XorL src1 minus_1) src2)) + long z = BMITests.andnq(lx, ly); + for (int i = 0; i < ITERATIONS; i++) { + long ll = BMITests.andnq(lx, ly); + if (ll != z) { + throw new Error("andnq with register failed"); + } + } } - } - } - { // match(Set dst (AndI (XorI src1 minus_1) (LoadI src2))) - int z = BMITests.andnl(ix, imy); - for (int i = 0; i < ITERATIONS; i++) { - int ii = BMITests.andnl(ix, imy); - if (ii != z) { - throw new Error("andnl with memory failed"); + { // match(Set dst (AndI (XorI src1 minus_1) (LoadI src2))) + int z = BMITests.andnl(ix, imy); + for (int i = 0; i < ITERATIONS; i++) { + int ii = BMITests.andnl(ix, imy); + if (ii != z) { + throw new Error("andnl with memory failed"); + } + } } - } - } - { // match(Set dst (AndL (XorL src1 minus_1) (LoadL src2))) - long z = BMITests.andnq(lx, lmy); - for (int i = 0; i < ITERATIONS; i++) { - long ll = BMITests.andnq(lx, lmy); - if (ll != z) { - throw new Error("andnq with memory failed"); + { // match(Set dst (AndL (XorL src1 minus_1) (LoadL src2))) + long z = BMITests.andnq(lx, lmy); + for (int i = 0; i < ITERATIONS; i++) { + long ll = BMITests.andnq(lx, lmy); + if (ll != z) { + throw new Error("andnq with memory failed"); + } + } } - } - } - { // match(Set dst (AndI (SubI imm_zero src) src)) - int z = BMITests.blsil(ix); - for (int i = 0; i < ITERATIONS; i++) { - int ii = BMITests.blsil(ix); - if (ii != z) { - throw new Error("blsil with register failed"); + { // match(Set dst (AndI (SubI imm_zero src) src)) + int z = BMITests.blsil(ix); + for (int i = 0; i < ITERATIONS; i++) { + int ii = BMITests.blsil(ix); + if (ii != z) { + throw new Error("blsil with register failed"); + } + } } - } - } - { // match(Set dst (AndL (SubL imm_zero src) src)) - long z = BMITests.blsiq(lx); - for (int i = 0; i < ITERATIONS; i++) { - long ll = BMITests.blsiq(lx); - if (ll != z) { - throw new Error("blsiq with register failed"); + { // match(Set dst (AndL (SubL imm_zero src) src)) + long z = BMITests.blsiq(lx); + for (int i = 0; i < ITERATIONS; i++) { + long ll = BMITests.blsiq(lx); + if (ll != z) { + throw new Error("blsiq with register failed"); + } + } } - } - } - { // match(Set dst (AndI (SubI imm_zero (LoadI src) ) (LoadI src) )) - int z = BMITests.blsil(imy); - for (int i = 0; i < ITERATIONS; i++) { - int ii = BMITests.blsil(imy); - if (ii != z) { - throw new Error("blsil with memory failed"); + { // match(Set dst (AndI (SubI imm_zero (LoadI src) ) (LoadI src) )) + int z = BMITests.blsil(imy); + for (int i = 0; i < ITERATIONS; i++) { + int ii = BMITests.blsil(imy); + if (ii != z) { + throw new Error("blsil with memory failed"); + } + } } - } - } - { // match(Set dst (AndL (SubL imm_zero (LoadL src) ) (LoadL src) )) - long z = BMITests.blsiq(lmy); - for (int i = 0; i < ITERATIONS; i++) { - long ll = BMITests.blsiq(lmy); - if (ll != z) { - throw new Error("blsiq with memory failed"); + { // match(Set dst (AndL (SubL imm_zero (LoadL src) ) (LoadL src) )) + long z = BMITests.blsiq(lmy); + for (int i = 0; i < ITERATIONS; i++) { + long ll = BMITests.blsiq(lmy); + if (ll != z) { + throw new Error("blsiq with memory failed"); + } + } } - } + + { // match(Set dst (XorI (AddI src minus_1) src)) + int z = BMITests.blsmskl(ix); + for (int i = 0; i < ITERATIONS; i++) { + int ii = BMITests.blsmskl(ix); + if (ii != z) { + throw new Error("blsmskl with register failed"); + } + } + } + { // match(Set dst (XorL (AddL src minus_1) src)) + long z = BMITests.blsmskq(lx); + for (int i = 0; i < ITERATIONS; i++) { + long ll = BMITests.blsmskq(lx); + if (ll != z) { + throw new Error("blsmskq with register failed"); + } + } + } + { // match(Set dst (XorI (AddI (LoadI src) minus_1) (LoadI src) ) ) + int z = BMITests.blsmskl(imy); + for (int i = 0; i < ITERATIONS; i++) { + int ii = BMITests.blsmskl(imy); + if (ii != z) { + throw new Error("blsmskl with memory failed"); + } + } + } + { // match(Set dst (XorL (AddL (LoadL src) minus_1) (LoadL src) ) ) + long z = BMITests.blsmskq(lmy); + for (int i = 0; i < ITERATIONS; i++) { + long ll = BMITests.blsmskq(lmy); + if (ll != z) { + throw new Error("blsmskq with memory failed"); + } + } + } + + { // match(Set dst (AndI (AddI src minus_1) src) ) + int z = BMITests.blsrl(ix); + for (int i = 0; i < ITERATIONS; i++) { + int ii = BMITests.blsrl(ix); + if (ii != z) { + throw new Error("blsrl with register failed"); + } + } + } + { // match(Set dst (AndL (AddL src minus_1) src) ) + long z = BMITests.blsrq(lx); + for (int i = 0; i < ITERATIONS; i++) { + long ll = BMITests.blsrq(lx); + if (ll != z) { + throw new Error("blsrq with register failed"); + } + } + } + { // match(Set dst (AndI (AddI (LoadI src) minus_1) (LoadI src) ) ) + int z = BMITests.blsrl(imy); + for (int i = 0; i < ITERATIONS; i++) { + int ii = BMITests.blsrl(imy); + if (ii != z) { + throw new Error("blsrl with memory failed"); + } + } + } + { // match(Set dst (AndL (AddL (LoadL src) minus_1) (LoadL src)) ) + long z = BMITests.blsrq(lmy); + for (int i = 0; i < ITERATIONS; i++) { + long ll = BMITests.blsrq(lmy); + if (ll != z) { + throw new Error("blsrq with memory failed"); + } + } + } + + { + int z = BMITests.lzcntl(ix); + for (int i = 0; i < ITERATIONS; i++) { + int ii = BMITests.lzcntl(ix); + if (ii != z) { + throw new Error("lzcntl failed"); + } + } + } + { + int z = BMITests.lzcntq(lx); + for (int i = 0; i < ITERATIONS; i++) { + int ii = BMITests.lzcntq(lx); + if (ii != z) { + throw new Error("lzcntq failed"); + } + } + } + + { + int z = BMITests.tzcntl(ix); + for (int i = 0; i < ITERATIONS; i++) { + int ii = BMITests.tzcntl(ix); + if (ii != z) { + throw new Error("tzcntl failed"); + } + } + } + { + int z = BMITests.tzcntq(lx); + for (int i = 0; i < ITERATIONS; i++) { + int ii = BMITests.tzcntq(lx); + if (ii != z) { + throw new Error("tzcntq failed"); + } + } + } } - { // match(Set dst (XorI (AddI src minus_1) src)) - int z = BMITests.blsmskl(ix); - for (int i = 0; i < ITERATIONS; i++) { - int ii = BMITests.blsmskl(ix); - if (ii != z) { - throw new Error("blsmskl with register failed"); + static class MemI { + public int x; + + public MemI(int x) { + this.x = x; } - } - } - { // match(Set dst (XorL (AddL src minus_1) src)) - long z = BMITests.blsmskq(lx); - for (int i = 0; i < ITERATIONS; i++) { - long ll = BMITests.blsmskq(lx); - if (ll != z) { - throw new Error("blsmskq with register failed"); - } - } - } - { // match(Set dst (XorI (AddI (LoadI src) minus_1) (LoadI src) ) ) - int z = BMITests.blsmskl(imy); - for (int i = 0; i < ITERATIONS; i++) { - int ii = BMITests.blsmskl(imy); - if (ii != z) { - throw new Error("blsmskl with memory failed"); - } - } - } - { // match(Set dst (XorL (AddL (LoadL src) minus_1) (LoadL src) ) ) - long z = BMITests.blsmskq(lmy); - for (int i = 0; i < ITERATIONS; i++) { - long ll = BMITests.blsmskq(lmy); - if (ll != z) { - throw new Error("blsmskq with memory failed"); - } - } } - { // match(Set dst (AndI (AddI src minus_1) src) ) - int z = BMITests.blsrl(ix); - for (int i = 0; i < ITERATIONS; i++) { - int ii = BMITests.blsrl(ix); - if (ii != z) { - throw new Error("blsrl with register failed"); + static class MemL { + public long x; + + public MemL(long x) { + this.x = x; } - } - } - { // match(Set dst (AndL (AddL src minus_1) src) ) - long z = BMITests.blsrq(lx); - for (int i = 0; i < ITERATIONS; i++) { - long ll = BMITests.blsrq(lx); - if (ll != z) { - throw new Error("blsrq with register failed"); - } - } - } - { // match(Set dst (AndI (AddI (LoadI src) minus_1) (LoadI src) ) ) - int z = BMITests.blsrl(imy); - for (int i = 0; i < ITERATIONS; i++) { - int ii = BMITests.blsrl(imy); - if (ii != z) { - throw new Error("blsrl with memory failed"); - } - } - } - { // match(Set dst (AndL (AddL (LoadL src) minus_1) (LoadL src)) ) - long z = BMITests.blsrq(lmy); - for (int i = 0; i < ITERATIONS; i++) { - long ll = BMITests.blsrq(lmy); - if (ll != z) { - throw new Error("blsrq with memory failed"); - } - } } - { - int z = BMITests.lzcntl(ix); - for (int i = 0; i < ITERATIONS; i++) { - int ii = BMITests.lzcntl(ix); - if (ii != z) { - throw new Error("lzcntl failed"); + static class BMITests { + static int andnl(int src1, int src2) { + return ~src1 & src2; } - } + + static long andnq(long src1, long src2) { + return ~src1 & src2; + } + + static int andnl(int src1, MemI src2) { + return ~src1 & src2.x; + } + + static long andnq(long src1, MemL src2) { + return ~src1 & src2.x; + } + + static int blsil(int src1) { + return src1 & -src1; + } + + static long blsiq(long src1) { + return src1 & -src1; + } + + static int blsil(MemI src1) { + return src1.x & -src1.x; + } + + static long blsiq(MemL src1) { + return src1.x & -src1.x; + } + + static int blsmskl(int src1) { + return (src1 - 1) ^ src1; + } + + static long blsmskq(long src1) { + return (src1 - 1) ^ src1; + } + + static int blsmskl(MemI src1) { + return (src1.x - 1) ^ src1.x; + } + + static long blsmskq(MemL src1) { + return (src1.x - 1) ^ src1.x; + } + + static int blsrl(int src1) { + return (src1 - 1) & src1; + } + + static long blsrq(long src1) { + return (src1 - 1) & src1; + } + + static int blsrl(MemI src1) { + return (src1.x - 1) & src1.x; + } + + static long blsrq(MemL src1) { + return (src1.x - 1) & src1.x; + } + + static int lzcntl(int src1) { + return Integer.numberOfLeadingZeros(src1); + } + + static int lzcntq(long src1) { + return Long.numberOfLeadingZeros(src1); + } + + static int tzcntl(int src1) { + return Integer.numberOfTrailingZeros(src1); + } + + static int tzcntq(long src1) { + return Long.numberOfTrailingZeros(src1); + } } - { - int z = BMITests.lzcntq(lx); - for (int i = 0; i < ITERATIONS; i++) { - int ii = BMITests.lzcntq(lx); - if (ii != z) { - throw new Error("lzcntq failed"); - } - } - } - - { - int z = BMITests.tzcntl(ix); - for (int i = 0; i < ITERATIONS; i++) { - int ii = BMITests.tzcntl(ix); - if (ii != z) { - throw new Error("tzcntl failed"); - } - } - } - { - int z = BMITests.tzcntq(lx); - for (int i = 0; i < ITERATIONS; i++) { - int ii = BMITests.tzcntq(lx); - if (ii != z) { - throw new Error("tzcntq failed"); - } - } - } - } } diff --git a/test/compiler/codegen/8144028/BitTests.java b/test/compiler/codegen/BitTests.java rename from test/compiler/codegen/8144028/BitTests.java rename to test/compiler/codegen/BitTests.java --- a/test/compiler/codegen/8144028/BitTests.java +++ b/test/compiler/codegen/BitTests.java @@ -25,13 +25,18 @@ * @test * @bug 8144028 * @summary Use AArch64 bit-test instructions in C2 - * @modules java.base - * @run main/othervm -Xbatch -XX:CompileCommand=dontinline,BitTests::* -XX:-TieredCompilation BitTests - * @run main/othervm -Xbatch -XX:+TieredCompilation -XX:TieredStopAtLevel=1 BitTests - * @run main/othervm -Xbatch -XX:+TieredCompilation BitTests * + * @run main/othervm -Xbatch -XX:-TieredCompilation + * -XX:CompileCommand=dontinline,compiler.codegen.BitTests::* + * compiler.codegen.BitTests + * @run main/othervm -Xbatch -XX:+TieredCompilation -XX:TieredStopAtLevel=1 + * compiler.codegen.BitTests + * @run main/othervm -Xbatch -XX:+TieredCompilation + * compiler.codegen.BitTests */ +package compiler.codegen; + // Try to ensure that the bit test instructions TBZ/TBNZ, TST/TSTW // don't generate incorrect code. We can't guarantee that C2 will use // bit test instructions for this test and it's not a bug if it @@ -50,7 +55,7 @@ } private final long testIntSignedBranch(long counter) { - if ((int)r.nextLong() < 0) { + if ((int) r.nextLong() < 0) { counter = increment(counter); } return counter; @@ -64,10 +69,10 @@ } private final long testIntBitBranch(long counter) { - if (((int)r.nextLong() & (1 << 27)) != 0) { + if (((int) r.nextLong() & (1 << 27)) != 0) { counter = increment(counter); } - if (((int)r.nextLong() & (1 << 27)) != 0) { + if (((int) r.nextLong() & (1 << 27)) != 0) { counter = increment(counter); } return counter; @@ -87,11 +92,11 @@ if (((r.nextLong() & 0x0800000000l) != 0)) { counter++; } - return counter; + return counter; } private final long testIntMaskBranch(long counter) { - if ((((int)r.nextLong() & 0x08) != 0)) { + if ((((int) r.nextLong() & 0x08) != 0)) { counter++; } return counter; @@ -101,11 +106,11 @@ if (((r.nextLong() & mask) != 0)) { counter++; } - return counter; + return counter; } private final long testIntMaskBranch(long counter, int mask) { - if ((((int)r.nextLong() & mask) != 0)) { + if ((((int) r.nextLong() & mask) != 0)) { counter++; } return counter; @@ -142,23 +147,22 @@ System.out.println("PASSED"); } -} + // Marsaglia's xor-shift generator, used here because it is + // reproducible across all Java implementations. It is also very + // fast. + static class XorShift { -// Marsaglia's xor-shift generator, used here because it is -// reproducible across all Java implementations. It is also very -// fast. -class XorShift { + private long y; - private long y; + XorShift() { + y = 2463534242l; + } - XorShift() { - y = 2463534242l; - } + public long nextLong() { + y ^= (y << 13); + y ^= (y >>> 17); + return (y ^= (y << 5)); - public long nextLong() { - y ^= (y << 13); - y ^= (y >>> 17); - return (y ^= (y << 5)); - + } } } diff --git a/test/compiler/codegen/C1NullCheckOfNullStore.java b/test/compiler/codegen/C1NullCheckOfNullStore.java --- a/test/compiler/codegen/C1NullCheckOfNullStore.java +++ b/test/compiler/codegen/C1NullCheckOfNullStore.java @@ -25,33 +25,39 @@ * @test * @bug 8039043 * @summary Null check is placed in a wrong place when storing a null to an object field on x64 with compressed oops off - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=compileonly,C1NullCheckOfNullStore::test -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-UseCompressedOops C1NullCheckOfNullStore * + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions + * -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-UseCompressedOops + * -XX:CompileCommand=compileonly,compiler.codegen.C1NullCheckOfNullStore::test + * compiler.codegen.C1NullCheckOfNullStore */ +package compiler.codegen; + public class C1NullCheckOfNullStore { - private static class Foo { - Object bar; - } - static private void test(Foo x) { - x.bar = null; - } - static public void main(String args[]) { - Foo x = new Foo(); - for (int i = 0; i < 10000; i++) { - test(x); + private static class Foo { + Object bar; } - boolean gotNPE = false; - try { - for (int i = 0; i < 10000; i++) { - test(null); - } + + static private void test(Foo x) { + x.bar = null; } - catch(NullPointerException e) { - gotNPE = true; + + static public void main(String args[]) { + Foo x = new Foo(); + for (int i = 0; i < 10000; i++) { + test(x); + } + boolean gotNPE = false; + try { + for (int i = 0; i < 10000; i++) { + test(null); + } + } catch (NullPointerException e) { + gotNPE = true; + } + if (!gotNPE) { + throw new Error("Expecting a NullPointerException"); + } } - if (!gotNPE) { - throw new Error("Expecting a NullPointerException"); - } - } } diff --git a/test/compiler/codegen/7088419/CRCTest.java b/test/compiler/codegen/CRCTest.java rename from test/compiler/codegen/7088419/CRCTest.java rename to test/compiler/codegen/CRCTest.java --- a/test/compiler/codegen/7088419/CRCTest.java +++ b/test/compiler/codegen/CRCTest.java @@ -22,12 +22,15 @@ */ /* - @test - @bug 7088419 - @run main CRCTest - @summary Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32 and java.util.zip.Adler32 + * @test + * @bug 7088419 + * @summary Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32 and java.util.zip.Adler32 + * + * @run main compiler.codegen.CRCTest */ +package compiler.codegen; + import java.nio.ByteBuffer; import java.util.zip.CRC32; import java.util.zip.Checksum; diff --git a/test/compiler/codegen/IntRotateWithImmediate.java b/test/compiler/codegen/IntRotateWithImmediate.java --- a/test/compiler/codegen/IntRotateWithImmediate.java +++ b/test/compiler/codegen/IntRotateWithImmediate.java @@ -28,51 +28,54 @@ * @bug 8154537 * @key regression * @summary Test that the rotate distance used in the rotate instruction is properly masked with 0x1f - * @run main/othervm -Xbatch -XX:-UseOnStackReplacement IntRotateWithImmediate + * + * @run main/othervm -Xbatch -XX:-UseOnStackReplacement compiler.codegen.IntRotateWithImmediate * @author volker.simonis@gmail.com */ +package compiler.codegen; + public class IntRotateWithImmediate { - // This is currently the same as Integer.rotateRight() - static int rotateRight1(int i, int distance) { - // On some architectures (i.e. x86_64 and ppc64) the following computation is - // matched in the .ad file into a single MachNode which emmits a single rotate - // machine instruction. It is important that the shift amount is masked to match - // corresponding immediate width in the native instruction. On x86_64 the rotate - // left instruction ('rol') encodes an 8-bit immediate while the corresponding - // 'rotlwi' instruction on Power only encodes a 5-bit immediate. - return ((i >>> distance) | (i << -distance)); - } + // This is currently the same as Integer.rotateRight() + static int rotateRight1(int i, int distance) { + // On some architectures (i.e. x86_64 and ppc64) the following computation is + // matched in the .ad file into a single MachNode which emmits a single rotate + // machine instruction. It is important that the shift amount is masked to match + // corresponding immediate width in the native instruction. On x86_64 the rotate + // left instruction ('rol') encodes an 8-bit immediate while the corresponding + // 'rotlwi' instruction on Power only encodes a 5-bit immediate. + return ((i >>> distance) | (i << -distance)); + } - static int rotateRight2(int i, int distance) { - return ((i >>> distance) | (i << (32-distance))); - } + static int rotateRight2(int i, int distance) { + return ((i >>> distance) | (i << (32 - distance))); + } - static int compute1(int x) { - return rotateRight1(x, 3); - } + static int compute1(int x) { + return rotateRight1(x, 3); + } - static int compute2(int x) { - return rotateRight2(x, 3); - } + static int compute2(int x) { + return rotateRight2(x, 3); + } - public static void main(String args[]) { - int val = 4096; + public static void main(String args[]) { + int val = 4096; - int firstResult = compute1(val); + int firstResult = compute1(val); - for (int i = 0; i < 100000; i++) { - int newResult = compute1(val); - if (firstResult != newResult) { - throw new InternalError(firstResult + " != " + newResult); - } - newResult = compute2(val); - if (firstResult != newResult) { - throw new InternalError(firstResult + " != " + newResult); - } + for (int i = 0; i < 100000; i++) { + int newResult = compute1(val); + if (firstResult != newResult) { + throw new InternalError(firstResult + " != " + newResult); + } + newResult = compute2(val); + if (firstResult != newResult) { + throw new InternalError(firstResult + " != " + newResult); + } + } + System.out.println("OK"); } - System.out.println("OK"); - } } diff --git a/test/compiler/codegen/LoadWithMask.java b/test/compiler/codegen/LoadWithMask.java --- a/test/compiler/codegen/LoadWithMask.java +++ b/test/compiler/codegen/LoadWithMask.java @@ -25,20 +25,26 @@ * @test * @bug 8032207 * @summary Invalid node sizing for loadUS2L_immI16 and loadI2L_immI - * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,LoadWithMask.foo LoadWithMask * + * @run main/othervm -Xbatch + * -XX:CompileCommand=compileonly,compiler.codegen.LoadWithMask::foo + * compiler.codegen.LoadWithMask */ + +package compiler.codegen; + public class LoadWithMask { - static int x[] = new int[1]; - static long foo() { - return x[0] & 0xfff0ffff; - } + static int x[] = new int[1]; - public static void main(String[] args) { - x[0] = -1; - long l = 0; - for (int i = 0; i < 100000; ++i) { - l = foo(); + static long foo() { + return x[0] & 0xfff0ffff; } - } + + public static void main(String[] args) { + x[0] = -1; + long l = 0; + for (int i = 0; i < 100000; ++i) { + l = foo(); + } + } } diff --git a/test/compiler/codegen/LoadWithMask2.java b/test/compiler/codegen/LoadWithMask2.java --- a/test/compiler/codegen/LoadWithMask2.java +++ b/test/compiler/codegen/LoadWithMask2.java @@ -25,31 +25,39 @@ * @test * @bug 8031743 * @summary loadI2L_immI broken for negative memory values - * @run main/othervm -Xbatch -XX:CompileCommand=compileonly,*.foo* LoadWithMask2 * + * @run main/othervm -Xbatch + * -XX:CompileCommand=compileonly,compiler.codegen.LoadWithMask2::foo* + * compiler.codegen.LoadWithMask2 */ + +package compiler.codegen; + public class LoadWithMask2 { - static int x; - static long foo1() { - return x & 0xfffffffe; - } - static long foo2() { - return x & 0xff000000; - } - static long foo3() { - return x & 0x8abcdef1; - } + static int x; - public static void main(String[] args) { - x = -1; - long l = 0; - for (int i = 0; i < 100000; ++i) { - l = foo1() & foo2() & foo3(); + static long foo1() { + return x & 0xfffffffe; } - if (l > 0) { - System.out.println("FAILED"); - System.exit(97); + + static long foo2() { + return x & 0xff000000; } - System.out.println("PASSED"); - } + + static long foo3() { + return x & 0x8abcdef1; + } + + public static void main(String[] args) { + x = -1; + long l = 0; + for (int i = 0; i < 100000; ++i) { + l = foo1() & foo2() & foo3(); + } + if (l > 0) { + System.out.println("FAILED"); + System.exit(97); + } + System.out.println("PASSED"); + } } diff --git a/test/compiler/codegen/6378821/Test6378821.java b/test/compiler/codegen/Test6378821.java rename from test/compiler/codegen/6378821/Test6378821.java rename to test/compiler/codegen/Test6378821.java --- a/test/compiler/codegen/6378821/Test6378821.java +++ b/test/compiler/codegen/Test6378821.java @@ -26,9 +26,13 @@ * @bug 6378821 * @summary where available, bitCount() should use POPC on SPARC processors and AMD+10h * - * @run main/othervm -Xcomp -XX:CompileOnly=Test6378821.fcomp Test6378821 + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.codegen.Test6378821::fcomp + * compiler.codegen.Test6378821 */ +package compiler.codegen; + public class Test6378821 { static final int[] ia = new int[] { 0x12345678 }; static final long[] la = new long[] { 0x12345678abcdefL }; diff --git a/test/compiler/codegen/6431242/Test.java b/test/compiler/codegen/Test6431242.java rename from test/compiler/codegen/6431242/Test.java rename to test/compiler/codegen/Test6431242.java --- a/test/compiler/codegen/6431242/Test.java +++ b/test/compiler/codegen/Test6431242.java @@ -25,152 +25,155 @@ /* * @test * @bug 6431242 - * @run main Test + * + * @run main compiler.codegen.Test6431242 */ -public class Test{ +package compiler.codegen; - int _len = 8; - int[] _arr_i = new int[_len]; - long[] _arr_l = new long[_len]; +public class Test6431242 { - int[] _arr_i_cp = new int [_len]; - long[] _arr_l_cp = new long [_len]; + int _len = 8; + int[] _arr_i = new int[_len]; + long[] _arr_l = new long[_len]; - int _k = 0x12345678; - int _j = 0; - int _ir = 0x78563412; - int _ir1 = 0x78563413; - int _ir2 = 0x79563412; + int[] _arr_i_cp = new int[_len]; + long[] _arr_l_cp = new long[_len]; - long _m = 0x123456789abcdef0L; - long _l = 0L; - long _lr = 0xf0debc9a78563412L; - long _lr1 = 0xf0debc9a78563413L; - long _lr2 = 0xf1debc9a78563412L; + int _k = 0x12345678; + int _j = 0; + int _ir = 0x78563412; + int _ir1 = 0x78563413; + int _ir2 = 0x79563412; - void init() { - for (int i=0; i<_arr_i.length; i++) { - _arr_i[i] = _k; - _arr_l[i] = _m; - } - } + long _m = 0x123456789abcdef0L; + long _l = 0L; + long _lr = 0xf0debc9a78563412L; + long _lr1 = 0xf0debc9a78563413L; + long _lr2 = 0xf1debc9a78563412L; - public int test_int_reversed(int i) { - return Integer.reverseBytes(i); - } - - public long test_long_reversed(long i) { - return Long.reverseBytes(i); - } - - public void test_copy_ints(int[] dst, int[] src) { - for(int i=0; i 0 ? Integer.valueOf(args[0]) : 1000000); - int warmupIters = (args.length > 1 ? Integer.valueOf(args[1]) : 20000); - System.out.println(iters + " iterations"); - TestAESEncode etest = new TestAESEncode(); - etest.prepare(); - // warm-up - System.out.println("Starting encryption warm-up"); - for (int i=0; i 0 ? Integer.valueOf(args[0]) : 1000000); + int warmupIters = (args.length > 1 ? Integer.valueOf(args[1]) : 20000); + System.out.println(iters + " iterations"); + TestAESEncode etest = new TestAESEncode(); + etest.prepare(); + // warm-up + System.out.println("Starting encryption warm-up"); + for (int i = 0; i < warmupIters; i++) { + etest.run(); + } + System.out.println("Finished encryption warm-up"); + long start = System.nanoTime(); + for (int i = 0; i < iters; i++) { + etest.run(); + } + long end = System.nanoTime(); + System.out.println("TestAESEncode runtime was " + (double) ((end - start) / 1000000.0) + " ms"); + + TestAESDecode dtest = new TestAESDecode(); + dtest.prepare(); + // warm-up + System.out.println("Starting decryption warm-up"); + for (int i = 0; i < warmupIters; i++) { + dtest.run(); + } + System.out.println("Finished decryption warm-up"); + start = System.nanoTime(); + for (int i = 0; i < iters; i++) { + dtest.run(); + } + end = System.nanoTime(); + System.out.println("TestAESDecode runtime was " + (double) ((end - start) / 1000000.0) + " ms"); } - System.out.println("Finished encryption warm-up"); - long start = System.nanoTime(); - for (int i=0; i(); List holders = new ArrayList<>(); - holders.add(new pool.sub.Klass()); - holders.add(new pool.sub.KlassDup()); - holders.add(new pool.subpack.Klass()); - holders.add(new pool.subpack.KlassDup()); - holders.add(new pool.sub.Klass.Internal()); - holders.add(new pool.subpack.KlassDup.Internal()); + holders.add(new compiler.compilercontrol.share.pool.sub.Klass()); + holders.add(new compiler.compilercontrol.share.pool.sub.KlassDup()); + holders.add(new compiler.compilercontrol.share.pool.subpack.Klass()); + holders.add(new compiler.compilercontrol.share.pool.subpack.KlassDup()); + holders.add(new compiler.compilercontrol.share.pool.sub.Klass.Internal()); + holders.add(new compiler.compilercontrol.share.pool.subpack.KlassDup.Internal()); for (MethodHolder holder : holders) { METHODS.addAll(holder.getAllMethods()); } diff --git a/test/compiler/compilercontrol/share/pool/SubMethodHolder.java b/test/compiler/compilercontrol/share/pool/SubMethodHolder.java --- a/test/compiler/compilercontrol/share/pool/SubMethodHolder.java +++ b/test/compiler/compilercontrol/share/pool/SubMethodHolder.java @@ -1,4 +1,4 @@ -package pool; +package compiler.compilercontrol.share.pool; import jdk.test.lib.Pair; diff --git a/test/compiler/compilercontrol/share/pool/sub/Klass.java b/test/compiler/compilercontrol/share/pool/sub/Klass.java --- a/test/compiler/compilercontrol/share/pool/sub/Klass.java +++ b/test/compiler/compilercontrol/share/pool/sub/Klass.java @@ -21,10 +21,10 @@ * questions. */ -package pool.sub; +package compiler.compilercontrol.share.pool.sub; -import pool.MethodHolder; -import pool.SubMethodHolder; +import compiler.compilercontrol.share.pool.MethodHolder; +import compiler.compilercontrol.share.pool.SubMethodHolder; /** * Simple class with methods to test signatures diff --git a/test/compiler/compilercontrol/share/pool/sub/KlassDup.java b/test/compiler/compilercontrol/share/pool/sub/KlassDup.java --- a/test/compiler/compilercontrol/share/pool/sub/KlassDup.java +++ b/test/compiler/compilercontrol/share/pool/sub/KlassDup.java @@ -21,9 +21,9 @@ * questions. */ -package pool.sub; +package compiler.compilercontrol.share.pool.sub; -import pool.MethodHolder; +import compiler.compilercontrol.share.pool.MethodHolder; /** * Simple class with methods to test signatures diff --git a/test/compiler/compilercontrol/share/pool/subpack/Klass.java b/test/compiler/compilercontrol/share/pool/subpack/Klass.java --- a/test/compiler/compilercontrol/share/pool/subpack/Klass.java +++ b/test/compiler/compilercontrol/share/pool/subpack/Klass.java @@ -21,15 +21,15 @@ * questions. */ -package pool.subpack; +package compiler.compilercontrol.share.pool.subpack; -import pool.MethodHolder; +import compiler.compilercontrol.share.pool.MethodHolder; /** * Simple class with methods to test signatures - * This is a clone of the pool.sub.Klass, but without inner class + * This is a clone of the c.c.s.pool.sub.Klass, but without inner class * This class has different package name to test prefix patterns like *Klass. - * *Klass patern should match both pool.sub.Klass and pool.subpack.Klass + * *Klass patern should match both c.c.s.pool.sub.Klass and c.c.s.pool.subpack.Klass */ public class Klass extends MethodHolder { public void method(int a, String[] ss, Integer i, byte[] bb, double[][] dd) { } diff --git a/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java b/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java --- a/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java +++ b/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java @@ -21,14 +21,14 @@ * questions. */ -package pool.subpack; +package compiler.compilercontrol.share.pool.subpack; -import pool.MethodHolder; -import pool.SubMethodHolder; +import compiler.compilercontrol.share.pool.MethodHolder; +import compiler.compilercontrol.share.pool.SubMethodHolder; /** - * This is a clone of the pool.sub.Klass used to test pattern matching - * Full class name contains both suffix (Dup) and prefix (pool.subpack) + * This is a clone of the c.c.s.pool.sub.Klass used to test pattern matching + * Full class name contains both suffix (Dup) and prefix (c.c.s.pool.subpack) */ public class KlassDup extends MethodHolder { public void method(int a, String[] ss, Integer i, byte[] bb, double[][] dd) { } diff --git a/test/compiler/compilercontrol/share/processors/LogProcessor.java b/test/compiler/compilercontrol/share/processors/LogProcessor.java --- a/test/compiler/compilercontrol/share/processors/LogProcessor.java +++ b/test/compiler/compilercontrol/share/processors/LogProcessor.java @@ -25,10 +25,10 @@ import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.method.MethodGenerator; +import compiler.compilercontrol.share.pool.PoolHelper; import compiler.compilercontrol.share.scenario.State; import jdk.test.lib.Asserts; import jdk.test.lib.OutputAnalyzer; -import pool.PoolHelper; import java.io.File; import java.io.FileNotFoundException; diff --git a/test/compiler/compilercontrol/share/processors/PrintProcessor.java b/test/compiler/compilercontrol/share/processors/PrintProcessor.java --- a/test/compiler/compilercontrol/share/processors/PrintProcessor.java +++ b/test/compiler/compilercontrol/share/processors/PrintProcessor.java @@ -26,10 +26,9 @@ import com.sun.management.HotSpotDiagnosticMXBean; import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.method.MethodGenerator; +import compiler.compilercontrol.share.pool.PoolHelper; import compiler.compilercontrol.share.scenario.State; import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.Pair; -import pool.PoolHelper; import java.lang.management.ManagementFactory; import java.lang.reflect.Executable; diff --git a/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java b/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java --- a/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java +++ b/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java @@ -24,8 +24,8 @@ package compiler.compilercontrol.share.scenario; import compiler.compilercontrol.share.method.MethodDescriptor; +import compiler.compilercontrol.share.pool.PoolHelper; import jdk.test.lib.Pair; -import pool.PoolHelper; import java.lang.reflect.Executable; import java.util.ArrayList; @@ -33,7 +33,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.concurrent.Callable; /** diff --git a/test/compiler/compilercontrol/share/scenario/Command.java b/test/compiler/compilercontrol/share/scenario/Command.java --- a/test/compiler/compilercontrol/share/scenario/Command.java +++ b/test/compiler/compilercontrol/share/scenario/Command.java @@ -24,6 +24,7 @@ package compiler.compilercontrol.share.scenario; import compiler.compilercontrol.share.processors.LogProcessor; + import java.util.Arrays; /** diff --git a/test/compiler/compilercontrol/share/scenario/DirectiveBuilder.java b/test/compiler/compilercontrol/share/scenario/DirectiveBuilder.java --- a/test/compiler/compilercontrol/share/scenario/DirectiveBuilder.java +++ b/test/compiler/compilercontrol/share/scenario/DirectiveBuilder.java @@ -26,15 +26,15 @@ import compiler.compilercontrol.share.JSONFile; import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.method.MethodGenerator; +import compiler.compilercontrol.share.pool.PoolHelper; import jdk.test.lib.Pair; -import pool.PoolHelper; import java.lang.reflect.Executable; -import java.util.List; -import java.util.Map; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; import java.util.concurrent.Callable; import java.util.stream.Collectors; diff --git a/test/compiler/compilercontrol/share/scenario/JcmdStateBuilder.java b/test/compiler/compilercontrol/share/scenario/JcmdStateBuilder.java --- a/test/compiler/compilercontrol/share/scenario/JcmdStateBuilder.java +++ b/test/compiler/compilercontrol/share/scenario/JcmdStateBuilder.java @@ -25,7 +25,7 @@ import compiler.compilercontrol.share.method.MethodDescriptor; import compiler.compilercontrol.share.method.MethodGenerator; -import pool.PoolHelper; +import compiler.compilercontrol.share.pool.PoolHelper; import jdk.test.lib.Pair; import java.lang.reflect.Executable; diff --git a/test/compiler/compilercontrol/share/scenario/Scenario.java b/test/compiler/compilercontrol/share/scenario/Scenario.java --- a/test/compiler/compilercontrol/share/scenario/Scenario.java +++ b/test/compiler/compilercontrol/share/scenario/Scenario.java @@ -24,6 +24,7 @@ package compiler.compilercontrol.share.scenario; import compiler.compilercontrol.share.method.MethodDescriptor; +import compiler.compilercontrol.share.pool.PoolHelper; import compiler.compilercontrol.share.processors.CommandProcessor; import compiler.compilercontrol.share.processors.LogProcessor; import compiler.compilercontrol.share.processors.PrintDirectivesProcessor; @@ -31,7 +32,6 @@ import jdk.test.lib.Asserts; import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.Pair; -import pool.PoolHelper; import java.lang.reflect.Executable; import java.util.ArrayList; diff --git a/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java b/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java --- a/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java +++ b/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java @@ -27,10 +27,15 @@ * @bug 8139771 * @summary Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash * @requires vm.gc=="Serial" | vm.gc=="Parallel" - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM TestEliminatedCastPPAtPhi + * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM + * compiler.controldependenc.TestEliminatedCastPPAtPhi * */ +package compiler.controldependency; + public class TestEliminatedCastPPAtPhi { static TestEliminatedCastPPAtPhi saved; diff --git a/test/compiler/cpuflags/AESIntrinsicsBase.java b/test/compiler/cpuflags/AESIntrinsicsBase.java --- a/test/compiler/cpuflags/AESIntrinsicsBase.java +++ b/test/compiler/cpuflags/AESIntrinsicsBase.java @@ -21,8 +21,12 @@ * questions. * */ + +package compiler.cpuflags; + +import compiler.codegen.aes.TestAESMain; +import compiler.cpuflags.predicate.AESSupportPredicate; import jdk.test.lib.cli.CommandLineOptionTest; -import predicate.AESSupportPredicate; import java.util.Arrays; import java.util.function.BooleanSupplier; @@ -45,7 +49,7 @@ public static final String[] TEST_AES_CMD = {"-XX:+IgnoreUnrecognizedVMOptions", "-XX:+PrintFlagsFinal", "-Xbatch", "-DcheckOutput=true", "-Dmode=CBC", - "TestAESMain"}; + TestAESMain.class.getName()}; protected AESIntrinsicsBase(BooleanSupplier predicate) { super(predicate); diff --git a/test/compiler/cpuflags/RestoreMXCSR.java b/test/compiler/cpuflags/RestoreMXCSR.java --- a/test/compiler/cpuflags/RestoreMXCSR.java +++ b/test/compiler/cpuflags/RestoreMXCSR.java @@ -28,16 +28,22 @@ * @library /testlibrary * @modules java.base/jdk.internal.misc * java.management + * + * @run driver compiler.cpuflags.RestoreMXCSR */ -import jdk.test.lib.*; + +package compiler.cpuflags; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; public class RestoreMXCSR { - public static void main(String[] args) throws Exception { - ProcessBuilder pb; - OutputAnalyzer out; + public static void main(String[] args) throws Exception { + ProcessBuilder pb; + OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder("-XX:+RestoreMXCSROnJNICalls", "-version"); - out = new OutputAnalyzer(pb.start()); - out.shouldHaveExitValue(0); - } + pb = ProcessTools.createJavaProcessBuilder("-XX:+RestoreMXCSROnJNICalls", "-version"); + out = new OutputAnalyzer(pb.start()); + out.shouldHaveExitValue(0); + } } diff --git a/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java b/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java --- a/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java +++ b/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java @@ -24,18 +24,21 @@ /* * @test - * @library /testlibrary /test/lib /compiler/codegen/7184394 / + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management * @ignore 8146128 - * @build TestAESIntrinsicsOnSupportedConfig TestAESMain + * @build compiler.cpuflags.TestAESIntrinsicsOnSupportedConfig + * compiler.codegen.aes.TestAESMain * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch - * TestAESIntrinsicsOnSupportedConfig + * compiler.cpuflags.TestAESIntrinsicsOnSupportedConfig */ +package compiler.cpuflags; + import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.Platform; import jdk.test.lib.ProcessTools; diff --git a/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java b/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java --- a/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java +++ b/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java @@ -24,19 +24,24 @@ /* * @test - * @library /testlibrary /test/lib /compiler/codegen/7184394 / + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestAESIntrinsicsOnUnsupportedConfig TestAESMain + * + * @build compiler.cpuflags.TestAESIntrinsicsOnUnsupportedConfig + * compiler.codegen.aes.TestAESMain * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -Xbatch TestAESIntrinsicsOnUnsupportedConfig + * -XX:+WhiteBoxAPI -Xbatch + * compiler.cpuflags.TestAESIntrinsicsOnUnsupportedConfig */ -import jdk.test.lib.cli.predicate.NotPredicate; +package compiler.cpuflags; + import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.ProcessTools; +import jdk.test.lib.cli.predicate.NotPredicate; public class TestAESIntrinsicsOnUnsupportedConfig extends AESIntrinsicsBase { diff --git a/test/compiler/cpuflags/TestSSE4Disabled.java b/test/compiler/cpuflags/TestSSE4Disabled.java --- a/test/compiler/cpuflags/TestSSE4Disabled.java +++ b/test/compiler/cpuflags/TestSSE4Disabled.java @@ -27,8 +27,12 @@ * @bug 8158214 * @requires (vm.simpleArch == "x64") * @summary Test correct execution without SSE 4. - * @run main/othervm -Xcomp -XX:UseSSE=3 TestSSE4Disabled + * + * @run main/othervm -Xcomp -XX:UseSSE=3 compiler.cpuflags.TestSSE4Disabled */ + +package compiler.cpuflags; + public class TestSSE4Disabled { public static void main(String args[]) { System.out.println("Passed"); diff --git a/test/compiler/cpuflags/predicate/AESSupportPredicate.java b/test/compiler/cpuflags/predicate/AESSupportPredicate.java --- a/test/compiler/cpuflags/predicate/AESSupportPredicate.java +++ b/test/compiler/cpuflags/predicate/AESSupportPredicate.java @@ -21,9 +21,10 @@ * questions. * */ -package predicate; +package compiler.cpuflags.predicate; import sun.hotspot.cpuinfo.CPUInfo; + import java.util.function.BooleanSupplier; public class AESSupportPredicate implements BooleanSupplier { diff --git a/test/compiler/debug/TraceIterativeGVN.java b/test/compiler/debug/TraceIterativeGVN.java --- a/test/compiler/debug/TraceIterativeGVN.java +++ b/test/compiler/debug/TraceIterativeGVN.java @@ -25,10 +25,14 @@ /* * @test + * * @run main/othervm -Xbatch -XX:-TieredCompilation * -XX:+IgnoreUnrecognizedVMOptions -XX:+TraceIterativeGVN - * TraceIterativeGVN + * compiler.debug.TraceIterativeGVN */ + +package compiler.debug; + public class TraceIterativeGVN { public static void main(String[] args) { for (int i = 0; i < 100_000; i++) { diff --git a/test/compiler/debug/VerifyAdapterSharing.java b/test/compiler/debug/VerifyAdapterSharing.java --- a/test/compiler/debug/VerifyAdapterSharing.java +++ b/test/compiler/debug/VerifyAdapterSharing.java @@ -28,17 +28,23 @@ * @library /testlibrary * @modules java.base/jdk.internal.misc * java.management + * + * @run driver compiler.debug.VerifyAdapterSharing */ -import jdk.test.lib.*; + +package compiler.debug; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; public class VerifyAdapterSharing { - public static void main(String[] args) throws Exception { - ProcessBuilder pb; - OutputAnalyzer out; + public static void main(String[] args) throws Exception { + ProcessBuilder pb; + OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder("-Xcomp", "-XX:+IgnoreUnrecognizedVMOptions", - "-XX:+VerifyAdapterSharing", "-version"); - out = new OutputAnalyzer(pb.start()); - out.shouldHaveExitValue(0); - } + pb = ProcessTools.createJavaProcessBuilder("-Xcomp", "-XX:+IgnoreUnrecognizedVMOptions", + "-XX:+VerifyAdapterSharing", "-version"); + out = new OutputAnalyzer(pb.start()); + out.shouldHaveExitValue(0); + } } diff --git a/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java b/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java --- a/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java +++ b/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java @@ -25,11 +25,17 @@ * @test * @bug 8050079 * @summary Compiles a monomorphic call to finalizeObject() on a modified java.lang.Object to test C1 CHA. + * * @build java.base/java.lang.Object * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-VerifyDependencies - * -XX:TieredStopAtLevel=1 -XX:CompileOnly=TestMonomorphicObjectCall::callFinalize - * -XX:CompileOnly=java.lang.Object::finalizeObject TestMonomorphicObjectCall + * -XX:TieredStopAtLevel=1 + * -XX:CompileCommand=compileonly,compiler.dependencies.TestMonomorphicObjectCall::callFinalize + * -XX:CompileCommand=compileonly,java.lang.Object::finalizeObject + * compiler.dependencies.MonomorphicObjectCall.TestMonomorphicObjectCall */ + +package compiler.dependencies.MonomorphicObjectCall; + public class TestMonomorphicObjectCall { private static void callFinalize(Object object) throws Throwable { diff --git a/test/compiler/eliminateAutobox/6934604/TestByteBoxing.java b/test/compiler/eliminateAutobox/TestByteBoxing.java rename from test/compiler/eliminateAutobox/6934604/TestByteBoxing.java rename to test/compiler/eliminateAutobox/TestByteBoxing.java --- a/test/compiler/eliminateAutobox/6934604/TestByteBoxing.java +++ b/test/compiler/eliminateAutobox/TestByteBoxing.java @@ -24,15 +24,23 @@ /* * @test * @bug 6934604 - * @summary enable parts of EliminateAutoBox by default - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestByteBoxing + * * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox - * -XX:CompileCommand=exclude,TestByteBoxing.dummy -XX:CompileCommand=exclude,TestByteBoxing.foo -XX:CompileCommand=exclude,TestByteBoxing.foob TestByteBoxing + * compiler.eliminateAutobox.TestByteBoxing + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::dummy + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foo + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foob + * compiler.eliminateAutobox.TestByteBoxing * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox - * -XX:CompileCommand=exclude,TestByteBoxing.dummy -XX:CompileCommand=exclude,TestByteBoxing.foo -XX:CompileCommand=exclude,TestByteBoxing.foob TestByteBoxing - * + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::dummy + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foo + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foob + * compiler.eliminateAutobox.TestByteBoxing */ +package compiler.eliminateAutobox; + public class TestByteBoxing { static final Byte ibc = new Byte((byte)1); diff --git a/test/compiler/eliminateAutobox/6934604/TestDoubleBoxing.java b/test/compiler/eliminateAutobox/TestDoubleBoxing.java rename from test/compiler/eliminateAutobox/6934604/TestDoubleBoxing.java rename to test/compiler/eliminateAutobox/TestDoubleBoxing.java --- a/test/compiler/eliminateAutobox/6934604/TestDoubleBoxing.java +++ b/test/compiler/eliminateAutobox/TestDoubleBoxing.java @@ -25,14 +25,23 @@ * @test * @bug 6934604 * @summary enable parts of EliminateAutoBox by default - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestDoubleBoxing + * * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox - * -XX:CompileCommand=exclude,TestDoubleBoxing.dummy -XX:CompileCommand=exclude,TestDoubleBoxing.foo -XX:CompileCommand=exclude,TestDoubleBoxing.foob TestDoubleBoxing + * compiler.eliminateAutobox.TestDoubleBoxing + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::dummy + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::foo + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::foob + * compiler.eliminateAutobox.TestDoubleBoxing * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox - * -XX:CompileCommand=exclude,TestDoubleBoxing.dummy -XX:CompileCommand=exclude,TestDoubleBoxing.foo -XX:CompileCommand=exclude,TestDoubleBoxing.foob TestDoubleBoxing - * + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::dummy + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::foo + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestDoubleBoxing::foob + * compiler.eliminateAutobox.TestDoubleBoxing */ +package compiler.eliminateAutobox; + public class TestDoubleBoxing { static final Double ibc = new Double(1.); diff --git a/test/compiler/eliminateAutobox/6934604/TestFloatBoxing.java b/test/compiler/eliminateAutobox/TestFloatBoxing.java rename from test/compiler/eliminateAutobox/6934604/TestFloatBoxing.java rename to test/compiler/eliminateAutobox/TestFloatBoxing.java --- a/test/compiler/eliminateAutobox/6934604/TestFloatBoxing.java +++ b/test/compiler/eliminateAutobox/TestFloatBoxing.java @@ -25,14 +25,23 @@ * @test * @bug 6934604 * @summary enable parts of EliminateAutoBox by default - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestFloatBoxing + * * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox - * -XX:CompileCommand=exclude,TestFloatBoxing.dummy -XX:CompileCommand=exclude,TestFloatBoxing.foo -XX:CompileCommand=exclude,TestFloatBoxing.foob TestFloatBoxing + * compiler.eliminateAutobox.TestFloatBoxing + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestFloatBoxing::dummy + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestFloatBoxing::foo + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestFloatBoxing::foob + * compiler.eliminateAutobox.TestFloatBoxing * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox - * -XX:CompileCommand=exclude,TestFloatBoxing.dummy -XX:CompileCommand=exclude,TestFloatBoxing.foo -XX:CompileCommand=exclude,TestFloatBoxing.foob TestFloatBoxing - * + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestFloatBoxing::dummy + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestFloatBoxing::foo + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestFloatBoxing::foob + * compiler.eliminateAutobox.TestFloatBoxing */ +package compiler.eliminateAutobox; + public class TestFloatBoxing { static final Float ibc = new Float(1.f); diff --git a/test/compiler/eliminateAutobox/6934604/TestIntBoxing.java b/test/compiler/eliminateAutobox/TestIntBoxing.java rename from test/compiler/eliminateAutobox/6934604/TestIntBoxing.java rename to test/compiler/eliminateAutobox/TestIntBoxing.java --- a/test/compiler/eliminateAutobox/6934604/TestIntBoxing.java +++ b/test/compiler/eliminateAutobox/TestIntBoxing.java @@ -25,14 +25,23 @@ * @test * @bug 6934604 * @summary enable parts of EliminateAutoBox by default - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestIntBoxing + * * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox - * -XX:CompileCommand=exclude,TestIntBoxing.dummy -XX:CompileCommand=exclude,TestIntBoxing.foo -XX:CompileCommand=exclude,TestIntBoxing.foob TestIntBoxing + * compiler.eliminateAutobox.TestIntBoxing + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestIntBoxing::dummy + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestIntBoxing::foo + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestIntBoxing::foob + * compiler.eliminateAutobox.TestIntBoxing * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox - * -XX:CompileCommand=exclude,TestIntBoxing.dummy -XX:CompileCommand=exclude,TestIntBoxing.foo -XX:CompileCommand=exclude,TestIntBoxing.foob TestIntBoxing - * + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestIntBoxing::dummy + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestIntBoxing::foo + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestIntBoxing::foob + * compiler.eliminateAutobox.TestIntBoxing */ +package compiler.eliminateAutobox; + public class TestIntBoxing { static final Integer ibc = new Integer(1); diff --git a/test/compiler/eliminateAutobox/6934604/TestLongBoxing.java b/test/compiler/eliminateAutobox/TestLongBoxing.java rename from test/compiler/eliminateAutobox/6934604/TestLongBoxing.java rename to test/compiler/eliminateAutobox/TestLongBoxing.java --- a/test/compiler/eliminateAutobox/6934604/TestLongBoxing.java +++ b/test/compiler/eliminateAutobox/TestLongBoxing.java @@ -25,14 +25,23 @@ * @test * @bug 6934604 * @summary enable parts of EliminateAutoBox by default - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestLongBoxing + * * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox - * -XX:CompileCommand=exclude,TestLongBoxing.dummy -XX:CompileCommand=exclude,TestLongBoxing.foo -XX:CompileCommand=exclude,TestLongBoxing.foob TestLongBoxing + * compiler.eliminateAutobox.TestLongBoxing + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestLongBoxing::dummy + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestLongBoxing::foo + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestLongBoxing::foob + * compiler.eliminateAutobox.TestLongBoxing * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox - * -XX:CompileCommand=exclude,TestLongBoxing.dummy -XX:CompileCommand=exclude,TestLongBoxing.foo -XX:CompileCommand=exclude,TestLongBoxing.foob TestLongBoxing - * + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestLongBoxing::dummy + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestLongBoxing::foo + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestLongBoxing::foob + * compiler.eliminateAutobox.TestLongBoxing */ +package compiler.eliminateAutobox; + public class TestLongBoxing { static final Long ibc = new Long(1); diff --git a/test/compiler/eliminateAutobox/6934604/TestShortBoxing.java b/test/compiler/eliminateAutobox/TestShortBoxing.java rename from test/compiler/eliminateAutobox/6934604/TestShortBoxing.java rename to test/compiler/eliminateAutobox/TestShortBoxing.java --- a/test/compiler/eliminateAutobox/6934604/TestShortBoxing.java +++ b/test/compiler/eliminateAutobox/TestShortBoxing.java @@ -25,14 +25,23 @@ * @test * @bug 6934604 * @summary enable parts of EliminateAutoBox by default - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestShortBoxing + * * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox - * -XX:CompileCommand=exclude,TestShortBoxing.dummy -XX:CompileCommand=exclude,TestShortBoxing.foo -XX:CompileCommand=exclude,TestShortBoxing.foob TestShortBoxing + * compiler.eliminateAutobox.TestShortBoxing + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestShortBoxing::dummy + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestShortBoxing::foo + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestShortBoxing::foob + * compiler.eliminateAutobox.TestShortBoxing * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox - * -XX:CompileCommand=exclude,TestShortBoxing.dummy -XX:CompileCommand=exclude,TestShortBoxing.foo -XX:CompileCommand=exclude,TestShortBoxing.foob TestShortBoxing - * + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestShortBoxing::dummy + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestShortBoxing::foo + * -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestShortBoxing::foob + * compiler.eliminateAutobox.TestShortBoxing */ +package compiler.eliminateAutobox; + public class TestShortBoxing { static final Short ibc = new Short((short)1); diff --git a/test/compiler/eliminateAutobox/UnsignedLoads.java b/test/compiler/eliminateAutobox/UnsignedLoads.java --- a/test/compiler/eliminateAutobox/UnsignedLoads.java +++ b/test/compiler/eliminateAutobox/UnsignedLoads.java @@ -27,10 +27,14 @@ * @test * @modules java.base/jdk.internal.misc * @library /testlibrary + * * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox * -XX:CompileOnly=::valueOf,::byteValue,::shortValue,::testUnsignedByte,::testUnsignedShort - * UnsignedLoads + * compiler.eliminateAutobox.UnsignedLoads */ + +package compiler.eliminateAutobox; + import static jdk.test.lib.Asserts.assertEQ; public class UnsignedLoads { diff --git a/test/compiler/escapeAnalysis/6689060/Test.java b/test/compiler/escapeAnalysis/Test6689060.java rename from test/compiler/escapeAnalysis/6689060/Test.java rename to test/compiler/escapeAnalysis/Test6689060.java --- a/test/compiler/escapeAnalysis/6689060/Test.java +++ b/test/compiler/escapeAnalysis/Test6689060.java @@ -25,552 +25,555 @@ * @test * @bug 6689060 * @summary Escape Analysis does not work with Compressed Oops - * @run main/othervm -Xbatch -XX:CompileCommand=exclude,Test.dummy -XX:+AggressiveOpts Test + * + * @run main/othervm -Xbatch -XX:+AggressiveOpts + * -XX:CompileCommand=exclude,compiler.escapeAnalysis.Test6689060::dummy + * compiler.escapeAnalysis.Test6689060 */ +package compiler.escapeAnalysis; + import java.lang.reflect.Array; -class Point { - int x; - int y; - Point next; - int ax[]; - int ay[]; - Point pax[]; - Point pay[]; - public Point getNext() { - return next; - } -} +public class Test6689060 { + static class Point { + int x; + int y; + Point next; + int ax[]; + int ay[]; + Point pax[]; + Point pay[]; -public class Test { - - void dummy() { - // Empty method to verify correctness of DebugInfo. - // Use -XX:CompileCommand=exclude,Test.dummy - } - - int ival(int i) { - return i*2; - } - - int test80(int y, int l, int i) { - Point p = new Point(); - p.ax = new int[2]; - p.ay = new int[2]; - int x = 3; - p.ax[0] = x; - p.ay[1] = 3 * x + y; - dummy(); - return p.ax[0] * p.ay[1]; - } - - int test81(int y, int l, int i) { - Point p = new Point(); - p.ax = new int[2]; - p.ay = new int[2]; - int x = 3; - p.ax[0] = x; - p.ay[1] = 3 * x + y; - dummy(); - return p.ax[0] * p.ay[1]; - } - - - int test44(int y) { - Point p1 = new Point(); - p1.x = ival(3); - dummy(); - p1.y = 3 * p1.x + y; - return p1.y; - } - - int test43(int y) { - Point p1 = new Point(); - if ( (y & 1) == 1 ) { - p1.x = ival(3); - } else { - p1.x = ival(5); - } - dummy(); - p1.y = 3 * p1.x + y; - return p1.y; - } - - int test42(int y) { - Point p1 = new Point(); - p1.x = 3; - for (int i = 0; i < y; i++) { - if ( (i & 1) == 1 ) { - p1.x += 4; - } - } - p1.y = 3 * y + p1.x; - return p1.y; - } - - int test40(int y) { - Point p1 = new Point(); - if ( (y & 1) == 1 ) { - p1.x = 3; - } else { - p1.x = 5; - } - p1.y = 3 * p1.x + y; - return p1.y; - } - - int test41(int y) { - Point p1 = new Point(); - if ( (y & 1) == 1 ) { - p1.x += 4; - } else { - p1.x += 5; - } - p1.y = 3 * p1.x + y; - return p1.y; - } - - Point test00(int y) { - int x = 3; - Point p = new Point(); - p.x = x; - p.y = 3 * x + y; - return p; - } - - Point test01(int y) { - int x = 3; - Point p = new Point(); - p.x = x; - p.y = 3 * x + y; - dummy(); - return p; - } - - Point test02(int y) { - int x = 3; - Point p1 = null; - for (int i = 0; i < y; i++) { - Point p2 = new Point(); - p2.x = x; - p2.y = 3 * y + x; - p2.next = p1; - p1 = p2; - } - return p1; - } - - Point test03(int y) { - int x = 3; - Point p1 = null; - for (int i = 0; i < y; i++) { - Point p2 = new Point(); - p2.x = x; - p2.y = 3 * y + x; - p2.next = p1; - p1 = p2; - } - dummy(); - return p1; - } - - Point test04(int y) { - int x = 3; - Point p1 = null; - for (int i = 0; i < y; i++) { - Point p2 = new Point(); - p2.x = x; - p2.y = 3 * y + x; - p2.next = p1; - dummy(); - p1 = p2; - } - return p1; - } - - int test05(int y) { - int x = 3; - Point p1 = new Point(); - for (int i = 0; i < y; i++) { - Point p2 = new Point(); - p2.x = x; - p2.y = 3 * y + x; - p1.next = p2; - p1 = p2; - } - return p1.y; - } - - int test0(int y) { - int x = 3; - Point p = new Point(); - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - - int test1(int y) { - Point p = new Point(); - if ( (y & 1) == 1 ) { - p = new Point(); // Kill previous - } - int x = 3; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - - int test2(int y) { - Point p1 = new Point(); - Point p2 = new Point(); - p1.x = 3; - p2.x = 4; - p1.y = 3 * p2.x + y; - p2.y = 3 * p1.x + y; - dummy(); - return p1.y * p2.y; - } - - int test3(int y, Point p1) { - Point p2 = new Point(); - p1.x = 3; - p2.x = 4; - p1.y = 3 * p2.x + y; - p2.y = 3 * p1.x + y; - dummy(); - return p1.y * p2.y; - } - - int test4(int y) { - Point p1 = new Point(); - Point p2 = new Point(); - if ( (y & 1) == 1 ) { - p1.x = 3; - p2.x = 4; - } else { - p1.x = 5; - p2.x = 6; - } - p1.y = 3 * p2.x + y; - p2.y = 3 * p1.x + y; - dummy(); - return p1.y * p2.y; - } - - int test5(int y, Point p1) { - Point p2 = new Point(); - if ( (y & 1) == 1 ) { - p1.x = 3; - p2.x = 4; - } else { - p1.x = 5; - p2.x = 6; - } - p1.y = 3 * p2.x + y; - p2.y = 3 * p1.x + y; - dummy(); - return p1.y * p2.y; - } - - int test6(int y) { - Point p1 = new Point(); - Point p2 = new Point(); - p1.next = p2; - if ( (y & 1) == 1 ) { - p1.x = 3; - p1.getNext().x = 4; - } else { - p1.x = 5; - p1.getNext().x = 6; - } - p1.y = 3 * p2.x + y; - p2.y = 3 * p1.x + y; - dummy(); - return p1.y * p2.y; - } - - int test7(int y, Point p1) { - Point p2 = new Point(); - p1.next = p2; - if ( (y & 1) == 1 ) { - p1.x = 3; - p1.getNext().x = 4; - } else { - p1.x = 5; - p1.getNext().x = 6; - } - p1.y = 3 * p2.x + y; - p2.y = 3 * p1.x + y; - dummy(); - return p1.y * p2.y; - } - - int test8(int y, int l, int i) { - Point p = new Point(); - p.ax = new int[l]; - p.ay = new int[l]; - int x = 3; - p.ax[i] = x; - p.ay[i] = 3 * x + y; - dummy(); - return p.ax[i] * p.ay[i]; - } - - int test9(int y, int l, int i) { - Point p = new Point(); - p.pax = new Point[l]; - p.pay = new Point[l]; - p.pax[i] = new Point(); - p.pay[i] = new Point(); - p.pax[i].x = 3; - p.pay[i].x = 4; - p.pax[i].y = 3 * p.pay[i].x + y; - p.pay[i].y = 3 * p.pax[i].x + y; - dummy(); - return p.pax[i].y * p.pay[i].y; - } - - int test10(int y, int l, int i, Class cls) { - Point p = new Point(); - try { - p.pax = (Point[])Array.newInstance(cls, l); - p.pax[i] = (Point)cls.newInstance(); - } - catch(java.lang.InstantiationException ex) { - return 0; - } - catch(java.lang.IllegalAccessException ex) { - return 0; - } - p.pax[i].x = 3; - p.pax[i].y = 3 * p.pax[i].x + y; - dummy(); - return p.pax[i].x * p.pax[i].y; - } - - int test11(int y) { - Point p1 = new Point(); - Point p2 = new Point(); - p1.next = p2; - if ( (y & 1) == 1 ) { - p1.x = 3; - p1.next.x = 4; - } else { - p1.x = 5; - p1.next.x = 6; - } - p1.y = 3 * p1.next.x + y; - p1.next.y = 3 * p1.x + y; - dummy(); - return p1.y * p1.next.y; - } - - int test12(int y) { - Point p1 = new Point(); - p1.next = p1; - if ( (y & 1) == 1 ) { - p1.x = 3; - p1.next.x = 4; - } else { - p1.x = 5; - p1.next.x = 6; - } - p1.y = 3 * p1.next.x + y; - p1.next.y = 3 * p1.x + y; - dummy(); - return p1.y * p1.next.y; - } - - - public static void main(String args[]) { - Test tsr = new Test(); - Point p = new Point(); - Point ptmp = p; - Class cls = Point.class; - int y = 0; - for (int i=0; i<10000; i++) { - ptmp.next = tsr.test00(1); - ptmp.next = tsr.test01(1); - ptmp.next = tsr.test02(1); - ptmp.next = tsr.test03(1); - ptmp.next = tsr.test04(1); - - y = tsr.test05(1); - - y = tsr.test80(y, 1, 0); - y = tsr.test81(y, 1, 0); - - y = tsr.test44(y); - y = tsr.test43(y); - y = tsr.test42(y); - y = tsr.test40(y); - y = tsr.test41(y); - - y = tsr.test0(y); - y = tsr.test1(y); - y = tsr.test2(y); - y = tsr.test3(y, p); - y = tsr.test4(y); - y = tsr.test5(y, p); - y = tsr.test6(y); - y = tsr.test7(y, p); - y = tsr.test8(y, 1, 0); - y = tsr.test9(y, 1, 0); - y = tsr.test10(y, 1, 0, cls); - y = tsr.test11(y); - y = tsr.test12(y); - } - for (int i=0; i<10000; i++) { - ptmp.next = tsr.test00(1); - ptmp.next = tsr.test01(1); - ptmp.next = tsr.test02(1); - ptmp.next = tsr.test03(1); - ptmp.next = tsr.test04(1); - - y = tsr.test05(1); - - y = tsr.test80(y, 1, 0); - y = tsr.test81(y, 1, 0); - - y = tsr.test44(y); - y = tsr.test43(y); - y = tsr.test42(y); - y = tsr.test40(y); - y = tsr.test41(y); - - y = tsr.test0(y); - y = tsr.test1(y); - y = tsr.test2(y); - y = tsr.test3(y, p); - y = tsr.test4(y); - y = tsr.test5(y, p); - y = tsr.test6(y); - y = tsr.test7(y, p); - y = tsr.test8(y, 1, 0); - y = tsr.test9(y, 1, 0); - y = tsr.test10(y, 1, 0, cls); - y = tsr.test11(y); - y = tsr.test12(y); - } - for (int i=0; i<10000; i++) { - ptmp.next = tsr.test00(1); - ptmp.next = tsr.test01(1); - ptmp.next = tsr.test02(1); - ptmp.next = tsr.test03(1); - ptmp.next = tsr.test04(1); - - y = tsr.test05(1); - - y = tsr.test80(y, 1, 0); - y = tsr.test81(y, 1, 0); - - y = tsr.test44(y); - y = tsr.test43(y); - y = tsr.test42(y); - y = tsr.test40(y); - y = tsr.test41(y); - - y = tsr.test0(y); - y = tsr.test1(y); - y = tsr.test2(y); - y = tsr.test3(y, p); - y = tsr.test4(y); - y = tsr.test5(y, p); - y = tsr.test6(y); - y = tsr.test7(y, p); - y = tsr.test8(y, 1, 0); - y = tsr.test9(y, 1, 0); - y = tsr.test10(y, 1, 0, cls); - y = tsr.test11(y); - y = tsr.test12(y); + public Point getNext() { + return next; + } } - int z = 0; - y = tsr.test80(0, 1, 0); - z += y; - System.out.println("After 'test80' y=" + y); - y = tsr.test81(0, 1, 0); - z += y; - System.out.println("After 'test81' y=" + y); + void dummy() { + // Empty method to verify correctness of DebugInfo. + // Use -XX:CompileCommand=exclude,Test.dummy + } - y = tsr.test44(0); - z += y; - System.out.println("After 'test44' y=" + y); - y = tsr.test43(0); - z += y; - System.out.println("After 'test43' y=" + y); - y = tsr.test42(0); - z += y; - System.out.println("After 'test42' y=" + y); - y = tsr.test40(0); - z += y; - System.out.println("After 'test40' y=" + y); - y = tsr.test41(0); - z += y; - System.out.println("After 'test41' y=" + y); + int ival(int i) { + return i * 2; + } - ptmp.next = tsr.test00(1); - z += y; - System.out.println("After 'test00' p.y=" + ptmp.next.y); - ptmp.next = tsr.test01(1); - z += y; - System.out.println("After 'test01' p.y=" + ptmp.next.y); - ptmp.next = tsr.test02(1); - z += y; - System.out.println("After 'test02' p.y=" + ptmp.next.y); - ptmp.next = tsr.test03(1); - z += y; - System.out.println("After 'test03' p.y=" + ptmp.next.y); - ptmp.next = tsr.test04(1); - z += y; - System.out.println("After 'test04' p.y=" + ptmp.next.y); + int test80(int y, int l, int i) { + Point p = new Point(); + p.ax = new int[2]; + p.ay = new int[2]; + int x = 3; + p.ax[0] = x; + p.ay[1] = 3 * x + y; + dummy(); + return p.ax[0] * p.ay[1]; + } - y = tsr.test05(1); - z += y; - System.out.println("After 'test05' y=" + y); + int test81(int y, int l, int i) { + Point p = new Point(); + p.ax = new int[2]; + p.ay = new int[2]; + int x = 3; + p.ax[0] = x; + p.ay[1] = 3 * x + y; + dummy(); + return p.ax[0] * p.ay[1]; + } - y = tsr.test0(0); - z += y; - System.out.println("After 'test0' y=" + y); - y = tsr.test1(0); - z += y; - System.out.println("After 'test1' y=" + y); - y = tsr.test2(0); - z += y; - System.out.println("After 'test2' y=" + y); - y = tsr.test3(0, new Point()); - z += y; - System.out.println("After 'test3' y=" + y); - y = tsr.test4(0); - z += y; - System.out.println("After 'test4' y=" + y); - y = tsr.test5(0, new Point()); - z += y; - System.out.println("After 'test5' y=" + y); - y = tsr.test6(0); - z += y; - System.out.println("After 'test6' y=" + y); - y = tsr.test7(0, new Point()); - z += y; - System.out.println("After 'test7' y=" + y); - y = tsr.test8(0, 1, 0); - z += y; - System.out.println("After 'test8' y=" + y); - y = tsr.test9(0, 1, 0); - z += y; - System.out.println("After 'test9' y=" + y); - y = tsr.test10(0, 1, 0, cls); - z += y; - System.out.println("After 'test10' y=" + y); - y = tsr.test11(0); - z += y; - System.out.println("After 'test11' y=" + y); - y = tsr.test12(0); - z += y; - System.out.println("After 'test12' y=" + y); - System.out.println("Sum of y =" + z); - } + + int test44(int y) { + Point p1 = new Point(); + p1.x = ival(3); + dummy(); + p1.y = 3 * p1.x + y; + return p1.y; + } + + int test43(int y) { + Point p1 = new Point(); + if ((y & 1) == 1) { + p1.x = ival(3); + } else { + p1.x = ival(5); + } + dummy(); + p1.y = 3 * p1.x + y; + return p1.y; + } + + int test42(int y) { + Point p1 = new Point(); + p1.x = 3; + for (int i = 0; i < y; i++) { + if ((i & 1) == 1) { + p1.x += 4; + } + } + p1.y = 3 * y + p1.x; + return p1.y; + } + + int test40(int y) { + Point p1 = new Point(); + if ((y & 1) == 1) { + p1.x = 3; + } else { + p1.x = 5; + } + p1.y = 3 * p1.x + y; + return p1.y; + } + + int test41(int y) { + Point p1 = new Point(); + if ((y & 1) == 1) { + p1.x += 4; + } else { + p1.x += 5; + } + p1.y = 3 * p1.x + y; + return p1.y; + } + + Point test00(int y) { + int x = 3; + Point p = new Point(); + p.x = x; + p.y = 3 * x + y; + return p; + } + + Point test01(int y) { + int x = 3; + Point p = new Point(); + p.x = x; + p.y = 3 * x + y; + dummy(); + return p; + } + + Point test02(int y) { + int x = 3; + Point p1 = null; + for (int i = 0; i < y; i++) { + Point p2 = new Point(); + p2.x = x; + p2.y = 3 * y + x; + p2.next = p1; + p1 = p2; + } + return p1; + } + + Point test03(int y) { + int x = 3; + Point p1 = null; + for (int i = 0; i < y; i++) { + Point p2 = new Point(); + p2.x = x; + p2.y = 3 * y + x; + p2.next = p1; + p1 = p2; + } + dummy(); + return p1; + } + + Point test04(int y) { + int x = 3; + Point p1 = null; + for (int i = 0; i < y; i++) { + Point p2 = new Point(); + p2.x = x; + p2.y = 3 * y + x; + p2.next = p1; + dummy(); + p1 = p2; + } + return p1; + } + + int test05(int y) { + int x = 3; + Point p1 = new Point(); + for (int i = 0; i < y; i++) { + Point p2 = new Point(); + p2.x = x; + p2.y = 3 * y + x; + p1.next = p2; + p1 = p2; + } + return p1.y; + } + + int test0(int y) { + int x = 3; + Point p = new Point(); + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; + } + + int test1(int y) { + Point p = new Point(); + if ((y & 1) == 1) { + p = new Point(); // Kill previous + } + int x = 3; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; + } + + int test2(int y) { + Point p1 = new Point(); + Point p2 = new Point(); + p1.x = 3; + p2.x = 4; + p1.y = 3 * p2.x + y; + p2.y = 3 * p1.x + y; + dummy(); + return p1.y * p2.y; + } + + int test3(int y, Point p1) { + Point p2 = new Point(); + p1.x = 3; + p2.x = 4; + p1.y = 3 * p2.x + y; + p2.y = 3 * p1.x + y; + dummy(); + return p1.y * p2.y; + } + + int test4(int y) { + Point p1 = new Point(); + Point p2 = new Point(); + if ((y & 1) == 1) { + p1.x = 3; + p2.x = 4; + } else { + p1.x = 5; + p2.x = 6; + } + p1.y = 3 * p2.x + y; + p2.y = 3 * p1.x + y; + dummy(); + return p1.y * p2.y; + } + + int test5(int y, Point p1) { + Point p2 = new Point(); + if ((y & 1) == 1) { + p1.x = 3; + p2.x = 4; + } else { + p1.x = 5; + p2.x = 6; + } + p1.y = 3 * p2.x + y; + p2.y = 3 * p1.x + y; + dummy(); + return p1.y * p2.y; + } + + int test6(int y) { + Point p1 = new Point(); + Point p2 = new Point(); + p1.next = p2; + if ((y & 1) == 1) { + p1.x = 3; + p1.getNext().x = 4; + } else { + p1.x = 5; + p1.getNext().x = 6; + } + p1.y = 3 * p2.x + y; + p2.y = 3 * p1.x + y; + dummy(); + return p1.y * p2.y; + } + + int test7(int y, Point p1) { + Point p2 = new Point(); + p1.next = p2; + if ((y & 1) == 1) { + p1.x = 3; + p1.getNext().x = 4; + } else { + p1.x = 5; + p1.getNext().x = 6; + } + p1.y = 3 * p2.x + y; + p2.y = 3 * p1.x + y; + dummy(); + return p1.y * p2.y; + } + + int test8(int y, int l, int i) { + Point p = new Point(); + p.ax = new int[l]; + p.ay = new int[l]; + int x = 3; + p.ax[i] = x; + p.ay[i] = 3 * x + y; + dummy(); + return p.ax[i] * p.ay[i]; + } + + int test9(int y, int l, int i) { + Point p = new Point(); + p.pax = new Point[l]; + p.pay = new Point[l]; + p.pax[i] = new Point(); + p.pay[i] = new Point(); + p.pax[i].x = 3; + p.pay[i].x = 4; + p.pax[i].y = 3 * p.pay[i].x + y; + p.pay[i].y = 3 * p.pax[i].x + y; + dummy(); + return p.pax[i].y * p.pay[i].y; + } + + int test10(int y, int l, int i, Class cls) { + Point p = new Point(); + try { + p.pax = (Point[]) Array.newInstance(cls, l); + p.pax[i] = (Point) cls.newInstance(); + } catch (java.lang.InstantiationException ex) { + return 0; + } catch (java.lang.IllegalAccessException ex) { + return 0; + } + p.pax[i].x = 3; + p.pax[i].y = 3 * p.pax[i].x + y; + dummy(); + return p.pax[i].x * p.pax[i].y; + } + + int test11(int y) { + Point p1 = new Point(); + Point p2 = new Point(); + p1.next = p2; + if ((y & 1) == 1) { + p1.x = 3; + p1.next.x = 4; + } else { + p1.x = 5; + p1.next.x = 6; + } + p1.y = 3 * p1.next.x + y; + p1.next.y = 3 * p1.x + y; + dummy(); + return p1.y * p1.next.y; + } + + int test12(int y) { + Point p1 = new Point(); + p1.next = p1; + if ((y & 1) == 1) { + p1.x = 3; + p1.next.x = 4; + } else { + p1.x = 5; + p1.next.x = 6; + } + p1.y = 3 * p1.next.x + y; + p1.next.y = 3 * p1.x + y; + dummy(); + return p1.y * p1.next.y; + } + + + public static void main(String args[]) { + Test6689060 tsr = new Test6689060(); + Point p = new Point(); + Point ptmp = p; + Class cls = Point.class; + int y = 0; + for (int i = 0; i < 10000; i++) { + ptmp.next = tsr.test00(1); + ptmp.next = tsr.test01(1); + ptmp.next = tsr.test02(1); + ptmp.next = tsr.test03(1); + ptmp.next = tsr.test04(1); + + y = tsr.test05(1); + + y = tsr.test80(y, 1, 0); + y = tsr.test81(y, 1, 0); + + y = tsr.test44(y); + y = tsr.test43(y); + y = tsr.test42(y); + y = tsr.test40(y); + y = tsr.test41(y); + + y = tsr.test0(y); + y = tsr.test1(y); + y = tsr.test2(y); + y = tsr.test3(y, p); + y = tsr.test4(y); + y = tsr.test5(y, p); + y = tsr.test6(y); + y = tsr.test7(y, p); + y = tsr.test8(y, 1, 0); + y = tsr.test9(y, 1, 0); + y = tsr.test10(y, 1, 0, cls); + y = tsr.test11(y); + y = tsr.test12(y); + } + for (int i = 0; i < 10000; i++) { + ptmp.next = tsr.test00(1); + ptmp.next = tsr.test01(1); + ptmp.next = tsr.test02(1); + ptmp.next = tsr.test03(1); + ptmp.next = tsr.test04(1); + + y = tsr.test05(1); + + y = tsr.test80(y, 1, 0); + y = tsr.test81(y, 1, 0); + + y = tsr.test44(y); + y = tsr.test43(y); + y = tsr.test42(y); + y = tsr.test40(y); + y = tsr.test41(y); + + y = tsr.test0(y); + y = tsr.test1(y); + y = tsr.test2(y); + y = tsr.test3(y, p); + y = tsr.test4(y); + y = tsr.test5(y, p); + y = tsr.test6(y); + y = tsr.test7(y, p); + y = tsr.test8(y, 1, 0); + y = tsr.test9(y, 1, 0); + y = tsr.test10(y, 1, 0, cls); + y = tsr.test11(y); + y = tsr.test12(y); + } + for (int i = 0; i < 10000; i++) { + ptmp.next = tsr.test00(1); + ptmp.next = tsr.test01(1); + ptmp.next = tsr.test02(1); + ptmp.next = tsr.test03(1); + ptmp.next = tsr.test04(1); + + y = tsr.test05(1); + + y = tsr.test80(y, 1, 0); + y = tsr.test81(y, 1, 0); + + y = tsr.test44(y); + y = tsr.test43(y); + y = tsr.test42(y); + y = tsr.test40(y); + y = tsr.test41(y); + + y = tsr.test0(y); + y = tsr.test1(y); + y = tsr.test2(y); + y = tsr.test3(y, p); + y = tsr.test4(y); + y = tsr.test5(y, p); + y = tsr.test6(y); + y = tsr.test7(y, p); + y = tsr.test8(y, 1, 0); + y = tsr.test9(y, 1, 0); + y = tsr.test10(y, 1, 0, cls); + y = tsr.test11(y); + y = tsr.test12(y); + } + + int z = 0; + y = tsr.test80(0, 1, 0); + z += y; + System.out.println("After 'test80' y=" + y); + y = tsr.test81(0, 1, 0); + z += y; + System.out.println("After 'test81' y=" + y); + + y = tsr.test44(0); + z += y; + System.out.println("After 'test44' y=" + y); + y = tsr.test43(0); + z += y; + System.out.println("After 'test43' y=" + y); + y = tsr.test42(0); + z += y; + System.out.println("After 'test42' y=" + y); + y = tsr.test40(0); + z += y; + System.out.println("After 'test40' y=" + y); + y = tsr.test41(0); + z += y; + System.out.println("After 'test41' y=" + y); + + ptmp.next = tsr.test00(1); + z += y; + System.out.println("After 'test00' p.y=" + ptmp.next.y); + ptmp.next = tsr.test01(1); + z += y; + System.out.println("After 'test01' p.y=" + ptmp.next.y); + ptmp.next = tsr.test02(1); + z += y; + System.out.println("After 'test02' p.y=" + ptmp.next.y); + ptmp.next = tsr.test03(1); + z += y; + System.out.println("After 'test03' p.y=" + ptmp.next.y); + ptmp.next = tsr.test04(1); + z += y; + System.out.println("After 'test04' p.y=" + ptmp.next.y); + + y = tsr.test05(1); + z += y; + System.out.println("After 'test05' y=" + y); + + y = tsr.test0(0); + z += y; + System.out.println("After 'test0' y=" + y); + y = tsr.test1(0); + z += y; + System.out.println("After 'test1' y=" + y); + y = tsr.test2(0); + z += y; + System.out.println("After 'test2' y=" + y); + y = tsr.test3(0, new Point()); + z += y; + System.out.println("After 'test3' y=" + y); + y = tsr.test4(0); + z += y; + System.out.println("After 'test4' y=" + y); + y = tsr.test5(0, new Point()); + z += y; + System.out.println("After 'test5' y=" + y); + y = tsr.test6(0); + z += y; + System.out.println("After 'test6' y=" + y); + y = tsr.test7(0, new Point()); + z += y; + System.out.println("After 'test7' y=" + y); + y = tsr.test8(0, 1, 0); + z += y; + System.out.println("After 'test8' y=" + y); + y = tsr.test9(0, 1, 0); + z += y; + System.out.println("After 'test9' y=" + y); + y = tsr.test10(0, 1, 0, cls); + z += y; + System.out.println("After 'test10' y=" + y); + y = tsr.test11(0); + z += y; + System.out.println("After 'test11' y=" + y); + y = tsr.test12(0); + z += y; + System.out.println("After 'test12' y=" + y); + System.out.println("Sum of y =" + z); + } } diff --git a/test/compiler/escapeAnalysis/6726999/Test.java b/test/compiler/escapeAnalysis/Test6726999.java rename from test/compiler/escapeAnalysis/6726999/Test.java rename to test/compiler/escapeAnalysis/Test6726999.java --- a/test/compiler/escapeAnalysis/6726999/Test.java +++ b/test/compiler/escapeAnalysis/Test6726999.java @@ -26,1394 +26,1396 @@ * @test * @bug 6726999 * @summary nsk/stress/jck12a/jck12a010 assert(n != NULL,"Bad immediate dominator info."); - * @run main/othervm -Xbatch -XX:CompileCommand=exclude,Test.dummy -XX:+AggressiveOpts Test + * + * @run main/othervm -Xbatch -XX:+AggressiveOpts + * -XX:CompileCommand=exclude,compiler.escapeAnalysis.Test6726999::dummy + * compiler.escapeAnalysis.Test6726999 */ -import java.lang.reflect.Array; +package compiler.escapeAnalysis; -class Point { - int x; - int y; -} +public class Test6726999 { + static class Point { + int x; + int y; + } -public class Test { + void dummy() { + // Empty method to verify correctness of DebugInfo. + // Use -XX:CompileCommand=exclude,Test.dummy + } - void dummy() { - // Empty method to verify correctness of DebugInfo. - // Use -XX:CompileCommand=exclude,Test.dummy - } + int test0_0_0(int y) { + int x = 3; + Point p = new Point(); + dummy(); + p.x = x; + p.y = 3 * x + y; + return p.x * p.y; + } - int test0_0_0(int y) { - int x = 3; - Point p = new Point(); - dummy(); - p.x = x; - p.y = 3 * x + y; - return p.x * p.y; - } + int test0_0_1(int y) { + int x = 3; + Point p = null; + dummy(); + p = new Point(); + dummy(); + p.x = x; + p.y = 3 * x + y; + return p.x * p.y; + } - int test0_0_1(int y) { - int x = 3; - Point p = null; - dummy(); - p = new Point(); - dummy(); - p.x = x; - p.y = 3 * x + y; - return p.x * p.y; - } + int test0_0_2(int y) { + int x = 3; + Point p = new Point(); + dummy(); + p = new Point(); + dummy(); + p.x = x; + p.y = 3 * x + y; + return p.x * p.y; + } - int test0_0_2(int y) { - int x = 3; - Point p = new Point(); - dummy(); - p = new Point(); - dummy(); - p.x = x; - p.y = 3 * x + y; - return p.x * p.y; - } + int test0_0_3(int y) { + int x = 3; + Point p[] = new Point[1]; + p[0] = new Point(); + dummy(); + p[0].x = x; + p[0].y = 3 * x + y; + return p[0].x * p[0].y; + } - int test0_0_3(int y) { - int x = 3; - Point p[] = new Point[1]; - p[0] = new Point(); - dummy(); - p[0].x = x; - p[0].y = 3 * x + y; - return p[0].x * p[0].y; - } + int test0_0_4(int y) { + int x = 3; + Point p[] = new Point[1]; + dummy(); + p[0] = new Point(); + dummy(); + p[0].x = x; + p[0].y = 3 * x + y; + return p[0].x * p[0].y; + } - int test0_0_4(int y) { - int x = 3; - Point p[] = new Point[1]; - dummy(); - p[0] = new Point(); - dummy(); - p[0].x = x; - p[0].y = 3 * x + y; - return p[0].x * p[0].y; - } + int test0_0_5(int y) { + int x = 3; + Point p[] = new Point[1]; + dummy(); + p[0] = null; + dummy(); + p[0] = new Point(); + dummy(); + p[0].x = x; + p[0].y = 3 * x + y; + return p[0].x * p[0].y; + } - int test0_0_5(int y) { - int x = 3; - Point p[] = new Point[1]; - dummy(); - p[0] = null; - dummy(); - p[0] = new Point(); - dummy(); - p[0].x = x; - p[0].y = 3 * x + y; - return p[0].x * p[0].y; - } + int test0_0_6(int y) { + int x = 3; + Point p[] = new Point[1]; + p[0] = new Point(); + dummy(); + p[0] = new Point(); + dummy(); + p[0].x = x; + p[0].y = 3 * x + y; + return p[0].x * p[0].y; + } - int test0_0_6(int y) { - int x = 3; - Point p[] = new Point[1]; - p[0] = new Point(); - dummy(); - p[0] = new Point(); - dummy(); - p[0].x = x; - p[0].y = 3 * x + y; - return p[0].x * p[0].y; - } + int test0_1_3(int y) { + int x = 3; + Point p1 = new Point(); + dummy(); + Point p[] = new Point[1]; + p[0] = p1; + dummy(); + p[0].x = x; + p[0].y = 3 * x + y; + return p[0].x * p[0].y; + } - int test0_1_3(int y) { - int x = 3; - Point p1 = new Point(); - dummy(); - Point p[] = new Point[1]; - p[0] = p1; - dummy(); - p[0].x = x; - p[0].y = 3 * x + y; - return p[0].x * p[0].y; - } + int test0_1_4(int y) { + int x = 3; + Point p1 = new Point(); + dummy(); + Point p[] = new Point[1]; + dummy(); + p[0] = p1; + dummy(); + p[0].x = x; + p[0].y = 3 * x + y; + return p[0].x * p[0].y; + } - int test0_1_4(int y) { - int x = 3; - Point p1 = new Point(); - dummy(); - Point p[] = new Point[1]; - dummy(); - p[0] = p1; - dummy(); - p[0].x = x; - p[0].y = 3 * x + y; - return p[0].x * p[0].y; - } + int test0_1_5(int y) { + int x = 3; + Point p1 = new Point(); + dummy(); + Point p[] = new Point[1]; + dummy(); + p[0] = null; + dummy(); + p[0] = p1; + dummy(); + p[0].x = x; + p[0].y = 3 * x + y; + return p[0].x * p[0].y; + } - int test0_1_5(int y) { - int x = 3; - Point p1 = new Point(); - dummy(); - Point p[] = new Point[1]; - dummy(); - p[0] = null; - dummy(); - p[0] = p1; - dummy(); - p[0].x = x; - p[0].y = 3 * x + y; - return p[0].x * p[0].y; - } + int test0_1_6(int y) { + int x = 3; + Point p1 = new Point(); + dummy(); + Point p2 = new Point(); + dummy(); + Point p[] = new Point[1]; + p[0] = p1; + dummy(); + p[0] = p2; + dummy(); + p[0].x = x; + p[0].y = 3 * x + y; + return p[0].x * p[0].y; + } - int test0_1_6(int y) { - int x = 3; - Point p1 = new Point(); - dummy(); - Point p2 = new Point(); - dummy(); - Point p[] = new Point[1]; - p[0] = p1; - dummy(); - p[0] = p2; - dummy(); - p[0].x = x; - p[0].y = 3 * x + y; - return p[0].x * p[0].y; - } + int test1_0_0(int y) { + Point p = new Point(); + if ((y & 1) == 1) { + p = new Point(); + } + int x = 3; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; + } - int test1_0_0(int y) { - Point p = new Point(); - if ( (y & 1) == 1 ) { - p = new Point(); + int test1_0_1(int y) { + Point p = null; + if ((y & 1) == 1) { + p = new Point(); + } + int x = 3; + if (p == null) + return (3 * x + y) * x; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; } - int x = 3; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - int test1_0_1(int y) { - Point p = null; - if ( (y & 1) == 1 ) { - p = new Point(); + int test1_0_2(int y) { + Point p[] = new Point[1]; + if ((y & 1) == 1) { + p[0] = new Point(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p == null ) - return (3 * x + y) * x; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - int test1_0_2(int y) { - Point p[] = new Point[1]; - if ( (y & 1) == 1 ) { - p[0] = new Point(); + int test1_0_3(int y) { + Point p[] = new Point[1]; + p[0] = null; + if ((y & 1) == 1) { + p[0] = new Point(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_0_3(int y) { - Point p[] = new Point[1]; - p[0] = null; - if ( (y & 1) == 1 ) { - p[0] = new Point(); + int test1_0_4(int y) { + Point p[] = new Point[1]; + p[0] = new Point(); + if ((y & 1) == 1) { + p[0] = new Point(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_0_4(int y) { - Point p[] = new Point[1]; - p[0] = new Point(); - if ( (y & 1) == 1 ) { - p[0] = new Point(); + int test1_0_5(int y) { + Point p[] = new Point[1]; + if ((y & 1) == 1) { + p[0] = new Point(); + } else { + p[0] = null; + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_0_5(int y) { - Point p[] = new Point[1]; - if ( (y & 1) == 1 ) { - p[0] = new Point(); - } else { - p[0] = null; + int test1_0_6(int y) { + Point p[] = new Point[1]; + if ((y & 1) == 1) { + p[0] = new Point(); + } else { + p[0] = new Point(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_0_6(int y) { - Point p[] = new Point[1]; - if ( (y & 1) == 1 ) { - p[0] = new Point(); - } else { - p[0] = new Point(); + int test1_1_0(int y) { + Point p = new Point(); + if ((y & 1) == 1) { + dummy(); + p = new Point(); + dummy(); + } + int x = 3; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_1_0(int y) { - Point p = new Point(); - if ( (y & 1) == 1 ) { - dummy(); - p = new Point(); - dummy(); + int test1_1_1(int y) { + Point p = null; + if ((y & 1) == 1) { + dummy(); + p = new Point(); + dummy(); + } + int x = 3; + if (p == null) + return (3 * x + y) * x; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; } - int x = 3; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - int test1_1_1(int y) { - Point p = null; - if ( (y & 1) == 1 ) { - dummy(); - p = new Point(); - dummy(); + int test1_1_2(int y) { + Point p[] = new Point[1]; + if ((y & 1) == 1) { + dummy(); + p[0] = new Point(); + dummy(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p == null ) - return (3 * x + y) * x; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - int test1_1_2(int y) { - Point p[] = new Point[1]; - if ( (y & 1) == 1 ) { - dummy(); - p[0] = new Point(); - dummy(); + int test1_1_3(int y) { + Point p[] = new Point[1]; + dummy(); + p[0] = null; + if ((y & 1) == 1) { + dummy(); + p[0] = new Point(); + dummy(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_1_3(int y) { - Point p[] = new Point[1]; - dummy(); - p[0] = null; - if ( (y & 1) == 1 ) { - dummy(); - p[0] = new Point(); - dummy(); + int test1_1_4(int y) { + Point p[] = new Point[1]; + dummy(); + p[0] = new Point(); + if ((y & 1) == 1) { + dummy(); + p[0] = new Point(); + dummy(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_1_4(int y) { - Point p[] = new Point[1]; - dummy(); - p[0] = new Point(); - if ( (y & 1) == 1 ) { - dummy(); - p[0] = new Point(); - dummy(); + int test1_1_5(int y) { + Point p[] = new Point[1]; + if ((y & 1) == 1) { + dummy(); + p[0] = new Point(); + dummy(); + } else { + dummy(); + p[0] = null; + dummy(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_1_5(int y) { - Point p[] = new Point[1]; - if ( (y & 1) == 1 ) { - dummy(); - p[0] = new Point(); - dummy(); - } else { - dummy(); - p[0] = null; - dummy(); + int test1_1_6(int y) { + Point p[] = new Point[1]; + if ((y & 1) == 1) { + dummy(); + p[0] = new Point(); + dummy(); + } else { + dummy(); + p[0] = new Point(); + dummy(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_1_6(int y) { - Point p[] = new Point[1]; - if ( (y & 1) == 1 ) { - dummy(); - p[0] = new Point(); - dummy(); - } else { - dummy(); - p[0] = new Point(); - dummy(); + int test1_2_0(int y) { + Point p1 = new Point(); + dummy(); + Point p = new Point(); + if ((y & 1) == 1) { + dummy(); + p = p1; + dummy(); + } + int x = 3; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_2_0(int y) { - Point p1 = new Point(); - dummy(); - Point p = new Point(); - if ( (y & 1) == 1 ) { - dummy(); - p = p1; - dummy(); + int test1_2_1(int y) { + Point p1 = new Point(); + dummy(); + Point p = null; + if ((y & 1) == 1) { + dummy(); + p = p1; + dummy(); + } + int x = 3; + if (p == null) + return (3 * x + y) * x; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; } - int x = 3; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - int test1_2_1(int y) { - Point p1 = new Point(); - dummy(); - Point p = null; - if ( (y & 1) == 1 ) { - dummy(); - p = p1; - dummy(); + int test1_2_2(int y) { + Point p1 = new Point(); + dummy(); + Point p[] = new Point[1]; + if ((y & 1) == 1) { + dummy(); + p[0] = p1; + dummy(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p == null ) - return (3 * x + y) * x; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - int test1_2_2(int y) { - Point p1 = new Point(); - dummy(); - Point p[] = new Point[1]; - if ( (y & 1) == 1 ) { - dummy(); - p[0] = p1; - dummy(); + int test1_2_3(int y) { + Point p1 = new Point(); + dummy(); + Point p[] = new Point[1]; + dummy(); + p[0] = null; + if ((y & 1) == 1) { + dummy(); + p[0] = p1; + dummy(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_2_3(int y) { - Point p1 = new Point(); - dummy(); - Point p[] = new Point[1]; - dummy(); - p[0] = null; - if ( (y & 1) == 1 ) { - dummy(); - p[0] = p1; - dummy(); + int test1_2_4(int y) { + Point p1 = new Point(); + dummy(); + Point p2 = new Point(); + dummy(); + Point p[] = new Point[1]; + dummy(); + p[0] = p1; + if ((y & 1) == 1) { + dummy(); + p[0] = p2; + dummy(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_2_4(int y) { - Point p1 = new Point(); - dummy(); - Point p2 = new Point(); - dummy(); - Point p[] = new Point[1]; - dummy(); - p[0] = p1; - if ( (y & 1) == 1 ) { - dummy(); - p[0] = p2; - dummy(); + int test1_2_5(int y) { + Point p1 = new Point(); + dummy(); + Point p[] = new Point[1]; + if ((y & 1) == 1) { + dummy(); + p[0] = p1; + dummy(); + } else { + dummy(); + p[0] = null; + dummy(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_2_5(int y) { - Point p1 = new Point(); - dummy(); - Point p[] = new Point[1]; - if ( (y & 1) == 1 ) { - dummy(); - p[0] = p1; - dummy(); - } else { - dummy(); - p[0] = null; - dummy(); + int test1_2_6(int y) { + Point p1 = new Point(); + dummy(); + Point p2 = new Point(); + dummy(); + Point p[] = new Point[1]; + if ((y & 1) == 1) { + dummy(); + p[0] = p1; + dummy(); + } else { + dummy(); + p[0] = p2; + dummy(); + } + int x = 3; + if (p[0] == null) + return (3 * x + y) * x; + p[0].x = x; + p[0].y = 3 * x + y; + dummy(); + return p[0].x * p[0].y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test1_2_6(int y) { - Point p1 = new Point(); - dummy(); - Point p2 = new Point(); - dummy(); - Point p[] = new Point[1]; - if ( (y & 1) == 1 ) { - dummy(); - p[0] = p1; - dummy(); - } else { - dummy(); - p[0] = p2; - dummy(); + int test2_0_0(int y) { + Point p = new Point(); + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + p = new Point(); + } + int x = 3; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; } - int x = 3; - if ( p[0] == null ) - return (3 * x + y) * x; - p[0].x = x; - p[0].y = 3 * x + y; - dummy(); - return p[0].x * p[0].y; - } - int test2_0_0(int y) { - Point p = new Point(); - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - p = new Point(); + int test2_0_1(int y) { + Point p = null; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + p = new Point(); + } + int x = 3; + if (p == null) + return (3 * x + y) * x; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; } - int x = 3; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - int test2_0_1(int y) { - Point p = null; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - p = new Point(); + int test2_0_2(int y) { + Point p[] = new Point[3]; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + p[i] = new Point(); + } + int x = 3; + int j = (y & 1); + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - if ( p == null ) - return (3 * x + y) * x; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - int test2_0_2(int y) { - Point p[] = new Point[3]; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - p[i] = new Point(); + int test2_0_3(int y) { + Point p[] = new Point[3]; + int j = (y & 1); + p[j] = null; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + p[i] = new Point(); + } + int x = 3; + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - int j = (y & 1); - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } - int test2_0_3(int y) { - Point p[] = new Point[3]; - int j = (y & 1); - p[j] = null; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - p[i] = new Point(); + int test2_0_4(int y) { + Point p[] = new Point[3]; + int j = (y & 1); + p[j] = new Point(); + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + p[i] = new Point(); + } + int x = 3; + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } - int test2_0_4(int y) { - Point p[] = new Point[3]; - int j = (y & 1); - p[j] = new Point(); - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - p[i] = new Point(); + int test2_0_5(int y) { + Point p[] = new Point[3]; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + p[i] = new Point(); + } + for (int i = 0; i < lim; i++) { + p[i] = null; + } + int x = 3; + int j = (y & 1); + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } - int test2_0_5(int y) { - Point p[] = new Point[3]; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - p[i] = new Point(); + int test2_0_6(int y) { + Point p[] = new Point[3]; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + p[i] = new Point(); + } + for (int i = 0; i < lim; i++) { + p[i] = new Point(); + } + int x = 3; + int j = (y & 1); + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - for (int i = 0; i < lim; i++) { - p[i] = null; + + int test2_1_0(int y) { + Point p = new Point(); + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p = new Point(); + dummy(); + } + int x = 3; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; } - int x = 3; - int j = (y & 1); - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } - int test2_0_6(int y) { - Point p[] = new Point[3]; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - p[i] = new Point(); + int test2_1_1(int y) { + Point p = null; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p = new Point(); + dummy(); + } + int x = 3; + if (p == null) + return (3 * x + y) * x; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; } - for (int i = 0; i < lim; i++) { - p[i] = new Point(); + + int test2_1_2(int y) { + Point p[] = new Point[3]; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = new Point(); + dummy(); + } + int x = 3; + int j = (y & 1); + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - int j = (y & 1); - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } - int test2_1_0(int y) { - Point p = new Point(); - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p = new Point(); - dummy(); + int test2_1_3(int y) { + Point p[] = new Point[3]; + dummy(); + int j = (y & 1); + p[j] = null; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = new Point(); + dummy(); + } + int x = 3; + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - int test2_1_1(int y) { - Point p = null; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p = new Point(); - dummy(); + int test2_1_4(int y) { + Point p[] = new Point[3]; + dummy(); + int j = (y & 1); + p[j] = new Point(); + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = new Point(); + dummy(); + } + int x = 3; + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - if ( p == null ) - return (3 * x + y) * x; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - int test2_1_2(int y) { - Point p[] = new Point[3]; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = new Point(); - dummy(); + int test2_1_5(int y) { + Point p[] = new Point[3]; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = new Point(); + dummy(); + } + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = null; + dummy(); + } + int x = 3; + int j = (y & 1); + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - int j = (y & 1); - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } - int test2_1_3(int y) { - Point p[] = new Point[3]; - dummy(); - int j = (y & 1); - p[j] = null; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = new Point(); - dummy(); + int test2_1_6(int y) { + Point p[] = new Point[3]; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = new Point(); + dummy(); + } + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = new Point(); + dummy(); + } + int x = 3; + int j = (y & 1); + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } - int test2_1_4(int y) { - Point p[] = new Point[3]; - dummy(); - int j = (y & 1); - p[j] = new Point(); - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = new Point(); - dummy(); + int test2_2_0(int y) { + Point p1 = new Point(); + dummy(); + Point p = new Point(); + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p = p1; + dummy(); + } + int x = 3; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; } - int x = 3; - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } - int test2_1_5(int y) { - Point p[] = new Point[3]; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = new Point(); - dummy(); + int test2_2_1(int y) { + Point p1 = new Point(); + dummy(); + Point p = null; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p = p1; + dummy(); + } + int x = 3; + if (p == null) + return (3 * x + y) * x; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; } - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = null; - dummy(); + + int test2_2_2(int y) { + Point p1 = new Point(); + dummy(); + Point p[] = new Point[3]; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = p1; + dummy(); + } + int x = 3; + int j = (y & 1); + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - int j = (y & 1); - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } - int test2_1_6(int y) { - Point p[] = new Point[3]; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = new Point(); - dummy(); + int test2_2_3(int y) { + Point p1 = new Point(); + dummy(); + Point p[] = new Point[3]; + dummy(); + int j = (y & 1); + p[j] = null; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = p1; + dummy(); + } + int x = 3; + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = new Point(); - dummy(); + + int test2_2_4(int y) { + Point p1 = new Point(); + dummy(); + Point p2 = new Point(); + dummy(); + Point p[] = new Point[3]; + dummy(); + int j = (y & 1); + p[j] = p1; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = p2; + dummy(); + } + int x = 3; + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - int j = (y & 1); - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } - int test2_2_0(int y) { - Point p1 = new Point(); - dummy(); - Point p = new Point(); - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p = p1; - dummy(); + int test2_2_5(int y) { + Point p1 = new Point(); + dummy(); + Point p[] = new Point[3]; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = p1; + dummy(); + } + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = null; + dummy(); + } + int x = 3; + int j = (y & 1); + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - int test2_2_1(int y) { - Point p1 = new Point(); - dummy(); - Point p = null; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p = p1; - dummy(); + int test2_2_6(int y) { + Point p1 = new Point(); + dummy(); + Point p2 = new Point(); + dummy(); + Point p[] = new Point[3]; + int lim = (y & 3); + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = p1; + dummy(); + } + for (int i = 0; i < lim; i++) { + dummy(); + p[i] = p2; + dummy(); + } + int x = 3; + int j = (y & 1); + if (p[j] == null) + return (3 * x + y) * x; + p[j].x = x; + p[j].y = 3 * x + y; + dummy(); + return p[j].x * p[0].y; } - int x = 3; - if ( p == null ) - return (3 * x + y) * x; - p.x = x; - p.y = 3 * x + y; - dummy(); - return p.x * p.y; - } - int test2_2_2(int y) { - Point p1 = new Point(); - dummy(); - Point p[] = new Point[3]; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = p1; - dummy(); - } - int x = 3; - int j = (y & 1); - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } + public static void main(String args[]) { + Test6726999 tsr = new Test6726999(); + Point p = new Point(); + Point ptmp = p; + Class cls = Point.class; + int y = 0; + for (int i = 0; i < 10000; i++) { + y = tsr.test0_0_0(y); + y = tsr.test0_0_0(y); + y = tsr.test0_0_1(y); + y = tsr.test0_0_1(y); + y = tsr.test0_0_2(y); + y = tsr.test0_0_2(y); + y = tsr.test0_0_3(y); + y = tsr.test0_0_3(y); + y = tsr.test0_0_4(y); + y = tsr.test0_0_4(y); + y = tsr.test0_0_5(y); + y = tsr.test0_0_5(y); + y = tsr.test0_0_6(y); + y = tsr.test0_0_6(y); - int test2_2_3(int y) { - Point p1 = new Point(); - dummy(); - Point p[] = new Point[3]; - dummy(); - int j = (y & 1); - p[j] = null; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = p1; - dummy(); - } - int x = 3; - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } + y = tsr.test0_1_3(y); + y = tsr.test0_1_3(y); + y = tsr.test0_1_4(y); + y = tsr.test0_1_4(y); + y = tsr.test0_1_5(y); + y = tsr.test0_1_5(y); + y = tsr.test0_1_6(y); + y = tsr.test0_1_6(y); - int test2_2_4(int y) { - Point p1 = new Point(); - dummy(); - Point p2 = new Point(); - dummy(); - Point p[] = new Point[3]; - dummy(); - int j = (y & 1); - p[j] = p1; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = p2; - dummy(); - } - int x = 3; - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } + y = tsr.test1_0_0(y & ~1); + y = tsr.test1_0_1(y & ~1); + y = tsr.test1_0_2(y & ~1); + y = tsr.test1_0_3(y & ~1); + y = tsr.test1_0_4(y & ~1); + y = tsr.test1_0_5(y & ~1); + y = tsr.test1_0_6(y & ~1); + y = tsr.test1_0_0((y & ~1) + 1); + y = tsr.test1_0_1((y & ~1) + 1); + y = tsr.test1_0_2((y & ~1) + 1); + y = tsr.test1_0_3((y & ~1) + 1); + y = tsr.test1_0_4((y & ~1) + 1); + y = tsr.test1_0_5((y & ~1) + 1); + y = tsr.test1_0_6((y & ~1) + 1); - int test2_2_5(int y) { - Point p1 = new Point(); - dummy(); - Point p[] = new Point[3]; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = p1; - dummy(); - } - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = null; - dummy(); - } - int x = 3; - int j = (y & 1); - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } + y = tsr.test1_1_0(y & ~1); + y = tsr.test1_1_1(y & ~1); + y = tsr.test1_1_2(y & ~1); + y = tsr.test1_1_3(y & ~1); + y = tsr.test1_1_4(y & ~1); + y = tsr.test1_1_5(y & ~1); + y = tsr.test1_1_6(y & ~1); + y = tsr.test1_1_0((y & ~1) + 1); + y = tsr.test1_1_1((y & ~1) + 1); + y = tsr.test1_1_2((y & ~1) + 1); + y = tsr.test1_1_3((y & ~1) + 1); + y = tsr.test1_1_4((y & ~1) + 1); + y = tsr.test1_1_5((y & ~1) + 1); + y = tsr.test1_1_6((y & ~1) + 1); - int test2_2_6(int y) { - Point p1 = new Point(); - dummy(); - Point p2 = new Point(); - dummy(); - Point p[] = new Point[3]; - int lim = (y & 3); - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = p1; - dummy(); - } - for (int i = 0; i < lim; i++) { - dummy(); - p[i] = p2; - dummy(); - } - int x = 3; - int j = (y & 1); - if ( p[j] == null ) - return (3 * x + y) * x; - p[j].x = x; - p[j].y = 3 * x + y; - dummy(); - return p[j].x * p[0].y; - } + y = tsr.test1_2_0(y & ~1); + y = tsr.test1_2_1(y & ~1); + y = tsr.test1_2_2(y & ~1); + y = tsr.test1_2_3(y & ~1); + y = tsr.test1_2_4(y & ~1); + y = tsr.test1_2_5(y & ~1); + y = tsr.test1_2_6(y & ~1); + y = tsr.test1_2_0((y & ~1) + 1); + y = tsr.test1_2_1((y & ~1) + 1); + y = tsr.test1_2_2((y & ~1) + 1); + y = tsr.test1_2_3((y & ~1) + 1); + y = tsr.test1_2_4((y & ~1) + 1); + y = tsr.test1_2_5((y & ~1) + 1); + y = tsr.test1_2_6((y & ~1) + 1); - public static void main(String args[]) { - Test tsr = new Test(); - Point p = new Point(); - Point ptmp = p; - Class cls = Point.class; - int y = 0; - for (int i=0; i<10000; i++) { - y = tsr.test0_0_0(y); - y = tsr.test0_0_0(y); - y = tsr.test0_0_1(y); - y = tsr.test0_0_1(y); - y = tsr.test0_0_2(y); - y = tsr.test0_0_2(y); - y = tsr.test0_0_3(y); - y = tsr.test0_0_3(y); - y = tsr.test0_0_4(y); - y = tsr.test0_0_4(y); - y = tsr.test0_0_5(y); - y = tsr.test0_0_5(y); - y = tsr.test0_0_6(y); - y = tsr.test0_0_6(y); + y = tsr.test2_0_0(y & ~3); + y = tsr.test2_0_1(y & ~3); + y = tsr.test2_0_2(y & ~3); + y = tsr.test2_0_3(y & ~3); + y = tsr.test2_0_4(y & ~3); + y = tsr.test2_0_5(y & ~3); + y = tsr.test2_0_6(y & ~3); + y = tsr.test2_0_0((y & ~3) + 3); + y = tsr.test2_0_1((y & ~3) + 3); + y = tsr.test2_0_2((y & ~3) + 3); + y = tsr.test2_0_3((y & ~3) + 3); + y = tsr.test2_0_4((y & ~3) + 3); + y = tsr.test2_0_5((y & ~3) + 3); + y = tsr.test2_0_6((y & ~3) + 3); - y = tsr.test0_1_3(y); - y = tsr.test0_1_3(y); - y = tsr.test0_1_4(y); - y = tsr.test0_1_4(y); - y = tsr.test0_1_5(y); - y = tsr.test0_1_5(y); - y = tsr.test0_1_6(y); - y = tsr.test0_1_6(y); + y = tsr.test2_1_0(y & ~3); + y = tsr.test2_1_1(y & ~3); + y = tsr.test2_1_2(y & ~3); + y = tsr.test2_1_3(y & ~3); + y = tsr.test2_1_4(y & ~3); + y = tsr.test2_1_5(y & ~3); + y = tsr.test2_1_6(y & ~3); + y = tsr.test2_1_0((y & ~3) + 3); + y = tsr.test2_1_1((y & ~3) + 3); + y = tsr.test2_1_2((y & ~3) + 3); + y = tsr.test2_1_3((y & ~3) + 3); + y = tsr.test2_1_4((y & ~3) + 3); + y = tsr.test2_1_5((y & ~3) + 3); + y = tsr.test2_1_6((y & ~3) + 3); - y = tsr.test1_0_0(y&~1); - y = tsr.test1_0_1(y&~1); - y = tsr.test1_0_2(y&~1); - y = tsr.test1_0_3(y&~1); - y = tsr.test1_0_4(y&~1); - y = tsr.test1_0_5(y&~1); - y = tsr.test1_0_6(y&~1); - y = tsr.test1_0_0((y&~1)+1); - y = tsr.test1_0_1((y&~1)+1); - y = tsr.test1_0_2((y&~1)+1); - y = tsr.test1_0_3((y&~1)+1); - y = tsr.test1_0_4((y&~1)+1); - y = tsr.test1_0_5((y&~1)+1); - y = tsr.test1_0_6((y&~1)+1); + y = tsr.test2_2_0(y & ~3); + y = tsr.test2_2_1(y & ~3); + y = tsr.test2_2_2(y & ~3); + y = tsr.test2_2_3(y & ~3); + y = tsr.test2_2_4(y & ~3); + y = tsr.test2_2_5(y & ~3); + y = tsr.test2_2_6(y & ~3); + y = tsr.test2_2_0((y & ~3) + 3); + y = tsr.test2_2_1((y & ~3) + 3); + y = tsr.test2_2_2((y & ~3) + 3); + y = tsr.test2_2_3((y & ~3) + 3); + y = tsr.test2_2_4((y & ~3) + 3); + y = tsr.test2_2_5((y & ~3) + 3); + y = tsr.test2_2_6((y & ~3) + 3); - y = tsr.test1_1_0(y&~1); - y = tsr.test1_1_1(y&~1); - y = tsr.test1_1_2(y&~1); - y = tsr.test1_1_3(y&~1); - y = tsr.test1_1_4(y&~1); - y = tsr.test1_1_5(y&~1); - y = tsr.test1_1_6(y&~1); - y = tsr.test1_1_0((y&~1)+1); - y = tsr.test1_1_1((y&~1)+1); - y = tsr.test1_1_2((y&~1)+1); - y = tsr.test1_1_3((y&~1)+1); - y = tsr.test1_1_4((y&~1)+1); - y = tsr.test1_1_5((y&~1)+1); - y = tsr.test1_1_6((y&~1)+1); + } + for (int i = 0; i < 10000; i++) { + y = tsr.test0_0_0(y); + y = tsr.test0_0_0(y); + y = tsr.test0_0_1(y); + y = tsr.test0_0_1(y); + y = tsr.test0_0_2(y); + y = tsr.test0_0_2(y); + y = tsr.test0_0_3(y); + y = tsr.test0_0_3(y); + y = tsr.test0_0_4(y); + y = tsr.test0_0_4(y); + y = tsr.test0_0_5(y); + y = tsr.test0_0_5(y); + y = tsr.test0_0_6(y); + y = tsr.test0_0_6(y); - y = tsr.test1_2_0(y&~1); - y = tsr.test1_2_1(y&~1); - y = tsr.test1_2_2(y&~1); - y = tsr.test1_2_3(y&~1); - y = tsr.test1_2_4(y&~1); - y = tsr.test1_2_5(y&~1); - y = tsr.test1_2_6(y&~1); - y = tsr.test1_2_0((y&~1)+1); - y = tsr.test1_2_1((y&~1)+1); - y = tsr.test1_2_2((y&~1)+1); - y = tsr.test1_2_3((y&~1)+1); - y = tsr.test1_2_4((y&~1)+1); - y = tsr.test1_2_5((y&~1)+1); - y = tsr.test1_2_6((y&~1)+1); + y = tsr.test0_1_3(y); + y = tsr.test0_1_3(y); + y = tsr.test0_1_4(y); + y = tsr.test0_1_4(y); + y = tsr.test0_1_5(y); + y = tsr.test0_1_5(y); + y = tsr.test0_1_6(y); + y = tsr.test0_1_6(y); - y = tsr.test2_0_0(y&~3); - y = tsr.test2_0_1(y&~3); - y = tsr.test2_0_2(y&~3); - y = tsr.test2_0_3(y&~3); - y = tsr.test2_0_4(y&~3); - y = tsr.test2_0_5(y&~3); - y = tsr.test2_0_6(y&~3); - y = tsr.test2_0_0((y&~3)+3); - y = tsr.test2_0_1((y&~3)+3); - y = tsr.test2_0_2((y&~3)+3); - y = tsr.test2_0_3((y&~3)+3); - y = tsr.test2_0_4((y&~3)+3); - y = tsr.test2_0_5((y&~3)+3); - y = tsr.test2_0_6((y&~3)+3); + y = tsr.test1_0_0(y & ~1); + y = tsr.test1_0_1(y & ~1); + y = tsr.test1_0_2(y & ~1); + y = tsr.test1_0_3(y & ~1); + y = tsr.test1_0_4(y & ~1); + y = tsr.test1_0_5(y & ~1); + y = tsr.test1_0_6(y & ~1); + y = tsr.test1_0_0((y & ~1) + 1); + y = tsr.test1_0_1((y & ~1) + 1); + y = tsr.test1_0_2((y & ~1) + 1); + y = tsr.test1_0_3((y & ~1) + 1); + y = tsr.test1_0_4((y & ~1) + 1); + y = tsr.test1_0_5((y & ~1) + 1); + y = tsr.test1_0_6((y & ~1) + 1); - y = tsr.test2_1_0(y&~3); - y = tsr.test2_1_1(y&~3); - y = tsr.test2_1_2(y&~3); - y = tsr.test2_1_3(y&~3); - y = tsr.test2_1_4(y&~3); - y = tsr.test2_1_5(y&~3); - y = tsr.test2_1_6(y&~3); - y = tsr.test2_1_0((y&~3)+3); - y = tsr.test2_1_1((y&~3)+3); - y = tsr.test2_1_2((y&~3)+3); - y = tsr.test2_1_3((y&~3)+3); - y = tsr.test2_1_4((y&~3)+3); - y = tsr.test2_1_5((y&~3)+3); - y = tsr.test2_1_6((y&~3)+3); + y = tsr.test1_1_0(y & ~1); + y = tsr.test1_1_1(y & ~1); + y = tsr.test1_1_2(y & ~1); + y = tsr.test1_1_3(y & ~1); + y = tsr.test1_1_4(y & ~1); + y = tsr.test1_1_5(y & ~1); + y = tsr.test1_1_6(y & ~1); + y = tsr.test1_1_0((y & ~1) + 1); + y = tsr.test1_1_1((y & ~1) + 1); + y = tsr.test1_1_2((y & ~1) + 1); + y = tsr.test1_1_3((y & ~1) + 1); + y = tsr.test1_1_4((y & ~1) + 1); + y = tsr.test1_1_5((y & ~1) + 1); + y = tsr.test1_1_6((y & ~1) + 1); - y = tsr.test2_2_0(y&~3); - y = tsr.test2_2_1(y&~3); - y = tsr.test2_2_2(y&~3); - y = tsr.test2_2_3(y&~3); - y = tsr.test2_2_4(y&~3); - y = tsr.test2_2_5(y&~3); - y = tsr.test2_2_6(y&~3); - y = tsr.test2_2_0((y&~3)+3); - y = tsr.test2_2_1((y&~3)+3); - y = tsr.test2_2_2((y&~3)+3); - y = tsr.test2_2_3((y&~3)+3); - y = tsr.test2_2_4((y&~3)+3); - y = tsr.test2_2_5((y&~3)+3); - y = tsr.test2_2_6((y&~3)+3); + y = tsr.test1_2_0(y & ~1); + y = tsr.test1_2_1(y & ~1); + y = tsr.test1_2_2(y & ~1); + y = tsr.test1_2_3(y & ~1); + y = tsr.test1_2_4(y & ~1); + y = tsr.test1_2_5(y & ~1); + y = tsr.test1_2_6(y & ~1); + y = tsr.test1_2_0((y & ~1) + 1); + y = tsr.test1_2_1((y & ~1) + 1); + y = tsr.test1_2_2((y & ~1) + 1); + y = tsr.test1_2_3((y & ~1) + 1); + y = tsr.test1_2_4((y & ~1) + 1); + y = tsr.test1_2_5((y & ~1) + 1); + y = tsr.test1_2_6((y & ~1) + 1); + + y = tsr.test2_0_0(y & ~3); + y = tsr.test2_0_1(y & ~3); + y = tsr.test2_0_2(y & ~3); + y = tsr.test2_0_3(y & ~3); + y = tsr.test2_0_4(y & ~3); + y = tsr.test2_0_5(y & ~3); + y = tsr.test2_0_6(y & ~3); + y = tsr.test2_0_0((y & ~3) + 3); + y = tsr.test2_0_1((y & ~3) + 3); + y = tsr.test2_0_2((y & ~3) + 3); + y = tsr.test2_0_3((y & ~3) + 3); + y = tsr.test2_0_4((y & ~3) + 3); + y = tsr.test2_0_5((y & ~3) + 3); + y = tsr.test2_0_6((y & ~3) + 3); + + y = tsr.test2_1_0(y & ~3); + y = tsr.test2_1_1(y & ~3); + y = tsr.test2_1_2(y & ~3); + y = tsr.test2_1_3(y & ~3); + y = tsr.test2_1_4(y & ~3); + y = tsr.test2_1_5(y & ~3); + y = tsr.test2_1_6(y & ~3); + y = tsr.test2_1_0((y & ~3) + 3); + y = tsr.test2_1_1((y & ~3) + 3); + y = tsr.test2_1_2((y & ~3) + 3); + y = tsr.test2_1_3((y & ~3) + 3); + y = tsr.test2_1_4((y & ~3) + 3); + y = tsr.test2_1_5((y & ~3) + 3); + y = tsr.test2_1_6((y & ~3) + 3); + + y = tsr.test2_2_0(y & ~3); + y = tsr.test2_2_1(y & ~3); + y = tsr.test2_2_2(y & ~3); + y = tsr.test2_2_3(y & ~3); + y = tsr.test2_2_4(y & ~3); + y = tsr.test2_2_5(y & ~3); + y = tsr.test2_2_6(y & ~3); + y = tsr.test2_2_0((y & ~3) + 3); + y = tsr.test2_2_1((y & ~3) + 3); + y = tsr.test2_2_2((y & ~3) + 3); + y = tsr.test2_2_3((y & ~3) + 3); + y = tsr.test2_2_4((y & ~3) + 3); + y = tsr.test2_2_5((y & ~3) + 3); + y = tsr.test2_2_6((y & ~3) + 3); + + } + for (int i = 0; i < 10000; i++) { + y = tsr.test0_0_0(y); + y = tsr.test0_0_0(y); + y = tsr.test0_0_1(y); + y = tsr.test0_0_1(y); + y = tsr.test0_0_2(y); + y = tsr.test0_0_2(y); + y = tsr.test0_0_3(y); + y = tsr.test0_0_3(y); + y = tsr.test0_0_4(y); + y = tsr.test0_0_4(y); + y = tsr.test0_0_5(y); + y = tsr.test0_0_5(y); + y = tsr.test0_0_6(y); + y = tsr.test0_0_6(y); + + y = tsr.test0_1_3(y); + y = tsr.test0_1_3(y); + y = tsr.test0_1_4(y); + y = tsr.test0_1_4(y); + y = tsr.test0_1_5(y); + y = tsr.test0_1_5(y); + y = tsr.test0_1_6(y); + y = tsr.test0_1_6(y); + + y = tsr.test1_0_0(y & ~1); + y = tsr.test1_0_1(y & ~1); + y = tsr.test1_0_2(y & ~1); + y = tsr.test1_0_3(y & ~1); + y = tsr.test1_0_4(y & ~1); + y = tsr.test1_0_5(y & ~1); + y = tsr.test1_0_6(y & ~1); + y = tsr.test1_0_0((y & ~1) + 1); + y = tsr.test1_0_1((y & ~1) + 1); + y = tsr.test1_0_2((y & ~1) + 1); + y = tsr.test1_0_3((y & ~1) + 1); + y = tsr.test1_0_4((y & ~1) + 1); + y = tsr.test1_0_5((y & ~1) + 1); + y = tsr.test1_0_6((y & ~1) + 1); + + y = tsr.test1_1_0(y & ~1); + y = tsr.test1_1_1(y & ~1); + y = tsr.test1_1_2(y & ~1); + y = tsr.test1_1_3(y & ~1); + y = tsr.test1_1_4(y & ~1); + y = tsr.test1_1_5(y & ~1); + y = tsr.test1_1_6(y & ~1); + y = tsr.test1_1_0((y & ~1) + 1); + y = tsr.test1_1_1((y & ~1) + 1); + y = tsr.test1_1_2((y & ~1) + 1); + y = tsr.test1_1_3((y & ~1) + 1); + y = tsr.test1_1_4((y & ~1) + 1); + y = tsr.test1_1_5((y & ~1) + 1); + y = tsr.test1_1_6((y & ~1) + 1); + + y = tsr.test1_2_0(y & ~1); + y = tsr.test1_2_1(y & ~1); + y = tsr.test1_2_2(y & ~1); + y = tsr.test1_2_3(y & ~1); + y = tsr.test1_2_4(y & ~1); + y = tsr.test1_2_5(y & ~1); + y = tsr.test1_2_6(y & ~1); + y = tsr.test1_2_0((y & ~1) + 1); + y = tsr.test1_2_1((y & ~1) + 1); + y = tsr.test1_2_2((y & ~1) + 1); + y = tsr.test1_2_3((y & ~1) + 1); + y = tsr.test1_2_4((y & ~1) + 1); + y = tsr.test1_2_5((y & ~1) + 1); + y = tsr.test1_2_6((y & ~1) + 1); + + y = tsr.test2_0_0(y & ~3); + y = tsr.test2_0_1(y & ~3); + y = tsr.test2_0_2(y & ~3); + y = tsr.test2_0_3(y & ~3); + y = tsr.test2_0_4(y & ~3); + y = tsr.test2_0_5(y & ~3); + y = tsr.test2_0_6(y & ~3); + y = tsr.test2_0_0((y & ~3) + 3); + y = tsr.test2_0_1((y & ~3) + 3); + y = tsr.test2_0_2((y & ~3) + 3); + y = tsr.test2_0_3((y & ~3) + 3); + y = tsr.test2_0_4((y & ~3) + 3); + y = tsr.test2_0_5((y & ~3) + 3); + y = tsr.test2_0_6((y & ~3) + 3); + + y = tsr.test2_1_0(y & ~3); + y = tsr.test2_1_1(y & ~3); + y = tsr.test2_1_2(y & ~3); + y = tsr.test2_1_3(y & ~3); + y = tsr.test2_1_4(y & ~3); + y = tsr.test2_1_5(y & ~3); + y = tsr.test2_1_6(y & ~3); + y = tsr.test2_1_0((y & ~3) + 3); + y = tsr.test2_1_1((y & ~3) + 3); + y = tsr.test2_1_2((y & ~3) + 3); + y = tsr.test2_1_3((y & ~3) + 3); + y = tsr.test2_1_4((y & ~3) + 3); + y = tsr.test2_1_5((y & ~3) + 3); + y = tsr.test2_1_6((y & ~3) + 3); + + y = tsr.test2_2_0(y & ~3); + y = tsr.test2_2_1(y & ~3); + y = tsr.test2_2_2(y & ~3); + y = tsr.test2_2_3(y & ~3); + y = tsr.test2_2_4(y & ~3); + y = tsr.test2_2_5(y & ~3); + y = tsr.test2_2_6(y & ~3); + y = tsr.test2_2_0((y & ~3) + 3); + y = tsr.test2_2_1((y & ~3) + 3); + y = tsr.test2_2_2((y & ~3) + 3); + y = tsr.test2_2_3((y & ~3) + 3); + y = tsr.test2_2_4((y & ~3) + 3); + y = tsr.test2_2_5((y & ~3) + 3); + y = tsr.test2_2_6((y & ~3) + 3); + + } + + int z = 0; + y = tsr.test0_0_0(0); + System.out.println("After 'test0_0_0' y=" + y); + y = tsr.test0_0_1(0); + System.out.println("After 'test0_0_1' y=" + y); + y = tsr.test0_0_2(0); + System.out.println("After 'test0_0_2' y=" + y); + y = tsr.test0_0_3(0); + System.out.println("After 'test0_0_3' y=" + y); + y = tsr.test0_0_4(0); + System.out.println("After 'test0_0_4' y=" + y); + y = tsr.test0_0_5(0); + System.out.println("After 'test0_0_5' y=" + y); + y = tsr.test0_0_6(0); + System.out.println("After 'test0_0_6' y=" + y); + y = tsr.test0_1_3(0); + System.out.println("After 'test0_1_3' y=" + y); + y = tsr.test0_1_4(0); + System.out.println("After 'test0_1_4' y=" + y); + y = tsr.test0_1_5(0); + System.out.println("After 'test0_1_5' y=" + y); + y = tsr.test0_1_6(0); + System.out.println("After 'test0_1_6' y=" + y); + + y = tsr.test1_0_0(0); + System.out.println("After 'test1_0_0' y=" + y); + y = tsr.test1_0_1(0); + System.out.println("After 'test1_0_1' y=" + y); + y = tsr.test1_0_2(0); + System.out.println("After 'test1_0_2' y=" + y); + y = tsr.test1_0_3(0); + System.out.println("After 'test1_0_3' y=" + y); + y = tsr.test1_0_4(0); + System.out.println("After 'test1_0_4' y=" + y); + y = tsr.test1_0_5(0); + System.out.println("After 'test1_0_5' y=" + y); + y = tsr.test1_0_6(0); + System.out.println("After 'test1_0_6' y=" + y); + + y = tsr.test1_1_0(0); + System.out.println("After 'test1_1_0' y=" + y); + y = tsr.test1_1_1(0); + System.out.println("After 'test1_1_1' y=" + y); + y = tsr.test1_1_2(0); + System.out.println("After 'test1_1_2' y=" + y); + y = tsr.test1_1_3(0); + System.out.println("After 'test1_1_3' y=" + y); + y = tsr.test1_1_4(0); + System.out.println("After 'test1_1_4' y=" + y); + y = tsr.test1_1_5(0); + System.out.println("After 'test1_1_5' y=" + y); + y = tsr.test1_1_6(0); + System.out.println("After 'test1_1_6' y=" + y); + + y = tsr.test1_2_0(0); + System.out.println("After 'test1_2_0' y=" + y); + y = tsr.test1_2_1(0); + System.out.println("After 'test1_2_1' y=" + y); + y = tsr.test1_2_2(0); + System.out.println("After 'test1_2_2' y=" + y); + y = tsr.test1_2_3(0); + System.out.println("After 'test1_2_3' y=" + y); + y = tsr.test1_2_4(0); + System.out.println("After 'test1_2_4' y=" + y); + y = tsr.test1_2_5(0); + System.out.println("After 'test1_2_5' y=" + y); + y = tsr.test1_2_6(0); + System.out.println("After 'test1_2_6' y=" + y); + + y = tsr.test2_0_0(0); + System.out.println("After 'test2_0_0' y=" + y); + y = tsr.test2_0_1(0); + System.out.println("After 'test2_0_1' y=" + y); + y = tsr.test2_0_2(0); + System.out.println("After 'test2_0_2' y=" + y); + y = tsr.test2_0_3(0); + System.out.println("After 'test2_0_3' y=" + y); + y = tsr.test2_0_4(0); + System.out.println("After 'test2_0_4' y=" + y); + y = tsr.test2_0_5(0); + System.out.println("After 'test2_0_5' y=" + y); + y = tsr.test2_0_6(0); + System.out.println("After 'test2_0_6' y=" + y); + + y = tsr.test2_1_0(0); + System.out.println("After 'test2_1_0' y=" + y); + y = tsr.test2_1_1(0); + System.out.println("After 'test2_1_1' y=" + y); + y = tsr.test2_1_2(0); + System.out.println("After 'test2_1_2' y=" + y); + y = tsr.test2_1_3(0); + System.out.println("After 'test2_1_3' y=" + y); + y = tsr.test2_1_4(0); + System.out.println("After 'test2_1_4' y=" + y); + y = tsr.test2_1_5(0); + System.out.println("After 'test2_1_5' y=" + y); + y = tsr.test2_1_6(0); + System.out.println("After 'test2_1_6' y=" + y); + + y = tsr.test2_2_0(0); + System.out.println("After 'test2_2_0' y=" + y); + y = tsr.test2_2_1(0); + System.out.println("After 'test2_2_1' y=" + y); + y = tsr.test2_2_2(0); + System.out.println("After 'test2_2_2' y=" + y); + y = tsr.test2_2_3(0); + System.out.println("After 'test2_2_3' y=" + y); + y = tsr.test2_2_4(0); + System.out.println("After 'test2_2_4' y=" + y); + y = tsr.test2_2_5(0); + System.out.println("After 'test2_2_5' y=" + y); + y = tsr.test2_2_6(0); + System.out.println("After 'test2_2_6' y=" + y); } - for (int i=0; i<10000; i++) { - y = tsr.test0_0_0(y); - y = tsr.test0_0_0(y); - y = tsr.test0_0_1(y); - y = tsr.test0_0_1(y); - y = tsr.test0_0_2(y); - y = tsr.test0_0_2(y); - y = tsr.test0_0_3(y); - y = tsr.test0_0_3(y); - y = tsr.test0_0_4(y); - y = tsr.test0_0_4(y); - y = tsr.test0_0_5(y); - y = tsr.test0_0_5(y); - y = tsr.test0_0_6(y); - y = tsr.test0_0_6(y); - - y = tsr.test0_1_3(y); - y = tsr.test0_1_3(y); - y = tsr.test0_1_4(y); - y = tsr.test0_1_4(y); - y = tsr.test0_1_5(y); - y = tsr.test0_1_5(y); - y = tsr.test0_1_6(y); - y = tsr.test0_1_6(y); - - y = tsr.test1_0_0(y&~1); - y = tsr.test1_0_1(y&~1); - y = tsr.test1_0_2(y&~1); - y = tsr.test1_0_3(y&~1); - y = tsr.test1_0_4(y&~1); - y = tsr.test1_0_5(y&~1); - y = tsr.test1_0_6(y&~1); - y = tsr.test1_0_0((y&~1)+1); - y = tsr.test1_0_1((y&~1)+1); - y = tsr.test1_0_2((y&~1)+1); - y = tsr.test1_0_3((y&~1)+1); - y = tsr.test1_0_4((y&~1)+1); - y = tsr.test1_0_5((y&~1)+1); - y = tsr.test1_0_6((y&~1)+1); - - y = tsr.test1_1_0(y&~1); - y = tsr.test1_1_1(y&~1); - y = tsr.test1_1_2(y&~1); - y = tsr.test1_1_3(y&~1); - y = tsr.test1_1_4(y&~1); - y = tsr.test1_1_5(y&~1); - y = tsr.test1_1_6(y&~1); - y = tsr.test1_1_0((y&~1)+1); - y = tsr.test1_1_1((y&~1)+1); - y = tsr.test1_1_2((y&~1)+1); - y = tsr.test1_1_3((y&~1)+1); - y = tsr.test1_1_4((y&~1)+1); - y = tsr.test1_1_5((y&~1)+1); - y = tsr.test1_1_6((y&~1)+1); - - y = tsr.test1_2_0(y&~1); - y = tsr.test1_2_1(y&~1); - y = tsr.test1_2_2(y&~1); - y = tsr.test1_2_3(y&~1); - y = tsr.test1_2_4(y&~1); - y = tsr.test1_2_5(y&~1); - y = tsr.test1_2_6(y&~1); - y = tsr.test1_2_0((y&~1)+1); - y = tsr.test1_2_1((y&~1)+1); - y = tsr.test1_2_2((y&~1)+1); - y = tsr.test1_2_3((y&~1)+1); - y = tsr.test1_2_4((y&~1)+1); - y = tsr.test1_2_5((y&~1)+1); - y = tsr.test1_2_6((y&~1)+1); - - y = tsr.test2_0_0(y&~3); - y = tsr.test2_0_1(y&~3); - y = tsr.test2_0_2(y&~3); - y = tsr.test2_0_3(y&~3); - y = tsr.test2_0_4(y&~3); - y = tsr.test2_0_5(y&~3); - y = tsr.test2_0_6(y&~3); - y = tsr.test2_0_0((y&~3)+3); - y = tsr.test2_0_1((y&~3)+3); - y = tsr.test2_0_2((y&~3)+3); - y = tsr.test2_0_3((y&~3)+3); - y = tsr.test2_0_4((y&~3)+3); - y = tsr.test2_0_5((y&~3)+3); - y = tsr.test2_0_6((y&~3)+3); - - y = tsr.test2_1_0(y&~3); - y = tsr.test2_1_1(y&~3); - y = tsr.test2_1_2(y&~3); - y = tsr.test2_1_3(y&~3); - y = tsr.test2_1_4(y&~3); - y = tsr.test2_1_5(y&~3); - y = tsr.test2_1_6(y&~3); - y = tsr.test2_1_0((y&~3)+3); - y = tsr.test2_1_1((y&~3)+3); - y = tsr.test2_1_2((y&~3)+3); - y = tsr.test2_1_3((y&~3)+3); - y = tsr.test2_1_4((y&~3)+3); - y = tsr.test2_1_5((y&~3)+3); - y = tsr.test2_1_6((y&~3)+3); - - y = tsr.test2_2_0(y&~3); - y = tsr.test2_2_1(y&~3); - y = tsr.test2_2_2(y&~3); - y = tsr.test2_2_3(y&~3); - y = tsr.test2_2_4(y&~3); - y = tsr.test2_2_5(y&~3); - y = tsr.test2_2_6(y&~3); - y = tsr.test2_2_0((y&~3)+3); - y = tsr.test2_2_1((y&~3)+3); - y = tsr.test2_2_2((y&~3)+3); - y = tsr.test2_2_3((y&~3)+3); - y = tsr.test2_2_4((y&~3)+3); - y = tsr.test2_2_5((y&~3)+3); - y = tsr.test2_2_6((y&~3)+3); - - } - for (int i=0; i<10000; i++) { - y = tsr.test0_0_0(y); - y = tsr.test0_0_0(y); - y = tsr.test0_0_1(y); - y = tsr.test0_0_1(y); - y = tsr.test0_0_2(y); - y = tsr.test0_0_2(y); - y = tsr.test0_0_3(y); - y = tsr.test0_0_3(y); - y = tsr.test0_0_4(y); - y = tsr.test0_0_4(y); - y = tsr.test0_0_5(y); - y = tsr.test0_0_5(y); - y = tsr.test0_0_6(y); - y = tsr.test0_0_6(y); - - y = tsr.test0_1_3(y); - y = tsr.test0_1_3(y); - y = tsr.test0_1_4(y); - y = tsr.test0_1_4(y); - y = tsr.test0_1_5(y); - y = tsr.test0_1_5(y); - y = tsr.test0_1_6(y); - y = tsr.test0_1_6(y); - - y = tsr.test1_0_0(y&~1); - y = tsr.test1_0_1(y&~1); - y = tsr.test1_0_2(y&~1); - y = tsr.test1_0_3(y&~1); - y = tsr.test1_0_4(y&~1); - y = tsr.test1_0_5(y&~1); - y = tsr.test1_0_6(y&~1); - y = tsr.test1_0_0((y&~1)+1); - y = tsr.test1_0_1((y&~1)+1); - y = tsr.test1_0_2((y&~1)+1); - y = tsr.test1_0_3((y&~1)+1); - y = tsr.test1_0_4((y&~1)+1); - y = tsr.test1_0_5((y&~1)+1); - y = tsr.test1_0_6((y&~1)+1); - - y = tsr.test1_1_0(y&~1); - y = tsr.test1_1_1(y&~1); - y = tsr.test1_1_2(y&~1); - y = tsr.test1_1_3(y&~1); - y = tsr.test1_1_4(y&~1); - y = tsr.test1_1_5(y&~1); - y = tsr.test1_1_6(y&~1); - y = tsr.test1_1_0((y&~1)+1); - y = tsr.test1_1_1((y&~1)+1); - y = tsr.test1_1_2((y&~1)+1); - y = tsr.test1_1_3((y&~1)+1); - y = tsr.test1_1_4((y&~1)+1); - y = tsr.test1_1_5((y&~1)+1); - y = tsr.test1_1_6((y&~1)+1); - - y = tsr.test1_2_0(y&~1); - y = tsr.test1_2_1(y&~1); - y = tsr.test1_2_2(y&~1); - y = tsr.test1_2_3(y&~1); - y = tsr.test1_2_4(y&~1); - y = tsr.test1_2_5(y&~1); - y = tsr.test1_2_6(y&~1); - y = tsr.test1_2_0((y&~1)+1); - y = tsr.test1_2_1((y&~1)+1); - y = tsr.test1_2_2((y&~1)+1); - y = tsr.test1_2_3((y&~1)+1); - y = tsr.test1_2_4((y&~1)+1); - y = tsr.test1_2_5((y&~1)+1); - y = tsr.test1_2_6((y&~1)+1); - - y = tsr.test2_0_0(y&~3); - y = tsr.test2_0_1(y&~3); - y = tsr.test2_0_2(y&~3); - y = tsr.test2_0_3(y&~3); - y = tsr.test2_0_4(y&~3); - y = tsr.test2_0_5(y&~3); - y = tsr.test2_0_6(y&~3); - y = tsr.test2_0_0((y&~3)+3); - y = tsr.test2_0_1((y&~3)+3); - y = tsr.test2_0_2((y&~3)+3); - y = tsr.test2_0_3((y&~3)+3); - y = tsr.test2_0_4((y&~3)+3); - y = tsr.test2_0_5((y&~3)+3); - y = tsr.test2_0_6((y&~3)+3); - - y = tsr.test2_1_0(y&~3); - y = tsr.test2_1_1(y&~3); - y = tsr.test2_1_2(y&~3); - y = tsr.test2_1_3(y&~3); - y = tsr.test2_1_4(y&~3); - y = tsr.test2_1_5(y&~3); - y = tsr.test2_1_6(y&~3); - y = tsr.test2_1_0((y&~3)+3); - y = tsr.test2_1_1((y&~3)+3); - y = tsr.test2_1_2((y&~3)+3); - y = tsr.test2_1_3((y&~3)+3); - y = tsr.test2_1_4((y&~3)+3); - y = tsr.test2_1_5((y&~3)+3); - y = tsr.test2_1_6((y&~3)+3); - - y = tsr.test2_2_0(y&~3); - y = tsr.test2_2_1(y&~3); - y = tsr.test2_2_2(y&~3); - y = tsr.test2_2_3(y&~3); - y = tsr.test2_2_4(y&~3); - y = tsr.test2_2_5(y&~3); - y = tsr.test2_2_6(y&~3); - y = tsr.test2_2_0((y&~3)+3); - y = tsr.test2_2_1((y&~3)+3); - y = tsr.test2_2_2((y&~3)+3); - y = tsr.test2_2_3((y&~3)+3); - y = tsr.test2_2_4((y&~3)+3); - y = tsr.test2_2_5((y&~3)+3); - y = tsr.test2_2_6((y&~3)+3); - - } - - int z = 0; - y = tsr.test0_0_0(0); - System.out.println("After 'test0_0_0' y=" + y); - y = tsr.test0_0_1(0); - System.out.println("After 'test0_0_1' y=" + y); - y = tsr.test0_0_2(0); - System.out.println("After 'test0_0_2' y=" + y); - y = tsr.test0_0_3(0); - System.out.println("After 'test0_0_3' y=" + y); - y = tsr.test0_0_4(0); - System.out.println("After 'test0_0_4' y=" + y); - y = tsr.test0_0_5(0); - System.out.println("After 'test0_0_5' y=" + y); - y = tsr.test0_0_6(0); - System.out.println("After 'test0_0_6' y=" + y); - y = tsr.test0_1_3(0); - System.out.println("After 'test0_1_3' y=" + y); - y = tsr.test0_1_4(0); - System.out.println("After 'test0_1_4' y=" + y); - y = tsr.test0_1_5(0); - System.out.println("After 'test0_1_5' y=" + y); - y = tsr.test0_1_6(0); - System.out.println("After 'test0_1_6' y=" + y); - - y = tsr.test1_0_0(0); - System.out.println("After 'test1_0_0' y=" + y); - y = tsr.test1_0_1(0); - System.out.println("After 'test1_0_1' y=" + y); - y = tsr.test1_0_2(0); - System.out.println("After 'test1_0_2' y=" + y); - y = tsr.test1_0_3(0); - System.out.println("After 'test1_0_3' y=" + y); - y = tsr.test1_0_4(0); - System.out.println("After 'test1_0_4' y=" + y); - y = tsr.test1_0_5(0); - System.out.println("After 'test1_0_5' y=" + y); - y = tsr.test1_0_6(0); - System.out.println("After 'test1_0_6' y=" + y); - - y = tsr.test1_1_0(0); - System.out.println("After 'test1_1_0' y=" + y); - y = tsr.test1_1_1(0); - System.out.println("After 'test1_1_1' y=" + y); - y = tsr.test1_1_2(0); - System.out.println("After 'test1_1_2' y=" + y); - y = tsr.test1_1_3(0); - System.out.println("After 'test1_1_3' y=" + y); - y = tsr.test1_1_4(0); - System.out.println("After 'test1_1_4' y=" + y); - y = tsr.test1_1_5(0); - System.out.println("After 'test1_1_5' y=" + y); - y = tsr.test1_1_6(0); - System.out.println("After 'test1_1_6' y=" + y); - - y = tsr.test1_2_0(0); - System.out.println("After 'test1_2_0' y=" + y); - y = tsr.test1_2_1(0); - System.out.println("After 'test1_2_1' y=" + y); - y = tsr.test1_2_2(0); - System.out.println("After 'test1_2_2' y=" + y); - y = tsr.test1_2_3(0); - System.out.println("After 'test1_2_3' y=" + y); - y = tsr.test1_2_4(0); - System.out.println("After 'test1_2_4' y=" + y); - y = tsr.test1_2_5(0); - System.out.println("After 'test1_2_5' y=" + y); - y = tsr.test1_2_6(0); - System.out.println("After 'test1_2_6' y=" + y); - - y = tsr.test2_0_0(0); - System.out.println("After 'test2_0_0' y=" + y); - y = tsr.test2_0_1(0); - System.out.println("After 'test2_0_1' y=" + y); - y = tsr.test2_0_2(0); - System.out.println("After 'test2_0_2' y=" + y); - y = tsr.test2_0_3(0); - System.out.println("After 'test2_0_3' y=" + y); - y = tsr.test2_0_4(0); - System.out.println("After 'test2_0_4' y=" + y); - y = tsr.test2_0_5(0); - System.out.println("After 'test2_0_5' y=" + y); - y = tsr.test2_0_6(0); - System.out.println("After 'test2_0_6' y=" + y); - - y = tsr.test2_1_0(0); - System.out.println("After 'test2_1_0' y=" + y); - y = tsr.test2_1_1(0); - System.out.println("After 'test2_1_1' y=" + y); - y = tsr.test2_1_2(0); - System.out.println("After 'test2_1_2' y=" + y); - y = tsr.test2_1_3(0); - System.out.println("After 'test2_1_3' y=" + y); - y = tsr.test2_1_4(0); - System.out.println("After 'test2_1_4' y=" + y); - y = tsr.test2_1_5(0); - System.out.println("After 'test2_1_5' y=" + y); - y = tsr.test2_1_6(0); - System.out.println("After 'test2_1_6' y=" + y); - - y = tsr.test2_2_0(0); - System.out.println("After 'test2_2_0' y=" + y); - y = tsr.test2_2_1(0); - System.out.println("After 'test2_2_1' y=" + y); - y = tsr.test2_2_2(0); - System.out.println("After 'test2_2_2' y=" + y); - y = tsr.test2_2_3(0); - System.out.println("After 'test2_2_3' y=" + y); - y = tsr.test2_2_4(0); - System.out.println("After 'test2_2_4' y=" + y); - y = tsr.test2_2_5(0); - System.out.println("After 'test2_2_5' y=" + y); - y = tsr.test2_2_6(0); - System.out.println("After 'test2_2_6' y=" + y); - - } } diff --git a/test/compiler/escapeAnalysis/6775880/Test.java b/test/compiler/escapeAnalysis/Test6775880.java rename from test/compiler/escapeAnalysis/6775880/Test.java rename to test/compiler/escapeAnalysis/Test6775880.java --- a/test/compiler/escapeAnalysis/6775880/Test.java +++ b/test/compiler/escapeAnalysis/Test6775880.java @@ -26,41 +26,46 @@ * @test * @bug 6775880 * @summary EA +DeoptimizeALot: assert(mon_info->owner()->is_locked(),"object must be locked now") - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+DoEscapeAnalysis -XX:+DeoptimizeALot -XX:CompileCommand=exclude,java.lang.AbstractStringBuilder::append Test + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+DoEscapeAnalysis -XX:+DeoptimizeALot + * -XX:CompileCommand=exclude,java.lang.AbstractStringBuilder::append + * compiler.escapeAnalysis.Test6775880 */ -public class Test { +package compiler.escapeAnalysis; - int cnt; - int b[]; - String s; +public class Test6775880 { - String test() { - String res=""; - for (int i=0; i < cnt; i++) { - if (i != 0) { - res = res +"."; - } - res = res + b[i]; + int cnt; + int b[]; + String s; + + String test() { + String res = ""; + for (int i = 0; i < cnt; i++) { + if (i != 0) { + res = res + "."; + } + res = res + b[i]; + } + return res; } - return res; - } - public static void main(String[] args) { - Test t = new Test(); - t.cnt = 3; - t.b = new int[3]; - t.b[0] = 0; - t.b[1] = 1; - t.b[2] = 2; - int j=0; - t.s = ""; - for (int i=0; i<10001; i++) { - t.s = "c"; - t.s = t.test(); + public static void main(String[] args) { + Test6775880 t = new Test6775880(); + t.cnt = 3; + t.b = new int[3]; + t.b[0] = 0; + t.b[1] = 1; + t.b[2] = 2; + int j = 0; + t.s = ""; + for (int i = 0; i < 10001; i++) { + t.s = "c"; + t.s = t.test(); + } + System.out.println("After s=" + t.s); } - System.out.println("After s=" + t.s); - } } diff --git a/test/compiler/escapeAnalysis/6895383/Test.java b/test/compiler/escapeAnalysis/Test6895383.java rename from test/compiler/escapeAnalysis/6895383/Test.java rename to test/compiler/escapeAnalysis/Test6895383.java --- a/test/compiler/escapeAnalysis/6895383/Test.java +++ b/test/compiler/escapeAnalysis/Test6895383.java @@ -27,15 +27,17 @@ * @bug 6895383 * @summary JCK test throws NPE for method compiled with Escape Analysis * - * @run main/othervm -Xcomp Test + * @run main/othervm -Xcomp compiler.escapeAnalysis.Test6895383 */ -import java.util.*; -import java.util.concurrent.*; +package compiler.escapeAnalysis; -public class Test { +import java.util.LinkedList; +import java.util.concurrent.CopyOnWriteArrayList; + +public class Test6895383 { public static void main(String argv[]) { - Test test = new Test(); + Test6895383 test = new Test6895383(); test.testRemove1_IndexOutOfBounds(); test.testAddAll1_IndexOutOfBoundsException(); } diff --git a/test/compiler/escapeAnalysis/6896727/Test.java b/test/compiler/escapeAnalysis/Test6896727.java rename from test/compiler/escapeAnalysis/6896727/Test.java rename to test/compiler/escapeAnalysis/Test6896727.java --- a/test/compiler/escapeAnalysis/6896727/Test.java +++ b/test/compiler/escapeAnalysis/Test6896727.java @@ -26,10 +26,14 @@ * @test * @bug 6896727 * @summary nsk/logging/LoggingPermission/LoggingPermission/logperm002 fails with G1, EscapeAnalisys w/o COOPs - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:+DoEscapeAnalysis Test + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:+DoEscapeAnalysis + * compiler.escapeAnalysis.Test6896727 */ -public class Test { +package compiler.escapeAnalysis; + +public class Test6896727 { final static String testString = "abracadabra"; public static void main(String args[]) { diff --git a/test/compiler/escapeAnalysis/Test8020215.java b/test/compiler/escapeAnalysis/Test8020215.java --- a/test/compiler/escapeAnalysis/Test8020215.java +++ b/test/compiler/escapeAnalysis/Test8020215.java @@ -25,9 +25,12 @@ * @test * @bug 8020215 * @summary Different execution plan when using JIT vs interpreter - * @run main Test8020215 + * + * @run main compiler.escapeAnalysis.Test8020215 */ +package compiler.escapeAnalysis; + import java.util.ArrayList; import java.util.List; diff --git a/test/compiler/escapeAnalysis/TestAllocatedEscapesPtrComparison.java b/test/compiler/escapeAnalysis/TestAllocatedEscapesPtrComparison.java --- a/test/compiler/escapeAnalysis/TestAllocatedEscapesPtrComparison.java +++ b/test/compiler/escapeAnalysis/TestAllocatedEscapesPtrComparison.java @@ -24,11 +24,16 @@ /* * @test * @bug 8043354 - * @summary bcEscapeAnalyzer allocated_escapes not conservative enough - * @run main/othervm -XX:CompileOnly=.visitAndPop TestAllocatedEscapesPtrComparison + * @summary bcEscapeAnalyzer allocated_escapes not conservative enough + * + * @run main/othervm + * -XX:CompileCommand=compileonly,compiler.escapeAnalysis.TestAllocatedEscapesPtrComparison::visitAndPop + * compiler.escapeAnalysis.TestAllocatedEscapesPtrComparison * @author Chuck Rasbold rasbold@google.com */ +package compiler.escapeAnalysis; + /* * Test always passes with -XX:-OptmimizePtrCompare */ diff --git a/test/compiler/escapeAnalysis/TestEABadMergeMem.java b/test/compiler/escapeAnalysis/TestEABadMergeMem.java --- a/test/compiler/escapeAnalysis/TestEABadMergeMem.java +++ b/test/compiler/escapeAnalysis/TestEABadMergeMem.java @@ -25,10 +25,14 @@ * @test * @bug 8134031 * @summary Bad rewiring of memory edges when we split unique types during EA - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestEABadMergeMem::m_notinlined TestEABadMergeMem * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:CompileCommand=dontinline,compiler.escapeAnalysis.TestEABadMergeMem::m_notinlined + * compiler.escapeAnalysis.TestEABadMergeMem */ +package compiler.escapeAnalysis; + public class TestEABadMergeMem { static class Box { diff --git a/test/compiler/escapeAnalysis/TestEscapeThroughInvoke.java b/test/compiler/escapeAnalysis/TestEscapeThroughInvoke.java --- a/test/compiler/escapeAnalysis/TestEscapeThroughInvoke.java +++ b/test/compiler/escapeAnalysis/TestEscapeThroughInvoke.java @@ -25,8 +25,14 @@ * @test * @bug 8073956 * @summary Tests C2 EA with allocated object escaping through a call. - * @run main/othervm -XX:CompileCommand=dontinline,TestEscapeThroughInvoke::create TestEscapeThroughInvoke + * + * @run main/othervm + * -XX:CompileCommand=dontinline,compiler.escapeAnalysis.TestEscapeThroughInvoke::create + * compiler.escapeAnalysis.TestEscapeThroughInvoke */ + +package compiler.escapeAnalysis; + public class TestEscapeThroughInvoke { private A a; @@ -55,20 +61,21 @@ result.saveInto(a, dummy); // result escapes into 'a' here return result; } -} -class A { - private A saved; + static class A { + private A saved; - public A(Integer dummy) { } + public A(Integer dummy) { + } - public void saveInto(A other, Integer dummy) { - other.saved = this; - } + public void saveInto(A other, Integer dummy) { + other.saved = this; + } - public void check(A other) { - if (this.saved != other) { - throw new RuntimeException("TEST FAILED: Objects not equal."); + public void check(A other) { + if (this.saved != other) { + throw new RuntimeException("TEST FAILED: Objects not equal."); + } } } -} +} \ No newline at end of file diff --git a/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java b/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java --- a/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java +++ b/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java @@ -26,12 +26,19 @@ * @bug 8038048 * @summary assert(null_obj->escape_state() == PointsToNode::NoEscape,etc) * @modules java.base/jdk.internal.misc - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+DoEscapeAnalysis -XX:-TieredCompilation -Xbatch TestUnsafePutAddressNullObjMustNotEscape + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+DoEscapeAnalysis + * -XX:-TieredCompilation -Xbatch + * compiler.escapeAnalysis.TestUnsafePutAddressNullObjMustNotEscape + * * @author Richard Reingruber richard DOT reingruber AT sap DOT com */ +package compiler.escapeAnalysis; + +import jdk.internal.misc.Unsafe; + import java.lang.reflect.Field; -import jdk.internal.misc.Unsafe; public class TestUnsafePutAddressNullObjMustNotEscape { diff --git a/test/compiler/escapeAnalysis/6716441/Tester.java b/test/compiler/escapeAnalysis/cr6716441/Tester.java rename from test/compiler/escapeAnalysis/6716441/Tester.java rename to test/compiler/escapeAnalysis/cr6716441/Tester.java --- a/test/compiler/escapeAnalysis/6716441/Tester.java +++ b/test/compiler/escapeAnalysis/cr6716441/Tester.java @@ -25,11 +25,15 @@ * @test * @bug 6716441 * @summary error in meet with +DoEscapeAnalysis - * @run main/othervm -Xcomp -XX:+AggressiveOpts Tester + * + * @run main/othervm -Xcomp -XX:+AggressiveOpts + * compiler.escapeAnalysis.cr6716441.Tester */ /* Complexity upper bound: 70070 ops */ +package compiler.escapeAnalysis.cr6716441; + class Tester_Class_0 { Object var_1; diff --git a/test/compiler/escapeAnalysis/6795161/Test.java b/test/compiler/escapeAnalysis/cr6795161/Test.java rename from test/compiler/escapeAnalysis/6795161/Test.java rename to test/compiler/escapeAnalysis/cr6795161/Test.java --- a/test/compiler/escapeAnalysis/6795161/Test.java +++ b/test/compiler/escapeAnalysis/cr6795161/Test.java @@ -26,9 +26,14 @@ * @test * @bug 6795161 * @summary Escape analysis leads to data corruption - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:CompileOnly=Test -XX:+DoEscapeAnalysis Test + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:+DoEscapeAnalysis + * -XX:CompileCommand=compileonly,compiler.escapeAnalysis.cr6795161.Test::* + * compiler.escapeAnalysis.cr6795161.Test */ +package compiler.escapeAnalysis.cr6795161; + class Test_Class_1 { static String var_1; diff --git a/test/compiler/exceptions/CatchInlineExceptions.java b/test/compiler/exceptions/CatchInlineExceptions.java --- a/test/compiler/exceptions/CatchInlineExceptions.java +++ b/test/compiler/exceptions/CatchInlineExceptions.java @@ -25,13 +25,15 @@ * @test * @bug 8059299 * @summary assert(adr_type != NULL) failed: expecting TypeKlassPtr - * @run main/othervm -Xbatch CatchInlineExceptions + * + * @run main/othervm -Xbatch compiler.exceptions.CatchInlineExceptions */ -class Exception1 extends Exception {}; -class Exception2 extends Exception {}; +package compiler.exceptions; public class CatchInlineExceptions { + static class Exception1 extends Exception {}; + static class Exception2 extends Exception {}; private static int counter0; private static int counter1; private static int counter2; diff --git a/test/compiler/exceptions/SumTest.java b/test/compiler/exceptions/SumTest.java --- a/test/compiler/exceptions/SumTest.java +++ b/test/compiler/exceptions/SumTest.java @@ -25,9 +25,12 @@ * @test * @bug 8066900 * @summary FP registers are not properly restored by C1 when handling exceptions - * @run main/othervm -Xbatch SumTest * + * @run main/othervm -Xbatch compiler.exceptions.SumTest */ + +package compiler.exceptions; + public class SumTest { private static class Sum { diff --git a/test/compiler/exceptions/TestRecursiveReplacedException.java b/test/compiler/exceptions/TestRecursiveReplacedException.java --- a/test/compiler/exceptions/TestRecursiveReplacedException.java +++ b/test/compiler/exceptions/TestRecursiveReplacedException.java @@ -25,10 +25,14 @@ * @test * @bug 8054224 * @summary Recursive method compiled by C1 is unable to catch StackOverflowError - * @run main/othervm -Xcomp -XX:CompileOnly=Test.run -XX:+TieredCompilation -XX:TieredStopAtLevel=2 -Xss512K TestRecursiveReplacedException * + * @run main/othervm -Xcomp -XX:+TieredCompilation -XX:TieredStopAtLevel=2 -Xss512K + * -XX:CompileCommand=compileonly,compiler.exceptions.TestRecursiveReplacedException::run + * compiler.exceptions.TestRecursiveReplacedException */ +package compiler.exceptions; + public class TestRecursiveReplacedException { public static void main(String args[]) { diff --git a/test/compiler/floatingpoint/ModNaN.java b/test/compiler/floatingpoint/ModNaN.java --- a/test/compiler/floatingpoint/ModNaN.java +++ b/test/compiler/floatingpoint/ModNaN.java @@ -24,10 +24,14 @@ /** * @test * @bug 8015396 + * @summary double a%b returns NaN for some (a,b) (|a| < inf, |b|>0) (on Core i7 980X) + * * @ignore 8145543 - * @summary double a%b returns NaN for some (a,b) (|a| < inf, |b|>0) (on Core i7 980X) - * @run main ModNaN + * @run main compiler.floatingpoint.ModNaN */ + +package compiler.floatingpoint; + public class ModNaN { /* This bug was seen in the field for a particular version of the VM, * but never reproduced internally, and the reason was never known, diff --git a/test/compiler/floatingpoint/NaNTest.java b/test/compiler/floatingpoint/NaNTest.java --- a/test/compiler/floatingpoint/NaNTest.java +++ b/test/compiler/floatingpoint/NaNTest.java @@ -24,8 +24,12 @@ * @test * @bug 8076373 * @summary Verify if signaling NaNs are preserved. - * @run main NaNTest + * + * @run main compiler.floatingpoint.NaNTest */ + +package compiler.floatingpoint; + public class NaNTest { static void testFloat() { int originalValue = 0x7f800001; diff --git a/test/compiler/floatingpoint/Test15FloatJNIArgs.java b/test/compiler/floatingpoint/Test15FloatJNIArgs.java --- a/test/compiler/floatingpoint/Test15FloatJNIArgs.java +++ b/test/compiler/floatingpoint/Test15FloatJNIArgs.java @@ -25,11 +25,14 @@ * @bug 8139258 * @summary Regression test for 8139258 which failed to properly pass float args * to a jni function on ppc64le. - * @run main/othervm/native -Xint Test15FloatJNIArgs - * @run main/othervm/native -XX:+TieredCompilation -Xcomp Test15FloatJNIArgs - * @run main/othervm/native -XX:-TieredCompilation -Xcomp Test15FloatJNIArgs + * + * @run main/othervm/native -Xint compiler.floatingpoint.Test15FloatJNIArgs + * @run main/othervm/native -XX:+TieredCompilation -Xcomp compiler.floatingpoint.Test15FloatJNIArgs + * @run main/othervm/native -XX:-TieredCompilation -Xcomp compiler.floatingpoint.Test15FloatJNIArgs */ +package compiler.floatingpoint; + public class Test15FloatJNIArgs { static { try { diff --git a/test/compiler/floatingpoint/TestPow2.java b/test/compiler/floatingpoint/TestPow2.java --- a/test/compiler/floatingpoint/TestPow2.java +++ b/test/compiler/floatingpoint/TestPow2.java @@ -27,18 +27,22 @@ * @summary X^2 special case for C2 yields different result than interpreter * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build TestPow2 + * java.management + * + * @build compiler.floatingpoint.TestPow2 * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestPow2 - * + * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.floatingpoint.TestPow2 */ -import java.lang.reflect.*; +package compiler.floatingpoint; + +import compiler.whitebox.CompilerWhiteBoxTest; import sun.hotspot.WhiteBox; -import compiler.whitebox.CompilerWhiteBoxTest; + +import java.lang.reflect.Method; public class TestPow2 { diff --git a/test/compiler/floatingpoint/libTest15FloatJNIArgs.c b/test/compiler/floatingpoint/libTest15FloatJNIArgs.c --- a/test/compiler/floatingpoint/libTest15FloatJNIArgs.c +++ b/test/compiler/floatingpoint/libTest15FloatJNIArgs.c @@ -27,7 +27,7 @@ extern "C" { #endif -JNIEXPORT jfloat JNICALL Java_Test15FloatJNIArgs_add15floats +JNIEXPORT jfloat JNICALL Java_compiler_floatingpoint_Test15FloatJNIArgs_add15floats (JNIEnv *env, jclass cls, jfloat f1, jfloat f2, jfloat f3, jfloat f4, jfloat f5, jfloat f6, jfloat f7, jfloat f8, diff --git a/test/compiler/gcbarriers/G1CrashTest.java b/test/compiler/gcbarriers/G1CrashTest.java --- a/test/compiler/gcbarriers/G1CrashTest.java +++ b/test/compiler/gcbarriers/G1CrashTest.java @@ -27,11 +27,14 @@ * @bug 8023472 * @summary C2 optimization breaks with G1 * - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -Dcount=100000 G1CrashTest + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -Dcount=100000 compiler.gcbarriers.G1CrashTest * * @author pbiswal@palantir.com */ +package compiler.gcbarriers; + public class G1CrashTest { static Object[] set = new Object[11]; diff --git a/test/compiler/gcbarriers/PreserveFPRegistersTest.java b/test/compiler/gcbarriers/PreserveFPRegistersTest.java --- a/test/compiler/gcbarriers/PreserveFPRegistersTest.java +++ b/test/compiler/gcbarriers/PreserveFPRegistersTest.java @@ -25,9 +25,14 @@ /** * @test * @bug 8148175 + * * @ignore 8153194 - * @run main/othervm/timeout=300 -Xbatch -Xmx128m PreserveFPRegistersTest + * @run main/othervm/timeout=300 -Xbatch -Xmx128m + * compiler.gcbarriers.PreserveFPRegistersTest */ + +package compiler.gcbarriers; + public class PreserveFPRegistersTest { public static void main(String... args) throws InterruptedException { diff --git a/test/compiler/inlining/DefaultAndConcreteMethodsCHA.java b/test/compiler/inlining/DefaultAndConcreteMethodsCHA.java --- a/test/compiler/inlining/DefaultAndConcreteMethodsCHA.java +++ b/test/compiler/inlining/DefaultAndConcreteMethodsCHA.java @@ -26,18 +26,21 @@ * @bug 8031695 * @summary CHA ignores default methods during analysis leading to incorrect code generation * - * @run main/othervm -Xbatch DefaultAndConcreteMethodsCHA + * @run main/othervm -Xbatch compiler.inlining.DefaultAndConcreteMethodsCHA */ -interface I { - default int m() { return 0; } -} -class A implements I {} - -class C extends A { } -class D extends A { public int m() { return 1; } } +package compiler.inlining; public class DefaultAndConcreteMethodsCHA { + interface I { + default int m() { return 0; } + } + + static class A implements I {} + + static class C extends A { } + static class D extends A { public int m() { return 1; } } + public static int test(A obj) { return obj.m(); } diff --git a/test/compiler/inlining/DefaultMethodsDependencies.java b/test/compiler/inlining/DefaultMethodsDependencies.java --- a/test/compiler/inlining/DefaultMethodsDependencies.java +++ b/test/compiler/inlining/DefaultMethodsDependencies.java @@ -25,10 +25,15 @@ * @test * @bug 8069263 * @summary Deoptimization between array allocation and arraycopy may result in non initialized array - * @run main/othervm -XX:-BackgroundCompilation -XX:CompileOnly=DefaultMethodsDependencies::test -XX:CompileOnly=DefaultMethodsDependencies$I2::m1 DefaultMethodsDependencies * + * @run main/othervm -XX:-BackgroundCompilation + * -XX:CompileCommand=compileonly,compiler.inlining.DefaultMethodsDependencies::test + * -XX:CompileCommand=compileonly,compiler.inlining.DefaultMethodsDependencies$I2::m1 + * compiler.inlining.DefaultMethodsDependencies */ +package compiler.inlining; + public class DefaultMethodsDependencies { interface I1 { diff --git a/test/compiler/inlining/InlineAccessors.java b/test/compiler/inlining/InlineAccessors.java --- a/test/compiler/inlining/InlineAccessors.java +++ b/test/compiler/inlining/InlineAccessors.java @@ -27,11 +27,14 @@ * @summary Method::is_accessor should cover getters and setters for all types * @modules java.base/jdk.internal.misc * @library /testlibrary - * @run main/othervm InlineAccessors + * + * @run driver compiler.inlining.InlineAccessors */ -import java.lang.invoke.*; -import jdk.test.lib.*; -import static jdk.test.lib.Asserts.*; + +package compiler.inlining; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; public class InlineAccessors { public static void main(String[] args) throws Exception { @@ -42,7 +45,7 @@ "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-server", "-XX:-TieredCompilation", "-Xbatch", "-Xcomp", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", - "InlineAccessors$Launcher"); + Launcher.class.getName()); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/compiler/inlining/InlineDefaultMethod.java b/test/compiler/inlining/InlineDefaultMethod.java --- a/test/compiler/inlining/InlineDefaultMethod.java +++ b/test/compiler/inlining/InlineDefaultMethod.java @@ -25,29 +25,32 @@ * @test * @bug 8026735 * @summary CHA in C1 should make correct decisions about default methods - * @run main/othervm -Xcomp -XX:CompileOnly=InlineDefaultMethod::test -XX:TieredStopAtLevel=1 InlineDefaultMethod + * + * @run main/othervm -Xcomp -XX:TieredStopAtLevel=1 + * -XX:CompileCommand=compileonly,compiler.inlining.InlineDefaultMethod::test + * compiler.inlining.InlineDefaultMethod */ +package compiler.inlining; +public class InlineDefaultMethod { + interface InterfaceWithDefaultMethod0 { + default public int defaultMethod() { + return 1; + } + } -interface InterfaceWithDefaultMethod0 { - default public int defaultMethod() { - return 1; + interface InterfaceWithDefaultMethod1 extends InterfaceWithDefaultMethod0 { } + + static abstract class Subtype implements InterfaceWithDefaultMethod1 { } + + static class Decoy extends Subtype { + public int defaultMethod() { + return 2; + } } -} -interface InterfaceWithDefaultMethod1 extends InterfaceWithDefaultMethod0 { } + static class Instance extends Subtype { } -abstract class Subtype implements InterfaceWithDefaultMethod1 { } - -class Decoy extends Subtype { - public int defaultMethod() { - return 2; - } -} - -class Instance extends Subtype { } - -public class InlineDefaultMethod { public static int test(InterfaceWithDefaultMethod1 x) { return x.defaultMethod(); } diff --git a/test/compiler/inlining/InlineDefaultMethod1.java b/test/compiler/inlining/InlineDefaultMethod1.java --- a/test/compiler/inlining/InlineDefaultMethod1.java +++ b/test/compiler/inlining/InlineDefaultMethod1.java @@ -25,25 +25,32 @@ * @test * @bug 8036100 * @summary Default method returns true for a while, and then returns false - * @run main/othervm -Xcomp -XX:CompileOnly=InlineDefaultMethod1::test - * -XX:CompileOnly=I1::m -XX:CompileOnly=I2::m - * InlineDefaultMethod1 + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.inlining.InlineDefaultMethod1::test + * -XX:CompileCommand=compileonly,compiler.inlining.InlineDefaultMethod1$I1::m + * -XX:CompileCommand=compileonly,compiler.inlining.InlineDefaultMethod1$I2::m + * compiler.inlining.InlineDefaultMethod1 */ -interface I1 { - default public int m() { return 0; } -} -interface I2 extends I1 { - default public int m() { return 1; } -} - -abstract class A implements I1 { -} - -class B extends A implements I2 { -} +package compiler.inlining; public class InlineDefaultMethod1 { + interface I1 { + default public int m() { return 0; } + } + + interface I2 extends I1 { + default public int m() { return 1; } + } + + static abstract class A implements I1 { + } + + static class B extends A implements I2 { + } + + public static void test(A obj) { int id = obj.m(); if (id != 1) { diff --git a/test/compiler/integerArithmetic/TestIntegerComparison.java b/test/compiler/integerArithmetic/TestIntegerComparison.java --- a/test/compiler/integerArithmetic/TestIntegerComparison.java +++ b/test/compiler/integerArithmetic/TestIntegerComparison.java @@ -24,34 +24,42 @@ /* * @test TestIntegerComparison * @bug 8043284 8042786 - * @summary "Tests optimizations of signed and unsigned integer comparison." - * @run main/othervm -Xcomp -XX:CompileOnly=TestIntegerComparison::testSigned,TestIntegerComparison::testUnsigned TestIntegerComparison + * @summary Tests optimizations of signed and unsigned integer comparison. + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.integerArithmetic.TestIntegerComparison::testSigned + * -XX:CompileCommand=compileonly,compiler.integerArithmetic.TestIntegerComparison::testUnsigned + * compiler.integerArithmetic.TestIntegerComparison */ +package compiler.integerArithmetic; + public class TestIntegerComparison { - /** - * Tests optimization of signed integer comparison (see BoolNode::Ideal). - * The body of the if statement is unreachable and should not be compiled. - * @param c Character (value in the integer range [0, 65535]) - */ - public static void testSigned(char c) { - // The following addition may overflow. The result is in one - // of the two ranges [IntMax] and [IntMin, IntMin + CharMax - 1]. - int result = c + Integer.MAX_VALUE; - // CmpINode has to consider both result ranges instead of only - // the general [IntMin, IntMax] range to be able to prove that - // result is always unequal to CharMax. - if (result == Character.MAX_VALUE) { - // Unreachable - throw new RuntimeException("Should not reach here!"); + /** + * Tests optimization of signed integer comparison (see BoolNode::Ideal). + * The body of the if statement is unreachable and should not be compiled. + * + * @param c Character (value in the integer range [0, 65535]) + */ + public static void testSigned(char c) { + // The following addition may overflow. The result is in one + // of the two ranges [IntMax] and [IntMin, IntMin + CharMax - 1]. + int result = c + Integer.MAX_VALUE; + // CmpINode has to consider both result ranges instead of only + // the general [IntMin, IntMax] range to be able to prove that + // result is always unequal to CharMax. + if (result == Character.MAX_VALUE) { + // Unreachable + throw new RuntimeException("Should not reach here!"); + } } - } - /** - * Tests optimization of unsigned integer comparison (see CmpUNode::Value). - * The body of the if statement is unreachable and should not be compiled. - * @param c Character (value in the integer range [0, 65535]) - */ - public static void testUnsigned(char c) { + /** + * Tests optimization of unsigned integer comparison (see CmpUNode::Value). + * The body of the if statement is unreachable and should not be compiled. + * + * @param c Character (value in the integer range [0, 65535]) + */ + public static void testUnsigned(char c) { /* * The following if statement consisting of two CmpIs is replaced * by a CmpU during optimization (see 'IfNode::fold_compares'). @@ -72,21 +80,21 @@ * that due to the overflow the signed comparison result < 98 is * always false. */ - int result = c - (Character.MAX_VALUE - Integer.MIN_VALUE) + 2; - if (1 < result && result < 100) { - // Unreachable - throw new RuntimeException("Should not reach here!"); + int result = c - (Character.MAX_VALUE - Integer.MIN_VALUE) + 2; + if (1 < result && result < 100) { + // Unreachable + throw new RuntimeException("Should not reach here!"); + } } - } - /** - * Tests optimizations of signed and unsigned integer comparison. - */ - public static void main(String[] args) { - // We use characters to get a limited integer range for free - for (int i = Character.MIN_VALUE; i <= Character.MAX_VALUE; ++i) { - testSigned((char) i); - testUnsigned((char) i); + /** + * Tests optimizations of signed and unsigned integer comparison. + */ + public static void main(String[] args) { + // We use characters to get a limited integer range for free + for (int i = Character.MIN_VALUE; i <= Character.MAX_VALUE; ++i) { + testSigned((char) i); + testUnsigned((char) i); + } } - } } diff --git a/test/compiler/interpreter/DisableOSRTest.java b/test/compiler/interpreter/DisableOSRTest.java --- a/test/compiler/interpreter/DisableOSRTest.java +++ b/test/compiler/interpreter/DisableOSRTest.java @@ -27,18 +27,24 @@ * @summary testing that -XX:-UseOnStackReplacement works with both -XX:(+/-)TieredCompilation * @modules java.base/jdk.internal.misc * @library /testlibrary /test/lib / + * * @build sun.hotspot.WhiteBox - * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+PrintCompilation - * -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:-UseOnStackReplacement DisableOSRTest + * -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:-UseOnStackReplacement + * compiler.interpreter.DisableOSRTest * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+PrintCompilation - * -XX:-BackgroundCompilation -XX:+TieredCompilation -XX:-UseOnStackReplacement DisableOSRTest + * -XX:-BackgroundCompilation -XX:+TieredCompilation -XX:-UseOnStackReplacement + * compiler.interpreter.DisableOSRTest */ +package compiler.interpreter; + +import sun.hotspot.WhiteBox; + import java.lang.reflect.Method; import java.util.Random; -import sun.hotspot.WhiteBox; public class DisableOSRTest { private static final WhiteBox WB = WhiteBox.getWhiteBox(); diff --git a/test/compiler/interpreter/6539464/Test.java b/test/compiler/interpreter/Test6539464.java rename from test/compiler/interpreter/6539464/Test.java rename to test/compiler/interpreter/Test6539464.java --- a/test/compiler/interpreter/6539464/Test.java +++ b/test/compiler/interpreter/Test6539464.java @@ -26,10 +26,14 @@ * @bug 6539464 * @summary Math.log() produces inconsistent results between successive runs. * - * @run main/othervm -Xcomp -XX:CompileOnly=Test.main Test + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.interpreter.Test6539464::main + * compiler.interpreter.Test6539464 */ -public class Test { +package compiler.interpreter; + +public class Test6539464 { static double log_value = 17197; static double log_result = Math.log(log_value); diff --git a/test/compiler/interpreter/6833129/Test.java b/test/compiler/interpreter/Test6833129.java rename from test/compiler/interpreter/6833129/Test.java rename to test/compiler/interpreter/Test6833129.java --- a/test/compiler/interpreter/6833129/Test.java +++ b/test/compiler/interpreter/Test6833129.java @@ -25,10 +25,13 @@ * @test * @bug 6833129 * @summary Object.clone() and Arrays.copyOf ignore coping with -XX:+DeoptimizeALot - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot Test + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot + * compiler.interpreter.Test6833129 */ -public class Test{ +package compiler.interpreter; + +public class Test6833129 { public static void init(int src[]) { for (int i =0; ijvms()->same_calls_as(_exceptions->jvms())) failed: all collected exceptions must come from the same place * @modules java.base/jdk.internal.misc * @library /testlibrary - * @run main/othervm -XX:-TieredCompilation -Xbatch -XX:CompileOnly=TestObjectClone::f TestObjectClone + * + * @run main/othervm -XX:-TieredCompilation -Xbatch + * -XX:CompileCommand=compileonly,compiler.intrinsics.object.TestClone::f + * compiler.intrinsics.object.TestClone */ + +package compiler.intrinsics.object; + import jdk.test.lib.Asserts; -public class TestObjectClone implements Cloneable { - static class A extends TestObjectClone {} - static class B extends TestObjectClone { +public class TestClone implements Cloneable { + static class A extends TestClone {} + static class B extends TestClone { public B clone() { - return (B)TestObjectClone.b; + return (B)TestClone.b; } } - static class C extends TestObjectClone { + static class C extends TestClone { public C clone() { - return (C)TestObjectClone.c; + return (C)TestClone.c; } } - static class D extends TestObjectClone { + static class D extends TestClone { public D clone() { - return (D)TestObjectClone.d; + return (D)TestClone.d; } } - static TestObjectClone a = new A(), b = new B(), c = new C(), d = new D(); + static TestClone a = new A(), b = new B(), c = new C(), d = new D(); - public static Object f(TestObjectClone o) throws CloneNotSupportedException { + public static Object f(TestClone o) throws CloneNotSupportedException { // Polymorphic call site: >90% Object::clone / <10% other methods return o.clone(); } public static void main(String[] args) throws Exception { - TestObjectClone[] params1 = {a, a, a, a, a, a, a, a, a, a, a, - a, a, a, a, a, a, a, a, a, a, a, - a, a, a, a, a, a, a, a, a, a, a, - b, c, d}; + TestClone[] params1 = {a, a, a, a, a, a, a, a, a, a, a, + a, a, a, a, a, a, a, a, a, a, a, + a, a, a, a, a, a, a, a, a, a, a, + b, c, d}; for (int i = 0; i < 15000; i++) { f(params1[i % params1.length]); diff --git a/test/compiler/intrinsics/hashcode/TestHashCode.java b/test/compiler/intrinsics/object/TestHashCode.java rename from test/compiler/intrinsics/hashcode/TestHashCode.java rename to test/compiler/intrinsics/object/TestHashCode.java --- a/test/compiler/intrinsics/hashcode/TestHashCode.java +++ b/test/compiler/intrinsics/object/TestHashCode.java @@ -25,10 +25,15 @@ * @test * @bug 8011646 * @summary SEGV in compiled code with loop predication - * @run main/othervm -XX:-TieredCompilation -XX:CompileOnly=TestHashCode.m1,Object.hashCode TestHashCode * + * @run main/othervm -XX:-TieredCompilation + * -XX:CompileCommand=compileonly,java.lang.Object::hashCode + * -XX:CompileCommand=compileonly,compiler.intrinsics.object.TestHashCode::m1 + * compiler.intrinsics.object.TestHashCode */ +package compiler.intrinsics.object; + public class TestHashCode { static class A { int i; diff --git a/test/compiler/intrinsics/sha/TestSHA.java b/test/compiler/intrinsics/sha/TestSHA.java --- a/test/compiler/intrinsics/sha/TestSHA.java +++ b/test/compiler/intrinsics/sha/TestSHA.java @@ -27,26 +27,58 @@ * @bug 8035968 * @summary C2 support for SHA on SPARC * - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-1 TestSHA - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-224 TestSHA - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-256 TestSHA - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-384 TestSHA - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-512 TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-1 + * compiler.intrinsics.sha.TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-224 + * compiler.intrinsics.sha.TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-256 + * compiler.intrinsics.sha.TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-384 + * compiler.intrinsics.sha.TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-512 + * compiler.intrinsics.sha.TestSHA * - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-1 -Doffset=1 TestSHA - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-224 -Doffset=1 TestSHA - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-256 -Doffset=1 TestSHA - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-384 -Doffset=1 TestSHA - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-512 -Doffset=1 TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-1 -Doffset=1 + * compiler.intrinsics.sha.TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-224 -Doffset=1 + * compiler.intrinsics.sha.TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-256 -Doffset=1 + * compiler.intrinsics.sha.TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-384 -Doffset=1 + * compiler.intrinsics.sha.TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-512 -Doffset=1 + * compiler.intrinsics.sha.TestSHA * - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-1 -Dalgorithm2=SHA-256 TestSHA - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-1 -Dalgorithm2=SHA-512 TestSHA - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-256 -Dalgorithm2=SHA-512 TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-1 -Dalgorithm2=SHA-256 + * compiler.intrinsics.sha.TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-1 -Dalgorithm2=SHA-512 + * compiler.intrinsics.sha.TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-256 -Dalgorithm2=SHA-512 + * compiler.intrinsics.sha.TestSHA * - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=SHA-1 -Dalgorithm2=MD5 TestSHA - * @run main/othervm/timeout=600 -Xbatch -Dalgorithm=MD5 -Dalgorithm2=SHA-1 TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=SHA-1 -Dalgorithm2=MD5 + * compiler.intrinsics.sha.TestSHA + * @run main/othervm/timeout=600 -Xbatch + * -Dalgorithm=MD5 -Dalgorithm2=SHA-1 + * compiler.intrinsics.sha.TestSHA */ +package compiler.intrinsics.sha; + import java.security.MessageDigest; import java.util.Arrays; @@ -70,7 +102,7 @@ } } - static void testSHA(String provider, String algorithm, int msgSize, + public static void testSHA(String provider, String algorithm, int msgSize, int offset, int iters, int warmupIters) throws Exception { System.out.println("provider = " + provider); System.out.println("algorithm = " + algorithm); diff --git a/test/compiler/intrinsics/sha/cli/SHAOptionsBase.java b/test/compiler/intrinsics/sha/cli/SHAOptionsBase.java --- a/test/compiler/intrinsics/sha/cli/SHAOptionsBase.java +++ b/test/compiler/intrinsics/sha/cli/SHAOptionsBase.java @@ -21,9 +21,11 @@ * questions. */ +package compiler.intrinsics.sha.cli; + +import compiler.testlibrary.sha.predicate.IntrinsicPredicates; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; -import compiler.testlibrary.sha.predicate.IntrinsicPredicates; import java.util.function.BooleanSupplier; @@ -34,17 +36,17 @@ * from several test cases shared among different tests. */ public class SHAOptionsBase extends CommandLineOptionTest { - protected static final String USE_SHA_OPTION = "UseSHA"; - protected static final String USE_SHA1_INTRINSICS_OPTION + public static final String USE_SHA_OPTION = "UseSHA"; + public static final String USE_SHA1_INTRINSICS_OPTION = "UseSHA1Intrinsics"; - protected static final String USE_SHA256_INTRINSICS_OPTION + public static final String USE_SHA256_INTRINSICS_OPTION = "UseSHA256Intrinsics"; - protected static final String USE_SHA512_INTRINSICS_OPTION + public static final String USE_SHA512_INTRINSICS_OPTION = "UseSHA512Intrinsics"; // Intrinsics flags are of diagnostic type // and must be preceded by UnlockDiagnosticVMOptions. - protected static final String UNLOCK_DIAGNOSTIC_VM_OPTIONS + public static final String UNLOCK_DIAGNOSTIC_VM_OPTIONS = "-XX:+UnlockDiagnosticVMOptions"; // Note that strings below will be passed to @@ -71,7 +73,7 @@ * @return A warning message that will be printed out to VM output if CPU * instructions required by the option are not supported. */ - protected static String getWarningForUnsupportedCPU(String optionName) { + public static String getWarningForUnsupportedCPU(String optionName) { if (Platform.isSparc() || Platform.isAArch64() || Platform.isX64() || Platform.isX86()) { switch (optionName) { @@ -101,7 +103,7 @@ * @return The predicate on availability of CPU instructions required by the * option. */ - protected static BooleanSupplier getPredicateForOption(String optionName) { + public static BooleanSupplier getPredicateForOption(String optionName) { switch (optionName) { case SHAOptionsBase.USE_SHA_OPTION: return IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE; diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java --- a/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java +++ b/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java @@ -28,12 +28,19 @@ * @library /testlibrary /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseSHA1IntrinsicsOptionOnSupportedCPU + * + * @build compiler.intrinsics.sha.cli.TestUseSHA1IntrinsicsOptionOnSupportedCPU * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseSHA1IntrinsicsOptionOnSupportedCPU + * -XX:+WhiteBoxAPI + * compiler.intrinsics.sha.cli.TestUseSHA1IntrinsicsOptionOnSupportedCPU */ + +package compiler.intrinsics.sha.cli; + +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForSupportedCPU; + public class TestUseSHA1IntrinsicsOptionOnSupportedCPU { public static void main(String args[]) throws Throwable { new SHAOptionsBase(new GenericTestCaseForSupportedCPU( diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java --- a/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java +++ b/test/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java @@ -28,13 +28,23 @@ * @library /testlibrary /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseSHA1IntrinsicsOptionOnUnsupportedCPU + * + * @build compiler.intrinsics.sha.cli.TestUseSHA1IntrinsicsOptionOnUnsupportedCPU * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestUseSHA1IntrinsicsOptionOnUnsupportedCPU + * compiler.intrinsics.sha.cli.TestUseSHA1IntrinsicsOptionOnUnsupportedCPU */ + +package compiler.intrinsics.sha.cli; + +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU; +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU; +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedSparcCPU; +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU; +import compiler.intrinsics.sha.cli.testcases.UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU; + public class TestUseSHA1IntrinsicsOptionOnUnsupportedCPU { public static void main(String args[]) throws Throwable { new SHAOptionsBase( diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java --- a/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java +++ b/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java @@ -28,13 +28,19 @@ * @library /testlibrary /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseSHA256IntrinsicsOptionOnSupportedCPU + * + * @build compiler.intrinsics.sha.cli.TestUseSHA256IntrinsicsOptionOnSupportedCPU * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestUseSHA256IntrinsicsOptionOnSupportedCPU + * compiler.intrinsics.sha.cli.TestUseSHA256IntrinsicsOptionOnSupportedCPU */ + +package compiler.intrinsics.sha.cli; + +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForSupportedCPU; + public class TestUseSHA256IntrinsicsOptionOnSupportedCPU { public static void main(String args[]) throws Throwable { new SHAOptionsBase(new GenericTestCaseForSupportedCPU( diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java --- a/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java +++ b/test/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java @@ -28,13 +28,23 @@ * @library /testlibrary /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseSHA256IntrinsicsOptionOnUnsupportedCPU + * + * @build compiler.intrinsics.sha.cli.TestUseSHA256IntrinsicsOptionOnUnsupportedCPU * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestUseSHA256IntrinsicsOptionOnUnsupportedCPU + * compiler.intrinsics.sha.cli.TestUseSHA256IntrinsicsOptionOnUnsupportedCPU */ + +package compiler.intrinsics.sha.cli; + +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU; +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU; +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedSparcCPU; +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU; +import compiler.intrinsics.sha.cli.testcases.UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU; + public class TestUseSHA256IntrinsicsOptionOnUnsupportedCPU { public static void main(String args[]) throws Throwable { new SHAOptionsBase( diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java --- a/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java +++ b/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java @@ -28,13 +28,19 @@ * @library /testlibrary /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseSHA512IntrinsicsOptionOnSupportedCPU + * + * @build compiler.intrinsics.sha.cli.TestUseSHA512IntrinsicsOptionOnSupportedCPU * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestUseSHA512IntrinsicsOptionOnSupportedCPU + * compiler.intrinsics.sha.cli.TestUseSHA512IntrinsicsOptionOnSupportedCPU */ + +package compiler.intrinsics.sha.cli; + +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForSupportedCPU; + public class TestUseSHA512IntrinsicsOptionOnSupportedCPU { public static void main(String args[]) throws Throwable { new SHAOptionsBase(new GenericTestCaseForSupportedCPU( diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java --- a/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java +++ b/test/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java @@ -28,13 +28,23 @@ * @library /testlibrary /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseSHA512IntrinsicsOptionOnUnsupportedCPU + * + * @build compiler.intrinsics.sha.cli.TestUseSHA512IntrinsicsOptionOnUnsupportedCPU * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestUseSHA512IntrinsicsOptionOnUnsupportedCPU + * compiler.intrinsics.sha.cli.TestUseSHA512IntrinsicsOptionOnUnsupportedCPU */ + +package compiler.intrinsics.sha.cli; + +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU; +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU; +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedSparcCPU; +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU; +import compiler.intrinsics.sha.cli.testcases.UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU; + public class TestUseSHA512IntrinsicsOptionOnUnsupportedCPU { public static void main(String args[]) throws Throwable { new SHAOptionsBase( diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java --- a/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java +++ b/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java @@ -28,12 +28,20 @@ * @library /testlibrary /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseSHAOptionOnSupportedCPU + * + * @build compiler.intrinsics.sha.cli.TestUseSHAOptionOnSupportedCPU * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseSHAOptionOnSupportedCPU + * -XX:+WhiteBoxAPI + * compiler.intrinsics.sha.cli.TestUseSHAOptionOnSupportedCPU */ + +package compiler.intrinsics.sha.cli; + +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForSupportedCPU; +import compiler.intrinsics.sha.cli.testcases.UseSHASpecificTestCaseForSupportedCPU; + public class TestUseSHAOptionOnSupportedCPU { public static void main(String args[]) throws Throwable { new SHAOptionsBase( diff --git a/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java b/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java --- a/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java +++ b/test/compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java @@ -28,12 +28,22 @@ * @library /testlibrary /test/lib testcases / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseSHAOptionOnUnsupportedCPU + * @build compiler.intrinsics.sha.cli.TestUseSHAOptionOnUnsupportedCPU * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseSHAOptionOnUnsupportedCPU + * -XX:+WhiteBoxAPI + * compiler.intrinsics.sha.cli.TestUseSHAOptionOnUnsupportedCPU */ + +package compiler.intrinsics.sha.cli; + +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForOtherCPU; +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedAArch64CPU; +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedSparcCPU; +import compiler.intrinsics.sha.cli.testcases.GenericTestCaseForUnsupportedX86CPU; +import compiler.intrinsics.sha.cli.testcases.UseSHASpecificTestCaseForUnsupportedCPU; + public class TestUseSHAOptionOnUnsupportedCPU { public static void main(String args[]) throws Throwable { new SHAOptionsBase( diff --git a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java --- a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java +++ b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java @@ -21,6 +21,9 @@ * questions. */ +package compiler.intrinsics.sha.cli.testcases; + +import compiler.intrinsics.sha.cli.SHAOptionsBase; import jdk.test.lib.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; diff --git a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java --- a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java +++ b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java @@ -21,6 +21,9 @@ * questions. */ +package compiler.intrinsics.sha.cli.testcases; + +import compiler.intrinsics.sha.cli.SHAOptionsBase; import jdk.test.lib.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; diff --git a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java --- a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java +++ b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedAArch64CPU.java @@ -21,6 +21,9 @@ * questions. */ +package compiler.intrinsics.sha.cli.testcases; + +import compiler.intrinsics.sha.cli.SHAOptionsBase; import jdk.test.lib.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; diff --git a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java --- a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java +++ b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java @@ -21,6 +21,9 @@ * questions. */ +package compiler.intrinsics.sha.cli.testcases; + +import compiler.intrinsics.sha.cli.SHAOptionsBase; import jdk.test.lib.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; diff --git a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java --- a/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java +++ b/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java @@ -21,12 +21,15 @@ * questions. */ +package compiler.intrinsics.sha.cli.testcases; + +import compiler.intrinsics.sha.cli.SHAOptionsBase; import jdk.test.lib.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; +import jdk.test.lib.cli.predicate.NotPredicate; import jdk.test.lib.cli.predicate.OrPredicate; -import jdk.test.lib.cli.predicate.NotPredicate; /** * Generic test case for SHA-related options targeted to X86 CPUs that don't diff --git a/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java b/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java --- a/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java +++ b/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java @@ -21,13 +21,16 @@ * questions. */ +package compiler.intrinsics.sha.cli.testcases; + +import compiler.intrinsics.sha.cli.SHAOptionsBase; +import compiler.testlibrary.sha.predicate.IntrinsicPredicates; import jdk.test.lib.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; +import jdk.test.lib.cli.predicate.NotPredicate; import jdk.test.lib.cli.predicate.OrPredicate; -import jdk.test.lib.cli.predicate.NotPredicate; -import compiler.testlibrary.sha.predicate.IntrinsicPredicates; /** * Test case specific to UseSHA*Intrinsics options targeted to SPARC and AArch64 diff --git a/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java b/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java --- a/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java +++ b/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java @@ -21,13 +21,16 @@ * questions. */ +package compiler.intrinsics.sha.cli.testcases; + +import compiler.intrinsics.sha.cli.SHAOptionsBase; +import compiler.testlibrary.sha.predicate.IntrinsicPredicates; import jdk.test.lib.Asserts; import jdk.test.lib.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.OrPredicate; -import compiler.testlibrary.sha.predicate.IntrinsicPredicates; /** * UseSHA specific test case targeted to SPARC and AArch64 CPUs which diff --git a/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java b/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java --- a/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java +++ b/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java @@ -21,14 +21,17 @@ * questions. */ +package compiler.intrinsics.sha.cli.testcases; + +import compiler.intrinsics.sha.cli.SHAOptionsBase; +import compiler.testlibrary.sha.predicate.IntrinsicPredicates; import jdk.test.lib.Asserts; import jdk.test.lib.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; +import jdk.test.lib.cli.predicate.NotPredicate; import jdk.test.lib.cli.predicate.OrPredicate; -import jdk.test.lib.cli.predicate.NotPredicate; -import compiler.testlibrary.sha.predicate.IntrinsicPredicates; /** * UseSHA specific test case targeted to SPARC and AArch64 CPUs which don't diff --git a/test/compiler/intrinsics/sha/sanity/SHASanityTestBase.java b/test/compiler/intrinsics/sha/sanity/SHASanityTestBase.java --- a/test/compiler/intrinsics/sha/sanity/SHASanityTestBase.java +++ b/test/compiler/intrinsics/sha/sanity/SHASanityTestBase.java @@ -21,6 +21,10 @@ * questions. */ +package compiler.intrinsics.sha.sanity; + +import compiler.intrinsics.sha.TestSHA; +import compiler.testlibrary.intrinsics.Verifier; import sun.hotspot.WhiteBox; import java.io.FileOutputStream; @@ -29,8 +33,6 @@ import java.util.Properties; import java.util.function.BooleanSupplier; -import compiler.testlibrary.intrinsics.Verifier; - /** * Base class for sanity tests on SHA intrinsics support. */ diff --git a/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java b/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java --- a/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java +++ b/test/compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java @@ -25,10 +25,12 @@ * @test * @bug 8035968 * @summary Verify that SHA-1 intrinsic is actually used. - * @library /testlibrary /test/lib / ../ + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestSHA compiler.testlibrary.intrinsics.Verifier TestSHA1Intrinsics + * + * @build compiler.testlibrary.intrinsics.Verifier + * compiler.intrinsics.sha.sanity.TestSHA1Intrinsics * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -38,7 +40,8 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA1Intrinsics - * -Dalgorithm=SHA-1 TestSHA1Intrinsics + * -Dalgorithm=SHA-1 + * compiler.intrinsics.sha.sanity.TestSHA1Intrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -46,11 +49,14 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:-UseSHA1Intrinsics - * -Dalgorithm=SHA-1 TestSHA1Intrinsics + * -Dalgorithm=SHA-1 + * compiler.intrinsics.sha.sanity.TestSHA1Intrinsics * @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE * compiler.testlibrary.intrinsics.Verifier positive.log negative.log */ +package compiler.intrinsics.sha.sanity; + import compiler.testlibrary.sha.predicate.IntrinsicPredicates; public class TestSHA1Intrinsics { diff --git a/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java b/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java --- a/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java +++ b/test/compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java @@ -25,10 +25,12 @@ * @test * @bug 8035968 * @summary Verify that SHA-1 multi block intrinsic is actually used. - * @library /testlibrary /test/lib / ../ + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestSHA compiler.testlibrary.intrinsics.Verifier TestSHA1MultiBlockIntrinsics + * + * @build compiler.testlibrary.intrinsics.Verifier + * compiler.intrinsics.sha.sanity.TestSHA1MultiBlockIntrinsics * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -39,7 +41,8 @@ * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA1Intrinsics -XX:-UseSHA256Intrinsics * -XX:-UseSHA512Intrinsics - * -Dalgorithm=SHA-1 TestSHA1MultiBlockIntrinsics + * -Dalgorithm=SHA-1 + * compiler.intrinsics.sha.sanity.TestSHA1MultiBlockIntrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -47,19 +50,21 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA1Intrinsics -Dalgorithm=SHA-1 - * TestSHA1MultiBlockIntrinsics + * compiler.intrinsics.sha.sanity.TestSHA1MultiBlockIntrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 * -XX:+LogCompilation -XX:LogFile=negative.log * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA -XX:-UseSHA - * -Dalgorithm=SHA-1 TestSHA1MultiBlockIntrinsics + * -Dalgorithm=SHA-1 + * compiler.intrinsics.sha.sanity.TestSHA1MultiBlockIntrinsics * @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE * compiler.testlibrary.intrinsics.Verifier positive.log positive_def.log * negative.log */ +package compiler.intrinsics.sha.sanity; import compiler.testlibrary.sha.predicate.IntrinsicPredicates; public class TestSHA1MultiBlockIntrinsics { diff --git a/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java b/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java --- a/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java +++ b/test/compiler/intrinsics/sha/sanity/TestSHA256Intrinsics.java @@ -25,10 +25,12 @@ * @test * @bug 8035968 * @summary Verify that SHA-256 intrinsic is actually used. - * @library /testlibrary /test/lib / ../ + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestSHA compiler.testlibrary.intrinsics.Verifier TestSHA256Intrinsics + * + * @build compiler.testlibrary.intrinsics.Verifier + * compiler.intrinsics.sha.sanity.TestSHA256Intrinsics * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -38,7 +40,8 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA256Intrinsics - * -Dalgorithm=SHA-224 TestSHA256Intrinsics + * -Dalgorithm=SHA-224 + * compiler.intrinsics.sha.sanity.TestSHA256Intrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -46,7 +49,8 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:-UseSHA256Intrinsics - * -Dalgorithm=SHA-224 TestSHA256Intrinsics + * -Dalgorithm=SHA-224 + * compiler.intrinsics.sha.sanity.TestSHA256Intrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -54,7 +58,8 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA256Intrinsics - * -Dalgorithm=SHA-256 TestSHA256Intrinsics + * -Dalgorithm=SHA-256 + * compiler.intrinsics.sha.sanity.TestSHA256Intrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -62,12 +67,15 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:-UseSHA256Intrinsics - * -Dalgorithm=SHA-256 TestSHA256Intrinsics + * -Dalgorithm=SHA-256 + * compiler.intrinsics.sha.sanity.TestSHA256Intrinsics * @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE * compiler.testlibrary.intrinsics.Verifier positive_224.log positive_256.log * negative_224.log negative_256.log */ +package compiler.intrinsics.sha.sanity; + import compiler.testlibrary.sha.predicate.IntrinsicPredicates; public class TestSHA256Intrinsics { diff --git a/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java b/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java --- a/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java +++ b/test/compiler/intrinsics/sha/sanity/TestSHA256MultiBlockIntrinsics.java @@ -25,10 +25,12 @@ * @test * @bug 8035968 * @summary Verify that SHA-256 multi block intrinsic is actually used. - * @library /testlibrary /test/lib / ../ + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestSHA compiler.testlibrary.intrinsics.Verifier TestSHA256MultiBlockIntrinsics + * + * @build compiler.testlibrary.intrinsics.Verifier + * compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -39,7 +41,8 @@ * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA256Intrinsics -XX:-UseSHA1Intrinsics * -XX:-UseSHA512Intrinsics - * -Dalgorithm=SHA-224 TestSHA256MultiBlockIntrinsics + * -Dalgorithm=SHA-224 + * compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -47,14 +50,15 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA256Intrinsics -Dalgorithm=SHA-224 - * TestSHA256MultiBlockIntrinsics + * compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 * -XX:+LogCompilation -XX:LogFile=negative_224.log * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA -XX:-UseSHA - * -Dalgorithm=SHA-224 TestSHA256MultiBlockIntrinsics + * -Dalgorithm=SHA-224 + * compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -63,7 +67,8 @@ * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA256Intrinsics -XX:-UseSHA1Intrinsics * -XX:-UseSHA512Intrinsics - * -Dalgorithm=SHA-256 TestSHA256MultiBlockIntrinsics + * -Dalgorithm=SHA-256 + * compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -71,20 +76,22 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA256Intrinsics -Dalgorithm=SHA-256 - * TestSHA256MultiBlockIntrinsics + * compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 * -XX:+LogCompilation -XX:LogFile=negative_256.log * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA -XX:-UseSHA - * -Dalgorithm=SHA-256 TestSHA256MultiBlockIntrinsics + * -Dalgorithm=SHA-256 + * compiler.intrinsics.sha.sanity.TestSHA256MultiBlockIntrinsics * @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE * compiler.testlibrary.intrinsics.Verifier positive_224.log positive_256.log * positive_224_def.log positive_256_def.log negative_224.log * negative_256.log */ +package compiler.intrinsics.sha.sanity; import compiler.testlibrary.sha.predicate.IntrinsicPredicates; public class TestSHA256MultiBlockIntrinsics { diff --git a/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java b/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java --- a/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java +++ b/test/compiler/intrinsics/sha/sanity/TestSHA512Intrinsics.java @@ -25,10 +25,12 @@ * @test * @bug 8035968 * @summary Verify that SHA-512 intrinsic is actually used. - * @library /testlibrary /test/lib / ../ + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestSHA compiler.testlibrary.intrinsics.Verifier TestSHA512Intrinsics + * + * @build compiler.testlibrary.intrinsics.Verifier + * compiler.intrinsics.sha.sanity.TestSHA512Intrinsics * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -38,7 +40,8 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA512Intrinsics - * -Dalgorithm=SHA-384 TestSHA512Intrinsics + * -Dalgorithm=SHA-384 + * compiler.intrinsics.sha.sanity.TestSHA512Intrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -46,7 +49,8 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:-UseSHA512Intrinsics - * -Dalgorithm=SHA-384 TestSHA512Intrinsics + * -Dalgorithm=SHA-384 + * compiler.intrinsics.sha.sanity.TestSHA512Intrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -54,7 +58,8 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA512Intrinsics - * -Dalgorithm=SHA-512 TestSHA512Intrinsics + * -Dalgorithm=SHA-512 + * compiler.intrinsics.sha.sanity.TestSHA512Intrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -62,12 +67,15 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:-UseSHA512Intrinsics - * -Dalgorithm=SHA-512 TestSHA512Intrinsics + * -Dalgorithm=SHA-512 + * compiler.intrinsics.sha.sanity.TestSHA512Intrinsics * @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE * compiler.testlibrary.intrinsics.Verifier positive_384.log positive_512.log * negative_384.log negative_512.log */ +package compiler.intrinsics.sha.sanity; + import compiler.testlibrary.sha.predicate.IntrinsicPredicates; public class TestSHA512Intrinsics { diff --git a/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java b/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java --- a/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java +++ b/test/compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java @@ -25,10 +25,12 @@ * @test * @bug 8035968 * @summary Verify that SHA-512 multi block intrinsic is actually used. - * @library /testlibrary /test/lib / ../ + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestSHA compiler.testlibrary.intrinsics.Verifier TestSHA512MultiBlockIntrinsics + * + * @build compiler.testlibrary.intrinsics.Verifier + * compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions @@ -39,7 +41,8 @@ * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA512Intrinsics -XX:-UseSHA1Intrinsics * -XX:-UseSHA256Intrinsics - * -Dalgorithm=SHA-384 TestSHA512MultiBlockIntrinsics + * -Dalgorithm=SHA-384 + * compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -47,14 +50,15 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA512Intrinsics -Dalgorithm=SHA-384 - * TestSHA512MultiBlockIntrinsics + * compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 * -XX:+LogCompilation -XX:LogFile=negative_384.log * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA -XX:-UseSHA - * -Dalgorithm=SHA-384 TestSHA1Intrinsics + * -Dalgorithm=SHA-384 + * compiler.intrinsics.sha.sanity.TestSHA1Intrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -63,7 +67,8 @@ * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA512Intrinsics -XX:-UseSHA1Intrinsics * -XX:-UseSHA256Intrinsics - * -Dalgorithm=SHA-512 TestSHA512MultiBlockIntrinsics + * -Dalgorithm=SHA-512 + * compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 @@ -71,20 +76,23 @@ * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA * -XX:+UseSHA512Intrinsics -Dalgorithm=SHA-512 - * TestSHA512MultiBlockIntrinsics + * compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch -XX:CompileThreshold=500 * -XX:Tier4InvocationThreshold=500 * -XX:+LogCompilation -XX:LogFile=negative_512.log * -XX:CompileOnly=sun/security/provider/DigestBase * -XX:CompileOnly=sun/security/provider/SHA -XX:-UseSHA - * -Dalgorithm=SHA-512 TestSHA512MultiBlockIntrinsics + * -Dalgorithm=SHA-512 + * compiler.intrinsics.sha.sanity.TestSHA512MultiBlockIntrinsics * @run main/othervm -DverificationStrategy=VERIFY_INTRINSIC_USAGE * compiler.testlibrary.intrinsics.Verifier positive_384.log positive_512.log * positive_384_def.log positive_512_def.log negative_384.log * negative_512.log */ +package compiler.intrinsics.sha.sanity; + import compiler.testlibrary.sha.predicate.IntrinsicPredicates; public class TestSHA512MultiBlockIntrinsics { diff --git a/test/compiler/intrinsics/string/TestHasNegatives.java b/test/compiler/intrinsics/string/TestHasNegatives.java --- a/test/compiler/intrinsics/string/TestHasNegatives.java +++ b/test/compiler/intrinsics/string/TestHasNegatives.java @@ -28,14 +28,14 @@ * @bug 8054307 * @summary Validates StringCoding.hasNegatives intrinsic with a small range of tests. * @library /compiler/patches + * * @build java.base/java.lang.Helper * @build compiler.intrinsics.string.TestHasNegatives * @run main compiler.intrinsics.string.TestHasNegatives */ + package compiler.intrinsics.string; -import java.lang.Helper; - /* * @summary Validates StringCoding.hasNegatives intrinsic with a small * range of tests. diff --git a/test/compiler/intrinsics/string/TestStringConstruction.java b/test/compiler/intrinsics/string/TestStringConstruction.java --- a/test/compiler/intrinsics/string/TestStringConstruction.java +++ b/test/compiler/intrinsics/string/TestStringConstruction.java @@ -25,8 +25,16 @@ * @test * @bug 8142303 * @summary Tests handling of invalid array indices in C2 intrinsic if explicit range check in Java code is not inlined. - * @run main/othervm -XX:CompileCommand=inline,java.lang.String::* -XX:CompileCommand=inline,java.lang.StringUTF16::* -XX:CompileCommand=exclude,java.lang.String::checkBoundsOffCount TestStringConstruction + * + * @run main/othervm + * -XX:CompileCommand=inline,java.lang.String::* + * -XX:CompileCommand=inline,java.lang.StringUTF16::* + * -XX:CompileCommand=exclude,java.lang.String::checkBoundsOffCount + * compiler.intrinsics.string.TestStringConstruction */ + +package compiler.intrinsics.string; + public class TestStringConstruction { public static void main(String[] args) { diff --git a/test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java b/test/compiler/intrinsics/string/TestStringEqualsBadLength.java rename from test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java rename to test/compiler/intrinsics/string/TestStringEqualsBadLength.java --- a/test/compiler/intrinsics/stringequals/TestStringEqualsBadLength.java +++ b/test/compiler/intrinsics/string/TestStringEqualsBadLength.java @@ -25,10 +25,13 @@ * @test * @bug 8027445 * @summary String.equals() may be called with a length whose upper bits are not cleared - * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestStringEqualsBadLength * + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * compiler.intrinsics.string.TestStringEqualsBadLength */ +package compiler.intrinsics.string; + import java.util.Arrays; public class TestStringEqualsBadLength { diff --git a/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java b/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java --- a/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java +++ b/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java @@ -21,16 +21,20 @@ * questions. */ -import jdk.test.lib.Asserts; - /* * @test * @bug 8144212 * @summary Check for correct memory flow with the String compress/inflate intrinsics. * @modules java.base/jdk.internal.misc * @library /testlibrary - * @run main TestStringIntrinsicMemoryFlow + * + * @run main compiler.intrinsics.string.TestStringIntrinsicMemoryFlow */ + +package compiler.intrinsics.string; + +import jdk.test.lib.Asserts; + public class TestStringIntrinsicMemoryFlow { public static void main(String[] args) { diff --git a/test/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java b/test/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java --- a/test/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java +++ b/test/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java @@ -27,15 +27,17 @@ * @test * @bug 8155608 * @summary Verifies that string intrinsics throw array out of bounds exceptions. - * @library /compiler/patches /testlibrary /test/lib / + * @library /compiler/patches /testlibrary /test/lib + * * @build java.base/java.lang.Helper * @build compiler.intrinsics.string.TestStringIntrinsicRangeChecks * @run main compiler.intrinsics.string.TestStringIntrinsicRangeChecks */ + package compiler.intrinsics.string; -import java.lang.Helper; -import java.lang.reflect.*; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; public class TestStringIntrinsicRangeChecks { // Prepare test arrays diff --git a/test/compiler/intrinsics/string/TestStringIntrinsics.java b/test/compiler/intrinsics/string/TestStringIntrinsics.java --- a/test/compiler/intrinsics/string/TestStringIntrinsics.java +++ b/test/compiler/intrinsics/string/TestStringIntrinsics.java @@ -21,16 +21,23 @@ * questions. */ -import java.lang.annotation.*; -import java.lang.reflect.*; -import java.util.Arrays; - /* * @test * @bug 8054307 * @summary Tests correctness of string related intrinsics and C2 optimizations. - * @run main/timeout=240 TestStringIntrinsics + * + * @run main/timeout=240 compiler.intrinsics.string.TestStringIntrinsics */ + +package compiler.intrinsics.string; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.reflect.Method; +import java.util.Arrays; + public class TestStringIntrinsics { public enum Operation { diff --git a/test/compiler/intrinsics/string/TestStringIntrinsics2.java b/test/compiler/intrinsics/string/TestStringIntrinsics2.java --- a/test/compiler/intrinsics/string/TestStringIntrinsics2.java +++ b/test/compiler/intrinsics/string/TestStringIntrinsics2.java @@ -28,8 +28,9 @@ * @summary PPC64: fix string intrinsics after CompactStrings change * @modules java.base/jdk.internal.misc * @library /testlibrary /test/lib + * * @build sun.hotspot.WhiteBox - * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * * @run main/othervm @@ -39,20 +40,23 @@ * -XX:+WhiteBoxAPI * -XX:MaxInlineSize=70 * -XX:MinInliningThreshold=0 - * TestStringIntrinsics2 + * compiler.intrinsics.string.TestStringIntrinsics2 */ +package compiler.intrinsics.string; + +import sun.hotspot.WhiteBox; + import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Retention; import java.lang.annotation.Target; -import java.lang.reflect.Method; import java.util.Arrays; import java.util.function.Consumer; -import java.util.function.Function; -import static jdk.test.lib.Asserts.*; -import sun.hotspot.WhiteBox; +import static jdk.test.lib.Asserts.assertEquals; +import static jdk.test.lib.Asserts.assertFalse; +import static jdk.test.lib.Asserts.assertTrue; public class TestStringIntrinsics2 { // ------------------------------------------------------------------------ diff --git a/test/compiler/intrinsics/unsafe/AllocateUninitializedArray.java b/test/compiler/intrinsics/unsafe/AllocateUninitializedArray.java --- a/test/compiler/intrinsics/unsafe/AllocateUninitializedArray.java +++ b/test/compiler/intrinsics/unsafe/AllocateUninitializedArray.java @@ -27,12 +27,19 @@ * @bug 8150465 * @summary Unsafe methods to produce uninitialized arrays * @modules java.base/jdk.internal.misc - * @run main/othervm -ea -Diters=200 -Xint AllocateUninitializedArray - * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=1 AllocateUninitializedArray - * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4 AllocateUninitializedArray + * + * @run main/othervm -ea -Diters=200 -Xint + * compiler.intrinsics.unsafe.AllocateUninitializedArray + * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=1 + * compiler.intrinsics.unsafe.AllocateUninitializedArray + * @run main/othervm -ea -Diters=30000 -XX:TieredStopAtLevel=4 + * compiler.intrinsics.unsafe.AllocateUninitializedArray */ + +package compiler.intrinsics.unsafe; + +import java.lang.reflect.Array; import java.lang.reflect.Field; -import java.lang.reflect.Array; import java.util.concurrent.Callable; public class AllocateUninitializedArray { diff --git a/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java b/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java --- a/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java +++ b/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java @@ -1,250 +1,256 @@ -// -// Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. -// Copyright (c) 2015, Red Hat Inc. 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. -// -// +/* + * Copyright (c) 200, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, Red Hat Inc. 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 8026049 + * @summary Verify that byte buffers are correctly accessed. + * @modules java.base/jdk.internal.misc + * @library /testlibrary + * + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses -Djdk.test.lib.random.seed=0 + * compiler.intrinsics.unsafe.HeapByteBufferTest + * @run main/othervm -Djdk.test.lib.random.seed=0 + * compiler.intrinsics.unsafe.HeapByteBufferTest + */ + +package compiler.intrinsics.unsafe; + +import jdk.test.lib.Utils; import java.nio.BufferOverflowException; import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; -import static java.nio.ByteOrder.BIG_ENDIAN; -import static java.nio.ByteOrder.LITTLE_ENDIAN; import java.nio.ByteOrder; import java.util.Arrays; import java.util.Random; -import jdk.test.lib.Utils; -/** - * @test - * @bug 8026049 - * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses -Djdk.test.lib.random.seed=0 HeapByteBufferTest - * @run main/othervm -Djdk.test.lib.random.seed=0 HeapByteBufferTest - * @summary Verify that byte buffers are correctly accessed. - */ +import static java.nio.ByteOrder.BIG_ENDIAN; +import static java.nio.ByteOrder.LITTLE_ENDIAN; // A wrapper for a ByteBuffer which maintains a backing array and a // position. Whenever this wrapper is written the backing array and // the wrapped byte buffer are updated together, and whenever it is // read we check that the ByteBuffer and the backing array are identical. -class MyByteBuffer { - final ByteBuffer buf; - final byte[] bytes; - int pos; - ByteOrder byteOrder = BIG_ENDIAN; +public class HeapByteBufferTest implements Runnable { + static class MyByteBuffer { + final ByteBuffer buf; + final byte[] bytes; + int pos; + ByteOrder byteOrder = BIG_ENDIAN; - MyByteBuffer(ByteBuffer buf, byte[] bytes) { - this.buf = buf; - this.bytes = Arrays.copyOf(bytes, bytes.length); - pos = 0; + MyByteBuffer(ByteBuffer buf, byte[] bytes) { + this.buf = buf; + this.bytes = Arrays.copyOf(bytes, bytes.length); + pos = 0; + } + + public final MyByteBuffer order(ByteOrder bo) { + byteOrder = bo; + buf.order(bo); + return this; + } + + static MyByteBuffer wrap(byte[] bytes) { + return new MyByteBuffer(ByteBuffer.wrap(bytes), bytes); + } + + int capacity() { return bytes.length; } + int position() { + if (buf.position() != pos) + throw new RuntimeException(); + return buf.position(); + } + + byte[] array() { return buf.array(); } + byte[] backingArray() { return bytes; } + + private static byte long7(long x) { return (byte)(x >> 56); } + private static byte long6(long x) { return (byte)(x >> 48); } + private static byte long5(long x) { return (byte)(x >> 40); } + private static byte long4(long x) { return (byte)(x >> 32); } + private static byte long3(long x) { return (byte)(x >> 24); } + private static byte long2(long x) { return (byte)(x >> 16); } + private static byte long1(long x) { return (byte)(x >> 8); } + private static byte long0(long x) { return (byte)(x ); } + + private static byte int3(int x) { return (byte)(x >> 24); } + private static byte int2(int x) { return (byte)(x >> 16); } + private static byte int1(int x) { return (byte)(x >> 8); } + private static byte int0(int x) { return (byte)(x ); } + + private static byte short1(short x) { return (byte)(x >> 8); } + private static byte short0(short x) { return (byte)(x ); } + + byte _get(long i) { return bytes[(int)i]; } + void _put(long i, byte x) { bytes[(int)i] = x; } + + private void putLongX(long a, long x) { + if (byteOrder == BIG_ENDIAN) { + x = Long.reverseBytes(x); + } + _put(a + 7, long7(x)); + _put(a + 6, long6(x)); + _put(a + 5, long5(x)); + _put(a + 4, long4(x)); + _put(a + 3, long3(x)); + _put(a + 2, long2(x)); + _put(a + 1, long1(x)); + _put(a , long0(x)); + } + + private void putIntX(long a, int x) { + if (byteOrder == BIG_ENDIAN) { + x = Integer.reverseBytes(x); + } + _put(a + 3, int3(x)); + _put(a + 2, int2(x)); + _put(a + 1, int1(x)); + _put(a , int0(x)); + } + + private void putShortX(int bi, short x) { + if (byteOrder == BIG_ENDIAN) { + x = Short.reverseBytes(x); + } + _put(bi , short0(x)); + _put(bi + 1, short1(x)); + } + + static private int makeInt(byte b3, byte b2, byte b1, byte b0) { + return (((b3 ) << 24) | + ((b2 & 0xff) << 16) | + ((b1 & 0xff) << 8) | + ((b0 & 0xff) )); + } + int getIntX(long a) { + int x = makeInt(_get(a + 3), + _get(a + 2), + _get(a + 1), + _get(a)); + if (byteOrder == BIG_ENDIAN) { + x = Integer.reverseBytes(x); + } + return x; + } + + static private long makeLong(byte b7, byte b6, byte b5, byte b4, + byte b3, byte b2, byte b1, byte b0) + { + return ((((long)b7 ) << 56) | + (((long)b6 & 0xff) << 48) | + (((long)b5 & 0xff) << 40) | + (((long)b4 & 0xff) << 32) | + (((long)b3 & 0xff) << 24) | + (((long)b2 & 0xff) << 16) | + (((long)b1 & 0xff) << 8) | + (((long)b0 & 0xff) )); + } + + long getLongX(long a) { + long x = makeLong(_get(a + 7), + _get(a + 6), + _get(a + 5), + _get(a + 4), + _get(a + 3), + _get(a + 2), + _get(a + 1), + _get(a)); + if (byteOrder == BIG_ENDIAN) { + x = Long.reverseBytes(x); + } + return x; + } + + static private short makeShort(byte b1, byte b0) { + return (short)((b1 << 8) | (b0 & 0xff)); + } + + short getShortX(long a) { + short x = makeShort(_get(a + 1), + _get(a )); + if (byteOrder == BIG_ENDIAN) { + x = Short.reverseBytes(x); + } + return x; + } + + double getDoubleX(long a) { + long x = getLongX(a); + return Double.longBitsToDouble(x); + } + + double getFloatX(long a) { + int x = getIntX(a); + return Float.intBitsToFloat(x); + } + + void ck(long x, long y) { + if (x != y) { + throw new RuntimeException(" x = " + Long.toHexString(x) + ", y = " + Long.toHexString(y)); + } + } + + void ck(double x, double y) { + if (x == x && y == y && x != y) { + ck(x, y); + } + } + + long getLong(int i) { ck(buf.getLong(i), getLongX(i)); return buf.getLong(i); } + int getInt(int i) { ck(buf.getInt(i), getIntX(i)); return buf.getInt(i); } + short getShort(int i) { ck(buf.getShort(i), getShortX(i)); return buf.getShort(i); } + char getChar(int i) { ck(buf.getChar(i), (char)getShortX(i)); return buf.getChar(i); } + double getDouble(int i) { ck(buf.getDouble(i), getDoubleX(i)); return buf.getDouble(i); } + float getFloat(int i) { ck(buf.getFloat(i), getFloatX(i)); return buf.getFloat(i); } + + void putLong(int i, long x) { buf.putLong(i, x); putLongX(i, x); } + void putInt(int i, int x) { buf.putInt(i, x); putIntX(i, x); } + void putShort(int i, short x) { buf.putShort(i, x); putShortX(i, x); } + void putChar(int i, char x) { buf.putChar(i, x); putShortX(i, (short)x); } + void putDouble(int i, double x) { buf.putDouble(i, x); putLongX(i, Double.doubleToRawLongBits(x)); } + void putFloat(int i, float x) { buf.putFloat(i, x); putIntX(i, Float.floatToRawIntBits(x)); } + + long getLong() { ck(buf.getLong(buf.position()), getLongX(pos)); long x = buf.getLong(); pos += 8; return x; } + int getInt() { ck(buf.getInt(buf.position()), getIntX(pos)); int x = buf.getInt(); pos += 4; return x; } + short getShort() { ck(buf.getShort(buf.position()), getShortX(pos)); short x = buf.getShort(); pos += 2; return x; } + char getChar() { ck(buf.getChar(buf.position()), (char)getShortX(pos)); char x = buf.getChar(); pos += 2; return x; } + double getDouble() { ck(buf.getDouble(buf.position()), getDoubleX(pos)); double x = buf.getDouble(); pos += 8; return x; } + float getFloat() { ck(buf.getFloat(buf.position()), getFloatX(pos)); float x = buf.getFloat(); pos += 4; return x; } + + void putLong(long x) { putLongX(pos, x); pos += 8; buf.putLong(x); } + void putInt(int x) { putIntX(pos, x); pos += 4; buf.putInt(x); } + void putShort(short x) { putShortX(pos, x); pos += 2; buf.putShort(x); } + void putChar(char x) { putShortX(pos, (short)x); pos += 2; buf.putChar(x); } + void putDouble(double x) { putLongX(pos, Double.doubleToRawLongBits(x)); pos += 8; buf.putDouble(x); } + void putFloat(float x) { putIntX(pos, Float.floatToRawIntBits(x)); pos += 4; buf.putFloat(x); } + + void rewind() { pos = 0; buf.rewind(); } } - public final MyByteBuffer order(ByteOrder bo) { - byteOrder = bo; - buf.order(bo); - return this; - } - - static MyByteBuffer wrap(byte[] bytes) { - return new MyByteBuffer(ByteBuffer.wrap(bytes), bytes); - } - - int capacity() { return bytes.length; } - int position() { - if (buf.position() != pos) - throw new RuntimeException(); - return buf.position(); - } - - byte[] array() { return buf.array(); } - byte[] backingArray() { return bytes; } - - private static byte long7(long x) { return (byte)(x >> 56); } - private static byte long6(long x) { return (byte)(x >> 48); } - private static byte long5(long x) { return (byte)(x >> 40); } - private static byte long4(long x) { return (byte)(x >> 32); } - private static byte long3(long x) { return (byte)(x >> 24); } - private static byte long2(long x) { return (byte)(x >> 16); } - private static byte long1(long x) { return (byte)(x >> 8); } - private static byte long0(long x) { return (byte)(x ); } - - private static byte int3(int x) { return (byte)(x >> 24); } - private static byte int2(int x) { return (byte)(x >> 16); } - private static byte int1(int x) { return (byte)(x >> 8); } - private static byte int0(int x) { return (byte)(x ); } - - private static byte short1(short x) { return (byte)(x >> 8); } - private static byte short0(short x) { return (byte)(x ); } - - byte _get(long i) { return bytes[(int)i]; } - void _put(long i, byte x) { bytes[(int)i] = x; } - - private void putLongX(long a, long x) { - if (byteOrder == BIG_ENDIAN) { - x = Long.reverseBytes(x); - } - _put(a + 7, long7(x)); - _put(a + 6, long6(x)); - _put(a + 5, long5(x)); - _put(a + 4, long4(x)); - _put(a + 3, long3(x)); - _put(a + 2, long2(x)); - _put(a + 1, long1(x)); - _put(a , long0(x)); - } - - private void putIntX(long a, int x) { - if (byteOrder == BIG_ENDIAN) { - x = Integer.reverseBytes(x); - } - _put(a + 3, int3(x)); - _put(a + 2, int2(x)); - _put(a + 1, int1(x)); - _put(a , int0(x)); - } - - private void putShortX(int bi, short x) { - if (byteOrder == BIG_ENDIAN) { - x = Short.reverseBytes(x); - } - _put(bi , short0(x)); - _put(bi + 1, short1(x)); - } - - static private int makeInt(byte b3, byte b2, byte b1, byte b0) { - return (((b3 ) << 24) | - ((b2 & 0xff) << 16) | - ((b1 & 0xff) << 8) | - ((b0 & 0xff) )); - } - int getIntX(long a) { - int x = makeInt(_get(a + 3), - _get(a + 2), - _get(a + 1), - _get(a)); - if (byteOrder == BIG_ENDIAN) { - x = Integer.reverseBytes(x); - } - return x; - } - - static private long makeLong(byte b7, byte b6, byte b5, byte b4, - byte b3, byte b2, byte b1, byte b0) - { - return ((((long)b7 ) << 56) | - (((long)b6 & 0xff) << 48) | - (((long)b5 & 0xff) << 40) | - (((long)b4 & 0xff) << 32) | - (((long)b3 & 0xff) << 24) | - (((long)b2 & 0xff) << 16) | - (((long)b1 & 0xff) << 8) | - (((long)b0 & 0xff) )); - } - - long getLongX(long a) { - long x = makeLong(_get(a + 7), - _get(a + 6), - _get(a + 5), - _get(a + 4), - _get(a + 3), - _get(a + 2), - _get(a + 1), - _get(a)); - if (byteOrder == BIG_ENDIAN) { - x = Long.reverseBytes(x); - } - return x; - } - - static private short makeShort(byte b1, byte b0) { - return (short)((b1 << 8) | (b0 & 0xff)); - } - - short getShortX(long a) { - short x = makeShort(_get(a + 1), - _get(a )); - if (byteOrder == BIG_ENDIAN) { - x = Short.reverseBytes(x); - } - return x; - } - - double getDoubleX(long a) { - long x = getLongX(a); - return Double.longBitsToDouble(x); - } - - double getFloatX(long a) { - int x = getIntX(a); - return Float.intBitsToFloat(x); - } - - void ck(long x, long y) { - if (x != y) { - throw new RuntimeException(" x = " + Long.toHexString(x) + ", y = " + Long.toHexString(y)); - } - } - - void ck(double x, double y) { - if (x == x && y == y && x != y) { - ck(x, y); - } - } - - long getLong(int i) { ck(buf.getLong(i), getLongX(i)); return buf.getLong(i); } - int getInt(int i) { ck(buf.getInt(i), getIntX(i)); return buf.getInt(i); } - short getShort(int i) { ck(buf.getShort(i), getShortX(i)); return buf.getShort(i); } - char getChar(int i) { ck(buf.getChar(i), (char)getShortX(i)); return buf.getChar(i); } - double getDouble(int i) { ck(buf.getDouble(i), getDoubleX(i)); return buf.getDouble(i); } - float getFloat(int i) { ck(buf.getFloat(i), getFloatX(i)); return buf.getFloat(i); } - - void putLong(int i, long x) { buf.putLong(i, x); putLongX(i, x); } - void putInt(int i, int x) { buf.putInt(i, x); putIntX(i, x); } - void putShort(int i, short x) { buf.putShort(i, x); putShortX(i, x); } - void putChar(int i, char x) { buf.putChar(i, x); putShortX(i, (short)x); } - void putDouble(int i, double x) { buf.putDouble(i, x); putLongX(i, Double.doubleToRawLongBits(x)); } - void putFloat(int i, float x) { buf.putFloat(i, x); putIntX(i, Float.floatToRawIntBits(x)); } - - long getLong() { ck(buf.getLong(buf.position()), getLongX(pos)); long x = buf.getLong(); pos += 8; return x; } - int getInt() { ck(buf.getInt(buf.position()), getIntX(pos)); int x = buf.getInt(); pos += 4; return x; } - short getShort() { ck(buf.getShort(buf.position()), getShortX(pos)); short x = buf.getShort(); pos += 2; return x; } - char getChar() { ck(buf.getChar(buf.position()), (char)getShortX(pos)); char x = buf.getChar(); pos += 2; return x; } - double getDouble() { ck(buf.getDouble(buf.position()), getDoubleX(pos)); double x = buf.getDouble(); pos += 8; return x; } - float getFloat() { ck(buf.getFloat(buf.position()), getFloatX(pos)); float x = buf.getFloat(); pos += 4; return x; } - - void putLong(long x) { putLongX(pos, x); pos += 8; buf.putLong(x); } - void putInt(int x) { putIntX(pos, x); pos += 4; buf.putInt(x); } - void putShort(short x) { putShortX(pos, x); pos += 2; buf.putShort(x); } - void putChar(char x) { putShortX(pos, (short)x); pos += 2; buf.putChar(x); } - void putDouble(double x) { putLongX(pos, Double.doubleToRawLongBits(x)); pos += 8; buf.putDouble(x); } - void putFloat(float x) { putIntX(pos, Float.floatToRawIntBits(x)); pos += 4; buf.putFloat(x); } - - void rewind() { pos = 0; buf.rewind(); } -} - -public class HeapByteBufferTest implements Runnable { - Random random = Utils.getRandomInstance(); MyByteBuffer data = MyByteBuffer.wrap(new byte[1024]); diff --git a/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java b/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java --- a/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java +++ b/test/compiler/intrinsics/unsafe/TestUnsafeMismatchedArrayFieldAccess.java @@ -25,16 +25,18 @@ /** * @test * @bug 8142386 + * @summary Unsafe access to an array is wrongly marked as mismatched * @modules java.base/jdk.internal.misc * @library /testlibrary /test/lib - * @summary Unsafe access to an array is wrongly marked as mismatched - * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation TestUnsafeMismatchedArrayFieldAccess * + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-TieredCompilation + * compiler.intrinsics.unsafe.TestUnsafeMismatchedArrayFieldAccess */ -import java.lang.reflect.*; +package compiler.intrinsics.unsafe; + +import jdk.internal.misc.Unsafe; import jdk.test.lib.Utils; -import jdk.internal.misc.Unsafe; public class TestUnsafeMismatchedArrayFieldAccess { diff --git a/test/compiler/intrinsics/unsafe/TestUnsafeUnalignedMismatchedAccesses.java b/test/compiler/intrinsics/unsafe/TestUnsafeUnalignedMismatchedAccesses.java --- a/test/compiler/intrinsics/unsafe/TestUnsafeUnalignedMismatchedAccesses.java +++ b/test/compiler/intrinsics/unsafe/TestUnsafeUnalignedMismatchedAccesses.java @@ -27,14 +27,20 @@ * @bug 8136473 * @summary Mismatched stores on same slice possible with Unsafe.Put*Unaligned methods * @modules java.base/jdk.internal.misc - * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation TestUnsafeUnalignedMismatchedAccesses - * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses TestUnsafeUnalignedMismatchedAccesses * + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * compiler.intrinsics.unsafe.TestUnsafeUnalignedMismatchedAccesses + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * -XX:+UnlockDiagnosticVMOptions -XX:-UseUnalignedAccesses + * compiler.intrinsics.unsafe.TestUnsafeUnalignedMismatchedAccesses */ -import java.lang.reflect.*; +package compiler.intrinsics.unsafe; + import jdk.internal.misc.Unsafe; +import java.lang.reflect.Field; + public class TestUnsafeUnalignedMismatchedAccesses { private static final Unsafe UNSAFE; diff --git a/test/compiler/intrinsics/unsafe/UnsafeGetAddressTest.java b/test/compiler/intrinsics/unsafe/UnsafeGetAddressTest.java --- a/test/compiler/intrinsics/unsafe/UnsafeGetAddressTest.java +++ b/test/compiler/intrinsics/unsafe/UnsafeGetAddressTest.java @@ -26,12 +26,15 @@ * @bug 6653795 * @summary C2 intrinsic for Unsafe.getAddress performs pointer sign extension on 32-bit systems * @modules java.base/jdk.internal.misc - * @run main UnsafeGetAddressTest * + * @run main compiler.intrinsics.unsafe.UnsafeGetAddressTest */ +package compiler.intrinsics.unsafe; + import jdk.internal.misc.Unsafe; -import java.lang.reflect.*; + +import java.lang.reflect.Field; public class UnsafeGetAddressTest { private static Unsafe unsafe; diff --git a/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java b/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java --- a/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java +++ b/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java @@ -27,9 +27,13 @@ * @bug 8143930 * @summary C1 LinearScan asserts when compiling two back-to-back CompareAndSwapLongs * @modules java.base/jdk.internal.misc - * @run testng/othervm -Diters=200000 -XX:TieredStopAtLevel=1 UnsafeTwoCASLong + * + * @run testng/othervm -Diters=200000 -XX:TieredStopAtLevel=1 + * compiler.intrinsics.unsafe.UnsafeTwoCASLong */ +package compiler.intrinsics.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/intrinsics/adler32/TestAdler32.java b/test/compiler/intrinsics/zip/TestAdler32.java rename from test/compiler/intrinsics/adler32/TestAdler32.java rename to test/compiler/intrinsics/zip/TestAdler32.java --- a/test/compiler/intrinsics/adler32/TestAdler32.java +++ b/test/compiler/intrinsics/zip/TestAdler32.java @@ -26,12 +26,14 @@ * @bug 8132081 * @summary C2 support for Adler32 on SPARC * - * @run main/othervm/timeout=600 -Xbatch TestAdler32 -m + * @run main/othervm/timeout=600 -Xbatch compiler.intrinsics.zip.TestAdler32 -m */ +package compiler.intrinsics.zip; + import java.nio.ByteBuffer; +import java.util.zip.Adler32; import java.util.zip.Checksum; -import java.util.zip.Adler32; public class TestAdler32 { public static void main(String[] args) { diff --git a/test/compiler/intrinsics/crc32/TestCRC32.java b/test/compiler/intrinsics/zip/TestCRC32.java rename from test/compiler/intrinsics/crc32/TestCRC32.java rename to test/compiler/intrinsics/zip/TestCRC32.java --- a/test/compiler/intrinsics/crc32/TestCRC32.java +++ b/test/compiler/intrinsics/zip/TestCRC32.java @@ -26,12 +26,14 @@ * @bug 8143012 * @summary CRC32 Intrinsics support on SPARC * - * @run main/othervm/timeout=720 -Xbatch TestCRC32 -m + * @run main/othervm/timeout=720 -Xbatch compiler.intrinsics.zip.TestCRC32 -m */ +package compiler.intrinsics.zip; + import java.nio.ByteBuffer; +import java.util.zip.CRC32; import java.util.zip.Checksum; -import java.util.zip.CRC32; public class TestCRC32 { public static void main(String[] args) { diff --git a/test/compiler/intrinsics/crc32c/TestCRC32C.java b/test/compiler/intrinsics/zip/TestCRC32C.java rename from test/compiler/intrinsics/crc32c/TestCRC32C.java rename to test/compiler/intrinsics/zip/TestCRC32C.java --- a/test/compiler/intrinsics/crc32c/TestCRC32C.java +++ b/test/compiler/intrinsics/zip/TestCRC32C.java @@ -26,12 +26,14 @@ * @bug 8073583 * @summary C2 support for CRC32C on SPARC * - * @run main/othervm/timeout=600 -Xbatch TestCRC32C -m + * @run main/othervm/timeout=600 -Xbatch compiler.intrinsics.zip.TestCRC32C -m */ +package compiler.intrinsics.zip; + import java.nio.ByteBuffer; +import java.util.zip.CRC32C; import java.util.zip.Checksum; -import java.util.zip.CRC32C; public class TestCRC32C { public static void main(String[] args) { diff --git a/test/compiler/jsr292/CallSiteDepContextTest.java b/test/compiler/jsr292/CallSiteDepContextTest.java --- a/test/compiler/jsr292/CallSiteDepContextTest.java +++ b/test/compiler/jsr292/CallSiteDepContextTest.java @@ -25,16 +25,23 @@ * @test * @bug 8057967 * @modules java.base/jdk.internal.misc - * @modules java.base/jdk.internal.org.objectweb.asm - * @library patches + * java.base/jdk.internal.org.objectweb.asm + * @library patches / + * * @build java.base/java.lang.invoke.MethodHandleHelper * @run main/bootclasspath/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -Xlog:class+unload * -XX:+PrintCompilation -XX:+TraceDependencies -XX:+TraceReferenceGC - * -verbose:gc compiler.jsr292.CallSiteDepContextTest + * -verbose:gc + * compiler.jsr292.CallSiteDepContextTest */ package compiler.jsr292; +import jdk.internal.misc.Unsafe; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.Handle; +import jdk.internal.org.objectweb.asm.MethodVisitor; + import java.lang.invoke.CallSite; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandleHelper; @@ -46,10 +53,11 @@ import java.lang.ref.ReferenceQueue; import java.lang.reflect.Field; -import jdk.internal.org.objectweb.asm.*; -import jdk.internal.misc.Unsafe; - -import static jdk.internal.org.objectweb.asm.Opcodes.*; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_SUPER; +import static jdk.internal.org.objectweb.asm.Opcodes.H_INVOKESTATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.IRETURN; public class CallSiteDepContextTest { static final Unsafe UNSAFE = Unsafe.getUnsafe(); diff --git a/test/compiler/jsr292/ConcurrentClassLoadingTest.java b/test/compiler/jsr292/ConcurrentClassLoadingTest.java --- a/test/compiler/jsr292/ConcurrentClassLoadingTest.java +++ b/test/compiler/jsr292/ConcurrentClassLoadingTest.java @@ -25,12 +25,17 @@ * @test * @bug 8022595 * @summary JSR292: deadlock during class loading of MethodHandles, MethodHandleImpl & MethodHandleNatives - * @library /testlibrary + * @library /testlibrary / * @modules java.base/jdk.internal.misc * java.management - * @run main/othervm ConcurrentClassLoadingTest + * + * @run main/othervm compiler.jsr292.ConcurrentClassLoadingTest */ + +package compiler.jsr292; + import jdk.test.lib.Utils; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/test/compiler/jsr292/ContinuousCallSiteTargetChange.java b/test/compiler/jsr292/ContinuousCallSiteTargetChange.java --- a/test/compiler/jsr292/ContinuousCallSiteTargetChange.java +++ b/test/compiler/jsr292/ContinuousCallSiteTargetChange.java @@ -24,11 +24,21 @@ /** * @test * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @run main ContinuousCallSiteTargetChange + * @library /testlibrary / + * + * @run driver compiler.jsr292.ContinuousCallSiteTargetChange */ -import java.lang.invoke.*; -import jdk.test.lib.*; + +package compiler.jsr292; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + +import java.lang.invoke.CallSite; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.lang.invoke.MutableCallSite; public class ContinuousCallSiteTargetChange { static void testServer() throws Exception { @@ -37,7 +47,7 @@ "-server", "-XX:-TieredCompilation", "-Xbatch", "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", - "ContinuousCallSiteTargetChange$Test", "100"); + Test.class.getName(), "100"); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); @@ -53,7 +63,7 @@ "-client", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch", "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", - "ContinuousCallSiteTargetChange$Test", "100"); + Test.class.getName(), "100"); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java b/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java --- a/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java +++ b/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java @@ -27,14 +27,17 @@ * @bug 8026124 * @summary Javascript file provoked assertion failure in linkResolver.cpp * @modules jdk.scripting.nashorn/jdk.nashorn.tools - * @run main/othervm CreatesInterfaceDotEqualsCallInfo + * + * @run main/othervm compiler.jsr292.CreatesInterfaceDotEqualsCallInfo */ +package compiler.jsr292; + public class CreatesInterfaceDotEqualsCallInfo { - public static void main(String[] args) throws java.io.IOException { - String[] jsargs = { System.getProperty("test.src", ".") + - "/createsInterfaceDotEqualsCallInfo.js" }; - jdk.nashorn.tools.Shell.main(System.in, System.out, System.err, jsargs); - System.out.println("PASS, did not crash running Javascript"); - } + public static void main(String[] args) throws java.io.IOException { + String[] jsargs = {System.getProperty("test.src", ".") + + "/createsInterfaceDotEqualsCallInfo.js"}; + jdk.nashorn.tools.Shell.main(System.in, System.out, System.err, jsargs); + System.out.println("PASS, did not crash running Javascript"); + } } diff --git a/test/compiler/jsr292/InvokerGC.java b/test/compiler/jsr292/InvokerGC.java --- a/test/compiler/jsr292/InvokerGC.java +++ b/test/compiler/jsr292/InvokerGC.java @@ -25,16 +25,22 @@ * @test * @bug 8067247 * @modules java.base/jdk.internal.misc - * @library /test/lib / + * @library /test/lib + * * @run main/bootclasspath/othervm -Xcomp -Xbatch - * -XX:CompileCommand=compileonly,InvokerGC::test * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * InvokerGC + * -XX:CompileCommand=compileonly,compiler.jsr292.InvokerGC::test + * compiler.jsr292.InvokerGC */ -import java.lang.invoke.*; +package compiler.jsr292; + import sun.hotspot.WhiteBox; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; + public class InvokerGC { static final WhiteBox WB = WhiteBox.getWhiteBox(); diff --git a/test/compiler/jsr292/LongReferenceCastingTest.java b/test/compiler/jsr292/LongReferenceCastingTest.java --- a/test/compiler/jsr292/LongReferenceCastingTest.java +++ b/test/compiler/jsr292/LongReferenceCastingTest.java @@ -22,14 +22,20 @@ * */ -import java.lang.invoke.*; - /** * @test * @bug 8148752 * @summary Test correct casting of MH arguments during inlining. - * @run main LongReferenceCastingTest + * + * @run main compiler.jsr292.LongReferenceCastingTest */ + +package compiler.jsr292; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; + public class LongReferenceCastingTest { static final String MY_STRING = "myString"; static final MethodHandle MH; diff --git a/test/compiler/jsr292/MHInlineTest.java b/test/compiler/jsr292/MHInlineTest.java --- a/test/compiler/jsr292/MHInlineTest.java +++ b/test/compiler/jsr292/MHInlineTest.java @@ -26,12 +26,21 @@ * @bug 8062280 * @summary C2: inlining failure due to access checks being too strict * @modules java.base/jdk.internal.misc - * @library /testlibrary - * @run main/othervm MHInlineTest + * @library /testlibrary / + * + * @run main/othervm compiler.jsr292.MHInlineTest */ -import java.lang.invoke.*; -import jdk.test.lib.*; -import static jdk.test.lib.Asserts.*; + +package compiler.jsr292; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; + +import static jdk.test.lib.Asserts.assertEquals; public class MHInlineTest { public static void main(String[] args) throws Exception { @@ -39,8 +48,8 @@ "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-server", "-XX:-TieredCompilation", "-Xbatch", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", - "-XX:CompileCommand=dontinline,MHInlineTest::test*", - "MHInlineTest$Launcher"); + "-XX:CompileCommand=dontinline,compiler.jsr292.MHInlineTest::test*", + Launcher.class.getName()); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); @@ -48,13 +57,13 @@ // The test is applicable only to C2 (present in Server VM). if (analyzer.getStderr().contains("Server VM")) { - analyzer.shouldContain("MHInlineTest$B::public_x (3 bytes) inline (hot)"); - analyzer.shouldContain("MHInlineTest$B::protected_x (3 bytes) inline (hot)"); - analyzer.shouldContain("MHInlineTest$B::package_x (3 bytes) inline (hot)"); - analyzer.shouldContain("MHInlineTest$A::package_final_x (3 bytes) inline (hot)"); - analyzer.shouldContain("MHInlineTest$B::private_x (3 bytes) inline (hot)"); - analyzer.shouldContain("MHInlineTest$B::private_static_x (3 bytes) inline (hot)"); - analyzer.shouldContain("MHInlineTest$A::package_static_x (3 bytes) inline (hot)"); + analyzer.shouldContain("compiler.jsr292.MHInlineTest$B::public_x (3 bytes) inline (hot)"); + analyzer.shouldContain("compiler.jsr292.MHInlineTest$B::protected_x (3 bytes) inline (hot)"); + analyzer.shouldContain("compiler.jsr292.MHInlineTest$B::package_x (3 bytes) inline (hot)"); + analyzer.shouldContain("compiler.jsr292.MHInlineTest$A::package_final_x (3 bytes) inline (hot)"); + analyzer.shouldContain("compiler.jsr292.MHInlineTest$B::private_x (3 bytes) inline (hot)"); + analyzer.shouldContain("compiler.jsr292.MHInlineTest$B::private_static_x (3 bytes) inline (hot)"); + analyzer.shouldContain("compiler.jsr292.MHInlineTest$A::package_static_x (3 bytes) inline (hot)"); } } diff --git a/test/compiler/jsr292/NonInlinedCall/Agent.java b/test/compiler/jsr292/NonInlinedCall/Agent.java --- a/test/compiler/jsr292/NonInlinedCall/Agent.java +++ b/test/compiler/jsr292/NonInlinedCall/Agent.java @@ -23,13 +23,13 @@ package compiler.jsr292.NonInlinedCall; +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.OutputAnalyzer; + import java.io.File; import java.io.PrintStream; import java.util.Arrays; -import jdk.test.lib.JDKToolLauncher; -import jdk.test.lib.OutputAnalyzer; - public class Agent { public static void main(String[] args) throws Exception { String jarName = args[0]; diff --git a/test/compiler/jsr292/NonInlinedCall/GCTest.java b/test/compiler/jsr292/NonInlinedCall/GCTest.java --- a/test/compiler/jsr292/NonInlinedCall/GCTest.java +++ b/test/compiler/jsr292/NonInlinedCall/GCTest.java @@ -26,7 +26,8 @@ * @bug 8072008 * @library /testlibrary /test/lib ../patches * @modules java.base/jdk.internal.misc - * @modules java.base/jdk.internal.vm.annotation + * java.base/jdk.internal.vm.annotation + * * @build java.base/java.lang.invoke.MethodHandleHelper * @build sun.hotspot.WhiteBox * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions @@ -38,22 +39,20 @@ package compiler.jsr292.NonInlinedCall; +import jdk.internal.vm.annotation.DontInline; +import jdk.internal.vm.annotation.Stable; +import sun.hotspot.WhiteBox; + +import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandleHelper; import java.lang.invoke.MethodHandleHelper.NonInlinedReinvoker; import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodHandle; - import java.lang.invoke.MethodType; import java.lang.ref.PhantomReference; import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; -import jdk.internal.vm.annotation.DontInline; -import jdk.internal.vm.annotation.Stable; - -import sun.hotspot.WhiteBox; - -import static jdk.test.lib.Asserts.*; +import static jdk.test.lib.Asserts.assertEquals; public class GCTest { static final MethodHandles.Lookup LOOKUP = MethodHandleHelper.IMPL_LOOKUP; diff --git a/test/compiler/jsr292/NonInlinedCall/InvokeTest.java b/test/compiler/jsr292/NonInlinedCall/InvokeTest.java --- a/test/compiler/jsr292/NonInlinedCall/InvokeTest.java +++ b/test/compiler/jsr292/NonInlinedCall/InvokeTest.java @@ -26,10 +26,11 @@ * @bug 8072008 * @library /testlibrary /test/lib / ../patches * @modules java.base/jdk.internal.misc - * @modules java.base/jdk.internal.vm.annotation + * java.base/jdk.internal.vm.annotation + * * @build java.base/java.lang.invoke.MethodHandleHelper - * @build sun.hotspot.WhiteBox - * @build compiler.jsr292.NonInlinedCall.InvokeTest + * sun.hotspot.WhiteBox + * compiler.jsr292.NonInlinedCall.InvokeTest * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 @@ -38,17 +39,16 @@ package compiler.jsr292.NonInlinedCall; +import jdk.internal.vm.annotation.DontInline; +import sun.hotspot.WhiteBox; + import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandleHelper; import java.lang.invoke.MethodHandleHelper.NonInlinedReinvoker; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; -import jdk.internal.vm.annotation.DontInline; - -import sun.hotspot.WhiteBox; - -import static jdk.test.lib.Asserts.*; +import static jdk.test.lib.Asserts.assertEquals; public class InvokeTest { static MethodHandles.Lookup LOOKUP = MethodHandleHelper.IMPL_LOOKUP; diff --git a/test/compiler/jsr292/NonInlinedCall/RedefineTest.java b/test/compiler/jsr292/NonInlinedCall/RedefineTest.java --- a/test/compiler/jsr292/NonInlinedCall/RedefineTest.java +++ b/test/compiler/jsr292/NonInlinedCall/RedefineTest.java @@ -29,13 +29,16 @@ * java.base/jdk.internal.vm.annotation * @library /testlibrary /test/lib / ../patches * @requires vm.flavor != "minimal" + * * @build sun.hotspot.WhiteBox - * @build java.base/java.lang.invoke.MethodHandleHelper - * @build compiler.jsr292.NonInlinedCall.RedefineTest - * @run main compiler.jsr292.NonInlinedCall.Agent agent.jar compiler.jsr292.NonInlinedCall.RedefineTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * compiler.jsr292.NonInlinedCall.RedefineTest + * java.base/java.lang.invoke.MethodHandleHelper + * compiler.jsr292.NonInlinedCall.RedefineTest + * @run driver compiler.jsr292.NonInlinedCall.Agent + * agent.jar + * compiler.jsr292.NonInlinedCall.RedefineTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * compiler.jsr292.NonInlinedCall.RedefineTest * @run main/bootclasspath/othervm -javaagent:agent.jar * -XX:+IgnoreUnrecognizedVMOptions * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI @@ -45,20 +48,23 @@ package compiler.jsr292.NonInlinedCall; +import jdk.internal.misc.Unsafe; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.vm.annotation.DontInline; import sun.hotspot.WhiteBox; import java.lang.instrument.ClassDefinition; import java.lang.instrument.Instrumentation; import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandleHelper; import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodHandleHelper; import java.lang.invoke.MethodType; -import jdk.internal.misc.Unsafe; -import jdk.internal.vm.annotation.DontInline; -import jdk.internal.org.objectweb.asm.*; - -import static jdk.internal.org.objectweb.asm.Opcodes.*; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_SUPER; +import static jdk.internal.org.objectweb.asm.Opcodes.IRETURN; public class RedefineTest { static final MethodHandles.Lookup LOOKUP = MethodHandleHelper.IMPL_LOOKUP; diff --git a/test/compiler/jsr292/NullConstantReceiver.java b/test/compiler/jsr292/NullConstantReceiver.java --- a/test/compiler/jsr292/NullConstantReceiver.java +++ b/test/compiler/jsr292/NullConstantReceiver.java @@ -24,9 +24,12 @@ /** * @test * @bug 8059556 - * @run main/othervm -Xbatch NullConstantReceiver + * + * @run main/othervm -Xbatch compiler.jsr292.NullConstantReceiver */ +package compiler.jsr292; + import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; diff --git a/test/compiler/jsr292/PollutedTrapCounts.java b/test/compiler/jsr292/PollutedTrapCounts.java --- a/test/compiler/jsr292/PollutedTrapCounts.java +++ b/test/compiler/jsr292/PollutedTrapCounts.java @@ -26,10 +26,18 @@ * @bug 8074551 * @modules java.base/jdk.internal.misc * @library /testlibrary - * @run main PollutedTrapCounts + * + * @run driver compiler.jsr292.PollutedTrapCounts */ -import java.lang.invoke.*; -import jdk.test.lib.*; + +package compiler.jsr292; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; public class PollutedTrapCounts { public static void main(String[] args) throws Exception { @@ -38,7 +46,7 @@ "-XX:-TieredCompilation", "-Xbatch", "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", - "PollutedTrapCounts$Test"); + Test.class.getName()); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java b/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java --- a/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java +++ b/test/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java @@ -25,27 +25,42 @@ * @test * @bug 8042235 * @summary redefining method used by multiple MethodHandles crashes VM + * @library / * @modules java.base/jdk.internal.org.objectweb.asm * java.compiler * java.instrument * java.management - * @compile -XDignore.symbol.file RedefineMethodUsedByMultipleMethodHandles.java - * @run main/othervm RedefineMethodUsedByMultipleMethodHandles + * + * @run main/othervm compiler.jsr292.RedefineMethodUsedByMultipleMethodHandles */ -import java.io.*; -import java.lang.instrument.*; -import java.lang.invoke.*; +package compiler.jsr292; + +import jdk.internal.org.objectweb.asm.ClassReader; +import jdk.internal.org.objectweb.asm.ClassVisitor; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.org.objectweb.asm.Opcodes; + +import javax.tools.ToolProvider; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.lang.instrument.ClassFileTransformer; +import java.lang.instrument.IllegalClassFormatException; +import java.lang.instrument.Instrumentation; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodHandles.Lookup; -import java.lang.management.*; -import java.lang.reflect.*; -import java.nio.file.*; -import java.security.*; -import java.util.jar.*; - -import javax.tools.*; - -import jdk.internal.org.objectweb.asm.*; +import java.lang.management.ManagementFactory; +import java.lang.reflect.Method; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.ProtectionDomain; +import java.util.jar.Attributes; +import java.util.jar.JarEntry; +import java.util.jar.JarOutputStream; +import java.util.jar.Manifest; public class RedefineMethodUsedByMultipleMethodHandles { diff --git a/test/compiler/jsr292/7082949/Test7082949.java b/test/compiler/jsr292/Test7082949.java rename from test/compiler/jsr292/7082949/Test7082949.java rename to test/compiler/jsr292/Test7082949.java --- a/test/compiler/jsr292/7082949/Test7082949.java +++ b/test/compiler/jsr292/Test7082949.java @@ -27,12 +27,15 @@ * @bug 7082949 * @summary JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method * - * @run main Test7082949 + * @run main compiler.jsr292.Test7082949 */ -import java.lang.invoke.*; -import static java.lang.invoke.MethodHandles.*; -import static java.lang.invoke.MethodType.*; +package compiler.jsr292; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; + +import static java.lang.invoke.MethodType.methodType; public class Test7082949 implements Runnable { public static void main(String... args) throws Throwable { diff --git a/test/compiler/jsr292/VMAnonymousClasses.java b/test/compiler/jsr292/VMAnonymousClasses.java --- a/test/compiler/jsr292/VMAnonymousClasses.java +++ b/test/compiler/jsr292/VMAnonymousClasses.java @@ -26,13 +26,16 @@ * @bug 8058828 * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc - * @run main/bootclasspath/othervm -Xbatch VMAnonymousClasses + * + * @run main/bootclasspath/othervm -Xbatch compiler.jsr292.VMAnonymousClasses */ +package compiler.jsr292; + +import jdk.internal.misc.Unsafe; import jdk.internal.org.objectweb.asm.ClassWriter; import jdk.internal.org.objectweb.asm.MethodVisitor; import jdk.internal.org.objectweb.asm.Opcodes; -import jdk.internal.misc.Unsafe; import java.lang.invoke.ConstantCallSite; import java.lang.invoke.MethodHandle; diff --git a/test/compiler/jsr292/6990212/Test6990212.java b/test/compiler/jsr292/cr6990212/Test6990212.java rename from test/compiler/jsr292/6990212/Test6990212.java rename to test/compiler/jsr292/cr6990212/Test6990212.java --- a/test/compiler/jsr292/6990212/Test6990212.java +++ b/test/compiler/jsr292/cr6990212/Test6990212.java @@ -27,10 +27,14 @@ * @bug 6990212 * @summary JSR 292 JVMTI MethodEnter hook is not called for JSR 292 bootstrap and target methods * - * @run main Test6990212 + * @run main compiler.jsr292.cr6990212.Test6990212 */ -import java.lang.invoke.*; +package compiler.jsr292.cr6990212; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; interface intf { public Object target(); diff --git a/test/compiler/jsr292/methodHandleExceptions/ByteClassLoader.java b/test/compiler/jsr292/methodHandleExceptions/ByteClassLoader.java --- a/test/compiler/jsr292/methodHandleExceptions/ByteClassLoader.java +++ b/test/compiler/jsr292/methodHandleExceptions/ByteClassLoader.java @@ -1,12 +1,3 @@ -import java.io.BufferedOutputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.jar.JarEntry; -import java.util.jar.JarOutputStream; - /* * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,6 +22,17 @@ * */ +package compiler.jsr292.methodHandleExceptions; + +import java.io.BufferedOutputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.jar.JarEntry; +import java.util.jar.JarOutputStream; + /** * A ByteClassLoader is used to define classes from collections of bytes, as * well as loading classes in the usual way. It includes options to write the diff --git a/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java b/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java --- a/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java +++ b/test/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java @@ -21,28 +21,47 @@ * questions. * */ + +/** + * @test + * @bug 8025260 8016839 + * @summary Ensure that AbstractMethodError and IllegalAccessError are thrown appropriately, not NullPointerException + * @modules java.base/jdk.internal.org.objectweb.asm + * @library / . + * + * @build p.* + * @run main/othervm compiler.jsr292.methodHandleExceptions.TestAMEnotNPE + * @run main/othervm -Xint compiler.jsr292.methodHandleExceptions.TestAMEnotNPE + * @run main/othervm -Xcomp compiler.jsr292.methodHandleExceptions.TestAMEnotNPE + */ + +package compiler.jsr292.methodHandleExceptions; + +import p.Dok; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.Handle; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.org.objectweb.asm.Opcodes; + import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; -import jdk.internal.org.objectweb.asm.ClassWriter; -import jdk.internal.org.objectweb.asm.Handle; -import jdk.internal.org.objectweb.asm.MethodVisitor; -import jdk.internal.org.objectweb.asm.Opcodes; -import p.Dok; -/** - * @test @bug 8025260 8016839 - * @summary Ensure that AbstractMethodError and IllegalAccessError are thrown appropriately, not NullPointerException - * - * @modules java.base/jdk.internal.org.objectweb.asm - * @compile -XDignore.symbol.file TestAMEnotNPE.java ByteClassLoader.java p/C.java p/Dok.java p/E.java p/F.java p/I.java p/Tdirect.java p/Treflect.java - * - * @run main/othervm TestAMEnotNPE - * @run main/othervm -Xint TestAMEnotNPE - * @run main/othervm -Xcomp TestAMEnotNPE - */ -public class TestAMEnotNPE implements Opcodes { +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PRIVATE; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_SUPER; +import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD; +import static jdk.internal.org.objectweb.asm.Opcodes.ILOAD; +import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL; +import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEVIRTUAL; +import static jdk.internal.org.objectweb.asm.Opcodes.IRETURN; +import static jdk.internal.org.objectweb.asm.Opcodes.LLOAD; +import static jdk.internal.org.objectweb.asm.Opcodes.RETURN; +import static jdk.internal.org.objectweb.asm.Opcodes.V1_8; + +public class TestAMEnotNPE { static boolean writeJarFiles = false; static boolean readJarFiles = false; @@ -115,7 +134,7 @@ System.out.flush(); Thread.sleep(250); // This de-interleaves output and error in Netbeans, sigh. for (Throwable th : lt) - System.err.println(th); + System.err.println(th); throw new Error("Test failed, there were " + lt.size() + " failures listed above"); } else { System.out.println("ALL PASS, HOORAY!"); @@ -191,7 +210,7 @@ * @throws Exception */ public static byte[] bytesForSomeDsubSomethingSomeAccess - (String d_name, String sub_what, int method_acc) + (String d_name, String sub_what, int method_acc) throws Exception { ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES diff --git a/test/compiler/jsr292/methodHandleExceptions/p/C.java b/test/compiler/jsr292/methodHandleExceptions/p/C.java --- a/test/compiler/jsr292/methodHandleExceptions/p/C.java +++ b/test/compiler/jsr292/methodHandleExceptions/p/C.java @@ -30,6 +30,6 @@ * an abstract method error if called. * */ -public abstract class C implements p.I { +public abstract class C implements I { public abstract int m(); } diff --git a/test/compiler/jsr292/methodHandleExceptions/p/Dok.java b/test/compiler/jsr292/methodHandleExceptions/p/Dok.java --- a/test/compiler/jsr292/methodHandleExceptions/p/Dok.java +++ b/test/compiler/jsr292/methodHandleExceptions/p/Dok.java @@ -21,11 +21,12 @@ * questions. * */ + package p; /** * Test class -- implements I, extends E, both define m, so all should be well. */ -public class Dok extends p.E { +public class Dok extends E { } diff --git a/test/compiler/jsr292/methodHandleExceptions/p/E.java b/test/compiler/jsr292/methodHandleExceptions/p/E.java --- a/test/compiler/jsr292/methodHandleExceptions/p/E.java +++ b/test/compiler/jsr292/methodHandleExceptions/p/E.java @@ -31,7 +31,7 @@ * of course is NOT usually the case in this test). * */ -public abstract class E implements p.I { +public abstract class E implements I { public int m() { return 2; } diff --git a/test/compiler/jsr292/methodHandleExceptions/p/F.java b/test/compiler/jsr292/methodHandleExceptions/p/F.java --- a/test/compiler/jsr292/methodHandleExceptions/p/F.java +++ b/test/compiler/jsr292/methodHandleExceptions/p/F.java @@ -34,7 +34,7 @@ * m. * */ -public abstract class F implements p.I { +public abstract class F implements I { final public int m() { return 2; } diff --git a/test/compiler/jsr292/methodHandleExceptions/p/Tdirect.java b/test/compiler/jsr292/methodHandleExceptions/p/Tdirect.java --- a/test/compiler/jsr292/methodHandleExceptions/p/Tdirect.java +++ b/test/compiler/jsr292/methodHandleExceptions/p/Tdirect.java @@ -28,7 +28,7 @@ * Invokes I.m directly using invokeInterface bytecodes. */ public class Tdirect { - public static int test(p.I i) { + public static int test(I i) { int accum = 0; for (int j = 0; j < 100000; j++) { accum += i.m(); @@ -36,7 +36,7 @@ return accum; } - public static int test(p.I ii, byte b, char c, short s, int i, long l, + public static int test(I ii, byte b, char c, short s, int i, long l, Object o1, Object o2, Object o3, Object o4, Object o5, Object o6) { int accum = 0; for (int j = 0; j < 100000; j++) { diff --git a/test/compiler/jsr292/methodHandleExceptions/p/Treflect.java b/test/compiler/jsr292/methodHandleExceptions/p/Treflect.java --- a/test/compiler/jsr292/methodHandleExceptions/p/Treflect.java +++ b/test/compiler/jsr292/methodHandleExceptions/p/Treflect.java @@ -21,6 +21,7 @@ * questions. * */ + package p; import java.lang.reflect.InvocationTargetException; @@ -31,9 +32,9 @@ */ public class Treflect { - public static int test(p.I ii) throws Throwable { + public static int test(I ii) throws Throwable { int accum = 0; - Method m = p.I.class.getMethod("m"); + Method m = I.class.getMethod("m"); try { for (int j = 0; j < 100000; j++) { Object o = m.invoke(ii); @@ -45,10 +46,10 @@ return accum; } - public static int test(p.I ii, byte b, char c, short s, int i, long l, + public static int test(I ii, byte b, char c, short s, int i, long l, Object o1, Object o2, Object o3, Object o4, Object o5, Object o6) throws Throwable { - Method m = p.I.class.getMethod("m", Byte.TYPE, Character.TYPE, + Method m = I.class.getMethod("m", Byte.TYPE, Character.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE, Object.class, Object.class, Object.class, Object.class, Object.class, Object.class); diff --git a/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java b/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java --- a/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java +++ b/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java @@ -52,8 +52,8 @@ package compiler.jvmci; +import jdk.test.lib.Asserts; import jdk.vm.ci.runtime.JVMCI; -import jdk.test.lib.Asserts; public class JVM_GetJVMCIRuntimeTest implements Runnable { private static final boolean IS_POSITIVE = Boolean.getBoolean( diff --git a/test/compiler/jvmci/SecurityRestrictionsTest.java b/test/compiler/jvmci/SecurityRestrictionsTest.java --- a/test/compiler/jvmci/SecurityRestrictionsTest.java +++ b/test/compiler/jvmci/SecurityRestrictionsTest.java @@ -56,14 +56,11 @@ package compiler.jvmci; import jdk.test.lib.Utils; -import java.lang.InternalError; -import java.lang.reflect.Constructor; + import java.security.AccessControlException; import java.security.Permission; import java.util.PropertyPermission; import java.util.function.Consumer; -import java.util.logging.Level; -import java.util.logging.Logger; public class SecurityRestrictionsTest { diff --git a/test/compiler/jvmci/common/CTVMUtilities.java b/test/compiler/jvmci/common/CTVMUtilities.java --- a/test/compiler/jvmci/common/CTVMUtilities.java +++ b/test/compiler/jvmci/common/CTVMUtilities.java @@ -23,18 +23,6 @@ package compiler.jvmci.common; -import java.io.IOException; -import java.lang.reflect.Module; -import java.lang.reflect.Field; -import java.lang.reflect.Executable; -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.lang.reflect.Parameter; -import java.util.HashMap; -import java.util.Map; -import java.util.TreeMap; - import jdk.internal.org.objectweb.asm.ClassReader; import jdk.internal.org.objectweb.asm.ClassVisitor; import jdk.internal.org.objectweb.asm.ClassWriter; @@ -47,6 +35,18 @@ import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.Executable; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.Module; +import java.lang.reflect.Parameter; +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; + public class CTVMUtilities { /* * A method to return HotSpotResolvedJavaMethod object using class object diff --git a/test/compiler/jvmci/common/JVMCIHelpers.java b/test/compiler/jvmci/common/JVMCIHelpers.java --- a/test/compiler/jvmci/common/JVMCIHelpers.java +++ b/test/compiler/jvmci/common/JVMCIHelpers.java @@ -23,14 +23,12 @@ package compiler.jvmci.common; -import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.CompilationRequest; import jdk.vm.ci.code.CompilationRequestResult; import jdk.vm.ci.hotspot.services.HotSpotVMEventListener; -import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.runtime.JVMCICompiler; +import jdk.vm.ci.runtime.JVMCIRuntime; import jdk.vm.ci.runtime.services.JVMCICompilerFactory; -import jdk.vm.ci.runtime.JVMCIRuntime; /* * A stub classes to be able to use jvmci diff --git a/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java b/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java --- a/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java +++ b/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java @@ -28,7 +28,6 @@ import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.meta.ConstantPool; import jdk.vm.ci.meta.ResolvedJavaMethod; -import jdk.vm.ci.meta.SpeculationLog; /** * A simple "proxy" class to get test access to CompilerToVM package-private methods diff --git a/test/compiler/jvmci/common/testcases/TestCase.java b/test/compiler/jvmci/common/testcases/TestCase.java --- a/test/compiler/jvmci/common/testcases/TestCase.java +++ b/test/compiler/jvmci/common/testcases/TestCase.java @@ -25,13 +25,9 @@ package compiler.jvmci.common.testcases; import java.lang.reflect.Executable; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; -import java.util.List; -import java.util.ArrayList; import java.util.Set; /** diff --git a/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java b/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java --- a/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java +++ b/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java @@ -47,22 +47,21 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; +import jdk.test.lib.Asserts; +import jdk.test.lib.Pair; +import jdk.test.lib.Utils; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import sun.hotspot.code.NMethod; import java.lang.reflect.Executable; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; -import java.util.HashSet; import java.util.stream.Collectors; import java.util.stream.Stream; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.test.lib.Asserts; -import jdk.test.lib.Pair; -import jdk.test.lib.Utils; -import sun.hotspot.code.NMethod; - public class AllocateCompileIdTest { private static final int SOME_REPEAT_VALUE = 5; diff --git a/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java b/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java --- a/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java +++ b/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java @@ -47,14 +47,15 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import sun.hotspot.WhiteBox; + import java.lang.reflect.Executable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.test.lib.Asserts; -import sun.hotspot.WhiteBox; public class CanInlineMethodTest { diff --git a/test/compiler/jvmci/compilerToVM/CollectCountersTest.java b/test/compiler/jvmci/compilerToVM/CollectCountersTest.java --- a/test/compiler/jvmci/compilerToVM/CollectCountersTest.java +++ b/test/compiler/jvmci/compilerToVM/CollectCountersTest.java @@ -45,8 +45,8 @@ package compiler.jvmci.compilerToVM; +import jdk.test.lib.Asserts; import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; public class CollectCountersTest { private static final int EXPECTED = Integer.getInteger( diff --git a/test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java b/test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java --- a/test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java +++ b/test/compiler/jvmci/compilerToVM/CompileCodeTestCase.java @@ -26,13 +26,14 @@ import compiler.jvmci.common.CTVMUtilities; import compiler.testlibrary.CompilerUtils; +import jdk.test.lib.Pair; import jdk.test.lib.Utils; import jdk.vm.ci.code.InstalledCode; import sun.hotspot.WhiteBox; import sun.hotspot.code.NMethod; +import java.lang.reflect.Constructor; import java.lang.reflect.Executable; -import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; @@ -42,7 +43,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import jdk.test.lib.Pair; /** * A test case for tests which require compiled code. diff --git a/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java b/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java --- a/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java +++ b/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java @@ -24,15 +24,31 @@ package compiler.jvmci.compilerToVM; -import java.util.HashMap; -import java.util.Map; +import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; +import jdk.internal.reflect.ConstantPool; +import jdk.internal.reflect.ConstantPool.Tag; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.ResolvedJavaMethod; import sun.hotspot.WhiteBox; -import jdk.internal.reflect.ConstantPool; -import jdk.internal.reflect.ConstantPool.Tag; -import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; -import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; + +import java.util.HashMap; +import java.util.Map; + +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_CLASS; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_DOUBLE; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FLOAT; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTEGER; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVALID; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVOKEDYNAMIC; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_LONG; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODHANDLE; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODTYPE; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_NAMEANDTYPE; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_STRING; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_UTF8; /** * Common class for jdk.vm.ci.hotspot.CompilerToVM constant pool tests diff --git a/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java b/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java --- a/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java +++ b/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java @@ -27,19 +27,28 @@ import compiler.jvmci.common.testcases.MultipleImplementer2; import compiler.jvmci.common.testcases.MultipleImplementersInterface; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes; -import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry; -import java.util.HashMap; -import java.util.Map; +import jdk.internal.misc.SharedSecrets; +import jdk.internal.org.objectweb.asm.Opcodes; +import jdk.internal.reflect.ConstantPool; +import jdk.internal.reflect.ConstantPool.Tag; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.runtime.JVMCI; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.org.objectweb.asm.Opcodes; import sun.hotspot.WhiteBox; -import jdk.internal.reflect.ConstantPool; -import jdk.internal.reflect.ConstantPool.Tag; + +import java.util.HashMap; +import java.util.Map; + +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_CLASS; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVOKEDYNAMIC; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODHANDLE; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODTYPE; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_STRING; /** * Class contains hard-coded constant pool tables for dummy classes used for diff --git a/test/compiler/jvmci/compilerToVM/DebugOutputTest.java b/test/compiler/jvmci/compilerToVM/DebugOutputTest.java --- a/test/compiler/jvmci/compilerToVM/DebugOutputTest.java +++ b/test/compiler/jvmci/compilerToVM/DebugOutputTest.java @@ -38,11 +38,11 @@ package compiler.jvmci.compilerToVM; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.ProcessTools; + import java.util.Arrays; -import jdk.test.lib.OutputAnalyzer; -import jdk.test.lib.Utils; public class DebugOutputTest { public static void main(String[] args) { diff --git a/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java b/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java --- a/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java +++ b/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java @@ -47,13 +47,13 @@ package compiler.jvmci.compilerToVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; +import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.code.InstalledCode; -import jdk.test.lib.Asserts; import sun.hotspot.code.NMethod; import java.util.List; -import jdk.test.lib.Utils; public class DisassembleCodeBlobTest { diff --git a/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java b/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java --- a/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java +++ b/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java @@ -47,14 +47,15 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import sun.hotspot.WhiteBox; + import java.lang.reflect.Executable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.test.lib.Asserts; -import sun.hotspot.WhiteBox; public class DoNotInlineOrCompileTest { diff --git a/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java b/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java --- a/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java +++ b/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java @@ -1,22 +1,17 @@ package compiler.jvmci.compilerToVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.Pair; +import jdk.test.lib.Utils; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.code.InvalidInstalledCodeException; import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; -import jdk.test.lib.Pair; import sun.hotspot.code.NMethod; import java.lang.reflect.Constructor; -import java.lang.reflect.Executable; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; /* * @test diff --git a/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java b/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java --- a/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java +++ b/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java @@ -40,19 +40,20 @@ package compiler.jvmci.compilerToVM; +import compiler.jvmci.common.CTVMUtilities; import compiler.jvmci.common.testcases.MultipleImplementer1; import compiler.jvmci.common.testcases.SingleImplementer; +import compiler.jvmci.common.testcases.SingleImplementerInterface; import compiler.jvmci.common.testcases.SingleSubclass; -import compiler.jvmci.common.CTVMUtilities; -import compiler.jvmci.common.testcases.SingleImplementerInterface; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; + import java.lang.reflect.Method; import java.util.HashSet; import java.util.Set; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; public class FindUniqueConcreteMethodTest { public static void main(String args[]) { diff --git a/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java b/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java --- a/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java +++ b/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java @@ -43,12 +43,13 @@ import compiler.jvmci.common.CTVMUtilities; import compiler.jvmci.common.testcases.TestCase; +import jdk.internal.org.objectweb.asm.Opcodes; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; + import java.lang.reflect.Executable; import java.lang.reflect.Modifier; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.internal.org.objectweb.asm.Opcodes; -import jdk.test.lib.Asserts; public class GetBytecodeTest { diff --git a/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java b/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java --- a/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java +++ b/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java @@ -43,13 +43,14 @@ import compiler.jvmci.common.testcases.MultipleImplementersInterfaceExtender; import compiler.jvmci.common.testcases.SingleImplementer; import compiler.jvmci.common.testcases.SingleImplementerInterface; -import java.util.HashSet; -import java.util.Set; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; + +import java.util.HashSet; +import java.util.Set; public class GetClassInitializerTest { diff --git a/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java b/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java --- a/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java +++ b/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java @@ -44,15 +44,15 @@ */ package compiler.jvmci.compilerToVM; -import java.lang.reflect.Field; -import jdk.vm.ci.meta.ConstantPool; +import jdk.internal.misc.Unsafe; +import jdk.test.lib.Utils; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject; -import jdk.test.lib.Utils; +import jdk.vm.ci.meta.ConstantPool; import sun.hotspot.WhiteBox; -import jdk.internal.misc.Unsafe; + +import java.lang.reflect.Field; /** * Tests for jdk.vm.ci.hotspot.CompilerToVM::getConstantPool method diff --git a/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java b/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java --- a/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java +++ b/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java @@ -42,14 +42,15 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; + import java.io.IOException; import java.lang.reflect.Executable; import java.net.Socket; import java.util.HashMap; import java.util.Map; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; public class GetExceptionTableTest { diff --git a/test/compiler/jvmci/compilerToVM/GetImplementorTest.java b/test/compiler/jvmci/compilerToVM/GetImplementorTest.java --- a/test/compiler/jvmci/compilerToVM/GetImplementorTest.java +++ b/test/compiler/jvmci/compilerToVM/GetImplementorTest.java @@ -39,8 +39,8 @@ import compiler.jvmci.common.testcases.AbstractClass; import compiler.jvmci.common.testcases.AbstractClassExtender; +import compiler.jvmci.common.testcases.DoNotExtendClass; import compiler.jvmci.common.testcases.DoNotImplementInterface; -import compiler.jvmci.common.testcases.DoNotExtendClass; import compiler.jvmci.common.testcases.MultipleImplementer1; import compiler.jvmci.common.testcases.MultipleImplementer2; import compiler.jvmci.common.testcases.MultipleImplementersInterface; @@ -48,13 +48,14 @@ import compiler.jvmci.common.testcases.SingleImplementerInterface; import compiler.jvmci.common.testcases.SingleSubclass; import compiler.jvmci.common.testcases.SingleSubclassedClass; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; + import java.util.HashSet; import java.util.Set; import java.util.stream.Stream; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; public class GetImplementorTest { public static void main(String args[]) { diff --git a/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java b/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java --- a/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java +++ b/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java @@ -44,9 +44,9 @@ import compiler.jvmci.common.CTVMUtilities; import compiler.jvmci.common.testcases.TestCase; +import jdk.test.lib.Asserts; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.test.lib.Asserts; import java.lang.reflect.Executable; import java.util.Arrays; diff --git a/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java b/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java --- a/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java +++ b/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java @@ -47,9 +47,9 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; import java.lang.reflect.Executable; import java.util.HashMap; diff --git a/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java b/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java --- a/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java +++ b/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java @@ -37,8 +37,8 @@ package compiler.jvmci.compilerToVM; +import jdk.test.lib.Asserts; import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; public class GetMaxCallTargetOffsetTest { public static void main(String args[]) { diff --git a/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java b/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java --- a/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java +++ b/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java @@ -42,11 +42,12 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; -import java.lang.reflect.Method; +import jdk.test.lib.Asserts; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotStackFrameReference; import jdk.vm.ci.meta.ResolvedJavaMethod; -import jdk.test.lib.Asserts; + +import java.lang.reflect.Method; public class GetNextStackFrameTest { private static final int RECURSION_AMOUNT = 3; diff --git a/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java b/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java --- a/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java +++ b/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java @@ -42,9 +42,10 @@ package compiler.jvmci.compilerToVM; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; + import java.util.HashMap; import java.util.Map; diff --git a/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java b/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java --- a/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java +++ b/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java @@ -43,13 +43,13 @@ package compiler.jvmci.compilerToVM; +import jdk.internal.misc.Unsafe; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; import sun.hotspot.WhiteBox; -import jdk.internal.misc.Unsafe; import java.lang.reflect.Field; diff --git a/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java b/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java --- a/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java +++ b/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java @@ -52,16 +52,17 @@ package compiler.jvmci.compilerToVM; -import java.lang.reflect.Field; -import jdk.vm.ci.meta.ConstantPool; +import jdk.internal.misc.Unsafe; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; +import jdk.vm.ci.meta.ConstantPool; import sun.hotspot.WhiteBox; -import jdk.internal.misc.Unsafe; + +import java.lang.reflect.Field; public class GetResolvedJavaTypeTest { private static enum TestCase { diff --git a/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java b/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java --- a/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java +++ b/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java @@ -42,17 +42,17 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; +import compiler.jvmci.common.testcases.TestCase; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; + import java.lang.reflect.Executable; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.HashMap; import java.util.Map; -import compiler.jvmci.common.testcases.TestCase; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; - public class GetStackTraceElementTest { public static void main(String[] args) { diff --git a/test/compiler/jvmci/compilerToVM/GetSymbolTest.java b/test/compiler/jvmci/compilerToVM/GetSymbolTest.java --- a/test/compiler/jvmci/compilerToVM/GetSymbolTest.java +++ b/test/compiler/jvmci/compilerToVM/GetSymbolTest.java @@ -41,9 +41,13 @@ package compiler.jvmci.compilerToVM; -import jdk.vm.ci.hotspot.CompilerToVMHelper; import compiler.jvmci.common.CTVMUtilities; import compiler.jvmci.common.testcases.SingleImplementer; +import jdk.test.lib.Utils; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import jdk.vm.ci.meta.ConstantPool; + import java.lang.reflect.Field; import java.lang.reflect.Member; import java.lang.reflect.Method; @@ -52,9 +56,6 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.vm.ci.meta.ConstantPool; -import jdk.test.lib.Utils; public class GetSymbolTest { private static final int CONSTANT_POOL_UTF8_TAG = 1; // see jvms, section 4.4 diff --git a/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java b/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java --- a/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java +++ b/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java @@ -40,7 +40,10 @@ package compiler.jvmci.compilerToVM; +import compiler.jvmci.common.CTVMUtilities; import compiler.jvmci.common.testcases.AbstractClass; +import compiler.jvmci.common.testcases.AnotherSingleImplementer; +import compiler.jvmci.common.testcases.AnotherSingleImplementerInterface; import compiler.jvmci.common.testcases.DoNotExtendClass; import compiler.jvmci.common.testcases.MultipleAbstractImplementer; import compiler.jvmci.common.testcases.MultipleImplementersInterface; @@ -49,18 +52,16 @@ import compiler.jvmci.common.testcases.SingleImplementerInterface; import compiler.jvmci.common.testcases.SingleSubclass; import compiler.jvmci.common.testcases.SingleSubclassedClass; -import compiler.jvmci.common.CTVMUtilities; -import compiler.jvmci.common.testcases.AnotherSingleImplementer; -import compiler.jvmci.common.testcases.AnotherSingleImplementerInterface; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; + import java.lang.reflect.Method; import java.util.HashSet; import java.util.Set; import java.util.stream.Stream; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; public class GetVtableIndexForInterfaceTest { private static final int INVALID_VTABLE_INDEX = -4; // see method.hpp: VtableIndexFlag diff --git a/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java b/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java --- a/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java +++ b/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java @@ -48,18 +48,17 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; +import compiler.testlibrary.CompilerUtils; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import sun.hotspot.code.NMethod; import java.lang.reflect.Executable; import java.util.ArrayList; import java.util.List; -import compiler.testlibrary.CompilerUtils; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; -import sun.hotspot.code.NMethod; - public class HasCompiledCodeForOSRTest { public static void main(String[] args) { List testCases = createTestCases(); diff --git a/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java b/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java --- a/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java +++ b/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java @@ -43,13 +43,14 @@ import compiler.jvmci.common.testcases.MultipleImplementer1; import compiler.jvmci.common.testcases.MultipleImplementersInterface; import compiler.jvmci.common.testcases.SingleImplementerInterface; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; + import java.util.HashSet; import java.util.Set; import java.util.stream.Stream; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; public class HasFinalizableSubclassTest { public static void main(String args[]) { diff --git a/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java b/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java --- a/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java +++ b/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java @@ -37,19 +37,10 @@ package compiler.jvmci.compilerToVM; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.function.Consumer; -import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.test.lib.Asserts; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotVMConfigAccess; import jdk.vm.ci.hotspot.HotSpotVMConfigStore; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; -import jdk.internal.misc.Unsafe; public class InitializeConfigurationTest { public static void main(String args[]) { diff --git a/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java b/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java --- a/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java +++ b/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java @@ -49,18 +49,18 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; +import jdk.vm.ci.code.CodeCacheProvider; +import jdk.vm.ci.code.CompilationResult; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; +import jdk.vm.ci.hotspot.HotSpotCompilationRequest; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import sun.hotspot.code.NMethod; import java.util.List; -import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.hotspot.HotSpotCompilationRequest; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; public class InvalidateInstalledCodeTest { private static final CodeCacheProvider CACHE_PROVIDER diff --git a/test/compiler/jvmci/compilerToVM/IsMatureTest.java b/test/compiler/jvmci/compilerToVM/IsMatureTest.java --- a/test/compiler/jvmci/compilerToVM/IsMatureTest.java +++ b/test/compiler/jvmci/compilerToVM/IsMatureTest.java @@ -44,8 +44,8 @@ import compiler.jvmci.common.testcases.SimpleClass; import compiler.whitebox.CompilerWhiteBoxTest; +import jdk.test.lib.Asserts; import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; import sun.hotspot.WhiteBox; import java.lang.reflect.Executable; diff --git a/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java b/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java --- a/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java +++ b/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java @@ -43,8 +43,8 @@ package compiler.jvmci.compilerToVM; +import jdk.test.lib.Asserts; import jdk.vm.ci.runtime.JVMCI; -import jdk.test.lib.Asserts; import java.lang.reflect.Method; diff --git a/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java b/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java --- a/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java +++ b/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java @@ -49,17 +49,19 @@ package compiler.jvmci.compilerToVM; -import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes; -import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator; -import java.util.HashMap; -import java.util.Map; +import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.ConstantPool; +import java.util.HashMap; +import java.util.Map; + +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_CLASS; + /** * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.lookupKlassInPool} method */ diff --git a/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java b/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java --- a/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java +++ b/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java @@ -47,17 +47,21 @@ package compiler.jvmci.compilerToVM; -import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes; -import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator; -import java.util.HashMap; -import java.util.Map; +import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import jdk.test.lib.Asserts; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.meta.ConstantPool; +import java.util.HashMap; +import java.util.Map; + +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF; + /** * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.lookupKlassRefIndexInPool} method */ diff --git a/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java b/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java --- a/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java +++ b/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java @@ -47,18 +47,21 @@ package compiler.jvmci.compilerToVM; -import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes; -import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator; -import java.util.HashMap; -import java.util.Map; +import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import jdk.test.lib.Asserts; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.meta.ConstantPool; +import java.util.HashMap; +import java.util.Map; + +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF; + /** * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.lookupMethodInPool} method */ diff --git a/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java b/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java --- a/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java +++ b/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java @@ -47,17 +47,22 @@ package compiler.jvmci.compilerToVM; -import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes; -import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator; -import java.util.HashMap; -import java.util.Map; +import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import jdk.test.lib.Asserts; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.meta.ConstantPool; +import java.util.HashMap; +import java.util.Map; + +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVOKEDYNAMIC; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF; + /** * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.lookupNameAndTypeRefIndexInPool} method */ diff --git a/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java b/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java --- a/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java +++ b/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java @@ -47,16 +47,21 @@ package compiler.jvmci.compilerToVM; -import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes; -import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator; +import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.meta.ConstantPool; + import java.util.HashMap; import java.util.Map; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.meta.ConstantPool; -import jdk.test.lib.Asserts; + +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVOKEDYNAMIC; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF; /** * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.lookupNameInPool} method diff --git a/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java b/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java --- a/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java +++ b/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java @@ -47,17 +47,22 @@ package compiler.jvmci.compilerToVM; -import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes; -import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator; -import java.util.HashMap; -import java.util.Map; +import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import jdk.test.lib.Asserts; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.meta.ConstantPool; +import java.util.HashMap; +import java.util.Map; + +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INTERFACEMETHODREF; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_INVOKEDYNAMIC; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODREF; + /** * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.lookupSignatureInPool} method */ diff --git a/test/compiler/jvmci/compilerToVM/LookupTypeTest.java b/test/compiler/jvmci/compilerToVM/LookupTypeTest.java --- a/test/compiler/jvmci/compilerToVM/LookupTypeTest.java +++ b/test/compiler/jvmci/compilerToVM/LookupTypeTest.java @@ -40,12 +40,13 @@ import compiler.jvmci.common.testcases.DoNotExtendClass; import compiler.jvmci.common.testcases.MultiSubclassedClass; import compiler.jvmci.common.testcases.SingleSubclass; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; + import java.util.HashSet; import java.util.Set; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; public class LookupTypeTest { public static void main(String args[]) { diff --git a/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java b/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java --- a/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java +++ b/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java @@ -58,17 +58,16 @@ package compiler.jvmci.compilerToVM; -import java.lang.reflect.Method; -import jdk.vm.ci.hotspot.HotSpotStackFrameReference; -import jdk.vm.ci.meta.ResolvedJavaMethod; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; - import compiler.jvmci.common.CTVMUtilities; import compiler.testlibrary.CompilerUtils; import compiler.whitebox.CompilerWhiteBoxTest; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotStackFrameReference; +import jdk.vm.ci.meta.ResolvedJavaMethod; +import sun.hotspot.WhiteBox; -import sun.hotspot.WhiteBox; +import java.lang.reflect.Method; public class MaterializeVirtualObjectTest { private static final WhiteBox WB; diff --git a/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java b/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java --- a/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java +++ b/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java @@ -43,13 +43,14 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; + +import java.lang.reflect.Executable; import java.lang.reflect.Method; -import java.lang.reflect.Executable; import java.util.HashMap; import java.util.Map; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; public class MethodIsIgnoredBySecurityStackWalkTest { diff --git a/test/compiler/jvmci/compilerToVM/ReprofileTest.java b/test/compiler/jvmci/compilerToVM/ReprofileTest.java --- a/test/compiler/jvmci/compilerToVM/ReprofileTest.java +++ b/test/compiler/jvmci/compilerToVM/ReprofileTest.java @@ -51,16 +51,16 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; +import compiler.whitebox.CompilerWhiteBoxTest; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import jdk.vm.ci.meta.ProfilingInfo; + import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; -import compiler.whitebox.CompilerWhiteBoxTest; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.meta.ProfilingInfo; -import jdk.test.lib.Asserts; - public class ReprofileTest { public static void main(String[] args) { diff --git a/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java b/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java --- a/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java +++ b/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java @@ -47,17 +47,20 @@ package compiler.jvmci.compilerToVM; +import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes; +import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator; import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; -import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes; -import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; -import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.meta.ConstantPool; + import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodType; import java.util.HashMap; import java.util.Map; -import jdk.test.lib.Asserts; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.meta.ConstantPool; + +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODHANDLE; +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_METHODTYPE; /** * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.resolveConstantInPool} method diff --git a/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java b/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java --- a/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java +++ b/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java @@ -47,21 +47,23 @@ package compiler.jvmci.compilerToVM; -import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes; -import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator; +import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; +import jdk.internal.misc.Unsafe; +import jdk.internal.org.objectweb.asm.Opcodes; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; +import jdk.vm.ci.meta.ConstantPool; + import java.lang.reflect.Field; import java.util.HashMap; import java.util.Map; -import jdk.internal.org.objectweb.asm.Opcodes; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; -import jdk.vm.ci.meta.ConstantPool; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; -import jdk.internal.misc.Unsafe; + +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_FIELDREF; /** * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.resolveFieldInPool} method diff --git a/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java b/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java --- a/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java +++ b/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java @@ -40,6 +40,7 @@ package compiler.jvmci.compilerToVM; +import compiler.jvmci.common.CTVMUtilities; import compiler.jvmci.common.testcases.AbstractClass; import compiler.jvmci.common.testcases.AbstractClassExtender; import compiler.jvmci.common.testcases.MultipleImplementer1; @@ -49,15 +50,15 @@ import compiler.jvmci.common.testcases.SingleImplementerInterface; import compiler.jvmci.common.testcases.SingleSubclass; import compiler.jvmci.common.testcases.SingleSubclassedClass; -import compiler.jvmci.common.CTVMUtilities; -import java.util.HashSet; -import java.util.Set; +import jdk.internal.misc.Unsafe; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; -import jdk.internal.misc.Unsafe; + +import java.util.HashSet; +import java.util.Set; public class ResolveMethodTest { private static final Unsafe UNSAFE = Utils.getUnsafe(); diff --git a/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java b/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java --- a/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java +++ b/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java @@ -47,17 +47,19 @@ package compiler.jvmci.compilerToVM; -import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes; -import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator; -import java.util.HashMap; -import java.util.Map; +import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import jdk.test.lib.Asserts; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.meta.ConstantPool; +import java.util.HashMap; +import java.util.Map; + +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_STRING; + /** * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.resolvePossiblyCachedConstantInPool} method */ diff --git a/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java b/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java --- a/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java +++ b/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java @@ -48,17 +48,19 @@ package compiler.jvmci.compilerToVM; -import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes; -import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.*; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.TestedCPEntry; import compiler.jvmci.compilerToVM.ConstantPoolTestCase.Validator; -import java.util.HashMap; -import java.util.Map; +import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.ConstantPool; +import java.util.HashMap; +import java.util.Map; + +import static compiler.jvmci.compilerToVM.ConstantPoolTestCase.ConstantTypes.CONSTANT_CLASS; + /** * Test for {@code jdk.vm.ci.hotspot.CompilerToVM.resolveTypeInPool} method */ diff --git a/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java b/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java --- a/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java +++ b/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java @@ -45,8 +45,8 @@ package compiler.jvmci.compilerToVM; +import jdk.test.lib.Asserts; import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.test.lib.Asserts; public class ShouldDebugNonSafepointsTest { private static final boolean EXPECTED = Boolean.getBoolean("compiler" diff --git a/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java b/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java --- a/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java +++ b/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java @@ -47,14 +47,15 @@ package compiler.jvmci.compilerToVM; import compiler.jvmci.common.CTVMUtilities; +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import sun.hotspot.WhiteBox; + import java.lang.reflect.Executable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import jdk.vm.ci.hotspot.CompilerToVMHelper; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import jdk.test.lib.Asserts; -import sun.hotspot.WhiteBox; public class ShouldInlineMethodTest { diff --git a/test/compiler/jvmci/errors/CodeInstallerTest.java b/test/compiler/jvmci/errors/CodeInstallerTest.java --- a/test/compiler/jvmci/errors/CodeInstallerTest.java +++ b/test/compiler/jvmci/errors/CodeInstallerTest.java @@ -23,8 +23,6 @@ package compiler.jvmci.errors; -import java.lang.reflect.Method; - import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.Register; @@ -41,8 +39,9 @@ import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; +import org.junit.Assert; -import org.junit.Assert; +import java.lang.reflect.Method; public class CodeInstallerTest { diff --git a/test/compiler/jvmci/errors/TestInvalidCompilationResult.java b/test/compiler/jvmci/errors/TestInvalidCompilationResult.java --- a/test/compiler/jvmci/errors/TestInvalidCompilationResult.java +++ b/test/compiler/jvmci/errors/TestInvalidCompilationResult.java @@ -51,7 +51,6 @@ import jdk.vm.ci.hotspot.HotSpotConstant; import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.VMConstant; - import org.junit.Test; /** diff --git a/test/compiler/jvmci/errors/TestInvalidDebugInfo.java b/test/compiler/jvmci/errors/TestInvalidDebugInfo.java --- a/test/compiler/jvmci/errors/TestInvalidDebugInfo.java +++ b/test/compiler/jvmci/errors/TestInvalidDebugInfo.java @@ -58,7 +58,6 @@ import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Value; import jdk.vm.ci.meta.ValueKind; - import org.junit.Test; /** diff --git a/test/compiler/jvmci/errors/TestInvalidOopMap.java b/test/compiler/jvmci/errors/TestInvalidOopMap.java --- a/test/compiler/jvmci/errors/TestInvalidOopMap.java +++ b/test/compiler/jvmci/errors/TestInvalidOopMap.java @@ -52,7 +52,6 @@ import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.PlatformKind; - import org.junit.Test; /** diff --git a/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java b/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java --- a/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java +++ b/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java @@ -72,20 +72,21 @@ import compiler.jvmci.common.CTVMUtilities; import compiler.jvmci.common.testcases.SimpleClass; import jdk.test.lib.Asserts; -import java.lang.reflect.Method; import jdk.test.lib.Utils; -import jdk.vm.ci.hotspot.HotSpotVMEventListener; import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.code.site.DataPatch; import jdk.vm.ci.code.site.Site; -import jdk.vm.ci.meta.Assumptions.Assumption; -import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; import jdk.vm.ci.hotspot.HotSpotCompiledCode; import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import jdk.vm.ci.hotspot.HotSpotVMEventListener; +import jdk.vm.ci.meta.Assumptions.Assumption; +import jdk.vm.ci.meta.ResolvedJavaMethod; + +import java.lang.reflect.Method; public class JvmciNotifyInstallEventTest implements HotSpotVMEventListener { private static final String METHOD_NAME = "testMethod"; diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/CodeInstallationTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/CodeInstallationTest.java --- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/CodeInstallationTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/CodeInstallationTest.java @@ -22,10 +22,6 @@ */ package jdk.vm.ci.code.test; -import java.lang.reflect.Method; - -import org.junit.Assert; - import jdk.vm.ci.amd64.AMD64; import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.CodeCacheProvider; @@ -41,6 +37,9 @@ import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.sparc.SPARC; +import org.junit.Assert; + +import java.lang.reflect.Method; /** * Base class for code installation tests. diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java --- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java @@ -38,13 +38,12 @@ package jdk.vm.ci.code.test; -import org.junit.Assume; -import org.junit.Test; - import jdk.vm.ci.code.Register; import jdk.vm.ci.code.site.DataSectionReference; import jdk.vm.ci.hotspot.HotSpotConstant; import jdk.vm.ci.meta.ResolvedJavaType; +import org.junit.Assume; +import org.junit.Test; /** * Test code installation with data patches. diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DebugInfoTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DebugInfoTest.java --- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DebugInfoTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DebugInfoTest.java @@ -22,8 +22,6 @@ */ package jdk.vm.ci.code.test; -import java.lang.reflect.Method; - import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.DebugInfo; import jdk.vm.ci.code.Location; @@ -33,6 +31,8 @@ import jdk.vm.ci.meta.JavaValue; import jdk.vm.ci.meta.ResolvedJavaMethod; +import java.lang.reflect.Method; + /** * Test code installation with debug information. */ diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java --- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java @@ -38,14 +38,13 @@ package jdk.vm.ci.code.test; -import org.junit.Assert; -import org.junit.Test; - import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaValue; import jdk.vm.ci.meta.ResolvedJavaMethod; +import org.junit.Assert; +import org.junit.Test; public class InterpreterFrameSizeTest extends CodeInstallationTest { diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java --- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java @@ -39,13 +39,12 @@ package jdk.vm.ci.code.test; -import org.junit.Test; - import jdk.vm.ci.code.Location; import jdk.vm.ci.code.Register; import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; +import org.junit.Test; public class MaxOopMapStackOffsetTest extends DebugInfoTest { diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java --- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java @@ -38,10 +38,9 @@ package jdk.vm.ci.code.test; +import jdk.vm.ci.code.Register; import org.junit.Test; -import jdk.vm.ci.code.Register; - /** * Test simple code installation. */ diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java --- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java @@ -38,15 +38,14 @@ package jdk.vm.ci.code.test; -import org.junit.Assume; -import org.junit.Test; - import jdk.vm.ci.code.Register; import jdk.vm.ci.hotspot.HotSpotConstant; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Value; +import org.junit.Assume; +import org.junit.Test; public class SimpleDebugInfoTest extends DebugInfoTest { diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestAssembler.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestAssembler.java --- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestAssembler.java +++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestAssembler.java @@ -23,11 +23,6 @@ package jdk.vm.ci.code.test; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.ArrayList; -import java.util.Arrays; - import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.DebugInfo; import jdk.vm.ci.code.Register; @@ -51,8 +46,13 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.PlatformKind; import jdk.vm.ci.meta.ResolvedJavaMethod; +import jdk.vm.ci.meta.VMConstant; import jdk.vm.ci.meta.ValueKind; -import jdk.vm.ci.meta.VMConstant; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.ArrayList; +import java.util.Arrays; /** * Simple assembler used by the code installation tests. diff --git a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java --- a/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java @@ -38,12 +38,6 @@ package jdk.vm.ci.code.test; -import java.util.ArrayList; -import java.util.Objects; - -import org.junit.Assert; -import org.junit.Test; - import jdk.vm.ci.code.Register; import jdk.vm.ci.code.VirtualObject; import jdk.vm.ci.hotspot.HotSpotConstant; @@ -52,6 +46,11 @@ import jdk.vm.ci.meta.JavaValue; import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaType; +import org.junit.Assert; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Objects; public class VirtualObjectDebugInfoTest extends DebugInfoTest { diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/AsJavaTypeDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/AsJavaTypeDataProvider.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/AsJavaTypeDataProvider.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/AsJavaTypeDataProvider.java @@ -23,12 +23,12 @@ package jdk.vm.ci.hotspot.test; +import jdk.vm.ci.meta.JavaConstant; +import org.testng.annotations.DataProvider; + import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE; -import jdk.vm.ci.meta.JavaConstant; -import org.testng.annotations.DataProvider; - public class AsJavaTypeDataProvider { @DataProvider(name = "asJavaTypeDataProvider") diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/BoxPrimitiveDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/BoxPrimitiveDataProvider.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/BoxPrimitiveDataProvider.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/BoxPrimitiveDataProvider.java @@ -23,13 +23,14 @@ package jdk.vm.ci.hotspot.test; +import jdk.vm.ci.meta.JavaConstant; +import org.testng.annotations.DataProvider; + +import java.util.LinkedList; + import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE; -import java.util.LinkedList; -import jdk.vm.ci.meta.JavaConstant; -import org.testng.annotations.DataProvider; - public class BoxPrimitiveDataProvider { @DataProvider(name = "boxPrimitiveDataProvider") diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ConstantEqualsDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ConstantEqualsDataProvider.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ConstantEqualsDataProvider.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ConstantEqualsDataProvider.java @@ -23,15 +23,16 @@ package jdk.vm.ci.hotspot.test; -import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; -import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE; +import jdk.vm.ci.meta.Constant; +import jdk.vm.ci.meta.JavaConstant; +import org.testng.annotations.DataProvider; import java.util.HashMap; import java.util.LinkedList; import java.util.Objects; -import jdk.vm.ci.meta.Constant; -import jdk.vm.ci.meta.JavaConstant; -import org.testng.annotations.DataProvider; + +import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; +import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE; public class ConstantEqualsDataProvider { @DataProvider(name = "constantEqualsDataProvider") diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ForStringDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ForStringDataProvider.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ForStringDataProvider.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ForStringDataProvider.java @@ -23,10 +23,10 @@ package jdk.vm.ci.hotspot.test; +import org.testng.annotations.DataProvider; + import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE; -import org.testng.annotations.DataProvider; - public class ForStringDataProvider { @DataProvider(name = "forStringDataProvider") public static Object[][] forStringDataProvider() { diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java @@ -39,12 +39,8 @@ package jdk.vm.ci.hotspot.test; -import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; - -import java.lang.reflect.Method; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaField; +import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.MemoryAccessProvider; import jdk.vm.ci.meta.MethodHandleAccessProvider; import jdk.vm.ci.meta.ResolvedJavaField; @@ -52,6 +48,8 @@ import org.testng.Assert; import org.testng.annotations.Test; +import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; + public class HotSpotConstantReflectionProviderTest { @Test(dataProvider = "forObjectDataProvider", dataProviderClass = ForObjectDataProvider.class) diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/IsEmbeddableDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/IsEmbeddableDataProvider.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/IsEmbeddableDataProvider.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/IsEmbeddableDataProvider.java @@ -23,12 +23,12 @@ package jdk.vm.ci.hotspot.test; +import jdk.vm.ci.meta.JavaConstant; +import org.testng.annotations.DataProvider; + import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE; -import jdk.vm.ci.meta.JavaConstant; -import org.testng.annotations.DataProvider; - public class IsEmbeddableDataProvider { @DataProvider(name = "isEmbeddableDataProvider") public static Object[][] isEmbeddableDataProvider() { diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java @@ -23,10 +23,6 @@ package jdk.vm.ci.hotspot.test; -import java.lang.reflect.Field; - -import org.testng.annotations.DataProvider; - import jdk.internal.misc.Unsafe; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; @@ -36,6 +32,9 @@ import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.runtime.JVMCI; +import org.testng.annotations.DataProvider; + +import java.lang.reflect.Field; public class MemoryAccessProviderData { private static final Unsafe UNSAFE = getUnsafe(); diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java @@ -38,12 +38,11 @@ package jdk.vm.ci.hotspot.test; import jdk.vm.ci.meta.Constant; -import org.testng.annotations.Test; -import org.testng.Assert; -import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MemoryAccessProvider; import jdk.vm.ci.runtime.JVMCI; +import org.testng.Assert; +import org.testng.annotations.Test; public class MemoryAccessProviderTest { private static final MemoryAccessProvider PROVIDER = JVMCI.getRuntime().getHostJVMCIBackend().getConstantReflection().getMemoryAccessProvider(); diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderData.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderData.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderData.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderData.java @@ -23,6 +23,13 @@ package jdk.vm.ci.hotspot.test; +import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; +import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.MetaAccessProvider; +import jdk.vm.ci.meta.MethodHandleAccessProvider; +import jdk.vm.ci.runtime.JVMCI; +import org.testng.annotations.DataProvider; + import java.io.File; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; @@ -31,12 +38,6 @@ import java.net.URL; import java.net.URLClassLoader; import java.nio.file.Paths; -import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; -import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.MetaAccessProvider; -import jdk.vm.ci.meta.MethodHandleAccessProvider; -import jdk.vm.ci.runtime.JVMCI; -import org.testng.annotations.DataProvider; public class MethodHandleAccessProviderData implements TestInterface { private static final MetaAccessProvider META_ACCESS = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess(); diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java @@ -35,18 +35,19 @@ package jdk.vm.ci.hotspot.test; +import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; +import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.MetaAccessProvider; +import jdk.vm.ci.meta.MethodHandleAccessProvider; +import jdk.vm.ci.meta.MethodHandleAccessProvider.IntrinsicMethod; +import jdk.vm.ci.meta.ResolvedJavaMethod; +import jdk.vm.ci.runtime.JVMCI; +import org.testng.Assert; +import org.testng.annotations.Test; + import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.reflect.Method; -import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; -import jdk.vm.ci.meta.MethodHandleAccessProvider; -import jdk.vm.ci.meta.ResolvedJavaMethod; -import jdk.vm.ci.runtime.JVMCI; -import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.MetaAccessProvider; -import jdk.vm.ci.meta.MethodHandleAccessProvider.IntrinsicMethod; -import org.testng.annotations.Test; -import org.testng.Assert; public class MethodHandleAccessProviderTest { private static final HotSpotConstantReflectionProvider CONSTANT_REFLECTION = (HotSpotConstantReflectionProvider) JVMCI.getRuntime().getHostJVMCIBackend().getConstantReflection(); diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayElementDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayElementDataProvider.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayElementDataProvider.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayElementDataProvider.java @@ -23,18 +23,18 @@ package jdk.vm.ci.hotspot.test; +import jdk.vm.ci.meta.JavaConstant; +import org.testng.annotations.DataProvider; + +import java.util.LinkedList; +import java.util.stream.Stream; + import static jdk.vm.ci.hotspot.test.TestHelper.ARRAYS_MAP; import static jdk.vm.ci.hotspot.test.TestHelper.ARRAY_ARRAYS_MAP; import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE; import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FIELDS_MAP; -import java.util.LinkedList; -import java.util.stream.Stream; - -import jdk.vm.ci.meta.JavaConstant; -import org.testng.annotations.DataProvider; - public class ReadArrayElementDataProvider { @DataProvider(name = "readArrayElementDataProvider") diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayLengthDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayLengthDataProvider.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayLengthDataProvider.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadArrayLengthDataProvider.java @@ -23,13 +23,14 @@ package jdk.vm.ci.hotspot.test; -import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; -import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE; +import jdk.vm.ci.meta.JavaConstant; +import org.testng.annotations.DataProvider; import java.util.LinkedList; import java.util.List; -import jdk.vm.ci.meta.JavaConstant; -import org.testng.annotations.DataProvider; + +import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; +import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE; public class ReadArrayLengthDataProvider { diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadFieldValueDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadFieldValueDataProvider.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadFieldValueDataProvider.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadFieldValueDataProvider.java @@ -23,22 +23,23 @@ package jdk.vm.ci.hotspot.test; +import jdk.vm.ci.meta.JavaConstant; +import org.testng.annotations.DataProvider; + +import java.util.LinkedList; + import static jdk.vm.ci.hotspot.test.TestHelper.ARRAYS_MAP; import static jdk.vm.ci.hotspot.test.TestHelper.ARRAY_ARRAYS_MAP; import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_CONSTANT; import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE; +import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FIELDS_MAP; +import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_STABLE_FIELDS_MAP; import static jdk.vm.ci.hotspot.test.TestHelper.STABLE_ARRAYS_MAP; import static jdk.vm.ci.hotspot.test.TestHelper.STABLE_ARRAY_ARRAYS_MAP; -import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_STABLE_FIELDS_MAP; -import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FIELDS_MAP; import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_FIELDS_MAP; import static jdk.vm.ci.hotspot.test.TestHelper.STATIC_STABLE_FIELDS_MAP; -import java.util.LinkedList; -import jdk.vm.ci.meta.JavaConstant; -import org.testng.annotations.DataProvider; - public class ReadFieldValueDataProvider { @DataProvider(name = "readFieldValueDataProvider") diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHelper.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHelper.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHelper.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestHelper.java @@ -23,15 +23,16 @@ package jdk.vm.ci.hotspot.test; -import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.Map; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.runtime.JVMCI; +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; + public class TestHelper { public static final DummyClass DUMMY_CLASS_INSTANCE = new DummyClass(); diff --git a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/UnboxPrimitiveDataProvider.java b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/UnboxPrimitiveDataProvider.java --- a/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/UnboxPrimitiveDataProvider.java +++ b/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/UnboxPrimitiveDataProvider.java @@ -23,13 +23,13 @@ package jdk.vm.ci.hotspot.test; -import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; -import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE; +import jdk.vm.ci.meta.JavaConstant; +import org.testng.annotations.DataProvider; import java.util.LinkedList; -import jdk.vm.ci.meta.JavaConstant; -import org.testng.annotations.DataProvider; +import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER; +import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE; public class UnboxPrimitiveDataProvider { diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java @@ -33,11 +33,10 @@ */ package jdk.vm.ci.runtime.test; +import jdk.vm.ci.meta.JavaConstant; import org.junit.Assert; import org.junit.Test; -import jdk.vm.ci.meta.JavaConstant; - public class ConstantTest extends FieldUniverse { @Test diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/FieldUniverse.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/FieldUniverse.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/FieldUniverse.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/FieldUniverse.java @@ -22,12 +22,12 @@ */ package jdk.vm.ci.runtime.test; +import jdk.vm.ci.meta.ResolvedJavaField; + import java.lang.reflect.Field; import java.util.HashMap; import java.util.Map; -import jdk.vm.ci.meta.ResolvedJavaField; - /** * Context for field related tests. */ diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/MethodUniverse.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/MethodUniverse.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/MethodUniverse.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/MethodUniverse.java @@ -22,13 +22,13 @@ */ package jdk.vm.ci.runtime.test; +import jdk.vm.ci.meta.ResolvedJavaMethod; + import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; -import jdk.vm.ci.meta.ResolvedJavaMethod; - /** * Context for method related tests. */ diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/NameAndSignature.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/NameAndSignature.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/NameAndSignature.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/NameAndSignature.java @@ -22,15 +22,15 @@ */ package jdk.vm.ci.runtime.test; -import java.lang.reflect.Method; -import java.util.Arrays; - import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Signature; import jdk.vm.ci.runtime.JVMCI; +import java.lang.reflect.Method; +import java.util.Arrays; + class NameAndSignature { public static final MetaAccessProvider metaAccess = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess(); diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java @@ -34,8 +34,11 @@ package jdk.vm.ci.runtime.test; -import static org.junit.Assume.assumeTrue; +import jdk.vm.ci.meta.ResolvedJavaMethod; +import org.junit.Assert; +import org.junit.Test; +import javax.tools.ToolProvider; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -53,12 +56,7 @@ import java.util.jar.JarOutputStream; import java.util.jar.Manifest; -import javax.tools.ToolProvider; - -import jdk.vm.ci.meta.ResolvedJavaMethod; - -import org.junit.Assert; -import org.junit.Test; +import static org.junit.Assume.assumeTrue; /** * Tests that {@link ResolvedJavaMethod}s are safe in the context of class redefinition being used diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java @@ -31,14 +31,14 @@ package jdk.vm.ci.runtime.test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.runtime.JVMCI; +import org.junit.Test; -import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; public class ResolvedJavaTypeResolveConcreteMethodTest { public final MetaAccessProvider metaAccess; diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java @@ -31,14 +31,14 @@ package jdk.vm.ci.runtime.test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.runtime.JVMCI; +import org.junit.Test; -import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; public class ResolvedJavaTypeResolveMethodTest { public final MetaAccessProvider metaAccess; diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java @@ -34,21 +34,20 @@ package jdk.vm.ci.runtime.test; +import jdk.vm.ci.meta.ConstantReflectionProvider; +import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.JavaKind; +import org.junit.Test; + +import java.lang.reflect.Array; +import java.util.List; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import java.lang.reflect.Array; -import java.util.List; - -import jdk.vm.ci.meta.ConstantReflectionProvider; -import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.JavaKind; - -import org.junit.Test; - /** * Tests for {@link ConstantReflectionProvider}. It assumes an implementation of the interface that * actually returns non-null results for access operations that are possible, i.e., the tests will diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java @@ -34,19 +34,18 @@ package jdk.vm.ci.runtime.test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.lang.reflect.Field; -import java.util.Map; - import jdk.vm.ci.meta.JavaField; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaType; +import org.junit.Test; -import org.junit.Test; +import java.lang.reflect.Field; +import java.util.Map; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * Tests for {@link JavaField}. diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java @@ -34,17 +34,16 @@ package jdk.vm.ci.runtime.test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import jdk.vm.ci.meta.JavaMethod; +import jdk.vm.ci.meta.ResolvedJavaMethod; +import jdk.vm.ci.meta.ResolvedJavaType; +import org.junit.Test; import java.lang.reflect.Method; import java.util.Map; -import jdk.vm.ci.meta.JavaMethod; -import jdk.vm.ci.meta.ResolvedJavaMethod; -import jdk.vm.ci.meta.ResolvedJavaType; - -import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * Tests for {@link JavaMethod}. diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java @@ -34,11 +34,11 @@ package jdk.vm.ci.runtime.test; -import static org.junit.Assert.assertEquals; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaType; +import org.junit.Test; -import org.junit.Test; +import static org.junit.Assert.assertEquals; /** * Tests for {@link JavaType}. diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java @@ -34,17 +34,8 @@ package jdk.vm.ci.runtime.test; -import static jdk.vm.ci.meta.MetaUtil.toInternalName; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; - import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; @@ -52,8 +43,16 @@ import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Signature; +import org.junit.Test; -import org.junit.Test; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +import static jdk.vm.ci.meta.MetaUtil.toInternalName; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; /** * Tests for {@link MetaAccessProvider}. diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java @@ -34,10 +34,9 @@ package jdk.vm.ci.runtime.test; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import jdk.vm.ci.meta.ResolvedJavaField; +import jdk.vm.ci.meta.ResolvedJavaMethod; +import org.junit.Test; import java.lang.annotation.Annotation; import java.lang.reflect.Field; @@ -47,10 +46,10 @@ import java.util.Map; import java.util.Set; -import jdk.vm.ci.meta.ResolvedJavaField; -import jdk.vm.ci.meta.ResolvedJavaMethod; - -import org.junit.Test; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * Tests for {@link ResolvedJavaField}. diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java @@ -34,10 +34,12 @@ package jdk.vm.ci.runtime.test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import jdk.vm.ci.meta.ConstantPool; +import jdk.vm.ci.meta.ExceptionHandler; +import jdk.vm.ci.meta.ResolvedJavaMethod; +import jdk.vm.ci.meta.ResolvedJavaType; +import org.junit.Assert; +import org.junit.Test; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; @@ -56,13 +58,10 @@ import java.util.Map; import java.util.Set; -import jdk.vm.ci.meta.ConstantPool; -import jdk.vm.ci.meta.ExceptionHandler; -import jdk.vm.ci.meta.ResolvedJavaMethod; -import jdk.vm.ci.meta.ResolvedJavaType; - -import org.junit.Assert; -import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * Tests for {@link ResolvedJavaMethod}. diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java @@ -36,6 +36,28 @@ package jdk.vm.ci.runtime.test; +import jdk.internal.reflect.ConstantPool; +import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.meta.Assumptions.AssumptionResult; +import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.meta.ModifiersProvider; +import jdk.vm.ci.meta.ResolvedJavaField; +import jdk.vm.ci.meta.ResolvedJavaMethod; +import jdk.vm.ci.meta.ResolvedJavaType; +import org.junit.Test; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + import static java.lang.reflect.Modifier.isAbstract; import static java.lang.reflect.Modifier.isFinal; import static java.lang.reflect.Modifier.isPrivate; @@ -49,30 +71,6 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import java.lang.annotation.Annotation; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import jdk.vm.ci.common.JVMCIError; -import jdk.vm.ci.meta.Assumptions.AssumptionResult; -import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.JavaKind; -import jdk.vm.ci.meta.ModifiersProvider; -import jdk.vm.ci.meta.ResolvedJavaField; -import jdk.vm.ci.meta.ResolvedJavaMethod; -import jdk.vm.ci.meta.ResolvedJavaType; - -import org.junit.Test; - -import jdk.internal.reflect.ConstantPool; - /** * Tests for {@link ResolvedJavaType}. */ diff --git a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java --- a/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java +++ b/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java @@ -22,8 +22,14 @@ */ package jdk.vm.ci.runtime.test; -import static java.lang.reflect.Modifier.isFinal; -import static java.lang.reflect.Modifier.isStatic; +import jdk.internal.misc.Unsafe; +import jdk.vm.ci.meta.ConstantReflectionProvider; +import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.MetaAccessProvider; +import jdk.vm.ci.meta.ResolvedJavaField; +import jdk.vm.ci.meta.ResolvedJavaType; +import jdk.vm.ci.runtime.JVMCI; +import org.junit.Test; import java.io.Serializable; import java.lang.reflect.Array; @@ -47,16 +53,8 @@ import java.util.TreeMap; import java.util.stream.Collectors; -import jdk.vm.ci.meta.ConstantReflectionProvider; -import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.MetaAccessProvider; -import jdk.vm.ci.meta.ResolvedJavaField; -import jdk.vm.ci.meta.ResolvedJavaType; -import jdk.vm.ci.runtime.JVMCI; - -import org.junit.Test; - -import jdk.internal.misc.Unsafe; +import static java.lang.reflect.Modifier.isFinal; +import static java.lang.reflect.Modifier.isStatic; /** * Context for type related tests. diff --git a/test/compiler/jvmci/meta/StableFieldTest.java b/test/compiler/jvmci/meta/StableFieldTest.java --- a/test/compiler/jvmci/meta/StableFieldTest.java +++ b/test/compiler/jvmci/meta/StableFieldTest.java @@ -38,11 +38,9 @@ package compiler.jvmci.meta; -import java.lang.reflect.Field; import jdk.internal.vm.annotation.Stable; import jdk.vm.ci.hotspot.HotSpotResolvedJavaField; import jdk.vm.ci.meta.MetaAccessProvider; -import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.runtime.JVMCI; public class StableFieldTest { diff --git a/test/compiler/linkage/CallSites.jasm b/test/compiler/linkage/CallSites.jasm --- a/test/compiler/linkage/CallSites.jasm +++ b/test/compiler/linkage/CallSites.jasm @@ -21,34 +21,34 @@ * questions. * */ -super class I +super class compiler/linkage/I version 52:0 { } -super class CallSites +super class compiler/linkage/CallSites version 52:0 { // Non-existent methods. // I.m1()V vs I.m1(I)V - public static Method testI1:"(LI;)V" + public static Method testI1:"(Lcompiler/linkage/I;)V" stack 1 locals 1 { aload_0; - invokeinterface InterfaceMethod I."m1":"()V", 1; // throws NSME + invokeinterface InterfaceMethod compiler/linkage/I."m1":"()V", 1; // throws NSME return; } // X.m1()V vs X.m1(I)V - public static Method testX1:"(LX;)V" + public static Method testX1:"(Lcompiler/linkage/X;)V" stack 1 locals 1 { aload_0; - invokevirtual Method X."m1":"()V"; // throws NSME + invokevirtual Method compiler/linkage/X."m1":"()V"; // throws NSME return; } @@ -58,7 +58,7 @@ stack 1 locals 0 { iconst_0; - invokestatic InterfaceMethod I."m1":"(I)V"; // throws ICCE + invokestatic InterfaceMethod compiler/linkage/I."m1":"(I)V"; // throws ICCE return; } @@ -66,25 +66,25 @@ stack 1 locals 0 { iconst_0; - invokestatic Method X."m1":"(I)V"; // throws ICCE + invokestatic Method compiler/linkage/X."m1":"(I)V"; // throws ICCE return; } // Virtual invocation of static methods. - public static Method testI3:"(LI;)V" + public static Method testI3:"(Lcompiler/linkage/I;)V" stack 1 locals 1 { aload_0; - invokeinterface InterfaceMethod I."s1":"()V", 1; // throws ICCE + invokeinterface InterfaceMethod compiler/linkage/I."s1":"()V", 1; // throws ICCE return; } - public static Method testX3:"(LX;)V" + public static Method testX3:"(Lcompiler/linkage/X;)V" stack 1 locals 1 { aload_0; - invokevirtual Method X."s1":"()V"; // throws ICCE + invokevirtual Method compiler/linkage/X."s1":"()V"; // throws ICCE return; } diff --git a/test/compiler/linkage/LinkageErrors.java b/test/compiler/linkage/LinkageErrors.java --- a/test/compiler/linkage/LinkageErrors.java +++ b/test/compiler/linkage/LinkageErrors.java @@ -25,10 +25,16 @@ * @test * @bug 8132879 * @compile CallSites.jasm - * @run main/othervm -Xverify:all -Xbatch -XX:CompileCommand=dontinline,Test::test* LinkageErrors + * @run main/othervm -Xverify:all -Xbatch + * -XX:CompileCommand=dontinline,compiler.linkage.LinkageErrors::test* + * compiler.linkage.LinkageErrors */ -import java.lang.invoke.*; +package compiler.linkage; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; interface I { void m1(int i); @@ -62,7 +68,7 @@ } public static void main(String args[]) throws Throwable { - Class test = Class.forName("CallSites"); + Class test = Class.forName("compiler.linkage.CallSites"); // Non-existent method lookups. MethodHandle testI1 = L.findStatic(test, "testI1", MethodType.methodType(void.class, I.class)); diff --git a/test/compiler/loopopts/BadPredicateAfterPartialPeel.java b/test/compiler/loopopts/BadPredicateAfterPartialPeel.java --- a/test/compiler/loopopts/BadPredicateAfterPartialPeel.java +++ b/test/compiler/loopopts/BadPredicateAfterPartialPeel.java @@ -26,10 +26,16 @@ * @test * @bug 8146792 * @summary Predicate moved after partial peel may lead to broken graph - * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileOnly=BadPredicateAfterPartialPeel::m -XX:CompileCommand=dontinline,BadPredicateAfterPartialPeel::not_inlined* -XX:CompileCommand=quiet BadPredicateAfterPartialPeel - * + * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation + * -XX:-UseOnStackReplacement + * -XX:CompileCommand=compileonly,compiler.loopopts.BadPredicateAfterPartialPeel::m + * -XX:CompileCommand=dontinline,compiler.loopopts.BadPredicateAfterPartialPeel::not_inlined* + * -XX:CompileCommand=quiet + * compiler.loopopts.BadPredicateAfterPartialPeel */ +package compiler.loopopts; + public class BadPredicateAfterPartialPeel { static void not_inlined1() {} diff --git a/test/compiler/loopopts/ConstFPVectorization.java b/test/compiler/loopopts/ConstFPVectorization.java --- a/test/compiler/loopopts/ConstFPVectorization.java +++ b/test/compiler/loopopts/ConstFPVectorization.java @@ -26,11 +26,12 @@ * @test * @bug 8074869 * @summary C2 code generator can replace -0.0f with +0.0f on Linux - * @run main ConstFPVectorization 8 + * @run main compiler.loopopts.ConstFPVectorization 8 * @author volker.simonis@gmail.com - * */ +package compiler.loopopts; + public class ConstFPVectorization { static float[] f = new float[16]; diff --git a/test/compiler/loopopts/CountedLoopProblem.java b/test/compiler/loopopts/CountedLoopProblem.java --- a/test/compiler/loopopts/CountedLoopProblem.java +++ b/test/compiler/loopopts/CountedLoopProblem.java @@ -26,11 +26,13 @@ * @test * @bug 8072753 * @summary Inner loop induction variable increment occurs before compare which causes integer overflow - * @run main/othervm CountedLoopProblem + * @run main/othervm compiler.loopopts.CountedLoopProblem * */ -import java.util.*; +package compiler.loopopts; + +import java.util.Random; public class CountedLoopProblem { public static void main(String[] args) throws Exception { diff --git a/test/compiler/loopopts/6659207/Test.java b/test/compiler/loopopts/Test6659207.java rename from test/compiler/loopopts/6659207/Test.java rename to test/compiler/loopopts/Test6659207.java --- a/test/compiler/loopopts/6659207/Test.java +++ b/test/compiler/loopopts/Test6659207.java @@ -26,9 +26,13 @@ * @test * @bug 6659207 * @summary access violation in CompilerThread0 + * + * @run main compiler.loopopts.Test6659207 */ -public class Test { +package compiler.loopopts; + +public class Test6659207 { static int[] array = new int[12]; static int index(int i) { diff --git a/test/compiler/loopopts/6855164/Test.java b/test/compiler/loopopts/Test6855164.java rename from test/compiler/loopopts/6855164/Test.java rename to test/compiler/loopopts/Test6855164.java --- a/test/compiler/loopopts/6855164/Test.java +++ b/test/compiler/loopopts/Test6855164.java @@ -25,10 +25,13 @@ * @test * @bug 6855164 * @summary SIGSEGV during compilation of method involving loop over CharSequence - * @run main/othervm -Xbatch Test + * + * @run main/othervm -Xbatch compiler.loopopts.Test6855164 */ -public class Test{ +package compiler.loopopts; + +public class Test6855164 { public static void main(String[] args) throws Exception { StringBuffer builder = new StringBuffer(); diff --git a/test/compiler/loopopts/6860469/Test.java b/test/compiler/loopopts/Test6860469.java rename from test/compiler/loopopts/6860469/Test.java rename to test/compiler/loopopts/Test6860469.java --- a/test/compiler/loopopts/6860469/Test.java +++ b/test/compiler/loopopts/Test6860469.java @@ -27,45 +27,49 @@ * @bug 6860469 * @summary remix_address_expressions reshapes address expression with bad control * - * @run main/othervm -Xcomp -XX:CompileOnly=Test.C Test + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.loopopt.Test6860469::C + * compiler.loopopts.Test6860469 */ -public class Test { +package compiler.loopopts; - private static final int H = 16; - private static final int F = 9; +public class Test6860469 { - static int[] fl = new int[1 << F]; + private static final int H = 16; + private static final int F = 9; - static int C(int ll, int f) { - int max = -1; - int min = H + 1; + static int[] fl = new int[1 << F]; - if (ll != 0) { - if (ll < min) { - min = ll; - } - if (ll > max) { - max = ll; - } + static int C(int ll, int f) { + int max = -1; + int min = H + 1; + + if (ll != 0) { + if (ll < min) { + min = ll; + } + if (ll > max) { + max = ll; + } + } + + if (f > max) { + f = max; + } + if (min > f) { + min = f; + } + + for (int mc = 1 >> max - f; mc <= 0; mc++) { + int i = mc << (32 - f); + fl[i] = max; + } + + return min; } - if (f > max) { - f = max; + public static void main(String argv[]) { + C(0, 10); } - if (min > f) { - min = f; - } - - for (int mc = 1 >> max - f; mc <= 0; mc++) { - int i = mc << (32 - f); - fl[i] = max; - } - - return min; - } - - public static void main(String argv[]) { - C(0, 10); - } } diff --git a/test/compiler/loopopts/7044738/Test7044738.java b/test/compiler/loopopts/Test7044738.java rename from test/compiler/loopopts/7044738/Test7044738.java rename to test/compiler/loopopts/Test7044738.java --- a/test/compiler/loopopts/7044738/Test7044738.java +++ b/test/compiler/loopopts/Test7044738.java @@ -27,78 +27,81 @@ * @bug 7044738 * @summary Loop unroll optimization causes incorrect result * - * @run main/othervm -Xbatch Test7044738 + * @run main/othervm -Xbatch compiler.loopopts.Test7044738 */ +package compiler.loopopts; + public class Test7044738 { - private static final int INITSIZE = 10000; - public int d[] = { 1, 2, 3, 4 }; - public int i, size; + private static final int INITSIZE = 10000; + public int d[] = {1, 2, 3, 4}; + public int i, size; - private static int iter = 5; + private static int iter = 5; - boolean done() { return (--iter > 0); } + boolean done() { + return (--iter > 0); + } - public static void main(String args[]) { - Test7044738 t = new Test7044738(); - t.test(); - } + public static void main(String args[]) { + Test7044738 t = new Test7044738(); + t.test(); + } - int test() { + int test() { - while (done()) { - size = INITSIZE; + while (done()) { + size = INITSIZE; - for (i = 0; i < size; i++) { - d[0] = d[1]; // 2 - d[1] = d[2]; // 3 - d[2] = d[3]; // 4 - d[3] = d[0]; // 2 + for (i = 0; i < size; i++) { + d[0] = d[1]; // 2 + d[1] = d[2]; // 3 + d[2] = d[3]; // 4 + d[3] = d[0]; // 2 - d[0] = d[1]; // 3 - d[1] = d[2]; // 4 - d[2] = d[3]; // 2 - d[3] = d[0]; // 3 + d[0] = d[1]; // 3 + d[1] = d[2]; // 4 + d[2] = d[3]; // 2 + d[3] = d[0]; // 3 - d[0] = d[1]; // 4 - d[1] = d[2]; // 2 - d[2] = d[3]; // 3 - d[3] = d[0]; // 4 + d[0] = d[1]; // 4 + d[1] = d[2]; // 2 + d[2] = d[3]; // 3 + d[3] = d[0]; // 4 - d[0] = d[1]; // 2 - d[1] = d[2]; // 3 - d[2] = d[3]; // 4 - d[3] = d[0]; // 2 + d[0] = d[1]; // 2 + d[1] = d[2]; // 3 + d[2] = d[3]; // 4 + d[3] = d[0]; // 2 - d[0] = d[1]; // 3 - d[1] = d[2]; // 4 - d[2] = d[3]; // 2 - d[3] = d[0]; // 3 + d[0] = d[1]; // 3 + d[1] = d[2]; // 4 + d[2] = d[3]; // 2 + d[3] = d[0]; // 3 - d[0] = d[1]; // 4 - d[1] = d[2]; // 2 - d[2] = d[3]; // 3 - d[3] = d[0]; // 4 + d[0] = d[1]; // 4 + d[1] = d[2]; // 2 + d[2] = d[3]; // 3 + d[3] = d[0]; // 4 - d[0] = d[1]; // 2 - d[1] = d[2]; // 3 - d[2] = d[3]; // 4 - d[3] = d[0]; // 2 + d[0] = d[1]; // 2 + d[1] = d[2]; // 3 + d[2] = d[3]; // 4 + d[3] = d[0]; // 2 - d[0] = d[1]; // 3 - d[1] = d[2]; // 4 - d[2] = d[3]; // 2 - d[3] = d[0]; // 3 - } + d[0] = d[1]; // 3 + d[1] = d[2]; // 4 + d[2] = d[3]; // 2 + d[3] = d[0]; // 3 + } - // try to defeat dead code elimination - if (d[0] == d[1]) { - System.out.println("test failed: iter=" + iter + " i=" + i + " d[] = { " + d[0] + ", " + d[1] + ", " + d[2] + ", " + d[3] + " } "); - System.exit(97); - } + // try to defeat dead code elimination + if (d[0] == d[1]) { + System.out.println("test failed: iter=" + iter + " i=" + i + " d[] = { " + d[0] + ", " + d[1] + ", " + d[2] + ", " + d[3] + " } "); + System.exit(97); + } + } + return d[3]; } - return d[3]; - } - } diff --git a/test/compiler/loopopts/7052494/Test7052494.java b/test/compiler/loopopts/Test7052494.java rename from test/compiler/loopopts/7052494/Test7052494.java rename to test/compiler/loopopts/Test7052494.java --- a/test/compiler/loopopts/7052494/Test7052494.java +++ b/test/compiler/loopopts/Test7052494.java @@ -27,149 +27,151 @@ * @bug 7052494 * @summary Eclipse test fails on JDK 7 b142 * - * @run main/othervm -Xbatch Test7052494 + * @run main/othervm -Xbatch compiler.loopopts.Test7052494 */ +package compiler.loopopts; public class Test7052494 { - static int test1(int i, int limit) { - int result = 0; - while (i++ != 0) { - if (result >= limit) - break; - result = i*2; + static int test1(int i, int limit) { + int result = 0; + while (i++ != 0) { + if (result >= limit) + break; + result = i * 2; + } + return result; } - return result; - } - static int test2(int i, int limit) { - int result = 0; - while (i-- != 0) { - if (result <= limit) - break; - result = i*2; + static int test2(int i, int limit) { + int result = 0; + while (i-- != 0) { + if (result <= limit) + break; + result = i * 2; + } + return result; } - return result; - } - static void test3(int i, int limit, int arr[]) { - while (i++ != 0) { - if (arr[i-1] >= limit) - break; - arr[i] = i*2; + static void test3(int i, int limit, int arr[]) { + while (i++ != 0) { + if (arr[i - 1] >= limit) + break; + arr[i] = i * 2; + } } - } - static void test4(int i, int limit, int arr[]) { - while (i-- != 0) { - if (arr[arr.length + i + 1] <= limit) - break; - arr[arr.length + i] = i*2; + static void test4(int i, int limit, int arr[]) { + while (i-- != 0) { + if (arr[arr.length + i + 1] <= limit) + break; + arr[arr.length + i] = i * 2; + } } - } - // Empty loop rolls through MAXINT if i > 0 + // Empty loop rolls through MAXINT if i > 0 - static final int limit5 = Integer.MIN_VALUE + 10000; + static final int limit5 = Integer.MIN_VALUE + 10000; - static int test5(int i) { - int result = 0; - while (i++ != limit5) { - result = i*2; + static int test5(int i) { + int result = 0; + while (i++ != limit5) { + result = i * 2; + } + return result; } - return result; - } - // Empty loop rolls through MININT if i < 0 + // Empty loop rolls through MININT if i < 0 - static final int limit6 = Integer.MAX_VALUE - 10000; + static final int limit6 = Integer.MAX_VALUE - 10000; - static int test6(int i) { - int result = 0; - while (i-- != limit6) { - result = i*2; + static int test6(int i) { + int result = 0; + while (i-- != limit6) { + result = i * 2; + } + return result; } - return result; - } - public static void main(String [] args) { - boolean failed = false; - int[] arr = new int[8]; - int[] ar3 = { 0, 0, 4, 6, 8, 10, 0, 0 }; - int[] ar4 = { 0, 0, 0, -10, -8, -6, -4, 0 }; - System.out.println("test1"); - for (int i = 0; i < 11000; i++) { - int k = test1(1, 10); - if (k != 10) { - System.out.println("FAILED: " + k + " != 10"); - failed = true; - break; - } + public static void main(String[] args) { + boolean failed = false; + int[] arr = new int[8]; + int[] ar3 = {0, 0, 4, 6, 8, 10, 0, 0}; + int[] ar4 = {0, 0, 0, -10, -8, -6, -4, 0}; + System.out.println("test1"); + for (int i = 0; i < 11000; i++) { + int k = test1(1, 10); + if (k != 10) { + System.out.println("FAILED: " + k + " != 10"); + failed = true; + break; + } + } + System.out.println("test2"); + for (int i = 0; i < 11000; i++) { + int k = test2(-1, -10); + if (k != -10) { + System.out.println("FAILED: " + k + " != -10"); + failed = true; + break; + } + } + System.out.println("test3"); + for (int i = 0; i < 11000; i++) { + java.util.Arrays.fill(arr, 0); + test3(1, 10, arr); + if (!java.util.Arrays.equals(arr, ar3)) { + System.out.println("FAILED: arr = { " + arr[0] + ", " + + arr[1] + ", " + + arr[2] + ", " + + arr[3] + ", " + + arr[4] + ", " + + arr[5] + ", " + + arr[6] + ", " + + arr[7] + " }"); + failed = true; + break; + } + } + System.out.println("test4"); + for (int i = 0; i < 11000; i++) { + java.util.Arrays.fill(arr, 0); + test4(-1, -10, arr); + if (!java.util.Arrays.equals(arr, ar4)) { + System.out.println("FAILED: arr = { " + arr[0] + ", " + + arr[1] + ", " + + arr[2] + ", " + + arr[3] + ", " + + arr[4] + ", " + + arr[5] + ", " + + arr[6] + ", " + + arr[7] + " }"); + failed = true; + break; + } + } + System.out.println("test5"); + for (int i = 0; i < 11000; i++) { + int k = test5(limit6); + if (k != limit5 * 2) { + System.out.println("FAILED: " + k + " != " + limit5 * 2); + failed = true; + break; + } + } + System.out.println("test6"); + for (int i = 0; i < 11000; i++) { + int k = test6(limit5); + if (k != limit6 * 2) { + System.out.println("FAILED: " + k + " != " + limit6 * 2); + failed = true; + break; + } + } + System.out.println("finish"); + if (failed) { + System.exit(97); + } } - System.out.println("test2"); - for (int i = 0; i < 11000; i++) { - int k = test2(-1, -10); - if (k != -10) { - System.out.println("FAILED: " + k + " != -10"); - failed = true; - break; - } - } - System.out.println("test3"); - for (int i = 0; i < 11000; i++) { - java.util.Arrays.fill(arr, 0); - test3(1, 10, arr); - if (!java.util.Arrays.equals(arr,ar3)) { - System.out.println("FAILED: arr = { " + arr[0] + ", " - + arr[1] + ", " - + arr[2] + ", " - + arr[3] + ", " - + arr[4] + ", " - + arr[5] + ", " - + arr[6] + ", " - + arr[7] + " }"); - failed = true; - break; - } - } - System.out.println("test4"); - for (int i = 0; i < 11000; i++) { - java.util.Arrays.fill(arr, 0); - test4(-1, -10, arr); - if (!java.util.Arrays.equals(arr,ar4)) { - System.out.println("FAILED: arr = { " + arr[0] + ", " - + arr[1] + ", " - + arr[2] + ", " - + arr[3] + ", " - + arr[4] + ", " - + arr[5] + ", " - + arr[6] + ", " - + arr[7] + " }"); - failed = true; - break; - } - } - System.out.println("test5"); - for (int i = 0; i < 11000; i++) { - int k = test5(limit6); - if (k != limit5*2) { - System.out.println("FAILED: " + k + " != " + limit5*2); - failed = true; - break; - } - } - System.out.println("test6"); - for (int i = 0; i < 11000; i++) { - int k = test6(limit5); - if (k != limit6*2) { - System.out.println("FAILED: " + k + " != " + limit6*2); - failed = true; - break; - } - } - System.out.println("finish"); - if (failed) - System.exit(97); - } } diff --git a/test/compiler/loopopts/TestArraysFillDeadControl.java b/test/compiler/loopopts/TestArraysFillDeadControl.java --- a/test/compiler/loopopts/TestArraysFillDeadControl.java +++ b/test/compiler/loopopts/TestArraysFillDeadControl.java @@ -26,10 +26,14 @@ * @test * @bug 8147645 * @summary Array.fill intrinsification code doesn't mark replaced control as dead - * @run main/othervm -XX:-TieredCompilation -XX:CompileCommand=dontinline,TestArraysFillDeadControl::dont_inline TestArraysFillDeadControl * + * @run main/othervm -XX:-TieredCompilation + * -XX:CompileCommand=dontinline,compiler.loopopts.TestArraysFillDeadControl::dont_inline + * compiler.loopopts.TestArraysFillDeadControl */ +package compiler.loopopts; + import java.util.Arrays; public class TestArraysFillDeadControl { diff --git a/test/compiler/loopopts/TestCastIINoLoopLimitCheck.java b/test/compiler/loopopts/TestCastIINoLoopLimitCheck.java --- a/test/compiler/loopopts/TestCastIINoLoopLimitCheck.java +++ b/test/compiler/loopopts/TestCastIINoLoopLimitCheck.java @@ -26,10 +26,13 @@ * @test * @bug 8073184 * @summary CastII that guards counted loops confuses range check elimination with LoopLimitCheck off - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileOnly=TestCastIINoLoopLimitCheck.m -Xcomp TestCastIINoLoopLimitCheck * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp + * -XX:CompileCommand=compileonly,compiler.loopopt.TestCastIINoLoopLimitCheck::m + * compiler.loopopts.TestCastIINoLoopLimitCheck */ +package compiler.loopopts; /* * The test was originally run with * diff --git a/test/compiler/loopopts/TestDeadBackbranchArrayAccess.java b/test/compiler/loopopts/TestDeadBackbranchArrayAccess.java --- a/test/compiler/loopopts/TestDeadBackbranchArrayAccess.java +++ b/test/compiler/loopopts/TestDeadBackbranchArrayAccess.java @@ -26,10 +26,14 @@ * @test * @bug 8054478 * @summary dead backbranch in main loop results in erroneous array access - * @run main/othervm -XX:CompileOnly=TestDeadBackbranchArrayAccess -Xcomp TestDeadBackbranchArrayAccess * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.loopopts.TestDeadBackbranchArrayAccess::* + * compiler.loopopts.TestDeadBackbranchArrayAccess */ +package compiler.loopopts; + public class TestDeadBackbranchArrayAccess { static char[] pattern0 = {0}; static char[] pattern1 = {1}; diff --git a/test/compiler/loopopts/TestLogSum.java b/test/compiler/loopopts/TestLogSum.java --- a/test/compiler/loopopts/TestLogSum.java +++ b/test/compiler/loopopts/TestLogSum.java @@ -25,14 +25,18 @@ * @test * @bug 8046516 * @summary Segmentation fault in JVM (easily reproducible) - * @run main/othervm -XX:-TieredCompilation -Xbatch TestLogSum + * + * @run main/othervm -XX:-TieredCompilation -Xbatch compiler.loopopts.TestLogSum * @author jackkamm@gmail.com */ +package compiler.loopopts; + import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; + public class TestLogSum { public static void main(String[] args) { double sum; diff --git a/test/compiler/loopopts/TestLoopPeeling.java b/test/compiler/loopopts/TestLoopPeeling.java --- a/test/compiler/loopopts/TestLoopPeeling.java +++ b/test/compiler/loopopts/TestLoopPeeling.java @@ -25,8 +25,14 @@ * @test * @bug 8078262 * @summary Tests correct dominator information after loop peeling. - * @run main/othervm -Xcomp -XX:CompileCommand=compileonly,TestLoopPeeling::test* TestLoopPeeling + * + * @run main/othervm -Xcomp + * -XX:CompileCommand=compileonly,compiler.loopopts.TestLoopPeeling::test* + * compiler.loopopts.TestLoopPeeling */ + +package compiler.loopopts; + public class TestLoopPeeling { public int[] array = new int[100]; diff --git a/test/compiler/loopopts/TestMoveStoresOutOfLoops.java b/test/compiler/loopopts/TestMoveStoresOutOfLoops.java --- a/test/compiler/loopopts/TestMoveStoresOutOfLoops.java +++ b/test/compiler/loopopts/TestMoveStoresOutOfLoops.java @@ -26,13 +26,18 @@ * @test * @bug 8080289 * @summary Move stores out of loops if possible - * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestMoveStoresOutOfLoops::test* TestMoveStoresOutOfLoops * + * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * -XX:CompileCommand=dontinline,compiler.loopopts.TestMoveStoresOutOfLoops::test* + * compiler.loopopts.TestMoveStoresOutOfLoops */ -import java.lang.reflect.*; -import java.util.*; -import java.util.function.*; +package compiler.loopopts; + +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.HashMap; +import java.util.function.Function; public class TestMoveStoresOutOfLoops { diff --git a/test/compiler/loopopts/TestMoveStoresOutOfLoopsStoreNoCtrl.java b/test/compiler/loopopts/TestMoveStoresOutOfLoopsStoreNoCtrl.java --- a/test/compiler/loopopts/TestMoveStoresOutOfLoopsStoreNoCtrl.java +++ b/test/compiler/loopopts/TestMoveStoresOutOfLoopsStoreNoCtrl.java @@ -25,10 +25,14 @@ * @test * @bug 8134288 * @summary Store nodes may not have a control if used to update profiling - * @run main/othervm -XX:-ProfileInterpreter -XX:-TieredCompilation -XX:-BackgroundCompilation TestMoveStoresOutOfLoopsStoreNoCtrl * + * @run main/othervm -XX:-ProfileInterpreter -XX:-TieredCompilation + * -XX:-BackgroundCompilation + * compiler.loopopts.TestMoveStoresOutOfLoopsStoreNoCtrl */ +package compiler.loopopts; + public class TestMoveStoresOutOfLoopsStoreNoCtrl { static void test(boolean flag) { diff --git a/test/compiler/loopopts/TestOverunrolling.java b/test/compiler/loopopts/TestOverunrolling.java --- a/test/compiler/loopopts/TestOverunrolling.java +++ b/test/compiler/loopopts/TestOverunrolling.java @@ -24,11 +24,16 @@ /* * @test * @bug 8159016 + * @summary Tests correct dominator information after over-unrolling a loop. * @requires vm.gc == "Parallel" | vm.gc == "null" - * @summary Tests correct dominator information after over-unrolling a loop. + * * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-TieredCompilation - * -XX:-UseG1GC -XX:+UseParallelGC TestOverunrolling + * -XX:-UseG1GC -XX:+UseParallelGC + * compiler.loopopts.TestOverunrolling */ + +package compiler.loopopts; + public class TestOverunrolling { public static Object test(int arg) { diff --git a/test/compiler/loopopts/TestPredicateLostDependency.java b/test/compiler/loopopts/TestPredicateLostDependency.java --- a/test/compiler/loopopts/TestPredicateLostDependency.java +++ b/test/compiler/loopopts/TestPredicateLostDependency.java @@ -26,10 +26,15 @@ * @test * @bug 8069191 * @summary predicate moved out of loops and CastPP removal causes dependency to be lost - * @run main/othervm -Xcomp -XX:CompileOnly=TestPredicateLostDependency.m1 -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM TestPredicateLostDependency + * + * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM + * -XX:CompileCommand=compileonly,compiler.loopopts.TestPredicateLostDependency::m1 + * compiler.loopopts.TestPredicateLostDependency * */ +package compiler.loopopts; + public class TestPredicateLostDependency { static class A { int i; diff --git a/test/compiler/loopopts/TestSplitIfBlocksDisabled.java b/test/compiler/loopopts/TestSplitIfBlocksDisabled.java --- a/test/compiler/loopopts/TestSplitIfBlocksDisabled.java +++ b/test/compiler/loopopts/TestSplitIfBlocksDisabled.java @@ -26,8 +26,13 @@ * @test TestSplitIfBlocksDisabled * @bug 8086057 * @summary Verifies that loop optimizations work if SplitIfBlocks is disabled. - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-SplitIfBlocks TestSplitIfBlocksDisabled + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:-SplitIfBlocks + * compiler.loopopts.TestSplitIfBlocksDisabled */ + +package compiler.loopopts; + public class TestSplitIfBlocksDisabled { public static void main(String[] args) { diff --git a/test/compiler/loopopts/TestSplitIfUnswitchedLoopsEliminated.java b/test/compiler/loopopts/TestSplitIfUnswitchedLoopsEliminated.java --- a/test/compiler/loopopts/TestSplitIfUnswitchedLoopsEliminated.java +++ b/test/compiler/loopopts/TestSplitIfUnswitchedLoopsEliminated.java @@ -26,10 +26,13 @@ * @test * @bug 8078426 * @summary split if finds predicates on several incoming paths when unswitched's loops are optimized out - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:-UseCompressedOops TestSplitIfUnswitchedLoopsEliminated * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement + * -XX:-BackgroundCompilation -XX:-UseCompressedOops + * compiler.loopopts.TestSplitIfUnswitchedLoopsEliminated */ +package compiler.loopopts; public class TestSplitIfUnswitchedLoopsEliminated { diff --git a/test/compiler/loopopts/UseCountedLoopSafepoints.java b/test/compiler/loopopts/UseCountedLoopSafepoints.java --- a/test/compiler/loopopts/UseCountedLoopSafepoints.java +++ b/test/compiler/loopopts/UseCountedLoopSafepoints.java @@ -28,14 +28,16 @@ * @summary Test that C2 flag UseCountedLoopSafepoints ensures a safepoint is kept in a CountedLoop * @library /testlibrary * @modules java.base/jdk.internal.misc - * @modules java.base * @ignore 8146096 - * @run main UseCountedLoopSafepoints + * @run driver compiler.loopopts.UseCountedLoopSafepoints */ +package compiler.loopopts; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + import java.util.concurrent.atomic.AtomicLong; -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; public class UseCountedLoopSafepoints { private static final AtomicLong _num = new AtomicLong(0); @@ -59,7 +61,7 @@ "-XX:+SafepointTimeout", "-XX:SafepointTimeoutDelay=2000", "-XX:+UseCountedLoopSafepoints", - "UseCountedLoopSafepoints", + UseCountedLoopSafepoints.class.getName(), "2000000000" ); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/test/compiler/loopopts/superword/ProdRed_Double.java b/test/compiler/loopopts/superword/ProdRed_Double.java --- a/test/compiler/loopopts/superword/ProdRed_Double.java +++ b/test/compiler/loopopts/superword/ProdRed_Double.java @@ -28,56 +28,85 @@ * @summary Add C2 x86 Superword support for scalar product reduction optimizations : float test * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Double - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.ProdRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.ProdRed_Double * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Double - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.ProdRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.ProdRed_Double * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Double - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.ProdRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.ProdRed_Double * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Double - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.ProdRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.ProdRed_Double */ -public class ProdRed_Double -{ - public static void main(String[] args) throws Exception { - double[] a = new double[256*1024]; - double[] b = new double[256*1024]; - prodReductionInit(a,b); - double valid = 2000; - double total = 0; - for(int j = 0; j < 2000; j++) { - total = j + 1; - total = prodReductionImplement(a,b, total); +package compiler.loopopts.superword; + +public class ProdRed_Double { + public static void main(String[] args) throws Exception { + double[] a = new double[256 * 1024]; + double[] b = new double[256 * 1024]; + prodReductionInit(a, b); + double valid = 2000; + double total = 0; + for (int j = 0; j < 2000; j++) { + total = j + 1; + total = prodReductionImplement(a, b, total); + } + if (total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } } - if(total == valid) { - System.out.println("Success"); - } else { - System.out.println("Invalid sum of elements variable in total: " + total); - System.out.println("Expected value = " + valid); - throw new Exception("Failed"); + + public static void prodReductionInit(double[] a, double[] b) { + for (int i = 0; i < a.length; i++) { + a[i] = i + 2; + b[i] = i + 1; + } } - } - public static void prodReductionInit(double[] a, double[] b) - { - for(int i = 0; i < a.length; i++) - { - a[i] = i + 2; - b[i] = i + 1; + public static double prodReductionImplement(double[] a, double[] b, double total) { + for (int i = 0; i < a.length; i++) { + total *= a[i] - b[i]; + } + return total; } - } - - public static double prodReductionImplement(double[] a, double[] b, double total) - { - for(int i = 0; i < a.length; i++) - { - total *= a[i] - b[i]; - } - return total; - } } diff --git a/test/compiler/loopopts/superword/ProdRed_Float.java b/test/compiler/loopopts/superword/ProdRed_Float.java --- a/test/compiler/loopopts/superword/ProdRed_Float.java +++ b/test/compiler/loopopts/superword/ProdRed_Float.java @@ -28,56 +28,85 @@ * @summary Add C2 x86 Superword support for scalar product reduction optimizations : float test * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Float - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.ProdRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.ProdRed_Float * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Float - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.ProdRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.ProdRed_Float * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Float - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.ProdRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.ProdRed_Float * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Float - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.ProdRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.ProdRed_Float */ -public class ProdRed_Float -{ - public static void main(String[] args) throws Exception { - float[] a = new float[256*1024]; - float[] b = new float[256*1024]; - prodReductionInit(a,b); - float valid = 2000; - float total = 0; - for(int j = 0; j < 2000; j++) { - total = j + 1; - total = prodReductionImplement(a,b, total); +package compiler.loopopts.superword; + +public class ProdRed_Float { + public static void main(String[] args) throws Exception { + float[] a = new float[256 * 1024]; + float[] b = new float[256 * 1024]; + prodReductionInit(a, b); + float valid = 2000; + float total = 0; + for (int j = 0; j < 2000; j++) { + total = j + 1; + total = prodReductionImplement(a, b, total); + } + if (total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } } - if(total == valid) { - System.out.println("Success"); - } else { - System.out.println("Invalid sum of elements variable in total: " + total); - System.out.println("Expected value = " + valid); - throw new Exception("Failed"); + + public static void prodReductionInit(float[] a, float[] b) { + for (int i = 0; i < a.length; i++) { + a[i] = i + 2; + b[i] = i + 1; + } } - } - public static void prodReductionInit(float[] a, float[] b) - { - for(int i = 0; i < a.length; i++) - { - a[i] = i + 2; - b[i] = i + 1; + public static float prodReductionImplement(float[] a, float[] b, float total) { + for (int i = 0; i < a.length; i++) { + total *= a[i] - b[i]; + } + return total; } - } - - public static float prodReductionImplement(float[] a, float[] b, float total) - { - for(int i = 0; i < a.length; i++) - { - total *= a[i] - b[i]; - } - return total; - } } diff --git a/test/compiler/loopopts/superword/ProdRed_Int.java b/test/compiler/loopopts/superword/ProdRed_Int.java --- a/test/compiler/loopopts/superword/ProdRed_Int.java +++ b/test/compiler/loopopts/superword/ProdRed_Int.java @@ -28,55 +28,84 @@ * @summary Add C2 x86 Superword support for scalar product reduction optimizations : int test * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Int - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 ProdRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.ProdRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.ProdRed_Int * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Int - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 ProdRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.ProdRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.ProdRed_Int * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Int - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 ProdRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.ProdRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.ProdRed_Int * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Int - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 ProdRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.ProdRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.ProdRed_Int */ -public class ProdRed_Int -{ - public static void main(String[] args) throws Exception { - int[] a = new int[256*1024]; - int[] b = new int[256*1024]; - prodReductionInit(a,b); - int valid = 419430401; - int total = 1; - for(int j = 0; j < 2000; j++) { - total = prodReductionImplement(a,b,total); +package compiler.loopopts.superword; + +public class ProdRed_Int { + public static void main(String[] args) throws Exception { + int[] a = new int[256 * 1024]; + int[] b = new int[256 * 1024]; + prodReductionInit(a, b); + int valid = 419430401; + int total = 1; + for (int j = 0; j < 2000; j++) { + total = prodReductionImplement(a, b, total); + } + if (total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } } - if(total == valid) { - System.out.println("Success"); - } else { - System.out.println("Invalid sum of elements variable in total: " + total); - System.out.println("Expected value = " + valid); - throw new Exception("Failed"); + + public static void prodReductionInit(int[] a, int[] b) { + for (int i = 0; i < a.length; i++) { + a[i] = i + 2; + b[i] = i + 1; + } } - } - public static void prodReductionInit(int[] a, int[] b) - { - for(int i = 0; i < a.length; i++) - { - a[i] = i + 2; - b[i] = i + 1; + public static int prodReductionImplement(int[] a, int[] b, int total) { + for (int i = 0; i < a.length; i++) { + total *= a[i] + b[i]; + } + return total; } - } - - public static int prodReductionImplement(int[] a, int[] b, int total) - { - for(int i = 0; i < a.length; i++) - { - total *= a[i] + b[i]; - } - return total; - } } diff --git a/test/compiler/loopopts/superword/ReductionPerf.java b/test/compiler/loopopts/superword/ReductionPerf.java --- a/test/compiler/loopopts/superword/ReductionPerf.java +++ b/test/compiler/loopopts/superword/ReductionPerf.java @@ -28,226 +28,236 @@ * @summary Add C2 x86 Superword support for scalar product reduction optimizations : int test * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:CompileThresholdScaling=0.1 -XX:CompileCommand=exclude,ReductionPerf::main ReductionPerf - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:CompileThresholdScaling=0.1 -XX:CompileCommand=exclude,ReductionPerf::main ReductionPerf + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions + * -XX:LoopUnrollLimit=250 -XX:CompileThresholdScaling=0.1 + * -XX:CompileCommand=exclude,compiler.loopopts.superword.ReductionPerf::main + * -XX:+SuperWordReductions + * compiler.loopopts.superword.ReductionPerf + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions + * -XX:LoopUnrollLimit=250 -XX:CompileThresholdScaling=0.1 + * -XX:CompileCommand=exclude,compiler.loopopts.superword.ReductionPerf::main + * -XX:-SuperWordReductions + * compiler.loopopts.superword.ReductionPerf */ +package compiler.loopopts.superword; + public class ReductionPerf { - public static void main(String[] args) throws Exception { - int[] a1 = new int[8*1024]; - int[] a2 = new int[8*1024]; - int[] a3 = new int[8*1024]; - long[] b1 = new long[8*1024]; - long[] b2 = new long[8*1024]; - long[] b3 = new long[8*1024]; - float[] c1 = new float[8*1024]; - float[] c2 = new float[8*1024]; - float[] c3 = new float[8*1024]; - double[] d1 = new double[8*1024]; - double[] d2 = new double[8*1024]; - double[] d3 = new double[8*1024]; + public static void main(String[] args) throws Exception { + int[] a1 = new int[8 * 1024]; + int[] a2 = new int[8 * 1024]; + int[] a3 = new int[8 * 1024]; + long[] b1 = new long[8 * 1024]; + long[] b2 = new long[8 * 1024]; + long[] b3 = new long[8 * 1024]; + float[] c1 = new float[8 * 1024]; + float[] c2 = new float[8 * 1024]; + float[] c3 = new float[8 * 1024]; + double[] d1 = new double[8 * 1024]; + double[] d2 = new double[8 * 1024]; + double[] d3 = new double[8 * 1024]; - ReductionInit(a1,a2,a3,b1,b2,b3,c1,c2,c3,d1,d2,d3); + ReductionInit(a1, a2, a3, b1, b2, b3, c1, c2, c3, d1, d2, d3); - int sumIv = sumInt(a1,a2,a3); - long sumLv = sumLong(b1,b2,b3); - float sumFv = sumFloat(c1,c2,c3); - double sumDv = sumDouble(d1,d2,d3); - int mulIv = prodInt(a1,a2,a3); - long mulLv = prodLong(b1,b2,b3); - float mulFv = prodFloat(c1,c2,c3); - double mulDv = prodDouble(d1,d2,d3); + int sumIv = sumInt(a1, a2, a3); + long sumLv = sumLong(b1, b2, b3); + float sumFv = sumFloat(c1, c2, c3); + double sumDv = sumDouble(d1, d2, d3); + int mulIv = prodInt(a1, a2, a3); + long mulLv = prodLong(b1, b2, b3); + float mulFv = prodFloat(c1, c2, c3); + double mulDv = prodDouble(d1, d2, d3); - int sumI = 0; - long sumL = 0; - float sumF = 0.f; - double sumD = 0.; - int mulI = 0; - long mulL = 0; - float mulF = 0.f; - double mulD = 0.; + int sumI = 0; + long sumL = 0; + float sumF = 0.f; + double sumD = 0.; + int mulI = 0; + long mulL = 0; + float mulF = 0.f; + double mulD = 0.; - System.out.println("Warmup ..."); - long start = System.currentTimeMillis(); + System.out.println("Warmup ..."); + long start = System.currentTimeMillis(); - for(int j = 0; j < 2000; j++) { - sumI = sumInt(a1,a2,a3); - sumL = sumLong(b1,b2,b3); - sumF = sumFloat(c1,c2,c3); - sumD = sumDouble(d1,d2,d3); - mulI = prodInt(a1,a2,a3); - mulL = prodLong(b1,b2,b3); - mulF = prodFloat(c1,c2,c3); - mulD = prodDouble(d1,d2,d3); + for (int j = 0; j < 2000; j++) { + sumI = sumInt(a1, a2, a3); + sumL = sumLong(b1, b2, b3); + sumF = sumFloat(c1, c2, c3); + sumD = sumDouble(d1, d2, d3); + mulI = prodInt(a1, a2, a3); + mulL = prodLong(b1, b2, b3); + mulF = prodFloat(c1, c2, c3); + mulD = prodDouble(d1, d2, d3); + } + + long stop = System.currentTimeMillis(); + System.out.println(" Warmup is done in " + (stop - start) + " msec"); + + if (sumIv != sumI) { + System.out.println("sum int: " + sumIv + " != " + sumI); + } + if (sumLv != sumL) { + System.out.println("sum long: " + sumLv + " != " + sumL); + } + if (sumFv != sumF) { + System.out.println("sum float: " + sumFv + " != " + sumF); + } + if (sumDv != sumD) { + System.out.println("sum double: " + sumDv + " != " + sumD); + } + if (mulIv != mulI) { + System.out.println("prod int: " + mulIv + " != " + mulI); + } + if (mulLv != mulL) { + System.out.println("prod long: " + mulLv + " != " + mulL); + } + if (mulFv != mulF) { + System.out.println("prod float: " + mulFv + " != " + mulF); + } + if (mulDv != mulD) { + System.out.println("prod double: " + mulDv + " != " + mulD); + } + + start = System.currentTimeMillis(); + for (int j = 0; j < 5000; j++) { + sumI = sumInt(a1, a2, a3); + } + stop = System.currentTimeMillis(); + System.out.println("sum int: " + (stop - start)); + + start = System.currentTimeMillis(); + for (int j = 0; j < 5000; j++) { + sumL = sumLong(b1, b2, b3); + } + stop = System.currentTimeMillis(); + System.out.println("sum long: " + (stop - start)); + + start = System.currentTimeMillis(); + for (int j = 0; j < 5000; j++) { + sumF = sumFloat(c1, c2, c3); + } + stop = System.currentTimeMillis(); + System.out.println("sum float: " + (stop - start)); + + start = System.currentTimeMillis(); + for (int j = 0; j < 5000; j++) { + sumD = sumDouble(d1, d2, d3); + } + stop = System.currentTimeMillis(); + System.out.println("sum double: " + (stop - start)); + + start = System.currentTimeMillis(); + for (int j = 0; j < 5000; j++) { + mulI = prodInt(a1, a2, a3); + } + stop = System.currentTimeMillis(); + System.out.println("prod int: " + (stop - start)); + + start = System.currentTimeMillis(); + for (int j = 0; j < 5000; j++) { + mulL = prodLong(b1, b2, b3); + } + stop = System.currentTimeMillis(); + System.out.println("prod long: " + (stop - start)); + + start = System.currentTimeMillis(); + for (int j = 0; j < 5000; j++) { + mulF = prodFloat(c1, c2, c3); + } + stop = System.currentTimeMillis(); + System.out.println("prod float: " + (stop - start)); + + start = System.currentTimeMillis(); + for (int j = 0; j < 5000; j++) { + mulD = prodDouble(d1, d2, d3); + } + stop = System.currentTimeMillis(); + System.out.println("prod double: " + (stop - start)); + } - long stop = System.currentTimeMillis(); - System.out.println(" Warmup is done in " + (stop - start) + " msec"); - - if (sumIv != sumI) { - System.out.println("sum int: " + sumIv + " != " + sumI); - } - if (sumLv != sumL) { - System.out.println("sum long: " + sumLv + " != " + sumL); - } - if (sumFv != sumF) { - System.out.println("sum float: " + sumFv + " != " + sumF); - } - if (sumDv != sumD) { - System.out.println("sum double: " + sumDv + " != " + sumD); - } - if (mulIv != mulI) { - System.out.println("prod int: " + mulIv + " != " + mulI); - } - if (mulLv != mulL) { - System.out.println("prod long: " + mulLv + " != " + mulL); - } - if (mulFv != mulF) { - System.out.println("prod float: " + mulFv + " != " + mulF); - } - if (mulDv != mulD) { - System.out.println("prod double: " + mulDv + " != " + mulD); + public static void ReductionInit(int[] a1, int[] a2, int[] a3, + long[] b1, long[] b2, long[] b3, + float[] c1, float[] c2, float[] c3, + double[] d1, double[] d2, double[] d3) { + for(int i = 0; i < a1.length; i++) { + a1[i] = (i + 0); + a2[i] = (i + 1); + a3[i] = (i + 2); + b1[i] = (long) (i + 0); + b2[i] = (long) (i + 1); + b3[i] = (long) (i + 2); + c1[i] = (float) (i + 0); + c2[i] = (float) (i + 1); + c3[i] = (float) (i + 2); + d1[i] = (double) (i + 0); + d2[i] = (double) (i + 1); + d3[i] = (double) (i + 2); + } } - start = System.currentTimeMillis(); - for (int j = 0; j < 5000; j++) { - sumI = sumInt(a1, a2 ,a3); + public static int sumInt(int[] a1, int[] a2, int[] a3) { + int total = 0; + for (int i = 0; i < a1.length; i++) { + total += (a1[i] * a2[i]) + (a1[i] * a3[i]) + (a2[i] * a3[i]); + } + return total; } - stop = System.currentTimeMillis(); - System.out.println("sum int: " + (stop - start)); - start = System.currentTimeMillis(); - for (int j = 0; j < 5000; j++) { - sumL = sumLong(b1, b2, b3); + public static long sumLong(long[] b1, long[] b2, long[] b3) { + long total = 0; + for (int i = 0; i < b1.length; i++) { + total += (b1[i] * b2[i]) + (b1[i] * b3[i]) + (b2[i] * b3[i]); + } + return total; } - stop = System.currentTimeMillis(); - System.out.println("sum long: " + (stop - start)); - start = System.currentTimeMillis(); - for (int j = 0; j < 5000; j++) { - sumF = sumFloat(c1, c2, c3); + public static float sumFloat(float[] c1, float[] c2, float[] c3) { + float total = 0; + for (int i = 0; i < c1.length; i++) { + total += (c1[i] * c2[i]) + (c1[i] * c3[i]) + (c2[i] * c3[i]); + } + return total; } - stop = System.currentTimeMillis(); - System.out.println("sum float: " + (stop - start)); - start = System.currentTimeMillis(); - for (int j = 0; j < 5000; j++) { - sumD = sumDouble(d1, d2, d3); + public static double sumDouble(double[] d1, double[] d2, double[] d3) { + double total = 0; + for (int i = 0; i < d1.length; i++) { + total += (d1[i] * d2[i]) + (d1[i] * d3[i]) + (d2[i] * d3[i]); + } + return total; } - stop = System.currentTimeMillis(); - System.out.println("sum double: " + (stop - start)); - start = System.currentTimeMillis(); - for (int j = 0; j < 5000; j++) { - mulI = prodInt(a1, a2, a3); + public static int prodInt(int[] a1, int[] a2, int[] a3) { + int total = 1; + for (int i = 0; i < a1.length; i++) { + total *= (a1[i] * a2[i]) + (a1[i] * a3[i]) + (a2[i] * a3[i]); + } + return total; } - stop = System.currentTimeMillis(); - System.out.println("prod int: " + (stop - start)); - start = System.currentTimeMillis(); - for (int j = 0; j < 5000; j++) { - mulL = prodLong(b1, b2 ,b3); + public static long prodLong(long[] b1, long[] b2, long[] b3) { + long total = 1; + for (int i = 0; i < b1.length; i++) { + total *= (b1[i] * b2[i]) + (b1[i] * b3[i]) + (b2[i] * b3[i]); + } + return total; } - stop = System.currentTimeMillis(); - System.out.println("prod long: " + (stop - start)); - start = System.currentTimeMillis(); - for (int j = 0; j < 5000; j++) { - mulF = prodFloat(c1, c2, c3); + public static float prodFloat(float[] c1, float[] c2, float[] c3) { + float total = 1; + for (int i = 0; i < c1.length; i++) { + total *= (c1[i] * c2[i]) + (c1[i] * c3[i]) + (c2[i] * c3[i]); + } + return total; } - stop = System.currentTimeMillis(); - System.out.println("prod float: " + (stop - start)); - start = System.currentTimeMillis(); - for (int j = 0; j < 5000; j++) { - mulD = prodDouble(d1, d2, d3); + public static double prodDouble(double[] d1, double[] d2, double[] d3) { + double total = 1; + for (int i = 0; i < d1.length; i++) { + total *= (d1[i] * d2[i]) + (d1[i] * d3[i]) + (d2[i] * d3[i]); + } + return total; } - stop = System.currentTimeMillis(); - System.out.println("prod double: " + (stop - start)); - - } - - public static void ReductionInit(int[] a1, int[] a2, int[] a3, - long[] b1, long[] b2, long[] b3, - float[] c1, float[] c2, float[] c3, - double[] d1, double[] d2, double[] d3 ) { - for(int i = 0; i < a1.length; i++) { - a1[i] = (i + 0); - a2[i] = (i + 1); - a3[i] = (i + 2); - b1[i] = (long) (i + 0); - b2[i] = (long) (i + 1); - b3[i] = (long) (i + 2); - c1[i] = (float) (i + 0); - c2[i] = (float) (i + 1); - c3[i] = (float) (i + 2); - d1[i] = (double) (i + 0); - d2[i] = (double) (i + 1); - d3[i] = (double) (i + 2); - } - } - - public static int sumInt(int[] a1, int[] a2, int[] a3) { - int total = 0; - for(int i = 0; i < a1.length; i++) { - total += (a1[i] * a2[i]) + (a1[i] * a3[i]) + (a2[i] * a3[i]); - } - return total; - } - - public static long sumLong(long[] b1, long[] b2, long[] b3) { - long total = 0; - for(int i = 0; i < b1.length; i++) { - total += (b1[i] * b2[i]) + (b1[i] * b3[i]) + (b2[i] * b3[i]); - } - return total; - } - - public static float sumFloat(float[] c1, float[] c2, float[] c3) { - float total = 0; - for(int i = 0; i < c1.length; i++) { - total += (c1[i] * c2[i]) + (c1[i] * c3[i]) + (c2[i] * c3[i]); - } - return total; - } - - public static double sumDouble(double[] d1, double[] d2, double[] d3) { - double total = 0; - for(int i = 0; i < d1.length; i++) { - total += (d1[i] * d2[i]) + (d1[i] * d3[i]) + (d2[i] * d3[i]); - } - return total; - } - - public static int prodInt(int[] a1, int[] a2, int[] a3) { - int total = 1; - for(int i = 0; i < a1.length; i++) { - total *= (a1[i] * a2[i]) + (a1[i] * a3[i]) + (a2[i] * a3[i]); - } - return total; - } - - public static long prodLong(long[] b1, long[] b2, long[] b3) { - long total = 1; - for(int i = 0; i < b1.length; i++) { - total *= (b1[i] * b2[i]) + (b1[i] * b3[i]) + (b2[i] * b3[i]); - } - return total; - } - - public static float prodFloat(float[] c1, float[] c2, float[] c3) { - float total = 1; - for(int i = 0; i < c1.length; i++) { - total *= (c1[i] * c2[i]) + (c1[i] * c3[i]) + (c2[i] * c3[i]); - } - return total; - } - - public static double prodDouble(double[] d1, double[] d2, double[] d3) { - double total = 1; - for(int i = 0; i < d1.length; i++) { - total *= (d1[i] * d2[i]) + (d1[i] * d3[i]) + (d2[i] * d3[i]); - } - return total; - } } diff --git a/test/compiler/loopopts/superword/SumRedAbsNeg_Double.java b/test/compiler/loopopts/superword/SumRedAbsNeg_Double.java --- a/test/compiler/loopopts/superword/SumRedAbsNeg_Double.java +++ b/test/compiler/loopopts/superword/SumRedAbsNeg_Double.java @@ -28,72 +28,100 @@ * @summary Add C2 AArch64 Superword support for scalar sum reduction optimizations : double abs & neg test * @requires os.arch=="aarch64" * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.SumRedAbsNeg_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.SumRedAbsNeg_Double * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRedAbsNeg_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRedAbsNeg_Double * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRedAbsNeg_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRedAbsNeg_Double * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.SumRedAbsNeg_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.SumRedAbsNeg_Double */ -public class SumRedAbsNeg_Double -{ - public static void main(String[] args) throws Exception { - double[] a = new double[256*1024]; - double[] b = new double[256*1024]; - double[] c = new double[256*1024]; - double[] d = new double[256*1024]; - sumReductionInit(a,b,c); - double total = 0; - double valid = 3.6028590866691944E19; +package compiler.loopopts.superword; - for(int j = 0; j < 2000; j++) { - total = sumReductionImplement(a,b,c,d,total); +public class SumRedAbsNeg_Double { + public static void main(String[] args) throws Exception { + double[] a = new double[256 * 1024]; + double[] b = new double[256 * 1024]; + double[] c = new double[256 * 1024]; + double[] d = new double[256 * 1024]; + sumReductionInit(a, b, c); + double total = 0; + double valid = 3.6028590866691944E19; + + for (int j = 0; j < 2000; j++) { + total = sumReductionImplement(a, b, c, d, total); + } + + if (total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } } - if(total == valid) { - System.out.println("Success"); - } else { - System.out.println("Invalid sum of elements variable in total: " + total); - System.out.println("Expected value = " + valid); - throw new Exception("Failed"); + public static void sumReductionInit( + double[] a, + double[] b, + double[] c) { + for (int j = 0; j < 1; j++) { + for (int i = 0; i < a.length; i++) { + a[i] = i * 1 + j; + b[i] = i * 1 - j; + c[i] = i + j; + } + } } - } - public static void sumReductionInit( - double[] a, - double[] b, - double[] c) - { - for(int j = 0; j < 1; j++) - { - for(int i = 0; i < a.length; i++) - { - a[i] = i * 1 + j; - b[i] = i * 1 - j; - c[i] = i + j; - } + public static double sumReductionImplement( + double[] a, + double[] b, + double[] c, + double[] d, + double total) { + for (int i = 0; i < a.length; i++) { + d[i] = Math.abs(-a[i] * -b[i]) + Math.abs(-a[i] * -c[i]) + Math.abs(-b[i] * -c[i]); + total += d[i]; + } + return total; } - } - - public static double sumReductionImplement( - double[] a, - double[] b, - double[] c, - double[] d, - double total) - { - for(int i = 0; i < a.length; i++) - { - d[i] = Math.abs(-a[i] * -b[i]) + Math.abs(-a[i] * -c[i]) + Math.abs(-b[i] * -c[i]); - total += d[i]; - } - return total; - } } diff --git a/test/compiler/loopopts/superword/SumRedAbsNeg_Float.java b/test/compiler/loopopts/superword/SumRedAbsNeg_Float.java --- a/test/compiler/loopopts/superword/SumRedAbsNeg_Float.java +++ b/test/compiler/loopopts/superword/SumRedAbsNeg_Float.java @@ -28,72 +28,100 @@ * @summary Add C2 AArch64 Superword support for scalar sum reduction optimizations : float abs & neg test * @requires os.arch=="aarch64" * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.SumRedAbsNeg_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.SumRedAbsNeg_Double * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRedAbsNeg_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRedAbsNeg_Double * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRedAbsNeg_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRedAbsNeg_Double * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRedAbsNeg_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.SumRedAbsNeg_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.SumRedAbsNeg_Double */ -public class SumRedAbsNeg_Float -{ - public static void main(String[] args) throws Exception { - float[] a = new float[256*1024]; - float[] b = new float[256*1024]; - float[] c = new float[256*1024]; - float[] d = new float[256*1024]; - sumReductionInit(a,b,c); - float total = 0; - float valid = (float)4.611686E18; +package compiler.loopopts.superword; - for(int j = 0; j < 2000; j++) { - total = sumReductionImplement(a,b,c,d,total); +public class SumRedAbsNeg_Float { + public static void main(String[] args) throws Exception { + float[] a = new float[256 * 1024]; + float[] b = new float[256 * 1024]; + float[] c = new float[256 * 1024]; + float[] d = new float[256 * 1024]; + sumReductionInit(a, b, c); + float total = 0; + float valid = (float) 4.611686E18; + + for (int j = 0; j < 2000; j++) { + total = sumReductionImplement(a, b, c, d, total); + } + + if (total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } } - if(total == valid) { - System.out.println("Success"); - } else { - System.out.println("Invalid sum of elements variable in total: " + total); - System.out.println("Expected value = " + valid); - throw new Exception("Failed"); + public static void sumReductionInit( + float[] a, + float[] b, + float[] c) { + for (int j = 0; j < 1; j++) { + for (int i = 0; i < a.length; i++) { + a[i] = i * 1 + j; + b[i] = i * 1 - j; + c[i] = i + j; + } + } } - } - public static void sumReductionInit( - float[] a, - float[] b, - float[] c) - { - for(int j = 0; j < 1; j++) - { - for(int i = 0; i < a.length; i++) - { - a[i] = i * 1 + j; - b[i] = i * 1 - j; - c[i] = i + j; - } + public static float sumReductionImplement( + float[] a, + float[] b, + float[] c, + float[] d, + float total) { + for (int i = 0; i < a.length; i++) { + d[i] = Math.abs(-a[i] * -b[i]) + Math.abs(-a[i] * -c[i]) + Math.abs(-b[i] * -c[i]); + total += d[i]; + } + return total; } - } - - public static float sumReductionImplement( - float[] a, - float[] b, - float[] c, - float[] d, - float total) - { - for(int i = 0; i < a.length; i++) - { - d[i] = Math.abs(-a[i] * -b[i]) + Math.abs(-a[i] * -c[i]) + Math.abs(-b[i] * -c[i]); - total += d[i]; - } - return total; - } } diff --git a/test/compiler/loopopts/superword/SumRedSqrt_Double.java b/test/compiler/loopopts/superword/SumRedSqrt_Double.java --- a/test/compiler/loopopts/superword/SumRedSqrt_Double.java +++ b/test/compiler/loopopts/superword/SumRedSqrt_Double.java @@ -23,75 +23,104 @@ */ /** -* @test -* @bug 8135028 -* @summary Add C2 x86 Superword support for scalar sum reduction optimizations : double sqrt test -* @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" -* -* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double -* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double -* -* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double -* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double -* -* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double -* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double -* -* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double -* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRedSqrt_Double -*/ + * @test + * @bug 8135028 + * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : double sqrt test + * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.SumRedSqrt_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.SumRedSqrt_Double + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRedSqrt_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRedSqrt_Double + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRedSqrt_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRedSqrt_Double + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.SumRedSqrt_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.SumRedSqrt_Double + */ -public class SumRedSqrt_Double -{ - public static void main(String[] args) throws Exception { - double[] a = new double[256*1024]; - double[] b = new double[256*1024]; - double[] c = new double[256*1024]; - double[] d = new double[256*1024]; - sumReductionInit(a,b,c); - double total = 0; - double valid = 2.06157643776E14; - for(int j = 0; j < 2000; j++) { - total = sumReductionImplement(a,b,c,d,total); + +package compiler.loopopts.superword; + +public class SumRedSqrt_Double { + public static void main(String[] args) throws Exception { + double[] a = new double[256 * 1024]; + double[] b = new double[256 * 1024]; + double[] c = new double[256 * 1024]; + double[] d = new double[256 * 1024]; + sumReductionInit(a, b, c); + double total = 0; + double valid = 2.06157643776E14; + for (int j = 0; j < 2000; j++) { + total = sumReductionImplement(a, b, c, d, total); + } + if (total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } } - if(total == valid) { - System.out.println("Success"); - } else { - System.out.println("Invalid sum of elements variable in total: " + total); - System.out.println("Expected value = " + valid); - throw new Exception("Failed"); + + public static void sumReductionInit( + double[] a, + double[] b, + double[] c) { + for (int j = 0; j < 1; j++) { + for (int i = 0; i < a.length; i++) { + a[i] = i * 1 + j; + b[i] = i * 1 - j; + c[i] = i + j; + } + } } - } - public static void sumReductionInit( - double[] a, - double[] b, - double[] c) - { - for(int j = 0; j < 1; j++) - { - for(int i = 0; i < a.length; i++) - { - a[i] = i * 1 + j; - b[i] = i * 1 - j; - c[i] = i + j; - } + public static double sumReductionImplement( + double[] a, + double[] b, + double[] c, + double[] d, + double total) { + for (int i = 0; i < a.length; i++) { + d[i] = Math.sqrt(a[i] * b[i]) + Math.sqrt(a[i] * c[i]) + Math.sqrt(b[i] * c[i]); + total += d[i]; + } + return total; } - } - - public static double sumReductionImplement( - double[] a, - double[] b, - double[] c, - double[] d, - double total) - { - for(int i = 0; i < a.length; i++) - { - d[i]= Math.sqrt(a[i] * b[i]) + Math.sqrt(a[i] * c[i]) + Math.sqrt(b[i] * c[i]); - total += d[i]; - } - return total; - } } diff --git a/test/compiler/loopopts/superword/SumRed_Double.java b/test/compiler/loopopts/superword/SumRed_Double.java --- a/test/compiler/loopopts/superword/SumRed_Double.java +++ b/test/compiler/loopopts/superword/SumRed_Double.java @@ -28,70 +28,98 @@ * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : double test * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Double - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.SumRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.SumRed_Double * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Double - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRed_Double * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Double - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRed_Double * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Double - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.SumRed_Double + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.SumRed_Double */ -public class SumRed_Double -{ - public static void main(String[] args) throws Exception { - double[] a = new double[256*1024]; - double[] b = new double[256*1024]; - double[] c = new double[256*1024]; - double[] d = new double[256*1024]; - sumReductionInit(a,b,c); - double total = 0; - double valid = 3.6028590866691944E19; - for(int j = 0; j < 2000; j++) { - total = sumReductionImplement(a,b,c,d,total); +package compiler.loopopts.superword; + +public class SumRed_Double { + public static void main(String[] args) throws Exception { + double[] a = new double[256 * 1024]; + double[] b = new double[256 * 1024]; + double[] c = new double[256 * 1024]; + double[] d = new double[256 * 1024]; + sumReductionInit(a, b, c); + double total = 0; + double valid = 3.6028590866691944E19; + for (int j = 0; j < 2000; j++) { + total = sumReductionImplement(a, b, c, d, total); + } + if (total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } } - if(total == valid) { - System.out.println("Success"); - } else { - System.out.println("Invalid sum of elements variable in total: " + total); - System.out.println("Expected value = " + valid); - throw new Exception("Failed"); + + public static void sumReductionInit( + double[] a, + double[] b, + double[] c) { + for (int j = 0; j < 1; j++) { + for (int i = 0; i < a.length; i++) { + a[i] = i * 1 + j; + b[i] = i * 1 - j; + c[i] = i + j; + } + } } - } - public static void sumReductionInit( - double[] a, - double[] b, - double[] c) - { - for(int j = 0; j < 1; j++) - { - for(int i = 0; i < a.length; i++) - { - a[i] = i * 1 + j; - b[i] = i * 1 - j; - c[i] = i + j; - } + public static double sumReductionImplement( + double[] a, + double[] b, + double[] c, + double[] d, + double total) { + for (int i = 0; i < a.length; i++) { + d[i] = (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]); + total += d[i]; + } + return total; } - } - - public static double sumReductionImplement( - double[] a, - double[] b, - double[] c, - double[] d, - double total) - { - for(int i = 0; i < a.length; i++) - { - d[i]= (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]); - total += d[i]; - } - return total; - } } diff --git a/test/compiler/loopopts/superword/SumRed_Float.java b/test/compiler/loopopts/superword/SumRed_Float.java --- a/test/compiler/loopopts/superword/SumRed_Float.java +++ b/test/compiler/loopopts/superword/SumRed_Float.java @@ -28,70 +28,98 @@ * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : float test * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Float - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.SumRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.SumRed_Float * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Float - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRed_Float * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Float - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRed_Float * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Float - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.SumRed_Float + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.SumRed_Float */ -public class SumRed_Float -{ - public static void main(String[] args) throws Exception { - float[] a = new float[256*1024]; - float[] b = new float[256*1024]; - float[] c = new float[256*1024]; - float[] d = new float[256*1024]; - sumReductionInit(a,b,c); - float total = 0; - float valid = (float)4.611686E18; - for(int j = 0; j < 2000; j++) { - total = sumReductionImplement(a,b,c,d,total); +package compiler.loopopts.superword; + +public class SumRed_Float { + public static void main(String[] args) throws Exception { + float[] a = new float[256 * 1024]; + float[] b = new float[256 * 1024]; + float[] c = new float[256 * 1024]; + float[] d = new float[256 * 1024]; + sumReductionInit(a, b, c); + float total = 0; + float valid = (float) 4.611686E18; + for (int j = 0; j < 2000; j++) { + total = sumReductionImplement(a, b, c, d, total); + } + if (total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } } - if(total == valid) { - System.out.println("Success"); - } else { - System.out.println("Invalid sum of elements variable in total: " + total); - System.out.println("Expected value = " + valid); - throw new Exception("Failed"); + + public static void sumReductionInit( + float[] a, + float[] b, + float[] c) { + for (int j = 0; j < 1; j++) { + for (int i = 0; i < a.length; i++) { + a[i] = i * 1 + j; + b[i] = i * 1 - j; + c[i] = i + j; + } + } } - } - public static void sumReductionInit( - float[] a, - float[] b, - float[] c) - { - for(int j = 0; j < 1; j++) - { - for(int i = 0; i < a.length; i++) - { - a[i] = i * 1 + j; - b[i] = i * 1 - j; - c[i] = i + j; - } + public static float sumReductionImplement( + float[] a, + float[] b, + float[] c, + float[] d, + float total) { + for (int i = 0; i < a.length; i++) { + d[i] = (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]); + total += d[i]; + } + return total; } - } - - public static float sumReductionImplement( - float[] a, - float[] b, - float[] c, - float[] d, - float total) - { - for(int i = 0; i < a.length; i++) - { - d[i]= (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]); - total += d[i]; - } - return total; - } } diff --git a/test/compiler/loopopts/superword/SumRed_Int.java b/test/compiler/loopopts/superword/SumRed_Int.java --- a/test/compiler/loopopts/superword/SumRed_Int.java +++ b/test/compiler/loopopts/superword/SumRed_Int.java @@ -28,70 +28,98 @@ * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : int test * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Int - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=2 -XX:CompileThresholdScaling=0.1 SumRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.SumRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=2 + * compiler.loopopts.superword.SumRed_Int * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Int - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRed_Int * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Int - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRed_Int * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Int - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=16 -XX:CompileThresholdScaling=0.1 SumRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.SumRed_Int + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=16 + * compiler.loopopts.superword.SumRed_Int */ -public class SumRed_Int -{ - public static void main(String[] args) throws Exception { - int[] a = new int[256*1024]; - int[] b = new int[256*1024]; - int[] c = new int[256*1024]; - int[] d = new int[256*1024]; - sumReductionInit(a,b,c); - int total = 0; - int valid = 262144000; - for(int j = 0; j < 2000; j++) { - total = sumReductionImplement(a,b,c,d,total); +package compiler.loopopts.superword; + +public class SumRed_Int { + public static void main(String[] args) throws Exception { + int[] a = new int[256 * 1024]; + int[] b = new int[256 * 1024]; + int[] c = new int[256 * 1024]; + int[] d = new int[256 * 1024]; + sumReductionInit(a, b, c); + int total = 0; + int valid = 262144000; + for (int j = 0; j < 2000; j++) { + total = sumReductionImplement(a, b, c, d, total); + } + if (total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } } - if(total == valid) { - System.out.println("Success"); - } else { - System.out.println("Invalid sum of elements variable in total: " + total); - System.out.println("Expected value = " + valid); - throw new Exception("Failed"); + + public static void sumReductionInit( + int[] a, + int[] b, + int[] c) { + for (int j = 0; j < 1; j++) { + for (int i = 0; i < a.length; i++) { + a[i] = i * 1 + j; + b[i] = i * 1 - j; + c[i] = i + j; + } + } } - } - public static void sumReductionInit( - int[] a, - int[] b, - int[] c) - { - for(int j = 0; j < 1; j++) - { - for(int i = 0; i < a.length; i++) - { - a[i] = i * 1 + j; - b[i] = i * 1 - j; - c[i] = i + j; - } + public static int sumReductionImplement( + int[] a, + int[] b, + int[] c, + int[] d, + int total) { + for (int i = 0; i < a.length; i++) { + d[i] = (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]); + total += d[i]; + } + return total; } - } - - public static int sumReductionImplement( - int[] a, - int[] b, - int[] c, - int[] d, - int total) - { - for(int i = 0; i < a.length; i++) - { - d[i]= (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]); - total += d[i]; - } - return total; - } } diff --git a/test/compiler/loopopts/superword/SumRed_Long.java b/test/compiler/loopopts/superword/SumRed_Long.java --- a/test/compiler/loopopts/superword/SumRed_Long.java +++ b/test/compiler/loopopts/superword/SumRed_Long.java @@ -28,66 +28,77 @@ * @summary Add C2 x86 Superword support for scalar sum reduction optimizations : long test * @requires os.arch=="x86" | os.arch=="i386" | os.arch=="amd64" | os.arch=="x86_64" * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Long - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=4 -XX:CompileThresholdScaling=0.1 SumRed_Long + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRed_Long + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=4 + * compiler.loopopts.superword.SumRed_Long * - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Long - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-SuperWordReductions -XX:LoopUnrollLimit=250 -XX:LoopMaxUnroll=8 -XX:CompileThresholdScaling=0.1 SumRed_Long - * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:+SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRed_Long + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:LoopUnrollLimit=250 + * -XX:CompileThresholdScaling=0.1 + * -XX:-SuperWordReductions + * -XX:LoopMaxUnroll=8 + * compiler.loopopts.superword.SumRed_Long */ -public class SumRed_Long -{ - public static void main(String[] args) throws Exception { - long[] a = new long[256*1024]; - long[] b = new long[256*1024]; - long[] c = new long[256*1024]; - long[] d = new long[256*1024]; - sumReductionInit(a,b,c); - long total = 0; - long valid = 262144000; - for(int j = 0; j < 2000; j++) { - total = sumReductionImplement(a,b,c,d,total); +package compiler.loopopts.superword; + +public class SumRed_Long { + public static void main(String[] args) throws Exception { + long[] a = new long[256 * 1024]; + long[] b = new long[256 * 1024]; + long[] c = new long[256 * 1024]; + long[] d = new long[256 * 1024]; + sumReductionInit(a, b, c); + long total = 0; + long valid = 262144000; + for (int j = 0; j < 2000; j++) { + total = sumReductionImplement(a, b, c, d, total); + } + total = (int) total; + if (total == valid) { + System.out.println("Success"); + } else { + System.out.println("Invalid sum of elements variable in total: " + total); + System.out.println("Expected value = " + valid); + throw new Exception("Failed"); + } } - total = (int)total; - if(total == valid) { - System.out.println("Success"); - } else { - System.out.println("Invalid sum of elements variable in total: " + total); - System.out.println("Expected value = " + valid); - throw new Exception("Failed"); + + public static void sumReductionInit( + long[] a, + long[] b, + long[] c) { + for (int j = 0; j < 1; j++) { + for (int i = 0; i < a.length; i++) { + a[i] = i * 1 + j; + b[i] = i * 1 - j; + c[i] = i + j; + } + } } - } - public static void sumReductionInit( - long[] a, - long[] b, - long[] c) - { - for(int j = 0; j < 1; j++) - { - for(int i = 0; i < a.length; i++) - { - a[i] = i * 1 + j; - b[i] = i * 1 - j; - c[i] = i + j; - } + public static long sumReductionImplement( + long[] a, + long[] b, + long[] c, + long[] d, + long total) { + for (int i = 0; i < a.length; i++) { + d[i] = (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]); + total += d[i]; + } + return total; } - } - - public static long sumReductionImplement( - long[] a, - long[] b, - long[] c, - long[] d, - long total) - { - for(int i = 0; i < a.length; i++) - { - d[i]= (a[i] * b[i]) + (a[i] * c[i]) + (b[i] * c[i]); - total += d[i]; - } - return total; - } } diff --git a/test/compiler/loopopts/superword/TestBestAlign.java b/test/compiler/loopopts/superword/TestBestAlign.java --- a/test/compiler/loopopts/superword/TestBestAlign.java +++ b/test/compiler/loopopts/superword/TestBestAlign.java @@ -25,10 +25,12 @@ * @test * @bug 8141624 * @summary Limit calculation of pre loop during super word optimization is wrong - * @run main/othervm TestBestAlign + * @run main/othervm compiler.loopopts.superword.TestBestAlign * @author gunter.haug@sap.com */ +package compiler.loopopts.superword; + public class TestBestAlign { static final int initVal = -1; diff --git a/test/compiler/loopopts/superword/TestReductionWithLoopVariantUse.java b/test/compiler/loopopts/superword/TestReductionWithLoopVariantUse.java --- a/test/compiler/loopopts/superword/TestReductionWithLoopVariantUse.java +++ b/test/compiler/loopopts/superword/TestReductionWithLoopVariantUse.java @@ -25,10 +25,12 @@ * @test * @bug 8080976 * @summary Loop variant use in reduction should prevent vectorization - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestReductionWithLoopVariantUse - * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.loopopts.superword.TestReductionWithLoopVariantUse */ +package compiler.loopopts.superword; + public class TestReductionWithLoopVariantUse { static int m(int[] array) { int c = 0; diff --git a/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java b/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java --- a/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java +++ b/test/compiler/loopopts/superword/TestVectorizationWithInvariant.java @@ -22,17 +22,20 @@ * */ -import jdk.test.lib.*; -import jdk.internal.misc.Unsafe; - /** * @test * @bug 8078497 * @summary Tests correct alignment of vectors with loop invariant offset. * @modules java.base/jdk.internal.misc * @library /testlibrary - * @run main TestVectorizationWithInvariant + * @run main compiler.loopopts.superword.TestVectorizationWithInvariant */ + +package compiler.loopopts.superword; + +import jdk.internal.misc.Unsafe; +import jdk.test.lib.Utils; + public class TestVectorizationWithInvariant { private static Unsafe unsafe; diff --git a/test/compiler/macronodes/TestEliminateAllocationPhi.java b/test/compiler/macronodes/TestEliminateAllocationPhi.java --- a/test/compiler/macronodes/TestEliminateAllocationPhi.java +++ b/test/compiler/macronodes/TestEliminateAllocationPhi.java @@ -25,10 +25,12 @@ * @test * @bug 8046698 * @summary PhiNode inserted between AllocateNode and Initialization node confuses allocation elimination - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestEliminateAllocationPhi - * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.macronodes.TestEliminateAllocationPhi */ +package compiler.macronodes; + public class TestEliminateAllocationPhi { // This will return I when called from m(0 and once optimized will diff --git a/test/compiler/membars/DekkerTest.java b/test/compiler/membars/DekkerTest.java --- a/test/compiler/membars/DekkerTest.java +++ b/test/compiler/membars/DekkerTest.java @@ -25,14 +25,22 @@ * @test * @bug 8007898 * @summary Incorrect optimization of Memory Barriers in Matcher::post_store_load_barrier(). - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM DekkerTest - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM DekkerTest - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM DekkerTest + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM + * compiler.membars.DekkerTest + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM + * compiler.membars.DekkerTest + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:CICompilerCount=1 -XX:+StressGCM -XX:+StressLCM + * compiler.membars.DekkerTest * @author Martin Doerr martin DOT doerr AT sap DOT com * * Run 3 times since the failure is intermittent. */ +package compiler.membars; + public class DekkerTest { /* diff --git a/test/compiler/membars/TestMemBarAcquire.java b/test/compiler/membars/TestMemBarAcquire.java --- a/test/compiler/membars/TestMemBarAcquire.java +++ b/test/compiler/membars/TestMemBarAcquire.java @@ -24,30 +24,34 @@ /* * @test TestMemBarAcquire * @bug 8048879 - * @summary "Tests optimization of MemBarAcquireNodes" - * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation TestMemBarAcquire + * @summary Tests optimization of MemBarAcquireNodes + * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation + * compiler.membars.TestMemBarAcquire */ + +package compiler.membars; + public class TestMemBarAcquire { - private volatile static Object defaultObj = new Object(); - private Object obj; + private volatile static Object defaultObj = new Object(); + private Object obj; - public TestMemBarAcquire(Object param) { - // Volatile load. MemBarAcquireNode is added after the - // load to prevent following loads from floating up past. - // StoreNode is added to store result of load in 'obj'. - this.obj = defaultObj; - // Overrides 'obj' and therefore makes previous StoreNode - // and the corresponding LoadNode useless. However, the - // LoadNode is still connected to the MemBarAcquireNode - // that should now release the reference. - this.obj = param; - } + public TestMemBarAcquire(Object param) { + // Volatile load. MemBarAcquireNode is added after the + // load to prevent following loads from floating up past. + // StoreNode is added to store result of load in 'obj'. + this.obj = defaultObj; + // Overrides 'obj' and therefore makes previous StoreNode + // and the corresponding LoadNode useless. However, the + // LoadNode is still connected to the MemBarAcquireNode + // that should now release the reference. + this.obj = param; + } - public static void main(String[] args) throws Exception { - // Make sure TestMemBarAcquire:: is compiled - for (int i = 0; i < 100000; ++i) { - TestMemBarAcquire p = new TestMemBarAcquire(new Object()); + public static void main(String[] args) throws Exception { + // Make sure TestMemBarAcquire:: is compiled + for (int i = 0; i < 100000; ++i) { + TestMemBarAcquire p = new TestMemBarAcquire(new Object()); + } } - } } diff --git a/test/compiler/memoryinitialization/ZeroTLABTest.java b/test/compiler/memoryinitialization/ZeroTLABTest.java --- a/test/compiler/memoryinitialization/ZeroTLABTest.java +++ b/test/compiler/memoryinitialization/ZeroTLABTest.java @@ -25,11 +25,15 @@ /* * @test * @bug 8086053 - * @run main/othervm -Xcomp -XX:+UseTLAB -XX:+ZeroTLAB ZeroTLABTest - * @run main/othervm -Xcomp -XX:+UseTLAB -XX:-ZeroTLAB ZeroTLABTest - * @run main/othervm -Xcomp -XX:-UseTLAB -XX:+ZeroTLAB ZeroTLABTest - * @run main/othervm -Xcomp -XX:-UseTLAB -XX:-ZeroTLAB ZeroTLABTest + * + * @run main/othervm -Xcomp -XX:+UseTLAB -XX:+ZeroTLAB compiler.memoryinitialization.ZeroTLABTest + * @run main/othervm -Xcomp -XX:+UseTLAB -XX:-ZeroTLAB compiler.memoryinitialization.ZeroTLABTest + * @run main/othervm -Xcomp -XX:-UseTLAB -XX:+ZeroTLAB compiler.memoryinitialization.ZeroTLABTest + * @run main/othervm -Xcomp -XX:-UseTLAB -XX:-ZeroTLAB compiler.memoryinitialization.ZeroTLABTest */ + +package compiler.memoryinitialization; + public class ZeroTLABTest { public static void main(String args[]) { System.out.println("Test PASSED"); diff --git a/test/compiler/onSpinWait/TestOnSpinWait.java b/test/compiler/onSpinWait/TestOnSpinWait.java --- a/test/compiler/onSpinWait/TestOnSpinWait.java +++ b/test/compiler/onSpinWait/TestOnSpinWait.java @@ -26,15 +26,16 @@ * @test TestOnSpinWait * @summary (x86 only) checks that java.lang.Thread.onSpinWait is intrinsified * @bug 8147844 + * @library /testlibrary * @modules java.base/jdk.internal.misc - * @library /testlibrary * @requires os.arch=="x86" | os.arch=="amd64" | os.arch=="x86_64" - * @run main TestOnSpinWait + * @run driver compiler.onSpinWait.TestOnSpinWait */ -import java.lang.invoke.*; -import jdk.test.lib.*; -import static jdk.test.lib.Asserts.*; +package compiler.onSpinWait; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; public class TestOnSpinWait { @@ -45,7 +46,7 @@ "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", - "-XX:+PrintInlining", "TestOnSpinWait$Launcher"); + "-XX:+PrintInlining", Launcher.class.getName()); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); @@ -59,7 +60,7 @@ "-XX:+IgnoreUnrecognizedVMOptions", "-showversion", "-XX:-TieredCompilation", "-Xbatch", "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", - "-XX:+PrintInlining", "TestOnSpinWait$Launcher"); + "-XX:+PrintInlining", Launcher.class.getName()); analyzer = new OutputAnalyzer(pb.start()); diff --git a/test/compiler/onSpinWait/TestOnSpinWaitEnableDisable.java b/test/compiler/onSpinWait/TestOnSpinWaitEnableDisable.java --- a/test/compiler/onSpinWait/TestOnSpinWaitEnableDisable.java +++ b/test/compiler/onSpinWait/TestOnSpinWaitEnableDisable.java @@ -26,10 +26,14 @@ * @test TestOnSpinWaitEnableDisable * @summary Test to ensure basic functioning of java.lang.Thread.onSpinWait * @bug 8157683 - * @run main TestOnSpinWaitEnableDisable - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_onSpinWait TestOnSpinWaitEnableDisable + * + * @run main compiler.onSpinWait.TestOnSpinWaitEnableDisable + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_onSpinWait + * compiler.onSpinWait.TestOnSpinWaitEnableDisable */ +package compiler.onSpinWait; + public class TestOnSpinWaitEnableDisable { public static void main(String[] args) { for (int i = 0; i < 50_000; i++) { diff --git a/test/compiler/oracle/CheckCompileCommandOption.java b/test/compiler/oracle/CheckCompileCommandOption.java --- a/test/compiler/oracle/CheckCompileCommandOption.java +++ b/test/compiler/oracle/CheckCompileCommandOption.java @@ -21,21 +21,23 @@ * questions. */ -import java.io.PrintWriter; -import java.io.File; - -import jdk.test.lib.*; - /* * @test CheckCompileCommandOption + * @summary Checks parsing of -XX:CompileCommand=option * @bug 8055286 8056964 8059847 8069035 - * @summary "Checks parsing of -XX:CompileCommand=option" * @library /testlibrary * @modules java.base/jdk.internal.misc * java.management - * @run main CheckCompileCommandOption + * @run driver compiler.oracle.CheckCompileCommandOption */ +package compiler.oracle; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + +import java.io.File; + public class CheckCompileCommandOption { // Currently, two types of trailing options can be used with diff --git a/test/compiler/oracle/GetMethodOptionTest.java b/test/compiler/oracle/GetMethodOptionTest.java --- a/test/compiler/oracle/GetMethodOptionTest.java +++ b/test/compiler/oracle/GetMethodOptionTest.java @@ -21,32 +21,34 @@ * questions. */ -import java.lang.reflect.Executable; -import java.util.function.BiFunction; +/* + * @test + * @bug 8074980 + * @library /testlibrary /test/lib + * @modules java.base/jdk.internal.misc + * @build sun.hotspot.WhiteBox jdk.test.lib.Asserts compiler.oracle.GetMethodOptionTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,ccstrlist,MyListOption,_foo,_bar + * -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,ccstr,MyStrOption,_foo + * -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,bool,MyBoolOption,false + * -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,intx,MyIntxOption,-1 + * -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,uintx,MyUintxOption,1 + * -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,MyFlag + * -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,double,MyDoubleOption1,1.123 + * -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,double,MyDoubleOption2,1.123 + * -XX:CompileCommand=option,compiler.oracle.GetMethodOptionTest::test,bool,MyBoolOptionX,false,intx,MyIntxOptionX,-1,uintx,MyUintxOptionX,1,MyFlagX,double,MyDoubleOptionX,1.123 + * compiler.oracle.GetMethodOptionTest + */ + +package compiler.oracle; import jdk.test.lib.Asserts; import sun.hotspot.WhiteBox; -/* - * @test - * @bug 8074980 - * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build sun.hotspot.WhiteBox jdk.test.lib.Asserts GetMethodOptionTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:CompileCommand=option,GetMethodOptionTest::test,ccstrlist,MyListOption,_foo,_bar - * -XX:CompileCommand=option,GetMethodOptionTest::test,ccstr,MyStrOption,_foo - * -XX:CompileCommand=option,GetMethodOptionTest::test,bool,MyBoolOption,false - * -XX:CompileCommand=option,GetMethodOptionTest::test,intx,MyIntxOption,-1 - * -XX:CompileCommand=option,GetMethodOptionTest::test,uintx,MyUintxOption,1 - * -XX:CompileCommand=option,GetMethodOptionTest::test,MyFlag - * -XX:CompileCommand=option,GetMethodOptionTest::test,double,MyDoubleOption1,1.123 - * -XX:CompileCommand=option,GetMethodOptionTest.test,double,MyDoubleOption2,1.123 - * -XX:CompileCommand=option,GetMethodOptionTest::test,bool,MyBoolOptionX,false,intx,MyIntxOptionX,-1,uintx,MyUintxOptionX,1,MyFlagX,double,MyDoubleOptionX,1.123 - * GetMethodOptionTest - */ +import java.lang.reflect.Executable; +import java.util.function.BiFunction; public class GetMethodOptionTest { private static final WhiteBox WB = WhiteBox.getWhiteBox(); diff --git a/test/compiler/oracle/MethodMatcherTest.java b/test/compiler/oracle/MethodMatcherTest.java --- a/test/compiler/oracle/MethodMatcherTest.java +++ b/test/compiler/oracle/MethodMatcherTest.java @@ -23,21 +23,24 @@ /* * @test MethodMatcherTest - * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @build sun.hotspot.WhiteBox - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI MethodMatcherTest * @summary Testing of compiler/MethodMatcher * @bug 8135068 + * @library /testlibrary /test/lib + * @modules java.base/jdk.internal.misc + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * compiler.oracle.MethodMatcherTest */ +package compiler.oracle; + +import sun.hotspot.WhiteBox; + import java.lang.reflect.Method; import java.util.ArrayList; -import sun.hotspot.WhiteBox; - public class MethodMatcherTest { /** Instance of WhiteBox */ @@ -83,14 +86,14 @@ testCases.add(helper, "_pool,sub,Klass*,met@%hod,(0)V", PARSING_FAILURE); testCases.add(helper, "*.*", MATCH); - testCases.add(helper, "MethodMatcherTest.*", MATCH); - testCases.add(helper, "MethodMatcherTest.helper", MATCH); - testCases.add(helper, "MethodMatcherTest.helper()", MATCH); - testCases.add(helper, "MethodMatcherTest.helper()V", MATCH); - testCases.add(helper, "MethodMatcherTest.helper()V;", NO_MATCH); - testCases.add(helper, "MethodMatcherTest.helper()I", NO_MATCH); - testCases.add(helper, "MethodMatcherTest.helperX", NO_MATCH); - testCases.add(helper, "MethodMatcherTestX.helper;", NO_MATCH); + testCases.add(helper, "compiler/oracle/MethodMatcherTest.*", MATCH); + testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper", MATCH); + testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper()", MATCH); + testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper()V", MATCH); + testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper()V;", NO_MATCH); + testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper()I", NO_MATCH); + testCases.add(helper, "compiler/oracle/MethodMatcherTest.helperX", NO_MATCH); + testCases.add(helper, "compiler/oracle/MethodMatcherTest.helper;", NO_MATCH); testCases.add(helper, "abc.*", NO_MATCH); testCases.add(helper, "*.abc", NO_MATCH); @@ -100,13 +103,13 @@ testCases.add(getDate, "java/util/Date.*", MATCH); testCases.add(inner, "*.*", MATCH); - testCases.add(inner, "MethodMatcherTest$TestCases.innerHelper", MATCH); - testCases.add(inner, "MethodMatcherTest*.innerHelper", MATCH); - testCases.add(inner, "MethodMatcherTest$*.innerHelper", MATCH); + testCases.add(inner, "compiler/oracle/MethodMatcherTest$TestCases.innerHelper", MATCH); + testCases.add(inner, "compiler/oracle/MethodMatcherTest*.innerHelper", MATCH); + testCases.add(inner, "compiler/oracle/MethodMatcherTest$*.innerHelper", MATCH); testCases.add(inner, "*$TestCases.innerHelper", MATCH); testCases.add(inner, "*TestCases.innerHelper", MATCH); testCases.add(inner, "TestCases.innerHelper", NO_MATCH); - testCases.add(inner, "MethodMatcherTest.innerHelper", NO_MATCH); + testCases.add(inner, "compiler/oracle/MethodMatcherTest.innerHelper", NO_MATCH); testCases.add(toString, "*.*", MATCH); testCases.add(toString, "java/lang/String.toString", MATCH); diff --git a/test/compiler/oracle/TestCompileCommand.java b/test/compiler/oracle/TestCompileCommand.java --- a/test/compiler/oracle/TestCompileCommand.java +++ b/test/compiler/oracle/TestCompileCommand.java @@ -21,21 +21,21 @@ * questions. */ -import java.io.PrintWriter; -import java.io.File; - -import jdk.test.lib.*; - /* * @test TestCompileCommand * @bug 8069389 - * @summary "Regression tests of -XX:CompileCommand" + * @summary Regression tests of -XX:CompileCommand * @library /testlibrary * @modules java.base/jdk.internal.misc * java.management - * @run main TestCompileCommand + * @run driver compiler.oracle.TestCompileCommand */ +package compiler.oracle; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + public class TestCompileCommand { private static final String[][] ARGUMENTS = { diff --git a/test/compiler/osr/TestOSRWithNonEmptyStack.java b/test/compiler/osr/TestOSRWithNonEmptyStack.java --- a/test/compiler/osr/TestOSRWithNonEmptyStack.java +++ b/test/compiler/osr/TestOSRWithNonEmptyStack.java @@ -21,22 +21,37 @@ * questions. */ -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; - -import jdk.internal.org.objectweb.asm.ClassWriter; -import jdk.internal.org.objectweb.asm.Label; -import jdk.internal.org.objectweb.asm.MethodVisitor; -import static jdk.internal.org.objectweb.asm.Opcodes.*; - /** * @test * @bug 8051344 * @summary Force OSR compilation with non-empty stack at the OSR entry point. * @modules java.base/jdk.internal.org.objectweb.asm - * @compile -XDignore.symbol.file TestOSRWithNonEmptyStack.java - * @run main/othervm -XX:CompileOnly=TestCase.test TestOSRWithNonEmptyStack + * @run main/othervm -XX:CompileCommand=compileonly,TestCase::test + * compiler.osr.TestOSRWithNonEmptyStack */ + +package compiler.osr; + +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.Label; +import jdk.internal.org.objectweb.asm.MethodVisitor; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; + +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD; +import static jdk.internal.org.objectweb.asm.Opcodes.DUP; +import static jdk.internal.org.objectweb.asm.Opcodes.IADD; +import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_0; +import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_1; +import static jdk.internal.org.objectweb.asm.Opcodes.IF_ICMPLT; +import static jdk.internal.org.objectweb.asm.Opcodes.ILOAD; +import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL; +import static jdk.internal.org.objectweb.asm.Opcodes.ISTORE; +import static jdk.internal.org.objectweb.asm.Opcodes.POP; +import static jdk.internal.org.objectweb.asm.Opcodes.RETURN; + public class TestOSRWithNonEmptyStack extends ClassLoader { private static final int CLASS_FILE_VERSION = 52; private static final String CLASS_NAME = "TestCase"; diff --git a/test/compiler/osr/TestRangeCheck.java b/test/compiler/osr/TestRangeCheck.java --- a/test/compiler/osr/TestRangeCheck.java +++ b/test/compiler/osr/TestRangeCheck.java @@ -25,8 +25,11 @@ * @test TestRangeCheck * @bug 8054883 * @summary Tests that range check is not skipped + * @run main compiler.osr.TestRangeCheck */ +package compiler.osr; + public class TestRangeCheck { public static void main(String args[]) { try { diff --git a/test/compiler/print/PrintInlining.java b/test/compiler/print/PrintInlining.java --- a/test/compiler/print/PrintInlining.java +++ b/test/compiler/print/PrintInlining.java @@ -25,12 +25,15 @@ * @test * @bug 8022585 * @summary VM crashes when ran with -XX:+PrintInlining - * @run main/othervm -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining PrintInlining + * @run main/othervm -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining + * compiler.print.PrintInlining * */ +package compiler.print; + public class PrintInlining { - public static void main(String[] args) { - System.out.println("Passed"); - } + public static void main(String[] args) { + System.out.println("Passed"); + } } diff --git a/test/compiler/print/TestProfileReturnTypePrinting.java b/test/compiler/print/TestProfileReturnTypePrinting.java --- a/test/compiler/print/TestProfileReturnTypePrinting.java +++ b/test/compiler/print/TestProfileReturnTypePrinting.java @@ -24,14 +24,17 @@ /** * @test * @bug 8073154 - * @build TestProfileReturnTypePrinting + * @build compiler.print.TestProfileReturnTypePrinting * @run main/othervm -XX:TypeProfileLevel=020 - * -XX:CompileOnly=TestProfileReturnTypePrinting.testMethod + * -XX:CompileCommand=compileonly,compiler.print.TestProfileReturnTypePrinting::testMethod * -XX:+IgnoreUnrecognizedVMOptions -XX:+PrintLIR - * TestProfileReturnTypePrinting + * compiler.print.TestProfileReturnTypePrinting * @summary Verify that c1's LIR that contains ProfileType node could be dumped * without a crash disregard to an exact class knowledge. */ + +package compiler.print; + public class TestProfileReturnTypePrinting { private static final int ITERATIONS = 1_000_000; diff --git a/test/compiler/profiling/TestMethodHandleInvokesIntrinsic.java b/test/compiler/profiling/TestMethodHandleInvokesIntrinsic.java --- a/test/compiler/profiling/TestMethodHandleInvokesIntrinsic.java +++ b/test/compiler/profiling/TestMethodHandleInvokesIntrinsic.java @@ -25,11 +25,18 @@ * @test * @bug 8041458 * @summary profiling of arguments in C1 at MethodHandle invoke of intrinsic tries to profile popped argument. - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TieredStopAtLevel=3 TestMethodHandleInvokesIntrinsic + * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:TieredStopAtLevel=3 + * compiler.profiling.TestMethodHandleInvokesIntrinsic * */ -import java.lang.invoke.*; +package compiler.profiling; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; public class TestMethodHandleInvokesIntrinsic { diff --git a/test/compiler/profiling/TestSpecTrapClassUnloading.java b/test/compiler/profiling/TestSpecTrapClassUnloading.java --- a/test/compiler/profiling/TestSpecTrapClassUnloading.java +++ b/test/compiler/profiling/TestSpecTrapClassUnloading.java @@ -25,10 +25,18 @@ * @test * @bug 8031752 * @summary speculative traps need to be cleaned up at GC - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:+UseTypeSpeculation -XX:TypeProfileLevel=222 -XX:CompileCommand=exclude,java.lang.reflect.Method::invoke -XX:CompileCommand=exclude,sun.reflect.DelegatingMethodAccessorImpl::invoke -Xmx512M TestSpecTrapClassUnloading * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation + * -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * -XX:+UseTypeSpeculation -XX:TypeProfileLevel=222 + * -XX:CompileCommand=exclude,java.lang.reflect.Method::invoke + * -XX:CompileCommand=exclude,sun.reflect.DelegatingMethodAccessorImpl::invoke + * -Xmx512M + * compiler.profiling.TestSpecTrapClassUnloading */ +package compiler.profiling; + import java.lang.reflect.Method; public class TestSpecTrapClassUnloading { diff --git a/test/compiler/profiling/TestUnexpectedProfilingMismatch.java b/test/compiler/profiling/TestUnexpectedProfilingMismatch.java --- a/test/compiler/profiling/TestUnexpectedProfilingMismatch.java +++ b/test/compiler/profiling/TestUnexpectedProfilingMismatch.java @@ -25,11 +25,17 @@ * @test * @bug 8027631 * @summary profiling of arguments at calls cannot rely on signature of callee for types - * @run main/othervm -XX:-BackgroundCompilation -XX:TieredStopAtLevel=3 -XX:TypeProfileLevel=111 -XX:Tier3InvocationThreshold=200 -XX:Tier0InvokeNotifyFreqLog=7 TestUnexpectedProfilingMismatch * + * @run main/othervm -XX:-BackgroundCompilation -XX:TieredStopAtLevel=3 -XX:TypeProfileLevel=111 + * -XX:Tier3InvocationThreshold=200 -XX:Tier0InvokeNotifyFreqLog=7 + * compiler.profiling.TestUnexpectedProfilingMismatch */ -import java.lang.invoke.*; +package compiler.profiling; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; public class TestUnexpectedProfilingMismatch { diff --git a/test/compiler/profiling/UnsafeAccess.java b/test/compiler/profiling/UnsafeAccess.java --- a/test/compiler/profiling/UnsafeAccess.java +++ b/test/compiler/profiling/UnsafeAccess.java @@ -24,10 +24,14 @@ * @test * @bug 8134918 * @modules java.base/jdk.internal.misc + * * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation -Xbatch - * -XX:CompileCommand=dontinline,UnsafeAccess::test* - * UnsafeAccess + * -XX:CompileCommand=dontinline,compiler.profiling.UnsafeAccess::test* + * compiler.profiling.UnsafeAccess */ + +package compiler.profiling; + import jdk.internal.misc.Unsafe; public class UnsafeAccess { diff --git a/test/compiler/profiling/spectrapredefineclass/Agent.java b/test/compiler/profiling/spectrapredefineclass/Agent.java --- a/test/compiler/profiling/spectrapredefineclass/Agent.java +++ b/test/compiler/profiling/spectrapredefineclass/Agent.java @@ -21,11 +21,14 @@ * questions. */ -import java.security.*; -import java.lang.instrument.*; -import java.lang.reflect.*; +package compiler.profiling.spectrapredefineclass; + +import com.sun.tools.attach.VirtualMachine; + +import java.lang.instrument.ClassFileTransformer; +import java.lang.instrument.Instrumentation; import java.lang.management.ManagementFactory; -import com.sun.tools.attach.VirtualMachine; +import java.security.ProtectionDomain; class A { void m() { diff --git a/test/compiler/profiling/spectrapredefineclass/Launcher.java b/test/compiler/profiling/spectrapredefineclass/Launcher.java --- a/test/compiler/profiling/spectrapredefineclass/Launcher.java +++ b/test/compiler/profiling/spectrapredefineclass/Launcher.java @@ -20,8 +20,6 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -import java.io.PrintWriter; -import jdk.test.lib.*; /* * @test @@ -30,21 +28,34 @@ * @modules java.base/jdk.internal.misc * java.instrument * java.management - * @build Agent - * @run main ClassFileInstaller Agent - * @run main Launcher - * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:ReservedCodeCacheSize=3M Agent + * @build compiler.profiling.spectrapredefineclass_classloaders.Agent + * @run driver ClassFileInstaller compiler.profiling.spectrapredefineclass.Agent + * @run driver compiler.profiling.spectrapredefineclass.Launcher + * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation + * -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 + * -XX:ReservedCodeCacheSize=3M + * compiler.profiling.spectrapredefineclass.Agent */ + +package compiler.profiling.spectrapredefineclass; + +import jdk.test.lib.JDKToolFinder; + +import java.io.File; +import java.io.PrintWriter; + public class Launcher { public static void main(String[] args) throws Exception { PrintWriter pw = new PrintWriter("MANIFEST.MF"); - pw.println("Agent-Class: Agent"); + pw.println("Agent-Class: " + Launcher.class.getPackage().getName() +".Agent"); pw.println("Can-Retransform-Classes: true"); pw.close(); ProcessBuilder pb = new ProcessBuilder(); - pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", System.getProperty("test.classes",".") + "/agent.jar", "Agent.class"}); + pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", + System.getProperty("test.classes",".") + "/agent.jar", + "compiler/profiling/spectrapredefineclass/Agent.class".replace('/', File.separatorChar)}); pb.start().waitFor(); } } diff --git a/test/compiler/profiling/spectrapredefineclass_classloaders/A.java b/test/compiler/profiling/spectrapredefineclass_classloaders/A.java --- a/test/compiler/profiling/spectrapredefineclass_classloaders/A.java +++ b/test/compiler/profiling/spectrapredefineclass_classloaders/A.java @@ -1,3 +1,5 @@ +package compiler.profiling.spectrapredefineclass_classloaders; + public class A { void m() { } diff --git a/test/compiler/profiling/spectrapredefineclass_classloaders/Agent.java b/test/compiler/profiling/spectrapredefineclass_classloaders/Agent.java --- a/test/compiler/profiling/spectrapredefineclass_classloaders/Agent.java +++ b/test/compiler/profiling/spectrapredefineclass_classloaders/Agent.java @@ -21,16 +21,19 @@ * questions. */ -import java.security.*; -import java.lang.instrument.*; -import java.lang.reflect.*; +package compiler.profiling.spectrapredefineclass_classloaders; + +import com.sun.tools.attach.VirtualMachine; + +import java.lang.instrument.ClassFileTransformer; +import java.lang.instrument.Instrumentation; import java.lang.management.ManagementFactory; -import com.sun.tools.attach.VirtualMachine; -import java.lang.reflect.*; +import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.nio.file.Paths; +import java.security.ProtectionDomain; public class Agent implements ClassFileTransformer { public static ClassLoader newClassLoader() { @@ -49,11 +52,12 @@ // loader2 must be first on the list so loader 1 must be used first ClassLoader loader1 = newClassLoader(); - Class dummy = loader1.loadClass("Test"); + String packageName = Agent.class.getPackage().getName(); + Class dummy = loader1.loadClass(packageName + ".Test"); ClassLoader loader2 = newClassLoader(); - Test_class = loader2.loadClass("Test"); + Test_class = loader2.loadClass(packageName + ".Test"); Method m3 = Test_class.getMethod("m3", ClassLoader.class); // Add speculative trap in m2() (loaded by loader1) that // references m4() (loaded by loader2). diff --git a/test/compiler/profiling/spectrapredefineclass_classloaders/B.java b/test/compiler/profiling/spectrapredefineclass_classloaders/B.java --- a/test/compiler/profiling/spectrapredefineclass_classloaders/B.java +++ b/test/compiler/profiling/spectrapredefineclass_classloaders/B.java @@ -1,3 +1,5 @@ +package compiler.profiling.spectrapredefineclass_classloaders; + public class B extends A { void m() { } diff --git a/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java b/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java --- a/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java +++ b/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java @@ -20,8 +20,6 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -import java.io.PrintWriter; -import jdk.test.lib.*; /* * @test @@ -30,21 +28,37 @@ * @modules java.base/jdk.internal.misc * java.instrument * java.management - * @build Agent Test A B - * @run main ClassFileInstaller Agent - * @run main Launcher - * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:ReservedCodeCacheSize=3M Agent + * @build compiler.profiling.spectrapredefineclass_classloaders.Agent + * compiler.profiling.spectrapredefineclass_classloaders.Test + * compiler.profiling.spectrapredefineclass_classloaders.A + * compiler.profiling.spectrapredefineclass_classloaders.B + * @run driver ClassFileInstaller compiler.profiling.spectrapredefineclass_classloaders.Agent + * @run driver compiler.profiling.spectrapredefineclass_classloaders.Launcher + * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation + * -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 + * -XX:ReservedCodeCacheSize=3M + * compiler.profiling.spectrapredefineclass_classloaders.Agent */ +package compiler.profiling.spectrapredefineclass_classloaders; + +import jdk.test.lib.JDKToolFinder; + +import java.io.File; +import java.io.PrintWriter; + public class Launcher { - public static void main(String[] args) throws Exception { + public static void main(String[] args) throws Exception { - PrintWriter pw = new PrintWriter("MANIFEST.MF"); - pw.println("Agent-Class: Agent"); - pw.println("Can-Retransform-Classes: true"); - pw.close(); + PrintWriter pw = new PrintWriter("MANIFEST.MF"); - ProcessBuilder pb = new ProcessBuilder(); - pb.command(new String[] { JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", System.getProperty("test.classes",".") + "/agent.jar", "Agent.class"}); - pb.start().waitFor(); + pw.println("Agent-Class: " + Launcher.class.getPackage().getName() + ".Agent"); + pw.println("Can-Retransform-Classes: true"); + pw.close(); + + ProcessBuilder pb = new ProcessBuilder(); + pb.command(new String[]{JDKToolFinder.getJDKTool("jar"), "cmf", "MANIFEST.MF", + System.getProperty("test.classes", ".") + "/agent.jar", + "compiler/profiling/spectrapredefineclass/Agent.class".replace('/', File.separatorChar)}); + pb.start().waitFor(); } } diff --git a/test/compiler/profiling/spectrapredefineclass_classloaders/Test.java b/test/compiler/profiling/spectrapredefineclass_classloaders/Test.java --- a/test/compiler/profiling/spectrapredefineclass_classloaders/Test.java +++ b/test/compiler/profiling/spectrapredefineclass_classloaders/Test.java @@ -1,4 +1,6 @@ -import java.lang.reflect.*; +package compiler.profiling.spectrapredefineclass_classloaders; + +import java.lang.reflect.Method; public class Test { @@ -19,11 +21,12 @@ } public void m3(ClassLoader loader) throws Exception { - Class Test_class = loader.loadClass("Test"); + String packageName = Test.class.getPackage().getName(); + Class Test_class = loader.loadClass(packageName + ".Test"); Object test = Test_class.newInstance(); - Class A_class = loader.loadClass("A"); + Class A_class = loader.loadClass(packageName + ".A"); Object a = A_class.newInstance(); - Class B_class = loader.loadClass("B"); + Class B_class = loader.loadClass(packageName + ".B"); Object b = B_class.newInstance(); Method m1 = Test_class.getMethod("m1", A_class, Boolean.class); diff --git a/test/compiler/profiling/unloadingconflict/B.java b/test/compiler/profiling/unloadingconflict/B.java --- a/test/compiler/profiling/unloadingconflict/B.java +++ b/test/compiler/profiling/unloadingconflict/B.java @@ -21,5 +21,7 @@ * questions. */ +package compiler.profiling.unloadingconflict; + public class B { } diff --git a/test/compiler/profiling/unloadingconflict/TestProfileConflictClassUnloading.java b/test/compiler/profiling/unloadingconflict/TestProfileConflictClassUnloading.java --- a/test/compiler/profiling/unloadingconflict/TestProfileConflictClassUnloading.java +++ b/test/compiler/profiling/unloadingconflict/TestProfileConflictClassUnloading.java @@ -24,12 +24,17 @@ /* * @test * @bug 8027572 - * @summary class unloading resets profile, method compiled after the profile is first set and before class loading sets unknown bit with not recorded class - * @build B - * @run main/othervm -XX:TypeProfileLevel=222 -XX:-BackgroundCompilation TestProfileConflictClassUnloading + * @summary class unloading resets profile, method compiled after the profile is + * first set and before class loading sets unknown bit with not recorded class + * @library / + * @build compiler.profiling.unloadingconflict.B + * @run main/othervm -XX:TypeProfileLevel=222 -XX:-BackgroundCompilation + * compiler.profiling.unloadingconflict.TestProfileConflictClassUnloading * */ +package compiler.profiling.unloadingconflict; + import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; @@ -66,7 +71,7 @@ public static void main(String[] args) throws Exception { ClassLoader loader = newClassLoader(); - Object o = loader.loadClass("B").newInstance(); + Object o = loader.loadClass("compiler.profiling.unloadingconflict.B").newInstance(); // collect conflicting profiles for (int i = 0; i < 5000; i++) { m2(o); diff --git a/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java b/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java --- a/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java +++ b/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java @@ -26,11 +26,16 @@ * @test * @bug 8003585 * @summary strength reduce or eliminate range checks for power-of-two sized arrays - * @run main/othervm -XX:CompileCommand=compileonly,PowerOf2SizedArraysChecks::test* -XX:-BackgroundCompilation PowerOf2SizedArraysChecks * + * @run main/othervm -XX:CompileCommand=compileonly,compiler.rangechecks.PowerOf2SizedArraysChecks::test* + * -XX:-BackgroundCompilation + * compiler.rangechecks.PowerOf2SizedArraysChecks */ -import java.util.function.*; +package compiler.rangechecks; + +import java.util.function.BiFunction; +import java.util.function.Function; public class PowerOf2SizedArraysChecks { diff --git a/test/compiler/rangechecks/TestBadFoldCompare.java b/test/compiler/rangechecks/TestBadFoldCompare.java --- a/test/compiler/rangechecks/TestBadFoldCompare.java +++ b/test/compiler/rangechecks/TestBadFoldCompare.java @@ -26,9 +26,13 @@ * @bug 8085832 * @bug 8135069 * @summary x <= 0 || x > 0 wrongly folded as (x-1) >u -1 and x < 0 || x > -1 wrongly folded as x >u -1 - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestBadFoldCompare + * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.rangechecks.TestBadFoldCompare */ +package compiler.rangechecks; + public class TestBadFoldCompare { static boolean test1_taken; diff --git a/test/compiler/rangechecks/TestExplicitRangeChecks.java b/test/compiler/rangechecks/TestExplicitRangeChecks.java --- a/test/compiler/rangechecks/TestExplicitRangeChecks.java +++ b/test/compiler/rangechecks/TestExplicitRangeChecks.java @@ -25,24 +25,31 @@ * @test * @bug 8073480 * @summary explicit range checks should be recognized by C2 + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib / - * @build TestExplicitRangeChecks + * @build compiler.rangechecks.TestExplicitRangeChecks * @run driver ClassFileInstaller sun.hotspot.WhiteBox * jdk.test.lib.Platform * @run main/othervm -ea -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=compileonly,TestExplicitRangeChecks.test* TestExplicitRangeChecks + * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:CompileCommand=compileonly,compiler.rangechecks.TestExplicitRangeChecks::test* + * compiler.rangechecks.TestExplicitRangeChecks * */ -import java.lang.annotation.*; -import java.lang.reflect.*; -import java.util.*; +package compiler.rangechecks; + +import compiler.whitebox.CompilerWhiteBoxTest; +import jdk.internal.misc.Unsafe; +import jdk.test.lib.Platform; import sun.hotspot.WhiteBox; -import sun.hotspot.code.NMethod; -import jdk.test.lib.Platform; -import jdk.internal.misc.Unsafe; -import compiler.whitebox.CompilerWhiteBoxTest; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.HashMap; public class TestExplicitRangeChecks { private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); diff --git a/test/compiler/rangechecks/TestRangeCheckEliminationDisabled.java b/test/compiler/rangechecks/TestRangeCheckEliminationDisabled.java --- a/test/compiler/rangechecks/TestRangeCheckEliminationDisabled.java +++ b/test/compiler/rangechecks/TestRangeCheckEliminationDisabled.java @@ -26,8 +26,14 @@ * @test TestRangeCheckEliminationDisabled * @bug 8154763 * @summary Tests PostLoopMultiversioning with RangeCheckElimination disabled. - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+PostLoopMultiversioning -XX:-RangeCheckElimination TestRangeCheckEliminationDisabled + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+PostLoopMultiversioning + * -XX:-RangeCheckElimination + * compiler.rangechecks.TestRangeCheckEliminationDisabled */ + +package compiler.rangechecks; + public class TestRangeCheckEliminationDisabled { public static void main(String[] args) { diff --git a/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm b/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm --- a/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm +++ b/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm @@ -22,7 +22,7 @@ * */ -super public class TestRangeCheckExceptionHandlerLoop +super public class compiler/rangechecks/TestRangeCheckExceptionHandlerLoop version 51:0 { diff --git a/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java b/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java --- a/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java +++ b/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java @@ -26,10 +26,14 @@ * @test * @bug 8134883 * @summary C1's range check elimination breaks with a non-natural loop that an exception handler as one entry + * * @compile TestRangeCheckExceptionHandlerLoop.jasm - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestRangeCheckExceptionHandlerLoopMain + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.rangechecks.TestRangeCheckExceptionHandlerLoopMain */ +package compiler.rangechecks; + public class TestRangeCheckExceptionHandlerLoopMain { public static void main(String[] args) throws Exception { Exception exception = new Exception(); diff --git a/test/compiler/rangechecks/TestRangeCheckSmearing.java b/test/compiler/rangechecks/TestRangeCheckSmearing.java --- a/test/compiler/rangechecks/TestRangeCheckSmearing.java +++ b/test/compiler/rangechecks/TestRangeCheckSmearing.java @@ -28,21 +28,27 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRangeCheckSmearing + * @build compiler.rangechecks.TestRangeCheckSmearing * @run driver ClassFileInstaller sun.hotspot.WhiteBox * jdk.test.lib.Platform * @run main/othervm -ea -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestRangeCheckSmearing + * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.rangechecks.TestRangeCheckSmearing * */ -import java.lang.annotation.*; -import java.lang.reflect.*; -import java.util.*; +package compiler.rangechecks; + +import compiler.whitebox.CompilerWhiteBoxTest; +import jdk.test.lib.Platform; import sun.hotspot.WhiteBox; -import sun.hotspot.code.NMethod; -import jdk.test.lib.Platform; -import compiler.whitebox.CompilerWhiteBoxTest; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.Arrays; +import java.util.HashMap; public class TestRangeCheckSmearing { private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); diff --git a/test/compiler/rangechecks/TestRangeCheckSmearingLoopOpts.java b/test/compiler/rangechecks/TestRangeCheckSmearingLoopOpts.java --- a/test/compiler/rangechecks/TestRangeCheckSmearingLoopOpts.java +++ b/test/compiler/rangechecks/TestRangeCheckSmearingLoopOpts.java @@ -25,9 +25,13 @@ * @test * @bug 8048170 * @summary Following range check smearing, range check cannot be replaced by dominating identical test. - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestRangeCheckSmearingLoopOpts * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.rangechecks.TestRangeCheckSmearingLoopOpts */ + +package compiler.rangechecks; + public class TestRangeCheckSmearingLoopOpts { static int dummy; diff --git a/test/compiler/rangechecks/TestUncommonTrapMerging.java b/test/compiler/rangechecks/TestUncommonTrapMerging.java --- a/test/compiler/rangechecks/TestUncommonTrapMerging.java +++ b/test/compiler/rangechecks/TestUncommonTrapMerging.java @@ -25,9 +25,16 @@ * @test * @bug 8140574 * @summary Verify proper re-execution of checks after merging of uncommon traps - * @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileCommand=compileonly,TestUncommonTrapMerging::test* TestUncommonTrapMerging Test1 - * @run main/othervm -XX:CompileCommand=compileonly,TestUncommonTrapMerging::test* TestUncommonTrapMerging Test2 + * + * @run main/othervm -Xcomp -XX:-TieredCompilation + * -XX:CompileCommand=compileonly,TestUncommonTrapMerging::test* + * compiler.rangechecks.TestUncommonTrapMerging Test1 + * @run main/othervm -XX:CompileCommand=compileonly,TestUncommonTrapMerging::test* + * compiler.rangechecks.TestUncommonTrapMerging Test2 */ + +package compiler.rangechecks; + public class TestUncommonTrapMerging { public static void main(String[] args) throws Throwable { diff --git a/test/compiler/reflection/ArrayNewInstanceOfVoid.java b/test/compiler/reflection/ArrayNewInstanceOfVoid.java --- a/test/compiler/reflection/ArrayNewInstanceOfVoid.java +++ b/test/compiler/reflection/ArrayNewInstanceOfVoid.java @@ -25,8 +25,12 @@ * @test * @bug 8029366 * @summary ShouldNotReachHere error when creating an array with component type of void + * + * @run main compiler.reflection.ArrayNewInstanceOfVoid */ +package compiler.reflection; + public class ArrayNewInstanceOfVoid { public static void main(String[] args) { for (int i = 0; i < 100_000; i++) { diff --git a/test/compiler/regalloc/C1ObjectSpillInLogicOp.java b/test/compiler/regalloc/C1ObjectSpillInLogicOp.java --- a/test/compiler/regalloc/C1ObjectSpillInLogicOp.java +++ b/test/compiler/regalloc/C1ObjectSpillInLogicOp.java @@ -24,24 +24,28 @@ /* * @test * @bug 8027751 + * @summary C1 crashes generating G1 post-barrier in Unsafe.getAndSetObject() intrinsic because of the new value spill * @requires vm.gc.G1 - * @summary C1 crashes generating G1 post-barrier in Unsafe.getAndSetObject() intrinsic because of the new value spill - * @run main/othervm -XX:+UseG1GC C1ObjectSpillInLogicOp * + * @run main/othervm -XX:+UseG1GC compiler.regalloc.C1ObjectSpillInLogicOp + */ + +package compiler.regalloc; + +import java.util.concurrent.atomic.AtomicReferenceArray; + +/* * G1 barriers use logical operators (xor) on T_OBJECT mixed with T_LONG or T_INT. * The current implementation of logical operations on x86 in C1 doesn't allow for long operands to be on stack. * There is a special code in the register allocator that forces long arguments in registers on x86. However T_OBJECT * can be spilled just fine, and in that case the xor emission will fail. */ - -import java.util.concurrent.atomic.*; - public class C1ObjectSpillInLogicOp { - public static void main(String[] args) { - AtomicReferenceArray x = new AtomicReferenceArray(128); - Integer y = new Integer(0); - for (int i = 0; i < 50000; i++) { - x.getAndSet(i % x.length(), y); + public static void main(String[] args) { + AtomicReferenceArray x = new AtomicReferenceArray(128); + Integer y = new Integer(0); + for (int i = 0; i < 50000; i++) { + x.getAndSet(i % x.length(), y); + } } - } } diff --git a/test/compiler/regalloc/TestVectorRegAlloc.java b/test/compiler/regalloc/TestVectorRegAlloc.java --- a/test/compiler/regalloc/TestVectorRegAlloc.java +++ b/test/compiler/regalloc/TestVectorRegAlloc.java @@ -25,11 +25,14 @@ /** * @test * @bug 8131969 - * @summary assert in register allocation code when vector Phi for a loop is processed because code assumes all inputs already processed - * @run main/othervm -Xbatch TestVectorRegAlloc + * @summary assert in register allocation code when vector Phi for a loop is + * processed because code assumes all inputs already processed * + * @run main/othervm -Xbatch compiler.regalloc.TestVectorRegAlloc */ +package compiler.regalloc; + public class TestVectorRegAlloc { static int test_helper_i; diff --git a/test/compiler/relocations/TestPrintRelocations.java b/test/compiler/relocations/TestPrintRelocations.java --- a/test/compiler/relocations/TestPrintRelocations.java +++ b/test/compiler/relocations/TestPrintRelocations.java @@ -25,14 +25,19 @@ * @test * @bug 8044538 * @summary assert hit while printing relocations for jump table entries - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:+PrintRelocations TestPrintRelocations + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:+PrintRelocations + * compiler.relocations.TestPrintRelocations */ - /** * The test compiles all methods (-Xcomp) and prints their relocation * entries (-XX:+PrintRelocations) to make sure the printing works. */ + +package compiler.relocations; + public class TestPrintRelocations { - static public void main(String[] args) { } + static public void main(String[] args) { + } } diff --git a/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java b/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java --- a/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java +++ b/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java @@ -22,8 +22,11 @@ * */ -import jdk.test.lib.*; -import jdk.test.lib.cli.*; +package compiler.rtm.cli; + +import jdk.test.lib.ExitCode; +import jdk.test.lib.Platform; +import jdk.test.lib.cli.CommandLineOptionTest; import java.util.function.BooleanSupplier; diff --git a/test/compiler/rtm/cli/RTMLockingAwareTest.java b/test/compiler/rtm/cli/RTMLockingAwareTest.java --- a/test/compiler/rtm/cli/RTMLockingAwareTest.java +++ b/test/compiler/rtm/cli/RTMLockingAwareTest.java @@ -22,14 +22,16 @@ * */ -import java.util.List; -import java.util.LinkedList; +package compiler.rtm.cli; -import jdk.test.lib.ExitCode; -import jdk.test.lib.cli.*; -import jdk.test.lib.cli.predicate.AndPredicate; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.ExitCode; +import jdk.test.lib.cli.CommandLineOptionTest; +import jdk.test.lib.cli.predicate.AndPredicate; + +import java.util.LinkedList; +import java.util.List; /** * Base for all RTM-related CLI tests on options whose processing depends diff --git a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java --- a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java +++ b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java @@ -22,8 +22,11 @@ * */ -import jdk.test.lib.*; -import jdk.test.lib.cli.*; +package compiler.rtm.cli; + +import jdk.test.lib.ExitCode; +import jdk.test.lib.Platform; +import jdk.test.lib.cli.CommandLineOptionTest; import java.util.function.BooleanSupplier; diff --git a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java --- a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java +++ b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java @@ -30,18 +30,21 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig + * + * @build compiler.rtm.cli.TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig + * compiler.rtm.cli.TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig */ -import jdk.test.lib.cli.*; -import jdk.test.lib.cli.predicate.AndPredicate; +package compiler.rtm.cli; + import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.cli.CommandLineOptionTest; +import jdk.test.lib.cli.predicate.AndPredicate; public class TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig extends TestPrintPreciseRTMLockingStatisticsBase { diff --git a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java --- a/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java +++ b/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java @@ -30,18 +30,21 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig + * + * @build compiler.rtm.cli.TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig + * compiler.rtm.cli.TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig */ +package compiler.rtm.cli; + +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.NotPredicate; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; public class TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig extends TestPrintPreciseRTMLockingStatisticsBase { diff --git a/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java --- a/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java +++ b/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnSupportedConfig.java @@ -30,13 +30,17 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMAbortRatioOptionOnSupportedConfig + * + * @build compiler.rtm.cli.TestRTMAbortRatioOptionOnSupportedConfig * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestRTMAbortRatioOptionOnSupportedConfig + * -XX:+WhiteBoxAPI + * compiler.rtm.cli.TestRTMAbortRatioOptionOnSupportedConfig */ +package compiler.rtm.cli; + public class TestRTMAbortRatioOptionOnSupportedConfig extends RTMLockingAwareTest { private static final String DEFAULT_VALUE = "50"; diff --git a/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java --- a/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java +++ b/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java @@ -30,17 +30,21 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMAbortRatioOptionOnUnsupportedConfig + * + * @build compiler.rtm.cli.TestRTMAbortRatioOptionOnUnsupportedConfig * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestRTMAbortRatioOptionOnUnsupportedConfig + * -XX:+WhiteBoxAPI + * compiler.rtm.cli.TestRTMAbortRatioOptionOnUnsupportedConfig */ +package compiler.rtm.cli; + +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.NotPredicate; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; public class TestRTMAbortRatioOptionOnUnsupportedConfig extends RTMGenericCommandLineOptionTest { diff --git a/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java b/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java --- a/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java +++ b/test/compiler/rtm/cli/TestRTMAbortThresholdOption.java @@ -26,13 +26,16 @@ * @test * @bug 8031320 * @summary Verify processing of RTMAbortThreshold option. - * @library /testlibrary + * @library /testlibrary / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMAbortThresholdOption - * @run main/othervm TestRTMAbortThresholdOption + * + * @build compiler.rtm.cli.TestRTMAbortThresholdOption + * @run main/othervm compiler.rtm.cli.TestRTMAbortThresholdOption */ +package compiler.rtm.cli; + public class TestRTMAbortThresholdOption extends RTMGenericCommandLineOptionTest { private static final String DEFAULT_VALUE = "1000"; diff --git a/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java b/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java --- a/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java +++ b/test/compiler/rtm/cli/TestRTMLockingCalculationDelayOption.java @@ -26,13 +26,16 @@ * @test * @bug 8031320 * @summary Verify processing of RTMLockingCalculationDelay option. - * @library /testlibrary + * @library /testlibrary / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMLockingCalculationDelayOption - * @run main/othervm TestRTMLockingCalculationDelayOption + * + * @build compiler.rtm.cli.TestRTMLockingCalculationDelayOption + * @run main/othervm compiler.rtm.cli.TestRTMLockingCalculationDelayOption */ +package compiler.rtm.cli; + public class TestRTMLockingCalculationDelayOption extends RTMGenericCommandLineOptionTest { private static final String DEFAULT_VALUE = "0"; diff --git a/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java b/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java --- a/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java +++ b/test/compiler/rtm/cli/TestRTMLockingThresholdOption.java @@ -26,13 +26,16 @@ * @test * @bug 8031320 * @summary Verify processing of RTMLockingThreshold option. - * @library /testlibrary + * @library /testlibrary / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMLockingThresholdOption - * @run main/othervm TestRTMLockingThresholdOption + * + * @build compiler.rtm.cli.TestRTMLockingThresholdOption + * @run main/othervm compiler.rtm.cli.TestRTMLockingThresholdOption */ +package compiler.rtm.cli; + public class TestRTMLockingThresholdOption extends RTMGenericCommandLineOptionTest { private static final String DEFAULT_VALUE = "10000"; diff --git a/test/compiler/rtm/cli/TestRTMRetryCountOption.java b/test/compiler/rtm/cli/TestRTMRetryCountOption.java --- a/test/compiler/rtm/cli/TestRTMRetryCountOption.java +++ b/test/compiler/rtm/cli/TestRTMRetryCountOption.java @@ -26,13 +26,16 @@ * @test * @bug 8031320 * @summary Verify processing of RTMRetryCount option. - * @library /testlibrary + * @library /testlibrary / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMRetryCountOption - * @run main/othervm TestRTMRetryCountOption + * + * @build compiler.rtm.cli.TestRTMRetryCountOption + * @run main/othervm compiler.rtm.cli.TestRTMRetryCountOption */ +package compiler.rtm.cli; + public class TestRTMRetryCountOption extends RTMGenericCommandLineOptionTest { private static final String DEFAULT_VALUE = "5"; diff --git a/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java b/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java --- a/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java +++ b/test/compiler/rtm/cli/TestRTMSpinLoopCountOption.java @@ -26,13 +26,16 @@ * @test * @bug 8031320 * @summary Verify processing of RTMSpinLoopCount option. - * @library /testlibrary + * @library /testlibrary / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMSpinLoopCountOption - * @run main/othervm TestRTMSpinLoopCountOption + * + * @build compiler.rtm.cli.TestRTMSpinLoopCountOption + * @run main/othervm compiler.rtm.cli.TestRTMSpinLoopCountOption */ +package compiler.rtm.cli; + public class TestRTMSpinLoopCountOption extends RTMGenericCommandLineOptionTest { private static final String DEFAULT_VALUE = "100"; diff --git a/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java --- a/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java +++ b/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnSupportedConfig.java @@ -30,14 +30,17 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMTotalCountIncrRateOptionOnSupportedConfig + * + * @build compiler.rtm.cli.TestRTMTotalCountIncrRateOptionOnSupportedConfig * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestRTMTotalCountIncrRateOptionOnSupportedConfig + * compiler.rtm.cli.TestRTMTotalCountIncrRateOptionOnSupportedConfig */ +package compiler.rtm.cli; + public class TestRTMTotalCountIncrRateOptionOnSupportedConfig extends RTMLockingAwareTest { private static final String DEFAULT_VALUE = "64"; diff --git a/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java --- a/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java +++ b/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java @@ -22,11 +22,6 @@ * */ -import jdk.test.lib.cli.predicate.AndPredicate; -import jdk.test.lib.cli.predicate.NotPredicate; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; - /** * @test * @bug 8031320 @@ -35,14 +30,22 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMTotalCountIncrRateOptionOnUnsupportedConfig + * + * @build compiler.rtm.cli.TestRTMTotalCountIncrRateOptionOnUnsupportedConfig * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestRTMTotalCountIncrRateOptionOnUnsupportedConfig + * compiler.rtm.cli.TestRTMTotalCountIncrRateOptionOnUnsupportedConfig */ +package compiler.rtm.cli; + +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.cli.predicate.AndPredicate; +import jdk.test.lib.cli.predicate.NotPredicate; + public class TestRTMTotalCountIncrRateOptionOnUnsupportedConfig extends RTMGenericCommandLineOptionTest { private static final String DEFAULT_VALUE = "64"; diff --git a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java --- a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java +++ b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java @@ -30,18 +30,22 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMDeoptOptionOnSupportedConfig + * + * @build compiler.rtm.cli.TestUseRTMDeoptOptionOnSupportedConfig * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseRTMDeoptOptionOnSupportedConfig + * -XX:+WhiteBoxAPI + * compiler.rtm.cli.TestUseRTMDeoptOptionOnSupportedConfig */ +package compiler.rtm.cli; + +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; public class TestUseRTMDeoptOptionOnSupportedConfig extends CommandLineOptionTest { diff --git a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java --- a/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java +++ b/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java @@ -30,19 +30,22 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMDeoptOptionOnUnsupportedConfig + * + * @build compiler.rtm.cli.TestUseRTMDeoptOptionOnUnsupportedConfig * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseRTMDeoptOptionOnUnsupportedConfig + * -XX:+WhiteBoxAPI + * compiler.rtm.cli.TestUseRTMDeoptOptionOnUnsupportedConfig */ +package compiler.rtm.cli; + +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.cli.CommandLineOptionTest; - import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.NotPredicate; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; public class TestUseRTMDeoptOptionOnUnsupportedConfig extends RTMGenericCommandLineOptionTest { diff --git a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java --- a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java +++ b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java @@ -30,19 +30,22 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMForStackLocksOptionOnSupportedConfig + * + * @build compiler.rtm.cli.TestUseRTMForStackLocksOptionOnSupportedConfig * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestUseRTMForStackLocksOptionOnSupportedConfig + * compiler.rtm.cli.TestUseRTMForStackLocksOptionOnSupportedConfig */ -import jdk.test.lib.*; -import jdk.test.lib.cli.*; -import jdk.test.lib.cli.predicate.AndPredicate; +package compiler.rtm.cli; + import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.ExitCode; +import jdk.test.lib.cli.CommandLineOptionTest; +import jdk.test.lib.cli.predicate.AndPredicate; public class TestUseRTMForStackLocksOptionOnSupportedConfig extends CommandLineOptionTest { diff --git a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java --- a/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java +++ b/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java @@ -30,20 +30,23 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMForStackLocksOptionOnUnsupportedConfig + * + * @build compiler.rtm.cli.TestUseRTMForStackLocksOptionOnUnsupportedConfig * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI - * TestUseRTMForStackLocksOptionOnUnsupportedConfig + * compiler.rtm.cli.TestUseRTMForStackLocksOptionOnUnsupportedConfig */ +package compiler.rtm.cli; + +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.NotPredicate; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; public class TestUseRTMForStackLocksOptionOnUnsupportedConfig extends RTMGenericCommandLineOptionTest { diff --git a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java --- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java +++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java @@ -30,18 +30,22 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMLockingOptionOnSupportedConfig + * + * @build compiler.rtm.cli.TestUseRTMLockingOptionOnSupportedConfig * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnSupportedConfig + * -XX:+WhiteBoxAPI + * compiler.rtm.cli.TestUseRTMLockingOptionOnSupportedConfig */ -import jdk.test.lib.ExitCode; -import jdk.test.lib.cli.*; -import jdk.test.lib.cli.predicate.AndPredicate; +package compiler.rtm.cli; + import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.ExitCode; +import jdk.test.lib.cli.CommandLineOptionTest; +import jdk.test.lib.cli.predicate.AndPredicate; public class TestUseRTMLockingOptionOnSupportedConfig extends CommandLineOptionTest { diff --git a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java --- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java +++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java @@ -30,19 +30,24 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMLockingOptionOnUnsupportedCPU + * + * @build compiler.rtm.cli.TestUseRTMLockingOptionOnUnsupportedCPU * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnUnsupportedCPU + * -XX:+WhiteBoxAPI + * compiler.rtm.cli.TestUseRTMLockingOptionOnUnsupportedCPU */ -import jdk.test.lib.*; -import jdk.test.lib.cli.*; +package compiler.rtm.cli; + +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.ExitCode; +import jdk.test.lib.Platform; +import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.NotPredicate; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; public class TestUseRTMLockingOptionOnUnsupportedCPU extends CommandLineOptionTest { diff --git a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java --- a/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java +++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java @@ -30,19 +30,23 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMLockingOptionOnUnsupportedVM + * + * @build compiler.rtm.cli.TestUseRTMLockingOptionOnUnsupportedVM * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnUnsupportedVM + * -XX:+WhiteBoxAPI + * compiler.rtm.cli.TestUseRTMLockingOptionOnUnsupportedVM */ +package compiler.rtm.cli; + +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.test.lib.ExitCode; -import jdk.test.lib.cli.*; +import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.NotPredicate; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; public class TestUseRTMLockingOptionOnUnsupportedVM extends CommandLineOptionTest { diff --git a/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java b/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java --- a/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java +++ b/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java @@ -30,18 +30,22 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMLockingOptionWithBiasedLocking + * + * @build compiler.rtm.cli.TestUseRTMLockingOptionWithBiasedLocking * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseRTMLockingOptionWithBiasedLocking + * -XX:+WhiteBoxAPI + * compiler.rtm.cli.TestUseRTMLockingOptionWithBiasedLocking */ -import jdk.test.lib.*; -import jdk.test.lib.cli.*; -import jdk.test.lib.cli.predicate.AndPredicate; +package compiler.rtm.cli; + import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.ExitCode; +import jdk.test.lib.cli.CommandLineOptionTest; +import jdk.test.lib.cli.predicate.AndPredicate; public class TestUseRTMLockingOptionWithBiasedLocking extends CommandLineOptionTest { diff --git a/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java b/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java --- a/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java +++ b/test/compiler/rtm/cli/TestUseRTMXendForLockBusyOption.java @@ -26,13 +26,16 @@ * @test * @bug 8031320 * @summary Verify processing of UseRTMXendForLockBusy option. - * @library /testlibrary + * @library /testlibrary / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMXendForLockBusyOption - * @run main/othervm TestUseRTMXendForLockBusyOption + * + * @build compiler.rtm.cli.TestUseRTMXendForLockBusyOption + * @run main/othervm compiler.rtm.cli.TestUseRTMXendForLockBusyOption */ +package compiler.rtm.cli; + public class TestUseRTMXendForLockBusyOption extends RTMGenericCommandLineOptionTest { private static final String DEFAULT_VALUE = "true"; diff --git a/test/compiler/rtm/locking/TestRTMAbortRatio.java b/test/compiler/rtm/locking/TestRTMAbortRatio.java --- a/test/compiler/rtm/locking/TestRTMAbortRatio.java +++ b/test/compiler/rtm/locking/TestRTMAbortRatio.java @@ -30,21 +30,30 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMAbortRatio + * @build compiler.rtm.locking.TestRTMAbortRatio * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestRTMAbortRatio + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestRTMAbortRatio */ -import java.util.List; -import jdk.test.lib.*; -import jdk.test.lib.cli.CommandLineOptionTest; -import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; +package compiler.rtm.locking; + +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.CompilableTest; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.internal.misc.Unsafe; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.Utils; +import jdk.test.lib.cli.CommandLineOptionTest; +import jdk.test.lib.cli.predicate.AndPredicate; + +import java.util.List; /** * Test verifies that method will be deoptimized on high abort ratio diff --git a/test/compiler/rtm/locking/TestRTMAbortThreshold.java b/test/compiler/rtm/locking/TestRTMAbortThreshold.java --- a/test/compiler/rtm/locking/TestRTMAbortThreshold.java +++ b/test/compiler/rtm/locking/TestRTMAbortThreshold.java @@ -30,20 +30,28 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMAbortThreshold + * @build compiler.rtm.locking.TestRTMAbortThreshold * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestRTMAbortThreshold + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestRTMAbortThreshold */ -import java.util.List; -import jdk.test.lib.*; +package compiler.rtm.locking; + +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.AbortType; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; + +import java.util.List; /** * Test verifies that on RTMAbortThreshold option actually affects how soon diff --git a/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java b/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java --- a/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java +++ b/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java @@ -32,21 +32,30 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMAfterNonRTMDeopt + * @build compiler.rtm.locking.TestRTMAfterNonRTMDeopt * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestRTMAfterNonRTMDeopt + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestRTMAfterNonRTMDeopt */ -import java.util.List; -import jdk.test.lib.*; -import jdk.test.lib.cli.CommandLineOptionTest; -import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; +package compiler.rtm.locking; + +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.CompilableTest; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.internal.misc.Unsafe; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.Utils; +import jdk.test.lib.cli.CommandLineOptionTest; +import jdk.test.lib.cli.predicate.AndPredicate; + +import java.util.List; /** * To verify that with +UseRTMDeopt method's RTM state will be diff --git a/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java b/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java --- a/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java +++ b/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java @@ -30,20 +30,28 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMDeoptOnHighAbortRatio + * @build compiler.rtm.locking.TestRTMDeoptOnHighAbortRatio * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestRTMDeoptOnHighAbortRatio + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestRTMDeoptOnHighAbortRatio */ -import java.util.List; -import jdk.test.lib.*; +package compiler.rtm.locking; + +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.AbortType; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; + +import java.util.List; /** * Test verifies that on high abort ratio method wil be deoptimized with diff --git a/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java b/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java --- a/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java +++ b/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java @@ -29,21 +29,30 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMDeoptOnLowAbortRatio + * @build compiler.rtm.locking.TestRTMDeoptOnLowAbortRatio * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestRTMDeoptOnLowAbortRatio + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestRTMDeoptOnLowAbortRatio */ -import java.util.List; -import jdk.test.lib.*; -import jdk.test.lib.cli.CommandLineOptionTest; -import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; +package compiler.rtm.locking; + +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.CompilableTest; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.internal.misc.Unsafe; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.Utils; +import jdk.test.lib.cli.CommandLineOptionTest; +import jdk.test.lib.cli.predicate.AndPredicate; + +import java.util.List; /** * Test verifies that low abort ratio method will be deoptimized with diff --git a/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java b/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java --- a/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java +++ b/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java @@ -30,19 +30,25 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMLockingCalculationDelay + * @build compiler.rtm.locking.TestRTMLockingCalculationDelay * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestRTMLockingCalculationDelay + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestRTMLockingCalculationDelay */ -import jdk.test.lib.*; +package compiler.rtm.locking; + +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.AbortType; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; /** * Test verifies that abort ratio calculation could be delayed using diff --git a/test/compiler/rtm/locking/TestRTMLockingThreshold.java b/test/compiler/rtm/locking/TestRTMLockingThreshold.java --- a/test/compiler/rtm/locking/TestRTMLockingThreshold.java +++ b/test/compiler/rtm/locking/TestRTMLockingThreshold.java @@ -30,21 +30,30 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMLockingThreshold + * @build compiler.rtm.locking.TestRTMLockingThreshold * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestRTMLockingThreshold + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestRTMLockingThreshold */ -import java.util.List; -import jdk.test.lib.*; -import jdk.test.lib.cli.CommandLineOptionTest; -import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; +package compiler.rtm.locking; + +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.CompilableTest; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.internal.misc.Unsafe; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.Utils; +import jdk.test.lib.cli.CommandLineOptionTest; +import jdk.test.lib.cli.predicate.AndPredicate; + +import java.util.List; /** * Test verifies that RTMLockingThreshold option actually affects how soon diff --git a/test/compiler/rtm/locking/TestRTMRetryCount.java b/test/compiler/rtm/locking/TestRTMRetryCount.java --- a/test/compiler/rtm/locking/TestRTMRetryCount.java +++ b/test/compiler/rtm/locking/TestRTMRetryCount.java @@ -29,21 +29,28 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMRetryCount + * @build compiler.rtm.locking.TestRTMRetryCount * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestRTMRetryCount + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestRTMRetryCount */ -import java.util.List; +package compiler.rtm.locking; -import jdk.test.lib.*; +import compiler.testlibrary.rtm.BusyLock; +import compiler.testlibrary.rtm.CompilableTest; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; + +import java.util.List; /** * Test verifies that RTMRetryCount option actually affects amount of diff --git a/test/compiler/rtm/locking/TestRTMSpinLoopCount.java b/test/compiler/rtm/locking/TestRTMSpinLoopCount.java --- a/test/compiler/rtm/locking/TestRTMSpinLoopCount.java +++ b/test/compiler/rtm/locking/TestRTMSpinLoopCount.java @@ -30,20 +30,28 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMSpinLoopCount + * @build compiler.rtm.locking.TestRTMSpinLoopCount * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestRTMSpinLoopCount + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestRTMSpinLoopCount */ -import java.util.List; -import jdk.test.lib.*; +package compiler.rtm.locking; + +import compiler.testlibrary.rtm.BusyLock; +import compiler.testlibrary.rtm.CompilableTest; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; + +import java.util.List; /** * Test verifies that RTMSpinLoopCount increase time spent between retries diff --git a/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java b/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java --- a/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java +++ b/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java @@ -30,22 +30,30 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestRTMTotalCountIncrRate + * @build compiler.rtm.locking.TestRTMTotalCountIncrRate * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestRTMTotalCountIncrRate + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestRTMTotalCountIncrRate */ +package compiler.rtm.locking; + +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.CompilableTest; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; import jdk.internal.misc.Unsafe; -import java.util.List; - -import jdk.test.lib.*; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.Utils; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; + +import java.util.List; /** * Test verifies that with RTMTotalCountIncrRate=1 RTM locking statistics diff --git a/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java b/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java --- a/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java +++ b/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java @@ -30,21 +30,28 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMAfterLockInflation + * @build compiler.rtm.locking.TestUseRTMAfterLockInflation * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseRTMAfterLockInflation + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestUseRTMAfterLockInflation */ -import java.util.List; +package compiler.rtm.locking; -import jdk.test.lib.*; +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.AbortType; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; + +import java.util.List; /** * Test verifies that RTM is used after lock inflation by executing compiled diff --git a/test/compiler/rtm/locking/TestUseRTMDeopt.java b/test/compiler/rtm/locking/TestUseRTMDeopt.java --- a/test/compiler/rtm/locking/TestUseRTMDeopt.java +++ b/test/compiler/rtm/locking/TestUseRTMDeopt.java @@ -30,19 +30,25 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMDeopt + * @build compiler.rtm.locking.TestUseRTMDeopt * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseRTMDeopt + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestUseRTMDeopt */ -import jdk.test.lib.*; +package compiler.rtm.locking; + +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.AbortType; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; /** * Test verifies that usage of UseRTMDeopt option affects uncommon traps usage diff --git a/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java b/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java --- a/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java +++ b/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java @@ -29,21 +29,27 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMForInflatedLocks + * @build compiler.rtm.locking.TestUseRTMForInflatedLocks * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseRTMForInflatedLocks + * -XX:+WhiteBoxAPI compiler.rtm.locking.TestUseRTMForInflatedLocks */ -import java.util.List; +package compiler.rtm.locking; -import jdk.test.lib.*; +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.AbortType; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; + +import java.util.List; /** * Test verifies that RTM-based lock elision could be used for inflated locks diff --git a/test/compiler/rtm/locking/TestUseRTMForStackLocks.java b/test/compiler/rtm/locking/TestUseRTMForStackLocks.java --- a/test/compiler/rtm/locking/TestUseRTMForStackLocks.java +++ b/test/compiler/rtm/locking/TestUseRTMForStackLocks.java @@ -29,21 +29,28 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMForStackLocks + * @build compiler.rtm.locking.TestUseRTMForStackLocks * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseRTMForStackLocks + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestUseRTMForStackLocks */ -import java.util.List; +package compiler.rtm.locking; -import jdk.test.lib.*; +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.AbortType; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; + +import java.util.List; /** * Test verifies that RTM-based lock elision could be used for stack locks diff --git a/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java b/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java --- a/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java +++ b/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java @@ -30,21 +30,29 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMXendForLockBusy + * @build compiler.rtm.locking.TestUseRTMXendForLockBusy * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseRTMXendForLockBusy + * -XX:+WhiteBoxAPI + * compiler.rtm.locking.TestUseRTMXendForLockBusy */ -import java.util.List; +package compiler.rtm.locking; -import jdk.test.lib.*; +import compiler.testlibrary.rtm.AbortType; +import compiler.testlibrary.rtm.BusyLock; +import compiler.testlibrary.rtm.CompilableTest; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; + +import java.util.List; /** * Test verifies that with +UseRTMXendForLockBusy there will be no aborts diff --git a/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java b/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java --- a/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java +++ b/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java @@ -30,20 +30,28 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestNoRTMLockElidingOption + * @build compiler.rtm.method_options.TestNoRTMLockElidingOption * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestNoRTMLockElidingOption + * -XX:+WhiteBoxAPI + * compiler.rtm.method_options.TestNoRTMLockElidingOption */ -import java.util.List; -import jdk.test.lib.*; +package compiler.rtm.method_options; + +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.AbortType; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; + +import java.util.List; /** * Test verifies that method tagged with option NoRTMLockElidingOption diff --git a/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java b/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java --- a/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java +++ b/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java @@ -31,20 +31,28 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestUseRTMLockElidingOption + * @build compiler.rtm.method_options.TestUseRTMLockElidingOption * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestUseRTMLockElidingOption + * -XX:+WhiteBoxAPI + * compiler.rtm.method_options.TestUseRTMLockElidingOption */ -import java.util.List; -import jdk.test.lib.*; +package compiler.rtm.method_options; + +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.AbortType; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; + +import java.util.List; /** * Test verifies that method tagged with option UseRTMLockElidingOption diff --git a/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java b/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java --- a/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java +++ b/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java @@ -32,21 +32,31 @@ * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TestPrintPreciseRTMLockingStatistics + * @build compiler.rtm.print.TestPrintPreciseRTMLockingStatistics * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI TestPrintPreciseRTMLockingStatistics + * -XX:+WhiteBoxAPI + * compiler.rtm.print.TestPrintPreciseRTMLockingStatistics */ -import java.util.*; -import jdk.test.lib.*; +package compiler.rtm.print; + +import compiler.testlibrary.rtm.AbortProvoker; +import compiler.testlibrary.rtm.AbortType; +import compiler.testlibrary.rtm.RTMLockingStatistics; +import compiler.testlibrary.rtm.RTMTestBase; +import compiler.testlibrary.rtm.predicate.SupportedCPU; +import compiler.testlibrary.rtm.predicate.SupportedVM; +import jdk.test.lib.Asserts; +import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.predicate.AndPredicate; -import compiler.testlibrary.rtm.*; -import compiler.testlibrary.rtm.predicate.SupportedCPU; -import compiler.testlibrary.rtm.predicate.SupportedVM; + +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; /** * Test verifies that VM output does not contain RTM locking statistics when it diff --git a/test/compiler/runtime/7141637/SpreadNullArg.java b/test/compiler/runtime/SpreadNullArg.java rename from test/compiler/runtime/7141637/SpreadNullArg.java rename to test/compiler/runtime/SpreadNullArg.java --- a/test/compiler/runtime/7141637/SpreadNullArg.java +++ b/test/compiler/runtime/SpreadNullArg.java @@ -24,11 +24,14 @@ /* * @test SpreadNullArg * @bug 7141637 - * @summary verifies that the MethodHandle spread adapter can gracefully handle null arguments. - * @run main SpreadNullArg + * @summary verifies that the MethodHandle spread adapter can gracefully handle null arguments. + * + * @run main compiler.runtime.SpreadNullArg * @author volker.simonis@gmail.com */ +package compiler.runtime; + import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; @@ -44,7 +47,7 @@ try { mh_spread_target = - MethodHandles.lookup().findStatic(SpreadNullArg.class, "target_spread_arg", mt_ref_arg); + MethodHandles.lookup().findStatic(SpreadNullArg.class, "target_spread_arg", mt_ref_arg); result = (int) mh_spreadInvoker.invokeExact(mh_spread_target, (Object[]) null); throw new Error("Expected IllegalArgumentException was not thrown"); } catch (IllegalArgumentException e) { @@ -55,7 +58,7 @@ if (result != 42) { throw new Error("result [" + result - + "] != 42 : Expected IllegalArgumentException was not thrown?"); + + "] != 42 : Expected IllegalArgumentException was not thrown?"); } } diff --git a/test/compiler/runtime/6865265/StackOverflowBug.java b/test/compiler/runtime/StackOverflowBug.java rename from test/compiler/runtime/6865265/StackOverflowBug.java rename to test/compiler/runtime/StackOverflowBug.java --- a/test/compiler/runtime/6865265/StackOverflowBug.java +++ b/test/compiler/runtime/StackOverflowBug.java @@ -28,40 +28,41 @@ * @summary JVM crashes with "missing exception handler" error * @author volker.simonis@sap.com * - * @run main/othervm -XX:CompileThreshold=100 -Xbatch -Xss512k StackOverflowBug + * @run main/othervm -XX:CompileThreshold=100 -Xbatch -Xss512k + * compiler.runtime.StackOverflowBug */ +package compiler.runtime; public class StackOverflowBug { - public static int run() { - try { - try { - return run(); - } catch (Throwable e) { - // Notice that the class 'Throwable' is NOT resolved by the verifier, - // because the verifier only checks if 'Throwable' is assignable to - // 'java.lang.Throwable' and this check succeeds immediately if the two - // types have equal names (see 'VerificationType::is_assignable_from' which - // is called from 'ClassVerifier::verify_exception_handler_table'). - // This is strange, because if the two classes have different names, - // 'is_assignable_from()' calls 'is_reference_assignable_from()' which resolves - // both classes by calling 'SystemDictionary::resolve_or_fail()'. This call - // also takes into account the current class loader (i.e. the one which was used - // to load this class) and would place a corresponding - // "java.lang.Throwable / current-Classloader" entry into the system dictionary. - // This would in turn allow C2 to see 'java.lang.Throwable' as "loaded" - // (see 'Parse::catch_inline_exceptions()') when this method is compiled. - return 42; - } + public static int run() { + try { + try { + return run(); + } catch (Throwable e) { + // Notice that the class 'Throwable' is NOT resolved by the verifier, + // because the verifier only checks if 'Throwable' is assignable to + // 'java.lang.Throwable' and this check succeeds immediately if the two + // types have equal names (see 'VerificationType::is_assignable_from' which + // is called from 'ClassVerifier::verify_exception_handler_table'). + // This is strange, because if the two classes have different names, + // 'is_assignable_from()' calls 'is_reference_assignable_from()' which resolves + // both classes by calling 'SystemDictionary::resolve_or_fail()'. This call + // also takes into account the current class loader (i.e. the one which was used + // to load this class) and would place a corresponding + // "java.lang.Throwable / current-Classloader" entry into the system dictionary. + // This would in turn allow C2 to see 'java.lang.Throwable' as "loaded" + // (see 'Parse::catch_inline_exceptions()') when this method is compiled. + return 42; + } + } finally { + } } - finally { + + public static void main(String argv[]) { + run(); } - } - - public static void main(String argv[]) { - run(); - } } /* diff --git a/test/compiler/runtime/6778657/Test.java b/test/compiler/runtime/Test6778657.java rename from test/compiler/runtime/6778657/Test.java rename to test/compiler/runtime/Test6778657.java --- a/test/compiler/runtime/6778657/Test.java +++ b/test/compiler/runtime/Test6778657.java @@ -26,50 +26,58 @@ * @test * @bug 6778657 * @summary Casts in SharedRuntime::f2i, f2l, d2i and d2l rely on undefined C++ behaviour + * + * @run main compiler.runtime.Test6778657 */ -public class Test { - public static void check_f2i(int expect) { - float check = expect; - check *= 2; - int actual = (int) check; - if (actual != expect) - throw new RuntimeException("expecting " + expect + ", got " + actual); - } +package compiler.runtime; - public static void check_f2l(long expect) { - float check = expect; - check *= 2; - long actual = (long) check; - if (actual != expect) - throw new RuntimeException("expecting " + expect + ", got " + actual); - } +public class Test6778657 { + public static void check_f2i(int expect) { + float check = expect; + check *= 2; + int actual = (int) check; + if (actual != expect) { + throw new RuntimeException("expecting " + expect + ", got " + actual); + } + } - public static void check_d2i(int expect) { - double check = expect; - check *= 2; - int actual = (int) check; - if (actual != expect) - throw new RuntimeException("expecting " + expect + ", got " + actual); - } + public static void check_f2l(long expect) { + float check = expect; + check *= 2; + long actual = (long) check; + if (actual != expect) { + throw new RuntimeException("expecting " + expect + ", got " + actual); + } + } - public static void check_d2l(long expect) { - double check = expect; - check *= 2; - long actual = (long) check; - if (actual != expect) - throw new RuntimeException("expecting " + expect + ", got " + actual); - } + public static void check_d2i(int expect) { + double check = expect; + check *= 2; + int actual = (int) check; + if (actual != expect) { + throw new RuntimeException("expecting " + expect + ", got " + actual); + } + } - public static void main(String[] args) { - check_f2i(Integer.MAX_VALUE); - check_f2i(Integer.MIN_VALUE); - check_f2l(Long.MAX_VALUE); - check_f2l(Long.MIN_VALUE); - check_d2i(Integer.MAX_VALUE); - check_d2i(Integer.MIN_VALUE); - check_d2l(Long.MAX_VALUE); - check_d2l(Long.MIN_VALUE); - } + public static void check_d2l(long expect) { + double check = expect; + check *= 2; + long actual = (long) check; + if (actual != expect) { + throw new RuntimeException("expecting " + expect + ", got " + actual); + } + } + + public static void main(String[] args) { + check_f2i(Integer.MAX_VALUE); + check_f2i(Integer.MIN_VALUE); + check_f2l(Long.MAX_VALUE); + check_f2l(Long.MIN_VALUE); + check_d2i(Integer.MAX_VALUE); + check_d2i(Integer.MIN_VALUE); + check_d2l(Long.MAX_VALUE); + check_d2l(Long.MIN_VALUE); + } } diff --git a/test/compiler/runtime/6826736/Test.java b/test/compiler/runtime/Test6826736.java rename from test/compiler/runtime/6826736/Test.java rename to test/compiler/runtime/Test6826736.java --- a/test/compiler/runtime/6826736/Test.java +++ b/test/compiler/runtime/Test6826736.java @@ -27,10 +27,17 @@ * @bug 6826736 * @summary CMS: core dump with -XX:+UseCompressedOops * - * @run main/othervm/timeout=600 -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:+ScavengeALot -XX:+UseCompressedOops -XX:HeapBaseMinAddress=32g -XX:CompileThreshold=100 -XX:CompileOnly=Test.test -XX:-BlockLayoutRotateLoops -XX:LoopUnrollLimit=0 -Xmx256m -XX:ParallelGCThreads=4 Test + * @run main/othervm/timeout=600 -XX:+IgnoreUnrecognizedVMOptions -Xbatch + * -XX:+ScavengeALot -XX:+UseCompressedOops -XX:HeapBaseMinAddress=32g + * -XX:CompileThreshold=100 -XX:-BlockLayoutRotateLoops + * -XX:LoopUnrollLimit=0 -Xmx256m -XX:ParallelGCThreads=4 + * -XX:CompileCommand=compileonly,compiler.runtime.Test6826736::test + * compiler.runtime.Test6826736 */ -public class Test { +package compiler.runtime; + +public class Test6826736 { int[] arr; int[] arr2; int test(int r) { @@ -50,7 +57,7 @@ public static void main(String[] args) { int r = 0; - Test t = new Test(); + Test6826736 t = new Test6826736(); for (int i = 0; i < 100; i++) { t.arr = new int[100]; r = t.test(r); diff --git a/test/compiler/runtime/6859338/Test6859338.java b/test/compiler/runtime/Test6859338.java rename from test/compiler/runtime/6859338/Test6859338.java rename to test/compiler/runtime/Test6859338.java --- a/test/compiler/runtime/6859338/Test6859338.java +++ b/test/compiler/runtime/Test6859338.java @@ -27,9 +27,13 @@ * @bug 6859338 * @summary Assertion failure in sharedRuntime.cpp * - * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-InlineObjectHash -Xbatch -XX:-ProfileInterpreter Test6859338 + * @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions + * -XX:-InlineObjectHash -Xbatch -XX:-ProfileInterpreter + * compiler.runtime.Test6859338 */ +package compiler.runtime; + public class Test6859338 { static Object[] o = new Object[] { new Object(), null }; public static void main(String[] args) { diff --git a/test/compiler/runtime/6863420/Test.java b/test/compiler/runtime/Test6863420.java rename from test/compiler/runtime/6863420/Test.java rename to test/compiler/runtime/Test6863420.java --- a/test/compiler/runtime/6863420/Test.java +++ b/test/compiler/runtime/Test6863420.java @@ -27,11 +27,15 @@ * @bug 6863420 * @summary os::javaTimeNanos() go backward on Solaris x86 * - * Notice the internal timeout in timeout thread Test.TOT. - * @run main/othervm/timeout=300 Test + * @run main/othervm/timeout=300 compiler.runtime.Test6863420 + */ +/* + * Notice the internal timeout in timeout thread Test6863420.TOT. */ -public class Test { +package compiler.runtime; + +public class Test6863420 { static final int INTERNAL_TIMEOUT=240; static class TOT extends Thread { diff --git a/test/compiler/runtime/6892265/Test.java b/test/compiler/runtime/Test6892265.java rename from test/compiler/runtime/6892265/Test.java rename to test/compiler/runtime/Test6892265.java --- a/test/compiler/runtime/6892265/Test.java +++ b/test/compiler/runtime/Test6892265.java @@ -27,39 +27,41 @@ * @bug 6892265 * @summary System.arraycopy unable to reference elements beyond Integer.MAX_VALUE bytes * - * @run main/othervm Test + * @run main/othervm compiler.runtime.Test6892265 */ -public class Test { - static final int NCOPY = 1; - static final int OVERFLOW = 1; - static int[] src2 = new int[NCOPY]; - static int[] dst2; +package compiler.runtime; - static void test() { - int N; - int SIZE; +public class Test6892265 { + static final int NCOPY = 1; + static final int OVERFLOW = 1; + static int[] src2 = new int[NCOPY]; + static int[] dst2; - N = Integer.MAX_VALUE/4 + OVERFLOW; - System.arraycopy(src2, 0, dst2, N, NCOPY); - System.arraycopy(dst2, N, src2, 0, NCOPY); - } + static void test() { + int N; + int SIZE; - public static void main(String[] args) { - try { - dst2 = new int[NCOPY + Integer.MAX_VALUE/4 + OVERFLOW]; - } catch (OutOfMemoryError e) { - System.exit(95); // Not enough memory + N = Integer.MAX_VALUE / 4 + OVERFLOW; + System.arraycopy(src2, 0, dst2, N, NCOPY); + System.arraycopy(dst2, N, src2, 0, NCOPY); } - System.out.println("warmup"); - for (int i=0; i <11000; i++) { - test(); + + public static void main(String[] args) { + try { + dst2 = new int[NCOPY + Integer.MAX_VALUE / 4 + OVERFLOW]; + } catch (OutOfMemoryError e) { + System.exit(95); // Not enough memory + } + System.out.println("warmup"); + for (int i = 0; i < 11000; i++) { + test(); + } + System.out.println("start"); + for (int i = 0; i < 1000; i++) { + test(); + } + System.out.println("finish"); } - System.out.println("start"); - for (int i=0; i <1000; i++) { - test(); - } - System.out.println("finish"); - } } diff --git a/test/compiler/runtime/7088020/Test7088020.java b/test/compiler/runtime/Test7088020.java rename from test/compiler/runtime/7088020/Test7088020.java rename to test/compiler/runtime/Test7088020.java --- a/test/compiler/runtime/7088020/Test7088020.java +++ b/test/compiler/runtime/Test7088020.java @@ -27,11 +27,15 @@ * @bug 7088020 * @summary SEGV in JNIHandleBlock::release_block * - * @run main Test7088020 + * @run main compiler.runtime.Test7088020 */ -import java.lang.invoke.*; +package compiler.runtime; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.lang.invoke.WrongMethodTypeException; public class Test7088020 { public static boolean test() { diff --git a/test/compiler/runtime/7196199/Test7196199.java b/test/compiler/runtime/Test7196199.java rename from test/compiler/runtime/7196199/Test7196199.java rename to test/compiler/runtime/Test7196199.java --- a/test/compiler/runtime/7196199/Test7196199.java +++ b/test/compiler/runtime/Test7196199.java @@ -27,163 +27,172 @@ * @bug 7196199 * @summary java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect * - * @run main/othervm/timeout=400 -Xmx32m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation -XX:CompileCommand=exclude,Test7196199.test -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100 Test7196199 + * @run main/othervm/timeout=400 -Xmx32m -Xbatch -XX:+IgnoreUnrecognizedVMOptions + * -XX:+UnlockDiagnosticVMOptions -XX:-TieredCompilation + * -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100 + * -XX:CompileCommand=exclude,compiler.runtime.Test7196199::test + * compiler.runtime.Test7196199 */ +package compiler.runtime; public class Test7196199 { - private static final int ARRLEN = 97; - private static final int ITERS = 5000; - private static final int INI_ITERS = 1000; - private static final int SFP_ITERS = 10000; - private static final float SFP_ITERS_F = 10000.f; - private static final float VALUE = 15.f; - public static void main(String args[]) { - int errn = test(); - if (errn > 0) { - System.err.println("FAILED: " + errn + " errors"); - System.exit(97); - } - System.out.println("PASSED"); - } + private static final int ARRLEN = 97; + private static final int ITERS = 5000; + private static final int INI_ITERS = 1000; + private static final int SFP_ITERS = 10000; + private static final float SFP_ITERS_F = 10000.f; + private static final float VALUE = 15.f; - static int test() { - float[] a0 = new float[ARRLEN]; - float[] a1 = new float[ARRLEN]; - // Initialize - for (int i=0; i 0) { + System.err.println("FAILED: " + errn + " errors"); + System.exit(97); + } + System.out.println("PASSED"); } - System.out.println(" test_incrv"); - for (int j=0; j 0) + return errn; + + System.out.println("Time"); + long start, end; + + start = System.currentTimeMillis(); + for (int i = 0; i < INI_ITERS; i++) { + test_incrc(a0); + } + end = System.currentTimeMillis(); + System.out.println("test_incrc: " + (end - start)); + + start = System.currentTimeMillis(); + for (int i = 0; i < INI_ITERS; i++) { + test_incrv(a0, VALUE); + } + end = System.currentTimeMillis(); + System.out.println("test_incrv: " + (end - start)); + + start = System.currentTimeMillis(); + for (int i = 0; i < INI_ITERS; i++) { + test_addc(a0, a1); + } + end = System.currentTimeMillis(); + System.out.println("test_addc: " + (end - start)); + + start = System.currentTimeMillis(); + for (int i = 0; i < INI_ITERS; i++) { + test_addv(a0, a1, VALUE); + } + end = System.currentTimeMillis(); + System.out.println("test_addv: " + (end - start)); + + return errn; } - System.out.println(" test_addc"); - for (int j=0; j 0) - return errn; + static void test_addc(float[] a0, float[] a1) { + // Non-counted loop with safepoint. + for (long l = 0; l < SFP_ITERS; l++) { + // Counted and vectorized loop. + for (int i = 0; i < a0.length; i += 1) { + a0[i] += a1[i] + VALUE; + } + } + } - System.out.println("Time"); - long start, end; + static void test_addv(float[] a0, float[] a1, float b) { + // Non-counted loop with safepoint. + for (long l = 0; l < SFP_ITERS; l++) { + // Counted and vectorized loop. + for (int i = 0; i < a0.length; i += 1) { + a0[i] += a1[i] + b; + } + } + } - start = System.currentTimeMillis(); - for (int i=0; i 0) { // substaction works with unsigned values - // OldGen is placed before youngger for ParallelOldGC. - upper_limit = low_limit + 21000000l; // +20971520 + public static Object[] o; + + public static final boolean debug = Boolean.getBoolean("debug"); + + // 2 different obect arrays but same element types + static Test8010927[] masterA; + static Object[] masterB; + static final Test8010927 elem = new Test8010927(); + static final WhiteBox wb = WhiteBox.getWhiteBox(); + + static final int obj_header_size = U.ARRAY_OBJECT_BASE_OFFSET; + static final int heap_oop_size = wb.getHeapOopSize(); + static final int card_size = 512; + static final int one_card = (card_size - obj_header_size) / heap_oop_size; + + static final int surv_size = 2112 * 1024; + + // The size is big to not fit into survive space. + static final Object[] cache = new Object[(surv_size / card_size)]; + + public static void main(String[] args) { + masterA = new Test8010927[one_card]; + masterB = new Object[one_card]; + for (int i = 0; i < one_card; ++i) { + masterA[i] = elem; + masterB[i] = elem; + } + + // Move cache[] to the old gen. + long low_limit = wb.getObjectAddress(cache); + System.gc(); + // Move 'cache' to oldgen. + long upper_limit = wb.getObjectAddress(cache); + if ((low_limit - upper_limit) > 0) { // substaction works with unsigned values + // OldGen is placed before youngger for ParallelOldGC. + upper_limit = low_limit + 21000000l; // +20971520 + } + // Each A[one_card] size is 512 bytes, + // it will take about 40000 allocations to trigger GC. + // cache[] has 8192 elements so GC should happen + // each 5th iteration. + for (long l = 0; l < 20; l++) { + fill_heap(); + if (debug) { + System.out.println("test oop_disjoint_arraycopy"); + } + testA_arraycopy(); + if (debug) { + System.out.println("test checkcast_arraycopy"); + } + testB_arraycopy(); + // Execute arraycopy to the topmost array in young gen + if (debug) { + int top_index = get_top_address(low_limit, upper_limit); + if (top_index >= 0) { + long addr = wb.getObjectAddress(cache[top_index]); + System.out.println("top_addr: 0x" + Long.toHexString(addr) + ", 0x" + Long.toHexString(addr + 512)); + } + } + } } - // Each A[one_card] size is 512 bytes, - // it will take about 40000 allocations to trigger GC. - // cache[] has 8192 elements so GC should happen - // each 5th iteration. - for(long l = 0; l < 20; l++) { - fill_heap(); - if (debug) { - System.out.println("test oop_disjoint_arraycopy"); - } - testA_arraycopy(); - if (debug) { - System.out.println("test checkcast_arraycopy"); - } - testB_arraycopy(); - // Execute arraycopy to the topmost array in young gen - if (debug) { - int top_index = get_top_address(low_limit, upper_limit); - if (top_index >= 0) { - long addr = wb.getObjectAddress(cache[top_index]); - System.out.println("top_addr: 0x" + Long.toHexString(addr) + ", 0x" + Long.toHexString(addr + 512)); + + static void fill_heap() { + for (int i = 0; i < cache.length; ++i) { + o = new Test8010927[one_card]; + System.arraycopy(masterA, 0, o, 0, masterA.length); + cache[i] = o; } - } + for (long j = 0; j < 256; ++j) { + o = new Long[10000]; // to trigger GC + } } - } - static void fill_heap() { - for (int i = 0; i < cache.length; ++i) { - o = new Test8010927[one_card]; - System.arraycopy(masterA, 0, o, 0, masterA.length); - cache[i] = o; + + static void testA_arraycopy() { + for (int i = 0; i < cache.length; ++i) { + System.arraycopy(masterA, 0, cache[i], 0, masterA.length); + } } - for (long j = 0; j < 256; ++j) { - o = new Long[10000]; // to trigger GC + + static void testB_arraycopy() { + for (int i = 0; i < cache.length; ++i) { + System.arraycopy(masterB, 0, cache[i], 0, masterB.length); + } } - } - static void testA_arraycopy() { - for (int i = 0; i < cache.length; ++i) { - System.arraycopy(masterA, 0, cache[i], 0, masterA.length); + + static int get_top_address(long min, long max) { + int index = -1; + long addr = min; + for (int i = 0; i < cache.length; ++i) { + long test = wb.getObjectAddress(cache[i]); + if (((test - addr) > 0) && ((max - test) > 0)) { // substaction works with unsigned values + addr = test; + index = i; + } + } + return index; } - } - static void testB_arraycopy() { - for (int i = 0; i < cache.length; ++i) { - System.arraycopy(masterB, 0, cache[i], 0, masterB.length); - } - } - static int get_top_address(long min, long max) { - int index = -1; - long addr = min; - for (int i = 0; i < cache.length; ++i) { - long test = wb.getObjectAddress(cache[i]); - if (((test - addr) > 0) && ((max - test) > 0)) { // substaction works with unsigned values - addr = test; - index = i; - } - } - return index; - } } diff --git a/test/compiler/runtime/6891750/Test6891750.java b/test/compiler/runtime/cr6891750/Test6891750.java rename from test/compiler/runtime/6891750/Test6891750.java rename to test/compiler/runtime/cr6891750/Test6891750.java --- a/test/compiler/runtime/6891750/Test6891750.java +++ b/test/compiler/runtime/cr6891750/Test6891750.java @@ -26,10 +26,11 @@ * @test * @bug 6891750 * @summary deopt blob kills values in O5 - * - * @run main Test6891750 + * @run main compiler.runtime.cr6891750.Test6891750 */ +package compiler.runtime.cr6891750; + abstract class Base6891750 extends Thread { abstract public long m(); } diff --git a/test/compiler/runtime/8015436/Test8015436.java b/test/compiler/runtime/cr8015436/Test8015436.java rename from test/compiler/runtime/8015436/Test8015436.java rename to test/compiler/runtime/cr8015436/Test8015436.java --- a/test/compiler/runtime/8015436/Test8015436.java +++ b/test/compiler/runtime/cr8015436/Test8015436.java @@ -25,8 +25,8 @@ * @test * @bug 8015436 * @summary the IK _initial_method_idnum value must be adjusted if overpass methods are added - * @run main Test8015436 * + * @run main compiler.runtime.cr8015436.Test8015436 */ /* @@ -38,15 +38,11 @@ * All the invocations of the defaultMethod() must be completed successfully. */ -import java.lang.invoke.*; +package compiler.runtime.cr8015436; -interface InterfaceWithDefaultMethod { - public void someMethod(); - - default public void defaultMethod(String str){ - System.out.println("defaultMethod() " + str); - } -} +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; public class Test8015436 implements InterfaceWithDefaultMethod { @Override @@ -66,6 +62,13 @@ } } +interface InterfaceWithDefaultMethod { + public void someMethod(); + + default public void defaultMethod(String str){ + System.out.println("defaultMethod() " + str); + } +} /* * A successful execution gives the output: * someMethod() invoked diff --git a/test/compiler/runtime/safepoints/TestRegisterRestoring.java b/test/compiler/runtime/safepoints/TestRegisterRestoring.java --- a/test/compiler/runtime/safepoints/TestRegisterRestoring.java +++ b/test/compiler/runtime/safepoints/TestRegisterRestoring.java @@ -27,36 +27,43 @@ * @test * @bug 8148490 * @summary Test correct saving and restoring of vector registers at safepoints. - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:-TieredCompilation -XX:CompileCommand=exclude,TestRegisterRestoring::main -XX:+SafepointALot TestRegisterRestoring + * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:-TieredCompilation + * -XX:+SafepointALot + * -XX:CompileCommand=exclude,compiler.runtime.safepoints.TestRegisterRestoring::main + * compiler.runtime.safepoints.TestRegisterRestoring */ + +package compiler.runtime.safepoints; + public class TestRegisterRestoring { - public static void main(String args[]) throws Exception { - // Initialize - float[] array = new float[100]; - for (int i = 0; i < array.length; ++i) { - array[i] = 0; + public static void main(String args[]) throws Exception { + // Initialize + float[] array = new float[100]; + for (int i = 0; i < array.length; ++i) { + array[i] = 0; + } + // Test + for (int j = 0; j < 20_000; ++j) { + increment(array); + // Check result + for (int i = 0; i < array.length; i++) { + if (array[i] != 10_000) { + throw new RuntimeException("Test failed: array[" + i + "] = " + array[i] + " but should be 10.000"); + } + array[i] = 0; + } + } } - // Test - for (int j = 0; j < 20_000; ++j) { - increment(array); - // Check result - for (int i = 0; i < array.length; i++) { - if (array[i] != 10_000) { - throw new RuntimeException("Test failed: array[" + i + "] = " + array[i] + " but should be 10.000"); + + static void increment(float[] array) { + // Loop with safepoint + for (long l = 0; l < 10_000; l++) { + // Vectorized loop + for (int i = 0; i < array.length; ++i) { + array[i] += 1; + } } - array[i] = 0; - } } - } - - static void increment(float[] array) { - // Loop with safepoint - for (long l = 0; l < 10_000; l++) { - // Vectorized loop - for (int i = 0; i < array.length; ++i) { - array[i] += 1; - } - } - } } diff --git a/test/compiler/stable/StableConfiguration.java b/test/compiler/stable/StableConfiguration.java --- a/test/compiler/stable/StableConfiguration.java +++ b/test/compiler/stable/StableConfiguration.java @@ -27,8 +27,6 @@ import sun.hotspot.WhiteBox; -import java.lang.reflect.Method; - public class StableConfiguration { static final WhiteBox WB = WhiteBox.getWhiteBox(); public static final boolean isStableEnabled; diff --git a/test/compiler/stable/TestStableBoolean.java b/test/compiler/stable/TestStableBoolean.java --- a/test/compiler/stable/TestStableBoolean.java +++ b/test/compiler/stable/TestStableBoolean.java @@ -58,6 +58,7 @@ package compiler.stable; import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableBoolean { diff --git a/test/compiler/stable/TestStableByte.java b/test/compiler/stable/TestStableByte.java --- a/test/compiler/stable/TestStableByte.java +++ b/test/compiler/stable/TestStableByte.java @@ -58,6 +58,7 @@ package compiler.stable; import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableByte { diff --git a/test/compiler/stable/TestStableChar.java b/test/compiler/stable/TestStableChar.java --- a/test/compiler/stable/TestStableChar.java +++ b/test/compiler/stable/TestStableChar.java @@ -57,8 +57,9 @@ package compiler.stable; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; -import jdk.internal.vm.annotation.Stable; public class TestStableChar { static final boolean isStableEnabled = StableConfiguration.isStableEnabled; diff --git a/test/compiler/stable/TestStableDouble.java b/test/compiler/stable/TestStableDouble.java --- a/test/compiler/stable/TestStableDouble.java +++ b/test/compiler/stable/TestStableDouble.java @@ -57,8 +57,9 @@ package compiler.stable; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; -import jdk.internal.vm.annotation.Stable; public class TestStableDouble { static final boolean isStableEnabled = StableConfiguration.isStableEnabled; diff --git a/test/compiler/stable/TestStableFloat.java b/test/compiler/stable/TestStableFloat.java --- a/test/compiler/stable/TestStableFloat.java +++ b/test/compiler/stable/TestStableFloat.java @@ -58,6 +58,7 @@ package compiler.stable; import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableFloat { diff --git a/test/compiler/stable/TestStableInt.java b/test/compiler/stable/TestStableInt.java --- a/test/compiler/stable/TestStableInt.java +++ b/test/compiler/stable/TestStableInt.java @@ -58,6 +58,7 @@ package compiler.stable; import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableInt { diff --git a/test/compiler/stable/TestStableLong.java b/test/compiler/stable/TestStableLong.java --- a/test/compiler/stable/TestStableLong.java +++ b/test/compiler/stable/TestStableLong.java @@ -58,6 +58,7 @@ package compiler.stable; import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableLong { diff --git a/test/compiler/stable/TestStableMemoryBarrier.java b/test/compiler/stable/TestStableMemoryBarrier.java --- a/test/compiler/stable/TestStableMemoryBarrier.java +++ b/test/compiler/stable/TestStableMemoryBarrier.java @@ -27,8 +27,6 @@ * @test TestStableMemoryBarrier * @bug 8139758 * @summary tests memory barrier correctly inserted for stable fields - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation * * @run main/bootclasspath/othervm -Xcomp -XX:CompileOnly=::testCompile diff --git a/test/compiler/stable/TestStableMismatched.java b/test/compiler/stable/TestStableMismatched.java --- a/test/compiler/stable/TestStableMismatched.java +++ b/test/compiler/stable/TestStableMismatched.java @@ -26,13 +26,17 @@ * @test TestStableMismatched * @bug 8158228 * @summary Tests if mismatched char load from stable byte[] returns correct result + * * @run main/othervm -XX:-CompactStrings -XX:TieredStopAtLevel=1 -Xcomp - * -XX:CompileOnly=TestStableMismatched::test,::charAt - * TestStableMismatched + * -XX:CompileOnly=compiler.stable.TestStableMismatched::test,::charAt + * compiler.stable.TestStableMismatched * @run main/othervm -XX:-CompactStrings -XX:-TieredCompilation -Xcomp - * -XX:CompileOnly=TestStableMismatched::test,::charAt - * TestStableMismatched + * -XX:CompileOnly=compiler.stable.TestStableMismatched::test,::charAt + * compiler.stable.TestStableMismatched */ + +package compiler.stable; + public class TestStableMismatched { public static void main(String args[]) { test(); diff --git a/test/compiler/stable/TestStableObject.java b/test/compiler/stable/TestStableObject.java --- a/test/compiler/stable/TestStableObject.java +++ b/test/compiler/stable/TestStableObject.java @@ -58,6 +58,7 @@ package compiler.stable; import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableObject { diff --git a/test/compiler/stable/TestStableShort.java b/test/compiler/stable/TestStableShort.java --- a/test/compiler/stable/TestStableShort.java +++ b/test/compiler/stable/TestStableShort.java @@ -58,6 +58,7 @@ package compiler.stable; import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableShort { diff --git a/test/compiler/stable/TestStableUByte.java b/test/compiler/stable/TestStableUByte.java --- a/test/compiler/stable/TestStableUByte.java +++ b/test/compiler/stable/TestStableUByte.java @@ -57,8 +57,8 @@ * -XX:-FoldStableValues * -XX:CompileOnly=::get,::get1 * compiler.stable.TestStableUByte - * */ + package compiler.stable; import jdk.internal.vm.annotation.Stable; diff --git a/test/compiler/stable/TestStableUShort.java b/test/compiler/stable/TestStableUShort.java --- a/test/compiler/stable/TestStableUShort.java +++ b/test/compiler/stable/TestStableUShort.java @@ -57,8 +57,8 @@ * -XX:-FoldStableValues * -XX:CompileOnly=::get,::get1 * compiler.stable.TestStableUShort - * */ + package compiler.stable; import jdk.internal.vm.annotation.Stable; diff --git a/test/compiler/startup/NumCompilerThreadsCheck.java b/test/compiler/startup/NumCompilerThreadsCheck.java --- a/test/compiler/startup/NumCompilerThreadsCheck.java +++ b/test/compiler/startup/NumCompilerThreadsCheck.java @@ -28,8 +28,15 @@ * @library /testlibrary * @modules java.base/jdk.internal.misc * java.management + * + * @run driver compiler.startup.NumCompilerThreadsCheck */ -import jdk.test.lib.*; + +package compiler.startup; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.Platform; +import jdk.test.lib.ProcessTools; public class NumCompilerThreadsCheck { diff --git a/test/compiler/startup/SmallCodeCacheStartup.java b/test/compiler/startup/SmallCodeCacheStartup.java --- a/test/compiler/startup/SmallCodeCacheStartup.java +++ b/test/compiler/startup/SmallCodeCacheStartup.java @@ -28,11 +28,18 @@ * to initialize all compiler threads. The option -Xcomp gives the VM more time to * trigger the old bug. * @library /testlibrary - * @ignore 8134286 * @modules java.base/jdk.internal.misc * java.management + * + * @ignore 8134286 + * @run driver compiler.startup.SmallCodeCacheStartup */ -import jdk.test.lib.*; + +package compiler.startup; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + import static jdk.test.lib.Asserts.assertTrue; public class SmallCodeCacheStartup { diff --git a/test/compiler/startup/StartupOutput.java b/test/compiler/startup/StartupOutput.java --- a/test/compiler/startup/StartupOutput.java +++ b/test/compiler/startup/StartupOutput.java @@ -28,18 +28,24 @@ * @library /testlibrary * @modules java.base/jdk.internal.misc * java.management + * + * @run driver compiler.startup.StartupOutput */ -import jdk.test.lib.*; + +package compiler.startup; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; public class StartupOutput { - public static void main(String[] args) throws Exception { - ProcessBuilder pb; - OutputAnalyzer out; + public static void main(String[] args) throws Exception { + ProcessBuilder pb; + OutputAnalyzer out; - pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version"); - out = new OutputAnalyzer(pb.start()); - out.shouldNotContain("no space to run compilers"); + pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version"); + out = new OutputAnalyzer(pb.start()); + out.shouldNotContain("no space to run compilers"); - out.shouldHaveExitValue(0); - } + out.shouldHaveExitValue(0); + } } diff --git a/test/compiler/startup/TieredStopAtLevel0SanityTest.java b/test/compiler/startup/TieredStopAtLevel0SanityTest.java --- a/test/compiler/startup/TieredStopAtLevel0SanityTest.java +++ b/test/compiler/startup/TieredStopAtLevel0SanityTest.java @@ -25,9 +25,13 @@ * @test * @bug 8154151 * @summary Sanity test flag combo that force compiles on level 0 - * @run main/othervm -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:TieredStopAtLevel=0 TieredStopAtLevel0SanityTest + * + * @run main/othervm -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:TieredStopAtLevel=0 + * compiler.startup.TieredStopAtLevel0SanityTest */ +package compiler.startup; + public class TieredStopAtLevel0SanityTest { public static void main(String[] args) throws Exception { System.out.println("Hello world!"); diff --git a/test/compiler/stringopts/TestOptimizeStringConcat.java b/test/compiler/stringopts/TestOptimizeStringConcat.java --- a/test/compiler/stringopts/TestOptimizeStringConcat.java +++ b/test/compiler/stringopts/TestOptimizeStringConcat.java @@ -26,9 +26,14 @@ * @bug 8068909 * @key regression * @summary test that string optimizations produce code, that doesn't lead to a crash. - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestOptimizeStringConcat + * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.stringopts.TestOptimizeStringConcat * @author axel.siebenborn@sap.com */ + +package compiler.stringopts; + public class TestOptimizeStringConcat { static boolean checkArgumentSyntax(String value, String allowedchars, String notallowedchars, String logmsg) { diff --git a/test/compiler/stringopts/TestStringObjectInitialization.java b/test/compiler/stringopts/TestStringObjectInitialization.java --- a/test/compiler/stringopts/TestStringObjectInitialization.java +++ b/test/compiler/stringopts/TestStringObjectInitialization.java @@ -22,19 +22,26 @@ */ -import java.util.Arrays; + /* * @test * @bug 8159244 - * @requires vm.gc == "Parallel" | vm.gc == "null" * @summary Verifies that no partially initialized String object escapes from * C2's String concat optimization in a highly concurrent setting. * This test triggers the bug in about 1 out of 10 runs. + * @requires vm.gc == "Parallel" | vm.gc == "null" + * * @compile -XDstringConcat=inline TestStringObjectInitialization.java * @run main/othervm/timeout=300 -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-CompactStrings - * -XX:-UseG1GC -XX:+UseParallelGC TestStringObjectInitialization + * -XX:-UseG1GC -XX:+UseParallelGC + * compiler.stringopts.TestStringObjectInitialization */ + +package compiler.stringopts; + +import java.util.Arrays; + public class TestStringObjectInitialization { String myString; @@ -59,19 +66,19 @@ // Trigger C2's string concatenation optimization add(s + Arrays.toString(sArray) + " const "); } -} -class Runner implements Runnable { - private TestStringObjectInitialization test; + private static class Runner implements Runnable { + private TestStringObjectInitialization test; - public Runner(TestStringObjectInitialization t) { - test = t; - } + public Runner(TestStringObjectInitialization t) { + test = t; + } - public void run(){ - String[] array = {"a", "b", "c"}; - for (int i = 0; i < 10000; ++i) { - test.run("a", array); + public void run() { + String[] array = {"a", "b", "c"}; + for (int i = 0; i < 10000; ++i) { + test.run("a", array); + } } } } diff --git a/test/compiler/testlibrary/CompilerUtils.java b/test/compiler/testlibrary/CompilerUtils.java --- a/test/compiler/testlibrary/CompilerUtils.java +++ b/test/compiler/testlibrary/CompilerUtils.java @@ -25,8 +25,9 @@ import jdk.test.lib.Asserts; import jdk.test.lib.Platform; +import sun.hotspot.WhiteBox; + import java.util.stream.IntStream; -import sun.hotspot.WhiteBox; public class CompilerUtils { diff --git a/test/compiler/testlibrary/rtm/AbortProvoker.java b/test/compiler/testlibrary/rtm/AbortProvoker.java --- a/test/compiler/testlibrary/rtm/AbortProvoker.java +++ b/test/compiler/testlibrary/rtm/AbortProvoker.java @@ -24,13 +24,13 @@ package compiler.testlibrary.rtm; +import jdk.test.lib.Asserts; +import sun.hotspot.WhiteBox; + import java.util.Objects; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; -import jdk.test.lib.Asserts; -import sun.hotspot.WhiteBox; - /** * Base class for different transactional execution abortion * provokers aimed to force abort due to specified reason. diff --git a/test/compiler/testlibrary/rtm/RTMLockingStatistics.java b/test/compiler/testlibrary/rtm/RTMLockingStatistics.java --- a/test/compiler/testlibrary/rtm/RTMLockingStatistics.java +++ b/test/compiler/testlibrary/rtm/RTMLockingStatistics.java @@ -28,8 +28,8 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.util.regex.Matcher; /** * Wrapper for +UsePreciseRTMLockingStatistics output. diff --git a/test/compiler/testlibrary/rtm/RTMTestBase.java b/test/compiler/testlibrary/rtm/RTMTestBase.java --- a/test/compiler/testlibrary/rtm/RTMTestBase.java +++ b/test/compiler/testlibrary/rtm/RTMTestBase.java @@ -24,21 +24,21 @@ package compiler.testlibrary.rtm; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.List; -import java.util.LinkedList; -import java.util.Arrays; -import java.util.Collections; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.ProcessTools; import jdk.test.lib.Utils; import jdk.test.lib.cli.CommandLineOptionTest; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + /** * Auxiliary methods used for RTM testing. */ diff --git a/test/compiler/testlibrary/rtm/XAbortProvoker.java b/test/compiler/testlibrary/rtm/XAbortProvoker.java --- a/test/compiler/testlibrary/rtm/XAbortProvoker.java +++ b/test/compiler/testlibrary/rtm/XAbortProvoker.java @@ -24,8 +24,8 @@ package compiler.testlibrary.rtm; +import jdk.internal.misc.Unsafe; import jdk.test.lib.Utils; -import jdk.internal.misc.Unsafe; /** * Current RTM locking implementation force transaction abort diff --git a/test/compiler/testlibrary/rtm/predicate/SupportedCPU.java b/test/compiler/testlibrary/rtm/predicate/SupportedCPU.java --- a/test/compiler/testlibrary/rtm/predicate/SupportedCPU.java +++ b/test/compiler/testlibrary/rtm/predicate/SupportedCPU.java @@ -24,12 +24,11 @@ package compiler.testlibrary.rtm.predicate; +import jdk.test.lib.Platform; import sun.hotspot.cpuinfo.CPUInfo; import java.util.function.BooleanSupplier; -import jdk.test.lib.Platform; - public class SupportedCPU implements BooleanSupplier { @Override public boolean getAsBoolean() { diff --git a/test/compiler/testlibrary/uncommontrap/Verifier.java b/test/compiler/testlibrary/uncommontrap/Verifier.java --- a/test/compiler/testlibrary/uncommontrap/Verifier.java +++ b/test/compiler/testlibrary/uncommontrap/Verifier.java @@ -23,6 +23,8 @@ package compiler.testlibrary.uncommontrap; +import jdk.test.lib.Asserts; + import java.io.FileReader; import java.io.IOException; import java.nio.file.Files; @@ -33,8 +35,6 @@ import java.util.Properties; import java.util.regex.Pattern; -import jdk.test.lib.Asserts; - /** * Utility tool aimed to verify presence or absence of specified uncommon trap * in compilation log. diff --git a/test/compiler/tiered/CompLevelsTest.java b/test/compiler/tiered/CompLevelsTest.java --- a/test/compiler/tiered/CompLevelsTest.java +++ b/test/compiler/tiered/CompLevelsTest.java @@ -27,6 +27,8 @@ * @author igor.ignatyev@oracle.com */ +package compiler.tiered; + import compiler.whitebox.CompilerWhiteBoxTest; public abstract class CompLevelsTest extends CompilerWhiteBoxTest { diff --git a/test/compiler/tiered/ConstantGettersTransitionsTest.java b/test/compiler/tiered/ConstantGettersTransitionsTest.java --- a/test/compiler/tiered/ConstantGettersTransitionsTest.java +++ b/test/compiler/tiered/ConstantGettersTransitionsTest.java @@ -23,21 +23,27 @@ /** * @test ConstantGettersTransitionsTest + * @summary Test the correctness of compilation level transitions for constant getters methods * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management - * @build TransitionsTestExecutor ConstantGettersTransitionsTest + * + * @build compiler.tiered.TransitionsTestExecutor + * compiler.tiered.ConstantGettersTransitionsTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:+TieredCompilation -XX:-UseCounterDecay - * -XX:CompileCommand=compileonly,ConstantGettersTestCase$TrivialMethods::* - * TransitionsTestExecutor ConstantGettersTransitionsTest - * @summary Test the correctness of compilation level transitions for constant getters methods + * -XX:+WhiteBoxAPI -XX:+TieredCompilation -XX:-UseCounterDecay + * -XX:CompileCommand=compileonly,compiler.tiered.ConstantGettersTransitionsTest$ConstantGettersTestCase$TrivialMethods::* + * compiler.tiered.TransitionsTestExecutor + * compiler.tiered.ConstantGettersTransitionsTest */ +package compiler.tiered; + +import compiler.whitebox.CompilerWhiteBoxTest; + import java.lang.reflect.Executable; import java.util.concurrent.Callable; -import compiler.whitebox.CompilerWhiteBoxTest; public class ConstantGettersTransitionsTest extends LevelTransitionTest { public static void main(String[] args) { @@ -57,141 +63,141 @@ private ConstantGettersTransitionsTest(TestCase testCase) { super(testCase); } -} -enum ConstantGettersTestCase implements CompilerWhiteBoxTest.TestCase { - ICONST_M1, - ICONST_0, - ICONST_1, - ICONST_2, - ICONST_3, - ICONST_4, - ICONST_5, - LCONST_0, - LCONST_1, - FCONST_0, - FCONST_1, - FCONST_2, - DCONST_0, - DCONST_1, - DCONST_W, - BYTE, - SHORT, - CHAR; + private static enum ConstantGettersTestCase implements CompilerWhiteBoxTest.TestCase { + ICONST_M1, + ICONST_0, + ICONST_1, + ICONST_2, + ICONST_3, + ICONST_4, + ICONST_5, + LCONST_0, + LCONST_1, + FCONST_0, + FCONST_1, + FCONST_2, + DCONST_0, + DCONST_1, + DCONST_W, + BYTE, + SHORT, + CHAR; - private final Executable executable; - private final Callable callable; + private final Executable executable; + private final Callable callable; - @Override - public Executable getExecutable() { - return executable; - } - - @Override - public Callable getCallable() { - return callable; - } - - @Override - public boolean isOsr() { - return false; - } - - private ConstantGettersTestCase() { - String name = "make" + this.name(); - this.executable = LevelTransitionTest.Helper.getMethod(TrivialMethods.class, name); - this.callable = LevelTransitionTest.Helper.getCallable(new TrivialMethods(), name); - } - - /** - * Contains methods that load constants with certain types of bytecodes - * See JVMS 2.11.2. Load and Store Instructions - * Note that it doesn't have a method for ldc_w instruction - */ - private static class TrivialMethods { - public static int makeICONST_M1() { - return -1; + @Override + public Executable getExecutable() { + return executable; } - public static int makeICONST_0() { - return 0; + @Override + public Callable getCallable() { + return callable; } - public static int makeICONST_1() { - return 1; + @Override + public boolean isOsr() { + return false; } - public static int makeICONST_2() { - return 2; + private ConstantGettersTestCase() { + String name = "make" + this.name(); + this.executable = LevelTransitionTest.Helper.getMethod(TrivialMethods.class, name); + this.callable = LevelTransitionTest.Helper.getCallable(new TrivialMethods(), name); } - public static int makeICONST_3() { - return 3; - } + /** + * Contains methods that load constants with certain types of bytecodes + * See JVMS 2.11.2. Load and Store Instructions + * Note that it doesn't have a method for ldc_w instruction + */ + private static class TrivialMethods { + public static int makeICONST_M1() { + return -1; + } - public static int makeICONST_4() { - return 4; - } + public static int makeICONST_0() { + return 0; + } - public static int makeICONST_5() { - return 5; - } + public static int makeICONST_1() { + return 1; + } - public static long makeLCONST_0() { - return 0L; - } + public static int makeICONST_2() { + return 2; + } - public static long makeLCONST_1() { - return 1L; - } + public static int makeICONST_3() { + return 3; + } - public static float makeFCONST_0() { - return 0F; - } + public static int makeICONST_4() { + return 4; + } - public static float makeFCONST_1() { - return 1F; - } + public static int makeICONST_5() { + return 5; + } - public static float makeFCONST_2() { - return 2F; - } + public static long makeLCONST_0() { + return 0L; + } - public static double makeDCONST_0() { - return 0D; - } + public static long makeLCONST_1() { + return 1L; + } - public static double makeDCONST_1() { - return 1D; - } + public static float makeFCONST_0() { + return 0F; + } - public static double makeDCONST_W() { - // ldc2_w - return Double.MAX_VALUE; - } + public static float makeFCONST_1() { + return 1F; + } - public static Object makeOBJECT() { - // aconst_null - return null; - } + public static float makeFCONST_2() { + return 2F; + } - public static byte makeBYTE() { - // bipush - return (byte) 0x7F; - } + public static double makeDCONST_0() { + return 0D; + } - public static short makeSHORT() { - // sipush - return (short) 0x7FFF; - } + public static double makeDCONST_1() { + return 1D; + } - public static char makeCHAR() { - // ldc - return (char) 0xFFFF; - } + public static double makeDCONST_W() { + // ldc2_w + return Double.MAX_VALUE; + } - public static boolean makeBOOLEAN() { - return true; + public static Object makeOBJECT() { + // aconst_null + return null; + } + + public static byte makeBYTE() { + // bipush + return (byte) 0x7F; + } + + public static short makeSHORT() { + // sipush + return (short) 0x7FFF; + } + + public static char makeCHAR() { + // ldc + return (char) 0xFFFF; + } + + public static boolean makeBOOLEAN() { + return true; + } } } -} +} \ No newline at end of file diff --git a/test/compiler/tiered/LevelTransitionTest.java b/test/compiler/tiered/LevelTransitionTest.java --- a/test/compiler/tiered/LevelTransitionTest.java +++ b/test/compiler/tiered/LevelTransitionTest.java @@ -23,29 +23,37 @@ /** * @test LevelTransitionTest + * @summary Test the correctness of compilation level transitions for different methods * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management + * * @ignore 8067651 - * @build TransitionsTestExecutor LevelTransitionTest - * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission + * @build compiler.tiered.TransitionsTestExecutor compiler.tiered.LevelTransitionTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:+TieredCompilation + * -XX:+WhiteBoxAPI -XX:+TieredCompilation -XX:-UseCounterDecay * -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* - * -XX:CompileCommand=compileonly,ExtendedTestCase$CompileMethodHolder::* - * TransitionsTestExecutor LevelTransitionTest - * @summary Test the correctness of compilation level transitions for different methods + * -XX:CompileCommand=compileonly,compiler.tiered.LevelTransitionTest$ExtendedTestCase$CompileMethodHolder::* + * compiler.tiered.TransitionsTestExecutor + * compiler.tiered.LevelTransitionTest */ +package compiler.tiered; + +import compiler.whitebox.CompilerWhiteBoxTest; +import compiler.whitebox.SimpleTestCase; + import java.lang.reflect.Executable; import java.lang.reflect.Method; import java.util.Objects; import java.util.concurrent.Callable; -import compiler.whitebox.CompilerWhiteBoxTest; -import compiler.whitebox.SimpleTestCase; public class LevelTransitionTest extends TieredLevelsTest { - /** Shows if method was profiled by being executed on levels 2 or 3 */ + /** + * Shows if method was profiled by being executed on levels 2 or 3 + */ protected boolean isMethodProfiled; private int transitionCount; @@ -103,7 +111,8 @@ System.out.printf("Method %s is compiled on level %d. Expected level is %d%n", method, newLevel, expected); checkLevel(expected, newLevel); printInfo(); - }; + } + ; } /** @@ -195,59 +204,66 @@ }; } } -} -enum ExtendedTestCase implements CompilerWhiteBoxTest.TestCase { - ACCESSOR_TEST("accessor"), - NONTRIVIAL_METHOD_TEST("nonTrivialMethod"), - TRIVIAL_CODE_TEST("trivialCode"); + private static enum ExtendedTestCase implements CompilerWhiteBoxTest.TestCase { + ACCESSOR_TEST("accessor"), + NONTRIVIAL_METHOD_TEST("nonTrivialMethod"), + TRIVIAL_CODE_TEST("trivialCode"); - private final Executable executable; - private final Callable callable; + private final Executable executable; + private final Callable callable; - @Override - public Executable getExecutable() { - return executable; + @Override + public Executable getExecutable() { + return executable; + } + + @Override + public Callable getCallable() { + return callable; + } + + @Override + public boolean isOsr() { + return false; + } + + private ExtendedTestCase(String methodName) { + this.executable = LevelTransitionTest.Helper.getMethod(CompileMethodHolder.class, methodName); + this.callable = LevelTransitionTest.Helper.getCallable(new CompileMethodHolder(), methodName); + } + + private static class CompileMethodHolder { + private final int iter = 10; + private int field = 42; + + /** + * Non-trivial method for threshold policy: contains loops + */ + public int nonTrivialMethod() { + int acc = 0; + for (int i = 0; i < iter; i++) { + acc += i; + } + return acc; + } + + /** + * Field accessor method + */ + public int accessor() { + return field; + } + + /** + * Method considered as trivial by amount of code + */ + public int trivialCode() { + int var = 0xBAAD_C0DE; + var *= field; + return var; + } + } } - @Override - public Callable getCallable() { - return callable; - } - - @Override - public boolean isOsr() { - return false; - } - - private ExtendedTestCase(String methodName) { - this.executable = LevelTransitionTest.Helper.getMethod(CompileMethodHolder.class, methodName); - this.callable = LevelTransitionTest.Helper.getCallable(new CompileMethodHolder(), methodName); - } - - private static class CompileMethodHolder { - private final int iter = 10; - private int field = 42; - - /** Non-trivial method for threshold policy: contains loops */ - public int nonTrivialMethod() { - int acc = 0; - for (int i = 0; i < iter; i++) { - acc += i; - } - return acc; - } - - /** Field accessor method */ - public int accessor() { - return field; - } - - /** Method considered as trivial by amount of code */ - public int trivialCode() { - int var = 0xBAAD_C0DE; - var *= field; - return var; - } - } -} +} \ No newline at end of file diff --git a/test/compiler/tiered/NonTieredLevelsTest.java b/test/compiler/tiered/NonTieredLevelsTest.java --- a/test/compiler/tiered/NonTieredLevelsTest.java +++ b/test/compiler/tiered/NonTieredLevelsTest.java @@ -23,22 +23,25 @@ /** * @test NonTieredLevelsTest + * @summary Verify that only one level can be used * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build NonTieredLevelsTest + * java.management + * + * @build compiler.tiered.NonTieredLevelsTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCounterDecay * -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* - * NonTieredLevelsTest - * @summary Verify that only one level can be used - * @author igor.ignatyev@oracle.com + * compiler.tiered.NonTieredLevelsTest */ +package compiler.tiered; + +import compiler.whitebox.CompilerWhiteBoxTest; + import java.util.function.IntPredicate; -import compiler.whitebox.CompilerWhiteBoxTest; public class NonTieredLevelsTest extends CompLevelsTest { private static final int AVAILABLE_COMP_LEVEL; diff --git a/test/compiler/tiered/TieredLevelsTest.java b/test/compiler/tiered/TieredLevelsTest.java --- a/test/compiler/tiered/TieredLevelsTest.java +++ b/test/compiler/tiered/TieredLevelsTest.java @@ -23,24 +23,26 @@ /** * @test TieredLevelsTest + * @summary Verify that all levels < 'TieredStopAtLevel' can be used * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build TieredLevelsTest + * java.management + * + * @build compiler.tiered.TieredLevelsTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+TieredCompilation * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCounterDecay * -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* - * TieredLevelsTest - * @summary Verify that all levels < 'TieredStopAtLevel' can be used - * @author igor.ignatyev@oracle.com + * compiler.tiered.TieredLevelsTest */ +package compiler.tiered; + import compiler.whitebox.CompilerWhiteBoxTest; public class TieredLevelsTest extends CompLevelsTest { - public static void main(String[] args) throws Exception, Throwable { + public static void main(String[] args) throws Throwable { if (CompilerWhiteBoxTest.skipOnTieredCompilation(false)) { return; } diff --git a/test/compiler/tiered/TransitionsTestExecutor.java b/test/compiler/tiered/TransitionsTestExecutor.java --- a/test/compiler/tiered/TransitionsTestExecutor.java +++ b/test/compiler/tiered/TransitionsTestExecutor.java @@ -21,6 +21,9 @@ * questions. */ +package compiler.tiered; + +import compiler.whitebox.CompilerWhiteBoxTest; import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.ProcessTools; @@ -29,7 +32,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import compiler.whitebox.CompilerWhiteBoxTest; /** * Executes given test in a separate VM with enabled Tiered Compilation for @@ -59,9 +61,6 @@ Collections.addAll(args, policy, testName); OutputAnalyzer out = ProcessTools.executeTestJvm(args.toArray(new String[args.size()])); - int exitCode = out.getExitValue(); - if (exitCode != 0) { - throw new Error("Test execution failed with exit code " + exitCode); - } + out.shouldHaveExitValue(0); } } diff --git a/test/compiler/types/TestMeetExactConstantArrays.java b/test/compiler/types/TestMeetExactConstantArrays.java --- a/test/compiler/types/TestMeetExactConstantArrays.java +++ b/test/compiler/types/TestMeetExactConstantArrays.java @@ -25,10 +25,12 @@ * @test * @bug 8075587 * @summary meet of 2 constant arrays result in bottom - * @run main/othervm TestMeetExactConstantArrays * + * @run main/othervm compiler.types.TestMeetExactConstantArrays */ +package compiler.types; + public class TestMeetExactConstantArrays { public abstract static class NumbersHolder { public Number[] getNumbers() { diff --git a/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java b/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java --- a/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java +++ b/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java @@ -28,9 +28,10 @@ * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc * @library /testlibrary /test/lib + * * @build sun.hotspot.WhiteBox - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm * -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions @@ -41,10 +42,10 @@ * -XX:CICompilerCount=1 * -XX:+PrintCompilation * -XX:+PrintInlining - * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*.run - * -XX:CompileCommand=dontinline,TestMeetIncompatibleInterfaceArrays$Helper.createI2* + * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run + * -XX:CompileCommand=dontinline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2* * -XX:CompileCommand=quiet - * TestMeetIncompatibleInterfaceArrays 0 + * compiler.types.TestMeetIncompatibleInterfaceArrays 0 * @run main/othervm * -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions @@ -55,10 +56,10 @@ * -XX:CICompilerCount=1 * -XX:+PrintCompilation * -XX:+PrintInlining - * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*.run - * -XX:CompileCommand=inline,TestMeetIncompatibleInterfaceArrays$Helper.createI2* + * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run + * -XX:CompileCommand=inline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2* * -XX:CompileCommand=quiet - * TestMeetIncompatibleInterfaceArrays 1 + * compiler.types.TestMeetIncompatibleInterfaceArrays 1 * @run main/othervm * -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions @@ -72,22 +73,39 @@ * -XX:CICompilerCount=2 * -XX:+PrintCompilation * -XX:+PrintInlining - * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*.run - * -XX:CompileCommand=compileonly,TestMeetIncompatibleInterfaceArrays$Helper.createI2* - * -XX:CompileCommand=inline,TestMeetIncompatibleInterfaceArrays$Helper.createI2* + * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run + * -XX:CompileCommand=compileonly,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2* + * -XX:CompileCommand=inline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2* * -XX:CompileCommand=quiet - * TestMeetIncompatibleInterfaceArrays 2 + * compiler.types.TestMeetIncompatibleInterfaceArrays 2 * * @author volker.simonis@gmail.com */ +package compiler.types; + +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import sun.hotspot.WhiteBox; + import java.io.FileOutputStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import jdk.internal.org.objectweb.asm.ClassWriter; -import jdk.internal.org.objectweb.asm.MethodVisitor; -import static jdk.internal.org.objectweb.asm.Opcodes.*; -import sun.hotspot.WhiteBox; + +import static jdk.internal.org.objectweb.asm.Opcodes.AALOAD; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD; +import static jdk.internal.org.objectweb.asm.Opcodes.ARETURN; +import static jdk.internal.org.objectweb.asm.Opcodes.ASTORE; +import static jdk.internal.org.objectweb.asm.Opcodes.GETSTATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_0; +import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEINTERFACE; +import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL; +import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESTATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEVIRTUAL; +import static jdk.internal.org.objectweb.asm.Opcodes.RETURN; +import static jdk.internal.org.objectweb.asm.Opcodes.V1_8; public class TestMeetIncompatibleInterfaceArrays extends ClassLoader { @@ -245,14 +263,14 @@ constr.visitMaxs(0, 0); constr.visitEnd(); MethodVisitor run = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "run", - "()" + a + "LTestMeetIncompatibleInterfaceArrays$I1;", null, null); + "()" + a + "Lcompiler/types/TestMeetIncompatibleInterfaceArrays$I1;", null, null); run.visitCode(); if (dim == 4) { - run.visitMethodInsn(INVOKESTATIC, "TestMeetIncompatibleInterfaceArrays$Helper", createName + 3, - "()" + "[[[" + "LTestMeetIncompatibleInterfaceArrays$I2;", false); + run.visitMethodInsn(INVOKESTATIC, "compiler/types/TestMeetIncompatibleInterfaceArrays$Helper", createName + 3, + "()" + "[[[" + "Lcompiler/types/TestMeetIncompatibleInterfaceArrays$I2;", false); } else { - run.visitMethodInsn(INVOKESTATIC, "TestMeetIncompatibleInterfaceArrays$Helper", createName + dim, - "()" + a + "LTestMeetIncompatibleInterfaceArrays$I2;", false); + run.visitMethodInsn(INVOKESTATIC, "compiler/types/TestMeetIncompatibleInterfaceArrays$Helper", createName + dim, + "()" + a + "Lcompiler/types/TestMeetIncompatibleInterfaceArrays$I2;", false); } run.visitInsn(ARETURN); run.visitMaxs(0, 0); @@ -260,7 +278,7 @@ MethodVisitor test = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "test", "()V", null, null); test.visitCode(); test.visitMethodInsn(INVOKESTATIC, baseClassName + dim + "ASM", "run", - "()" + a + "LTestMeetIncompatibleInterfaceArrays$I1;", false); + "()" + a + "Lcompiler/types/TestMeetIncompatibleInterfaceArrays$I1;", false); test.visitVarInsn(ASTORE, 0); if (dim > 0) { test.visitVarInsn(ALOAD, 0); @@ -272,7 +290,7 @@ } test.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); test.visitVarInsn(ALOAD, dim > 0 ? 1 : 0); - test.visitMethodInsn(INVOKEINTERFACE, "TestMeetIncompatibleInterfaceArrays$I1", "getName", + test.visitMethodInsn(INVOKEINTERFACE, "compiler/types/TestMeetIncompatibleInterfaceArrays$I1", "getName", "()Ljava/lang/String;", true); test.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/Object;)V", false); test.visitInsn(RETURN); @@ -296,9 +314,9 @@ final int pass = Integer.parseInt(args.length > 0 ? args[0] : "0"); // Load and initialize some classes required for compilation - Class.forName("TestMeetIncompatibleInterfaceArrays$I1"); - Class.forName("TestMeetIncompatibleInterfaceArrays$I2"); - Class.forName("TestMeetIncompatibleInterfaceArrays$Helper"); + Class.forName("compiler.types.TestMeetIncompatibleInterfaceArrays$I1"); + Class.forName("compiler.types.TestMeetIncompatibleInterfaceArrays$I2"); + Class.forName("compiler.types.TestMeetIncompatibleInterfaceArrays$Helper"); for (int g = 0; g < 2; g++) { String baseClassName = "MeetIncompatibleInterfaceArrays"; diff --git a/test/compiler/types/TestMeetTopArrayExactConstantArray.java b/test/compiler/types/TestMeetTopArrayExactConstantArray.java --- a/test/compiler/types/TestMeetTopArrayExactConstantArray.java +++ b/test/compiler/types/TestMeetTopArrayExactConstantArray.java @@ -25,10 +25,15 @@ * @test * @bug 8027571 * @summary meet of TopPTR exact array with constant array is not symmetric - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation -XX:-BackgroundCompilation TestMeetTopArrayExactConstantArray * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement + * -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation + * -XX:-BackgroundCompilation + * compiler.types.TestMeetTopArrayExactConstantArray */ +package compiler.types; + public class TestMeetTopArrayExactConstantArray { static class A { diff --git a/test/compiler/types/TestPhiElimination.java b/test/compiler/types/TestPhiElimination.java --- a/test/compiler/types/TestPhiElimination.java +++ b/test/compiler/types/TestPhiElimination.java @@ -26,8 +26,13 @@ * @test * @bug 8150804 * @summary Tests elimination of Phi nodes without losing type information. - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestPhiElimination + * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.types.TestPhiElimination */ + +package compiler.types; + public class TestPhiElimination { /* A::get() is inlined into test(obj) producing the following graph: @@ -90,23 +95,20 @@ } } -} + static class A extends TestPhiElimination { + public Object f; -class A extends TestPhiElimination { - public Object f; + public A create() { + return new A(); + } - public A create() { - return new A(); + public synchronized Object get() { + if (f == null) { + f = create(); + } + return f; + } } - public synchronized Object get() { - if (f == null) { - f = create(); - } - return f; - } + static class B extends A { } } - -class B extends A { - -} diff --git a/test/compiler/types/TestSpeculationFailedHigherEqual.java b/test/compiler/types/TestSpeculationFailedHigherEqual.java --- a/test/compiler/types/TestSpeculationFailedHigherEqual.java +++ b/test/compiler/types/TestSpeculationFailedHigherEqual.java @@ -25,10 +25,14 @@ * @test * @bug 8027422 * @summary type methods shouldn't always operate on speculative part - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation -XX:-BackgroundCompilation TestSpeculationFailedHigherEqual * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TypeProfileLevel=222 + * -XX:+UseTypeSpeculation -XX:-BackgroundCompilation + * compiler.types.TestSpeculationFailedHigherEqual */ +package compiler.types; + public class TestSpeculationFailedHigherEqual { static class A { diff --git a/test/compiler/types/TestTypePropagationToCmpU.java b/test/compiler/types/TestTypePropagationToCmpU.java --- a/test/compiler/types/TestTypePropagationToCmpU.java +++ b/test/compiler/types/TestTypePropagationToCmpU.java @@ -25,8 +25,12 @@ * @test * @bug 8080156 8060036 * @summary Test correctness of type propagation to CmpUNodes. - * @run main TestTypePropagationToCmpU + * + * @run main compiler.types.TestTypePropagationToCmpU */ + +package compiler.types; + public class TestTypePropagationToCmpU { public static void main(String[] args) { try { diff --git a/test/compiler/types/TypeSpeculation.java b/test/compiler/types/TypeSpeculation.java --- a/test/compiler/types/TypeSpeculation.java +++ b/test/compiler/types/TypeSpeculation.java @@ -25,10 +25,15 @@ * @test * @bug 8024070 * @summary Test that type speculation doesn't cause incorrect execution - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation TypeSpeculation * + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseOnStackReplacement + * -XX:-BackgroundCompilation -XX:TypeProfileLevel=222 + * -XX:+UseTypeSpeculation + * compiler.types.TypeSpeculation */ +package compiler.types; + public class TypeSpeculation { interface I { diff --git a/test/compiler/types/correctness/CorrectnessTest.java b/test/compiler/types/correctness/CorrectnessTest.java --- a/test/compiler/types/correctness/CorrectnessTest.java +++ b/test/compiler/types/correctness/CorrectnessTest.java @@ -24,47 +24,60 @@ /* * @test CorrectnessTest * @bug 8038418 - * @library /testlibrary /test/lib + * @summary Tests correctness of type usage with type profiling and speculations + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management * @ignore 8066173 - * @compile execution/TypeConflict.java execution/TypeProfile.java - * execution/MethodHandleDelegate.java - * @build CorrectnessTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission + * @build compiler.types.correctness.CorrectnessTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation - * -XX:CompileCommand=exclude,execution/*::methodNotToCompile - * -XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType - * CorrectnessTest RETURN + * -XX:CompileCommand=exclude,compiler.types.correctness.execution.*::methodNotToCompile + * -XX:CompileCommand=dontinline,compiler.types.correctness.scenarios.Scenario::collectReturnType + * compiler.types.correctness.CorrectnessTest RETURN * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation - * -XX:CompileCommand=exclude,execution/*::methodNotToCompile - * -XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType - * CorrectnessTest PARAMETERS + * -XX:CompileCommand=exclude,compiler.types.correctness.execution.*::methodNotToCompile + * -XX:CompileCommand=dontinline,compiler.types.correctness.scenarios.Scenario::collectReturnType + * compiler.types.correctness.CorrectnessTest PARAMETERS * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:TypeProfileLevel=222 -XX:+UseTypeSpeculation - * -XX:CompileCommand=exclude,execution/*::methodNotToCompile - * -XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType - * CorrectnessTest ARGUMENTS - * @summary Tests correctness of type usage with type profiling and speculations + * -XX:CompileCommand=exclude,compiler.types.correctness.execution.*::methodNotToCompile + * -XX:CompileCommand=dontinline,compiler.types.correctness.scenarios.Scenario::collectReturnType + * compiler.types.correctness.CorrectnessTest ARGUMENTS */ +package compiler.types.correctness; + +import compiler.types.correctness.execution.Execution; +import compiler.types.correctness.execution.MethodHandleDelegate; +import compiler.types.correctness.execution.TypeConflict; +import compiler.types.correctness.execution.TypeProfile; +import compiler.types.correctness.hierarchies.DefaultMethodInterface; +import compiler.types.correctness.hierarchies.DefaultMethodInterface2; +import compiler.types.correctness.hierarchies.Linear; +import compiler.types.correctness.hierarchies.Linear2; +import compiler.types.correctness.hierarchies.NullableType; +import compiler.types.correctness.hierarchies.OneRank; +import compiler.types.correctness.hierarchies.TypeHierarchy; +import compiler.types.correctness.scenarios.ArrayCopy; +import compiler.types.correctness.scenarios.ArrayReferenceStore; +import compiler.types.correctness.scenarios.CheckCast; +import compiler.types.correctness.scenarios.ClassIdentity; +import compiler.types.correctness.scenarios.ClassInstanceOf; +import compiler.types.correctness.scenarios.ClassIsInstance; +import compiler.types.correctness.scenarios.ProfilingType; +import compiler.types.correctness.scenarios.ReceiverAtInvokes; +import compiler.types.correctness.scenarios.Scenario; import jdk.test.lib.Asserts; import jdk.test.lib.Platform; -import execution.Execution; -import execution.MethodHandleDelegate; -import execution.TypeConflict; -import execution.TypeProfile; -import hierarchies.*; -import scenarios.*; import sun.hotspot.WhiteBox; -import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; diff --git a/test/compiler/types/correctness/OffTest.java b/test/compiler/types/correctness/OffTest.java --- a/test/compiler/types/correctness/OffTest.java +++ b/test/compiler/types/correctness/OffTest.java @@ -24,24 +24,25 @@ /* * @test CorrectnessTest * @bug 8038418 - * @library /testlibrary /test/lib + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management + * * @ignore 8066173 - * @compile execution/TypeConflict.java execution/TypeProfile.java - * execution/MethodHandleDelegate.java - * @build CorrectnessTest - * @build OffTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/timeout=1200 OffTest + * @build compiler.types.correctness.OffTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/timeout=1200 compiler.types.correctness.OffTest */ +package compiler.types.correctness; + +import compiler.types.correctness.scenarios.ProfilingType; import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.ProcessTools; import jdk.test.lib.Utils; + import java.util.Random; -import scenarios.ProfilingType; public class OffTest { private static final String[] OPTIONS = { @@ -50,8 +51,8 @@ "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", - "-XX:CompileCommand=exclude,execution/*::methodNotToCompile", - "-XX:CompileCommand=dontinline,scenarios/Scenario::collectReturnType", + "-XX:CompileCommand=exclude,compiler.types.correctness.execution.*::methodNotToCompile", + "-XX:CompileCommand=dontinline,compiler.types.correctness.scenarios.Scenario::collectReturnType", "", // -XX:TypeProfileLevel=? "", // -XX:?UseTypeSpeculation CorrectnessTest.class.getName(), diff --git a/test/compiler/types/correctness/execution/Execution.java b/test/compiler/types/correctness/execution/Execution.java --- a/test/compiler/types/correctness/execution/Execution.java +++ b/test/compiler/types/correctness/execution/Execution.java @@ -20,10 +20,10 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package execution; +package compiler.types.correctness.execution; -import hierarchies.TypeHierarchy; -import scenarios.Scenario; +import compiler.types.correctness.hierarchies.TypeHierarchy; +import compiler.types.correctness.scenarios.Scenario; /** * Execution scenario represents test methods execution type. @@ -33,7 +33,7 @@ public interface Execution { /** * Executes the test code of the given scenario - * See {@link scenarios.Scenario#run(T)} + * See {@link Scenario#run(T)} * * @param scenario test scenario */ diff --git a/test/compiler/types/correctness/execution/MethodHandleDelegate.java b/test/compiler/types/correctness/execution/MethodHandleDelegate.java --- a/test/compiler/types/correctness/execution/MethodHandleDelegate.java +++ b/test/compiler/types/correctness/execution/MethodHandleDelegate.java @@ -21,10 +21,10 @@ * questions. */ -package execution; +package compiler.types.correctness.execution; -import hierarchies.TypeHierarchy; -import scenarios.Scenario; +import compiler.types.correctness.hierarchies.TypeHierarchy; +import compiler.types.correctness.scenarios.Scenario; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; diff --git a/test/compiler/types/correctness/execution/TypeConflict.java b/test/compiler/types/correctness/execution/TypeConflict.java --- a/test/compiler/types/correctness/execution/TypeConflict.java +++ b/test/compiler/types/correctness/execution/TypeConflict.java @@ -21,10 +21,10 @@ * questions. */ -package execution; +package compiler.types.correctness.execution; -import hierarchies.TypeHierarchy; -import scenarios.Scenario; +import compiler.types.correctness.hierarchies.TypeHierarchy; +import compiler.types.correctness.scenarios.Scenario; /** * Type profiling conflict execution scenario. The main goal is diff --git a/test/compiler/types/correctness/execution/TypeProfile.java b/test/compiler/types/correctness/execution/TypeProfile.java --- a/test/compiler/types/correctness/execution/TypeProfile.java +++ b/test/compiler/types/correctness/execution/TypeProfile.java @@ -21,10 +21,10 @@ * questions. */ -package execution; +package compiler.types.correctness.execution; -import hierarchies.TypeHierarchy; -import scenarios.Scenario; +import compiler.types.correctness.hierarchies.TypeHierarchy; +import compiler.types.correctness.scenarios.Scenario; /** * Profile type execution scenario. Executes tester method diff --git a/test/compiler/types/correctness/hierarchies/DefaultMethodInterface.java b/test/compiler/types/correctness/hierarchies/DefaultMethodInterface.java --- a/test/compiler/types/correctness/hierarchies/DefaultMethodInterface.java +++ b/test/compiler/types/correctness/hierarchies/DefaultMethodInterface.java @@ -21,7 +21,7 @@ * questions. */ -package hierarchies; +package compiler.types.correctness.hierarchies; public class DefaultMethodInterface { private DefaultMethodInterface() { diff --git a/test/compiler/types/correctness/hierarchies/DefaultMethodInterface2.java b/test/compiler/types/correctness/hierarchies/DefaultMethodInterface2.java --- a/test/compiler/types/correctness/hierarchies/DefaultMethodInterface2.java +++ b/test/compiler/types/correctness/hierarchies/DefaultMethodInterface2.java @@ -21,7 +21,7 @@ * questions. */ -package hierarchies; +package compiler.types.correctness.hierarchies; public class DefaultMethodInterface2 { private DefaultMethodInterface2() { diff --git a/test/compiler/types/correctness/hierarchies/Linear.java b/test/compiler/types/correctness/hierarchies/Linear.java --- a/test/compiler/types/correctness/hierarchies/Linear.java +++ b/test/compiler/types/correctness/hierarchies/Linear.java @@ -21,7 +21,7 @@ * questions. */ -package hierarchies; +package compiler.types.correctness.hierarchies; public class Linear { private Linear() { diff --git a/test/compiler/types/correctness/hierarchies/Linear2.java b/test/compiler/types/correctness/hierarchies/Linear2.java --- a/test/compiler/types/correctness/hierarchies/Linear2.java +++ b/test/compiler/types/correctness/hierarchies/Linear2.java @@ -21,7 +21,7 @@ * questions. */ -package hierarchies; +package compiler.types.correctness.hierarchies; public class Linear2 { private Linear2() { diff --git a/test/compiler/types/correctness/hierarchies/NullableType.java b/test/compiler/types/correctness/hierarchies/NullableType.java --- a/test/compiler/types/correctness/hierarchies/NullableType.java +++ b/test/compiler/types/correctness/hierarchies/NullableType.java @@ -21,7 +21,7 @@ * questions. */ -package hierarchies; +package compiler.types.correctness.hierarchies; public class NullableType extends TypeHierarchy { diff --git a/test/compiler/types/correctness/hierarchies/OneRank.java b/test/compiler/types/correctness/hierarchies/OneRank.java --- a/test/compiler/types/correctness/hierarchies/OneRank.java +++ b/test/compiler/types/correctness/hierarchies/OneRank.java @@ -21,7 +21,7 @@ * questions. */ -package hierarchies; +package compiler.types.correctness.hierarchies; public class OneRank { private OneRank() { diff --git a/test/compiler/types/correctness/hierarchies/TypeHierarchy.java b/test/compiler/types/correctness/hierarchies/TypeHierarchy.java --- a/test/compiler/types/correctness/hierarchies/TypeHierarchy.java +++ b/test/compiler/types/correctness/hierarchies/TypeHierarchy.java @@ -21,7 +21,7 @@ * questions. */ -package hierarchies; +package compiler.types.correctness.hierarchies; /** * Type hierarchy contains classes the type profiling and speculation are tested with diff --git a/test/compiler/types/correctness/scenarios/ArrayCopy.java b/test/compiler/types/correctness/scenarios/ArrayCopy.java --- a/test/compiler/types/correctness/scenarios/ArrayCopy.java +++ b/test/compiler/types/correctness/scenarios/ArrayCopy.java @@ -21,9 +21,9 @@ * questions. */ -package scenarios; +package compiler.types.correctness.scenarios; -import hierarchies.TypeHierarchy; +import compiler.types.correctness.hierarchies.TypeHierarchy; import java.util.Arrays; diff --git a/test/compiler/types/correctness/scenarios/ArrayReferenceStore.java b/test/compiler/types/correctness/scenarios/ArrayReferenceStore.java --- a/test/compiler/types/correctness/scenarios/ArrayReferenceStore.java +++ b/test/compiler/types/correctness/scenarios/ArrayReferenceStore.java @@ -21,9 +21,9 @@ * questions. */ -package scenarios; +package compiler.types.correctness.scenarios; -import hierarchies.TypeHierarchy; +import compiler.types.correctness.hierarchies.TypeHierarchy; import java.util.Arrays; diff --git a/test/compiler/types/correctness/scenarios/ArrayScenario.java b/test/compiler/types/correctness/scenarios/ArrayScenario.java --- a/test/compiler/types/correctness/scenarios/ArrayScenario.java +++ b/test/compiler/types/correctness/scenarios/ArrayScenario.java @@ -21,10 +21,10 @@ * questions. */ -package scenarios; +package compiler.types.correctness.scenarios; +import compiler.types.correctness.hierarchies.TypeHierarchy; import jdk.test.lib.Asserts; -import hierarchies.TypeHierarchy; import java.lang.reflect.Array; import java.util.Arrays; diff --git a/test/compiler/types/correctness/scenarios/CheckCast.java b/test/compiler/types/correctness/scenarios/CheckCast.java --- a/test/compiler/types/correctness/scenarios/CheckCast.java +++ b/test/compiler/types/correctness/scenarios/CheckCast.java @@ -21,10 +21,10 @@ * questions. */ -package scenarios; +package compiler.types.correctness.scenarios; +import compiler.types.correctness.hierarchies.TypeHierarchy; import jdk.test.lib.Asserts; -import hierarchies.TypeHierarchy; import java.util.Objects; diff --git a/test/compiler/types/correctness/scenarios/ClassIdentity.java b/test/compiler/types/correctness/scenarios/ClassIdentity.java --- a/test/compiler/types/correctness/scenarios/ClassIdentity.java +++ b/test/compiler/types/correctness/scenarios/ClassIdentity.java @@ -21,10 +21,10 @@ * questions. */ -package scenarios; +package compiler.types.correctness.scenarios; +import compiler.types.correctness.hierarchies.TypeHierarchy; import jdk.test.lib.Asserts; -import hierarchies.TypeHierarchy; /** * Tests pattern: if (a.getClass() == D.class) diff --git a/test/compiler/types/correctness/scenarios/ClassInstanceOf.java b/test/compiler/types/correctness/scenarios/ClassInstanceOf.java --- a/test/compiler/types/correctness/scenarios/ClassInstanceOf.java +++ b/test/compiler/types/correctness/scenarios/ClassInstanceOf.java @@ -21,10 +21,10 @@ * questions. */ -package scenarios; +package compiler.types.correctness.scenarios; +import compiler.types.correctness.hierarchies.TypeHierarchy; import jdk.test.lib.Asserts; -import hierarchies.TypeHierarchy; /** * Tests instanceof diff --git a/test/compiler/types/correctness/scenarios/ClassIsInstance.java b/test/compiler/types/correctness/scenarios/ClassIsInstance.java --- a/test/compiler/types/correctness/scenarios/ClassIsInstance.java +++ b/test/compiler/types/correctness/scenarios/ClassIsInstance.java @@ -21,10 +21,10 @@ * questions. */ -package scenarios; +package compiler.types.correctness.scenarios; +import compiler.types.correctness.hierarchies.TypeHierarchy; import jdk.test.lib.Asserts; -import hierarchies.TypeHierarchy; /** * Tests {@link Class#isInstance(Object)} diff --git a/test/compiler/types/correctness/scenarios/ProfilingType.java b/test/compiler/types/correctness/scenarios/ProfilingType.java --- a/test/compiler/types/correctness/scenarios/ProfilingType.java +++ b/test/compiler/types/correctness/scenarios/ProfilingType.java @@ -21,7 +21,7 @@ * questions. */ -package scenarios; +package compiler.types.correctness.scenarios; public enum ProfilingType { /** type profiling of return values of reference types from an invoke */ diff --git a/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java b/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java --- a/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java +++ b/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java @@ -21,10 +21,10 @@ * questions. */ -package scenarios; +package compiler.types.correctness.scenarios; +import compiler.types.correctness.hierarchies.TypeHierarchy; import jdk.test.lib.Asserts; -import hierarchies.TypeHierarchy; /** * Receiver at invokes profiling and speculation diff --git a/test/compiler/types/correctness/scenarios/Scenario.java b/test/compiler/types/correctness/scenarios/Scenario.java --- a/test/compiler/types/correctness/scenarios/Scenario.java +++ b/test/compiler/types/correctness/scenarios/Scenario.java @@ -21,9 +21,9 @@ * questions. */ -package scenarios; +package compiler.types.correctness.scenarios; -import hierarchies.TypeHierarchy; +import compiler.types.correctness.hierarchies.TypeHierarchy; /** * Test scenario diff --git a/test/compiler/uncommontrap/DeoptReallocFailure.java b/test/compiler/uncommontrap/DeoptReallocFailure.java --- a/test/compiler/uncommontrap/DeoptReallocFailure.java +++ b/test/compiler/uncommontrap/DeoptReallocFailure.java @@ -25,30 +25,37 @@ * @test * @bug 8146416 * @library /test/lib /testlibrary / + * * @build sun.hotspot.WhiteBox - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbatch -XX:CompileCommand=exclude,DeoptReallocFailure::main -Xmx100m DeoptReallocFailure + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -Xbatch -Xmx100m + * -XX:CompileCommand=exclude,compiler.uncommontrap.DeoptReallocFailure::main + * compiler.uncommontrap.DeoptReallocFailure * */ -import java.lang.reflect.Method; + +package compiler.uncommontrap; + import sun.hotspot.WhiteBox; -class MemoryChunk { - MemoryChunk other; - Object[][] array; - - MemoryChunk(MemoryChunk other) { - this.other = other; - array = new Object[1024 * 256][]; - } -} - -class NoEscape { - long f1; -} +import java.lang.reflect.Method; public class DeoptReallocFailure { + static class MemoryChunk { + MemoryChunk other; + Object[][] array; + + MemoryChunk(MemoryChunk other) { + this.other = other; + array = new Object[1024 * 256][]; + } + } + + static class NoEscape { + long f1; + } static MemoryChunk root; private static final WhiteBox WB = WhiteBox.getWhiteBox(); diff --git a/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java b/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java --- a/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java +++ b/test/compiler/uncommontrap/StackOverflowGuardPagesOff.java @@ -25,10 +25,16 @@ * @test * @bug 8029383 * @summary stack overflow if callee is marked for deoptimization causes crash - * @run main/othervm -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,StackOverflowGuardPagesOff::m1 -XX:CompileCommand=exclude,StackOverflowGuardPagesOff::m2 -Xss512K -XX:-UseOnStackReplacement StackOverflowGuardPagesOff * + * @run main/othervm -XX:TieredStopAtLevel=1 -XX:-BackgroundCompilation + * -XX:CompileCommand=dontinline,compiler.uncommontrap.StackOverflowGuardPagesOff::m1 + * -XX:CompileCommand=exclude,compiler.uncommontrap.StackOverflowGuardPagesOff::m2 + * -Xss512K -XX:-UseOnStackReplacement + * compiler.uncommontrap.StackOverflowGuardPagesOff */ +package compiler.uncommontrap; + // This test calls m2 recursively until a stack overflow. Then calls // m3 that calls m1. m1 triggers B's class loading, as a result m1 and // m3 needs to be deoptimized. Deoptimization of m1 causes a stack diff --git a/test/compiler/uncommontrap/8009761/Test8009761.java b/test/compiler/uncommontrap/Test8009761.java rename from test/compiler/uncommontrap/8009761/Test8009761.java rename to test/compiler/uncommontrap/Test8009761.java --- a/test/compiler/uncommontrap/8009761/Test8009761.java +++ b/test/compiler/uncommontrap/Test8009761.java @@ -21,20 +21,28 @@ * questions. */ -import sun.hotspot.WhiteBox; -import java.lang.reflect.Method; - /* * @test * @bug 8009761 + * @summary Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates + * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @library /testlibrary /test/lib - * @summary Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates - * @build Test8009761 - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=exclude,Test8009761::m2 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -Xss512K Test8009761 + * + * @build compiler.uncommontrap.Test8009761 + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -Xss512K + * -XX:CompileCommand=exclude,compiler.uncommontrap.Test8009761::m2 + * compiler.uncommontrap.Test8009761 */ + +package compiler.uncommontrap; + +import sun.hotspot.WhiteBox; + +import java.lang.reflect.Method; + public class Test8009761 { private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); diff --git a/test/compiler/uncommontrap/TestDeoptOOM.java b/test/compiler/uncommontrap/TestDeoptOOM.java --- a/test/compiler/uncommontrap/TestDeoptOOM.java +++ b/test/compiler/uncommontrap/TestDeoptOOM.java @@ -25,10 +25,15 @@ * @test * @bug 6898462 * @summary failed reallocations of scalar replaced objects during deoptimization causes crash - * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=exclude,TestDeoptOOM::main -XX:CompileCommand=exclude,TestDeoptOOM::m9_1 -Xmx128M TestDeoptOOM * + * @run main/othervm -XX:-BackgroundCompilation -Xmx128M + * -XX:CompileCommand=exclude,compiler.uncommontrap.TestDeoptOOM::main + * -XX:CompileCommand=exclude,compiler.uncommontrap.TestDeoptOOM::m9_1 + * compiler.uncommontrap.TestDeoptOOM */ +package compiler.uncommontrap; + public class TestDeoptOOM { long f1; diff --git a/test/compiler/uncommontrap/TestLockEliminatedAtDeopt.java b/test/compiler/uncommontrap/TestLockEliminatedAtDeopt.java --- a/test/compiler/uncommontrap/TestLockEliminatedAtDeopt.java +++ b/test/compiler/uncommontrap/TestLockEliminatedAtDeopt.java @@ -25,10 +25,15 @@ * @test * @bug 8032011 * @summary biased locking's revoke_bias locks monitor in compiled frame with eliminated lock - * @run main/othervm -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,TestLockEliminatedAtDeopt$A.m2 -XX:-BackgroundCompilation -XX:BiasedLockingStartupDelay=0 TestLockEliminatedAtDeopt * + * @run main/othervm -XX:-UseOnStackReplacement + * -XX:CompileCommand=dontinline,compiler.uncommontrap.TestLockEliminatedAtDeopt$A::m2 + * -XX:-BackgroundCompilation -XX:BiasedLockingStartupDelay=0 + * compiler.uncommontrap.TestLockEliminatedAtDeopt */ +package compiler.uncommontrap; + public class TestLockEliminatedAtDeopt { static class A { diff --git a/test/compiler/uncommontrap/TestStackBangMonitorOwned.java b/test/compiler/uncommontrap/TestStackBangMonitorOwned.java --- a/test/compiler/uncommontrap/TestStackBangMonitorOwned.java +++ b/test/compiler/uncommontrap/TestStackBangMonitorOwned.java @@ -25,9 +25,15 @@ * @test * @bug 8032410 * @summary Stack overflow at deoptimization doesn't release owned monitors - * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangMonitorOwned::m1 -XX:CompileCommand=exclude,TestStackBangMonitorOwned::m2 -Xss512K -XX:-UseOnStackReplacement TestStackBangMonitorOwned * + * @run main/othervm -XX:-BackgroundCompilation -Xss512K -XX:-UseOnStackReplacement + * -XX:CompileCommand=dontinline,compiler.uncommontrap.TestStackBangMonitorOwned::m1 + * -XX:CompileCommand=exclude,compiler.uncommontrap.TestStackBangMonitorOwned::m2 + * compiler.uncommontrap.TestStackBangMonitorOwned */ + +package compiler.uncommontrap; + public class TestStackBangMonitorOwned { static class UnloadedClass1 { diff --git a/test/compiler/uncommontrap/TestStackBangRbp.java b/test/compiler/uncommontrap/TestStackBangRbp.java --- a/test/compiler/uncommontrap/TestStackBangRbp.java +++ b/test/compiler/uncommontrap/TestStackBangRbp.java @@ -25,9 +25,15 @@ * @test * @bug 8028308 * @summary rbp not restored when stack overflow is thrown from deopt/uncommon trap blobs - * @run main/othervm -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestStackBangRbp::m1 -XX:CompileCommand=exclude,TestStackBangRbp::m2 -Xss512K -XX:-UseOnStackReplacement TestStackBangRbp * + * @run main/othervm -XX:-BackgroundCompilation -Xss512K -XX:-UseOnStackReplacement + * -XX:CompileCommand=dontinline,compiler.uncommontrap.TestStackBangRbp::m1 + * -XX:CompileCommand=exclude,compiler.uncommontrap.TestStackBangRbp::m2 + * compiler.uncommontrap.TestStackBangRbp */ + +package compiler.uncommontrap; + public class TestStackBangRbp { static class UnloadedClass1 { diff --git a/test/compiler/uncommontrap/TestUnstableIfTrap.java b/test/compiler/uncommontrap/TestUnstableIfTrap.java --- a/test/compiler/uncommontrap/TestUnstableIfTrap.java +++ b/test/compiler/uncommontrap/TestUnstableIfTrap.java @@ -30,51 +30,67 @@ * java.compiler * java.management * jdk.jvmstat/sun.jvmstat.monitor - * @build TestUnstableIfTrap jdk.test.lib.* compiler.testlibrary.uncommontrap.Verifier + * + * @build compiler.uncommontrap.TestUnstableIfTrap + * jdk.test.lib.* + * compiler.testlibrary.uncommontrap.Verifier * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,UnstableIfExecutable.test * -XX:LogFile=always_taken_not_fired.xml - * TestUnstableIfTrap ALWAYS_TAKEN false + * compiler.uncommontrap.TestUnstableIfTrap ALWAYS_TAKEN false * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,UnstableIfExecutable.test * -XX:LogFile=always_taken_fired.xml - * TestUnstableIfTrap ALWAYS_TAKEN true + * compiler.uncommontrap.TestUnstableIfTrap ALWAYS_TAKEN true * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,UnstableIfExecutable.test * -XX:LogFile=never_taken_not_fired.xml - * TestUnstableIfTrap NEVER_TAKEN false + * compiler.uncommontrap.TestUnstableIfTrap NEVER_TAKEN false * @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,UnstableIfExecutable.test * -XX:LogFile=never_taken_fired.xml - * TestUnstableIfTrap NEVER_TAKEN true + * compiler.uncommontrap.TestUnstableIfTrap NEVER_TAKEN true * @run driver compiler.testlibrary.uncommontrap.Verifier always_taken_not_fired.xml * always_taken_fired.xml * never_taken_not_fired.xml * never_taken_fired.xml */ +package compiler.uncommontrap; + +import compiler.testlibrary.uncommontrap.Verifier; +import jdk.internal.org.objectweb.asm.ClassVisitor; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.Label; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.test.lib.ByteCodeLoader; +import jdk.test.lib.Platform; +import sun.hotspot.WhiteBox; + import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.lang.reflect.Method; import java.util.Properties; -import jdk.test.lib.ByteCodeLoader; -import jdk.test.lib.Platform; -import jdk.internal.org.objectweb.asm.ClassVisitor; -import jdk.internal.org.objectweb.asm.ClassWriter; -import jdk.internal.org.objectweb.asm.Label; -import jdk.internal.org.objectweb.asm.MethodVisitor; -import static jdk.internal.org.objectweb.asm.Opcodes.*; - -import sun.hotspot.WhiteBox; -import compiler.testlibrary.uncommontrap.Verifier; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_ABSTRACT; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_VOLATILE; +import static jdk.internal.org.objectweb.asm.Opcodes.GETSTATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.GOTO; +import static jdk.internal.org.objectweb.asm.Opcodes.IADD; +import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_1; +import static jdk.internal.org.objectweb.asm.Opcodes.IFEQ; +import static jdk.internal.org.objectweb.asm.Opcodes.ILOAD; +import static jdk.internal.org.objectweb.asm.Opcodes.ISUB; +import static jdk.internal.org.objectweb.asm.Opcodes.RETURN; public class TestUnstableIfTrap { private static final WhiteBox WB = WhiteBox.getWhiteBox(); diff --git a/test/compiler/uncommontrap/TraceDeoptimizationNoRealloc.java b/test/compiler/uncommontrap/TraceDeoptimizationNoRealloc.java --- a/test/compiler/uncommontrap/TraceDeoptimizationNoRealloc.java +++ b/test/compiler/uncommontrap/TraceDeoptimizationNoRealloc.java @@ -25,10 +25,14 @@ * @test * @bug 8067144 * @summary -XX:+TraceDeoptimization tries to print realloc'ed objects even when there are none - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+IgnoreUnrecognizedVMOptions -XX:+TraceDeoptimization TraceDeoptimizationNoRealloc * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * -XX:+IgnoreUnrecognizedVMOptions -XX:+TraceDeoptimization + * compiler.uncommontrap.TraceDeoptimizationNoRealloc */ +package compiler.uncommontrap; + public class TraceDeoptimizationNoRealloc { static void m(boolean some_condition) { diff --git a/test/compiler/uncommontrap/UncommonTrapStackBang.java b/test/compiler/uncommontrap/UncommonTrapStackBang.java --- a/test/compiler/uncommontrap/UncommonTrapStackBang.java +++ b/test/compiler/uncommontrap/UncommonTrapStackBang.java @@ -27,8 +27,10 @@ * @bug 8026775 * @summary Uncommon trap blob did not bang all the stack shadow pages * - * @run main/othervm UncommonTrapStackBang - * + * @run main/othervm compiler.uncommontrap.UncommonTrapStackBang + */ + +/* * Note: This test does not reproduce the problem with absolute * certainty. Empirically the bug reproduces on Windows some 80+% of * the time. Setting everything up to fail in 100% of the cases turns @@ -55,6 +57,9 @@ * which raises an exception on Windows when the stack bang in * StringBuilder is performed. */ + +package compiler.uncommontrap; + public class UncommonTrapStackBang extends Thread { class Foo { } diff --git a/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java b/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java --- a/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java +++ b/test/compiler/unsafe/GetUnsafeObjectG1PreBarrier.java @@ -25,14 +25,18 @@ * @test * @bug 8016474 * @summary The bug only happens with C1 and G1 using a different ObjectAlignmentInBytes than KlassAlignmentInBytes (which is 8) + * * @modules java.base/jdk.internal.misc - * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32 GetUnsafeObjectG1PreBarrier + * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32 + * compiler.unsafe.GetUnsafeObjectG1PreBarrier */ -import java.lang.reflect.Field; +package compiler.unsafe; import jdk.internal.misc.Unsafe; +import java.lang.reflect.Field; + public class GetUnsafeObjectG1PreBarrier { private static final Unsafe unsafe; private static final int N = 100_000; diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java --- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java +++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for boolean + * * @modules java.base/jdk.internal.misc - * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestBoolean - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestBoolean - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestBoolean - * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.JdkInternalMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.JdkInternalMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 compiler.unsafe.JdkInternalMiscUnsafeAccessTestBoolean */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java --- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java +++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for byte + * * @modules java.base/jdk.internal.misc - * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestByte - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestByte - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestByte - * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.JdkInternalMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.JdkInternalMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 compiler.unsafe.JdkInternalMiscUnsafeAccessTestByte */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java --- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java +++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for char + * * @modules java.base/jdk.internal.misc - * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestChar - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestChar - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestChar - * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.JdkInternalMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.JdkInternalMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 compiler.unsafe.JdkInternalMiscUnsafeAccessTestChar */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java --- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java +++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for double + * * @modules java.base/jdk.internal.misc - * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestDouble - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestDouble - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestDouble - * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.JdkInternalMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.JdkInternalMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 compiler.unsafe.JdkInternalMiscUnsafeAccessTestDouble */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java --- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java +++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for float + * * @modules java.base/jdk.internal.misc - * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestFloat - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestFloat - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestFloat - * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.JdkInternalMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.JdkInternalMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 compiler.unsafe.JdkInternalMiscUnsafeAccessTestFloat */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java --- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java +++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for int + * * @modules java.base/jdk.internal.misc - * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestInt - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestInt - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestInt - * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.JdkInternalMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.JdkInternalMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 compiler.unsafe.JdkInternalMiscUnsafeAccessTestInt */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java --- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java +++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for long + * * @modules java.base/jdk.internal.misc - * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestLong - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestLong - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestLong - * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.JdkInternalMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.JdkInternalMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 compiler.unsafe.JdkInternalMiscUnsafeAccessTestLong */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java --- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java +++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for Object + * * @modules java.base/jdk.internal.misc - * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestObject - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestObject - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestObject - * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.JdkInternalMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.JdkInternalMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 compiler.unsafe.JdkInternalMiscUnsafeAccessTestObject */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java --- a/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java +++ b/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for short + * * @modules java.base/jdk.internal.misc - * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestShort - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestShort - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestShort - * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.JdkInternalMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.JdkInternalMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.JdkInternalMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 compiler.unsafe.JdkInternalMiscUnsafeAccessTestShort */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java b/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java --- a/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java +++ b/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java @@ -26,13 +26,18 @@ * @bug 8158260 * @summary Test unaligned Unsafe accesses * @modules java.base/jdk.internal.misc - * @run main/othervm -Diters=20000 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation JdkInternalMiscUnsafeUnalignedAccess + * + * @run main/othervm -Diters=20000 -XX:-UseOnStackReplacement -XX:-BackgroundCompilation + * compiler.unsafe.JdkInternalMiscUnsafeUnalignedAccess * @author volker.simonis@gmail.com */ +package compiler.unsafe; + +import jdk.internal.misc.Unsafe; + import java.lang.reflect.Field; import java.nio.ByteOrder; -import jdk.internal.misc.Unsafe; public class JdkInternalMiscUnsafeUnalignedAccess { static final int ITERS = Integer.getInteger("iters", 20_000); diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java --- a/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java +++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for boolean + * * @modules jdk.unsupported/sun.misc - * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestBoolean - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestBoolean - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestBoolean - * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.SunMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.SunMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 compiler.unsafe.SunMiscUnsafeAccessTestBoolean */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java --- a/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java +++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for byte + * * @modules jdk.unsupported/sun.misc - * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestByte - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestByte - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestByte - * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.SunMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.SunMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 compiler.unsafe.SunMiscUnsafeAccessTestByte */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java --- a/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java +++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for char + * * @modules jdk.unsupported/sun.misc - * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestChar - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestChar - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestChar - * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.SunMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.SunMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 compiler.unsafe.SunMiscUnsafeAccessTestChar */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java --- a/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java +++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for double + * * @modules jdk.unsupported/sun.misc - * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestDouble - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestDouble - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestDouble - * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.SunMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.SunMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 compiler.unsafe.SunMiscUnsafeAccessTestDouble */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java --- a/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java +++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for float + * * @modules jdk.unsupported/sun.misc - * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestFloat - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestFloat - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestFloat - * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.SunMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.SunMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 compiler.unsafe.SunMiscUnsafeAccessTestFloat */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java --- a/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java +++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for int + * * @modules jdk.unsupported/sun.misc - * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestInt - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestInt - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestInt - * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.SunMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.SunMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 compiler.unsafe.SunMiscUnsafeAccessTestInt */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java --- a/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java +++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for long + * * @modules jdk.unsupported/sun.misc - * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestLong - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestLong - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestLong - * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.SunMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.SunMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 compiler.unsafe.SunMiscUnsafeAccessTestLong */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java --- a/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java +++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for Object + * * @modules jdk.unsupported/sun.misc - * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestObject - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestObject - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestObject - * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.SunMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.SunMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 compiler.unsafe.SunMiscUnsafeAccessTestObject */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java b/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java --- a/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java +++ b/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for short + * * @modules jdk.unsupported/sun.misc - * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestShort - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestShort - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestShort - * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.SunMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.SunMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.SunMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 compiler.unsafe.SunMiscUnsafeAccessTestShort */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/unsafe/TestUnsafeLoadControl.java b/test/compiler/unsafe/TestUnsafeLoadControl.java --- a/test/compiler/unsafe/TestUnsafeLoadControl.java +++ b/test/compiler/unsafe/TestUnsafeLoadControl.java @@ -26,12 +26,16 @@ * @bug 8077504 * @summary Unsafe load can loose control dependency and cause crash * @modules java.base/jdk.internal.misc - * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestUnsafeLoadControl * + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement + * compiler.unsafe.TestUnsafeLoadControl */ +package compiler.unsafe; + +import jdk.internal.misc.Unsafe; + import java.lang.reflect.Field; -import jdk.internal.misc.Unsafe; public class TestUnsafeLoadControl { diff --git a/test/compiler/unsafe/UnsafeGetConstantField.java b/test/compiler/unsafe/UnsafeGetConstantField.java --- a/test/compiler/unsafe/UnsafeGetConstantField.java +++ b/test/compiler/unsafe/UnsafeGetConstantField.java @@ -37,24 +37,26 @@ * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions * -Xbatch -XX:-TieredCompilation * -XX:+FoldStableValues - * -XX:CompileCommand=dontinline,UnsafeGetConstantField.checkGetAddress() - * -XX:CompileCommand=dontinline,*.test* + * -XX:CompileCommand=dontinline,compiler.unsafe.UnsafeGetConstantField::checkGetAddress + * -XX:CompileCommand=dontinline,*::test* * -XX:+UseUnalignedAccesses - * -XaddReads:java.base=ALL-UNNAMED + * -XaddReads:java.base=ALL-UNNAMED * compiler.unsafe.UnsafeGetConstantField * * @run main/bootclasspath/othervm -XX:+UnlockDiagnosticVMOptions * -Xbatch -XX:-TieredCompilation * -XX:+FoldStableValues - * -XX:CompileCommand=dontinline,UnsafeGetConstantField.checkGetAddress() - * -XX:CompileCommand=dontinline,*.test* - * -XX:CompileCommand=inline,*Unsafe.get* + * -XX:CompileCommand=dontinline,compiler.unsafe.UnsafeGetConstantField::checkGetAddress + * -XX:CompileCommand=dontinline,*::test* + * -XX:CompileCommand=inline,*Unsafe::get* * -XX:-UseUnalignedAccesses - * -XaddReads:java.base=ALL-UNNAMED + * -XaddReads:java.base=ALL-UNNAMED * compiler.unsafe.UnsafeGetConstantField */ + package compiler.unsafe; +import jdk.internal.misc.Unsafe; import jdk.internal.org.objectweb.asm.ClassWriter; import jdk.internal.org.objectweb.asm.FieldVisitor; import jdk.internal.org.objectweb.asm.MethodVisitor; @@ -63,14 +65,28 @@ import jdk.internal.vm.annotation.Stable; import jdk.test.lib.Asserts; import jdk.test.lib.Platform; -import jdk.internal.misc.Unsafe; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import static jdk.internal.org.objectweb.asm.Opcodes.*; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_FINAL; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.ACONST_NULL; +import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD; +import static jdk.internal.org.objectweb.asm.Opcodes.ARETURN; +import static jdk.internal.org.objectweb.asm.Opcodes.DUP; +import static jdk.internal.org.objectweb.asm.Opcodes.GETFIELD; +import static jdk.internal.org.objectweb.asm.Opcodes.GETSTATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL; +import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESTATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEVIRTUAL; +import static jdk.internal.org.objectweb.asm.Opcodes.NEW; +import static jdk.internal.org.objectweb.asm.Opcodes.PUTFIELD; +import static jdk.internal.org.objectweb.asm.Opcodes.PUTSTATIC; +import static jdk.internal.org.objectweb.asm.Opcodes.RETURN; public class UnsafeGetConstantField { static final Class THIS_CLASS = UnsafeGetConstantField.class; diff --git a/test/compiler/unsafe/UnsafeGetStableArrayElement.java b/test/compiler/unsafe/UnsafeGetStableArrayElement.java --- a/test/compiler/unsafe/UnsafeGetStableArrayElement.java +++ b/test/compiler/unsafe/UnsafeGetStableArrayElement.java @@ -39,15 +39,18 @@ * -XX:CompileCommand=dontinline,*Test::test* * compiler.unsafe.UnsafeGetStableArrayElement */ + package compiler.unsafe; import jdk.internal.misc.Unsafe; import jdk.internal.vm.annotation.Stable; -import java.util.concurrent.Callable; import jdk.test.lib.Platform; +import java.util.concurrent.Callable; + import static jdk.internal.misc.Unsafe.*; -import static jdk.test.lib.Asserts.*; +import static jdk.test.lib.Asserts.assertEQ; +import static jdk.test.lib.Asserts.assertNE; public class UnsafeGetStableArrayElement { @Stable static final boolean[] STABLE_BOOLEAN_ARRAY = new boolean[16]; diff --git a/test/compiler/unsafe/UnsafeRaw.java b/test/compiler/unsafe/UnsafeRaw.java --- a/test/compiler/unsafe/UnsafeRaw.java +++ b/test/compiler/unsafe/UnsafeRaw.java @@ -28,12 +28,15 @@ * @library /testlibrary * @modules java.base/jdk.internal.misc * java.management - * @run main/othervm -Xbatch UnsafeRaw + * @run main/othervm -Xbatch compiler.unsafe.UnsafeRaw */ +package compiler.unsafe; + +import jdk.internal.misc.Unsafe; import jdk.test.lib.Utils; + import java.util.Random; -import jdk.internal.misc.Unsafe; public class UnsafeRaw { public static class Tests { diff --git a/test/compiler/unsafe/X-UnsafeAccessTest.java.template b/test/compiler/unsafe/X-UnsafeAccessTest.java.template --- a/test/compiler/unsafe/X-UnsafeAccessTest.java.template +++ b/test/compiler/unsafe/X-UnsafeAccessTest.java.template @@ -25,13 +25,16 @@ * @test * @bug 8143628 * @summary Test unsafe access for $type$ + * * @modules $module$/$package$ - * @run testng/othervm -Diters=100 -Xint $Qualifier$UnsafeAccessTest$Type$ - * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 $Qualifier$UnsafeAccessTest$Type$ - * @run testng/othervm -Diters=20000 -XX:-TieredCompilation $Qualifier$UnsafeAccessTest$Type$ - * @run testng/othervm -Diters=20000 $Qualifier$UnsafeAccessTest$Type$ + * @run testng/othervm -Diters=100 -Xint compiler.unsafe.$Qualifier$UnsafeAccessTest$Type$ + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 compiler.unsafe.$Qualifier$UnsafeAccessTest$Type$ + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation compiler.unsafe.$Qualifier$UnsafeAccessTest$Type$ + * @run testng/othervm -Diters=20000 compiler.unsafe.$Qualifier$UnsafeAccessTest$Type$ */ +package compiler.unsafe; + import org.testng.annotations.Test; import java.lang.reflect.Field; diff --git a/test/compiler/vectorization/TestVectorUnalignedOffset.java b/test/compiler/vectorization/TestVectorUnalignedOffset.java --- a/test/compiler/vectorization/TestVectorUnalignedOffset.java +++ b/test/compiler/vectorization/TestVectorUnalignedOffset.java @@ -25,10 +25,11 @@ * @test * @bug 8155612 * @summary Aarch64: vector nodes need to support misaligned offset - * @run main/othervm -XX:-BackgroundCompilation TestVectorUnalignedOffset * + * @run main/othervm -XX:-BackgroundCompilation compiler.vectorization.TestVectorUnalignedOffset */ +package compiler.vectorization; public class TestVectorUnalignedOffset { diff --git a/test/compiler/whitebox/AllocationCodeBlobTest.java b/test/compiler/whitebox/AllocationCodeBlobTest.java --- a/test/compiler/whitebox/AllocationCodeBlobTest.java +++ b/test/compiler/whitebox/AllocationCodeBlobTest.java @@ -22,32 +22,37 @@ * */ -import java.lang.management.MemoryPoolMXBean; -import java.util.EnumSet; -import java.util.ArrayList; +/* + * @test AllocationCodeBlobTest + * @summary testing of WB::allocate/freeCodeBlob() + * @bug 8059624 8064669 + * @library /testlibrary /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * @build compiler.whitebox.AllocationCodeBlobTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:-SegmentedCodeCache + * compiler.whitebox.AllocationCodeBlobTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* + * -XX:+SegmentedCodeCache + * compiler.whitebox.AllocationCodeBlobTest + */ +package compiler.whitebox; + +import jdk.test.lib.Asserts; +import jdk.test.lib.InfiniteLoop; import sun.hotspot.WhiteBox; import sun.hotspot.code.BlobType; -import jdk.test.lib.Asserts; -import jdk.test.lib.InfiniteLoop; -/* - * @test AllocationCodeBlobTest - * @bug 8059624 8064669 - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * @modules java.management - * @build AllocationCodeBlobTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* - * -XX:-SegmentedCodeCache AllocationCodeBlobTest - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* - * -XX:+SegmentedCodeCache AllocationCodeBlobTest - * @summary testing of WB::allocate/freeCodeBlob() - */ +import java.lang.management.MemoryPoolMXBean; +import java.util.ArrayList; +import java.util.EnumSet; + public class AllocationCodeBlobTest { private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); private static final long CODE_CACHE_SIZE diff --git a/test/compiler/whitebox/BlockingCompilation.java b/test/compiler/whitebox/BlockingCompilation.java --- a/test/compiler/whitebox/BlockingCompilation.java +++ b/test/compiler/whitebox/BlockingCompilation.java @@ -31,19 +31,22 @@ * compiler.testlibrary.CompilerUtils * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm/timeout=60 + * @run main/othervm * -Xbootclasspath/a:. * -Xmixed * -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * -XX:+PrintCompilation - * BlockingCompilation + * compiler.whitebox.BlockingCompilation */ +package compiler.whitebox; + import compiler.testlibrary.CompilerUtils; +import sun.hotspot.WhiteBox; + import java.lang.reflect.Method; import java.util.Random; -import sun.hotspot.WhiteBox; public class BlockingCompilation { private static final WhiteBox WB = WhiteBox.getWhiteBox(); @@ -94,7 +97,9 @@ // Blocking compilations on all levels, using the default versions of // WB.enqueueMethodForCompilation() and manually setting compiler directives. - String directive = "[{ match: \"BlockingCompilation.foo\", BackgroundCompilation: false }]"; + String directive = "[{ match: \"" + + BlockingCompilation.class.getName().replace('.', '/') + + ".foo\", BackgroundCompilation: false }]"; if (WB.addCompilerDirective(directive) != 1) { throw new Exception("Failed to add compiler directive"); } diff --git a/test/compiler/whitebox/ClearMethodStateTest.java b/test/compiler/whitebox/ClearMethodStateTest.java --- a/test/compiler/whitebox/ClearMethodStateTest.java +++ b/test/compiler/whitebox/ClearMethodStateTest.java @@ -21,23 +21,23 @@ * questions. */ -import java.util.function.Function; - -import compiler.whitebox.CompilerWhiteBoxTest; - /* * @test ClearMethodStateTest * @bug 8006683 8007288 8022832 + * @summary testing of WB::clearMethodState() * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build ClearMethodStateTest + * java.management + * @build compiler.whitebox.ClearMethodStateTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+PrintCompilation -XX:-UseCounterDecay ClearMethodStateTest - * @summary testing of WB::clearMethodState() - * @author igor.ignatyev@oracle.com + * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:+PrintCompilation -XX:-UseCounterDecay + * compiler.whitebox.ClearMethodStateTest */ + +package compiler.whitebox; + public class ClearMethodStateTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { diff --git a/test/compiler/whitebox/CompilerWhiteBoxTest.java b/test/compiler/whitebox/CompilerWhiteBoxTest.java --- a/test/compiler/whitebox/CompilerWhiteBoxTest.java +++ b/test/compiler/whitebox/CompilerWhiteBoxTest.java @@ -20,6 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package compiler.whitebox; import sun.hotspot.WhiteBox; diff --git a/test/compiler/whitebox/DeoptimizeAllTest.java b/test/compiler/whitebox/DeoptimizeAllTest.java --- a/test/compiler/whitebox/DeoptimizeAllTest.java +++ b/test/compiler/whitebox/DeoptimizeAllTest.java @@ -21,21 +21,24 @@ * questions. */ -import compiler.whitebox.CompilerWhiteBoxTest; - /* * @test DeoptimizeAllTest * @bug 8006683 8007288 8022832 + * @summary testing of WB::deoptimizeAll() * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build DeoptimizeAllTest + * java.management + * @build compiler.whitebox.DeoptimizeAllTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCounterDecay -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* DeoptimizeAllTest - * @summary testing of WB::deoptimizeAll() - * @author igor.ignatyev@oracle.com + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCounterDecay + * -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* + * compiler.whitebox.DeoptimizeAllTest */ + +package compiler.whitebox; + public class DeoptimizeAllTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { diff --git a/test/compiler/whitebox/DeoptimizeFramesTest.java b/test/compiler/whitebox/DeoptimizeFramesTest.java --- a/test/compiler/whitebox/DeoptimizeFramesTest.java +++ b/test/compiler/whitebox/DeoptimizeFramesTest.java @@ -21,37 +21,37 @@ * questions. */ -import compiler.whitebox.CompilerWhiteBoxTest; - /* * @test DeoptimizeFramesTest * @bug 8028595 + * @summary testing of WB::deoptimizeFrames() * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build DeoptimizeFramesTest + * java.management + * @build compiler.whitebox.DeoptimizeFramesTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission + * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xmixed -XX:-UseCounterDecay - * -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method + * -XX:CompileCommand=compileonly,compiler.whitebox.DeoptimizeFramesTest$TestCaseImpl::method * -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot - * DeoptimizeFramesTest true + * compiler.whitebox.DeoptimizeFramesTest true * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xmixed -XX:-UseCounterDecay - * -XX:CompileCommand=compileonly,DeoptimizeFramesTest$TestCaseImpl::method + * -XX:CompileCommand=compileonly,compiler.whitebox.DeoptimizeFramesTest$TestCaseImpl::method * -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom -XX:-DeoptimizeALot - * DeoptimizeFramesTest false - * @summary testing of WB::deoptimizeFrames() + * compiler.whitebox.DeoptimizeFramesTest false */ + +package compiler.whitebox; + +import jdk.test.lib.Asserts; +import sun.hotspot.code.NMethod; + import java.lang.reflect.Executable; import java.util.concurrent.Callable; import java.util.concurrent.Phaser; -import sun.hotspot.code.NMethod; -import jdk.test.lib.Asserts; -import jdk.test.lib.InfiniteLoop; - public class DeoptimizeFramesTest extends CompilerWhiteBoxTest { private final boolean makeNotEntrant; private final Phaser phaser; diff --git a/test/compiler/whitebox/DeoptimizeMethodTest.java b/test/compiler/whitebox/DeoptimizeMethodTest.java --- a/test/compiler/whitebox/DeoptimizeMethodTest.java +++ b/test/compiler/whitebox/DeoptimizeMethodTest.java @@ -21,21 +21,24 @@ * questions. */ -import compiler.whitebox.CompilerWhiteBoxTest; - /* * @test DeoptimizeMethodTest * @bug 8006683 8007288 8022832 + * @summary testing of WB::deoptimizeMethod() * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build DeoptimizeMethodTest + * java.management + * @build compiler.whitebox.DeoptimizeMethodTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCounterDecay -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* DeoptimizeMethodTest - * @summary testing of WB::deoptimizeMethod() - * @author igor.ignatyev@oracle.com + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCounterDecay + * -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* + * compiler.whitebox.DeoptimizeMethodTest */ + +package compiler.whitebox; + public class DeoptimizeMethodTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { diff --git a/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java b/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java --- a/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java +++ b/test/compiler/whitebox/DeoptimizeMultipleOSRTest.java @@ -21,23 +21,28 @@ * questions. */ -import sun.hotspot.WhiteBox; -import java.lang.reflect.Executable; -import java.lang.reflect.Method; -import compiler.whitebox.CompilerWhiteBoxTest; /* * @test DeoptimizeMultipleOSRTest * @bug 8061817 + * @summary testing of WB::deoptimizeMethod() * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build DeoptimizeMultipleOSRTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,DeoptimizeMultipleOSRTest::triggerOSR DeoptimizeMultipleOSRTest - * @summary testing of WB::deoptimizeMethod() + * java.management + * @build compiler.whitebox.DeoptimizeMultipleOSRTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:CompileCommand=compileonly,DeoptimizeMultipleOSRTest::triggerOSR + * compiler.whitebox.DeoptimizeMultipleOSRTest */ + +package compiler.whitebox; + +import sun.hotspot.WhiteBox; + +import java.lang.reflect.Method; + public class DeoptimizeMultipleOSRTest { private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); private static final long BACKEDGE_THRESHOLD = 150000; diff --git a/test/compiler/whitebox/EnqueueMethodForCompilationTest.java b/test/compiler/whitebox/EnqueueMethodForCompilationTest.java --- a/test/compiler/whitebox/EnqueueMethodForCompilationTest.java +++ b/test/compiler/whitebox/EnqueueMethodForCompilationTest.java @@ -21,21 +21,23 @@ * questions. */ -import compiler.whitebox.CompilerWhiteBoxTest; - /* * @test EnqueueMethodForCompilationTest * @bug 8006683 8007288 8022832 + * @summary testing of WB::enqueueMethodForCompilation() * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build EnqueueMethodForCompilationTest + * java.management + * @build compiler.whitebox.EnqueueMethodForCompilationTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+PrintCompilation -XX:-UseCounterDecay EnqueueMethodForCompilationTest - * @summary testing of WB::enqueueMethodForCompilation() - * @author igor.ignatyev@oracle.com + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:+PrintCompilation -XX:-UseCounterDecay + * compiler.whitebox.EnqueueMethodForCompilationTest */ + +package compiler.whitebox; + public class EnqueueMethodForCompilationTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { diff --git a/test/compiler/whitebox/ForceNMethodSweepTest.java b/test/compiler/whitebox/ForceNMethodSweepTest.java --- a/test/compiler/whitebox/ForceNMethodSweepTest.java +++ b/test/compiler/whitebox/ForceNMethodSweepTest.java @@ -22,31 +22,30 @@ * */ -import java.lang.reflect.Method; -import java.util.EnumSet; - -import sun.hotspot.WhiteBox; -import sun.hotspot.code.BlobType; - -import jdk.test.lib.Asserts; -import jdk.test.lib.InfiniteLoop; -import compiler.whitebox.CompilerWhiteBoxTest; - /* * @test * @bug 8059624 8064669 8153265 + * @summary testing of WB::forceNMethodSweep * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build ForceNMethodSweepTest + * java.management + * @build compiler.whitebox.ForceNMethodSweepTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:-TieredCompilation -XX:+WhiteBoxAPI * -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* - * -XX:-BackgroundCompilation -XX:-UseCounterDecay ForceNMethodSweepTest - * @summary testing of WB::forceNMethodSweep + * -XX:-BackgroundCompilation -XX:-UseCounterDecay + * compiler.whitebox.ForceNMethodSweepTest */ + +package compiler.whitebox; + +import jdk.test.lib.Asserts; +import sun.hotspot.code.BlobType; + +import java.util.EnumSet; + public class ForceNMethodSweepTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { CompilerWhiteBoxTest.main(ForceNMethodSweepTest::new, args); diff --git a/test/compiler/whitebox/GetCodeHeapEntriesTest.java b/test/compiler/whitebox/GetCodeHeapEntriesTest.java --- a/test/compiler/whitebox/GetCodeHeapEntriesTest.java +++ b/test/compiler/whitebox/GetCodeHeapEntriesTest.java @@ -22,31 +22,34 @@ * */ +/* + * @test GetCodeHeapEntriesTest + * @bug 8059624 + * @summary testing of WB::getCodeHeapEntries() + * @library /testlibrary /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * @build compiler.whitebox.GetCodeHeapEntriesTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache + * compiler.whitebox.GetCodeHeapEntriesTest + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache + * compiler.whitebox.GetCodeHeapEntriesTest + */ + +package compiler.whitebox; + +import jdk.test.lib.Asserts; +import sun.hotspot.WhiteBox; +import sun.hotspot.code.BlobType; +import sun.hotspot.code.CodeBlob; + import java.util.Arrays; import java.util.EnumSet; -import sun.hotspot.WhiteBox; -import sun.hotspot.code.CodeBlob; -import sun.hotspot.code.BlobType; -import jdk.test.lib.Asserts; - -/* - * @test GetCodeHeapEntriesTest - * @bug 8059624 - * @library /testlibrary /test/lib - * @modules java.base/jdk.internal.misc - * @modules java.management - * @build GetCodeHeapEntriesTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:-SegmentedCodeCache - * GetCodeHeapEntriesTest - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions - * -XX:+WhiteBoxAPI -XX:+SegmentedCodeCache - * GetCodeHeapEntriesTest - * @summary testing of WB::getCodeHeapEntries() - */ public class GetCodeHeapEntriesTest { private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); private static final int SIZE = 1024; diff --git a/test/compiler/whitebox/GetNMethodTest.java b/test/compiler/whitebox/GetNMethodTest.java --- a/test/compiler/whitebox/GetNMethodTest.java +++ b/test/compiler/whitebox/GetNMethodTest.java @@ -22,24 +22,28 @@ * */ -import sun.hotspot.code.BlobType; -import sun.hotspot.code.NMethod; -import jdk.test.lib.Asserts; -import compiler.whitebox.CompilerWhiteBoxTest; - /* * @test GetNMethodTest * @bug 8038240 + * @summary testing of WB::getNMethod() * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build GetNMethodTest + * java.management + * @build compiler.whitebox.GetNMethodTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCounterDecay -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* GetNMethodTest - * @summary testing of WB::getNMethod() - * @author igor.ignatyev@oracle.com + * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCounterDecay + * -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* + * compiler.whitebox.GetNMethodTest */ + +package compiler.whitebox; + +import jdk.test.lib.Asserts; +import sun.hotspot.code.BlobType; +import sun.hotspot.code.NMethod; + public class GetNMethodTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { CompilerWhiteBoxTest.main(GetNMethodTest::new, args); diff --git a/test/compiler/whitebox/IsMethodCompilableTest.java b/test/compiler/whitebox/IsMethodCompilableTest.java --- a/test/compiler/whitebox/IsMethodCompilableTest.java +++ b/test/compiler/whitebox/IsMethodCompilableTest.java @@ -24,22 +24,26 @@ /* * @test IsMethodCompilableTest * @bug 8007270 8006683 8007288 8022832 + * @summary testing of WB::isMethodCompilable() * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc * java.management * @build jdk.test.lib.* * sun.hotspot.WhiteBox - * @build IsMethodCompilableTest + * @build compiler.whitebox.IsMethodCompilableTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * jdk.test.lib.Platform - * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -Xmixed -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:PerMethodRecompilationCutoff=3 -XX:-UseCounterDecay -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* IsMethodCompilableTest - * @summary testing of WB::isMethodCompilable() - * @author igor.ignatyev@oracle.com + * @run main/othervm/timeout=2400 -XX:-TieredCompilation -Xmixed + * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:PerMethodRecompilationCutoff=3 -XX:-UseCounterDecay + * -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* + * compiler.whitebox.IsMethodCompilableTest */ +package compiler.whitebox; + import jdk.test.lib.Platform; -import compiler.whitebox.CompilerWhiteBoxTest; public class IsMethodCompilableTest extends CompilerWhiteBoxTest { /** diff --git a/test/compiler/whitebox/LockCompilationTest.java b/test/compiler/whitebox/LockCompilationTest.java --- a/test/compiler/whitebox/LockCompilationTest.java +++ b/test/compiler/whitebox/LockCompilationTest.java @@ -24,22 +24,20 @@ /* * @test LockCompilationTest * @bug 8059624 8152169 + * @summary testing of WB::lock/unlockCompilation() * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build LockCompilationTest + * java.management + * @build compiler.whitebox.LockCompilationTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseCounterDecay LockCompilationTest - * @summary testing of WB::lock/unlockCompilation() + * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:-UseCounterDecay + * compiler.whitebox.LockCompilationTest */ -import java.io.OutputStream; -import java.io.PrintWriter; -import java.util.concurrent.BrokenBarrierException; -import java.util.concurrent.CyclicBarrier; +package compiler.whitebox; -import compiler.whitebox.CompilerWhiteBoxTest; import jdk.test.lib.Asserts; public class LockCompilationTest extends CompilerWhiteBoxTest { diff --git a/test/compiler/whitebox/MakeMethodNotCompilableTest.java b/test/compiler/whitebox/MakeMethodNotCompilableTest.java --- a/test/compiler/whitebox/MakeMethodNotCompilableTest.java +++ b/test/compiler/whitebox/MakeMethodNotCompilableTest.java @@ -21,21 +21,23 @@ * questions. */ -import compiler.whitebox.CompilerWhiteBoxTest; - /* * @test MakeMethodNotCompilableTest * @bug 8012322 8006683 8007288 8022832 + * @summary testing of WB::makeMethodNotCompilable() * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build MakeMethodNotCompilableTest + * java.management + * @build compiler.whitebox.MakeMethodNotCompilableTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmixed -XX:-UseCounterDecay MakeMethodNotCompilableTest - * @summary testing of WB::makeMethodNotCompilable() - * @author igor.ignatyev@oracle.com + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -Xmixed -XX:-UseCounterDecay + * compiler.whitebox.MakeMethodNotCompilableTest */ + +package compiler.whitebox; + public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest { private int bci; public static void main(String[] args) throws Exception { diff --git a/test/compiler/whitebox/SetDontInlineMethodTest.java b/test/compiler/whitebox/SetDontInlineMethodTest.java --- a/test/compiler/whitebox/SetDontInlineMethodTest.java +++ b/test/compiler/whitebox/SetDontInlineMethodTest.java @@ -21,21 +21,24 @@ * questions. */ -import compiler.whitebox.CompilerWhiteBoxTest; - /* * @test SetDontInlineMethodTest * @bug 8006683 8007288 8022832 + * @summary testing of WB::testSetDontInlineMethod() * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build SetDontInlineMethodTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* SetDontInlineMethodTest - * @summary testing of WB::testSetDontInlineMethod() - * @author igor.ignatyev@oracle.com + * java.management + * @build compiler.whitebox.SetDontInlineMethodTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* + * compiler.whitebox.SetDontInlineMethodTest */ + +package compiler.whitebox; + public class SetDontInlineMethodTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { diff --git a/test/compiler/whitebox/SetForceInlineMethodTest.java b/test/compiler/whitebox/SetForceInlineMethodTest.java --- a/test/compiler/whitebox/SetForceInlineMethodTest.java +++ b/test/compiler/whitebox/SetForceInlineMethodTest.java @@ -21,21 +21,24 @@ * questions. */ -import compiler.whitebox.CompilerWhiteBoxTest; - /* * @test SetForceInlineMethodTest * @bug 8006683 8007288 8022832 + * @summary testing of WB::testSetForceInlineMethod() * @library /testlibrary /test/lib / * @modules java.base/jdk.internal.misc - * @modules java.management - * @build SetForceInlineMethodTest - * @run main ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* SetForceInlineMethodTest - * @summary testing of WB::testSetForceInlineMethod() - * @author igor.ignatyev@oracle.com + * java.management + * @build compiler.whitebox.SetForceInlineMethodTest + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::* + * compiler.whitebox.SetForceInlineMethodTest */ + +package compiler.whitebox; + public class SetForceInlineMethodTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { diff --git a/test/compiler/whitebox/SimpleTestCase.java b/test/compiler/whitebox/SimpleTestCase.java --- a/test/compiler/whitebox/SimpleTestCase.java +++ b/test/compiler/whitebox/SimpleTestCase.java @@ -23,11 +23,12 @@ package compiler.whitebox; +import sun.hotspot.WhiteBox; + import java.lang.reflect.Constructor; import java.lang.reflect.Executable; import java.lang.reflect.Method; import java.util.concurrent.Callable; -import sun.hotspot.WhiteBox; public enum SimpleTestCase implements CompilerWhiteBoxTest.TestCase { /** constructor test case */