From dcdf0df942d2ae6cd451c16c66ef505dcabb7c93 Mon Sep 17 00:00:00 2001 From: Igor Bukanov Date: Tue, 29 Jul 2008 19:53:03 +0200 Subject: [PATCH] bug 445391 - re-enable OJI for Firefox 3.1, the configure changes is from jst, r=jst,crowder, sr=benjamin --- configure.in | 10 +++++----- js/src/jsgc.cpp | 2 +- js/src/jsinterp.h | 4 ++-- js/src/jslock.cpp | 24 ++++++++++++------------ js/src/jsregexp.cpp | 14 +++++++------- js/src/jsscan.cpp | 2 +- js/src/jsscript.h | 2 +- js/src/jstypes.h | 28 ++++++++++++++++++++-------- 8 files changed, 49 insertions(+), 37 deletions(-) diff --git a/configure.in b/configure.in index 1f94a7190c7..6614483b807 100644 --- a/configure.in +++ b/configure.in @@ -4359,7 +4359,7 @@ MOZ_NO_INSPECTOR_APIS= MOZ_NO_XPCOM_OBSOLETE= MOZ_NO_FAST_LOAD= MOZ_MEDIA= -MOZ_OJI= +MOZ_OJI=1 MOZ_PERMISSIONS=1 MOZ_PLACES= MOZ_PLAINTEXT_EDITOR_ONLY= @@ -5162,10 +5162,10 @@ MOZ_ARG_DISABLE_BOOL(plugins, dnl ======================================================== dnl = Open JVM Interface (OJI) support dnl ======================================================== -MOZ_ARG_ENABLE_BOOL(oji, -[ --enable-oji Enable Open JVM Integration support], - MOZ_OJI=1, - MOZ_OJI=) +MOZ_ARG_DISABLE_BOOL(oji, +[ --disable-oji Disable Open JVM Integration support], + MOZ_OJI=, + MOZ_OJI=1) if test -n "$MOZ_OJI"; then AC_DEFINE(OJI) fi diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 4e666e4a0d0..bcd76db05d0 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -561,7 +561,7 @@ ClearDoubleArenaFlags(JSGCArenaInfo *a) bitmap[DOUBLES_ARENA_BITMAP_WORDS - 1] = mask << nused; } -static JS_INLINE JSBool +static JS_ALWAYS_INLINE JSBool IsMarkedDouble(JSGCArenaInfo *a, uint32 index) { jsbitmap *bitmap; diff --git a/js/src/jsinterp.h b/js/src/jsinterp.h index 81dadda9b2d..55f813d0c76 100644 --- a/js/src/jsinterp.h +++ b/js/src/jsinterp.h @@ -93,13 +93,13 @@ struct JSStackFrame { #endif }; -static inline jsval * +static JS_INLINE jsval * StackBase(JSStackFrame *fp) { return fp->slots + fp->script->nfixed; } -static inline uintN +static JS_INLINE uintN GlobalVarCount(JSStackFrame *fp) { uintN n; diff --git a/js/src/jslock.cpp b/js/src/jslock.cpp index 136343bc7f3..ec0e01db7f2 100644 --- a/js/src/jslock.cpp +++ b/js/src/jslock.cpp @@ -71,7 +71,7 @@ _InterlockedCompareExchange(long *volatile dest, long exchange, long comp); JS_END_EXTERN_C #pragma intrinsic(_InterlockedCompareExchange) -static JS_INLINE int +static JS_ALWAYS_INLINE int NativeCompareAndSwapHelper(jsword *w, jsword ov, jsword nv) { _InterlockedCompareExchange(w, nv, ov); @@ -80,7 +80,7 @@ NativeCompareAndSwapHelper(jsword *w, jsword ov, jsword nv) } } -static JS_INLINE int +static JS_ALWAYS_INLINE int NativeCompareAndSwap(jsword *w, jsword ov, jsword nv) { return (NativeCompareAndSwapHelper(w, ov, nv) & 1); @@ -90,7 +90,7 @@ NativeCompareAndSwap(jsword *w, jsword ov, jsword nv) #include -static JS_INLINE int +static JS_ALWAYS_INLINE int NativeCompareAndSwap(jsword *w, jsword ov, jsword nv) { /* Details on these functions available in the manpage for atomic */ @@ -104,7 +104,7 @@ NativeCompareAndSwap(jsword *w, jsword ov, jsword nv) #elif defined(__GNUC__) && defined(__i386__) /* Note: This fails on 386 cpus, cmpxchgl is a >= 486 instruction */ -static JS_INLINE int +static JS_ALWAYS_INLINE int NativeCompareAndSwap(jsword *w, jsword ov, jsword nv) { unsigned int res; @@ -121,7 +121,7 @@ NativeCompareAndSwap(jsword *w, jsword ov, jsword nv) } #elif defined(__GNUC__) && defined(__x86_64__) -static JS_INLINE int +static JS_ALWAYS_INLINE int NativeCompareAndSwap(jsword *w, jsword ov, jsword nv) { unsigned int res; @@ -139,7 +139,7 @@ NativeCompareAndSwap(jsword *w, jsword ov, jsword nv) #elif defined(SOLARIS) && defined(sparc) && defined(ULTRA_SPARC) -static JS_INLINE int +static JS_ALWAYS_INLINE int NativeCompareAndSwap(jsword *w, jsword ov, jsword nv) { #if defined(__GNUC__) @@ -167,7 +167,7 @@ mov 0,%0\n\ #include -static JS_INLINE int +static JS_ALWAYS_INLINE int NativeCompareAndSwap(jsword *w, jsword ov, jsword nv) { return !_check_lock((atomic_p)w, ov, nv); @@ -184,7 +184,7 @@ typedef int (__kernel_cmpxchg_t)(int oldval, int newval, volatile int *ptr); JS_STATIC_ASSERT(sizeof(jsword) == sizeof(int)); -static JS_INLINE int +static JS_ALWAYS_INLINE int NativeCompareAndSwap(jsword *w, jsword ov, jsword nv) { volatile int *vp = (volatile int *) w; @@ -916,14 +916,14 @@ js_CleanupLocks() #ifdef NSPR_LOCK -static JS_INLINE void +static JS_ALWAYS_INLINE void ThinLock(JSThinLock *tl, jsword me) { JS_ACQUIRE_LOCK((JSLock *) tl->fat); tl->owner = me; } -static JS_INLINE void +static JS_ALWAYS_INLINE void ThinUnlock(JSThinLock *tl, jsword /*me*/) { tl->owner = 0; @@ -1047,7 +1047,7 @@ js_Dequeue(JSThinLock *tl) js_ResumeThread(tl); } -static JS_INLINE void +static JS_ALWAYS_INLINE void ThinLock(JSThinLock *tl, jsword me) { JS_ASSERT(CURRENT_THREAD_IS_ME(me)); @@ -1061,7 +1061,7 @@ ThinLock(JSThinLock *tl, jsword me) #endif } -static JS_INLINE void +static JS_ALWAYS_INLINE void ThinUnlock(JSThinLock *tl, jsword me) { JS_ASSERT(CURRENT_THREAD_IS_ME(me)); diff --git a/js/src/jsregexp.cpp b/js/src/jsregexp.cpp index a7eaccb376f..fa2e0a236e7 100644 --- a/js/src/jsregexp.cpp +++ b/js/src/jsregexp.cpp @@ -238,7 +238,7 @@ GetCompactIndexWidth(size_t index) return width; } -static JS_INLINE jsbytecode * +static JS_ALWAYS_INLINE jsbytecode * WriteCompactIndex(jsbytecode *pc, size_t index) { size_t next; @@ -251,7 +251,7 @@ WriteCompactIndex(jsbytecode *pc, size_t index) return pc; } -static JS_INLINE jsbytecode * +static JS_ALWAYS_INLINE jsbytecode * ReadCompactIndex(jsbytecode *pc, size_t *result) { size_t nextByte; @@ -354,7 +354,7 @@ typedef struct REGlobalData { * code point value is less than decimal 128, then return ch. * 6. Return cu. */ -static JS_INLINE uintN +static JS_ALWAYS_INLINE uintN upcase(uintN ch) { uintN cu; @@ -370,7 +370,7 @@ upcase(uintN ch) return (cu < 128) ? ch : cu; } -static JS_INLINE uintN +static JS_ALWAYS_INLINE uintN downcase(uintN ch) { JS_ASSERT((uintN) (jschar) ch == ch); @@ -2164,7 +2164,7 @@ FlatNMatcher(REGlobalData *gData, REMatchState *x, jschar *matchChars, } #endif -static JS_INLINE REMatchState * +static JS_ALWAYS_INLINE REMatchState * FlatNIMatcher(REGlobalData *gData, REMatchState *x, jschar *matchChars, size_t length) { @@ -2529,7 +2529,7 @@ ReallocStateStack(REGlobalData *gData) * true, then update the current state's cp. Always update startpc to the next * op. */ -static JS_INLINE REMatchState * +static JS_ALWAYS_INLINE REMatchState * SimpleMatch(REGlobalData *gData, REMatchState *x, REOp op, jsbytecode **startpc, JSBool updatecp) { @@ -2738,7 +2738,7 @@ SimpleMatch(REGlobalData *gData, REMatchState *x, REOp op, return NULL; } -static JS_INLINE REMatchState * +static JS_ALWAYS_INLINE REMatchState * ExecuteREBytecode(REGlobalData *gData, REMatchState *x) { REMatchState *result = NULL; diff --git a/js/src/jsscan.cpp b/js/src/jsscan.cpp index 3320f6ff08d..d47805eda32 100644 --- a/js/src/jsscan.cpp +++ b/js/src/jsscan.cpp @@ -984,7 +984,7 @@ NewToken(JSTokenStream *ts, ptrdiff_t adjust) return tp; } -static JS_INLINE JSBool +static JS_ALWAYS_INLINE JSBool ScanAsSpace(jschar c) { /* Treat little- and big-endian BOMs as whitespace for compatibility. */ diff --git a/js/src/jsscript.h b/js/src/jsscript.h index dfac7b1b15f..6e5ee6c3897 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -112,7 +112,7 @@ struct JSScript { #endif }; -static inline uintN +static JS_INLINE uintN StackDepth(JSScript *script) { return script->nslots - script->nfixed; diff --git a/js/src/jstypes.h b/js/src/jstypes.h index d406f4396b9..56cf0cc6b0f 100644 --- a/js/src/jstypes.h +++ b/js/src/jstypes.h @@ -161,16 +161,28 @@ #define JS_FRIEND_API(t) JS_PUBLIC_API(t) #define JS_FRIEND_DATA(t) JS_PUBLIC_DATA(t) -#if defined(_MSC_VER) -# define JS_INLINE __forceinline -#elif defined(__GNUC__) -# ifndef DEBUG -# define JS_INLINE __attribute__((always_inline)) +#ifndef JS_INLINE +# if defined __cplusplus +# define JS_INLINE inline +# elif defined _MSC_VER +# define JS_INLINE __inline +# elif defined __GNUC__ +# define JS_INLINE __inline__ # else -# define JS_INLINE inline +# define JS_INLINE inline +# endif +#endif + +#ifndef JS_ALWAYS_INLINE +# if defined DEBUG +# define JS_ALWAYS_INLINE JS_INLINE +# elif defined _MSC_VER +# define JS_ALWAYS_INLINE __forceinline +# elif defined __GNUC__ +# define JS_ALWAYS_INLINE __attribute__((always_inline)) +# else +# define JS_ALWAYS_INLINE JS_INLINE # endif -#else -# define JS_INLINE #endif /***********************************************************************