use of com.oracle.truffle.api.nodes.RootNode in project graal by oracle.
the class OptimizedOSRLoopNode method compileImpl.
private OptimizedCallTarget compileImpl(VirtualFrame frame) {
RootNode root = getRootNode();
Node parent = getParent();
if (speculationLog == null) {
speculationLog = GraalTruffleRuntime.getRuntime().createSpeculationLog();
}
OptimizedCallTarget osrTarget = (OptimizedCallTarget) GraalTruffleRuntime.getRuntime().createCallTarget(createRootNodeImpl(root, frame.getClass()));
osrTarget.setSpeculationLog(speculationLog);
// let the old parent re-adopt the children
parent.adoptChildren();
osrTarget.compile();
return osrTarget;
}
use of com.oracle.truffle.api.nodes.RootNode in project graal by oracle.
the class OptimizedOSRLoopNode method forceOSR.
/**
* Forces OSR compilation for this loop.
*/
public final void forceOSR() {
baseLoopCount = getThreshold();
RootNode rootNode = getRootNode();
VirtualFrame dummyFrame = Truffle.getRuntime().createVirtualFrame(new Object[0], rootNode != null ? rootNode.getFrameDescriptor() : new FrameDescriptor());
compileLoop(dummyFrame);
}
use of com.oracle.truffle.api.nodes.RootNode in project graal by oracle.
the class GraalTVMCI method onLoopCount.
@Override
public void onLoopCount(Node source, int count) {
Node node = source;
Node parentNode = source != null ? source.getParent() : null;
while (node != null) {
if (node instanceof OptimizedOSRLoopNode) {
((OptimizedOSRLoopNode) node).reportChildLoopCount(count);
}
parentNode = node;
node = node.getParent();
}
if (parentNode != null && parentNode instanceof RootNode) {
CallTarget target = ((RootNode) parentNode).getCallTarget();
if (target instanceof OptimizedCallTarget) {
((OptimizedCallTarget) target).onLoopCount(count);
}
}
}
use of com.oracle.truffle.api.nodes.RootNode in project graal by oracle.
the class GraalTVMCI method reportPolymorphicSpecialize.
@Override
protected void reportPolymorphicSpecialize(Node source) {
if (TruffleCompilerOptions.getValue(TruffleCompilerOptions.TruffleExperimentalSplitting)) {
TruffleSplittingStrategy.newPolymorphicSpecialize(source);
final RootNode rootNode = source.getRootNode();
final OptimizedCallTarget callTarget = rootNode == null ? null : (OptimizedCallTarget) rootNode.getCallTarget();
if (callTarget != null) {
callTarget.polymorphicSpecialize(source);
}
}
}
use of com.oracle.truffle.api.nodes.RootNode in project graal by oracle.
the class DebugStackFrame method wrapHeapValue.
DebugValue wrapHeapValue(Object result) {
LanguageInfo language;
RootNode root = findCurrentRoot();
if (root != null) {
language = root.getLanguageInfo();
} else {
language = null;
}
return new HeapValue(event.getSession().getDebugger(), language, null, result);
}
Aggregations