RFR: 8297763: Fix missing stub code expansion before align() in shared trampolines
Fei Yang
fyang at openjdk.org
Wed Nov 30 09:49:28 UTC 2022
On Tue, 29 Nov 2022 13:43:20 GMT, Xiaolin Zheng <xlinzheng at openjdk.org> wrote:
> This patch fixes missing stub code expansion logic before `align()` for AArch64 and RISC-V.
>
> The `align()` at most creates 4-byte padding, so a `NativeInstruction::instruction_size` is enough.
>
> I am considering pre-calculating the total trampoline sizes and allocating them in batches, but maybe after this one, for this is a quick fix to unblock https://github.com/openjdk/jdk/pull/11188. Please see that thread.
>
> The `assert_alignment(pc());` added in the RISC-V part shows that RVC doesn't change the trampoline stub / static stub logic, so there is no need to adjust the trampoline size for it. [1]
>
> Tested AArch64 hotspot tier1~3, and 4 is still running; tested RISC-V hotspot tier1~2, and 3~4 are still running.
>
> Thanks,
> Xiaolin
>
> [1] https://github.com/openjdk/jdk/blob/2deb318c9f047ec5a4b160d66a4b52f93688ec42/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp#L3125-L3126
src/hotspot/cpu/aarch64/codeBuffer_aarch64.cpp line 55:
> 53: auto emit = [&](address dest, const CodeBuffer::Offsets &offsets) {
> 54: masm.set_code_section(cb->stubs());
> 55: if (cb->stubs()->maybe_expand_to_ensure_remaining(NativeInstruction::instruction_size) && cb->blob() == NULL) {
Shoud we add a check for the real code alignment here and put maybe_expand_to_ensure_remaining() and masm.align(wordSize) operations under that check?
-------------
PR: https://git.openjdk.org/jdk/pull/11414
More information about the hotspot-dev
mailing list