Bug 1301496 - Simplify runtime check when tracing helper threads r=terrence a=decoder

This commit is contained in:
Jon Coppeard 2016-09-22 13:02:40 +01:00
Родитель 65d765221c
Коммит 1295093170
7 изменённых файлов: 22 добавлений и 3 удалений

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

@ -0,0 +1,7 @@
if (helperThreadCount() == 0)
quit();
startgc(1, 'shrinking');
offThreadCompileScript("");
// Adapted from randomly chosen test: js/src/jit-test/tests/parser/bug-1263355-13.js
gczeal(9);
newGlobal();

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

@ -188,6 +188,12 @@ CompileRuntime::setMinorGCShouldCancelIonCompilations()
runtime()->gc.storeBuffer.setShouldCancelIonCompilations();
}
bool
CompileRuntime::runtimeMatches(JSRuntime* rt)
{
return rt == runtime();
}
Zone*
CompileZone::zone()
{

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

@ -86,6 +86,8 @@ class CompileRuntime
const Nursery& gcNursery();
void setMinorGCShouldCancelIonCompilations();
bool runtimeMatches(JSRuntime* rt);
};
class CompileZone

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

@ -14622,7 +14622,7 @@ IonBuilder::convertToBoolean(MDefinition* input)
void
IonBuilder::trace(JSTracer* trc)
{
if (script_->zoneFromAnyThread()->runtimeFromAnyThread() != trc->runtime())
if (!compartment->runtime()->runtimeMatches(trc->runtime()))
return;
TraceManuallyBarrieredEdge(trc, &script_, "IonBuiler::script_");

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

@ -162,6 +162,10 @@ class ExclusiveContext : public ContextFriendFields,
return options_;
}
bool runtimeMatches(JSRuntime* rt) const {
return runtime_ == rt;
}
protected:
js::gc::ArenaLists* arenas_;

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

@ -345,7 +345,7 @@ ParseTask::~ParseTask()
void
ParseTask::trace(JSTracer* trc)
{
if (exclusiveContextGlobal->zoneFromAnyThread()->runtimeFromAnyThread() != trc->runtime())
if (!cx->runtimeMatches(trc->runtime()))
return;
TraceManuallyBarrieredEdge(trc, &exclusiveContextGlobal, "ParseTask::exclusiveContextGlobal");

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

@ -568,7 +568,7 @@ struct ParseTask
bool finish(JSContext* cx);
bool runtimeMatches(JSRuntime* rt) {
return exclusiveContextGlobal->runtimeFromAnyThread() == rt;
return cx->runtimeMatches(rt);
}
virtual ~ParseTask();