From d3ae06c469f7fd284aa662ab66520399b04386dd Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 18 Dec 2025 17:42:37 -0500 Subject: [PATCH 1/2] 8367408: [lworld] runtime/cds/appcds/methodHandles/MethodHandlesGeneralTest.java#aot fails --- src/hotspot/share/oops/method.cpp | 2 ++ src/hotspot/share/runtime/sharedRuntime.cpp | 28 +++++++++++---------- test/hotspot/jtreg/ProblemList.txt | 1 - 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp index 3f562d3dcb4..78b662bb7d4 100644 --- a/src/hotspot/share/oops/method.cpp +++ b/src/hotspot/share/oops/method.cpp @@ -1387,6 +1387,8 @@ address Method::make_adapters(const methodHandle& mh, TRAPS) { } } + assert(!mh->has_scalarized_args() || adapter->get_sig_cc() != nullptr, "sigcc should not be null here"); + mh->set_adapter_entry(adapter); return adapter->get_c2i_entry(); } diff --git a/src/hotspot/share/runtime/sharedRuntime.cpp b/src/hotspot/share/runtime/sharedRuntime.cpp index a79c8d1511f..79a89935038 100644 --- a/src/hotspot/share/runtime/sharedRuntime.cpp +++ b/src/hotspot/share/runtime/sharedRuntime.cpp @@ -2912,19 +2912,6 @@ void CompiledEntrySignature::compute_calling_conventions(bool init) { GrowableArray* supers = get_supers(); for (int i = 0; i < supers->length(); ++i) { Method* super_method = supers->at(i); - if (AOTCodeCache::is_using_adapter() && super_method->adapter()->get_sig_cc() == nullptr) { - // Calling conventions have to be regenerated at runtime and are accessed through method adapters, - // which are archived in the AOT code cache. If the adapters are not regenerated, the - // calling conventions should be regenerated here. - CompiledEntrySignature ces(super_method); - ces.compute_calling_conventions(); - if (ces.has_scalarized_args()) { - // Save a C heap allocated version of the scalarized signature and store it in the adapter - GrowableArray* heap_sig = new (mtInternal) GrowableArray(ces.sig_cc()->length(), mtInternal); - heap_sig->appendAll(ces.sig_cc()); - super_method->adapter()->set_sig_cc(heap_sig); - } - } if (super_method->is_scalarized_arg(arg_num)) { scalar_super = true; } else { @@ -3460,9 +3447,24 @@ void AdapterHandlerEntry::link() { log_warning(aot)("Failed to link AdapterHandlerEntry (fp=%s) to its code in the AOT code cache", _fingerprint->as_basic_args_string()); generate_code = true; } + + if (get_sig_cc() == nullptr) { + // Calling conventions have to be regenerated at runtime and are accessed through method adapters, + // which are archived in the AOT code cache. If the adapters are not regenerated, the + // calling conventions should be regenerated here. + CompiledEntrySignature ces; + ces.initialize_from_fingerprint(_fingerprint); + if (ces.has_scalarized_args()) { + // Save a C heap allocated version of the scalarized signature and store it in the adapter + GrowableArray* heap_sig = new (mtInternal) GrowableArray(ces.sig_cc()->length(), mtInternal); + heap_sig->appendAll(ces.sig_cc()); + set_sig_cc(heap_sig); + } + } } else { generate_code = true; } + if (generate_code) { CompiledEntrySignature ces; ces.initialize_from_fingerprint(_fingerprint); diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index b9ae2c892e4..a462f86f8db 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -156,7 +156,6 @@ runtime/cds/TestDefaultArchiveLoading.java#coops_nocoh 8366774 runtime/cds/TestDefaultArchiveLoading.java#nocoops_nocoh 8366774 generic-all # Valhalla + AOT -runtime/cds/appcds/methodHandles/MethodHandlesGeneralTest.java#aot 8367408 generic-all runtime/cds/appcds/resolvedConstants/ResolvedConstants.java#aot 8371456 generic-all runtime/cds/appcds/resolvedConstants/ResolvedConstants.java#static 8371456 generic-all runtime/cds/appcds/dynamicArchive/DynamicArchiveRelocationTest.java 8372265 generic-all From f8c23ab7ce042d6ed0e0b86e38cce3d8015c46b2 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Fri, 19 Dec 2025 15:46:24 -0500 Subject: [PATCH 2/2] Removing two tests from ProblemList-enable-valhalla.txt that pass with this fix. --- test/hotspot/jtreg/ProblemList-enable-preview.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList-enable-preview.txt b/test/hotspot/jtreg/ProblemList-enable-preview.txt index bcc47f76255..56b09e43b26 100644 --- a/test/hotspot/jtreg/ProblemList-enable-preview.txt +++ b/test/hotspot/jtreg/ProblemList-enable-preview.txt @@ -37,6 +37,4 @@ compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJav runtime/exceptionMsgs/ArrayIndexOutOfBoundsException/ArrayIndexOutOfBoundsExceptionTest.java#id1 8369045 macosx-aarch64 # Runtime (all Valhalla): -runtime/cds/appcds/aotCode/AOTCodeCompressedOopsTest.java 8372602 generic-all -runtime/cds/appcds/aotCode/AOTCodeFlags.java 8372602 generic-all runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java 8372599 generic-all