src/hotspot/share/gc/g1/g1DirtyCardQueue.cpp
changeset 54110 f4f0dce5d0bb
parent 54006 a421bdf22394
child 54255 c81fbf340ceb
equal deleted inserted replaced
54109:debb15cc04ee 54110:f4f0dce5d0bb
    42 // point into the collection set while the mutator is running.
    42 // point into the collection set while the mutator is running.
    43 // Assumed to be only executed concurrently with the mutator. Yields via
    43 // Assumed to be only executed concurrently with the mutator. Yields via
    44 // SuspendibleThreadSet after every card.
    44 // SuspendibleThreadSet after every card.
    45 class G1RefineCardConcurrentlyClosure: public G1CardTableEntryClosure {
    45 class G1RefineCardConcurrentlyClosure: public G1CardTableEntryClosure {
    46 public:
    46 public:
    47   bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
    47   bool do_card_ptr(CardValue* card_ptr, uint worker_i) {
    48     G1CollectedHeap::heap()->rem_set()->refine_card_concurrently(card_ptr, worker_i);
    48     G1CollectedHeap::heap()->rem_set()->refine_card_concurrently(card_ptr, worker_i);
    49 
    49 
    50     if (SuspendibleThreadSet::should_yield()) {
    50     if (SuspendibleThreadSet::should_yield()) {
    51       // Caller will actually yield.
    51       // Caller will actually yield.
    52       return false;
    52       return false;
   111   bool result = true;
   111   bool result = true;
   112   void** buf = BufferNode::make_buffer_from_node(node);
   112   void** buf = BufferNode::make_buffer_from_node(node);
   113   size_t i = node->index();
   113   size_t i = node->index();
   114   size_t limit = buffer_size();
   114   size_t limit = buffer_size();
   115   for ( ; i < limit; ++i) {
   115   for ( ; i < limit; ++i) {
   116     jbyte* card_ptr = static_cast<jbyte*>(buf[i]);
   116     CardTable::CardValue* card_ptr = static_cast<CardTable::CardValue*>(buf[i]);
   117     assert(card_ptr != NULL, "invariant");
   117     assert(card_ptr != NULL, "invariant");
   118     if (!cl->do_card_ptr(card_ptr, worker_i)) {
   118     if (!cl->do_card_ptr(card_ptr, worker_i)) {
   119       result = false;           // Incomplete processing.
   119       result = false;           // Incomplete processing.
   120       break;
   120       break;
   121     }
   121     }