On Mon, 15 Jul 2024 17:00:24 GMT, Rémi Forax <fo...@openjdk.org> wrote:
> Even if the int vs long issue is fixed for this case, i think we should > recommand to call `withInvokeExactBehavior()` after creating any VarHandle so > all the auto-conversions are treated as runtime errors. > > This is what i do with my students (when using compareAndSet) and it makes > this kind of perf issue easy to find and easy to fix. Note that this has nothing to do with implicit conversion, as the memory segment var handle is called by our implementation, with the correct type (a long). This is likely an issue with bound check elimination with "long loops". ------------- PR Comment: https://git.openjdk.org/jdk/pull/20158#issuecomment-2228992252