test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java
Print this page
@@ -49,11 +49,11 @@
* 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}.
+ * {@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,11 +98,10 @@
"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 {
@@ -110,14 +109,16 @@
"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();
}
}
}