diff src/share/vm/opto/lcm.cpp @ 1161:1fc01a2425ce

Merge
author iveresov
date Tue, 12 Jan 2010 13:54:40 -0800
parents 1271af4ec18c
children c18cbe5936b8 3657cb01ffc5
line wrap: on
line diff
--- a/src/share/vm/opto/lcm.cpp	Sat Jan 09 09:01:41 2010 -0800
+++ b/src/share/vm/opto/lcm.cpp	Tue Jan 12 13:54:40 2010 -0800
@@ -120,6 +120,7 @@
     case Op_LoadRange:
     case Op_LoadD_unaligned:
     case Op_LoadL_unaligned:
+      assert(mach->in(2) == val, "should be address");
       break;
     case Op_StoreB:
     case Op_StoreC:
@@ -146,6 +147,21 @@
     default:                    // Also check for embedded loads
       if( !mach->needs_anti_dependence_check() )
         continue;               // Not an memory op; skip it
+      {
+        // Check that value is used in memory address.
+        Node* base;
+        Node* index;
+        const MachOper* oper = mach->memory_inputs(base, index);
+        if (oper == NULL || oper == (MachOper*)-1) {
+          continue;             // Not an memory op; skip it
+        }
+        if (val == base ||
+            val == index && val->bottom_type()->isa_narrowoop()) {
+          break;                // Found it
+        } else {
+          continue;             // Skip it
+        }
+      }
       break;
     }
     // check if the offset is not too high for implicit exception