use of com.oracle.truffle.api.nodes.LoopNode in project graal by oracle.
the class OptimizedCallTargetTest method testCompileOnly5.
@Test
public void testCompileOnly5() {
// OSR should trigger if compile-only with excludes
try (TruffleOptionsOverrideScope scope = TruffleCompilerOptions.overrideOptions(TruffleCompileOnly, "~foobar")) {
final OSRRepeatingNode repeating = new OSRRepeatingNode(TruffleCompilerOptions.getValue(TruffleOSRCompilationThreshold));
final LoopNode loop = runtime.createLoopNode(repeating);
OptimizedCallTarget target = (OptimizedCallTarget) runtime.createCallTarget(new NamedRootNode("foobar") {
@Child
LoopNode loopChild = loop;
@Override
public Object execute(VirtualFrame frame) {
loopChild.executeLoop(frame);
return super.execute(frame);
}
});
target.call();
OptimizedCallTarget osrTarget = findOSRTarget(loop);
assertCompiled(osrTarget);
}
}
use of com.oracle.truffle.api.nodes.LoopNode in project graal by oracle.
the class OptimizedCallTargetTest method testCompileOnly4.
@Test
public void testCompileOnly4() {
// OSR should not trigger for compile-only includes
try (TruffleOptionsOverrideScope scope = TruffleCompilerOptions.overrideOptions(TruffleCompileOnly, "foobar")) {
final OSRRepeatingNode repeating = new OSRRepeatingNode(TruffleCompilerOptions.getValue(TruffleOSRCompilationThreshold));
final LoopNode loop = runtime.createLoopNode(repeating);
OptimizedCallTarget target = (OptimizedCallTarget) runtime.createCallTarget(new NamedRootNode("foobar") {
@Child
LoopNode loopChild = loop;
@Override
public Object execute(VirtualFrame frame) {
loopChild.executeLoop(frame);
return super.execute(frame);
}
});
target.call();
OptimizedCallTarget osrTarget = findOSRTarget(loop);
if (osrTarget != null) {
assertNotCompiled(osrTarget);
}
}
}
Aggregations