Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/ir/NullCheck.java @ 2834:bfce42cd9c07
Graph duplication now passes all tests
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Tue, 31 May 2011 13:34:52 +0200 |
parents | bd17ac598c6e |
children | c1c8a0291771 |
comparison
equal
deleted
inserted
replaced
2829:27c00b180416 | 2834:bfce42cd9c07 |
---|---|
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 import com.sun.cri.ri.*; | 30 import com.sun.cri.ri.*; |
30 | 31 |
31 /** | 32 /** |
32 * The {@code NullCheck} class represents an explicit null check instruction. | 33 * The {@code NullCheck} class represents an explicit null check instruction. |
33 */ | 34 */ |
69 super(object.kind, INPUT_COUNT, SUCCESSOR_COUNT, graph); | 70 super(object.kind, INPUT_COUNT, SUCCESSOR_COUNT, graph); |
70 setNonNull(true); | 71 setNonNull(true); |
71 setObject(object); | 72 setObject(object); |
72 } | 73 } |
73 | 74 |
75 // for copying | |
76 private NullCheck(CiKind kind, Graph graph) { | |
77 super(kind, INPUT_COUNT, SUCCESSOR_COUNT, graph); | |
78 setNonNull(true); | |
79 } | |
80 | |
74 @Override | 81 @Override |
75 public void accept(ValueVisitor v) { | 82 public void accept(ValueVisitor v) { |
76 v.visitNullCheck(this); | 83 v.visitNullCheck(this); |
77 } | 84 } |
78 | 85 |
107 out.print("null_check(").print(object()).print(')'); | 114 out.print("null_check(").print(object()).print(')'); |
108 } | 115 } |
109 | 116 |
110 @Override | 117 @Override |
111 public Node copy(Graph into) { | 118 public Node copy(Graph into) { |
112 NullCheck x = new NullCheck(null, into); | 119 NullCheck x = new NullCheck(kind, into); |
113 x.setNonNull(isNonNull()); | 120 x.setNonNull(isNonNull()); |
114 return x; | 121 return x; |
115 } | 122 } |
116 } | 123 } |