diff src/share/vm/classfile/classFileParser.cpp @ 977:74a5db69c1fe

6419370: 4/4 new jmethodID code has tiny holes in synchronization Summary: Fix races in jmethodID cache and JNI itable index cache. Reviewed-by: ikrylov, acorn
author dcubed
date Mon, 21 Sep 2009 09:30:24 -0600
parents 83c29a26f67c
children 85f13cdfbc1d 2e8bdfdd3ba2
line wrap: on
line diff
--- a/src/share/vm/classfile/classFileParser.cpp	Wed Sep 16 15:42:46 2009 -0400
+++ b/src/share/vm/classfile/classFileParser.cpp	Mon Sep 21 09:30:24 2009 -0600
@@ -3231,6 +3231,12 @@
       this_klass->set_has_final_method();
     }
     this_klass->set_method_ordering(method_ordering());
+    // The instanceKlass::_methods_jmethod_ids cache and the
+    // instanceKlass::_methods_cached_itable_indices cache are
+    // both managed on the assumption that the initial cache
+    // size is equal to the number of methods in the class. If
+    // that changes, then instanceKlass::idnum_can_increment()
+    // has to be changed accordingly.
     this_klass->set_initial_method_idnum(methods->length());
     this_klass->set_name(cp->klass_name_at(this_class_index));
     if (LinkWellKnownClasses || is_anonymous())  // I am well known to myself