Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/hotspot/jtreg/compiler/c2/PolynomialRoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

/**
* @test
* @key randomness
* @bug 8005956
* @summary C2: assert(!def_outside->member(r)) failed: Use of external LRG overlaps the same LRG defined in this block
* @library /test/lib
Expand Down
7 changes: 5 additions & 2 deletions test/hotspot/jtreg/compiler/c2/Test6661247.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,16 +23,19 @@

/*
* @test
* @key randomness
* @bug 6661247
* @summary Internal bug in 32-bit HotSpot optimizer while bit manipulations
*
* @library /test/lib
* @run main compiler.c2.Test6661247
*/

package compiler.c2;

import java.nio.LongBuffer;
import java.util.Random;
import jdk.test.lib.Utils;

// This isn't a completely reliable test for 6661247 since the results
// depend on what the local schedule looks like but it does reproduce
Expand Down Expand Up @@ -133,7 +136,7 @@ public static void test(boolean[] src, int srcPos, LongBuffer dest, long destPos
}
}
public static void main(String[] args) {
Random r = new Random();
Random r = Utils.getRandomInstance();
int entries = 1000;
boolean[] src = new boolean[entries * 64];
long[] dest = new long[entries];
Expand Down
19 changes: 12 additions & 7 deletions test/hotspot/jtreg/compiler/c2/Test7047069.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,16 +23,20 @@

/**
* @test
* @key randomness
* @bug 7047069
* @summary Array can dynamically change size when assigned to an object field
* @modules java.desktop
*
* @library /test/lib
* @run main/othervm -Xbatch compiler.c2.Test7047069
*/

package compiler.c2;

import java.awt.geom.Line2D;
import java.util.Random;
import jdk.test.lib.Utils;

public class Test7047069 {
static boolean verbose;
Expand Down Expand Up @@ -119,12 +123,13 @@ public Test7047069() {
this.squareflat = .0001f * .0001f;
holdIndex = hold.length - 6;
holdEnd = hold.length - 2;
hold[holdIndex + 0] = (float) (Math.random() * 100);
hold[holdIndex + 1] = (float) (Math.random() * 100);
hold[holdIndex + 2] = (float) (Math.random() * 100);
hold[holdIndex + 3] = (float) (Math.random() * 100);
hold[holdIndex + 4] = (float) (Math.random() * 100);
hold[holdIndex + 5] = (float) (Math.random() * 100);
Random rng = Utils.getRandomInstance();
hold[holdIndex + 0] = (float) (rng.nextDouble() * 100);
hold[holdIndex + 1] = (float) (rng.nextDouble() * 100);
hold[holdIndex + 2] = (float) (rng.nextDouble() * 100);
hold[holdIndex + 3] = (float) (rng.nextDouble() * 100);
hold[holdIndex + 4] = (float) (rng.nextDouble() * 100);
hold[holdIndex + 5] = (float) (rng.nextDouble() * 100);
levelIndex = 0;
this.limit = 10;
this.levels = new int[limit + 1];
Expand Down
14 changes: 10 additions & 4 deletions test/hotspot/jtreg/compiler/c2/Test7160610.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,28 +23,34 @@

/**
* @test
* @key randomness
* @bug 7160610
* @summary Unknown Native Code compilation issue.
*
* @library /test/lib
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-OptimizeFill compiler.c2.Test7160610
*/

package compiler.c2;

import jdk.test.lib.Utils;

import java.util.Random;

public class Test7160610 {
private static final byte[] BYTE_ARRAY = new byte[7];
private static int[] anIntArray1190 = new int[32768];
private static int[] anIntArray1191 = new int[32768];

public static void main(String arg[]) {
Random rng = Utils.getRandomInstance();
int i = 256;
for(int j = BYTE_ARRAY[2]; j < anIntArray1190.length; j++) {
anIntArray1190[j] = BYTE_ARRAY[2];
}

for(int k = BYTE_ARRAY[2]; (k ^ BYTE_ARRAY[1]) > -5001; k++) {
int i1 = (int)(Math.random() * 128D * (double)i);
anIntArray1190[i1] = (int)(Math.random() * 256D);
int i1 = (int)(rng.nextDouble() * 128D * (double)i);
anIntArray1190[i1] = (int)(rng.nextDouble() * 256D);
}

for(int l = BYTE_ARRAY[2]; (l ^ BYTE_ARRAY[1]) > -21; l++) {
Expand Down
3 changes: 2 additions & 1 deletion test/hotspot/jtreg/compiler/c2/Test7177917.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,6 +23,7 @@

/**
* @test
* @key randomness
* @bug 7177917
* @summary Micro-benchmark for Math.pow() and Math.exp()
* @modules java.base/jdk.internal.misc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,6 +23,7 @@

/**
* @test
* @key randomness
* @bug 8015774
* @summary Verify processing of options related to code heaps sizing.
* @library /test/lib /
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,6 +23,7 @@

/*
* @test SegmentedCodeCacheDtraceTest
* @key randomness
* @bug 8015774
* @summary testing of dtrace for segmented code cache
* @requires os.family=="solaris"
Expand Down
5 changes: 1 addition & 4 deletions test/hotspot/jtreg/compiler/codecache/stress/Helper.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,18 +26,15 @@
import jdk.test.lib.Asserts;
import jdk.test.lib.ByteCodeLoader;
import jdk.test.lib.InfiniteLoop;
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 = "compiler.codecache.stress.Helper$TestCaseImpl";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,6 +23,7 @@

/*
* @test OverloadCompileQueueTest
* @key stress randomness
* @summary stressing code cache by overloading compile queues
* @library /test/lib /
* @modules java.base/jdk.internal.misc
Expand All @@ -46,9 +47,11 @@
package compiler.codecache.stress;

import jdk.test.lib.Platform;
import jdk.test.lib.Utils;

import java.lang.reflect.Method;
import java.util.stream.IntStream;
import java.util.Random;

public class OverloadCompileQueueTest implements Runnable {
private static final int MAX_SLEEP = 10000;
Expand All @@ -60,6 +63,7 @@ public class OverloadCompileQueueTest implements Runnable {
private static final int TIERED_STOP_AT_LEVEL
= Helper.WHITE_BOX.getIntxVMFlag("TieredStopAtLevel").intValue();
private static final int[] AVAILABLE_LEVELS;
private final Random rng = Utils.getRandomInstance();
static {
if (TIERED_COMPILATION) {
AVAILABLE_LEVELS = IntStream
Expand Down Expand Up @@ -104,7 +108,7 @@ public void run() {

private void lockUnlock() {
try {
int sleep = Helper.RNG.nextInt(MAX_SLEEP);
int sleep = rng.nextInt(MAX_SLEEP);
Helper.WHITE_BOX.lockCompilation();
Thread.sleep(sleep);
} catch (InterruptedException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,7 +23,7 @@

/*
* @test RandomAllocationTest
* @key stress
* @key stress randomness
* @summary stressing code cache by allocating randomly sized "dummy" code blobs
* @library /test/lib /
* @modules java.base/jdk.internal.misc
Expand All @@ -49,13 +49,16 @@
import sun.hotspot.code.BlobType;

import java.util.ArrayList;
import java.util.Random;
import jdk.test.lib.Utils;

public class RandomAllocationTest implements Runnable {
private static final long CODE_CACHE_SIZE
= Helper.WHITE_BOX.getUintxVMFlag("ReservedCodeCacheSize");
private static final int MAX_BLOB_SIZE = (int) (CODE_CACHE_SIZE >> 7);
private static final BlobType[] BLOB_TYPES
= BlobType.getAvailable().toArray(new BlobType[0]);
private final Random rng = Utils.getRandomInstance();

public static void main(String[] args) {
new CodeCacheStressRunner(new RandomAllocationTest()).runTest();
Expand All @@ -64,16 +67,16 @@ public static void main(String[] args) {
private final ArrayList<Long> blobs = new ArrayList<>();
@Override
public void run() {
boolean allocate = blobs.isEmpty() || Helper.RNG.nextBoolean();
boolean allocate = blobs.isEmpty() || rng.nextBoolean();
if (allocate) {
int type = Helper.RNG.nextInt(BLOB_TYPES.length);
int type = rng.nextInt(BLOB_TYPES.length);
long addr = Helper.WHITE_BOX.allocateCodeBlob(
Helper.RNG.nextInt(MAX_BLOB_SIZE), BLOB_TYPES[type].id);
rng.nextInt(MAX_BLOB_SIZE), BLOB_TYPES[type].id);
if (addr != 0) {
blobs.add(addr);
}
} else {
int index = Helper.RNG.nextInt(blobs.size());
int index = rng.nextInt(blobs.size());
Helper.WHITE_BOX.freeCodeBlob(blobs.remove(index));
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,7 +23,7 @@

/*
* @test UnexpectedDeoptimizationTest
* @key stress
* @key stress randomness
* @summary stressing code cache by forcing unexpected deoptimizations
* @library /test/lib /
* @modules java.base/jdk.internal.misc
Expand All @@ -46,15 +46,19 @@

package compiler.codecache.stress;

import java.util.Random;
import jdk.test.lib.Utils;

public class UnexpectedDeoptimizationTest implements Runnable {
private final Random rng = Utils.getRandomInstance();

public static void main(String[] args) {
new CodeCacheStressRunner(new UnexpectedDeoptimizationTest()).runTest();
}

@Override
public void run() {
Helper.WHITE_BOX.deoptimizeFrames(Helper.RNG.nextBoolean());
Helper.WHITE_BOX.deoptimizeFrames(rng.nextBoolean());
}

}
3 changes: 2 additions & 1 deletion test/hotspot/jtreg/compiler/codegen/Test6896617.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,6 +23,7 @@

/*
* @test
* @key randomness
* @bug 6896617
* @summary Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() with SSE instructions on x86
* @library /test/lib
Expand Down
3 changes: 2 additions & 1 deletion test/hotspot/jtreg/compiler/codegen/Test7100757.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,6 +23,7 @@

/**
* @test
* @key randomness
* @bug 7100757
* @summary The BitSet.nextSetBit() produces incorrect result in 32bit VM on Sparc
* @library /test/lib
Expand Down
3 changes: 2 additions & 1 deletion test/hotspot/jtreg/compiler/codegen/aes/TestAESMain.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,6 +25,7 @@
* @test
* @bug 7184394
* @key stress
* @comment the test isn't marked w/ randomness as it uses predefined key b/c of keySize==128
* @summary add intrinsics to use AES instructions
* @library /test/lib /
* @modules java.base/jdk.internal.misc
Expand Down
Loading