зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1105069 - Part 5: Convert MarkGCThingAsLive to GCCellPtr; r=jonco
--HG-- extra : rebase_source : 19fc003cc5c9796963b8bf54213556e1310ab240
This commit is contained in:
Родитель
0adfbe6015
Коммит
806266015e
|
@ -499,6 +499,21 @@ ExposeGCThingToActiveJS(JS::GCCellPtr thing)
|
|||
JS::UnmarkGrayGCThingRecursively(thing, thing.kind());
|
||||
}
|
||||
|
||||
static MOZ_ALWAYS_INLINE void
|
||||
MarkGCThingAsLive(JSRuntime *aRt, JS::GCCellPtr thing)
|
||||
{
|
||||
JS::shadow::Runtime *rt = JS::shadow::Runtime::asShadowRuntime(aRt);
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
/*
|
||||
* Any object in the nursery will not be freed during any GC running at that time.
|
||||
*/
|
||||
if (IsInsideNursery(thing))
|
||||
return;
|
||||
#endif
|
||||
if (IsIncrementalBarrierNeededOnTenuredGCThing(rt, thing))
|
||||
JS::IncrementalReferenceBarrier(thing, thing.kind());
|
||||
}
|
||||
|
||||
} /* namespace gc */
|
||||
} /* namespace js */
|
||||
|
||||
|
@ -523,28 +538,13 @@ ExposeScriptToActiveJS(JSScript *script)
|
|||
}
|
||||
|
||||
/*
|
||||
* If a GC is currently marking, mark the object black.
|
||||
* If a GC is currently marking, mark the string black.
|
||||
*/
|
||||
static MOZ_ALWAYS_INLINE void
|
||||
MarkGCThingAsLive(JSRuntime *rt_, void *thing, JSGCTraceKind kind)
|
||||
{
|
||||
shadow::Runtime *rt = shadow::Runtime::asShadowRuntime(rt_);
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
/*
|
||||
* Any object in the nursery will not be freed during any GC running at that time.
|
||||
*/
|
||||
if (js::gc::IsInsideNursery((js::gc::Cell *)thing))
|
||||
return;
|
||||
#endif
|
||||
if (js::gc::IsIncrementalBarrierNeededOnTenuredGCThing(rt, GCCellPtr(thing, kind)))
|
||||
IncrementalReferenceBarrier(thing, kind);
|
||||
}
|
||||
|
||||
static MOZ_ALWAYS_INLINE void
|
||||
MarkStringAsLive(Zone *zone, JSString *string)
|
||||
{
|
||||
JSRuntime *rt = JS::shadow::Zone::asShadowZone(zone)->runtimeFromMainThread();
|
||||
MarkGCThingAsLive(rt, string, JSTRACE_STRING);
|
||||
js::gc::MarkGCThingAsLive(rt, GCCellPtr(string));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче