RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v2]
mchung at openjdk.java.net
Tue Sep 28 17:58:31 UTC 2021
On Tue, 28 Sep 2021 08:25:17 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.
> Peter Levart has updated the pull request incrementally with one additional commit since the last revision:
> Make Method/Constructor/Field instance fields initialized in the constructors final
> making fields @stable does improve performance since `jdk.internal.reflect` and `java.lang.reflect` are not final-field-trusted packages as you noted above. If JEP 416 makes them trusted, it can also remove the @stable annotations. But for backporting, they better stay there. WDYT?
Thanks for clarifying it. Okay to keep those changes.
> I made them final in newly added patch now. So we can either merge this or previous commit if desired.
I would suggest to use the previous commit so that this patch focuses on this specific change - making the accessor @Stable. We can make the fields final together with adding `jdk.internal.reflect` and `java.lang.reflect` in the trusted packages for TNSFF in JEP 416.
More information about the core-libs-dev