changeset 17027:b44535d38d64

Eliminate the recursion over lambda expression as it generates a huge stack which may cause stack overflow earlier as it should be
author Stefan Anzinger <stefan.anzinger@oracle.com>
date Tue, 02 Sep 2014 17:19:53 -0700
parents 8adf60d5ce73
children dc293c1d969c
files graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/FixedNodeProbabilityCache.java
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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<AbstractEndNode> 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();
                 }