hotspot/src/share/vm/memory/allocation.cpp
changeset 14579 7f6ce6e3dd80
parent 14120 7d298141c258
child 17026 72b2233861f1
child 18055 ba8c01e0d016
--- a/hotspot/src/share/vm/memory/allocation.cpp	Wed Nov 28 08:43:26 2012 -0800
+++ b/hotspot/src/share/vm/memory/allocation.cpp	Wed Nov 28 17:50:21 2012 -0500
@@ -66,10 +66,17 @@
 }
 
 bool MetaspaceObj::is_metadata() const {
-  // ClassLoaderDataGraph::contains((address)this); has lock inversion problems
+  // GC Verify checks use this in guarantees.
+  // TODO: either replace them with is_metaspace_object() or remove them.
+  // is_metaspace_object() is slower than this test.  This test doesn't
+  // seem very useful for metaspace objects anymore though.
   return !Universe::heap()->is_in_reserved(this);
 }
 
+bool MetaspaceObj::is_metaspace_object() const {
+  return Metaspace::contains((void*)this);
+}
+
 void MetaspaceObj::print_address_on(outputStream* st) const {
   st->print(" {"INTPTR_FORMAT"}", this);
 }