Mercurial > hg > graal-jvmci-8
comparison test/compiler/rtm/locking/TestRTMAbortRatio.java @ 22994:9041e030d11f
8050486: compiler/rtm/ tests fail due to monitor deflation at safepoint synchronization
Reviewed-by: kvn, iignatyev
author | bmoloden |
---|---|
date | Thu, 30 Apr 2015 12:06:39 -0700 |
parents | ba8268c23fa2 |
children |
comparison
equal
deleted
inserted
replaced
22993:e9a7f132cec3 | 22994:9041e030d11f |
---|---|
124 return this.getClass().getName() + "::lock"; | 124 return this.getClass().getName() + "::lock"; |
125 } | 125 } |
126 | 126 |
127 @Override | 127 @Override |
128 public String[] getMethodsToCompileNames() { | 128 public String[] getMethodsToCompileNames() { |
129 return new String[] { | 129 return new String[] { getMethodWithLockName() }; |
130 getMethodWithLockName(), | |
131 Unsafe.class.getName() + "::addressSize" | |
132 }; | |
133 } | 130 } |
134 | 131 |
135 public void lock(boolean abort) { | 132 public void lock(boolean abort) { |
136 synchronized(monitor) { | 133 synchronized(monitor) { |
137 if (abort) { | 134 if (abort) { |
145 * Test <inflate monitor> | 142 * Test <inflate monitor> |
146 */ | 143 */ |
147 public static void main(String args[]) throws Throwable { | 144 public static void main(String args[]) throws Throwable { |
148 Asserts.assertGTE(args.length, 1, "One argument required."); | 145 Asserts.assertGTE(args.length, 1, "One argument required."); |
149 Test t = new Test(); | 146 Test t = new Test(); |
150 if (Boolean.valueOf(args[0])) { | 147 boolean shouldBeInflated = Boolean.valueOf(args[0]); |
148 if (shouldBeInflated) { | |
151 AbortProvoker.inflateMonitor(t.monitor); | 149 AbortProvoker.inflateMonitor(t.monitor); |
152 } | 150 } |
153 for (int i = 0; i < Test.TOTAL_ITERATIONS; i++) { | 151 for (int i = 0; i < Test.TOTAL_ITERATIONS; i++) { |
152 AbortProvoker.verifyMonitorState(t.monitor, shouldBeInflated); | |
154 t.lock(i >= Test.WARMUP_ITERATIONS); | 153 t.lock(i >= Test.WARMUP_ITERATIONS); |
155 } | 154 } |
156 } | 155 } |
157 } | 156 } |
158 | 157 |