8132919: Put compiler tests in packages

Reviewed-by: vlivanov, dpochepk
This commit is contained in:
Igor Ignatyev 2016-07-12 18:24:48 +03:00 committed by Tatiana Pivovarova
parent 4710cf65a7
commit a0381422dd
942 changed files with 12622 additions and 9353 deletions
hotspot
make/test
test
TEST.groups
compiler
arguments
arraycopy
c1
c2

@ -50,7 +50,6 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC := \
$(HOTSPOT_TOPDIR)/test/runtime/BoolReturn \
$(HOTSPOT_TOPDIR)/test/compiler/floatingpoint/ \
$(HOTSPOT_TOPDIR)/test/compiler/calls \
$(HOTSPOT_TOPDIR)/test/compiler/native \
$(HOTSPOT_TOPDIR)/test/serviceability/jvmti/GetNamedModule \
$(HOTSPOT_TOPDIR)/test/testlibrary/jvmti \
#

@ -130,8 +130,8 @@ jre = \
# 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 @@ hotspot_fast_compiler_1 = \
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 @@ hotspot_fast_compiler_2 = \
compiler/integerArithmetic/ \
compiler/interpreter/ \
compiler/jvmci/ \
-compiler/codegen/7184394 \
-compiler/codegen/aes \
-compiler/codecache/stress \
-compiler/gcbarriers/PreserveFPRegistersTest.java
@ -320,13 +320,13 @@ hotspot_fast_compiler_3 = \
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

@ -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.

@ -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,

@ -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,

@ -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 = {
{

@ -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

@ -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
* @build compiler.arguments.TestUseBMI1InstructionsOnSupportedCPU
* compiler.arguments.BMISupportedCPUTest
* @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 {

@ -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
* @build compiler.arguments.TestUseBMI1InstructionsOnUnsupportedCPU
* compiler.arguments.BMIUnsupportedCPUTest
* @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 {

@ -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[]) {

@ -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 {

@ -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 {

@ -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 {

@ -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 {

@ -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];

@ -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 {

@ -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;

@ -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 {
}

@ -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) {

@ -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
*/
import sun.hotspot.WhiteBox;
import sun.hotspot.code.NMethod;
import jdk.test.lib.Platform;
import java.lang.reflect.*;
package compiler.arraycopy;
import compiler.whitebox.CompilerWhiteBoxTest;
import jdk.test.lib.Platform;
import sun.hotspot.WhiteBox;
import java.lang.reflect.Method;
public class TestArrayCopyNoInitDeopt {

@ -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 {

@ -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

@ -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' };

@ -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() {

@ -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 {

@ -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 {

@ -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;

@ -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 {

@ -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 {

@ -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;

@ -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) {

@ -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

@ -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 {

@ -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;

@ -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) {

@ -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) {

@ -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) {

@ -1,72 +0,0 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/**
* @test
* @bug 6478991
* @summary C1 NullCheckEliminator yields incorrect exceptions
*
* @run main/othervm -XX:CompileOnly=NullCheckTest.test,NullCheckTest.inlined -Xcomp NullCheckTest
*/
public class NullCheckTest {
static class A {
int f;
public final void inlined(A a) {
// This cast is intended to fail.
B b = ((B) 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;
}
}
}

@ -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;

@ -0,0 +1,77 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/**
* @test
* @bug 6478991
* @summary C1 NullCheckEliminator yields incorrect exceptions
*
* @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;
public final void inlined(A a) {
// This cast is intended to fail.
B b = ((B) 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;
}
}
}

@ -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);

@ -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;

@ -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;
}

@ -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 = {

@ -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;

@ -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;

@ -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);

@ -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;

@ -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;

@ -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);
}
}

@ -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 {

@ -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;

@ -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 {

@ -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();

@ -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;

@ -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) {

@ -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) {

@ -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;

@ -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;

@ -1,76 +0,0 @@
/*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/**
* @test
* @bug 6905845
* @summary Server VM improperly optimizing away loop.
*
* @run main/timeout=480 Test6905845
*/
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;
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);
}
}
}
}
}

@ -1,96 +0,0 @@
/*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/*
* @test
* @bug 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
*/
public class Test {
static long vara_1 = 1L;
static void testa() {
short var_2 = (byte) 1.0E10;
for ( Object temp = new byte[(byte)1.0E10]; true ;
var_2 = "1".equals("0") ? ((byte) vara_1) : 1 ) {}
}
static void testb() {
long var_1 = -1L;
short var_2 = (byte) 1.0E10;
for ( Object temp = new byte[(byte)1.0E10]; true ;
var_2 = "1".equals("0") ? ((byte) var_1) : 1 ) {}
}
static void testc() {
long var_1 = -1L;
if (vara_1 > 0) var_1 = 1L;
int var_2 = (byte)var_1 - 128;
for ( Object temp = new byte[var_2]; true ;
var_2 = "1".equals("0") ? 2 : 1 ) {}
}
static void testd() {
long var_1 = 0L;
int var_2 = (byte)var_1 + 1;
for (int i=0; i<2 ; i++) var_2 = var_2 - 1;
for ( Object temp = new byte[var_2]; true ;
var_2 = "1".equals("0") ? 2 : 1 ) {}
}
public static void main(String[] args) throws Exception {
int nex = 0;
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);
}
}

@ -1,87 +0,0 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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 7190310
* @summary Inlining WeakReference.get(), and hoisting $referent may lead to non-terminating loops
* @run main/othervm/timeout=600 -Xbatch Test7190310
*/
/*
* Note bug exhibits as infinite loop, timeout is helpful.
* 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.
*/
import java.lang.ref.*;
public class Test7190310 {
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<Object> rq =
new ReferenceQueue<Object>();
private final static WeakReference<Object> wr =
new WeakReference<Object>(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<? extends Object> 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();
}
}

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

@ -1,98 +0,0 @@
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/**
* @test
* @bug 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
*/
abstract class O {
int f;
public O() { f = 5; }
abstract void put(int i);
public int foo(int i) {
put(i);
return i;
}
};
class A extends O {
int[] a;
public A(int s) {
a = new int[s];
}
public void put(int i) {
a[i%a.length] = i;
}
}
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;
}
}

@ -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;

@ -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;

@ -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 {

@ -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) {

@ -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;

@ -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 class Test5057225 {
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");
}
}

@ -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;

@ -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 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 Test6186134(int n) {
num = n;
}
return res;
}
public static void main(String[] pars) {
int n = Integer.parseInt(pars[0]);
for (int i=0; i<n; i++) {
Test6186134 t = new Test6186134(10);
int size = t.test1().size();
if (size != 10) {
System.out.println("wrong size: " + size +", should be 10");
System.exit(97);
}
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();
}
return res;
}
public static void main(String[] pars) {
int n = Integer.parseInt(pars[0]);
for (int i = 0; i < n; i++) {
Test6186134 t = new Test6186134(10);
int size = t.test1().size();
if (size != 10) {
System.out.println("wrong size: " + size + ", should be 10");
System.exit(97);
}
}
System.out.println("Passed");
}
System.out.println("Passed");
}
}

@ -27,9 +27,11 @@
* @bug 6196102
* @summary Integer seems to be greater than Integer.MAX_VALUE
*
* @run main Test6196102
* @run main compiler.c2.Test6196102
*/
package compiler.c2;
public class Test6196102 {
static public void main(String[] args) {
int i1 = 0;

@ -27,46 +27,48 @@
* @bug 6357214
* @summary Hotspot server compiler gets integer comparison wrong
*
* @run main/othervm/timeout=60 -DshowAll=ffo -DeventID=444 Test6357214
* @run main/othervm/timeout=60 -DshowAll=ffo -DeventID=444 compiler.c2.Test6357214
*/
package compiler.c2;
// The test hangs after few iterations before the fix. So it fails if timeout.
class MyResult {
public class Test6357214 {
static class MyResult {
public boolean next() {
return true;
return true;
}
public String getString(String in) {
if (in.equals("id"))
return "idFoo";
if (in.equals("contentKey"))
return "ckFoo";
return "Foo";
if (in.equals("id"))
return "idFoo";
if (in.equals("contentKey"))
return "ckFoo";
return "Foo";
}
public int getInt(String in) {
if (in.equals("processingComplete"))
return 0;
return 1;
if (in.equals("processingComplete"))
return 0;
return 1;
}
public byte[] getBytes(String in) {
byte[] arr = null;
if (in.equals("content")) {
arr = new byte[65536];
byte j = 32;
for (int i=0; i<65536; i++) {
arr[i] = j;
if (++j == 127)
j=32;
}
byte[] arr = null;
if (in.equals("content")) {
arr = new byte[65536];
byte j = 32;
for (int i=0; i<65536; i++) {
arr[i] = j;
if (++j == 127)
j=32;
}
return arr;
}
return arr;
}
}
}
public class Test6357214 {
public static volatile boolean bollocks = true;
public static volatile boolean bollocks = true;
public String create(String context) throws Exception {
//

@ -27,9 +27,13 @@
* @bug 6443505
* @summary Some cases for CmpLTMask missed; also wrong code.
*
* @run main/othervm -Xcomp -XX:CompileOnly="Test6443505.compiled" Test6443505
* @run main/othervm -Xcomp
* -XX:CompileCommand=compileonly,compiler.c2.Test6443505::compiled
* compiler.c2.Test6443505
*/
package compiler.c2;
public class Test6443505 {
public static void main(String[] args) throws InterruptedException {

@ -27,9 +27,11 @@
* @bug 6559156
* @summary Server compiler generates bad code for "<= Integer.MAX_VALUE" expression
*
* @run main Test6559156
* @run main compiler.c2.Test6559156
*/
package compiler.c2;
public class Test6559156 {
static final int N_TESTS = 1000000;

@ -27,7 +27,8 @@
* @summary long/int division by constant
* @modules java.base/jdk.internal.misc
* @library /testlibrary
* @run main/othervm -Xcomp -Xbatch -XX:-Inline Test
*
* @run main/othervm -Xcomp -Xbatch -XX:-Inline compiler.c2.Test6603011
*/
//
@ -37,16 +38,17 @@
// dividend and divisor combinations are tested
//
package compiler.c2;
import jdk.test.lib.Utils;
class s {
static int divi(int dividend, int divisor) { return dividend / divisor; }
static int modi(int dividend, int divisor) { return dividend % divisor; }
static long divl(long dividend, long divisor) { return dividend / divisor; }
static long modl(long dividend, long divisor) { return dividend % divisor; }
}
public class Test implements Runnable {
public class Test6603011 implements Runnable {
static class s {
static int divi(int dividend, int divisor) { return dividend / divisor; }
static int modi(int dividend, int divisor) { return dividend % divisor; }
static long divl(long dividend, long divisor) { return dividend / divisor; }
static long modl(long dividend, long divisor) { return dividend % divisor; }
}
// Report verbose messages on failure; turn off to suppress
// too much output with gross numbers of failures.
static final boolean VERBOSE = true;
@ -194,13 +196,13 @@ public class Test implements Runnable {
System.setProperty("divisor", "" + divisor);
ClassLoader loader
= Utils.getTestClassPathURLClassLoader(apploader.getParent());
Class c = loader.loadClass("Test");
Class c = loader.loadClass(Test6603011.class.getName());
Runnable r = (Runnable)c.newInstance();
r.run();
}
public static void main(String[] args) throws Exception {
Class cl = Class.forName("Test");
Class cl = Test6603011.class;
ClassLoader apploader = cl.getClassLoader();

@ -26,10 +26,14 @@
* @bug 6636138
* @summary SuperWord::co_locate_pack(Node_List* p) generates memory graph that leads to memory order violation.
*
* @run main/othervm -Xbatch -XX:CompileOnly=Test1.init Test1
* @run main/othervm -Xbatch
* -XX:CompileCommand=compileonly,compiler.c2.Test6636138_1::init
* compiler.c2.Test6636138_1
*/
public class Test1 {
package compiler.c2;
public class Test6636138_1 {
public static void init(int src[], int [] dst, int[] ref) {
// initialize the arrays

@ -26,10 +26,14 @@
* @bug 6636138
* @summary SuperWord::co_locate_pack(Node_List* p) generates memory graph that leads to memory order violation.
*
* @run main/othervm -Xbatch -XX:CompileOnly=Test2.shift Test2
* @run main/othervm -Xbatch
* -XX:CompileCommand=compileonly,compiler.c2.Test6636138_2::shift
* compiler.c2.Test6636138_2
*/
public class Test2 {
package compiler.c2;
public class Test6636138_2 {
public static void init(int src[]) {
// Initialize the array
@ -37,22 +41,22 @@ public class Test2 {
src[i] = i;
}
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 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 class Test2 {
}
public static void main(String[] args) {
for (int i=0; i< 2000; i++)
for (int i = 0; i < 2000; i++)
test();
}
}
}

@ -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)];
}
}

@ -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);

@ -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 class Test {
}
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);

@ -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];

@ -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.<init> Test
*
* @run main/othervm -Xcomp
* -XX:CompileCommand=compileonly,compiler.c2.Test6711100::<init>
* 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 class Test {
public static void main(String[] args) {
try {
Test t = new Test();
Test6711100 t = new Test6711100();
} catch (ArrayIndexOutOfBoundsException e) {
}
}

@ -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 @@ public class Test {
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 class Test {
}
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++) {

@ -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

@ -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;
public static void main(String[] args) {
Tester t = new Tester();
String s = t.foo();
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) {
Test6741738 t = new Test6741738();
String s = t.foo();
}
}

@ -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;

@ -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 class Test6792161 {
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) {}
}

@ -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)
{

@ -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;

@ -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");
}
}

@ -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 class Test6800154 implements Runnable {
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 @@ public class Test6800154 implements Runnable {
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();
}

@ -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 class Test6805724 implements Runnable {
}
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 @@ public class Test6805724 implements Runnable {
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();
}

@ -0,0 +1,109 @@
/*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/*
* @test
* @bug 6823453
* @summary DeoptimizeALot causes fastdebug server jvm to fail with assert(false,"unscheduable graph")
*
* @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+DeoptimizeALot
* -XX:CompileCommand=compileonly,compiler.c2.Test6823453::*
* compiler.c2.Test6823453
*/
package compiler.c2;
public class Test6823453 {
static long vara_1 = 1L;
static void testa() {
short var_2 = (byte) 1.0E10;
for (Object temp = new byte[(byte) 1.0E10]; true;
var_2 = "1".equals("0") ? ((byte) vara_1) : 1) {
}
}
static void testb() {
long var_1 = -1L;
short var_2 = (byte) 1.0E10;
for (Object temp = new byte[(byte) 1.0E10]; true;
var_2 = "1".equals("0") ? ((byte) var_1) : 1) {
}
}
static void testc() {
long var_1 = -1L;
if (vara_1 > 0) var_1 = 1L;
int var_2 = (byte) var_1 - 128;
for (Object temp = new byte[var_2]; true;
var_2 = "1".equals("0") ? 2 : 1) {
}
}
static void testd() {
long var_1 = 0L;
int var_2 = (byte) var_1 + 1;
for (int i = 0; i < 2; i++) var_2 = var_2 - 1;
for (Object temp = new byte[var_2]; true;
var_2 = "1".equals("0") ? 2 : 1) {
}
}
public static void main(String[] args) throws Exception {
int nex = 0;
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);
}
}

@ -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;
}
interface AnotherInterface {
int THIRDS = 33;
}
class SomeClass implements SomeInterface {
int i;
SomeClass(int i) {
this.i = i;
public class Test6832293 {
static interface SomeInterface {
int SEVENS = 777;
}
}
class ImmediateSubclass extends SomeClass implements SomeInterface {
float f;
ImmediateSubclass(int i, float f) {
super(i);
this.f = f;
static interface AnotherInterface {
int THIRDS = 33;
}
}
final class FinalSubclass extends ImmediateSubclass implements AnotherInterface {
double d;
static class SomeClass implements SomeInterface {
int i;
FinalSubclass(int i, float f, double d) {
super(i, f);
this.d = d;
SomeClass(int i) {
this.i = i;
}
}
}
public class Test {
static class ImmediateSubclass extends SomeClass implements SomeInterface {
float f;
ImmediateSubclass(int i, float f) {
super(i);
this.f = f;
}
}
static final class FinalSubclass extends ImmediateSubclass implements AnotherInterface {
double d;
FinalSubclass(int i, float f, double d) {
super(i, f);
this.d = d;
}
}
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*/);
}

@ -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;

@ -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
*/
import java.util.Set;
import java.util.HashSet;
package compiler.c2;
public class Test {
import java.util.HashSet;
import java.util.Set;
public class Test6837094 {
private interface Factory<M extends Interface> {
Factory<Child0> Zero = new Factory<Child0>() {
@ -72,23 +78,25 @@ public class Test {
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 {
}

@ -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 @@ public class Test {
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);

@ -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) {

Some files were not shown because too many files have changed in this diff Show More