hotspot/src/share/vm/runtime/thread.cpp
changeset 18946 65a870954fd7
parent 18943 7d0ef675e808
child 19713 8ef23b417f55
child 19553 9bbd930be684
child 22823 40b2c6c30123
equal deleted inserted replaced
18943:7d0ef675e808 18946:65a870954fd7
  3488       create_vm_init_libraries();
  3488       create_vm_init_libraries();
  3489     }
  3489     }
  3490 
  3490 
  3491     initialize_class(vmSymbols::java_lang_String(), CHECK_0);
  3491     initialize_class(vmSymbols::java_lang_String(), CHECK_0);
  3492 
  3492 
  3493     if (AggressiveOpts) {
       
  3494       {
       
  3495         // Forcibly initialize java/util/HashMap and mutate the private
       
  3496         // static final "frontCacheEnabled" field before we start creating instances
       
  3497 #ifdef ASSERT
       
  3498         Klass* tmp_k = SystemDictionary::find(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0);
       
  3499         assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet");
       
  3500 #endif
       
  3501         Klass* k_o = SystemDictionary::resolve_or_null(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0);
       
  3502         KlassHandle k = KlassHandle(THREAD, k_o);
       
  3503         guarantee(k.not_null(), "Must find java/util/HashMap");
       
  3504         instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
       
  3505         ik->initialize(CHECK_0);
       
  3506         fieldDescriptor fd;
       
  3507         // Possible we might not find this field; if so, don't break
       
  3508         if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
       
  3509           k()->java_mirror()->bool_field_put(fd.offset(), true);
       
  3510         }
       
  3511       }
       
  3512 
       
  3513       if (UseStringCache) {
       
  3514         // Forcibly initialize java/lang/StringValue and mutate the private
       
  3515         // static final "stringCacheEnabled" field before we start creating instances
       
  3516         Klass* k_o = SystemDictionary::resolve_or_null(vmSymbols::java_lang_StringValue(), Handle(), Handle(), CHECK_0);
       
  3517         // Possible that StringValue isn't present: if so, silently don't break
       
  3518         if (k_o != NULL) {
       
  3519           KlassHandle k = KlassHandle(THREAD, k_o);
       
  3520           instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
       
  3521           ik->initialize(CHECK_0);
       
  3522           fieldDescriptor fd;
       
  3523           // Possible we might not find this field: if so, silently don't break
       
  3524           if (ik->find_local_field(vmSymbols::stringCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
       
  3525             k()->java_mirror()->bool_field_put(fd.offset(), true);
       
  3526           }
       
  3527         }
       
  3528       }
       
  3529     }
       
  3530 
       
  3531     // Initialize java_lang.System (needed before creating the thread)
  3493     // Initialize java_lang.System (needed before creating the thread)
  3532     initialize_class(vmSymbols::java_lang_System(), CHECK_0);
  3494     initialize_class(vmSymbols::java_lang_System(), CHECK_0);
  3533     initialize_class(vmSymbols::java_lang_ThreadGroup(), CHECK_0);
  3495     initialize_class(vmSymbols::java_lang_ThreadGroup(), CHECK_0);
  3534     Handle thread_group = create_initial_thread_group(CHECK_0);
  3496     Handle thread_group = create_initial_thread_group(CHECK_0);
  3535     Universe::set_main_thread_group(thread_group());
  3497     Universe::set_main_thread_group(thread_group());