Bug 984537 - Keep JIT code around for compartments on the stack when triggering GC, r=jandem.

This commit is contained in:
Brian Hackett 2014-04-26 10:39:53 -06:00
Родитель 3b258ba0d5
Коммит 5bb9404b74
3 изменённых файлов: 16 добавлений и 0 удалений

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

@ -1221,6 +1221,14 @@ MarkJitActivations(JSRuntime *rt, JSTracer *trc)
MarkJitActivation(trc, activations);
}
JSCompartment *
TopmostJitActivationCompartment(JSRuntime *rt)
{
for (JitActivationIterator activations(rt); !activations.done(); ++activations)
return activations.activation()->compartment();
return nullptr;
}
#ifdef JSGC_GENERATIONAL
void
UpdateJitActivationsForMinorGC(JSRuntime *rt, JSTracer *trc)

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

@ -268,6 +268,9 @@ void EnsureExitFrame(IonCommonFrameLayout *frame);
void MarkJitActivations(JSRuntime *rt, JSTracer *trc);
void MarkIonCompilerRoots(JSTracer *trc);
JSCompartment *
TopmostJitActivationCompartment(JSRuntime *rt);
#ifdef JSGC_GENERATIONAL
void UpdateJitActivationsForMinorGC(JSRuntime *rt, JSTracer *trc);
#endif

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

@ -2770,6 +2770,11 @@ BeginMarkPhase(JSRuntime *rt)
c->zone()->setPreservingCode(true);
}
if (!rt->gcShouldCleanUpEverything) {
if (JSCompartment *comp = jit::TopmostJitActivationCompartment(rt))
comp->zone()->setPreservingCode(true);
}
/*
* Atoms are not in the cross-compartment map. So if there are any
* zones that are not being collected, we are not allowed to collect