src/hotspot/share/memory/heapInspection.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54786 ebf733a324d4
child 58679 9c3209ff7550
--- a/src/hotspot/share/memory/heapInspection.cpp	Thu Oct 17 20:27:44 2019 +0100
+++ b/src/hotspot/share/memory/heapInspection.cpp	Thu Oct 17 20:53:35 2019 +0100
@@ -123,7 +123,7 @@
 
 KlassInfoEntry* KlassInfoBucket::lookup(Klass* const k) {
   // Can happen if k is an archived class that we haven't loaded yet.
-  if (k->java_mirror() == NULL) {
+  if (k->java_mirror_no_keepalive() == NULL) {
     return NULL;
   }
 
@@ -719,7 +719,7 @@
   ResourceMark rm;
 
   RecordInstanceClosure ric(cit, filter);
-  Universe::heap()->object_iterate(&ric);
+  Universe::heap()->safe_object_iterate(&ric);
   return ric.missed_count();
 }
 
@@ -792,8 +792,5 @@
 
   // Iterate over objects in the heap
   FindInstanceClosure fic(k, result);
-  // If this operation encounters a bad object when using CMS,
-  // consider using safe_object_iterate() which avoids metadata
-  // objects that may contain bad references.
-  Universe::heap()->object_iterate(&fic);
+  Universe::heap()->safe_object_iterate(&fic);
 }