On Fri, 16 Jan 2026 21:17:56 GMT, Matias Saavedra Silva <[email protected]> 
wrote:

>> The alternate substitutability method relies on an injected Java object 
>> "acmp_maps" which is currently not being archived and thus leads to crashes 
>> attempting to run with a CDS archive. The issue stems from inline klasses 
>> being archived and thus loaded at dumptime while the acmp_maps oops is 
>> generated in the class file parser, leading this oop to be absent at 
>> runtime. 
>> 
>> Additionally, the other injected static field "null_reset" was not being 
>> archived either, so both of these fields are properly stored in the archived 
>> heap. In the case of CDS/AOT configurations where the heap is not dumped, 
>> acmp_maps is regenerated at class loading using a copy of the array stored 
>> in metadata.
>> 
>> Tests and APIs are updated to conform to the new output generated by the use 
>> of acmp_maps and remove some test cases which target the old 
>> substitutability method.
>
> Matias Saavedra Silva has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Coleen and Fred comments

Mostly good, but one thing needs to be changed.

src/hotspot/share/classfile/classFileParser.cpp line 5549:

> 5547:     int acmp_map_size = nonoop_acmp_map_size + oop_acmp_map_size + 1;
> 5548: 
> 5549:     Array<int>* acmp_maps_array = 
> MetadataFactory::new_array<int>(loader_data(), acmp_map_size, CHECK);

It's actually really important that this line is after 5550.  with a comment 
like:
// Create metadata after potential OOM so this does not have to be cleaned up 
in the ClassFileParser destructor.

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

Changes requested by coleenp (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/1903#pullrequestreview-3672834837
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1903#discussion_r2709597602

Reply via email to