提交 6c74417c 编写于 作者: S stefank

8025096: Move the ChunkManager instances out of the VirtualSpaceLists

Reviewed-by: coleenp, mgerdin, jmasa
上级 17f44793
此差异已折叠。
...@@ -56,12 +56,15 @@ ...@@ -56,12 +56,15 @@
// +-------------------+ // +-------------------+
// //
class ChunkManager;
class ClassLoaderData; class ClassLoaderData;
class Metablock; class Metablock;
class Metachunk;
class MetaWord; class MetaWord;
class Mutex; class Mutex;
class outputStream; class outputStream;
class SpaceManager; class SpaceManager;
class VirtualSpaceList;
// Metaspaces each have a SpaceManager and allocations // Metaspaces each have a SpaceManager and allocations
// are done by the SpaceManager. Allocations are done // are done by the SpaceManager. Allocations are done
...@@ -76,8 +79,6 @@ class SpaceManager; ...@@ -76,8 +79,6 @@ class SpaceManager;
// allocate() method returns a block for use as a // allocate() method returns a block for use as a
// quantum of metadata. // quantum of metadata.
class VirtualSpaceList;
class Metaspace : public CHeapObj<mtClass> { class Metaspace : public CHeapObj<mtClass> {
friend class VMStructs; friend class VMStructs;
friend class SpaceManager; friend class SpaceManager;
...@@ -102,6 +103,10 @@ class Metaspace : public CHeapObj<mtClass> { ...@@ -102,6 +103,10 @@ class Metaspace : public CHeapObj<mtClass> {
private: private:
void initialize(Mutex* lock, MetaspaceType type); void initialize(Mutex* lock, MetaspaceType type);
Metachunk* get_initialization_chunk(MetadataType mdtype,
size_t chunk_word_size,
size_t chunk_bunch);
// Align up the word size to the allocation word size // Align up the word size to the allocation word size
static size_t align_word_size_up(size_t); static size_t align_word_size_up(size_t);
...@@ -134,6 +139,10 @@ class Metaspace : public CHeapObj<mtClass> { ...@@ -134,6 +139,10 @@ class Metaspace : public CHeapObj<mtClass> {
static VirtualSpaceList* _space_list; static VirtualSpaceList* _space_list;
static VirtualSpaceList* _class_space_list; static VirtualSpaceList* _class_space_list;
static ChunkManager* _chunk_manager_metadata;
static ChunkManager* _chunk_manager_class;
public:
static VirtualSpaceList* space_list() { return _space_list; } static VirtualSpaceList* space_list() { return _space_list; }
static VirtualSpaceList* class_space_list() { return _class_space_list; } static VirtualSpaceList* class_space_list() { return _class_space_list; }
static VirtualSpaceList* get_space_list(MetadataType mdtype) { static VirtualSpaceList* get_space_list(MetadataType mdtype) {
...@@ -141,6 +150,14 @@ class Metaspace : public CHeapObj<mtClass> { ...@@ -141,6 +150,14 @@ class Metaspace : public CHeapObj<mtClass> {
return mdtype == ClassType ? class_space_list() : space_list(); return mdtype == ClassType ? class_space_list() : space_list();
} }
static ChunkManager* chunk_manager_metadata() { return _chunk_manager_metadata; }
static ChunkManager* chunk_manager_class() { return _chunk_manager_class; }
static ChunkManager* get_chunk_manager(MetadataType mdtype) {
assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype");
return mdtype == ClassType ? chunk_manager_class() : chunk_manager_metadata();
}
private:
// This is used by DumpSharedSpaces only, where only _vsm is used. So we will // This is used by DumpSharedSpaces only, where only _vsm is used. So we will
// maintain a single list for now. // maintain a single list for now.
void record_allocation(void* ptr, MetaspaceObj::Type type, size_t word_size); void record_allocation(void* ptr, MetaspaceObj::Type type, size_t word_size);
...@@ -199,6 +216,7 @@ class Metaspace : public CHeapObj<mtClass> { ...@@ -199,6 +216,7 @@ class Metaspace : public CHeapObj<mtClass> {
void dump(outputStream* const out) const; void dump(outputStream* const out) const;
// Free empty virtualspaces // Free empty virtualspaces
static void purge(MetadataType mdtype);
static void purge(); static void purge();
void print_on(outputStream* st) const; void print_on(outputStream* st) const;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册