< prev index next >
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java
Print this page
@@ -51,10 +51,15 @@
@Test
public void testOSR03() {
testOSR(getInitialOptions(), "testNonReduceLoop");
}
+ @Test
+ public void testOSR04() {
+ testOSR(getInitialOptions(), "testDeoptAfterCountedLoop");
+ }
+
static int limit = 10000;
public static int sideEffect;
public static ReturnValue testReduceLoop() {
@@ -98,6 +103,16 @@
}
}
GraalDirectives.controlFlowAnchor();
return ret;
}
+
+ public static ReturnValue testDeoptAfterCountedLoop() {
+ long ret = 0;
+ for (int i = 0; GraalDirectives.injectBranchProbability(1, i < limit * limit); i++) {
+ GraalDirectives.blackhole(i);
+ ret = GraalDirectives.opaque(i);
+ }
+ GraalDirectives.controlFlowAnchor();
+ return ret + 1 == limit * limit ? ReturnValue.SUCCESS : ReturnValue.FAILURE;
+ }
}
< prev index next >