Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/classLoaderData.hpp @ 20260:556a06aec3fa
8035412: Cleanup ClassLoaderData::is_alive
Reviewed-by: coleenp, mgerdin
author | stefank |
---|---|
date | Fri, 21 Feb 2014 10:19:09 +0100 |
parents | e4a6e7f1b90b |
children | 2c6ef90f030a |
comparison
equal
deleted
inserted
replaced
20259:4af19b914f53 | 20260:556a06aec3fa |
---|---|
147 | 147 |
148 Metaspace * _metaspace; // Meta-space where meta-data defined by the | 148 Metaspace * _metaspace; // Meta-space where meta-data defined by the |
149 // classes in the class loader are allocated. | 149 // classes in the class loader are allocated. |
150 Mutex* _metaspace_lock; // Locks the metaspace for allocations and setup. | 150 Mutex* _metaspace_lock; // Locks the metaspace for allocations and setup. |
151 bool _unloading; // true if this class loader goes away | 151 bool _unloading; // true if this class loader goes away |
152 bool _keep_alive; // if this CLD can be unloaded for anonymous loaders | 152 bool _keep_alive; // if this CLD is kept alive without a keep_alive_object(). |
153 bool _is_anonymous; // if this CLD is for an anonymous class | 153 bool _is_anonymous; // if this CLD is for an anonymous class |
154 volatile int _claimed; // true if claimed, for example during GC traces. | 154 volatile int _claimed; // true if claimed, for example during GC traces. |
155 // To avoid applying oop closure more than once. | 155 // To avoid applying oop closure more than once. |
156 // Has to be an int because we cas it. | 156 // Has to be an int because we cas it. |
157 Klass* _klasses; // The classes defined by the class loader. | 157 Klass* _klasses; // The classes defined by the class loader. |
238 // method will allocate a Metaspace if needed. | 238 // method will allocate a Metaspace if needed. |
239 Metaspace* metaspace_non_null(); | 239 Metaspace* metaspace_non_null(); |
240 | 240 |
241 oop class_loader() const { return _class_loader; } | 241 oop class_loader() const { return _class_loader; } |
242 | 242 |
243 // The object the GC is using to keep this ClassLoaderData alive. | |
244 oop keep_alive_object() const; | |
245 | |
243 // Returns true if this class loader data is for a loader going away. | 246 // Returns true if this class loader data is for a loader going away. |
244 bool is_unloading() const { | 247 bool is_unloading() const { |
245 assert(!(is_the_null_class_loader_data() && _unloading), "The null class loader can never be unloaded"); | 248 assert(!(is_the_null_class_loader_data() && _unloading), "The null class loader can never be unloaded"); |
246 return _unloading; | 249 return _unloading; |
247 } | 250 } |
248 // Anonymous class loader data doesn't have anything to keep them from | 251 |
249 // being unloaded during parsing the anonymous class. | 252 // Used to make sure that this CLD is not unloaded. |
250 void set_keep_alive(bool value) { _keep_alive = value; } | 253 void set_keep_alive(bool value) { _keep_alive = value; } |
251 | 254 |
252 unsigned int identity_hash() { | 255 unsigned int identity_hash() { |
253 return _class_loader == NULL ? 0 : _class_loader->identity_hash(); | 256 return _class_loader == NULL ? 0 : _class_loader->identity_hash(); |
254 } | 257 } |