RFR(XS) 8145579: SimpleThresholdPolicy assumes non-trivial methods to be trivial

Aleksey Shipilev shade at redhat.com
Mon Dec 4 20:10:26 UTC 2017


On 12/04/2017 06:44 PM, dean.long at oracle.com wrote:
> https://bugs.openjdk.java.net/browse/JDK-8145579
> http://cr.openjdk.java.net/~dlong/8145579/webrev/
> 
> This change fixes certain non-trivial methods being marked as trivial.  A method should only be
> marked as trivial if C2 cannot generate better code.  The two cases fixed here are calling
> intrinsics, and Object.<init>, which has a hidden call to register finalizers.  

I am good with the fix, but my issue is with the essence of that shortcut. We can keep piling on
exceptions on top of exceptions to that triviality rule, or we can just dispense with the idea that
we can guess what methods are trivial and/or remember to fix it up every time something changes.

Is it really worth falling back to C1 for trivial methods? I.e. is C2 compilation for those methods
too costly (which would seem counter-intuitive)? Can we remove that triviality check, and see if we
run fine without it?

Thanks,
-Aleksey


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20171204/f9922fff/signature.asc>


More information about the hotspot-compiler-dev mailing list