зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1301496 - Simplify runtime check when tracing helper threads r=terrence a=decoder
This commit is contained in:
Родитель
65d765221c
Коммит
1295093170
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче