mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
Issue #2148 - Don't null out RegExpObject -> RegExpShared pointer on GC.
Follow-up for issue #2083. Taken from Mozilla bug 1378736.
This commit is contained in:
parent
3d2a4f4066
commit
ad8d9639a4
2 changed files with 3 additions and 8 deletions
|
|
@ -187,11 +187,6 @@ IsMarkingTrace(JSTracer* trc)
|
|||
void
|
||||
RegExpObject::trace(JSTracer* trc)
|
||||
{
|
||||
// When marking the object normally we have the option of unlinking the
|
||||
// object from its RegExpShared so that the RegExpShared may be collected.
|
||||
if (IsMarkingTrace(trc) && !zone()->isPreservingCode())
|
||||
sharedRef() = nullptr;
|
||||
|
||||
TraceNullableEdge(trc, &sharedRef(), "RegExpObject shared");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -464,7 +464,7 @@ class RegExpObject : public NativeObject
|
|||
|
||||
void setShared(RegExpShared& shared) {
|
||||
MOZ_ASSERT(!hasShared());
|
||||
sharedRef() = &shared;
|
||||
sharedRef().init(&shared);
|
||||
}
|
||||
|
||||
static void trace(JSTracer* trc, JSObject* obj);
|
||||
|
|
@ -490,9 +490,9 @@ class RegExpObject : public NativeObject
|
|||
static MOZ_MUST_USE bool createShared(JSContext* cx, Handle<RegExpObject*> regexp,
|
||||
MutableHandleRegExpShared shared);
|
||||
|
||||
ReadBarriered<RegExpShared*>& sharedRef() {
|
||||
PreBarriered<RegExpShared*>& sharedRef() {
|
||||
auto& ref = NativeObject::privateRef(PRIVATE_SLOT);
|
||||
return reinterpret_cast<ReadBarriered<RegExpShared*>&>(ref);
|
||||
return reinterpret_cast<PreBarriered<RegExpShared*>&>(ref);
|
||||
}
|
||||
|
||||
/* Call setShared in preference to setPrivate. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue