comparison src/share/vm/memory/metaspace.hpp @ 7446:e51c9860cf66

8005082: NPG: Add specialized Metachunk sizes for reflection and anonymous classloaders Reviewed-by: johnc, coleenp
author jmasa
date Mon, 03 Dec 2012 15:09:39 -0800
parents c71879335291
children dbd5837b342f
comparison
equal deleted inserted replaced
7445:cd962e15c08e 7446:e51c9860cf66
85 friend class MetaspaceGC; 85 friend class MetaspaceGC;
86 friend class MetaspaceAux; 86 friend class MetaspaceAux;
87 87
88 public: 88 public:
89 enum MetadataType {ClassType, NonClassType}; 89 enum MetadataType {ClassType, NonClassType};
90 enum MetaspaceType {
91 StandardMetaspaceType,
92 BootMetaspaceType,
93 ROMetaspaceType,
94 ReadWriteMetaspaceType,
95 AnonymousMetaspaceType,
96 ReflectionMetaspaceType
97 };
90 98
91 private: 99 private:
92 void initialize(Mutex* lock, size_t initial_size = 0); 100 void initialize(Mutex* lock, MetaspaceType type);
101
102 // Align up the word size to the allocation word size
103 static size_t align_word_size_up(size_t);
93 104
94 static size_t _first_chunk_word_size; 105 static size_t _first_chunk_word_size;
106 static size_t _first_class_chunk_word_size;
95 107
96 SpaceManager* _vsm; 108 SpaceManager* _vsm;
97 SpaceManager* vsm() const { return _vsm; } 109 SpaceManager* vsm() const { return _vsm; }
98 110
99 SpaceManager* _class_vsm; 111 SpaceManager* _class_vsm;
108 static VirtualSpaceList* space_list() { return _space_list; } 120 static VirtualSpaceList* space_list() { return _space_list; }
109 static VirtualSpaceList* class_space_list() { return _class_space_list; } 121 static VirtualSpaceList* class_space_list() { return _class_space_list; }
110 122
111 public: 123 public:
112 124
113 Metaspace(Mutex* lock, size_t initial_size); 125 Metaspace(Mutex* lock, MetaspaceType type);
114 Metaspace(Mutex* lock);
115 ~Metaspace(); 126 ~Metaspace();
116 127
117 // Initialize globals for Metaspace 128 // Initialize globals for Metaspace
118 static void global_initialize(); 129 static void global_initialize();
119 static void initialize_class_space(ReservedSpace rs); 130 static void initialize_class_space(ReservedSpace rs);
120 131
121 static size_t first_chunk_word_size() { return _first_chunk_word_size; } 132 static size_t first_chunk_word_size() { return _first_chunk_word_size; }
133 static size_t first_class_chunk_word_size() { return _first_class_chunk_word_size; }
122 134
123 char* bottom() const; 135 char* bottom() const;
124 size_t used_words(MetadataType mdtype) const; 136 size_t used_words(MetadataType mdtype) const;
125 size_t free_words(MetadataType mdtype) const; 137 size_t free_words(MetadataType mdtype) const;
126 size_t capacity_words(MetadataType mdtype) const; 138 size_t capacity_words(MetadataType mdtype) const;