Integrated: 8297728: Cache invocation type rather than invoker in NamedFunction

Claes Redestad redestad at openjdk.org
Wed Nov 30 20:58:34 UTC 2022


On Tue, 29 Nov 2022 21:57:09 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> `java.lang.invoke.LambdaForm.NamedFunction` has an `invoker` field acting as a cache, but this field is only used for lambda form interpretation, thus not very performance sensitive. 
> 
> Since the invoker is already cached in the method type hierarchy we could replace it with a cache of the invocation type instead. This means cost to retrieve an invoker for lambda form interpretation is only slightly affected (a few ns/op that end up in the noise since interpretation already incur a >50ns/op overhead on even the simplest forms), while speeding up bytecode generation for `LF`s with `NamedFunction`s not holding a resolvedHandle.
> 
> Being lazy about the creation of the type is not significantly beneficial right now, but is done in anticipation of future changes that may better defer bytecode spinning for `LambdaForm`s.

This pull request has now been integrated.

Changeset: 4485d4e5
Author:    Claes Redestad <redestad at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/4485d4e517b6dece7a9eeb5cf9a2180d84956da3
Stats:     19 lines in 1 file changed: 9 ins; 6 del; 4 mod

8297728: Cache invocation type rather than invoker in NamedFunction

Reviewed-by: jvernee

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

PR: https://git.openjdk.org/jdk/pull/11424


More information about the core-libs-dev mailing list