< prev index next >
test/gc/shenandoah/compiler/TestReferenceCAS.java
Print this page
rev 10672 : [backport] Turn TestReferenceCAS into a standalone/no-testng test
rev 10697 : [backport] Prepare tests for making UseShenandoahGC experimental
rev 10772 : [backport] Update copyrights
rev 10782 : [backport] Shenandoah should @require Shenandoah, @key gc, and have good @test
*** 1,7 ****
/*
! * Copyright (c) 2016, Red Hat, Inc. and/or its affiliates.
*
* 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.
*
--- 1,7 ----
/*
! * Copyright (c) 2016, 2018, Red Hat, Inc. All rights reserved.
*
* 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.
*
*** 20,50 ****
* questions.
*
*/
/*
! * @test Shenandoah reference CAS test
! *
! * @run testng/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC TestReferenceCAS
! * @run testng/othervm -Diters=100 -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -Xint TestReferenceCAS
! * @run testng/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:-TieredCompilation TestReferenceCAS
! * @run testng/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:TieredStopAtLevel=1 TestReferenceCAS
! * @run testng/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:TieredStopAtLevel=4 TestReferenceCAS
! *
! * @run testng/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:-UseCompressedOops TestReferenceCAS
! * @run testng/othervm -Diters=100 -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:-UseCompressedOops -Xint TestReferenceCAS
! * @run testng/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:-UseCompressedOops -XX:-TieredCompilation TestReferenceCAS
! * @run testng/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:-UseCompressedOops -XX:TieredStopAtLevel=1 TestReferenceCAS
! * @run testng/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:-UseCompressedOops -XX:TieredStopAtLevel=4 TestReferenceCAS
*/
- import org.testng.annotations.Test;
-
import java.lang.reflect.Field;
- import static org.testng.Assert.*;
-
public class TestReferenceCAS {
static final int ITERS = Integer.getInteger("iters", 1);
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
--- 20,48 ----
* questions.
*
*/
/*
! * @test TestReferenceCAS
! * @summary Shenandoah reference CAS test
! * @key gc
! *
! * @run main/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC TestReferenceCAS
! * @run main/othervm -Diters=100 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -Xint TestReferenceCAS
! * @run main/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:-TieredCompilation TestReferenceCAS
! * @run main/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:TieredStopAtLevel=1 TestReferenceCAS
! * @run main/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:TieredStopAtLevel=4 TestReferenceCAS
! *
! * @run main/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:-UseCompressedOops TestReferenceCAS
! * @run main/othervm -Diters=100 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:-UseCompressedOops -Xint TestReferenceCAS
! * @run main/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:-UseCompressedOops -XX:-TieredCompilation TestReferenceCAS
! * @run main/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:-UseCompressedOops -XX:TieredStopAtLevel=1 TestReferenceCAS
! * @run main/othervm -Diters=20000 -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCHeuristics=aggressive -XX:+UseShenandoahGC -XX:-UseCompressedOops -XX:TieredStopAtLevel=4 TestReferenceCAS
*/
import java.lang.reflect.Field;
public class TestReferenceCAS {
static final int ITERS = Integer.getInteger("iters", 1);
static final int WEAK_ATTEMPTS = Integer.getInteger("weakAttempts", 10);
*** 68,79 ****
}
}
Object v;
! @Test
! public void testFieldInstance() {
TestReferenceCAS t = new TestReferenceCAS();
for (int c = 0; c < ITERS; c++) {
testAccess(t, V_OFFSET);
}
}
--- 66,88 ----
}
}
Object v;
! private static void assertEquals(boolean a, boolean b, String msg) {
! if (a != b) {
! throw new RuntimeException("a (" + a + ") != b (" + b + "): " + msg);
! }
! }
!
! private static void assertEquals(Object a, Object b, String msg) {
! if (!a.equals(b)) {
! throw new RuntimeException("a (" + a.toString() + ") != b (" + b.toString() + "): " + msg);
! }
! }
!
! public static void main(String[] args) {
TestReferenceCAS t = new TestReferenceCAS();
for (int c = 0; c < ITERS; c++) {
testAccess(t, V_OFFSET);
}
}
< prev index next >