test/compiler/rtm/locking/TestRTMLockingThreshold.java

Print this page

        

@@ -140,14 +140,11 @@
             return this.getClass().getName() + "::lock";
         }
 
         @Override
         public String[] getMethodsToCompileNames() {
-            return new String[] {
-                getMethodWithLockName(),
-                sun.misc.Unsafe.class.getName() + "::addressSize"
-            };
+            return new String[] { getMethodWithLockName() };
         }
 
         public void lock(boolean abort) {
             synchronized(monitor) {
                 if (abort) {

@@ -161,15 +158,16 @@
          * Test <inflate monitor>
          */
         public static void main(String args[]) throws Throwable {
             Asserts.assertGTE(args.length, 1, "One argument required.");
             Test t = new Test();
-
-            if (Boolean.valueOf(args[0])) {
+            boolean shouldBeInflated = Boolean.valueOf(args[0]);
+            if (shouldBeInflated) {
                 AbortProvoker.inflateMonitor(t.monitor);
             }
             for (int i = 0; i < Test.TOTAL_ITERATIONS; i++) {
+                AbortProvoker.verifyMonitorState(t.monitor, shouldBeInflated);
                 t.lock(i % 2 == 1);
             }
         }
     }