Mercurial > hg > truffle
annotate test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java @ 21274:d2f314708067
added extra test for arraycopy snippet using StubRoutines::_checkcast_arraycopy
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 08 May 2015 17:51:04 +0200 |
parents | ba8268c23fa2 |
children |
rev | line source |
---|---|
17873
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
1 /* |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
4 * |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
8 * |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
13 * accompanied this code). |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
14 * |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
18 * |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
21 * questions. |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
22 * |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
23 */ |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
24 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
25 /** |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
26 * @test |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
27 * @bug 8031320 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
28 * @summary Verify that on low abort ratio method will be recompiled. |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
29 * @library /testlibrary /testlibrary/whitebox /compiler/testlibrary |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
30 * @build TestRTMDeoptOnLowAbortRatio |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
31 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
32 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
33 * -XX:+WhiteBoxAPI TestRTMDeoptOnLowAbortRatio |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
34 */ |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
35 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
36 import java.util.List; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
37 import com.oracle.java.testlibrary.*; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
38 import com.oracle.java.testlibrary.cli.CommandLineOptionTest; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
39 import com.oracle.java.testlibrary.cli.predicate.AndPredicate; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
40 import rtm.*; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
41 import rtm.predicate.SupportedCPU; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
42 import rtm.predicate.SupportedVM; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
43 import sun.misc.Unsafe; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
44 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
45 /** |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
46 * Test verifies that low abort ratio method will be deoptimized with |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
47 * <i>rtm_state_change</i> reason and will continue to use RTM-based lock |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
48 * elision after that. |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
49 * This test make asserts on total locks count done by compiled method, |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
50 * so in order to avoid issue with retriable locks -XX:RTMRetryCount=0 is used. |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
51 * For more details on that issue see {@link TestUseRTMAfterLockInflation}. |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
52 */ |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
53 public class TestRTMDeoptOnLowAbortRatio extends CommandLineOptionTest { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
54 private static final long LOCKING_THRESHOLD = 100L; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
55 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
56 private TestRTMDeoptOnLowAbortRatio() { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
57 super(new AndPredicate(new SupportedCPU(), new SupportedVM())); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
58 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
59 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
60 @Override |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
61 protected void runTestCases() throws Throwable { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
62 verifyRTMDeopt(false); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
63 verifyRTMDeopt(true); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
64 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
65 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
66 private void verifyRTMDeopt(boolean useStackLock) throws Throwable { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
67 CompilableTest test = new Test(); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
68 String logFileName = String.format("rtm_deopt_%s_stack_lock.xml", |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
69 useStackLock ? "use" : "no"); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
70 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
71 OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest( |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
72 logFileName, |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
73 test, |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
74 "-XX:+UseRTMDeopt", |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
75 CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks", |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
76 useStackLock), |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
77 CommandLineOptionTest.prepareNumericFlag("RTMLockingThreshold", |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
78 TestRTMDeoptOnLowAbortRatio.LOCKING_THRESHOLD), |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
79 "-XX:RTMAbortThreshold=1", |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
80 "-XX:RTMAbortRatio=100", |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
81 "-XX:CompileThreshold=1", |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
82 "-XX:RTMRetryCount=0", |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
83 "-XX:RTMTotalCountIncrRate=1", |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
84 "-XX:+PrintPreciseRTMLockingStatistics", |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
85 Test.class.getName(), |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
86 Boolean.toString(!useStackLock) |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
87 ); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
88 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
89 outputAnalyzer.shouldHaveExitValue(0); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
90 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
91 int firedTraps = RTMTestBase.firedRTMStateChangeTraps(logFileName); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
92 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
93 Asserts.assertEQ(firedTraps, 1, |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
94 "Expected to get only one deoptimization due to rtm" |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
95 + " state change"); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
96 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
97 List<RTMLockingStatistics> statistics = RTMLockingStatistics.fromString( |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
98 test.getMethodWithLockName(), outputAnalyzer.getOutput()); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
99 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
100 Asserts.assertEQ(statistics.size(), 2, |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
101 "VM output should contain two RTM locking " |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
102 + "statistics entries for method " |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
103 + test.getMethodWithLockName()); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
104 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
105 RTMLockingStatistics statisticsBeforeDeopt = null; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
106 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
107 for (RTMLockingStatistics s : statistics) { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
108 if (s.getTotalLocks() |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
109 == TestRTMDeoptOnLowAbortRatio.LOCKING_THRESHOLD + 1L) { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
110 Asserts.assertNull(statisticsBeforeDeopt, |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
111 "Only one abort was expected during test run"); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
112 statisticsBeforeDeopt = s; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
113 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
114 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
115 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
116 Asserts.assertNotNull(statisticsBeforeDeopt, |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
117 "After LockThreshold was reached, method should be recompiled " |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
118 + "with rtm lock eliding."); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
119 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
120 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
121 public static class Test implements CompilableTest { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
122 private static final Unsafe UNSAFE = Utils.getUnsafe(); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
123 private final Object monitor = new Object(); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
124 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
125 @Override |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
126 public String getMethodWithLockName() { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
127 return this.getClass().getName() + "::forceAbort"; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
128 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
129 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
130 @Override |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
131 public String[] getMethodsToCompileNames() { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
132 return new String[] { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
133 getMethodWithLockName(), |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
134 sun.misc.Unsafe.class.getName() + "::addressSize" |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
135 }; |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
136 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
137 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
138 public void forceAbort(boolean abort) { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
139 synchronized(monitor) { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
140 if (abort) { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
141 Test.UNSAFE.addressSize(); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
142 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
143 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
144 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
145 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
146 /** |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
147 * Usage: |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
148 * Test <inflate monitor> |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
149 */ |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
150 public static void main(String args[]) throws Throwable { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
151 Asserts.assertGTE(args.length, 1, "One argument required."); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
152 Test t = new Test(); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
153 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
154 if (Boolean.valueOf(args[0])) { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
155 AbortProvoker.inflateMonitor(t.monitor); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
156 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
157 for (int i = 0; i < AbortProvoker.DEFAULT_ITERATIONS; i++) { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
158 t.forceAbort( |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
159 i == TestRTMDeoptOnLowAbortRatio.LOCKING_THRESHOLD); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
160 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
161 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
162 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
163 |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
164 public static void main(String args[]) throws Throwable { |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
165 new TestRTMDeoptOnLowAbortRatio().test(); |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
166 } |
ba8268c23fa2
8037860: Add tests to cover Intel RTM instructions support
iignatyev
parents:
diff
changeset
|
167 } |