1 /*
2 * Copyright (c) 2012, 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 *
203 assert(!(is_the_null_class_loader_data() && _unloading), "The null class loader can never be unloaded");
204 return _unloading;
205 }
206 // Anonymous class loader data doesn't have anything to keep them from
207 // being unloaded during parsing the anonymous class.
208 void set_keep_alive(bool value) { _keep_alive = value; }
209
210 unsigned int identity_hash() {
211 return _class_loader == NULL ? 0 : _class_loader->identity_hash();
212 }
213
214 // Used when tracing from klasses.
215 void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim);
216
217 void classes_do(KlassClosure* klass_closure);
218
219 JNIMethodBlock* jmethod_ids() const { return _jmethod_ids; }
220 void set_jmethod_ids(JNIMethodBlock* new_block) { _jmethod_ids = new_block; }
221
222 void print_value() { print_value_on(tty); }
223 void print_value_on(outputStream* out) const PRODUCT_RETURN;
224 void dump(outputStream * const out) PRODUCT_RETURN;
225 void verify();
226 const char* loader_name();
227
228 jobject add_handle(Handle h);
229 void add_class(Klass* k);
230 void remove_class(Klass* k);
231 void record_dependency(Klass* to, TRAPS);
232 void init_dependencies(TRAPS);
233
234 void add_to_deallocate_list(Metadata* m);
235
236 static ClassLoaderData* class_loader_data(oop loader);
237 static ClassLoaderData* anonymous_class_loader_data(oop loader, TRAPS);
238 static void print_loader(ClassLoaderData *loader_data, outputStream *out);
239
240 // CDS support
241 Metaspace* ro_metaspace();
242 Metaspace* rw_metaspace();
243 void initialize_shared_metaspaces();
|
1 /*
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.
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 *
203 assert(!(is_the_null_class_loader_data() && _unloading), "The null class loader can never be unloaded");
204 return _unloading;
205 }
206 // Anonymous class loader data doesn't have anything to keep them from
207 // being unloaded during parsing the anonymous class.
208 void set_keep_alive(bool value) { _keep_alive = value; }
209
210 unsigned int identity_hash() {
211 return _class_loader == NULL ? 0 : _class_loader->identity_hash();
212 }
213
214 // Used when tracing from klasses.
215 void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim);
216
217 void classes_do(KlassClosure* klass_closure);
218
219 JNIMethodBlock* jmethod_ids() const { return _jmethod_ids; }
220 void set_jmethod_ids(JNIMethodBlock* new_block) { _jmethod_ids = new_block; }
221
222 void print_value() { print_value_on(tty); }
223 void print_value_on(outputStream* out) const;
224 void dump(outputStream * const out) PRODUCT_RETURN;
225 void verify();
226 const char* loader_name();
227
228 jobject add_handle(Handle h);
229 void add_class(Klass* k);
230 void remove_class(Klass* k);
231 void record_dependency(Klass* to, TRAPS);
232 void init_dependencies(TRAPS);
233
234 void add_to_deallocate_list(Metadata* m);
235
236 static ClassLoaderData* class_loader_data(oop loader);
237 static ClassLoaderData* anonymous_class_loader_data(oop loader, TRAPS);
238 static void print_loader(ClassLoaderData *loader_data, outputStream *out);
239
240 // CDS support
241 Metaspace* ro_metaspace();
242 Metaspace* rw_metaspace();
243 void initialize_shared_metaspaces();
|