diff src/share/vm/opto/machnode.cpp @ 6848:8e47bac5643a

7054512: Compress class pointers after perm gen removal Summary: support of compress class pointers in the compilers. Reviewed-by: kvn, twisti
author roland
date Tue, 09 Oct 2012 10:11:38 +0200
parents da91efe96a93
children a7114d3d712e
line wrap: on
line diff
--- a/src/share/vm/opto/machnode.cpp	Mon Oct 08 17:04:00 2012 -0700
+++ b/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