diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index bbecbfae0b2..99c98081255 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -1073,14 +1073,14 @@ JS_YieldRequest(JSContext *cx) #endif } -JS_PUBLIC_API(jsrefcount) +JS_PUBLIC_API(unsigned) JS_SuspendRequest(JSContext *cx) { #ifdef JS_THREADSAFE JSRuntime *rt = cx->runtime; JS_ASSERT(rt->onOwnerThread()); - jsrefcount saveDepth = rt->requestDepth; + unsigned saveDepth = rt->requestDepth; if (!saveDepth) return 0; @@ -1094,7 +1094,7 @@ JS_SuspendRequest(JSContext *cx) } JS_PUBLIC_API(void) -JS_ResumeRequest(JSContext *cx, jsrefcount saveDepth) +JS_ResumeRequest(JSContext *cx, unsigned saveDepth) { #ifdef JS_THREADSAFE JSRuntime *rt = cx->runtime; @@ -4447,16 +4447,16 @@ JS_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode, } #ifdef JS_THREADSAFE -JS_PUBLIC_API(jsrefcount) +JS_PUBLIC_API(unsigned) JS_HoldPrincipals(JSContext *cx, JSPrincipals *principals) { return JS_ATOMIC_INCREMENT(&principals->refcount); } -JS_PUBLIC_API(jsrefcount) +JS_PUBLIC_API(unsigned) JS_DropPrincipals(JSContext *cx, JSPrincipals *principals) { - jsrefcount rc = JS_ATOMIC_DECREMENT(&principals->refcount); + unsigned rc = JS_ATOMIC_DECREMENT(&principals->refcount); if (rc == 0) principals->destroy(cx, principals); return rc; diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 7a9497c8315..2890ccb5abc 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -2351,11 +2351,11 @@ JS_EndRequest(JSContext *cx); extern JS_PUBLIC_API(void) JS_YieldRequest(JSContext *cx); -extern JS_PUBLIC_API(jsrefcount) +extern JS_PUBLIC_API(unsigned) JS_SuspendRequest(JSContext *cx); extern JS_PUBLIC_API(void) -JS_ResumeRequest(JSContext *cx, jsrefcount saveDepth); +JS_ResumeRequest(JSContext *cx, unsigned saveDepth); extern JS_PUBLIC_API(JSBool) JS_IsInRequest(JSRuntime *rt); @@ -2396,7 +2396,7 @@ class JSAutoRequest { protected: JSContext *mContext; - jsrefcount mSaveDepth; + unsigned mSaveDepth; JS_DECL_USE_GUARD_OBJECT_NOTIFIER #if 0 @@ -2428,7 +2428,7 @@ class JSAutoSuspendRequest { protected: JSContext *mContext; - jsrefcount mSaveDepth; + unsigned mSaveDepth; JS_DECL_USE_GUARD_OBJECT_NOTIFIER #if 0 @@ -4085,7 +4085,7 @@ struct JSPrincipals { char *codebase; /* Don't call "destroy"; use reference counting macros below. */ - jsrefcount refcount; + unsigned refcount; void (* destroy)(JSContext *cx, JSPrincipals *); JSBool (* subsume)(JSPrincipals *, JSPrincipals *); @@ -4095,10 +4095,10 @@ struct JSPrincipals { #define JSPRINCIPALS_HOLD(cx, principals) JS_HoldPrincipals(cx,principals) #define JSPRINCIPALS_DROP(cx, principals) JS_DropPrincipals(cx,principals) -extern JS_PUBLIC_API(jsrefcount) +extern JS_PUBLIC_API(unsigned) JS_HoldPrincipals(JSContext *cx, JSPrincipals *principals); -extern JS_PUBLIC_API(jsrefcount) +extern JS_PUBLIC_API(unsigned) JS_DropPrincipals(JSContext *cx, JSPrincipals *principals); #else diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h index 88cded30861..3604a2f3eed 100644 --- a/js/src/jscntxt.h +++ b/js/src/jscntxt.h @@ -86,7 +86,7 @@ struct JSSharpInfo { typedef js::HashMap JSSharpTable; struct JSSharpObjectMap { - jsrefcount depth; + unsigned depth; uint32_t sharpgen; JSSharpTable table; @@ -293,7 +293,7 @@ struct JSRuntime : js::RuntimeFriendFields js::RootedValueMap gcRootsHash; js::GCLocks gcLocksHash; - jsrefcount gcKeepAtoms; + unsigned gcKeepAtoms; size_t gcBytes; size_t gcMaxBytes; size_t gcMaxMallocBytes; diff --git a/js/src/jscompartment.h b/js/src/jscompartment.h index c2d936f6ae9..fc22037a23e 100644 --- a/js/src/jscompartment.h +++ b/js/src/jscompartment.h @@ -270,10 +270,10 @@ struct JSCompartment #ifdef DEBUG /* Property metering. */ - jsrefcount livePropTreeNodes; - jsrefcount totalPropTreeNodes; - jsrefcount propTreeKidsChunks; - jsrefcount liveDictModeNodes; + unsigned livePropTreeNodes; + unsigned totalPropTreeNodes; + unsigned propTreeKidsChunks; + unsigned liveDictModeNodes; #endif /* Set of all unowned base shapes in the compartment. */ diff --git a/js/src/jspubtd.h b/js/src/jspubtd.h index 1731a805280..d2d5d7ddc8d 100644 --- a/js/src/jspubtd.h +++ b/js/src/jspubtd.h @@ -96,7 +96,6 @@ JS_BEGIN_EXTERN_C /* Scalar typedefs. */ typedef int32_t jsint; typedef uint32_t jsuint; -typedef int32_t jsrefcount; /* PRInt32 if JS_THREADSAFE, see jslock.h */ #ifdef WIN32 typedef wchar_t jschar; diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index de09da7fc3e..1de2ec70ba5 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -1619,7 +1619,7 @@ CountHeap(JSContext *cx, unsigned argc, jsval *vp) return JS_NewNumberValue(cx, (double) counter, vp); } -static jsrefcount finalizeCount = 0; +static unsigned finalizeCount = 0; static void finalize_counter_finalize(JSContext *cx, JSObject *obj) diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 9bbee84440a..76a9d11a0d8 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -3586,7 +3586,7 @@ struct XPCJSContextInfo { bool savedFrameChain; // Greater than 0 if a request was suspended. - jsrefcount suspendDepth; + unsigned suspendDepth; }; class XPCJSContextStack