--- old/src/hotspot/share/memory/metaspaceClosure.hpp 2019-10-10 17:16:38.662262762 -0700 +++ new/src/hotspot/share/memory/metaspaceClosure.hpp 2019-10-10 17:16:38.406253574 -0700 @@ -75,6 +75,10 @@ _default }; + enum SpecialRef { + _method_entry_ref + }; + // class MetaspaceClosure::Ref -- // // MetaspaceClosure can be viewed as a very simple type of copying garbage @@ -278,6 +282,16 @@ template void push(T** mpp, Writability w = _default) { push_impl(new ObjectRef(mpp, w)); } + + template void push_method_entry(T** mpp, intptr_t* p) { + push_special(_method_entry_ref, new ObjectRef(mpp, _default), (intptr_t*)p); + } + + // This is for tagging special pointers that are not a reference to MetaspaceObj. It's currently + // used to mark the method entry points in Method/ConstMethod. + virtual void push_special(SpecialRef type, Ref* obj, intptr_t* p) { + assert(type == _method_entry_ref, "only special type allowed for now"); + } }; // This is a special MetaspaceClosure that visits each unique MetaspaceObj once.