RFR: 8373633: C2: Use interface receiver type to improve CHA decisions [v2]

Vladimir Ivanov vlivanov at openjdk.org
Thu Jan 29 21:27:20 UTC 2026


On Thu, 29 Jan 2026 12:22:33 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Even better, since these `_interfaces` are trusted, we don't need to emit a runtime check for the type.
>
> Come to think of it, we can use `interface->unique_implementor()` similar to how we use `ik->unique_concrete_subklass()` in `TypeOopPtr::make_from_klass_common`, that is to tighten the `TypeOopPtr` at the time of creation.

What makes it more complicated is the requirement to return a subtype of declared interface. `_interfaces` contain a closure of a set of interfaces. A dependency on an unrelated interface (in the context of the call site) is not enough to ensure correctness of interface->virtual strength reduction.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28811#discussion_r2743614851


More information about the hotspot-compiler-dev mailing list