< prev index next >

src/share/vm/opto/macro.cpp

Print this page




 227   assert(p2x->Opcode() == Op_CastP2X, "ConvP2XNode required");
 228   if (!UseG1GC) {
 229     // vanilla/CMS post barrier
 230     Node *shift = p2x->unique_out();
 231     Node *addp = shift->unique_out();
 232     for (DUIterator_Last jmin, j = addp->last_outs(jmin); j >= jmin; --j) {
 233       Node *mem = addp->last_out(j);
 234       if (UseCondCardMark && mem->is_Load()) {
 235         assert(mem->Opcode() == Op_LoadB, "unexpected code shape");
 236         // The load is checking if the card has been written so
 237         // replace it with zero to fold the test.
 238         _igvn.replace_node(mem, intcon(0));
 239         continue;
 240       }
 241       assert(mem->is_Store(), "store required");
 242       _igvn.replace_node(mem, mem->in(MemNode::Memory));
 243     }
 244   } else {
 245     // G1 pre/post barriers
 246     assert(p2x->outcnt() <= 2, "expects 1 or 2 users: Xor and URShift nodes");
 247     // It could be only one user, URShift node, in Object.clone() instrinsic
 248     // but the new allocation is passed to arraycopy stub and it could not
 249     // be scalar replaced. So we don't check the case.
 250 
 251     // An other case of only one user (Xor) is when the value check for NULL
 252     // in G1 post barrier is folded after CCP so the code which used URShift
 253     // is removed.
 254 
 255     // Take Region node before eliminating post barrier since it also
 256     // eliminates CastP2X node when it has only one user.
 257     Node* this_region = p2x->in(0);
 258     assert(this_region != NULL, "");
 259 
 260     // Remove G1 post barrier.
 261 
 262     // Search for CastP2X->Xor->URShift->Cmp path which
 263     // checks if the store done to a different from the value's region.
 264     // And replace Cmp with #0 (false) to collapse G1 post barrier.
 265     Node* xorx = p2x->find_out_with(Op_XorX);
 266     assert(xorx != NULL, "missing G1 post barrier");
 267     Node* shift = xorx->unique_out();




 227   assert(p2x->Opcode() == Op_CastP2X, "ConvP2XNode required");
 228   if (!UseG1GC) {
 229     // vanilla/CMS post barrier
 230     Node *shift = p2x->unique_out();
 231     Node *addp = shift->unique_out();
 232     for (DUIterator_Last jmin, j = addp->last_outs(jmin); j >= jmin; --j) {
 233       Node *mem = addp->last_out(j);
 234       if (UseCondCardMark && mem->is_Load()) {
 235         assert(mem->Opcode() == Op_LoadB, "unexpected code shape");
 236         // The load is checking if the card has been written so
 237         // replace it with zero to fold the test.
 238         _igvn.replace_node(mem, intcon(0));
 239         continue;
 240       }
 241       assert(mem->is_Store(), "store required");
 242       _igvn.replace_node(mem, mem->in(MemNode::Memory));
 243     }
 244   } else {
 245     // G1 pre/post barriers
 246     assert(p2x->outcnt() <= 2, "expects 1 or 2 users: Xor and URShift nodes");
 247     // It could be only one user, URShift node, in Object.clone() intrinsic
 248     // but the new allocation is passed to arraycopy stub and it could not
 249     // be scalar replaced. So we don't check the case.
 250 
 251     // An other case of only one user (Xor) is when the value check for NULL
 252     // in G1 post barrier is folded after CCP so the code which used URShift
 253     // is removed.
 254 
 255     // Take Region node before eliminating post barrier since it also
 256     // eliminates CastP2X node when it has only one user.
 257     Node* this_region = p2x->in(0);
 258     assert(this_region != NULL, "");
 259 
 260     // Remove G1 post barrier.
 261 
 262     // Search for CastP2X->Xor->URShift->Cmp path which
 263     // checks if the store done to a different from the value's region.
 264     // And replace Cmp with #0 (false) to collapse G1 post barrier.
 265     Node* xorx = p2x->find_out_with(Op_XorX);
 266     assert(xorx != NULL, "missing G1 post barrier");
 267     Node* shift = xorx->unique_out();


< prev index next >