After JDK-8138659 we have the following:
InstanceKlass::is_other_instance_klass
InstanceKlass::is_reference_instance_klass
InstanceKlass::is_mirror_instance_klass
InstanceKlass::is_class_loader_instance_klass
We also have:
Klass::oop_is_instance (135 occurrences)
Klass::oop_is_array (36 occurrences)
Klass::oop_is_objArray (25 occurrences)
Klass::oop_is_typeArray (23 occurrences)
The oop_ prefix is inappropriate for these Klass functions; the oop_ prefix is intended for operations that would have been member functions of the oop (pseudo) class, but have been moved to Klass for representational efficiency. That's not the case for these functions; a klass can be obtained from anywhere (not just from an oop) and asked about its type.
These are queries about the klass. For consistency with the similar InstanceKlass predicates, they should probably be suffixed with _klass.
If we're changing all these names anyway, some of the also violate current Hotspot style guidelines, which says (local) functions have all lower-case names. So perhaps "objArray" => "obj_array" or maybe "object_array"? And "typeArray" => "type_array". Although there are many other places that use objArray and typeArray, so it might be better to leave this alone. (For example, typeArrayOop and objArrayOop are in widespread use, and there are others.)
InstanceKlass::is_other_instance_klass
InstanceKlass::is_reference_instance_klass
InstanceKlass::is_mirror_instance_klass
InstanceKlass::is_class_loader_instance_klass
We also have:
Klass::oop_is_instance (135 occurrences)
Klass::oop_is_array (36 occurrences)
Klass::oop_is_objArray (25 occurrences)
Klass::oop_is_typeArray (23 occurrences)
The oop_ prefix is inappropriate for these Klass functions; the oop_ prefix is intended for operations that would have been member functions of the oop (pseudo) class, but have been moved to Klass for representational efficiency. That's not the case for these functions; a klass can be obtained from anywhere (not just from an oop) and asked about its type.
These are queries about the klass. For consistency with the similar InstanceKlass predicates, they should probably be suffixed with _klass.
If we're changing all these names anyway, some of the also violate current Hotspot style guidelines, which says (local) functions have all lower-case names. So perhaps "objArray" => "obj_array" or maybe "object_array"? And "typeArray" => "type_array". Although there are many other places that use objArray and typeArray, so it might be better to leave this alone. (For example, typeArrayOop and objArrayOop are in widespread use, and there are others.)
- relates to
-
JDK-8138923 Remove oop coupling with InstanceKlass subclasses
-
- Resolved
-
-
JDK-8138659 Speed up InstanceKlass subclass discrimination
-
- Resolved
-