RFR: 8377554: Load card table base and other values via AOTRuntimeConstants in AOT code [v4]
Vladimir Kozlov
kvn at openjdk.org
Tue Feb 24 17:06:22 UTC 2026
On Tue, 24 Feb 2026 16:41:44 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> This also needs fixing in premain.
>
> No, `movptr` loads from this address. It is not `lea` instruction.
> And `movq` simply moves value from register to register - it does not do anything in this case.
Note, movptr() is macro instruction which checks reachability (which is always false when we dump AOT code):
void MacroAssembler::movptr(Register dst, AddressLiteral src) {
if (src.is_lval()) {
mov_literal64(dst, (intptr_t)src.target(), src.rspec());
} else {
if (reachable(src)) {
movq(dst, as_Address(src));
} else {
lea(dst, src);
movq(dst, Address(dst, 0));
}
}
}
But if you want to optimize knowing that we dumping AOT code use this:
__ lea(rscratch, ExternalAddress(AOTRuntimeConstants::card_table_address()));
__ movq(rscratch, Address(rscratch, 0));
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29884#discussion_r2848419572
More information about the hotspot-dev
mailing list