hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java
changeset 28394 6d382dc493e5
parent 28190 5a6b07edeb21
child 28498 c90265622ab7
equal deleted inserted replaced
28393:18701d7781e7 28394:6d382dc493e5
   115             return this.getClass().getName() + "::lock";
   115             return this.getClass().getName() + "::lock";
   116         }
   116         }
   117 
   117 
   118         @Override
   118         @Override
   119         public String[] getMethodsToCompileNames() {
   119         public String[] getMethodsToCompileNames() {
   120             return new String[] {
   120             return new String[] { getMethodWithLockName() };
   121                 getMethodWithLockName()
       
   122             };
       
   123         }
   121         }
   124 
   122 
   125         public void lock() {
   123         public void lock() {
   126             synchronized(monitor) {
   124             synchronized(monitor) {
   127                 Test.field++;
   125                 Test.field++;
   133          * Test <inflate monitor>
   131          * Test <inflate monitor>
   134          */
   132          */
   135         public static void main(String args[]) throws Throwable {
   133         public static void main(String args[]) throws Throwable {
   136             Asserts.assertGTE(args.length, 1, "One argument required.");
   134             Asserts.assertGTE(args.length, 1, "One argument required.");
   137             Test test = new Test();
   135             Test test = new Test();
   138 
   136             boolean shouldBeInflated = Boolean.valueOf(args[0]);
   139             if (Boolean.valueOf(args[0])) {
   137             if (shouldBeInflated) {
   140                 AbortProvoker.inflateMonitor(test.monitor);
   138                 AbortProvoker.inflateMonitor(test.monitor);
   141             }
   139             }
   142             for (long i = 0L; i < Test.TOTAL_ITERATIONS; i++) {
   140             for (long i = 0L; i < Test.TOTAL_ITERATIONS; i++) {
       
   141                 AbortProvoker.verifyMonitorState(test.monitor,
       
   142                         shouldBeInflated);
   143                 test.lock();
   143                 test.lock();
   144             }
   144             }
   145         }
   145         }
   146     }
   146     }
   147 
   147