Bug 1015664. Part 3: Remove NS_HIDDEN_VISIBILITY from NS_IMETHOD_VISIBILITY. r=bsmedberg
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 03 Jun 2014 00:08:27 +1200
changeset 205380 fc7786236f98b184a122adb6f719f5f05435ae2d
parent 205379 4e200260a4535784c254b0c142574f7cf3bcf777
child 205381 e09168ca307247b69bf9e494a512327a5fdb7f8c
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1015664
milestone32.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 1015664. Part 3: Remove NS_HIDDEN_VISIBILITY from NS_IMETHOD_VISIBILITY. r=bsmedberg
xpcom/base/nscore.h
xpcom/ds/nsHashPropertyBag.h
xpcom/glue/nsThreadUtils.h
xpcom/glue/nsWeakReference.h
--- a/xpcom/base/nscore.h
+++ b/xpcom/base/nscore.h
@@ -32,48 +32,16 @@
 
 #include "mozilla/RefCountType.h"
 
 /* Core XPCOM declarations. */
 
 /*----------------------------------------------------------------------*/
 /* Import/export defines */
 
-/**
- * Using the visibility("hidden") attribute allows the compiler to use
- * PC-relative addressing to call this function.  If a function does not
- * access any global data, and does not call any methods which are not either
- * file-local or hidden, then on ELF systems we avoid loading the address of
- * the PLT into a register at the start of the function, which reduces code
- * size and frees up a register for general use.
- *
- * As a general rule, this should be used for any non-exported symbol
- * (including virtual method implementations).  NS_IMETHOD uses this by
- * default; if you need to have your NS_IMETHOD functions exported, you can
- * wrap your class as follows:
- *
- * #undef  IMETHOD_VISIBILITY
- * #define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT
- *
- * class Foo {
- * ...
- * };
- *
- * #undef  IMETHOD_VISIBILITY
- * #define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN
- *
- * Don't forget to change the visibility back to hidden before the end
- * of a header!
- *
- * Other examples:
- *
- * NS_HIDDEN_(int) someMethod();
- * SomeCtor();
- */
-
 #ifdef HAVE_VISIBILITY_HIDDEN_ATTRIBUTE
 #define NS_VISIBILITY_HIDDEN   __attribute__ ((visibility ("hidden")))
 #else
 #define NS_VISIBILITY_HIDDEN
 #endif
 
 #if defined(HAVE_VISIBILITY_ATTRIBUTE)
 #define NS_VISIBILITY_DEFAULT __attribute__ ((visibility ("default")))
@@ -85,17 +53,17 @@
 
 #define NS_HIDDEN_(type)   NS_VISIBILITY_HIDDEN type
 #define NS_EXTERNAL_VIS_(type) NS_VISIBILITY_DEFAULT type
 
 #define NS_HIDDEN           NS_VISIBILITY_HIDDEN
 #define NS_EXTERNAL_VIS     NS_VISIBILITY_DEFAULT
 
 #undef  IMETHOD_VISIBILITY
-#define IMETHOD_VISIBILITY  NS_VISIBILITY_HIDDEN
+#define IMETHOD_VISIBILITY
 
 /**
  * Mark a function as using a potentially non-standard function calling
  * convention.  This can be used on functions that are called very
  * frequently, to reduce the overhead of the function call.  It is still worth
  * using the macro for C++ functions which take no parameters since it allows
  * passing |this| in a register.
  *
--- a/xpcom/ds/nsHashPropertyBag.h
+++ b/xpcom/ds/nsHashPropertyBag.h
@@ -28,17 +28,14 @@ public:
 
     NS_DECL_NSIWRITABLEPROPERTYBAG2
 
 protected:
     // a hash table of string -> nsIVariant
     nsInterfaceHashtable<nsStringHashKey, nsIVariant> mPropertyHash;
 };
 
-#undef  IMETHOD_VISIBILITY
-#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN
-
 // Note: NS_NewHashPropertyBag returns a HPB that
 // uses a non-thread-safe internal hash
 extern "C" nsresult
 NS_NewHashPropertyBag(nsIWritablePropertyBag* *_retval);
 
 #endif /* nsHashPropertyBag_h___ */
--- a/xpcom/glue/nsThreadUtils.h
+++ b/xpcom/glue/nsThreadUtils.h
@@ -241,17 +241,17 @@ public:
   }
 
 protected:
   virtual ~nsCancelableRunnable() {
   }
 };
 
 #undef  IMETHOD_VISIBILITY
-#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN
+#define IMETHOD_VISIBILITY
 
 // An event that can be used to call a method on a class.  The class type must
 // support reference counting. This event supports Revoke for use
 // with nsRevocableEventPtr.
 template <class ClassType,
           typename ReturnType = void,
           bool Owning = true>
 class nsRunnableMethod : public nsRunnable
--- a/xpcom/glue/nsWeakReference.h
+++ b/xpcom/glue/nsWeakReference.h
@@ -48,17 +48,17 @@ class NS_COM_GLUE nsSupportsWeakReferenc
 
 		protected:
 
 			void ClearWeakReferences();
 			bool HasWeakReferences() const {return mProxy != 0;}
   };
 
 #undef  IMETHOD_VISIBILITY
-#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN
+#define IMETHOD_VISIBILITY
 
 inline
 nsSupportsWeakReference::~nsSupportsWeakReference()
   {
   	ClearWeakReferences();
   }
 
 #endif