RFR (S) 8073479: Replace obj.getClass hacks with Objects.requireNonNull
Vladimir Ivanov
vladimir.x.ivanov at oracle.com
Fri Feb 20 13:15:30 UTC 2015
> So we hope for Objects.requireNonNull to be inlined most of the times.
> It would be nice if @ForceInline annotation was accessible outside
> java.lang.invoke package, so methods like requireNonNull could benefit
> from it too. With modules, such platform annotations could be made
> public and put into a package (java.lang.internal) that is not exported
> to the world.
I don't think @ForceInline is the right solution here.
I'd be happy to get rid of it in java.lang.invoke code as well :-)
Instead, JIT inlining heuristics should be tuned to favor inlining
trivial and small methods.
There's -XX:MaxInlineSize(=35) flag in HotSpot. With current inlining
heuristics, C1 & C2 should almost always inline the method.
Best regards,
Vladimir Ivanov
More information about the core-libs-dev
mailing list