test/hotspot/jtreg/compiler/rtm/locking/TestRTMSpinLoopCount.java
changeset 51148 959dbf7e96d0
parent 50369 09bd89dde2f9
child 51753 763aa4d1d596
equal deleted inserted replaced
51147:a1a53d240353 51148:959dbf7e96d0
    45 import compiler.testlibrary.rtm.RTMLockingStatistics;
    45 import compiler.testlibrary.rtm.RTMLockingStatistics;
    46 import compiler.testlibrary.rtm.RTMTestBase;
    46 import compiler.testlibrary.rtm.RTMTestBase;
    47 import jdk.test.lib.Asserts;
    47 import jdk.test.lib.Asserts;
    48 import jdk.test.lib.process.OutputAnalyzer;
    48 import jdk.test.lib.process.OutputAnalyzer;
    49 import jdk.test.lib.cli.CommandLineOptionTest;
    49 import jdk.test.lib.cli.CommandLineOptionTest;
       
    50 import jdk.test.lib.Platform;
    50 
    51 
    51 import java.util.List;
    52 import java.util.List;
    52 
    53 
    53 /**
    54 /**
    54  * Test verifies that RTMSpinLoopCount increase time spent between retries
    55  * Test verifies that RTMSpinLoopCount increase time spent between retries
    57 public class TestRTMSpinLoopCount {
    58 public class TestRTMSpinLoopCount {
    58     private static final int LOCKING_TIME = 1000;
    59     private static final int LOCKING_TIME = 1000;
    59     private static final int RTM_RETRY_COUNT = 1000;
    60     private static final int RTM_RETRY_COUNT = 1000;
    60     private static final boolean INFLATE_MONITOR = true;
    61     private static final boolean INFLATE_MONITOR = true;
    61     private static final long MAX_ABORTS = RTM_RETRY_COUNT + 1L;
    62     private static final long MAX_ABORTS = RTM_RETRY_COUNT + 1L;
    62     private static final int[] SPIN_LOOP_COUNTS
    63     private static int[] SPIN_LOOP_COUNTS;
    63             = new int[] { 0, 100, 1_000, 10_000, 100_000 };
       
    64 
    64 
    65     protected void runTestCases() throws Throwable {
    65     protected void runTestCases() throws Throwable {
       
    66 
       
    67         if (Platform.isPPC()) {
       
    68             SPIN_LOOP_COUNTS = new int[] { 0, 10, 100, 1_000, 10_000 };
       
    69         } else {
       
    70             SPIN_LOOP_COUNTS = new int[] { 0, 100, 1_000, 10_000, 100_000 };
       
    71         }
       
    72 
    66         long[] aborts = new long[TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length];
    73         long[] aborts = new long[TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length];
       
    74 
    67         for (int i = 0; i < TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length; i++) {
    75         for (int i = 0; i < TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length; i++) {
    68             aborts[i] = getAbortsCountOnLockBusy(
    76             aborts[i] = getAbortsCountOnLockBusy(
    69                     TestRTMSpinLoopCount.SPIN_LOOP_COUNTS[i]);
    77                     TestRTMSpinLoopCount.SPIN_LOOP_COUNTS[i]);
    70         }
    78         }
    71 
    79