comparison graal/GraalCompiler/src/com/sun/c1x/ir/Unwind.java @ 2840:75e0d39833a0

new CompilerGraph, create only one Return and one Unwind per CompilerGraph
author Lukas Stadler <lukas.stadler@jku.at>
date Tue, 31 May 2011 16:53:19 +0200
parents bfce42cd9c07
children 14708c03abba
comparison
equal deleted inserted replaced
2837:7b5831f0e913 2840:75e0d39833a0
32 public final class Unwind extends BlockEnd { 32 public final class Unwind extends BlockEnd {
33 33
34 private static final int INPUT_COUNT = 1; 34 private static final int INPUT_COUNT = 1;
35 private static final int INPUT_EXCEPTION = 0; 35 private static final int INPUT_EXCEPTION = 0;
36 36
37 private static final int SUCCESSOR_COUNT = 1; 37 private static final int SUCCESSOR_COUNT = 0;
38 private static final int SUCCESSOR_END = 0;
39 38
40 @Override 39 @Override
41 protected int inputCount() { 40 protected int inputCount() {
42 return super.inputCount() + INPUT_COUNT; 41 return super.inputCount() + INPUT_COUNT;
43 } 42 }
62 public Value setException(Value n) { 61 public Value setException(Value n) {
63 assert n == null || n.kind == CiKind.Object; 62 assert n == null || n.kind == CiKind.Object;
64 return (Value) inputs().set(super.inputCount() + INPUT_EXCEPTION, n); 63 return (Value) inputs().set(super.inputCount() + INPUT_EXCEPTION, n);
65 } 64 }
66 65
67 public Unwind(Value exception, Node successor, Graph graph) { 66 public Unwind(Value exception, Graph graph) {
68 super(CiKind.Object, 0, INPUT_COUNT, SUCCESSOR_COUNT, graph); 67 super(CiKind.Object, 0, INPUT_COUNT, SUCCESSOR_COUNT, graph);
69 setException(exception); 68 setException(exception);
70 successors().set(SUCCESSOR_END, successor);
71 } 69 }
72 70
73 @Override 71 @Override
74 public void accept(ValueVisitor v) { 72 public void accept(ValueVisitor v) {
75 v.visitUnwind(this); 73 v.visitUnwind(this);
80 out.print(kind.typeChar).print("unwind ").print(exception()); 78 out.print(kind.typeChar).print("unwind ").print(exception());
81 } 79 }
82 80
83 @Override 81 @Override
84 public Node copy(Graph into) { 82 public Node copy(Graph into) {
85 Unwind x = new Unwind(null, null, into); 83 Unwind x = new Unwind(null, into);
86 x.setNonNull(isNonNull()); 84 x.setNonNull(isNonNull());
87 return x; 85 return x;
88 } 86 }
89 } 87 }