169 } 170 171 void CardTableBarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { 172 assert(node->Opcode() == Op_CastP2X, "ConvP2XNode required"); 173 Node *shift = node->unique_out(); 174 Node *addp = shift->unique_out(); 175 for (DUIterator_Last jmin, j = addp->last_outs(jmin); j >= jmin; --j) { 176 Node *mem = addp->last_out(j); 177 if (UseCondCardMark && mem->is_Load()) { 178 assert(mem->Opcode() == Op_LoadB, "unexpected code shape"); 179 // The load is checking if the card has been written so 180 // replace it with zero to fold the test. 181 macro->replace_node(mem, macro->intcon(0)); 182 continue; 183 } 184 assert(mem->is_Store(), "store required"); 185 macro->replace_node(mem, mem->in(MemNode::Memory)); 186 } 187 } 188 189 bool CardTableBarrierSetC2::array_copy_requires_gc_barriers(BasicType type) const { 190 return !use_ReduceInitialCardMarks(); 191 } | 169 } 170 171 void CardTableBarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { 172 assert(node->Opcode() == Op_CastP2X, "ConvP2XNode required"); 173 Node *shift = node->unique_out(); 174 Node *addp = shift->unique_out(); 175 for (DUIterator_Last jmin, j = addp->last_outs(jmin); j >= jmin; --j) { 176 Node *mem = addp->last_out(j); 177 if (UseCondCardMark && mem->is_Load()) { 178 assert(mem->Opcode() == Op_LoadB, "unexpected code shape"); 179 // The load is checking if the card has been written so 180 // replace it with zero to fold the test. 181 macro->replace_node(mem, macro->intcon(0)); 182 continue; 183 } 184 assert(mem->is_Store(), "store required"); 185 macro->replace_node(mem, mem->in(MemNode::Memory)); 186 } 187 } 188 189 bool CardTableBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const { 190 bool is_oop = type == T_OBJECT || type == T_ARRAY; 191 return is_oop && (!tightly_coupled_alloc || !use_ReduceInitialCardMarks()); 192 } |