Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-34954] Make OSR tests more robust. #10814

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -351,10 +351,6 @@ public void testOSRPolling() {
RootNode rootNode = new Program(osrNode, new FrameDescriptor());
OptimizedCallTarget target = (OptimizedCallTarget) rootNode.getCallTarget();
Assert.assertEquals(42, target.call());
BytecodeOSRMetadata osrMetadata = osrNode.getGraalOSRMetadata();
int backEdgeCount = osrMetadata.getBackEdgeCount();
Assert.assertTrue(backEdgeCount > OSR_THRESHOLD);
Assert.assertEquals(0, backEdgeCount % BytecodeOSRMetadata.OSR_POLL_INTERVAL);
}

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

@@ -814,7 +813,8 @@ public Object execute(VirtualFrame frame) {
// This node only terminates in compiled code.
while (true) {
if (CompilerDirectives.inCompiledCode()) {
return 42;
// must never happen
return 41;
}
if (BytecodeOSRNode.pollOSRBackEdge(this)) {
Object result = BytecodeOSRNode.tryOSR(this, DEFAULT_TARGET, null, null, frame);
Loading
Oops, something went wrong.