RFR: 8289743: AArch64: Clean up patching logic [v9]
Andrew Haley
aph at openjdk.org
Mon Jul 18 10:37:13 UTC 2022
On Fri, 15 Jul 2022 16:02:03 GMT, Andrew Haley <aph at openjdk.org> wrote:
>> The current logic for patching is a mess of if-then-elses. By rearranging the logic and using a switch we can make it both easier to understand and faster.
>
> Andrew Haley has updated the pull request incrementally with three additional commits since the last revision:
>
> - 8289743: AArch64: Clean up patching logic
> - 8289743: AArch64: Clean up patching logic
> - 8289743: AArch64: Clean up patching logic
src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 461:
> 459: uint32_t insn = ((uint32_t*)insn_addr)[0];
> 460: int *insn3_addr = &((int*)insn_addr)[2];
> 461: uint32_t insn3 = (uint32_t)SafeFetch32(insn3_addr, -1);
I'm wondering if this is safe. Maybe something like `adrp;movk` could be followed by not-an-instruction which looked like an offset. However, I think that's impossible because anything following would be executed immediately following the `movk`. For the same reason, the `adrp;movk` can't be at the very end of an executable page, so I suppose the use of `SafeFetch32` is unnecessary too.
It's still a code smell, though, even if it is safe.
-------------
PR: https://git.openjdk.org/jdk/pull/9398
More information about the hotspot-dev
mailing list