Bug 1170416 (part 3) - Remove the PLDHashTable2 typedef. r=froydnj.

This commit is contained in:
Nicholas Nethercote 2015-05-19 16:46:17 -07:00
parent c61daa7222
commit 662f90fecb
43 changed files with 121 additions and 124 deletions

View File

@ -153,7 +153,7 @@ nsSimpleContentList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto
} }
// Hashtable for storing nsContentLists // Hashtable for storing nsContentLists
static PLDHashTable2* gContentListHashTable; static PLDHashTable* gContentListHashTable;
#define RECENTLY_USED_CONTENT_LIST_CACHE_SIZE 31 #define RECENTLY_USED_CONTENT_LIST_CACHE_SIZE 31
static nsContentList* static nsContentList*
@ -217,7 +217,7 @@ NS_GetContentList(nsINode* aRootNode,
// Initialize the hashtable if needed. // Initialize the hashtable if needed.
if (!gContentListHashTable) { if (!gContentListHashTable) {
gContentListHashTable = gContentListHashTable =
new PLDHashTable2(&hash_table_ops, sizeof(ContentListHashEntry)); new PLDHashTable(&hash_table_ops, sizeof(ContentListHashEntry));
} }
ContentListHashEntry *entry = nullptr; ContentListHashEntry *entry = nullptr;
@ -270,7 +270,7 @@ nsCacheableFuncStringHTMLCollection::WrapObject(JSContext *cx, JS::Handle<JSObje
} }
// Hashtable for storing nsCacheableFuncStringContentList // Hashtable for storing nsCacheableFuncStringContentList
static PLDHashTable2* gFuncStringContentListHashTable; static PLDHashTable* gFuncStringContentListHashTable;
struct FuncStringContentListHashEntry : public PLDHashEntryHdr struct FuncStringContentListHashEntry : public PLDHashEntryHdr
{ {
@ -321,7 +321,7 @@ GetFuncStringContentList(nsINode* aRootNode,
// Initialize the hashtable if needed. // Initialize the hashtable if needed.
if (!gFuncStringContentListHashTable) { if (!gFuncStringContentListHashTable) {
gFuncStringContentListHashTable = gFuncStringContentListHashTable =
new PLDHashTable2(&hash_table_ops, sizeof(FuncStringContentListHashEntry)); new PLDHashTable(&hash_table_ops, sizeof(FuncStringContentListHashEntry));
} }
FuncStringContentListHashEntry *entry = nullptr; FuncStringContentListHashEntry *entry = nullptr;

View File

@ -336,7 +336,7 @@ namespace {
static NS_DEFINE_CID(kParserServiceCID, NS_PARSERSERVICE_CID); static NS_DEFINE_CID(kParserServiceCID, NS_PARSERSERVICE_CID);
static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID); static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID);
static PLDHashTable2* sEventListenerManagersHash; static PLDHashTable* sEventListenerManagersHash;
class DOMEventListenerManagersHashReporter final : public nsIMemoryReporter class DOMEventListenerManagersHashReporter final : public nsIMemoryReporter
{ {
@ -498,7 +498,7 @@ nsContentUtils::Init()
}; };
sEventListenerManagersHash = sEventListenerManagersHash =
new PLDHashTable2(&hash_table_ops, sizeof(EventListenerManagerMapEntry)); new PLDHashTable(&hash_table_ops, sizeof(EventListenerManagerMapEntry));
RegisterStrongMemoryReporter(new DOMEventListenerManagersHashReporter()); RegisterStrongMemoryReporter(new DOMEventListenerManagersHashReporter());
} }

View File

@ -3986,7 +3986,7 @@ nsDocument::SetSubDocumentFor(Element* aElement, nsIDocument* aSubDoc)
SubDocInitEntry SubDocInitEntry
}; };
mSubDocuments = new PLDHashTable2(&hash_table_ops, sizeof(SubDocMapEntry)); mSubDocuments = new PLDHashTable(&hash_table_ops, sizeof(SubDocMapEntry));
} }
// Add a mapping to the hash table // Add a mapping to the hash table

View File

@ -1520,7 +1520,7 @@ protected:
nsTArray<nsIObserver*> mCharSetObservers; nsTArray<nsIObserver*> mCharSetObservers;
PLDHashTable2 *mSubDocuments; PLDHashTable *mSubDocuments;
// Array of owning references to all children // Array of owning references to all children
nsAttrAndChildArray mChildren; nsAttrAndChildArray mChildren;

View File

@ -57,7 +57,7 @@ public:
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf); size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
nsCOMPtr<nsIAtom> mName; // property name nsCOMPtr<nsIAtom> mName; // property name
PLDHashTable2 mObjectValueMap; // map of object/value pairs PLDHashTable mObjectValueMap; // map of object/value pairs
NSPropertyDtorFunc mDtorFunc; // property specific value dtor function NSPropertyDtorFunc mDtorFunc; // property specific value dtor function
void* mDtorData; // pointer to pass to dtor void* mDtorData; // pointer to pass to dtor
bool mTransfer; // whether to transfer in bool mTransfer; // whether to transfer in

View File

@ -234,8 +234,8 @@ private:
nsGlobalNameStruct* LookupNameInternal(const nsAString& aName, nsGlobalNameStruct* LookupNameInternal(const nsAString& aName,
const char16_t **aClassName = nullptr); const char16_t **aClassName = nullptr);
PLDHashTable2 mGlobalNames; PLDHashTable mGlobalNames;
PLDHashTable2 mNavigatorNames; PLDHashTable mNavigatorNames;
}; };
#endif /* nsScriptNameSpaceManager_h__ */ #endif /* nsScriptNameSpaceManager_h__ */

View File

@ -83,7 +83,7 @@ static JSObjWrapperTable sJSObjWrappers;
static bool sJSObjWrappersAccessible = false; static bool sJSObjWrappersAccessible = false;
// Hash of NPObject wrappers that wrap NPObjects as JSObjects. // Hash of NPObject wrappers that wrap NPObjects as JSObjects.
static PLDHashTable2* sNPObjWrappers; static PLDHashTable* sNPObjWrappers;
// Global wrapper count. This includes JSObject wrappers *and* // Global wrapper count. This includes JSObject wrappers *and*
// NPObject wrappers. When this count goes to zero, there are no more // NPObject wrappers. When this count goes to zero, there are no more
@ -408,7 +408,7 @@ CreateNPObjWrapperTable()
} }
sNPObjWrappers = sNPObjWrappers =
new PLDHashTable2(PL_DHashGetStubOps(), sizeof(NPObjWrapperHashEntry)); new PLDHashTable(PL_DHashGetStubOps(), sizeof(NPObjWrapperHashEntry));
return true; return true;
} }
@ -1970,7 +1970,7 @@ NPObjWrapperPluginDestroyedCallback(PLDHashTable *table, PLDHashEntryHdr *hdr,
if (entry->mNpp == nppcx->npp) { if (entry->mNpp == nppcx->npp) {
// HACK: temporarily hide the hash we're enumerating so that invalidate() // HACK: temporarily hide the hash we're enumerating so that invalidate()
// and deallocate() don't touch it. // and deallocate() don't touch it.
PLDHashTable2 *tmp = static_cast<PLDHashTable2*>(table); PLDHashTable *tmp = static_cast<PLDHashTable*>(table);
sNPObjWrappers = nullptr; sNPObjWrappers = nullptr;
NPObject *npobj = entry->mNPObj; NPObject *npobj = entry->mNPObj;

View File

@ -765,7 +765,7 @@ XULDocument::AddBroadcastListenerFor(Element& aBroadcaster, Element& aListener,
}; };
if (! mBroadcasterMap) { if (! mBroadcasterMap) {
mBroadcasterMap = new PLDHashTable2(&gOps, sizeof(BroadcasterMapEntry)); mBroadcasterMap = new PLDHashTable(&gOps, sizeof(BroadcasterMapEntry));
} }
BroadcasterMapEntry* entry = BroadcasterMapEntry* entry =

View File

@ -719,7 +719,7 @@ protected:
/** /**
* A map from a broadcaster element to a list of listener elements. * A map from a broadcaster element to a list of listener elements.
*/ */
PLDHashTable2* mBroadcasterMap; PLDHashTable* mBroadcasterMap;
nsAutoPtr<nsInterfaceHashtable<nsURIHashKey,nsIObserver> > mOverlayLoadObservers; nsAutoPtr<nsInterfaceHashtable<nsURIHashKey,nsIObserver> > mOverlayLoadObservers;
nsAutoPtr<nsInterfaceHashtable<nsURIHashKey,nsIObserver> > mPendingOverlayLoadNotifications; nsAutoPtr<nsInterfaceHashtable<nsURIHashKey,nsIObserver> > mPendingOverlayLoadNotifications;

View File

@ -52,7 +52,7 @@ public:
void Clear() { mMap.Clear(); } void Clear() { mMap.Clear(); }
protected: protected:
PLDHashTable2 mMap; PLDHashTable mMap;
struct Entry : public PLDHashEntryHdr { struct Entry : public PLDHashEntryHdr {
nsIContent* mContent; nsIContent* mContent;

View File

@ -16,7 +16,7 @@ protected:
nsIContent* mTemplate; nsIContent* mTemplate;
}; };
PLDHashTable2 mTable; PLDHashTable mTable;
public: public:
nsTemplateMap() : mTable(PL_DHashGetStubOps(), sizeof(Entry)) { } nsTemplateMap() : mTable(PL_DHashGetStubOps(), sizeof(Entry)) { }

View File

@ -124,7 +124,7 @@ protected:
static void HashClearEntry(PLDHashTable* aTable, PLDHashEntryHdr* aEntry); static void HashClearEntry(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);
PLDHashTable2 mValuesHash; PLDHashTable mValuesHash;
static const PLDHashTableOps sHashOps; static const PLDHashTableOps sHashOps;
}; };

View File

@ -749,7 +749,7 @@ public:
private: private:
mozilla::scache::StartupCache* mCache; mozilla::scache::StartupCache* mCache;
PLDHashTable2 mMap; PLDHashTable mMap;
bool mWriteNeeded; bool mWriteNeeded;
PLDHashTableOps mOps; PLDHashTableOps mOps;

View File

@ -174,7 +174,7 @@ Native2WrappedNativeMap::newMap(int length)
Native2WrappedNativeMap::Native2WrappedNativeMap(int length) Native2WrappedNativeMap::Native2WrappedNativeMap(int length)
{ {
mTable = new PLDHashTable2(PL_DHashGetStubOps(), sizeof(Entry), length); mTable = new PLDHashTable(PL_DHashGetStubOps(), sizeof(Entry), length);
} }
Native2WrappedNativeMap::~Native2WrappedNativeMap() Native2WrappedNativeMap::~Native2WrappedNativeMap()
@ -222,7 +222,7 @@ IID2WrappedJSClassMap::newMap(int length)
IID2WrappedJSClassMap::IID2WrappedJSClassMap(int length) IID2WrappedJSClassMap::IID2WrappedJSClassMap(int length)
{ {
mTable = new PLDHashTable2(&Entry::sOps, sizeof(Entry), length); mTable = new PLDHashTable(&Entry::sOps, sizeof(Entry), length);
} }
IID2WrappedJSClassMap::~IID2WrappedJSClassMap() IID2WrappedJSClassMap::~IID2WrappedJSClassMap()
@ -255,7 +255,7 @@ IID2NativeInterfaceMap::newMap(int length)
IID2NativeInterfaceMap::IID2NativeInterfaceMap(int length) IID2NativeInterfaceMap::IID2NativeInterfaceMap(int length)
{ {
mTable = new PLDHashTable2(&Entry::sOps, sizeof(Entry), length); mTable = new PLDHashTable(&Entry::sOps, sizeof(Entry), length);
} }
IID2NativeInterfaceMap::~IID2NativeInterfaceMap() IID2NativeInterfaceMap::~IID2NativeInterfaceMap()
@ -296,7 +296,7 @@ ClassInfo2NativeSetMap::newMap(int length)
ClassInfo2NativeSetMap::ClassInfo2NativeSetMap(int length) ClassInfo2NativeSetMap::ClassInfo2NativeSetMap(int length)
{ {
mTable = new PLDHashTable2(PL_DHashGetStubOps(), sizeof(Entry), length); mTable = new PLDHashTable(PL_DHashGetStubOps(), sizeof(Entry), length);
} }
ClassInfo2NativeSetMap::~ClassInfo2NativeSetMap() ClassInfo2NativeSetMap::~ClassInfo2NativeSetMap()
@ -326,7 +326,7 @@ ClassInfo2WrappedNativeProtoMap::newMap(int length)
ClassInfo2WrappedNativeProtoMap::ClassInfo2WrappedNativeProtoMap(int length) ClassInfo2WrappedNativeProtoMap::ClassInfo2WrappedNativeProtoMap(int length)
{ {
mTable = new PLDHashTable2(PL_DHashGetStubOps(), sizeof(Entry), length); mTable = new PLDHashTable(PL_DHashGetStubOps(), sizeof(Entry), length);
} }
ClassInfo2WrappedNativeProtoMap::~ClassInfo2WrappedNativeProtoMap() ClassInfo2WrappedNativeProtoMap::~ClassInfo2WrappedNativeProtoMap()
@ -446,7 +446,7 @@ NativeSetMap::newMap(int length)
NativeSetMap::NativeSetMap(int length) NativeSetMap::NativeSetMap(int length)
{ {
mTable = new PLDHashTable2(&Entry::sOps, sizeof(Entry), length); mTable = new PLDHashTable(&Entry::sOps, sizeof(Entry), length);
} }
NativeSetMap::~NativeSetMap() NativeSetMap::~NativeSetMap()
@ -509,7 +509,7 @@ IID2ThisTranslatorMap::newMap(int length)
IID2ThisTranslatorMap::IID2ThisTranslatorMap(int length) IID2ThisTranslatorMap::IID2ThisTranslatorMap(int length)
{ {
mTable = new PLDHashTable2(&Entry::sOps, sizeof(Entry), length); mTable = new PLDHashTable(&Entry::sOps, sizeof(Entry), length);
} }
IID2ThisTranslatorMap::~IID2ThisTranslatorMap() IID2ThisTranslatorMap::~IID2ThisTranslatorMap()
@ -585,7 +585,7 @@ XPCNativeScriptableSharedMap::newMap(int length)
XPCNativeScriptableSharedMap::XPCNativeScriptableSharedMap(int length) XPCNativeScriptableSharedMap::XPCNativeScriptableSharedMap(int length)
{ {
mTable = new PLDHashTable2(&Entry::sOps, sizeof(Entry), length); mTable = new PLDHashTable(&Entry::sOps, sizeof(Entry), length);
} }
XPCNativeScriptableSharedMap::~XPCNativeScriptableSharedMap() XPCNativeScriptableSharedMap::~XPCNativeScriptableSharedMap()
@ -636,8 +636,8 @@ XPCWrappedNativeProtoMap::newMap(int length)
XPCWrappedNativeProtoMap::XPCWrappedNativeProtoMap(int length) XPCWrappedNativeProtoMap::XPCWrappedNativeProtoMap(int length)
{ {
mTable = new PLDHashTable2(PL_DHashGetStubOps(), mTable = new PLDHashTable(PL_DHashGetStubOps(),
sizeof(PLDHashEntryStub), length); sizeof(PLDHashEntryStub), length);
} }
XPCWrappedNativeProtoMap::~XPCWrappedNativeProtoMap() XPCWrappedNativeProtoMap::~XPCWrappedNativeProtoMap()

View File

@ -158,7 +158,7 @@ private:
static size_t SizeOfEntryExcludingThis(PLDHashEntryHdr* hdr, mozilla::MallocSizeOf mallocSizeOf, void*); static size_t SizeOfEntryExcludingThis(PLDHashEntryHdr* hdr, mozilla::MallocSizeOf mallocSizeOf, void*);
private: private:
PLDHashTable2* mTable; PLDHashTable* mTable;
}; };
/*************************/ /*************************/
@ -212,7 +212,7 @@ private:
IID2WrappedJSClassMap(); // no implementation IID2WrappedJSClassMap(); // no implementation
explicit IID2WrappedJSClassMap(int size); explicit IID2WrappedJSClassMap(int size);
private: private:
PLDHashTable2* mTable; PLDHashTable* mTable;
}; };
/*************************/ /*************************/
@ -271,7 +271,7 @@ private:
static size_t SizeOfEntryExcludingThis(PLDHashEntryHdr* hdr, mozilla::MallocSizeOf mallocSizeOf, void*); static size_t SizeOfEntryExcludingThis(PLDHashEntryHdr* hdr, mozilla::MallocSizeOf mallocSizeOf, void*);
private: private:
PLDHashTable2* mTable; PLDHashTable* mTable;
}; };
/*************************/ /*************************/
@ -328,7 +328,7 @@ private:
ClassInfo2NativeSetMap(); // no implementation ClassInfo2NativeSetMap(); // no implementation
explicit ClassInfo2NativeSetMap(int size); explicit ClassInfo2NativeSetMap(int size);
private: private:
PLDHashTable2* mTable; PLDHashTable* mTable;
}; };
/*************************/ /*************************/
@ -384,7 +384,7 @@ private:
static size_t SizeOfEntryExcludingThis(PLDHashEntryHdr* hdr, mozilla::MallocSizeOf mallocSizeOf, void*); static size_t SizeOfEntryExcludingThis(PLDHashEntryHdr* hdr, mozilla::MallocSizeOf mallocSizeOf, void*);
private: private:
PLDHashTable2* mTable; PLDHashTable* mTable;
}; };
/*************************/ /*************************/
@ -454,7 +454,7 @@ private:
static size_t SizeOfEntryExcludingThis(PLDHashEntryHdr* hdr, mozilla::MallocSizeOf mallocSizeOf, void*); static size_t SizeOfEntryExcludingThis(PLDHashEntryHdr* hdr, mozilla::MallocSizeOf mallocSizeOf, void*);
private: private:
PLDHashTable2* mTable; PLDHashTable* mTable;
}; };
/***************************************************************************/ /***************************************************************************/
@ -512,7 +512,7 @@ private:
IID2ThisTranslatorMap(); // no implementation IID2ThisTranslatorMap(); // no implementation
explicit IID2ThisTranslatorMap(int size); explicit IID2ThisTranslatorMap(int size);
private: private:
PLDHashTable2* mTable; PLDHashTable* mTable;
}; };
/***************************************************************************/ /***************************************************************************/
@ -548,7 +548,7 @@ private:
XPCNativeScriptableSharedMap(); // no implementation XPCNativeScriptableSharedMap(); // no implementation
explicit XPCNativeScriptableSharedMap(int size); explicit XPCNativeScriptableSharedMap(int size);
private: private:
PLDHashTable2* mTable; PLDHashTable* mTable;
}; };
/***************************************************************************/ /***************************************************************************/
@ -586,7 +586,7 @@ private:
XPCWrappedNativeProtoMap(); // no implementation XPCWrappedNativeProtoMap(); // no implementation
explicit XPCWrappedNativeProtoMap(int size); explicit XPCWrappedNativeProtoMap(int size);
private: private:
PLDHashTable2* mTable; PLDHashTable* mTable;
}; };
/***************************************************************************/ /***************************************************************************/

View File

@ -166,7 +166,7 @@ nsFrameManager::GetPlaceholderFrameFor(const nsIFrame* aFrame)
if (mPlaceholderMap.IsInitialized()) { if (mPlaceholderMap.IsInitialized()) {
PlaceholderMapEntry *entry = static_cast<PlaceholderMapEntry*> PlaceholderMapEntry *entry = static_cast<PlaceholderMapEntry*>
(PL_DHashTableSearch(const_cast<PLDHashTable2*>(&mPlaceholderMap), (PL_DHashTableSearch(const_cast<PLDHashTable*>(&mPlaceholderMap),
aFrame)); aFrame));
if (entry) { if (entry) {
return entry->placeholderFrame; return entry->placeholderFrame;

View File

@ -56,7 +56,7 @@ protected:
// the pres shell owns the style set // the pres shell owns the style set
nsStyleSet* mStyleSet; nsStyleSet* mStyleSet;
nsIFrame* mRootFrame; nsIFrame* mRootFrame;
PLDHashTable2 mPlaceholderMap; PLDHashTable mPlaceholderMap;
UndisplayedMap* mUndisplayedMap; UndisplayedMap* mUndisplayedMap;
UndisplayedMap* mDisplayContentsMap; UndisplayedMap* mDisplayContentsMap;
bool mIsDestroyingFrames; // The frame manager is destroying some frame(s). bool mIsDestroyingFrames; // The frame manager is destroying some frame(s).

View File

@ -450,10 +450,10 @@ protected:
int32_t mRuleCount; int32_t mRuleCount;
PLDHashTable2 mIdTable; PLDHashTable mIdTable;
PLDHashTable2 mClassTable; PLDHashTable mClassTable;
PLDHashTable2 mTagTable; PLDHashTable mTagTable;
PLDHashTable2 mNameSpaceTable; PLDHashTable mNameSpaceTable;
RuleValueList mUniversalRules; RuleValueList mUniversalRules;
struct EnumData { struct EnumData {
@ -892,14 +892,14 @@ struct RuleCascadeData {
mPseudoElementRuleHashes[nsCSSPseudoElements::ePseudo_PseudoElementCount]; mPseudoElementRuleHashes[nsCSSPseudoElements::ePseudo_PseudoElementCount];
nsTArray<nsCSSRuleProcessor::StateSelector> mStateSelectors; nsTArray<nsCSSRuleProcessor::StateSelector> mStateSelectors;
EventStates mSelectorDocumentStates; EventStates mSelectorDocumentStates;
PLDHashTable2 mClassSelectors; PLDHashTable mClassSelectors;
PLDHashTable2 mIdSelectors; PLDHashTable mIdSelectors;
nsTArray<nsCSSSelector*> mPossiblyNegatedClassSelectors; nsTArray<nsCSSSelector*> mPossiblyNegatedClassSelectors;
nsTArray<nsCSSSelector*> mPossiblyNegatedIDSelectors; nsTArray<nsCSSSelector*> mPossiblyNegatedIDSelectors;
PLDHashTable2 mAttributeSelectors; PLDHashTable mAttributeSelectors;
PLDHashTable2 mAnonBoxRules; PLDHashTable mAnonBoxRules;
#ifdef MOZ_XUL #ifdef MOZ_XUL
PLDHashTable2 mXULTreeRules; PLDHashTable mXULTreeRules;
#endif #endif
nsTArray<nsFontFaceRuleContainer> mFontFaceRules; nsTArray<nsFontFaceRuleContainer> mFontFaceRules;
@ -3321,7 +3321,7 @@ struct CascadeEnumData {
PLArenaPool mArena; PLArenaPool mArena;
// Hooray, a manual PLDHashTable since nsClassHashtable doesn't // Hooray, a manual PLDHashTable since nsClassHashtable doesn't
// provide a getter that gives me a *reference* to the value. // provide a getter that gives me a *reference* to the value.
PLDHashTable2 mRulesByWeight; // of PerWeightDataListItem linked lists PLDHashTable mRulesByWeight; // of PerWeightDataListItem linked lists
uint8_t mSheetType; uint8_t mSheetType;
}; };

View File

@ -159,8 +159,8 @@ private:
nsRefPtr<TableQuirkColorRule> mTableQuirkColorRule; nsRefPtr<TableQuirkColorRule> mTableQuirkColorRule;
nsRefPtr<TableTHRule> mTableTHRule; nsRefPtr<TableTHRule> mTableTHRule;
PLDHashTable2 mMappedAttrTable; PLDHashTable mMappedAttrTable;
PLDHashTable2 mLangRuleTable; PLDHashTable mLangRuleTable;
}; };
#endif /* !defined(nsHTMLStyleSheet_h_) */ #endif /* !defined(nsHTMLStyleSheet_h_) */

View File

@ -1427,7 +1427,7 @@ nsRuleNode::DestroyInternal(nsRuleNode ***aDestroyQueueTail)
} }
if (ChildrenAreHashed()) { if (ChildrenAreHashed()) {
PLDHashTable2 *children = ChildrenHash(); PLDHashTable *children = ChildrenHash();
PL_DHashTableEnumerate(children, EnqueueRuleNodeChildren, PL_DHashTableEnumerate(children, EnqueueRuleNodeChildren,
&destroyQueueTail); &destroyQueueTail);
*destroyQueueTail = nullptr; // ensure null-termination *destroyQueueTail = nullptr; // ensure null-termination
@ -1614,9 +1614,9 @@ nsRuleNode::ConvertChildrenToHash(int32_t aNumKids)
{ {
NS_ASSERTION(!ChildrenAreHashed() && HaveChildren(), NS_ASSERTION(!ChildrenAreHashed() && HaveChildren(),
"must have a non-empty list of children"); "must have a non-empty list of children");
PLDHashTable2 *hash = new PLDHashTable2(&ChildrenHashOps, PLDHashTable *hash = new PLDHashTable(&ChildrenHashOps,
sizeof(ChildrenHashEntry), sizeof(ChildrenHashEntry),
aNumKids); aNumKids);
for (nsRuleNode* curr = ChildrenList(); curr; curr = curr->mNextSibling) { for (nsRuleNode* curr = ChildrenList(); curr; curr = curr->mNextSibling) {
// This will never fail because of the initial size we gave the table. // This will never fail because of the initial size we gave the table.
ChildrenHashEntry *entry = static_cast<ChildrenHashEntry*>( ChildrenHashEntry *entry = static_cast<ChildrenHashEntry*>(
@ -9374,7 +9374,7 @@ nsRuleNode::SweepChildren(nsTArray<nsRuleNode*>& aSweepQueue)
uint32_t childrenDestroyed = 0; uint32_t childrenDestroyed = 0;
nsRuleNode* survivorsWithChildren = nullptr; nsRuleNode* survivorsWithChildren = nullptr;
if (ChildrenAreHashed()) { if (ChildrenAreHashed()) {
PLDHashTable2* children = ChildrenHash(); PLDHashTable* children = ChildrenHash();
uint32_t oldChildCount = children->EntryCount(); uint32_t oldChildCount = children->EntryCount();
PL_DHashTableEnumerate(children, SweepHashEntry, &survivorsWithChildren); PL_DHashTableEnumerate(children, SweepHashEntry, &survivorsWithChildren);
childrenDestroyed = oldChildCount - children->EntryCount(); childrenDestroyed = oldChildCount - children->EntryCount();

View File

@ -317,7 +317,7 @@ private:
union { union {
void* asVoid; void* asVoid;
nsRuleNode* asList; nsRuleNode* asList;
PLDHashTable2* asHash; PLDHashTable* asHash;
} mChildren; // Accessed only through the methods below. } mChildren; // Accessed only through the methods below.
enum { enum {
@ -343,18 +343,18 @@ private:
nsRuleNode** ChildrenListPtr() { nsRuleNode** ChildrenListPtr() {
return &mChildren.asList; return &mChildren.asList;
} }
PLDHashTable2* ChildrenHash() { PLDHashTable* ChildrenHash() {
return (PLDHashTable2*) (intptr_t(mChildren.asHash) & ~intptr_t(kTypeMask)); return (PLDHashTable*) (intptr_t(mChildren.asHash) & ~intptr_t(kTypeMask));
} }
void SetChildrenList(nsRuleNode *aList) { void SetChildrenList(nsRuleNode *aList) {
NS_ASSERTION(!(intptr_t(aList) & kTypeMask), NS_ASSERTION(!(intptr_t(aList) & kTypeMask),
"pointer not 2-byte aligned"); "pointer not 2-byte aligned");
mChildren.asList = aList; mChildren.asList = aList;
} }
void SetChildrenHash(PLDHashTable2 *aHashtable) { void SetChildrenHash(PLDHashTable *aHashtable) {
NS_ASSERTION(!(intptr_t(aHashtable) & kTypeMask), NS_ASSERTION(!(intptr_t(aHashtable) & kTypeMask),
"pointer not 2-byte aligned"); "pointer not 2-byte aligned");
mChildren.asHash = (PLDHashTable2*)(intptr_t(aHashtable) | kHashType); mChildren.asHash = (PLDHashTable*)(intptr_t(aHashtable) | kHashType);
} }
void ConvertChildrenToHash(int32_t aNumKids); void ConvertChildrenToHash(int32_t aNumKids);

View File

@ -62,7 +62,7 @@ private:
return SpanToIndex(aSpan) < ARRAY_SIZE; return SpanToIndex(aSpan) < ARRAY_SIZE;
} }
PLDHashTable2 mHashTable; PLDHashTable mHashTable;
struct HashTableEntry : public PLDHashEntryHdr { struct HashTableEntry : public PLDHashEntryHdr {
int32_t mColSpan; int32_t mColSpan;
Item *mItems; Item *mItems;

View File

@ -68,7 +68,7 @@ matchPrefEntry(PLDHashTable*, const PLDHashEntryHdr* entry,
return (strcmp(prefEntry->key, otherKey) == 0); return (strcmp(prefEntry->key, otherKey) == 0);
} }
PLDHashTable2* gHashTable; PLDHashTable* gHashTable;
static PLArenaPool gPrefNameArena; static PLArenaPool gPrefNameArena;
bool gDirty = false; bool gDirty = false;
@ -150,9 +150,9 @@ static nsresult pref_HashPref(const char *key, PrefValue value, PrefType type, u
nsresult PREF_Init() nsresult PREF_Init()
{ {
if (!gHashTable) { if (!gHashTable) {
gHashTable = new PLDHashTable2(&pref_HashTableOps, gHashTable = new PLDHashTable(&pref_HashTableOps,
sizeof(PrefHashEntry), sizeof(PrefHashEntry),
PREF_HASHTABLE_INITIAL_LENGTH); PREF_HASHTABLE_INITIAL_LENGTH);
PL_INIT_ARENA_POOL(&gPrefNameArena, "PrefNameArena", PL_INIT_ARENA_POOL(&gPrefNameArena, "PrefNameArena",
PREFNAME_ARENA_SIZE); PREFNAME_ARENA_SIZE);

View File

@ -10,7 +10,7 @@
#include "mozilla/MemoryReporting.h" #include "mozilla/MemoryReporting.h"
extern PLDHashTable2* gHashTable; extern PLDHashTable* gHashTable;
extern bool gDirty; extern bool gDirty;
namespace mozilla { namespace mozilla {

View File

@ -70,7 +70,7 @@ protected:
nsCOMPtr<nsILoadGroupConnectionInfo> mConnectionInfo; nsCOMPtr<nsILoadGroupConnectionInfo> mConnectionInfo;
nsCOMPtr<nsIRequest> mDefaultLoadRequest; nsCOMPtr<nsIRequest> mDefaultLoadRequest;
PLDHashTable2 mRequests; PLDHashTable mRequests;
nsWeakPtr mObserver; nsWeakPtr mObserver;
nsWeakPtr mParentLoadGroup; nsWeakPtr mParentLoadGroup;

View File

@ -305,7 +305,7 @@ private:
// member variables // member variables
static const PLDHashTableOps ops; static const PLDHashTableOps ops;
PLDHashTable2 table; PLDHashTable table;
bool initialized; bool initialized;
static const uint32_t kInitialTableLength = 256; static const uint32_t kInitialTableLength = 256;

View File

@ -114,7 +114,7 @@ private:
// member variables // member variables
static const PLDHashTableOps ops; static const PLDHashTableOps ops;
PLDHashTable2 table; PLDHashTable table;
bool initialized; bool initialized;
static const uint32_t kInitialTableLength = 0; static const uint32_t kInitialTableLength = 0;

View File

@ -345,7 +345,7 @@ private:
uint32_t mNumIdleThreads; uint32_t mNumIdleThreads;
uint32_t mThreadCount; uint32_t mThreadCount;
uint32_t mActiveAnyThreadCount; uint32_t mActiveAnyThreadCount;
PLDHashTable2 mDB; PLDHashTable mDB;
PRCList mHighQ; PRCList mHighQ;
PRCList mMediumQ; PRCList mMediumQ;
PRCList mLowQ; PRCList mLowQ;

View File

@ -40,7 +40,7 @@ struct HttpHeapAtom {
char value[1]; char value[1];
}; };
static PLDHashTable2 *sAtomTable; static PLDHashTable *sAtomTable;
static struct HttpHeapAtom *sHeapAtoms = nullptr; static struct HttpHeapAtom *sHeapAtoms = nullptr;
static Mutex *sLock = nullptr; static Mutex *sLock = nullptr;
@ -103,8 +103,8 @@ nsHttp::CreateAtomTable()
// The initial length for this table is a value greater than the number of // The initial length for this table is a value greater than the number of
// known atoms (NUM_HTTP_ATOMS) because we expect to encounter a few random // known atoms (NUM_HTTP_ATOMS) because we expect to encounter a few random
// headers right off the bat. // headers right off the bat.
sAtomTable = new PLDHashTable2(&ops, sizeof(PLDHashEntryStub), sAtomTable = new PLDHashTable(&ops, sizeof(PLDHashEntryStub),
NUM_HTTP_ATOMS + 10); NUM_HTTP_ATOMS + 10);
// fill the table with our known atoms // fill the table with our known atoms
const char *const atoms[] = { const char *const atoms[] = {

View File

@ -65,8 +65,8 @@ static const PLDHashTableOps UnicodeToEntityOps = {
nullptr, nullptr,
}; };
static PLDHashTable2* gEntityToUnicode; static PLDHashTable* gEntityToUnicode;
static PLDHashTable2* gUnicodeToEntity; static PLDHashTable* gUnicodeToEntity;
static nsrefcnt gTableRefCnt = 0; static nsrefcnt gTableRefCnt = 0;
#define HTML_ENTITY(_name, _value) { #_name, _value }, #define HTML_ENTITY(_name, _value) { #_name, _value },
@ -81,12 +81,12 @@ nsresult
nsHTMLEntities::AddRefTable(void) nsHTMLEntities::AddRefTable(void)
{ {
if (!gTableRefCnt) { if (!gTableRefCnt) {
gEntityToUnicode = new PLDHashTable2(&EntityToUnicodeOps, gEntityToUnicode = new PLDHashTable(&EntityToUnicodeOps,
sizeof(EntityNodeEntry), sizeof(EntityNodeEntry),
NS_HTML_ENTITY_COUNT); NS_HTML_ENTITY_COUNT);
gUnicodeToEntity = new PLDHashTable2(&UnicodeToEntityOps, gUnicodeToEntity = new PLDHashTable(&UnicodeToEntityOps,
sizeof(EntityNodeEntry), sizeof(EntityNodeEntry),
NS_HTML_ENTITY_COUNT); NS_HTML_ENTITY_COUNT);
for (const EntityNode *node = gEntityArray, for (const EntityNode *node = gEntityArray,
*node_end = ArrayEnd(gEntityArray); *node_end = ArrayEnd(gEntityArray);
node < node_end; ++node) { node < node_end; ++node) {

View File

@ -125,7 +125,7 @@ public:
{ {
struct hash struct hash
{ {
PLDHashTable2* mPropertyHash; PLDHashTable* mPropertyHash;
} hash; } hash;
struct as struct as
{ {
@ -163,7 +163,7 @@ Assertion::Assertion(nsIRDFResource* aSource)
NS_ADDREF(mSource); NS_ADDREF(mSource);
u.hash.mPropertyHash = u.hash.mPropertyHash =
new PLDHashTable2(PL_DHashGetStubOps(), sizeof(Entry)); new PLDHashTable(PL_DHashGetStubOps(), sizeof(Entry));
} }
Assertion::Assertion(nsIRDFResource* aSource, Assertion::Assertion(nsIRDFResource* aSource,
@ -250,8 +250,8 @@ protected:
// nsIRDFResource object per unique URI). The value of an entry is // nsIRDFResource object per unique URI). The value of an entry is
// an Assertion struct, which is a linked list of (subject // an Assertion struct, which is a linked list of (subject
// predicate object) triples. // predicate object) triples.
PLDHashTable2 mForwardArcs; PLDHashTable mForwardArcs;
PLDHashTable2 mReverseArcs; PLDHashTable mReverseArcs;
nsCOMArray<nsIRDFObserver> mObservers; nsCOMArray<nsIRDFObserver> mObservers;
uint32_t mNumObservers; uint32_t mNumObservers;

View File

@ -38,11 +38,11 @@ class RDFServiceImpl final : public nsIRDFService,
{ {
protected: protected:
PLHashTable* mNamedDataSources; PLHashTable* mNamedDataSources;
PLDHashTable2 mResources; PLDHashTable mResources;
PLDHashTable2 mLiterals; PLDHashTable mLiterals;
PLDHashTable2 mInts; PLDHashTable mInts;
PLDHashTable2 mDates; PLDHashTable mDates;
PLDHashTable2 mBlobs; PLDHashTable mBlobs;
nsAutoCString mLastURIPrefix; nsAutoCString mLastURIPrefix;
nsCOMPtr<nsIFactory> mLastFactory; nsCOMPtr<nsIFactory> mLastFactory;

View File

@ -124,7 +124,7 @@ private:
treeArrayEl *mTreeArray; treeArrayEl *mTreeArray;
int32_t mNumOrgs; int32_t mNumOrgs;
int32_t mNumRows; int32_t mNumRows;
PLDHashTable2 mCompareCache; PLDHashTable mCompareCache;
nsCOMPtr<nsINSSComponent> mNSSComponent; nsCOMPtr<nsINSSComponent> mNSSComponent;
nsCOMPtr<nsICertOverrideService> mOverrideService; nsCOMPtr<nsICertOverrideService> mOverrideService;
mozilla::RefPtr<nsCertOverrideService> mOriginalOverrideService; mozilla::RefPtr<nsCertOverrideService> mOriginalOverrideService;

View File

@ -158,8 +158,8 @@ protected:
mozilla::Mutex mListLock; mozilla::Mutex mListLock;
static nsNSSShutDownList *singleton; static nsNSSShutDownList *singleton;
uint32_t mActiveSSLSockets; uint32_t mActiveSSLSockets;
PLDHashTable2 mObjects; PLDHashTable mObjects;
PLDHashTable2 mPK11LogoutCancelObjects; PLDHashTable mPK11LogoutCancelObjects;
nsNSSActivityState mActivityState; nsNSSActivityState mActivityState;
}; };

View File

@ -100,7 +100,7 @@ protected:
nsCOMPtr<nsISSLStatus> mSSLStatus; nsCOMPtr<nsISSLStatus> mSSLStatus;
nsCOMPtr<nsISupports> mCurrentToplevelSecurityInfo; nsCOMPtr<nsISupports> mCurrentToplevelSecurityInfo;
PLDHashTable2 mTransferringRequests; PLDHashTable mTransferringRequests;
}; };

View File

@ -276,7 +276,7 @@ protected:
int64_t mCurrentTotalProgress; int64_t mCurrentTotalProgress;
int64_t mMaxTotalProgress; int64_t mMaxTotalProgress;
PLDHashTable2 mRequestInfoHash; PLDHashTable mRequestInfoHash;
int64_t mCompletedTotalProgress; int64_t mCompletedTotalProgress;
mozilla::LinkedList<nsStatusInfo> mStatusInfoList; mozilla::LinkedList<nsStatusInfo> mStatusInfoList;

View File

@ -829,7 +829,7 @@ struct CCGraph
uint32_t mRootCount; uint32_t mRootCount;
private: private:
PLDHashTable2 mPtrToNodeMap; PLDHashTable mPtrToNodeMap;
bool mOutOfMemory; bool mOutOfMemory;
static const uint32_t kInitialMapLength = 16384; static const uint32_t kInitialMapLength = 16384;

View File

@ -41,7 +41,7 @@ using namespace mozilla;
* sure it's only manipulated from the main thread. Probably the latter * sure it's only manipulated from the main thread. Probably the latter
* is better, since the former would hurt performance. * is better, since the former would hurt performance.
*/ */
static PLDHashTable2* gAtomTable; static PLDHashTable* gAtomTable;
class StaticAtomEntry : public PLDHashEntryHdr class StaticAtomEntry : public PLDHashEntryHdr
{ {
@ -543,8 +543,8 @@ static inline void
EnsureTableExists() EnsureTableExists()
{ {
if (!gAtomTable) { if (!gAtomTable) {
gAtomTable = new PLDHashTable2(&AtomTableOps, sizeof(AtomTableEntry), gAtomTable = new PLDHashTable(&AtomTableOps, sizeof(AtomTableEntry),
ATOM_HASHTABLE_INITIAL_LENGTH); ATOM_HASHTABLE_INITIAL_LENGTH);
} }
} }

View File

@ -33,7 +33,7 @@ private:
protected: protected:
nsCOMPtr<nsIUnicharInputStream> mIn; nsCOMPtr<nsIUnicharInputStream> mIn;
PLDHashTable2 mTable; PLDHashTable mTable;
PLArenaPool mArena; PLArenaPool mArena;
}; };

View File

@ -42,7 +42,7 @@ public:
private: private:
nsDependentCString* mNameArray; nsDependentCString* mNameArray;
PLDHashTable2 mNameTable; PLDHashTable mNameTable;
nsDependentCString mNullStr; nsDependentCString mNullStr;
}; };

View File

@ -328,7 +328,7 @@ public:
#endif #endif
protected: protected:
PLDHashTable2 mTable; PLDHashTable mTable;
static const void* s_GetKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry); static const void* s_GetKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);

View File

@ -341,9 +341,6 @@ private:
PLDHashTable& operator=(const PLDHashTable& aOther) = delete; PLDHashTable& operator=(const PLDHashTable& aOther) = delete;
}; };
// XXX: this is a temporary typedef that will be removed shortly.
typedef PLDHashTable PLDHashTable2;
/* /*
* Compute the hash code for a given key to be looked up, added, or removed * Compute the hash code for a given key to be looked up, added, or removed
* from aTable. A hash code may have any PLDHashNumber value. * from aTable. A hash code may have any PLDHashNumber value.

View File

@ -27,8 +27,8 @@ static bool test_pldhash_Init_capacity_ok()
// of entry storage. That's very likely to fail on 32-bit platforms, so such // of entry storage. That's very likely to fail on 32-bit platforms, so such
// a test wouldn't be reliable. // a test wouldn't be reliable.
// //
PLDHashTable2 t(PL_DHashGetStubOps(), sizeof(PLDHashEntryStub), PLDHashTable t(PL_DHashGetStubOps(), sizeof(PLDHashEntryStub),
PL_DHASH_MAX_INITIAL_LENGTH); PL_DHASH_MAX_INITIAL_LENGTH);
// Check that the constructor sets |ops|. // Check that the constructor sets |ops|.
if (!t.IsInitialized()) { if (!t.IsInitialized()) {
@ -40,7 +40,7 @@ static bool test_pldhash_Init_capacity_ok()
static bool test_pldhash_lazy_storage() static bool test_pldhash_lazy_storage()
{ {
PLDHashTable2 t(PL_DHashGetStubOps(), sizeof(PLDHashEntryStub)); PLDHashTable t(PL_DHashGetStubOps(), sizeof(PLDHashEntryStub));
// PLDHashTable allocates entry storage lazily. Check that all the non-add // PLDHashTable allocates entry storage lazily. Check that all the non-add
// operations work appropriately when the table is empty and the storage // operations work appropriately when the table is empty and the storage
@ -115,40 +115,40 @@ static const PLDHashTableOps trivialOps = {
static bool test_pldhash_move_semantics() static bool test_pldhash_move_semantics()
{ {
PLDHashTable2 t1(&trivialOps, sizeof(PLDHashEntryStub)); PLDHashTable t1(&trivialOps, sizeof(PLDHashEntryStub));
PL_DHashTableAdd(&t1, (const void*)88); PL_DHashTableAdd(&t1, (const void*)88);
PLDHashTable2 t2(&trivialOps, sizeof(PLDHashEntryStub)); PLDHashTable t2(&trivialOps, sizeof(PLDHashEntryStub));
PL_DHashTableAdd(&t2, (const void*)99); PL_DHashTableAdd(&t2, (const void*)99);
t1 = mozilla::Move(t1); // self-move t1 = mozilla::Move(t1); // self-move
t1 = mozilla::Move(t2); // empty overwritten with empty t1 = mozilla::Move(t2); // empty overwritten with empty
PLDHashTable2 t3(&trivialOps, sizeof(PLDHashEntryStub)); PLDHashTable t3(&trivialOps, sizeof(PLDHashEntryStub));
PLDHashTable2 t4(&trivialOps, sizeof(PLDHashEntryStub)); PLDHashTable t4(&trivialOps, sizeof(PLDHashEntryStub));
PL_DHashTableAdd(&t3, (const void*)88); PL_DHashTableAdd(&t3, (const void*)88);
t3 = mozilla::Move(t4); // non-empty overwritten with empty t3 = mozilla::Move(t4); // non-empty overwritten with empty
PLDHashTable2 t5(&trivialOps, sizeof(PLDHashEntryStub)); PLDHashTable t5(&trivialOps, sizeof(PLDHashEntryStub));
PLDHashTable2 t6(&trivialOps, sizeof(PLDHashEntryStub)); PLDHashTable t6(&trivialOps, sizeof(PLDHashEntryStub));
PL_DHashTableAdd(&t6, (const void*)88); PL_DHashTableAdd(&t6, (const void*)88);
t5 = mozilla::Move(t6); // empty overwritten with non-empty t5 = mozilla::Move(t6); // empty overwritten with non-empty
PLDHashTable2 t7(&trivialOps, sizeof(PLDHashEntryStub)); PLDHashTable t7(&trivialOps, sizeof(PLDHashEntryStub));
PLDHashTable2 t8(mozilla::Move(t7)); // new table constructed with uninited PLDHashTable t8(mozilla::Move(t7)); // new table constructed with uninited
PLDHashTable2 t9(&trivialOps, sizeof(PLDHashEntryStub)); PLDHashTable t9(&trivialOps, sizeof(PLDHashEntryStub));
PL_DHashTableAdd(&t9, (const void*)88); PL_DHashTableAdd(&t9, (const void*)88);
PLDHashTable2 t10(mozilla::Move(t9)); // new table constructed with inited PLDHashTable t10(mozilla::Move(t9)); // new table constructed with inited
return true; return true;
} }
static bool test_pldhash_Clear() static bool test_pldhash_Clear()
{ {
PLDHashTable2 t1(&trivialOps, sizeof(PLDHashEntryStub)); PLDHashTable t1(&trivialOps, sizeof(PLDHashEntryStub));
t1.Clear(); t1.Clear();
if (t1.EntryCount() != 0) { if (t1.EntryCount() != 0) {
@ -194,8 +194,8 @@ static bool test_pldhash_Clear()
static bool test_pldhash_grow_to_max_capacity() static bool test_pldhash_grow_to_max_capacity()
{ {
// This is infallible. // This is infallible.
PLDHashTable2* t = PLDHashTable* t =
new PLDHashTable2(&trivialOps, sizeof(PLDHashEntryStub), 128); new PLDHashTable(&trivialOps, sizeof(PLDHashEntryStub), 128);
// Check that New() sets |t->ops|. // Check that New() sets |t->ops|.
if (!t->IsInitialized()) { if (!t->IsInitialized()) {