Bug 694256 - Build error: JS_FloorLog2 is missing. r=luke.
authorLeon Sha <leon.sha@oracle.com>
Fri, 14 Oct 2011 13:12:46 +0800
changeset 78728 aa2e380c86fb21743b7e627687357fc06761a84b
parent 78724 d2a037d0354d354b2d683518ce5c6c297d1b7af8
child 78729 56c7568767f18154d266287d6ba03264602a3133
push id21329
push usereakhgari@mozilla.com
push dateFri, 14 Oct 2011 14:37:50 +0000
treeherdermozilla-central@349f3d4b2d87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs694256
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 694256 - Build error: JS_FloorLog2 is missing. r=luke.
js/public/Utility.h
js/src/jslog2.cpp
--- a/js/public/Utility.h
+++ b/js/public/Utility.h
@@ -341,17 +341,17 @@ unsigned char _BitScanReverse64(unsigned
  */
 #define JS_FLOOR_LOG2W(n) (JS_ASSERT((n) != 0), js_FloorLog2wImpl(n))
 
 #if JS_BYTES_PER_WORD == 4
 # ifdef JS_HAS_BUILTIN_BITSCAN32
 #  define js_FloorLog2wImpl(n)                                                \
     ((size_t)(JS_BITS_PER_WORD - 1 - js_bitscan_clz32(n)))
 # else
-#  define js_FloorLog2wImpl(n) ((size_t)JS_FloorLog2(n))
+extern size_t js_FloorLog2wImpl(size_t n);
 # endif
 #elif JS_BYTES_PER_WORD == 8
 # ifdef JS_HAS_BUILTIN_BITSCAN64
 #  define js_FloorLog2wImpl(n)                                                \
     ((size_t)(JS_BITS_PER_WORD - 1 - js_bitscan_clz64(n)))
 # else
 extern size_t js_FloorLog2wImpl(size_t n);
 # endif
--- a/js/src/jslog2.cpp
+++ b/js/src/jslog2.cpp
@@ -49,16 +49,27 @@ JS_STATIC_ASSERT(sizeof(unsigned int) ==
 JS_STATIC_ASSERT_IF(JS_BYTES_PER_WORD == 4,
                     sizeof(unsigned int) == sizeof(JSUword));
 #endif
 #ifdef JS_HAS_BUILTIN_BITSCAN64
 JS_STATIC_ASSERT_IF(JS_BYTES_PER_WORD == 8,
                     sizeof(unsigned long long) == sizeof(JSUword));
 #endif
 
+#if !defined(JS_HAS_BUILTIN_BITSCAN32) && JS_BYTES_PER_WORD == 4
+
+size_t
+js_FloorLog2wImpl(size_t n)
+{
+    size_t log2;
+
+    JS_FLOOR_LOG2(log2, n);
+    return log2;
+}
+#endif
 /*
  * js_FloorLog2wImpl has to be defined only for 64-bit non-GCC case.
  */
 #if !defined(JS_HAS_BUILTIN_BITSCAN64) && JS_BYTES_PER_WORD == 8
 
 size_t
 js_FloorLog2wImpl(size_t n)
 {