--- a/hotspot/src/share/vm/opto/output.cpp Fri Feb 18 10:07:34 2011 -0800
+++ b/hotspot/src/share/vm/opto/output.cpp Tue Apr 05 19:14:03 2011 -0700
@@ -1354,15 +1354,20 @@
// Check that oop-store precedes the card-mark
else if( mach->ideal_Opcode() == Op_StoreCM ) {
uint storeCM_idx = j;
- Node *oop_store = mach->in(mach->_cnt); // First precedence edge
- assert( oop_store != NULL, "storeCM expects a precedence edge");
- uint i4;
- for( i4 = 0; i4 < last_inst; ++i4 ) {
- if( b->_nodes[i4] == oop_store ) break;
+ int count = 0;
+ for (uint prec = mach->req(); prec < mach->len(); prec++) {
+ Node *oop_store = mach->in(prec); // Precedence edge
+ if (oop_store == NULL) continue;
+ count++;
+ uint i4;
+ for( i4 = 0; i4 < last_inst; ++i4 ) {
+ if( b->_nodes[i4] == oop_store ) break;
+ }
+ // Note: This test can provide a false failure if other precedence
+ // edges have been added to the storeCMNode.
+ assert( i4 == last_inst || i4 < storeCM_idx, "CM card-mark executes before oop-store");
}
- // Note: This test can provide a false failure if other precedence
- // edges have been added to the storeCMNode.
- assert( i4 == last_inst || i4 < storeCM_idx, "CM card-mark executes before oop-store");
+ assert(count > 0, "storeCM expects at least one precedence edge");
}
#endif