7029167: add support for conditional card marks

Reviewed-by: iveresov, kvn
This commit is contained in:
Tom Rodriguez 2011-04-27 15:40:36 -07:00
parent 6c8fc4b347
commit 2126589fd0
3 changed files with 32 additions and 5 deletions

View file

@ -221,9 +221,16 @@ void PhaseMacroExpand::eliminate_card_mark(Node* p2x) {
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