Backed out changeset 181a123cd227 (bug 1629022) by jonco's request CLOSED TREE

This commit is contained in:
Bogdan Tara 2020-04-14 16:36:47 +03:00
Родитель 93fa5f1ac1
Коммит 2d4b72dc82
1 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -1181,25 +1181,26 @@ static inline void CheckHolderIsSingleZone(
aParticipant->Trace(aHolder, tracer, nullptr);
}
#endif
static inline bool ShouldCheckSingleZoneHolders() {
#if defined(DEBUG)
# ifdef DEBUG
return true;
#elif defined(NIGHTLY_BUILD) || defined(MOZ_DEV_EDITION)
# else
// Don't check every time to avoid performance impact.
return rand() % 256 == 0;
#else
return false;
# endif
}
#endif
void CycleCollectedJSRuntime::TraceNativeGrayRoots(JSTracer* aTracer) {
// NB: This is here just to preserve the existing XPConnect order. I doubt it
// would hurt to do this after the JS holders.
TraceAdditionalNativeGrayRoots(aTracer);
#ifdef CHECK_SINGLE_ZONE_JS_HOLDERS
bool checkSingleZoneHolders = ShouldCheckSingleZoneHolders();
#endif
mJSHolders.ForEach([aTracer, checkSingleZoneHolders](
void* holder, nsScriptObjectTracer* tracer) {
#ifdef CHECK_SINGLE_ZONE_JS_HOLDERS