src/share/vm/opto/macro.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/opto/macro.cpp Tue Feb 7 16:22:54 2012
--- new/src/share/vm/opto/macro.cpp Tue Feb 7 16:22:54 2012
*** 232,246 ****
--- 232,255 ----
assert(mem->is_Store(), "store required");
_igvn.replace_node(mem, mem->in(MemNode::Memory));
}
} else {
// G1 pre/post barriers
! assert(p2x->outcnt() == 2, "expects 2 users: Xor and URShift nodes");
! assert(p2x->outcnt() <= 2, "expects 1 or 2 users: Xor and URShift nodes");
// It could be only one user, URShift node, in Object.clone() instrinsic
// but the new allocation is passed to arraycopy stub and it could not
// be scalar replaced. So we don't check the case.
+ // An other case of only one user (Xor) is when the value check for NULL
+ // in G1 post barrier is folded after CCP so the code which used URShift
+ // is removed.
+
+ // Take Region node before eliminating post barrier since it also
+ // eliminates CastP2X node when it has only one user.
+ Node* this_region = p2x->in(0);
+ assert(this_region != NULL, "");
+
// Remove G1 post barrier.
// Search for CastP2X->Xor->URShift->Cmp path which
// checks if the store done to a different from the value's region.
// And replace Cmp with #0 (false) to collapse G1 post barrier.
*** 261,272 ****
--- 270,279 ----
_igvn.replace_node(cmpx, makecon(TypeInt::CC_EQ));
// Remove G1 pre barrier.
// Search "if (marking != 0)" check and set it to "false".
Node* this_region = p2x->in(0);
assert(this_region != NULL, "");
// There is no G1 pre barrier if previous stored value is NULL
// (for example, after initialization).
if (this_region->is_Region() && this_region->req() == 3) {
int ind = 1;
if (!this_region->in(ind)->is_IfFalse()) {
*** 290,300 ****
--- 297,307 ----
}
}
}
// Now CastP2X can be removed since it is used only on dead path
// which currently still alive until igvn optimize it.
! assert(p2x->outcnt() == 0 || p2x->unique_out()->Opcode() == Op_URShiftX, "");
_igvn.replace_node(p2x, top());
}
}
// Search for a memory operation for the specified memory slice.
src/share/vm/opto/macro.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File