RFR: 8282143: Objects.requireNonNull should be ForceInline
Quan Anh Mai
duke at openjdk.java.net
Sat Feb 19 05:58:05 UTC 2022
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.
-------------
Commit messages:
- requireNonNull force inline
Changes: https://git.openjdk.java.net/jdk/pull/7543/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7543&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8282143
Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
Patch: https://git.openjdk.java.net/jdk/pull/7543.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/7543/head:pull/7543
PR: https://git.openjdk.java.net/jdk/pull/7543
More information about the core-libs-dev
mailing list