mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
Bug 1270108 - IonMonkey: Only keep a certain amount of IonBuilder waiting to get linked alive, r=jandem
This commit is contained in:
parent
9c6551efdd
commit
8f9524759e
@ -465,7 +465,7 @@ jit::FinishOffThreadBuilder(JSContext* cx, IonBuilder* builder)
|
||||
|
||||
// If the builder is still in one of the helper thread list, then remove it.
|
||||
if (builder->isInList())
|
||||
builder->removeFrom(HelperThreadState().ionLazyLinkList());
|
||||
HelperThreadState().ionLazyLinkListRemove(builder);
|
||||
|
||||
// Clear the recompiling flag of the old ionScript, since we continue to
|
||||
// use the old ionScript if recompiling fails.
|
||||
@ -548,7 +548,7 @@ jit::LazyLink(JSContext* cx, HandleScript calleeScript)
|
||||
calleeScript->baselineScript()->removePendingIonBuilder(calleeScript);
|
||||
|
||||
// Remove from pending.
|
||||
builder->removeFrom(HelperThreadState().ionLazyLinkList());
|
||||
HelperThreadState().ionLazyLinkListRemove(builder);
|
||||
}
|
||||
|
||||
{
|
||||
@ -2019,7 +2019,15 @@ AttachFinishedCompilations(JSContext* cx)
|
||||
JSScript* script = builder->script();
|
||||
MOZ_ASSERT(script->hasBaselineScript());
|
||||
script->baselineScript()->setPendingIonBuilder(cx, script, builder);
|
||||
HelperThreadState().ionLazyLinkList().insertFront(builder);
|
||||
HelperThreadState().ionLazyLinkListAdd(builder);
|
||||
|
||||
// Don't keep more than 100 lazy link builders.
|
||||
// Throw away the oldest items.
|
||||
while (HelperThreadState().ionLazyLinkListSize() > 100) {
|
||||
jit::IonBuilder* builder = HelperThreadState().ionLazyLinkList().getLast();
|
||||
jit::FinishOffThreadBuilder(nullptr, builder);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ function foo(code)
|
||||
toString = c1;
|
||||
}
|
||||
let z;
|
||||
for (z = 1; z <= 1632; ++z) {
|
||||
for (z = 1; z <= 16322; ++z) {
|
||||
this.__defineGetter__('functional', function x(){ yield; } );
|
||||
foo("this.__defineSetter__('', function(){});");
|
||||
foo("for each (y in this);");
|
||||
|
@ -628,6 +628,7 @@ GlobalHelperThreadState::GlobalHelperThreadState()
|
||||
: cpuCount(0),
|
||||
threadCount(0),
|
||||
threads(nullptr),
|
||||
ionLazyLinkListSize_(0),
|
||||
wasmCompilationInProgress(false),
|
||||
numWasmFailedJobs(0),
|
||||
helperLock(nullptr),
|
||||
@ -657,6 +658,7 @@ GlobalHelperThreadState::finish()
|
||||
PR_DestroyLock(helperLock);
|
||||
|
||||
ionLazyLinkList_.clear();
|
||||
ionLazyLinkListSize_ = 0;
|
||||
}
|
||||
|
||||
void
|
||||
@ -731,6 +733,24 @@ GlobalHelperThreadState::notifyOne(CondVar which)
|
||||
PR_NotifyCondVar(whichWakeup(which));
|
||||
}
|
||||
|
||||
void
|
||||
GlobalHelperThreadState::ionLazyLinkListRemove(jit::IonBuilder* builder)
|
||||
{
|
||||
MOZ_ASSERT(ionLazyLinkListSize_ > 0);
|
||||
|
||||
builder->removeFrom(HelperThreadState().ionLazyLinkList());
|
||||
ionLazyLinkListSize_--;
|
||||
|
||||
MOZ_ASSERT(HelperThreadState().ionLazyLinkList().isEmpty() == (ionLazyLinkListSize_ == 0));
|
||||
}
|
||||
|
||||
void
|
||||
GlobalHelperThreadState::ionLazyLinkListAdd(jit::IonBuilder* builder)
|
||||
{
|
||||
HelperThreadState().ionLazyLinkList().insertFront(builder);
|
||||
ionLazyLinkListSize_++;
|
||||
}
|
||||
|
||||
bool
|
||||
GlobalHelperThreadState::hasActiveThreads()
|
||||
{
|
||||
|
@ -72,6 +72,7 @@ class GlobalHelperThreadState
|
||||
|
||||
// List of IonBuilders using lazy linking pending to get linked.
|
||||
IonBuilderList ionLazyLinkList_;
|
||||
size_t ionLazyLinkListSize_;
|
||||
|
||||
// wasm worklist and finished jobs.
|
||||
wasm::IonCompileTaskVector wasmWorklist_, wasmFinishedList_;
|
||||
@ -156,6 +157,11 @@ class GlobalHelperThreadState
|
||||
"Should only be mutated by the main thread.");
|
||||
return ionLazyLinkList_;
|
||||
}
|
||||
size_t ionLazyLinkListSize() {
|
||||
return ionLazyLinkListSize_;
|
||||
}
|
||||
void ionLazyLinkListRemove(jit::IonBuilder* builder);
|
||||
void ionLazyLinkListAdd(jit::IonBuilder* builder);
|
||||
|
||||
wasm::IonCompileTaskVector& wasmWorklist() {
|
||||
MOZ_ASSERT(isLocked());
|
||||
|
Loading…
Reference in New Issue
Block a user