mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8001028: Improve GC option handling
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
This commit is contained in:
parent
9d5b19ab0a
commit
73843e1140
1 changed files with 4 additions and 3 deletions
|
@ -3527,11 +3527,12 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
|
|||
java_lang_Thread::set_thread_status(thread_object,
|
||||
java_lang_Thread::RUNNABLE);
|
||||
|
||||
// The VM preresolve methods to these classes. Make sure that 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);
|
||||
|
||||
// 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);
|
||||
call_initializeSystemClass(CHECK_0);
|
||||
|
||||
// get the Java runtime name after java.lang.System is initialized
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue