--- old/src/share/vm/memory/iterator.hpp 2017-04-11 12:39:03.040807549 +0200 +++ new/src/share/vm/memory/iterator.hpp 2017-04-11 12:39:02.900802030 +0200 @@ -65,6 +65,16 @@ public: ReferenceProcessor* ref_processor() const { return _ref_processor; } + // Iteration of InstanceRefKlasses differ depending on the closure, + // the below enum describes the different alternatives. + enum ReferenceIterationMode { + DO_DISCOVERY, // Tries to discover references + DO_FIELDS // No discovery, just apply closure to all fields + }; + + // The current default iteration mode is to do discovery. + virtual ReferenceIterationMode reference_iteration_mode() { return DO_DISCOVERY; } + // If the do_metadata functions return "true", // we invoke the following when running oop_iterate(): //