RFR: JDK-8302989: Add missing INCLUDE_CDS checks

David Holmes dholmes at openjdk.org
Mon Feb 27 09:15:14 UTC 2023


On Mon, 27 Feb 2023 08:06:56 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> systemDictionaryShared.cpp is already not compiled in non-CDS mode, see hotspot/lib/JvmFeatures.gmk

Sorry I must have misread something.

> The conversion of a handful of sites is just an addition to the already rather common usage of the macro. Nothin new really ...

Nothing new but it doesn't really add anything either; especially when there remains so much non-conditional usage.

> Maybe in a separate issue, that do you think ? Do you have some example places where to use it ?

Up to you. These are what I spotted mainly:

./share/oops/instanceClassLoaderKlass.hpp:  InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
./share/oops/instanceMirrorKlass.hpp:  InstanceMirrorKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
./share/oops/arrayKlass.hpp:  ArrayKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); }
./share/oops/constantPool.hpp:  ConstantPool() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
./share/oops/instanceRefKlass.hpp:  InstanceRefKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
./share/oops/instanceStackChunkKlass.hpp:  InstanceStackChunkKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
./share/oops/klass.hpp:  Klass() : _kind(KlassKind(-1)) { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); }
./share/oops/instanceKlass.hpp:  InstanceKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }

But looking closer these are all in constructors that should be CDS_ONLY.

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

PR: https://git.openjdk.org/jdk/pull/12691


More information about the hotspot-dev mailing list