зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 61f6c63bcb3d (bug 928056) for m-oth failures.
This commit is contained in:
Родитель
b1ecf84f9d
Коммит
5b4766e2b7
|
@ -20,8 +20,7 @@ MarkRuntime(JSTracer *trc, bool useSavedRoots = false);
|
|||
void
|
||||
BufferGrayRoots(GCMarker *gcmarker);
|
||||
|
||||
class AutoCopyFreeListToArenas
|
||||
{
|
||||
class AutoCopyFreeListToArenas {
|
||||
JSRuntime *runtime;
|
||||
|
||||
public:
|
||||
|
@ -38,8 +37,7 @@ struct AutoFinishGC
|
|||
* This class should be used by any code that needs to exclusive access to the
|
||||
* heap in order to trace through it...
|
||||
*/
|
||||
class AutoTraceSession
|
||||
{
|
||||
class AutoTraceSession {
|
||||
public:
|
||||
AutoTraceSession(JSRuntime *rt, HeapState state = Tracing);
|
||||
~AutoTraceSession();
|
||||
|
@ -52,12 +50,12 @@ class AutoTraceSession
|
|||
void operator=(const AutoTraceSession&) MOZ_DELETE;
|
||||
|
||||
js::HeapState prevState;
|
||||
AutoPauseWorkersForGC pause;
|
||||
};
|
||||
|
||||
struct AutoPrepareForTracing
|
||||
{
|
||||
AutoFinishGC finish;
|
||||
AutoPauseWorkersForTracing pause;
|
||||
AutoTraceSession session;
|
||||
AutoCopyFreeListToArenas copy;
|
||||
|
||||
|
|
|
@ -104,7 +104,6 @@ JS_IterateCompartments(JSRuntime *rt, void *data,
|
|||
{
|
||||
JS_ASSERT(!rt->isHeapBusy());
|
||||
|
||||
AutoPauseWorkersForTracing pause(rt);
|
||||
AutoTraceSession session(rt);
|
||||
|
||||
for (CompartmentsIter c(rt); !c.done(); c.next())
|
||||
|
|
|
@ -4076,10 +4076,7 @@ EndSweepPhase(JSRuntime *rt, JSGCInvocationKind gckind, bool lastGC)
|
|||
namespace {
|
||||
|
||||
/* ...while this class is to be used only for garbage collection. */
|
||||
class AutoGCSession : AutoTraceSession
|
||||
{
|
||||
AutoPauseWorkersForTracing pause;
|
||||
|
||||
class AutoGCSession : AutoTraceSession {
|
||||
public:
|
||||
explicit AutoGCSession(JSRuntime *rt);
|
||||
~AutoGCSession();
|
||||
|
@ -4090,7 +4087,8 @@ class AutoGCSession : AutoTraceSession
|
|||
/* Start a new heap session. */
|
||||
AutoTraceSession::AutoTraceSession(JSRuntime *rt, js::HeapState heapState)
|
||||
: runtime(rt),
|
||||
prevState(rt->heapState)
|
||||
prevState(rt->heapState),
|
||||
pause(rt)
|
||||
{
|
||||
JS_ASSERT(!rt->noGCOrAllocationCheck);
|
||||
JS_ASSERT(!rt->isHeapBusy());
|
||||
|
@ -4105,8 +4103,7 @@ AutoTraceSession::~AutoTraceSession()
|
|||
}
|
||||
|
||||
AutoGCSession::AutoGCSession(JSRuntime *rt)
|
||||
: AutoTraceSession(rt, MajorCollecting),
|
||||
pause(rt)
|
||||
: AutoTraceSession(rt, MajorCollecting)
|
||||
{
|
||||
runtime->gcIsNeeded = false;
|
||||
runtime->gcInterFrameGC = true;
|
||||
|
@ -4791,7 +4788,6 @@ AutoFinishGC::AutoFinishGC(JSRuntime *rt)
|
|||
|
||||
AutoPrepareForTracing::AutoPrepareForTracing(JSRuntime *rt)
|
||||
: finish(rt),
|
||||
pause(rt),
|
||||
session(rt),
|
||||
copy(rt)
|
||||
{
|
||||
|
|
|
@ -927,8 +927,7 @@ WorkerThread::threadLoop()
|
|||
}
|
||||
}
|
||||
|
||||
AutoPauseWorkersForTracing::AutoPauseWorkersForTracing(JSRuntime *rt
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
|
||||
AutoPauseWorkersForGC::AutoPauseWorkersForGC(JSRuntime *rt MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
|
||||
: runtime(rt), needsUnpause(false), oldExclusiveThreadsPaused(rt->exclusiveThreadsPaused)
|
||||
{
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
|
@ -946,7 +945,7 @@ AutoPauseWorkersForTracing::AutoPauseWorkersForTracing(JSRuntime *rt
|
|||
|
||||
AutoLockWorkerThreadState lock(state);
|
||||
|
||||
// Tolerate reentrant use of AutoPauseWorkersForTracing.
|
||||
// Tolerate reentrant use of AutoPauseWorkersForGC.
|
||||
if (state.shouldPause) {
|
||||
JS_ASSERT(state.numPaused == state.numThreads);
|
||||
return;
|
||||
|
@ -962,7 +961,7 @@ AutoPauseWorkersForTracing::AutoPauseWorkersForTracing(JSRuntime *rt
|
|||
}
|
||||
}
|
||||
|
||||
AutoPauseWorkersForTracing::~AutoPauseWorkersForTracing()
|
||||
AutoPauseWorkersForGC::~AutoPauseWorkersForGC()
|
||||
{
|
||||
runtime->exclusiveThreadsPaused = oldExclusiveThreadsPaused;
|
||||
|
||||
|
@ -987,7 +986,7 @@ AutoPauseCurrentWorkerThread::AutoPauseCurrentWorkerThread(ExclusiveContext *cx
|
|||
// If the current thread is a worker thread, treat it as paused while
|
||||
// the caller is waiting for another worker thread to complete. Otherwise
|
||||
// we will not wake up and mark this as paused due to the loop in
|
||||
// AutoPauseWorkersForTracing.
|
||||
// AutoPauseWorkersForGC.
|
||||
if (cx->workerThread()) {
|
||||
WorkerThreadState &state = *cx->workerThreadState();
|
||||
JS_ASSERT(state.isLocked());
|
||||
|
@ -1087,13 +1086,12 @@ ScriptSource::getOffThreadCompressionChars(ExclusiveContext *cx)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
AutoPauseWorkersForTracing::AutoPauseWorkersForTracing(JSRuntime *rt
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
|
||||
AutoPauseWorkersForGC::AutoPauseWorkersForGC(JSRuntime *rt MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
|
||||
{
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
}
|
||||
|
||||
AutoPauseWorkersForTracing::~AutoPauseWorkersForTracing()
|
||||
AutoPauseWorkersForGC::~AutoPauseWorkersForGC()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -328,7 +328,7 @@ WorkerThread::maybePause()
|
|||
#endif // JS_WORKER_THREADS
|
||||
|
||||
/* Pause any threads that are running jobs off thread during GC activity. */
|
||||
class AutoPauseWorkersForTracing
|
||||
class AutoPauseWorkersForGC
|
||||
{
|
||||
#ifdef JS_WORKER_THREADS
|
||||
JSRuntime *runtime;
|
||||
|
@ -338,8 +338,8 @@ class AutoPauseWorkersForTracing
|
|||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
|
||||
public:
|
||||
AutoPauseWorkersForTracing(JSRuntime *rt MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
|
||||
~AutoPauseWorkersForTracing();
|
||||
AutoPauseWorkersForGC(JSRuntime *rt MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
|
||||
~AutoPauseWorkersForGC();
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -675,7 +675,7 @@ class MarkingValidator;
|
|||
typedef Vector<JS::Zone *, 4, SystemAllocPolicy> ZoneVector;
|
||||
|
||||
class AutoLockForExclusiveAccess;
|
||||
class AutoPauseWorkersForTracing;
|
||||
class AutoPauseWorkersForGC;
|
||||
class ThreadDataIter;
|
||||
|
||||
void RecomputeStackLimit(JSRuntime *rt, StackKind kind);
|
||||
|
@ -789,7 +789,7 @@ struct JSRuntime : public JS::shadow::Runtime,
|
|||
size_t numExclusiveThreads;
|
||||
|
||||
friend class js::AutoLockForExclusiveAccess;
|
||||
friend class js::AutoPauseWorkersForTracing;
|
||||
friend class js::AutoPauseWorkersForGC;
|
||||
friend class js::ThreadDataIter;
|
||||
|
||||
public:
|
||||
|
|
Загрузка…
Ссылка в новой задаче