Skip to content

Commit 072291c

Browse files
committed
Make OSR tests more robust.
1 parent 8e0b9db commit 072291c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/BytecodeOSRNodeTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,6 @@ public void testOSRPolling() {
351351
RootNode rootNode = new Program(osrNode, new FrameDescriptor());
352352
OptimizedCallTarget target = (OptimizedCallTarget) rootNode.getCallTarget();
353353
Assert.assertEquals(42, target.call());
354-
BytecodeOSRMetadata osrMetadata = osrNode.getGraalOSRMetadata();
355-
int backEdgeCount = osrMetadata.getBackEdgeCount();
356-
Assert.assertTrue(backEdgeCount > OSR_THRESHOLD);
357-
Assert.assertEquals(0, backEdgeCount % BytecodeOSRMetadata.OSR_POLL_INTERVAL);
358354
}
359355

360356
/*
@@ -806,6 +802,9 @@ void assertDoubleEquals(double expected, double actual) {
806802
public static class InfiniteInterpreterLoop extends BytecodeOSRTestNode {
807803
@Override
808804
public Object executeOSR(VirtualFrame osrFrame, int target, Object interpreterState) {
805+
if (CompilerDirectives.inCompiledCode()) {
806+
return 42;
807+
}
809808
return execute(osrFrame);
810809
}
811810

@@ -814,7 +813,8 @@ public Object execute(VirtualFrame frame) {
814813
// This node only terminates in compiled code.
815814
while (true) {
816815
if (CompilerDirectives.inCompiledCode()) {
817-
return 42;
816+
// must never happen
817+
return 41;
818818
}
819819
if (BytecodeOSRNode.pollOSRBackEdge(this)) {
820820
Object result = BytecodeOSRNode.tryOSR(this, DEFAULT_TARGET, null, null, frame);

0 commit comments

Comments
 (0)