Bug 800106: replace some NS_ALWAYS_INLINEs with MOZ_ALWAYS_INLINEs; r=ehsan
authorJacek Szpot <maligree@gmail.com>
Fri, 19 Oct 2012 10:33:33 +0200
changeset 110781 788a51ef6221d796306b83fa73b73dbafe8f29ce
parent 110780 0cc577753007d51616aa7bbc88af122c4b4142b2
child 110782 4c0a5d9f82eed0083560bb702ee699d9560c5bd9
push id23716
push userryanvm@gmail.com
push dateSat, 20 Oct 2012 01:43:16 +0000
treeherderautoland@ff4af83233dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs800106
milestone19.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 800106: replace some NS_ALWAYS_INLINEs with MOZ_ALWAYS_INLINEs; r=ehsan
intl/unicharutil/util/nsUnicharUtils.cpp
storage/public/StatementCache.h
toolkit/components/places/SQLFunctions.cpp
xpcom/string/public/nsUTF8Utils.h
--- a/intl/unicharutil/util/nsUnicharUtils.cpp
+++ b/intl/unicharutil/util/nsUnicharUtils.cpp
@@ -31,27 +31,27 @@ static const uint8_t gASCIIToLower [128]
 #define IS_ASCII_UPPER(u) (('A' <= (u)) && ((u) <= 'Z'))
 #define IS_ASCII_LOWER(u) (('a' <= (u)) && ((u) <= 'z'))
 #define IS_ASCII_ALPHA(u) (IS_ASCII_UPPER(u) || IS_ASCII_LOWER(u))
 #define IS_ASCII_SPACE(u) (' ' == (u))
 
 // We want ToLowerCase(uint32_t) and ToLowerCaseASCII(uint32_t) to be fast
 // when they're called from within the case-insensitive comparators, so we
 // define inlined versions.
-static NS_ALWAYS_INLINE uint32_t
+static MOZ_ALWAYS_INLINE uint32_t
 ToLowerCase_inline(uint32_t aChar)
 {
   if (IS_ASCII(aChar)) {
     return gASCIIToLower[aChar];
   }
 
   return mozilla::unicode::GetLowercase(aChar);
 }
 
-static NS_ALWAYS_INLINE uint32_t
+static MOZ_ALWAYS_INLINE uint32_t
 ToLowerCaseASCII_inline(const uint32_t aChar)
 {
   if (IS_ASCII(aChar)) {
     return gASCIIToLower[aChar];
   }
 
   return aChar;
 }
@@ -266,17 +266,17 @@ CaseInsensitiveCompare(const PRUnichar *
 
 // Calculates the codepoint of the UTF8 sequence starting at aStr.  Sets aNext
 // to the byte following the end of the sequence.
 //
 // If the sequence is invalid, or if computing the codepoint would take us off
 // the end of the string (as marked by aEnd), returns -1 and does not set
 // aNext.  Note that this function doesn't check that aStr < aEnd -- it assumes
 // you've done that already.
-static NS_ALWAYS_INLINE uint32_t
+static MOZ_ALWAYS_INLINE uint32_t
 GetLowerUTF8Codepoint(const char* aStr, const char* aEnd, const char **aNext)
 {
   // Convert to unsigned char so that stuffing chars into PRUint32s doesn't
   // sign extend.
   const unsigned char *str = (unsigned char*)aStr;
 
   if (UTF8traits::isASCII(str[0])) {
     // It's ASCII; just convert to lower-case and return it.
--- a/storage/public/StatementCache.h
+++ b/storage/public/StatementCache.h
@@ -60,17 +60,17 @@ public:
       NS_ENSURE_TRUE(stmt, nullptr);
 
       mCachedStatements.Put(aQuery, stmt);
     }
     return stmt.forget();
   }
 
   template<int N>
-  NS_ALWAYS_INLINE already_AddRefed<StatementType>
+  MOZ_ALWAYS_INLINE already_AddRefed<StatementType>
   GetCachedStatement(const char (&aQuery)[N])
   {
     nsDependentCString query(aQuery, N - 1);
     return GetCachedStatement(query);
   }
 
   /**
    * Finalizes all cached statements so the database can be safely closed.  The
--- a/toolkit/components/places/SQLFunctions.cpp
+++ b/toolkit/components/places/SQLFunctions.cpp
@@ -39,17 +39,17 @@ namespace {
    *
    * @param aStart the beginning of the UTF-8 sequence
    * @param aNext the next character in the sequence
    * @param aEnd the first byte which is not part of the sequence
    *
    * @return a pointer to the next word boundary after aStart
    */
   static
-  NS_ALWAYS_INLINE const_char_iterator
+  MOZ_ALWAYS_INLINE const_char_iterator
   nextWordBoundary(const_char_iterator const aStart,
                    const_char_iterator const aNext,
                    const_char_iterator const aEnd) {
 
     const_char_iterator cur = aStart;
     if (('a' <= *cur && *cur <= 'z') ||
         ('A' <= *cur && *cur <= 'Z')) {
 
@@ -71,32 +71,32 @@ namespace {
     eFindOnBoundary,
     eFindAnywhere
   };
 
   /**
    * findAnywhere and findOnBoundary do almost the same thing, so it's natural
    * to implement them in terms of a single function.  They're both
    * performance-critical functions, however, and checking aBehavior makes them
-   * a bit slower.  Our solution is to define findInString as NS_ALWAYS_INLINE
+   * a bit slower.  Our solution is to define findInString as MOZ_ALWAYS_INLINE
    * and rely on the compiler to optimize out the aBehavior check.
    *
    * @param aToken
    *        The token we're searching for
    * @param aSourceString
    *        The string in which we're searching
    * @param aBehavior
    *        eFindOnBoundary if we should only consider matchines which occur on
    *        word boundaries, or eFindAnywhere if we should consider matches
    *        which appear anywhere.
    *
    * @return true if aToken was found in aSourceString, false otherwise.
    */
   static
-  NS_ALWAYS_INLINE bool
+  MOZ_ALWAYS_INLINE bool
   findInString(const nsDependentCSubstring &aToken,
                const nsACString &aSourceString,
                FindInStringBehavior aBehavior)
   {
     // CaseInsensitiveUTF8CharsEqual assumes that there's at least one byte in
     // the both strings, so don't pass an empty token here.
     NS_PRECONDITION(!aToken.IsEmpty(), "Don't search for an empty token!");
 
--- a/xpcom/string/public/nsUTF8Utils.h
+++ b/xpcom/string/public/nsUTF8Utils.h
@@ -281,17 +281,17 @@ class ConvertUTF8toUTF16
 
     ConvertUTF8toUTF16( buffer_type* aBuffer )
         : mStart(aBuffer), mBuffer(aBuffer), mErrorEncountered(false) {}
 
     size_t Length() const { return mBuffer - mStart; }
 
     bool ErrorEncountered() const { return mErrorEncountered; }
 
-    void NS_ALWAYS_INLINE write( const value_type* start, uint32_t N )
+    void MOZ_ALWAYS_INLINE write( const value_type* start, uint32_t N )
       {
         if ( mErrorEncountered )
           return;
 
         // algorithm assumes utf8 units won't
         // be spread across fragments
         const value_type* p = start;
         const value_type* end = start + N;
@@ -340,17 +340,17 @@ class CalculateUTF8Length
   {
     public:
       typedef char value_type;
 
     CalculateUTF8Length() : mLength(0), mErrorEncountered(false) { }
 
     size_t Length() const { return mLength; }
 
-    void NS_ALWAYS_INLINE write( const value_type* start, uint32_t N )
+    void MOZ_ALWAYS_INLINE write( const value_type* start, uint32_t N )
       {
           // ignore any further requests
         if ( mErrorEncountered )
             return;
 
         // algorithm assumes utf8 units won't
         // be spread across fragments
         const value_type* p = start;
@@ -444,17 +444,17 @@ class ConvertUTF16toUTF8
     // |ConvertUTF8toUTF16|, but it's that way for backwards
     // compatibility.
 
     ConvertUTF16toUTF8( buffer_type* aBuffer )
         : mStart(aBuffer), mBuffer(aBuffer) {}
 
     size_t Size() const { return mBuffer - mStart; }
 
-    void NS_ALWAYS_INLINE write( const value_type* start, uint32_t N )
+    void MOZ_ALWAYS_INLINE write( const value_type* start, uint32_t N )
       {
         buffer_type *out = mBuffer; // gcc isn't smart enough to do this!
 
         for (const value_type *p = start, *end = start + N; p < end; ++p )
           {
             value_type c = *p;
             if (! (c & 0xFF80)) // U+0000 - U+007F
               {
@@ -561,17 +561,17 @@ class CalculateUTF8Size
     public:
       typedef PRUnichar value_type;
 
     CalculateUTF8Size()
       : mSize(0) { }
 
     size_t Size() const { return mSize; }
 
-    void NS_ALWAYS_INLINE write( const value_type* start, uint32_t N )
+    void MOZ_ALWAYS_INLINE write( const value_type* start, uint32_t N )
       {
         // Assume UCS2 surrogate pairs won't be spread across fragments.
         for (const value_type *p = start, *end = start + N; p < end; ++p )
           {
             value_type c = *p;
             if (! (c & 0xFF80)) // U+0000 - U+007F
               mSize += 1;
             else if (! (c & 0xF800)) // U+0100 - U+07FF