Bug 684947 - Fix bogus compartment assertion caused by generators (r=luke)

This commit is contained in:
Bill McCloskey 2011-10-05 14:51:51 -07:00
Родитель e867c11bc8
Коммит 57e548a029
1 изменённых файлов: 19 добавлений и 1 удалений

Просмотреть файл

@ -888,8 +888,26 @@ MarkThreadDataConservatively(JSTracer *trc, ThreadData *td)
void
MarkStackRangeConservatively(JSTracer *trc, Value *beginv, Value *endv)
{
/*
* Normally, the drainMarkStack phase of marking will never trace outside
* of the compartment currently being collected. However, conservative
* scanning during drainMarkStack (as is done for generators) can break
* this invariant. So we disable the compartment assertions in this
* situation.
*/
struct AutoSkipChecking {
JSRuntime *runtime;
JSCompartment *savedCompartment;
AutoSkip(JSRuntime *rt)
: runtime(rt), savedCompartment(rt->gcCheckCompartment) {
rt->gcCheckCompartment = NULL;
}
~AutoSkip() { runtime->gcCheckCompartment = savedCompartment; }
} as(trc->context->runtime);
const jsuword *begin = beginv->payloadWord();
const jsuword *end = endv->payloadWord();;
const jsuword *end = endv->payloadWord();
#ifdef JS_NUNBOX32
/*
* With 64-bit jsvals on 32-bit systems, we can optimize a bit by