--- old/src/share/vm/opto/machnode.cpp 2012-10-08 20:36:41.925124422 +0200 +++ new/src/share/vm/opto/machnode.cpp 2012-10-08 20:36:41.729915483 +0200 @@ -265,7 +265,8 @@ // See if it adds up to a base + offset. if (index != NULL) { const Type* t_index = index->bottom_type(); - if (t_index->isa_narrowoop()) { // EncodeN, LoadN, LoadConN, LoadNKlass. + if (t_index->isa_narrowoop() || t_index->isa_narrowklass()) { // EncodeN, LoadN, LoadConN, LoadNKlass, + // EncodeNKlass, LoadConNklass. // Memory references through narrow oops have a // funny base so grab the type from the index: // [R12 + narrow_oop_reg<<3 + offset] @@ -352,6 +353,10 @@ // 32-bit unscaled narrow oop can be the base of any address expression t = t->make_ptr(); } + if (UseCompressedKlassPointers && Universe::narrow_klass_shift() == 0) { + // 32-bit unscaled narrow oop can be the base of any address expression + t = t->make_ptr(); + } if (t->isa_intptr_t() && offset != 0 && offset != Type::OffsetBot) { // We cannot assert that the offset does not look oop-ish here. // Depending on the heap layout the cardmark base could land