src/share/vm/classfile/systemDictionary.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/classfile/systemDictionary.cpp	Tue Nov 11 16:54:08 2008
--- new/src/share/vm/classfile/systemDictionary.cpp	Tue Nov 11 16:54:08 2008

*** 935,944 **** --- 935,946 ---- // TODO consolidate the two methods with a helper routine? klassOop SystemDictionary::parse_stream(symbolHandle class_name, Handle class_loader, Handle protection_domain, ClassFileStream* st, + KlassHandle host_klass, + GrowableArray<Handle>* cp_patches, TRAPS) { symbolHandle parsed_name; // Parse the stream. Note that we do this even though this klass might // already be present in the SystemDictionary, otherwise we would not
*** 951,964 **** --- 953,966 ---- // java.lang.Object through resolve_or_fail, not this path. instanceKlassHandle k = ClassFileParser(st).parseClassFile(class_name, class_loader, protection_domain, + cp_patches, parsed_name, THREAD); // We don't redefine the class, so we just need to clean up whether there // was an error or not (don't want to modify any system dictionary // data structures). // Parsed name could be null if we threw an error before we got far // enough along to parse it -- in that case, there is nothing to clean up.
*** 971,980 **** --- 973,1006 ---- placeholders()->find_and_remove(p_index, p_hash, parsed_name, class_loader, THREAD); SystemDictionary_lock->notify_all(); } } + if (host_klass.not_null() && k.not_null()) { + assert(AnonymousClasses, ""); + // If it's anonymous, initialize it now, since nobody else will. + k->set_host_klass(host_klass()); + + { + MutexLocker mu_r(Compile_lock, THREAD); + + // Add to class hierarchy, initialize vtables, and do possible + // deoptimizations. + add_to_hierarchy(k, CHECK_NULL); // No exception, but can block + + // But, do not add to system dictionary. + } + + k->eager_initialize(THREAD); + + // notify jvmti + if (JvmtiExport::should_post_class_load()) { + assert(THREAD->is_Java_thread(), "thread->is_Java_thread()"); + JvmtiExport::post_class_load((JavaThread *) THREAD, k()); + } + } + return k(); } // Add a klass to the system from a stream (called by jni_DefineClass and // JVM_DefineClass).

src/share/vm/classfile/systemDictionary.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File