mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 951722 - Add asserts that hash table postbarriers are working for debug scopes r=terrence
This commit is contained in:
parent
7447361f80
commit
66d25c1b3e
@ -290,6 +290,13 @@ StoreBuffer::mark(JSTracer *trc)
|
||||
bufferRelocVal.mark(this, trc);
|
||||
bufferRelocCell.mark(this, trc);
|
||||
bufferGeneric.mark(this, trc);
|
||||
|
||||
#if defined(DEBUG)
|
||||
for (CompartmentsIter c(runtime_, SkipAtoms); !c.done(); c.next()) {
|
||||
if (c->debugScopes)
|
||||
c->debugScopes->checkHashTablesAfterMovingGC(runtime_);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1693,6 +1693,33 @@ DebugScopes::sweep(JSRuntime *rt)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(DEBUG) && defined(JSGC_GENERATIONAL)
|
||||
void
|
||||
DebugScopes::checkHashTablesAfterMovingGC(JSRuntime *runtime)
|
||||
{
|
||||
/*
|
||||
* This is called at the end of StoreBuffer::mark() to check that our
|
||||
* postbarriers have worked and that no hashtable keys (or values) are left
|
||||
* pointing into the nursery.
|
||||
*/
|
||||
JS::shadow::Runtime *rt = JS::shadow::Runtime::asShadowRuntime(runtime);
|
||||
for (ObjectWeakMap::Range r = proxiedScopes.all(); !r.empty(); r.popFront()) {
|
||||
JS_ASSERT(!IsInsideNursery(rt, r.front().key().get()));
|
||||
JS_ASSERT(!IsInsideNursery(rt, r.front().value().get()));
|
||||
}
|
||||
for (MissingScopeMap::Range r = missingScopes.all(); !r.empty(); r.popFront()) {
|
||||
JS_ASSERT(!IsInsideNursery(rt, r.front().key().cur()));
|
||||
JS_ASSERT(!IsInsideNursery(rt, r.front().key().block()));
|
||||
JS_ASSERT(!IsInsideNursery(rt, r.front().value().get()));
|
||||
}
|
||||
for (LiveScopeMap::Range r = liveScopes.all(); !r.empty(); r.popFront()) {
|
||||
JS_ASSERT(!IsInsideNursery(rt, r.front().key()));
|
||||
JS_ASSERT(!IsInsideNursery(rt, r.front().value().cur_.get()));
|
||||
JS_ASSERT(!IsInsideNursery(rt, r.front().value().block_.get()));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Unfortunately, GetDebugScopeForFrame needs to work even outside debug mode
|
||||
* (in particular, JS_GetFrameScopeChain does not require debug mode). Since
|
||||
|
@ -618,6 +618,7 @@ class ScopeIterKey
|
||||
class ScopeIterVal
|
||||
{
|
||||
friend class ScopeIter;
|
||||
friend class DebugScopes;
|
||||
|
||||
AbstractFramePtr frame_;
|
||||
RelocatablePtr<JSObject> cur_;
|
||||
@ -746,6 +747,9 @@ class DebugScopes
|
||||
public:
|
||||
void mark(JSTracer *trc);
|
||||
void sweep(JSRuntime *rt);
|
||||
#if defined(DEBUG) && defined(JSGC_GENERATIONAL)
|
||||
void checkHashTablesAfterMovingGC(JSRuntime *rt);
|
||||
#endif
|
||||
|
||||
static DebugScopeObject *hasDebugScope(JSContext *cx, ScopeObject &scope);
|
||||
static bool addDebugScope(JSContext *cx, ScopeObject &scope, DebugScopeObject &debugScope);
|
||||
|
Loading…
Reference in New Issue
Block a user