diff src/share/vm/opto/machnode.cpp @ 851:fc4be448891f

6851742: (EA) allocation elimination doesn't work with UseG1GC Summary: Fix eliminate_card_mark() to eliminate G1 pre/post barriers. Reviewed-by: never
author kvn
date Thu, 16 Jul 2009 14:10:42 -0700
parents fbc12e71c476
children 18f526145aea
line wrap: on
line diff
--- a/src/share/vm/opto/machnode.cpp	Wed Jul 15 13:37:35 2009 -0700
+++ b/src/share/vm/opto/machnode.cpp	Thu Jul 16 14:10:42 2009 -0700
@@ -300,6 +300,12 @@
           }
         }
         adr_type = t_disp->add_offset(offset);
+      } else if( base == NULL && offset != 0 && offset != Type::OffsetBot ) {
+        // Use ideal type if it is oop ptr.
+        const TypePtr *tp = oper->type()->isa_ptr();
+        if( tp != NULL) {
+          adr_type = tp;
+        }
       }
     }