Integrated: 8282143: Objects.requireNonNull should be ForceInline

Quan Anh Mai duke at openjdk.java.net
Wed Mar 2 00:49:06 UTC 2022


On Sat, 19 Feb 2022 05:51:52 GMT, Quan Anh Mai <duke at openjdk.java.net> wrote:

> Hi,
> 
> `Objects.requireNonNull` may fail to be inlined. The call is expensive and may lead to objects escaping to the heap while the null check is cheap and is often elided. I have observed this when using the vector API when a call to `Objects.requireNonNull` leads to vectors being materialised in a hot loop.
> 
> Should the other `requireNonNull` be `ForceInline` as well?
> 
> Thank you very much.

This pull request has now been integrated.

Changeset: fc52a218
Author:    Quan Anh Mai <anhmdq99 at gmail.com>
Committer: Paul Sandoz <psandoz at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/fc52a2182a9debc04b2ac302801b3d61989f54ec
Stats:     2 lines in 1 file changed: 2 ins; 0 del; 0 mod

8282143: Objects.requireNonNull should be ForceInline

Reviewed-by: psandoz

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

PR: https://git.openjdk.java.net/jdk/pull/7543


More information about the core-libs-dev mailing list