bug 641048 - follow up to fix compilation warnings. r=njn
authorIgor Bukanov <igor@mir2.org>
Tue, 05 Apr 2011 03:49:42 +0200
changeset 67916 84e734e6e8ab4d4c07b90b2ab0e33d01639fb7da
parent 67915 34d87d26a315cd32e4e3b159c714d0e8eebbf624
child 67917 37e5a7fe49efa374d2259280cee36b7851aedda7
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs641048
milestone2.2a1pre
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 641048 - follow up to fix compilation warnings. r=njn
js/src/jsgc.h
js/src/jshashtable.h
--- a/js/src/jsgc.h
+++ b/js/src/jsgc.h
@@ -973,17 +973,17 @@ struct ConservativeGCThreadData {
     /*
      * Cycle collector uses this to communicate that the native stack of the
      * GC thread should be scanned only if the thread have more than the given
      * threshold of requests.
      */
     unsigned requestThreshold;
 
     ConservativeGCThreadData()
-      : nativeStackTop(NULL), requestThreshold(NULL)
+      : nativeStackTop(NULL), requestThreshold(0)
     {
     }
 
     ~ConservativeGCThreadData() {
 #ifdef JS_THREADSAFE
         /*
          * The conservative GC scanner should be disabled when the thread leaves
          * the last request.
--- a/js/src/jshashtable.h
+++ b/js/src/jshashtable.h
@@ -761,18 +761,22 @@ struct DefaultHasher
  */
 template <typename Key, size_t zeroBits>
 struct PointerHasher
 {
     typedef Key Lookup;
     static HashNumber hash(const Lookup &l) {
         size_t word = reinterpret_cast<size_t>(l) >> zeroBits;
         JS_STATIC_ASSERT(sizeof(HashNumber) == 4);
-        JS_STATIC_ASSERT(sizeof word == 4 || sizeof word == 8);
-        return HashNumber(sizeof word == 4 ? word : (word >> 32) ^ word);
+#if JS_BYTES_PER_WORD == 4
+        return HashNumber(word);
+#else
+        JS_STATIC_ASSERT(sizeof word == 8);
+        return HashNumber((word >> 32) ^ word);
+#endif
     }
     static bool match(const Key &k, const Lookup &l) {
         return k == l;
     }
 };
 
 /*
  * Specialized hashing policy for pointer types. It assumes that the type is