mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 10:34:38 +02:00
8247740: Inline derived CollectedHeap access for G1 and ParallelGC
Added shared helper in CollectedHeap, and inlined for G1 and ParallelGC Reviewed-by: stefank, pliden
This commit is contained in:
parent
e3eb38f4d2
commit
f8596b57f3
9 changed files with 28 additions and 34 deletions
|
@ -29,6 +29,7 @@
|
|||
#include "gc/shared/gcWhen.hpp"
|
||||
#include "gc/shared/verifyOption.hpp"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "runtime/handles.hpp"
|
||||
#include "runtime/perfData.hpp"
|
||||
#include "runtime/safepoint.hpp"
|
||||
|
@ -177,6 +178,20 @@ class CollectedHeap : public CHeapObj<mtInternal> {
|
|||
Shenandoah
|
||||
};
|
||||
|
||||
protected:
|
||||
// Get a pointer to the derived heap object. Used to implement
|
||||
// derived class heap() functions rather than being called directly.
|
||||
template<typename T>
|
||||
static T* named_heap(Name kind) {
|
||||
CollectedHeap* heap = Universe::heap();
|
||||
assert(heap != NULL, "Uninitialized heap");
|
||||
assert(kind == heap->kind(), "Heap kind %u should be %u",
|
||||
static_cast<uint>(heap->kind()), static_cast<uint>(kind));
|
||||
return static_cast<T*>(heap);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
static inline size_t filler_array_max_size() {
|
||||
return _filler_array_max_size;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue