2 import IR.FieldDescriptor;
4 public class FlatElementNode extends FlatNode {
9 public FlatElementNode(TempDescriptor src, TempDescriptor index, TempDescriptor dst) {
15 public boolean needsBoundsCheck() {
19 public FlatNode clone(TempMap t) {
20 return new FlatElementNode(t.tempMap(src), t.tempMap(index), t.tempMap(dst));
22 public void rewriteDef(TempMap t) {
25 public void rewriteUse(TempMap t) {
26 index=t.tempMap(index);
30 public TempDescriptor getIndex() {
34 public TempDescriptor getSrc() {
38 public TempDescriptor getDst() {
42 public String toString() {
43 return "FlatElementNode_"+dst.toString()+"="+src.toString()+"["+index.toString()+"]";
47 return FKind.FlatElementNode;
50 public TempDescriptor [] writesTemps() {
51 return new TempDescriptor[] {dst};
54 public TempDescriptor [] readsTemps() {
55 return new TempDescriptor[] {src,index};