mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
Extract a reproducer into a test method
This commit is contained in:
parent
af3d71363b
commit
3c86ec1b84
@ -26,17 +26,33 @@
|
||||
* @bug 8374807
|
||||
* @summary Regression test for -XX:+TraceDeoptimization -XX:-ProfileTraps
|
||||
* -XX:-TieredCompilation -Xcomp crash
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* @requires vm.debug
|
||||
* @run main/othervm -XX:+TraceDeoptimization -XX:-ProfileTraps
|
||||
* -XX:-TieredCompilation -Xcomp
|
||||
* -XX:-TieredCompilation -Xcomp -Xbatch
|
||||
* -XX:CompileCommand=compileonly,compiler.uncommontrap.TestPrintDiagnosticsWithoutProfileTraps::test
|
||||
* compiler.uncommontrap.TestPrintDiagnosticsWithoutProfileTraps
|
||||
*/
|
||||
|
||||
package compiler.uncommontrap;
|
||||
|
||||
import jdk.internal.misc.Unsafe;
|
||||
|
||||
public class TestPrintDiagnosticsWithoutProfileTraps {
|
||||
static final Unsafe UNSAFE=Unsafe.getUnsafe();
|
||||
static volatile long sink;
|
||||
|
||||
static class TestSubClass {
|
||||
int f;
|
||||
}
|
||||
|
||||
static void test(){
|
||||
// Trigger a deopt/uncommon-trap path while resolving the field offset.
|
||||
sink = UNSAFE.objectFieldOffset(TestSubClass.class,"f");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
test();
|
||||
System.out.println("passed");
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user