On Mon, 1 May 2023 22:25:31 GMT, Jorn Vernee <jver...@openjdk.org> wrote:
> Type profiling works for the HC type we define, we inline `HC::foo`, and find > that: hey, in HC::foo's implementation, the target MH is constant, so we can > inline through that as well. Giving us once again, optimal performance. My fear is that, without this, people will keep reaching for LambdaMetafactory instead, which does have the ability to give you a type per MethodHandle instance. Maybe a compromise is to let the current `asInterfaceInstance` share the classes (using MH instance fields), but we add a `asUniqueInterfaceInstance` (name tbd) which does guarantee a 1-to-1 mapping between a type and a MH instance (which would allow inlining). ------------- PR Comment: https://git.openjdk.org/jdk/pull/13197#issuecomment-1530476940