src/share/vm/memory/cardTableModRefBS.hpp

changeset 1063
7bb995fbd3c0
parent 1014
0fbdb4381b99
parent 1051
4f360ec815ba
child 1280
df6caf649ff7
     1.1 --- a/src/share/vm/memory/cardTableModRefBS.hpp	Mon Mar 09 13:34:00 2009 -0700
     1.2 +++ b/src/share/vm/memory/cardTableModRefBS.hpp	Thu Mar 12 18:16:36 2009 -0700
     1.3 @@ -52,11 +52,15 @@
     1.4  
     1.5    enum CardValues {
     1.6      clean_card                  = -1,
     1.7 +    // The mask contains zeros in places for all other values.
     1.8 +    clean_card_mask             = clean_card - 31,
     1.9 +
    1.10      dirty_card                  =  0,
    1.11      precleaned_card             =  1,
    1.12 -    claimed_card                =  3,
    1.13 -    last_card                   =  4,
    1.14 -    CT_MR_BS_last_reserved      = 10
    1.15 +    claimed_card                =  2,
    1.16 +    deferred_card               =  4,
    1.17 +    last_card                   =  8,
    1.18 +    CT_MR_BS_last_reserved      = 16
    1.19    };
    1.20  
    1.21    // dirty and precleaned are equivalent wrt younger_refs_iter.
    1.22 @@ -254,9 +258,11 @@
    1.23    };
    1.24  
    1.25    static int clean_card_val()      { return clean_card; }
    1.26 +  static int clean_card_mask_val() { return clean_card_mask; }
    1.27    static int dirty_card_val()      { return dirty_card; }
    1.28    static int claimed_card_val()    { return claimed_card; }
    1.29    static int precleaned_card_val() { return precleaned_card; }
    1.30 +  static int deferred_card_val()   { return deferred_card; }
    1.31  
    1.32    // For RTTI simulation.
    1.33    bool is_a(BarrierSet::Name bsn) {
    1.34 @@ -329,7 +335,8 @@
    1.35    }
    1.36  
    1.37    bool is_card_claimed(size_t card_index) {
    1.38 -    return _byte_map[card_index] == claimed_card_val();
    1.39 +    jbyte val = _byte_map[card_index];
    1.40 +    return (val & (clean_card_mask_val() | claimed_card_val())) == claimed_card_val();
    1.41    }
    1.42  
    1.43    bool claim_card(size_t card_index);
    1.44 @@ -338,6 +345,13 @@
    1.45      return _byte_map[card_index] == clean_card_val();
    1.46    }
    1.47  
    1.48 +  bool is_card_deferred(size_t card_index) {
    1.49 +    jbyte val = _byte_map[card_index];
    1.50 +    return (val & (clean_card_mask_val() | deferred_card_val())) == deferred_card_val();
    1.51 +  }
    1.52 +
    1.53 +  bool mark_card_deferred(size_t card_index);
    1.54 +
    1.55    // Card marking array base (adjusted for heap low boundary)
    1.56    // This would be the 0th element of _byte_map, if the heap started at 0x0.
    1.57    // But since the heap starts at some higher address, this points to somewhere
    1.58 @@ -434,6 +448,10 @@
    1.59      return byte_for(p) - _byte_map;
    1.60    }
    1.61  
    1.62 +  const jbyte* byte_for_index(const size_t card_index) const {
    1.63 +    return _byte_map + card_index;
    1.64 +  }
    1.65 +
    1.66    void verify();
    1.67    void verify_guard();
    1.68  

mercurial