src/share/vm/prims/jvmtiRedefineClasses.cpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -4109,10 +4109,16 @@
 
   // increment the classRedefinedCount field in the_class and in any
   // direct and indirect subclasses of the_class
   increment_class_counter((InstanceKlass *)the_class(), THREAD);
 
+  if (the_class() == SystemDictionary::misc_Unsafe_klass()) {
+    // Update old Unsafe.throwIllegalAccessError() itable entries
+    UpdateITableThrowIllegalAccessErrorEntries updater;
+    ClassLoaderDataGraph::classes_do(&updater);
+  }
+
   // RC_TRACE macro has an embedded ResourceMark
   RC_TRACE_WITH_THREAD(0x00000001, THREAD,
     ("redefined name=%s, count=%d (avail_mem=" UINT64_FORMAT "K)",
     the_class->external_name(),
     java_lang_Class::classRedefinedCount(the_class_mirror),