RFR: 8367692: RISC-V: Align post call nop [v5]
Hamlin Li
mli at openjdk.org
Mon Sep 29 10:05:46 UTC 2025
On Fri, 26 Sep 2025 16:13:11 GMT, Robbin Ehn <rehn at openjdk.org> wrote:
> Runtime calls don't have an interrupt point and used for calling stub and such.
For "interrupt point" above, do you mean safepoint?
> E.g. C2_MacroAssembler::string_compare calls StubRoutines::riscv::compare_long_string_LL. There is not post_call_nops as we can't deoptimize the caller while running this stub. So it's still true that they don't need to be aligned.
I see, thanks!
>> src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp line 1353:
>>
>>> 1351:
>>> 1352: void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
>>> 1353: Assembler::IncompressibleScope scope(_masm);
>>
>> Is an alignment needed here?
>
> It's aligned:
>
> void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {
> verify_oop_map(op->info());
>
> // must align calls sites, otherwise they can't be updated atomically
> align_call(op->code());
I see, thanks!
>> src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp line 1364:
>>
>>> 1362:
>>> 1363: void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
>>> 1364: Assembler::IncompressibleScope scope(_masm);
>>
>> Is an alignment needed here?
>
> It's aligned:
>
> void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {
> verify_oop_map(op->info());
>
> // must align calls sites, otherwise they can't be updated atomically
> align_call(op->code());
I see, thanks!
>> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 358:
>>
>>> 356:
>>> 357: void MacroAssembler::post_call_nop() {
>>> 358: assert(!in_compressible_scope(), "Must be");
>>
>> Maybe `do_compress` is better? All other places use `do_compress`.
>> Similar suggestion as below.
>
> There is a semantic difference: in_compressible_scope() only check if caller turned off c-instruction.
> While do_compressed() also consider what ISA we are using in runtime.
> Regardless of ISA : caller of post_call_nop() should have turned C off is what I want to assert.
Although I prefer do_compress, in_compressible_scope is also fine to me.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27467#issuecomment-3346071581
PR Review Comment: https://git.openjdk.org/jdk/pull/27467#discussion_r2387385726
PR Review Comment: https://git.openjdk.org/jdk/pull/27467#discussion_r2387385900
PR Review Comment: https://git.openjdk.org/jdk/pull/27467#discussion_r2387388024
More information about the hotspot-dev
mailing list