On Fri, 27 Jun 2025 20:21:31 GMT, ExE Boss <d...@openjdk.org> wrote: >> My point is this is a performance-sensitive API. We are using a known-slow >> check method `checkFromIndexSize` which may introduce a performance >> regression. > > Maybe use `jdk.internal.util.Preconditions` directly instead? > Suggestion: > > Preconditions.checkFromIndexSize(off, len, ba.length, null);
@ExE-Boss, I consulted this internally and decided to stick to using public APIs, unless there is a reason not to do so. In short, given `Objects::checkFromIndexSize` directly delegates to `Preconditions::checkFromIndexSize`, I expect that C2 will do its magic. Note my remark above that, prior to promoting this draft to a PR, a comprehensive benchmark suite run will be performed when all intrinsics of concern are addressed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25998#discussion_r2185587428