Mercurial > hg > truffle
changeset 2639:8e96b2b3a866
Added stateBefore to Throw instruction.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 11 May 2011 13:41:35 +0200 |
parents | 3e47aeb60ab3 |
children | 9e30cf6dcf96 |
files | graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java |
diffstat | 3 files changed, 17 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Wed May 11 12:10:41 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Wed May 11 13:41:35 2011 +0200 @@ -892,7 +892,7 @@ public void visitThrow(Throw x) { setNoResult(x); CiValue exceptionOpr = load(x.exception()); - LIRDebugInfo info = stateFor(x); + LIRDebugInfo info = stateFor(x, x.stateBefore()); // check if the instruction has an xhandler in any of the nested scopes boolean unwind = false;
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Wed May 11 12:10:41 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Wed May 11 13:41:35 2011 +0200 @@ -553,7 +553,9 @@ } void genThrow(int bci) { + FrameState stateBefore = frameState.create(bci); Throw t = new Throw(frameState.apop(), !noSafepoints(), graph); + t.setStateBefore(stateBefore); appendWithoutOptimization(t, bci); }
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java Wed May 11 12:10:41 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java Wed May 11 13:41:35 2011 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.graph.*; import com.sun.c1x.debug.*; +import com.sun.c1x.value.*; import com.sun.cri.ci.*; /** @@ -31,8 +32,9 @@ */ public final class Throw extends BlockEnd { - private static final int INPUT_COUNT = 1; + private static final int INPUT_COUNT = 2; private static final int INPUT_EXCEPTION = 0; + private static final int INPUT_STATE_BEFORE = 1; private static final int SUCCESSOR_COUNT = 0; @@ -58,6 +60,17 @@ } /** + * The state for this instruction. + */ + public FrameState stateBefore() { + return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_BEFORE); + } + + public FrameState setStateBefore(FrameState n) { + return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_BEFORE, n); + } + + /** * Creates a new Throw instruction. * @param exception the instruction that generates the exception to throw * @param stateAfter the state before the exception is thrown but after the exception object has been popped