< prev index next >

src/hotspot/share/prims/jvmtiExport.hpp

Print this page

        

@@ -171,14 +171,14 @@
 
   // This flag indicates whether RedefineClasses() has ever redefined
   // 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
   // records all dependencies from startup. However if the capability is first
   // enabled some time later then the dependencies recorded by the compiler

@@ -186,14 +186,20 @@
   // dependency information is complete or not.
   static bool _all_dependencies_are_recorded;
 
  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;
   }
 
   inline static void set_all_dependencies_are_recorded(bool on) {
< prev index next >