Bug 1560064 - Barrier: Set MovableCellHasher<JSObject*> visibility before being used. r=sfink, a=RyanVM
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 20 Jun 2019 19:15:39 +0200
changeset 537134 3a892f49828e0d05ebd99969c81b5149873e4137
parent 537133 d77755aee6dedf20ac61ddc6c5376a42ec9c331d
child 537135 f3b929b28ab888967128bcd263bd03ff6645f701
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink, RyanVM
bugs1560064
milestone68.0
Bug 1560064 - Barrier: Set MovableCellHasher<JSObject*> visibility before being used. r=sfink, a=RyanVM
js/src/gc/Barrier.cpp
js/src/gc/Barrier.h
--- a/js/src/gc/Barrier.cpp
+++ b/js/src/gc/Barrier.cpp
@@ -171,17 +171,20 @@ template <typename T>
   return keyId == zone->getUniqueIdInfallible(l);
 }
 
 #ifdef JS_BROKEN_GCC_ATTRIBUTE_WARNING
 #  pragma GCC diagnostic push
 #  pragma GCC diagnostic ignored "-Wattributes"
 #endif  // JS_BROKEN_GCC_ATTRIBUTE_WARNING
 
+#if !MOZ_IS_GCC
 template struct JS_PUBLIC_API MovableCellHasher<JSObject*>;
+#endif
+
 template struct JS_PUBLIC_API MovableCellHasher<GlobalObject*>;
 template struct JS_PUBLIC_API MovableCellHasher<SavedFrame*>;
 template struct JS_PUBLIC_API MovableCellHasher<EnvironmentObject*>;
 template struct JS_PUBLIC_API MovableCellHasher<WasmInstanceObject*>;
 template struct JS_PUBLIC_API MovableCellHasher<JSScript*>;
 template struct JS_PUBLIC_API MovableCellHasher<LazyScript*>;
 
 #ifdef JS_BROKEN_GCC_ATTRIBUTE_WARNING
--- a/js/src/gc/Barrier.h
+++ b/js/src/gc/Barrier.h
@@ -859,16 +859,20 @@ class ImmutableTenuredPtr {
     AssertTargetIsNotGray(ptr);
     value = ptr;
   }
 
   T get() const { return value; }
   const T* address() { return &value; }
 };
 
+#if MOZ_IS_GCC
+template struct JS_PUBLIC_API MovableCellHasher<JSObject*>;
+#endif
+
 template <typename T>
 struct MovableCellHasher<PreBarriered<T>> {
   using Key = PreBarriered<T>;
   using Lookup = T;
 
   static bool hasHash(const Lookup& l) {
     return MovableCellHasher<T>::hasHash(l);
   }