Bug 1118024 - Use new PL_DHashTable{Add,Lookup,Remove} functions. r=nfroyd
authorMichael Pruett <michael@68k.org>
Mon, 05 Jan 2015 20:27:28 -0600
changeset 248431 fd2f17917aaeafe67c966b8e5d712a8f88c94f1e
parent 248430 b61a510edfb9aa4800e27e7d5d3803be212e5bcd
child 248432 9f3ee2b72d354e303500e9773a6b6072c54fd4c9
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnfroyd
bugs1118024
milestone37.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 1118024 - Use new PL_DHashTable{Add,Lookup,Remove} functions. r=nfroyd
dom/base/nsContentList.cpp
dom/base/nsContentUtils.cpp
dom/base/nsDocument.cpp
dom/base/nsPropertyTable.cpp
dom/base/nsScriptNameSpaceManager.cpp
dom/plugins/base/nsJSNPRuntime.cpp
dom/xul/XULDocument.cpp
dom/xul/templates/nsContentSupportMap.cpp
dom/xul/templates/nsContentSupportMap.h
dom/xul/templates/nsTemplateMap.h
embedding/components/commandhandler/nsCommandParams.cpp
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/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/nsInMemoryDataSource.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
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -225,19 +225,17 @@ NS_GetContentList(nsINode* aRootNode,
 
   ContentListHashEntry *entry = nullptr;
   // First we look in our hashtable.  Then we create a content list if needed
   if (gContentListHashTable.ops) {
 
     // A PL_DHASH_ADD is equivalent to a PL_DHASH_LOOKUP for cases
     // when the entry is already in the hashtable.
     entry = static_cast<ContentListHashEntry *>
-                       (PL_DHashTableOperate(&gContentListHashTable,
-                                             &hashKey,
-                                             PL_DHASH_ADD));
+                       (PL_DHashTableAdd(&gContentListHashTable, &hashKey));
     if (entry)
       list = entry->mContentList;
   }
 
   if (!list) {
     // We need to create a ContentList and add it to our new entry, if
     // we have an entry
     nsCOMPtr<nsIAtom> xmlAtom = do_GetAtom(aTagname);
@@ -341,19 +339,18 @@ GetFuncStringContentList(nsINode* aRootN
   FuncStringContentListHashEntry *entry = nullptr;
   // First we look in our hashtable.  Then we create a content list if needed
   if (gFuncStringContentListHashTable.ops) {
     nsFuncStringCacheKey hashKey(aRootNode, aFunc, aString);
 
     // A PL_DHASH_ADD is equivalent to a PL_DHASH_LOOKUP for cases
     // when the entry is already in the hashtable.
     entry = static_cast<FuncStringContentListHashEntry *>
-                       (PL_DHashTableOperate(&gFuncStringContentListHashTable,
-                                             &hashKey,
-                                             PL_DHASH_ADD));
+                       (PL_DHashTableAdd(&gFuncStringContentListHashTable,
+                                         &hashKey));
     if (entry) {
       list = entry->mContentList;
 #ifdef DEBUG
       MOZ_ASSERT_IF(list, list->mType == ListType::sType);
 #endif
     }
   }
 
@@ -984,19 +981,17 @@ nsContentList::RemoveFromHashtable()
   uint32_t recentlyUsedCacheIndex = RecentlyUsedCacheIndex(key);
   if (sRecentlyUsedContentLists[recentlyUsedCacheIndex] == this) {
     sRecentlyUsedContentLists[recentlyUsedCacheIndex] = nullptr;
   }
 
   if (!gContentListHashTable.ops)
     return;
 
-  PL_DHashTableOperate(&gContentListHashTable,
-                       &key,
-                       PL_DHASH_REMOVE);
+  PL_DHashTableRemove(&gContentListHashTable, &key);
 
   if (gContentListHashTable.EntryCount() == 0) {
     PL_DHashTableFinish(&gContentListHashTable);
     gContentListHashTable.ops = nullptr;
   }
 }
 
 void
@@ -1027,19 +1022,17 @@ nsCacheableFuncStringContentList::~nsCac
 void
 nsCacheableFuncStringContentList::RemoveFromFuncStringHashtable()
 {
   if (!gFuncStringContentListHashTable.ops) {
     return;
   }
 
   nsFuncStringCacheKey key(mRootNode, mFunc, mString);
-  PL_DHashTableOperate(&gFuncStringContentListHashTable,
-                       &key,
-                       PL_DHASH_REMOVE);
+  PL_DHashTableRemove(&gFuncStringContentListHashTable, &key);
 
   if (gFuncStringContentListHashTable.EntryCount() == 0) {
     PL_DHashTableFinish(&gFuncStringContentListHashTable);
     gFuncStringContentListHashTable.ops = nullptr;
   }
 }
 
 #ifdef DEBUG_CONTENT_LIST
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -3949,18 +3949,17 @@ nsContentUtils::TraverseListenerManager(
 {
   if (!sEventListenerManagersHash.ops) {
     // We're already shut down, just return.
     return;
   }
 
   EventListenerManagerMapEntry *entry =
     static_cast<EventListenerManagerMapEntry *>
-               (PL_DHashTableOperate(&sEventListenerManagersHash, aNode,
-                                        PL_DHASH_LOOKUP));
+               (PL_DHashTableLookup(&sEventListenerManagersHash, aNode));
   if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
     CycleCollectionNoteChild(cb, entry->mListenerManager.get(),
                              "[via hash] mListenerManager");
   }
 }
 
 EventListenerManager*
 nsContentUtils::GetListenerManagerForNode(nsINode *aNode)
@@ -3969,18 +3968,17 @@ nsContentUtils::GetListenerManagerForNod
     // We're already shut down, don't bother creating an event listener
     // manager.
 
     return nullptr;
   }
 
   EventListenerManagerMapEntry *entry =
     static_cast<EventListenerManagerMapEntry *>
-               (PL_DHashTableOperate(&sEventListenerManagersHash, aNode,
-                                        PL_DHASH_ADD));
+               (PL_DHashTableAdd(&sEventListenerManagersHash, aNode));
 
   if (!entry) {
     return nullptr;
   }
 
   if (!entry->mListenerManager) {
     entry->mListenerManager = new EventListenerManager(aNode);
 
@@ -4001,34 +3999,32 @@ nsContentUtils::GetExistingListenerManag
     // We're already shut down, don't bother creating an event listener
     // manager.
 
     return nullptr;
   }
 
   EventListenerManagerMapEntry *entry =
     static_cast<EventListenerManagerMapEntry *>
-               (PL_DHashTableOperate(&sEventListenerManagersHash, aNode,
-                                        PL_DHASH_LOOKUP));
+               (PL_DHashTableLookup(&sEventListenerManagersHash, aNode));
   if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
     return entry->mListenerManager;
   }
 
   return nullptr;
 }
 
 /* static */
 void
 nsContentUtils::RemoveListenerManager(nsINode *aNode)
 {
   if (sEventListenerManagersHash.ops) {
     EventListenerManagerMapEntry *entry =
       static_cast<EventListenerManagerMapEntry *>
-                 (PL_DHashTableOperate(&sEventListenerManagersHash, aNode,
-                                          PL_DHASH_LOOKUP));
+                 (PL_DHashTableLookup(&sEventListenerManagersHash, aNode));
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       nsRefPtr<EventListenerManager> listenerManager;
       listenerManager.swap(entry->mListenerManager);
       // Remove the entry and *then* do operations that could cause further
       // modification of sEventListenerManagersHash.  See bug 334177.
       PL_DHashTableRawRemove(&sEventListenerManagersHash, entry);
       if (listenerManager) {
         listenerManager->Disconnect();
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3955,18 +3955,17 @@ nsDocument::SetSubDocumentFor(Element* a
   NS_ENSURE_TRUE(aElement, NS_ERROR_UNEXPECTED);
 
   if (!aSubDoc) {
     // aSubDoc is nullptr, remove the mapping
 
     if (mSubDocuments) {
       SubDocMapEntry *entry =
         static_cast<SubDocMapEntry*>
-                   (PL_DHashTableOperate(mSubDocuments, aElement,
-                                         PL_DHASH_LOOKUP));
+                   (PL_DHashTableLookup(mSubDocuments, aElement));
 
       if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
         PL_DHashTableRawRemove(mSubDocuments, entry);
       }
     }
   } else {
     if (!mSubDocuments) {
       // Create a new hashtable
@@ -3988,18 +3987,17 @@ nsDocument::SetSubDocumentFor(Element* a
       if (!mSubDocuments) {
         return NS_ERROR_OUT_OF_MEMORY;
       }
     }
 
     // Add a mapping to the hash table
     SubDocMapEntry *entry =
       static_cast<SubDocMapEntry*>
-                 (PL_DHashTableOperate(mSubDocuments, aElement,
-                                       PL_DHASH_ADD));
+                 (PL_DHashTableAdd(mSubDocuments, aElement));
 
     if (!entry) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
     if (entry->mSubDocument) {
       entry->mSubDocument->SetParentDocument(nullptr);
 
@@ -4017,18 +4015,17 @@ nsDocument::SetSubDocumentFor(Element* a
 }
 
 nsIDocument*
 nsDocument::GetSubDocumentFor(nsIContent *aContent) const
 {
   if (mSubDocuments && aContent->IsElement()) {
     SubDocMapEntry *entry =
       static_cast<SubDocMapEntry*>
-                 (PL_DHashTableOperate(mSubDocuments, aContent->AsElement(),
-                                       PL_DHASH_LOOKUP));
+                 (PL_DHashTableLookup(mSubDocuments, aContent->AsElement()));
 
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       return entry->mSubDocument;
     }
   }
 
   return nullptr;
 }
--- a/dom/base/nsPropertyTable.cpp
+++ b/dom/base/nsPropertyTable.cpp
@@ -90,18 +90,17 @@ nsPropertyTable::DeleteAllPropertiesFor(
 nsresult
 nsPropertyTable::TransferOrDeleteAllPropertiesFor(nsPropertyOwner aObject,
                                                   nsPropertyTable *aOtherTable)
 {
   nsresult rv = NS_OK;
   for (PropertyList* prop = mPropertyList; prop; prop = prop->mNext) {
     if (prop->mTransfer) {
       PropertyListMapEntry *entry = static_cast<PropertyListMapEntry*>
-                                               (PL_DHashTableOperate(&prop->mObjectValueMap, aObject,
-                               PL_DHASH_LOOKUP));
+                                               (PL_DHashTableLookup(&prop->mObjectValueMap, aObject));
       if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
         rv = aOtherTable->SetProperty(aObject, prop->mName,
                                       entry->value, prop->mDtorFunc,
                                       prop->mDtorData, prop->mTransfer);
         if (NS_FAILED(rv)) {
           DeleteAllPropertiesFor(aObject);
           aOtherTable->DeleteAllPropertiesFor(aObject);
 
@@ -121,17 +120,17 @@ nsPropertyTable::TransferOrDeleteAllProp
 
 void
 nsPropertyTable::Enumerate(nsPropertyOwner aObject,
                            NSPropertyFunc aCallback, void *aData)
 {
   PropertyList* prop;
   for (prop = mPropertyList; prop; prop = prop->mNext) {
     PropertyListMapEntry *entry = static_cast<PropertyListMapEntry*>
-      (PL_DHashTableOperate(&prop->mObjectValueMap, aObject, PL_DHASH_LOOKUP));
+      (PL_DHashTableLookup(&prop->mObjectValueMap, aObject));
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       aCallback(const_cast<void*>(aObject.get()), prop->mName, entry->value,
                  aData);
     }
   }
 }
 
 struct PropertyEnumeratorData
@@ -169,18 +168,17 @@ nsPropertyTable::GetPropertyInternal(nsP
 {
   NS_PRECONDITION(aPropertyName && aObject, "unexpected null param");
   nsresult rv = NS_PROPTABLE_PROP_NOT_THERE;
   void *propValue = nullptr;
 
   PropertyList* propertyList = GetPropertyListFor(aPropertyName);
   if (propertyList) {
     PropertyListMapEntry *entry = static_cast<PropertyListMapEntry*>
-                                             (PL_DHashTableOperate(&propertyList->mObjectValueMap, aObject,
-                             PL_DHASH_LOOKUP));
+                                             (PL_DHashTableLookup(&propertyList->mObjectValueMap, aObject));
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       propValue = entry->value;
       if (aRemove) {
         // don't call propertyList->mDtorFunc.  That's the caller's job now.
         PL_DHashTableRawRemove(&propertyList->mObjectValueMap, entry);
       }
       rv = NS_OK;
     }
@@ -225,17 +223,17 @@ nsPropertyTable::SetPropertyInternal(nsP
     propertyList->mNext = mPropertyList;
     mPropertyList = propertyList;
   }
 
   // The current property value (if there is one) is replaced and the current
   // value is destroyed
   nsresult result = NS_OK;
   PropertyListMapEntry *entry = static_cast<PropertyListMapEntry*>
-                                           (PL_DHashTableOperate(&propertyList->mObjectValueMap, aObject, PL_DHASH_ADD));
+                                           (PL_DHashTableAdd(&propertyList->mObjectValueMap, aObject));
   if (!entry)
     return NS_ERROR_OUT_OF_MEMORY;
   // A nullptr entry->key is the sign that the entry has just been allocated
   // for us.  If it's non-nullptr then we have an existing entry.
   if (entry->key) {
     if (aOldValue)
       *aOldValue = entry->value;
     else if (propertyList->mDtorFunc)
@@ -324,17 +322,17 @@ nsPropertyTable::PropertyList::Destroy()
     PL_DHashTableEnumerate(&mObjectValueMap, DestroyPropertyEnumerator,
                            nullptr);
 }
 
 bool
 nsPropertyTable::PropertyList::DeletePropertyFor(nsPropertyOwner aObject)
 {
   PropertyListMapEntry *entry = static_cast<PropertyListMapEntry*>
-                                           (PL_DHashTableOperate(&mObjectValueMap, aObject, PL_DHASH_LOOKUP));
+                                           (PL_DHashTableLookup(&mObjectValueMap, aObject));
   if (!PL_DHASH_ENTRY_IS_BUSY(entry))
     return false;
 
   void* value = entry->value;
   PL_DHashTableRawRemove(&mObjectValueMap, entry);
 
   if (mDtorFunc)
     mDtorFunc(const_cast<void*>(aObject.get()), mName, value, mDtorData);
--- a/dom/base/nsScriptNameSpaceManager.cpp
+++ b/dom/base/nsScriptNameSpaceManager.cpp
@@ -139,47 +139,46 @@ nsScriptNameSpaceManager::~nsScriptNameS
 }
 
 nsGlobalNameStruct *
 nsScriptNameSpaceManager::AddToHash(PLDHashTable *aTable, const nsAString *aKey,
                                     const char16_t **aClassName)
 {
   GlobalNameMapEntry *entry =
     static_cast<GlobalNameMapEntry *>
-               (PL_DHashTableOperate(aTable, aKey, PL_DHASH_ADD));
+               (PL_DHashTableAdd(aTable, aKey));
 
   if (!entry) {
     return nullptr;
   }
 
   if (aClassName) {
     *aClassName = entry->mKey.get();
   }
 
   return &entry->mGlobalName;
 }
 
 void
 nsScriptNameSpaceManager::RemoveFromHash(PLDHashTable *aTable,
                                          const nsAString *aKey)
 {
-  PL_DHashTableOperate(aTable, aKey, PL_DHASH_REMOVE);
+  PL_DHashTableRemove(aTable, aKey);
 }
 
 nsGlobalNameStruct*
 nsScriptNameSpaceManager::GetConstructorProto(const nsGlobalNameStruct* aStruct)
 {
   NS_ASSERTION(aStruct->mType == nsGlobalNameStruct::eTypeExternalConstructorAlias,
                "This function only works on constructor aliases!");
   if (!aStruct->mAlias->mProto) {
     GlobalNameMapEntry *proto =
       static_cast<GlobalNameMapEntry *>
-                 (PL_DHashTableOperate(&mGlobalNames,
-                                          &aStruct->mAlias->mProtoName,
-                                          PL_DHASH_LOOKUP));
+                 (PL_DHashTableLookup(&mGlobalNames,
+                                      &aStruct->mAlias->mProtoName));
 
     if (PL_DHASH_ENTRY_IS_BUSY(proto)) {
       aStruct->mAlias->mProto = &proto->mGlobalName;
     }
   }
   return aStruct->mAlias->mProto;
 }
 
@@ -384,18 +383,17 @@ nsScriptNameSpaceManager::Init()
 }
 
 nsGlobalNameStruct*
 nsScriptNameSpaceManager::LookupNameInternal(const nsAString& aName,
                                              const char16_t **aClassName)
 {
   GlobalNameMapEntry *entry =
     static_cast<GlobalNameMapEntry *>
-               (PL_DHashTableOperate(&mGlobalNames, &aName,
-                                        PL_DHASH_LOOKUP));
+               (PL_DHashTableLookup(&mGlobalNames, &aName));
 
   if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
     if (aClassName) {
       *aClassName = entry->mKey.get();
     }
     return &entry->mGlobalName;
   }
 
@@ -405,18 +403,17 @@ nsScriptNameSpaceManager::LookupNameInte
   return nullptr;
 }
 
 const nsGlobalNameStruct*
 nsScriptNameSpaceManager::LookupNavigatorName(const nsAString& aName)
 {
   GlobalNameMapEntry *entry =
     static_cast<GlobalNameMapEntry *>
-               (PL_DHashTableOperate(&mNavigatorNames, &aName,
-                                     PL_DHASH_LOOKUP));
+               (PL_DHashTableLookup(&mNavigatorNames, &aName));
 
   if (!PL_DHASH_ENTRY_IS_BUSY(entry)) {
     return nullptr;
   }
 
   return &entry->mGlobalName;
 }
 
--- a/dom/plugins/base/nsJSNPRuntime.cpp
+++ b/dom/plugins/base/nsJSNPRuntime.cpp
@@ -1745,17 +1745,17 @@ NPObjWrapper_Convert(JSContext *cx, JS::
 }
 
 static void
 NPObjWrapper_Finalize(js::FreeOp *fop, JSObject *obj)
 {
   NPObject *npobj = (NPObject *)::JS_GetPrivate(obj);
   if (npobj) {
     if (sNPObjWrappers.ops) {
-      PL_DHashTableOperate(&sNPObjWrappers, npobj, PL_DHASH_REMOVE);
+      PL_DHashTableRemove(&sNPObjWrappers, npobj);
     }
   }
 
   if (!sDelayedReleases)
     sDelayedReleases = new nsTArray<NPObject*>;
   sDelayedReleases->AppendElement(npobj);
 }
 
@@ -1774,17 +1774,17 @@ NPObjWrapper_ObjectMoved(JSObject *obj, 
     return;
   }
 
   // The hazard analysis thinks that PL_DHashTableOperate() can GC but this is
   // not possible if we pass PL_DHASH_LOOKUP.
   JS::AutoSuppressGCAnalysis nogc;
 
   NPObjWrapperHashEntry *entry = static_cast<NPObjWrapperHashEntry *>
-    (PL_DHashTableOperate(&sNPObjWrappers, npobj, PL_DHASH_LOOKUP));
+    (PL_DHashTableLookup(&sNPObjWrappers, npobj));
   MOZ_ASSERT(PL_DHASH_ENTRY_IS_BUSY(entry) && entry->mJSObj);
   MOZ_ASSERT(entry->mJSObj == old);
   entry->mJSObj = obj;
 }
 
 static bool
 NPObjWrapper_Call(JSContext *cx, unsigned argc, JS::Value *vp)
 {
@@ -1827,17 +1827,17 @@ nsNPObjWrapper::OnDestroy(NPObject *npob
 
   if (!sNPObjWrappers.ops) {
     // No hash yet (or any more), no used wrappers available.
 
     return;
   }
 
   NPObjWrapperHashEntry *entry = static_cast<NPObjWrapperHashEntry *>
-    (PL_DHashTableOperate(&sNPObjWrappers, npobj, PL_DHASH_LOOKUP));
+    (PL_DHashTableLookup(&sNPObjWrappers, npobj));
 
   if (PL_DHASH_ENTRY_IS_BUSY(entry) && entry->mJSObj) {
     // Found a live NPObject wrapper, null out its JSObjects' private
     // data.
 
     ::JS_SetPrivate(entry->mJSObj, nullptr);
 
     // Remove the npobj from the hash now that it went away.
@@ -1878,17 +1878,17 @@ nsNPObjWrapper::GetNewOrUsed(NPP npp, JS
   if (!sNPObjWrappers.ops) {
     // No hash yet (or any more), initialize it.
     if (!CreateNPObjWrapperTable()) {
       return nullptr;
     }
   }
 
   NPObjWrapperHashEntry *entry = static_cast<NPObjWrapperHashEntry *>
-    (PL_DHashTableOperate(&sNPObjWrappers, npobj, PL_DHASH_ADD));
+    (PL_DHashTableAdd(&sNPObjWrappers, npobj));
 
   if (!entry) {
     // Out of memory
     JS_ReportOutOfMemory(cx);
 
     return nullptr;
   }
 
@@ -1912,17 +1912,17 @@ nsNPObjWrapper::GetNewOrUsed(NPP npp, JS
   JS::Rooted<JSObject*> obj(cx, ::JS_NewObject(cx, js::Jsvalify(&sNPObjectJSWrapperClass),
                                                JS::NullPtr(), JS::NullPtr()));
 
   if (generation != sNPObjWrappers.Generation()) {
       // Reload entry if the JS_NewObject call caused a GC and reallocated
       // the table (see bug 445229). This is guaranteed to succeed.
 
       entry = static_cast<NPObjWrapperHashEntry *>
-        (PL_DHashTableOperate(&sNPObjWrappers, npobj, PL_DHASH_LOOKUP));
+        (PL_DHashTableLookup(&sNPObjWrappers, npobj));
       NS_ASSERTION(entry && PL_DHASH_ENTRY_IS_BUSY(entry),
                    "Hashtable didn't find what we just added?");
   }
 
   if (!obj) {
     // OOM? Remove the stale entry from the hash.
 
     PL_DHashTableRawRemove(&sNPObjWrappers, entry);
@@ -2044,17 +2044,17 @@ static NPP
 LookupNPP(NPObject *npobj)
 {
   if (npobj->_class == &nsJSObjWrapper::sJSObjWrapperNPClass) {
     nsJSObjWrapper* o = static_cast<nsJSObjWrapper*>(npobj);
     return o->mNpp;
   }
 
   NPObjWrapperHashEntry *entry = static_cast<NPObjWrapperHashEntry *>
-    (PL_DHashTableOperate(&sNPObjWrappers, npobj, PL_DHASH_ADD));
+    (PL_DHashTableAdd(&sNPObjWrappers, npobj));
 
   if (PL_DHASH_ENTRY_IS_FREE(entry)) {
     return nullptr;
   }
 
   NS_ASSERTION(entry->mNpp, "Live NPObject entry w/o an NPP!");
 
   return entry->mNpp;
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -777,24 +777,22 @@ XULDocument::AddBroadcastListenerFor(Ele
         if (! mBroadcasterMap) {
             aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
             return;
         }
     }
 
     BroadcasterMapEntry* entry =
         static_cast<BroadcasterMapEntry*>
-                   (PL_DHashTableOperate(mBroadcasterMap, &aBroadcaster,
-                                            PL_DHASH_LOOKUP));
+                   (PL_DHashTableLookup(mBroadcasterMap, &aBroadcaster));
 
     if (PL_DHASH_ENTRY_IS_FREE(entry)) {
         entry =
             static_cast<BroadcasterMapEntry*>
-                       (PL_DHashTableOperate(mBroadcasterMap, &aBroadcaster,
-                                                PL_DHASH_ADD));
+                       (PL_DHashTableAdd(mBroadcasterMap, &aBroadcaster));
 
         if (! entry) {
             aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
             return;
         }
 
         entry->mBroadcaster = &aBroadcaster;
 
@@ -845,34 +843,32 @@ XULDocument::RemoveBroadcastListenerFor(
 {
     // If we haven't added any broadcast listeners, then there sure
     // aren't any to remove.
     if (! mBroadcasterMap)
         return;
 
     BroadcasterMapEntry* entry =
         static_cast<BroadcasterMapEntry*>
-                   (PL_DHashTableOperate(mBroadcasterMap, &aBroadcaster,
-                                            PL_DHASH_LOOKUP));
+                   (PL_DHashTableLookup(mBroadcasterMap, &aBroadcaster));
 
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
         nsCOMPtr<nsIAtom> attr = do_GetAtom(aAttr);
         for (int32_t i = entry->mListeners.Count() - 1; i >= 0; --i) {
             BroadcastListener* bl =
                 static_cast<BroadcastListener*>(entry->mListeners[i]);
 
             nsCOMPtr<Element> blListener = do_QueryReferent(bl->mListener);
 
             if (blListener == &aListener && bl->mAttribute == attr) {
                 entry->mListeners.RemoveElementAt(i);
                 delete bl;
 
                 if (entry->mListeners.Count() == 0)
-                    PL_DHashTableOperate(mBroadcasterMap, &aBroadcaster,
-                                         PL_DHASH_REMOVE);
+                    PL_DHashTableRemove(mBroadcasterMap, &aBroadcaster);
 
                 break;
             }
         }
     }
 }
 
 nsresult
@@ -969,18 +965,17 @@ XULDocument::AttributeChanged(nsIDocumen
     
     nsresult rv;
 
     // Synchronize broadcast listeners
     if (mBroadcasterMap &&
         CanBroadcast(aNameSpaceID, aAttribute)) {
         BroadcasterMapEntry* entry =
             static_cast<BroadcasterMapEntry*>
-                       (PL_DHashTableOperate(mBroadcasterMap, aElement,
-                                                PL_DHASH_LOOKUP));
+                       (PL_DHashTableLookup(mBroadcasterMap, aElement));
 
         if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
             // We've got listeners: push the value.
             nsAutoString value;
             bool attrSet = aElement->GetAttr(kNameSpaceID_None, aAttribute, value);
 
             int32_t i;
             for (i = entry->mListeners.Count() - 1; i >= 0; --i) {
@@ -4166,17 +4161,17 @@ XULDocument::BroadcastAttributeChangeFro
 
     if (!mBroadcasterMap || !CanBroadcast(aNameSpaceID, aAttribute))
         return rv;
 
     if (!aNode->IsElement())
         return rv;
 
     BroadcasterMapEntry* entry = static_cast<BroadcasterMapEntry*>
-        (PL_DHashTableOperate(mBroadcasterMap, aNode->AsElement(), PL_DHASH_LOOKUP));
+        (PL_DHashTableLookup(mBroadcasterMap, aNode->AsElement()));
     if (!PL_DHASH_ENTRY_IS_BUSY(entry))
         return rv;
 
     // We've got listeners: push the value.
     int32_t i;
     for (i = entry->mListeners.Count() - 1; i >= 0; --i) {
         BroadcastListener* bl = static_cast<BroadcastListener*>
             (entry->mListeners[i]);
--- a/dom/xul/templates/nsContentSupportMap.cpp
+++ b/dom/xul/templates/nsContentSupportMap.cpp
@@ -22,16 +22,16 @@ nsContentSupportMap::Finish()
 nsresult
 nsContentSupportMap::Remove(nsIContent* aElement)
 {
     if (!mMap.ops)
         return NS_ERROR_NOT_INITIALIZED;
 
     nsIContent* child = aElement;
     do {
-        PL_DHashTableOperate(&mMap, child, PL_DHASH_REMOVE);
+        PL_DHashTableRemove(&mMap, child);
         child = child->GetNextNode(aElement);
     } while(child);
 
     return NS_OK;
 }
 
 
--- a/dom/xul/templates/nsContentSupportMap.h
+++ b/dom/xul/templates/nsContentSupportMap.h
@@ -23,31 +23,31 @@ class nsContentSupportMap {
 public:
     nsContentSupportMap() { Init(); }
     ~nsContentSupportMap() { Finish(); }
 
     nsresult Put(nsIContent* aElement, nsTemplateMatch* aMatch) {
         if (!mMap.ops)
             return NS_ERROR_NOT_INITIALIZED;
 
-        PLDHashEntryHdr* hdr = PL_DHashTableOperate(&mMap, aElement, PL_DHASH_ADD);
+        PLDHashEntryHdr* hdr = PL_DHashTableAdd(&mMap, aElement);
         if (!hdr)
             return NS_ERROR_OUT_OF_MEMORY;
 
         Entry* entry = reinterpret_cast<Entry*>(hdr);
         NS_ASSERTION(entry->mMatch == nullptr, "over-writing entry");
         entry->mContent = aElement;
         entry->mMatch   = aMatch;
         return NS_OK; }
 
     bool Get(nsIContent* aElement, nsTemplateMatch** aMatch) {
         if (!mMap.ops)
             return false;
 
-        PLDHashEntryHdr* hdr = PL_DHashTableOperate(&mMap, aElement, PL_DHASH_LOOKUP);
+        PLDHashEntryHdr* hdr = PL_DHashTableLookup(&mMap, aElement);
         if (PL_DHASH_ENTRY_IS_FREE(hdr))
             return false;
 
         Entry* entry = reinterpret_cast<Entry*>(hdr);
         *aMatch = entry->mMatch;
         return true; }
 
     nsresult Remove(nsIContent* aElement);
--- a/dom/xul/templates/nsTemplateMap.h
+++ b/dom/xul/templates/nsTemplateMap.h
@@ -31,44 +31,44 @@ protected:
 
 public:
     nsTemplateMap() { Init(); }
 
     ~nsTemplateMap() { Finish(); }
 
     void
     Put(nsIContent* aContent, nsIContent* aTemplate) {
-        NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(PL_DHashTableOperate(&mTable, aContent, PL_DHASH_LOOKUP)),
+        NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(PL_DHashTableLookup(&mTable, aContent)),
                      "aContent already in map");
 
         Entry* entry =
-            reinterpret_cast<Entry*>(PL_DHashTableOperate(&mTable, aContent, PL_DHASH_ADD));
+            reinterpret_cast<Entry*>(PL_DHashTableAdd(&mTable, aContent));
 
         if (entry) {
             entry->mContent = aContent;
             entry->mTemplate = aTemplate;
         }
     }
 
     void
     Remove(nsIContent* aContent) {
-        PL_DHashTableOperate(&mTable, aContent, PL_DHASH_REMOVE);
+        PL_DHashTableRemove(&mTable, aContent);
 
         for (nsIContent* child = aContent->GetFirstChild();
              child;
              child = child->GetNextSibling()) {
             Remove(child);
         }
     }
 
 
     void
     GetTemplateFor(nsIContent* aContent, nsIContent** aResult) {
         Entry* entry =
-            reinterpret_cast<Entry*>(PL_DHashTableOperate(&mTable, aContent, PL_DHASH_LOOKUP));
+            reinterpret_cast<Entry*>(PL_DHashTableLookup(&mTable, aContent));
 
         if (PL_DHASH_ENTRY_IS_BUSY(&entry->mHdr))
             NS_IF_ADDREF(*aResult = entry->mTemplate);
         else
             *aResult = nullptr;
     }
 
     void
--- a/embedding/components/commandhandler/nsCommandParams.cpp
+++ b/embedding/components/commandhandler/nsCommandParams.cpp
@@ -209,45 +209,42 @@ nsCommandParams::SetISupportsValue(const
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsCommandParams::RemoveValue(const char* aName)
 {
   // PL_DHASH_REMOVE doesn't tell us if the entry was really removed, so we
   // return NS_OK unconditionally.
-  (void)PL_DHashTableOperate(&mValuesHash, (void *)aName, PL_DHASH_REMOVE);
+  (void)PL_DHashTableRemove(&mValuesHash, (void *)aName);
   return NS_OK;
 }
 
 nsCommandParams::HashEntry*
 nsCommandParams::GetNamedEntry(const char* aName)
 {
   HashEntry *foundEntry =
-    (HashEntry *)PL_DHashTableOperate(&mValuesHash, (void *)aName,
-                                      PL_DHASH_LOOKUP);
+    (HashEntry *)PL_DHashTableLookup(&mValuesHash, (void *)aName);
   if (PL_DHASH_ENTRY_IS_BUSY(foundEntry)) {
     return foundEntry;
   }
   return nullptr;
 }
 
 nsCommandParams::HashEntry*
 nsCommandParams::GetOrMakeEntry(const char* aName, uint8_t entryType)
 {
   HashEntry *foundEntry =
-    (HashEntry *)PL_DHashTableOperate(&mValuesHash, (void *)aName,
-                                      PL_DHASH_LOOKUP);
+    (HashEntry *)PL_DHashTableLookup(&mValuesHash, (void *)aName);
   if (PL_DHASH_ENTRY_IS_BUSY(foundEntry)) { // reuse existing entry
     foundEntry->Reset(entryType);
     return foundEntry;
   }
 
-  foundEntry = (HashEntry *)PL_DHashTableOperate(&mValuesHash, (void *)aName,
-                                                 PL_DHASH_ADD);
+  foundEntry = (HashEntry *)PL_DHashTableAdd(&mValuesHash, (void *)aName);
   if (!foundEntry) {
     return nullptr;
   }
 
   // Use placement new. Our ctor does not clobber keyHash, which is important.
   new (foundEntry) HashEntry(entryType, aName);
   return foundEntry;
 }
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -687,17 +687,17 @@ public:
             beginning = end + 1;
             if (!(end = strchr(beginning, ';'))) {
                 break;
             }
             uint32_t filesize = strtoul(beginning, nullptr, 10);
 
             FNCMapEntry* mapEntry =
                 static_cast<FNCMapEntry*>
-                (PL_DHashTableOperate(&mMap, filename.get(), PL_DHASH_ADD));
+                (PL_DHashTableAdd(&mMap, filename.get()));
             if (mapEntry) {
                 mapEntry->mFilename.Assign(filename);
                 mapEntry->mTimestamp = timestamp;
                 mapEntry->mFilesize = filesize;
                 mapEntry->mFaces.Assign(faceList);
                 // entries from the startupcache are marked "non-existing"
                 // until we have confirmed that the file still exists
                 mapEntry->mFileExists = false;
@@ -714,17 +714,17 @@ public:
     virtual void
     GetInfoForFile(const nsCString& aFileName, nsCString& aFaceList,
                    uint32_t *aTimestamp, uint32_t *aFilesize)
     {
         if (!mMap.ops) {
             return;
         }
         PLDHashEntryHdr *hdr =
-            PL_DHashTableOperate(&mMap, aFileName.get(), PL_DHASH_LOOKUP);
+            PL_DHashTableLookup(&mMap, aFileName.get());
         if (!hdr) {
             return;
         }
         FNCMapEntry* entry = static_cast<FNCMapEntry*>(hdr);
         if (entry && entry->mFilesize) {
             *aTimestamp = entry->mTimestamp;
             *aFilesize = entry->mFilesize;
             aFaceList.Assign(entry->mFaces);
@@ -739,17 +739,17 @@ public:
     CacheFileInfo(const nsCString& aFileName, const nsCString& aFaceList,
                   uint32_t aTimestamp, uint32_t aFilesize)
     {
         if (!mMap.ops) {
             return;
         }
         FNCMapEntry* entry =
             static_cast<FNCMapEntry*>
-            (PL_DHashTableOperate(&mMap, aFileName.get(), PL_DHASH_ADD));
+            (PL_DHashTableAdd(&mMap, aFileName.get()));
         if (entry) {
             entry->mFilename.Assign(aFileName);
             entry->mTimestamp = aTimestamp;
             entry->mFilesize = aFilesize;
             entry->mFaces.Assign(aFaceList);
             entry->mFileExists = true;
         }
         mWriteNeeded = true;
--- a/js/xpconnect/src/XPCMaps.cpp
+++ b/js/xpconnect/src/XPCMaps.cpp
@@ -639,18 +639,17 @@ bool
 XPCNativeScriptableSharedMap::GetNewOrUsed(uint32_t flags,
                                            char* name,
                                            XPCNativeScriptableInfo* si)
 {
     NS_PRECONDITION(name,"bad param");
     NS_PRECONDITION(si,"bad param");
 
     XPCNativeScriptableShared key(flags, name);
-    Entry* entry = (Entry*)
-        PL_DHashTableOperate(mTable, &key, PL_DHASH_ADD);
+    Entry* entry = (Entry*) PL_DHashTableAdd(mTable, &key);
     if (!entry)
         return false;
 
     XPCNativeScriptableShared* shared = entry->key;
 
     if (!shared) {
         entry->key = shared =
             new XPCNativeScriptableShared(flags, key.TransferNameOwnership());
--- a/js/xpconnect/src/XPCMaps.h
+++ b/js/xpconnect/src/XPCMaps.h
@@ -106,30 +106,28 @@ public:
         XPCWrappedNative* value;
     };
 
     static Native2WrappedNativeMap* newMap(int length);
 
     inline XPCWrappedNative* Find(nsISupports* Obj)
     {
         NS_PRECONDITION(Obj,"bad param");
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, Obj, PL_DHASH_LOOKUP);
+        Entry* entry = (Entry*) PL_DHashTableLookup(mTable, Obj);
         if (PL_DHASH_ENTRY_IS_FREE(entry))
             return nullptr;
         return entry->value;
     }
 
     inline XPCWrappedNative* Add(XPCWrappedNative* wrapper)
     {
         NS_PRECONDITION(wrapper,"bad param");
         nsISupports* obj = wrapper->GetIdentityObject();
         MOZ_ASSERT(!Find(obj), "wrapper already in new scope!");
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, obj, PL_DHASH_ADD);
+        Entry* entry = (Entry*) PL_DHashTableAdd(mTable, obj);
         if (!entry)
             return nullptr;
         if (entry->key)
             return entry->value;
         entry->key = obj;
         entry->value = wrapper;
         return wrapper;
     }
@@ -139,17 +137,17 @@ public:
         NS_PRECONDITION(wrapper,"bad param");
 #ifdef DEBUG
         XPCWrappedNative* wrapperInMap = Find(wrapper->GetIdentityObject());
         MOZ_ASSERT(!wrapperInMap || wrapperInMap == wrapper,
                    "About to remove a different wrapper with the same "
                    "nsISupports identity! This will most likely cause serious "
                    "problems!");
 #endif
-        PL_DHashTableOperate(mTable, wrapper->GetIdentityObject(), PL_DHASH_REMOVE);
+        PL_DHashTableRemove(mTable, wrapper->GetIdentityObject());
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
     inline uint32_t Enumerate(PLDHashEnumerator f, void *arg)
         {return PL_DHashTableEnumerate(mTable, f, arg);}
 
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf);
 
@@ -176,42 +174,40 @@ public:
 
         static const struct PLDHashTableOps sOps;
     };
 
     static IID2WrappedJSClassMap* newMap(int length);
 
     inline nsXPCWrappedJSClass* Find(REFNSIID iid)
     {
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, &iid, PL_DHASH_LOOKUP);
+        Entry* entry = (Entry*) PL_DHashTableLookup(mTable, &iid);
         if (PL_DHASH_ENTRY_IS_FREE(entry))
             return nullptr;
         return entry->value;
     }
 
     inline nsXPCWrappedJSClass* Add(nsXPCWrappedJSClass* clazz)
     {
         NS_PRECONDITION(clazz,"bad param");
         const nsIID* iid = &clazz->GetIID();
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, iid, PL_DHASH_ADD);
+        Entry* entry = (Entry*) PL_DHashTableAdd(mTable, iid);
         if (!entry)
             return nullptr;
         if (entry->key)
             return entry->value;
         entry->key = iid;
         entry->value = clazz;
         return clazz;
     }
 
     inline void Remove(nsXPCWrappedJSClass* clazz)
     {
         NS_PRECONDITION(clazz,"bad param");
-        PL_DHashTableOperate(mTable, &clazz->GetIID(), PL_DHASH_REMOVE);
+        PL_DHashTableRemove(mTable, &clazz->GetIID());
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
     inline uint32_t Enumerate(PLDHashEnumerator f, void *arg)
         {return PL_DHashTableEnumerate(mTable, f, arg);}
 
     ~IID2WrappedJSClassMap();
 private:
@@ -233,42 +229,40 @@ public:
 
         static const struct PLDHashTableOps sOps;
     };
 
     static IID2NativeInterfaceMap* newMap(int length);
 
     inline XPCNativeInterface* Find(REFNSIID iid)
     {
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, &iid, PL_DHASH_LOOKUP);
+        Entry* entry = (Entry*) PL_DHashTableLookup(mTable, &iid);
         if (PL_DHASH_ENTRY_IS_FREE(entry))
             return nullptr;
         return entry->value;
     }
 
     inline XPCNativeInterface* Add(XPCNativeInterface* iface)
     {
         NS_PRECONDITION(iface,"bad param");
         const nsIID* iid = iface->GetIID();
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, iid, PL_DHASH_ADD);
+        Entry* entry = (Entry*) PL_DHashTableAdd(mTable, iid);
         if (!entry)
             return nullptr;
         if (entry->key)
             return entry->value;
         entry->key = iid;
         entry->value = iface;
         return iface;
     }
 
     inline void Remove(XPCNativeInterface* iface)
     {
         NS_PRECONDITION(iface,"bad param");
-        PL_DHashTableOperate(mTable, iface->GetIID(), PL_DHASH_REMOVE);
+        PL_DHashTableRemove(mTable, iface->GetIID());
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
     inline uint32_t Enumerate(PLDHashEnumerator f, void *arg)
         {return PL_DHashTableEnumerate(mTable, f, arg);}
 
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf);
 
@@ -293,41 +287,39 @@ public:
         nsIClassInfo* key;
         XPCNativeSet* value;
     };
 
     static ClassInfo2NativeSetMap* newMap(int length);
 
     inline XPCNativeSet* Find(nsIClassInfo* info)
     {
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, info, PL_DHASH_LOOKUP);
+        Entry* entry = (Entry*) PL_DHashTableLookup(mTable, info);
         if (PL_DHASH_ENTRY_IS_FREE(entry))
             return nullptr;
         return entry->value;
     }
 
     inline XPCNativeSet* Add(nsIClassInfo* info, XPCNativeSet* set)
     {
         NS_PRECONDITION(info,"bad param");
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, info, PL_DHASH_ADD);
+        Entry* entry = (Entry*) PL_DHashTableAdd(mTable, info);
         if (!entry)
             return nullptr;
         if (entry->key)
             return entry->value;
         entry->key = info;
         entry->value = set;
         return set;
     }
 
     inline void Remove(nsIClassInfo* info)
     {
         NS_PRECONDITION(info,"bad param");
-        PL_DHashTableOperate(mTable, info, PL_DHASH_REMOVE);
+        PL_DHashTableRemove(mTable, info);
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
     inline uint32_t Enumerate(PLDHashEnumerator f, void *arg)
         {return PL_DHashTableEnumerate(mTable, f, arg);}
 
     // ClassInfo2NativeSetMap holds pointers to *some* XPCNativeSets.
     // So we don't want to count those XPCNativeSets, because they are better
@@ -353,41 +345,39 @@ public:
         nsIClassInfo*          key;
         XPCWrappedNativeProto* value;
     };
 
     static ClassInfo2WrappedNativeProtoMap* newMap(int length);
 
     inline XPCWrappedNativeProto* Find(nsIClassInfo* info)
     {
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, info, PL_DHASH_LOOKUP);
+        Entry* entry = (Entry*) PL_DHashTableLookup(mTable, info);
         if (PL_DHASH_ENTRY_IS_FREE(entry))
             return nullptr;
         return entry->value;
     }
 
     inline XPCWrappedNativeProto* Add(nsIClassInfo* info, XPCWrappedNativeProto* proto)
     {
         NS_PRECONDITION(info,"bad param");
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, info, PL_DHASH_ADD);
+        Entry* entry = (Entry*) PL_DHashTableAdd(mTable, info);
         if (!entry)
             return nullptr;
         if (entry->key)
             return entry->value;
         entry->key = info;
         entry->value = proto;
         return proto;
     }
 
     inline void Remove(nsIClassInfo* info)
     {
         NS_PRECONDITION(info,"bad param");
-        PL_DHashTableOperate(mTable, info, PL_DHASH_REMOVE);
+        PL_DHashTableRemove(mTable, info);
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
     inline uint32_t Enumerate(PLDHashEnumerator f, void *arg)
         {return PL_DHashTableEnumerate(mTable, f, arg);}
 
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf);
 
@@ -418,29 +408,27 @@ public:
 
         static const struct PLDHashTableOps sOps;
     };
 
     static NativeSetMap* newMap(int length);
 
     inline XPCNativeSet* Find(XPCNativeSetKey* key)
     {
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, key, PL_DHASH_LOOKUP);
+        Entry* entry = (Entry*) PL_DHashTableLookup(mTable, key);
         if (PL_DHASH_ENTRY_IS_FREE(entry))
             return nullptr;
         return entry->key_value;
     }
 
     inline XPCNativeSet* Add(const XPCNativeSetKey* key, XPCNativeSet* set)
     {
         NS_PRECONDITION(key,"bad param");
         NS_PRECONDITION(set,"bad param");
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, key, PL_DHASH_ADD);
+        Entry* entry = (Entry*) PL_DHashTableAdd(mTable, key);
         if (!entry)
             return nullptr;
         if (entry->key_value)
             return entry->key_value;
         entry->key_value = set;
         return set;
     }
 
@@ -450,17 +438,17 @@ public:
         return Add(&key, set);
     }
 
     inline void Remove(XPCNativeSet* set)
     {
         NS_PRECONDITION(set,"bad param");
 
         XPCNativeSetKey key(set, nullptr, 0);
-        PL_DHashTableOperate(mTable, &key, PL_DHASH_REMOVE);
+        PL_DHashTableRemove(mTable, &key);
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
     inline uint32_t Enumerate(PLDHashEnumerator f, void *arg)
         {return PL_DHashTableEnumerate(mTable, f, arg);}
 
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf);
 
@@ -495,39 +483,37 @@ public:
 
         static const struct PLDHashTableOps sOps;
     };
 
     static IID2ThisTranslatorMap* newMap(int length);
 
     inline nsIXPCFunctionThisTranslator* Find(REFNSIID iid)
     {
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, &iid, PL_DHASH_LOOKUP);
+        Entry* entry = (Entry*) PL_DHashTableLookup(mTable, &iid);
         if (PL_DHASH_ENTRY_IS_FREE(entry))
             return nullptr;
         return entry->value;
     }
 
     inline nsIXPCFunctionThisTranslator* Add(REFNSIID iid,
                                              nsIXPCFunctionThisTranslator* obj)
     {
 
-        Entry* entry = (Entry*)
-            PL_DHashTableOperate(mTable, &iid, PL_DHASH_ADD);
+        Entry* entry = (Entry*) PL_DHashTableAdd(mTable, &iid);
         if (!entry)
             return nullptr;
         entry->value = obj;
         entry->key = iid;
         return obj;
     }
 
     inline void Remove(REFNSIID iid)
     {
-        PL_DHashTableOperate(mTable, &iid, PL_DHASH_REMOVE);
+        PL_DHashTableRemove(mTable, &iid);
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
     inline uint32_t Enumerate(PLDHashEnumerator f, void *arg)
         {return PL_DHashTableEnumerate(mTable, f, arg);}
 
     ~IID2ThisTranslatorMap();
 private:
@@ -579,29 +565,29 @@ class XPCWrappedNativeProtoMap
 {
 public:
     static XPCWrappedNativeProtoMap* newMap(int length);
 
     inline XPCWrappedNativeProto* Add(XPCWrappedNativeProto* proto)
     {
         NS_PRECONDITION(proto,"bad param");
         PLDHashEntryStub* entry = (PLDHashEntryStub*)
-            PL_DHashTableOperate(mTable, proto, PL_DHASH_ADD);
+            PL_DHashTableAdd(mTable, proto);
         if (!entry)
             return nullptr;
         if (entry->key)
             return (XPCWrappedNativeProto*) entry->key;
         entry->key = proto;
         return proto;
     }
 
     inline void Remove(XPCWrappedNativeProto* proto)
     {
         NS_PRECONDITION(proto,"bad param");
-        PL_DHashTableOperate(mTable, proto, PL_DHASH_REMOVE);
+        PL_DHashTableRemove(mTable, proto);
     }
 
     inline uint32_t Count() { return mTable->EntryCount(); }
     inline uint32_t Enumerate(PLDHashEnumerator f, void *arg)
         {return PL_DHashTableEnumerate(mTable, f, arg);}
 
     ~XPCWrappedNativeProtoMap();
 private:
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -153,18 +153,18 @@ nsFrameManager::Destroy()
 // Placeholder frame functions
 nsPlaceholderFrame*
 nsFrameManager::GetPlaceholderFrameFor(const nsIFrame* aFrame)
 {
   NS_PRECONDITION(aFrame, "null param unexpected");
 
   if (mPlaceholderMap.ops) {
     PlaceholderMapEntry *entry = static_cast<PlaceholderMapEntry*>
-                                            (PL_DHashTableOperate(const_cast<PLDHashTable*>(&mPlaceholderMap),
-                                aFrame, PL_DHASH_LOOKUP));
+                                            (PL_DHashTableLookup(const_cast<PLDHashTable*>(&mPlaceholderMap),
+                                aFrame));
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       return entry->placeholderFrame;
     }
   }
 
   return nullptr;
 }
 
@@ -173,19 +173,18 @@ nsFrameManager::RegisterPlaceholderFrame
 {
   NS_PRECONDITION(aPlaceholderFrame, "null param unexpected");
   NS_PRECONDITION(nsGkAtoms::placeholderFrame == aPlaceholderFrame->GetType(),
                   "unexpected frame type");
   if (!mPlaceholderMap.ops) {
     PL_DHashTableInit(&mPlaceholderMap, &PlaceholderMapOps, nullptr,
                       sizeof(PlaceholderMapEntry));
   }
-  PlaceholderMapEntry *entry = static_cast<PlaceholderMapEntry*>(PL_DHashTableOperate(&mPlaceholderMap,
-                              aPlaceholderFrame->GetOutOfFlowFrame(),
-                              PL_DHASH_ADD));
+  PlaceholderMapEntry *entry = static_cast<PlaceholderMapEntry*>(PL_DHashTableAdd(&mPlaceholderMap,
+                              aPlaceholderFrame->GetOutOfFlowFrame()));
   if (!entry)
     return NS_ERROR_OUT_OF_MEMORY;
 
   NS_ASSERTION(!entry->placeholderFrame, "Registering a placeholder for a frame that already has a placeholder!");
   entry->placeholderFrame = aPlaceholderFrame;
 
   return NS_OK;
 }
@@ -193,19 +192,18 @@ nsFrameManager::RegisterPlaceholderFrame
 void
 nsFrameManager::UnregisterPlaceholderFrame(nsPlaceholderFrame* aPlaceholderFrame)
 {
   NS_PRECONDITION(aPlaceholderFrame, "null param unexpected");
   NS_PRECONDITION(nsGkAtoms::placeholderFrame == aPlaceholderFrame->GetType(),
                   "unexpected frame type");
 
   if (mPlaceholderMap.ops) {
-    PL_DHashTableOperate(&mPlaceholderMap,
-                         aPlaceholderFrame->GetOutOfFlowFrame(),
-                         PL_DHASH_REMOVE);
+    PL_DHashTableRemove(&mPlaceholderMap,
+                        aPlaceholderFrame->GetOutOfFlowFrame());
   }
 }
 
 static PLDHashOperator
 UnregisterPlaceholders(PLDHashTable* table, PLDHashEntryHdr* hdr,
                        uint32_t number, void* arg)
 {
   PlaceholderMapEntry* entry = static_cast<PlaceholderMapEntry*>(hdr);
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -593,29 +593,29 @@ RuleHash::~RuleHash()
   }
 }
 
 void RuleHash::AppendRuleToTable(PLDHashTable* aTable, const void* aKey,
                                  const RuleSelectorPair& aRuleInfo)
 {
   // Get a new or existing entry.
   RuleHashTableEntry *entry = static_cast<RuleHashTableEntry*>
-                                         (PL_DHashTableOperate(aTable, aKey, PL_DHASH_ADD));
+                                         (PL_DHashTableAdd(aTable, aKey));
   if (!entry)
     return;
   entry->mRules.AppendElement(RuleValue(aRuleInfo, mRuleCount++, mQuirksMode));
 }
 
 static void
 AppendRuleToTagTable(PLDHashTable* aTable, nsIAtom* aKey,
                      const RuleValue& aRuleInfo)
 {
   // Get a new or exisiting entry
   RuleHashTagTableEntry *entry = static_cast<RuleHashTagTableEntry*>
-    (PL_DHashTableOperate(aTable, aKey, PL_DHASH_ADD));
+    (PL_DHashTableAdd(aTable, aKey));
   if (!entry)
     return;
 
   entry->mRules.AppendElement(aRuleInfo);
 }
 
 void RuleHash::AppendUniversalRule(const RuleSelectorPair& aRuleInfo)
 {
@@ -720,44 +720,42 @@ void RuleHash::EnumerateAllRules(Element
 
   if (mUniversalRules.Length() != 0) { // universal rules
     mEnumList[valueCount++] = ToEnumData(mUniversalRules);
     RULE_HASH_STAT_INCREMENT_LIST_COUNT(mUniversalRules, mElementUniversalCalls);
   }
   // universal rules within the namespace
   if (kNameSpaceID_Unknown != nameSpace && mNameSpaceTable.ops) {
     RuleHashTableEntry *entry = static_cast<RuleHashTableEntry*>
-                                           (PL_DHashTableOperate(&mNameSpaceTable, NS_INT32_TO_PTR(nameSpace),
-                             PL_DHASH_LOOKUP));
+                                           (PL_DHashTableLookup(&mNameSpaceTable, NS_INT32_TO_PTR(nameSpace)));
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       mEnumList[valueCount++] = ToEnumData(entry->mRules);
       RULE_HASH_STAT_INCREMENT_LIST_COUNT(entry->mRules, mElementNameSpaceCalls);
     }
   }
   if (mTagTable.ops) {
     RuleHashTableEntry *entry = static_cast<RuleHashTableEntry*>
-                                           (PL_DHashTableOperate(&mTagTable, tag, PL_DHASH_LOOKUP));
+                                           (PL_DHashTableLookup(&mTagTable, tag));
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       mEnumList[valueCount++] = ToEnumData(entry->mRules);
       RULE_HASH_STAT_INCREMENT_LIST_COUNT(entry->mRules, mElementTagCalls);
     }
   }
   if (id && mIdTable.ops) {
     RuleHashTableEntry *entry = static_cast<RuleHashTableEntry*>
-                                           (PL_DHashTableOperate(&mIdTable, id, PL_DHASH_LOOKUP));
+                                           (PL_DHashTableLookup(&mIdTable, id));
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       mEnumList[valueCount++] = ToEnumData(entry->mRules);
       RULE_HASH_STAT_INCREMENT_LIST_COUNT(entry->mRules, mElementIdCalls);
     }
   }
   if (mClassTable.ops) {
     for (int32_t index = 0; index < classCount; ++index) {
       RuleHashTableEntry *entry = static_cast<RuleHashTableEntry*>
-                                             (PL_DHashTableOperate(&mClassTable, classList->AtomAt(index),
-                             PL_DHASH_LOOKUP));
+                                             (PL_DHashTableLookup(&mClassTable, classList->AtomAt(index)));
       if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
         mEnumList[valueCount++] = ToEnumData(entry->mRules);
         RULE_HASH_STAT_INCREMENT_LIST_COUNT(entry->mRules, mElementClassCalls);
       }
     }
   }
   NS_ASSERTION(valueCount <= testCount, "values exceeded list size");
 
@@ -1069,18 +1067,17 @@ RuleCascadeData::SizeOfIncludingThis(Mal
   return n;
 }
 
 nsTArray<nsCSSSelector*>*
 RuleCascadeData::AttributeListFor(nsIAtom* aAttribute)
 {
   AtomSelectorEntry *entry =
     static_cast<AtomSelectorEntry*>
-               (PL_DHashTableOperate(&mAttributeSelectors, aAttribute,
-                                     PL_DHASH_ADD));
+               (PL_DHashTableAdd(&mAttributeSelectors, aAttribute));
   if (!entry)
     return nullptr;
   return &entry->mSelectors;
 }
 
 // -------------------------------
 // CSS Style rule processor implementation
 //
@@ -2611,18 +2608,17 @@ nsCSSRuleProcessor::RulesMatching(Pseudo
 
 /* virtual */ void
 nsCSSRuleProcessor::RulesMatching(AnonBoxRuleProcessorData* aData)
 {
   RuleCascadeData* cascade = GetRuleCascade(aData->mPresContext);
 
   if (cascade && cascade->mAnonBoxRules.EntryCount()) {
     RuleHashTagTableEntry* entry = static_cast<RuleHashTagTableEntry*>
-      (PL_DHashTableOperate(&cascade->mAnonBoxRules, aData->mPseudoTag,
-                            PL_DHASH_LOOKUP));
+      (PL_DHashTableLookup(&cascade->mAnonBoxRules, aData->mPseudoTag));
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       nsTArray<RuleValue>& rules = entry->mRules;
       for (RuleValue *value = rules.Elements(), *end = value + rules.Length();
            value != end; ++value) {
         value->mRule->RuleMatched();
         aData->mRuleWalker->Forward(value->mRule);
       }
     }
@@ -2632,18 +2628,17 @@ nsCSSRuleProcessor::RulesMatching(AnonBo
 #ifdef MOZ_XUL
 /* virtual */ void
 nsCSSRuleProcessor::RulesMatching(XULTreeRuleProcessorData* aData)
 {
   RuleCascadeData* cascade = GetRuleCascade(aData->mPresContext);
 
   if (cascade && cascade->mXULTreeRules.EntryCount()) {
     RuleHashTagTableEntry* entry = static_cast<RuleHashTagTableEntry*>
-      (PL_DHashTableOperate(&cascade->mXULTreeRules, aData->mPseudoTag,
-                            PL_DHASH_LOOKUP));
+      (PL_DHashTableLookup(&cascade->mXULTreeRules, aData->mPseudoTag));
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       NodeMatchContext nodeContext(EventStates(),
                                    nsCSSRuleProcessor::IsLink(aData->mElement));
       nsTArray<RuleValue>& rules = entry->mRules;
       for (RuleValue *value = rules.Elements(), *end = value + rules.Length();
            value != end; ++value) {
         if (aData->mComparator->PseudoMatches(value->mSelector)) {
           ContentEnumFunc(*value, value->mSelector->mNext, aData, nodeContext,
@@ -2868,49 +2863,48 @@ nsCSSRuleProcessor::HasAttributeDependen
   // rules we might stop matching; if the after change notification, the
   // ones we might have started matching.
   if (cascade) {
     if (aData->mAttribute == nsGkAtoms::id) {
       nsIAtom* id = aData->mElement->GetID();
       if (id) {
         AtomSelectorEntry *entry =
           static_cast<AtomSelectorEntry*>
-                     (PL_DHashTableOperate(&cascade->mIdSelectors,
-                                           id, PL_DHASH_LOOKUP));
+                     (PL_DHashTableLookup(&cascade->mIdSelectors, id));
         if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
           EnumerateSelectors(entry->mSelectors, &data);
         }
       }
 
       EnumerateSelectors(cascade->mPossiblyNegatedIDSelectors, &data);
     }
     
     if (aData->mAttribute == nsGkAtoms::_class) {
       const nsAttrValue* elementClasses = aData->mElement->GetClasses();
       if (elementClasses) {
         int32_t atomCount = elementClasses->GetAtomCount();
         for (int32_t i = 0; i < atomCount; ++i) {
           nsIAtom* curClass = elementClasses->AtomAt(i);
           AtomSelectorEntry *entry =
             static_cast<AtomSelectorEntry*>
-                       (PL_DHashTableOperate(&cascade->mClassSelectors,
-                                             curClass, PL_DHASH_LOOKUP));
+                       (PL_DHashTableLookup(&cascade->mClassSelectors,
+                                            curClass));
           if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
             EnumerateSelectors(entry->mSelectors, &data);
           }
         }
       }
 
       EnumerateSelectors(cascade->mPossiblyNegatedClassSelectors, &data);
     }
 
     AtomSelectorEntry *entry =
       static_cast<AtomSelectorEntry*>
-                 (PL_DHashTableOperate(&cascade->mAttributeSelectors,
-                                       aData->mAttribute, PL_DHASH_LOOKUP));
+                 (PL_DHashTableLookup(&cascade->mAttributeSelectors,
+                                      aData->mAttribute));
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       EnumerateSelectors(entry->mSelectors, &data);
     }
   }
 
   return data.change;
 }
 
@@ -3151,35 +3145,33 @@ AddSelector(RuleCascadeData* aCascade,
                                           aSelectorInTopLevel));
     }
 
     // Build mIDSelectors
     if (negation == aSelectorInTopLevel) {
       for (nsAtomList* curID = negation->mIDList; curID;
            curID = curID->mNext) {
         AtomSelectorEntry *entry =
-          static_cast<AtomSelectorEntry*>(PL_DHashTableOperate(&aCascade->mIdSelectors,
-                                                               curID->mAtom,
-                                                               PL_DHASH_ADD));
+          static_cast<AtomSelectorEntry*>(PL_DHashTableAdd(&aCascade->mIdSelectors,
+                                                           curID->mAtom));
         if (entry) {
           entry->mSelectors.AppendElement(aSelectorInTopLevel);
         }
       }
     } else if (negation->mIDList) {
       aCascade->mPossiblyNegatedIDSelectors.AppendElement(aSelectorInTopLevel);
     }
 
     // Build mClassSelectors
     if (negation == aSelectorInTopLevel) {
       for (nsAtomList* curClass = negation->mClassList; curClass;
            curClass = curClass->mNext) {
         AtomSelectorEntry *entry =
-          static_cast<AtomSelectorEntry*>(PL_DHashTableOperate(&aCascade->mClassSelectors,
-                                                               curClass->mAtom,
-                                                               PL_DHASH_ADD));
+          static_cast<AtomSelectorEntry*>(PL_DHashTableAdd(&aCascade->mClassSelectors,
+                                                           curClass->mAtom));
         if (entry) {
           entry->mSelectors.AppendElement(aSelectorInTopLevel);
         }
       }
     } else if (negation->mClassList) {
       aCascade->mPossiblyNegatedClassSelectors.AppendElement(aSelectorInTopLevel);
     }
 
@@ -3432,18 +3424,17 @@ CascadeRuleEnumFunc(css::Rule* aRule, vo
 
   if (css::Rule::STYLE_RULE == type) {
     css::StyleRule* styleRule = static_cast<css::StyleRule*>(aRule);
 
     for (nsCSSSelectorList *sel = styleRule->Selector();
          sel; sel = sel->mNext) {
       int32_t weight = sel->mWeight;
       RuleByWeightEntry *entry = static_cast<RuleByWeightEntry*>(
-        PL_DHashTableOperate(&data->mRulesByWeight, NS_INT32_TO_PTR(weight),
-                             PL_DHASH_ADD));
+        PL_DHashTableAdd(&data->mRulesByWeight, NS_INT32_TO_PTR(weight)));
       if (!entry)
         return false;
       entry->data.mWeight = weight;
       // entry->data.mRuleSelectorPairs should be linked in forward order;
       // entry->data.mTail is the slot to write to.
       PerWeightDataListItem *newItem =
         new (data->mArena) PerWeightDataListItem(styleRule, sel->mSelectors);
       if (newItem) {
--- a/layout/style/nsHTMLStyleSheet.cpp
+++ b/layout/style/nsHTMLStyleSheet.cpp
@@ -487,17 +487,17 @@ nsHTMLStyleSheet::SetVisitedLinkColor(ns
 already_AddRefed<nsMappedAttributes>
 nsHTMLStyleSheet::UniqueMappedAttributes(nsMappedAttributes* aMapped)
 {
   if (!mMappedAttrTable.ops) {
     PL_DHashTableInit(&mMappedAttrTable, &MappedAttrTable_Ops,
                       nullptr, sizeof(MappedAttrTableEntry));
   }
   MappedAttrTableEntry *entry = static_cast<MappedAttrTableEntry*>
-                                           (PL_DHashTableOperate(&mMappedAttrTable, aMapped, PL_DHASH_ADD));
+                                           (PL_DHashTableAdd(&mMappedAttrTable, aMapped));
   if (!entry)
     return nullptr;
   if (!entry->mAttributes) {
     // We added a new entry to the hashtable, so we have a new unique set.
     entry->mAttributes = aMapped;
   }
   nsRefPtr<nsMappedAttributes> ret = entry->mAttributes;
   return ret.forget();
@@ -508,30 +508,30 @@ nsHTMLStyleSheet::DropMappedAttributes(n
 {
   NS_ENSURE_TRUE_VOID(aMapped);
 
   NS_ASSERTION(mMappedAttrTable.ops, "table uninitialized");
 #ifdef DEBUG
   uint32_t entryCount = mMappedAttrTable.EntryCount() - 1;
 #endif
 
-  PL_DHashTableOperate(&mMappedAttrTable, aMapped, PL_DHASH_REMOVE);
+  PL_DHashTableRemove(&mMappedAttrTable, aMapped);
 
   NS_ASSERTION(entryCount == mMappedAttrTable.EntryCount(), "not removed");
 }
 
 nsIStyleRule*
 nsHTMLStyleSheet::LangRuleFor(const nsString& aLanguage)
 {
   if (!mLangRuleTable.ops) {
     PL_DHashTableInit(&mLangRuleTable, &LangRuleTable_Ops,
                       nullptr, sizeof(LangRuleTableEntry));
   }
   LangRuleTableEntry *entry = static_cast<LangRuleTableEntry*>
-    (PL_DHashTableOperate(&mLangRuleTable, &aLanguage, PL_DHASH_ADD));
+    (PL_DHashTableAdd(&mLangRuleTable, &aLanguage));
   if (!entry) {
     NS_ASSERTION(false, "out of memory");
     return nullptr;
   }
   return entry->mRule;
 }
 
 static size_t
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -1532,17 +1532,17 @@ nsRuleNode::Transition(nsIStyleRule* aRu
     if (curr)
       next = curr;
     else if (numKids >= kMaxChildrenInList)
       ConvertChildrenToHash(numKids);
   }
 
   if (ChildrenAreHashed()) {
     ChildrenHashEntry *entry = static_cast<ChildrenHashEntry*>
-                                          (PL_DHashTableOperate(ChildrenHash(), &key, PL_DHASH_ADD));
+                                          (PL_DHashTableAdd(ChildrenHash(), &key));
     if (!entry) {
       NS_WARNING("out of memory");
       return this;
     }
     if (entry->mRuleNode)
       next = entry->mRuleNode;
     else {
       next = entry->mRuleNode = new (mPresContext)
@@ -1610,17 +1610,17 @@ nsRuleNode::ConvertChildrenToHash(int32_
   PLDHashTable *hash = PL_NewDHashTable(&ChildrenHashOps, nullptr,
                                         sizeof(ChildrenHashEntry),
                                         aNumKids);
   if (!hash)
     return;
   for (nsRuleNode* curr = ChildrenList(); curr; curr = curr->mNextSibling) {
     // This will never fail because of the initial size we gave the table.
     ChildrenHashEntry *entry = static_cast<ChildrenHashEntry*>(
-      PL_DHashTableOperate(hash, curr->mRule, PL_DHASH_ADD));
+      PL_DHashTableAdd(hash, curr->mRule));
     NS_ASSERTION(!entry->mRuleNode, "duplicate entries in list");
     entry->mRuleNode = curr;
   }
   SetChildrenHash(hash);
 }
 
 inline void
 nsRuleNode::PropagateNoneBit(uint32_t aBit, nsRuleNode* aHighestNode)
--- a/layout/tables/SpanningCellSorter.cpp
+++ b/layout/tables/SpanningCellSorter.cpp
@@ -75,18 +75,17 @@ SpanningCellSorter::AddCell(int32_t aCol
         i->next = mArray[index];
         mArray[index] = i;
     } else {
         if (!mHashTable.ops) {
             PL_DHashTableInit(&mHashTable, &HashTableOps, nullptr,
                               sizeof(HashTableEntry));
         }
         HashTableEntry *entry = static_cast<HashTableEntry*>
-                                           (PL_DHashTableOperate(&mHashTable, NS_INT32_TO_PTR(aColSpan),
-                                 PL_DHASH_ADD));
+                                           (PL_DHashTableAdd(&mHashTable, NS_INT32_TO_PTR(aColSpan)));
         NS_ENSURE_TRUE(entry, false);
 
         NS_ASSERTION(entry->mColSpan == 0 || entry->mColSpan == aColSpan,
                      "wrong entry");
         NS_ASSERTION((entry->mColSpan == 0) == (entry->mItems == nullptr),
                      "entry should be either new or properly initialized");
         entry->mColSpan = aColSpan;
 
--- a/modules/libpref/prefapi.cpp
+++ b/modules/libpref/prefapi.cpp
@@ -609,17 +609,17 @@ PREF_ClearUserPref(const char *pref_name
         return NS_ERROR_NOT_INITIALIZED;
 
     PrefHashEntry* pref = pref_HashTableLookup(pref_name);
     if (pref && PREF_HAS_USER_VALUE(pref))
     {
         pref->flags &= ~PREF_USERSET;
 
         if (!(pref->flags & PREF_HAS_DEFAULT)) {
-            PL_DHashTableOperate(&gHashTable, pref_name, PL_DHASH_REMOVE);
+            PL_DHashTableRemove(&gHashTable, pref_name);
         }
 
         pref_DoCallback(pref_name);
         gDirty = true;
     }
     return NS_OK;
 }
 
@@ -729,34 +729,34 @@ static void pref_SetValue(PrefValue* exi
 
 PrefHashEntry* pref_HashTableLookup(const void *key)
 {
 #ifndef MOZ_B2G
     MOZ_ASSERT(NS_IsMainThread());
 #endif
 
     PrefHashEntry* result =
-        static_cast<PrefHashEntry*>(PL_DHashTableOperate(&gHashTable, key, PL_DHASH_LOOKUP));
+        static_cast<PrefHashEntry*>(PL_DHashTableLookup(&gHashTable, key));
 
     if (PL_DHASH_ENTRY_IS_FREE(result))
         return nullptr;
 
     return result;
 }
 
 nsresult pref_HashPref(const char *key, PrefValue value, PrefType type, uint32_t flags)
 {
 #ifndef MOZ_B2G
     MOZ_ASSERT(NS_IsMainThread());
 #endif
 
     if (!gHashTable.ops)
         return NS_ERROR_OUT_OF_MEMORY;
 
-    PrefHashEntry* pref = static_cast<PrefHashEntry*>(PL_DHashTableOperate(&gHashTable, key, PL_DHASH_ADD));
+    PrefHashEntry* pref = static_cast<PrefHashEntry*>(PL_DHashTableAdd(&gHashTable, key));
 
     if (!pref)
         return NS_ERROR_OUT_OF_MEMORY;
 
     // new entry, better initialize
     if (!pref->key) {
 
         // initialize the pref entry
--- a/netwerk/base/src/nsLoadGroup.cpp
+++ b/netwerk/base/src/nsLoadGroup.cpp
@@ -259,18 +259,17 @@ nsLoadGroup::Cancel(nsresult status)
 
     while (count > 0) {
         nsIRequest* request = requests.ElementAt(--count);
 
         NS_ASSERTION(request, "NULL request found in list.");
 
         RequestMapEntry *entry =
             static_cast<RequestMapEntry *>
-                       (PL_DHashTableOperate(&mRequests, request,
-                                                PL_DHASH_LOOKUP));
+                       (PL_DHashTableLookup(&mRequests, request));
 
         if (PL_DHASH_ENTRY_IS_FREE(entry)) {
             // |request| was removed already
 
             NS_RELEASE(request);
 
             continue;
         }
@@ -492,18 +491,17 @@ nsLoadGroup::AddRequest(nsIRequest *requ
              this, request, nameStr.get(), mRequests.EntryCount()));
     }
 #endif /* PR_LOGGING */
 
 #ifdef DEBUG
     {
       RequestMapEntry *entry =
           static_cast<RequestMapEntry *>
-                     (PL_DHashTableOperate(&mRequests, request,
-                                          PL_DHASH_LOOKUP));
+                     (PL_DHashTableLookup(&mRequests, request));
 
       NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(entry),
                    "Entry added to loadgroup twice, don't do that");
     }
 #endif
 
     //
     // Do not add the channel, if the loadgroup is being canceled...
@@ -529,18 +527,17 @@ nsLoadGroup::AddRequest(nsIRequest *requ
     if (NS_FAILED(rv)) return rv;
     
     //
     // Add the request to the list of active requests...
     //
 
     RequestMapEntry *entry =
         static_cast<RequestMapEntry *>
-                   (PL_DHashTableOperate(&mRequests, request,
-                                        PL_DHASH_ADD));
+                   (PL_DHashTableAdd(&mRequests, request));
 
     if (!entry) {
         return NS_ERROR_OUT_OF_MEMORY;
     }
 
     if (mPriority != 0)
         RescheduleRequest(request, mPriority);
 
@@ -567,17 +564,17 @@ nsLoadGroup::AddRequest(nsIRequest *requ
             if (NS_FAILED(rv)) {
                 LOG(("LOADGROUP [%x]: OnStartRequest for request %x FAILED.\n",
                     this, request));
                 //
                 // The URI load has been canceled by the observer.  Clean up
                 // the damage...
                 //
 
-                PL_DHashTableOperate(&mRequests, request, PL_DHASH_REMOVE);
+                PL_DHashTableRemove(&mRequests, request);
 
                 rv = NS_OK;
 
                 mForegroundCount -= 1;
             }
         }
 
         // Ensure that we're part of our loadgroup while pending
@@ -613,18 +610,17 @@ nsLoadGroup::RemoveRequest(nsIRequest *r
 
     //
     // Remove the request from the group.  If this fails, it means that
     // the request was *not* in the group so do not update the foreground
     // count or it will get messed up...
     //
     RequestMapEntry *entry =
         static_cast<RequestMapEntry *>
-                   (PL_DHashTableOperate(&mRequests, request,
-                                        PL_DHASH_LOOKUP));
+                   (PL_DHashTableLookup(&mRequests, request));
 
     if (PL_DHASH_ENTRY_IS_FREE(entry)) {
         LOG(("LOADGROUP [%x]: Unable to remove request %x. Not in group!\n",
             this, request));
 
         return NS_ERROR_FAILURE;
     }
 
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -429,34 +429,34 @@ nsCacheEntry *
 nsCacheEntryHashTable::GetEntry( const nsCString * key)
 {
     PLDHashEntryHdr *hashEntry;
     nsCacheEntry    *result = nullptr;
 
     NS_ASSERTION(initialized, "nsCacheEntryHashTable not initialized");
     if (!initialized)  return nullptr;
     
-    hashEntry = PL_DHashTableOperate(&table, key, PL_DHASH_LOOKUP);
+    hashEntry = PL_DHashTableLookup(&table, key);
     if (PL_DHASH_ENTRY_IS_BUSY(hashEntry)) {
         result = ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry;
     }
     return result;
 }
 
 
 nsresult
 nsCacheEntryHashTable::AddEntry( nsCacheEntry *cacheEntry)
 {
     PLDHashEntryHdr    *hashEntry;
 
     NS_ASSERTION(initialized, "nsCacheEntryHashTable not initialized");
     if (!initialized)  return NS_ERROR_NOT_INITIALIZED;
     if (!cacheEntry)   return NS_ERROR_NULL_POINTER;
 
-    hashEntry = PL_DHashTableOperate(&table, &(cacheEntry->mKey), PL_DHASH_ADD);
+    hashEntry = PL_DHashTableAdd(&table, &(cacheEntry->mKey));
 #ifndef DEBUG_dougt
     NS_ASSERTION(((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry == 0,
                  "### nsCacheEntryHashTable::AddEntry - entry already used");
 #endif
     ((nsCacheEntryHashTableEntry *)hashEntry)->cacheEntry = cacheEntry;
 
     return NS_OK;
 }
@@ -470,17 +470,17 @@ nsCacheEntryHashTable::RemoveEntry( nsCa
 
     if (!initialized)  return; // NS_ERROR_NOT_INITIALIZED
 
 #if DEBUG
     // XXX debug code to make sure we have the entry we're trying to remove
     nsCacheEntry *check = GetEntry(&(cacheEntry->mKey));
     NS_ASSERTION(check == cacheEntry, "### Attempting to remove unknown cache entry!!!");
 #endif
-    (void) PL_DHashTableOperate(&table, &(cacheEntry->mKey), PL_DHASH_REMOVE);
+    PL_DHashTableRemove(&table, &(cacheEntry->mKey));
 }
 
 
 void
 nsCacheEntryHashTable::VisitEntries( PLDHashEnumerator etor, void *arg)
 {
     NS_ASSERTION(initialized, "nsCacheEntryHashTable not initialized");
     if (!initialized)  return; // NS_ERROR_NOT_INITIALIZED
--- a/netwerk/cache/nsDiskCacheBinding.cpp
+++ b/netwerk/cache/nsDiskCacheBinding.cpp
@@ -199,19 +199,18 @@ nsDiskCacheBindery::CreateBinding(nsCach
  */
 nsDiskCacheBinding *
 nsDiskCacheBindery::FindActiveBinding(uint32_t  hashNumber)
 {
     NS_ASSERTION(initialized, "nsDiskCacheBindery not initialized");
     // find hash entry for key
     HashTableEntry * hashEntry;
     hashEntry =
-      (HashTableEntry *) PL_DHashTableOperate(&table,
-                                              (void*)(uintptr_t) hashNumber,
-                                              PL_DHASH_LOOKUP);
+      (HashTableEntry *) PL_DHashTableLookup(&table,
+                                             (void*)(uintptr_t) hashNumber);
     if (PL_DHASH_ENTRY_IS_FREE(hashEntry)) return nullptr;
 
     // walk list looking for active entry
     NS_ASSERTION(hashEntry->mBinding, "hash entry left with no binding");
     nsDiskCacheBinding * binding = hashEntry->mBinding;    
     while (binding->mCacheEntry->IsDoomed()) {
         binding = (nsDiskCacheBinding *)PR_NEXT_LINK(binding);
         if (binding == hashEntry->mBinding)  return nullptr;
@@ -234,19 +233,18 @@ nsresult
 nsDiskCacheBindery::AddBinding(nsDiskCacheBinding * binding)
 {
     NS_ENSURE_ARG_POINTER(binding);
     NS_ASSERTION(initialized, "nsDiskCacheBindery not initialized");
 
     // find hash entry for key
     HashTableEntry * hashEntry;
     hashEntry = (HashTableEntry *)
-      PL_DHashTableOperate(&table,
-                           (void *)(uintptr_t) binding->mRecord.HashNumber(),
-                           PL_DHASH_ADD);
+      PL_DHashTableAdd(&table,
+                       (void *)(uintptr_t) binding->mRecord.HashNumber());
     if (!hashEntry) return NS_ERROR_OUT_OF_MEMORY;
     
     if (hashEntry->mBinding == nullptr) {
         hashEntry->mBinding = binding;
         if (binding->mGeneration == 0)
             binding->mGeneration = 1;   // if generation uninitialized, set it to 1
             
         return NS_OK;
@@ -298,30 +296,28 @@ void
 nsDiskCacheBindery::RemoveBinding(nsDiskCacheBinding * binding)
 {
     NS_ASSERTION(initialized, "nsDiskCacheBindery not initialized");
     if (!initialized)   return;
     
     HashTableEntry * hashEntry;
     void           * key = (void *)(uintptr_t)binding->mRecord.HashNumber();
 
-    hashEntry = (HashTableEntry*) PL_DHashTableOperate(&table,
-                                                       (void*)(uintptr_t) key,
-                                                       PL_DHASH_LOOKUP);
+    hashEntry = (HashTableEntry*) PL_DHashTableLookup(&table,
+                                                      (void*)(uintptr_t) key);
     if (!PL_DHASH_ENTRY_IS_BUSY(hashEntry)) {
         NS_WARNING("### disk cache: binding not in hashtable!");
         return;
     }
     
     if (binding == hashEntry->mBinding) {
         if (PR_CLIST_IS_EMPTY(binding)) {
             // remove this hash entry
-            PL_DHashTableOperate(&table,
-                                 (void*)(uintptr_t) binding->mRecord.HashNumber(),
-                                 PL_DHASH_REMOVE);
+            PL_DHashTableRemove(&table,
+                                (void*)(uintptr_t) binding->mRecord.HashNumber());
             return;
             
         } else {
             // promote next binding to head, and unlink this binding
             hashEntry->mBinding = (nsDiskCacheBinding *)PR_NEXT_LINK(binding);
         }
     }
     PR_REMOVE_AND_INIT_LINK(binding);
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -622,17 +622,17 @@ nsHostResolver::FlushCache()
   // Clear the evictionQ and remove all its corresponding entries from
   // the cache first
   if (!PR_CLIST_IS_EMPTY(&mEvictionQ)) {
       PRCList *node = mEvictionQ.next;
       while (node != &mEvictionQ) {
           nsHostRecord *rec = static_cast<nsHostRecord *>(node);
           node = node->next;
           PR_REMOVE_AND_INIT_LINK(rec);
-          PL_DHashTableOperate(&mDB, (nsHostKey *) rec, PL_DHASH_REMOVE);
+          PL_DHashTableRemove(&mDB, (nsHostKey *) rec);
           NS_RELEASE(rec);
       }
   }
 
   // Refresh the cache entries that are resolving RIGHT now, remove the rest.
   PL_DHashTableEnumerate(&mDB, HostDB_PruneEntry, nullptr);
 }
 
@@ -754,17 +754,17 @@ nsHostResolver::ResolveHost(const char  
             // in the hash table.  if so, then check to see if we can't
             // just reuse the lookup result.  otherwise, if there are
             // any pending callbacks, then add to pending callbacks queue,
             // and return.  otherwise, add ourselves as first pending
             // callback, and proceed to do the lookup.
 
             nsHostKey key = { host, flags, af };
             nsHostDBEnt *he = static_cast<nsHostDBEnt *>
-                                         (PL_DHashTableOperate(&mDB, &key, PL_DHASH_ADD));
+                                         (PL_DHashTableAdd(&mDB, &key));
 
             // if the record is null, then HostDB_InitEntry failed.
             if (!he || !he->rec) {
                 LOG(("  Out of memory: no cache entry for [%s].\n", host));
                 rv = NS_ERROR_OUT_OF_MEMORY;
             }
             // do we have a cached result that we can reuse?
             else if (!(flags & RES_BYPASS_CACHE) &&
@@ -827,17 +827,17 @@ nsHostResolver::ResolveHost(const char  
             // If this is an IPV4 or IPV6 specific request, check if there is
             // an AF_UNSPEC entry we can use. Otherwise, hit the resolver...
             else if (!he->rec->resolving) {
                 if (!(flags & RES_BYPASS_CACHE) &&
                     ((af == PR_AF_INET) || (af == PR_AF_INET6))) {
                     // First, search for an entry with AF_UNSPEC
                     const nsHostKey unspecKey = { host, flags, PR_AF_UNSPEC };
                     nsHostDBEnt *unspecHe = static_cast<nsHostDBEnt *>
-                        (PL_DHashTableOperate(&mDB, &unspecKey, PL_DHASH_LOOKUP));
+                        (PL_DHashTableLookup(&mDB, &unspecKey));
                     NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(unspecHe) ||
                                  (PL_DHASH_ENTRY_IS_BUSY(unspecHe) &&
                                   unspecHe->rec),
                                 "Valid host entries should contain a record");
                     if (PL_DHASH_ENTRY_IS_BUSY(unspecHe) &&
                         unspecHe->rec &&
                         unspecHe->rec->HasUsableResult(TimeStamp::NowLoRes(), flags)) {
 
@@ -955,17 +955,17 @@ nsHostResolver::DetachCallback(const cha
                                nsresult               status)
 {
     nsRefPtr<nsHostRecord> rec;
     {
         MutexAutoLock lock(mLock);
 
         nsHostKey key = { host, flags, af };
         nsHostDBEnt *he = static_cast<nsHostDBEnt *>
-                                     (PL_DHashTableOperate(&mDB, &key, PL_DHASH_LOOKUP));
+                                     (PL_DHashTableLookup(&mDB, &key));
         if (he && he->rec) {
             // walk list looking for |callback|... we cannot assume
             // that it will be there!
             PRCList *node = he->rec->callbacks.next;
             while (node != &he->rec->callbacks) {
                 if (static_cast<nsResolveHostCallback *>(node) == callback) {
                     PR_REMOVE_LINK(callback);
                     rec = he->rec;
@@ -1247,17 +1247,17 @@ nsHostResolver::OnLookupComplete(nsHostR
             NS_ADDREF(rec);
             if (mEvictionQSize < mMaxCacheEntries)
                 mEvictionQSize++;
             else {
                 // remove first element on mEvictionQ
                 nsHostRecord *head =
                     static_cast<nsHostRecord *>(PR_LIST_HEAD(&mEvictionQ));
                 PR_REMOVE_AND_INIT_LINK(head);
-                PL_DHashTableOperate(&mDB, (nsHostKey *) head, PL_DHASH_REMOVE);
+                PL_DHashTableRemove(&mDB, (nsHostKey *) head);
 
                 if (!head->negative) {
                     // record the age of the entry upon eviction.
                     TimeDuration age = TimeStamp::NowLoRes() - head->mValidStart;
                     Telemetry::Accumulate(Telemetry::DNS_CLEANUP_AGE,
                                           static_cast<uint32_t>(age.ToSeconds() / 60));
                 }
 
@@ -1303,17 +1303,17 @@ nsHostResolver::CancelAsyncRequest(const
                                    nsresult               status)
 
 {
     MutexAutoLock lock(mLock);
 
     // Lookup the host record associated with host, flags & address family
     nsHostKey key = { host, flags, af };
     nsHostDBEnt *he = static_cast<nsHostDBEnt *>
-                      (PL_DHashTableOperate(&mDB, &key, PL_DHASH_LOOKUP));
+                      (PL_DHashTableLookup(&mDB, &key));
     if (he && he->rec) {
         nsHostRecord* recPtr = nullptr;
         PRCList *node = he->rec->callbacks.next;
         // Remove the first nsDNSAsyncRequest callback which matches the
         // supplied listener object
         while (node != &he->rec->callbacks) {
             nsResolveHostCallback *callback
                 = static_cast<nsResolveHostCallback *>(node);
@@ -1324,17 +1324,17 @@ nsHostResolver::CancelAsyncRequest(const
                 callback->OnLookupComplete(this, recPtr, status);
                 break;
             }
             node = node->next;
         }
 
         // If there are no more callbacks, remove the hash table entry
         if (recPtr && PR_CLIST_IS_EMPTY(&recPtr->callbacks)) {
-            PL_DHashTableOperate(&mDB, (nsHostKey *)recPtr, PL_DHASH_REMOVE);
+            PL_DHashTableRemove(&mDB, (nsHostKey *)recPtr);
             // If record is on a Queue, remove it and then deref it
             if (recPtr->next != recPtr) {
                 PR_REMOVE_LINK(recPtr);
                 NS_RELEASE(recPtr);
             }
         }
     }
 }
--- a/netwerk/protocol/http/nsHttp.cpp
+++ b/netwerk/protocol/http/nsHttp.cpp
@@ -120,17 +120,17 @@ nsHttp::CreateAtomTable()
 #define HTTP_ATOM(_name, _value) nsHttp::_name._val,
 #include "nsHttpAtomList.h"
 #undef HTTP_ATOM
         nullptr
     };
 
     for (int i = 0; atoms[i]; ++i) {
         PLDHashEntryStub *stub = reinterpret_cast<PLDHashEntryStub *>
-                                                 (PL_DHashTableOperate(&sAtomTable, atoms[i], PL_DHASH_ADD));
+                                                 (PL_DHashTableAdd(&sAtomTable, atoms[i]));
         if (!stub)
             return NS_ERROR_OUT_OF_MEMORY;
 
         MOZ_ASSERT(!stub->key, "duplicate static atom");
         stub->key = atoms[i];
     }
 
     return NS_OK;
@@ -169,17 +169,17 @@ nsHttp::ResolveAtom(const char *str)
     nsHttpAtom atom = { nullptr };
 
     if (!str || !sAtomTable.ops)
         return atom;
 
     MutexAutoLock lock(*sLock);
 
     PLDHashEntryStub *stub = reinterpret_cast<PLDHashEntryStub *>
-                                             (PL_DHashTableOperate(&sAtomTable, str, PL_DHASH_ADD));
+                                             (PL_DHashTableAdd(&sAtomTable, str));
     if (!stub)
         return atom;  // out of memory
 
     if (stub->key) {
         atom._val = reinterpret_cast<const char *>(stub->key);
         return atom;
     }
 
--- a/parser/htmlparser/nsHTMLEntities.cpp
+++ b/parser/htmlparser/nsHTMLEntities.cpp
@@ -104,29 +104,26 @@ nsHTMLEntities::AddRefTable(void)
     }
     for (const EntityNode *node = gEntityArray,
                  *node_end = ArrayEnd(gEntityArray);
          node < node_end; ++node) {
 
       // add to Entity->Unicode table
       EntityNodeEntry* entry =
         static_cast<EntityNodeEntry*>
-                   (PL_DHashTableOperate(&gEntityToUnicode,
-                                            node->mStr,
-                                            PL_DHASH_ADD));
+                   (PL_DHashTableAdd(&gEntityToUnicode, node->mStr));
       NS_ASSERTION(entry, "Error adding an entry");
       // Prefer earlier entries when we have duplication.
       if (!entry->node)
         entry->node = node;
 
       // add to Unicode->Entity table
       entry = static_cast<EntityNodeEntry*>
-                         (PL_DHashTableOperate(&gUnicodeToEntity,
-                                                  NS_INT32_TO_PTR(node->mUnicode),
-                                                  PL_DHASH_ADD));
+                         (PL_DHashTableAdd(&gUnicodeToEntity,
+                                           NS_INT32_TO_PTR(node->mUnicode)));
       NS_ASSERTION(entry, "Error adding an entry");
       // Prefer earlier entries when we have duplication.
       if (!entry->node)
         entry->node = node;
     }
 #ifdef DEBUG
     PL_DHashMarkTableImmutable(&gUnicodeToEntity);
     PL_DHashMarkTableImmutable(&gEntityToUnicode);
@@ -166,17 +163,17 @@ nsHTMLEntities::EntityToUnicode(const ns
     if(';'==aEntity.Last()) {
       nsAutoCString temp(aEntity);
       temp.Truncate(aEntity.Length()-1);
       return EntityToUnicode(temp);
     }
       
   EntityNodeEntry* entry = 
     static_cast<EntityNodeEntry*>
-               (PL_DHashTableOperate(&gEntityToUnicode, aEntity.get(), PL_DHASH_LOOKUP));
+               (PL_DHashTableLookup(&gEntityToUnicode, aEntity.get()));
 
   if (!entry || PL_DHASH_ENTRY_IS_FREE(entry))
   return -1;
         
   return entry->node->mUnicode;
 }
 
 
@@ -192,17 +189,17 @@ nsHTMLEntities::EntityToUnicode(const ns
 
 
 const char*
 nsHTMLEntities::UnicodeToEntity(int32_t aUnicode)
 {
   NS_ASSERTION(gUnicodeToEntity.ops, "no lookup table, needs addref");
   EntityNodeEntry* entry =
     static_cast<EntityNodeEntry*>
-               (PL_DHashTableOperate(&gUnicodeToEntity, NS_INT32_TO_PTR(aUnicode), PL_DHASH_LOOKUP));
+               (PL_DHashTableLookup(&gUnicodeToEntity, NS_INT32_TO_PTR(aUnicode)));
                    
   if (!entry || PL_DHASH_ENTRY_IS_FREE(entry))
   return nullptr;
     
   return entry->node->mStr;
 }
 
 #ifdef DEBUG
--- a/rdf/base/nsInMemoryDataSource.cpp
+++ b/rdf/base/nsInMemoryDataSource.cpp
@@ -315,24 +315,24 @@ protected:
     static PLDHashOperator
     SweepForwardArcsEntries(PLDHashTable* aTable, PLDHashEntryHdr* aHdr,
                             uint32_t aNumber, void* aArg);
 
 public:
     // Implementation methods
     Assertion*
     GetForwardArcs(nsIRDFResource* u) {
-        PLDHashEntryHdr* hdr = PL_DHashTableOperate(&mForwardArcs, u, PL_DHASH_LOOKUP);
+        PLDHashEntryHdr* hdr = PL_DHashTableLookup(&mForwardArcs, u);
         return PL_DHASH_ENTRY_IS_BUSY(hdr)
             ? reinterpret_cast<Entry*>(hdr)->mAssertions
             : nullptr; }
 
     Assertion*
     GetReverseArcs(nsIRDFNode* v) {
-        PLDHashEntryHdr* hdr = PL_DHashTableOperate(&mReverseArcs, v, PL_DHASH_LOOKUP);
+        PLDHashEntryHdr* hdr = PL_DHashTableLookup(&mReverseArcs, v);
         return PL_DHASH_ENTRY_IS_BUSY(hdr)
             ? reinterpret_cast<Entry*>(hdr)->mAssertions
             : nullptr; }
 
     void
     SetForwardArcs(nsIRDFResource* u, Assertion* as) {
         PLDHashEntryHdr* hdr = PL_DHashTableOperate(&mForwardArcs, u,
                                                     as ? PL_DHASH_ADD : PL_DHASH_REMOVE);
@@ -431,18 +431,18 @@ InMemoryAssertionEnumeratorImpl::InMemor
     NS_ADDREF(mProperty);
     NS_IF_ADDREF(mTarget);
 
     if (mSource) {
         mNextAssertion = mDataSource->GetForwardArcs(mSource);
 
         if (mNextAssertion && mNextAssertion->mHashEntry) {
             // its our magical HASH_ENTRY forward hash for assertions
-            PLDHashEntryHdr* hdr = PL_DHashTableOperate(mNextAssertion->u.hash.mPropertyHash,
-                aProperty, PL_DHASH_LOOKUP);
+            PLDHashEntryHdr* hdr = PL_DHashTableLookup(mNextAssertion->u.hash.mPropertyHash,
+                aProperty);
             mNextAssertion = PL_DHASH_ENTRY_IS_BUSY(hdr)
                 ? reinterpret_cast<Entry*>(hdr)->mAssertions
                 : nullptr;
         }
     }
     else {
         mNextAssertion = mDataSource->GetReverseArcs(mTarget);
     }
@@ -975,17 +975,17 @@ InMemoryDataSource::GetTarget(nsIRDFReso
         return NS_ERROR_NULL_POINTER;
 
     NS_PRECONDITION(target != nullptr, "null ptr");
     if (! target)
         return NS_ERROR_NULL_POINTER;
 
     Assertion *as = GetForwardArcs(source);
     if (as && as->mHashEntry) {
-        PLDHashEntryHdr* hdr = PL_DHashTableOperate(as->u.hash.mPropertyHash, property, PL_DHASH_LOOKUP);
+        PLDHashEntryHdr* hdr = PL_DHashTableLookup(as->u.hash.mPropertyHash, property);
         Assertion* val = PL_DHASH_ENTRY_IS_BUSY(hdr)
             ? reinterpret_cast<Entry*>(hdr)->mAssertions
             : nullptr;
         while (val) {
             if (tv == val->u.as.mTruthValue) {
                 *target = val->u.as.mTarget;
                 NS_IF_ADDREF(*target);
                 return NS_OK;
@@ -1021,17 +1021,17 @@ InMemoryDataSource::HasAssertion(nsIRDFR
     if (! property)
         return NS_ERROR_NULL_POINTER;
 
     if (! target)
         return NS_ERROR_NULL_POINTER;
 
     Assertion *as = GetForwardArcs(source);
     if (as && as->mHashEntry) {
-        PLDHashEntryHdr* hdr = PL_DHashTableOperate(as->u.hash.mPropertyHash, property, PL_DHASH_LOOKUP);
+        PLDHashEntryHdr* hdr = PL_DHashTableLookup(as->u.hash.mPropertyHash, property);
         Assertion* val = PL_DHASH_ENTRY_IS_BUSY(hdr)
             ? reinterpret_cast<Entry*>(hdr)->mAssertions
             : nullptr;
         while (val) {
             if ((val->u.as.mTarget == target) && (tv == (val->u.as.mTruthValue))) {
                 *hasAssertion = true;
                 return NS_OK;
             }
@@ -1134,17 +1134,17 @@ InMemoryDataSource::LockedAssert(nsIRDFR
 #endif
 
     Assertion* next = GetForwardArcs(aSource);
     Assertion* prev = next;
     Assertion* as = nullptr;
 
     bool    haveHash = (next) ? next->mHashEntry : false;
     if (haveHash) {
-        PLDHashEntryHdr* hdr = PL_DHashTableOperate(next->u.hash.mPropertyHash, aProperty, PL_DHASH_LOOKUP);
+        PLDHashEntryHdr* hdr = PL_DHashTableLookup(next->u.hash.mPropertyHash, aProperty);
         Assertion* val = PL_DHASH_ENTRY_IS_BUSY(hdr)
             ? reinterpret_cast<Entry*>(hdr)->mAssertions
             : nullptr;
         while (val) {
             if (val->u.as.mTarget == aTarget) {
                 // Wow, we already had the assertion. Make sure that the
                 // truth values are correct and bail.
                 val->u.as.mTruthValue = aTruthValue;
@@ -1175,30 +1175,29 @@ InMemoryDataSource::LockedAssert(nsIRDFR
     if (! as)
         return NS_ERROR_OUT_OF_MEMORY;
 
     // Add the datasource's owning reference.
     as->AddRef();
 
     if (haveHash)
     {
-        PLDHashEntryHdr* hdr = PL_DHashTableOperate(next->u.hash.mPropertyHash,
-            aProperty, PL_DHASH_LOOKUP);
+        PLDHashEntryHdr* hdr = PL_DHashTableLookup(next->u.hash.mPropertyHash,
+            aProperty);
         Assertion *asRef = PL_DHASH_ENTRY_IS_BUSY(hdr)
             ? reinterpret_cast<Entry*>(hdr)->mAssertions
             : nullptr;
         if (asRef)
         {
             as->mNext = asRef->mNext;
             asRef->mNext = as;
         }
         else
         {
-            hdr = PL_DHashTableOperate(next->u.hash.mPropertyHash,
-                                            aProperty, PL_DHASH_ADD);
+            hdr = PL_DHashTableAdd(next->u.hash.mPropertyHash, aProperty);
             if (hdr)
             {
                 Entry* entry = reinterpret_cast<Entry*>(hdr);
                 entry->mNode = aProperty;
                 entry->mAssertions = as;
             }
         }
     }
@@ -1277,18 +1276,18 @@ InMemoryDataSource::LockedUnassert(nsIRD
 
     Assertion* next = GetForwardArcs(aSource);
     Assertion* prev = next;
     Assertion* root = next;
     Assertion* as = nullptr;
     
     bool    haveHash = (next) ? next->mHashEntry : false;
     if (haveHash) {
-        PLDHashEntryHdr* hdr = PL_DHashTableOperate(next->u.hash.mPropertyHash,
-            aProperty, PL_DHASH_LOOKUP);
+        PLDHashEntryHdr* hdr = PL_DHashTableLookup(next->u.hash.mPropertyHash,
+            aProperty);
         prev = next = PL_DHASH_ENTRY_IS_BUSY(hdr)
             ? reinterpret_cast<Entry*>(hdr)->mAssertions
             : nullptr;
         bool first = true;
         while (next) {
             if (aTarget == next->u.as.mTarget) {
                 break;
             }
@@ -1301,18 +1300,18 @@ InMemoryDataSource::LockedUnassert(nsIRD
             return NS_OK;
 
         as = next;
 
         if (first) {
             PL_DHashTableRawRemove(root->u.hash.mPropertyHash, hdr);
 
             if (next && next->mNext) {
-                PLDHashEntryHdr* hdr = PL_DHashTableOperate(root->u.hash.mPropertyHash,
-                                     aProperty, PL_DHASH_ADD);
+                PLDHashEntryHdr* hdr = PL_DHashTableAdd(root->u.hash.mPropertyHash,
+                                     aProperty);
                 if (hdr) {
                     Entry* entry = reinterpret_cast<Entry*>(hdr);
                     entry->mNode = aProperty;
                     entry->mAssertions = next->mNext;
                 }
             }
             else {
                 // If this second-level hash empties out, clean it up.
@@ -1580,18 +1579,18 @@ InMemoryDataSource::HasArcIn(nsIRDFNode 
     return NS_OK;
 }
 
 NS_IMETHODIMP 
 InMemoryDataSource::HasArcOut(nsIRDFResource *aSource, nsIRDFResource *aArc, bool *result)
 {
     Assertion* ass = GetForwardArcs(aSource);
     if (ass && ass->mHashEntry) {
-        PLDHashEntryHdr* hdr = PL_DHashTableOperate(ass->u.hash.mPropertyHash,
-            aArc, PL_DHASH_LOOKUP);
+        PLDHashEntryHdr* hdr = PL_DHashTableLookup(ass->u.hash.mPropertyHash,
+            aArc);
         Assertion* val = PL_DHASH_ENTRY_IS_BUSY(hdr)
             ? reinterpret_cast<Entry*>(hdr)->mAssertions
             : nullptr;
         if (val) {
             *result = true;
             return NS_OK;
         }
         ass = ass->mNext;
@@ -1741,28 +1740,27 @@ InMemoryDataSource::EnsureFastContainmen
 
     // mutate references of existing forward assertions into this hash
     PLDHashTable *table = hashAssertion->u.hash.mPropertyHash;
     Assertion *nextRef;
     while(first) {
         nextRef = first->mNext;
         nsIRDFResource *prop = first->u.as.mProperty;
 
-        PLDHashEntryHdr* hdr = PL_DHashTableOperate(table,
-            prop, PL_DHASH_LOOKUP);
+        PLDHashEntryHdr* hdr = PL_DHashTableLookup(table,
+            prop);
         Assertion* val = PL_DHASH_ENTRY_IS_BUSY(hdr)
             ? reinterpret_cast<Entry*>(hdr)->mAssertions
             : nullptr;
         if (val) {
             first->mNext = val->mNext;
             val->mNext = first;
         }
         else {
-            PLDHashEntryHdr* hdr = PL_DHashTableOperate(table,
-                                            prop, PL_DHASH_ADD);
+            PLDHashEntryHdr* hdr = PL_DHashTableAdd(table, prop);
             if (hdr) {
                 Entry* entry = reinterpret_cast<Entry*>(hdr);
                 entry->mNode = prop;
                 entry->mAssertions = first;
                 first->mNext = nullptr;
             }
         }
         first = nextRef;
@@ -1807,18 +1805,18 @@ InMemoryDataSource::Mark(nsIRDFResource*
         return NS_ERROR_NULL_POINTER;
 
     NS_PRECONDITION(aTarget != nullptr, "null ptr");
     if (! aTarget)
         return NS_ERROR_NULL_POINTER;
 
     Assertion *as = GetForwardArcs(aSource);
     if (as && as->mHashEntry) {
-        PLDHashEntryHdr* hdr = PL_DHashTableOperate(as->u.hash.mPropertyHash,
-            aProperty, PL_DHASH_LOOKUP);
+        PLDHashEntryHdr* hdr = PL_DHashTableLookup(as->u.hash.mPropertyHash,
+            aProperty);
         Assertion* val = PL_DHASH_ENTRY_IS_BUSY(hdr)
             ? reinterpret_cast<Entry*>(hdr)->mAssertions
             : nullptr;
         while (val) {
             if ((val->u.as.mTarget == aTarget) &&
                 (aTruthValue == (val->u.as.mTruthValue))) {
 
                 // found it! so mark it.
@@ -1943,17 +1941,17 @@ InMemoryDataSource::SweepForwardArcsEntr
             }
             else {
                 // it's the first one. update the hashtable entry.
                 entry->mAssertions = next;
             }
 
             // remove from the reverse arcs
             PLDHashEntryHdr* hdr =
-                PL_DHashTableOperate(info->mReverseArcs, as->u.as.mTarget, PL_DHASH_LOOKUP);
+                PL_DHashTableLookup(info->mReverseArcs, as->u.as.mTarget);
             NS_ASSERTION(PL_DHASH_ENTRY_IS_BUSY(hdr), "no assertion in reverse arcs");
 
             Entry* rentry = reinterpret_cast<Entry*>(hdr);
             Assertion* ras = rentry->mAssertions;
             Assertion* rprev = nullptr;
             while (ras) {
                 if (ras == as) {
                     if (rprev) {
--- a/rdf/base/nsRDFService.cpp
+++ b/rdf/base/nsRDFService.cpp
@@ -881,17 +881,17 @@ RDFServiceImpl::GetResource(const nsACSt
         return NS_ERROR_INVALID_ARG;
 
     const nsAFlatCString& flatURI = PromiseFlatCString(aURI);
     PR_LOG(gLog, PR_LOG_DEBUG, ("rdfserv get-resource %s", flatURI.get()));
 
     // First, check the cache to see if we've already created and
     // registered this thing.
     PLDHashEntryHdr *hdr =
-        PL_DHashTableOperate(&mResources, flatURI.get(), PL_DHASH_LOOKUP);
+        PL_DHashTableLookup(&mResources, flatURI.get());
 
     if (PL_DHASH_ENTRY_IS_BUSY(hdr)) {
         ResourceHashEntry *entry = static_cast<ResourceHashEntry *>(hdr);
         NS_ADDREF(*aResource = entry->mResource);
         return NS_OK;
     }
 
     // Nope. So go to the repository to create it.
@@ -1051,34 +1051,34 @@ RDFServiceImpl::GetLiteral(const char16_
         return NS_ERROR_NULL_POINTER;
 
     NS_PRECONDITION(aLiteral != nullptr, "null ptr");
     if (! aLiteral)
         return NS_ERROR_NULL_POINTER;
 
     // See if we have one already cached
     PLDHashEntryHdr *hdr =
-        PL_DHashTableOperate(&mLiterals, aValue, PL_DHASH_LOOKUP);
+        PL_DHashTableLookup(&mLiterals, aValue);
 
     if (PL_DHASH_ENTRY_IS_BUSY(hdr)) {
         LiteralHashEntry *entry = static_cast<LiteralHashEntry *>(hdr);
         NS_ADDREF(*aLiteral = entry->mLiteral);
         return NS_OK;
     }
 
     // Nope. Create a new one
     return LiteralImpl::Create(aValue, aLiteral);
 }
 
 NS_IMETHODIMP
 RDFServiceImpl::GetDateLiteral(PRTime aTime, nsIRDFDate** aResult)
 {
     // See if we have one already cached
     PLDHashEntryHdr *hdr =
-        PL_DHashTableOperate(&mDates, &aTime, PL_DHASH_LOOKUP);
+        PL_DHashTableLookup(&mDates, &aTime);
 
     if (PL_DHASH_ENTRY_IS_BUSY(hdr)) {
         DateHashEntry *entry = static_cast<DateHashEntry *>(hdr);
         NS_ADDREF(*aResult = entry->mDate);
         return NS_OK;
     }
 
     DateImpl* result = new DateImpl(aTime);
@@ -1089,17 +1089,17 @@ RDFServiceImpl::GetDateLiteral(PRTime aT
     return NS_OK;
 }
 
 NS_IMETHODIMP
 RDFServiceImpl::GetIntLiteral(int32_t aInt, nsIRDFInt** aResult)
 {
     // See if we have one already cached
     PLDHashEntryHdr *hdr =
-        PL_DHashTableOperate(&mInts, &aInt, PL_DHASH_LOOKUP);
+        PL_DHashTableLookup(&mInts, &aInt);
 
     if (PL_DHASH_ENTRY_IS_BUSY(hdr)) {
         IntHashEntry *entry = static_cast<IntHashEntry *>(hdr);
         NS_ADDREF(*aResult = entry->mInt);
         return NS_OK;
     }
 
     IntImpl* result = new IntImpl(aInt);
@@ -1112,17 +1112,17 @@ RDFServiceImpl::GetIntLiteral(int32_t aI
 
 NS_IMETHODIMP
 RDFServiceImpl::GetBlobLiteral(const uint8_t *aBytes, int32_t aLength,
                                nsIRDFBlob **aResult)
 {
     BlobImpl::Data key = { aLength, const_cast<uint8_t *>(aBytes) };
 
     PLDHashEntryHdr *hdr =
-        PL_DHashTableOperate(&mBlobs, &key, PL_DHASH_LOOKUP);
+        PL_DHashTableLookup(&mBlobs, &key);
 
     if (PL_DHASH_ENTRY_IS_BUSY(hdr)) {
         BlobHashEntry *entry = static_cast<BlobHashEntry *>(hdr);
         NS_ADDREF(*aResult = entry->mBlob);
         return NS_OK;
     }
 
     BlobImpl *result = new BlobImpl(aBytes, aLength);
@@ -1175,17 +1175,17 @@ RDFServiceImpl::RegisterResource(nsIRDFR
     NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get URI from resource");
     if (NS_FAILED(rv)) return rv;
 
     NS_ASSERTION(uri != nullptr, "resource has no URI");
     if (! uri)
         return NS_ERROR_NULL_POINTER;
 
     PLDHashEntryHdr *hdr =
-        PL_DHashTableOperate(&mResources, uri, PL_DHASH_LOOKUP);
+        PL_DHashTableLookup(&mResources, uri);
 
     if (PL_DHASH_ENTRY_IS_BUSY(hdr)) {
         if (!aReplace) {
             NS_WARNING("resource already registered, and replace not specified");
             return NS_ERROR_FAILURE;    // already registered
         }
 
         // N.B., we do _not_ release the original resource because we
@@ -1193,17 +1193,17 @@ RDFServiceImpl::RegisterResource(nsIRDFR
         // it.
 
         PR_LOG(gLog, PR_LOG_DEBUG,
                ("rdfserv   replace-resource [%p] <-- [%p] %s",
                 static_cast<ResourceHashEntry *>(hdr)->mResource,
                 aResource, (const char*) uri));
     }
     else {
-        hdr = PL_DHashTableOperate(&mResources, uri, PL_DHASH_ADD);
+        hdr = PL_DHashTableAdd(&mResources, uri);
         if (! hdr)
             return NS_ERROR_OUT_OF_MEMORY;
 
         PR_LOG(gLog, PR_LOG_DEBUG,
                ("rdfserv   register-resource [%p] %s",
                 aResource, (const char*) uri));
     }
 
@@ -1235,21 +1235,21 @@ RDFServiceImpl::UnregisterResource(nsIRD
     if (! uri)
         return NS_ERROR_UNEXPECTED;
 
     PR_LOG(gLog, PR_LOG_DEBUG,
            ("rdfserv unregister-resource [%p] %s",
             aResource, (const char*) uri));
 
 #ifdef DEBUG
-    if (PL_DHASH_ENTRY_IS_FREE(PL_DHashTableOperate(&mResources, uri, PL_DHASH_LOOKUP)))
+    if (PL_DHASH_ENTRY_IS_FREE(PL_DHashTableLookup(&mResources, uri)))
         NS_WARNING("resource was never registered");
 #endif
 
-    PL_DHashTableOperate(&mResources, uri, PL_DHASH_REMOVE);
+    PL_DHashTableRemove(&mResources, uri);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 RDFServiceImpl::RegisterDataSource(nsIRDFDataSource* aDataSource, bool aReplace)
 {
     NS_PRECONDITION(aDataSource != nullptr, "null ptr");
     if (! aDataSource)
@@ -1427,23 +1427,22 @@ RDFServiceImpl::GetDataSource(const char
 ////////////////////////////////////////////////////////////////////////
 
 nsresult
 RDFServiceImpl::RegisterLiteral(nsIRDFLiteral* aLiteral)
 {
     const char16_t* value;
     aLiteral->GetValueConst(&value);
 
-    NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(PL_DHashTableOperate(&mLiterals,
-                                                             value,
-                                                             PL_DHASH_LOOKUP)),
+    NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(PL_DHashTableLookup(&mLiterals,
+                                                            value)),
                  "literal already registered");
 
     PLDHashEntryHdr *hdr =
-        PL_DHashTableOperate(&mLiterals, value, PL_DHASH_ADD);
+        PL_DHashTableAdd(&mLiterals, value);
 
     if (! hdr)
         return NS_ERROR_OUT_OF_MEMORY;
 
     LiteralHashEntry *entry = static_cast<LiteralHashEntry *>(hdr);
 
     // N.B., we only hold a weak reference to the literal: that
     // way, the literal can be destroyed when the last refcount
@@ -1461,22 +1460,21 @@ RDFServiceImpl::RegisterLiteral(nsIRDFLi
 
 
 nsresult
 RDFServiceImpl::UnregisterLiteral(nsIRDFLiteral* aLiteral)
 {
     const char16_t* value;
     aLiteral->GetValueConst(&value);
 
-    NS_ASSERTION(PL_DHASH_ENTRY_IS_BUSY(PL_DHashTableOperate(&mLiterals,
-                                                             value,
-                                                             PL_DHASH_LOOKUP)),
+    NS_ASSERTION(PL_DHASH_ENTRY_IS_BUSY(PL_DHashTableLookup(&mLiterals,
+                                                            value)),
                  "literal was never registered");
 
-    PL_DHashTableOperate(&mLiterals, value, PL_DHASH_REMOVE);
+    PL_DHashTableRemove(&mLiterals, value);
 
     // N.B. that we _don't_ release the literal: we only held a weak
     // reference to it in the hashtable.
     PR_LOG(gLog, PR_LOG_DEBUG,
            ("rdfserv unregister-literal [%p] %s",
             aLiteral, (const char16_t*) value));
 
     return NS_OK;
@@ -1485,23 +1483,22 @@ RDFServiceImpl::UnregisterLiteral(nsIRDF
 //----------------------------------------------------------------------
 
 nsresult
 RDFServiceImpl::RegisterInt(nsIRDFInt* aInt)
 {
     int32_t value;
     aInt->GetValue(&value);
 
-    NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(PL_DHashTableOperate(&mInts,
-                                                             &value,
-                                                             PL_DHASH_LOOKUP)),
+    NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(PL_DHashTableLookup(&mInts,
+                                                            &value)),
                  "int already registered");
 
     PLDHashEntryHdr *hdr =
-        PL_DHashTableOperate(&mInts, &value, PL_DHASH_ADD);
+        PL_DHashTableAdd(&mInts, &value);
 
     if (! hdr)
         return NS_ERROR_OUT_OF_MEMORY;
 
     IntHashEntry *entry = static_cast<IntHashEntry *>(hdr);
 
     // N.B., we only hold a weak reference to the literal: that
     // way, the literal can be destroyed when the last refcount
@@ -1519,22 +1516,21 @@ RDFServiceImpl::RegisterInt(nsIRDFInt* a
 
 
 nsresult
 RDFServiceImpl::UnregisterInt(nsIRDFInt* aInt)
 {
     int32_t value;
     aInt->GetValue(&value);
 
-    NS_ASSERTION(PL_DHASH_ENTRY_IS_BUSY(PL_DHashTableOperate(&mInts,
-                                                             &value,
-                                                             PL_DHASH_LOOKUP)),
+    NS_ASSERTION(PL_DHASH_ENTRY_IS_BUSY(PL_DHashTableLookup(&mInts,
+                                                            &value)),
                  "int was never registered");
 
-    PL_DHashTableOperate(&mInts, &value, PL_DHASH_REMOVE);
+    PL_DHashTableRemove(&mInts, &value);
 
     // N.B. that we _don't_ release the literal: we only held a weak
     // reference to it in the hashtable.
     PR_LOG(gLog, PR_LOG_DEBUG,
            ("rdfserv unregister-int [%p] %d",
             aInt, value));
 
     return NS_OK;
@@ -1543,23 +1539,22 @@ RDFServiceImpl::UnregisterInt(nsIRDFInt*
 //----------------------------------------------------------------------
 
 nsresult
 RDFServiceImpl::RegisterDate(nsIRDFDate* aDate)
 {
     PRTime value;
     aDate->GetValue(&value);
 
-    NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(PL_DHashTableOperate(&mDates,
-                                                             &value,
-                                                             PL_DHASH_LOOKUP)),
+    NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(PL_DHashTableLookup(&mDates,
+                                                            &value)),
                  "date already registered");
 
     PLDHashEntryHdr *hdr =
-        PL_DHashTableOperate(&mDates, &value, PL_DHASH_ADD);
+        PL_DHashTableAdd(&mDates, &value);
 
     if (! hdr)
         return NS_ERROR_OUT_OF_MEMORY;
 
     DateHashEntry *entry = static_cast<DateHashEntry *>(hdr);
 
     // N.B., we only hold a weak reference to the literal: that
     // way, the literal can be destroyed when the last refcount
@@ -1577,42 +1572,40 @@ RDFServiceImpl::RegisterDate(nsIRDFDate*
 
 
 nsresult
 RDFServiceImpl::UnregisterDate(nsIRDFDate* aDate)
 {
     PRTime value;
     aDate->GetValue(&value);
 
-    NS_ASSERTION(PL_DHASH_ENTRY_IS_BUSY(PL_DHashTableOperate(&mDates,
-                                                             &value,
-                                                             PL_DHASH_LOOKUP)),
+    NS_ASSERTION(PL_DHASH_ENTRY_IS_BUSY(PL_DHashTableLookup(&mDates,
+                                                            &value)),
                  "date was never registered");
 
-    PL_DHashTableOperate(&mDates, &value, PL_DHASH_REMOVE);
+    PL_DHashTableRemove(&mDates, &value);
 
     // N.B. that we _don't_ release the literal: we only held a weak
     // reference to it in the hashtable.
     PR_LOG(gLog, PR_LOG_DEBUG,
            ("rdfserv unregister-date [%p] %ld",
             aDate, value));
 
     return NS_OK;
 }
 
 nsresult
 RDFServiceImpl::RegisterBlob(BlobImpl *aBlob)
 {
-    NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(PL_DHashTableOperate(&mBlobs,
-                                                             &aBlob->mData,
-                                                             PL_DHASH_LOOKUP)),
+    NS_ASSERTION(PL_DHASH_ENTRY_IS_FREE(PL_DHashTableLookup(&mBlobs,
+                                                            &aBlob->mData)),
                  "blob already registered");
 
     PLDHashEntryHdr *hdr = 
-        PL_DHashTableOperate(&mBlobs, &aBlob->mData, PL_DHASH_ADD);
+        PL_DHashTableAdd(&mBlobs, &aBlob->mData);
 
     if (! hdr)
         return NS_ERROR_OUT_OF_MEMORY;
 
     BlobHashEntry *entry = static_cast<BlobHashEntry *>(hdr);
 
     // N.B., we only hold a weak reference to the literal: that
     // way, the literal can be destroyed when the last refcount
@@ -1625,22 +1618,21 @@ RDFServiceImpl::RegisterBlob(BlobImpl *a
             aBlob, aBlob->mData.mBytes));
 
     return NS_OK;
 }
 
 nsresult
 RDFServiceImpl::UnregisterBlob(BlobImpl *aBlob)
 {
-    NS_ASSERTION(PL_DHASH_ENTRY_IS_BUSY(PL_DHashTableOperate(&mBlobs,
-                                                             &aBlob->mData,
-                                                             PL_DHASH_LOOKUP)),
+    NS_ASSERTION(PL_DHASH_ENTRY_IS_BUSY(PL_DHashTableLookup(&mBlobs,
+                                                            &aBlob->mData)),
                  "blob was never registered");
 
-    PL_DHashTableOperate(&mBlobs, &aBlob->mData, PL_DHASH_REMOVE);
+    PL_DHashTableRemove(&mBlobs, &aBlob->mData);
  
      // N.B. that we _don't_ release the literal: we only held a weak
      // reference to it in the hashtable.
     PR_LOG(gLog, PR_LOG_DEBUG,
            ("rdfserv unregister-blob [%p] %s",
             aBlob, aBlob->mData.mBytes));
 
     return NS_OK;
--- a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
@@ -957,33 +957,33 @@ nsSecureBrowserUIImpl::OnStateChange(nsI
   if (aProgressStateFlags & STATE_TRANSFERRING
       &&
       aProgressStateFlags & STATE_IS_REQUEST)
   {
     // The listing of a request in mTransferringRequests
     // means, there has already been data transfered.
 
     ReentrantMonitorAutoEnter lock(mReentrantMonitor);
-    PL_DHashTableOperate(&mTransferringRequests, aRequest, PL_DHASH_ADD);
+    PL_DHashTableAdd(&mTransferringRequests, aRequest);
     
     return NS_OK;
   }
 
   bool requestHasTransferedData = false;
 
   if (aProgressStateFlags & STATE_STOP
       &&
       aProgressStateFlags & STATE_IS_REQUEST)
   {
     { /* scope for the ReentrantMonitorAutoEnter */
       ReentrantMonitorAutoEnter lock(mReentrantMonitor);
-      PLDHashEntryHdr *entry = PL_DHashTableOperate(&mTransferringRequests, aRequest, PL_DHASH_LOOKUP);
+      PLDHashEntryHdr *entry = PL_DHashTableLookup(&mTransferringRequests, aRequest);
       if (PL_DHASH_ENTRY_IS_BUSY(entry))
       {
-        PL_DHashTableOperate(&mTransferringRequests, aRequest, PL_DHASH_REMOVE);
+        PL_DHashTableRemove(&mTransferringRequests, aRequest);
 
         requestHasTransferedData = true;
       }
     }
 
     if (!requestHasTransferedData) {
       // Because image loads doesn't support any TRANSFERRING notifications but
       // only START and STOP we must ask them directly whether content was
--- a/security/manager/ssl/src/nsCertTree.cpp
+++ b/security/manager/ssl/src/nsCertTree.cpp
@@ -207,23 +207,23 @@ nsCertTree::FreeCertArray()
 }
 
 CompareCacheHashEntry *
 nsCertTree::getCacheEntry(void *cache, void *aCert)
 {
   PLDHashTable &aCompareCache = *reinterpret_cast<PLDHashTable*>(cache);
   CompareCacheHashEntryPtr *entryPtr = 
     static_cast<CompareCacheHashEntryPtr*>
-               (PL_DHashTableOperate(&aCompareCache, aCert, PL_DHASH_ADD));
+               (PL_DHashTableAdd(&aCompareCache, aCert));
   return entryPtr ? entryPtr->entry : nullptr;
 }
 
 void nsCertTree::RemoveCacheEntry(void *key)
 {
-  PL_DHashTableOperate(&mCompareCache, key, PL_DHASH_REMOVE);
+  PL_DHashTableRemove(&mCompareCache, key);
 }
 
 // CountOrganizations
 //
 // Count the number of different organizations encountered in the cert
 // list.
 int32_t
 nsCertTree::CountOrganizations()
--- a/security/manager/ssl/src/nsNSSShutDown.cpp
+++ b/security/manager/ssl/src/nsNSSShutDown.cpp
@@ -73,47 +73,47 @@ nsNSSShutDownList::~nsNSSShutDownList()
 
 void nsNSSShutDownList::remember(nsNSSShutDownObject *o)
 {
   if (!singleton)
     return;
   
   PR_ASSERT(o);
   MutexAutoLock lock(singleton->mListLock);
-    PL_DHashTableOperate(&singleton->mObjects, o, PL_DHASH_ADD);
+  PL_DHashTableAdd(&singleton->mObjects, o);
 }
 
 void nsNSSShutDownList::forget(nsNSSShutDownObject *o)
 {
   if (!singleton)
     return;
   
   PR_ASSERT(o);
   MutexAutoLock lock(singleton->mListLock);
-  PL_DHashTableOperate(&singleton->mObjects, o, PL_DHASH_REMOVE);
+  PL_DHashTableRemove(&singleton->mObjects, o);
 }
 
 void nsNSSShutDownList::remember(nsOnPK11LogoutCancelObject *o)
 {
   if (!singleton)
     return;
   
   PR_ASSERT(o);
   MutexAutoLock lock(singleton->mListLock);
-  PL_DHashTableOperate(&singleton->mPK11LogoutCancelObjects, o, PL_DHASH_ADD);
+  PL_DHashTableAdd(&singleton->mPK11LogoutCancelObjects, o);
 }
 
 void nsNSSShutDownList::forget(nsOnPK11LogoutCancelObject *o)
 {
   if (!singleton)
     return;
   
   PR_ASSERT(o);
   MutexAutoLock lock(singleton->mListLock);
-  PL_DHashTableOperate(&singleton->mPK11LogoutCancelObjects, o, PL_DHASH_REMOVE);
+  PL_DHashTableRemove(&singleton->mPK11LogoutCancelObjects, o);
 }
 
 void nsNSSShutDownList::trackSSLSocketCreate()
 {
   if (!singleton)
     return;
   
   MutexAutoLock lock(singleton->mListLock);
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -1339,34 +1339,33 @@ nsDocLoader::RefreshAttempted(nsIWebProg
       mParent->RefreshAttempted(aWebProgress, aURI, aDelay, aSameURI);
   }
 
   return allowRefresh;
 }
 
 nsresult nsDocLoader::AddRequestInfo(nsIRequest *aRequest)
 {
-  if (!PL_DHashTableOperate(&mRequestInfoHash, aRequest, PL_DHASH_ADD)) {
+  if (!PL_DHashTableAdd(&mRequestInfoHash, aRequest)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   return NS_OK;
 }
 
 void nsDocLoader::RemoveRequestInfo(nsIRequest *aRequest)
 {
-  PL_DHashTableOperate(&mRequestInfoHash, aRequest, PL_DHASH_REMOVE);
+  PL_DHashTableRemove(&mRequestInfoHash, aRequest);
 }
 
 nsDocLoader::nsRequestInfo* nsDocLoader::GetRequestInfo(nsIRequest* aRequest)
 {
   nsRequestInfo* info =
     static_cast<nsRequestInfo*>
-               (PL_DHashTableOperate(&mRequestInfoHash, aRequest,
-                                        PL_DHASH_LOOKUP));
+               (PL_DHashTableLookup(&mRequestInfoHash, aRequest));
 
   if (PL_DHASH_ENTRY_IS_FREE(info)) {
     // Nothing found in the hash, return null.
 
     return nullptr;
   }
 
   // Return what we found in the hash...