Bug 1315122 - Remove JS::Heap<T>'s unused setToCrashOnTouch() methods r=jandem
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 04 Nov 2016 17:32:36 +0000
changeset 320986 24ed6f84d823
parent 320985 a5d8d7e811c1
child 320987 5c1285f9911c
push id83499
push userjcoppeard@mozilla.com
push date2016-11-04 17:36 +0000
treeherdermozilla-inbound@24ed6f84d823 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1315122
milestone52.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 1315122 - Remove JS::Heap<T>'s unused setToCrashOnTouch() methods r=jandem
dom/base/nsWrapperCache.h
js/public/RootingAPI.h
--- a/dom/base/nsWrapperCache.h
+++ b/dom/base/nsWrapperCache.h
@@ -260,17 +260,18 @@ protected:
     if (mWrapper) {
       js::UnsafeTraceManuallyBarrieredEdge(aTrc, &mWrapper, name);
     }
   }
 
   void PoisonWrapper()
   {
     if (mWrapper) {
-      // See setToCrashOnTouch() in RootingAPI.h
+      // Set the pointer to a value that will cause a crash if it is
+      // dereferenced.
       mWrapper = reinterpret_cast<JSObject*>(1);
     }
   }
 
 private:
   friend class mozilla::dom::TabChildGlobal;
   friend class mozilla::dom::ProcessGlobal;
   friend class SandboxPrivate;
--- a/js/public/RootingAPI.h
+++ b/js/public/RootingAPI.h
@@ -272,48 +272,32 @@ class Heap : public js::HeapBase<T>
 
     explicit operator bool() const {
         return bool(js::BarrierMethods<T>::asGCThingOrNull(ptr));
     }
     explicit operator bool() {
         return bool(js::BarrierMethods<T>::asGCThingOrNull(ptr));
     }
 
-    /*
-     * Set the pointer to a value which will cause a crash if it is
-     * dereferenced.
-     */
-    void setToCrashOnTouch() {
-        ptr = reinterpret_cast<T>(crashOnTouchPointer);
-    }
-
-    bool isSetToCrashOnTouch() {
-        return ptr == crashOnTouchPointer;
-    }
-
   private:
     void init(const T& newPtr) {
         ptr = newPtr;
         post(GCPolicy<T>::initial(), ptr);
     }
 
     void set(const T& newPtr) {
         T tmp = ptr;
         ptr = newPtr;
         post(tmp, ptr);
     }
 
     void post(const T& prev, const T& next) {
         js::BarrierMethods<T>::postBarrier(&ptr, prev, next);
     }
 
-    enum {
-        crashOnTouchPointer = 1
-    };
-
     T ptr;
 };
 
 static MOZ_ALWAYS_INLINE bool
 ObjectIsTenured(JSObject* obj)
 {
     return !js::gc::IsInsideNursery(reinterpret_cast<js::gc::Cell*>(obj));
 }