21 * questions. 22 * 23 */ 24 25 /** 26 * @test 27 * @bug 8031320 28 * @summary Verify that rtm locking is used for inflated locks. 29 * @library /testlibrary /../../test/lib /compiler/testlibrary 30 * @modules java.base/sun.misc 31 * java.management 32 * @build TestUseRTMForInflatedLocks 33 * @run main ClassFileInstaller sun.hotspot.WhiteBox 34 * sun.hotspot.WhiteBox$WhiteBoxPermission 35 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions 36 * -XX:+WhiteBoxAPI TestUseRTMForInflatedLocks 37 */ 38 39 import java.util.List; 40 41 import com.oracle.java.testlibrary.*; 42 import com.oracle.java.testlibrary.cli.CommandLineOptionTest; 43 import com.oracle.java.testlibrary.cli.predicate.AndPredicate; 44 import rtm.*; 45 import rtm.predicate.SupportedCPU; 46 import rtm.predicate.SupportedVM; 47 48 /** 49 * Test verifies that RTM-based lock elision could be used for inflated locks 50 * by calling compiled method that use RTM-based lock elision and using 51 * manually inflated lock. 52 * Compiled method invoked {@code AbortProvoker.DEFAULT_ITERATIONS} times, 53 * so total locks count should be the same. 54 * This test could also be affected by retriable aborts, so -XX:RTMRetryCount=0 55 * is used. For more information abort that issue see 56 * {@link TestUseRTMAfterLockInflation}. 57 */ 58 public class TestUseRTMForInflatedLocks extends CommandLineOptionTest { 59 private TestUseRTMForInflatedLocks() { 60 super(new AndPredicate(new SupportedCPU(), new SupportedVM())); 61 } 62 63 @Override | 21 * questions. 22 * 23 */ 24 25 /** 26 * @test 27 * @bug 8031320 28 * @summary Verify that rtm locking is used for inflated locks. 29 * @library /testlibrary /../../test/lib /compiler/testlibrary 30 * @modules java.base/sun.misc 31 * java.management 32 * @build TestUseRTMForInflatedLocks 33 * @run main ClassFileInstaller sun.hotspot.WhiteBox 34 * sun.hotspot.WhiteBox$WhiteBoxPermission 35 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions 36 * -XX:+WhiteBoxAPI TestUseRTMForInflatedLocks 37 */ 38 39 import java.util.List; 40 41 import jdk.test.lib.*; 42 import jdk.test.lib.cli.CommandLineOptionTest; 43 import jdk.test.lib.cli.predicate.AndPredicate; 44 import rtm.*; 45 import rtm.predicate.SupportedCPU; 46 import rtm.predicate.SupportedVM; 47 48 /** 49 * Test verifies that RTM-based lock elision could be used for inflated locks 50 * by calling compiled method that use RTM-based lock elision and using 51 * manually inflated lock. 52 * Compiled method invoked {@code AbortProvoker.DEFAULT_ITERATIONS} times, 53 * so total locks count should be the same. 54 * This test could also be affected by retriable aborts, so -XX:RTMRetryCount=0 55 * is used. For more information abort that issue see 56 * {@link TestUseRTMAfterLockInflation}. 57 */ 58 public class TestUseRTMForInflatedLocks extends CommandLineOptionTest { 59 private TestUseRTMForInflatedLocks() { 60 super(new AndPredicate(new SupportedCPU(), new SupportedVM())); 61 } 62 63 @Override |