RFR: 8336421: ciMethod() constructor should use ConditionalMutexLocker(Compile_lock)

Vladimir Kozlov kvn at openjdk.org
Tue Jul 16 01:06:31 UTC 2024


During Leyden testing with `-XX:+LogCompilation` flag I hit assert because `ciMethod()` could be called from `ciEnv::register_method()` which already holds `Compile_lock` lock. See call stack in JBS report.
Use `ConditionalMutexLocker` in `ciMethod()`.
This is normal code pattern used in other places where we can have nested locking: [compileBroker.cpp#L2847](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/compiler/compileBroker.cpp#L2847).

Tested tier1.

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

Commit messages:
 - 8336421: ciMethod() constructor should use ConditionalMutexLocker(Compile_lock)

Changes: https://git.openjdk.org/jdk/pull/20187/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20187&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8336421
  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/20187.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20187/head:pull/20187

PR: https://git.openjdk.org/jdk/pull/20187


More information about the hotspot-compiler-dev mailing list