22 * 23 */ 24 25 /** 26 * @test 27 * @bug 8031320 28 * @summary Verify that rtm locking is used for stack locks before 29 * inflation and after it used for inflated locks. 30 * @library /testlibrary /../../test/lib /compiler/testlibrary 31 * @modules java.base/sun.misc 32 * java.management 33 * @build TestUseRTMAfterLockInflation 34 * @run main ClassFileInstaller sun.hotspot.WhiteBox 35 * sun.hotspot.WhiteBox$WhiteBoxPermission 36 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions 37 * -XX:+WhiteBoxAPI TestUseRTMAfterLockInflation 38 */ 39 40 import java.util.List; 41 42 import com.oracle.java.testlibrary.*; 43 import com.oracle.java.testlibrary.cli.CommandLineOptionTest; 44 import com.oracle.java.testlibrary.cli.predicate.AndPredicate; 45 import rtm.*; 46 import rtm.predicate.SupportedCPU; 47 import rtm.predicate.SupportedVM; 48 49 /** 50 * Test verifies that RTM is used after lock inflation by executing compiled 51 * method with RTM-based lock elision using stack lock first, then that lock 52 * is inflated and the same compiled method invoked again. 53 * 54 * Compiled method invoked {@code AbortProvoker.DEFAULT_ITERATIONS} times before 55 * lock inflation and the same amount of times after inflation. 56 * As a result total locks count should be equal to 57 * {@code 2 * AbortProvoker.DEFAULT_ITERATIONS}. 58 * It is a pretty strict assertion which could fail if some retriable abort 59 * happened: it could be {@code AbortType.RETRIABLE} or 60 * {@code AbortType.MEM_CONFLICT}, but unfortunately abort can has both these 61 * reasons simultaneously. In order to avoid false negative failures related 62 * to incorrect aborts counting, -XX:RTMRetryCount=0 is used. 63 */ 64 public class TestUseRTMAfterLockInflation extends CommandLineOptionTest { | 22 * 23 */ 24 25 /** 26 * @test 27 * @bug 8031320 28 * @summary Verify that rtm locking is used for stack locks before 29 * inflation and after it used for inflated locks. 30 * @library /testlibrary /../../test/lib /compiler/testlibrary 31 * @modules java.base/sun.misc 32 * java.management 33 * @build TestUseRTMAfterLockInflation 34 * @run main ClassFileInstaller sun.hotspot.WhiteBox 35 * sun.hotspot.WhiteBox$WhiteBoxPermission 36 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions 37 * -XX:+WhiteBoxAPI TestUseRTMAfterLockInflation 38 */ 39 40 import java.util.List; 41 42 import jdk.test.lib.*; 43 import jdk.test.lib.cli.CommandLineOptionTest; 44 import jdk.test.lib.cli.predicate.AndPredicate; 45 import rtm.*; 46 import rtm.predicate.SupportedCPU; 47 import rtm.predicate.SupportedVM; 48 49 /** 50 * Test verifies that RTM is used after lock inflation by executing compiled 51 * method with RTM-based lock elision using stack lock first, then that lock 52 * is inflated and the same compiled method invoked again. 53 * 54 * Compiled method invoked {@code AbortProvoker.DEFAULT_ITERATIONS} times before 55 * lock inflation and the same amount of times after inflation. 56 * As a result total locks count should be equal to 57 * {@code 2 * AbortProvoker.DEFAULT_ITERATIONS}. 58 * It is a pretty strict assertion which could fail if some retriable abort 59 * happened: it could be {@code AbortType.RETRIABLE} or 60 * {@code AbortType.MEM_CONFLICT}, but unfortunately abort can has both these 61 * reasons simultaneously. In order to avoid false negative failures related 62 * to incorrect aborts counting, -XX:RTMRetryCount=0 is used. 63 */ 64 public class TestUseRTMAfterLockInflation extends CommandLineOptionTest { |