Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/ir/NegateOp.java @ 2827:bd17ac598c6e
Graph cloning, initial version (not completely working)
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Mon, 30 May 2011 18:46:57 +0200 |
parents | 5526d82388be |
children | bfce42cd9c07 caf55daa41dc |
comparison
equal
deleted
inserted
replaced
2821:015be60afcf3 | 2827:bd17ac598c6e |
---|---|
24 | 24 |
25 import com.oracle.graal.graph.*; | 25 import com.oracle.graal.graph.*; |
26 import com.sun.c1x.debug.*; | 26 import com.sun.c1x.debug.*; |
27 import com.sun.c1x.util.*; | 27 import com.sun.c1x.util.*; |
28 import com.sun.cri.bytecode.*; | 28 import com.sun.cri.bytecode.*; |
29 import com.sun.cri.ci.*; | |
29 | 30 |
30 /** | 31 /** |
31 * The {@code NegateOp} instruction negates its operand. | 32 * The {@code NegateOp} instruction negates its operand. |
32 */ | 33 */ |
33 public final class NegateOp extends Value { | 34 public final class NegateOp extends Value { |
66 public NegateOp(Value x, Graph graph) { | 67 public NegateOp(Value x, Graph graph) { |
67 super(x.kind, INPUT_COUNT, SUCCESSOR_COUNT, graph); | 68 super(x.kind, INPUT_COUNT, SUCCESSOR_COUNT, graph); |
68 setX(x); | 69 setX(x); |
69 } | 70 } |
70 | 71 |
72 private NegateOp(CiKind kind, Graph graph) { | |
73 super(kind, INPUT_COUNT, SUCCESSOR_COUNT, graph); | |
74 } | |
75 | |
71 @Override | 76 @Override |
72 public void accept(ValueVisitor v) { | 77 public void accept(ValueVisitor v) { |
73 v.visitNegateOp(this); | 78 v.visitNegateOp(this); |
74 } | 79 } |
75 | 80 |
89 | 94 |
90 @Override | 95 @Override |
91 public void print(LogStream out) { | 96 public void print(LogStream out) { |
92 out.print("- ").print(x()); | 97 out.print("- ").print(x()); |
93 } | 98 } |
99 | |
100 @Override | |
101 public Node copy(Graph into) { | |
102 NegateOp x = new NegateOp(kind, into); | |
103 x.setNonNull(isNonNull()); | |
104 return x; | |
105 } | |
94 } | 106 } |