RFR: 8302066: Counter _number_of_nmethods_with_dependencies should be atomic.

Tobias Hartmann thartmann at openjdk.org
Wed Feb 8 12:21:47 UTC 2023


On Wed, 8 Feb 2023 11:48:13 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

> Hi, please consider!
> 
> We increment this counter when holding CodeCache, but loads are holding Compile_lock.
> Lets just make it atomic so we don't need to reason about if there is some race here.
> Also we are trying to avoid 'dirty' reads in the code base. (since in theory it is subject to things like word-tearing)
> 
> Testing tier1 in progress.
> 
> Thanks, Robbin

Looks good to me! Maybe rename `have_nmethods_with_dependencies` -> `has_nmethods_with_dependencies`.

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

Marked as reviewed by thartmann (Reviewer).

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


More information about the hotspot-compiler-dev mailing list