Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/ir/Local.java @ 2771:056e392d63d4
Connected local variables to start node. No more need for frame state to emit locals.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Tue, 24 May 2011 09:49:04 +0200 |
parents | 01c5c0443158 |
children | 9253df721472 |
comparison
equal
deleted
inserted
replaced
2770:4f3053eef0de | 2771:056e392d63d4 |
---|---|
31 * The {@code Local} instruction is a placeholder for an incoming argument | 31 * The {@code Local} instruction is a placeholder for an incoming argument |
32 * to a function call. | 32 * to a function call. |
33 */ | 33 */ |
34 public final class Local extends Value { | 34 public final class Local extends Value { |
35 | 35 |
36 private static final int INPUT_COUNT = 0; | 36 private static final int INPUT_COUNT = 1; |
37 private static final int SUCCESSOR_COUNT = 0; | 37 private static final int SUCCESSOR_COUNT = 0; |
38 | 38 |
39 private final int javaIndex; | 39 private final int index; |
40 private RiType declaredType; | 40 private RiType declaredType; |
41 | 41 |
42 public Local(CiKind kind, int javaIndex, Graph graph) { | 42 public Local(CiKind kind, int javaIndex, Graph graph) { |
43 super(kind, INPUT_COUNT, SUCCESSOR_COUNT, graph); | 43 super(kind, INPUT_COUNT, SUCCESSOR_COUNT, graph); |
44 this.javaIndex = javaIndex; | 44 this.index = javaIndex; |
45 this.inputs().set(0, graph.start()); | |
45 } | 46 } |
46 | 47 |
47 @Override | 48 @Override |
48 public BlockBegin block() { | 49 public BlockBegin block() { |
49 return null; | 50 return null; |
51 | 52 |
52 /** | 53 /** |
53 * Gets the index of this local. | 54 * Gets the index of this local. |
54 * @return the index | 55 * @return the index |
55 */ | 56 */ |
56 public int javaIndex() { | 57 public int index() { |
57 return javaIndex; | 58 return index; |
58 } | 59 } |
59 | 60 |
60 /** | 61 /** |
61 * Sets the declared type of this local, e.g. derived from the signature of the method. | 62 * Sets the declared type of this local, e.g. derived from the signature of the method. |
62 * @param declaredType the declared type of the local variable | 63 * @param declaredType the declared type of the local variable |
79 v.visitLocal(this); | 80 v.visitLocal(this); |
80 } | 81 } |
81 | 82 |
82 @Override | 83 @Override |
83 public void print(LogStream out) { | 84 public void print(LogStream out) { |
84 out.print("local[index ").print(javaIndex()).print(']'); | 85 out.print("local[index ").print(index()).print(']'); |
85 } | 86 } |
86 } | 87 } |