RFR: 8230501: Class data support for hidden classes [v2]

Mandy Chung mchung at openjdk.java.net
Fri Nov 13 18:46:02 UTC 2020


On Thu, 12 Nov 2020 15:19:30 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> Also (as mentioned offline), while it's possible with the current API to provide an `Object[]` as class data, and then load elements of that array into CP entries using downstream condys (e.g. by creating an array access var handle and then using that), I think it would be good to add a `getArrayElement` BSM for doing that to `ConstantBootstraps` to make this (seemingly) common case easier (maybe also a `getField` for loading instance fields). This would help to address the case where multiple live constants need to be injected.

I am uncomfortable with adding `ConstantBootstraps::getArrayElement` because an array is modifiable and _not_ true constant.   A final instance field can be modified via reflection and therefore it's not trusted as a constant either.

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

PR: https://git.openjdk.java.net/jdk/pull/1171


More information about the core-libs-dev mailing list