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

some uses of ciKlass::is_java_lang_Object need refactoring

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: hotspot
    • Labels:

      Description

      As a universal reference type, java.lang.Object has a special place,
      and the JIT has some ad hoc special-case logic that detects this class.
      The usual idiom is some variation on ti->klass()->is_java_lang_Object.
      In many cases, the logic is *also* specialized for interfaces,
      on the grounds that the JVM verifier treats interfaces as aliases
      for Object. (Conversion between them is unchecked at the JVM level.)

      There are often (and currently, I think) some places where
      special-case treatment of Object should be extended to interfaces.
      This is a recurrent bug, and should be fixed by refactoring the
      type-test APIs in the JIT (C2 and probably also C1) to use an
      appropriate new API point, "is_java_lang_Object_or_interface", or
      even "is_unconstrained_reference". This API point should be put
      onto both ciKlass *and* TypePtr.

      The code should be audited to replace explicit mentions of Object
      with uses of the new API point, or else document remaining explicit
      mentions of Object with a note saying why interfaces are not relevant
      also.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thartmann Tobias Hartmann
                Reporter:
                jrose John Rose
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: