changeset 4951:ad22a9c14cd5

8033487: Improve GC option handling Summary: If there are not enough native resources to create the ReferenceHandler or Finalizer Java threads, the VM will attempt to throw an OOME before the java.lang.Class class has been initialized. This can result in assertion failures and other crashes. Move the initialization of the java.lang.Class class to just before the initialization of the java.lang.ref.Finalizer class. Reviewed-by: jwilhelm, dholmes, coleenp
author johnc
date Wed, 12 Dec 2012 12:07:32 -0800
parents bdb3798edd11
children eec4f2185a7d
files src/share/vm/runtime/thread.cpp
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/thread.cpp	Fri Feb 07 16:58:24 2014 -0800
+++ b/src/share/vm/runtime/thread.cpp	Wed Dec 12 12:07:32 2012 -0800
@@ -3505,11 +3505,12 @@
       java_lang_Thread::set_thread_status(thread_object,
                                           java_lang_Thread::RUNNABLE);
 
-      // The VM preresolve methods to these classes. Make sure that get initialized
+      // The VM creates & returns objects of this class. Make sure it's initialized.
+      initialize_class(vmSymbols::java_lang_Class(), CHECK_0);
+
+      // The VM preresolves methods to these classes. Make sure that they get initialized
       initialize_class(vmSymbols::java_lang_reflect_Method(), CHECK_0);
       initialize_class(vmSymbols::java_lang_ref_Finalizer(),  CHECK_0);
-      // The VM creates & returns objects of this class. Make sure it's initialized.
-      initialize_class(vmSymbols::java_lang_Class(), CHECK_0);
       call_initializeSystemClass(CHECK_0);
 
       // get the Java runtime name after java.lang.System is initialized