Bug 417419: You too can solve global-warming without making the JS_INLINE macro ugly. r=/a=brendan

This commit is contained in:
jag@tty.nl 2008-02-14 15:56:53 -08:00
Родитель d15f9c4206
Коммит 83acb80efe
3 изменённых файлов: 34 добавлений и 34 удалений

Просмотреть файл

@ -90,8 +90,8 @@ extern long __cdecl
_InterlockedCompareExchange(long *volatile dest, long exchange, long comp);
#pragma intrinsic(_InterlockedCompareExchange)
JS_INLINE(static int
js_CompareAndSwapHelper(jsword *w, jsword ov, jsword nv))
static JS_INLINE int
js_CompareAndSwapHelper(jsword *w, jsword ov, jsword nv)
{
_InterlockedCompareExchange(w, nv, ov);
__asm {
@ -99,8 +99,8 @@ js_CompareAndSwapHelper(jsword *w, jsword ov, jsword nv))
}
}
JS_INLINE(static int
js_CompareAndSwap(jsword *w, jsword ov, jsword nv))
static JS_INLINE int
js_CompareAndSwap(jsword *w, jsword ov, jsword nv)
{
return (js_CompareAndSwapHelper(w, ov, nv) & 1);
}
@ -109,8 +109,8 @@ js_CompareAndSwap(jsword *w, jsword ov, jsword nv))
#include <libkern/OSAtomic.h>
JS_INLINE(static int
js_CompareAndSwap(jsword *w, jsword ov, jsword nv))
static JS_INLINE int
js_CompareAndSwap(jsword *w, jsword ov, jsword nv)
{
/* Details on these functions available in the manpage for atomic */
#if JS_BYTES_PER_WORD == 8 && JS_BYTES_PER_LONG != 8
@ -123,8 +123,8 @@ js_CompareAndSwap(jsword *w, jsword ov, jsword nv))
#elif defined(__GNUC__) && defined(__i386__)
/* Note: This fails on 386 cpus, cmpxchgl is a >= 486 instruction */
JS_INLINE(static int
js_CompareAndSwap(jsword *w, jsword ov, jsword nv))
static JS_INLINE int
js_CompareAndSwap(jsword *w, jsword ov, jsword nv)
{
unsigned int res;
@ -179,8 +179,8 @@ js_CompareAndSwap(jsword *w, jsword ov, jsword nv)
#elif defined(SOLARIS) && defined(sparc) && defined(ULTRA_SPARC)
JS_INLINE(static int
js_CompareAndSwap(jsword *w, jsword ov, jsword nv))
static JS_INLINE int
js_CompareAndSwap(jsword *w, jsword ov, jsword nv)
{
#if defined(__GNUC__)
unsigned int res;
@ -207,8 +207,8 @@ mov 0,%0\n\
#include <sys/atomic_op.h>
JS_INLINE(static int
js_CompareAndSwap(jsword *w, jsword ov, jsword nv))
static JS_INLINE int
js_CompareAndSwap(jsword *w, jsword ov, jsword nv)
{
return !_check_lock((atomic_p)w, ov, nv);
}
@ -1003,8 +1003,8 @@ js_Dequeue(JSThinLock *tl)
js_ResumeThread(tl);
}
JS_INLINE(void
js_Lock(JSThinLock *tl, jsword me))
JS_INLINE void
js_Lock(JSThinLock *tl, jsword me)
{
JS_ASSERT(CURRENT_THREAD_IS_ME(me));
if (js_CompareAndSwap(&tl->owner, 0, me))
@ -1017,8 +1017,8 @@ js_Lock(JSThinLock *tl, jsword me))
#endif
}
JS_INLINE(void
js_Unlock(JSThinLock *tl, jsword me))
JS_INLINE void
js_Unlock(JSThinLock *tl, jsword me)
{
JS_ASSERT(CURRENT_THREAD_IS_ME(me));

Просмотреть файл

@ -237,8 +237,8 @@ GetCompactIndexWidth(size_t index)
return width;
}
JS_INLINE(static jsbytecode *
WriteCompactIndex(jsbytecode *pc, size_t index))
static JS_INLINE jsbytecode *
WriteCompactIndex(jsbytecode *pc, size_t index)
{
size_t next;
@ -250,8 +250,8 @@ WriteCompactIndex(jsbytecode *pc, size_t index))
return pc;
}
JS_INLINE(static jsbytecode *
ReadCompactIndex(jsbytecode *pc, size_t *result))
static JS_INLINE jsbytecode *
ReadCompactIndex(jsbytecode *pc, size_t *result)
{
size_t nextByte;
@ -353,8 +353,8 @@ typedef struct REGlobalData {
* code point value is less than decimal 128, then return ch.
* 6. Return cu.
*/
JS_INLINE(static uintN
upcase(uintN ch))
static JS_INLINE uintN
upcase(uintN ch)
{
uintN cu;
@ -369,8 +369,8 @@ upcase(uintN ch))
return (cu < 128) ? ch : cu;
}
JS_INLINE(static uintN
downcase(uintN ch))
static JS_INLINE uintN
downcase(uintN ch)
{
JS_ASSERT((uintN) (jschar) ch == ch);
if (ch < 128) {
@ -2152,9 +2152,9 @@ FlatNMatcher(REGlobalData *gData, REMatchState *x, jschar *matchChars,
}
#endif
JS_INLINE(static REMatchState *
static JS_INLINE REMatchState *
FlatNIMatcher(REGlobalData *gData, REMatchState *x, jschar *matchChars,
size_t length))
size_t length)
{
size_t i;
JS_ASSERT(gData->cpend >= x->cp);
@ -2511,9 +2511,9 @@ ReallocStateStack(REGlobalData *gData)
* true, then update the current state's cp. Always update startpc to the next
* op.
*/
JS_INLINE(static REMatchState *
static JS_INLINE REMatchState *
SimpleMatch(REGlobalData *gData, REMatchState *x, REOp op,
jsbytecode **startpc, JSBool updatecp))
jsbytecode **startpc, JSBool updatecp)
{
REMatchState *result = NULL;
jschar matchCh;
@ -2720,8 +2720,8 @@ SimpleMatch(REGlobalData *gData, REMatchState *x, REOp op,
return NULL;
}
JS_INLINE(static REMatchState *
ExecuteREBytecode(REGlobalData *gData, REMatchState *x))
static JS_INLINE REMatchState *
ExecuteREBytecode(REGlobalData *gData, REMatchState *x)
{
REMatchState *result = NULL;
REBackTrackData *backTrackData;

Просмотреть файл

@ -162,15 +162,15 @@
#define JS_FRIEND_DATA(t) JS_PUBLIC_DATA(t)
#ifdef _WIN32
# define JS_INLINE(x) __forceinline x
# define JS_INLINE __forceinline
#elif defined(__GNUC__)
# ifndef DEBUG
# define JS_INLINE(x) x __attribute__((always_inline)); x
# define JS_INLINE __attribute__((always_inline))
# else
# define JS_INLINE(x) inline x
# define JS_INLINE inline
# endif
#else
# define JS_INLINE(x) x
# define JS_INLINE
#endif
/***********************************************************************