RFR: 8324584: Optimize Symbol and char* handling in ClassLoader [v4]

David Holmes dholmes at openjdk.org
Tue Feb 13 06:30:08 UTC 2024


On Mon, 12 Feb 2024 17:34:07 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

>> The call to `ClassLoader::load_class()` currently takes a Symbol* for the name and later extracts the string only to change it back into a Symbol* inside `ClassLoader::search_module_entries()` while also recalculating the package entry. This patch simply passes the string directly along with the package entry from the caller. Verified with tier1-5 tests.
>
> Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Improved comments

I hate to belabour this, but in trying to understand what the `pkg_entry` means it seems to me that it is only needed to extract the `ModuleEntry` and we have that information available at the top-level too. So we could pass that through instead. Thoughts?

The problem I'm having with this is how you would document/explain the API, because we are basically passing through "tramp data" for convenience as we evaluated something higher up the call chain that is needed again lower-down, so we pass it through rather than re-evaluating/re-calculating. But that then means there are very strict constraints between the different parameters, which are not captured/documented anywhere.

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

PR Review: https://git.openjdk.org/jdk/pull/17761#pullrequestreview-1876951643


More information about the hotspot-runtime-dev mailing list