From 36e441912ecf92ea9523ffad6e95e93dd0e923b6 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Tue, 20 May 2014 22:52:18 -0700 Subject: [PATCH] Bug 997440 - Push some more cxes in jsd. r=bz --- js/jsd/jsd_stak.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/js/jsd/jsd_stak.cpp b/js/jsd/jsd_stak.cpp index 585644ac66a..d07394fe453 100644 --- a/js/jsd/jsd_stak.cpp +++ b/js/jsd/jsd_stak.cpp @@ -270,7 +270,8 @@ jsd_GetCallObjectForStackFrame(JSDContext* jsdc, if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) ) { - obj = jsdframe->frame.callObject(jsdthreadstate->context); + AutoPushJSContext cx(jsdthreadstate->context); + obj = jsdframe->frame.callObject(cx); if(obj) jsdval = JSD_NewValue(jsdc, OBJECT_TO_JSVAL(obj)); } @@ -292,9 +293,8 @@ jsd_GetScopeChainForStackFrame(JSDContext* jsdc, if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) ) { - JS_BeginRequest(jsdthreadstate->context); - obj = jsdframe->frame.scopeChain(jsdthreadstate->context); - JS_EndRequest(jsdthreadstate->context); + AutoPushJSContext cx(jsdthreadstate->context); + obj = jsdframe->frame.scopeChain(cx); if(obj) jsdval = JSD_NewValue(jsdc, OBJECT_TO_JSVAL(obj)); } @@ -316,9 +316,8 @@ jsd_GetThisForStackFrame(JSDContext* jsdc, { bool ok; JS::RootedValue thisval(jsdthreadstate->context); - JS_BeginRequest(jsdthreadstate->context); - ok = jsdframe->frame.getThisValue(jsdthreadstate->context, &thisval); - JS_EndRequest(jsdthreadstate->context); + AutoPushJSContext cx(jsdthreadstate->context); + ok = jsdframe->frame.getThisValue(cx, &thisval); if(ok) jsdval = JSD_NewValue(jsdc, thisval); } @@ -473,7 +472,6 @@ jsd_ValToStringInStackFrame(JSDContext* jsdc, bool valid; JSString* retval; JSExceptionState* exceptionState; - JSContext* cx; JSD_LOCK_THREADSTATES(jsdc); valid = jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe); @@ -482,8 +480,7 @@ jsd_ValToStringInStackFrame(JSDContext* jsdc, if( ! valid ) return nullptr; - cx = jsdthreadstate->context; - MOZ_ASSERT(cx); + AutoPushJSContext cx(jsdthreadstate->context); JS::RootedValue v(cx, val); exceptionState = JS_SaveExceptionState(cx);