Bug 1044256: Fix hash policy of SimdConstant; r=nbp
authorBenjamin Bouvier <benj@benj.me>
Wed, 08 Oct 2014 15:20:32 +0200
changeset 209347 2ae98c304c5e2c12d82227d894eca96511dd3eb4
parent 209346 30cb1d37a3ffc64b323057ad318fe18b7dcef529
child 209348 2a12b3e698c9a1abbb26d0ee8adf39843482a290
push id27615
push userkwierso@gmail.com
push dateWed, 08 Oct 2014 23:37:42 +0000
treeherdermozilla-central@7b16babf6a73 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1044256
milestone35.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 1044256: Fix hash policy of SimdConstant; r=nbp
js/src/jit/IonTypes.h
js/src/jit/LIR-Common.h
--- a/js/src/jit/IonTypes.h
+++ b/js/src/jit/IonTypes.h
@@ -336,17 +336,18 @@ class SimdConstant {
         if (type() != rhs.type())
             return false;
         return memcmp(&u, &rhs.u, sizeof(u)) == 0;
     }
 
     // SimdConstant is a HashPolicy
     typedef SimdConstant Lookup;
     static HashNumber hash(const SimdConstant &val) {
-        return mozilla::HashBytes(&val.u, sizeof(SimdConstant));
+        uint32_t hash = mozilla::HashBytes(&val.u, sizeof(val.u));
+        return mozilla::AddToHash(hash, val.type_);
     }
     static bool match(const SimdConstant &lhs, const SimdConstant &rhs) {
         return lhs == rhs;
     }
 };
 
 // The ordering of this enumeration is important: Anything < Value is a
 // specialized type. Furthermore, anything < String has trivial conversion to
--- a/js/src/jit/LIR-Common.h
+++ b/js/src/jit/LIR-Common.h
@@ -189,17 +189,17 @@ class LSimdInsertElementBase : public LI
 
   public:
     const LAllocation *vector() {
         return getOperand(0);
     }
     const LAllocation *value() {
         return getOperand(1);
     }
-    const SimdLane lane() const {
+    SimdLane lane() const {
         return mir_->toSimdInsertElement()->lane();
     }
 };
 
 // Replace an element from a given SIMD int32x4 lane with a given value.
 class LSimdInsertElementI : public LSimdInsertElementBase
 {
   public: