Mercurial > hg > truffle
diff src/share/vm/runtime/thread.cpp @ 18:c7d713375c94
6621621: HashMap front cache should be enabled only with AggressiveOpts
Reviewed-by: sbohne, xlu
author | phh |
---|---|
date | Wed, 05 Dec 2007 09:02:00 -0800 |
parents | a61af66fc99e |
children | 75b0f3cb1943 |
line wrap: on
line diff
--- a/src/share/vm/runtime/thread.cpp Wed Dec 05 09:01:00 2007 -0800 +++ b/src/share/vm/runtime/thread.cpp Wed Dec 05 09:02:00 2007 -0800 @@ -2925,6 +2925,25 @@ warning("java.lang.String not initialized"); } + if (AggressiveOpts) { + // Forcibly initialize java/util/HashMap and mutate the private + // static final "frontCacheEnabled" field before we start creating instances +#ifdef ASSERT + klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0); + assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet"); +#endif + klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0); + KlassHandle k = KlassHandle(THREAD, k_o); + guarantee(k.not_null(), "Must find java/util/HashMap"); + instanceKlassHandle ik = instanceKlassHandle(THREAD, k()); + ik->initialize(CHECK_0); + fieldDescriptor fd; + // Possible we might not find this field; if so, don't break + if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) { + k()->bool_field_put(fd.offset(), true); + } + } + // Initialize java_lang.System (needed before creating the thread) if (InitializeJavaLangSystem) { initialize_class(vmSymbolHandles::java_lang_System(), CHECK_0);