提交 1d68510a 编写于 作者: C coleenp

6741004: UseLargePages + UseCompressedOops breaks implicit null checking guard page

Summary: Turn off c2 implicit null checking on windows and large pages specified.
Reviewed-by: jrose, xlu
上级 7f9f4b1a
...@@ -2082,7 +2082,7 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { ...@@ -2082,7 +2082,7 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) {
in2 = n->in(2)->in(1); in2 = n->in(2)->in(1);
} else if ( n->in(2)->Opcode() == Op_ConP ) { } else if ( n->in(2)->Opcode() == Op_ConP ) {
const Type* t = n->in(2)->bottom_type(); const Type* t = n->in(2)->bottom_type();
if (t == TypePtr::NULL_PTR) { if (t == TypePtr::NULL_PTR && UseImplicitNullCheckForNarrowOop) {
Node *in1 = n->in(1); Node *in1 = n->in(1);
if (Matcher::clone_shift_expressions) { if (Matcher::clone_shift_expressions) {
// x86, ARM and friends can handle 2 adds in addressing mode. // x86, ARM and friends can handle 2 adds in addressing mode.
......
...@@ -1204,15 +1204,17 @@ void Arguments::set_ergonomics_flags() { ...@@ -1204,15 +1204,17 @@ void Arguments::set_ergonomics_flags() {
// Turn off until bug is fixed. // Turn off until bug is fixed.
// FLAG_SET_ERGO(bool, UseCompressedOops, true); // FLAG_SET_ERGO(bool, UseCompressedOops, true);
} }
#ifdef _WIN64
if (UseLargePages && UseCompressedOops) {
// Cannot allocate guard pages for implicit checks in indexed addressing
// mode, when large pages are specified on windows.
FLAG_SET_DEFAULT(UseImplicitNullCheckForNarrowOop, false);
}
#endif // _WIN64
} else { } else {
if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) { if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
// If specified, give a warning // If specified, give a warning
if (UseConcMarkSweepGC){ warning( "Max heap size too large for Compressed Oops");
warning("Compressed Oops does not work with CMS");
} else {
warning(
"Max heap size too large for Compressed Oops");
}
FLAG_SET_DEFAULT(UseCompressedOops, false); FLAG_SET_DEFAULT(UseCompressedOops, false);
} }
} }
......
...@@ -294,6 +294,9 @@ class CommandLineFlags { ...@@ -294,6 +294,9 @@ class CommandLineFlags {
lp64_product(bool, CheckCompressedOops, trueInDebug, \ lp64_product(bool, CheckCompressedOops, trueInDebug, \
"generate checks in encoding/decoding code") \ "generate checks in encoding/decoding code") \
\ \
product(bool, UseImplicitNullCheckForNarrowOop, true, \
"generate implicit null check in indexed addressing mode.") \
\
/* UseMembar is theoretically a temp flag used for memory barrier \ /* UseMembar is theoretically a temp flag used for memory barrier \
* removal testing. It was supposed to be removed before FCS but has \ * removal testing. It was supposed to be removed before FCS but has \
* been re-added (see 6401008) */ \ * been re-added (see 6401008) */ \
......
...@@ -380,7 +380,8 @@ ReservedHeapSpace::ReservedHeapSpace(size_t size, size_t alignment, ...@@ -380,7 +380,8 @@ ReservedHeapSpace::ReservedHeapSpace(size_t size, size_t alignment,
bool large, char* requested_address) : bool large, char* requested_address) :
ReservedSpace(size, alignment, large, ReservedSpace(size, alignment, large,
requested_address, requested_address,
UseCompressedOops ? lcm(os::vm_page_size(), alignment) : 0) { UseCompressedOops && UseImplicitNullCheckForNarrowOop ?
lcm(os::vm_page_size(), alignment) : 0) {
// Only reserved space for the java heap should have a noaccess_prefix // Only reserved space for the java heap should have a noaccess_prefix
// if using compressed oops. // if using compressed oops.
protect_noaccess_prefix(size); protect_noaccess_prefix(size);
...@@ -391,7 +392,8 @@ ReservedHeapSpace::ReservedHeapSpace(const size_t prefix_size, ...@@ -391,7 +392,8 @@ ReservedHeapSpace::ReservedHeapSpace(const size_t prefix_size,
const size_t suffix_size, const size_t suffix_size,
const size_t suffix_align) : const size_t suffix_align) :
ReservedSpace(prefix_size, prefix_align, suffix_size, suffix_align, ReservedSpace(prefix_size, prefix_align, suffix_size, suffix_align,
UseCompressedOops ? lcm(os::vm_page_size(), prefix_align) : 0) { UseCompressedOops && UseImplicitNullCheckForNarrowOop ?
lcm(os::vm_page_size(), prefix_align) : 0) {
protect_noaccess_prefix(prefix_size+suffix_size); protect_noaccess_prefix(prefix_size+suffix_size);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册