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.
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.
- relates to
-
JDK-8207773 [lworld] C2 should not allocate when returning a value type as Object from an inlined method
-
- Resolved
-