src/share/vm/memory/allocation.cpp

changeset 4295
59c790074993
parent 4193
716c64bda5ba
child 4962
6f817ce50129
child 5241
f75faf51e8c4
     1.1 --- a/src/share/vm/memory/allocation.cpp	Wed Nov 28 08:43:26 2012 -0800
     1.2 +++ b/src/share/vm/memory/allocation.cpp	Wed Nov 28 17:50:21 2012 -0500
     1.3 @@ -66,10 +66,17 @@
     1.4  }
     1.5  
     1.6  bool MetaspaceObj::is_metadata() const {
     1.7 -  // ClassLoaderDataGraph::contains((address)this); has lock inversion problems
     1.8 +  // GC Verify checks use this in guarantees.
     1.9 +  // TODO: either replace them with is_metaspace_object() or remove them.
    1.10 +  // is_metaspace_object() is slower than this test.  This test doesn't
    1.11 +  // seem very useful for metaspace objects anymore though.
    1.12    return !Universe::heap()->is_in_reserved(this);
    1.13  }
    1.14  
    1.15 +bool MetaspaceObj::is_metaspace_object() const {
    1.16 +  return Metaspace::contains((void*)this);
    1.17 +}
    1.18 +
    1.19  void MetaspaceObj::print_address_on(outputStream* st) const {
    1.20    st->print(" {"INTPTR_FORMAT"}", this);
    1.21  }

mercurial