[aarch64-port-dev ] System.arraycopy() intrinsics
Andrew Haley
aph at redhat.com
Mon Sep 23 12:36:01 PDT 2013
On 09/23/2013 06:23 PM, Andrew Dinn wrote:
> On 23/09/13 17:58, Andrew Haley wrote:
>> On 09/23/2013 04:26 PM, Andrew Dinn wrote:
>>> That requires adding
>>>
>>> __ c_stub_prolog(3, 0, MacroAssembler::ret_type_void);
>>>
>>> at the start of StubGenerator methods generate_disjoint_copy(),
>>> generate_conjoint_copy() and generate_checkcast_copy(). It also requires
>>> changing the code above to remove the if/then clauses and only make the
>>> VM_leaf call plus reverting some similar call in c1_LIRAssembler (to the
>>> generic copy routine) back to a VM_leaf call. This restores both calls
>>> to be as per the equivalent x86 code.
>>>
>>> The patch below fixes this problem in C2 by making the stubs x86
>>> callable.
>>
>> Oh yuck, that's disgusting. Is there really no way that C2 can't just
>> do what C1 does, and call via an x86 thunk only if it's absolutely
>> necessary?
>>
>> The arraycopy function should always be ARM code. I'll grant
>> you that it should not be an ExternalAddress -- that's just a
>> mistake.
>
> Well, it is a tad yucky but so is adding the code blob lookup to the
> back end generator for CallRuntime
Hmm. IMO that it exactly what you should do.
> (to anyone comparing the code to the x86 version it not exactly very
> clear why we would be doing that). This solution also avoids doing
> this codeblob lookup for every runtime call -- unlike C1, where the
> lookup only happens when planting an arraycopy.
I don't get it. If you're calling a stub, it's either implemented as
generated ARM code, in which case you can call it via BL, or it's
native code, in which case you can't because BL won't reach. Doing
the code blob lookup doesn't hurt at all.
> That's not an issue when running on the sime but it slows us down on
> real hardware.
>
> My main preference for this is that it means the code is now written the
> way it will need to be once we decommision the sim.
Why? It doesn't need to be changed.
> I would rather not have to remember to take the lookup out
So would I. There's no need to take it out. It's fine, and will
always be.
Andrew.
More information about the aarch64-port-dev
mailing list