From 02d634159d52387d4a988ae357959fb3c9da5070 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Thu, 24 May 2018 09:40:46 +0100 Subject: [PATCH] Bug 1463723 - Remove ubi::Census' pointer to the atoms zone r=fitzgen --- js/public/UbiNodeCensus.h | 3 +-- js/src/vm/UbiNodeCensus.cpp | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/js/public/UbiNodeCensus.h b/js/public/UbiNodeCensus.h index 8c79908864b4..dcc6d376d044 100644 --- a/js/public/UbiNodeCensus.h +++ b/js/public/UbiNodeCensus.h @@ -199,9 +199,8 @@ struct Census { // is an element of the set. If the targetZones set is empty, then nodes in // all zones are considered. JS::ZoneSet targetZones; - Zone* atomsZone; - explicit Census(JSContext* cx) : cx(cx), atomsZone(nullptr) { } + explicit Census(JSContext* cx) : cx(cx) { } MOZ_MUST_USE JS_PUBLIC_API(bool) init(); }; diff --git a/js/src/vm/UbiNodeCensus.cpp b/js/src/vm/UbiNodeCensus.cpp index 2e71968db911..52e91dc00580 100644 --- a/js/src/vm/UbiNodeCensus.cpp +++ b/js/src/vm/UbiNodeCensus.cpp @@ -32,8 +32,6 @@ CountDeleter::operator()(CountBase* ptr) JS_PUBLIC_API(bool) Census::init() { - AutoLockForExclusiveAccess lock(cx); - atomsZone = cx->runtime()->atomsRealm(lock)->zone(); return targetZones.init(); } @@ -942,7 +940,7 @@ CensusHandler::operator() (BreadthFirst& traversal, if (census.targetZones.count() == 0 || census.targetZones.has(zone)) return rootCount->count(mallocSizeOf, referent); - if (zone == census.atomsZone) { + if (zone->isAtomsZone()) { traversal.abandonReferent(); return rootCount->count(mallocSizeOf, referent); }