mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
6711316: Open source the Garbage-First garbage collector
First mercurial integration of the code for the Garbage-First garbage collector. Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
This commit is contained in:
parent
39463bb3fc
commit
18f3386a98
215 changed files with 36088 additions and 1249 deletions
|
@ -44,6 +44,9 @@ class KlassHandle;
|
|||
class SharedHeap : public CollectedHeap {
|
||||
friend class VMStructs;
|
||||
|
||||
friend class VM_GC_Operation;
|
||||
friend class VM_CGC_Operation;
|
||||
|
||||
private:
|
||||
// For claiming strong_roots tasks.
|
||||
SubTasksDone* _process_strong_tasks;
|
||||
|
@ -82,6 +85,14 @@ protected:
|
|||
// function.
|
||||
SharedHeap(CollectorPolicy* policy_);
|
||||
|
||||
// Returns true if the calling thread holds the heap lock,
|
||||
// or the calling thread is a par gc thread and the heap_lock is held
|
||||
// by the vm thread doing a gc operation.
|
||||
bool heap_lock_held_for_gc();
|
||||
// True if the heap_lock is held by the a non-gc thread invoking a gc
|
||||
// operation.
|
||||
bool _thread_holds_heap_lock_for_gc;
|
||||
|
||||
public:
|
||||
static SharedHeap* heap() { return _sh; }
|
||||
|
||||
|
@ -97,8 +108,8 @@ public:
|
|||
|
||||
void set_perm(PermGen* perm_gen) { _perm_gen = perm_gen; }
|
||||
|
||||
// A helper function that fills an allocated-but-not-yet-initialized
|
||||
// region with a garbage object.
|
||||
// A helper function that fills a region of the heap with
|
||||
// with a single object.
|
||||
static void fill_region_with_object(MemRegion mr);
|
||||
|
||||
// Minimum garbage fill object size
|
||||
|
@ -214,13 +225,12 @@ public:
|
|||
// "SharedHeap" can use in the implementation of its virtual
|
||||
// functions.
|
||||
|
||||
protected:
|
||||
public:
|
||||
|
||||
// Do anything common to GC's.
|
||||
virtual void gc_prologue(bool full) = 0;
|
||||
virtual void gc_epilogue(bool full) = 0;
|
||||
|
||||
public:
|
||||
//
|
||||
// New methods from CollectedHeap
|
||||
//
|
||||
|
@ -266,7 +276,8 @@ public:
|
|||
}
|
||||
|
||||
// Some utilities.
|
||||
void print_size_transition(size_t bytes_before,
|
||||
void print_size_transition(outputStream* out,
|
||||
size_t bytes_before,
|
||||
size_t bytes_after,
|
||||
size_t capacity);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue