hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
changeset 9120 3606dd709168
parent 9102 4708a4aefb33
child 9182 ab3e9e0925ad
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Thu Apr 07 21:32:23 2011 -0700
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Apr 08 17:03:31 2011 -0700
@@ -1456,7 +1456,7 @@
 
   if (addr->is_address()) {
     LIR_Address* address = addr->as_address_ptr();
-    LIR_Opr ptr = new_register(T_OBJECT);
+    LIR_Opr ptr = new_pointer_register();
     if (!address->index()->is_valid() && address->disp() == 0) {
       __ move(address->base(), ptr);
     } else {
@@ -1508,7 +1508,9 @@
   LIR_Const* card_table_base = new LIR_Const(((CardTableModRefBS*)_bs)->byte_map_base);
   if (addr->is_address()) {
     LIR_Address* address = addr->as_address_ptr();
-    LIR_Opr ptr = new_register(T_OBJECT);
+    // ptr cannot be an object because we use this barrier for array card marks
+    // and addr can point in the middle of an array.
+    LIR_Opr ptr = new_pointer_register();
     if (!address->index()->is_valid() && address->disp() == 0) {
       __ move(address->base(), ptr);
     } else {