On Wed, 10 Dec 2025 17:51:47 GMT, Ioi Lam <[email protected]> wrote: >> This fixes three crashes in when heap dumping is enabled with Matias's patch. >> Tested with tier1-3, that doesn't exactly turn on valhalla and some >> --enable-valhalla testing locally. > > src/hotspot/share/cds/aotStreamedHeapWriter.cpp line 393: > >> 391: narrowKlass nk = >> ArchiveBuilder::current()->get_requested_narrow_klass(src_klass); >> 392: >> 393: markWord mw = Arguments::enable_preview() ? >> src_klass->prototype_header() : markWord::prototype(); > > Why is `Arguments::enable_preview()` check necessary here but not in > aotMappedHeapWriter.cpp?
Yes, these should fail too. Edit. No they don't fail because they test Universe::objectArrayKlass() which is a default RefArrayKlass and that class doesn't set any special flattening or other bits in the markWord, so markWord::prototype() is okay there. But this code is confusing and fragile and should be rewritten. ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/1784#discussion_r2607919708
