test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java

Print this page

        

*** 49,59 **** * is inflated and the same compiled method invoked again. * * Compiled method invoked {@code AbortProvoker.DEFAULT_ITERATIONS} times before * lock inflation and the same amount of times after inflation. * As a result total locks count should be equal to ! * {@code 2*AbortProvoker.DEFAULT_ITERATIONS}. * It is a pretty strict assertion which could fail if some retriable abort * happened: it could be {@code AbortType.RETRIABLE} or * {@code AbortType.MEM_CONFLICT}, but unfortunately abort can has both these * reasons simultaneously. In order to avoid false negative failures related * to incorrect aborts counting, -XX:RTMRetryCount=0 is used. --- 49,59 ---- * is inflated and the same compiled method invoked again. * * Compiled method invoked {@code AbortProvoker.DEFAULT_ITERATIONS} times before * lock inflation and the same amount of times after inflation. * As a result total locks count should be equal to ! * {@code 2 * AbortProvoker.DEFAULT_ITERATIONS}. * It is a pretty strict assertion which could fail if some retriable abort * happened: it could be {@code AbortType.RETRIABLE} or * {@code AbortType.MEM_CONFLICT}, but unfortunately abort can has both these * reasons simultaneously. In order to avoid false negative failures related * to incorrect aborts counting, -XX:RTMRetryCount=0 is used.
*** 98,108 **** "Total lock count should be greater or equal to " + TestUseRTMAfterLockInflation.EXPECTED_LOCKS); } public static class Test { - /** * Usage: * Test <provoker type> */ public static void main(String args[]) throws Throwable { --- 98,107 ----
*** 110,123 **** --- 109,124 ---- "AbortType name is expected as first argument."); AbortProvoker provoker = AbortType.lookup(Integer.valueOf(args[0])).provoker(); for (int i = 0; i < AbortProvoker.DEFAULT_ITERATIONS; i++) { + AbortProvoker.verifyMonitorState(provoker, false /*deflated*/); provoker.forceAbort(); } provoker.inflateMonitor(); for (int i = 0; i < AbortProvoker.DEFAULT_ITERATIONS; i++) { + AbortProvoker.verifyMonitorState(provoker, true /*inflated*/); provoker.forceAbort(); } } }