Backout 02919b7d57d7 (Bug 1225233) for having regressed all the things.
authorTerrence Cole <terrence@mozilla.com>
Tue, 17 Nov 2015 16:55:46 -0800
changeset 307188 84d1c56d6983f1acb9f09bf29c2b45b9183e944b
parent 307187 28d11278ff97bf9f4965e14870d9ace9377b3b79
child 307189 401949c4008ed49464a7fd13781bee79b432a0b4
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1225233
milestone45.0a1
backs out02919b7d57d7f8206328f53ac0f7b2b9fe334c9b
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
Backout 02919b7d57d7 (Bug 1225233) for having regressed all the things.
js/public/RootingAPI.h
js/src/gc/Barrier.h
--- a/js/public/RootingAPI.h
+++ b/js/public/RootingAPI.h
@@ -558,38 +558,16 @@ struct GCMethods<JSFunction*>
     static JSFunction* initial() { return nullptr; }
     static void postBarrier(JSFunction** vp, JSFunction* prev, JSFunction* next) {
         JS::HeapObjectPostBarrier(reinterpret_cast<JSObject**>(vp),
                                   reinterpret_cast<JSObject*>(prev),
                                   reinterpret_cast<JSObject*>(next));
     }
 };
 
-// Provide hash codes for Cell kinds that may be relocated and, thus, not have
-// a stable address to use as the base for a hash code. Instead of the address,
-// this hasher uses Cell::getUniqueId to provide exact matches and as a base
-// for generating hash codes.
-//
-// Note: this hasher, like PointerHasher can "hash" a nullptr. While a nullptr
-// would not likely be a useful key, there are some cases where being able to
-// hash a nullptr is useful, either on purpose or because of bugs:
-// (1) existence checks where the key may happen to be null and (2) some
-// aggregate Lookup kinds embed a JSObject* that is frequently null and do not
-// null test before dispatching to the hasher.
-template <typename T>
-struct JS_PUBLIC_API(MovableCellHasher)
-{
-    using Key = T;
-    using Lookup = T;
-
-    static HashNumber hash(const Lookup& l);
-    static bool match(const Key& k, const Lookup& l);
-    static void rekey(Key& k, const Key& newKey) { k = newKey; }
-};
-
 } /* namespace js */
 
 namespace JS {
 
 // Non pointer types -- structs or classes that contain GC pointers, either as
 // a member or in a more complex container layout -- can also be stored in a
 // [Persistent]Rooted if it derives from JS::Traceable. A JS::Traceable stored
 // in a [Persistent]Rooted must implement the method:
--- a/js/src/gc/Barrier.h
+++ b/js/src/gc/Barrier.h
@@ -779,16 +779,38 @@ class ImmutableTenuredPtr
         MOZ_ASSERT(ptr->isTenured());
         value = ptr;
     }
 
     T get() const { return value; }
     const T* address() { return &value; }
 };
 
+// Provide hash codes for Cell kinds that may be relocated and, thus, not have
+// a stable address to use as the base for a hash code. Instead of the address,
+// this hasher uses Cell::getUniqueId to provide exact matches and as a base
+// for generating hash codes.
+//
+// Note: this hasher, like PointerHasher can "hash" a nullptr. While a nullptr
+// would not likely be a useful key, there are some cases where being able to
+// hash a nullptr is useful, either on purpose or because of bugs:
+// (1) existence checks where the key may happen to be null and (2) some
+// aggregate Lookup kinds embed a JSObject* that is frequently null and do not
+// null test before dispatching to the hasher.
+template <typename T>
+struct MovableCellHasher
+{
+    using Key = T;
+    using Lookup = T;
+
+    static HashNumber hash(const Lookup& l);
+    static bool match(const Key& k, const Lookup& l);
+    static void rekey(Key& k, const Key& newKey) { k = newKey; }
+};
+
 template <typename T>
 struct MovableCellHasher<PreBarriered<T>>
 {
     using Key = PreBarriered<T>;
     using Lookup = T;
 
     static HashNumber hash(const Lookup& l) { return MovableCellHasher<T>::hash(l); }
     static bool match(const Key& k, const Lookup& l) { return MovableCellHasher<T>::match(k, l); }