--- old/src/hotspot/share/prims/jvmtiExport.hpp 2019-09-25 09:46:49.663919511 -0400 +++ new/src/hotspot/share/prims/jvmtiExport.hpp 2019-09-25 09:46:49.399919520 -0400 @@ -173,10 +173,10 @@ // one or more classes during the lifetime of the VM. The flag should // only be set by the friend class and can be queried by other sub // systems as needed to relax invariant checks. - static bool _has_redefined_a_class; + static int _redefinition_count; friend class VM_RedefineClasses; - inline static void set_has_redefined_a_class() { - JVMTI_ONLY(_has_redefined_a_class = true;) + inline static void increment_redefinition_count() { + JVMTI_ONLY(_redefinition_count++;) } // Flag to indicate if the compiler has recorded all dependencies. When the // can_redefine_classes capability is enabled in the OnLoad phase then the compiler @@ -188,10 +188,16 @@ public: inline static bool has_redefined_a_class() { - JVMTI_ONLY(return _has_redefined_a_class); + JVMTI_ONLY(return _redefinition_count != 0); NOT_JVMTI(return false); } + // Only set in safepoint, so no memory ordering needed. + inline static int redefinition_count() { return _redefinition_count; } + + // Set by ciReplay + inline static void set_redefinition_count(int value) { _redefinition_count = value; } + inline static bool all_dependencies_are_recorded() { return _all_dependencies_are_recorded; }