mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
6621621: HashMap front cache should be enabled only with AggressiveOpts
Reviewed-by: sbohne, xlu
This commit is contained in:
parent
10c473e425
commit
4abbae1fc2
2 changed files with 22 additions and 1 deletions
|
@ -96,6 +96,7 @@
|
||||||
template(java_util_Vector, "java/util/Vector") \
|
template(java_util_Vector, "java/util/Vector") \
|
||||||
template(java_util_AbstractList, "java/util/AbstractList") \
|
template(java_util_AbstractList, "java/util/AbstractList") \
|
||||||
template(java_util_Hashtable, "java/util/Hashtable") \
|
template(java_util_Hashtable, "java/util/Hashtable") \
|
||||||
|
template(java_util_HashMap, "java/util/HashMap") \
|
||||||
template(java_lang_Compiler, "java/lang/Compiler") \
|
template(java_lang_Compiler, "java/lang/Compiler") \
|
||||||
template(sun_misc_Signal, "sun/misc/Signal") \
|
template(sun_misc_Signal, "sun/misc/Signal") \
|
||||||
template(java_lang_AssertionStatusDirectives, "java/lang/AssertionStatusDirectives") \
|
template(java_lang_AssertionStatusDirectives, "java/lang/AssertionStatusDirectives") \
|
||||||
|
@ -281,6 +282,7 @@
|
||||||
template(park_event_name, "nativeParkEventPointer") \
|
template(park_event_name, "nativeParkEventPointer") \
|
||||||
template(cache_field_name, "cache") \
|
template(cache_field_name, "cache") \
|
||||||
template(value_name, "value") \
|
template(value_name, "value") \
|
||||||
|
template(frontCacheEnabled_name, "frontCacheEnabled") \
|
||||||
\
|
\
|
||||||
/* non-intrinsic name/signature pairs: */ \
|
/* non-intrinsic name/signature pairs: */ \
|
||||||
template(register_method_name, "register") \
|
template(register_method_name, "register") \
|
||||||
|
|
|
@ -2925,6 +2925,25 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
|
||||||
warning("java.lang.String not initialized");
|
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)
|
// Initialize java_lang.System (needed before creating the thread)
|
||||||
if (InitializeJavaLangSystem) {
|
if (InitializeJavaLangSystem) {
|
||||||
initialize_class(vmSymbolHandles::java_lang_System(), CHECK_0);
|
initialize_class(vmSymbolHandles::java_lang_System(), CHECK_0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue