RFR: 8325949: Create an internal utility method for creating VarHandle instances [v6]
Per Minborg
pminborg at openjdk.org
Fri Sep 20 07:36:18 UTC 2024
> This PR suggests introducing an internal class in `java.base` to simplify the use of some `MethodHandles.Lookup` operations.
>
> While the utility of the methods might appear to be limited in classes with many static `VarHandle`/`MethodHandle` variables, it should be noted that the class files become smaller and simpler. Here are some examples:
>
> | Class File | Base [Bytes] | Patch [Byte] |
> | --------------------------------| ------------- | ------------ |
> | FutureTask.class | 10,255 | 10,123 |
> | AtomicBoolean.class | 5,364 | 5,134 |
> |AtomicMarkableReference.class | 3,890 | 3,660 |
>
> 
>
> The new `MethodHandlesInternal.class` file is of size 1,952 bytes.
>
> In total for `java.base` we have:
>
> | Build map "jdk" | Size [Bytes] |
> | ---------------| ------------- |
> | Base | 5,906,457 |
> | Patch | 5,905,487 |
> | Delta | 940|
>
> For 60 billion instances, this represents > 50 TB.
>
> Tried and passed tier1-3
Per Minborg 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 11 additional commits since the last revision:
- Simplify calls
- Merge branch 'master' into internal-mh-util
- Merge branch 'master' into internal-mh-util
- Rename class and shorten JavaDoc
- Update javadoc
- Rename utility class
- Move to new package and add overload
- Merge branch 'master' into internal-mh-util
- Rename and reformat
- Fix copyright headers
- ... and 1 more: https://git.openjdk.org/jdk/compare/85e28c70...5d9f1be9
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/20972/files
- new: https://git.openjdk.org/jdk/pull/20972/files/a1444c28..5d9f1be9
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=20972&range=05
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=20972&range=04-05
Stats: 20508 lines in 294 files changed: 18484 ins; 277 del; 1747 mod
Patch: https://git.openjdk.org/jdk/pull/20972.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/20972/head:pull/20972
PR: https://git.openjdk.org/jdk/pull/20972
More information about the core-libs-dev
mailing list