Remove wtf/Alignment.h
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Sep 2013 23:37:21 +0000 (23:37 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Sep 2013 23:37:21 +0000 (23:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=121077

Reviewed by Andreas Kling.

Source/WebCore:

* platform/PODArena.h:
(WebCore::PODArena::minAlignment):
* platform/graphics/cpu/arm/filters/FELightingNEON.h:
(WebCore::FELighting::platformApplyNeon):

Source/WTF:

* GNUmakefile.list.am:
* WTF.pro:
* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/Alignment.h: Removed.
* wtf/CMakeLists.txt:
* wtf/text/ASCIIFastPath.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155491 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WTF/ChangeLog
Source/WTF/GNUmakefile.list.am
Source/WTF/WTF.pro
Source/WTF/WTF.vcxproj/WTF.vcxproj
Source/WTF/WTF.vcxproj/WTF.vcxproj.filters
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/Alignment.h [deleted file]
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/text/ASCIIFastPath.h
Source/WebCore/ChangeLog
Source/WebCore/platform/PODArena.h
Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp
Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h

index 8e25218..5535a63 100644 (file)
@@ -1,5 +1,21 @@
 2013-09-10  Anders Carlsson  <andersca@apple.com>
 
+        Remove wtf/Alignment.h
+        https://bugs.webkit.org/show_bug.cgi?id=121077
+
+        Reviewed by Andreas Kling.
+
+        * GNUmakefile.list.am:
+        * WTF.pro:
+        * WTF.vcxproj/WTF.vcxproj:
+        * WTF.vcxproj/WTF.vcxproj.filters:
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/Alignment.h: Removed.
+        * wtf/CMakeLists.txt:
+        * wtf/text/ASCIIFastPath.h:
+
+2013-09-10  Anders Carlsson  <andersca@apple.com>
+
         More WTF/Alignment.h removal
         https://bugs.webkit.org/show_bug.cgi?id=121125
 
index abf670c..65c21f3 100644 (file)
@@ -3,7 +3,6 @@ wtf_sources += \
     Source/WTF/wtf/Platform.h \
     Source/WTF/wtf/ASCIICType.h \
     Source/WTF/wtf/AVLTree.h \
-    Source/WTF/wtf/Alignment.h \
     Source/WTF/wtf/Assertions.cpp \
     Source/WTF/wtf/Assertions.h \
     Source/WTF/wtf/Atomics.cpp \
index 6353bc0..58f9181 100644 (file)
@@ -20,7 +20,6 @@ wince* {
 }
 
 HEADERS += \
-    Alignment.h \
     ASCIICType.h \
     Assertions.h \
     Atomics.h \
index 313ada8..89a95b1 100644 (file)
   <ItemGroup>\r
     <ClInclude Include="..\wtf\CompilationThread.h" />\r
     <ClInclude Include="..\WTF\config.h" />\r
-    <ClInclude Include="..\wtf\Alignment.h" />\r
     <ClInclude Include="..\wtf\ASCIICType.h" />\r
     <ClInclude Include="..\wtf\Assertions.h" />\r
     <ClInclude Include="..\wtf\Atomics.h" />\r
index 43cc389..19e1037 100644 (file)
     <ClInclude Include="..\wtf\unicode\UTF8.h">\r
       <Filter>wtf\unicode</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\wtf\Alignment.h">\r
-      <Filter>wtf</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="..\wtf\WTFThreadData.h">\r
       <Filter>wtf</Filter>\r
     </ClInclude>\r
index 13df054..dacf7fd 100644 (file)
@@ -74,7 +74,6 @@
                A7E643C617C5423B003BB16B /* Compression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E643C417C5423B003BB16B /* Compression.cpp */; };
                A7E643C717C5423B003BB16B /* Compression.h in Headers */ = {isa = PBXBuildFile; fileRef = A7E643C517C5423B003BB16B /* Compression.h */; };
                A876DBD8151816E500DADB95 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = A876DBD7151816E500DADB95 /* Platform.h */; };
-               A8A4737F151A825B004123FF /* Alignment.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A47254151A825A004123FF /* Alignment.h */; };
                A8A47385151A825B004123FF /* ASCIICType.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725A151A825A004123FF /* ASCIICType.h */; };
                A8A47386151A825B004123FF /* Assertions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A4725B151A825A004123FF /* Assertions.cpp */; };
                A8A47387151A825B004123FF /* Assertions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4725C151A825A004123FF /* Assertions.h */; };
                A7E643C417C5423B003BB16B /* Compression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Compression.cpp; sourceTree = "<group>"; };
                A7E643C517C5423B003BB16B /* Compression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compression.h; sourceTree = "<group>"; };
                A876DBD7151816E500DADB95 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Platform.h; sourceTree = "<group>"; };
-               A8A47254151A825A004123FF /* Alignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Alignment.h; sourceTree = "<group>"; };
                A8A4725A151A825A004123FF /* ASCIICType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCIICType.h; sourceTree = "<group>"; };
                A8A4725B151A825A004123FF /* Assertions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Assertions.cpp; sourceTree = "<group>"; };
                A8A4725C151A825A004123FF /* Assertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Assertions.h; sourceTree = "<group>"; };
                                A8A4731B151A825B004123FF /* text */,
                                A8A47339151A825B004123FF /* threads */,
                                A8A47348151A825B004123FF /* unicode */,
-                               A8A47254151A825A004123FF /* Alignment.h */,
                                A8A4725A151A825A004123FF /* ASCIICType.h */,
                                A8A4725B151A825A004123FF /* Assertions.cpp */,
                                A8A4725C151A825A004123FF /* Assertions.h */,
                        isa = PBXHeadersBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
-                               A8A4737F151A825B004123FF /* Alignment.h in Headers */,
                                A8A47385151A825B004123FF /* ASCIICType.h in Headers */,
                                A8A47434151A825B004123FF /* ASCIIFastPath.h in Headers */,
                                A8A47387151A825B004123FF /* Assertions.h in Headers */,
diff --git a/Source/WTF/wtf/Alignment.h b/Source/WTF/wtf/Alignment.h
deleted file mode 100644 (file)
index ab38d95..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *  Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this library; see the file COPYING.LIB.  If not, write to
- *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef WTF_Alignment_h
-#define WTF_Alignment_h
-
-#include <wtf/Platform.h>
-#include <algorithm>
-#include <stdint.h>
-
-
-namespace WTF {
-
-#if COMPILER(GCC) || COMPILER(MINGW) || COMPILER(RVCT) || COMPILER(GCCE) || (COMPILER(SUNCC) && __SUNPRO_CC > 0x590)
-    #define WTF_ALIGN_OF(type) __alignof__(type)
-    #define WTF_ALIGNED(variable_type, variable, n) variable_type variable __attribute__((__aligned__(n)))
-#elif COMPILER(MSVC)
-    #define WTF_ALIGN_OF(type) __alignof(type)
-    #define WTF_ALIGNED(variable_type, variable, n) __declspec(align(n)) variable_type variable
-#else
-    #error WTF_ALIGN macros need alignment control.
-#endif
-
-#if COMPILER(GCC) && !COMPILER(INTEL)
-    typedef char __attribute__((__may_alias__)) AlignedBufferChar; 
-#else
-    typedef char AlignedBufferChar; 
-#endif
-
-    template<size_t size, size_t alignment> struct AlignedBuffer;
-    template<size_t size> struct AlignedBuffer<size, 1> { AlignedBufferChar buffer[size]; };
-    template<size_t size> struct AlignedBuffer<size, 2> { WTF_ALIGNED(AlignedBufferChar, buffer[size], 2);  };
-    template<size_t size> struct AlignedBuffer<size, 4> { WTF_ALIGNED(AlignedBufferChar, buffer[size], 4);  };
-    template<size_t size> struct AlignedBuffer<size, 8> { WTF_ALIGNED(AlignedBufferChar, buffer[size], 8);  };
-    template<size_t size> struct AlignedBuffer<size, 16> { WTF_ALIGNED(AlignedBufferChar, buffer[size], 16); };
-    template<size_t size> struct AlignedBuffer<size, 32> { WTF_ALIGNED(AlignedBufferChar, buffer[size], 32); };
-    template<size_t size> struct AlignedBuffer<size, 64> { WTF_ALIGNED(AlignedBufferChar, buffer[size], 64); };
-
-    template <size_t size, size_t alignment>
-    void swap(AlignedBuffer<size, alignment>& a, AlignedBuffer<size, alignment>& b)
-    {
-        for (size_t i = 0; i < size; ++i)
-            std::swap(a.buffer[i], b.buffer[i]);
-    }
-
-}
-
-#endif // WTF_Alignment_h
index 2f89b98..1afc620 100644 (file)
@@ -1,7 +1,6 @@
 set(WTF_HEADERS
     ASCIICType.h
     AVLTree.h
-    Alignment.h
     Assertions.h
     Atomics.h
     BitArray.h
index 6f664f4..40f6076 100644 (file)
@@ -26,7 +26,6 @@
 #include <emmintrin.h>
 #endif
 #include <stdint.h>
-#include <wtf/Alignment.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/unicode/Unicode.h>
 
index 6070cf5..bb9c3da 100644 (file)
@@ -1,3 +1,15 @@
+2013-09-10  Anders Carlsson  <andersca@apple.com>
+
+        Remove wtf/Alignment.h
+        https://bugs.webkit.org/show_bug.cgi?id=121077
+
+        Reviewed by Andreas Kling.
+
+        * platform/PODArena.h:
+        (WebCore::PODArena::minAlignment):
+        * platform/graphics/cpu/arm/filters/FELightingNEON.h:
+        (WebCore::FELighting::platformApplyNeon):
+
 2013-09-10  Zoltan Horvath  <zoltan@webkit.org>
 
         [Qt] Add FloatingObjects.h to Target.pri
index bcea173..5d29673 100644 (file)
@@ -27,7 +27,6 @@
 #define PODArena_h
 
 #include <stdint.h>
-#include <wtf/Alignment.h>
 #include <wtf/Assertions.h>
 #include <wtf/FastMalloc.h>
 #include <wtf/Noncopyable.h>
@@ -52,7 +51,7 @@ protected:
     // current platform.
     template <class T> static size_t minAlignment()
     {
-        return WTF_ALIGN_OF(T);
+        return std::alignment_of<T>::value;
     }
 
     // Rounds up the given allocation size to the specified alignment.
index 76fefbd..e5a0b60 100644 (file)
@@ -29,8 +29,6 @@
 
 #if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC)
 
-#include <wtf/Alignment.h>
-
 namespace WebCore {
 
 // These constants are copied to the following SIMD registers:
index 863aab5..3eb299a 100644 (file)
@@ -30,7 +30,6 @@
 #if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC)
 
 #include "FELighting.h"
-#include <wtf/Alignment.h>
 #include <wtf/ParallelJobs.h>
 
 namespace WebCore {
@@ -94,7 +93,12 @@ void neonDrawLighting(FELightingPaintingDataForNeon*);
 
 inline void FELighting::platformApplyNeon(LightingData& data, LightSource::PaintingData& paintingData)
 {
-    WTF_ALIGNED(FELightingFloatArgumentsForNeon, floatArguments, 16);
+    union {
+        FELightingFloatArgumentsForNeon floatArguments;
+        std::aligned_storage<sizeof(FELightingFloatArgumentsForNeon), 16>::type forAlignment;
+    } alignedArguments;
+
+    auto& floatArguments = alignedArguments.floatArguments;
 
     FELightingPaintingDataForNeon neonData = {
         data.pixels->data(),