equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2015, 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. |
44 // |
44 // |
45 // Loaded instance klass. |
45 // Loaded instance klass. |
46 ciInstanceKlass::ciInstanceKlass(KlassHandle h_k) : |
46 ciInstanceKlass::ciInstanceKlass(KlassHandle h_k) : |
47 ciKlass(h_k) |
47 ciKlass(h_k) |
48 { |
48 { |
49 assert(get_Klass()->oop_is_instance(), "wrong type"); |
49 assert(get_Klass()->is_instance_klass(), "wrong type"); |
50 assert(get_instanceKlass()->is_loaded(), "must be at least loaded"); |
50 assert(get_instanceKlass()->is_loaded(), "must be at least loaded"); |
51 InstanceKlass* ik = get_instanceKlass(); |
51 InstanceKlass* ik = get_instanceKlass(); |
52 |
52 |
53 AccessFlags access_flags = ik->access_flags(); |
53 AccessFlags access_flags = ik->access_flags(); |
54 _flags = ciFlags(access_flags); |
54 _flags = ciFlags(access_flags); |
354 if (!is_abstract()) return NULL; // Only applies to abstract classes. |
354 if (!is_abstract()) return NULL; // Only applies to abstract classes. |
355 if (!has_subklass()) return NULL; // Must have at least one subklass. |
355 if (!has_subklass()) return NULL; // Must have at least one subklass. |
356 VM_ENTRY_MARK; |
356 VM_ENTRY_MARK; |
357 InstanceKlass* ik = get_instanceKlass(); |
357 InstanceKlass* ik = get_instanceKlass(); |
358 Klass* up = ik->up_cast_abstract(); |
358 Klass* up = ik->up_cast_abstract(); |
359 assert(up->oop_is_instance(), "must be InstanceKlass"); |
359 assert(up->is_instance_klass(), "must be InstanceKlass"); |
360 if (ik == up) { |
360 if (ik == up) { |
361 return NULL; |
361 return NULL; |
362 } |
362 } |
363 return CURRENT_THREAD_ENV->get_instance_klass(up); |
363 return CURRENT_THREAD_ENV->get_instance_klass(up); |
364 } |
364 } |
681 ConstantPool* cp = ik->constants(); |
681 ConstantPool* cp = ik->constants(); |
682 |
682 |
683 // Try to record related loaded classes |
683 // Try to record related loaded classes |
684 Klass* sub = ik->subklass(); |
684 Klass* sub = ik->subklass(); |
685 while (sub != NULL) { |
685 while (sub != NULL) { |
686 if (sub->oop_is_instance()) { |
686 if (sub->is_instance_klass()) { |
687 out->print_cr("instanceKlass %s", sub->name()->as_quoted_ascii()); |
687 out->print_cr("instanceKlass %s", sub->name()->as_quoted_ascii()); |
688 } |
688 } |
689 sub = sub->next_sibling(); |
689 sub = sub->next_sibling(); |
690 } |
690 } |
691 |
691 |