Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: third_party/WebKit/Source/wtf/HashTable.h

Issue 2725953003: Fix WTF::HashTable performance regression on Windows. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 David Levin <levin@chromium.org> 4 * Copyright (C) 2008 David Levin <levin@chromium.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 bool accessForbidden() const { return m_accessForbidden; } 793 bool accessForbidden() const { return m_accessForbidden; }
794 int64_t modifications() const { return m_modifications; } 794 int64_t modifications() const { return m_modifications; }
795 void registerModification() { m_modifications++; } 795 void registerModification() { m_modifications++; }
796 // HashTable and collections that build on it do not support modifications 796 // HashTable and collections that build on it do not support modifications
797 // while there is an iterator in use. The exception is ListHashSet, which 797 // while there is an iterator in use. The exception is ListHashSet, which
798 // has its own iterators that tolerate modification of the underlying set. 798 // has its own iterators that tolerate modification of the underlying set.
799 void checkModifications(int64_t mods) const { 799 void checkModifications(int64_t mods) const {
800 DCHECK_EQ(mods, m_modifications); 800 DCHECK_EQ(mods, m_modifications);
801 } 801 }
802 #else 802 #else
803 void enterAccessForbiddenScope() {} 803 ALWAYS_INLINE void enterAccessForbiddenScope() {}
804 void leaveAccessForbiddenScope() {} 804 ALWAYS_INLINE void leaveAccessForbiddenScope() {}
805 bool accessForbidden() const { return false; } 805 ALWAYS_INLINE bool accessForbidden() const { return false; }
806 int64_t modifications() const { return 0; } 806 ALWAYS_INLINE int64_t modifications() const { return 0; }
807 void registerModification() {} 807 ALWAYS_INLINE void registerModification() {}
808 void checkModifications(int64_t mods) const {} 808 ALWAYS_INLINE void checkModifications(int64_t mods) const {}
809 #endif 809 #endif
810 810
811 private: 811 private:
812 static ValueType* allocateTable(unsigned size); 812 static ValueType* allocateTable(unsigned size);
813 static void deleteAllBucketsAndDeallocate(ValueType* table, unsigned size); 813 static void deleteAllBucketsAndDeallocate(ValueType* table, unsigned size);
814 814
815 typedef std::pair<ValueType*, bool> LookupType; 815 typedef std::pair<ValueType*, bool> LookupType;
816 typedef std::pair<LookupType, unsigned> FullLookupType; 816 typedef std::pair<LookupType, unsigned> FullLookupType;
817 817
818 LookupType lookupForWriting(const Key& key) { 818 LookupType lookupForWriting(const Key& key) {
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
2271 CollectionIterator end(toBeRemoved.end()); 2271 CollectionIterator end(toBeRemoved.end());
2272 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it) 2272 for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it)
2273 collection.erase(*it); 2273 collection.erase(*it);
2274 } 2274 }
2275 2275
2276 } // namespace WTF 2276 } // namespace WTF
2277 2277
2278 #include "wtf/HashIterators.h" 2278 #include "wtf/HashIterators.h"
2279 2279
2280 #endif // WTF_HashTable_h 2280 #endif // WTF_HashTable_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698