src/hotspot/share/oops/instanceRefKlass.inline.hpp
changeset 50870 830b05ca7f58
parent 50752 9d62da00bf15
child 51516 7c3891b9f1e0
--- a/src/hotspot/share/oops/instanceRefKlass.inline.hpp	Thu Jun 28 01:10:09 2018 -0700
+++ b/src/hotspot/share/oops/instanceRefKlass.inline.hpp	Wed Jun 27 15:02:53 2018 +0200
@@ -89,17 +89,22 @@
 }
 
 template <typename T, class OopClosureType, class Contains>
+void InstanceRefKlass::oop_oop_iterate_discovered_and_discovery(oop obj, ReferenceType type, OopClosureType* closure, Contains& contains) {
+  // Explicitly apply closure to the discovered field.
+  do_discovered<T>(obj, closure, contains);
+  // Then do normal reference processing with discovery.
+  oop_oop_iterate_discovery<T>(obj, type, closure, contains);
+}
+
+template <typename T, class OopClosureType, class Contains>
 void InstanceRefKlass::oop_oop_iterate_fields(oop obj, OopClosureType* closure, Contains& contains) {
   do_referent<T>(obj, closure, contains);
   do_discovered<T>(obj, closure, contains);
 }
 
 template <typename T, class OopClosureType, class Contains>
-void InstanceRefKlass::oop_oop_iterate_discovered_and_discovery(oop obj, ReferenceType type, OopClosureType* closure, Contains& contains) {
-  // Explicitly apply closure to the discovered field.
+void InstanceRefKlass::oop_oop_iterate_fields_except_referent(oop obj, OopClosureType* closure, Contains& contains) {
   do_discovered<T>(obj, closure, contains);
-  // Then do normal reference processing with discovery.
-  oop_oop_iterate_discovery<T>(obj, type, closure, contains);
 }
 
 template <typename T, class OopClosureType, class Contains>
@@ -117,6 +122,10 @@
       trace_reference_gc<T>("do_fields", obj);
       oop_oop_iterate_fields<T>(obj, closure, contains);
       break;
+    case OopIterateClosure::DO_FIELDS_EXCEPT_REFERENT:
+      trace_reference_gc<T>("do_fields_except_referent", obj);
+      oop_oop_iterate_fields_except_referent<T>(obj, closure, contains);
+      break;
     default:
       ShouldNotReachHere();
   }