165 static inline void inc_array_classes(size_t count);
166 static inline void dec_array_classes(size_t count);
167
168 #ifndef PRODUCT
169 static bool contains_loader_data(ClassLoaderData* loader_data);
170 #endif
171
172 #if INCLUDE_TRACE
173 private:
174 static Ticks _class_unload_time;
175 static void class_unload_event(Klass* const k);
176 #endif
177 };
178
179 // ClassLoaderData class
180
181 class ClassLoaderData : public CHeapObj<mtClass> {
182 friend class VMStructs;
183
184 private:
185 class ChunkedHandleList VALUE_OBJ_CLASS_SPEC {
186 struct Chunk : public CHeapObj<mtClass> {
187 static const size_t CAPACITY = 32;
188
189 oop _data[CAPACITY];
190 volatile juint _size;
191 Chunk* _next;
192
193 Chunk(Chunk* c) : _next(c), _size(0) { }
194 };
195
196 Chunk* volatile _head;
197
198 void oops_do_chunk(OopClosure* f, Chunk* c, const juint size);
199
200 public:
201 ChunkedHandleList() : _head(NULL) {}
202 ~ChunkedHandleList();
203
204 // Only one thread at a time can add, guarded by ClassLoaderData::metaspace_lock().
205 // However, multiple threads can execute oops_do concurrently with add.
|
165 static inline void inc_array_classes(size_t count);
166 static inline void dec_array_classes(size_t count);
167
168 #ifndef PRODUCT
169 static bool contains_loader_data(ClassLoaderData* loader_data);
170 #endif
171
172 #if INCLUDE_TRACE
173 private:
174 static Ticks _class_unload_time;
175 static void class_unload_event(Klass* const k);
176 #endif
177 };
178
179 // ClassLoaderData class
180
181 class ClassLoaderData : public CHeapObj<mtClass> {
182 friend class VMStructs;
183
184 private:
185 class ChunkedHandleList {
186 struct Chunk : public CHeapObj<mtClass> {
187 static const size_t CAPACITY = 32;
188
189 oop _data[CAPACITY];
190 volatile juint _size;
191 Chunk* _next;
192
193 Chunk(Chunk* c) : _next(c), _size(0) { }
194 };
195
196 Chunk* volatile _head;
197
198 void oops_do_chunk(OopClosure* f, Chunk* c, const juint size);
199
200 public:
201 ChunkedHandleList() : _head(NULL) {}
202 ~ChunkedHandleList();
203
204 // Only one thread at a time can add, guarded by ClassLoaderData::metaspace_lock().
205 // However, multiple threads can execute oops_do concurrently with add.
|