Re: Hotspot loves PHP.reboot

2011-09-06 Thread Charles Oliver Nutter
On Tue, Sep 6, 2011 at 6:10 PM, John Rose wrote: > Yes.  Your request for "JO" makes me think some users would be happy with a > boolean test, a la addWouldOverflow. > It's what happens after the test that differs widely among applications, so > why not just standardize the test. >   if (addWouldO

Re: Hotspot loves PHP.reboot

2011-09-06 Thread John Rose
On Sep 6, 2011, at 1:18 PM, Charles Oliver Nutter wrote: > On Tue, Sep 6, 2011 at 3:04 PM, John Rose wrote: >> (1) Write a compelling API for something like Integer.addDetectingOverflow. >> (2) Roll it into JDK 8+epsilon. >> (3) Do the JIT work. >> People have thought on and off about (1) for man

Re: Hotspot loves PHP.reboot

2011-09-06 Thread Charles Oliver Nutter
On Tue, Sep 6, 2011 at 3:36 PM, Rémi Forax wrote: > An exception is perhaps more easier to use, > because if it overflow you may have to deoptimize, for that you need the > stack and local values, > it's easier to jump to a exception handler that will push all these values > and call the interpret

Re: Hotspot loves PHP.reboot

2011-09-06 Thread Rémi Forax
On 09/06/2011 10:19 PM, John Rose wrote: On Sep 6, 2011, at 12:58 PM, John Rose wrote: What's needed here is a way to get 33 bits out of a 32-bit add intrinsic. There's no fully natural way to do this, and about 4 kludgey ways. Because there are so many poor ways to shape the API, it's hard

Re: Hotspot loves PHP.reboot

2011-09-06 Thread John Rose
On Sep 6, 2011, at 12:58 PM, John Rose wrote: > What's needed here is a way to get 33 bits out of a 32-bit add intrinsic. > There's no fully natural way to do this, and about 4 kludgey ways. Because > there are so many poor ways to shape the API, it's hard to pick the best one > to invest in.

Re: Hotspot loves PHP.reboot

2011-09-06 Thread Charles Oliver Nutter
On Tue, Sep 6, 2011 at 3:04 PM, John Rose wrote: > (1) Write a compelling API for something like Integer.addDetectingOverflow. > (2) Roll it into JDK 8+epsilon. > (3) Do the JIT work. > People have thought on and off about (1) for many years, but with no clear > winner.  Exceptions or boxed object

Re: Hotspot loves PHP.reboot

2011-09-06 Thread John Rose
On Sep 6, 2011, at 8:51 AM, Charles Oliver Nutter wrote: > Did we ever figure out if it's possible to trick Hotspot into doing a > JO instead of the raw bit-level operations? John/Christian/Tom: what > would it take to get HS to "know" that we're doing an integer > overflow-after-maths check and d

Re: Hotspot loves PHP.reboot

2011-09-06 Thread John Rose
On Sep 6, 2011, at 11:28 AM, Charles Oliver Nutter wrote: > On Tue, Sep 6, 2011 at 12:36 PM, Rémi Forax wrote: >> If you have specialize for -2/+2, you should reuse exactly the same code >> for +n/-n. >> see >> https://code.google.com/p/jsr292-cookbook/source/browse/trunk/binary-operation/src/jsr

Re: Hotspot loves PHP.reboot

2011-09-06 Thread Charles Oliver Nutter
On Tue, Sep 6, 2011 at 12:36 PM, Rémi Forax wrote: > If you have specialize for -2/+2, you should reuse exactly the same code > for +n/-n. > see > https://code.google.com/p/jsr292-cookbook/source/browse/trunk/binary-operation/src/jsr292/cookbook/binop/RT.java#11 You're right. I'll make that chang

Re: Hotspot loves PHP.reboot

2011-09-06 Thread Charles Oliver Nutter
On Tue, Sep 6, 2011 at 12:33 PM, Christian Thalinger wrote: > We already talked a bit about that some while ago.  I think matching that > double-xor-trick (or whatever it's called) is too risky.  A JDK method that > does the check (and the math?) would be nice so we can intrinsify it.  GWT > wo

Re: Hotspot loves PHP.reboot

2011-09-06 Thread Rémi Forax
On 09/06/2011 05:51 PM, Charles Oliver Nutter wrote: > On Tue, Sep 6, 2011 at 10:39 AM, Rémi Forax wrote: >> Yes, but don't forget that PHP.reboot has no overflow check. > Did we ever figure out if it's possible to trick Hotspot into doing a > JO instead of the raw bit-level operations? John/Chris

Re: Hotspot loves PHP.reboot

2011-09-06 Thread Rémi Forax
On 09/06/2011 07:33 PM, Christian Thalinger wrote: > On Sep 6, 2011, at 5:51 PM, Charles Oliver Nutter wrote: > >> On Tue, Sep 6, 2011 at 10:39 AM, Rémi Forax wrote: >>> Yes, but don't forget that PHP.reboot has no overflow check. >> Did we ever figure out if it's possible to trick Hotspot into do

Re: Hotspot loves PHP.reboot

2011-09-06 Thread Christian Thalinger
On Sep 6, 2011, at 5:51 PM, Charles Oliver Nutter wrote: > On Tue, Sep 6, 2011 at 10:39 AM, Rémi Forax wrote: >> Yes, but don't forget that PHP.reboot has no overflow check. > > Did we ever figure out if it's possible to trick Hotspot into doing a > JO instead of the raw bit-level operations? J

Re: Hotspot loves PHP.reboot

2011-09-06 Thread Charles Oliver Nutter
On Tue, Sep 6, 2011 at 10:39 AM, Rémi Forax wrote: > Yes, but don't forget that PHP.reboot has no overflow check. Did we ever figure out if it's possible to trick Hotspot into doing a JO instead of the raw bit-level operations? John/Christian/Tom: what would it take to get HS to "know" that we're

Re: Hotspot loves PHP.reboot

2011-09-06 Thread Rémi Forax
On 09/06/2011 04:59 PM, Charles Oliver Nutter wrote: > Awesome numbers, especially promising for impls like JRuby that will > never have type annotations and for which type inference will be very > limited. Getting within 3x Java while still fully boxed is amazing. Yes, but don't forget that PHP.r

Re: Hotspot loves PHP.reboot

2011-09-06 Thread Charles Oliver Nutter
Awesome numbers, especially promising for impls like JRuby that will never have type annotations and for which type inference will be very limited. Getting within 3x Java while still fully boxed is amazing. Perhaps the next big thing for InDy will be getting EA working across invokedynamic boundar