diff graal/GraalCompiler/src/com/sun/c1x/ir/Logic.java @ 2853:0635ba16afe4

Reintroduce Logic subclasses, creating some Canonicalization related classes
author Gilles Duboscq <gilles.duboscq@oracle.com>
date Tue, 07 Jun 2011 15:52:55 +0200
parents c6bdec623ef9
children
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Logic.java	Tue Jun 07 12:10:27 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Logic.java	Tue Jun 07 15:52:55 2011 +0200
@@ -24,13 +24,12 @@
 
 import com.oracle.graal.graph.*;
 import com.sun.c1x.debug.*;
-import com.sun.cri.bytecode.*;
 import com.sun.cri.ci.*;
 
 /**
  * The {@code LogicOp} class definition.
  */
-public final class Logic extends Binary {
+public abstract class Logic extends Binary {
 
     private static final int INPUT_COUNT = 0;
     private static final int SUCCESSOR_COUNT = 0;
@@ -41,13 +40,8 @@
      * @param x the first input into this instruction
      * @param y the second input into this instruction
      */
-    public Logic(int opcode, Value x, Value y, Graph graph) {
-        super(x.kind, opcode, x, y, INPUT_COUNT, SUCCESSOR_COUNT, graph);
-    }
-
-    // for copying
-    private Logic(CiKind kind, int opcode, Graph graph) {
-        super(kind, opcode, null, null, INPUT_COUNT, SUCCESSOR_COUNT, graph);
+    public Logic(CiKind kind, int opcode, Value x, Value y, Graph graph) {
+        super(kind, opcode, x, y, INPUT_COUNT, SUCCESSOR_COUNT, graph);
     }
 
     @Override
@@ -57,12 +51,9 @@
 
     @Override
     public void print(LogStream out) {
-        out.print(x()).print(' ').print(Bytecodes.operator(opcode)).print(' ').print(y());
+        out.print(x()).print(' ').print(this.shortName()).print(' ').print(y());
     }
 
     @Override
-    public Node copy(Graph into) {
-        Logic x = new Logic(kind, opcode, into);
-        return x;
-    }
+    public abstract String shortName();
 }