RFR: 8298177: Various java.lang.invoke cleanups

Jorn Vernee jvernee at openjdk.org
Tue Dec 6 16:22:47 UTC 2022


On Tue, 6 Dec 2022 15:22:27 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> Various code cleanups around java.lang.invoke code. Started out with dead code removal in `jli.MemberName`, then piled on to fix a set of minor inefficiencies (excessive vararg array allocations, unnecessary defensive cloning of parameter arrays etc).

src/java.base/share/classes/java/lang/invoke/MemberName.java line 578:

> 576:             throw new LinkageError(m.toString());
> 577:         }
> 578:         assert(isResolved());

I don't see why this can be removed. Can you explain?

src/java.base/share/classes/java/lang/invoke/MemberName.java line 657:

> 655:         this.name = fld.getName();
> 656:         this.type = fld.getType();
> 657:         // assert((REF_putStatic - REF_getStatic) == (REF_putField - REF_getField));

Intellij says this is always true. Maybe it could be put in the `static {}` block instead?

Also, I think this should just be removed if it's not needed. (instead of commented out)

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

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


More information about the core-libs-dev mailing list