--- old/src/share/vm/opto/mulnode.cpp 2017-08-04 21:19:39.668315352 +0200 +++ new/src/share/vm/opto/mulnode.cpp 2017-08-04 21:19:32.662326661 +0200 @@ -155,6 +155,18 @@ if( t2->higher_equal( zero ) ) return zero; } + // Code pattern on return from a call that returns an __Value. Can + // be optimized away if the return value turns out to be an oop. + if (op == Op_AndX && + in(1) != NULL && + in(1)->Opcode() == Op_CastP2X && + in(1)->in(1) != NULL && + phase->type(in(1)->in(1))->isa_oopptr() && + t2->isa_intptr_t()->_lo >= 0 && + t2->isa_intptr_t()->_hi <= MinObjAlignmentInBytesMask) { + return add_id(); + } + // Either input is BOTTOM ==> the result is the local BOTTOM if( t1 == Type::BOTTOM || t2 == Type::BOTTOM ) return bottom_type();