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

Doug Simon dnsimon at openjdk.org
Thu Aug 10 08:36:28 UTC 2023


On Tue, 8 Aug 2023 13:54:53 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).
>
> Doug Simon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'openjdk-jdk/master' into JDK-8313421
>  - avoid locking class loader in CompilerToVM.lookupType (JDK-8313421)

Thanks for the reviews.

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

PR Comment: https://git.openjdk.org/jdk/pull/15128#issuecomment-1672770989


More information about the hotspot-compiler-dev mailing list