Bug 869742 - Add post-barriers for writes to liveScopes; r=billm

--HG--
extra : rebase_source : 37596559db5d11f160f2c220a27effd575c9b508
This commit is contained in:
Terrence Cole 2013-05-08 12:02:49 -07:00
parent 4cdbb3efde
commit 58b5fc50ba

View File

@ -1723,6 +1723,7 @@ DebugScopes::addDebugScope(JSContext *cx, const ScopeIter &si, DebugScopeObject
js_ReportOutOfMemory(cx);
return false;
}
HashTableWriteBarrierPost(cx->runtime, &scopes->liveScopes, &debugScope.scope());
return true;
}
@ -1872,10 +1873,12 @@ DebugScopes::onGeneratorFrameChange(AbstractFramePtr from, AbstractFramePtr to,
*/
JS_ASSERT(toIter.scope().compartment() == cx->compartment);
LiveScopeMap::AddPtr livePtr = scopes->liveScopes.lookupForAdd(&toIter.scope());
if (livePtr)
if (livePtr) {
livePtr->value = to;
else
} else {
scopes->liveScopes.add(livePtr, &toIter.scope(), to); // OOM here?
HashTableWriteBarrierPost(cx->runtime, &scopes->liveScopes, &toIter.scope());
}
} else {
ScopeIter si(toIter, from, cx);
JS_ASSERT(si.frame().scopeChain()->compartment() == cx->compartment);
@ -1936,6 +1939,7 @@ DebugScopes::updateLiveScopes(JSContext *cx)
return false;
if (!scopes->liveScopes.put(&si.scope(), frame))
return false;
HashTableWriteBarrierPost(cx->runtime, &scopes->liveScopes, &si.scope());
}
}