RFR (S) 8073479: Replace obj.getClass hacks with Objects.requireNonNull
Aleksey Shipilev
aleksey.shipilev at oracle.com
Fri Feb 20 13:17:37 UTC 2015
Hi Peter,
Thanks for additional testing!
On 02/20/2015 03:48 PM, Peter Levart wrote:
> So we hope for Objects.requireNonNull to be inlined most of the times.
Yes, I think so, otherwise it is a platform bug :) And, as I said in
reply to Vitaly, the ultimate answer would be to intrinsify
Objects.requireNonNull to unconditionally bias it towards the non-null
case and implicit NP checks.
The test is actually specifically crafted to amplify the costs of the
pollution. The side effect of that method is excessive method calls.
It's not a surprise CPUs can execute the dense code oblivious of minor
code differences. (Speculation: CPUs need to re-adjust their pipelines
after the real call, so non-inlined version would pay some extra)
Thanks,
-Aleksey
More information about the core-libs-dev
mailing list