Review request for JDK-8141425: Improve caching in NashornCallSiteDescriptor
Attila Szegedi
attila.szegedi at oracle.com
Wed Nov 4 13:59:20 UTC 2015
Please review JDK-8141425 "Improve caching in NashornCallSiteDescriptor" at <http://cr.openjdk.java.net/~attila/8141425/webrev.jdk9> for <https://bugs.openjdk.java.net/browse/JDK-8141425>
Few words on the implementation:
- I went with one String->NamedOperation map per Nashorn operation, as this makes it unnecessary to create a NamedOperation to use as a key (and then have the map use its equals/hashCode)
- I went with global caching, which necessitates using weak/weak synchronized maps. Alternatively, we could’ve used a per-class caching as for the call site descriptors themselves, but as one class is one function in Nashorn, that’d result in reuse of NamedOperation objects only within a single function. (But we’d get rid of both synchronization and use of weak references.)
Thanks,
Attila.
More information about the nashorn-dev
mailing list