diff -r dfe27f03244a -r e9ff18c4ace7 src/share/vm/opto/compile.cpp --- a/src/share/vm/opto/compile.cpp Tue Jun 01 11:48:33 2010 -0700 +++ b/src/share/vm/opto/compile.cpp Wed Jun 02 22:45:42 2010 -0700 @@ -2176,14 +2176,14 @@ #ifdef _LP64 case Op_CastPP: - if (n->in(1)->is_DecodeN() && Universe::narrow_oop_use_implicit_null_checks()) { + if (n->in(1)->is_DecodeN() && Matcher::gen_narrow_oop_implicit_null_checks()) { Compile* C = Compile::current(); Node* in1 = n->in(1); const Type* t = n->bottom_type(); Node* new_in1 = in1->clone(); new_in1->as_DecodeN()->set_type(t); - if (!Matcher::clone_shift_expressions) { + if (!Matcher::narrow_oop_use_complex_address()) { // // x86, ARM and friends can handle 2 adds in addressing mode // and Matcher can fold a DecodeN node into address by using @@ -2231,8 +2231,12 @@ new_in2 = in2->in(1); } else if (in2->Opcode() == Op_ConP) { const Type* t = in2->bottom_type(); - if (t == TypePtr::NULL_PTR && Universe::narrow_oop_use_implicit_null_checks()) { - new_in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR); + if (t == TypePtr::NULL_PTR) { + // Don't convert CmpP null check into CmpN if compressed + // oops implicit null check is not generated. + // This will allow to generate normal oop implicit null check. + if (Matcher::gen_narrow_oop_implicit_null_checks()) + new_in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR); // // This transformation together with CastPP transformation above // will generated code for implicit NULL checks for compressed oops. @@ -2289,9 +2293,9 @@ case Op_DecodeN: assert(!n->in(1)->is_EncodeP(), "should be optimized out"); - // DecodeN could be pinned on Sparc where it can't be fold into + // DecodeN could be pinned when it can't be fold into // an address expression, see the code for Op_CastPP above. - assert(n->in(0) == NULL || !Matcher::clone_shift_expressions, "no control except on sparc"); + assert(n->in(0) == NULL || !Matcher::narrow_oop_use_complex_address(), "no control"); break; case Op_EncodeP: { @@ -2496,6 +2500,10 @@ } } + // Skip next transformation if compressed oops are not used. + if (!UseCompressedOops || !Matcher::gen_narrow_oop_implicit_null_checks()) + return; + // Go over safepoints nodes to skip DecodeN nodes for debug edges. // It could be done for an uncommon traps or any safepoints/calls // if the DecodeN node is referenced only in a debug info.