RFR: 8317266: Move nmethod::check_all_dependencies to codeCache.cpp and mark it NOT_PRODUCT

Evgeny Astigeevich eastigeevich at openjdk.org
Wed Oct 11 14:22:10 UTC 2023


`nmethod::check_all_dependencies` goes over live nmethods and checks if any of nmethod's dependencies have been invalidated. It is public static and does not use any private/protected members of nmethod. There are no other uses of `nmethod::check_all_dependencies` but in `CodeCache::mark_for_deoptimization` of codeCache.cpp. The use is in NOT_PRODUCT code. The function has not-product code dependant on not-product `TraceDependencies`. If `TraceDependencies` is enabled in a release build, the code will not be available and there will be significant performance impact. See https://bugs.openjdk.org/browse/JDK-7194669 for details.

As the function is only used in debug builds, depends on not-product code, does not use any specifics of nmethods and has only one use, it is reasonable to move it to codeCache.cpp and to make it a standalone static function guarded by `#ifndef PRODUCT`

Tested with fastdebug and release builds:
- [x] gtest
- [x] tier1

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

Commit messages:
 - 8317266: Move nmethod::check_all_dependencies to codeCache.cpp and mark it NOT_PRODUCT

Changes: https://git.openjdk.org/jdk/pull/16152/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16152&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8317266
  Stats: 98 lines in 3 files changed: 48 ins; 49 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/16152.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16152/head:pull/16152

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


More information about the hotspot-compiler-dev mailing list