Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/value/FrameStateBuilder.java @ 2866:7f14e6b48a9c
added dead code elimination
added ValueAnchor (temp workaround)
more inlining logic (now uses DCE)
IdealGraphPrinter: print even if Scheduler fails
added inlining and DCE tracing options to C1XOptions
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Tue, 07 Jun 2011 16:27:08 +0200 |
parents | 7596ae867a7b |
children | 5c545fef2c81 |
comparison
equal
deleted
inserted
replaced
2845:e55543ff91fd | 2866:7f14e6b48a9c |
---|---|
47 | 47 |
48 public FrameStateBuilder(RiMethod method, Graph graph) { | 48 public FrameStateBuilder(RiMethod method, Graph graph) { |
49 this.method = method; | 49 this.method = method; |
50 this.graph = graph; | 50 this.graph = graph; |
51 this.locals = new Value[method.maxLocals()]; | 51 this.locals = new Value[method.maxLocals()]; |
52 this.stack = new Value[method.maxStackSize()]; | 52 // we always need at least one stack slot (for exceptions) |
53 int stackSize = Math.max(1, method.maxStackSize()); | |
54 this.stack = new Value[stackSize]; | |
53 | 55 |
54 int javaIndex = 0; | 56 int javaIndex = 0; |
55 int index = 0; | 57 int index = 0; |
56 if (!isStatic(method.accessFlags())) { | 58 if (!isStatic(method.accessFlags())) { |
57 // add the receiver and assume it is non null | 59 // add the receiver and assume it is non null |
80 } | 82 } |
81 this.locks = new ArrayList<Value>(); | 83 this.locks = new ArrayList<Value>(); |
82 } | 84 } |
83 | 85 |
84 public void initializeFrom(FrameState other) { | 86 public void initializeFrom(FrameState other) { |
85 assert locals.length == other.localsSize(); | 87 assert locals.length == other.localsSize() : "expected: " + locals.length + ", actual: " + other.localsSize(); |
86 assert stack.length >= other.stackSize(); | 88 assert stack.length >= other.stackSize() : "expected: <=" + stack.length + ", actual: " + other.stackSize(); |
87 | 89 |
88 this.stackIndex = other.stackSize(); | 90 this.stackIndex = other.stackSize(); |
89 for (int i = 0; i < other.localsSize(); i++) { | 91 for (int i = 0; i < other.localsSize(); i++) { |
90 locals[i] = other.localAt(i); | 92 locals[i] = other.localAt(i); |
91 } | 93 } |