Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8139203

Consistent naming for klass type predicates

    Details

    • Subcomponent:
    • Resolved In Build:
      b93
    • CPU:
      generic
    • OS:
      generic

      Description

      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.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                coleenp Coleen Phillimore
                Reporter:
                kbarrett Kim Barrett
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: