--- a/src/hotspot/share/memory/heap.hpp Mon May 20 10:06:07 2019 -0400
+++ b/src/hotspot/share/memory/heap.hpp Mon May 20 17:44:29 2019 +0200
@@ -51,6 +51,8 @@
public:
// Initialization
void initialize(size_t length) { _header._length = length; set_used(); }
+ // Merging/splitting
+ void set_length(size_t length) { _header._length = length; }
// Accessors
void* allocated_space() const { return (void*)(this + 1); }
@@ -71,9 +73,6 @@
// Initialization
void initialize(size_t length) { HeapBlock::initialize(length); _link= NULL; }
- // Merging
- void set_length(size_t l) { _header._length = l; }
-
// Accessors
FreeBlock* link() const { return _link; }
void set_link(FreeBlock* link) { _link = link; }
@@ -115,8 +114,12 @@
bool is_segment_unused(int val) const { return val == free_sentinel; }
HeapBlock* block_at(size_t i) const { return (HeapBlock*)(_memory.low() + (i << _log2_segment_size)); }
- void mark_segmap_as_free(size_t beg, size_t end);
- void mark_segmap_as_used(size_t beg, size_t end);
+ // These methods take segment map indices as range boundaries
+ void mark_segmap_as_free(size_t beg, size_t end);
+ void mark_segmap_as_used(size_t beg, size_t end);
+ void invalidate(size_t beg, size_t end, size_t header_bytes);
+ void clear(size_t beg, size_t end);
+ void clear(); // clears all heap contents
// Freelist management helpers
FreeBlock* following_block(FreeBlock* b);
@@ -125,7 +128,7 @@
// Toplevel freelist management
void add_to_freelist(HeapBlock* b);
- FreeBlock* search_freelist(size_t length);
+ HeapBlock* search_freelist(size_t length);
// Iteration helpers
void* next_used(HeapBlock* b) const;
@@ -133,7 +136,6 @@
// to perform additional actions on creation of executable code
void on_code_mapping(char* base, size_t size);
- void clear(); // clears all heap contents
public:
CodeHeap(const char* name, const int code_blob_type);
@@ -180,6 +182,7 @@
size_t segment_size() const { return _segment_size; } // for CodeHeapState
HeapBlock* first_block() const; // for CodeHeapState
HeapBlock* next_block(HeapBlock* b) const; // for CodeHeapState
+ HeapBlock* split_block(HeapBlock* b, size_t split_seg); // split one block into two
FreeBlock* freelist() const { return _freelist; } // for CodeHeapState