question about bci in LIRFrameState for DeoptimizeOp
Thomas Wuerthinger
thomas.wuerthinger at oracle.com
Wed Nov 20 12:39:42 PST 2013
Graal understands that it can safely replay bytecodes without side effects. Therefore the target bci of a deoptimization will reflect the last side effecting instruction (or the beginning of the method if no such instruction exists). Gilles wrote a paper describing in more details how deoptimization works in Graal and we will publish it shortly as part of the Graal documentation. - thomas
On 20 Nov 2013, at 21:17, Deneau, Tom <tom.deneau at amd.com> wrote:
> I was looking at the AMD64DeoptimizeOp.emitCode routine which is
> AMD64Call.directCall(tasm, masm, tasm.foreignCalls.lookupForeignCall(UNCOMMON_TRAP), null, false, info);
>
> When I look at the LIRFrameState info which is passed to UNCOMMON_TRAP, the bci always seems to be 0.
> Why is that?
>
> For example, compiling this small snippet thru AMD64 backend
> public int intFromArray(int[] ary, int idx) {
> return ary[idx];
> }
>
> with bytecodes
> public int intFromArray(int[], int);
> Code:
> 0: aload_1
> 1: iload_2
> 2: iaload
> 3: ireturn
>
> when I get to AMD64DeoptimizeOp.emitCode, I see
> info = "at com.oracle.graal.compiler.test.BasicTest2.intFromArray(BasicTest2.java:46) [bci: 0]
> |0 |1 |2
> locals: |- |v0|a |v1|i "
>
> I would have expected the bci in this case to be 2, referring to the iaload instruction.
>
> -- Tom
>
>
More information about the graal-dev
mailing list