23 */ 24 25 /** 26 * @test 27 * @bug 8031320 28 * @summary Verify that if we use RTMDeopt, then deoptimization 29 * caused by reason other then rtm_state_change will reset 30 * method's RTM state. And if we don't use RTMDeopt, then 31 * RTM state remain the same after such deoptimization. 32 * @library /testlibrary /../../test/lib /compiler/testlibrary 33 * @modules java.base/sun.misc 34 * java.management 35 * @build TestRTMAfterNonRTMDeopt 36 * @run main ClassFileInstaller sun.hotspot.WhiteBox 37 * sun.hotspot.WhiteBox$WhiteBoxPermission 38 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions 39 * -XX:+WhiteBoxAPI TestRTMAfterNonRTMDeopt 40 */ 41 42 import java.util.List; 43 import com.oracle.java.testlibrary.*; 44 import com.oracle.java.testlibrary.cli.CommandLineOptionTest; 45 import com.oracle.java.testlibrary.cli.predicate.AndPredicate; 46 import rtm.*; 47 import rtm.predicate.SupportedCPU; 48 import rtm.predicate.SupportedVM; 49 import sun.misc.Unsafe; 50 51 /** 52 * To verify that with +UseRTMDeopt method's RTM state will be 53 * changed to ProfileRTM on deoptimization unrelated to 54 * rtm_state_change following sequence of events is used: 55 * <pre> 56 * 57 * rtm state ^ 58 * | 59 * UseRTM | ******| ****** 60 * | | 61 * ProfileRTM |******| |*****| 62 * | | | | 63 * 0-------|-----|-----|---------------------> time 64 * | | \ force abort 65 * | | | 23 */ 24 25 /** 26 * @test 27 * @bug 8031320 28 * @summary Verify that if we use RTMDeopt, then deoptimization 29 * caused by reason other then rtm_state_change will reset 30 * method's RTM state. And if we don't use RTMDeopt, then 31 * RTM state remain the same after such deoptimization. 32 * @library /testlibrary /../../test/lib /compiler/testlibrary 33 * @modules java.base/sun.misc 34 * java.management 35 * @build TestRTMAfterNonRTMDeopt 36 * @run main ClassFileInstaller sun.hotspot.WhiteBox 37 * sun.hotspot.WhiteBox$WhiteBoxPermission 38 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions 39 * -XX:+WhiteBoxAPI TestRTMAfterNonRTMDeopt 40 */ 41 42 import java.util.List; 43 import jdk.test.lib.*; 44 import jdk.test.lib.cli.CommandLineOptionTest; 45 import jdk.test.lib.cli.predicate.AndPredicate; 46 import rtm.*; 47 import rtm.predicate.SupportedCPU; 48 import rtm.predicate.SupportedVM; 49 import sun.misc.Unsafe; 50 51 /** 52 * To verify that with +UseRTMDeopt method's RTM state will be 53 * changed to ProfileRTM on deoptimization unrelated to 54 * rtm_state_change following sequence of events is used: 55 * <pre> 56 * 57 * rtm state ^ 58 * | 59 * UseRTM | ******| ****** 60 * | | 61 * ProfileRTM |******| |*****| 62 * | | | | 63 * 0-------|-----|-----|---------------------> time 64 * | | \ force abort 65 * | | |