Diff
Modified: trunk/Source/WTF/ChangeLog (160491 => 160492)
--- trunk/Source/WTF/ChangeLog 2013-12-12 18:21:30 UTC (rev 160491)
+++ trunk/Source/WTF/ChangeLog 2013-12-12 18:31:47 UTC (rev 160492)
@@ -1,3 +1,17 @@
+2013-12-12 Sam Weinig <[email protected]>
+
+ Replace uses of WTF::BitArray with std::bitset
+ https://bugs.webkit.org/show_bug.cgi?id=125642
+
+ Reviewed by Anders Carlsson.
+
+ * GNUmakefile.list.am:
+ * WTF.vcxproj/WTF.vcxproj:
+ * WTF.vcxproj/WTF.vcxproj.filters:
+ * WTF.xcodeproj/project.pbxproj:
+ * wtf/BitArray.h: Removed.
+ * wtf/CMakeLists.txt:
+
2013-12-11 David Kilzer <[email protected]>
Define m_hasBadParent in InlineBox if defined(ADDRESS_SANITIZER)
Modified: trunk/Source/WTF/GNUmakefile.list.am (160491 => 160492)
--- trunk/Source/WTF/GNUmakefile.list.am 2013-12-12 18:21:30 UTC (rev 160491)
+++ trunk/Source/WTF/GNUmakefile.list.am 2013-12-12 18:31:47 UTC (rev 160492)
@@ -10,7 +10,6 @@
Source/WTF/wtf/AutodrainedPool.h \
Source/WTF/wtf/Bag.h \
Source/WTF/wtf/BagToHashMap.h \
- Source/WTF/wtf/BitArray.h \
Source/WTF/wtf/BitVector.cpp \
Source/WTF/wtf/BitVector.h \
Source/WTF/wtf/Bitmap.h \
Modified: trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj (160491 => 160492)
--- trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj 2013-12-12 18:21:30 UTC (rev 160491)
+++ trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj 2013-12-12 18:31:47 UTC (rev 160492)
@@ -160,7 +160,6 @@
<ClInclude Include="..\wtf\AVLTree.h" />
<ClInclude Include="..\wtf\Bag.h" />
<ClInclude Include="..\wtf\BagToHashMap.h" />
- <ClInclude Include="..\wtf\BitArray.h" />
<ClInclude Include="..\wtf\Bitmap.h" />
<ClInclude Include="..\wtf\BitVector.h" />
<ClInclude Include="..\wtf\BlockStack.h" />
Modified: trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters (160491 => 160492)
--- trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters 2013-12-12 18:21:30 UTC (rev 160491)
+++ trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters 2013-12-12 18:31:47 UTC (rev 160492)
@@ -362,9 +362,6 @@
<ClInclude Include="..\wtf\AVLTree.h">
<Filter>wtf</Filter>
</ClInclude>
- <ClInclude Include="..\wtf\BitArray.h">
- <Filter>wtf</Filter>
- </ClInclude>
<ClInclude Include="..\wtf\Bitmap.h">
<Filter>wtf</Filter>
</ClInclude>
Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (160491 => 160492)
--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2013-12-12 18:21:30 UTC (rev 160491)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj 2013-12-12 18:31:47 UTC (rev 160492)
@@ -65,7 +65,6 @@
2CDED0F318115C85004DBA70 /* RunLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2CDED0F118115C85004DBA70 /* RunLoop.cpp */; };
2CDED0F418115C85004DBA70 /* RunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CDED0F218115C85004DBA70 /* RunLoop.h */; };
44F66008171AFAE600E4AD19 /* EnumClass.h in Headers */ = {isa = PBXBuildFile; fileRef = 44F66007171AFAA900E4AD19 /* EnumClass.h */; };
- 4F0321BC156AA8D1006EBAF6 /* BitArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F0321BB156AA8D1006EBAF6 /* BitArray.h */; };
7E29C33E15FFD79B00516D61 /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */; };
8134013815B092FD001FF0B8 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; };
8134013915B092FD001FF0B8 /* Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8134013715B092FD001FF0B8 /* Base64.h */; };
@@ -333,7 +332,6 @@
2CDED0F218115C85004DBA70 /* RunLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoop.h; sourceTree = "<group>"; };
44DEE74A152274BB00C6EC37 /* iOS.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = iOS.xcconfig; sourceTree = "<group>"; };
44F66007171AFAA900E4AD19 /* EnumClass.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EnumClass.h; sourceTree = "<group>"; };
- 4F0321BB156AA8D1006EBAF6 /* BitArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitArray.h; sourceTree = "<group>"; };
5D247B6214689B8600E78B76 /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; };
5D247B6E14689C4700E78B76 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
5D247B7014689C4700E78B76 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
@@ -655,7 +653,6 @@
A8A4725E151A825A004123FF /* AVLTree.h */,
0FB14E18180FA218009B6B4D /* Bag.h */,
0FB14E1A1810E1DA009B6B4D /* BagToHashMap.h */,
- 4F0321BB156AA8D1006EBAF6 /* BitArray.h */,
A8A4725F151A825A004123FF /* Bitmap.h */,
A8A47260151A825A004123FF /* BitVector.cpp */,
A8A47261151A825A004123FF /* BitVector.h */,
@@ -964,7 +961,6 @@
A8A473A9151A825B004123FF /* bignum-dtoa.h in Headers */,
A8A473AB151A825B004123FF /* bignum.h in Headers */,
A8A47452151A825B004123FF /* BinarySemaphore.h in Headers */,
- 4F0321BC156AA8D1006EBAF6 /* BitArray.h in Headers */,
A8A4738A151A825B004123FF /* Bitmap.h in Headers */,
A8A4738C151A825B004123FF /* BitVector.h in Headers */,
A8A4738E151A825B004123FF /* BlockStack.h in Headers */,
Deleted: trunk/Source/WTF/wtf/BitArray.h (160491 => 160492)
--- trunk/Source/WTF/wtf/BitArray.h 2013-12-12 18:21:30 UTC (rev 160491)
+++ trunk/Source/WTF/wtf/BitArray.h 2013-12-12 18:31:47 UTC (rev 160492)
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef BitArray_h
-#define BitArray_h
-
-#include <string.h>
-#include <wtf/Assertions.h>
-
-namespace WTF {
-
-template<unsigned arraySize>
-class BitArray {
-public:
- BitArray()
- {
- memset(m_data, 0, sizeof(m_data));
- }
-
- void set(unsigned index)
- {
- ASSERT_WITH_SECURITY_IMPLICATION(index < arraySize);
- m_data[index / 8] |= 1 << (index & 7);
- }
-
- bool get(unsigned index) const
- {
- ASSERT_WITH_SECURITY_IMPLICATION(index < arraySize);
- return !!(m_data[index / 8] & (1 << (index & 7)));
- }
-
-private:
- unsigned char m_data[arraySize / 8 + 1];
-};
-
-} // namespace WTF
-
-using WTF::BitArray;
-
-#endif // BitArray_h
Modified: trunk/Source/WTF/wtf/CMakeLists.txt (160491 => 160492)
--- trunk/Source/WTF/wtf/CMakeLists.txt 2013-12-12 18:21:30 UTC (rev 160491)
+++ trunk/Source/WTF/wtf/CMakeLists.txt 2013-12-12 18:31:47 UTC (rev 160492)
@@ -5,7 +5,6 @@
Atomics.h
Bag.h
BagToHashMap.h
- BitArray.h
BitVector.h
Bitmap.h
BoundsCheckedPointer.h
Modified: trunk/Source/WebCore/ChangeLog (160491 => 160492)
--- trunk/Source/WebCore/ChangeLog 2013-12-12 18:21:30 UTC (rev 160491)
+++ trunk/Source/WebCore/ChangeLog 2013-12-12 18:31:47 UTC (rev 160492)
@@ -1,3 +1,16 @@
+2013-12-12 Sam Weinig <[email protected]>
+
+ Replace uses of WTF::BitArray with std::bitset
+ https://bugs.webkit.org/show_bug.cgi?id=125642
+
+ Reviewed by Anders Carlsson.
+
+ * css/CSSParser.cpp:
+ (WebCore::filterProperties):
+ (WebCore::CSSParser::createStyleProperties):
+ * css/StyleProperties.cpp:
+ (WebCore::StyleProperties::asText):
+
2013-12-12 Alexey Proskuryakov <[email protected]>
Make algorithm.name return registered name, not normalized one
Modified: trunk/Source/WebCore/css/CSSParser.cpp (160491 => 160492)
--- trunk/Source/WebCore/css/CSSParser.cpp 2013-12-12 18:21:30 UTC (rev 160491)
+++ trunk/Source/WebCore/css/CSSParser.cpp 2013-12-12 18:31:47 UTC (rev 160492)
@@ -84,8 +84,8 @@
#include "WebKitCSSKeyframesRule.h"
#include "WebKitCSSRegionRule.h"
#include "WebKitCSSTransformValue.h"
+#include <bitset>
#include <limits.h>
-#include <wtf/BitArray.h>
#include <wtf/HexNumber.h>
#include <wtf/StdLibExtras.h>
#include <wtf/dtoa.h>
@@ -1479,7 +1479,7 @@
return m_mediaQuery.release();
}
-static inline void filterProperties(bool important, const CSSParser::ParsedPropertyVector& input, Vector<CSSProperty, 256>& output, size_t& unusedEntries, BitArray<numCSSProperties>& seenProperties)
+static inline void filterProperties(bool important, const CSSParser::ParsedPropertyVector& input, Vector<CSSProperty, 256>& output, size_t& unusedEntries, std::bitset<numCSSProperties>& seenProperties)
{
// Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found.
for (int i = input.size() - 1; i >= 0; --i) {
@@ -1487,7 +1487,7 @@
if (property.isImportant() != important)
continue;
const unsigned propertyIDIndex = property.id() - firstCSSProperty;
- if (seenProperties.get(propertyIDIndex))
+ if (seenProperties.test(propertyIDIndex))
continue;
seenProperties.set(propertyIDIndex);
output[--unusedEntries] = property;
@@ -1496,7 +1496,7 @@
PassRef<ImmutableStyleProperties> CSSParser::createStyleProperties()
{
- BitArray<numCSSProperties> seenProperties;
+ std::bitset<numCSSProperties> seenProperties;
size_t unusedEntries = m_parsedProperties.size();
Vector<CSSProperty, 256> results(unusedEntries);
Modified: trunk/Source/WebCore/css/StyleProperties.cpp (160491 => 160492)
--- trunk/Source/WebCore/css/StyleProperties.cpp 2013-12-12 18:21:30 UTC (rev 160491)
+++ trunk/Source/WebCore/css/StyleProperties.cpp 2013-12-12 18:31:47 UTC (rev 160492)
@@ -32,7 +32,7 @@
#include "PropertySetCSSStyleDeclaration.h"
#include "StylePropertyShorthand.h"
#include "StyleSheetContents.h"
-#include <wtf/BitArray.h>
+#include <bitset>
#include <wtf/text/StringBuilder.h>
#ifndef NDEBUG
@@ -779,8 +779,8 @@
int repeatXPropertyIndex = -1;
int repeatYPropertyIndex = -1;
- BitArray<numCSSProperties> shorthandPropertyUsed;
- BitArray<numCSSProperties> shorthandPropertyAppeared;
+ std::bitset<numCSSProperties> shorthandPropertyUsed;
+ std::bitset<numCSSProperties> shorthandPropertyAppeared;
unsigned size = propertyCount();
unsigned numDecls = 0;
@@ -824,13 +824,13 @@
borderFallbackShorthandProperty = CSSPropertyBorderColor;
// FIXME: Deal with cases where only some of border-(top|right|bottom|left) are specified.
- if (!shorthandPropertyAppeared.get(CSSPropertyBorder - firstCSSProperty)) {
+ if (!shorthandPropertyAppeared.test(CSSPropertyBorder - firstCSSProperty)) {
value = borderPropertyValue(ReturnNullOnUncommonValues);
if (value.isNull())
shorthandPropertyAppeared.set(CSSPropertyBorder - firstCSSProperty);
else
shorthandPropertyID = CSSPropertyBorder;
- } else if (shorthandPropertyUsed.get(CSSPropertyBorder - firstCSSProperty))
+ } else if (shorthandPropertyUsed.test(CSSPropertyBorder - firstCSSProperty))
shorthandPropertyID = CSSPropertyBorder;
if (!shorthandPropertyID)
shorthandPropertyID = borderFallbackShorthandProperty;
@@ -925,9 +925,9 @@
unsigned shortPropertyIndex = shorthandPropertyID - firstCSSProperty;
if (shorthandPropertyID) {
- if (shorthandPropertyUsed.get(shortPropertyIndex))
+ if (shorthandPropertyUsed.test(shortPropertyIndex))
continue;
- if (!shorthandPropertyAppeared.get(shortPropertyIndex) && value.isNull())
+ if (!shorthandPropertyAppeared.test(shortPropertyIndex) && value.isNull())
value = getPropertyValue(shorthandPropertyID);
shorthandPropertyAppeared.set(shortPropertyIndex);
}