Skip to content

Commit

Permalink
Backout changeset 0f0797cdb55a (bug 800106) because of Kraken regress…
Browse files Browse the repository at this point in the history
…ions on Windows XP
  • Loading branch information
ehsan committed Oct 15, 2012
1 parent 7ff6375 commit bfb2711
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 19 deletions.
13 changes: 13 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -3785,6 +3785,13 @@ AC_CHECK_FUNCS(strndup posix_memalign memalign valloc)

dnl See if compiler supports some gcc-style attributes

AC_CACHE_CHECK(for __attribute__((always_inline)),
ac_cv_attribute_always_inline,
[AC_TRY_COMPILE([inline void f(void) __attribute__((always_inline));],
[],
ac_cv_attribute_always_inline=yes,
ac_cv_attribute_always_inline=no)])

AC_CACHE_CHECK(for __attribute__((malloc)),
ac_cv_attribute_malloc,
[AC_TRY_COMPILE([void* f(int) __attribute__((malloc));],
Expand Down Expand Up @@ -3836,6 +3843,12 @@ dnl are defined in build/autoconf/altoptions.m4.

dnl If the compiler supports these attributes, define them as
dnl convenience macros.
if test "$ac_cv_attribute_always_inline" = yes ; then
AC_DEFINE(NS_ALWAYS_INLINE, [__attribute__((always_inline))])
else
AC_DEFINE(NS_ALWAYS_INLINE,)
fi

if test "$ac_cv_attribute_malloc" = yes ; then
AC_DEFINE(NS_ATTR_MALLOC, [__attribute__((malloc))])
else
Expand Down
6 changes: 3 additions & 3 deletions intl/unicharutil/util/nsUnicharUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static const uint8_t gASCIIToLower [128] = {
// 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 MOZ_ALWAYS_INLINE uint32_t
static NS_ALWAYS_INLINE uint32_t
ToLowerCase_inline(uint32_t aChar)
{
if (IS_ASCII(aChar)) {
Expand All @@ -46,7 +46,7 @@ ToLowerCase_inline(uint32_t aChar)
return mozilla::unicode::GetLowercase(aChar);
}

static MOZ_ALWAYS_INLINE uint32_t
static NS_ALWAYS_INLINE uint32_t
ToLowerCaseASCII_inline(const uint32_t aChar)
{
if (IS_ASCII(aChar)) {
Expand Down Expand Up @@ -271,7 +271,7 @@ CaseInsensitiveCompare(const PRUnichar *a,
// 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 MOZ_ALWAYS_INLINE uint32_t
static NS_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
Expand Down
13 changes: 13 additions & 0 deletions js/src/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -3094,6 +3094,13 @@ AC_CHECK_FUNCS(strndup posix_memalign memalign valloc)

dnl See if compiler supports some gcc-style attributes

AC_CACHE_CHECK(for __attribute__((always_inline)),
ac_cv_attribute_always_inline,
[AC_TRY_COMPILE([inline void f(void) __attribute__((always_inline));],
[],
ac_cv_attribute_always_inline=yes,
ac_cv_attribute_always_inline=no)])

AC_CACHE_CHECK(for __attribute__((malloc)),
ac_cv_attribute_malloc,
[AC_TRY_COMPILE([void* f(int) __attribute__((malloc));],
Expand Down Expand Up @@ -3145,6 +3152,12 @@ dnl are defined in build/autoconf/altoptions.m4.

dnl If the compiler supports these attributes, define them as
dnl convenience macros.
if test "$ac_cv_attribute_always_inline" = yes ; then
AC_DEFINE(NS_ALWAYS_INLINE, [__attribute__((always_inline))])
else
AC_DEFINE(NS_ALWAYS_INLINE,)
fi

if test "$ac_cv_attribute_malloc" = yes ; then
AC_DEFINE(NS_ATTR_MALLOC, [__attribute__((malloc))])
else
Expand Down
4 changes: 0 additions & 4 deletions media/libjpeg/MOZCHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ To upgrade to a new revision of libjpeg-turbo, do the following:

$ hg addremove

== October 13, 2012 ==

* Modified config.h to use MOZ_ALWAYS_INLINE (bug 800106).

== July 4, 2012 (libjpeg-turbo v1.2.1 r853 2012-06-30) ==

* Updated to v1.2.1 stable release.
Expand Down
3 changes: 1 addition & 2 deletions media/libjpeg/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
#define PACKAGE_NAME "libjpeg-turbo"

/* Need to use Mozilla-specific function inlining. */
#include "mozilla/Attributes.h"
#define INLINE MOZ_ALWAYS_INLINE
#define INLINE NS_ALWAYS_INLINE
4 changes: 2 additions & 2 deletions memory/mozalloc/mozalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
#endif


#if defined(MOZ_ALWAYS_INLINE)
# define MOZALLOC_INLINE MOZ_ALWAYS_INLINE
#if defined(NS_ALWAYS_INLINE)
# define MOZALLOC_INLINE NS_ALWAYS_INLINE inline
#elif defined(HAVE_FORCEINLINE)
# define MOZALLOC_INLINE __forceinline
#else
Expand Down
2 changes: 1 addition & 1 deletion storage/public/StatementCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class StatementCache {
}

template<int N>
MOZ_ALWAYS_INLINE already_AddRefed<StatementType>
NS_ALWAYS_INLINE already_AddRefed<StatementType>
GetCachedStatement(const char (&aQuery)[N])
{
nsDependentCString query(aQuery, N - 1);
Expand Down
6 changes: 3 additions & 3 deletions toolkit/components/places/SQLFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace {
* @return a pointer to the next word boundary after aStart
*/
static
MOZ_ALWAYS_INLINE const_char_iterator
NS_ALWAYS_INLINE const_char_iterator
nextWordBoundary(const_char_iterator const aStart,
const_char_iterator const aNext,
const_char_iterator const aEnd) {
Expand Down Expand Up @@ -76,7 +76,7 @@ namespace {
* 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 MOZ_ALWAYS_INLINE
* a bit slower. Our solution is to define findInString as NS_ALWAYS_INLINE
* and rely on the compiler to optimize out the aBehavior check.
*
* @param aToken
Expand All @@ -91,7 +91,7 @@ namespace {
* @return true if aToken was found in aSourceString, false otherwise.
*/
static
MOZ_ALWAYS_INLINE bool
NS_ALWAYS_INLINE bool
findInString(const nsDependentCSubstring &aToken,
const nsACString &aSourceString,
FindInStringBehavior aBehavior)
Expand Down
8 changes: 4 additions & 4 deletions xpcom/string/public/nsUTF8Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class ConvertUTF8toUTF16

bool ErrorEncountered() const { return mErrorEncountered; }

void MOZ_ALWAYS_INLINE write( const value_type* start, uint32_t N )
void NS_ALWAYS_INLINE write( const value_type* start, uint32_t N )
{
if ( mErrorEncountered )
return;
Expand Down Expand Up @@ -345,7 +345,7 @@ class CalculateUTF8Length

size_t Length() const { return mLength; }

void MOZ_ALWAYS_INLINE write( const value_type* start, uint32_t N )
void NS_ALWAYS_INLINE write( const value_type* start, uint32_t N )
{
// ignore any further requests
if ( mErrorEncountered )
Expand Down Expand Up @@ -449,7 +449,7 @@ class ConvertUTF16toUTF8

size_t Size() const { return mBuffer - mStart; }

void MOZ_ALWAYS_INLINE write( const value_type* start, uint32_t N )
void NS_ALWAYS_INLINE write( const value_type* start, uint32_t N )
{
buffer_type *out = mBuffer; // gcc isn't smart enough to do this!

Expand Down Expand Up @@ -566,7 +566,7 @@ class CalculateUTF8Size

size_t Size() const { return mSize; }

void MOZ_ALWAYS_INLINE write( const value_type* start, uint32_t N )
void NS_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 )
Expand Down

0 comments on commit bfb2711

Please sign in to comment.