Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/thread.cpp @ 11154:02d7aa1456c9
8004872: Early loading of HashMap and StringValue under -XX:+AggressiveOpts can be removed
Summary: this fix also removes the -XX:+UseStringCache option
Reviewed-by: dholmes, acorn, iklam
author | ccheung |
---|---|
date | Thu, 18 Jul 2013 14:57:51 -0700 |
parents | 5e3b6f79d280 |
children | 6b0fd0964b87 f92b82d454fa 74608df95ba3 94c202aa2646 |
comparison
equal
deleted
inserted
replaced
11151:5e3b6f79d280 | 11154:02d7aa1456c9 |
---|---|
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()); |