icecat: add release icecat-140.10.1-1gnu1 for ecne
This commit is contained in:
parent
a5f93cb214
commit
ff85d7c623
1256 changed files with 63469 additions and 24141 deletions
|
|
@ -167,6 +167,7 @@
|
|||
|
||||
#include <utility>
|
||||
|
||||
#include "js/friend/CycleCollector.h"
|
||||
#include "js/SliceBudget.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Likely.h"
|
||||
|
|
@ -1257,6 +1258,12 @@ class nsCycleCollector : public nsIMemoryReporter {
|
|||
// returns whether anything was collected
|
||||
bool CollectWhite();
|
||||
|
||||
void ClearWhiteJSWeakRefTargets();
|
||||
|
||||
public:
|
||||
bool IsGCThingWhiteInCCGraph(JS::GCCellPtr aPtr);
|
||||
|
||||
private:
|
||||
void CleanupAfterCollection();
|
||||
};
|
||||
|
||||
|
|
@ -3223,6 +3230,8 @@ bool nsCycleCollector::CollectWhite() {
|
|||
// - Unlink(whites), which drops outgoing links on each white.
|
||||
// - Unroot(whites), which returns the whites to normal GC.
|
||||
|
||||
ClearWhiteJSWeakRefTargets();
|
||||
|
||||
// Segments are 4 KiB on 32-bit and 8 KiB on 64-bit.
|
||||
static const size_t kSegmentSize = sizeof(void*) * 1024;
|
||||
SegmentedVector<PtrInfo*, kSegmentSize, InfallibleAllocPolicy> whiteNodes(
|
||||
|
|
@ -3314,6 +3323,31 @@ bool nsCycleCollector::CollectWhite() {
|
|||
return numWhiteNodes > 0 || numWhiteGCed > 0 || numWhiteJSZones > 0;
|
||||
}
|
||||
|
||||
static bool IsGCThingWhiteInCCGraph(JS::GCCellPtr aPtr, void* aData) {
|
||||
auto* cc = static_cast<nsCycleCollector*>(aData);
|
||||
return cc->IsGCThingWhiteInCCGraph(aPtr);
|
||||
}
|
||||
|
||||
bool nsCycleCollector::IsGCThingWhiteInCCGraph(JS::GCCellPtr aPtr) {
|
||||
PtrInfo* pinfo = mGraph.FindNode(aPtr.asCell());
|
||||
if (!pinfo) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(pinfo->mParticipant);
|
||||
bool isWhite = pinfo->mColor == white;
|
||||
|
||||
MOZ_ASSERT_IF(isWhite, pinfo->IsGrayJS());
|
||||
return isWhite;
|
||||
}
|
||||
|
||||
void nsCycleCollector::ClearWhiteJSWeakRefTargets() {
|
||||
// Clear the targets of JS WeakRef objects whose target is part of a cycle
|
||||
// that we're about to unlink.
|
||||
JSRuntime* runtime = Runtime()->Runtime();
|
||||
JS::MaybeClearWeakRefTargets(runtime, &::IsGCThingWhiteInCCGraph, this);
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
// Memory reporting
|
||||
////////////////////////
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue