mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 19:47:32 +09:00
Issue #2083 - Part 1: Make RegExpShared a GC thing.
Based on Mozilla bug 1345177. Changes from the original bug's patch: - We don't have JS::CurrentThreadIsHeapCollecting, so let's use trc->runtime()->isHeapCollecting() instead. - Mozilla bug 1337117 renamed runtimeFromMainThread to runtimeFromActiveCooperatingThread for Firefox 54, so let's use the former
This commit is contained in:
parent
8bf892d728
commit
3796c7c1e1
29 changed files with 384 additions and 412 deletions
|
|
@ -436,6 +436,14 @@ js::TraceNullableEdge(JSTracer* trc, WriteBarrieredBase<T>* thingp, const char*
|
|||
DispatchToTracer(trc, ConvertToBase(thingp->unsafeUnbarrieredForTracing()), name);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
js::TraceNullableEdge(JSTracer* trc, ReadBarriered<T>* thingp, const char* name)
|
||||
{
|
||||
if (InternalBarrierMethods<T>::isMarkable(thingp->unbarrieredGet()))
|
||||
DispatchToTracer(trc, ConvertToBase(thingp->unsafeGet()), name);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
JS_PUBLIC_API(void)
|
||||
JS::TraceEdge(JSTracer* trc, JS::Heap<T>* thingp, const char* name)
|
||||
|
|
@ -550,6 +558,7 @@ js::TraceRootRange(JSTracer* trc, size_t len, T* vec, const char* name)
|
|||
template void js::TraceEdge<type>(JSTracer*, WriteBarrieredBase<type>*, const char*); \
|
||||
template void js::TraceEdge<type>(JSTracer*, ReadBarriered<type>*, const char*); \
|
||||
template void js::TraceNullableEdge<type>(JSTracer*, WriteBarrieredBase<type>*, const char*); \
|
||||
template void js::TraceNullableEdge<type>(JSTracer*, ReadBarriered<type>*, const char*); \
|
||||
template void js::TraceManuallyBarrieredEdge<type>(JSTracer*, type*, const char*); \
|
||||
template void js::TraceWeakEdge<type>(JSTracer*, WeakRef<type>*, const char*); \
|
||||
template void js::TraceRoot<type>(JSTracer*, type*, const char*); \
|
||||
|
|
@ -866,6 +875,7 @@ js::GCMarker::markAndTraceChildren(T* thing)
|
|||
namespace js {
|
||||
template <> void GCMarker::traverse(BaseShape* thing) { markAndTraceChildren(thing); }
|
||||
template <> void GCMarker::traverse(JS::Symbol* thing) { markAndTraceChildren(thing); }
|
||||
template <> void GCMarker::traverse(RegExpShared* thing) { markAndTraceChildren(thing); }
|
||||
} // namespace js
|
||||
|
||||
// Strings, LazyScripts, Shapes, and Scopes are extremely common, but have
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue