--- old/src/share/vm/oops/annotations.hpp 2017-06-29 15:57:35.688357092 -0700 +++ new/src/share/vm/oops/annotations.hpp 2017-06-29 15:57:35.504350018 -0700 @@ -63,6 +63,10 @@ // Sizing (in words) static int size() { return sizeof(Annotations) / wordSize; } + + // Annotations should be stored in the read-only region of CDS archive. + static bool is_read_only_by_default() { return true; } + #if INCLUDE_SERVICES void collect_statistics(KlassSizeStats *sz) const; #endif @@ -87,6 +91,9 @@ static typeArrayOop make_java_array(AnnotationArray* annotations, TRAPS); bool is_klass() const { return false; } + void metaspace_pointers_do(MetaspaceClosure* it); + MetaspaceObj::Type type() const { return AnnotationsType; } + private: static julong count_bytes(Array* p); public: