Bug 1253085 - Remove the |PLDHashTable*| argument from PLDHash{HashKey,MatchEntry}. r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 16 Mar 2016 15:33:44 +1100
changeset 288926 4a416720bfb3075cb6af708b129bf9eb711a9e12
parent 288925 21e9dd187ca87f1eec65888aa373559a2c3e9ab1
child 288927 0ad528e4b17dfdd13e5b6490be176f7437555705
push id73621
push usernnethercote@mozilla.com
push dateWed, 16 Mar 2016 08:22:38 +0000
treeherdermozilla-inbound@4a416720bfb3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1253085
milestone48.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 1253085 - Remove the |PLDHashTable*| argument from PLDHash{HashKey,MatchEntry}. r=froydnj. This is easy because it's never needed.
dom/base/nsContentList.cpp
dom/base/nsScriptNameSpaceManager.cpp
embedding/components/commandhandler/nsCommandParams.cpp
embedding/components/commandhandler/nsCommandParams.h
gfx/thebes/gfxFT2FontList.cpp
js/xpconnect/src/XPCMaps.cpp
js/xpconnect/src/XPCMaps.h
layout/base/nsFrameManager.cpp
layout/style/nsCSSRuleProcessor.cpp
layout/style/nsHTMLStyleSheet.cpp
layout/style/nsRuleNode.cpp
layout/style/nsRuleNode.h
layout/tables/SpanningCellSorter.cpp
layout/tables/SpanningCellSorter.h
modules/libpref/prefapi.cpp
netwerk/base/nsLoadGroup.cpp
netwerk/cache/nsCacheEntry.cpp
netwerk/cache/nsCacheEntry.h
netwerk/cache/nsDiskCacheBinding.cpp
netwerk/dns/nsHostResolver.cpp
netwerk/protocol/http/nsHttp.cpp
parser/htmlparser/nsHTMLEntities.cpp
rdf/base/nsRDFService.cpp
security/manager/ssl/nsCertOverrideService.h
security/manager/ssl/nsCertTree.cpp
security/manager/ssl/nsClientAuthRemember.h
security/manager/ssl/nsNSSShutDown.cpp
security/manager/ssl/nsSecureBrowserUIImpl.cpp
xpcom/base/nsCycleCollector.cpp
xpcom/base/nsMemoryReporterManager.cpp
xpcom/ds/nsAtomTable.cpp
xpcom/ds/nsStaticNameTable.cpp
xpcom/glue/PLDHashTable.cpp
xpcom/glue/PLDHashTable.h
xpcom/glue/nsTHashtable.h
xpcom/tests/gtest/TestPLDHash.cpp
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -166,26 +166,24 @@ RecentlyUsedCacheIndex(const nsContentLi
 }
 
 struct ContentListHashEntry : public PLDHashEntryHdr
 {
   nsContentList* mContentList;
 };
 
 static PLDHashNumber
-ContentListHashtableHashKey(PLDHashTable *table, const void *key)
+ContentListHashtableHashKey(const void *key)
 {
   const nsContentListKey* list = static_cast<const nsContentListKey *>(key);
   return list->GetHash();
 }
 
 static bool
-ContentListHashtableMatchEntry(PLDHashTable *table,
-                               const PLDHashEntryHdr *entry,
-                               const void *key)
+ContentListHashtableMatchEntry(const PLDHashEntryHdr *entry, const void *key)
 {
   const ContentListHashEntry *e =
     static_cast<const ContentListHashEntry *>(entry);
   const nsContentList* list = e->mContentList;
   const nsContentListKey* ourKey = static_cast<const nsContentListKey *>(key);
 
   return list->MatchesKey(*ourKey);
 }
@@ -273,27 +271,26 @@ nsCacheableFuncStringHTMLCollection::Wra
 static PLDHashTable* gFuncStringContentListHashTable;
 
 struct FuncStringContentListHashEntry : public PLDHashEntryHdr
 {
   nsCacheableFuncStringContentList* mContentList;
 };
 
 static PLDHashNumber
-FuncStringContentListHashtableHashKey(PLDHashTable *table, const void *key)
+FuncStringContentListHashtableHashKey(const void *key)
 {
   const nsFuncStringCacheKey* funcStringKey =
     static_cast<const nsFuncStringCacheKey *>(key);
   return funcStringKey->GetHash();
 }
 
 static bool
-FuncStringContentListHashtableMatchEntry(PLDHashTable *table,
-                               const PLDHashEntryHdr *entry,
-                               const void *key)
+FuncStringContentListHashtableMatchEntry(const PLDHashEntryHdr *entry,
+                                         const void *key)
 {
   const FuncStringContentListHashEntry *e =
     static_cast<const FuncStringContentListHashEntry *>(entry);
   const nsFuncStringCacheKey* ourKey =
     static_cast<const nsFuncStringCacheKey *>(key);
 
   return e->mContentList->Equals(ourKey);
 }
--- a/dom/base/nsScriptNameSpaceManager.cpp
+++ b/dom/base/nsScriptNameSpaceManager.cpp
@@ -31,25 +31,24 @@
 #include "mozilla/Services.h"
 
 #define NS_INTERFACE_PREFIX "nsI"
 #define NS_DOM_INTERFACE_PREFIX "nsIDOM"
 
 using namespace mozilla;
 
 static PLDHashNumber
-GlobalNameHashHashKey(PLDHashTable *table, const void *key)
+GlobalNameHashHashKey(const void *key)
 {
   const nsAString *str = static_cast<const nsAString *>(key);
   return HashString(*str);
 }
 
 static bool
-GlobalNameHashMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *entry,
-                         const void *key)
+GlobalNameHashMatchEntry(const PLDHashEntryHdr *entry, const void *key)
 {
   const GlobalNameMapEntry *e =
     static_cast<const GlobalNameMapEntry *>(entry);
   const nsAString *str = static_cast<const nsAString *>(key);
 
   return str->Equals(e->mKey);
 }
 
--- a/embedding/components/commandhandler/nsCommandParams.cpp
+++ b/embedding/components/commandhandler/nsCommandParams.cpp
@@ -225,24 +225,23 @@ nsCommandParams::GetOrMakeEntry(const ch
   }
 
   // Use placement new. Our ctor does not clobber keyHash, which is important.
   new (foundEntry) HashEntry(aEntryType, aName);
   return foundEntry;
 }
 
 PLDHashNumber
-nsCommandParams::HashKey(PLDHashTable* aTable, const void* aKey)
+nsCommandParams::HashKey(const void* aKey)
 {
   return HashString((const char*)aKey);
 }
 
 bool
-nsCommandParams::HashMatchEntry(PLDHashTable* aTable,
-                                const PLDHashEntryHdr* aEntry, const void* aKey)
+nsCommandParams::HashMatchEntry(const PLDHashEntryHdr* aEntry, const void* aKey)
 {
   const char* keyString = (const char*)aKey;
   const HashEntry* thisEntry = static_cast<const HashEntry*>(aEntry);
   return thisEntry->mEntryName.Equals(keyString);
 }
 
 void
 nsCommandParams::HashMoveEntry(PLDHashTable* aTable,
--- a/embedding/components/commandhandler/nsCommandParams.h
+++ b/embedding/components/commandhandler/nsCommandParams.h
@@ -109,20 +109,19 @@ protected:
       mEntryType = aNewType;
     }
   };
 
   HashEntry* GetNamedEntry(const char* aName);
   HashEntry* GetOrMakeEntry(const char* aName, uint8_t aEntryType);
 
 protected:
-  static PLDHashNumber HashKey(PLDHashTable* aTable, const void* aKey);
+  static PLDHashNumber HashKey(const void* aKey);
 
-  static bool HashMatchEntry(PLDHashTable* aTable,
-                             const PLDHashEntryHdr* aEntry, const void* aKey);
+  static bool HashMatchEntry(const PLDHashEntryHdr* aEntry, const void* aKey);
 
   static void HashMoveEntry(PLDHashTable* aTable, const PLDHashEntryHdr* aFrom,
                             PLDHashEntryHdr* aTo);
 
   static void HashClearEntry(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);
 
   PLDHashTable mValuesHash;
 
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -754,23 +754,22 @@ private:
     public:
         nsCString mFilename;
         uint32_t  mTimestamp;
         uint32_t  mFilesize;
         nsCString mFaces;
         bool      mFileExists;
     } FNCMapEntry;
 
-    static PLDHashNumber StringHash(PLDHashTable *table, const void *key)
+    static PLDHashNumber StringHash(const void *key)
     {
         return HashString(reinterpret_cast<const char*>(key));
     }
 
-    static bool HashMatchEntry(PLDHashTable *table,
-                                 const PLDHashEntryHdr *aHdr, const void *key)
+    static bool HashMatchEntry(const PLDHashEntryHdr *aHdr, const void *key)
     {
         const FNCMapEntry* entry =
             static_cast<const FNCMapEntry*>(aHdr);
         return entry->mFilename.Equals(reinterpret_cast<const char*>(key));
     }
 
     static void MoveEntry(PLDHashTable *table, const PLDHashEntryHdr *aFrom,
                           PLDHashEntryHdr *aTo)
--- a/js/xpconnect/src/XPCMaps.cpp
+++ b/js/xpconnect/src/XPCMaps.cpp
@@ -16,32 +16,30 @@ using namespace mozilla;
 
 /***************************************************************************/
 // static shared...
 
 // Note this is returning the bit pattern of the first part of the nsID, not
 // the pointer to the nsID.
 
 static PLDHashNumber
-HashIIDPtrKey(PLDHashTable* table, const void* key)
+HashIIDPtrKey(const void* key)
 {
     return *((js::HashNumber*)key);
 }
 
 static bool
-MatchIIDPtrKey(PLDHashTable* table,
-               const PLDHashEntryHdr* entry,
-               const void* key)
+MatchIIDPtrKey(const PLDHashEntryHdr* entry, const void* key)
 {
     return ((const nsID*)key)->
                 Equals(*((const nsID*)((PLDHashEntryStub*)entry)->key));
 }
 
 static PLDHashNumber
-HashNativeKey(PLDHashTable* table, const void* key)
+HashNativeKey(const void* key)
 {
     XPCNativeSetKey* Key = (XPCNativeSetKey*) key;
 
     PLDHashNumber h = 0;
 
     XPCNativeSet*       Set;
     XPCNativeInterface* Addition;
     uint16_t            Position;
@@ -314,19 +312,17 @@ ClassInfo2WrappedNativeProtoMap::SizeOfI
     }
     return n;
 }
 
 /***************************************************************************/
 // implement NativeSetMap...
 
 bool
-NativeSetMap::Entry::Match(PLDHashTable* table,
-                           const PLDHashEntryHdr* entry,
-                           const void* key)
+NativeSetMap::Entry::Match(const PLDHashEntryHdr* entry, const void* key)
 {
     XPCNativeSetKey* Key = (XPCNativeSetKey*) key;
 
     // See the comment in the XPCNativeSetKey declaration in xpcprivate.h.
     if (!Key->IsAKey()) {
         XPCNativeSet* Set1 = (XPCNativeSet*) key;
         XPCNativeSet* Set2 = ((Entry*)entry)->key_value;
 
@@ -426,18 +422,17 @@ NativeSetMap::SizeOfIncludingThis(mozill
     }
     return n;
 }
 
 /***************************************************************************/
 // implement IID2ThisTranslatorMap...
 
 bool
-IID2ThisTranslatorMap::Entry::Match(PLDHashTable* table,
-                                    const PLDHashEntryHdr* entry,
+IID2ThisTranslatorMap::Entry::Match(const PLDHashEntryHdr* entry,
                                     const void* key)
 {
     return ((const nsID*)key)->Equals(((Entry*)entry)->key);
 }
 
 void
 IID2ThisTranslatorMap::Entry::Clear(PLDHashTable* table, PLDHashEntryHdr* entry)
 {
@@ -468,17 +463,17 @@ IID2ThisTranslatorMap::IID2ThisTranslato
 IID2ThisTranslatorMap::~IID2ThisTranslatorMap()
 {
     delete mTable;
 }
 
 /***************************************************************************/
 
 PLDHashNumber
-XPCNativeScriptableSharedMap::Entry::Hash(PLDHashTable* table, const void* key)
+XPCNativeScriptableSharedMap::Entry::Hash(const void* key)
 {
     PLDHashNumber h;
     const unsigned char* s;
 
     XPCNativeScriptableShared* obj =
         (XPCNativeScriptableShared*) key;
 
     // hash together the flags and the classname string, ignore the interfaces
@@ -487,18 +482,17 @@ XPCNativeScriptableSharedMap::Entry::Has
 
     h = (PLDHashNumber) obj->GetFlags();
     for (s = (const unsigned char*) obj->GetJSClass()->name; *s != '\0'; s++)
         h = RotateLeft(h, 4) ^ *s;
     return h;
 }
 
 bool
-XPCNativeScriptableSharedMap::Entry::Match(PLDHashTable* table,
-                                           const PLDHashEntryHdr* entry,
+XPCNativeScriptableSharedMap::Entry::Match(const PLDHashEntryHdr* entry,
                                            const void* key)
 {
     XPCNativeScriptableShared* obj1 =
         ((XPCNativeScriptableSharedMap::Entry*) entry)->key;
 
     XPCNativeScriptableShared* obj2 =
         (XPCNativeScriptableShared*) key;
 
--- a/js/xpconnect/src/XPCMaps.h
+++ b/js/xpconnect/src/XPCMaps.h
@@ -385,19 +385,17 @@ private:
 class NativeSetMap
 {
 public:
     struct Entry : public PLDHashEntryHdr
     {
         XPCNativeSet* key_value;
 
         static bool
-        Match(PLDHashTable* table,
-              const PLDHashEntryHdr* entry,
-              const void* key);
+        Match(const PLDHashEntryHdr* entry, const void* key);
 
         static const struct PLDHashTableOps sOps;
     };
 
     static NativeSetMap* newMap(int length);
 
     inline XPCNativeSet* Find(XPCNativeSetKey* key)
     {
@@ -454,19 +452,17 @@ class IID2ThisTranslatorMap
 {
 public:
     struct Entry : public PLDHashEntryHdr
     {
         nsIID                                  key;
         nsCOMPtr<nsIXPCFunctionThisTranslator> value;
 
         static bool
-        Match(PLDHashTable* table,
-              const PLDHashEntryHdr* entry,
-              const void* key);
+        Match(const PLDHashEntryHdr* entry, const void* key);
 
         static void
         Clear(PLDHashTable* table, PLDHashEntryHdr* entry);
 
         static const struct PLDHashTableOps sOps;
     };
 
     static IID2ThisTranslatorMap* newMap(int length);
@@ -508,22 +504,20 @@ private:
 class XPCNativeScriptableSharedMap
 {
 public:
     struct Entry : public PLDHashEntryHdr
     {
         XPCNativeScriptableShared* key;
 
         static PLDHashNumber
-        Hash(PLDHashTable* table, const void* key);
+        Hash(const void* key);
 
         static bool
-        Match(PLDHashTable* table,
-              const PLDHashEntryHdr* entry,
-              const void* key);
+        Match(const PLDHashEntryHdr* entry, const void* key);
 
         static const struct PLDHashTableOps sOps;
     };
 
     static XPCNativeScriptableSharedMap* newMap(int length);
 
     bool GetNewOrUsed(uint32_t flags, char* name, XPCNativeScriptableInfo* si);
 
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -52,18 +52,17 @@ using namespace mozilla::dom;
 //----------------------------------------------------------------------
 
 struct PlaceholderMapEntry : public PLDHashEntryHdr {
   // key (the out of flow frame) can be obtained through placeholder frame
   nsPlaceholderFrame *placeholderFrame;
 };
 
 static bool
-PlaceholderMapMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                         const void *key)
+PlaceholderMapMatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   const PlaceholderMapEntry *entry =
     static_cast<const PlaceholderMapEntry*>(hdr);
   NS_ASSERTION(entry->placeholderFrame->GetOutOfFlowFrame() !=
                (void*)0xdddddddd,
                "Dead placeholder in placeholder map");
   return entry->placeholderFrame->GetOutOfFlowFrame() == key;
 }
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -180,17 +180,17 @@ struct RuleHashTableEntry : public PLDHa
 
 struct RuleHashTagTableEntry : public RuleHashTableEntry {
   // If you add members that have heap allocated memory be sure to change the
   // logic in RuleHash::SizeOf{In,Ex}cludingThis.
   nsCOMPtr<nsIAtom> mTag;
 };
 
 static PLDHashNumber
-RuleHash_CIHashKey(PLDHashTable *table, const void *key)
+RuleHash_CIHashKey(const void *key)
 {
   nsIAtom *atom = const_cast<nsIAtom*>(static_cast<const nsIAtom*>(key));
 
   nsAutoString str;
   atom->ToString(str);
   nsContentUtils::ASCIIToLower(str);
   return HashString(str);
 }
@@ -227,39 +227,35 @@ CIMatchAtoms(const void* key, nsIAtom *e
 static inline bool
 CSMatchAtoms(const void* key, nsIAtom *entry_atom)
 {
   auto match_atom = const_cast<nsIAtom*>(static_cast<const nsIAtom*>(key));
   return match_atom == entry_atom;
 }
 
 static bool
-RuleHash_ClassCIMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                           const void *key)
+RuleHash_ClassCIMatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   return CIMatchAtoms(key, SubjectSelectorForRuleHash(hdr)->mClassList->mAtom);
 }
 
 static bool
-RuleHash_IdCIMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                        const void *key)
+RuleHash_IdCIMatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   return CIMatchAtoms(key, SubjectSelectorForRuleHash(hdr)->mIDList->mAtom);
 }
 
 static bool
-RuleHash_ClassCSMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                           const void *key)
+RuleHash_ClassCSMatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   return CSMatchAtoms(key, SubjectSelectorForRuleHash(hdr)->mClassList->mAtom);
 }
 
 static bool
-RuleHash_IdCSMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                        const void *key)
+RuleHash_IdCSMatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   return CSMatchAtoms(key, SubjectSelectorForRuleHash(hdr)->mIDList->mAtom);
 }
 
 static void
 RuleHash_InitEntry(PLDHashEntryHdr *hdr, const void *key)
 {
   RuleHashTableEntry* entry = static_cast<RuleHashTableEntry*>(hdr);
@@ -282,18 +278,17 @@ RuleHash_MoveEntry(PLDHashTable *table, 
     const_cast<RuleHashTableEntry*>(
       static_cast<const RuleHashTableEntry*>(from));
   RuleHashTableEntry *newEntry = new (to) RuleHashTableEntry();
   newEntry->mRules.SwapElements(oldEntry->mRules);
   oldEntry->~RuleHashTableEntry();
 }
 
 static bool
-RuleHash_TagTable_MatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                      const void *key)
+RuleHash_TagTable_MatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   nsIAtom *match_atom = const_cast<nsIAtom*>(static_cast<const nsIAtom*>(key));
   nsIAtom *entry_atom = static_cast<const RuleHashTagTableEntry*>(hdr)->mTag;
 
   return match_atom == entry_atom;
 }
 
 static void
@@ -321,25 +316,23 @@ RuleHash_TagTable_MoveEntry(PLDHashTable
       static_cast<const RuleHashTagTableEntry*>(from));
   RuleHashTagTableEntry *newEntry = new (to) RuleHashTagTableEntry();
   newEntry->mTag.swap(oldEntry->mTag);
   newEntry->mRules.SwapElements(oldEntry->mRules);
   oldEntry->~RuleHashTagTableEntry();
 }
 
 static PLDHashNumber
-RuleHash_NameSpaceTable_HashKey(PLDHashTable *table, const void *key)
+RuleHash_NameSpaceTable_HashKey(const void *key)
 {
   return NS_PTR_TO_INT32(key);
 }
 
 static bool
-RuleHash_NameSpaceTable_MatchEntry(PLDHashTable *table,
-                                   const PLDHashEntryHdr *hdr,
-                                   const void *key)
+RuleHash_NameSpaceTable_MatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   const RuleHashTableEntry *entry =
     static_cast<const RuleHashTableEntry*>(hdr);
 
   nsCSSSelector* selector = entry->mRules[0].mSelector;
   if (selector->IsPseudoElement()) {
     selector = selector->mNext;
   }
@@ -813,18 +806,17 @@ AtomSelector_MoveEntry(PLDHashTable *tab
     const_cast<AtomSelectorEntry*>(static_cast<const AtomSelectorEntry*>(from));
   AtomSelectorEntry *newEntry = new (to) AtomSelectorEntry();
   newEntry->mAtom = oldEntry->mAtom;
   newEntry->mSelectors.SwapElements(oldEntry->mSelectors);
   oldEntry->~AtomSelectorEntry();
 }
 
 static bool
-AtomSelector_CIMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                          const void *key)
+AtomSelector_CIMatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   const AtomSelectorEntry *entry = static_cast<const AtomSelectorEntry*>(hdr);
   return CIMatchAtoms(key, entry->mAtom);
 }
 
 // Case-sensitive ops.
 static const PLDHashTableOps AtomSelector_CSOps = {
   PLDHashTable::HashVoidPtrKeyStub,
@@ -3485,24 +3477,23 @@ struct PerWeightData {
   PerWeightDataListItem **mTail;
 };
 
 struct RuleByWeightEntry : public PLDHashEntryHdr {
   PerWeightData data; // mWeight is key, mRuleSelectorPairs are value
 };
 
 static PLDHashNumber
-HashIntKey(PLDHashTable *table, const void *key)
+HashIntKey(const void *key)
 {
   return PLDHashNumber(NS_PTR_TO_INT32(key));
 }
 
 static bool
-MatchWeightEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                 const void *key)
+MatchWeightEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   const RuleByWeightEntry *entry = (const RuleByWeightEntry *)hdr;
   return entry->data.mWeight == NS_PTR_TO_INT32(key);
 }
 
 static void
 InitWeightEntry(PLDHashEntryHdr *hdr, const void *key)
 {
--- a/layout/style/nsHTMLStyleSheet.cpp
+++ b/layout/style/nsHTMLStyleSheet.cpp
@@ -159,17 +159,17 @@ nsHTMLStyleSheet::LangRule::List(FILE* o
 
 // -----------------------------------------------------------
 
 struct MappedAttrTableEntry : public PLDHashEntryHdr {
   nsMappedAttributes *mAttributes;
 };
 
 static PLDHashNumber
-MappedAttrTable_HashKey(PLDHashTable *table, const void *key)
+MappedAttrTable_HashKey(const void *key)
 {
   nsMappedAttributes *attributes =
     static_cast<nsMappedAttributes*>(const_cast<void*>(key));
 
   return attributes->HashValue();
 }
 
 static void
@@ -177,18 +177,17 @@ MappedAttrTable_ClearEntry(PLDHashTable 
 {
   MappedAttrTableEntry *entry = static_cast<MappedAttrTableEntry*>(hdr);
 
   entry->mAttributes->DropStyleSheetReference();
   memset(entry, 0, sizeof(MappedAttrTableEntry));
 }
 
 static bool
-MappedAttrTable_MatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                           const void *key)
+MappedAttrTable_MatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   nsMappedAttributes *attributes =
     static_cast<nsMappedAttributes*>(const_cast<void*>(key));
   const MappedAttrTableEntry *entry =
     static_cast<const MappedAttrTableEntry*>(hdr);
 
   return attributes->Equals(entry->mAttributes);
 }
@@ -203,34 +202,33 @@ static const PLDHashTableOps MappedAttrT
 
 // -----------------------------------------------------------
 
 struct LangRuleTableEntry : public PLDHashEntryHdr {
   RefPtr<nsHTMLStyleSheet::LangRule> mRule;
 };
 
 static PLDHashNumber
-LangRuleTable_HashKey(PLDHashTable *table, const void *key)
+LangRuleTable_HashKey(const void *key)
 {
   const nsString *lang = static_cast<const nsString*>(key);
   return HashString(*lang);
 }
 
 static void
 LangRuleTable_ClearEntry(PLDHashTable *table, PLDHashEntryHdr *hdr)
 {
   LangRuleTableEntry *entry = static_cast<LangRuleTableEntry*>(hdr);
 
   entry->~LangRuleTableEntry();
   memset(entry, 0, sizeof(LangRuleTableEntry));
 }
 
 static bool
-LangRuleTable_MatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                         const void *key)
+LangRuleTable_MatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   const nsString *lang = static_cast<const nsString*>(key);
   const LangRuleTableEntry *entry = static_cast<const LangRuleTableEntry*>(hdr);
 
   return entry->mRule->mLang == *lang;
 }
 
 static void
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -123,28 +123,27 @@ static void
  */
 
 struct ChildrenHashEntry : public PLDHashEntryHdr {
   // key is |mRuleNode->GetKey()|
   nsRuleNode *mRuleNode;
 };
 
 /* static */ PLDHashNumber
-nsRuleNode::ChildrenHashHashKey(PLDHashTable *aTable, const void *aKey)
+nsRuleNode::ChildrenHashHashKey(const void *aKey)
 {
   const nsRuleNode::Key *key =
     static_cast<const nsRuleNode::Key*>(aKey);
   // Disagreement on importance and level for the same rule is extremely
   // rare, so hash just on the rule.
-  return PLDHashTable::HashVoidPtrKeyStub(aTable, key->mRule);
+  return PLDHashTable::HashVoidPtrKeyStub(key->mRule);
 }
 
 /* static */ bool
-nsRuleNode::ChildrenHashMatchEntry(PLDHashTable *aTable,
-                                   const PLDHashEntryHdr *aHdr,
+nsRuleNode::ChildrenHashMatchEntry(const PLDHashEntryHdr *aHdr,
                                    const void *aKey)
 {
   const ChildrenHashEntry *entry =
     static_cast<const ChildrenHashEntry*>(aHdr);
   const nsRuleNode::Key *key =
     static_cast<const nsRuleNode::Key*>(aKey);
   return entry->mRuleNode->GetKey() == *key;
 }
--- a/layout/style/nsRuleNode.h
+++ b/layout/style/nsRuleNode.h
@@ -446,22 +446,20 @@ private:
 
     bool operator!=(const Key& aOther) const
     {
       return !(*this == aOther);
     }
   };
 
   static PLDHashNumber
-  ChildrenHashHashKey(PLDHashTable *aTable, const void *aKey);
+  ChildrenHashHashKey(const void *aKey);
 
   static bool
-  ChildrenHashMatchEntry(PLDHashTable *aTable,
-                         const PLDHashEntryHdr *aHdr,
-                         const void *aKey);
+  ChildrenHashMatchEntry(const PLDHashEntryHdr *aHdr, const void *aKey);
 
   void SweepChildren(nsTArray<nsRuleNode*>& aSweepQueue);
   bool DestroyIfNotMarked();
 
   static const PLDHashTableOps ChildrenHashOps;
 
   Key GetKey() const {
     return Key(mRule, GetLevel(), IsImportantRule());
--- a/layout/tables/SpanningCellSorter.cpp
+++ b/layout/tables/SpanningCellSorter.cpp
@@ -32,24 +32,23 @@ SpanningCellSorter::HashTableOps = {
     HashTableHashKey,
     HashTableMatchEntry,
     PLDHashTable::MoveEntryStub,
     PLDHashTable::ClearEntryStub,
     nullptr
 };
 
 /* static */ PLDHashNumber
-SpanningCellSorter::HashTableHashKey(PLDHashTable *table, const void *key)
+SpanningCellSorter::HashTableHashKey(const void *key)
 {
     return NS_PTR_TO_INT32(key);
 }
 
 /* static */ bool
-SpanningCellSorter::HashTableMatchEntry(PLDHashTable *table,
-                                        const PLDHashEntryHdr *hdr,
+SpanningCellSorter::HashTableMatchEntry(const PLDHashEntryHdr *hdr,
                                         const void *key)
 {
     const HashTableEntry *entry = static_cast<const HashTableEntry*>(hdr);
     return NS_PTR_TO_INT32(key) == entry->mColSpan;
 }
 
 bool
 SpanningCellSorter::AddCell(int32_t aColSpan, int32_t aRow, int32_t aCol)
--- a/layout/tables/SpanningCellSorter.h
+++ b/layout/tables/SpanningCellSorter.h
@@ -65,21 +65,19 @@ private:
     PLDHashTable mHashTable;
     struct HashTableEntry : public PLDHashEntryHdr {
         int32_t mColSpan;
         Item *mItems;
     };
 
     static const PLDHashTableOps HashTableOps;
 
-    static PLDHashNumber
-        HashTableHashKey(PLDHashTable *table, const void *key);
+    static PLDHashNumber HashTableHashKey(const void *key);
     static bool
-        HashTableMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                            const void *key);
+        HashTableMatchEntry(const PLDHashEntryHdr *hdr, const void *key);
 
     static int SortArray(const void *a, const void *b, void *closure);
 
     /* state used only during enumeration */
     uint32_t mEnumerationIndex; // into mArray or mSortedHashTable
     HashTableEntry **mSortedHashTable;
 
     /*
--- a/modules/libpref/prefapi.cpp
+++ b/modules/libpref/prefapi.cpp
@@ -49,18 +49,17 @@ clearPrefEntry(PLDHashTable *table, PLDH
     }
     // don't need to free this as it's allocated in memory owned by
     // gPrefNameArena
     pref->key = nullptr;
     memset(entry, 0, table->EntrySize());
 }
 
 static bool
-matchPrefEntry(PLDHashTable*, const PLDHashEntryHdr* entry,
-               const void* key)
+matchPrefEntry(const PLDHashEntryHdr* entry, const void* key)
 {
     const PrefHashEntry *prefEntry =
         static_cast<const PrefHashEntry*>(entry);
 
     if (prefEntry->key == key) return true;
 
     if (!prefEntry->key || !key) return false;
 
--- a/netwerk/base/nsLoadGroup.cpp
+++ b/netwerk/base/nsLoadGroup.cpp
@@ -51,18 +51,17 @@ public:
         mKey(aRequest)
     {
     }
 
     nsCOMPtr<nsIRequest> mKey;
 };
 
 static bool
-RequestHashMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *entry,
-                      const void *key)
+RequestHashMatchEntry(const PLDHashEntryHdr *entry, const void *key)
 {
     const RequestMapEntry *e =
         static_cast<const RequestMapEntry *>(entry);
     const nsIRequest *request = static_cast<const nsIRequest *>(key);
 
     return e->mKey == request;
 }
 
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -471,24 +471,23 @@ nsCacheEntryHashTable::Iter()
     return PLDHashTable::Iterator(&table);
 }
 
 /**
  *  hash table operation callback functions
  */
 
 PLDHashNumber
-nsCacheEntryHashTable::HashKey( PLDHashTable *table, const void *key)
+nsCacheEntryHashTable::HashKey(const void *key)
 {
     return HashString(*static_cast<const nsCString *>(key));
 }
 
 bool
-nsCacheEntryHashTable::MatchEntry(PLDHashTable *       /* table */,
-                                  const PLDHashEntryHdr * hashEntry,
+nsCacheEntryHashTable::MatchEntry(const PLDHashEntryHdr * hashEntry,
                                   const void *            key)
 {
     NS_ASSERTION(key !=  nullptr, "### nsCacheEntryHashTable::MatchEntry : null key");
     nsCacheEntry *cacheEntry = ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry;
 
     return cacheEntry->mKey.Equals(*(nsCString *)key);
 }
 
--- a/netwerk/cache/nsCacheEntry.h
+++ b/netwerk/cache/nsCacheEntry.h
@@ -273,21 +273,20 @@ public:
     nsCacheEntry *GetEntry( const nsCString * key);
     nsresult      AddEntry( nsCacheEntry *entry);
     void          RemoveEntry( nsCacheEntry *entry);
 
     PLDHashTable::Iterator Iter();
 
 private:
     // PLDHashTable operation callbacks
-    static PLDHashNumber  HashKey( PLDHashTable *table, const void *key);
+    static PLDHashNumber  HashKey(const void *key);
 
-    static bool           MatchEntry( PLDHashTable *           table,
-                                      const PLDHashEntryHdr *  entry,
-                                      const void *             key);
+    static bool           MatchEntry(const PLDHashEntryHdr *  entry,
+                                     const void *             key);
 
     static void           MoveEntry( PLDHashTable *table,
                                      const PLDHashEntryHdr *from,
                                      PLDHashEntryHdr       *to);
 
     static void           ClearEntry( PLDHashTable *table, PLDHashEntryHdr *entry);
 
     static void           Finalize( PLDHashTable *table);
--- a/netwerk/cache/nsDiskCacheBinding.cpp
+++ b/netwerk/cache/nsDiskCacheBinding.cpp
@@ -19,26 +19,25 @@ using namespace mozilla;
  *
  *****************************************************************************/
 struct HashTableEntry : PLDHashEntryHdr {
     nsDiskCacheBinding *  mBinding;
 };
 
 
 static PLDHashNumber
-HashKey( PLDHashTable *table, const void *key)
+HashKey(const void *key)
 {
     return (PLDHashNumber) NS_PTR_TO_INT32(key);
 }
 
 
 static bool
-MatchEntry(PLDHashTable *              /* table */,
-            const PLDHashEntryHdr *       header,
-            const void *                  key)
+MatchEntry(const PLDHashEntryHdr *       header,
+           const void *                  key)
 {
     HashTableEntry * hashEntry = (HashTableEntry *) header;
     return (hashEntry->mBinding->mRecord.HashNumber() == (PLDHashNumber) NS_PTR_TO_INT32(key));
 }
 
 static void
 MoveEntry(PLDHashTable *           /* table */,
           const PLDHashEntryHdr *     src,
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -389,26 +389,25 @@ nsHostRecord::RemoveOrRefresh()
 //----------------------------------------------------------------------------
 
 struct nsHostDBEnt : PLDHashEntryHdr
 {
     nsHostRecord *rec;
 };
 
 static PLDHashNumber
-HostDB_HashKey(PLDHashTable *table, const void *key)
+HostDB_HashKey(const void *key)
 {
     const nsHostKey *hk = static_cast<const nsHostKey *>(key);
     return AddToHash(HashString(hk->host), RES_KEY_FLAGS(hk->flags), hk->af,
                      HashString(hk->netInterface));
 }
 
 static bool
-HostDB_MatchEntry(PLDHashTable *table,
-                  const PLDHashEntryHdr *entry,
+HostDB_MatchEntry(const PLDHashEntryHdr *entry,
                   const void *key)
 {
     const nsHostDBEnt *he = static_cast<const nsHostDBEnt *>(entry);
     const nsHostKey *hk = static_cast<const nsHostKey *>(key); 
 
     return !strcmp(he->rec->host, hk->host) &&
             RES_KEY_FLAGS (he->rec->flags) == RES_KEY_FLAGS(hk->flags) &&
             he->rec->af == hk->af &&
--- a/netwerk/protocol/http/nsHttp.cpp
+++ b/netwerk/protocol/http/nsHttp.cpp
@@ -56,27 +56,26 @@ NewHeapAtom(const char *value) {
     a->next = sHeapAtoms;
     sHeapAtoms = a;
 
     return a;
 }
 
 // Hash string ignore case, based on PL_HashString
 static PLDHashNumber
-StringHash(PLDHashTable *table, const void *key)
+StringHash(const void *key)
 {
     PLDHashNumber h = 0;
     for (const char *s = reinterpret_cast<const char*>(key); *s; ++s)
         h = AddToHash(h, nsCRT::ToLower(*s));
     return h;
 }
 
 static bool
-StringCompare(PLDHashTable *table, const PLDHashEntryHdr *entry,
-              const void *testKey)
+StringCompare(const PLDHashEntryHdr *entry, const void *testKey)
 {
     const void *entryKey =
             reinterpret_cast<const PLDHashEntryStub *>(entry)->key;
 
     return PL_strcasecmp(reinterpret_cast<const char *>(entryKey),
                          reinterpret_cast<const char *>(testKey)) == 0;
 }
 
--- a/parser/htmlparser/nsHTMLEntities.cpp
+++ b/parser/htmlparser/nsHTMLEntities.cpp
@@ -18,40 +18,35 @@ struct EntityNode {
   int32_t       mUnicode;
 };
 
 struct EntityNodeEntry : public PLDHashEntryHdr
 {
   const EntityNode* node;
 }; 
 
-static bool
-  matchNodeString(PLDHashTable*, const PLDHashEntryHdr* aHdr,
-                  const void* key)
+static bool matchNodeString(const PLDHashEntryHdr* aHdr, const void* key)
 {
   const EntityNodeEntry* entry = static_cast<const EntityNodeEntry*>(aHdr);
   const char* str = static_cast<const char*>(key);
   return (nsCRT::strcmp(entry->node->mStr, str) == 0);
 }
 
-static bool
-  matchNodeUnicode(PLDHashTable*, const PLDHashEntryHdr* aHdr,
-                   const void* key)
+static bool matchNodeUnicode(const PLDHashEntryHdr* aHdr, const void* key)
 {
   const EntityNodeEntry* entry = static_cast<const EntityNodeEntry*>(aHdr);
   const int32_t ucode = NS_PTR_TO_INT32(key);
   return (entry->node->mUnicode == ucode);
 }
 
-static PLDHashNumber
-  hashUnicodeValue(PLDHashTable*, const void* key)
+static PLDHashNumber hashUnicodeValue(const void* key)
 {
   // key is actually the unicode value
   return PLDHashNumber(NS_PTR_TO_INT32(key));
-  }
+}
 
 
 static const PLDHashTableOps EntityToUnicodeOps = {
   PLDHashTable::HashStringKey,
   matchNodeString,
   PLDHashTable::MoveEntryStub,
   PLDHashTable::ClearEntryStub,
   nullptr,
--- a/rdf/base/nsRDFService.cpp
+++ b/rdf/base/nsRDFService.cpp
@@ -116,24 +116,23 @@ static PLHashAllocOps dataSourceHashAllo
 // For the mResources hashtable.
 //
 
 struct ResourceHashEntry : public PLDHashEntryHdr {
     const char *mKey;
     nsIRDFResource *mResource;
 
     static PLDHashNumber
-    HashKey(PLDHashTable *table, const void *key)
+    HashKey(const void *key)
     {
         return HashString(static_cast<const char *>(key));
     }
 
     static bool
-    MatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-               const void *key)
+    MatchEntry(const PLDHashEntryHdr *hdr, const void *key)
     {
         const ResourceHashEntry *entry =
             static_cast<const ResourceHashEntry *>(hdr);
 
         return 0 == nsCRT::strcmp(static_cast<const char *>(key),
                                   entry->mKey);
     }
 };
@@ -151,24 +150,23 @@ static const PLDHashTableOps gResourceTa
 // For the mLiterals hashtable.
 //
 
 struct LiteralHashEntry : public PLDHashEntryHdr {
     nsIRDFLiteral *mLiteral;
     const char16_t *mKey;
 
     static PLDHashNumber
-    HashKey(PLDHashTable *table, const void *key)
+    HashKey(const void *key)
     {
         return HashString(static_cast<const char16_t *>(key));
     }
 
     static bool
-    MatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-               const void *key)
+    MatchEntry(const PLDHashEntryHdr *hdr, const void *key)
     {
         const LiteralHashEntry *entry =
             static_cast<const LiteralHashEntry *>(hdr);
 
         return 0 == nsCRT::strcmp(static_cast<const char16_t *>(key),
                                   entry->mKey);
     }
 };
@@ -186,24 +184,23 @@ static const PLDHashTableOps gLiteralTab
 // For the mInts hashtable.
 //
 
 struct IntHashEntry : public PLDHashEntryHdr {
     nsIRDFInt *mInt;
     int32_t    mKey;
 
     static PLDHashNumber
-    HashKey(PLDHashTable *table, const void *key)
+    HashKey(const void *key)
     {
         return PLDHashNumber(*static_cast<const int32_t *>(key));
     }
 
     static bool
-    MatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-               const void *key)
+    MatchEntry(const PLDHashEntryHdr *hdr, const void *key)
     {
         const IntHashEntry *entry =
             static_cast<const IntHashEntry *>(hdr);
 
         return *static_cast<const int32_t *>(key) == entry->mKey;
     }
 };
 
@@ -220,28 +217,27 @@ static const PLDHashTableOps gIntTableOp
 // For the mDates hashtable.
 //
 
 struct DateHashEntry : public PLDHashEntryHdr {
     nsIRDFDate *mDate;
     PRTime      mKey;
 
     static PLDHashNumber
-    HashKey(PLDHashTable *table, const void *key)
+    HashKey(const void *key)
     {
         // xor the low 32 bits with the high 32 bits.
         PRTime t = *static_cast<const PRTime *>(key);
         int32_t h32 = int32_t(t >> 32);
         int32_t l32 = int32_t(0xffffffff & t);
         return PLDHashNumber(l32 ^ h32);
     }
 
     static bool
-    MatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-               const void *key)
+    MatchEntry(const PLDHashEntryHdr *hdr, const void *key)
     {
         const DateHashEntry *entry =
             static_cast<const DateHashEntry *>(hdr);
 
         return *static_cast<const PRTime *>(key) == entry->mKey;
     }
 };
 
@@ -333,26 +329,25 @@ BlobImpl::GetLength(int32_t *aResult)
 //
 // For the mBlobs hashtable.
 //
 
 struct BlobHashEntry : public PLDHashEntryHdr {
     BlobImpl *mBlob;
 
     static PLDHashNumber
-    HashKey(PLDHashTable *table, const void *key)
+    HashKey(const void *key)
     {
         const BlobImpl::Data *data =
             static_cast<const BlobImpl::Data *>(key);
         return HashBytes(data->mBytes, data->mLength);
     }
 
     static bool
-    MatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-               const void *key)
+    MatchEntry(const PLDHashEntryHdr *hdr, const void *key)
     {
         const BlobHashEntry *entry =
             static_cast<const BlobHashEntry *>(hdr);
 
         const BlobImpl::Data *left = &entry->mBlob->mData;
 
         const BlobImpl::Data *right =
             static_cast<const BlobImpl::Data *>(key);
--- a/security/manager/ssl/nsCertOverrideService.h
+++ b/security/manager/ssl/nsCertOverrideService.h
@@ -102,19 +102,17 @@ class nsCertOverrideEntry final : public
 
     static KeyTypePointer KeyToPointer(KeyType aKey)
     {
       return aKey;
     }
 
     static PLDHashNumber HashKey(KeyTypePointer aKey)
     {
-      // PLDHashTable::HashStringKey doesn't use the table parameter, so we can
-      // safely pass nullptr
-      return PLDHashTable::HashStringKey(nullptr, aKey);
+      return PLDHashTable::HashStringKey(aKey);
     }
 
     enum { ALLOW_MEMMOVE = false };
 
     // get methods
     inline const nsCString &HostWithPort() const { return mHostWithPort; }
 
     inline KeyTypePointer HostWithPortPtr() const
--- a/security/manager/ssl/nsCertTree.cpp
+++ b/security/manager/ssl/nsCertTree.cpp
@@ -56,18 +56,17 @@ CompareCacheHashEntry::CompareCacheHashE
 :key(nullptr)
 {
   for (int i = 0; i < max_criterions; ++i) {
     mCritInit[i] = false;
   }
 }
 
 static bool
-CompareCacheMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                         const void *key)
+CompareCacheMatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   const CompareCacheHashEntryPtr *entryPtr = static_cast<const CompareCacheHashEntryPtr*>(hdr);
   return entryPtr->entry->key == key;
 }
 
 static void
 CompareCacheInitEntry(PLDHashEntryHdr *hdr, const void *key)
 {
--- a/security/manager/ssl/nsClientAuthRemember.h
+++ b/security/manager/ssl/nsClientAuthRemember.h
@@ -82,19 +82,17 @@ class nsClientAuthRememberEntry final : 
 
     static KeyTypePointer KeyToPointer(KeyType aKey)
     {
       return aKey;
     }
 
     static PLDHashNumber HashKey(KeyTypePointer aKey)
     {
-      // PLDHashTable::HashStringKey doesn't use the table parameter, so we can
-      // safely pass nullptr
-      return PLDHashTable::HashStringKey(nullptr, aKey);
+      return PLDHashTable::HashStringKey(aKey);
     }
 
     enum { ALLOW_MEMMOVE = false };
 
     // get methods
     inline const nsCString &HostWithCert() const { return mHostWithCert; }
 
     inline KeyTypePointer HostWithCertPtr() const
--- a/security/manager/ssl/nsNSSShutDown.cpp
+++ b/security/manager/ssl/nsNSSShutDown.cpp
@@ -9,18 +9,17 @@ using namespace mozilla;
 
 extern LazyLogModule gPIPNSSLog;
 
 struct ObjectHashEntry : PLDHashEntryHdr {
   nsNSSShutDownObject *obj;
 };
 
 static bool
-ObjectSetMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                         const void *key)
+ObjectSetMatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   const ObjectHashEntry *entry = static_cast<const ObjectHashEntry*>(hdr);
   return entry->obj == static_cast<const nsNSSShutDownObject*>(key);
 }
 
 static void
 ObjectSetInitEntry(PLDHashEntryHdr *hdr, const void *key)
 {
--- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp
@@ -51,18 +51,17 @@ using namespace mozilla;
 //
 LazyLogModule gSecureDocLog("nsSecureBrowserUI");
 
 struct RequestHashEntry : PLDHashEntryHdr {
     void *r;
 };
 
 static bool
-RequestMapMatchEntry(PLDHashTable *table, const PLDHashEntryHdr *hdr,
-                         const void *key)
+RequestMapMatchEntry(const PLDHashEntryHdr *hdr, const void *key)
 {
   const RequestHashEntry *entry = static_cast<const RequestHashEntry*>(hdr);
   return entry->r == key;
 }
 
 static void
 RequestMapInitEntry(PLDHashEntryHdr *hdr, const void *key)
 {
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -789,19 +789,17 @@ private:
 
 struct PtrToNodeEntry : public PLDHashEntryHdr
 {
   // The key is mNode->mPointer
   PtrInfo* mNode;
 };
 
 static bool
-PtrToNodeMatchEntry(PLDHashTable* aTable,
-                    const PLDHashEntryHdr* aEntry,
-                    const void* aKey)
+PtrToNodeMatchEntry(const PLDHashEntryHdr* aEntry, const void* aKey)
 {
   const PtrToNodeEntry* n = static_cast<const PtrToNodeEntry*>(aEntry);
   return n->mNode->mPointer == aKey;
 }
 
 static PLDHashTableOps PtrNodeOps = {
   PLDHashTable::HashVoidPtrKeyStub,
   PtrToNodeMatchEntry,
--- a/xpcom/base/nsMemoryReporterManager.cpp
+++ b/xpcom/base/nsMemoryReporterManager.cpp
@@ -751,25 +751,24 @@ struct SegmentKind
   DWORD mState;
   DWORD mType;
   DWORD mProtect;
   int mIsStack;
 };
 
 struct SegmentEntry : public PLDHashEntryHdr
 {
-  static PLDHashNumber HashKey(PLDHashTable* aTable, const void* aKey)
+  static PLDHashNumber HashKey(const void* aKey)
   {
     auto kind = static_cast<const SegmentKind*>(aKey);
     return mozilla::HashGeneric(kind->mState, kind->mType, kind->mProtect,
                                 kind->mIsStack);
   }
 
-  static bool MatchEntry(PLDHashTable* aTable,
-                         const PLDHashEntryHdr* aEntry, const void* aKey)
+  static bool MatchEntry(const PLDHashEntryHdr* aEntry, const void* aKey)
   {
     auto kind = static_cast<const SegmentKind*>(aKey);
     auto entry = static_cast<const SegmentEntry*>(aEntry);
     return kind->mState == entry->mKind.mState &&
            kind->mType == entry->mKind.mType &&
            kind->mProtect == entry->mKind.mProtect &&
            kind->mIsStack == entry->mKind.mIsStack;
   }
--- a/xpcom/ds/nsAtomTable.cpp
+++ b/xpcom/ds/nsAtomTable.cpp
@@ -231,25 +231,24 @@ struct AtomTableKey
 
   const char16_t* mUTF16String;
   const char* mUTF8String;
   uint32_t mLength;
   uint32_t mHash;
 };
 
 static PLDHashNumber
-AtomTableGetHash(PLDHashTable* aTable, const void* aKey)
+AtomTableGetHash(const void* aKey)
 {
   const AtomTableKey* k = static_cast<const AtomTableKey*>(aKey);
   return k->mHash;
 }
 
 static bool
-AtomTableMatchKey(PLDHashTable* aTable, const PLDHashEntryHdr* aEntry,
-                  const void* aKey)
+AtomTableMatchKey(const PLDHashEntryHdr* aEntry, const void* aKey)
 {
   const AtomTableEntry* he = static_cast<const AtomTableEntry*>(aEntry);
   const AtomTableKey* k = static_cast<const AtomTableKey*>(aKey);
 
   if (k->mUTF8String) {
     return
       CompareUTF8toUTF16(nsDependentCSubstring(k->mUTF8String,
                                                k->mUTF8String + k->mLength),
--- a/xpcom/ds/nsStaticNameTable.cpp
+++ b/xpcom/ds/nsStaticNameTable.cpp
@@ -45,18 +45,17 @@ struct NameTableKey
 };
 
 struct NameTableEntry : public PLDHashEntryHdr
 {
   int32_t mIndex;
 };
 
 static bool
-matchNameKeysCaseInsensitive(PLDHashTable*, const PLDHashEntryHdr* aHdr,
-                             const void* aVoidKey)
+matchNameKeysCaseInsensitive(const PLDHashEntryHdr* aHdr, const void* aVoidKey)
 {
   auto entry = static_cast<const NameTableEntry*>(aHdr);
   auto key = static_cast<const NameTableKey*>(aVoidKey);
   const nsDependentCString* name = &key->mNameArray[entry->mIndex];
 
   return key->mIsUnichar
        ? key->mKeyStr.m2b->LowerCaseEqualsASCII(name->get(), name->Length())
        : key->mKeyStr.m1b->LowerCaseEqualsASCII(name->get(), name->Length());
@@ -66,17 +65,17 @@ matchNameKeysCaseInsensitive(PLDHashTabl
  * caseInsensitiveHashKey is just like PLDHashTable::HashStringKey except it
  * uses (*s & ~0x20) instead of simply *s.  This means that "aFOO" and
  * "afoo" and "aFoo" will all hash to the same thing.  It also means
  * that some strings that aren't case-insensensitively equal will hash
  * to the same value, but it's just a hash function so it doesn't
  * matter.
  */
 static PLDHashNumber
-caseInsensitiveStringHashKey(PLDHashTable* aTable, const void* aKey)
+caseInsensitiveStringHashKey(const void* aKey)
 {
   PLDHashNumber h = 0;
   const NameTableKey* tableKey = static_cast<const NameTableKey*>(aKey);
   if (tableKey->mIsUnichar) {
     for (const char16_t* s = tableKey->mKeyStr.m2b->get();
          *s != '\0';
          s++) {
       h = AddToHash(h, *s & ~0x20);
--- a/xpcom/glue/PLDHashTable.cpp
+++ b/xpcom/glue/PLDHashTable.cpp
@@ -58,41 +58,37 @@ public:
     mChk.StartDestructorOp();
   }
   ~AutoDestructorOp() { mChk.EndDestructorOp(); }
 };
 
 #endif
 
 /* static */ PLDHashNumber
-PLDHashTable::HashStringKey(PLDHashTable* aTable, const void* aKey)
+PLDHashTable::HashStringKey(const void* aKey)
 {
   return HashString(static_cast<const char*>(aKey));
 }
 
 /* static */ PLDHashNumber
-PLDHashTable::HashVoidPtrKeyStub(PLDHashTable* aTable, const void* aKey)
+PLDHashTable::HashVoidPtrKeyStub(const void* aKey)
 {
   return (PLDHashNumber)(ptrdiff_t)aKey >> 2;
 }
 
 /* static */ bool
-PLDHashTable::MatchEntryStub(PLDHashTable* aTable,
-                             const PLDHashEntryHdr* aEntry,
-                             const void* aKey)
+PLDHashTable::MatchEntryStub(const PLDHashEntryHdr* aEntry, const void* aKey)
 {
   const PLDHashEntryStub* stub = (const PLDHashEntryStub*)aEntry;
 
   return stub->key == aKey;
 }
 
 /* static */ bool
-PLDHashTable::MatchStringKey(PLDHashTable* aTable,
-                             const PLDHashEntryHdr* aEntry,
-                             const void* aKey)
+PLDHashTable::MatchStringKey(const PLDHashEntryHdr* aEntry, const void* aKey)
 {
   const PLDHashEntryStub* stub = (const PLDHashEntryStub*)aEntry;
 
   // XXX tolerate null keys on account of sloppy Mozilla callers.
   return stub->key == aKey ||
          (stub->key && aKey &&
           strcmp((const char*)stub->key, (const char*)aKey) == 0);
 }
@@ -350,17 +346,17 @@ PLDHashTable::SearchTable(const void* aK
   // Miss: return space for a new entry.
   if (EntryIsFree(entry)) {
     return (Reason == ForAdd) ? entry : nullptr;
   }
 
   // Hit: return entry.
   PLDHashMatchEntry matchEntry = mOps->matchEntry;
   if (MatchEntryKeyhash(entry, aKeyHash) &&
-      matchEntry(this, entry, aKey)) {
+      matchEntry(entry, aKey)) {
     return entry;
   }
 
   // Collision: double hash.
   PLDHashNumber hash2;
   uint32_t sizeMask;
   Hash2(aKeyHash, hash2, sizeMask);
 
@@ -384,17 +380,17 @@ PLDHashTable::SearchTable(const void* aK
 
     entry = AddressEntry(hash1);
     if (EntryIsFree(entry)) {
       return (Reason == ForAdd) ? (firstRemoved ? firstRemoved : entry)
                                 : nullptr;
     }
 
     if (MatchEntryKeyhash(entry, aKeyHash) &&
-        matchEntry(this, entry, aKey)) {
+        matchEntry(entry, aKey)) {
       return entry;
     }
   }
 
   // NOTREACHED
   return nullptr;
 }
 
@@ -496,17 +492,17 @@ PLDHashTable::ChangeTable(int32_t aDelta
   return true;
 }
 
 MOZ_ALWAYS_INLINE PLDHashNumber
 PLDHashTable::ComputeKeyHash(const void* aKey)
 {
   MOZ_ASSERT(mEntryStore.Get());
 
-  PLDHashNumber keyHash = mOps->hashKey(this, aKey);
+  PLDHashNumber keyHash = mOps->hashKey(aKey);
   keyHash *= kGoldenRatio;
 
   // Avoid 0 and 1 hash codes, they indicate free and removed entries.
   if (keyHash < 2) {
     keyHash -= 2;
   }
   keyHash &= ~kCollisionFlag;
 
--- a/xpcom/glue/PLDHashTable.h
+++ b/xpcom/glue/PLDHashTable.h
@@ -391,28 +391,25 @@ public:
 #endif
 
   // 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.
   static const PLDHashTableOps* StubOps();
 
   // The individual stub operations in StubOps().
-  static PLDHashNumber HashVoidPtrKeyStub(PLDHashTable* aTable,
-                                          const void* aKey);
-  static bool MatchEntryStub(PLDHashTable* aTable,
-                             const PLDHashEntryHdr* aEntry, const void* aKey);
+  static PLDHashNumber HashVoidPtrKeyStub(const void* aKey);
+  static bool MatchEntryStub(const PLDHashEntryHdr* aEntry, const void* aKey);
   static void MoveEntryStub(PLDHashTable* aTable, const PLDHashEntryHdr* aFrom,
                             PLDHashEntryHdr* aTo);
   static void ClearEntryStub(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);
 
   // Hash/match operations for tables holding C strings.
-  static PLDHashNumber HashStringKey(PLDHashTable* aTable, const void* aKey);
-  static bool MatchStringKey(PLDHashTable* aTable,
-                             const PLDHashEntryHdr* aEntry, const void* aKey);
+  static PLDHashNumber HashStringKey(const void* aKey);
+  static bool MatchStringKey(const PLDHashEntryHdr* aEntry, const void* aKey);
 
   // This is an iterator for PLDHashtable. Assertions will detect some, but not
   // all, mid-iteration table modifications that might invalidate (e.g.
   // reallocate) the entry storage.
   //
   // Any element can be removed during iteration using Remove(). If any
   // elements are removed, the table may be resized once iteration ends.
   //
@@ -550,25 +547,23 @@ private:
   bool ChangeTable(int aDeltaLog2);
 
   void ShrinkIfAppropriate();
 
   PLDHashTable(const PLDHashTable& aOther) = delete;
   PLDHashTable& operator=(const PLDHashTable& aOther) = delete;
 };
 
-// Compute the hash code for a given key to be looked up, added, or removed
-// from aTable. A hash code may have any PLDHashNumber value.
-typedef PLDHashNumber (*PLDHashHashKey)(PLDHashTable* aTable,
-                                        const void* aKey);
+// Compute the hash code for a given key to be looked up, added, or removed.
+// A hash code may have any PLDHashNumber value.
+typedef PLDHashNumber (*PLDHashHashKey)(const void* aKey);
 
-// Compare the key identifying aEntry in aTable with the provided key parameter.
-// Return true if keys match, false otherwise.
-typedef bool (*PLDHashMatchEntry)(PLDHashTable* aTable,
-                                  const PLDHashEntryHdr* aEntry,
+// Compare the key identifying aEntry with the provided key parameter. Return
+// true if keys match, false otherwise.
+typedef bool (*PLDHashMatchEntry)(const PLDHashEntryHdr* aEntry,
                                   const void* aKey);
 
 // Copy the data starting at aFrom to the new entry storage at aTo. Do not add
 // reference counts for any strong references in the entry, however, as this
 // is a "move" operation: the old entry storage at from will be freed without
 // any reference-decrementing callback shortly.
 typedef void (*PLDHashMoveEntry)(PLDHashTable* aTable,
                                  const PLDHashEntryHdr* aFrom,
--- a/xpcom/glue/nsTHashtable.h
+++ b/xpcom/glue/nsTHashtable.h
@@ -298,21 +298,19 @@ public:
   {
     mTable.MarkImmutable();
   }
 #endif
 
 protected:
   PLDHashTable mTable;
 
-  static const void* s_GetKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);
+  static PLDHashNumber s_HashKey(const void* aKey);
 
-  static PLDHashNumber s_HashKey(PLDHashTable* aTable, const void* aKey);
-
-  static bool s_MatchEntry(PLDHashTable* aTable, const PLDHashEntryHdr* aEntry,
+  static bool s_MatchEntry(const PLDHashEntryHdr* aEntry,
                            const void* aKey);
 
   static void s_CopyEntry(PLDHashTable* aTable, const PLDHashEntryHdr* aFrom,
                           PLDHashEntryHdr* aTo);
 
   static void s_ClearEntry(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);
 
   static void s_InitEntry(PLDHashEntryHdr* aEntry, const void* aKey);
@@ -365,25 +363,24 @@ nsTHashtable<EntryType>::Ops()
   };
   return &sOps;
 }
 
 // static definitions
 
 template<class EntryType>
 PLDHashNumber
-nsTHashtable<EntryType>::s_HashKey(PLDHashTable* aTable, const void* aKey)
+nsTHashtable<EntryType>::s_HashKey(const void* aKey)
 {
   return EntryType::HashKey(static_cast<const KeyTypePointer>(aKey));
 }
 
 template<class EntryType>
 bool
-nsTHashtable<EntryType>::s_MatchEntry(PLDHashTable* aTable,
-                                      const PLDHashEntryHdr* aEntry,
+nsTHashtable<EntryType>::s_MatchEntry(const PLDHashEntryHdr* aEntry,
                                       const void* aKey)
 {
   return ((const EntryType*)aEntry)->KeyEquals(
     static_cast<const KeyTypePointer>(aKey));
 }
 
 template<class EntryType>
 void
--- a/xpcom/tests/gtest/TestPLDHash.cpp
+++ b/xpcom/tests/gtest/TestPLDHash.cpp
@@ -152,17 +152,17 @@ TEST(PLDHashTableTest, LazyStorage)
 
   ASSERT_EQ(t.ShallowSizeOfExcludingThis(moz_malloc_size_of), 0u);
 }
 
 // A trivial hash function is good enough here. It's also super-fast for the
 // GrowToMaxCapacity test because we insert the integers 0.., which means it's
 // collision-free.
 static PLDHashNumber
-TrivialHash(PLDHashTable *table, const void *key)
+TrivialHash(const void *key)
 {
   return (PLDHashNumber)(size_t)key;
 }
 
 static void
 TrivialInitEntry(PLDHashEntryHdr* aEntry, const void* aKey)
 {
   auto entry = static_cast<PLDHashEntryStub*>(aEntry);