[aarch64-port-dev ] Assert failure building Graal
Andrew Haley
aph at redhat.com
Thu Jun 7 17:17:24 UTC 2018
On 06/07/2018 04:29 PM, Stuart Monteith wrote:
> I think I prefer what you have there Andrew, rather than pushing
> onto the stack. I guess the mistake was when using r22 and r23 was our
> not saving them as callee-saved registers. There is nothing on the
> path from RangeCheckStub to the exception throw that overwrote r22 or
> r23 (AFAICT from stepping through the code), and the code does return.
That's right. The important code path is something like this:
static volatile Object o;
static void count(int n, int[] a) {
try {
poo += a[n/10_000_000];
} catch (Exception e) {
o = a;
throw e;
}
}
Here, when we hit the throw_range_check_failed Runtime1 stub
everything is live. We call into the runtime with everything on the
stack, and the runtime returns to that same stack. Then from the stub
we jump to another stub, forward_exception Runtime1. That searches
for a handler for the exception, finds it in the compiled code for
count(), then restores all of our registers and jumps to it. It's
essential that all of the registers, integer and vector, are restored
at this point.
> r8 and r9 have no opportunities to be overwritten between them being
> set and used, so it'll be ok.
Yes. It's a bit too hairy for my taste but it'll work.
> Shall I raise a bug and suggest your change be merged?
I think so.
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the aarch64-port-dev
mailing list