hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp
changeset 42650 1f304d0c888b
parent 40635 22fa174b2af8
child 46329 53ccc37bda19
--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Sun Dec 11 12:05:57 2016 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp	Sun Dec 11 19:07:04 2016 -0800
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "aot/aotLoader.hpp"
 #include "classfile/classFileStream.hpp"
 #include "classfile/metadataOnStackMark.hpp"
 #include "classfile/systemDictionary.hpp"
@@ -4011,8 +4012,18 @@
     scratch_class->enclosing_method_method_index());
   scratch_class->set_enclosing_method_indices(old_class_idx, old_method_idx);
 
+  // Replace fingerprint data
+  the_class->set_has_passed_fingerprint_check(scratch_class->has_passed_fingerprint_check());
+  the_class->store_fingerprint(scratch_class->get_stored_fingerprint());
+
   the_class->set_has_been_redefined();
 
+  if (!the_class->should_be_initialized()) {
+    // Class was already initialized, so AOT has only seen the original version.
+    // We need to let AOT look at it again.
+    AOTLoader::load_for_klass(the_class, THREAD);
+  }
+
   // keep track of previous versions of this class
   the_class->add_previous_version(scratch_class, emcp_method_count);