Bug 1056410 - Mark more classes final. r=terrence, a=2.2+
authorSteve Fink <sfink@mozilla.com>
Mon, 30 Mar 2015 14:00:45 -0700
changeset 238400 bb9c9ed29fdd8d310f2f26ada432b60f32c75e39
parent 238399 af7478dd5b99928c980de0afe0f95fc4b18021d9
child 238401 bab8e4f5cbe872e70616ca56f4077457699f8161
push id609
push userryanvm@gmail.com
push dateTue, 19 May 2015 01:35:34 +0000
treeherdermozilla-b2g37_v2_2@bab8e4f5cbe8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence, 2.2
bugs1056410, 1047696
milestone37.0
Bug 1056410 - Mark more classes final. r=terrence, a=2.2+ Bug 1047696 was blocked by the hazard here, so it ended up not marking problematic classes final. Mark them final.
js/src/devtools/rootAnalysis/annotations.js
js/xpconnect/src/xpcprivate.h
--- a/js/src/devtools/rootAnalysis/annotations.js
+++ b/js/src/devtools/rootAnalysis/annotations.js
@@ -132,16 +132,19 @@ var ignoreFunctions = {
     "ptio.c:pt_MapError" : true,
     "je_malloc_printf" : true,
     "PR_ExplodeTime" : true,
     "PR_ErrorInstallTable" : true,
     "PR_SetThreadPrivate" : true,
     "JSObject* js::GetWeakmapKeyDelegate(JSObject*)" : true, // FIXME: mark with AutoSuppressGCAnalysis instead
     "uint8 NS_IsMainThread()" : true,
 
+    // Bug 1056410 - devirtualization prevents the standard nsISupports::Release heuristic from working
+    "uint32 nsXPConnect::Release()" : true,
+
     // FIXME!
     "NS_LogInit": true,
     "NS_LogTerm": true,
     "NS_LogAddRef": true,
     "NS_LogRelease": true,
     "NS_LogCtor": true,
     "NS_LogDtor": true,
     "NS_LogCOMPtrAddRef": true,
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -239,20 +239,20 @@ static inline bool IS_WN_REFLECTOR(JSObj
 ****************************************************************************
 ***************************************************************************/
 
 // We have a general rule internally that getters that return addref'd interface
 // pointer generally do so using an 'out' parm. When interface pointers are
 // returned as function call result values they are not addref'd. Exceptions
 // to this rule are noted explicitly.
 
-class nsXPConnect : public nsIXPConnect,
-                    public nsIThreadObserver,
-                    public nsSupportsWeakReference,
-                    public nsIJSRuntimeService
+class nsXPConnect final : public nsIXPConnect,
+                          public nsIThreadObserver,
+                          public nsSupportsWeakReference,
+                          public nsIJSRuntimeService
 {
 public:
     // all the interface method declarations...
     NS_DECL_ISUPPORTS
     NS_DECL_NSIXPCONNECT
     NS_DECL_NSITHREADOBSERVER
     NS_DECL_NSIJSRUNTIMESERVICE
 
@@ -1971,17 +1971,17 @@ private:
 };
 
 void* xpc_GetJSPrivate(JSObject* obj);
 
 /***************************************************************************/
 // XPCWrappedNative the wrapper around one instance of a native xpcom object
 // to be used from JavaScript.
 
-class XPCWrappedNative : public nsIXPConnectWrappedNative
+class XPCWrappedNative final : public nsIXPConnectWrappedNative
 {
 public:
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_NSIXPCONNECTJSOBJECTHOLDER
     NS_DECL_NSIXPCONNECTWRAPPEDNATIVE
 
     NS_DECL_CYCLE_COLLECTION_CLASS(XPCWrappedNative)
 
@@ -2285,17 +2285,17 @@ public:
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPCWrappedJSClass,
                               NS_IXPCONNECT_WRAPPED_JS_CLASS_IID)
 
 /*************************/
 // nsXPCWrappedJSClass represents the sharable factored out common code and
 // data for nsXPCWrappedJS instances for the same interface type.
 
-class nsXPCWrappedJSClass : public nsIXPCWrappedJSClass
+class nsXPCWrappedJSClass final : public nsIXPCWrappedJSClass
 {
     // all the interface method declarations...
     NS_DECL_ISUPPORTS
     NS_IMETHOD DebugDump(int16_t depth);
 public:
 
     static already_AddRefed<nsXPCWrappedJSClass>
     GetNewOrUsed(JSContext* cx,