# HG changeset patch # User Stefan Anzinger # Date 1409703593 25200 # Node ID b44535d38d647d35f3997fb9c4e984696d9929dd # Parent 8adf60d5ce73053070303832a49be4d55b9bc87a Eliminate the recursion over lambda expression as it generates a huge stack which may cause stack overflow earlier as it should be diff -r 8adf60d5ce73 -r b44535d38d64 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/FixedNodeProbabilityCache.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/FixedNodeProbabilityCache.java Tue Sep 02 17:18:35 2014 -0700 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/FixedNodeProbabilityCache.java Tue Sep 02 17:19:53 2014 -0700 @@ -104,11 +104,10 @@ if (current instanceof MergeNode) { MergeNode currentMerge = (MergeNode) current; NodeInputList currentForwardEnds = currentMerge.forwardEnds(); + // Using simple iteration instead of lambda as the lambda blows up the stack for (AbstractEndNode endNode : currentForwardEnds) { probability += applyAsDouble(endNode); } - // probability = ((MergeNode) -// current).forwardEnds().stream().mapToDouble(this::applyAsDouble).sum(); if (current instanceof LoopBeginNode) { probability *= ((LoopBeginNode) current).loopFrequency(); }