Re: [cp-patches] RFC: Double.doubleToLongBits simplified
Dalibor Topic wrote: Hi all, I've implemented doubleToLongBits without requring a VMDouble method of the same name. It would let us remove one method from the VM interface for the next version, and the corresoponding native code. OK to commit? (I'd do the equivalent patch for Float, too). * java/lang/Double.java (doubleToLongBits): Simplified. cheers, dalibor topic Hi, if this life makes things easier for you then its a good thing. The Jikes RVM already does this at the VMDouble level, and just has a doubleAsRawLongBits magic/native method. So, I'm not sure if this change shouldn't be pushed down into VMDouble, or at least if it is done in Double the obsolete doubleToLongBits call in VMDouble should be removed. Thanks, Ian
Re: [cp-patches] RFC: Double.doubleToLongBits simplified
Ian Rogers schrieb: Dalibor Topic wrote: Hi all, I've implemented doubleToLongBits without requring a VMDouble method of the same name. It would let us remove one method from the VM interface for the next version, and the corresoponding native code. OK to commit? (I'd do the equivalent patch for Float, too). * java/lang/Double.java (doubleToLongBits): Simplified. cheers, dalibor topic Hi, if this life makes things easier for you then its a good thing. The Jikes RVM already does this at the VMDouble level, and just has a doubleAsRawLongBits magic/native method. So, I'm not sure if this change shouldn't be pushed down into VMDouble, or at least if it is done in Double the obsolete doubleToLongBits call in VMDouble should be removed. Yeah, I'll do the latter, as there is no point in having this method in the VM interface if we can do it (and the methods its implementation invokes) in Java. Same for Float and the int conversion method. cheers, dalibor topic
Re: [cp-patches] RFC: Double.doubleToLongBits simplified
Christian Thalinger wrote: On Fri, 2008-02-08 at 12:23 +0100, Dalibor Topic wrote: Yeah, I'll do the latter, as there is no point in having this method in the VM interface if we can do it (and the methods its implementation invokes) in Java. Same for Float and the int conversion method. I completely agree. Thanks for the feedback. I've committed the patch, and will send the remaining changes FYI soon, with the native code changes RFC after that. cheers, dalibor topic
Re: [cp-patches] RFC: Double.doubleToLongBits simplified
On Fri, 2008-02-08 at 12:23 +0100, Dalibor Topic wrote: Yeah, I'll do the latter, as there is no point in having this method in the VM interface if we can do it (and the methods its implementation invokes) in Java. Same for Float and the int conversion method. I completely agree. - twisti
[cp-patches] RFC: Double.doubleToLongBits simplified
Hi all, I've implemented doubleToLongBits without requring a VMDouble method of the same name. It would let us remove one method from the VM interface for the next version, and the corresoponding native code. OK to commit? (I'd do the equivalent patch for Float, too). * java/lang/Double.java (doubleToLongBits): Simplified. cheers, dalibor topic ### Eclipse Workspace Patch 1.0 #P classpath Index: java/lang/Double.java === RCS file: /sources/classpath/classpath/java/lang/Double.java,v retrieving revision 1.43 diff -u -r1.43 Double.java --- java/lang/Double.java 12 Oct 2007 08:50:50 - 1.43 +++ java/lang/Double.java 8 Feb 2008 00:18:01 - @@ -518,7 +518,10 @@ */ public static long doubleToLongBits(double value) { -return VMDouble.doubleToLongBits(value); +if (isNaN(value)) + return 0x7ff8L; +else + return VMDouble.doubleToRawLongBits(value); } /**