On Fri, 16 Jan 2026 19:44:03 GMT, Coleen Phillimore <[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. > > src/hotspot/share/classfile/classFileParser.cpp line 5571: > >> 5569: >> 5570: // Clear out this field so it doesn't get deallocated by the >> destructor >> 5571: _acmp_maps_array = nullptr; > > This is right. It didn't look necessary but it is if > oopFactory::new_intArray() throws an OOM. > > You could remove this field from ClassFileParser and this handling, and make > it a local variable if you reverse lines 5549 and 5550. +1 to use a local variable. It looks weird to have this _acmp_maps_array field in ClassFilerParser whose content's ownership is not transferred to the InstanceKlass using the apply_parsed_class_metadata() method. ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/1903#discussion_r2699890402
