Backed out changeset 40c187d91db4 (bug 1183604) for hazard analysis failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 28 Jul 2015 21:20:34 -0400
changeset 286743 39fba4322e8a55845030a749da2028238c5ffade
parent 286742 8420f6ffc2dbba3798afcdf444d68575266be435
child 286744 64f342488fbfaf6105778676cf1904e6d175e1d9
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1183604
milestone42.0a1
backs out40c187d91db4de94a1d4883573d4d3490c225f93
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
Backed out changeset 40c187d91db4 (bug 1183604) for hazard analysis failures. CLOSED TREE
dom/base/nsWrapperCache.h
dom/bindings/BindingUtils.h
--- a/dom/base/nsWrapperCache.h
+++ b/dom/base/nsWrapperCache.h
@@ -317,20 +317,18 @@ private:
     MOZ_ASSERT((aFlagsToUnset & ~kWrapperFlagsMask) == 0, "Bad wrapper flag bits");
     mFlags &= ~aFlagsToUnset;
   }
 
   static void HoldJSObjects(void* aScriptObjectHolder,
                             nsScriptObjectTracer* aTracer);
 
 #ifdef DEBUG
-public:
   void CheckCCWrapperTraversal(void* aScriptObjectHolder,
                                nsScriptObjectTracer* aTracer);
-private:
 #endif // DEBUG
 
   /**
    * If this bit is set then we're preserving the wrapper, which in effect ties
    * the lifetime of the JS object stored in the cache to the lifetime of the
    * native object. We rely on the cycle collector to break the cycle that this
    * causes between the native object and the JS object, so it is important that
    * any native object that supports preserving of its wrapper
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -874,62 +874,16 @@ template <class T>
 struct TypeNeedsOuterization
 {
   // We only need to outerize Window objects, so anything inheriting from
   // nsGlobalWindow (which inherits from EventTarget itself).
   static const bool value =
     IsBaseOf<nsGlobalWindow, T>::value || IsSame<EventTarget, T>::value;
 };
 
-#ifdef DEBUG
-template<typename T, bool isISupports=IsBaseOf<nsISupports, T>::value>
-struct CheckWrapperCacheTracing
-{
-  static inline void Check(T* aObject)
-  {
-  }
-};
-
-template<typename T>
-struct CheckWrapperCacheTracing<T, true>
-{
-  static void Check(T* aObject)
-  {
-    nsWrapperCache* wrapperCacheFromQI = nullptr;
-    aObject->QueryInterface(NS_GET_IID(nsWrapperCache),
-                            reinterpret_cast<void**>(&wrapperCacheFromQI));
-
-    MOZ_ASSERT(wrapperCacheFromQI,
-               "Missing nsWrapperCache from QueryInterface implementation?");
-
-    if (!wrapperCacheFromQI->GetWrapperPreserveColor()) {
-      // Can't assert that we trace the wrapper, since we don't have any
-      // wrapper to trace.
-      return;
-    }
-
-    nsISupports* ccISupports = nullptr;
-    aObject->QueryInterface(NS_GET_IID(nsCycleCollectionISupports),
-                            reinterpret_cast<void**>(&ccISupports));
-    MOZ_ASSERT(ccISupports,
-               "nsWrapperCache object which isn't cycle collectable?");
-
-    nsXPCOMCycleCollectionParticipant* participant = nullptr;
-    CallQueryInterface(ccISupports, &participant);
-    MOZ_ASSERT(participant, "Can't QI to CycleCollectionParticipant?");
-
-    bool wasPreservingWrapper = wrapperCacheFromQI->PreservingWrapper();
-    wrapperCacheFromQI->SetPreservingWrapper(true);
-    wrapperCacheFromQI->CheckCCWrapperTraversal(ccISupports, participant);
-    wrapperCacheFromQI->SetPreservingWrapper(wasPreservingWrapper);
-  }
-};
-
-#endif
-
 template <class T, GetOrCreateReflectorWrapBehavior wrapBehavior>
 MOZ_ALWAYS_INLINE bool
 DoGetOrCreateDOMReflector(JSContext* cx, T* value,
                           JS::MutableHandle<JS::Value> rval)
 {
   MOZ_ASSERT(value);
   JSObject* obj = value->GetWrapperPreserveColor();
   // We can get rid of this when we remove support for hasXPConnectImpls.
@@ -944,22 +898,16 @@ DoGetOrCreateDOMReflector(JSContext* cx,
 
     obj = value->WrapObject(cx, nullptr);
     if (!obj) {
       // At this point, obj is null, so just return false.
       // Callers seem to be testing JS_IsExceptionPending(cx) to
       // figure out whether WrapObject() threw.
       return false;
     }
-
-#ifdef DEBUG
-    if (IsBaseOf<nsWrapperCache, T>::value) {
-      CheckWrapperCacheTracing<T>::Check(value);
-    }
-#endif
   }
 
 #ifdef DEBUG
   const DOMJSClass* clasp = GetDOMClass(obj);
   // clasp can be null if the cache contained a non-DOM object.
   if (clasp) {
     // Some sanity asserts about our object.  Specifically:
     // 1)  If our class claims we're nsISupports, we better be nsISupports