comparison graal/GraalCompiler/src/com/sun/c1x/value/FrameStateBuilder.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 43ffa0e47a46
children 015be60afcf3
comparison
equal deleted inserted replaced
2770:4f3053eef0de 2771:056e392d63d4
47 public FrameStateBuilder(RiMethod method, Graph graph) { 47 public FrameStateBuilder(RiMethod method, Graph graph) {
48 this.graph = graph; 48 this.graph = graph;
49 this.locals = new Value[method.maxLocals()]; 49 this.locals = new Value[method.maxLocals()];
50 this.stack = new Value[method.maxStackSize()]; 50 this.stack = new Value[method.maxStackSize()];
51 51
52 int javaIndex = 0;
52 int index = 0; 53 int index = 0;
53 if (!isStatic(method.accessFlags())) { 54 if (!isStatic(method.accessFlags())) {
54 // add the receiver and assume it is non null 55 // add the receiver and assume it is non null
55 Local local = new Local(method.holder().kind(), index, graph); 56 Local local = new Local(method.holder().kind(), javaIndex, graph);
56 local.setFlag(Value.Flag.NonNull, true); 57 local.setFlag(Value.Flag.NonNull, true);
57 local.setDeclaredType(method.holder()); 58 local.setDeclaredType(method.holder());
58 storeLocal(index, local); 59 storeLocal(javaIndex, local);
60 javaIndex = 1;
59 index = 1; 61 index = 1;
60 } 62 }
61 RiSignature sig = method.signature(); 63 RiSignature sig = method.signature();
62 int max = sig.argumentCount(false); 64 int max = sig.argumentCount(false);
63 RiType accessingClass = method.holder(); 65 RiType accessingClass = method.holder();
66 CiKind kind = type.kind().stackKind(); 68 CiKind kind = type.kind().stackKind();
67 Local local = new Local(kind, index, graph); 69 Local local = new Local(kind, index, graph);
68 if (type.isResolved()) { 70 if (type.isResolved()) {
69 local.setDeclaredType(type); 71 local.setDeclaredType(type);
70 } 72 }
71 storeLocal(index, local); 73 storeLocal(javaIndex, local);
72 index += kind.sizeInSlots(); 74 javaIndex += kind.sizeInSlots();
75 index++;
73 } 76 }
74 this.locks = new ArrayList<Value>(); 77 this.locks = new ArrayList<Value>();
75 } 78 }
76 79
77 public void initializeFrom(FrameState other) { 80 public void initializeFrom(FrameState other) {