91d1df5
diff -up firefox-56.0/dom/plugins/base/nsJSNPRuntime.cpp.1337988 firefox-56.0/dom/plugins/base/nsJSNPRuntime.cpp
91d1df5
--- firefox-56.0/dom/plugins/base/nsJSNPRuntime.cpp.1337988	2017-09-14 22:15:56.000000000 +0200
91d1df5
+++ firefox-56.0/dom/plugins/base/nsJSNPRuntime.cpp	2017-09-25 10:34:11.205611698 +0200
91d1df5
@@ -1719,7 +1719,7 @@ NPObjWrapper_ObjectMoved(JSObject *obj,
91d1df5
   auto entry =
91d1df5
     static_cast<NPObjWrapperHashEntry*>(sNPObjWrappers->Search(npobj));
91d1df5
   MOZ_ASSERT(entry && entry->mJSObj);
91d1df5
-  MOZ_ASSERT(entry->mJSObj == old);
91d1df5
+  MOZ_ASSERT(entry->mJSObj.unbarrieredGetPtr() == old);
91d1df5
   entry->mJSObj = obj;
91d1df5
 }
91d1df5
 
91d1df5
diff -up firefox-56.0/js/ipc/JavaScriptShared.cpp.1337988 firefox-56.0/js/ipc/JavaScriptShared.cpp
91d1df5
--- firefox-56.0/js/ipc/JavaScriptShared.cpp.1337988	2017-07-31 18:20:47.000000000 +0200
91d1df5
+++ firefox-56.0/js/ipc/JavaScriptShared.cpp	2017-09-25 10:34:11.205611698 +0200
91d1df5
@@ -101,7 +101,7 @@ IdToObjectMap::has(const ObjectId& id, c
91d1df5
     auto p = table_.lookup(id);
91d1df5
     if (!p)
91d1df5
         return false;
91d1df5
-    return p->value() == obj;
91d1df5
+    return p->value().unbarrieredGet() == obj;
91d1df5
 }
91d1df5
 #endif
91d1df5
 
91d1df5
diff -up firefox-56.0/js/public/RootingAPI.h.1337988 firefox-56.0/js/public/RootingAPI.h
91d1df5
--- firefox-56.0/js/public/RootingAPI.h.1337988	2017-07-31 18:20:47.000000000 +0200
91d1df5
+++ firefox-56.0/js/public/RootingAPI.h	2017-09-25 10:34:11.206611695 +0200
91d1df5
@@ -148,6 +148,10 @@ template<typename T>
91d1df5
 struct PersistentRootedMarker;
91d1df5
 } /* namespace gc */
91d1df5
 
91d1df5
+#define DECLARE_POINTER_COMPARISON_OPS(T)                                                         \
91d1df5
+    bool operator==(const T& other) const { return get() == other; }                              \
91d1df5
+    bool operator!=(const T& other) const { return get() != other; }
91d1df5
+
91d1df5
 // Important: Return a reference so passing a Rooted<T>, etc. to
91d1df5
 // something that takes a |const T&| is not a GC hazard.
91d1df5
 #define DECLARE_POINTER_CONSTREF_OPS(T)                                                           \
91d1df5
@@ -237,8 +241,6 @@ class Heap : public js::HeapBase
91d1df5
     static_assert(js::IsHeapConstructibleType<T>::value,
91d1df5
                   "Type T must be a public GC pointer type");
91d1df5
   public:
91d1df5
-    using ElementType = T;
91d1df5
-
91d1df5
     Heap() {
91d1df5
         static_assert(sizeof(T) == sizeof(Heap<T>),
91d1df5
                       "Heap<T> must be binary compatible with T.");
91d1df5
@@ -385,8 +387,6 @@ template <typename T>
91d1df5
 class TenuredHeap : public js::HeapBase<T, TenuredHeap<T>>
91d1df5
 {
91d1df5
   public:
91d1df5
-    using ElementType = T;
91d1df5
-
91d1df5
     TenuredHeap() : bits(0) {
91d1df5
         static_assert(sizeof(T) == sizeof(TenuredHeap<T>),
91d1df5
                       "TenuredHeap<T> must be binary compatible with T.");
91d1df5
@@ -394,6 +394,9 @@ class TenuredHeap : public js::HeapBase<
91d1df5
     explicit TenuredHeap(T p) : bits(0) { setPtr(p); }
91d1df5
     explicit TenuredHeap(const TenuredHeap<T>& p) : bits(0) { setPtr(p.getPtr()); }
91d1df5
 
91d1df5
+    bool operator==(const TenuredHeap<T>& other) { return bits == other.bits; }
91d1df5
+    bool operator!=(const TenuredHeap<T>& other) { return bits != other.bits; }
91d1df5
+
91d1df5
     void setPtr(T newPtr) {
91d1df5
         MOZ_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);
91d1df5
         if (newPtr)
91d1df5
@@ -470,8 +473,6 @@ class MOZ_NONHEAP_CLASS Handle : public
91d1df5
     friend class JS::MutableHandle<T>;
91d1df5
 
91d1df5
   public:
91d1df5
-    using ElementType = T;
91d1df5
-
91d1df5
     /* Creates a handle from a handle of a type convertible to T. */
91d1df5
     template <typename S>
91d1df5
     MOZ_IMPLICIT Handle(Handle<S> handle,
91d1df5
@@ -533,6 +534,7 @@ class MOZ_NONHEAP_CLASS Handle : public
91d1df5
     MOZ_IMPLICIT Handle(MutableHandle<S>& root,
91d1df5
                         typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);
91d1df5
 
91d1df5
+    DECLARE_POINTER_COMPARISON_OPS(T);
91d1df5
     DECLARE_POINTER_CONSTREF_OPS(T);
91d1df5
     DECLARE_NONPOINTER_ACCESSOR_METHODS(*ptr);
91d1df5
 
91d1df5
@@ -559,8 +561,6 @@ template <typename T>
91d1df5
 class MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase<T, MutableHandle<T>>
91d1df5
 {
91d1df5
   public:
91d1df5
-    using ElementType = T;
91d1df5
-
91d1df5
     inline MOZ_IMPLICIT MutableHandle(Rooted<T>* root);
91d1df5
     inline MOZ_IMPLICIT MutableHandle(PersistentRooted<T>* root);
91d1df5
 
91d1df5
@@ -589,6 +589,7 @@ class MOZ_STACK_CLASS MutableHandle : pu
91d1df5
         return h;
91d1df5
     }
91d1df5
 
91d1df5
+    DECLARE_POINTER_COMPARISON_OPS(T);
91d1df5
     DECLARE_POINTER_CONSTREF_OPS(T);
91d1df5
     DECLARE_NONPOINTER_ACCESSOR_METHODS(*ptr);
91d1df5
     DECLARE_NONPOINTER_MUTABLE_ACCESSOR_METHODS(*ptr);
91d1df5
@@ -805,8 +806,6 @@ class MOZ_RAII Rooted : public js::Roote
91d1df5
     }
91d1df5
 
91d1df5
   public:
91d1df5
-    using ElementType = T;
91d1df5
-
91d1df5
     template <typename RootingContext>
91d1df5
     explicit Rooted(const RootingContext& cx)
91d1df5
       : ptr(GCPolicy<T>::initial())
91d1df5
@@ -839,6 +838,7 @@ class MOZ_RAII Rooted : public js::Roote
91d1df5
         ptr = mozilla::Move(value);
91d1df5
     }
91d1df5
 
91d1df5
+    DECLARE_POINTER_COMPARISON_OPS(T);
91d1df5
     DECLARE_POINTER_CONSTREF_OPS(T);
91d1df5
     DECLARE_POINTER_ASSIGN_OPS(Rooted, T);
91d1df5
     DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr);
91d1df5
@@ -903,14 +903,13 @@ template <typename T>
91d1df5
 class MOZ_RAII FakeRooted : public RootedBase<T, FakeRooted<T>>
91d1df5
 {
91d1df5
   public:
91d1df5
-    using ElementType = T;
91d1df5
-
91d1df5
     template <typename CX>
91d1df5
     explicit FakeRooted(CX* cx) : ptr(JS::GCPolicy<T>::initial()) {}
91d1df5
 
91d1df5
     template <typename CX>
91d1df5
     FakeRooted(CX* cx, T initial) : ptr(initial) {}
91d1df5
 
91d1df5
+    DECLARE_POINTER_COMPARISON_OPS(T);
91d1df5
     DECLARE_POINTER_CONSTREF_OPS(T);
91d1df5
     DECLARE_POINTER_ASSIGN_OPS(FakeRooted, T);
91d1df5
     DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr);
91d1df5
@@ -931,8 +930,6 @@ template <typename T>
91d1df5
 class FakeMutableHandle : public js::MutableHandleBase<T, FakeMutableHandle<T>>
91d1df5
 {
91d1df5
   public:
91d1df5
-    using ElementType = T;
91d1df5
-
91d1df5
     MOZ_IMPLICIT FakeMutableHandle(T* t) {
91d1df5
         ptr = t;
91d1df5
     }
91d1df5
@@ -1124,8 +1121,6 @@ class PersistentRooted : public js::Root
91d1df5
     }
91d1df5
 
91d1df5
   public:
91d1df5
-    using ElementType = T;
91d1df5
-
91d1df5
     PersistentRooted() : ptr(GCPolicy<T>::initial()) {}
91d1df5
 
91d1df5
     explicit PersistentRooted(RootingContext* cx)
91d1df5
@@ -1203,6 +1198,7 @@ class PersistentRooted : public js::Root
91d1df5
         }
91d1df5
     }
91d1df5
 
91d1df5
+    DECLARE_POINTER_COMPARISON_OPS(T);
91d1df5
     DECLARE_POINTER_CONSTREF_OPS(T);
91d1df5
     DECLARE_POINTER_ASSIGN_OPS(PersistentRooted, T);
91d1df5
     DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr);
91d1df5
@@ -1234,8 +1230,6 @@ class JS_PUBLIC_API(ObjectPtr)
91d1df5
     Heap<JSObject*> value;
91d1df5
 
91d1df5
   public:
91d1df5
-    using ElementType = JSObject*;
91d1df5
-
91d1df5
     ObjectPtr() : value(nullptr) {}
91d1df5
 
91d1df5
     explicit ObjectPtr(JSObject* obj) : value(obj) {}
91d1df5
@@ -1342,177 +1336,6 @@ Swap(JS::TenuredHeap<T>& aX, JS::Tenured
91d1df5
 
91d1df5
 } /* namespace mozilla */
91d1df5
 
91d1df5
-namespace js {
91d1df5
-namespace detail {
91d1df5
-
91d1df5
-// DefineComparisonOps is a trait which selects which wrapper classes to define
91d1df5
-// operator== and operator!= for. It supplies a getter function to extract the
91d1df5
-// value to compare. This is used to avoid triggering the automatic read
91d1df5
-// barriers where appropriate.
91d1df5
-//
91d1df5
-// If DefineComparisonOps is not specialized for a particular wrapper you may
91d1df5
-// get errors such as 'invalid operands to binary expression' or 'no match for
91d1df5
-// operator==' when trying to compare against instances of the wrapper.
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps : mozilla::FalseType {};
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps<JS::Heap<T>> : mozilla::TrueType {
91d1df5
-    static const T& get(const JS::Heap<T>& v) { return v.unbarrieredGet(); }
91d1df5
-};
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps<JS::TenuredHeap<T>> : mozilla::TrueType {
91d1df5
-    static const T get(const JS::TenuredHeap<T>& v) { return v.unbarrieredGetPtr(); }
91d1df5
-};
91d1df5
-
91d1df5
-template <>
91d1df5
-struct DefineComparisonOps<JS::ObjectPtr> : mozilla::TrueType {
91d1df5
-    static const JSObject* get(const JS::ObjectPtr& v) { return v.unbarrieredGet(); }
91d1df5
-};
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps<JS::Rooted<T>> : mozilla::TrueType {
91d1df5
-    static const T& get(const JS::Rooted<T>& v) { return v.get(); }
91d1df5
-};
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps<JS::Handle<T>> : mozilla::TrueType {
91d1df5
-    static const T& get(const JS::Handle<T>& v) { return v.get(); }
91d1df5
-};
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps<JS::MutableHandle<T>> : mozilla::TrueType {
91d1df5
-    static const T& get(const JS::MutableHandle<T>& v) { return v.get(); }
91d1df5
-};
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps<JS::PersistentRooted<T>> : mozilla::TrueType {
91d1df5
-    static const T& get(const JS::PersistentRooted<T>& v) { return v.get(); }
91d1df5
-};
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps<js::FakeRooted<T>> : mozilla::TrueType {
91d1df5
-    static const T& get(const js::FakeRooted<T>& v) { return v.get(); }
91d1df5
-};
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps<js::FakeMutableHandle<T>> : mozilla::TrueType {
91d1df5
-    static const T& get(const js::FakeMutableHandle<T>& v) { return v.get(); }
91d1df5
-};
91d1df5
-
91d1df5
-} /* namespace detail */
91d1df5
-} /* namespace js */
91d1df5
-
91d1df5
-// Overload operator== and operator!= for all types with the DefineComparisonOps
91d1df5
-// trait using the supplied getter.
91d1df5
-//
91d1df5
-// There are four cases:
91d1df5
-
91d1df5
-// Case 1: comparison between two wrapper objects.
91d1df5
-
91d1df5
-template <typename T, typename U>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
91d1df5
-                           js::detail::DefineComparisonOps<U>::value, bool>::Type
91d1df5
-operator==(const T& a, const U& b) {
91d1df5
-    return js::detail::DefineComparisonOps<T>::get(a) == js::detail::DefineComparisonOps<U>::get(b);
91d1df5
-}
91d1df5
-
91d1df5
-template <typename T, typename U>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
91d1df5
-                           js::detail::DefineComparisonOps<U>::value, bool>::Type
91d1df5
-operator!=(const T& a, const U& b) {
91d1df5
-    return !(a == b);
91d1df5
-}
91d1df5
-
91d1df5
-// Case 2: comparison between a wrapper object and its unwrapped element type.
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value, bool>::Type
91d1df5
-operator==(const T& a, const typename T::ElementType& b) {
91d1df5
-    return js::detail::DefineComparisonOps<T>::get(a) == b;
91d1df5
-}
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value, bool>::Type
91d1df5
-operator!=(const T& a, const typename T::ElementType& b) {
91d1df5
-    return !(a == b);
91d1df5
-}
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value, bool>::Type
91d1df5
-operator==(const typename T::ElementType& a, const T& b) {
91d1df5
-    return a == js::detail::DefineComparisonOps<T>::get(b);
91d1df5
-}
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value, bool>::Type
91d1df5
-operator!=(const typename T::ElementType& a, const T& b) {
91d1df5
-    return !(a == b);
91d1df5
-}
91d1df5
-
91d1df5
-// Case 3: For pointer wrappers, comparison between the wrapper and a const
91d1df5
-// element pointer.
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
91d1df5
-                           mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
91d1df5
-operator==(const typename mozilla::RemovePointer<typename T::ElementType>::Type* a, const T& b) {
91d1df5
-    return a == js::detail::DefineComparisonOps<T>::get(b);
91d1df5
-}
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
91d1df5
-                           mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
91d1df5
-operator!=(const typename mozilla::RemovePointer<typename T::ElementType>::Type* a, const T& b) {
91d1df5
-    return !(a == b);
91d1df5
-}
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
91d1df5
-                           mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
91d1df5
-operator==(const T& a, const typename mozilla::RemovePointer<typename T::ElementType>::Type* b) {
91d1df5
-    return js::detail::DefineComparisonOps<T>::get(a) == b;
91d1df5
-}
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
91d1df5
-                           mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
91d1df5
-operator!=(const T& a, const typename mozilla::RemovePointer<typename T::ElementType>::Type* b) {
91d1df5
-    return !(a == b);
91d1df5
-}
91d1df5
-
91d1df5
-// Case 4: For pointer wrappers, comparison between the wrapper and nullptr.
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
91d1df5
-                           mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
91d1df5
-operator==(std::nullptr_t a, const T& b) {
91d1df5
-    return a == js::detail::DefineComparisonOps<T>::get(b);
91d1df5
-}
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
91d1df5
-                           mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
91d1df5
-operator!=(std::nullptr_t a, const T& b) {
91d1df5
-    return !(a == b);
91d1df5
-}
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
91d1df5
-                           mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
91d1df5
-operator==(const T& a, std::nullptr_t b) {
91d1df5
-    return js::detail::DefineComparisonOps<T>::get(a) == b;
91d1df5
-}
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-typename mozilla::EnableIf<js::detail::DefineComparisonOps<T>::value &&
91d1df5
-                           mozilla::IsPointer<typename T::ElementType>::value, bool>::Type
91d1df5
-operator!=(const T& a, std::nullptr_t b) {
91d1df5
-    return !(a == b);
91d1df5
-}
91d1df5
-
91d1df5
 #undef DELETE_ASSIGNMENT_OPS
91d1df5
 
91d1df5
 #endif  /* js_RootingAPI_h */
91d1df5
diff -up firefox-56.0/js/src/gc/Barrier.h.1337988 firefox-56.0/js/src/gc/Barrier.h
91d1df5
--- firefox-56.0/js/src/gc/Barrier.h.1337988	2017-09-14 22:16:01.000000000 +0200
91d1df5
+++ firefox-56.0/js/src/gc/Barrier.h	2017-09-25 10:34:11.206611695 +0200
91d1df5
@@ -353,8 +353,8 @@ class WriteBarrieredBase : public Barrie
91d1df5
     explicit WriteBarrieredBase(const T& v) : BarrieredBase<T>(v) {}
91d1df5
 
91d1df5
   public:
91d1df5
-    using ElementType = T;
91d1df5
 
91d1df5
+    DECLARE_POINTER_COMPARISON_OPS(T);
91d1df5
     DECLARE_POINTER_CONSTREF_OPS(T);
91d1df5
 
91d1df5
     // Use this if the automatic coercion to T isn't working.
91d1df5
@@ -612,13 +612,14 @@ class ReadBarriered : public ReadBarrier
91d1df5
         return *this;
91d1df5
     }
91d1df5
 
91d1df5
-    const T& get() const {
91d1df5
-        if (InternalBarrierMethods<T>::isMarkable(this->value))
91d1df5
-            this->read();
91d1df5
+    const T get() const {
91d1df5
+        if (!InternalBarrierMethods<T>::isMarkable(this->value))
91d1df5
+            return JS::GCPolicy<T>::initial();
91d1df5
+        this->read();
91d1df5
         return this->value;
91d1df5
     }
91d1df5
 
91d1df5
-    const T& unbarrieredGet() const {
91d1df5
+    const T unbarrieredGet() const {
91d1df5
         return this->value;
91d1df5
     }
91d1df5
 
91d1df5
@@ -626,9 +627,9 @@ class ReadBarriered : public ReadBarrier
91d1df5
         return bool(this->value);
91d1df5
     }
91d1df5
 
91d1df5
-    operator const T&() const { return get(); }
91d1df5
+    operator const T() const { return get(); }
91d1df5
 
91d1df5
-    const T& operator->() const { return get(); }
91d1df5
+    const T operator->() const { return get(); }
91d1df5
 
91d1df5
     T* unsafeGet() { return &this->value; }
91d1df5
     T const* unsafeGet() const { return &this->value; }
91d1df5
@@ -955,35 +956,6 @@ typedef ReadBarriered<WasmTableObject*>
91d1df5
 
91d1df5
 typedef ReadBarriered<Value> ReadBarrieredValue;
91d1df5
 
91d1df5
-namespace detail {
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps<PreBarriered<T>> : mozilla::TrueType {
91d1df5
-    static const T& get(const PreBarriered<T>& v) { return v.get(); }
91d1df5
-};
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps<GCPtr<T>> : mozilla::TrueType {
91d1df5
-    static const T& get(const GCPtr<T>& v) { return v.get(); }
91d1df5
-};
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps<HeapPtr<T>> : mozilla::TrueType {
91d1df5
-    static const T& get(const HeapPtr<T>& v) { return v.get(); }
91d1df5
-};
91d1df5
-
91d1df5
-template <typename T>
91d1df5
-struct DefineComparisonOps<ReadBarriered<T>> : mozilla::TrueType {
91d1df5
-    static const T& get(const ReadBarriered<T>& v) { return v.unbarrieredGet(); }
91d1df5
-};
91d1df5
-
91d1df5
-template <>
91d1df5
-struct DefineComparisonOps<HeapSlot> : mozilla::TrueType {
91d1df5
-    static const Value& get(const HeapSlot& v) { return v.get(); }
91d1df5
-};
91d1df5
-
91d1df5
-} /* namespace detail */
91d1df5
-
91d1df5
 } /* namespace js */
91d1df5
 
91d1df5
 #endif /* gc_Barrier_h */
91d1df5
diff -up firefox-56.0/js/src/jsapi-tests/testGCHeapPostBarriers.cpp.1337988 firefox-56.0/js/src/jsapi-tests/testGCHeapPostBarriers.cpp
91d1df5
--- firefox-56.0/js/src/jsapi-tests/testGCHeapPostBarriers.cpp.1337988	2017-09-14 22:16:02.000000000 +0200
91d1df5
+++ firefox-56.0/js/src/jsapi-tests/testGCHeapPostBarriers.cpp	2017-09-25 10:34:11.206611695 +0200
91d1df5
@@ -5,7 +5,6 @@
91d1df5
  * License, v. 2.0. If a copy of the MPL was not distributed with this
91d1df5
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
91d1df5
 
91d1df5
-#include "mozilla/TypeTraits.h"
91d1df5
 #include "mozilla/UniquePtr.h"
91d1df5
 
91d1df5
 #include "js/RootingAPI.h"
91d1df5
diff -up firefox-56.0/js/src/vm/SharedMem.h.1337988 firefox-56.0/js/src/vm/SharedMem.h
91d1df5
--- firefox-56.0/js/src/vm/SharedMem.h.1337988	2017-06-15 22:52:29.000000000 +0200
91d1df5
+++ firefox-56.0/js/src/vm/SharedMem.h	2017-09-25 10:34:11.206611695 +0200
91d1df5
@@ -12,8 +12,8 @@
91d1df5
 template<typename T>
91d1df5
 class SharedMem
91d1df5
 {
91d1df5
-    // static_assert(mozilla::IsPointer<T>::value,
91d1df5
-    //               "SharedMem encapsulates pointer types");
91d1df5
+    static_assert(mozilla::IsPointer<T>::value,
91d1df5
+                  "SharedMem encapsulates pointer types");
91d1df5
 
91d1df5
     enum Sharedness {
91d1df5
         IsUnshared,
91d1df5
diff -up firefox-56.0/js/xpconnect/src/XPCInlines.h.1337988 firefox-56.0/js/xpconnect/src/XPCInlines.h
91d1df5
--- firefox-56.0/js/xpconnect/src/XPCInlines.h.1337988	2017-09-14 22:16:03.000000000 +0200
91d1df5
+++ firefox-56.0/js/xpconnect/src/XPCInlines.h	2017-09-25 10:34:11.206611695 +0200
91d1df5
@@ -465,7 +465,7 @@ inline
91d1df5
 void XPCWrappedNativeTearOff::JSObjectMoved(JSObject* obj, const JSObject* old)
91d1df5
 {
91d1df5
     MOZ_ASSERT(!IsMarked());
91d1df5
-    MOZ_ASSERT(mJSObject == old);
91d1df5
+    MOZ_ASSERT(mJSObject.unbarrieredGetPtr() == old);
91d1df5
     mJSObject = obj;
91d1df5
 }
91d1df5
 
91d1df5
diff -up firefox-56.0/js/xpconnect/src/XPCWrappedNative.cpp.1337988 firefox-56.0/js/xpconnect/src/XPCWrappedNative.cpp
91d1df5
--- firefox-56.0/js/xpconnect/src/XPCWrappedNative.cpp.1337988	2017-09-14 22:16:03.000000000 +0200
91d1df5
+++ firefox-56.0/js/xpconnect/src/XPCWrappedNative.cpp	2017-09-25 10:34:11.207611692 +0200
91d1df5
@@ -874,7 +874,7 @@ void
91d1df5
 XPCWrappedNative::FlatJSObjectMoved(JSObject* obj, const JSObject* old)
91d1df5
 {
91d1df5
     JS::AutoAssertGCCallback inCallback;
91d1df5
-    MOZ_ASSERT(mFlatJSObject == old);
91d1df5
+    MOZ_ASSERT(mFlatJSObject.unbarrieredGetPtr() == old);
91d1df5
 
91d1df5
     nsWrapperCache* cache = nullptr;
91d1df5
     CallQueryInterface(mIdentity, &cache);
91d1df5
diff -up firefox-56.0/js/xpconnect/src/XPCWrappedNativeProto.cpp.1337988 firefox-56.0/js/xpconnect/src/XPCWrappedNativeProto.cpp
91d1df5
--- firefox-56.0/js/xpconnect/src/XPCWrappedNativeProto.cpp.1337988	2017-07-31 18:20:47.000000000 +0200
91d1df5
+++ firefox-56.0/js/xpconnect/src/XPCWrappedNativeProto.cpp	2017-09-25 10:34:11.207611692 +0200
91d1df5
@@ -101,7 +101,7 @@ XPCWrappedNativeProto::CallPostCreatePro
91d1df5
 void
91d1df5
 XPCWrappedNativeProto::JSProtoObjectFinalized(js::FreeOp* fop, JSObject* obj)
91d1df5
 {
91d1df5
-    MOZ_ASSERT(obj == mJSProtoObject, "huh?");
91d1df5
+    MOZ_ASSERT(obj == mJSProtoObject.unbarrieredGet(), "huh?");
91d1df5
 
91d1df5
 #ifdef DEBUG
91d1df5
     // Check that this object has already been swept from the map.
91d1df5
@@ -117,7 +117,7 @@ XPCWrappedNativeProto::JSProtoObjectFina
91d1df5
 void
91d1df5
 XPCWrappedNativeProto::JSProtoObjectMoved(JSObject* obj, const JSObject* old)
91d1df5
 {
91d1df5
-    MOZ_ASSERT(mJSProtoObject == old);
91d1df5
+    MOZ_ASSERT(mJSProtoObject.unbarrieredGet() == old);
91d1df5
     mJSProtoObject.init(obj); // Update without triggering barriers.
91d1df5
 }
91d1df5