comparison src/share/vm/classfile/classLoaderData.hpp @ 14909:4ca6dc0799b6

Backout jdk9 merge
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 01 Apr 2014 13:57:07 +0200
parents f460c6926af7
children 52b4284cb496
comparison
equal deleted inserted replaced
14908:8db6e76cb658 14909:4ca6dc0799b6
1 /* 1 /*
2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
88 88
89 static void dump_on(outputStream * const out) PRODUCT_RETURN; 89 static void dump_on(outputStream * const out) PRODUCT_RETURN;
90 static void dump() { dump_on(tty); } 90 static void dump() { dump_on(tty); }
91 static void verify(); 91 static void verify();
92 92
93 #ifndef PRODUCT
93 // expensive test for pointer in metaspace for debugging 94 // expensive test for pointer in metaspace for debugging
94 static bool contains(const void* x); 95 static bool contains(address x);
95 #ifndef PRODUCT
96 static bool contains_loader_data(ClassLoaderData* loader_data); 96 static bool contains_loader_data(ClassLoaderData* loader_data);
97 #endif 97 #endif
98 98
99 #if INCLUDE_TRACE 99 #if INCLUDE_TRACE
100 private: 100 private:
137 137
138 Metaspace * _metaspace; // Meta-space where meta-data defined by the 138 Metaspace * _metaspace; // Meta-space where meta-data defined by the
139 // classes in the class loader are allocated. 139 // classes in the class loader are allocated.
140 Mutex* _metaspace_lock; // Locks the metaspace for allocations and setup. 140 Mutex* _metaspace_lock; // Locks the metaspace for allocations and setup.
141 bool _unloading; // true if this class loader goes away 141 bool _unloading; // true if this class loader goes away
142 bool _keep_alive; // if this CLD is kept alive without a keep_alive_object(). 142 bool _keep_alive; // if this CLD can be unloaded for anonymous loaders
143 bool _is_anonymous; // if this CLD is for an anonymous class 143 bool _is_anonymous; // if this CLD is for an anonymous class
144 volatile int _claimed; // true if claimed, for example during GC traces. 144 volatile int _claimed; // true if claimed, for example during GC traces.
145 // To avoid applying oop closure more than once. 145 // To avoid applying oop closure more than once.
146 // Has to be an int because we cas it. 146 // Has to be an int because we cas it.
147 Klass* _klasses; // The classes defined by the class loader. 147 Klass* _klasses; // The classes defined by the class loader.
228 // method will allocate a Metaspace if needed. 228 // method will allocate a Metaspace if needed.
229 Metaspace* metaspace_non_null(); 229 Metaspace* metaspace_non_null();
230 230
231 oop class_loader() const { return _class_loader; } 231 oop class_loader() const { return _class_loader; }
232 232
233 // The object the GC is using to keep this ClassLoaderData alive.
234 oop keep_alive_object() const;
235
236 // Returns true if this class loader data is for a loader going away. 233 // Returns true if this class loader data is for a loader going away.
237 bool is_unloading() const { 234 bool is_unloading() const {
238 assert(!(is_the_null_class_loader_data() && _unloading), "The null class loader can never be unloaded"); 235 assert(!(is_the_null_class_loader_data() && _unloading), "The null class loader can never be unloaded");
239 return _unloading; 236 return _unloading;
240 } 237 }
241 238 // Anonymous class loader data doesn't have anything to keep them from
242 // Used to make sure that this CLD is not unloaded. 239 // being unloaded during parsing the anonymous class.
243 void set_keep_alive(bool value) { _keep_alive = value; } 240 void set_keep_alive(bool value) { _keep_alive = value; }
244 241
245 unsigned int identity_hash() { 242 unsigned int identity_hash() {
246 return _class_loader == NULL ? 0 : _class_loader->identity_hash(); 243 return _class_loader == NULL ? 0 : _class_loader->identity_hash();
247 } 244 }
261 const char* loader_name(); 258 const char* loader_name();
262 259
263 jobject add_handle(Handle h); 260 jobject add_handle(Handle h);
264 void add_class(Klass* k); 261 void add_class(Klass* k);
265 void remove_class(Klass* k); 262 void remove_class(Klass* k);
266 bool contains_klass(Klass* k);
267 void record_dependency(Klass* to, TRAPS); 263 void record_dependency(Klass* to, TRAPS);
268 void init_dependencies(TRAPS); 264 void init_dependencies(TRAPS);
269 265
270 void add_to_deallocate_list(Metadata* m); 266 void add_to_deallocate_list(Metadata* m);
271 267