Skip to content

Commit

Permalink
8300693: Lower the compile threshold and reduce the iterations of war…
Browse files Browse the repository at this point in the history
…mup loop in VarHandles tests

Reviewed-by: jvernee, dholmes, psandoz
  • Loading branch information
Mandy Chung committed Jan 23, 2023
1 parent 4525aa3 commit 86fed79
Show file tree
Hide file tree
Showing 27 changed files with 172 additions and 128 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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,10 +23,14 @@

/*
* @test
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessBoolean
* @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessBoolean
* @run testng/othervm -Diters=20000 VarHandleTestAccessBoolean
* @run testng/othervm -Diters=20000 -XX:-TieredCompilation VarHandleTestAccessBoolean
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessBoolean
*
* @comment Set CompileThresholdScaling to 0.1 so that the warmup loop sets to 2000 iterations
* to hit compilation thresholds
*
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:TieredStopAtLevel=1 VarHandleTestAccessBoolean
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 VarHandleTestAccessBoolean
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation VarHandleTestAccessBoolean
*/

import org.testng.annotations.BeforeClass;
Expand Down Expand Up @@ -289,9 +293,6 @@ public <T> void testAccess(String desc, AccessTestCase<T> atc) throws Throwable
}
}




static void testInstanceFinalField(VarHandleTestAccessBoolean recv, VarHandle vh) {
// Plain
{
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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,10 +23,14 @@

/*
* @test
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessByte
* @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessByte
* @run testng/othervm -Diters=20000 VarHandleTestAccessByte
* @run testng/othervm -Diters=20000 -XX:-TieredCompilation VarHandleTestAccessByte
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessByte
*
* @comment Set CompileThresholdScaling to 0.1 so that the warmup loop sets to 2000 iterations
* to hit compilation thresholds
*
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:TieredStopAtLevel=1 VarHandleTestAccessByte
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 VarHandleTestAccessByte
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation VarHandleTestAccessByte
*/

import org.testng.annotations.BeforeClass;
Expand Down Expand Up @@ -289,9 +293,6 @@ public <T> void testAccess(String desc, AccessTestCase<T> atc) throws Throwable
}
}




static void testInstanceFinalField(VarHandleTestAccessByte recv, VarHandle vh) {
// Plain
{
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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,10 +23,14 @@

/*
* @test
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessChar
* @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessChar
* @run testng/othervm -Diters=20000 VarHandleTestAccessChar
* @run testng/othervm -Diters=20000 -XX:-TieredCompilation VarHandleTestAccessChar
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessChar
*
* @comment Set CompileThresholdScaling to 0.1 so that the warmup loop sets to 2000 iterations
* to hit compilation thresholds
*
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:TieredStopAtLevel=1 VarHandleTestAccessChar
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 VarHandleTestAccessChar
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation VarHandleTestAccessChar
*/

import org.testng.annotations.BeforeClass;
Expand Down Expand Up @@ -289,9 +293,6 @@ public <T> void testAccess(String desc, AccessTestCase<T> atc) throws Throwable
}
}




static void testInstanceFinalField(VarHandleTestAccessChar recv, VarHandle vh) {
// Plain
{
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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,10 +23,14 @@

/*
* @test
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessDouble
* @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessDouble
* @run testng/othervm -Diters=20000 VarHandleTestAccessDouble
* @run testng/othervm -Diters=20000 -XX:-TieredCompilation VarHandleTestAccessDouble
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessDouble
*
* @comment Set CompileThresholdScaling to 0.1 so that the warmup loop sets to 2000 iterations
* to hit compilation thresholds
*
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:TieredStopAtLevel=1 VarHandleTestAccessDouble
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 VarHandleTestAccessDouble
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation VarHandleTestAccessDouble
*/

import org.testng.annotations.BeforeClass;
Expand Down Expand Up @@ -289,9 +293,6 @@ public <T> void testAccess(String desc, AccessTestCase<T> atc) throws Throwable
}
}




static void testInstanceFinalField(VarHandleTestAccessDouble recv, VarHandle vh) {
// Plain
{
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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,10 +23,14 @@

/*
* @test
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessFloat
* @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessFloat
* @run testng/othervm -Diters=20000 VarHandleTestAccessFloat
* @run testng/othervm -Diters=20000 -XX:-TieredCompilation VarHandleTestAccessFloat
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessFloat
*
* @comment Set CompileThresholdScaling to 0.1 so that the warmup loop sets to 2000 iterations
* to hit compilation thresholds
*
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:TieredStopAtLevel=1 VarHandleTestAccessFloat
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 VarHandleTestAccessFloat
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation VarHandleTestAccessFloat
*/

import org.testng.annotations.BeforeClass;
Expand Down Expand Up @@ -289,9 +293,6 @@ public <T> void testAccess(String desc, AccessTestCase<T> atc) throws Throwable
}
}




static void testInstanceFinalField(VarHandleTestAccessFloat recv, VarHandle vh) {
// Plain
{
Expand Down
17 changes: 9 additions & 8 deletions test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessInt.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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,10 +23,14 @@

/*
* @test
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessInt
* @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessInt
* @run testng/othervm -Diters=20000 VarHandleTestAccessInt
* @run testng/othervm -Diters=20000 -XX:-TieredCompilation VarHandleTestAccessInt
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessInt
*
* @comment Set CompileThresholdScaling to 0.1 so that the warmup loop sets to 2000 iterations
* to hit compilation thresholds
*
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:TieredStopAtLevel=1 VarHandleTestAccessInt
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 VarHandleTestAccessInt
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation VarHandleTestAccessInt
*/

import org.testng.annotations.BeforeClass;
Expand Down Expand Up @@ -289,9 +293,6 @@ public <T> void testAccess(String desc, AccessTestCase<T> atc) throws Throwable
}
}




static void testInstanceFinalField(VarHandleTestAccessInt recv, VarHandle vh) {
// Plain
{
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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,10 +23,14 @@

/*
* @test
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessLong
* @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessLong
* @run testng/othervm -Diters=20000 VarHandleTestAccessLong
* @run testng/othervm -Diters=20000 -XX:-TieredCompilation VarHandleTestAccessLong
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessLong
*
* @comment Set CompileThresholdScaling to 0.1 so that the warmup loop sets to 2000 iterations
* to hit compilation thresholds
*
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:TieredStopAtLevel=1 VarHandleTestAccessLong
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 VarHandleTestAccessLong
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation VarHandleTestAccessLong
*/

import org.testng.annotations.BeforeClass;
Expand Down Expand Up @@ -289,9 +293,6 @@ public <T> void testAccess(String desc, AccessTestCase<T> atc) throws Throwable
}
}




static void testInstanceFinalField(VarHandleTestAccessLong recv, VarHandle vh) {
// Plain
{
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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,10 +23,14 @@

/*
* @test
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessShort
* @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessShort
* @run testng/othervm -Diters=20000 VarHandleTestAccessShort
* @run testng/othervm -Diters=20000 -XX:-TieredCompilation VarHandleTestAccessShort
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessShort
*
* @comment Set CompileThresholdScaling to 0.1 so that the warmup loop sets to 2000 iterations
* to hit compilation thresholds
*
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:TieredStopAtLevel=1 VarHandleTestAccessShort
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 VarHandleTestAccessShort
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation VarHandleTestAccessShort
*/

import org.testng.annotations.BeforeClass;
Expand Down Expand Up @@ -289,9 +293,6 @@ public <T> void testAccess(String desc, AccessTestCase<T> atc) throws Throwable
}
}




static void testInstanceFinalField(VarHandleTestAccessShort recv, VarHandle vh) {
// Plain
{
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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,10 +23,14 @@

/*
* @test
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessString
* @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessString
* @run testng/othervm -Diters=20000 VarHandleTestAccessString
* @run testng/othervm -Diters=20000 -XX:-TieredCompilation VarHandleTestAccessString
* @run testng/othervm -Diters=10 -Xint VarHandleTestAccessString
*
* @comment Set CompileThresholdScaling to 0.1 so that the warmup loop sets to 2000 iterations
* to hit compilation thresholds
*
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:TieredStopAtLevel=1 VarHandleTestAccessString
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 VarHandleTestAccessString
* @run testng/othervm -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation VarHandleTestAccessString
*/

import org.testng.annotations.BeforeClass;
Expand Down Expand Up @@ -296,9 +300,6 @@ public <T> void testAccess(String desc, AccessTestCase<T> atc) throws Throwable
}
}




static void testInstanceFinalField(VarHandleTestAccessString recv, VarHandle vh) {
// Plain
{
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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 @@ -24,9 +24,11 @@
/*
* @test
* @bug 8154556
* @run testng/othervm/timeout=360 -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestByteArrayAsChar
* @run testng/othervm/timeout=360 -Diters=20000 VarHandleTestByteArrayAsChar
* @run testng/othervm/timeout=360 -Diters=20000 -XX:-TieredCompilation VarHandleTestByteArrayAsChar
* @comment Set CompileThresholdScaling to 0.1 so that the warmup loop sets to 2000 iterations
* to hit compilation thresholds
* @run testng/othervm/timeout=360 -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:TieredStopAtLevel=1 VarHandleTestByteArrayAsChar
* @run testng/othervm/timeout=360 -Diters=2000 -XX:CompileThresholdScaling=0.1 VarHandleTestByteArrayAsChar
* @run testng/othervm/timeout=360 -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation VarHandleTestByteArrayAsChar
*/

import org.testng.annotations.DataProvider;
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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 @@ -24,9 +24,11 @@
/*
* @test
* @bug 8154556
* @run testng/othervm/timeout=360 -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestByteArrayAsDouble
* @run testng/othervm/timeout=360 -Diters=20000 VarHandleTestByteArrayAsDouble
* @run testng/othervm/timeout=360 -Diters=20000 -XX:-TieredCompilation VarHandleTestByteArrayAsDouble
* @comment Set CompileThresholdScaling to 0.1 so that the warmup loop sets to 2000 iterations
* to hit compilation thresholds
* @run testng/othervm/timeout=360 -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:TieredStopAtLevel=1 VarHandleTestByteArrayAsDouble
* @run testng/othervm/timeout=360 -Diters=2000 -XX:CompileThresholdScaling=0.1 VarHandleTestByteArrayAsDouble
* @run testng/othervm/timeout=360 -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation VarHandleTestByteArrayAsDouble
*/

import org.testng.annotations.DataProvider;
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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 @@ -24,9 +24,11 @@
/*
* @test
* @bug 8154556
* @run testng/othervm/timeout=360 -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestByteArrayAsFloat
* @run testng/othervm/timeout=360 -Diters=20000 VarHandleTestByteArrayAsFloat
* @run testng/othervm/timeout=360 -Diters=20000 -XX:-TieredCompilation VarHandleTestByteArrayAsFloat
* @comment Set CompileThresholdScaling to 0.1 so that the warmup loop sets to 2000 iterations
* to hit compilation thresholds
* @run testng/othervm/timeout=360 -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:TieredStopAtLevel=1 VarHandleTestByteArrayAsFloat
* @run testng/othervm/timeout=360 -Diters=2000 -XX:CompileThresholdScaling=0.1 VarHandleTestByteArrayAsFloat
* @run testng/othervm/timeout=360 -Diters=2000 -XX:CompileThresholdScaling=0.1 -XX:-TieredCompilation VarHandleTestByteArrayAsFloat
*/

import org.testng.annotations.DataProvider;
Expand Down

1 comment on commit 86fed79

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.