RFR: 8248404: AArch64: Remove uses of long and unsigned long [v2]

Coleen Phillimore coleenp at openjdk.java.net
Tue Jan 11 16:04:08 UTC 2022


On Tue, 11 Jan 2022 10:54:52 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> src/hotspot/cpu/aarch64/universalUpcallHandler_aarch64.cpp line 74:
>> 
>>> 72:   // Capture prev stack pointer (stack arguments base)
>>> 73:   __ add(rscratch1, rfp, 16);   // Skip saved FP and LR
>>> 74:   __ str(rscratch1, Address(sp, (int)layout.stack_args));  // x86 casts to int also
>> 
>> Suggestion:
>> 
>>   __ str(rscratch1, Address(sp, checked_cast<int>(layout.stack_args)));  // x86 casts to int also
>
> ... because this is UB if it doesn't fit.

Yes, I changed this and wasn't really sure how to fix it better.  I'd love if Address had a unit64_t argument but all the callers that just passed 0 wouldn't compile.  The code is like that in the x86 version. So I thought that'd be safe.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7023


More information about the hotspot-dev mailing list