RFR: 8274299: Make Method/Constructor/Field accessors @Stable
redestad at openjdk.java.net
Mon Sep 27 11:26:53 UTC 2021
On Sat, 25 Sep 2021 10:15:11 GMT, Peter Levart <plevart at openjdk.org> wrote:
> This patch improves reflective access speed as shown by the included benchmarks:
> ... and is also a prerequisite to make JEP 416 (Reimplement Core Reflection with Method Handle) perform better in some circumstances.
This looks good, assuming Mandy is OK with extracting and adding to the microbenchmarks from JEP 416
A stray thought is why not most fields in `Field`/`Method`/`Constructor` are `final`, as my IDE suggests. I can't find any hotspot code that injects values to these fields. Experimentally changing most fields in `Field` to final seem to pass at least all the java/lang/reflect tests. Since this is a trusted package `@Stable` should then be pointless.
Marked as reviewed by redestad (Reviewer).
More information about the core-libs-dev