RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v4]

Tagir F. Valeev tvaleev at openjdk.org
Mon Feb 6 10:08:52 UTC 2023


On Mon, 6 Feb 2023 10:01:49 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

> Suggestion: Refactor the uncommon cases into separate functions so the compiler can have easier time inlining the common path. Thanks

@merykitty this probably needs confirmation from VM folks. I'm pretty sure that C2 will be capable to do this having the profiling information, and I'm not sure whether we should optimize for C1. In any case, this could be done separately later, after careful benchmarking.

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

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


More information about the core-libs-dev mailing list