Mercurial > hg > truffle
diff src/share/vm/opto/macro.cpp @ 3297:6431be02f3ac
Merge
author | trims |
---|---|
date | Fri, 29 Apr 2011 16:55:43 -0700 |
parents | 149bb459be66 |
children | bad7ecd0b6ed |
line wrap: on
line diff
--- a/src/share/vm/opto/macro.cpp Wed Apr 27 19:20:31 2011 -0700 +++ b/src/share/vm/opto/macro.cpp Fri Apr 29 16:55:43 2011 -0700 @@ -221,9 +221,16 @@ Node *shift = p2x->unique_out(); Node *addp = shift->unique_out(); for (DUIterator_Last jmin, j = addp->last_outs(jmin); j >= jmin; --j) { - Node *st = addp->last_out(j); - assert(st->is_Store(), "store required"); - _igvn.replace_node(st, st->in(MemNode::Memory)); + Node *mem = addp->last_out(j); + if (UseCondCardMark && mem->is_Load()) { + assert(mem->Opcode() == Op_LoadB, "unexpected code shape"); + // The load is checking if the card has been written so + // replace it with zero to fold the test. + _igvn.replace_node(mem, intcon(0)); + continue; + } + assert(mem->is_Store(), "store required"); + _igvn.replace_node(mem, mem->in(MemNode::Memory)); } } else { // G1 pre/post barriers