提交 8a6c064f 编写于 作者: C ccheung

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
上级 892c54bb
...@@ -53,8 +53,6 @@ ...@@ -53,8 +53,6 @@
template(java_lang_Object, "java/lang/Object") \ template(java_lang_Object, "java/lang/Object") \
template(java_lang_Class, "java/lang/Class") \ template(java_lang_Class, "java/lang/Class") \
template(java_lang_String, "java/lang/String") \ template(java_lang_String, "java/lang/String") \
template(java_lang_StringValue, "java/lang/StringValue") \
template(java_lang_StringCache, "java/lang/StringValue$StringCache") \
template(java_lang_Thread, "java/lang/Thread") \ template(java_lang_Thread, "java/lang/Thread") \
template(java_lang_ThreadGroup, "java/lang/ThreadGroup") \ template(java_lang_ThreadGroup, "java/lang/ThreadGroup") \
template(java_lang_Cloneable, "java/lang/Cloneable") \ template(java_lang_Cloneable, "java/lang/Cloneable") \
...@@ -106,7 +104,6 @@ ...@@ -106,7 +104,6 @@
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") \
...@@ -367,8 +364,6 @@ ...@@ -367,8 +364,6 @@
template(offset_name, "offset") \ template(offset_name, "offset") \
template(count_name, "count") \ template(count_name, "count") \
template(hash_name, "hash") \ template(hash_name, "hash") \
template(frontCacheEnabled_name, "frontCacheEnabled") \
template(stringCacheEnabled_name, "stringCacheEnabled") \
template(numberOfLeadingZeros_name, "numberOfLeadingZeros") \ template(numberOfLeadingZeros_name, "numberOfLeadingZeros") \
template(numberOfTrailingZeros_name, "numberOfTrailingZeros") \ template(numberOfTrailingZeros_name, "numberOfTrailingZeros") \
template(bitCount_name, "bitCount") \ template(bitCount_name, "bitCount") \
......
...@@ -297,15 +297,6 @@ bool InlineTree::should_not_inline(ciMethod *callee_method, ...@@ -297,15 +297,6 @@ bool InlineTree::should_not_inline(ciMethod *callee_method,
} }
} }
if (UseStringCache) {
// Do not inline StringCache::profile() method used only at the beginning.
if (callee_method->name() == ciSymbol::profile_name() &&
callee_method->holder()->name() == ciSymbol::java_lang_StringCache()) {
set_msg("profiling method");
return true;
}
}
// use frequency-based objections only for non-trivial methods // use frequency-based objections only for non-trivial methods
if (callee_method->code_size() <= MaxTrivialSize) { if (callee_method->code_size() <= MaxTrivialSize) {
return false; return false;
......
...@@ -263,6 +263,7 @@ static ObsoleteFlag obsolete_jvm_flags[] = { ...@@ -263,6 +263,7 @@ static ObsoleteFlag obsolete_jvm_flags[] = {
{ "UseISM", JDK_Version::jdk(8), JDK_Version::jdk(9) }, { "UseISM", JDK_Version::jdk(8), JDK_Version::jdk(9) },
{ "UsePermISM", JDK_Version::jdk(8), JDK_Version::jdk(9) }, { "UsePermISM", JDK_Version::jdk(8), JDK_Version::jdk(9) },
{ "UseMPSS", JDK_Version::jdk(8), JDK_Version::jdk(9) }, { "UseMPSS", JDK_Version::jdk(8), JDK_Version::jdk(9) },
{ "UseStringCache", JDK_Version::jdk(8), JDK_Version::jdk(9) },
#ifdef PRODUCT #ifdef PRODUCT
{ "DesiredMethodLimit", { "DesiredMethodLimit",
JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) }, JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) },
......
...@@ -2589,9 +2589,6 @@ class CommandLineFlags { ...@@ -2589,9 +2589,6 @@ class CommandLineFlags {
product(bool, AggressiveOpts, false, \ product(bool, AggressiveOpts, false, \
"Enable aggressive optimizations - see arguments.cpp") \ "Enable aggressive optimizations - see arguments.cpp") \
\ \
product(bool, UseStringCache, false, \
"Enable String cache capabilities on String.java") \
\
/* statistics */ \ /* statistics */ \
develop(bool, CountCompiledCalls, false, \ develop(bool, CountCompiledCalls, false, \
"counts method invocations") \ "counts method invocations") \
......
...@@ -3490,44 +3490,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { ...@@ -3490,44 +3490,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
initialize_class(vmSymbols::java_lang_String(), CHECK_0); initialize_class(vmSymbols::java_lang_String(), CHECK_0);
if (AggressiveOpts) {
{
// Forcibly initialize java/util/HashMap and mutate the private
// static final "frontCacheEnabled" field before we start creating instances
#ifdef ASSERT
Klass* tmp_k = SystemDictionary::find(vmSymbols::java_util_HashMap(), Handle(), Handle(), CHECK_0);
assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet");
#endif
Klass* k_o = SystemDictionary::resolve_or_null(vmSymbols::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()->java_mirror()->bool_field_put(fd.offset(), true);
}
}
if (UseStringCache) {
// Forcibly initialize java/lang/StringValue and mutate the private
// static final "stringCacheEnabled" field before we start creating instances
Klass* k_o = SystemDictionary::resolve_or_null(vmSymbols::java_lang_StringValue(), Handle(), Handle(), CHECK_0);
// Possible that StringValue isn't present: if so, silently don't break
if (k_o != NULL) {
KlassHandle k = KlassHandle(THREAD, k_o);
instanceKlassHandle ik = instanceKlassHandle(THREAD, k());
ik->initialize(CHECK_0);
fieldDescriptor fd;
// Possible we might not find this field: if so, silently don't break
if (ik->find_local_field(vmSymbols::stringCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) {
k()->java_mirror()->bool_field_put(fd.offset(), true);
}
}
}
}
// Initialize java_lang.System (needed before creating the thread) // Initialize java_lang.System (needed before creating the thread)
initialize_class(vmSymbols::java_lang_System(), CHECK_0); initialize_class(vmSymbols::java_lang_System(), CHECK_0);
initialize_class(vmSymbols::java_lang_ThreadGroup(), CHECK_0); initialize_class(vmSymbols::java_lang_ThreadGroup(), CHECK_0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册