< prev index next >

src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp

Print this page

141     int raw_adr_idx = Compile::AliasIdxRaw;
142     post_barrier(kit, kit->control(),
143                  kit->memory(raw_adr_type),
144                  dst,
145                  no_particular_field,
146                  raw_adr_idx,
147                  no_particular_value,
148                  T_OBJECT,
149                  false);
150   }
151 }
152 
153 bool CardTableBarrierSetC2::use_ReduceInitialCardMarks() const {
154   return ReduceInitialCardMarks;
155 }
156 
157 bool CardTableBarrierSetC2::is_gc_barrier_node(Node* node) const {
158   return ModRefBarrierSetC2::is_gc_barrier_node(node) || node->Opcode() == Op_StoreCM;
159 }
160 
161 void CardTableBarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const {
162   assert(node->Opcode() == Op_CastP2X, "ConvP2XNode required");
163   Node *shift = node->unique_out();
164   Node *addp = shift->unique_out();
165   for (DUIterator_Last jmin, j = addp->last_outs(jmin); j >= jmin; --j) {
166     Node *mem = addp->last_out(j);
167     if (UseCondCardMark && mem->is_Load()) {
168       assert(mem->Opcode() == Op_LoadB, "unexpected code shape");
169       // The load is checking if the card has been written so
170       // replace it with zero to fold the test.
171       macro->replace_node(mem, macro->intcon(0));
172       continue;






173     }
174     assert(mem->is_Store(), "store required");
175     macro->replace_node(mem, mem->in(MemNode::Memory));
176   }
177 }
178 
179 bool CardTableBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, bool is_clone_instance, ArrayCopyPhase phase) const {
180   bool is_oop = is_reference_type(type);
181   return is_oop && (!tightly_coupled_alloc || !use_ReduceInitialCardMarks());
182 }

141     int raw_adr_idx = Compile::AliasIdxRaw;
142     post_barrier(kit, kit->control(),
143                  kit->memory(raw_adr_type),
144                  dst,
145                  no_particular_field,
146                  raw_adr_idx,
147                  no_particular_value,
148                  T_OBJECT,
149                  false);
150   }
151 }
152 
153 bool CardTableBarrierSetC2::use_ReduceInitialCardMarks() const {
154   return ReduceInitialCardMarks;
155 }
156 
157 bool CardTableBarrierSetC2::is_gc_barrier_node(Node* node) const {
158   return ModRefBarrierSetC2::is_gc_barrier_node(node) || node->Opcode() == Op_StoreCM;
159 }
160 
161 void CardTableBarrierSetC2::eliminate_gc_barrier(PhaseIterGVN* igvn, Node* node) const {
162   assert(node->Opcode() == Op_CastP2X, "ConvP2XNode required");
163   for (DUIterator_Last imin, i = node->last_outs(imin); i >= imin; --i) {
164     Node* shift = node->last_out(i);
165     for (DUIterator_Last jmin, j = shift->last_outs(jmin); j >= jmin; --j) {
166       Node* addp = shift->last_out(j);
167       for (DUIterator_Last kmin, k = addp->last_outs(kmin); k >= kmin; --k) {
168         Node* mem = addp->last_out(k);
169         if (UseCondCardMark && mem->is_Load()) {
170           assert(mem->Opcode() == Op_LoadB, "unexpected code shape");
171           // The load is checking if the card has been written so
172           // replace it with zero to fold the test.
173           igvn->replace_node(mem, igvn->intcon(0));
174           continue;
175         }
176         assert(mem->is_Store(), "store required");
177         igvn->replace_node(mem, mem->in(MemNode::Memory));
178       }
179     }


180   }
181 }
182 
183 bool CardTableBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, bool is_clone_instance, ArrayCopyPhase phase) const {
184   bool is_oop = type == T_OBJECT || type == T_ARRAY;
185   return is_oop && (!tightly_coupled_alloc || !use_ReduceInitialCardMarks());
186 }
< prev index next >