hotspot/src/share/vm/runtime/thread.cpp
changeset 19723 79c3f91dc0fa
parent 19553 9bbd930be684
parent 19713 8ef23b417f55
child 19973 d98623e1f50b
child 19959 29844efa0a6b
child 19986 33d188c66ed9
--- a/hotspot/src/share/vm/runtime/thread.cpp	Fri Aug 30 00:29:52 2013 -0700
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Mon Sep 02 13:13:45 2013 +0200
@@ -3636,6 +3636,16 @@
   CompileBroker::compilation_init();
 #endif
 
+  if (EnableInvokeDynamic) {
+    // Pre-initialize some JSR292 core classes to avoid deadlock during class loading.
+    // It is done after compilers are initialized, because otherwise compilations of
+    // signature polymorphic MH intrinsics can be missed
+    // (see SystemDictionary::find_method_handle_intrinsic).
+    initialize_class(vmSymbols::java_lang_invoke_MethodHandle(), CHECK_0);
+    initialize_class(vmSymbols::java_lang_invoke_MemberName(), CHECK_0);
+    initialize_class(vmSymbols::java_lang_invoke_MethodHandleNatives(), CHECK_0);
+  }
+
 #if INCLUDE_MANAGEMENT
   Management::initialize(THREAD);
 #endif // INCLUDE_MANAGEMENT