--- old/src/share/vm/oops/constMethod.hpp 2017-06-29 15:57:40.088526250 -0700 +++ new/src/share/vm/oops/constMethod.hpp 2017-06-29 15:57:39.908519330 -0700 @@ -368,6 +368,10 @@ int size() const { return _constMethod_size;} void set_constMethod_size(int size) { _constMethod_size = size; } + + // ConstMethods 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 @@ -528,6 +532,8 @@ bool is_klass() const { return false; } DEBUG_ONLY(bool on_stack() { return false; }) + void metaspace_pointers_do(MetaspaceClosure* it); + MetaspaceObj::Type type() const { return ConstMethodType; } private: // Since the size of the compressed line number table is unknown, the // offsets of the other variable sized sections are computed backwards