hotspot/src/share/vm/opto/machnode.cpp
changeset 13969 d2a189b83b87
parent 13728 882756847a04
child 15241 87d217c2d183
--- a/hotspot/src/share/vm/opto/machnode.cpp	Mon Oct 08 17:04:00 2012 -0700
+++ b/hotspot/src/share/vm/opto/machnode.cpp	Tue Oct 09 10:11:38 2012 +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