Changeset 155357 in webkit
- Timestamp:
- Sep 9, 2013, 10:10:19 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 18 edited
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/heap/PassWeak.h (modified) (1 diff)
-
JavaScriptCore/runtime/JSCell.h (modified) (5 diffs)
-
JavaScriptCore/runtime/WriteBarrier.h (modified) (2 diffs)
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/CheckedArithmetic.h (modified) (2 diffs)
-
WTF/wtf/HashTraits.h (modified) (2 diffs)
-
WTF/wtf/NeverDestroyed.h (modified) (2 diffs)
-
WTF/wtf/OwnPtr.h (modified) (2 diffs)
-
WTF/wtf/PassOwnPtr.h (modified) (3 diffs)
-
WTF/wtf/RetainPtr.h (modified) (2 diffs)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/Platform/CoreIPC/ArgumentCoder.h (modified) (1 diff)
-
WebKit2/Platform/CoreIPC/ArgumentCoders.h (modified) (1 diff)
-
WebKit2/Platform/CoreIPC/ArgumentDecoder.h (modified) (1 diff)
-
WebKit2/Platform/CoreIPC/ArgumentEncoder.h (modified) (1 diff)
-
WebKit2/Platform/CoreIPC/Arguments.h (modified) (10 diffs)
-
WebKit2/Shared/API/c/WKSharedAPICast.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r155317 r155357 1 2013-09-08 Anders Carlsson <andersca@apple.com> 2 3 Begin moving off of TypeTraits.h 4 https://bugs.webkit.org/show_bug.cgi?id=121006 5 6 Reviewed by Darin Adler. 7 8 Convert uses of WTF type traits to STL type traits. 9 10 * heap/PassWeak.h: 11 * runtime/JSCell.h: 12 (JSC::jsCast): 13 (JSC::jsDynamicCast): 14 * runtime/WriteBarrier.h: 15 (JSC::validateCell): 16 1 17 2013-09-08 Mark Hahnenberg <mhahnenberg@apple.com> 2 18 -
trunk/Source/JavaScriptCore/heap/PassWeak.h
r147962 r155357 31 31 #include <wtf/Assertions.h> 32 32 #include <wtf/NullPtr.h> 33 #include <wtf/TypeTraits.h>34 33 35 34 namespace JSC { -
trunk/Source/JavaScriptCore/runtime/JSCell.h
r154459 r155357 32 32 #include "WriteBarrier.h" 33 33 #include <wtf/Noncopyable.h> 34 #include <wtf/TypeTraits.h>35 34 36 35 namespace JSC { … … 179 178 inline To jsCast(From* from) 180 179 { 181 ASSERT(!from || from->JSCell::inherits( WTF::RemovePointer<To>::Type::info()));180 ASSERT(!from || from->JSCell::inherits(std::remove_pointer<To>::type::info())); 182 181 return static_cast<To>(from); 183 182 } … … 186 185 inline To jsCast(JSValue from) 187 186 { 188 ASSERT(from.isCell() && from.asCell()->JSCell::inherits( WTF::RemovePointer<To>::Type::info()));187 ASSERT(from.isCell() && from.asCell()->JSCell::inherits(std::remove_pointer<To>::type::info())); 189 188 return static_cast<To>(from.asCell()); 190 189 } … … 193 192 inline To jsDynamicCast(From* from) 194 193 { 195 return from->inherits( WTF::RemovePointer<To>::Type::info()) ? static_cast<To>(from) : 0;194 return from->inherits(std::remove_pointer<To>::type::info()) ? static_cast<To>(from) : 0; 196 195 } 197 196 … … 199 198 inline To jsDynamicCast(JSValue from) 200 199 { 201 return from.isCell() && from.asCell()->inherits( WTF::RemovePointer<To>::Type::info()) ? static_cast<To>(from.asCell()) : 0;200 return from.isCell() && from.asCell()->inherits(std::remove_pointer<To>::type::info()) ? static_cast<To>(from.asCell()) : 0; 202 201 } 203 202 -
trunk/Source/JavaScriptCore/runtime/WriteBarrier.h
r154162 r155357 31 31 #include "Heap.h" 32 32 #include "SamplingCounter.h" 33 #include <wtf/TypeTraits.h>34 33 35 34 namespace JSC { … … 52 51 template<class T> inline void validateCell(T cell) 53 52 { 54 ASSERT_GC_OBJECT_INHERITS(cell, WTF::RemovePointer<T>::Type::info());53 ASSERT_GC_OBJECT_INHERITS(cell, std::remove_pointer<T>::type::info()); 55 54 } 56 55 -
trunk/Source/WTF/ChangeLog
r155338 r155357 1 2013-09-08 Anders Carlsson <andersca@apple.com> 2 3 Begin moving off of TypeTraits.h 4 https://bugs.webkit.org/show_bug.cgi?id=121006 5 6 Reviewed by Darin Adler. 7 8 The C++11 has its own type traits implementation that is more complete and handles corner cases better 9 since it ties into the compiler. Begin switching uses of WTF type traits to STL type traits. 10 11 * wtf/CheckedArithmetic.h: 12 * wtf/HashTraits.h: 13 * wtf/NeverDestroyed.h: 14 * wtf/OwnPtr.h: 15 * wtf/PassOwnPtr.h: 16 (WTF::adoptPtr): 17 * wtf/RetainPtr.h: 18 1 19 2013-09-09 Julien Brianceau <jbriance@cisco.com> 2 20 -
trunk/Source/WTF/wtf/CheckedArithmetic.h
r154498 r155357 29 29 #include <wtf/Assertions.h> 30 30 #include <wtf/EnumClass.h> 31 #include <wtf/TypeTraits.h>32 31 33 32 #include <limits> 34 33 #include <stdint.h> 34 #include <type_traits> 35 35 36 36 /* Checked<T> … … 162 162 }; 163 163 164 template <typename Target, typename Source, bool CanElide = IsSameType<Target, Source>::value || (sizeof(Target) > sizeof(Source)) > struct BoundsCheckElider;164 template <typename Target, typename Source, bool CanElide = std::is_same<Target, Source>::value || (sizeof(Target) > sizeof(Source)) > struct BoundsCheckElider; 165 165 template <typename Target, typename Source> struct BoundsCheckElider<Target, Source, true> { 166 166 static bool inBounds(Source) { return true; } -
trunk/Source/WTF/wtf/HashTraits.h
r149739 r155357 24 24 #include <wtf/HashFunctions.h> 25 25 #include <wtf/StdLibExtras.h> 26 #include <wtf/TypeTraits.h>27 26 #include <utility> 28 27 #include <limits> … … 64 63 }; 65 64 66 template<typename T> struct GenericHashTraits : GenericHashTraitsBase< IsInteger<T>::value, T> {65 template<typename T> struct GenericHashTraits : GenericHashTraitsBase<std::is_integral<T>::value, T> { 67 66 typedef T TraitType; 68 67 typedef T EmptyValueType; -
trunk/Source/WTF/wtf/NeverDestroyed.h
r150451 r155357 30 30 #include <wtf/Noncopyable.h> 31 31 #include <wtf/StdLibExtras.h> 32 #include <wtf/TypeTraits.h>33 32 34 33 // NeverDestroyed is a smart pointer like class who ensures that the destructor … … 76 75 #endif 77 76 78 typedef typename WTF::RemoveConst<T>::Type *PointerType;77 typedef typename std::remove_const<T>::type *PointerType; 79 78 80 79 PointerType asPtr() { return reinterpret_cast<PointerType>(&m_storage); } -
trunk/Source/WTF/wtf/OwnPtr.h
r128203 r155357 26 26 #include <wtf/NullPtr.h> 27 27 #include <wtf/OwnPtrCommon.h> 28 #include <wtf/TypeTraits.h>29 28 #include <algorithm> 30 29 #include <memory> … … 44 43 #endif 45 44 public: 46 typedef typename RemovePointer<T>::Type ValueType;45 typedef typename std::remove_pointer<T>::type ValueType; 47 46 typedef ValueType* PtrType; 48 47 -
trunk/Source/WTF/wtf/PassOwnPtr.h
r149341 r155357 30 30 #include <wtf/NullPtr.h> 31 31 #include <wtf/OwnPtrCommon.h> 32 #include < wtf/TypeTraits.h>32 #include <type_traits> 33 33 34 34 namespace WTF { … … 45 45 template<typename T> class PassOwnPtr { 46 46 public: 47 typedef typename RemovePointer<T>::Type ValueType;47 typedef typename std::remove_pointer<T>::type ValueType; 48 48 typedef ValueType* PtrType; 49 49 … … 148 148 template<typename T> inline PassOwnPtr<T> adoptPtr(T* ptr) 149 149 { 150 COMPILE_ASSERT(!(IsSubclass<T, RefCountedBase>::value), DoNotUseAdoptPtrWithRefCounted);151 COMPILE_ASSERT(!(IsSubclass<T, ThreadSafeRefCountedBase>::value), DoNotUseAdoptPtrWithThreadSafeRefCounted);150 static_assert(!std::is_convertible<T*, RefCountedBase*>::value, "Do not use adoptPtr with RefCounted, use adoptPtr!"); 151 static_assert(!std::is_convertible<T*, ThreadSafeRefCountedBase*>::value, "Do not use adoptPtr with ThreadSafeRefCounted, use adoptPtr!"); 152 152 153 153 return PassOwnPtr<T>(ptr); -
trunk/Source/WTF/wtf/RetainPtr.h
r155319 r155357 26 26 #include <wtf/HashTraits.h> 27 27 #include <wtf/NullPtr.h> 28 #include <wtf/TypeTraits.h>29 28 #include <algorithm> 30 29 … … 76 75 template<typename T> class RetainPtr { 77 76 public: 78 typedef typename RemovePointer<T>::Type ValueType;77 typedef typename std::remove_pointer<T>::type ValueType; 79 78 typedef ValueType* PtrType; 80 79 typedef CFTypeRef StorageType; -
trunk/Source/WebKit2/ChangeLog
r155353 r155357 1 2013-09-08 Anders Carlsson <andersca@apple.com> 2 3 Begin moving off of TypeTraits.h 4 https://bugs.webkit.org/show_bug.cgi?id=121006 5 6 Reviewed by Darin Adler. 7 8 Convert uses of WTF type traits to STL type traits. 9 10 * Platform/CoreIPC/ArgumentCoder.h: 11 * Platform/CoreIPC/ArgumentCoders.h: 12 * Platform/CoreIPC/ArgumentDecoder.h: 13 * Platform/CoreIPC/ArgumentEncoder.h: 14 * Platform/CoreIPC/Arguments.h: 15 * Shared/API/c/WKSharedAPICast.h: 16 (WebKit::toImpl): 17 1 18 2013-09-09 Gustavo Noronha Silva <gns@gnome.org> 2 19 -
trunk/Source/WebKit2/Platform/CoreIPC/ArgumentCoder.h
r141619 r155357 27 27 #define ArgumentCoder_h 28 28 29 #include <wtf/TypeTraits.h>30 31 29 namespace CoreIPC { 32 30 -
trunk/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h
r149848 r155357 32 32 #include <wtf/Forward.h> 33 33 #include <wtf/HashMap.h> 34 #include <wtf/TypeTraits.h>35 34 #include <wtf/Vector.h> 36 35 -
trunk/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.h
r148043 r155357 30 30 #include "Attachment.h" 31 31 #include <wtf/PassOwnPtr.h> 32 #include <wtf/TypeTraits.h>33 32 #include <wtf/Vector.h> 34 33 -
trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.h
r149944 r155357 30 30 #include "Attachment.h" 31 31 #include <wtf/PassOwnPtr.h> 32 #include <wtf/TypeTraits.h>33 32 #include <wtf/Vector.h> 34 33 -
trunk/Source/WebKit2/Platform/CoreIPC/Arguments.h
r143052 r155357 29 29 #include "ArgumentDecoder.h" 30 30 #include "ArgumentEncoder.h" 31 #include <wtf/TypeTraits.h>32 31 33 32 namespace CoreIPC { … … 47 46 48 47 template<typename T1> struct Arguments1 { 49 typedef Arguments1<typename WTF::RemoveConst<typename WTF::RemoveReference<T1>::Type>::Type> ValueType;48 typedef Arguments1<typename std::remove_const<typename std::remove_reference<T1>::type>::type> ValueType; 50 49 51 50 Arguments1() … … 72 71 73 72 template<typename T1, typename T2> struct Arguments2 : Arguments1<T1> { 74 typedef Arguments2<typename WTF::RemoveConst<typename WTF::RemoveReference<T1>::Type>::Type,75 typename WTF::RemoveConst<typename WTF::RemoveReference<T2>::Type>::Type> ValueType;73 typedef Arguments2<typename std::remove_const<typename std::remove_reference<T1>::type>::type, 74 typename std::remove_const<typename std::remove_reference<T2>::type>::type> ValueType; 76 75 77 76 Arguments2() … … 103 102 104 103 template<typename T1, typename T2, typename T3> struct Arguments3 : Arguments2<T1, T2> { 105 typedef Arguments3<typename WTF::RemoveConst<typename WTF::RemoveReference<T1>::Type>::Type,106 typename WTF::RemoveConst<typename WTF::RemoveReference<T2>::Type>::Type,107 typename WTF::RemoveConst<typename WTF::RemoveReference<T3>::Type>::Type> ValueType;104 typedef Arguments3<typename std::remove_const<typename std::remove_reference<T1>::type>::type, 105 typename std::remove_const<typename std::remove_reference<T2>::type>::type, 106 typename std::remove_const<typename std::remove_reference<T3>::type>::type> ValueType; 108 107 109 108 Arguments3() … … 135 134 136 135 template<typename T1, typename T2, typename T3, typename T4> struct Arguments4 : Arguments3<T1, T2, T3> { 137 typedef Arguments4<typename WTF::RemoveConst<typename WTF::RemoveReference<T1>::Type>::Type,138 typename WTF::RemoveConst<typename WTF::RemoveReference<T2>::Type>::Type,139 typename WTF::RemoveConst<typename WTF::RemoveReference<T3>::Type>::Type,140 typename WTF::RemoveConst<typename WTF::RemoveReference<T4>::Type>::Type> ValueType;136 typedef Arguments4<typename std::remove_const<typename std::remove_reference<T1>::type>::type, 137 typename std::remove_const<typename std::remove_reference<T2>::type>::type, 138 typename std::remove_const<typename std::remove_reference<T3>::type>::type, 139 typename std::remove_const<typename std::remove_reference<T4>::type>::type> ValueType; 141 140 142 141 Arguments4() … … 168 167 169 168 template<typename T1, typename T2, typename T3, typename T4, typename T5> struct Arguments5 : Arguments4<T1, T2, T3, T4> { 170 typedef Arguments5<typename WTF::RemoveConst<typename WTF::RemoveReference<T1>::Type>::Type,171 typename WTF::RemoveConst<typename WTF::RemoveReference<T2>::Type>::Type,172 typename WTF::RemoveConst<typename WTF::RemoveReference<T3>::Type>::Type,173 typename WTF::RemoveConst<typename WTF::RemoveReference<T4>::Type>::Type,174 typename WTF::RemoveConst<typename WTF::RemoveReference<T5>::Type>::Type> ValueType;169 typedef Arguments5<typename std::remove_const<typename std::remove_reference<T1>::type>::type, 170 typename std::remove_const<typename std::remove_reference<T2>::type>::type, 171 typename std::remove_const<typename std::remove_reference<T3>::type>::type, 172 typename std::remove_const<typename std::remove_reference<T4>::type>::type, 173 typename std::remove_const<typename std::remove_reference<T5>::type>::type> ValueType; 175 174 176 175 Arguments5() … … 202 201 203 202 template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> struct Arguments6 : Arguments5<T1, T2, T3, T4, T5> { 204 typedef Arguments6<typename WTF::RemoveConst<typename WTF::RemoveReference<T1>::Type>::Type,205 typename WTF::RemoveConst<typename WTF::RemoveReference<T2>::Type>::Type,206 typename WTF::RemoveConst<typename WTF::RemoveReference<T3>::Type>::Type,207 typename WTF::RemoveConst<typename WTF::RemoveReference<T4>::Type>::Type,208 typename WTF::RemoveConst<typename WTF::RemoveReference<T5>::Type>::Type,209 typename WTF::RemoveConst<typename WTF::RemoveReference<T6>::Type>::Type> ValueType;203 typedef Arguments6<typename std::remove_const<typename std::remove_reference<T1>::type>::type, 204 typename std::remove_const<typename std::remove_reference<T2>::type>::type, 205 typename std::remove_const<typename std::remove_reference<T3>::type>::type, 206 typename std::remove_const<typename std::remove_reference<T4>::type>::type, 207 typename std::remove_const<typename std::remove_reference<T5>::type>::type, 208 typename std::remove_const<typename std::remove_reference<T6>::type>::type> ValueType; 210 209 211 210 Arguments6() … … 237 236 238 237 template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> struct Arguments7 : Arguments6<T1, T2, T3, T4, T5, T6> { 239 typedef Arguments7<typename WTF::RemoveConst<typename WTF::RemoveReference<T1>::Type>::Type,240 typename WTF::RemoveConst<typename WTF::RemoveReference<T2>::Type>::Type,241 typename WTF::RemoveConst<typename WTF::RemoveReference<T3>::Type>::Type,242 typename WTF::RemoveConst<typename WTF::RemoveReference<T4>::Type>::Type,243 typename WTF::RemoveConst<typename WTF::RemoveReference<T5>::Type>::Type,244 typename WTF::RemoveConst<typename WTF::RemoveReference<T6>::Type>::Type,245 typename WTF::RemoveConst<typename WTF::RemoveReference<T7>::Type>::Type> ValueType;238 typedef Arguments7<typename std::remove_const<typename std::remove_reference<T1>::type>::type, 239 typename std::remove_const<typename std::remove_reference<T2>::type>::type, 240 typename std::remove_const<typename std::remove_reference<T3>::type>::type, 241 typename std::remove_const<typename std::remove_reference<T4>::type>::type, 242 typename std::remove_const<typename std::remove_reference<T5>::type>::type, 243 typename std::remove_const<typename std::remove_reference<T6>::type>::type, 244 typename std::remove_const<typename std::remove_reference<T7>::type>::type> ValueType; 246 245 247 246 Arguments7() … … 273 272 274 273 template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> struct Arguments8 : Arguments7<T1, T2, T3, T4, T5, T6, T7> { 275 typedef Arguments8<typename WTF::RemoveConst<typename WTF::RemoveReference<T1>::Type>::Type,276 typename WTF::RemoveConst<typename WTF::RemoveReference<T2>::Type>::Type,277 typename WTF::RemoveConst<typename WTF::RemoveReference<T3>::Type>::Type,278 typename WTF::RemoveConst<typename WTF::RemoveReference<T4>::Type>::Type,279 typename WTF::RemoveConst<typename WTF::RemoveReference<T5>::Type>::Type,280 typename WTF::RemoveConst<typename WTF::RemoveReference<T6>::Type>::Type,281 typename WTF::RemoveConst<typename WTF::RemoveReference<T7>::Type>::Type,282 typename WTF::RemoveConst<typename WTF::RemoveReference<T8>::Type>::Type> ValueType;274 typedef Arguments8<typename std::remove_const<typename std::remove_reference<T1>::type>::type, 275 typename std::remove_const<typename std::remove_reference<T2>::type>::type, 276 typename std::remove_const<typename std::remove_reference<T3>::type>::type, 277 typename std::remove_const<typename std::remove_reference<T4>::type>::type, 278 typename std::remove_const<typename std::remove_reference<T5>::type>::type, 279 typename std::remove_const<typename std::remove_reference<T6>::type>::type, 280 typename std::remove_const<typename std::remove_reference<T7>::type>::type, 281 typename std::remove_const<typename std::remove_reference<T8>::type>::type> ValueType; 283 282 284 283 Arguments8() { } … … 308 307 309 308 template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> struct Arguments10 : Arguments8<T1, T2, T3, T4, T5, T6, T7, T8> { 310 typedef Arguments10<typename WTF::RemoveConst<typename WTF::RemoveReference<T1>::Type>::Type,311 typename WTF::RemoveConst<typename WTF::RemoveReference<T2>::Type>::Type,312 typename WTF::RemoveConst<typename WTF::RemoveReference<T3>::Type>::Type,313 typename WTF::RemoveConst<typename WTF::RemoveReference<T4>::Type>::Type,314 typename WTF::RemoveConst<typename WTF::RemoveReference<T5>::Type>::Type,315 typename WTF::RemoveConst<typename WTF::RemoveReference<T6>::Type>::Type,316 typename WTF::RemoveConst<typename WTF::RemoveReference<T7>::Type>::Type,317 typename WTF::RemoveConst<typename WTF::RemoveReference<T8>::Type>::Type,318 typename WTF::RemoveConst<typename WTF::RemoveReference<T9>::Type>::Type,319 typename WTF::RemoveConst<typename WTF::RemoveReference<T10>::Type>::Type> ValueType;309 typedef Arguments10<typename std::remove_const<typename std::remove_reference<T1>::type>::type, 310 typename std::remove_const<typename std::remove_reference<T2>::type>::type, 311 typename std::remove_const<typename std::remove_reference<T3>::type>::type, 312 typename std::remove_const<typename std::remove_reference<T4>::type>::type, 313 typename std::remove_const<typename std::remove_reference<T5>::type>::type, 314 typename std::remove_const<typename std::remove_reference<T6>::type>::type, 315 typename std::remove_const<typename std::remove_reference<T7>::type>::type, 316 typename std::remove_const<typename std::remove_reference<T8>::type>::type, 317 typename std::remove_const<typename std::remove_reference<T9>::type>::type, 318 typename std::remove_const<typename std::remove_reference<T10>::type>::type> ValueType; 320 319 321 320 Arguments10() { } -
trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h
r151656 r155357 56 56 #include <WebCore/UserContentTypes.h> 57 57 #include <WebCore/UserScriptTypes.h> 58 #include <wtf/TypeTraits.h>59 58 60 59 namespace WebKit { … … 143 142 // const struct OpaqueWKArray* -> const struct OpaqueWKArray -> struct OpaqueWKArray -> struct OpaqueWKArray* -> ImmutableArray* 144 143 145 typedef typename WTF::RemovePointer<T>::Type PotentiallyConstValueType;146 typedef typename WTF::RemoveConst<PotentiallyConstValueType>::Type NonConstValueType;144 typedef typename std::remove_pointer<T>::type PotentiallyConstValueType; 145 typedef typename std::remove_const<PotentiallyConstValueType>::type NonConstValueType; 147 146 148 147 return reinterpret_cast<typename APITypeInfo<T>::ImplType>(const_cast<NonConstValueType*>(t));
Note:
See TracChangeset
for help on using the changeset viewer.