RFR: 8329764: G1: Handle null references during verification first [v3]

Thomas Schatzl tschatzl at openjdk.org
Wed Apr 10 08:34:10 UTC 2024


On Wed, 10 Apr 2024 07:24:06 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> > this change speeds up the common case (no error, null references),
> 
> That's true, but the new logic is kind of surprising -- the threshold is checked after we de-ref the field; I would have expected the threshold controls the field-iteration/de-ref.

That is why I consider this change "ugly" as well.

Looking at perf counters, my hunch is that the two loads for the current failure counter and the bound (and comparison) are just much more expensive (in terms of cpu resources even if both branches are easily predicted) than the single pointer deref and check against `null`.

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

PR Comment: https://git.openjdk.org/jdk/pull/18650#issuecomment-2046902512


More information about the hotspot-gc-dev mailing list