hotspot/src/share/vm/oops/instanceKlass.hpp
changeset 14816 f2935b95cb54
parent 14477 95e66ea71f71
child 15097 9db149412e0e
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp	Fri Dec 07 10:55:16 2012 -0800
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp	Wed Dec 12 11:39:29 2012 -0500
@@ -538,6 +538,12 @@
     }
   }
 
+  // Oop that keeps the metadata for this class from being unloaded
+  // in places where the metadata is stored in other places, like nmethods
+  oop klass_holder() const {
+    return is_anonymous() ? java_mirror() : class_loader();
+  }
+
   // signers
   objArrayOop signers() const              { return _signers; }
   void set_signers(objArrayOop s)          { klass_oop_store((oop*)&_signers, s); }