changeset 14971:63bc517c3543

BaselineCompiler: implement genIf.
author Josef Eisl <josef.eisl@jku.at>
date Thu, 03 Apr 2014 10:23:34 +0200
parents fe00ea6439be
children 0e111aab730c
files graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java
diffstat 1 files changed, 3 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java	Fri Apr 04 12:29:46 2014 +0200
+++ b/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java	Thu Apr 03 10:23:34 2014 +0200
@@ -390,21 +390,10 @@
             }
         }
 
-        // the mirroring and negation operations get the condition into canonical form
-        boolean mirror = cond.canonicalMirror();
-        boolean negate = cond.canonicalNegate();
-
-        Value a = mirror ? y : x;
-        Value b = mirror ? x : y;
+        LabelRef trueDestination = LabelRef.forSuccessor(lirGenRes.getLIR(), currentBlock, 0);
+        LabelRef falseDestination = LabelRef.forSuccessor(lirGenRes.getLIR(), currentBlock, 1);
 
-        LabelRef trueDestination = LabelRef.forSuccessor(lirGenRes.getLIR(), trueBlock, 0);
-        LabelRef falseDestination = LabelRef.forSuccessor(lirGenRes.getLIR(), falseBlock, 1);
-
-        if (negate) {
-            gen.emitCompareBranch(a.getKind(), a, b, cond, false, falseDestination, trueDestination, 1 - probability);
-        } else {
-            gen.emitCompareBranch(a.getKind(), a, b, cond, false, trueDestination, falseDestination, probability);
-        }
+        gen.emitCompareBranch(x.getKind(), x, y, cond, false, trueDestination, falseDestination, probability);
     }
 
     @Override