mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 952650 (part 14) - Remove JSVAL_IS_GCTHING. r=till.
--HG-- extra : rebase_source : 469430d481f5fdb14d49609d8460f9fcbc90927f
This commit is contained in:
parent
8cc884d7c8
commit
c3b4a130ee
@ -101,7 +101,7 @@ DOMRequest::FireSuccess(JS::Handle<JS::Value> aResult)
|
||||
NS_ASSERTION(mResult == JSVAL_VOID, "mResult shouldn't have been set!");
|
||||
|
||||
mDone = true;
|
||||
if (JSVAL_IS_GCTHING(aResult)) {
|
||||
if (aResult.isGCThing()) {
|
||||
RootResultVal();
|
||||
}
|
||||
mResult = aResult;
|
||||
|
@ -838,7 +838,7 @@ IDBIndex::GetKeyPath(JSContext* aCx, ErrorResult& aRv)
|
||||
aRv = GetKeyPath().ToJSVal(aCx, mCachedKeyPath);
|
||||
ENSURE_SUCCESS(aRv, JSVAL_VOID);
|
||||
|
||||
if (JSVAL_IS_GCTHING(mCachedKeyPath)) {
|
||||
if (mCachedKeyPath.isGCThing()) {
|
||||
mozilla::HoldJSObjects(this);
|
||||
mRooted = true;
|
||||
}
|
||||
|
@ -2622,7 +2622,7 @@ IDBObjectStore::GetKeyPath(JSContext* aCx, ErrorResult& aRv)
|
||||
aRv = GetKeyPath().ToJSVal(aCx, mCachedKeyPath);
|
||||
ENSURE_SUCCESS(aRv, JSVAL_VOID);
|
||||
|
||||
if (JSVAL_IS_GCTHING(mCachedKeyPath)) {
|
||||
if (mCachedKeyPath.isGCThing()) {
|
||||
mozilla::HoldJSObjects(this);
|
||||
mRooted = true;
|
||||
}
|
||||
|
@ -2289,7 +2289,7 @@ void
|
||||
XMLHttpRequest::UpdateState(const StateData& aStateData)
|
||||
{
|
||||
mStateData = aStateData;
|
||||
if (JSVAL_IS_GCTHING(mStateData.mResponse)) {
|
||||
if (mStateData.mResponse.isGCThing()) {
|
||||
mozilla::HoldJSObjects(this);
|
||||
}
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ jsd_NewValue(JSDContext* jsdc, jsval value)
|
||||
if(!(jsdval = (JSDValue*) calloc(1, sizeof(JSDValue))))
|
||||
return nullptr;
|
||||
|
||||
if(JSVAL_IS_GCTHING(val))
|
||||
if(val.isGCThing())
|
||||
{
|
||||
bool ok;
|
||||
JSAutoCompartment ac(cx, jsdc->glob);
|
||||
@ -279,7 +279,7 @@ jsd_DropValue(JSDContext* jsdc, JSDValue* jsdval)
|
||||
if(0 == --jsdval->nref)
|
||||
{
|
||||
jsd_RefreshValue(jsdc, jsdval);
|
||||
if(JSVAL_IS_GCTHING(jsdval->val))
|
||||
if(jsdval->val.isGCThing())
|
||||
{
|
||||
AutoSafeJSContext cx;
|
||||
JSAutoCompartment ac(cx, jsdc->glob);
|
||||
|
@ -1874,12 +1874,6 @@ BOOLEAN_TO_JSVAL(bool b)
|
||||
return IMPL_TO_JSVAL(BOOLEAN_TO_JSVAL_IMPL(b));
|
||||
}
|
||||
|
||||
static inline bool
|
||||
JSVAL_IS_GCTHING(jsval v)
|
||||
{
|
||||
return JSVAL_IS_GCTHING_IMPL(JSVAL_TO_IMPL(v));
|
||||
}
|
||||
|
||||
static inline void *
|
||||
JSVAL_TO_GCTHING(jsval v)
|
||||
{
|
||||
|
@ -5983,7 +5983,7 @@ JS_SaveExceptionState(JSContext *cx)
|
||||
if (state) {
|
||||
state->throwing =
|
||||
JS_GetPendingException(cx, MutableHandleValue::fromMarkedLocation(&state->exception));
|
||||
if (state->throwing && JSVAL_IS_GCTHING(state->exception))
|
||||
if (state->throwing && state->exception.isGCThing())
|
||||
AddValueRoot(cx, &state->exception, "JSExceptionState.exception");
|
||||
}
|
||||
return state;
|
||||
@ -6009,7 +6009,7 @@ JS_DropExceptionState(JSContext *cx, JSExceptionState *state)
|
||||
AssertHeapIsIdle(cx);
|
||||
CHECK_REQUEST(cx);
|
||||
if (state) {
|
||||
if (state->throwing && JSVAL_IS_GCTHING(state->exception)) {
|
||||
if (state->throwing && state->exception.isGCThing()) {
|
||||
assertSameCompartment(cx, state->exception);
|
||||
RemoveRoot(cx->runtime(), &state->exception);
|
||||
}
|
||||
|
@ -844,7 +844,7 @@ INTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);
|
||||
static MOZ_ALWAYS_INLINE bool
|
||||
JSVAL_IS_UNIVERSAL(jsval v)
|
||||
{
|
||||
return !JSVAL_IS_GCTHING(v);
|
||||
return !v.isGCThing();
|
||||
}
|
||||
|
||||
namespace JS {
|
||||
|
@ -117,7 +117,7 @@ public:
|
||||
|
||||
nsAutoJSValHolder &operator=(JS::Value aOther) {
|
||||
#ifdef DEBUG
|
||||
if (JSVAL_IS_GCTHING(aOther) && !aOther.isNull()) {
|
||||
if (aOther.isGCThing() && !aOther.isNull()) {
|
||||
MOZ_ASSERT(IsHeld(), "Not rooted!");
|
||||
}
|
||||
#endif
|
||||
|
@ -56,7 +56,7 @@ XPCTraceableVariant::~XPCTraceableVariant()
|
||||
{
|
||||
jsval val = GetJSValPreserveColor();
|
||||
|
||||
MOZ_ASSERT(JSVAL_IS_GCTHING(val), "Must be traceable or unlinked");
|
||||
MOZ_ASSERT(val.isGCThing(), "Must be traceable or unlinked");
|
||||
|
||||
// If val is JSVAL_STRING, we don't need to clean anything up; simply
|
||||
// removing the string from the root set is good.
|
||||
|
Loading…
Reference in New Issue
Block a user