Bug 720094 - Simplify the implementation of JSDOUBLE_IS_NaN a bit, consolidating two implementations (conditioned on the architecture) into one. r=dvander, a=akeybl
authorJeff Walden <jwalden@mit.edu>
Fri, 20 Jan 2012 23:39:32 -0800
changeset 84210 e7312c8640ffa03228161972558b6a382cbd4f31
parent 84209 1a931c3136116bf3ff71faee76727a2c15fd8738
child 84211 3c403469f83449241d9412525080968ae0f2e72b
push id773
push userjwalden@mit.edu
push dateThu, 26 Jan 2012 00:18:48 +0000
treeherdermozilla-aurora@e7312c8640ff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander, akeybl
bugs720094
milestone11.0a2
Bug 720094 - Simplify the implementation of JSDOUBLE_IS_NaN a bit, consolidating two implementations (conditioned on the architecture) into one. r=dvander, a=akeybl
js/src/jsnum.h
--- a/js/src/jsnum.h
+++ b/js/src/jsnum.h
@@ -84,17 +84,18 @@ typedef union jsdpun {
 #define JSDOUBLE_HI32_NAN       0x7ff80000
 #define JSDOUBLE_LO32_NAN       0x00000000
 
 static inline int
 JSDOUBLE_IS_NaN(jsdouble d)
 {
     jsdpun u;
     u.d = d;
-    return (u.s.hi & JSDOUBLE_HI32_NAN) == JSDOUBLE_HI32_NAN;
+    return (u.u64 & JSDOUBLE_EXPMASK) == JSDOUBLE_EXPMASK &&
+           (u.u64 & JSDOUBLE_MANTMASK) != 0;
 }
 
 static inline int
 JSDOUBLE_IS_FINITE(jsdouble d)
 {
     /* -0 is finite. NaNs are not. */
     jsdpun u;
     u.d = d;