hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
changeset 20318 a02849111b27
parent 20282 7f9cbdf89af2
parent 20309 7445302daff6
child 20408 ca559663042f
equal deleted inserted replaced
20304:e4b626bef54e 20318:a02849111b27
    60     T heap_oop = oopDesc::load_heap_oop(elem_ptr);
    60     T heap_oop = oopDesc::load_heap_oop(elem_ptr);
    61     if (!oopDesc::is_null(heap_oop)) {
    61     if (!oopDesc::is_null(heap_oop)) {
    62       enqueue(oopDesc::decode_heap_oop_not_null(heap_oop));
    62       enqueue(oopDesc::decode_heap_oop_not_null(heap_oop));
    63     }
    63     }
    64   }
    64   }
       
    65 }
       
    66 
       
    67 bool G1SATBCardTableModRefBS::mark_card_deferred(size_t card_index) {
       
    68   jbyte val = _byte_map[card_index];
       
    69   // It's already processed
       
    70   if ((val & (clean_card_mask_val() | deferred_card_val())) == deferred_card_val()) {
       
    71     return false;
       
    72   }
       
    73   // Cached bit can be installed either on a clean card or on a claimed card.
       
    74   jbyte new_val = val;
       
    75   if (val == clean_card_val()) {
       
    76     new_val = (jbyte)deferred_card_val();
       
    77   } else {
       
    78     if (val & claimed_card_val()) {
       
    79       new_val = val | (jbyte)deferred_card_val();
       
    80     }
       
    81   }
       
    82   if (new_val != val) {
       
    83     Atomic::cmpxchg(new_val, &_byte_map[card_index], val);
       
    84   }
       
    85   return true;
    65 }
    86 }
    66 
    87 
    67 G1SATBCardTableLoggingModRefBS::
    88 G1SATBCardTableLoggingModRefBS::
    68 G1SATBCardTableLoggingModRefBS(MemRegion whole_heap,
    89 G1SATBCardTableLoggingModRefBS(MemRegion whole_heap,
    69                                int max_covered_regions) :
    90                                int max_covered_regions) :