4141#if INCLUDE_CDS_JAVA_HEAP
4242
4343// CDSHeapVerifier is used to check for problems where an archived object references a
44- // static field that may be get a different value at runtime. In the following example,
44+ // static field that may be get a different value at runtime.
45+ //
46+ // *Please see comments in aotClassInitializer.cpp for how to avoid such problems*,
47+ //
48+ // In the following example,
4549// Foo.get.test()
4650// correctly returns true when CDS disabled, but incorrectly returns false when CDS is enabled,
4751// because the archived archivedFoo.bar value is different than Bar.bar.
@@ -133,6 +137,12 @@ CDSHeapVerifier::CDSHeapVerifier() : _archived_objs(0), _problems(0)
133137 ADD_EXCL (" java/lang/invoke/InvokerBytecodeGenerator" , " MEMBERNAME_FACTORY" , // D
134138 " CD_Object_array" , // E same as <...>ConstantUtils.CD_Object_array::CD_Object
135139 " INVOKER_SUPER_DESC" ); // E same as java.lang.constant.ConstantDescs::CD_Object
140+
141+ ADD_EXCL (" java/lang/invoke/MethodHandleImpl$ArrayAccessor" ,
142+ " OBJECT_ARRAY_GETTER" , // D
143+ " OBJECT_ARRAY_SETTER" , // D
144+ " OBJECT_ARRAY_LENGTH" ); // D
145+
136146 }
137147
138148# undef ADD_EXCL
@@ -145,6 +155,7 @@ CDSHeapVerifier::~CDSHeapVerifier() {
145155 log_error (cds, heap)(" Scanned %d objects. Found %d case(s) where "
146156 " an object points to a static field that "
147157 " may hold a different value at runtime." , _archived_objs, _problems);
158+ log_error (cds, heap)(" Please see cdsHeapVerifier.cpp and aotClassInitializer.cpp for details" );
148159 MetaspaceShared::unrecoverable_writing_error ();
149160 }
150161}
0 commit comments