src/share/vm/runtime/thread.cpp

changeset 783
69fefd031e6c
parent 777
37f87013dfd8
parent 627
6d13fcb3663f
child 791
1ee8caae33af
     1.1 --- a/src/share/vm/runtime/thread.cpp	Mon Jun 23 16:49:37 2008 -0700
     1.2 +++ b/src/share/vm/runtime/thread.cpp	Tue Jun 24 13:20:34 2008 -0700
     1.3 @@ -2947,21 +2947,42 @@
     1.4      }
     1.5  
     1.6      if (AggressiveOpts) {
     1.7 -      // Forcibly initialize java/util/HashMap and mutate the private
     1.8 -      // static final "frontCacheEnabled" field before we start creating instances
     1.9 +      {
    1.10 +        // Forcibly initialize java/util/HashMap and mutate the private
    1.11 +        // static final "frontCacheEnabled" field before we start creating instances
    1.12  #ifdef ASSERT
    1.13 -      klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0);
    1.14 -      assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet");
    1.15 +        klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0);
    1.16 +        assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet");
    1.17  #endif
    1.18 -      klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0);
    1.19 -      KlassHandle k = KlassHandle(THREAD, k_o);
    1.20 -      guarantee(k.not_null(), "Must find java/util/HashMap");
    1.21 -      instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
    1.22 -      ik->initialize(CHECK_0);
    1.23 -      fieldDescriptor fd;
    1.24 -      // Possible we might not find this field; if so, don't break
    1.25 -      if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
    1.26 -        k()->bool_field_put(fd.offset(), true);
    1.27 +        klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0);
    1.28 +        KlassHandle k = KlassHandle(THREAD, k_o);
    1.29 +        guarantee(k.not_null(), "Must find java/util/HashMap");
    1.30 +        instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
    1.31 +        ik->initialize(CHECK_0);
    1.32 +        fieldDescriptor fd;
    1.33 +        // Possible we might not find this field; if so, don't break
    1.34 +        if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
    1.35 +          k()->bool_field_put(fd.offset(), true);
    1.36 +        }
    1.37 +      }
    1.38 +
    1.39 +      if (UseStringCache) {
    1.40 +        // Forcibly initialize java/lang/String and mutate the private
    1.41 +        // static final "stringCacheEnabled" field before we start creating instances
    1.42 +#ifdef ASSERT
    1.43 +        klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_lang_String(), Handle(), Handle(), CHECK_0);
    1.44 +        assert(tmp_k == NULL, "java/lang/String should not be loaded yet");
    1.45 +#endif
    1.46 +        klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_lang_String(), Handle(), Handle(), CHECK_0);
    1.47 +        KlassHandle k = KlassHandle(THREAD, k_o);
    1.48 +        guarantee(k.not_null(), "Must find java/lang/String");
    1.49 +        instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
    1.50 +        ik->initialize(CHECK_0);
    1.51 +        fieldDescriptor fd;
    1.52 +        // Possible we might not find this field; if so, don't break
    1.53 +        if (ik->find_local_field(vmSymbols::stringCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
    1.54 +          k()->bool_field_put(fd.offset(), true);
    1.55 +        }
    1.56        }
    1.57      }
    1.58  

mercurial