On Mon, 21 Mar 2022 14:24:30 GMT, Jim Laskey <[email protected]> wrote:
>> We propose to provide a runtime anonymous carrier class object generator;
>> java.lang.runtime.Carrier. This generator class is designed to share
>> anonymous classes when shapes are similar. For example, if several clients
>> require objects containing two integer fields, then Carrier will ensure that
>> each client generates carrier objects using the same underlying anonymous
>> class.
>>
>> See JBS for details.
>
> Jim Laskey has updated the pull request with a new target base due to a merge
> or a rebase. The incremental webrev excludes the unrelated changes brought in
> by the merge/rebase. The pull request contains 18 additional commits since
> the last revision:
>
> - Remove LOOKUP static final
> - Merge branch 'master' into 8282798
> - Typos
> - Update Carrier.java
> - Redo API to use list, bring Carrier.component back
> - Clean up API
> - Remove redundant MethodHandle component(MethodType methodType, int i) API
> - Revert to {@return} style comments.
> - Clarify primitive store in array carriers.
> - Use long array for primitives
> - ... and 8 more:
> https://git.openjdk.java.net/jdk/compare/7feac45e...a8657bbe
src/java.base/share/classes/java/lang/runtime/Carrier.java line 574:
> 572: try {
> 573: Lookup lookup = MethodHandles.lookup();
> 574: return lookup.defineHiddenClass(bytes, false,
> ClassOption.STRONG);
Actually, this lookup object should probably be kept cached.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7744