src/share/vm/memory/cardTableModRefBS.hpp

changeset 7051
1f1d373cd044
parent 6680
78bbf4d43a14
child 7535
7ae4e26cb1e0
child 8659
c70ebf41026a
     1.1 --- a/src/share/vm/memory/cardTableModRefBS.hpp	Tue Aug 19 10:50:27 2014 +0200
     1.2 +++ b/src/share/vm/memory/cardTableModRefBS.hpp	Thu Aug 21 11:47:10 2014 +0200
     1.3 @@ -96,12 +96,12 @@
     1.4    // The declaration order of these const fields is important; see the
     1.5    // constructor before changing.
     1.6    const MemRegion _whole_heap;       // the region covered by the card table
     1.7 -  const size_t    _guard_index;      // index of very last element in the card
     1.8 +  size_t          _guard_index;      // index of very last element in the card
     1.9                                       // table; it is set to a guard value
    1.10                                       // (last_card) and should never be modified
    1.11 -  const size_t    _last_valid_index; // index of the last valid element
    1.12 +  size_t          _last_valid_index; // index of the last valid element
    1.13    const size_t    _page_size;        // page size used when mapping _byte_map
    1.14 -  const size_t    _byte_map_size;    // in bytes
    1.15 +  size_t          _byte_map_size;    // in bytes
    1.16    jbyte*          _byte_map;         // the card marking array
    1.17  
    1.18    int _cur_covered_regions;
    1.19 @@ -123,7 +123,12 @@
    1.20   protected:
    1.21    // Initialization utilities; covered_words is the size of the covered region
    1.22    // in, um, words.
    1.23 -  inline size_t cards_required(size_t covered_words);
    1.24 +  inline size_t cards_required(size_t covered_words) {
    1.25 +    // Add one for a guard card, used to detect errors.
    1.26 +    const size_t words = align_size_up(covered_words, card_size_in_words);
    1.27 +    return words / card_size_in_words + 1;
    1.28 +  }
    1.29 +
    1.30    inline size_t compute_byte_map_size();
    1.31  
    1.32    // Finds and return the index of the region, if any, to which the given
    1.33 @@ -137,7 +142,7 @@
    1.34    int find_covering_region_containing(HeapWord* addr);
    1.35  
    1.36    // Resize one of the regions covered by the remembered set.
    1.37 -  void resize_covered_region(MemRegion new_region);
    1.38 +  virtual void resize_covered_region(MemRegion new_region);
    1.39  
    1.40    // Returns the leftmost end of a committed region corresponding to a
    1.41    // covered region before covered region "ind", or else "NULL" if "ind" is
    1.42 @@ -282,6 +287,8 @@
    1.43    CardTableModRefBS(MemRegion whole_heap, int max_covered_regions);
    1.44    ~CardTableModRefBS();
    1.45  
    1.46 +  virtual void initialize();
    1.47 +
    1.48    // *** Barrier set functions.
    1.49  
    1.50    bool has_write_ref_pre_barrier() { return false; }

mercurial