8387745: [aot] Several tests fail because a SoftReferenceKey cannot be archived

Reviewed-by: iklam, kvn
This commit is contained in:
Ashutosh Mehra 2026-07-16 00:48:42 +00:00
parent 399317d393
commit bc03baed72
3 changed files with 17 additions and 0 deletions

View File

@ -142,6 +142,16 @@ void AOTReferenceObjSupport::stabilize_cached_reference_objects(TRAPS) {
vmSymbols::void_method_signature(),
CHECK);
}
{
TempNewSymbol method_name = SymbolTable::new_symbol("assemblySetup");
JavaValue result(T_VOID);
Symbol* baseLocale_name = vmSymbols::sun_util_locale_BaseLocale();
Klass* baseLocale_klass = SystemDictionary::resolve_or_fail(baseLocale_name, true, CHECK);
JavaCalls::call_static(&result, baseLocale_klass,
method_name,
vmSymbols::void_method_signature(),
CHECK);
}
{
Symbol* cds_name = vmSymbols::jdk_internal_misc_CDS();

View File

@ -731,6 +731,7 @@ class SerializeClosure;
template(runtimeSetup, "runtimeSetup") \
template(toFileURL_name, "toFileURL") \
template(toFileURL_signature, "(Ljava/lang/String;)Ljava/net/URL;") \
template(sun_util_locale_BaseLocale, "sun/util/locale/BaseLocale") \
\
/* jcmd Thread.dump_to_file */ \
template(jdk_internal_vm_ThreadDumper, "jdk/internal/vm/ThreadDumper") \

View File

@ -275,4 +275,10 @@ public final class BaseLocale {
}
return h;
}
// This is called from C code, at the very end of Java code execution
// during the AOT cache assembly phase.
private static void assemblySetup() {
CACHE.get().prepareForAOTCache();
}
}