RFR(L): 8161211: better inlining support for loop bytecode intrinsics

Michael Haupt michael.haupt at oracle.com
Fri Sep 23 13:40:21 UTC 2016


Hi John,

thank you for your review. Comments on your suggestions are inlined.

> Am 22.09.2016 um 20:04 schrieb John Rose <john.r.rose at oracle.com>:
> On Sep 22, 2016, at 12:23 AM, Michael Haupt <michael.haupt at oracle.com <mailto:michael.haupt at oracle.com>> wrote:
>> The new webrev is at http://cr.openjdk.java.net/~mhaupt/8161211/webrev.01/ <http://cr.openjdk.java.net/~mhaupt/8161211/webrev.01/>; please review.
> 
> 
> Suggestion:  Filter all loop clause functions with ".asFixedArity" when you wrap up the constant array.
> This will do two things:  1. double-check for nulls (which @Stable doesn't like) and 2. allow you to
> omit all asFixedArity calls from the driver function (MHI.loop).  The asFixedArity normalization could
> move into MethodHandles.java, in fact, since that's part of the advertised semantics (hmm, right?).

The double-checking for nulls is not strictly required, as none of the handles in any of the loop clauses will be null at the point the call to MethodHandleImpl.makeLoop() is made. I still like the idea of moving these calls out of the driver and will apply it. I'm applying the same transformation to the tryFinally combinator.

> Also (this is a nit) consider commoning (binding a temp for) the three expressions 'init[i]' in the driver.
> I noticed that while peeking at the asFixedArity calls.  The JIT will DTRT here, but we might as well
> make its job a bit easier.  JITs enjoy little favors like that; they are less likely to drop optimizations.

Agreed.

With the performance measurements showing no difference, I'm going to push with these modifications.

Best,

Michael

-- 

 <http://www.oracle.com/>
Dr. Michael Haupt | Principal Member of Technical Staff
Phone: +49 331 200 7277 | Fax: +49 331 200 7561
Oracle Java Platform Group | LangTools Team | Nashorn
Oracle Deutschland B.V. & Co. KG | Schiffbauergasse 14 | 14467 Potsdam, Germany

ORACLE Deutschland B.V. & Co. KG | Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V. | Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
 <http://www.oracle.com/commitment>	Oracle is committed to developing practices and products that help protect the environment



More information about the core-libs-dev mailing list