1 /*
2 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
258 bool is_ext_class_loader_data() const;
259
260 // The Metaspace is created lazily so may be NULL. This
261 // method will allocate a Metaspace if needed.
262 Metaspace* metaspace_non_null();
263
264 oop class_loader() const { return _class_loader; }
265
266 // The object the GC is using to keep this ClassLoaderData alive.
267 oop keep_alive_object() const;
268
269 // Returns true if this class loader data is for a loader going away.
270 bool is_unloading() const {
271 assert(!(is_the_null_class_loader_data() && _unloading), "The null class loader can never be unloaded");
272 return _unloading;
273 }
274
275 // Used to make sure that this CLD is not unloaded.
276 void set_keep_alive(bool value) { _keep_alive = value; }
277
278 unsigned int identity_hash() const {
279 return _class_loader == NULL ? 0 : _class_loader->identity_hash();
280 }
281
282 // Used when tracing from klasses.
283 void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim);
284
285 void classes_do(KlassClosure* klass_closure);
286
287 JNIMethodBlock* jmethod_ids() const { return _jmethod_ids; }
288 void set_jmethod_ids(JNIMethodBlock* new_block) { _jmethod_ids = new_block; }
289
290 void print_value() { print_value_on(tty); }
291 void print_value_on(outputStream* out) const;
292 void dump(outputStream * const out) PRODUCT_RETURN;
293 void verify();
294 const char* loader_name();
295
296 jobject add_handle(Handle h);
297 void add_class(Klass* k, bool publicize = true);
298 void remove_class(Klass* k);
299 bool contains_klass(Klass* k);
300 void record_dependency(const Klass* to, TRAPS);
|
1 /*
2 * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
258 bool is_ext_class_loader_data() const;
259
260 // The Metaspace is created lazily so may be NULL. This
261 // method will allocate a Metaspace if needed.
262 Metaspace* metaspace_non_null();
263
264 oop class_loader() const { return _class_loader; }
265
266 // The object the GC is using to keep this ClassLoaderData alive.
267 oop keep_alive_object() const;
268
269 // Returns true if this class loader data is for a loader going away.
270 bool is_unloading() const {
271 assert(!(is_the_null_class_loader_data() && _unloading), "The null class loader can never be unloaded");
272 return _unloading;
273 }
274
275 // Used to make sure that this CLD is not unloaded.
276 void set_keep_alive(bool value) { _keep_alive = value; }
277
278 inline unsigned int identity_hash() const;
279
280 // Used when tracing from klasses.
281 void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim);
282
283 void classes_do(KlassClosure* klass_closure);
284
285 JNIMethodBlock* jmethod_ids() const { return _jmethod_ids; }
286 void set_jmethod_ids(JNIMethodBlock* new_block) { _jmethod_ids = new_block; }
287
288 void print_value() { print_value_on(tty); }
289 void print_value_on(outputStream* out) const;
290 void dump(outputStream * const out) PRODUCT_RETURN;
291 void verify();
292 const char* loader_name();
293
294 jobject add_handle(Handle h);
295 void add_class(Klass* k, bool publicize = true);
296 void remove_class(Klass* k);
297 bool contains_klass(Klass* k);
298 void record_dependency(const Klass* to, TRAPS);
|