mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
8038423: G1: Decommit memory within heap
Allow G1 to decommit memory of arbitrary regions within the heap and their associated auxiliary data structures card table, BOT, hot card cache, and mark bitmaps. Reviewed-by: mgerdin, brutisso, jwilhelm
This commit is contained in:
parent
2617d54723
commit
100e51a339
32 changed files with 1322 additions and 579 deletions
|
@ -96,12 +96,12 @@ class CardTableModRefBS: public ModRefBarrierSet {
|
|||
// The declaration order of these const fields is important; see the
|
||||
// constructor before changing.
|
||||
const MemRegion _whole_heap; // the region covered by the card table
|
||||
const size_t _guard_index; // index of very last element in the card
|
||||
size_t _guard_index; // index of very last element in the card
|
||||
// table; it is set to a guard value
|
||||
// (last_card) and should never be modified
|
||||
const size_t _last_valid_index; // index of the last valid element
|
||||
size_t _last_valid_index; // index of the last valid element
|
||||
const size_t _page_size; // page size used when mapping _byte_map
|
||||
const size_t _byte_map_size; // in bytes
|
||||
size_t _byte_map_size; // in bytes
|
||||
jbyte* _byte_map; // the card marking array
|
||||
|
||||
int _cur_covered_regions;
|
||||
|
@ -123,7 +123,12 @@ class CardTableModRefBS: public ModRefBarrierSet {
|
|||
protected:
|
||||
// Initialization utilities; covered_words is the size of the covered region
|
||||
// in, um, words.
|
||||
inline size_t cards_required(size_t covered_words);
|
||||
inline size_t cards_required(size_t covered_words) {
|
||||
// Add one for a guard card, used to detect errors.
|
||||
const size_t words = align_size_up(covered_words, card_size_in_words);
|
||||
return words / card_size_in_words + 1;
|
||||
}
|
||||
|
||||
inline size_t compute_byte_map_size();
|
||||
|
||||
// Finds and return the index of the region, if any, to which the given
|
||||
|
@ -137,7 +142,7 @@ class CardTableModRefBS: public ModRefBarrierSet {
|
|||
int find_covering_region_containing(HeapWord* addr);
|
||||
|
||||
// Resize one of the regions covered by the remembered set.
|
||||
void resize_covered_region(MemRegion new_region);
|
||||
virtual void resize_covered_region(MemRegion new_region);
|
||||
|
||||
// Returns the leftmost end of a committed region corresponding to a
|
||||
// covered region before covered region "ind", or else "NULL" if "ind" is
|
||||
|
@ -282,6 +287,8 @@ public:
|
|||
CardTableModRefBS(MemRegion whole_heap, int max_covered_regions);
|
||||
~CardTableModRefBS();
|
||||
|
||||
virtual void initialize();
|
||||
|
||||
// *** Barrier set functions.
|
||||
|
||||
bool has_write_ref_pre_barrier() { return false; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue