equal
deleted
inserted
replaced
1 /* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
1 /* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * |
3 * |
4 * This code is free software; you can redistribute it and/or modify it |
4 * This code is free software; you can redistribute it and/or modify it |
5 * under the terms of the GNU General Public License version 2 only, as |
5 * under the terms of the GNU General Public License version 2 only, as |
6 * published by the Free Software Foundation. |
6 * published by the Free Software Foundation. |
49 |
49 |
50 if (Devirtualizer::do_metadata(closure)) { |
50 if (Devirtualizer::do_metadata(closure)) { |
51 Klass* klass = java_lang_Class::as_Klass(obj); |
51 Klass* klass = java_lang_Class::as_Klass(obj); |
52 // We'll get NULL for primitive mirrors. |
52 // We'll get NULL for primitive mirrors. |
53 if (klass != NULL) { |
53 if (klass != NULL) { |
54 if (klass->is_instance_klass() && InstanceKlass::cast(klass)->is_anonymous()) { |
54 if (klass->is_instance_klass() && |
55 // An anonymous class doesn't have its own class loader, so when handling |
55 InstanceKlass::cast(klass)->is_unsafe_anonymous()) { |
56 // the java mirror for an anonymous class we need to make sure its class |
56 // An unsafe anonymous class doesn't have its own class loader, so |
|
57 // when handling the java mirror for the class we need to make sure its class |
57 // loader data is claimed, this is done by calling do_cld explicitly. |
58 // loader data is claimed, this is done by calling do_cld explicitly. |
58 // For non-anonymous classes the call to do_cld is made when the class |
59 // For non-anonymous classes the call to do_cld is made when the class |
59 // loader itself is handled. |
60 // loader itself is handled. |
60 Devirtualizer::do_cld(closure, klass->class_loader_data()); |
61 Devirtualizer::do_cld(closure, klass->class_loader_data()); |
61 } else { |
62 } else { |