RFR: 8377554: Load card table base and other values via AOTRuntimeConstants in AOT code [v7]

Vladimir Kozlov kvn at openjdk.org
Wed Feb 25 17:16:33 UTC 2026


On Wed, 25 Feb 2026 16:28:56 GMT, Andrew Dinn <adinn at openjdk.org> wrote:

>> Generated stubs and nmethods embed some runtime-derived constants, such as the card table base, directly into code as instruction operands. AOT code generation cannot rely on these constants being valid between the assembly run and a production run and adjusting the constants at load time is not currently supported. So, instead AOT generation must employ code which loads the constants from a table whose address can be relocated at load time.
>
> Andrew Dinn has updated the pull request incrementally with one additional commit since the last revision:
> 
>   allow for fake RawPtr ConP addresses

I got next failure on aarch64:

[2026-02-25T01:42:11,470Z] # A fatal error has been detected by the Java Runtime Environment:
[2026-02-25T01:42:11,470Z] #
[2026-02-25T01:42:11,470Z] #  Internal Error (/workspace/open/src/hotspot/cpu/aarch64/aarch64.ad:3406), pid=93318, tid=33815
[2026-02-25T01:42:11,470Z] #  assert(rtype == relocInfo::none) failed: unexpected reloc type


You need this change to fix it (we have it in premain):


diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad
index a9ca91d9309..f48c549dc0b 100644
--- a/src/hotspot/cpu/aarch64/aarch64.ad
+++ b/src/hotspot/cpu/aarch64/aarch64.ad
@@ -3403,7 +3403,7 @@ encode %{
       } else if (rtype == relocInfo::metadata_type) {
         __ mov_metadata(dst_reg, (Metadata*)con);
       } else {
-        assert(rtype == relocInfo::none, "unexpected reloc type");
+        assert(rtype == relocInfo::none || rtype == relocInfo::external_word_type, "unexpected reloc type");
         if (! __ is_valid_AArch64_address(con) ||
             con < (address)(uintptr_t)os::vm_page_size()) {
           __ mov(dst_reg, con);

-------------

PR Comment: https://git.openjdk.org/jdk/pull/29884#issuecomment-3960733358


More information about the hotspot-dev mailing list