8139203: Consistent naming for klass type predicates

8138923: Remove oop coupling with InstanceKlass subclasses

Renamed oop_is_instance and friends, removed the functions in oop that dug down into InstanceKlass.

Reviewed-by: jrose, lfoltan, stefank
This commit is contained in:
Coleen Phillimore 2015-10-28 09:47:23 -04:00
parent 5179fc3488
commit fc03719078
68 changed files with 257 additions and 279 deletions

View file

@ -348,7 +348,7 @@ GrowableArray<Klass*>* Klass::compute_secondary_supers(int num_extra_slots) {
InstanceKlass* Klass::superklass() const {
assert(super() == NULL || super()->oop_is_instance(), "must be instance klass");
assert(super() == NULL || super()->is_instance_klass(), "must be instance klass");
return _super == NULL ? NULL : InstanceKlass::cast(_super);
}
@ -440,7 +440,7 @@ void Klass::clean_weak_klass_links(BoolObjectClosure* is_alive, bool clean_alive
}
// Clean the implementors list and method data.
if (clean_alive_klasses && current->oop_is_instance()) {
if (clean_alive_klasses && current->is_instance_klass()) {
InstanceKlass* ik = InstanceKlass::cast(current);
ik->clean_weak_instanceklass_links(is_alive);
}
@ -560,7 +560,7 @@ oop Klass::class_loader() const { return class_loader_data()->class_loader(); }
// In product mode, this function doesn't have virtual function calls so
// there might be some performance advantage to handling InstanceKlass here.
const char* Klass::external_name() const {
if (oop_is_instance()) {
if (is_instance_klass()) {
const InstanceKlass* ik = static_cast<const InstanceKlass*>(this);
if (ik->is_anonymous()) {
intptr_t hash = 0;
@ -695,7 +695,7 @@ bool Klass::verify_vtable_index(int i) {
}
bool Klass::verify_itable_index(int i) {
assert(oop_is_instance(), "");
assert(is_instance_klass(), "");
int method_count = klassItable::method_count_for_interface(this);
assert(i >= 0 && i < method_count, "index out of bounds");
return true;
@ -711,11 +711,11 @@ class TestKlass {
public:
static void test_oop_is_instanceClassLoader() {
Klass* klass = SystemDictionary::ClassLoader_klass();
guarantee(klass->oop_is_instance(), "assert");
guarantee(klass->is_instance_klass(), "assert");
guarantee(InstanceKlass::cast(klass)->is_class_loader_instance_klass(), "test failed");
klass = SystemDictionary::String_klass();
guarantee(!klass->oop_is_instance() ||
guarantee(!klass->is_instance_klass() ||
!InstanceKlass::cast(klass)->is_class_loader_instance_klass(),
"test failed");
}
@ -725,4 +725,4 @@ void TestKlass_test() {
TestKlass::test_oop_is_instanceClassLoader();
}
#endif
#endif // PRODUCT