RFR: 8313421: [JVMCI] avoid locking class loader in CompilerToVM.lookupType

Tom Rodriguez never at openjdk.org
Thu Aug 3 08:34:50 UTC 2023


On Wed, 2 Aug 2023 20:33:49 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

> This PR removes the need to lock the system class loader when converting Class instances for boot and platform classes to ResolvedJavaType objects. Not only is the system class loader a suboptimal loader for resolving these classes but locking it can cause deadlock in some JDK tests (e.g. `test/jdk/java/lang/System/LoggerFinder/`) when run with `-Xcomp`. For example, a thread that holds the system class loader lock and triggers a blocking compilation will deadlock with the compiler thread servicing the compilation if the compilation requires calling `CompilerToVM.lookupType` (which most compilations do).

This looks looks like a nice cleanup

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

Marked as reviewed by never (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15128#pullrequestreview-1559962501


More information about the hotspot-compiler-dev mailing list