Mercurial > hg > graal-jvmci-8
diff graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java @ 2716:c1a9bf38da28
Removed bci from the Instruction class.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Thu, 19 May 2011 13:59:55 +0200 |
parents | 3ac3dd97d8df |
children | c1ce2a53d6c3 |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Thu May 19 13:21:31 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Thu May 19 13:59:55 2011 +0200 @@ -42,6 +42,7 @@ import com.sun.c1x.util.*; import com.sun.c1x.value.*; import com.sun.c1x.value.FrameState.PhiProcedure; +import com.sun.cri.bytecode.*; import com.sun.cri.bytecode.Bytecodes.MemoryBarriers; import com.sun.cri.ci.*; import com.sun.cri.ri.*; @@ -447,7 +448,7 @@ } protected FrameState stateBeforeInvokeReturn(Invoke invoke) { - return invoke.stateAfter().duplicateModified(invoke.bci(), invoke.kind/*, args*/); + return invoke.stateAfter().duplicateModified(getBeforeInvokeBci(invoke), invoke.kind); } protected FrameState stateBeforeInvokeWithArguments(Invoke invoke) { @@ -455,7 +456,15 @@ for (int i = 0; i < invoke.argumentCount(); i++) { args[i] = invoke.argument(i); } - return invoke.stateAfter().duplicateModified(invoke.bci(), invoke.kind, args); + return invoke.stateAfter().duplicateModified(getBeforeInvokeBci(invoke), invoke.kind, args); + } + + private int getBeforeInvokeBci(Invoke invoke) { + int length = 3; + if (invoke.opcode() == Bytecodes.INVOKEINTERFACE) { + length += 2; + } + return invoke.stateAfter().bci - length; } @Override @@ -1393,17 +1402,8 @@ walkStateValue(value); } } - FrameState s = state; - int bci = x.bci(); - if (bci == Instruction.SYNCHRONIZATION_ENTRY_BCI) { - assert x instanceof ExceptionObject || - x instanceof Throw || - x instanceof MonitorEnter || - x instanceof MonitorExit : x + ", " + x.getClass(); - } - - for (int index = 0; index < s.localsSize(); index++) { - final Value value = s.localAt(index); + for (int index = 0; index < state.localsSize(); index++) { + final Value value = state.localAt(index); if (value != null) { if (!value.isIllegal()) { walkStateValue(value);