src/share/vm/runtime/thread.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hs25_8004872 Sdiff src/share/vm/runtime

src/share/vm/runtime/thread.cpp

Print this page




3465     MetaspaceShared::preload_and_dump(CHECK_0);
3466     ShouldNotReachHere();
3467   }
3468 
3469   // Always call even when there are not JVMTI environments yet, since environments
3470   // may be attached late and JVMTI must track phases of VM execution
3471   JvmtiExport::enter_start_phase();
3472 
3473   // Notify JVMTI agents that VM has started (JNI is up) - nop if no agents.
3474   JvmtiExport::post_vm_start();
3475 
3476   {
3477     TraceTime timer("Initialize java.lang classes", TraceStartupTime);
3478 
3479     if (EagerXrunInit && Arguments::init_libraries_at_startup()) {
3480       create_vm_init_libraries();
3481     }
3482 
3483     initialize_class(vmSymbols::java_lang_String(), CHECK_0);
3484 
3485     if (AggressiveOpts) {
3486       {
3487         // Forcibly initialize java/util/HashMap and mutate the private
3488         // static final "frontCacheEnabled" field before we start creating instances
3489 #ifdef ASSERT
3490         Klass* tmp_k = SystemDictionary::find(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0);
3491         assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet");
3492 #endif
3493         Klass* k_o = SystemDictionary::resolve_or_null(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0);
3494         KlassHandle k = KlassHandle(THREAD, k_o);
3495         guarantee(k.not_null(), "Must find java/util/HashMap");
3496         instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
3497         ik->initialize(CHECK_0);
3498         fieldDescriptor fd;
3499         // Possible we might not find this field; if so, don't break
3500         if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
3501           k()->java_mirror()->bool_field_put(fd.offset(), true);
3502         }
3503       }
3504 
3505       if (UseStringCache) {
3506         // Forcibly initialize java/lang/StringValue and mutate the private
3507         // static final "stringCacheEnabled" field before we start creating instances
3508         Klass* k_o = SystemDictionary::resolve_or_null(vmSymbols::java_lang_StringValue(), Handle(), Handle(), CHECK_0);
3509         // Possible that StringValue isn't present: if so, silently don't break
3510         if (k_o != NULL) {
3511           KlassHandle k = KlassHandle(THREAD, k_o);
3512           instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
3513           ik->initialize(CHECK_0);
3514           fieldDescriptor fd;
3515           // Possible we might not find this field: if so, silently don't break
3516           if (ik->find_local_field(vmSymbols::stringCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
3517             k()->java_mirror()->bool_field_put(fd.offset(), true);
3518           }
3519         }
3520       }
3521     }
3522 
3523     // Initialize java_lang.System (needed before creating the thread)
3524     initialize_class(vmSymbols::java_lang_System(), CHECK_0);
3525     initialize_class(vmSymbols::java_lang_ThreadGroup(), CHECK_0);
3526     Handle thread_group = create_initial_thread_group(CHECK_0);
3527     Universe::set_main_thread_group(thread_group());
3528     initialize_class(vmSymbols::java_lang_Thread(), CHECK_0);
3529     oop thread_object = create_initial_thread(thread_group, main_thread, CHECK_0);
3530     main_thread->set_threadObj(thread_object);
3531     // Set thread status to running since main thread has
3532     // been started and running.
3533     java_lang_Thread::set_thread_status(thread_object,
3534                                         java_lang_Thread::RUNNABLE);
3535 
3536     // The VM creates & returns objects of this class. Make sure it's initialized.
3537     initialize_class(vmSymbols::java_lang_Class(), CHECK_0);
3538 
3539     // The VM preresolves methods to these classes. Make sure that they get initialized
3540     initialize_class(vmSymbols::java_lang_reflect_Method(), CHECK_0);
3541     initialize_class(vmSymbols::java_lang_ref_Finalizer(),  CHECK_0);
3542     call_initializeSystemClass(CHECK_0);




3465     MetaspaceShared::preload_and_dump(CHECK_0);
3466     ShouldNotReachHere();
3467   }
3468 
3469   // Always call even when there are not JVMTI environments yet, since environments
3470   // may be attached late and JVMTI must track phases of VM execution
3471   JvmtiExport::enter_start_phase();
3472 
3473   // Notify JVMTI agents that VM has started (JNI is up) - nop if no agents.
3474   JvmtiExport::post_vm_start();
3475 
3476   {
3477     TraceTime timer("Initialize java.lang classes", TraceStartupTime);
3478 
3479     if (EagerXrunInit && Arguments::init_libraries_at_startup()) {
3480       create_vm_init_libraries();
3481     }
3482 
3483     initialize_class(vmSymbols::java_lang_String(), CHECK_0);
3484 






































3485     // Initialize java_lang.System (needed before creating the thread)
3486     initialize_class(vmSymbols::java_lang_System(), CHECK_0);
3487     initialize_class(vmSymbols::java_lang_ThreadGroup(), CHECK_0);
3488     Handle thread_group = create_initial_thread_group(CHECK_0);
3489     Universe::set_main_thread_group(thread_group());
3490     initialize_class(vmSymbols::java_lang_Thread(), CHECK_0);
3491     oop thread_object = create_initial_thread(thread_group, main_thread, CHECK_0);
3492     main_thread->set_threadObj(thread_object);
3493     // Set thread status to running since main thread has
3494     // been started and running.
3495     java_lang_Thread::set_thread_status(thread_object,
3496                                         java_lang_Thread::RUNNABLE);
3497 
3498     // The VM creates & returns objects of this class. Make sure it's initialized.
3499     initialize_class(vmSymbols::java_lang_Class(), CHECK_0);
3500 
3501     // The VM preresolves methods to these classes. Make sure that they get initialized
3502     initialize_class(vmSymbols::java_lang_reflect_Method(), CHECK_0);
3503     initialize_class(vmSymbols::java_lang_ref_Finalizer(),  CHECK_0);
3504     call_initializeSystemClass(CHECK_0);


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