hotspot/src/share/vm/opto/machnode.cpp
changeset 360 21d113ecbf6a
parent 1 489c9b5090e2
child 762 1b26adb5fea1
child 670 ddf3e9583f2f
--- a/hotspot/src/share/vm/opto/machnode.cpp	Fri Apr 11 09:56:35 2008 -0400
+++ b/hotspot/src/share/vm/opto/machnode.cpp	Sun Apr 13 17:43:42 2008 -0400
@@ -263,6 +263,13 @@
     // See if it adds up to a base + offset.
     if (index != NULL) {
       if (!index->is_Con()) {
+        const TypeNarrowOop* narrowoop = index->bottom_type()->isa_narrowoop();
+        if (narrowoop != NULL) {
+          // Memory references through narrow oops have a
+          // funny base so grab the type from the index.
+          adr_type = narrowoop->make_oopptr();
+          return NULL;
+        }
         disp = Type::OffsetBot;
       } else if (disp != Type::OffsetBot) {
         const TypeX* ti = index->bottom_type()->isa_intptr_t();