--- old/src/hotspot/share/opto/phaseX.cpp 2017-10-24 09:09:29.415228208 +0200 +++ new/src/hotspot/share/opto/phaseX.cpp 2017-10-24 09:09:29.263220218 +0200 @@ -1625,6 +1625,17 @@ Node* imem = use->as_Initialize()->proj_out(TypeFunc::Memory); if (imem != NULL) add_users_to_worklist0(imem); } + // Loading the java mirror from a klass oop requires two loads and the type + // of the mirror load depends on the type of 'n'. See LoadNode::Value(). + // Also handle other raw memory users that depend on the type of the AddP. + if (use_op == Op_LoadP && use->bottom_type()->isa_rawptr()) { + for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { + Node* u = use->fast_out(i2); + if (u->is_Mem()) { + _worklist.push(u); + } + } + } } } @@ -1760,6 +1771,17 @@ worklist.push(phi); } } + // Loading the java mirror from a klass oop requires two loads and the type + // of the mirror load depends on the type of 'n'. See LoadNode::Value(). + // Also handle other raw memory users that depend on the type of the AddP. + if (m_op == Op_LoadP && m->bottom_type()->isa_rawptr()) { + for (DUIterator_Fast i2max, i2 = m->fast_outs(i2max); i2 < i2max; i2++) { + Node* u = m->fast_out(i2); + if (u->is_Mem() && u->bottom_type() != type(u)) { + worklist.push(u); + } + } + } } } }