< prev index next >

src/hotspot/share/memory/metaspaceClosure.hpp

Print this page

*** 73,82 **** --- 73,86 ---- _writable, _not_writable, _default }; + enum SpecialRef { + _method_entry_ref + }; + // class MetaspaceClosure::Ref -- // // MetaspaceClosure can be viewed as a very simple type of copying garbage // collector. For it to function properly, it requires each subclass of // MetaspaceObj to provide two methods:
*** 276,285 **** --- 280,299 ---- // If the above function doesn't match (mpp is not an Array<> type), then // this will be matched by default. template <class T> void push(T** mpp, Writability w = _default) { push_impl(new ObjectRef<T>(mpp, w)); } + + template <class T> void push_method_entry(T** mpp, intptr_t* p) { + push_special(_method_entry_ref, new ObjectRef<T>(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. class UniqueMetaspaceClosure : public MetaspaceClosure { static const int INITIAL_TABLE_SIZE = 15889;
< prev index next >