Bug 1120476 (part 4) - Remove PLDHashTableOps::finalize. r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 13 Jan 2015 19:02:35 -0800
changeset 251048 3675f746dc9443e31a7387c09e32cb0685609645
parent 251047 18a73b98c0ebac504fd48febc0943f05f530f85a
child 251049 758afec77c95285c5cd4256079c6be171b375483
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1120476
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1120476 (part 4) - Remove PLDHashTableOps::finalize. r=froydnj.
dom/base/nsContentList.cpp
dom/base/nsContentUtils.cpp
dom/base/nsDocument.cpp
dom/base/nsScriptNameSpaceManager.cpp
dom/xul/XULDocument.cpp
embedding/components/commandhandler/nsCommandParams.cpp
gfx/thebes/gfxFT2FontList.cpp
js/xpconnect/src/XPCMaps.cpp
layout/base/nsFrameManager.cpp
layout/style/nsCSSRuleProcessor.cpp
layout/style/nsHTMLStyleSheet.cpp
layout/style/nsRuleNode.cpp
layout/tables/SpanningCellSorter.cpp
modules/libpref/prefapi.cpp
netwerk/base/src/nsLoadGroup.cpp
netwerk/cache/nsCacheEntry.cpp
netwerk/cache/nsDiskCacheBinding.cpp
netwerk/dns/nsHostResolver.cpp
netwerk/protocol/http/nsHttp.cpp
parser/htmlparser/nsHTMLEntities.cpp
rdf/base/nsRDFService.cpp
security/manager/boot/src/nsSecureBrowserUIImpl.cpp
security/manager/ssl/src/nsCertTree.cpp
security/manager/ssl/src/nsNSSShutDown.cpp
uriloader/base/nsDocLoader.cpp
xpcom/base/nsCycleCollector.cpp
xpcom/ds/nsAtomTable.cpp
xpcom/ds/nsPersistentProperties.cpp
xpcom/ds/nsStaticNameTable.cpp
xpcom/glue/nsTHashtable.h
xpcom/glue/pldhash.cpp
xpcom/glue/pldhash.h
xpcom/tests/TestPLDHash.cpp
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -208,18 +208,17 @@ NS_GetContentList(nsINode* aRootNode,
 
   static const PLDHashTableOps hash_table_ops =
   {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     ContentListHashtableHashKey,
     ContentListHashtableMatchEntry,
     PL_DHashMoveEntryStub,
-    PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub
+    PL_DHashClearEntryStub
   };
 
   // Initialize the hashtable if needed.
   if (!gContentListHashTable.ops) {
     PL_DHashTableInit(&gContentListHashTable, &hash_table_ops,
                       sizeof(ContentListHashEntry));
   }
 
@@ -321,18 +320,17 @@ GetFuncStringContentList(nsINode* aRootN
 
   static const PLDHashTableOps hash_table_ops =
   {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     FuncStringContentListHashtableHashKey,
     FuncStringContentListHashtableMatchEntry,
     PL_DHashMoveEntryStub,
-    PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub
+    PL_DHashClearEntryStub
   };
 
   // Initialize the hashtable if needed.
   if (!gFuncStringContentListHashTable.ops) {
     PL_DHashTableInit(&gFuncStringContentListHashTable, &hash_table_ops,
                       sizeof(FuncStringContentListHashEntry));
   }
 
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -480,17 +480,16 @@ nsContentUtils::Init()
     static const PLDHashTableOps hash_table_ops =
     {
       PL_DHashAllocTable,
       PL_DHashFreeTable,
       PL_DHashVoidPtrKeyStub,
       PL_DHashMatchEntryStub,
       PL_DHashMoveEntryStub,
       EventListenerManagerHashClearEntry,
-      PL_DHashFinalizeStub,
       EventListenerManagerHashInitEntry
     };
 
     PL_DHashTableInit(&sEventListenerManagersHash, &hash_table_ops,
                       sizeof(EventListenerManagerMapEntry));
 
     RegisterStrongMemoryReporter(new DOMEventListenerManagersHashReporter());
   }
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3973,17 +3973,16 @@ nsDocument::SetSubDocumentFor(Element* a
       static const PLDHashTableOps hash_table_ops =
       {
         PL_DHashAllocTable,
         PL_DHashFreeTable,
         PL_DHashVoidPtrKeyStub,
         PL_DHashMatchEntryStub,
         PL_DHashMoveEntryStub,
         SubDocClearEntry,
-        PL_DHashFinalizeStub,
         SubDocInitEntry
       };
 
       mSubDocuments = PL_NewDHashTable(&hash_table_ops, sizeof(SubDocMapEntry));
       if (!mSubDocuments) {
         return NS_ERROR_OUT_OF_MEMORY;
       }
     }
--- a/dom/base/nsScriptNameSpaceManager.cpp
+++ b/dom/base/nsScriptNameSpaceManager.cpp
@@ -321,17 +321,16 @@ nsScriptNameSpaceManager::Init()
   static const PLDHashTableOps hash_table_ops =
   {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     GlobalNameHashHashKey,
     GlobalNameHashMatchEntry,
     PL_DHashMoveEntryStub,
     GlobalNameHashClearEntry,
-    PL_DHashFinalizeStub,
     GlobalNameHashInitEntry
   };
 
   mIsInitialized = PL_DHashTableInit(&mGlobalNames, &hash_table_ops,
                                      sizeof(GlobalNameMapEntry),
                                      fallible_t(),
                                      GLOBALNAME_HASHTABLE_INITIAL_LENGTH);
   NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_OUT_OF_MEMORY);
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -761,17 +761,16 @@ XULDocument::AddBroadcastListenerFor(Ele
 
     static const PLDHashTableOps gOps = {
         PL_DHashAllocTable,
         PL_DHashFreeTable,
         PL_DHashVoidPtrKeyStub,
         PL_DHashMatchEntryStub,
         PL_DHashMoveEntryStub,
         ClearBroadcasterMapEntry,
-        PL_DHashFinalizeStub,
         nullptr
     };
 
     if (! mBroadcasterMap) {
         mBroadcasterMap = PL_NewDHashTable(&gOps, sizeof(BroadcasterMapEntry));
 
         if (! mBroadcasterMap) {
             aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
--- a/embedding/components/commandhandler/nsCommandParams.cpp
+++ b/embedding/components/commandhandler/nsCommandParams.cpp
@@ -16,18 +16,17 @@ using namespace mozilla;
 
 const PLDHashTableOps nsCommandParams::sHashOps =
 {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   HashKey,
   HashMatchEntry,
   HashMoveEntry,
-  HashClearEntry,
-  PL_DHashFinalizeStub
+  HashClearEntry
 };
 
 NS_IMPL_ISUPPORTS(nsCommandParams, nsICommandParams)
 
 nsCommandParams::nsCommandParams()
 {
   // init the hash table later
 }
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -623,17 +623,16 @@ public:
     {
         mOps = (PLDHashTableOps) {
             PL_DHashAllocTable,
             PL_DHashFreeTable,
             StringHash,
             HashMatchEntry,
             MoveEntry,
             PL_DHashClearEntryStub,
-            PL_DHashFinalizeStub,
             nullptr
         };
 
         PL_DHashTableInit(&mMap, &mOps, sizeof(FNCMapEntry), 0);
 
         NS_ABORT_IF_FALSE(XRE_GetProcessType() == GeckoProcessType_Default,
                           "StartupCacheFontNameCache should only be used in chrome process");
         mCache = mozilla::scache::StartupCache::GetSingleton();
--- a/js/xpconnect/src/XPCMaps.cpp
+++ b/js/xpconnect/src/XPCMaps.cpp
@@ -212,18 +212,17 @@ Native2WrappedNativeMap::SizeOfEntryExcl
 
 const struct PLDHashTableOps IID2WrappedJSClassMap::Entry::sOps =
 {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     HashIIDPtrKey,
     MatchIIDPtrKey,
     PL_DHashMoveEntryStub,
-    PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub
+    PL_DHashClearEntryStub
 };
 
 // static
 IID2WrappedJSClassMap*
 IID2WrappedJSClassMap::newMap(int length)
 {
     IID2WrappedJSClassMap* map = new IID2WrappedJSClassMap(length);
     if (map && map->mTable)
@@ -249,18 +248,17 @@ IID2WrappedJSClassMap::~IID2WrappedJSCla
 
 const struct PLDHashTableOps IID2NativeInterfaceMap::Entry::sOps =
 {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     HashIIDPtrKey,
     MatchIIDPtrKey,
     PL_DHashMoveEntryStub,
-    PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub
+    PL_DHashClearEntryStub
 };
 
 // static
 IID2NativeInterfaceMap*
 IID2NativeInterfaceMap::newMap(int length)
 {
     IID2NativeInterfaceMap* map = new IID2NativeInterfaceMap(length);
     if (map && map->mTable)
@@ -454,18 +452,17 @@ NativeSetMap::Entry::Match(PLDHashTable 
 
 const struct PLDHashTableOps NativeSetMap::Entry::sOps =
 {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     HashNativeKey,
     Match,
     PL_DHashMoveEntryStub,
-    PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub
+    PL_DHashClearEntryStub
 };
 
 // static
 NativeSetMap*
 NativeSetMap::newMap(int length)
 {
     NativeSetMap* map = new NativeSetMap(length);
     if (map && map->mTable)
@@ -521,18 +518,17 @@ IID2ThisTranslatorMap::Entry::Clear(PLDH
 
 const struct PLDHashTableOps IID2ThisTranslatorMap::Entry::sOps =
 {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     HashIIDPtrKey,
     Match,
     PL_DHashMoveEntryStub,
-    Clear,
-    PL_DHashFinalizeStub
+    Clear
 };
 
 // static
 IID2ThisTranslatorMap*
 IID2ThisTranslatorMap::newMap(int length)
 {
     IID2ThisTranslatorMap* map = new IID2ThisTranslatorMap(length);
     if (map && map->mTable)
@@ -600,18 +596,17 @@ XPCNativeScriptableSharedMap::Entry::Mat
 
 const struct PLDHashTableOps XPCNativeScriptableSharedMap::Entry::sOps =
 {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     Hash,
     Match,
     PL_DHashMoveEntryStub,
-    PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub
+    PL_DHashClearEntryStub
 };
 
 // static
 XPCNativeScriptableSharedMap*
 XPCNativeScriptableSharedMap::newMap(int length)
 {
     XPCNativeScriptableSharedMap* map =
         new XPCNativeScriptableSharedMap(length);
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -70,17 +70,16 @@ PlaceholderMapMatchEntry(PLDHashTable *t
 
 static const PLDHashTableOps PlaceholderMapOps = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   PlaceholderMapMatchEntry,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
-  PL_DHashFinalizeStub,
   nullptr
 };
 
 //----------------------------------------------------------------------
 
 // XXXldb This seems too complicated for what I think it's doing, and it
 // should also be using pldhash rather than plhash to use less memory.
 
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -363,88 +363,82 @@ RuleHash_NameSpaceTable_MatchEntry(PLDHa
 
 static const PLDHashTableOps RuleHash_TagTable_Ops = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   RuleHash_TagTable_MatchEntry,
   RuleHash_TagTable_MoveEntry,
   RuleHash_TagTable_ClearEntry,
-  PL_DHashFinalizeStub,
   RuleHash_TagTable_InitEntry
 };
 
 // Case-sensitive ops.
 static const RuleHashTableOps RuleHash_ClassTable_CSOps = {
   {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   RuleHash_CSMatchEntry,
   RuleHash_MoveEntry,
   RuleHash_ClearEntry,
-  PL_DHashFinalizeStub,
   RuleHash_InitEntry
   },
   RuleHash_ClassTable_GetKey
 };
 
 // Case-insensitive ops.
 static const RuleHashTableOps RuleHash_ClassTable_CIOps = {
   {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   RuleHash_CIHashKey,
   RuleHash_CIMatchEntry,
   RuleHash_MoveEntry,
   RuleHash_ClearEntry,
-  PL_DHashFinalizeStub,
   RuleHash_InitEntry
   },
   RuleHash_ClassTable_GetKey
 };
 
 // Case-sensitive ops.
 static const RuleHashTableOps RuleHash_IdTable_CSOps = {
   {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   RuleHash_CSMatchEntry,
   RuleHash_MoveEntry,
   RuleHash_ClearEntry,
-  PL_DHashFinalizeStub,
   RuleHash_InitEntry
   },
   RuleHash_IdTable_GetKey
 };
 
 // Case-insensitive ops.
 static const RuleHashTableOps RuleHash_IdTable_CIOps = {
   {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   RuleHash_CIHashKey,
   RuleHash_CIMatchEntry,
   RuleHash_MoveEntry,
   RuleHash_ClearEntry,
-  PL_DHashFinalizeStub,
   RuleHash_InitEntry
   },
   RuleHash_IdTable_GetKey
 };
 
 static const PLDHashTableOps RuleHash_NameSpaceTable_Ops = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   RuleHash_NameSpaceTable_HashKey,
   RuleHash_NameSpaceTable_MatchEntry,
   RuleHash_MoveEntry,
   RuleHash_ClearEntry,
-  PL_DHashFinalizeStub,
   RuleHash_InitEntry
 };
 
 #undef RULE_HASH_STATS
 #undef PRINT_UNIVERSAL_RULES
 
 #ifdef RULE_HASH_STATS
 #define RULE_HASH_STAT_INCREMENT(var_) PR_BEGIN_MACRO ++(var_); PR_END_MACRO
@@ -894,30 +888,28 @@ AtomSelector_GetKey(PLDHashTable *table,
 // Case-sensitive ops.
 static const PLDHashTableOps AtomSelector_CSOps = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   PL_DHashMatchEntryStub,
   AtomSelector_MoveEntry,
   AtomSelector_ClearEntry,
-  PL_DHashFinalizeStub,
   AtomSelector_InitEntry
 };
 
 // Case-insensitive ops.
 static const RuleHashTableOps AtomSelector_CIOps = {
   {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   RuleHash_CIHashKey,
   RuleHash_CIMatchEntry,
   AtomSelector_MoveEntry,
   AtomSelector_ClearEntry,
-  PL_DHashFinalizeStub,
   AtomSelector_InitEntry
   },
   AtomSelector_GetKey
 };
 
 //--------------------------------
 
 struct RuleCascadeData {
@@ -3346,17 +3338,16 @@ InitWeightEntry(PLDHashTable *table, PLD
 
 static const PLDHashTableOps gRulesByWeightOps = {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     HashIntKey,
     MatchWeightEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub,
     InitWeightEntry
 };
 
 struct CascadeEnumData {
   CascadeEnumData(nsPresContext* aPresContext,
                   nsTArray<nsFontFaceRuleContainer>& aFontFaceRules,
                   nsTArray<nsCSSKeyframesRule*>& aKeyframesRules,
                   nsTArray<nsCSSFontFeatureValuesRule*>& aFontFeatureValuesRules,
--- a/layout/style/nsHTMLStyleSheet.cpp
+++ b/layout/style/nsHTMLStyleSheet.cpp
@@ -170,17 +170,16 @@ MappedAttrTable_MatchEntry(PLDHashTable 
 
 static const PLDHashTableOps MappedAttrTable_Ops = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   MappedAttrTable_HashKey,
   MappedAttrTable_MatchEntry,
   PL_DHashMoveEntryStub,
   MappedAttrTable_ClearEntry,
-  PL_DHashFinalizeStub,
   nullptr
 };
 
 // -----------------------------------------------------------
 
 struct LangRuleTableEntry : public PLDHashEntryHdr {
   nsRefPtr<nsHTMLStyleSheet::LangRule> mRule;
 };
@@ -227,17 +226,16 @@ LangRuleTable_InitEntry(PLDHashTable *ta
 
 static const PLDHashTableOps LangRuleTable_Ops = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   LangRuleTable_HashKey,
   LangRuleTable_MatchEntry,
   PL_DHashMoveEntryStub,
   LangRuleTable_ClearEntry,
-  PL_DHashFinalizeStub,
   LangRuleTable_InitEntry
 };
 
 // -----------------------------------------------------------
 
 nsHTMLStyleSheet::nsHTMLStyleSheet(nsIDocument* aDocument)
   : mDocument(aDocument)
   , mTableQuirkColorRule(new TableQuirkColorRule())
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -115,17 +115,16 @@ nsRuleNode::ChildrenHashOps = {
   // grow very often and the pres shell's arena doesn't recycle very
   // large size allocations.
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   ChildrenHashHashKey,
   ChildrenHashMatchEntry,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
-  PL_DHashFinalizeStub,
   nullptr
 };
 
 
 // EnsureBlockDisplay:
 // Never change display:none or display:contents *ever*, otherwise:
 //  - if the display value (argument) is not a block-type
 //    then we set it to a valid block display value
--- a/layout/tables/SpanningCellSorter.cpp
+++ b/layout/tables/SpanningCellSorter.cpp
@@ -34,17 +34,16 @@ SpanningCellSorter::~SpanningCellSorter(
 /* static */ const PLDHashTableOps
 SpanningCellSorter::HashTableOps = {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     HashTableHashKey,
     HashTableMatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub,
     nullptr
 };
 
 /* static */ PLDHashNumber
 SpanningCellSorter::HashTableHashKey(PLDHashTable *table, const void *key)
 {
     return NS_PTR_TO_INT32(key);
 }
--- a/modules/libpref/prefapi.cpp
+++ b/modules/libpref/prefapi.cpp
@@ -78,17 +78,16 @@ static bool         gShouldCleanupDeadNo
 
 static PLDHashTableOps     pref_HashTableOps = {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     PL_DHashStringKey,
     matchPrefEntry,
     PL_DHashMoveEntryStub,
     clearPrefEntry,
-    PL_DHashFinalizeStub,
     nullptr,
 };
 
 // PR_ALIGN_OF_WORD is only defined on some platforms.  ALIGN_OF_WORD has
 // already been defined to PR_ALIGN_OF_WORD everywhere
 #ifndef PR_ALIGN_OF_WORD
 #define PR_ALIGN_OF_WORD PR_ALIGN_OF_POINTER
 #endif
--- a/netwerk/base/src/nsLoadGroup.cpp
+++ b/netwerk/base/src/nsLoadGroup.cpp
@@ -1157,17 +1157,16 @@ nsresult nsLoadGroup::Init()
     static const PLDHashTableOps hash_table_ops =
     {
         PL_DHashAllocTable,
         PL_DHashFreeTable,
         PL_DHashVoidPtrKeyStub,
         RequestHashMatchEntry,
         PL_DHashMoveEntryStub,
         RequestHashClearEntry,
-        PL_DHashFinalizeStub,
         RequestHashInitEntry
     };
 
     PL_DHashTableInit(&mRequests, &hash_table_ops,
                       sizeof(RequestMapEntry));
 
     mConnectionInfo = new nsLoadGroupConnectionInfo();
 
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -377,18 +377,17 @@ nsCacheEntryInfo::IsStreamBased(bool * r
 const PLDHashTableOps
 nsCacheEntryHashTable::ops =
 {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     HashKey,
     MatchEntry,
     MoveEntry,
-    ClearEntry,
-    PL_DHashFinalizeStub
+    ClearEntry
 };
 
 
 nsCacheEntryHashTable::nsCacheEntryHashTable()
     : initialized(false)
 {
     MOZ_COUNT_CTOR(nsCacheEntryHashTable);
 }
--- a/netwerk/cache/nsDiskCacheBinding.cpp
+++ b/netwerk/cache/nsDiskCacheBinding.cpp
@@ -124,18 +124,17 @@ nsDiskCacheBinding::EnsureStreamIO()
 
 const PLDHashTableOps nsDiskCacheBindery::ops =
 {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     HashKey,
     MatchEntry,
     MoveEntry,
-    ClearEntry,
-    PL_DHashFinalizeStub
+    ClearEntry
 };
 
 
 nsDiskCacheBindery::nsDiskCacheBindery()
     : initialized(false)
 {
 }
 
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -464,17 +464,16 @@ HostDB_InitEntry(PLDHashTable *table,
 static const PLDHashTableOps gHostDB_ops =
 {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     HostDB_HashKey,
     HostDB_MatchEntry,
     HostDB_MoveEntry,
     HostDB_ClearEntry,
-    PL_DHashFinalizeStub,
     HostDB_InitEntry,
 };
 
 static PLDHashOperator
 HostDB_RemoveEntry(PLDHashTable *table,
                    PLDHashEntryHdr *hdr,
                    uint32_t number,
                    void *arg)
--- a/netwerk/protocol/http/nsHttp.cpp
+++ b/netwerk/protocol/http/nsHttp.cpp
@@ -86,17 +86,16 @@ StringCompare(PLDHashTable *table, const
 
 static const PLDHashTableOps ops = {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     StringHash,
     StringCompare,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub,
     nullptr
 };
 
 // We put the atoms in a hash table for speedy lookup.. see ResolveAtom.
 nsresult
 nsHttp::CreateAtomTable()
 {
     MOZ_ASSERT(!sAtomTable.ops, "atom table already initialized");
--- a/parser/htmlparser/nsHTMLEntities.cpp
+++ b/parser/htmlparser/nsHTMLEntities.cpp
@@ -53,28 +53,26 @@ static PLDHashNumber
 
 static const PLDHashTableOps EntityToUnicodeOps = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   PL_DHashStringKey,
   matchNodeString,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
-  PL_DHashFinalizeStub,
   nullptr,
 }; 
 
 static const PLDHashTableOps UnicodeToEntityOps = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   hashUnicodeValue,
   matchNodeUnicode,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
-  PL_DHashFinalizeStub,
   nullptr,
 };
 
 static PLDHashTable gEntityToUnicode;
 static PLDHashTable gUnicodeToEntity;
 static nsrefcnt gTableRefCnt = 0;
 
 #define HTML_ENTITY(_name, _value) { #_name, _value },
--- a/rdf/base/nsRDFService.cpp
+++ b/rdf/base/nsRDFService.cpp
@@ -141,17 +141,16 @@ struct ResourceHashEntry : public PLDHas
 
 static const PLDHashTableOps gResourceTableOps = {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     ResourceHashEntry::HashKey,
     ResourceHashEntry::MatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub,
     nullptr
 };
 
 // ----------------------------------------------------------------------
 //
 // For the mLiterals hashtable.
 //
 
@@ -179,17 +178,16 @@ struct LiteralHashEntry : public PLDHash
 
 static const PLDHashTableOps gLiteralTableOps = {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     LiteralHashEntry::HashKey,
     LiteralHashEntry::MatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub,
     nullptr
 };
 
 // ----------------------------------------------------------------------
 //
 // For the mInts hashtable.
 //
 
@@ -216,17 +214,16 @@ struct IntHashEntry : public PLDHashEntr
 
 static const PLDHashTableOps gIntTableOps = {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     IntHashEntry::HashKey,
     IntHashEntry::MatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub,
     nullptr
 };
 
 // ----------------------------------------------------------------------
 //
 // For the mDates hashtable.
 //
 
@@ -257,17 +254,16 @@ struct DateHashEntry : public PLDHashEnt
 
 static const PLDHashTableOps gDateTableOps = {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     DateHashEntry::HashKey,
     DateHashEntry::MatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub,
     nullptr
 };
 
 class BlobImpl : public nsIRDFBlob
 {
 public:
     struct Data {
         int32_t  mLength;
@@ -377,17 +373,16 @@ struct BlobHashEntry : public PLDHashEnt
 
 static const PLDHashTableOps gBlobTableOps = {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     BlobHashEntry::HashKey,
     BlobHashEntry::MatchEntry,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub,
     nullptr
 };
 
 ////////////////////////////////////////////////////////////////////////
 // LiteralImpl
 //
 //   Currently, all literals are implemented exactly the same way;
 //   i.e., there is are no resource factories to allow you to generate
--- a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
@@ -81,17 +81,16 @@ RequestMapInitEntry(PLDHashTable *table,
 
 static const PLDHashTableOps gMapOps = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   RequestMapMatchEntry,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
-  PL_DHashFinalizeStub,
   RequestMapInitEntry
 };
 
 #ifdef DEBUG
 class nsAutoAtomic {
   public:
     explicit nsAutoAtomic(Atomic<int32_t> &i)
     :mI(i) {
--- a/security/manager/ssl/src/nsCertTree.cpp
+++ b/security/manager/ssl/src/nsCertTree.cpp
@@ -93,17 +93,16 @@ CompareCacheClearEntry(PLDHashTable *tab
 
 static const PLDHashTableOps gMapOps = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   CompareCacheMatchEntry,
   PL_DHashMoveEntryStub,
   CompareCacheClearEntry,
-  PL_DHashFinalizeStub,
   CompareCacheInitEntry
 };
 
 NS_IMPL_ISUPPORTS0(nsCertAddonInfo)
 NS_IMPL_ISUPPORTS(nsCertTreeDispInfo, nsICertTreeItem)
 
 nsCertTreeDispInfo::nsCertTreeDispInfo()
 :mAddonInfo(nullptr)
--- a/security/manager/ssl/src/nsNSSShutDown.cpp
+++ b/security/manager/ssl/src/nsNSSShutDown.cpp
@@ -34,17 +34,16 @@ ObjectSetInitEntry(PLDHashTable *table, 
 
 static const PLDHashTableOps gSetOps = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   ObjectSetMatchEntry,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
-  PL_DHashFinalizeStub,
   ObjectSetInitEntry
 };
 
 nsNSSShutDownList *nsNSSShutDownList::singleton = nullptr;
 
 nsNSSShutDownList::nsNSSShutDownList()
 :mListLock("nsNSSShutDownList.mListLock")
 {
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -115,17 +115,16 @@ nsDocLoader::nsDocLoader()
   static const PLDHashTableOps hash_table_ops =
   {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     PL_DHashVoidPtrKeyStub,
     PL_DHashMatchEntryStub,
     PL_DHashMoveEntryStub,
     RequestInfoHashClearEntry,
-    PL_DHashFinalizeStub,
     RequestInfoHashInitEntry
   };
 
   PL_DHashTableInit(&mRequestInfoHash, &hash_table_ops, sizeof(nsRequestInfo));
 
   ClearInternalProgress();
 
   PR_LOG(gDocLoaderLog, PR_LOG_DEBUG, 
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -802,17 +802,16 @@ PtrToNodeMatchEntry(PLDHashTable* aTable
 
 static PLDHashTableOps PtrNodeOps = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   PtrToNodeMatchEntry,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
-  PL_DHashFinalizeStub,
   nullptr
 };
 
 
 struct WeakMapping
 {
   // map and key will be null if the corresponding objects are GC marked
   PtrInfo* mMap;
--- a/xpcom/ds/nsAtomTable.cpp
+++ b/xpcom/ds/nsAtomTable.cpp
@@ -289,17 +289,16 @@ AtomTableInitEntry(PLDHashTable* aTable,
 
 static const PLDHashTableOps AtomTableOps = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   AtomTableGetHash,
   AtomTableMatchKey,
   PL_DHashMoveEntryStub,
   AtomTableClearEntry,
-  PL_DHashFinalizeStub,
   AtomTableInitEntry
 };
 
 
 #ifdef DEBUG
 static PLDHashOperator
 DumpAtomLeaks(PLDHashTable* aTable, PLDHashEntryHdr* aEntryHdr,
               uint32_t aIndex, void* aArg)
--- a/xpcom/ds/nsPersistentProperties.cpp
+++ b/xpcom/ds/nsPersistentProperties.cpp
@@ -51,17 +51,16 @@ ArenaStrdup(const nsAFlatCString& aStrin
 
 static const struct PLDHashTableOps property_HashTableOps = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   PL_DHashStringKey,
   PL_DHashMatchStringKey,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
-  PL_DHashFinalizeStub,
   nullptr,
 };
 
 //
 // parser stuff
 //
 enum EParserState
 {
--- a/xpcom/ds/nsStaticNameTable.cpp
+++ b/xpcom/ds/nsStaticNameTable.cpp
@@ -95,17 +95,16 @@ caseInsensitiveStringHashKey(PLDHashTabl
 
 static const struct PLDHashTableOps nametable_CaseInsensitiveHashTableOps = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   caseInsensitiveStringHashKey,
   matchNameKeysCaseInsensitive,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
-  PL_DHashFinalizeStub,
   nullptr,
 };
 
 nsStaticCaseInsensitiveNameTable::nsStaticCaseInsensitiveNameTable()
   : mNameArray(nullptr)
   , mNullStr("")
 {
   MOZ_COUNT_CTOR(nsStaticCaseInsensitiveNameTable);
--- a/xpcom/glue/nsTHashtable.h
+++ b/xpcom/glue/nsTHashtable.h
@@ -420,17 +420,16 @@ nsTHashtable<EntryType>::Init(uint32_t a
   static const PLDHashTableOps sOps =
   {
     ::PL_DHashAllocTable,
     ::PL_DHashFreeTable,
     s_HashKey,
     s_MatchEntry,
     EntryType::ALLOW_MEMMOVE ? ::PL_DHashMoveEntryStub : s_CopyEntry,
     s_ClearEntry,
-    ::PL_DHashFinalizeStub,
     s_InitEntry
   };
 
   PL_DHashTableInit(&mTable, &sOps, sizeof(EntryType), aInitLength);
 }
 
 // static
 template<class EntryType>
--- a/xpcom/glue/pldhash.cpp
+++ b/xpcom/glue/pldhash.cpp
@@ -152,29 +152,23 @@ PLDHashTable::FreeStringKey(PLDHashEntry
 }
 
 void
 PL_DHashFreeStringKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry)
 {
   aTable->FreeStringKey(aEntry);
 }
 
-void
-PL_DHashFinalizeStub(PLDHashTable* aTable)
-{
-}
-
 static const PLDHashTableOps stub_ops = {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   PL_DHashVoidPtrKeyStub,
   PL_DHashMatchEntryStub,
   PL_DHashMoveEntryStub,
   PL_DHashClearEntryStub,
-  PL_DHashFinalizeStub,
   nullptr
 };
 
 const PLDHashTableOps*
 PL_DHashGetStubOps(void)
 {
   return &stub_ops;
 }
@@ -337,19 +331,16 @@ PL_DHashTableInit(PLDHashTable* aTable, 
 #define ADDRESS_ENTRY(table, index) \
     ((PLDHashEntryHdr *)((table)->mEntryStore + (index) * (table)->mEntrySize))
 
 MOZ_ALWAYS_INLINE void
 PLDHashTable::Finish()
 {
   INCREMENT_RECURSION_LEVEL(this);
 
-  /* Call finalize before clearing entries, so it can enumerate them. */
-  ops->finalize(this);
-
   /* Clear any remaining live entries. */
   char* entryAddr = mEntryStore;
   char* entryLimit = entryAddr + Capacity() * mEntrySize;
   while (entryAddr < entryLimit) {
     PLDHashEntryHdr* entry = (PLDHashEntryHdr*)entryAddr;
     if (ENTRY_IS_LIVE(entry)) {
       METER(mStats.mRemoveEnums++);
       ops->clearEntry(this, entry);
--- a/xpcom/glue/pldhash.h
+++ b/xpcom/glue/pldhash.h
@@ -338,47 +338,38 @@ typedef void (*PLDHashMoveEntry)(PLDHash
  * Clear the entry and drop any strong references it holds.  This callback is
  * invoked during a PL_DHASH_REMOVE operation (see below for operation codes),
  * but only if the given key is found in the table.
  */
 typedef void (*PLDHashClearEntry)(PLDHashTable* aTable,
                                   PLDHashEntryHdr* aEntry);
 
 /*
- * Called when a table (whether allocated dynamically by itself, or nested in
- * a larger structure, or allocated on the stack) is finished.  This callback
- * allows aTable->ops-specific code to finalize aTable->data.
- */
-typedef void (*PLDHashFinalize)(PLDHashTable* aTable);
-
-/*
  * Initialize a new entry, apart from keyHash.  This function is called when
  * PL_DHashTableOperate's PL_DHASH_ADD case finds no existing entry for the
  * given key, and must add a new one.  At that point, aEntry->keyHash is not
  * set yet, to avoid claiming the last free entry in a severely overloaded
  * table.
  */
 typedef bool (*PLDHashInitEntry)(PLDHashTable* aTable, PLDHashEntryHdr* aEntry,
                                  const void* aKey);
 
 /*
- * Finally, the "vtable" structure for PLDHashTable.  The first eight hooks
+ * Finally, the "vtable" structure for PLDHashTable.  The first six hooks
  * must be provided by implementations; they're called unconditionally by the
  * generic pldhash.c code.  Hooks after these may be null.
  *
  * Summary of allocation-related hook usage with C++ placement new emphasis:
  *  allocTable          Allocate raw bytes with malloc, no ctors run.
  *  freeTable           Free raw bytes with free, no dtors run.
  *  initEntry           Call placement new using default key-based ctor.
  *                      Return true on success, false on error.
  *  moveEntry           Call placement new using copy ctor, run dtor on old
  *                      entry storage.
  *  clearEntry          Run dtor on entry.
- *  finalize            Stub unless aTable->data was initialized and needs to
- *                      be finalized.
  *
  * Note the reason why initEntry is optional: the default hooks (stubs) clear
  * entry storage:  On successful PL_DHashTableOperate(tbl, key, PL_DHASH_ADD),
  * the returned entry pointer addresses an entry struct whose keyHash member
  * has been set non-zero, but all other entry members are still clear (null).
  * PL_DHASH_ADD callers can test such members to see whether the entry was
  * newly created by the PL_DHASH_ADD call that just succeeded.  If placement
  * new or similar initialization is required, define an initEntry hook.  Of
@@ -390,17 +381,16 @@ struct PLDHashTableOps
 {
   /* Mandatory hooks.  All implementations must provide these. */
   PLDHashAllocTable   allocTable;
   PLDHashFreeTable    freeTable;
   PLDHashHashKey      hashKey;
   PLDHashMatchEntry   matchEntry;
   PLDHashMoveEntry    moveEntry;
   PLDHashClearEntry   clearEntry;
-  PLDHashFinalize     finalize;
 
   /* Optional hooks start here.  If null, these are not called. */
   PLDHashInitEntry    initEntry;
 };
 
 /*
  * Default implementations for the above ops.
  */
@@ -431,18 +421,16 @@ void
 PL_DHashMoveEntryStub(PLDHashTable* aTable,
                       const PLDHashEntryHdr* aFrom,
                       PLDHashEntryHdr* aTo);
 
 void PL_DHashClearEntryStub(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);
 
 void PL_DHashFreeStringKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);
 
-void PL_DHashFinalizeStub(PLDHashTable* aTable);
-
 /*
  * If you use PLDHashEntryStub or a subclass of it as your entry struct, and
  * if your entries move via memcpy and clear via memset(0), you can use these
  * stub operations.
  */
 const PLDHashTableOps* PL_DHashGetStubOps(void);
 
 /*
@@ -451,18 +439,19 @@ const PLDHashTableOps* PL_DHashGetStubOp
  * Note that the entry storage at aTable->mEntryStore will be allocated using
  * the aOps->allocTable callback.
  */
 PLDHashTable* PL_NewDHashTable(
   const PLDHashTableOps* aOps, uint32_t aEntrySize,
   uint32_t aLength = PL_DHASH_DEFAULT_INITIAL_LENGTH);
 
 /*
- * Finalize aTable's data, free its entry storage (via aTable->ops->freeTable),
- * and return the memory starting at aTable to the malloc heap.
+ * Free |aTable|'s entry storage and |aTable| itself (both via
+ * aTable->ops->freeTable). Use this function to destroy a PLDHashTable that
+ * was allocated on the heap via PL_NewDHashTable().
  */
 void PL_DHashTableDestroy(PLDHashTable* aTable);
 
 /*
  * Initialize aTable with aOps, aEntrySize, and aCapacity. The table's initial
  * capacity will be chosen such that |aLength| elements can be inserted without
  * rehashing. If |aLength| is a power-of-two, this capacity will be |2*length|.
  *
@@ -478,20 +467,19 @@ void PL_DHashTableInit(
  * returns a boolean indicating success, rather than crashing on failure.
  */
 MOZ_WARN_UNUSED_RESULT bool PL_DHashTableInit(
   PLDHashTable* aTable, const PLDHashTableOps* aOps,
   uint32_t aEntrySize, const mozilla::fallible_t&,
   uint32_t aLength = PL_DHASH_DEFAULT_INITIAL_LENGTH);
 
 /*
- * Finalize aTable's data, free its entry storage using aTable->ops->freeTable,
- * and leave its members unchanged from their last live values (which leaves
- * pointers dangling).  If you want to burn cycles clearing aTable, it's up to
- * your code to call memset.
+ * Free |aTable|'s entry storage (via aTable->ops->freeTable). Use this function
+ * to destroy a PLDHashTable that is allocated on the stack or in static memory
+ * and was created via PL_DHashTableInit().
  */
 void PL_DHashTableFinish(PLDHashTable* aTable);
 
 /*
  * To lookup a key in table, call:
  *
  *  entry = PL_DHashTableOperate(table, key, PL_DHASH_LOOKUP);
  *
--- a/xpcom/tests/TestPLDHash.cpp
+++ b/xpcom/tests/TestPLDHash.cpp
@@ -81,17 +81,16 @@ static bool test_pldhash_grow_to_max_cap
 {
   static const PLDHashTableOps ops = {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     hash,
     PL_DHashMatchEntryStub,
     PL_DHashMoveEntryStub,
     PL_DHashClearEntryStub,
-    PL_DHashFinalizeStub,
     nullptr
   };
 
   PLDHashTable t;
   bool ok = PL_DHashTableInit(&t, &ops, sizeof(PLDHashEntryStub),
                               mozilla::fallible_t(), 128);
   if (!ok)
     return false;