RFR: 8256025: AArch64: MachCallRuntimeNode::ret_addr_offset() is incorrect for stub calls
Jorn Vernee
jvernee at openjdk.java.net
Tue Nov 10 11:06:01 UTC 2020
On Tue, 10 Nov 2020 08:49:45 GMT, Andrew Haley <aph at openjdk.org> wrote:
>> The PR for JDK-8254231 introduces a new assertion in opto/output.cpp to
>> check the current instruction offset against the offset of the call
>> return address reported by ret_addr_offset(). This fails on AArch64
>> because MachCallRuntimeNode::ret_addr_offset() claims four instructions
>> are generated for a stub call (far branch) but actually it's just
>> one (blr to stub or trampoline).
>>
>> Tested tier1.
>
> So here's a weird thing: this code has been wrong forever, but apparently it never mattered. I wonder why it didn't break anything before now.
@theRealAph The bug that this catches manifests when the reported return offset lines up _exactly_ with that of a later call. In that case two calls will use the same PC for their oop map, and one will be overwritten.
Maybe we've been lucky that this is never actually the case for ARM, but I'd imaging the oop map annotation in PrintAssembly output might be in the wrong place, and the oop map offset it prints should be wrong. But, as long as the return PC it reports is unique, I don't think it will cause an immediate problem to functionality.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1138
More information about the hotspot-compiler-dev
mailing list