Changeset 155258 in webkit
- Timestamp:
- Sep 7, 2013 12:45:41 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r155251 r155258 1 2013-09-07 Anders Carlsson <andersca@apple.com> 2 3 VectorMover should use std::move 4 https://bugs.webkit.org/show_bug.cgi?id=120959 5 6 Reviewed by Geoffrey Garen. 7 8 Work around a bug in GCC by changing the type of the callType bitfield 9 in CallLinkInfo to be unsigned instead of CallType. 10 11 * bytecode/CallLinkInfo.h: 12 1 13 2013-09-07 Anders Carlsson <andersca@apple.com> 2 14 -
trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.h
r148696 r155258 83 83 bool isDFG : 1; 84 84 bool hasSeenClosure : 1; 85 CallType callType : 5;85 unsigned callType : 5; // CallType 86 86 unsigned calleeGPR : 8; 87 87 CodeOrigin codeOrigin; -
trunk/Source/WTF/ChangeLog
r155251 r155258 1 2013-09-07 Anders Carlsson <andersca@apple.com> 2 3 VectorMover should use std::move 4 https://bugs.webkit.org/show_bug.cgi?id=120959 5 6 Reviewed by Geoffrey Garen. 7 8 This lets the compiler use move constructors when moving data, which can be a performance improvement. 9 If the vector element type isn't movable it will be copied instead. 10 11 * wtf/Vector.h: 12 (WTF::VectorTypeOperations::move): 13 (WTF::VectorTypeOperations::moveOverlapping): 14 1 15 2013-09-07 Anders Carlsson <andersca@apple.com> 2 16 -
trunk/Source/WTF/wtf/Vector.h
r155251 r155258 91 91 struct VectorMover<false, T> 92 92 { 93 static void move( const T* src, constT* srcEnd, T* dst)93 static void move(T* src, T* srcEnd, T* dst) 94 94 { 95 95 while (src != srcEnd) { 96 new (NotNull, dst) T(*src); 97 #if COMPILER(SUNCC) && __SUNPRO_CC <= 0x590 98 const_cast<T*>(src)->~T(); // Work around obscure SunCC 12 compiler bug. 99 #else 96 new (NotNull, dst) T(std::move(*src)); 100 97 src->~T(); 101 #endif102 98 ++dst; 103 99 ++src; 104 100 } 105 101 } 106 static void moveOverlapping( const T* src, constT* srcEnd, T* dst)102 static void moveOverlapping(T* src, T* srcEnd, T* dst) 107 103 { 108 104 if (src > dst) … … 113 109 --srcEnd; 114 110 --dstEnd; 115 new (NotNull, dstEnd) T( *srcEnd);111 new (NotNull, dstEnd) T(std::move(*srcEnd)); 116 112 srcEnd->~T(); 117 113 } … … 223 219 } 224 220 225 static void move( const T* src, constT* srcEnd, T* dst)221 static void move(T* src, T* srcEnd, T* dst) 226 222 { 227 223 VectorMover<VectorTraits<T>::canMoveWithMemcpy, T>::move(src, srcEnd, dst); 228 224 } 229 225 230 static void moveOverlapping( const T* src, constT* srcEnd, T* dst)226 static void moveOverlapping(T* src, T* srcEnd, T* dst) 231 227 { 232 228 VectorMover<VectorTraits<T>::canMoveWithMemcpy, T>::moveOverlapping(src, srcEnd, dst);
Note: See TracChangeset
for help on using the changeset viewer.