RFR: 8333796: Add missing serialization functionality to sun.reflect.ReflectionFactory
Chen Liang
liach at openjdk.org
Fri Jul 5 14:46:47 UTC 2024
On Mon, 1 Jul 2024 12:58:16 GMT, David M. Lloyd <duke at openjdk.org> wrote:
>> My hope is that the method handle would be more easily inlined when each one is a separate constant. I'd feel less confident that this would be the case if I indirected through `List`. I think it would also increase the size of the generated method as well, though I'm not sure if there actually is any practical consequence to this.
>>
>> Also, this was easier. ;-)
>
> Oh, this comment landed on the wrong spot for some reason. To respond to the actual post here, I figured that the serialization library is likely to perform this caching anyway, so adding another layer here would just put more burden on the GC for no gain. But I'm not strongly committed to that stance.
Makes sense. No point of caching this when `Class` isn't even caching `getRecordComponents()` or `getPermittedSubclasses()`.
And yes, using classDataAt is easier in bytecode than adding another invokeinterface.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19702#discussion_r1661033583
More information about the core-libs-dev
mailing list