RFR: 8320276: Improve class initialization barrier in TemplateTable::_new [v2]

Matias Saavedra Silva matsaave at openjdk.org
Thu Dec 21 17:47:37 UTC 2023


On Thu, 21 Dec 2023 02:51:41 GMT, David Holmes <dholmes at openjdk.org> wrote:

> The code itself seems fine. But I don't see any supporting evidence of how this optimisation performs. IIUC the only case it benefits is when a static initializer creates an instance of the class being initialized - how typical is that?
> 
> The definitions of `supports_fast_class_init_checks` all have the comment:
> 
> ```
> // ... supports fast class initialization checks for static methods.
> ```
> 
> which needs updating now it is not just for static methods. (Actually the comments became out-dated with [JDK-8223216](https://bugs.openjdk.org/browse/JDK-8223216) but it would be nice to fix them all.)
> 
> Would be nice to see this applied across all platforms too - or at least those that support fast_class_init - ppc and s390. Perhaps file follow-up RFE's for those platforms so this is not forgotten. I note that RISCV64 doesn't support fast_class_init at all yet.
> 
> Thanks

Thank you for pointing this out, I did mean to report some performance metrics. While I'm not sure how typical this case is, the performance results indicate a meaningful improvement. I will attach them to the description at the top of this PR. 

With regard to other platforms, I agree that it's a good idea to open RFE's for the remaining platforms.

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

PR Comment: https://git.openjdk.org/jdk/pull/17006#issuecomment-1866703207


More information about the hotspot-dev mailing list