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

Tobias Hartmann thartmann at openjdk.org
Mon Aug 7 13:21:31 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).

Looks good to me but I'm not an expert in this code.

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

Marked as reviewed by thartmann (Reviewer).

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


More information about the graal-dev mailing list