From 1d68510adbde3b9a7bb1a6a470bce4224ad4d450 Mon Sep 17 00:00:00 2001 From: coleenp Date: Tue, 2 Sep 2008 15:18:26 -0400 Subject: [PATCH] 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 --- src/share/vm/opto/compile.cpp | 2 +- src/share/vm/runtime/arguments.cpp | 14 ++++++++------ src/share/vm/runtime/globals.hpp | 3 +++ src/share/vm/runtime/virtualspace.cpp | 6 ++++-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/share/vm/opto/compile.cpp b/src/share/vm/opto/compile.cpp index 18114bafc..8a0a9848c 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 d27421469..62e764d1a 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 f06fa3cef..4f4b9b54b 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 44471632d..fbbafef2c 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); } -- GitLab