2945 } else { |
2945 } else { |
2946 warning("java.lang.String not initialized"); |
2946 warning("java.lang.String not initialized"); |
2947 } |
2947 } |
2948 |
2948 |
2949 if (AggressiveOpts) { |
2949 if (AggressiveOpts) { |
2950 // Forcibly initialize java/util/HashMap and mutate the private |
2950 { |
2951 // static final "frontCacheEnabled" field before we start creating instances |
2951 // Forcibly initialize java/util/HashMap and mutate the private |
|
2952 // static final "frontCacheEnabled" field before we start creating instances |
2952 #ifdef ASSERT |
2953 #ifdef ASSERT |
2953 klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0); |
2954 klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0); |
2954 assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet"); |
2955 assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet"); |
2955 #endif |
2956 #endif |
2956 klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0); |
2957 klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0); |
2957 KlassHandle k = KlassHandle(THREAD, k_o); |
2958 KlassHandle k = KlassHandle(THREAD, k_o); |
2958 guarantee(k.not_null(), "Must find java/util/HashMap"); |
2959 guarantee(k.not_null(), "Must find java/util/HashMap"); |
2959 instanceKlassHandle ik = instanceKlassHandle(THREAD, k()); |
2960 instanceKlassHandle ik = instanceKlassHandle(THREAD, k()); |
2960 ik->initialize(CHECK_0); |
2961 ik->initialize(CHECK_0); |
2961 fieldDescriptor fd; |
2962 fieldDescriptor fd; |
2962 // Possible we might not find this field; if so, don't break |
2963 // Possible we might not find this field; if so, don't break |
2963 if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) { |
2964 if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) { |
2964 k()->bool_field_put(fd.offset(), true); |
2965 k()->bool_field_put(fd.offset(), true); |
|
2966 } |
|
2967 } |
|
2968 |
|
2969 if (UseStringCache) { |
|
2970 // Forcibly initialize java/lang/String and mutate the private |
|
2971 // static final "stringCacheEnabled" field before we start creating instances |
|
2972 #ifdef ASSERT |
|
2973 klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_lang_String(), Handle(), Handle(), CHECK_0); |
|
2974 assert(tmp_k == NULL, "java/lang/String should not be loaded yet"); |
|
2975 #endif |
|
2976 klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_lang_String(), Handle(), Handle(), CHECK_0); |
|
2977 KlassHandle k = KlassHandle(THREAD, k_o); |
|
2978 guarantee(k.not_null(), "Must find java/lang/String"); |
|
2979 instanceKlassHandle ik = instanceKlassHandle(THREAD, k()); |
|
2980 ik->initialize(CHECK_0); |
|
2981 fieldDescriptor fd; |
|
2982 // Possible we might not find this field; if so, don't break |
|
2983 if (ik->find_local_field(vmSymbols::stringCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) { |
|
2984 k()->bool_field_put(fd.offset(), true); |
|
2985 } |
2965 } |
2986 } |
2966 } |
2987 } |
2967 |
2988 |
2968 // Initialize java_lang.System (needed before creating the thread) |
2989 // Initialize java_lang.System (needed before creating the thread) |
2969 if (InitializeJavaLangSystem) { |
2990 if (InitializeJavaLangSystem) { |