changeset 4419:2302b1514e7e

set probability of nodes added to the cfg graph
author Lukas Stadler <lukas.stadler@jku.at>
date Tue, 31 Jan 2012 10:47:55 +0100
parents 46e9068c09b4
children e952b6c6949b 0bb7ab1add7e
files graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/StructuredGraph.java
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/StructuredGraph.java	Tue Jan 31 10:47:33 2012 +0100
+++ b/graal/com.oracle.max.graal.nodes/src/com/oracle/max/graal/nodes/StructuredGraph.java	Tue Jan 31 10:47:55 2012 +0100
@@ -173,6 +173,7 @@
 
     public void replaceFixedWithFixed(FixedWithNextNode node, FixedWithNextNode replacement) {
         assert node != null && replacement != null && node.isAlive() && replacement.isAlive() : "cannot replace " + node + " with " + replacement;
+        replacement.setProbability(node.probability());
         FixedNode next = node.next();
         node.setNext(null);
         replacement.setNext(next);
@@ -268,6 +269,7 @@
     public void addAfterFixed(FixedWithNextNode node, FixedWithNextNode newNode) {
         assert node != null && newNode != null && node.isAlive() && newNode.isAlive() : "cannot add " + newNode + " after " + node;
         assert newNode.next() == null;
+        newNode.setProbability(node.probability());
         FixedNode next = node.next();
         node.setNext(newNode);
         newNode.setNext(next);
@@ -277,6 +279,7 @@
         assert node != null && newNode != null && node.isAlive() && newNode.isAlive() : "cannot add " + newNode + " before " + node;
         assert node.predecessor() != null && node.predecessor() instanceof FixedWithNextNode : "cannot add " + newNode + " before " + node;
         assert newNode.next() == null;
+        newNode.setProbability(node.probability());
         FixedWithNextNode pred = (FixedWithNextNode) node.predecessor();
         pred.setNext(newNode);
         newNode.setNext(node);