RFR: 8142487: Cleanup sun.invoke.util.Wrapper zeroes to be both reliable and lazy
Claes Redestad
claes.redestad at oracle.com
Thu Nov 12 14:13:37 UTC 2015
On 2015-11-12 01:10, John Rose wrote:
> For better maintainability, I think the zero and identity forms should be created together, not in separate twin code blocks.
>
> I think this is a safer, saner way to inject laziness here:
>
> - private static void createIdentityForms() {
> + // Create LF_zero, LF_identity, etc., for the given type.
> + private static void createIdentityForms(BasicType type) {
>
> It means that groups of LFs get lazily created; if that is tolerable for the present purpose, it's easier to reason about.
>
> — John
How about this:
http://cr.openjdk.java.net/~redestad/8142487/webrev.02
I'm seeing no increase in number of LambdaForms or NamedFunctions
created by merging it all back into one method, while getting rid of
MN_* arrays.
I fixed the obvious mistake in sun.invoke.util.WrapperTest w.r.t
byte/char, and since these tests fail against JDK-8141678 I wouldn't
mind keeping it around.
/Claes
More information about the core-libs-dev
mailing list