On Sat, 21 Nov 2026 02:32:00 GMT, Vladimir Ivanov <[email protected]> wrote:

> Can you elaborate what do you mean by "avoid loading that class into the 
> ciEnv"? Does it mean "skip loading" or "returning unloaded ciKlass"?

For example, we have already calculated and determined that the only subclass 
of `A` is `B`. However, later on, when trying to call 
`ciInstanceKlass::implementor` on an interface `C`, the runtime finds the 
result to be a class `D` which is a subclass of `A` but not a subclass of `B`.

         A <----- D -----> C
         ^
         |
         B

Creating a `ciInstanceKlass` for `D` would lead to an inconsistency, so we fall 
back to a more conservative result for the call to 
`ciInstanceKlass::implementor` on `C` and assume it has multiple implementors. 
This is useful because the compiler does not expect to fail after calling 
something innocent such as `TypeOopPtr::make_from_klass`.

> Can you give more details about problematic cases/scenarios?

Same as the example above. But this time the class file says that it wants to 
create an instance of `D`. This time, we cannot reject the creation of the 
`ciInstanceKlass` for `D` as there is no reasonable thing to fall back to. So 
we still create that `ciInstanceKlass` and wait for the next call to 
`Compile::failing` to bail out.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/33753#issuecomment-7056498618

Reply via email to