use of org.graalvm.compiler.nodes.LoopBeginNode in project graal by oracle.
the class FixedNodeProbabilityCache method handleMerge.
private double handleMerge(FixedNode current, double probability) {
double result = probability;
AbstractMergeNode currentMerge = (AbstractMergeNode) current;
NodeInputList<EndNode> currentForwardEnds = currentMerge.forwardEnds();
/*
* Use simple iteration instead of streams, since the stream infrastructure adds many frames
* which causes the recursion to overflow the stack earlier than it would otherwise.
*/
for (AbstractEndNode endNode : currentForwardEnds) {
result += applyAsDouble(endNode);
}
if (current instanceof LoopBeginNode) {
result = multiplyProbabilities(result, ((LoopBeginNode) current).loopFrequency());
}
return result;
}
Aggregations