[aarch64-port-dev ] Whether or not to revert of checkcast_arraycopy stub to generate return value expected by generic C2 code
Andrew Dinn
adinn at redhat.com
Tue Oct 15 07:47:56 PDT 2013
On 15/10/13 15:36, Andrew Haley wrote:
>> I have implemented the changes needed to revert the behaviour of the
>> stub and the diff is attached below.
>
> There's a better solution: keep the stub as it is, but if the copy
> fails return -1^K. I will make that change if you like. It's much
> better than the rather nightmarish code we had before.
Well, that's actually what I have done. I didn't rewrite the code based
on what Intel does I merely rewrote your code to return -1^K.
Specifically, this required:
i) a skip at the start to allow posting 0 into rax when the input length
is zero length input case. This could be improved if we planted the mov
r0, zr and ret out of line.
ii) an extra register saved in the push and pop so we can keep the
original count -- needed to compute K (== count_orig - count) n.b. this
is essentially free because one of the stps is using zr.
iii) variant code in the fail case to compute -1^K and do its own card
marking
iv) an extra label L_cleanup and extra branch to it after the fail case
so as to skip the move of 0 into r0 and card marking done in the success
case but still do the pop in both cases.
Looking at it again I think the duplication of the card marking code
could be avoided by moving it after L_cleanup
regards,
Andrew Dinn
-----------
Principal Software Engineer
Red Hat UK Ltd
Registered in UK and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Matt Parson (USA), Charlie Peters
(USA), Paul Hickey (Ireland)
More information about the aarch64-port-dev
mailing list