diff --git a/src/share/vm/opto/compile.cpp b/src/share/vm/opto/compile.cpp index 18114bafc8073d76788766903fb692b11aa8a812..8a0a9848c0961273efd91aab1f95ea12e824ad47 100644 --- a/src/share/vm/opto/compile.cpp +++ b/src/share/vm/opto/compile.cpp @@ -2082,7 +2082,7 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { in2 = n->in(2)->in(1); } else if ( n->in(2)->Opcode() == Op_ConP ) { const Type* t = n->in(2)->bottom_type(); - if (t == TypePtr::NULL_PTR) { + if (t == TypePtr::NULL_PTR && UseImplicitNullCheckForNarrowOop) { Node *in1 = n->in(1); if (Matcher::clone_shift_expressions) { // x86, ARM and friends can handle 2 adds in addressing mode. diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index d274214695a0aae57aa61ebf425c05e1eeded59c..62e764d1a7a660fbf29f32975282e0671f009bbb 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -1204,15 +1204,17 @@ void Arguments::set_ergonomics_flags() { // Turn off until bug is fixed. // 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 { if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) { // If specified, give a warning - if (UseConcMarkSweepGC){ - warning("Compressed Oops does not work with CMS"); - } else { - warning( - "Max heap size too large for Compressed Oops"); - } + warning( "Max heap size too large for Compressed Oops"); FLAG_SET_DEFAULT(UseCompressedOops, false); } } diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp index f06fa3cef729414efa6b25ff176f9796b19f29a2..4f4b9b54bcd45f11b1bec2ffe6a11e1fb6f2768d 100644 --- a/src/share/vm/runtime/globals.hpp +++ b/src/share/vm/runtime/globals.hpp @@ -294,6 +294,9 @@ class CommandLineFlags { lp64_product(bool, CheckCompressedOops, trueInDebug, \ "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 \ * removal testing. It was supposed to be removed before FCS but has \ * been re-added (see 6401008) */ \ diff --git a/src/share/vm/runtime/virtualspace.cpp b/src/share/vm/runtime/virtualspace.cpp index 44471632df65d1c6dc99d7925ea1d96b253c0200..fbbafef2c5f2deaac4cd8e48ce77b9578071f0ab 100644 --- a/src/share/vm/runtime/virtualspace.cpp +++ b/src/share/vm/runtime/virtualspace.cpp @@ -380,7 +380,8 @@ ReservedHeapSpace::ReservedHeapSpace(size_t size, size_t alignment, bool large, char* requested_address) : ReservedSpace(size, alignment, large, 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 // if using compressed oops. protect_noaccess_prefix(size); @@ -391,7 +392,8 @@ ReservedHeapSpace::ReservedHeapSpace(const size_t prefix_size, const size_t suffix_size, const size_t 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); }