In HeapShared::archive_object(oop obj), CDS unconditionally invokes identity_hash() on objects being archived:
// The archived objects are discovered in a predictable order. Compute
// their identity_hash() as soon as we see them. This ensures that the
// the identity_hash in the object header will have a predictable value,
// making the archive reproducible.
obj->identity_hash();
This is an issue for value instances because the computation of the identity hash code for instances of value classes is delegated to Java code (method handle generated by ValueObjects.valueTypeHashCode()), but HeapShared::archive_object() is executed by the VM Thread, which cannot execute Java code.
As explained in the comment, the goal of CDS is to improve the archive reproducibility, but CDS itself doesn't depend on this identity hash code. The identity hash code of value instance depends on its fields content, so there's no need to force its computation, its value being already reproducible from the value object's content.
// The archived objects are discovered in a predictable order. Compute
// their identity_hash() as soon as we see them. This ensures that the
// the identity_hash in the object header will have a predictable value,
// making the archive reproducible.
obj->identity_hash();
This is an issue for value instances because the computation of the identity hash code for instances of value classes is delegated to Java code (method handle generated by ValueObjects.valueTypeHashCode()), but HeapShared::archive_object() is executed by the VM Thread, which cannot execute Java code.
As explained in the comment, the goal of CDS is to improve the archive reproducibility, but CDS itself doesn't depend on this identity hash code. The identity hash code of value instance depends on its fields content, so there's no need to force its computation, its value being already reproducible from the value object's content.