2013-10-12 Anders Carlsson Change callOnMainThread to take an std::function https://bugs.webkit.org/show_bug.cgi?id=122698 Reviewed by Darin Adler. This will let us pass anything that can be converted to an std::function (including lambdas and WTF::Function objects) to callOnMainThread. * wtf/MainThread.cpp: (WTF::callOnMainThread): * wtf/MainThread.h: 2013-09-06 Jessica Pease Replace bounds checking ASSERTs with ASSERT_WITH_SECURITY_IMPLICATION https://bugs.webkit.org/show_bug.cgi?id=120893 Reviewed by Darin Adler. * wtf/BumpPointerAllocator.h: (WTF::BumpPointerPool::ensureCapacity): (WTF::BumpPointerPool::alloc): (WTF::BumpPointerPool::ensureCapacityCrossPool): * wtf/FastMalloc.cpp: (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary): * wtf/StringPrintStream.cpp: (WTF::StringPrintStream::increaseSize): * wtf/dtoa/utils.h: (WTF::double_conversion::BufferReference::SubBufferReference): * wtf/text/WTFString.cpp: (WTF::String::fromUTF8): 2013-10-11 Darin Adler Change most call sites to call ICU directly instead of through WTF::Unicode https://bugs.webkit.org/show_bug.cgi?id=122635 Reviewed by Alexey Proskuryakov. * wtf/text/StringHash.h: (WTF::CaseFoldingHash::foldCase): Use u_foldCase instead of WTF::Unicode::foldCase. (WTF::CaseFoldingHash::hash): Added an overload for a StringImpl& because why not. * wtf/text/StringImpl.cpp: (WTF::StringImpl::lower): Use u_tolower rather than WTF::Unicode::toLower. Also added an assertion to check that the lowercase version is also part of Latin-1. If this is not guaranteed it would be good to know in a debug build at least. Use u_strToLower rather than WTF::Unicode::toLower. Also removed #if USE(ICU_UNICODE) around the locale-specific version. (WTF::StringImpl::upper): Use u_toupper and u_strToUpper, as above. (WTF::StringImpl::foldCase): Use u_tolower and u_strFoldCase, as above. (WTF::equalIgnoringCase): Use u_foldCase instead of WTF::Unicode::foldCase. (WTF::StringImpl::defaultWritingDirection): Use u_charDirection and UCharDirection instead of WTF::Unicode::direction and WTF::Unicode::Direction. * wtf/text/StringImpl.h: (WTF::equalIgnoringCase): Use u_memcasecmp instead of WTF::Unicode::umemcasecmp. (WTF::isSpaceOrNewline): Use u_charDirection instead of WTF::Unicode::direction. * wtf/text/WTFString.h: (WTF::String::defaultWritingDirection): Use UCharDirection instead of WTF::Unicode::Direction. * wtf/unicode/icu/UnicodeIcu.h: Removed almost everything. * wtf/unicode/wchar/UnicodeWchar.cpp: Tried to do the right thing in this file, but I did not actually compile it. Also, the implementations here aren't really sufficient to make WebKit work broadly. There are many things that just aren't working with this implementation, such as parsing that uses u_charType to figure out which characters are valid. (unorm_normalize): Added. (u_charDirection): Added. (u_charMirror): Added. (u_charType): Added. (u_getCombiningClass): Added. (u_getIntPropertyValue): Added. (u_memcasecmp): Added. (convertWithFunction): Changed to work with ICU-style status code instead of error bool. (u_strFoldCase): Added. (u_strToLower): Added. (u_strToUpper): Added. * wtf/unicode/wchar/UnicodeWchar.h: Ditto. Later this file should just be named like the real ICU headers so the code can include it the same way it would ICU. But that will be in a future patch. 2013-10-11 Anders Carlsson Remove gesture event support from WebCore https://bugs.webkit.org/show_bug.cgi?id=122650 Reviewed by Ryosuke Niwa. * wtf/FeatureDefines.h: * wtf/nix/FeatureDefinesNix.h: 2013-10-09 Filip Pizlo FTL: Soft-link LLVM as a workaround for LLVM's static initializers and exit-time destructors https://bugs.webkit.org/show_bug.cgi?id=122566 Reviewed by Mark Rowe. Remove all LLVM stuff from WTF since to get LLVM you need to soft-link and it's entirely the responsibility of JSC to do that. Also fixed an export goof that I found after fixing the weak thingy script in JSC. * WTF.xcodeproj/project.pbxproj: * wtf/LLVMHeaders.h: Removed. * wtf/text/CString.h: (WTF::CStringHash::hash): 2013-10-10 Mark Rowe WebKit should always build against an SDK. Have all projects default to building against the OS X Internal SDK for the Production configuration. For the Debug and Release configurations, look for UseInternalSDK.xcconfig to determine whether the OS X Internal SDK should be used. If not, use the normal OS X SDK. Reviewed by Dan Bernstein. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: 2013-10-10 Hans Muller [CSS Shapes] clampToUnsigned() should return unsigned, not int https://bugs.webkit.org/show_bug.cgi?id=122601 Corrected the return type for clampToUnsigned() in MathExtras.h. It's now unsigned. Reviewed by Andreas Kling. * wtf/MathExtras.h: (clampToUnsigned): 2013-10-08 Filip Pizlo FTL should be able to do simple OSR exits using llvm.webkit.stackmap https://bugs.webkit.org/show_bug.cgi?id=122538 Reviewed by Oliver Hunt. * wtf/PrintStream.cpp: (WTF::printInternal): * wtf/PrintStream.h: * wtf/RefCountedArray.h: (WTF::RefCountedArray::byteSize): 2013-10-09 Michael Saboff Change to std::unique_ptr breaks wtf/DataLog.cpp when DATA_LOG_TO_FILE set to 1 https://bugs.webkit.org/show_bug.cgi?id=122557 Reviewed by Filip Pizlo. Changed the leakPtr() to release(). * wtf/DataLog.cpp: (WTF::initializeLogFileOnce): 2013-10-08 Tim Horton Turn threaded scrolling on for all Mac ports. Rubber-stamped by Simon Fraser and Sam Weinig. * wtf/FeatureDefines.h: 2013-10-06 Darin Adler Improve HashMap::add comment and other similar comments https://bugs.webkit.org/show_bug.cgi?id=122432 Reviewed by Andreas Kling. * wtf/HashCountedSet.h: * wtf/HashMap.h: * wtf/HashSet.h: Updated comment wording. They were a bit old and out of date. They also featured the word "interator". 2013-10-07 Darin Adler Make Vector::insert work for move-only types https://bugs.webkit.org/show_bug.cgi?id=122429 Reviewed by Anders Carlsson. * wtf/Vector.h: (WTF::Vector::insert): Take an rvalue reference instead of a const reference. (WTF::Vector::insertVector): Renamed to avoid overloading troubles, analogous to what we did for appendVector. 2013-10-07 Anders Carlsson Fix Windows build. * wtf/StdLibExtras.h: (std::make_unique): 2013-10-07 Roger Fong Modify WTF makefile for x64 build. https://bugs.webkit.org/show_bug.cgi?id=122467. . Reviewed by Brent Fulgham. * WTF.vcxproj/WTF.make: 2013-10-07 Anders Carlsson Remove passIn and passOut from HashTraits https://bugs.webkit.org/show_bug.cgi?id=122452 Reviewed by Sam Weinig. Change RefPtrHashMap to not use passOut (just like the regular HashMap) and get rid of the passIn and passOut functions and related typedefs. * wtf/HashTraits.h: * wtf/RefPtrHashMap.h: 2013-10-06 Anders Carlsson Add OVERRIDE and virtual where appropriate https://bugs.webkit.org/show_bug.cgi?id=122439 Reviewed by Antti Koivisto. * wtf/Compiler.h: * wtf/FilePrintStream.h: * wtf/StringPrintStream.h: 2013-10-06 Andreas Kling Range constructors should take a Document&. Reviewed by Sam Weinig. Give Ref an assignment operator. 2013-10-05 Anders Carlsson Clean up MessageQueue.h https://bugs.webkit.org/show_bug.cgi?id=122392 Reviewed by Andreas Kling. Make MessageQueue use std::unique_ptr and change findIf and removeIf to take const references. * wtf/Deque.h: Change findIf to take an rvalue reference. * wtf/MessageQueue.h: (WTF::::append): (WTF::::appendAndKill): (WTF::::appendAndCheckEmpty): (WTF::::prepend): (WTF::::removeIf): 2013-10-05 Anders Carlsson Try to #define final to sealed when building with MSVC https://bugs.webkit.org/show_bug.cgi?id=122386 Reviewed by Darin Adler. * wtf/Compiler.h: 2013-10-05 Anders Carlsson Remove createOwned https://bugs.webkit.org/show_bug.cgi?id=122388 Reviewed by Darin Adler. Since we're going with std::unique_ptr instead of OwnPtr, there's no need for makeOwned to exist. Get rid of it and replace it with calls to std::make_unique. * wtf/FilePrintStream.cpp: (WTF::FilePrintStream::open): * wtf/FilePrintStream.h: * wtf/HashTable.h: (WTF::::HashTable): * wtf/ListHashSet.h: (WTF::::ListHashSet): * wtf/OwnPtr.h: * wtf/Threading.cpp: (WTF::compatEntryPoint): (WTF::createThread): * wtf/ThreadingPthreads.cpp: (WTF::wtfThreadEntryPoint): (WTF::createThreadInternal): * wtf/unicode/Collator.h: * wtf/unicode/CollatorDefault.cpp: (WTF::Collator::userDefault): * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::userDefault): 2013-10-05 Darin Adler Remove COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES) since it's required now https://bugs.webkit.org/show_bug.cgi?id=122387 Reviewed by Anders Carlsson. * wtf/RefPtr.h: * wtf/RetainPtr.h: * wtf/Vector.h: * wtf/text/AtomicString.h: * wtf/text/WTFString.h: Take out conditionals. 2013-10-05 Darin Adler Add AtomicString::number and use it https://bugs.webkit.org/show_bug.cgi?id=122384 Reviewed by Anders Carlsson. * wtf/text/AtomicString.cpp: (WTF::AtomicString::number): Added. * wtf/text/AtomicString.h: Ditto. * wtf/text/IntegerToStringConversion.h: Simplify includes, renamed ConversionTrait to IntegerToStringConversionTrait. Changed String version to use String since we no longer need to use PassRefPtr to efficiently handle return values. Replaced UnsignedIntegerTrait with std::make_unsigned. Added AtomicString support. Use nullptr instead of 0. 2013-10-05 Darin Adler Cut down on use of String::number https://bugs.webkit.org/show_bug.cgi?id=122382 Reviewed by Anders Carlsson. * wtf/DateMath.cpp: (WTF::appendTwoDigitNumber): Added. Replaces twoDigitStringFromNumber, which returned a String and also allocated a temporary string for any number 10 or higher. (WTF::makeRFC2822DateString): Updated to use the new function. 2013-10-05 Anders Carlsson Test the waters and begin using lambdas https://bugs.webkit.org/show_bug.cgi?id=121809 Reviewed by Andreas Kling. * wtf/ListDump.h: (WTF::sortedListDump): Use std::less instead of a custom lessThan function. 2013-10-04 Darin Adler text-transform: lowercase is not lang-dependent (Turkish languages : tr,az) https://bugs.webkit.org/show_bug.cgi?id=21312 Reviewed by Ryosuke Niwa. * wtf/text/StringImpl.cpp: (WTF::StringImpl::upper): Removed an extra call that would unnecessarily reallocate a StringImpl in the general non-ASCII case. Added an overload that takes a locale identifier. (WTF::StringImpl::lower): Ditto. * wtf/text/StringImpl.h: Ditto. * wtf/text/WTFString.cpp: (WTF::String::lower): Ditto. (WTF::String::upper): Ditto. * wtf/text/WTFString.h: Ditto. Also deleted the makeLower and makeUpper functions since they offer no advantages over the lower and upper functions. Also added a constructor that takes a RefPtr with move construction to help. 2013-10-04 Brent Fulgham Remove Qt definitions from Platform.h https://bugs.webkit.org/show_bug.cgi?id=122349 Reviewed by Anders Carlsson. * wtf/Platform.h: Remove unused PLATFORM(QT) stanzas from file. 2013-10-04 Brent Fulgham [Win] Turn off FastMalloc on Windows https://bugs.webkit.org/show_bug.cgi?id=122352 Reviewed by Darin Adler. * wtf/Platform.h: Enable USE_SYSTEM_MALLOC when building on Windows to stick to the MSVCRT allocator/deallocator. 2013-10-04 Mikhail Pozdnyakov Remove WTF smart pointers 'const_pointer_cast' https://bugs.webkit.org/show_bug.cgi?id=122325 Reviewed by Darin Adler. Removed WTF smart pointers 'const_pointer_cast' functions as: - they were not used - their implementation was wrong as they tried to cast to a different pointer type * wtf/PassOwnPtr.h: * wtf/PassRefPtr.h: * wtf/RefPtr.h: 2013-10-04 Oliver Hunt Support for-of syntax https://bugs.webkit.org/show_bug.cgi?id=122339 Reviewed by Geoffrey Garen. Update assertions and add a helper function to StringImpl to save repeated unique or identifier calls. * wtf/text/StringImpl.h: (WTF::StringImpl::isIdentifierOrUnique): (WTF::StringImpl::setIsIdentifier): (WTF::StringImpl::setIsAtomic): 2013-10-02 Brent Fulgham [Win] Update solutions and projects to support 64-bit build. https://bugs.webkit.org/show_bug.cgi?id=122225 Reviewed by Anders Carlsson. * WTF.vcxproj/WTF.submit.sln: Add x64 architecture targets. * WTF.vcxproj/WTF.vcxproj: Correct path to config.h file. * WTF.vcxproj/WTF.vcxproj.filters: Correct path to config.h file. 2013-10-02 Nadav Rotem Eliminate a branch in FastBitVector setAndCheck, make it vectorizable. https://bugs.webkit.org/show_bug.cgi?id=122229 Reviewed by Geoffrey Garen. The CPU is unlikely to predict the branch in setAndCheck. I changed the code to use conditional instructions. * wtf/FastBitVector.h: (WTF::FastBitVector::setAndCheck): 2013-10-02 Anders Carlsson Remove Qt code from WTF https://bugs.webkit.org/show_bug.cgi?id=122221 Reviewed by Antti Koivisto. I'm keeping the PLATFORM(QT) defines in Platform.h for now so we can assess if there are any Qt only features that we can remove later. * WTF.pri: Removed. * WTF.pro: Removed. * wtf/Assertions.cpp: * wtf/CurrentTime.cpp: * wtf/DisallowCType.h: * wtf/FastMalloc.cpp: * wtf/FeatureDefines.h: * wtf/qt/MainThreadQt.cpp: Removed. * wtf/qt/StringQt.cpp: Removed. * wtf/text/AtomicString.h: * wtf/text/StringImpl.cpp: (WTF::StringImpl::~StringImpl): * wtf/text/StringImpl.h: * wtf/text/WTFString.cpp: (WTF::String::format): * wtf/text/WTFString.h: 2013-09-30 Sam Weinig Remove support for DOMFileSystem https://bugs.webkit.org/show_bug.cgi?id=122137 Reviewed by Anders Carlsson. * wtf/FeatureDefines.h: 2013-09-30 Benjamin Poulain Remove the code guarded by STYLE_SCOPED https://bugs.webkit.org/show_bug.cgi?id=122123 Reviewed by Anders Carlsson. * wtf/FeatureDefines.h: 2013-09-28 Mark Rowe Take Xcode's advice and enable some extra warnings. Reviewed by Sam Weinig. * Configurations/Base.xcconfig: * WTF.xcodeproj/project.pbxproj: 2013-09-28 Mark Rowe WTF fails to build with newer versions of clang. Reviewed by Sam Weinig. * wtf/DateMath.cpp: Remove some unused constants. * wtf/FastMalloc.cpp: #if some constants and functions that are unused in some configurations. Remove a function that's unused on all platforms. * wtf/TCSystemAlloc.cpp: Remove some unused constants. (TCMalloc_SystemRelease): Remove an if whose body is never executed. * wtf/dtoa.cpp: #if things such that storeInc is only defined when USE_LONG_LONG is undefined. Remove an unused constant. 2013-09-27 Thiago de Barros Lacerda [Nix] Updating Nix trunk files https://bugs.webkit.org/show_bug.cgi?id=121752 Reviewed by Benjamin Poulain. * wtf/nix/FeatureDefinesNix.h: 2013-09-06 Jer Noble [Mac] Implement the media controls in JavaScript. https://bugs.webkit.org/show_bug.cgi?id=120895 Reviewed by Dean Jackson. Define and turn on ENABLE_MEDIA_CONTROLS_SCRIPT. * wtf/FeatureDefines.h: 2013-09-27 Gustavo Noronha Silva [GCC] Fix build with gcc < 4.8.1, which does not have is_trivially_destructible https://bugs.webkit.org/show_bug.cgi?id=121999 Reviewed by Benjamin Poulain. * wtf/StdLibExtras.h: 2013-09-26 Anders Carlsson "Build fix". We can't use std::move. Explicitly destroy the old value and then construct the new in place. * wtf/HashTable.h: 2013-09-26 Anders Carlsson Use the move assignment operator when reinserting values in the hash map https://bugs.webkit.org/show_bug.cgi?id=122003 Reviewed by Alexey Proskuryakov. Using the move assignment operator ensures that the existing values will be destroyed correctly. * wtf/HashTable.h: 2013-09-26 Brent Fulgham [Windows] Work around missing C++11 features of MSVC by providing an implementation for std::is_trivially_destructible based on the existing std::has_trivial_destructor. Rubber-stamped by Anders Carlsson. * wtf/StdLibExtras.h: Add implementation for is_trivially_destructable for MSVC 2010 and prior. 2013-09-26 Anders Carlsson Remove needsDestruction from vector and hash traits https://bugs.webkit.org/show_bug.cgi?id=121983 Reviewed by Sam Weinig. For Vector, use std::is_trivially_destructible to determine whether to call the destructor. For HashTable, always call the destructor; if it is trivial then no code will be generated for it and the loops will be folded away. Removing this does break the ability to store objects with non-trivial destructors in vectors and hash maps and have their destructors not be called when removed, but we've never used this feature in WebKit so the extra code complexity is not worth it. * wtf/HashTable.h: (WTF::::deallocateTable): * wtf/HashTraits.h: * wtf/Vector.h: (WTF::VectorTypeOperations::destruct): * wtf/VectorTraits.h: 2013-09-26 Anders Carlsson Build fixes. Fix a paste-o. * wtf/StdLibExtras.h: (std::make_unique): 2013-09-26 Anders Carlsson Remove the hash table mover https://bugs.webkit.org/show_bug.cgi?id=121980 Reviewed by Andreas Kling. Use std::move instead. * wtf/HashTable.h: 2013-09-26 Anders Carlsson Change a couple of HashMap value types from OwnPtr to std::unique_ptr https://bugs.webkit.org/show_bug.cgi?id=121973 Reviewed by Andreas Kling. * wtf/RefPtrHashMap.h: Add a missing std::forward. * wtf/StdLibExtras.h: (std::make_unique): Add more overloads. 2013-09-26 Julien Brianceau [Qt] Remove PassTraits.h from WTF.pro. https://bugs.webkit.org/show_bug.cgi?id=121946 Reviewed by Andreas Kling. * WTF.pro: Remove PassTraits.h as this file disappeared in r156298. 2013-09-25 Patrick Gansterer Fix compilation with new MSVC compiler for Windows CE https://bugs.webkit.org/show_bug.cgi?id=121914 Reviewed by Darin Adler. Remove code to support older Windows CE versions, since those old versions do not support C+11, which is required in the meantime. * wtf/Atomics.h: * wtf/Platform.h: 2013-09-25 Anders Carlsson Move KeyValuePairTraits inside HashMap https://bugs.webkit.org/show_bug.cgi?id=121931 Reviewed by Sam Weinig. Also rename the ValueType typedef to KeyValuePairType since it's always a key value pair. * wtf/HashMap.h: (WTF::HashMap::KeyValuePairTraits::isEmptyValue): (WTF::HashMap::find): (WTF::HashMap::contains): 2013-09-25 Anders Carlsson Un-indent HashMap.h. Rubber-stamped by Andreas Kling. * wtf/HashMap.h: 2013-09-25 Anders Carlsson Un-indent HashTraits.h. Rubber-stamped by Andreas Kling. * wtf/HashTraits.h: 2013-09-25 Patrick Gansterer Fix template deduction for CollatorDefault * wtf/unicode/CollatorDefault.cpp: (WTF::Collator::userDefault): Use nullptr instead of 0. 2013-09-24 Anders Carlsson Remove encoder create functions https://bugs.webkit.org/show_bug.cgi?id=121853 Reviewed by Sam Weinig. Add a variadic version of createOwned. * wtf/OwnPtr.h: (WTF::createOwned): 2013-09-24 Mark Rowe WebKit should build against the Xcode default toolchain when targeting OS X 10.8 Reviewed by Dan Bernstein. * Configurations/Base.xcconfig: 2013-09-23 Anders Carlsson Remove WTF_USE_SCROLLBAR_PAINTER #define https://bugs.webkit.org/show_bug.cgi?id=121819 Reviewed by Sam Weinig. All our supported systems use the scrollbar painter now, so get rid of the #ifdef. * wtf/Platform.h: 2013-09-23 Commit Queue Unreviewed, rolling out r156307. http://trac.webkit.org/changeset/156307 https://bugs.webkit.org/show_bug.cgi?id=121817 Broke the build, and crashes the compiler (Requested by ap on #webkit). * wtf/ListDump.h: (WTF::lessThan): (WTF::sortedListDump): 2013-09-23 Anders Carlsson Test the waters and begin using lambdas https://bugs.webkit.org/show_bug.cgi?id=121809 Reviewed by Andreas Kling. * wtf/ListDump.h: (WTF::sortedListDump): Use std::less instead of a custom lessThan function. 2013-09-23 Anders Carlsson ListHashSet::removeLast should only remove one element. * wtf/ListHashSet.h: (WTF::ListHashSet::removeLast): 2013-09-23 Anders Carlsson Add hash traits for std::unique_ptr https://bugs.webkit.org/show_bug.cgi?id=121807 Reviewed by Antti Koivisto. Also, convert the thread map over to using std::unique_ptr instead of OwnPtr. * wtf/HashMap.h: Remove unnecessary typedefs and add missing calls to std::forward. * wtf/HashTraits.h: Add hash trait for std::unique_ptr. * wtf/RefPtrHashMap.h: Use std::add_lvalue_reference. * wtf/ThreadingPthreads.cpp: (WTF::establishIdentifierForPthreadHandle): Change ThreadMap to be a hash map from ThreadIdentifier to std::unique_ptr. 2013-09-23 Patrick Gansterer use NOMINMAX instead of #define min min https://bugs.webkit.org/show_bug.cgi?id=73563 Reviewed by Brent Fulgham. Use NOMINMAX instead of #define min/max as a cleaner way of ensuring that Windows system header files don't define min/max as macro in the first place. * config.h: 2013-09-23 Anders Carlsson Remove PassTraits.h https://bugs.webkit.org/show_bug.cgi?id=121805 Reviewed by Andreas Kling. We no longer need PassTraits.h, get rid of it. * GNUmakefile.list.am: * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTF.vcxproj.filters: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PassTraits.h: Removed. 2013-09-23 Anders Carlsson ListHashSet should work with move-only types https://bugs.webkit.org/show_bug.cgi?id=121802 Reviewed by Andreas Kling. Add rvalue reference overloads and calls to std::forward and std::move where appropriate. * wtf/ListHashSet.h: (WTF::::removeFirst): Implement this in terms of takeFirst. (WTF::::takeFirst): Look up the iterator before we move out the value so we won't break the hash invariant. (WTF::::removeLast): Implement this in terms of takeLast. (WTF::::takeLast): Look up the iterator before we move out the value so we won't break the hash invariant. 2013-09-23 Anders Carlsson Clean up ListHashSet https://bugs.webkit.org/show_bug.cgi?id=121797 Reviewed by Antti Koivisto. * wtf/ListHashSet.h: 2013-09-23 Anders Carlsson ListHashSet should use std::reverse_iterator for reverse iterators https://bugs.webkit.org/show_bug.cgi?id=121795 Reviewed by Antti Koivisto. Get rid of the custom reverse iterators and just use std::reverse_iterator instead. * wtf/ListHashSet.h: 2013-09-23 Anders Carlsson De-indent ListHashSet in preparation of more changes. Rubber-stamped by Sam Weinig. * wtf/ListHashSet.h: 2013-09-23 Patrick Gansterer Cleanup CMake files in WTF https://bugs.webkit.org/show_bug.cgi?id=121761 Reviewed by Gyuyoung Kim. Sort files and unify the style. * wtf/CMakeLists.txt: * wtf/PlatformEfl.cmake: * wtf/PlatformGTK.cmake: 2013-09-22 Andreas Kling Give purity hints to compiler to avoid penalizing repeated calls to some functions. Reviewed by Darin Adler. Added a PURE_FUNCTION macro. This is supported on GCC and Clang for now. Marking a function pure means that the compiler's CSE pass is free to coalesce multiple calls to this function because it has no globally observable side effects beyond the first call. 2013-09-20 Anders Carlsson Add an implementation of std::index_sequence from C++14 https://bugs.webkit.org/show_bug.cgi?id=121718 Reviewed by Ryosuke Niwa. This will make it easier to do things like pack expansion of tuple elements. * wtf/StdLibExtras.h: 2013-09-20 Allan Sandfeld Jensen Atomics.h does not build on MinGW https://bugs.webkit.org/show_bug.cgi?id=121663 Reviewed by Darin Adler. MinGW does not have _ReadWriteBarrier() intrinsic, but does have GCC inline assembler, so use the GCC definitions instead of MSVC ones. * wtf/Atomics.h: (WTF::compilerFence): 2013-09-20 Patrick Gansterer [CMake] Use COMPILE_DEFINITIONS target property for setting BUILDING_* defines https://bugs.webkit.org/show_bug.cgi?id=121672 Reviewed by Gyuyoung Kim. Since the scope of add_definitions() is always a whole file, we need to use target properties instead to set definitions only for specific targets. * wtf/CMakeLists.txt: 2013-09-20 Patrick Gansterer Remove duplicated secondsPerDay variables https://bugs.webkit.org/show_bug.cgi?id=121601 Reviewed by Andreas Kling. Move secondsPerDay from the source into the header file to make it accessible by other code too. * wtf/DateMath.cpp: * wtf/DateMath.h: 2013-09-19 Joseph Pecoraro ASSERTs in isMainThread after USE(WEB_THREAD) MainThread changes https://bugs.webkit.org/show_bug.cgi?id=121650 Reviewed by Benjamin Poulain. * wtf/mac/MainThreadMac.mm: (WTF::initializeMainThreadPlatform): 2013-09-19 Daniel Bates [iOS] Define mainThreadEstablishedAsPthreadMain to be true in WTF::initializeMainThreadPlatform() Reviewed by Joseph Pecoraro. This change was inadvertently left out of . * wtf/mac/MainThreadMac.mm: (WTF::initializeMainThreadPlatform): 2013-09-19 Sam Weinig Remove OwnArrayPtr https://bugs.webkit.org/show_bug.cgi?id=121612 Reviewed by Anders Carlsson. * GNUmakefile.list.am: * WTF.pro: * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTF.vcxproj.filters: * WTF.xcodeproj/project.pbxproj: * wtf/Assertions.cpp: * wtf/CMakeLists.txt: * wtf/DateMath.h: * wtf/FastBitVector.h: * wtf/Forward.h: * wtf/OwnArrayPtr.h: Removed. * wtf/VectorTraits.h: 2013-09-19 Daniel Bates Substitute return type void for bool in function declaration for WTF::initializeWebThread() Reviewed by Joseph Pecoraro. Make the declaration of WTF::initializeWebThread() match the function prototype of its definition. * wtf/MainThread.h: 2013-09-19 Andreas Kling Assume allocator success in Vector unless using try* functions. Reviewed by Anders Carlsson. Turn some Vector::begin() null checking into assertions instead. We have try* style functions for when an allocation request is so large that it might actually fail. fastMalloc() will never return null (it will just CRASH() instead.) 2013-09-18 Brent Fulgham [Windows] Unreviewed build correction. * WTF.vcxproj/WTFGeneratedCommon.props: Export PLATFORMARCHITECTURE macro for use in Makefiles and shell scripts. * WTF.vcxproj/build-generated-files.sh: Output header search path to identify when the build is confused about build architecture. 2013-09-18 Anders Carlsson RefPtrHashMap should work with move only types https://bugs.webkit.org/show_bug.cgi?id=121564 Reviewed by Andreas Kling. Add the same rvalue references and std::forward calls that already exist in HashMap. * wtf/RefPtrHashMap.h: 2013-09-18 Filip Pizlo DFG should support Int52 for local variables https://bugs.webkit.org/show_bug.cgi?id=121064 Reviewed by Oliver Hunt. * wtf/PrintStream.h: (WTF::ValueIgnoringContext::ValueIgnoringContext): (WTF::ValueIgnoringContext::dump): (WTF::ignoringContext): 2013-09-18 Andreas Kling Put constant CachedPower table in read-only memory. Reviewed by Anders Carlsson. * wtf/dtoa/cached-powers.cc: 2013-09-18 Commit Queue Unreviewed, rolling out r156019 and r156020. http://trac.webkit.org/changeset/156019 http://trac.webkit.org/changeset/156020 https://bugs.webkit.org/show_bug.cgi?id=121540 Broke tests (Requested by ap on #webkit). * wtf/PrintStream.h: 2013-09-16 Filip Pizlo DFG should support Int52 for local variables https://bugs.webkit.org/show_bug.cgi?id=121064 Reviewed by Oliver Hunt. * wtf/PrintStream.h: (WTF::ValueIgnoringContext::ValueIgnoringContext): (WTF::ValueIgnoringContext::dump): (WTF::ignoringContext): 2013-09-17 Anders Carlsson Stop explicitly using PassOwnPtr in WebCore/html https://bugs.webkit.org/show_bug.cgi?id=121511 Reviewed by Andreas Kling. Make operator= work work for different types of OwnPtrs. * wtf/OwnPtr.h: 2013-09-17 Sam Weinig Add make_unique and start using it https://bugs.webkit.org/show_bug.cgi?id=121523 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (std::make_unique): Add temporary implementation of std::make_unique that we can use until our standard libraries have support for it. 2013-09-17 Darin Adler Make SVGTransform::valueAsString use StringBuilder https://bugs.webkit.org/show_bug.cgi?id=121498 Reviewed by Andreas Kling. * wtf/text/StringBuilder.cpp: Added appendNumber functions corresponding to all remaining String::number functions. If we find we don't need all of these we can delete them later, but I don't want to give clients a reason to prefer less-efficient API to StringBuilder. * wtf/text/StringBuilder.h: Ditto. 2013-09-16 Anders Carlsson HashMap should work with move-only keys https://bugs.webkit.org/show_bug.cgi?id=121310 Reviewed by Darin Adler. Add extra overloads for add and set where the key is an rvalue reference, but not a template parameter rvalue reference. This way we'll coerce the key parameter to have the expected type instead of the passed in type, causing map.add(StringImpl::create("Hello"), 123) work when the type of map is HashMap. Also, sprinkle && and std::forward where appropriate. * wtf/HashMap.h: * wtf/HashTable.h: 2013-09-17 Sergio Martins Fix Windows CE build on ARM. https://bugs.webkit.org/show_bug.cgi?id=121490 Reviewed by Darin Adler. * wtf/dtoa/utils.h: 2013-09-17 Mihnea Ovidenie REGRESSION(r155910): WebKit nightly builds don't load any page https://bugs.webkit.org/show_bug.cgi?id=121482 Reviewed by Andreas Kling. Replaced C++ style comments with C style comments. * wtf/Platform.h: 2013-09-16 Joseph Pecoraro USE(WEB_THREAD): More explicit WebThread initialization https://bugs.webkit.org/show_bug.cgi?id=121454 Reviewed by Benjamin Poulain. Be more explicit when initializing WebThread only data. * wtf/MainThread.h: * wtf/MainThread.cpp: (WTF::initializeWebThreadOnce): (WTF::initializeWebThread): Ensure one time initialization. * wtf/mac/MainThreadMac.mm: (WTF::initializeMainThreadPlatform): (WTF::initializeWebThreadPlatform): Move WebThread value initialization to its own function. (WTF::isMainThread): Remove no longer invalid assert if WebThread was not initialized. 2013-09-16 Benjamin Poulain Fix WebKit1 build after r155910 Reviewed by Anders Carlsson. * wtf/Platform.h: Some files in WebKit include system headers before WTF headers, causing the macro to be defined twice. #undef the macro to support that case. 2013-09-16 Benjamin Poulain Disable OS X's unprefixed debug macro https://bugs.webkit.org/show_bug.cgi?id=121460 Reviewed by Anders Carlsson. * wtf/Platform.h: OS X defines a series of platform macros for debugging. Some of them are really annoying because they use common names (e.g. check()). Disable those macros so that we are not limited in how we name methods and functions. 2013-09-16 Anders Carlsson MessageQueue should use a Deque of OwnPtrs https://bugs.webkit.org/show_bug.cgi?id=121450 Reviewed by Andreas Kling. * wtf/MessageQueue.h: 2013-09-16 Anders Carlsson WTF::Deque should work with move only types https://bugs.webkit.org/show_bug.cgi?id=121446 Reviewed by Andreas Kling. * wtf/Deque.h: Use std::move and std::forward where appropriate and get rid of the PassTraits include. 2013-09-16 Anders Carlsson Change a couple of COMPILE_ASSERTs to static_assert https://bugs.webkit.org/show_bug.cgi?id=121441 Reviewed by Andreas Kling. * wtf/BloomFilter.h: * wtf/PackedIntVector.h: (WTF::PackedIntVector::PackedIntVector): * wtf/StdLibExtras.h: (WTF::bitwise_cast): (WTF::safeCast): (WTF::roundUpToMultipleOf): * wtf/StringHasher.h: (WTF::StringHasher::hashMemory): * wtf/Vector.h: * wtf/text/AtomicString.cpp: * wtf/unicode/Unicode.h: 2013-09-15 Gustavo Noronha Silva Unreviewed make distcheck fix. * GNUmakefile.list.am: 2013-09-15 Patrick Gansterer Fix build with Visual Studio 2012 after r153764. https://bugs.webkit.org/show_bug.cgi?id=121406 Reviewed by Brent Fulgham. * wtf/MathExtras.h: 2013-09-15 Alberto Garcia Unreviewed GTK gardening. * GNUmakefile.list.am: remove FastAllocBase.h, this file disappeared in r155251. 2013-09-15 Patrick Gansterer [WIN] Fix build without precompiled header after r155454. * wtf/win/GDIObject.h: Added missing windows.h include. 2013-09-15 Andreas Kling Remove Ref(const T&) constructor. Reviewed by Anders Carlsson. This constructor was added as a stopgap measure until we got better support for move semantics in Vector. * wtf/Ref.h: 2013-09-15 Andreas Kling Unreviewed, fix ridiculous bug in WeakPtr. I made operator!() null check the pointer to the WeakReference. :| Caught by plugins/destroy-on-setwindow.html on bots. * wtf/WeakPtr.h: (WTF::WeakPtr::operator!): 2013-09-14 Andreas Kling Get rid of ref-counting on RenderWidget. Reviewed by Darin Adler. * wtf/WeakPtr.h: (WTF::WeakPtr::operator!): Add operator! to WeakPtr. 2013-09-14 Darin Adler Add NeverDestroyed::get https://bugs.webkit.org/show_bug.cgi?id=121358 Reviewed by Anders Carlsson. * wtf/NeverDestroyed.h: Removed code to make this non-copyable, since we also use a macro to accomplish that. (WTF::NeverDestroyed::get): Added. Useful in conjuction with auto to avoid having to repeat the type when we want to put one of these into a reference. 2013-09-13 Anders Carlsson Pick the correct overload when a const reference is passed to appendSlowCase. https://bugs.webkit.org/show_bug.cgi?id=121326 Reviewed by Darin Adler. * wtf/Vector.h: (WTF::Vector::appendSlowCase): Make sure that the pointer to the element isn't const so we'll pick the right expandCapacity overload. 2013-09-13 Anders Carlsson Avoid a couple of zero-sized fastMalloc calls https://bugs.webkit.org/show_bug.cgi?id=121333 Reviewed by Geoffrey Garen. * wtf/text/StringBuffer.h: (WTF::StringBuffer::StringBuffer): Initialize m_data to null if m_length is null, and use Checked to check for overflow when multiplying m_length with the character size. 2013-09-13 Brent Fulgham [Windows] Activate FastMalloc hardening https://bugs.webkit.org/show_bug.cgi?id=121307 Reviewed by Oliver Hunt. * wtf/FastMalloc.cpp: (WTF::SLL_Next): Add workaround for MSVC compiler bug. 2013-09-13 Mikhail Pozdnyakov OwnArrayPtr: Never allow implicit pointer conversion https://bugs.webkit.org/show_bug.cgi?id=121291 Reviewed by Anders Carlsson. We should never allow implicit pointer conversion in OwnArrayPtr and remove its template copy constructor & template assignment operator, as: - these methods are never used - these methods are inappropriate to have in OwnArrayPtr as arrays do not interact well with polymorphism. * wtf/OwnArrayPtr.h: 2013-09-13 Allan Sandfeld Jensen Remove support for QXmlStream as the XML parser. https://bugs.webkit.org/show_bug.cgi?id=121229 Reviewed by Andreas Kling. Removed USE flags. * wtf/Platform.h: 2013-09-12 Mark Hahnenberg Bitmap's WordType should be a template parameter https://bugs.webkit.org/show_bug.cgi?id=121238 Reviewed by Darin Adler. The code is written as if it already is. We just need to lift it out of the class. This simplifies code that wants to load, for example, a single byte rather than an entire 32-bit word. * wtf/Bitmap.h: (WTF::Bitmap::Bitmap): (WTF::Bitmap::get): (WTF::Bitmap::set): (WTF::Bitmap::testAndSet): (WTF::Bitmap::testAndClear): (WTF::Bitmap::concurrentTestAndSet): (WTF::Bitmap::concurrentTestAndClear): (WTF::Bitmap::clear): (WTF::Bitmap::clearAll): (WTF::Bitmap::nextPossiblyUnset): (WTF::Bitmap::findRunOfZeros): (WTF::Bitmap::count): (WTF::Bitmap::isEmpty): (WTF::Bitmap::isFull): 2013-09-12 Anders Carlsson Add rudimentary support for move-only types as values in HashMap https://bugs.webkit.org/show_bug.cgi?id=121226 Reviewed by Andreas Kling. * wtf/HashMap.h: Change a bunch of functions to so they can take both rvalue and lvalue references and use std::forward. * wtf/HashTraits.h: (WTF::KeyValuePair::KeyValuePair): Change constructors to accept both lvalues and rvalues. 2013-09-12 Mikhail Pozdnyakov Remove home-brewed nullptr https://bugs.webkit.org/show_bug.cgi?id=119624 Reviewed by Anders Carlsson. The standard C++11 nullptr and std::nullptr_t type should be used now. * GNUmakefile.list.am: * WTF.pro: * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTF.vcxproj.filters: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/NullPtr.cpp: Removed. * wtf/NullPtr.h: Removed. * wtf/OwnArrayPtr.h: * wtf/OwnPtr.h: * wtf/PassOwnPtr.h: * wtf/PassRefPtr.h: * wtf/RetainPtr.h: * wtf/win/GDIObject.h: 2013-09-11 Anders Carlsson Use the new C++11 function declaration syntax throughout our hash collection classes https://bugs.webkit.org/show_bug.cgi?id=121195 Reviewed by Andreas Kling. * wtf/HashMap.h: * wtf/HashSet.h: * wtf/HashTable.h: 2013-09-11 Anders Carlsson Add HashSet::take https://bugs.webkit.org/show_bug.cgi?id=121192 Reviewed by Darin Adler. This is mostly done to see if we can use the new C++11 function declaration syntax, and for parity with HashMap::take. * wtf/HashMap.h: * wtf/HashSet.h: 2013-09-11 Anders Carlsson HashSet should work with move only types https://bugs.webkit.org/show_bug.cgi?id=121188 Reviewed by Geoffrey Garen. * wtf/HashSet.h: (WTF::HashSet::add): Add a new rvalue reference overload and use std::move when calling HashTable::add. * wtf/HashTable.h: (WTF::IdentityHashTranslator::translate): Change this to take an rvalue reference for the value so we can invoke the move assignment operator. (WTF::HashTable::add): Call the add member function template, using std::move to move the value. (WTF::HashTable::add): Add std::forward so we'll potentially move extra. 2013-09-11 Anders Carlsson Avoid copying a hash table bucket when inserting causes a rehash https://bugs.webkit.org/show_bug.cgi?id=121185 Reviewed by Darin Adler. Allow rehashing to track a hash bucket and return the new pointer to it, thus avoiding having to do a copy of a hash table bucket as well as an extra hash lookup. * wtf/HashTable.h: 2013-09-11 Brent Fulgham [Windows] Unreviewed build fix. * wtf/win/GDIObject.h: (WTF::GDIObject::GDIObject): I forgot to check in as part of r155557 by using webkit-patch land in a sub-directory! 2013-09-11 Oliver Hunt Partial Information Leakage in Hash Table implementations (PrivateName) https://bugs.webkit.org/show_bug.cgi?id=120663 Reviewed by Michael Saboff. Unique strings now just generate a completely random value as their hash, rather than using their this pointer. * wtf/text/StringImpl.h: (WTF::StringImpl::StringImpl): 2013-09-11 Brent Fulgham Unreviewed build correction. * WTF.vcxproj/copy-files.cmd: Touch file to force WTFGenerated build to copy updated GDIObject.h header file on build machines. 2013-09-11 Anders Carlsson Vector::append doesn't work if element type has overloaded operator& https://bugs.webkit.org/show_bug.cgi?id=121175 Reviewed by Brent Fulgham. Use std::addressof to get the address of the given object. * wtf/Vector.h: (WTF::::appendSlowCase): (WTF::::uncheckedAppend): 2013-09-11 Anders Carlsson Vector::append doesn't work if element type has overloaded operator& https://bugs.webkit.org/show_bug.cgi?id=121175 Reviewed by Brent Fulgham. Use std::addressof to get the address of the given object. * wtf/Vector.h: (WTF::::appendSlowCase): (WTF::::uncheckedAppend): 2013-09-11 Anders Carlsson VectorBuffer::swap doesn't need to use std::swap_ranges https://bugs.webkit.org/show_bug.cgi?id=121164 Reviewed by Darin Adler. There's a std::swap overload for swapping arrays, just use it instead. * wtf/Vector.h: (WTF::VectorBuffer::swap): 2013-09-11 Anders Carlsson Implement Vector::append for move-only types https://bugs.webkit.org/show_bug.cgi?id=120805 Reviewed by Andreas Kling. * wtf/Vector.h: (WTF::::expandCapacity): Remove const from the pointer passed to expandCapacity, it can be non-const if we're moving. (WTF::::append): Change append to take U&& and use std::forward when constructing the element and when passing the element along to appendSlowCase if that's necessary. (WTF::::appendSlowCase): Use std::forward. (WTF::::uncheckedAppend): Rename val to value. 2013-09-11 Mikhail Pozdnyakov WTF::OwnPtr should behave similarly with the rest of WTF smart pointers https://bugs.webkit.org/show_bug.cgi?id=120773 Reviewed by Anders Carlsson. Before the change OwnPtr could take either the pointer type or the pointed-to type, which was bad for the following reasons: - It distinguished OwnPtr behaviour from other WTF smart pointer classes behaviour (so it was confusing for the Client). - It was potential error-prone as it actually modified the type given by the Client in opaque way. * wtf/OwnPtr.h: * wtf/PassOwnPtr.h: 2013-09-11 Mikhail Pozdnyakov OwnPtr: Use copy/move-and-swap for assignment operators https://bugs.webkit.org/show_bug.cgi?id=121154 Reviewed by Anders Carlsson. Rationals: - decrease of repeated code - consistency with RefPtr * wtf/OwnPtr.h: (WTF::=): 2013-09-11 Patrick Gansterer [CMake] Split out generic Windows files into its own file https://bugs.webkit.org/show_bug.cgi?id=119514 Reviewed by Gyuyoung Kim. This allows us to add smaller CMakeLists.txt files when adding additional Windows ports. * wtf/PlatformWin.cmake: Renamed from Source/WTF/wtf/PlatformWinCE.cmake. 2013-09-10 Daniel Bates [iOS] Upstream text autosizing https://bugs.webkit.org/show_bug.cgi?id=121111 Reviewed by Andy Estes and Sam Weinig. Define iOS text autosizing to be enabled on iOS unless otherwise defined. * wtf/FeatureDefines.h: 2013-09-10 Anders Carlsson 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 More WTF/Alignment.h removal https://bugs.webkit.org/show_bug.cgi?id=121125 Reviewed by Andreas Kling. * wtf/Alignment.h: * wtf/Vector.h: (WTF::VectorBuffer::swap): (WTF::VectorBuffer::inlineBuffer): * wtf/text/ASCIIFastPath.h: (WTF::isAlignedTo): (WTF::isAlignedToMachineWord): 2013-09-10 Brent Fulgham Unreviewed build fix after r155476. * GNUmakefile.list.am: Remove reference to deleted OwnPtrWin.cpp file. * WTF.pro: Ditto. * wtf/CMakeLists.txt: Ditto. 2013-09-10 Brent Fulgham [Windows] Create SharedGDIObject Class Template https://bugs.webkit.org/show_bug.cgi?id=121037 Reviewed by Anders Carlsson. Now that the SharedGDIObject class exists we can get rid of the Windows-specific code in OwnPtr. * WTF.vcxproj/WTF.vcxproj: Remove OwnPtrWin.cpp. * WTF.vcxproj/WTF.vcxproj.filters: Ditto. * wtf/OwnPtrCommon.h: (WTF::deleteOwnedPtr): Remove Windows declarations that are no longer needed. * wtf/win/GDIObject.h: (WTF::GDIObject::get): Change to 'const' to match signature (and use cases) elsewhere in the code base for our smart pointer classes. * wtf/win/OwnPtrWin.cpp: Removed. 2013-09-10 Anders Carlsson Remove more uses of WTF::AlignedBuffer https://bugs.webkit.org/show_bug.cgi?id=121119 Reviewed by Andreas Kling. * wtf/HashTable.h: * wtf/SizeLimits.cpp: 2013-09-10 Anders Carlsson Clean up wtf/Noncopyable.h https://bugs.webkit.org/show_bug.cgi?id=121115 Reviewed by Darin Adler. Use std::aligned_storage instead of WTF::AlignedBuffer. * wtf/NeverDestroyed.h: (WTF::NeverDestroyed::NeverDestroyed): 2013-09-09 Brent Fulgham [Windows] Change from using OwnPtr to new GDIObject template. https://bugs.webkit.org/show_bug.cgi?id=120778 Reviewed by Anders Carlsson. * WTF.vcxproj/WTF.vcxproj: Add new GDIObject header file. * WTF.vcxproj/WTF.vcxproj.filters: Ditto. * WTF.vcxproj/copy-files.cmd: Copy new header file. * wtf/OwnPtrCommon.h: Remove some GDI specializations. * wtf/win/GDIObject.h: Added. (WTF::GDIObject::GDIObject): (WTF::GDIObject::~GDIObject): (WTF::GDIObject::get): (WTF::GDIObject::operator!): (WTF::GDIObject::operator UnspecifiedBoolType): (WTF::GDIObject::operator=): (WTF::GDIObject::swap): (WTF::::clear): (WTF::::leak): (WTF::::GDIObject): (WTF::=): (WTF::adoptGDIObject): (WTF::swap): (WTF::T): (WTF::HDC): * wtf/win/OwnPtrWin.cpp: (WTF::deleteOwnedPtr): Remove some GDI specializations. 2013-09-09 Anders Carlsson Introduce WTF::createOwned https://bugs.webkit.org/show_bug.cgi?id=121059 Reviewed by Andreas Kling. WTF::createOwned is a function template that does adoptPtr + new in a single function call, with all the arguments being perfectly forwarded thanks to C++11. Being forward-looking, createOwned returns an OwnPtr rather than a PassOwnPtr since the plan is to get rid of PassOwnPtr and just use std::move instead. * wtf/FilePrintStream.cpp: * wtf/FilePrintStream.h: * wtf/HashTable.h: * wtf/ListHashSet.h: * wtf/OwnPtr.h: (WTF::OwnPtr::OwnPtr): (WTF::createOwned): (WTF::createThread): (WTF::establishIdentifierForPthreadHandle): (WTF::createThreadInternal): (WTF::Collator::userDefault): (WTF::Collator::userDefault): 2013-09-09 Anders Carlsson Remove wtf/TypeTraits.h https://bugs.webkit.org/show_bug.cgi?id=121047 Reviewed by Darin Adler. * GNUmakefile.list.am: * WTF.pro: * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTF.vcxproj.filters: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/TypeTraits.cpp: Removed. * wtf/TypeTraits.h: Removed. * wtf/VectorTraits.h: 2013-09-09 Luciano Wolf Nix upstreaming - Adding stubs and Nix specific platform files https://bugs.webkit.org/show_bug.cgi?id=118358 Reviewed by Benjamin Poulain. Basically adding all files that have "Nix" in their names and are related to WebCore module. * wtf/nix/FeatureDefinesNix.h: Added. * wtf/nix/PlatformNix.h: Added. 2013-09-08 Anders Carlsson Begin moving off of TypeTraits.h https://bugs.webkit.org/show_bug.cgi?id=121006 Reviewed by Darin Adler. The C++11 has its own type traits implementation that is more complete and handles corner cases better since it ties into the compiler. Begin switching uses of WTF type traits to STL type traits. * wtf/CheckedArithmetic.h: * wtf/HashTraits.h: * wtf/NeverDestroyed.h: * wtf/OwnPtr.h: * wtf/PassOwnPtr.h: (WTF::adoptPtr): * wtf/RetainPtr.h: 2013-09-09 Julien Brianceau [Qt] Remove FastAllocBase.h from WTF.pro. https://bugs.webkit.org/show_bug.cgi?id=121024 Reviewed by Jocelyn Turcotte. * WTF.pro: Remove FastAllocBase.h as this file disappeared in r155251. 2013-09-08 Darin Adler Deprecate AdoptCF and AdoptNS (on all platforms except iOS for now) https://bugs.webkit.org/show_bug.cgi?id=121017 Reviewed by Andreas Kling. * wtf/RetainPtr.h: Use the preprocessor to rename AdoptCF and AdoptNS to DeprecatedAdoptCF and DeprecatedAdoptNS on all platforms except for iOS. Also removed an unneeded explicit conversion in the retainPtr function. Also re-sorted the using lines at the end of the file. 2013-09-08 Anders Carlsson Move WTF::notFound to Vector.h and delete NotFound.h https://bugs.webkit.org/show_bug.cgi?id=120990 Reviewed by Sam Weinig. * GNUmakefile.list.am: * WTF.pro: * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTF.vcxproj.filters: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/NotFound.h: Removed. * wtf/Vector.h: 2013-09-07 David Kilzer gtest fails to build due to integer type mismatch in WTF::insertIntoBoundedVector() Reviewed by Dan Bernstein. Fixes the following build failure: WebKitBuild/Debug/usr/local/include/wtf/StdLibExtras.h:266:23: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int' [-Werror,-Wshorten-64-to-32] for (unsigned i = size; i-- > index + 1;) ~ ^~~~ * wtf/StdLibExtras.h: (WTF::insertIntoBoundedVector): Use size_t instead of unsigned as for loop index variable. 2013-09-07 Anders Carlsson Remove NonCopyableSort.h from WTF https://bugs.webkit.org/show_bug.cgi?id=120984 Reviewed by Andreas Kling. std::sort as defined by C++11 moves elements when possible, so there's no need for nonCopyableSort anymore. * GNUmakefile.list.am: * WTF.pro: * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTF.vcxproj.filters: * WTF.xcodeproj/project.pbxproj: * wtf/NonCopyingSort.h: Removed. 2013-09-07 Anders Carlsson Get rid of PassOwnArrayPtr https://bugs.webkit.org/show_bug.cgi?id=120964 Reviewed by Andreas Kling. Make OwnArrayPtr a proper move-only type and get rid of PassOwnArrayPtr. Ultimately I'd like to get rid of OwnArrayPtr as well and just have it be a specialization of OwnPtr, but this is a step in the right direction. * GNUmakefile.list.am: * WTF.pro: * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTF.vcxproj.filters: * WTF.xcodeproj/project.pbxproj: * wtf/Assertions.cpp: * wtf/CMakeLists.txt: * wtf/DateMath.h: * wtf/FastBitVector.h: * wtf/Forward.h: * wtf/OwnArrayPtr.h: * wtf/PassOwnArrayPtr.h: Removed. 2013-09-07 Anders Carlsson VectorMover should use std::move https://bugs.webkit.org/show_bug.cgi?id=120959 Reviewed by Geoffrey Garen. This lets the compiler use move constructors when moving data, which can be a performance improvement. If the vector element type isn't movable it will be copied instead. * wtf/Vector.h: (WTF::VectorTypeOperations::move): (WTF::VectorTypeOperations::moveOverlapping): 2013-09-07 Anders Carlsson Get rid of FastAllocBase.h https://bugs.webkit.org/show_bug.cgi?id=120952 Reviewed by Antti Koivisto. FastAllocBase.h now only contains the WTF_MAKE_FAST_ALLOCATED macro. Move that macro to FastMalloc.h instead and remove FastAllocBase.h. * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTF.vcxproj.filters: * WTF.xcodeproj/project.pbxproj: * wtf/DeferrableRefCounted.h: * wtf/FastAllocBase.h: Removed. * wtf/FastMalloc.h: * wtf/HashSet.h: * wtf/MediaTime.h: * wtf/PrintStream.h: * wtf/RefCounted.h: * wtf/RefPtr.h: * wtf/ThreadingPrimitives.h: * wtf/Vector.h: * wtf/gobject/GMutexLocker.h: * wtf/unicode/Collator.h: 2013-09-06 Anders Carlsson Add a new smart pointer type for fastMalloc'ed memory https://bugs.webkit.org/show_bug.cgi?id=120911 Reviewed by Andreas Kling. Due to an oversight on my part, Vector::releaseBuffer() currently returns an OwnPtr which means that its data will be freed with operator delete instead of fastFree. Fix this by introducing a new MllocPtr smart pointer class and change Vector::releaseBuffer() to return it instead. * WTF.pro: * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTF.vcxproj.filters: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/FastAllocBase.h: * wtf/MallocPtr.h: Added. * wtf/Vector.h: * wtf/text/StringBuffer.h: * wtf/text/StringImpl.h: 2013-09-06 Andreas Kling Remove old workaround for Nokia's Harmattan GCC on Qt/ARM. Reviewed by Anders Carlsson. Apparently this was a workaround for GCC getting stuck in an infinite loop when building for ARM in a Nokia SDK over 2 years ago. I think it's safe to remove this now, but if I'm wrong, and you're reading this ChangeLog wondering why I did this to you, feel free to put it back in. * wtf/PassRefPtr.h: (WTF::refIfNotNull): (WTF::derefIfNotNull): 2013-09-06 Andreas Kling Remove unused RefPtr(PlacementNewAdopt) constructor. Reviewed by Anders Carlsson. * wtf/RefPtr.h: 2013-09-06 David Kilzer BUILD FIX (r155171): INSTALL_PATH_PREFIX should no longer be used beneath BUILT_PRODUCTS_DIR in HEADER_SEARCH_PATHS for iOS * Configurations/Base.xcconfig: (HEADER_SEARCH_PATHS): Change $(BUILT_PRODUCTS_DIR)/$(INSTALL_PATH_PREFIX)/usr/local/include to $(BUILT_PRODUCTS_DIR)/usr/local/include. 2013-09-06 Anders Carlsson Remove fastNew/fastDelete https://bugs.webkit.org/show_bug.cgi?id=120904 Reviewed by Andreas Kling. Remove the various variants of fastNew and fastDelete. * wtf/FastAllocBase.h: 2013-09-06 Alberto Garcia [GTK] GlibUtilities: getCurrentExecutablePath() does not compile on GNU/Hurd https://bugs.webkit.org/show_bug.cgi?id=120793 Reviewed by Gustavo Noronha Silva. Original patch by Svante Signell . PATH_MAX is not defined in GNU/Hurd, this patch adds a dummy implementation to make it compile. * wtf/gobject/GlibUtilities.cpp: (getCurrentExecutablePath): 2013-09-05 Dan Bernstein INSTALL_PATH_PREFIX is used even when not installing https://bugs.webkit.org/show_bug.cgi?id=120810 Reviewed by Andy Estes. * Configurations/CopyWTFHeaders.xcconfig: Removed INSTALL_PATH_PREFIX from the definition of PRIVATE_HEADERS_FOLDER_PATH. Also removed the leading slash, because the Xcode definition of this build setting is relative. * WTF.xcodeproj/project.pbxproj: Prepend INSTALL_PATH_PREFIX here when installing. 2013-09-05 Anders Carlsson Fix build with older versions of clang from Xcode. * wtf/Compiler.h: 2013-09-05 Anders Carlsson Make Vector::uncheckedAppend work with move-only types https://bugs.webkit.org/show_bug.cgi?id=120799 Reviewed by Andreas Kling. * wtf/Vector.h: (WTF::::uncheckedAppend): Use std::forward to invoke the move constructor when possible. 2013-09-05 Anders Carlsson Add COMPILER_SUPPORTS(CXX_AUTO_TYPE) and #error if it's 0 https://bugs.webkit.org/show_bug.cgi?id=120794 Reviewed by Andreas Kling. People have already begun using C++11 auto in WebCore, so let's make it a prerequisite. * wtf/Compiler.h: 2013-09-05 Anders Carlsson Clean up wtf/Compiler.h https://bugs.webkit.org/show_bug.cgi?id=120790 Reviewed by Andreas Kling. - Get rid of the CLANG_PRAGMA define, it's not used anywhere. - Remove a workaround for a bug in the version of clang that came with Xcode 4.2. - Replace WTF_COMPILER_SUPPORTS_CXX_FINAL_CONTROL with a compiler quirk for versions of clang that have a buggy final implementation and fix a bug in the macro where final would be disabled for versions of clang where __clang_minor__ is less than 2, regardless of the major version. - Fail if someone tries to compile the WebKit stack with a compiler that doesn't support rvalue references or static_assert. * wtf/Compiler.h: 2013-09-05 Anders Carlsson Change StringBuffer back to not use an OwnPtr in an attempt to fix ports. * wtf/text/StringBuffer.h: 2013-09-04 Anders Carlsson Vector::releaseBuffer should return an OwnPtr https://bugs.webkit.org/show_bug.cgi?id=120718 Reviewed by Andreas Kling. Change Vector::releaseBuffer() to return an OwnPtr. I intentionally chose to use an OwnPtr over a PassOwnPtr since we're trying to move away from PassOwnPtr objects. Fix fallout from this change by adopting OwnPtr/PassOwnPtr in StringBuffer and the two StringImpl constructors that adopt the passed in pointer. * wtf/Vector.h: * wtf/text/StringBuffer.h: * wtf/text/StringImpl.h: 2013-09-05 Mikhail Pozdnyakov Remove String(RefPtr) constructor https://bugs.webkit.org/show_bug.cgi?id=120767 Reviewed by Anders Carlsson. The String(RefPtr) constructor should be removed for the following reasons: - It almost does not have clients, so it is unneeded. - RefPtr should never be passed by value * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::shrinkToFit): * wtf/text/WTFString.h: 2013-09-05 Jaehun Lim Unreviewed. Fix build after r155083 Source/WTF/wtf/Vector.h:1210:48: error: ‘>>’ should be ‘> >’ within a nested template argument list * wtf/Vector.h: Add missing space. 2013-09-04 Mark Rowe Fix AutodrainedPool.h to compile without errors under ARC. Rubber-stamped by Anders Carlsson. * wtf/AutodrainedPool.h: Some versions of Clang complain about any use of NSAutoreleasePool under ARC. Change the type of the member variable to id to work around this. Since the implementation file is compiled under manual reference counting, everything will work fine. 2013-09-04 Anders Carlsson De-indent Vector.h. Rubber-stamped by Andreas Kling. I'm cleaning up Vector and making it work with move-only objects, and the namespace WTF indentation is driving me crazy. * wtf/Vector.h: 2013-09-03 Filip Pizlo CodeBlock memory cost reporting should be rationalized https://bugs.webkit.org/show_bug.cgi?id=120615 Reviewed by Darin Adler. * wtf/RefCountedArray.h: (WTF::RefCountedArray::refCount): 2013-09-03 Enrica Casucci Follow up to http://trac.webkit.org/changeset/155014 Reviewed by Alexey Proskuryakov. In the r155014 I renamed hasLineBreakingPropertyComplexContext to requiresComplexContextForWordBreaking but forgot to make the same change in UnicodeWchar.h. * wtf/unicode/wchar/UnicodeWchar.cpp: (WTF::Unicode::requiresComplexContextForWordBreaking): * wtf/unicode/wchar/UnicodeWchar.h: 2013-09-03 Enrica Casucci Can't select Katakana word by double-clicking. Reviewed by Alexey Proskuryakov and Ryosuke Niwa. For some languages, like Japanese we need to use more context for word breaking. I've renamed the function to better reflect its use and remove the unused hasLineBreakingPropertyComplexContextOrIdeographic. * wtf/unicode/icu/UnicodeIcu.h: (WTF::Unicode::requiresComplexContextForWordBreaking): 2013-09-03 Andreas Kling Support Vector>. Reviewed by Antti Koivisto. Add a Ref(const T&) constructor to enable Vector>. This looks a bit awkward but is necessary for Vector::append(const T&) to find a constructor. An alternative would be to add something like std::vector::emplace_back, but I can't think of a good name for that, and it'd be nice if append() would "just work." Also add operator->(). I initially excluded this because I felt it made for unsafe-looking code. Things quickly got out of hand with .get() everywhere though. IMO -> looks OK as long as it's only used on the first link in a dereference chain, as that variable and its type will be "in context." * wtf/Ref.h: (WTF::Ref::Ref): (WTF::Ref::~Ref): (WTF::Ref::operator->): (WTF::Ref::get): * wtf/VectorTraits.h: Add simple traits for Ref so it can be moved around freely by Vector. 2013-09-03 Mikhail Pozdnyakov Check WTF::VectorFiller template argument type size in compile time https://bugs.webkit.org/show_bug.cgi?id=120631 Reviewed by Darin Adler. The template argument's type size in WTF::VectorFiller 'memset' specialization should be checked during compilation rather than in runtime. * wtf/Vector.h: 2013-09-02 Darin Adler Cut down on double hashing and code needlessly using hash table iterators https://bugs.webkit.org/show_bug.cgi?id=120611 Reviewed by Andreas Kling. Double hashing is common in code that needs to combine a remove with some action to only be done if the code is removed. The only way to avoid it is to write code using find and a hash table iterator. To help with this, add a boolean return value to remove functions to indicate if anything was removed. Double hashing also happens in code that does a get followed by a remove. The take function is helpful in this case. To help with this, add a takeFirst funciton to ListHashSet. * wtf/HashCountedSet.h: (WTF::HashCountedSet::removeAll): Added a boolean return value, analogous to the one that the HashCountedSet::remove function already has. * wtf/HashMap.h: (WTF::HashMap::remove): Added a boolean return value, true if something was removed. * wtf/HashSet.h: (WTF::HashSet::remove): Ditto. * wtf/RefPtrHashMap.h: (WTF::RefPtrHashMap::remove): Ditto. * wtf/ListHashSet.h: (WTF::ListHashSet::takeFirst): Added. (WTF::ListHashSet::takeLast): Added. (WTF::ListHashSet::remove): Added a boolean return value, true if something was removed. * wtf/WTFThreadData.h: (JSC::IdentifierTable::remove): Use the new remove return value to get rid of most of the code in this function. 2013-09-02 David Kilzer Remove duplicate entries found by Xcode in WTF project Platform.h was duplicated in r111778 after being added in r111504. A dangling reference to Ref.h was added in r154962. * WTF.xcodeproj/project.pbxproj: Remove duplicate entries for Platform.h and Ref.h. 2013-09-02 Andreas Kling Actually add Ref.h 2013-09-02 Darin Adler [Mac] No need for HardAutorelease, which is same as CFBridgingRelease https://bugs.webkit.org/show_bug.cgi?id=120569 Reviewed by Andy Estes. * wtf/ObjcRuntimeExtras.h: Added a FIXME about miscapitalization of ObjC. Deleted HardAutorelease. (wtfObjcMsgSend): Dropped the use of abbreviations in local class and argument names. (wtfCallIMP): Ditto. 2013-09-01 Andreas Kling Ref: A smart pointer for the reference age. Reviewed by Antti Koivisto. Add a very simple simple Ref smart pointer class that is never null. It's initialized by passing a T& to the constructor and cannot be assigned to. operator-> is not overloaded, to prevent unsafe-looking code. The value is extracted by "T& get()", since C++ does not let you override operator.() * wtf/Ref.h: 2013-08-30 Oliver Hunt Make JSValue bool conversion less dangerous https://bugs.webkit.org/show_bug.cgi?id=120505 Reviewed by Darin Adler. Make LIKELY and UNLIKELY macros coerce to bool before passing to expect. * wtf/Compiler.h: 2013-08-30 Antti Koivisto Remove code behind ENABLE(DIALOG_ELEMENT) https://bugs.webkit.org/show_bug.cgi?id=120467 Reviewed by Darin Adler. * wtf/FeatureDefines.h: 2013-08-29 Sam Weinig Add ENABLE guards for Promises https://bugs.webkit.org/show_bug.cgi?id=120488 Reviewed by Andreas Kling. * wtf/FeatureDefines.h: 2013-08-28 Zan Dobersek [GTK] Add support for building JSC with FTL JIT enabled https://bugs.webkit.org/show_bug.cgi?id=120270 Reviewed by Filip Pizlo. * wtf/Platform.h: Define ENABLE_FTL_JIT to the value of 1 for the GTK port if building for the x86-64 architecture with LLVM present and the define not being previously defined. This is applicable when configuring the Automake build with '--enable-ftl-jit=auto'. 2013-08-27 Arunprasad Rajkumar Replace currentTime() with monotonicallyIncreasingTime() in WebCore https://bugs.webkit.org/show_bug.cgi?id=119958 Reviewed by Alexey Proskuryakov. WTF::currentTime() is prone to NTP and manual adjustments, so use WTF::monotonicallyIncreasingTime() to measure elapsed time. It is a continuation of r154201. * wtf/CurrentTime.h: Edited comment. 2013-08-27 Andre Moreira Magalhaes [gstreamer] Make sure gstreamer source element is thread-safe https://bugs.webkit.org/show_bug.cgi?id=115352 Reviewed by Philippe Normand. Add convenience class that simplifies locking and unlocking a GMutex. * GNUmakefile.list.am: * wtf/gobject/GMutexLocker.h: Added. (WebCore::GMutexLocker::GMutexLocker): (WebCore::GMutexLocker::~GMutexLocker): (WebCore::GMutexLocker::lock): (WebCore::GMutexLocker::unlock): (WebCore::GMutexLocker::mutex): 2013-08-26 Andy Estes Don't leak objects in HardAutorelease when OBJC_NO_GC is undefined but Objective-C GC is disabled at runtime. Reviewed by Darin Adler. * wtf/ObjcRuntimeExtras.h: (HardAutorelease): 2013-08-23 Andy Estes Fix issues found by the Clang Static Analyzer https://bugs.webkit.org/show_bug.cgi?id=120230 Reviewed by Darin Adler. * wtf/ObjcRuntimeExtras.h: (HardAutorelease): Added a canonical implementation of HardAutorelease. 2013-08-26 Zan Dobersek Undefine __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS before redefining them https://bugs.webkit.org/show_bug.cgi?id=120313 Reviewed by Darin Adler. * wtf/LLVMHeaders.h: Undefine the two macros before they are defined again. This way we avoid the compilation-time warnings about the macros being invalidly redefined. 2013-08-26 Oliver Hunt Building is so overrated. * wtf/Compression.cpp: (WTF::GenericCompressedData::decompress): 2013-08-26 Oliver Hunt Disable compression under MSVC for now as we're getting weird release-only failures. * wtf/Compression.cpp: 2013-08-24 Benjamin Poulain Save three bytes per CStringBuffer object https://bugs.webkit.org/show_bug.cgi?id=120040 Reviewed by Darin Adler. Merge https://chromium.googlesource.com/chromium/blink/+/894ae8eafdb64912aefd8f9c809f4ccda84f3b89 sizeof(CStringBuffer) was rounded up to 8 on account of struct size and alignment rules. This is clearly not what was intended. * wtf/text/CString.cpp: (WTF::CStringBuffer::createUninitialized): * wtf/text/CString.h: (WTF::CStringBuffer::data): (WTF::CStringBuffer::mutableData): 2013-08-24 Darin Adler RetainPtr lacks move constructor for case when argument is a RetainPtr of a different type https://bugs.webkit.org/show_bug.cgi?id=120255 Reviewed by Andreas Kling. * wtf/RetainPtr.h: Added missing move constructor, modeled on the other move constructor, and the one from RetPtr. 2013-08-24 Oliver Hunt Make the world build. * wtf/Compression.h: 2013-08-24 Oliver Hunt REGRESSION(r154498): Crashes on EFL, GTK, Qt on release configurations https://bugs.webkit.org/show_bug.cgi?id=120246 Reviewed by Antti Koivisto. Undestroy all the platforms that don't use the global new overload * wtf/Compression.h: 2013-08-21 Mark Rowe Make RetainPtr work with ARC. Have RetainPtr store the object its managing as a CFTypeRef and manage its lifetime with CFRetain / CFRelease. This is necessary to have explicit control over the lifetime of Objective-C objects when automatic reference counting is in use. Two helper methods are introduced to convert between the pointer type that the RetainPtr manages and the CFTypeRef that the pointer is stored as. For CF types and Objective-C types with ARC disabled, these methods are simply casts. For Objective-C types under ARC they need to use the special bridging casts to keep the compiler happy. Reviewed by Anders Carlsson. * wtf/RetainPtr.h: (WTF::RetainPtr::RetainPtr): Use the helper methods to convert to and from the storage types when necessary. (WTF::RetainPtr::~RetainPtr): Ditto. (WTF::RetainPtr::get): Ditto. (WTF::RetainPtr::operator->): Ditto. (WTF::RetainPtr::operator PtrType): Ditto. (WTF::::RetainPtr): Ditto. (WTF::::clear): Ditto. (WTF::::leakRef): Ditto. (WTF::=): Ditto. (WTF::RetainPtr::fromStorageTypeHelper): Use crazy template magic to determine whether to use a bridging cast or not depending on the desired return type. (WTF::RetainPtr::fromStorageType): (WTF::RetainPtr::toStorageType): Overloading is sufficient here. 2013-08-21 Mark Rowe Revert r153637. It didn't work with ARC like it said it would. We'll need to take a slightly different approach. Rubber-stamped by Anders Carlsson. * wtf/RetainPtr.h: (WTF::RetainPtr::RetainPtr): (WTF::RetainPtr::~RetainPtr): (WTF::RetainPtr::operator UnspecifiedBoolType): (WTF::::RetainPtr): (WTF::::clear): (WTF::=): (WTF::adoptCF): (WTF::adoptNS): 2013-08-23 Brent Fulgham [Windows] Unreviewed build correction after r154513. * WTF.vcxproj/build-generated-files.sh: Variable was missing '$' character. 2013-08-23 Darin Adler Cut down repeated code in RefPtr and RetainPtr by using copy/move-and-swap for assignment operators https://bugs.webkit.org/show_bug.cgi?id=120223 Reviewed by Anders Carlsson. * wtf/RefPtr.h: Switch to copy-and-swap in the assignment operators. The move ones already were done that way. * wtf/RetainPtr.h: Ditto, except for the move ones too. 2013-08-23 Oliver Hunt Add more validation logic to CompressibleVector https://bugs.webkit.org/show_bug.cgi?id=120227 Reviewed by Brent Fulgham. Add a pile of assertions to try on catch whatever is going wrong in the windows environment or other platforms. * wtf/Compression.cpp: (WTF::GenericCompressedData::create): (WTF::GenericCompressedData::decompress): * wtf/Compression.h: (WTF::CompressedVector::decompress): 2013-08-23 Alex Christensen Re-separating Win32 and Win64 builds. https://bugs.webkit.org/show_bug.cgi?id=120178 Reviewed by Brent Fulgham. * WTF.vcxproj/WTFGenerated.make: Pass PlatformArchitecture as a command line parameter to bash scripts. * WTF.vcxproj/build-generated-files.sh: Use PlatformArchitecture from command line to determine which object directory to use (obj32 or obj64). 2013-08-22 Filip Pizlo build-jsc --ftl-jit should work https://bugs.webkit.org/show_bug.cgi?id=120194 Reviewed by Oliver Hunt. * wtf/LLVMHeaders.h: I don't know what went wrong here. If HAVE(LLVM), then we need those headers! 2013-08-23 Brent Fulgham [Windows] Unreviewed build correction after r154498. * WTF.vcxproj/WTF.vcxproj.filters: Adjust files so they show up in the proper folders. * WTF.vcxproj/WTFCommon.props: Add search path for zlib header and include link directive. 2013-08-23 Oliver Hunt Attempt to appease windows bot. * wtf/Compression.h: 2013-08-23 Oliver Hunt Re-sort xcode project file * WTF.xcodeproj/project.pbxproj: 2013-08-23 Oliver Hunt Support in memory compression of rarely used data https://bugs.webkit.org/show_bug.cgi?id=120143 Reviewed by Gavin Barraclough. Adds a set of utility functions to wrap the use of zlib over a generic type or a Vector<> as well as adding CompressibleVector that wraps either a Vector<> or compressed data. * GNUmakefile.list.am: * WTF.pro: * WTF.vcxproj/WTF.vcxproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CheckedArithmetic.h: * wtf/Compression.cpp: Added. (WTF::zAlloc): (WTF::zFree): (WTF::GenericCompressedData::create): (WTF::GenericCompressedData::decompress): * wtf/Compression.h: Added. (WTF::GenericCompressedData::compressedSize): (WTF::GenericCompressedData::originalSize): (WTF::GenericCompressedData::GenericCompressedData): (WTF::CompressedVector::create): (WTF::CompressedVector::decompress): (WTF::CompressedVector::size): (WTF::CompressibleVector::CompressibleVector): (WTF::CompressibleVector::shrinkToFit): (WTF::CompressibleVector::size): (WTF::CompressibleVector::operator[]): (WTF::CompressibleVector::at): (WTF::CompressibleVector::begin): (WTF::CompressibleVector::end): (WTF::CompressibleVector::data): (WTF::CompressibleVector::decompressIfNecessary): 2013-08-21 Commit Queue Unreviewed, rolling out r154416. http://trac.webkit.org/changeset/154416 https://bugs.webkit.org/show_bug.cgi?id=120147 Broke Windows builds (Requested by rniwa on #webkit). * WTF.vcxproj/WTFGenerated.make: * WTF.vcxproj/build-generated-files.sh: 2013-08-21 Alex Christensen Separating Win32 and Win64 builds. Reviewed by Brent Fulgham. * WTF.vcxproj/WTFGenerated.make: Pass PlatformArchitecture as a command line parameter to bash scripts. * WTF.vcxproj/build-generated-files.sh: Use PlatformArchitecture from command line to determine which object directory to use (obj32 or obj64). 2013-08-21 Allan Sandfeld Jensen Disable maybe-uninitialized warning in GCC 4.8 https://bugs.webkit.org/show_bug.cgi?id=119835 Reviewed by Anders Carlsson. Disable the maybe-uninitialized warning. * wtf/Compiler.h: 2013-08-20 Alex Christensen Use PlatformArchitecture to distinguish between 32-bit and 64-bit builds on Windows. https://bugs.webkit.org/show_bug.cgi?id=119512 Reviewed by Brent Fulgham. * WTF.vcxproj/WTFGeneratedCommon.props: Replaced obj32, bin32, and lib32 with macros for 64-bit build. 2013-08-20 Víctor Manuel Jáquez Leal [GTK][ARM] enable DFG_JIT Reviewed by Martin Robinson. Enable DFG_JIT in GTK+ platform for ARM/Thumb architecture * wtf/Platform.h: 2013-08-19 Ryosuke Niwa Delete code for Snow Leopard Reviewed by Benjamin Poulain. * wtf/FastMalloc.cpp: (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary): * wtf/FeatureDefines.h: * wtf/Platform.h: 2013-08-19 Joseph Pecoraro [iOS] Upstream Source/WTF Xcode project for iOS Reviewed by David Kilzer. Include iOS only WebCoreThread.* files in an ios group, and clean up the included files a bit. * WTF.xcodeproj/project.pbxproj: * wtf/ios/WebCoreThread.cpp: * wtf/ios/WebCoreThread.h: 2013-08-19 Joseph Pecoraro [iOS] Upstream Source/WTF Reviewed by Benjamin Poulain. Upstream iOS WebKit Source/WTF. * Configurations/Base.xcconfig: JavaScriptCore.framework is a public framework. * wtf/Assertions.h: Define an export macro for iOS projects just including . * wtf/Platform.h: * wtf/FeatureDefines.h: iOS ENABLE and USE defines. * wtf/MainThread.h: * wtf/mac/MainThreadMac.mm: (WTF::initializeApplicationUIThreadIdentifier): (WTF::initializeWebThreadIdentifier): (WTF::canAccessThreadLocalDataForThread): * wtf/WeakPtr.h: (WTF::WeakReference::get): (WTF::WeakReference::clear): Shared WebThread and MainThread access to thread local data. * wtf/WTFThreadData.cpp: (WTF::WTFThreadData::WTFThreadData): Shared WebThread and MainThread identifier tables. * wtf/ThreadSpecific.h: (WTF::::replace): Used later on so that WebThread can share the MainThread's thread global data. * wtf/text/StringStatics.cpp: (WTF::AtomicString::init): When USE(WEB_THREAD) assert AtomicString::init is initialized on the realMainThread. * wtf/unicode/CharacterNames.h: * wtf/unicode/icu/UnicodeIcu.h: (WTF::Unicode::hasLineBreakingPropertyComplexContextOrIdeographic): Minor iOS constants and functions used later by WebCore. 2013-08-16 Arunprasad Rajkumar Replace currentTime() with monotonicallyIncreasingTime() in WebCore Reviewed by Alexey Proskuryakov. WTF::currentTime() is prone to DST changes and NTP adjustments, so use WTF::monotonicallyIncreasingTime() to measure elapsed time. * wtf/CurrentTime.h: (WTF::monotonicallyIncreasingTimeMS): Added mille second version of monotonic time API. 2013-08-15 Filip Pizlo refCount() of a StringImpl could be zero if it's static; in that case we shouldn't report extra memory cost https://bugs.webkit.org/show_bug.cgi?id=119870 Reviewed by Mark Hahnenberg. * wtf/text/StringImpl.h: (WTF::StringImpl::costDuringGC): (WTF::StringImpl::isStatic): (WTF::StringImpl::bufferOwnership): 2013-08-14 Filip Pizlo Typed arrays should be rewritten https://bugs.webkit.org/show_bug.cgi?id=119064 Reviewed by Oliver Hunt. - Added the notion of a reference counted object that can be marked Deferred, which is like a special-purpose upref. - Added a common byte flipper. Automake work courtesy of Zan Dobersek . * GNUmakefile.list.am: * WTF.xcodeproj/project.pbxproj: * wtf/DeferrableRefCounted.h: Added. (WTF::DeferrableRefCountedBase::ref): (WTF::DeferrableRefCountedBase::hasOneRef): (WTF::DeferrableRefCountedBase::refCount): (WTF::DeferrableRefCountedBase::isDeferred): (WTF::DeferrableRefCountedBase::DeferrableRefCountedBase): (WTF::DeferrableRefCountedBase::~DeferrableRefCountedBase): (WTF::DeferrableRefCountedBase::derefBase): (WTF::DeferrableRefCountedBase::setIsDeferredBase): (WTF::DeferrableRefCounted::deref): (WTF::DeferrableRefCounted::setIsDeferred): (WTF::DeferrableRefCounted::DeferrableRefCounted): (WTF::DeferrableRefCounted::~DeferrableRefCounted): * wtf/FlipBytes.h: Added. (WTF::needToFlipBytesIfLittleEndian): (WTF::flipBytes): (WTF::flipBytesIfLittleEndian): 2013-08-14 Julien Brianceau DFG_JIT implementation for sh4 architecture. https://bugs.webkit.org/show_bug.cgi?id=119737 Reviewed by Oliver Hunt. * wtf/Platform.h: 2013-08-13 Arunprasad Rajkumar [WTF] [JSC] Replace currentTime() with monotonicallyIncreasingTime() in all possible places https://bugs.webkit.org/show_bug.cgi?id=119762 Reviewed by Geoffrey Garen. * wtf/MainThread.cpp: (WTF::dispatchFunctionsFromMainThread): 2013-08-12 Ragner Magalhaes Broken build with build-webkit --no-webgl https://bugs.webkit.org/show_bug.cgi?id=119272 Reviewed by Alexandru Chiculita. CSS_SHADERS requires WEBGL enabled. Add error message to dependency failure. * wtf/FeatureDefines.h: 2013-08-12 Joseph Pecoraro [iOS] isMainThread implementation with USE(WEB_THREAD) https://bugs.webkit.org/show_bug.cgi?id=119644 Reviewed by Benjamin Poulain. On iOS isMainThread() means that the current thread is either the MainThread or WebThread and the current thread has the WebThreadLock. * wtf/ios/WebCoreThread.cpp: Added. * wtf/ios/WebCoreThread.h: Added. * wtf/mac/MainThreadMac.mm: (WTF::isMainThread): 2013-08-11 Carlos Garcia Campos Unreviewed. Fix make distcheck. * GNUmakefile.list.am: Add missing header file. 2013-08-09 Christophe Dumez Make atob() throw an InvalidCharacterError on excess padding characters https://bugs.webkit.org/show_bug.cgi?id=118898 Reviewed by Darin Adler. Add a Base64FailOnInvalidCharacterOrExcessPadding value to the Base64DecodePolicy enumeration so that the caller can request strict padding validation in addition to strict character validation. This is needed so that we can use WTF::base64Decode() for window.atob(). * wtf/text/Base64.cpp: (WTF::base64DecodeInternal): * wtf/text/Base64.h: 2013-08-07 Alex Christensen Fixed wrong definition for AppleWin port's WebGL after r153768. Rubberstamped by Benjamin Poulain. * wtf/Platform.h: Replaced WTF_USE_SURFACE with WTF_USE_GRAPHICS_SURFACE. 2013-08-04 Sam Weinig Remove support for HTML5 MicroData https://bugs.webkit.org/show_bug.cgi?id=119480 Reviewed by Anders Carlsson. * wtf/FeatureDefines.h: 2013-08-06 Alex Christensen Enabled WebGL on WinCairo port. https://bugs.webkit.org/show_bug.cgi?id=119502 Reviewed by Benjamin Poulain. * wtf/FeatureDefines.h: Enabled WebGL. * wtf/Platform.h: Added definitions required for WebGL on Windows. 2013-08-05 Mark Rowe FastMalloc should support MallocStackLogging Call the malloc stack logging function from within the various entry points to FastMalloc when stack logging is enabled. Reviewed by Oliver Hunt and Geoff Garen. * wtf/FastMalloc.cpp: Call in to MallocHook::InvokeNewHook / MallocHook::InvokeDeleteHook at the appropriate entry points to FastMalloc. The naming comes from TCMalloc's existing, unused concept of malloc hooks. (WTF::MallocHook::record): Call the stack logging function with appropriate argument types. (WTF::MallocHook::recordAllocation): Out-of-line slow path for when stack logging is enabled that calls record with the values in the right arguments. (WTF::MallocHook::recordDeallocation): Ditto. (WTF::MallocHook::init): Stack logging is enabled if the system allocator has enabled stack logging. (WTF::MallocHook::InvokeNewHook): Call recordAllocation in the unlikely event that stack logging is enabled. (WTF::MallocHook::InvokeDeleteHook): Ditto for recordDeallocation. (WTF::TCMalloc_ThreadCache::InitModule): Initialize the malloc hook. 2013-08-06 Brent Fulgham [Windows] Unreviewed build correction after r153754 and r153757. * wtf/MathExtras.h: (remainder): Provide implementation of C99 remainder for VS2010 (and earlier). 2013-07-23 David Farler Provide optional OTHER_CFLAGS, OTHER_CPPFLAGS, OTHER_LDFLAGS additions for building with ASAN https://bugs.webkit.org/show_bug.cgi?id=117762 Reviewed by Mark Rowe. * Configurations/DebugRelease.xcconfig: Add ASAN_OTHER_CFLAGS, CPLUSPLUSFLAGS. 2013-08-05 Mark Rowe Build fix for Qt Windows. * wtf/Assertions.cpp: Include StringExtras.h rather than StdLibExtras.h, since the former is where strncasecmp is declared. 2013-07-26 Mark Rowe Logging should be configurable using human-readable channel names rather than crazy bitmasks Implement shared logic for initializing logging channels based on human-readable channel names in WTF, and rework the WebCore, WebKit and WebKit2 logging initialization on top of it. Logging channels may now be enabled by providing a comma-separated list of channel names, with the special "all" name enabling all channels. Channel names prefixed with a leading "-" will result in the named channel being disabled. For instance, specifying "all,-history,-loading" will result in all logging channels except for history and loading being enabled. For OS X developers, this also changes the name of the user defaults used to enable logging. This is done to allow the old user defaults to remain set for those people that need to switch between version of WebKit before and after this change. Where the old user default keys were WebCoreLogLevel, WebKitLogLevel and WebKit2LogLevel, the new user default keys are WebCoreLogging, WebKitLogging and WebKit2Logging. For GTK developers, this changes the separator used in the WEBKIT_DEBUG environment variable to a comma for consistency with the other platforms and to enable more code sharing. While doing this work I've also taken the opportunity to eliminate the need to touch multiple files when adding a new logging channel. Now only the header in the relevant project needs to be updated. Reviewed by Sam Weinig. * wtf/Assertions.cpp: (WTFLogChannelByName): Iterate over the provided array of log channels, returning the first whose name matches case-insensitively. (setStateOfAllChannels): Helper function to set the state of all channels to a single value. (WTFInitializeLogChannelStatesFromString): Parse a string containing a case-insensitive, comma-separated list of channel names to enable or disable, with the latter being prefixed by a "-". * wtf/Assertions.h: Update the layout of WTFLogChannel to include only the state of the channel and its name. Declare WTFLogChannelByName and WTFInitializeLogChannelStatesFromString. * wtf/RefCountedLeakCounter.cpp: Update to the new format of WTFLogChannel. 2013-08-05 Benjamin Poulain Disable by default on iOS, it is enabled through the xconfig files https://bugs.webkit.org/show_bug.cgi?id=119503 Reviewed by Alexey Proskuryakov. * wtf/FeatureDefines.h: 2013-08-05 Oliver Hunt Move TypedArray implementation into JSC https://bugs.webkit.org/show_bug.cgi?id=119489 Reviewed by Filip Pizlo. Remove TypedArray implementation from WTF * GNUmakefile.list.am: * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: 2013-08-02 Benjamin Poulain Remove a bunch of redundant checks for empty string in StringImpl https://bugs.webkit.org/show_bug.cgi?id=118768 Reviewed by Ryosuke Niwa. The first thing done by createUninitialized() is check if the length passed is zero. Internally, there are many cases for which we know the check will never succeed. Clang is usually really smart for those kind of things, but there are a few cases where the condition to avoid returning empty() is not simply a check for the length. This patch adds an internal initializer to deal with that. * wtf/text/StringImpl.cpp: (WTF::StringImpl::createUninitializedInternal): (WTF::StringImpl::createUninitializedInternalNonEmpty): (WTF::StringImpl::createInternal): Create internal has a special case for null pointer for the characters. The test also check length, the second check for length cannot fail. (WTF::StringImpl::create8BitIfPossible): ditto. (WTF::StringImpl::lower): 3 of the calls cannot be reached for empty length. On an empty length, the test for (noUpper && !(ored & ~0x7F)) would have caused the function to return "this". For the last createUninitialized(), there is no guarantee the realLength is not zero. (WTF::StringImpl::replace): The first thing we do in replace(UChar,UChar) is check if there is anything to replace. The check for length will never succeed as there must be a character to replace at that point. * wtf/text/StringImpl.h: 2013-08-02 Mark Lam Gardening: Touched a line in Platform.h to get all bots to do a clean build. Not reviewed. * wtf/Platform.h: 2013-08-02 Mikhail Pozdnyakov Check WTF::Vector size with '0' inline capacity https://bugs.webkit.org/show_bug.cgi?id=119397 Reviewed by Andreas Kling. Putting in place the compile assertion that had been removed with r153514. * wtf/SizeLimits.cpp: 2013-07-26 Mark Rowe RetainPtr should support ARC for Objective-C objects. While RetainPtr is not necessary under ARC, having it available makes it easier to transition existing code from manual retain / release to ARC. Under ARC, the object member of RetainPtr is treated as a strong reference by the compiler. This means that merely assigning to the member variable is sufficient to retain the object, and clearing the member variable is sufficient to release it. We still need to explicitly CFRetain / CFRelease CoreFoundation types so the explicit calls to these functions are moved in to helper functions and overloading is used to have the Objective-C object versions of them be no-ops under ARC. Reviewed by Anders Carlsson. * wtf/RetainPtr.h: (WTF::retain): Continue to always CFRetain / CFRelease CoreFoundation objects. Only CFRetain / CFRelease Objective-C objects when using manual retain / release. (WTF::release): Ditto. (WTF::adoptNSReference): Adopting references will be handled automatically by the compiler when possible under ARC by eliminating redundant retain / release pairs. (WTF::RetainPtr::ImplicitConversionToBoolIsNotAllowed): A new method that exists only to be used by the conversion to the unspecified bool type. (WTF::RetainPtr::operator UnspecifiedBoolType): Switch to using a pointer to a member function as the unspecified bool type to avoid warnings from the compiler when casting Objective-C object types under ARC. (WTF::RetainPtr::RetainPtr): Switch to our retain / release helper functions. (WTF::RetainPtr::~RetainPtr): Ditto. (WTF::::RetainPtr): Ditto. (WTF::::clear): Ditto. (WTF::=): Ditto. (WTF::adoptCF): Annotate the argument with CF_RELEASES_ARGUMENT on both the declaration and the definition. (WTF::adoptNS): Ditto for NS_RELEASES_ARGUMENT. 2013-08-01 Mark Rowe FastMalloc zone enumerator responding to MALLOC_PTR_REGION_RANGE_TYPE with individual allocations Teach PageMapMemoryUsageRecorder::recordPendingRegions to only record data of the type that it's asked for. This also fixes the vmmap output to associate some regions with the FastMalloc malloc zone that were previously associated with it only via the VM tag, meaning they were incorrectly being omitted from the malloc statistics section of the report. Reviewed by Dan Bernstein. * wtf/FastMalloc.cpp: (WTF::PageMapMemoryUsageRecorder::recordPendingRegions): Report the individual allocations only when requested. Add the ability to report the regions containing pointers separately from the allocations. 2013-08-01 Mark Rowe False-positive leaks from FastMalloc. A logic error in the page map enumeration code within FastMalloc could result in a subset of the memory regions owned by FastMalloc being skipped by the malloc zone enumeration code used by leaks and other performance tools. If the only reference to an allocated object lived within one of the skipped memory regions, leaks would believe it had been leaked since it would not find any references to the object. The logic error manifested when a FastMalloc span owned a region of memory that crossed a 16MB address space boundary, and when there was one or more other spans immediately after it in the address space. Crossing the 16MB address space boundary means that the start and end points of the span are in different leaf nodes of the page map trie, and the code within the page map's visitValues method didn't correctly account this case when skipping to the end of the span after visiting it. It would resume iterating from the start of the next leaf node rather than continuing to skip values until the end of the span was passed. The value representing the end of the span would then be processed as if it were the start of a new span, and more values would be skipped even though they may contain actual spans. The solution is to rework the algorithm used in visitValues so that it will skip the correct number of values even when some of the values are in different leaf nodes. This is a more involved change than it may seem since it's also necessary to deal with the case where a memory region spans two separate root nodes, which can happen if the region happens to cross a 64GB boundary in the address space. Reviewed by Geoff Garen. * wtf/TCPageMap.h: (TCMalloc_PageMap3::visitValues): Use a single loop to iterate, with the loop index being the key in to the page map in the same form as used by get and set. This allows us to correctly deal with the index being skipped to a different intermediate or root node as a result of visiting a span that crosses a 16MB boundary in memory. (TCMalloc_PageMap2::visitValues): Ditto, but without having to deal with intermediate nodes. 2013-08-01 Ruth Fong [Forms: color] popover color well implementation and https://bugs.webkit.org/show_bug.cgi?id=119356 Reviewed by Benjamin Poulain. * wtf/FeatureDefines.h: Added and enabled INPUT_TYPE_COLOR_POPOVER. 2013-08-01 Simon Fraser REGRESSION(r145592): AutodrainedPool.h. RunLoopTimer.h, SchedulePair.h are being copied into the wrong location https://bugs.webkit.org/show_bug.cgi?id=112833 Reviewed by Sam Weinig. AutodrainedPool.h and SchedulePair.h should just be project headers, not private headers, so they get copied into /usr/local/include/wtf not /usr/local/include * WTF.xcodeproj/project.pbxproj: 2013-07-31 Ruth Fong Mac UI behaviour and https://bugs.webkit.org/show_bug.cgi?id=61276 Reviewed by Brady Eidson. * wtf/FeatureDefines.h: Enabled INPUT_TYPE_COLOR on Mac port. 2013-07-31 Andreas Kling Shrink Vectors with inline capacity. Reviewed by Anders Carlsson. Pack Vector::m_size next to VectorBufferBase::m_capacity so there's no space wasted on padding when sizeof(T) >= 8. Since m_size is not conceptually part of the buffer, I just using'ed it into Vector. * wtf/SizeLimits.cpp: * wtf/Vector.h: (WTF::VectorBufferBase::VectorBufferBase): (WTF::VectorBuffer::VectorBuffer): (WTF::Vector::Vector): (WTF::::Vector): 2013-07-30 Patrick Gansterer Move WindowsExtras.h from WebCore to WTF https://bugs.webkit.org/show_bug.cgi?id=118125 Reviewed by Anders Carlsson. Move it to WTF to be able to use the functions in WTF too. * wtf/WindowsExtras.h: Renamed from Source/WebCore/platform/win/WindowsExtras.h. (WTF::getRegistryValue): (WTF::getWindowPointer): (WTF::setWindowPointer): * wtf/win/MainThreadWin.cpp: (WTF::initializeMainThreadPlatform): 2013-07-29 Carlos Garcia Campos Unreviewed. Fix make distcheck. * GNUmakefile.list.am: Add missing files to compilation. 2013-07-29 Mark Rowe Tons of FastMalloc leaks reported by leaks of objects that have already been deallocated Reviewed by Sam Weinig. * wtf/FastMalloc.cpp: (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Mark objects in the transfer cache as being free. 2013-07-29 Zan Dobersek Reintroduce convenience CheckedInt*, CheckedUint* types https://bugs.webkit.org/show_bug.cgi?id=119213 Reviewed by Oliver Hunt. Reintroduce CheckedInt* and CheckedUint* types that were previously provided for convenience through the CheckedInt header that was removed in r153095. The types are now based on the Checked class, using the RecordOverflow class as the overflow handler. * wtf/CheckedArithmetic.h: 2013-07-27 Ryosuke Niwa REGRESSION(r153380): Can't open messages on Gmail https://bugs.webkit.org/show_bug.cgi?id=119165 Reviewed by Andreas Kling. This bug was caused by r153380. The bug doesn't reproduce as long as WebKit is built by clang 4.2 and later or final is disabled (it could be clang 4.1 and later but we don't have information about that). Fix the bug by disabling final on earlier versions of clang. Unfortunately we can only check versions of Apple clang since __clang_major__ and __clang_minor__ are vendor dependent. * wtf/Compiler.h: 2013-07-26 Oliver Hunt ASSERT failure in wtf/CheckedBoolean.h line 43 on Windows https://bugs.webkit.org/show_bug.cgi?id=119170 Reviewed by Michael Saboff. Added a copy constructor to CheckedBoolean. * wtf/CheckedBoolean.h: (CheckedBoolean::CheckedBoolean): 2013-07-25 Brent Fulgham [Windows] Unreviewed build fix. * WTF.vcxproj/WTF.vcxproj: Add missing SixCharacterHash.h,.cpp files. * WTF.vcxproj/WTF.vcxproj.filters: Ditto. * wtf/NumberOfCores.h: Add export macro to numberOfProcessorCores. * wtf/PrintStream.h: Add export macro to dumpCharacter. * wtf/SixCharacterHash.h: Add export macro to sixCharacterHashStringToInteger and integerToSixCharacterHashString. * wtf/text/CString.h: Add export macro to hash and equal methods. (WTF::CStringHash::hash): Add export macro. 2013-07-25 peavo@outlook.com [Windows] Provide ASM implemenation of 8-bit compare-and-swap https://bugs.webkit.org/show_bug.cgi?id=119084 Reviewed by Brent Fulgham. * wtf/Atomics.h: (WTF::weakCompareAndSwap): Add a 32-bit X86 Assembly path for Windows build. 2013-07-25 Brent Fulgham [Windows] Unreviewed build fix. * WTF.vcxproj/WTF.vcxproj: Add missing CompilationThread.h,.cpp * WTF.vcxproj/WTF.vcxproj.filters: Ditto. 2013-07-25 Michael Brüning Fix Windows build after r153134. https://bugs.webkit.org/show_bug.cgi?id=119090 Reviewed by Oliver Hunt. Add USE(PTHREADS) guards around pthread specific code for now. This will cause isCompilationThread to always return false on non pthread platforms such as Windows. We might be able to use the Windows one-time initialization for this, but this is only available from Windows Vista on. * wtf/CompilationThread.cpp: (WTF::initializeCompilationThreads): 2013-07-25 Allan Sandfeld Jensen Fix windows build after FTL upstream Unreviewed build fix. * wtf/Atomics.h: (WTF::weakCompareAndSwap): 2013-07-25 Ryuan Choi Unreviewed, build fix on the EFL port. * wtf/CMakeLists.txt: Added SixCharacterHash.cpp 2013-07-25 Gabor Rapcsanyi Unreviewed, build fix on the Qt port. * WTF.pro: Add additional build files for the FTL. 2013-07-25 Zan Dobersek Unreviewed, further GTK build fixing. * GNUmakefile.am: Make libWTF.la depend on any changes made to the build targets list. * GNUmakefile.list.am: Add SixCharacterHash source files to the build. 2013-07-25 Csaba Osztrogonác [GTK] Similar fix to r153304. * GNUmakefile.list.am: 2013-07-25 Grzegorz Czajkowski Build break in debug after r153134: StringImpl.h:640: undefined reference to `WTF::isCompilationThread() https://bugs.webkit.org/show_bug.cgi?id=119077 Reviewed by Christophe Dumez. * wtf/CMakeLists.txt: Added CompilationThread.{h/cpp}. 2013-07-24 Filip Pizlo fourthTier: DFG IR dumps should be easier to read https://bugs.webkit.org/show_bug.cgi?id=119050 Reviewed by Mark Hahnenberg. Added support for dumping values within a context. By default, if you say print(inContext(value, context)) it calls value.dumpInContext(out, context) instead of value.dump(out). Hoisted the support for six-character hashes out of JSC::CodeBlockHash into WTF, in the form of SixCharacterHash.h. Added a helper for creating dump contexts where the inContext() dump will just use a short string hash to "name" the object being dumped, and then will print out the full dumps in an endnote to your dump. Added support for using CString as a hashtable key. * WTF.xcodeproj/project.pbxproj: * wtf/PrintStream.h: (WTF): (ValueInContext): (WTF::ValueInContext::ValueInContext): (WTF::ValueInContext::dump): (WTF::inContext): * wtf/SixCharacterHash.cpp: Added. (WTF): (WTF::sixCharacterHashStringToInteger): (WTF::integerToSixCharacterHashString): * wtf/SixCharacterHash.h: Added. (WTF): * wtf/StringHashDumpContext.h: Added. (WTF): (StringHashDumpContext): (WTF::StringHashDumpContext::StringHashDumpContext): (WTF::StringHashDumpContext::getID): (WTF::StringHashDumpContext::dumpBrief): (WTF::StringHashDumpContext::brief): (WTF::StringHashDumpContext::isEmpty): (WTF::StringHashDumpContext::dump): * wtf/text/CString.cpp: (WTF::CString::hash): (WTF): (WTF::operator<): (WTF::CStringHash::equal): * wtf/text/CString.h: (WTF::CString::CString): (CString): (WTF::CString::isHashTableDeletedValue): (WTF): (WTF::CStringHash::hash): (CStringHash): 2013-07-21 Filip Pizlo fourthTier: DFG Nodes should be able to abstractly tell you what they read and what they write https://bugs.webkit.org/show_bug.cgi?id=118910 Reviewed by Sam Weinig. Fix compile goof in sortedListDump(). * wtf/ListDump.h: (WTF::sortedListDump): 2013-07-16 Filip Pizlo fourthTier: NaturalLoops should be able to quickly answer questions like "what loops own this basic block" https://bugs.webkit.org/show_bug.cgi?id=118750 Reviewed by Mark Hahnenberg. Add a utility function for inserting an element into a vector that has bounded size, and where the insertion causes things to drop off the end. * wtf/StdLibExtras.h: (WTF): (WTF::insertIntoBoundedVector): 2013-07-12 Filip Pizlo fourthTier: DFG should have an SSA form for use by FTL https://bugs.webkit.org/show_bug.cgi?id=118338 Reviewed by Mark Hahnenberg. - Extend variadicity of PrintStream and dataLog. - Give HashSet the ability to add a span of things. - Give HashSet the ability to == another HashSet. - Note FIXME's in HashTable concerning copying performance, that affects the way that the DFG now uses HashSets and HashMaps. - Factor out the bulk-insertion logic of JSC::DFG::InsertionSet into WTF::Insertion, so that it can be used in more places. - Create a dumper for lists and maps. * WTF.xcodeproj/project.pbxproj: * wtf/DataLog.h: (WTF): (WTF::dataLog): * wtf/HashSet.h: (HashSet): (WTF): (WTF::::add): (WTF::=): * wtf/HashTable.h: (WTF::::HashTable): (WTF::=): * wtf/Insertion.h: Added. (WTF): (Insertion): (WTF::Insertion::Insertion): (WTF::Insertion::index): (WTF::Insertion::element): (WTF::Insertion::operator<): (WTF::executeInsertions): * wtf/ListDump.h: Added. (WTF): (ListDump): (WTF::ListDump::ListDump): (WTF::ListDump::dump): (MapDump): (WTF::MapDump::MapDump): (WTF::MapDump::dump): (WTF::listDump): (WTF::sortedListDump): (WTF::lessThan): (WTF::mapDump): (WTF::sortedMapDump): * wtf/PrintStream.h: (PrintStream): (WTF::PrintStream::print): 2013-07-02 Filip Pizlo Unreviewed, fix 32-bit build. * wtf/Platform.h: 2013-07-02 Filip Pizlo fourthTier: FTL should use the equivalent of llvm opt -O2 by default https://bugs.webkit.org/show_bug.cgi?id=118311 Reviewed by Mark Hahnenberg. * wtf/LLVMHeaders.h: 2013-06-27 Filip Pizlo fourthTier: JSC's disassembly infrastructure should be able to disassemble the code that LLVM generates https://bugs.webkit.org/show_bug.cgi?id=118148 Reviewed by Anders Carlsson. We now use LLVM for two things: disassembler and FTL. Separate out the question of whether we have LLVM (HAVE(LLVM)) from whether we want to use the LLVM disassembler (USE(LLVM_DISASSEMBLER)) and whether we enable the FTL (ENABLE(FTL_JIT)). Also move the cruft for including LLVM headers into WTF since now we use it in a bunch of places, not all related to FTL. There's no obvious place to put that file in JSC so I put it in WTF. * WTF.xcodeproj/project.pbxproj: * wtf/LLVMHeaders.h: Copied from Source/JavaScriptCore/ftl/FTLLLVMHeaders.h. * wtf/Platform.h: 2013-06-25 Filip Pizlo fourthTier: DFG should support switch_string https://bugs.webkit.org/show_bug.cgi?id=117967 Reviewed by Sam Weinig. Make it possible to compare a RefPtr and a StringImpl* without having to ref the StringImpl. * wtf/text/StringHash.h: (WTF::StringHash::equal): 2013-06-24 Filip Pizlo fourthTier: Count external memory usage towards heap footprint https://bugs.webkit.org/show_bug.cgi?id=117948 Reviewed by Geoffrey Garen. Expose some functionality needed for properly measuring StringImpl footprint. * wtf/Atomics.h: (WTF::weakCompareAndSwapSize): (WTF): * wtf/MathExtras.h: (divideRoundedUp): * wtf/text/StringImpl.h: (WTF::StringImpl::cost): (StringImpl): (WTF::StringImpl::costDuringGC): (WTF::StringImpl::refCount): 2013-06-23 Filip Pizlo fourthTier: DFG should optimize identifier string equality https://bugs.webkit.org/show_bug.cgi?id=117920 Reviewed by Sam Weinig. Note that this ChangeLog was supposed to be committed in r151890. Expose the IsIdentifier bit to the JIT. * wtf/text/StringImpl.h: (WTF::StringImpl::flagIsIdentifier): 2013-06-18 Filip Pizlo fourthTier: DFG should have switch_char https://bugs.webkit.org/show_bug.cgi?id=117710 Reviewed by Michael Saboff. I wanted to be able to say stringImpl->at(index), and now I can! Also made it possible to convert a UChar to a utf8 CString without allocating a StringImpl. * wtf/text/StringImpl.cpp: (WTF::StringImpl::utf8Impl): (WTF): (WTF::StringImpl::utf8ForCharacters): (WTF::StringImpl::utf8ForRange): * wtf/text/StringImpl.h: (StringImpl): (WTF::StringImpl::at): (WTF::StringImpl::operator[]): 2013-06-15 Filip Pizlo fourthTier: Add CFG simplification for Switch https://bugs.webkit.org/show_bug.cgi?id=117677 Reviewed by Mark Hahnenberg. * wtf/TriState.h: * wtf/text/StringImpl.h: 2013-06-15 Filip Pizlo Printing a StringImpl* should really guard against NULL https://bugs.webkit.org/show_bug.cgi?id=117675 Reviewed by Mark Hahnenberg. * wtf/PrintStream.cpp: (WTF::printInternal): 2013-06-11 Filip Pizlo fourthTier: DFG should support op_in and it should use patching to make it fast https://bugs.webkit.org/show_bug.cgi?id=117385 Reviewed by Geoffrey Garen. Now if you pass a null StringImpl* then something will still get printed instead of crashing. I figure that this is broadly useful for debug code, and I make use of it in the JSC portion of this patch. * wtf/PrintStream.cpp: (WTF::printInternal): 2013-06-09 Filip Pizlo Unreviewed, fix build. On some compilers the automatic coercion from WTF::String to NSString* causes operator[] to appear ambiguous. One way around this is to make WTF::String behave like most of our other classes: at(unsigned) is always a valid synonym for operator[](unsigned). * wtf/text/WTFString.h: (WTF::String::at): (WTF::String::operator[]): 2013-06-08 Filip Pizlo fourthTier: Recursive deadlock in DFG::ByteCodeParser https://bugs.webkit.org/show_bug.cgi?id=117376 Reviewed by Mark Hahnenberg. I've often wanted to leave a lock early. Now I have that power! * wtf/Locker.h: (WTF::Locker::Locker): (WTF::Locker::~Locker): (Locker): (WTF::Locker::unlockEarly): (WTF::Locker::lock): 2013-05-27 Filip Pizlo It should be possible to record heap operations (both FastMalloc and JSC GC) https://bugs.webkit.org/show_bug.cgi?id=116848 Reviewed by Mark Hahnenberg. * WTF.xcodeproj/project.pbxproj: * wtf/DataLog.cpp: (WTF): (WTF::initializeLogFileOnce): * wtf/FastMalloc.cpp: (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary): * wtf/Platform.h: 2013-05-21 Filip Pizlo fourthTier: DFG should be able to run on a separate thread https://bugs.webkit.org/show_bug.cgi?id=112839 Reviewed by Geoffrey Garen. * wtf/ByteSpinLock.h: Make it non-copyable. We previously had bugs where we used ByteSpinLock as a locker. Clearly that's bad. * wtf/MetaAllocatorHandle.h: Make it thread-safe ref-counted, since we may now be passing them between the concurrent JIT thread and the main thread. * wtf/Vector.h: (WTF::Vector::takeLast): I've wanted this method for ages, and now I finally added. 2013-04-30 Filip Pizlo fourthTier: DFG tries to ref/deref StringImpls in a ton of places https://bugs.webkit.org/show_bug.cgi?id=115300 Reviewed by Geoffrey Garen. Make it possible to do more things directly to StringImpl*'s, including being able to directly do utf8 conversion on a substring without creating the substring first. Add assertions to StringImpl that it isn't being ref/deref'd from the compilation thread. * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (WTF): (WTF::printInternal): * wtf/StringPrintStream.h: (WTF): (WTF::toCString): * wtf/text/StringImpl.cpp: (WTF::StringImpl::utf8ForRange): (WTF::StringImpl::utf8): (WTF): * wtf/text/StringImpl.h: (StringImpl): (WTF::StringImpl::hasAtLeastOneRef): (WTF::StringImpl::ref): (WTF::StringImpl::deref): 2013-04-29 Filip Pizlo fourthTier: String::utf8() should also be available as StringImpl::utf8() so that you don't have to ref() a StringImpl just to get its utf8() https://bugs.webkit.org/show_bug.cgi?id=115393 Reviewed by Geoffrey Garen. * WTF.xcodeproj/project.pbxproj: * wtf/text/ConversionMode.h: Added. (WTF): * wtf/text/StringImpl.cpp: (WTF): (WTF::putUTF8Triple): (WTF::StringImpl::utf8): * wtf/text/StringImpl.h: (StringImpl): * wtf/text/WTFString.cpp: (WTF): (WTF::String::utf8): * wtf/text/WTFString.h: (String): 2013-07-16 Oliver Hunt Merge dfgFourthTier r149301 2013-04-28 Filip Pizlo fourthTier: ASSERT that commonly used not-thread-safe methods in the runtime are not being called during compilation https://bugs.webkit.org/show_bug.cgi?id=115297 Reviewed by Geoffrey Garen. Taught WTF the notion of compilation threads. This allows all parts of our stack to assert that we're not being called from a JSC compilation thread. This is in WTF because it will probably end up being used in StringImpl and WTFString. * WTF.xcodeproj/project.pbxproj: * wtf/CompilationThread.cpp: Added. (WTF): (WTF::initializeCompilationThreadsOnce): (WTF::initializeCompilationThreads): (WTF::isCompilationThread): (WTF::exchangeIsCompilationThread): * wtf/CompilationThread.h: Added. (WTF): (CompilationScope): (WTF::CompilationScope::CompilationScope): (WTF::CompilationScope::~CompilationScope): (WTF::CompilationScope::leaveEarly): 2013-07-16 Oliver Hunt Merge dfgFourthTier r148836 2013-04-21 Filip Pizlo fourthTier: It should be possible to query WatchpointSets, and add Watchpoints, even if the compiler is running in another thread https://bugs.webkit.org/show_bug.cgi?id=114909 Reviewed by Oliver Hunt. Harden our notions of memory fences, now that we're doing racy algorithms. * wtf/Atomics.h: (WTF): (WTF::compilerFence): (WTF::armV7_dmb): (WTF::armV7_dmb_st): (WTF::loadLoadFence): (WTF::loadStoreFence): (WTF::storeLoadFence): (WTF::storeStoreFence): (WTF::memoryBarrierAfterLock): (WTF::memoryBarrierBeforeUnlock): (WTF::x86_mfence): 2013-07-16 Oliver Hunt Merge dfgFourthTier r148804 2013-04-20 Filip Pizlo fourthTier: value profiles and array profiles should be thread-safe enough to be accessible in a concurrent compilation thread https://bugs.webkit.org/show_bug.cgi?id=114906 Reviewed by Oliver Hunt. Add ability to abstract whether or not the CodeBlock requires locking at all, since some platforms may not support the byte spin-locking and/or may not want to, if they turn off concurrent JIT. * WTF.xcodeproj/project.pbxproj: * wtf/ByteSpinLock.h: * wtf/NoLock.h: Added. (WTF): (NoLock): (WTF::NoLock::lock): (WTF::NoLock::unlock): (WTF::NoLock::isHeld): * wtf/Platform.h: 2013-04-17 Filip Pizlo fourthTier: all inline caches should thread-safe enough to allow a concurrent compilation thread to read them safely https://bugs.webkit.org/show_bug.cgi?id=114762 Reviewed by Mark Hahnenberg. Implemented a new spinlock that is optimized for compactness, by using just a byte. This will be useful as we start using fine-grained locking on a bunch of places. At some point I'll make these byte-sized spinlocks into adaptive mutexes, but for now I think it's fine to do the evil thing and use spinning particularly since we only use them for short critical sections. * WTF.xcodeproj/project.pbxproj: * wtf/Atomics.h: (WTF): (WTF::weakCompareAndSwap): * wtf/ByteSpinLock.h: Added. (WTF): (ByteSpinLock): (WTF::ByteSpinLock::ByteSpinLock): (WTF::ByteSpinLock::lock): (WTF::ByteSpinLock::unlock): (WTF::ByteSpinLock::isHeld): * wtf/ThreadingPrimitives.h: (WTF::pauseBriefly): (WTF): 2013-04-12 Filip Pizlo fourthTier: FTL should have OSR exit https://bugs.webkit.org/show_bug.cgi?id=113623 Reviewed by Oliver Hunt. Finally make toCString() somewhat variadic. * wtf/StringPrintStream.h: (WTF): (WTF::toCString): 2013-03-31 Filip Pizlo https://bugs.webkit.org/show_bug.cgi?id=113656 Fix Sam's nits. Unreviewed. Forgot to land these as part of http://trac.webkit.org/changeset/147299. * wtf/MathExtras.h: (isGreaterThanNonZeroPowerOfTwo): 2013-03-29 Filip Pizlo fourthTier: FTL JIT should be able run some simple function https://bugs.webkit.org/show_bug.cgi?id=113481 Reviewed by Geoffrey Garen. * wtf/Platform.h: 2013-07-22 Benjamin Poulain String::lower() - Skip to slow path on the first failure https://bugs.webkit.org/show_bug.cgi?id=118885 Reviewed by Andreas Kling. In the 8 bits case, we don't need to know the state of the full string before changing characters to their lowercase variant. Just fail immediately and start transforming characters from the point of failure. This avoid reading the string twice when the uppercase character is not at the end of the string. * wtf/text/StringImpl.cpp: (WTF::StringImpl::lower): 2013-07-22 Brent Fulgham [Windows] Unreviewed build fix. * WTF.vcxproj/WTFGenerated.make: Stop triggering a "Build All" when things have not changed. 2013-07-19 Alex Christensen Added x64 configuration to Visual Studio build. https://bugs.webkit.org/show_bug.cgi?id=118888 Reviewed by Brent Fulgham. * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTF.vcxproj.filters: * WTF.vcxproj/WTFGenerated.vcxproj: 2013-07-18 Benjamin Poulain Fix the build after r152881 * wtf/text/StringImpl.cpp: (WTF::StringImpl::lower): 2013-07-18 Benjamin Poulain Little cleaning of StringImpl::lower() and StringImpl::upper() for ARM https://bugs.webkit.org/show_bug.cgi?id=118831 Reviewed by Gavin Barraclough. Clean lower() and upper() before trying some optimizations: -Prefix the code with the empty() case. Otherwise, each descending loop starts with a check for length == 0. -Change ored to a 32 bits registers. ARM only has 32 bits registers and access to full word. To keep the value a UChar, the compiler is adding a bunch of useless value & 0xffff in the loops. -Change the pointer based loops for index based loops. The compiler does a mighty job at optimizing those for each architecture. No need to make the code more complex. -Don't perform the check for int32 unless we need to. The only code limited to int is Unicode::toLower. * wtf/text/StringImpl.cpp: (WTF::StringImpl::lower): (WTF::StringImpl::upper): 2013-07-18 Andreas Kling CodeBlock::m_argumentValueProfiles wastes a lot of memory. Reviewed by Anders Carlsson. Add Vector::resizeToFit(size), like resize() but without growth padding. * wtf/Vector.h: (WTF::::resizeToFit): 2013-07-17 Benjamin Poulain Add a thread safety assertion when creating an AtomicString from a StringImpl https://bugs.webkit.org/show_bug.cgi?id=118637 Reviewed by Sam Weinig. The goal is to prevent this kind of use: -Someone create a String from a StringImpl. -At some point, the string becomes atomic. -Later, when the string only has one ref, its ownership is 'passed' to an other thread without checking String::isSafeToSendToAnotherThread(). -In the thread B, an AtomicString is created from the String. ->The AtomicString's StringImpl returned is not in the current thread string table. * wtf/text/AtomicString.cpp: (WTF::AtomicString::isInAtomicStringTable): * wtf/text/AtomicString.h: (WTF::AtomicString::add): 2013-07-17 Benjamin Poulain Simplify AtomicString::lower() https://bugs.webkit.org/show_bug.cgi?id=118719 Reviewed by Gavin Barraclough. * wtf/text/AtomicString.cpp: (WTF::AtomicString::lower): Previously, the code was using a copy constructor for two path and one regular construction in another path. Just put the StringImpl where it needs to be instead. 2013-07-15 Benjamin Poulain Add a threading assertion to AtomicString::remove https://bugs.webkit.org/show_bug.cgi?id=118695 Reviewed by Sam Weinig. * wtf/text/AtomicString.cpp: (WTF::AtomicString::remove): The destructor of StringImpl remove the string from the string table if it is atomic. This needs to be done on the same thread as the one on which the string was added (otherwise the original table would keep a dangling pointer to a dead string). 2013-07-15 Benjamin Poulain Minor cleaning of AtomicString::addSlowCase https://bugs.webkit.org/show_bug.cgi?id=118615 Reviewed by Geoffrey Garen. Give the variable a proper name. Add assertions to clarify the in and out states. * wtf/text/AtomicString.cpp: (WTF::AtomicString::addSlowCase): 2013-07-12 Mikhail Pozdnyakov Improve StringImpl::constructInternal() method https://bugs.webkit.org/show_bug.cgi?id=118503 Reviewed by Benjamin Poulain. StringImpl::constructInternal used 'if ()' statement to decide which constructor to invoke hence compiler had to compile both branches even though optimizer would have then removed one of those, and as the function is inline it could affect slightly the compilation time. The problem is solved via template specialization. * wtf/text/StringImpl.h: (WTF::LChar): (WTF::UChar): 2013-07-11 Patrick Gansterer Remove unused Windows CE files https://bugs.webkit.org/show_bug.cgi?id=118557 Reviewed by Andreas Kling. * wtf/wince/FastMallocWinCE.h: Removed. * wtf/wince/MemoryManager.cpp: Removed. * wtf/wince/MemoryManager.h: Removed. 2013-07-10 Michael Brüning Workaround for x86 optimizer bug in MSVC 2012. https://bugs.webkit.org/show_bug.cgi?id=118478 Reviewed by Benjamin Poulain. This is a workaround for a bug in the x86 MSVC 2012 optimizer. The problem is that the range comparison gets optimized out when the templated inline function toASCIIUpper. Copying the methods content fixes the problem. This is unfortunately not the nicest fix, but the alternative would be to turn off optimization for StringImpl::upper on the x86 MSVC 2012 build, which might impact overall performance negatively. * wtf/text/StringImpl.cpp: (WTF::StringImpl::upper): 2013-07-08 Carlos Garcia Campos Unreviewed. Fix make distcheck. * GNUmakefile.list.am: Add missing header files. 2013-07-08 Antti Koivisto Add Deque::removeLast https://bugs.webkit.org/show_bug.cgi?id=118466 Reviewed by Andreas Kling. Deque can remove both the first and the last element efficiently. Test: TestWebKitAPI/Tests/WTF/Deque.cpp * wtf/Deque.h: (WTF::::takeLast): (WTF::::removeLast): 2013-07-08 Zoltan Arvai [Qt][Windows] Buildfix after r152426. Reviewed by Csaba Osztrogonác. * wtf/Platform.h: Do not include WTFHeaderDetection.h on Qt build. 2013-07-06 Benjamin Poulain Fix the performance regressions introduced by r152418 https://bugs.webkit.org/show_bug.cgi?id=118438 Reviewed by Sam Weinig. * wtf/text/StringImpl.h: (WTF::equal): Looping between two arbitrary pointers prevents important loop optimizations. 2013-07-05 Brent Fulgham [Windows] Unreviewed build correction. * WTF.vcxproj/WTFGenerated.make: Avoid syntax error in generated file in cases where Legible Output support is not present. 2013-07-05 Brent Fulgham [Windows] Unreviewed build correction. * WTF.vcxproj/WTFGenerated.make: Use space (rather than double quotes) when handling the no-Legible-Output case. 2013-07-05 Brent Fulgham [Windows] Identify OS-level at build-time. https://bugs.webkit.org/show_bug.cgi?id=118428 Reviewed by Anders Carlsson. * WTF.vcxproj/WTFGenerated.make: Check for Legible Output featurs and set build environment as appropriate. * wtf/Platform.h: Activate Legible Output features if present. 2013-07-05 Mikhail Pozdnyakov A lot of code duplication within StringImpl 'equal' functions https://bugs.webkit.org/show_bug.cgi?id=118415 Reviewed by Anders Carlsson. There has been a lot of code duplication within StringImpl 'equal' functions: the whole logic was copied to every overloaded 'equal' function. Fixed now using templates and std::equal. * wtf/text/StringImpl.cpp: (WTF::equalInternal): (WTF::equal): * wtf/text/StringImpl.h: (WTF::arraysEqual): (WTF::equal): 2013-07-05 Mikhail Pozdnyakov Remove code duplication from StringImpl create()/reallocate() methods https://bugs.webkit.org/show_bug.cgi?id=118355 Reviewed by Andreas Kling. StringImpl create()/reallocate() methods accepting LChar and UChar used to have duplicated code. The code duplication is removed now via used templates. * wtf/text/StringImpl.cpp: (WTF::StringImpl::constructInternal): (WTF::LChar): (WTF::StringImpl::createUninitializedInternal): (WTF::StringImpl::createUninitialized): (WTF::StringImpl::reallocateInternal): (WTF::StringImpl::reallocate): (WTF::StringImpl::createInternal): (WTF::StringImpl::create): * wtf/text/StringImpl.h: 2013-07-03 Brent Fulgham [Windows] Unreviewed build correction. * WTF.vcxproj/copy-files.cmd: Limit path (for this file) to DOS-only to avoid the Cygwin variant of rmdir from being used. 2013-07-03 Commit Queue Unreviewed, rolling out r152356. http://trac.webkit.org/changeset/152356 https://bugs.webkit.org/show_bug.cgi?id=118361 Broke JSCore tests (Requested by andersca on #webkit). * wtf/text/StringImpl.cpp: (WTF::StringImpl::createUninitialized): (WTF::StringImpl::reallocate): (WTF::StringImpl::create): * wtf/text/StringImpl.h: 2013-07-03 Mikhail Pozdnyakov Remove code duplication from StringImpl create()/reallocate() methods https://bugs.webkit.org/show_bug.cgi?id=118355 Reviewed by Anders Carlsson. StringImpl create()/reallocate() methods accepting LChar and UChar used to have duplicated code. The code duplication is removed now via used templates. * wtf/text/StringImpl.cpp: (WTF::StringImpl::constructInternal): (WTF::LChar): (WTF::StringImpl::createUninitializedInternal): (WTF::StringImpl::createUninitialized): (WTF::StringImpl::reallocateInternal): (WTF::StringImpl::reallocate): (WTF::StringImpl::createInternal): (WTF::StringImpl::create): * wtf/text/StringImpl.h: 2013-07-03 Csaba Osztrogonác Fix cast-align warnings in FastMalloc.cpp https://bugs.webkit.org/show_bug.cgi?id=117991 Reviewed by Mark Hahnenberg. * wtf/FastMalloc.cpp: 2013-07-02 Geoffrey Garen plainText() is O(N^2) https://bugs.webkit.org/show_bug.cgi?id=118282 Reviewed by Alexey Proskuryakov. * wtf/text/StringBuilder.cpp: (WTF::expandCapacity): Factored out this helper function to simplify some code that was duplicated in four places. (WTF::StringBuilder::appendUninitializedSlow): (WTF::StringBuilder::append): Use expandCapacity(). One of the cases was not doing anything special, and so was O(N^2). Also, always call expandCapacity() it in a standard way, calling capacity() first, so it's easy to tell at a glance that you got it right. 2013-07-02 Mikhail Pozdnyakov Avoid code duplication inside String::append() https://bugs.webkit.org/show_bug.cgi?id=118290 Reviewed by Anders Carlsson. The implementation of 'append(UChar)' had been repeated inside 'append(LChar)', this duplication is obviated now. * wtf/text/WTFString.cpp: (WTF::String::appendInternal): (WTF::String::append): * wtf/text/WTFString.h: 2013-06-28 Anders Carlsson Remove String::deprecatedCharactersWithNullTermination() and related code https://bugs.webkit.org/show_bug.cgi?id=118211 Reviewed by Benjamin Poulain. Remove String::deprecatedCharactersWithNullTermination, StringImpl::createWithTerminatingNullCharacter and the s_hashFlagHasTerminatingNullCharacter flag. We no longer care about whether strings have a terminating null character. * wtf/text/StringImpl.cpp: (WTF::StringImpl::createFromLiteral): (WTF::StringImpl::createWithoutCopying): (WTF::StringImpl::getData16SlowCase): (WTF::StringImpl::sizeInBytes): * wtf/text/StringImpl.h: (WTF::StringImpl::StringImpl): (WTF::StringImpl::createFromLiteral): (WTF::StringImpl::isolatedCopy): * wtf/text/WTFString.cpp: * wtf/text/WTFString.h: 2013-06-27 Anders Carlsson Add a new String::charactersWithNullTermination() function that returns a vector https://bugs.webkit.org/show_bug.cgi?id=118155 Reviewed by Andreas Kling. This new String::charactersWithNullTermination() function returns a new Vector and does not modify the underlying string data. * wtf/text/WTFString.cpp: (WTF::String::charactersWithNullTermination): * wtf/text/WTFString.h: 2013-06-26 Anders Carlsson Deprecate StringImpl::charactersWithNullTermination https://bugs.webkit.org/show_bug.cgi?id=118108 Reviewed by Beth Dakin. The optimization in String and StringImpl to keep track of whether a string has a null terminator isn't worth it; in most cases we call charactersWithNullTermination() on temporary strings which ends up copying strings anyway. A better solution is to have a charactersWithNullTermination() function that returns a Vector, which is similar to what we have for String::utf8() and String::ascii(). This will be done in a follow-up patch. * wtf/text/WTFString.cpp: (WTF::String::deprecatedCharactersWithNullTermination): * wtf/text/WTFString.h: 2013-06-26 Anders Carlsson Add JSStringCreateWithCharactersNoCopy SPI https://bugs.webkit.org/show_bug.cgi?id=118074 Reviewed by Geoffrey Garen. * wtf/text/StringImpl.cpp: (WTF::StringImpl::createFromLiteral): Use the new ConstructWithoutCopying constructor, passing DoesHaveTerminatingNullCharacter to it. Change the other createFromLiteral overload to just call the first. (WTF::StringImpl::createWithoutCopying): Add helper functions for creating strings that shouldn't copy their underlying data. * wtf/text/StringImpl.h: (WTF::StringImpl::StringImpl): Rename the ConstructFromLiteralTag constructor enum to ConstructWithoutCopyingTag. Change the constructor to take an enum that states whether the string has a terminating null character or not. (WTF::StringImpl::createFromLiteral): Call createWithoutCopying. (WTF::StringImpl::requiresCopy): Rename this from isASCIILiteral() and make it more generic so it can handle 16-bit strings as well. (WTF::StringImpl::isolatedCopy): If this string doesn't have to be copied, just create a new StringImpl object that references the current data. 2013-06-26 Jer Noble Potential use-after-free after neutering AudioBuffer's underlying ArrayBuffer. https://bugs.webkit.org/show_bug.cgi?id=118040 Reviewed by Filip Pizlo. Add support for 'unneuterable' ArrayBufferViews. Views marked as such will have their underlying ArrayBuffer objects copied rather than transferred to a new view. * wtf/ArrayBuffer.cpp: (WTF::ArrayBuffer::transfer): Check whether the associated views are neuterable, and if not clone the ArrayBuffer rather than transferring it. * wtf/ArrayBuffer.h: (WTF::ArrayBufferContents::copyTo): Added. Utility function. * wtf/ArrayBufferView.cpp: (WTF::ArrayBufferView::ArrayBufferView): (WTF::ArrayBufferView::neuter): * wtf/ArrayBufferView.h: (WTF::ArrayBufferView::setNeuterable): (WTF::ArrayBufferView::isNeuterable): 2013-06-26 Brent Fulgham [Windows] Enable CaptionUserPreferenceMediaAF on Windows. https://bugs.webkit.org/show_bug.cgi?id=118076 Reviewed by Eric Carlson. * wtf/Platform.h: Enable Media Accessibility Framework in Windows build environments that support it. 2013-06-24 Roger Fong Unreviewed. AppleWin build fix, followup to r151915. * WTF.vcxproj/WTFProduction.props: 2013-06-24 Mikhail Pozdnyakov HashMap: reverse the order of the template arguments at alternate 'find', 'contains' and 'add' methods https://bugs.webkit.org/show_bug.cgi?id=117911 Reviewed by Anders Carlsson. The order of the template arguments at HashMap alternate 'find', 'contains' and 'add' methods is reversed so that callers can just pass the translator and let the compiler deduce input argument type. Another rational is consistency with HashSet class. * wtf/HashMap.h: 2013-06-24 peavo@outlook.com [WinCairo] WTF.dll is linking with CoreFoundation.lib in VS2010. https://bugs.webkit.org/show_bug.cgi?id=117294 Reviewed by Brent Fulgham. WinCairo build should not use CoreFoundation. * WTF.vcxproj/WTFCFLite.props: Added. * WTF.vcxproj/WTFCommon.props: Remove CoreFoundation.lib from depencency list. * WTF.vcxproj/WTFCoreFoundation.props: Added. * WTF.vcxproj/WTFDebug.props: Import WTFCoreFoundation.props for WinApple. * WTF.vcxproj/WTFDebugWinCairo.props: Import WTFCFLite.props for WinCairo. * WTF.vcxproj/WTFRelease.props: Import WTFCoreFoundation.props for WinApple. * WTF.vcxproj/WTFReleaseWinCairo.props: Import WTFCFLite.props for WinCairo. 2013-06-17 Darin Adler Sort all the Xcode project files https://bugs.webkit.org/show_bug.cgi?id=117696 Reviewed by Anders Carlsson. * WTF.xcodeproj/project.pbxproj: Ran the sort-Xcode-project-file script. 2013-06-20 Sergio Correia [WK2] Looping for EINTR on close() is incorrect for Linux, at least https://bugs.webkit.org/show_bug.cgi?id=117266 Reviewed by Darin Adler. Added file UniStdExtras with a closeWithRetry() function that works around the EINTR behavior on Linux during a close() call: it closes the descriptor unconditionally even when the call is interrupted. * wtf/UniStdExtras.h: Added. (WTF::closeWithRetry): Wrapper around POSIX close() that handles EINTR correctly. 2013-06-20 Mark Lam Refine the StackBounds computation for Windows. https://bugs.webkit.org/show_bug.cgi?id=117854. Reviewed by Brent Fulgham. * wtf/StackBounds.cpp: (WTF::StackBounds::initialize): 2013-06-20 Mark Lam [Windows] Undoing r150621 to roll r150600 back in as the jsc test failures have been fixed in r151808. https://bugs.webkit.org/show_bug.cgi?id=116661. Reviewed by Brent Fulgham. * wtf/StackBounds.cpp: (WTF::StackBounds::initialize): 2013-06-20 Mikhail Pozdnyakov HashSet: reverse the order of the template arguments at alternate 'find', 'contains' and 'add' methods https://bugs.webkit.org/show_bug.cgi?id=117830 Reviewed by Anders Carlsson. The order of the template arguments at HashSet alternate 'find', 'contains' and 'add' methods is reversed so that callers can just pass the translator and let the compiler deduce input argument type. * wtf/HashSet.h: * wtf/text/AtomicString.cpp: (WTF::addToStringTable): (WTF::findString): 2013-06-20 Roger Fong Make Windows makefile copy build output to a different folder. . * WTF.vcxproj/WTF.make: 2013-06-19 Geoffrey Garen Remove the SegmentedVector inline segment to shrink CodeBlock by 6X https://bugs.webkit.org/show_bug.cgi?id=117808 Reviewed by Oliver Hunt. SegmentedVector allocation isn't super hot, but we do tend to have many live SegmentedVectors at runtime, particularly in CodeBlocks, so the right tradeoff is to allocate segments out-of-line as needed. This reduces startup memory usage @ google.com by about 6MB. No regression on SunSpider. * wtf/SegmentedVector.h: (WTF::SegmentedVector::SegmentedVector): (WTF::SegmentedVector::at): (WTF::SegmentedVector::append): (WTF::SegmentedVector::removeLast): (WTF::SegmentedVector::clear): (WTF::SegmentedVector::deleteAllSegments): No more inline segment. (WTF::SegmentedVector::ensureSegmentsFor): This code used to assume that there was always a 0 segment, so the math would underflow if there were no 0 segment. I udpated the math to account for having no segments. 2013-06-19 David Kilzer BUILD FIX (r151663): Fix build for iOS WebKit * wtf/text/AtomicStringTable.cpp: Include MainThread.h. (WTF::AtomicStringTable::create): Use AtomicStringTable::destroy instead of non-existent destroyAtomicStringTable function. 2013-06-18 Roger Fong Replace tools32 folder with tools and update WebKit Windows solution accordingly. . Rubberstamped by Brent Fulgham. * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTFDebug.props: * WTF.vcxproj/WTFDebugWinCairo.props: * WTF.vcxproj/WTFGenerated.vcxproj: * WTF.vcxproj/WTFGeneratedDebug.props: * WTF.vcxproj/WTFGeneratedProduction.props: * WTF.vcxproj/WTFGeneratedRelease.props: * WTF.vcxproj/WTFProduction.props: * WTF.vcxproj/WTFRelease.props: * WTF.vcxproj/WTFReleaseWinCairo.props: * WTF.vcxproj/work-around-vs-dependency-tracking-bugs.py: (react_to_vsprops_changes): 2013-06-18 Mikhail Pozdnyakov PackedIntVector: check template arguments at compile time https://bugs.webkit.org/show_bug.cgi?id=117737 Use 'COMPILE_ASSERT' instead of 'ASSERT' in PackedIntVector class constructor. Reviewed by Sam Weinig. * wtf/PackedIntVector.h: (WTF::PackedIntVector::PackedIntVector): 2013-06-17 Andy Estes A static_assert() in RetainPtr.h sometimes causes the build to fail. Wrap the first argument to a static_assert() in parentheses since it contains a comma, which sometimes tricks the preprocessor into thinking the macro is being passed three arguments rather than two. Reviewed by Brian Weinstein. * wtf/RetainPtr.h: (WTF::RetainPtr::RetainPtr): 2013-06-17 Zan Dobersek REGRESSION (r149184): Build errors in RefPtr.h when building with Clang, C++98 standard https://bugs.webkit.org/show_bug.cgi?id=116352 Reviewed by Anders Carlsson. Use the __has_feature macro instead of the __has_extension one when detecting what features the Clang compiler that's being used is capable to provide. With the project moving onto using C++11 throughout its components, there currently exist cases where C++11-specific functionality (for instance std::move) is used despite being guarded by compiler-specific feature guards that still get enabled even when compiling in C++98 with Clang. The problematic features are enabled because they're available as C++98 language extensions by Clang. Using __has_feature instead enables the feature guard only if the tested feature is actually standardized in the currently used language standard. * wtf/Compiler.h: 2013-06-17 Ryosuke Niwa Initialize AtomicStringTable in WTFThreadData's constructor https://bugs.webkit.org/show_bug.cgi?id=117671 Reviewed by Geoffrey Garen. Extracted AtomicStringTable from AtomicString.cpp into AtomicStringTable.h/cpp and made WTFThreadDada::WTFThreadData create the atomic string table for the thread. This eliminates a branch from stringTable() in AtomicString.cpp. * GNUmakefile.list.am: * WTF.pro: * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTF.vcxproj.filters: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/WTFThreadData.cpp: (WTF::WTFThreadData::WTFThreadData): * wtf/text/AtomicString.cpp: (WTF::stringTable): * wtf/text/AtomicStringTable.cpp: Added. (WTF::AtomicStringTable::create): (WTF::AtomicStringTable::destroy): * wtf/text/AtomicStringTable.h: Added. (WTF::AtomicStringTable::table): 2013-06-17 Roger Fong Modify Windows makefiles to copy some bin output into Program Files. https://bugs.webkit.org/show_bug.cgi?id=117714. Reviewed by Brent Fulgham. * WTF.vcxproj/WTF.make: 2013-06-17 Grzegorz Czajkowski Unreviewed, rolling out r151632. http://trac.webkit.org/changeset/151632 https://bugs.webkit.org/show_bug.cgi?id=117585 Debug build error ASSERT(WTF_USE_GRAMMAR_CHECKING) for non MAC platforms * wtf/Platform.h: 2013-06-14 Grzegorz Czajkowski Context menu grammar checking items are available when GRAMMAR_CHECKING macro is off https://bugs.webkit.org/show_bug.cgi?id=117585 Reviewed by Anders Carlsson. Enable GRAMMAR_CHECKING for WebKit ports that use/implement it. * wtf/Platform.h: 2013-06-14 Patrick Gansterer Introduce USE(WINGDI) for the Windows port https://bugs.webkit.org/show_bug.cgi?id=116138 Reviewed by Ryosuke Niwa. Using USE(WINGDI) instead of OS(WINCE) will allow us to compile the GDI based Windows port on WinNT too. * wtf/Platform.h: 2013-06-13 Ryosuke Niwa Remove LiteralIdentifierTable https://bugs.webkit.org/show_bug.cgi?id=117613 Reviewed by Geoffrey Garen. Removed LiteralIdentifierTable since it doesn't seem to have any perf. impact now. * wtf/WTFThreadData.h: 2013-06-13 Brent Fulgham [WinCairo] Correct FeatureDefines.h Default for ENABLE_VIEW_MODE_CSS_MEDIA https://bugs.webkit.org/show_bug.cgi?id=114396 Reviewed by Dean Jackson. * wtf/FeatureDefines.h: The WinCairo port does not (currently) support Media elements, so make sure we do not enable this feature by default for that port. 2013-06-13 Brent Fulgham [Windows] Unreviewed gardening. * WTF.vcxproj/WTF.vcxproj: Add FeatureDefines.h to visible files. * WTF.vcxproj/WTF.vcxproj.filters: Ditto. 2013-06-13 Gyuyoung Kim Optimize String::fromUTF8 for ASCII https://bugs.webkit.org/show_bug.cgi?id=117586 Reviewed by Brent Fulgham. From Blink r152243 by Current String::fromUTF8() implementation converts 8 bit ASCII character into 16 bit. Instead of always trying to convert into a 16 bit buffer, we can add a call to charactersAreAllASCII. In the common case when characters are ASCII, we directly copy it into an 8 bit string buffer. * wtf/text/WTFString.cpp: (WTF::String::fromUTF8): 2013-06-12 Brent Fulgham [Windows] Activate supported C++11 Features for VS2010 https://bugs.webkit.org/show_bug.cgi?id=117569 Reviewed by Anders Carlsson. * wtf/Compiler.h: Turn on rvalue references and static_assert when compiling with VS2010 (or newer) 2013-06-07 Roger Fong Unreviewed. Makefile fix. Copy WTF.dll over as well. * WTF.vcxproj/WTF.make: 2013-06-07 Commit Queue Unreviewed, rolling out r151318. http://trac.webkit.org/changeset/151318 https://bugs.webkit.org/show_bug.cgi?id=117356 Broke Windows Release Build (Requested by bfulgham on #webkit). * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTFCommon.props: * WTF.vcxproj/WTFCoreFoundation.props: Removed. * WTF.vcxproj/WTFDebug.props: * WTF.vcxproj/WTFRelease.props: 2013-06-07 peavo@outlook.com [WinCairo] WTF.dll is linking with CoreFoundation.lib in VS2010. https://bugs.webkit.org/show_bug.cgi?id=117294 Reviewed by Darin Adler. WinCairo build should not use CoreFoundation. * WTF.vcxproj/WTF.vcxproj: Exclude unneeded file from WinCairo build. * WTF.vcxproj/WTFCommon.props: Removed CoreFoundation.lib from common props. * WTF.vcxproj/WTFCoreFoundation.props: Added. * WTF.vcxproj/WTFDebug.props: Inherit from WTFCoreFoundations.props. * WTF.vcxproj/WTFRelease.props: Inherit from WTFCoreFoundations.props. 2013-06-06 Roger Fong Unreviewed. Fix typo with winmm linker input. * WTF.vcxproj/WTFCommon.props: 2013-06-05 Benjamin Poulain WebSQL forces 16-bit strings https://bugs.webkit.org/show_bug.cgi?id=116935 Reviewed by Darin Adler. Merge chromium 49c9632ac135f6f06e623a7a81d9da1f6bb7196f. https://chromium.googlesource.com/chromium/blink/+/49c9632ac135f6f06e623a7a81d9da1f6bb7196f * wtf/text/StringImpl.cpp: (WTF::StringImpl::create8BitIfPossible): * wtf/text/StringImpl.h: (WTF::lengthOfNullTerminatedString): * wtf/text/WTFString.cpp: (WTF::String::String): 2013-06-03 Roger Fong Nuke VS2005 files from the tree. . Rubberstamped by Brent Fulgham. * WTF.vcproj: Removed. * WTF.vcproj/WTF.make: Removed. * WTF.vcproj/WTF.sln: Removed. * WTF.vcproj/WTF.vcproj: Removed. * WTF.vcproj/WTFCommon.vsprops: Removed. * WTF.vcproj/WTFDebug.vsprops: Removed. * WTF.vcproj/WTFDebugAll.vsprops: Removed. * WTF.vcproj/WTFDebugCairoCFLite.vsprops: Removed. * WTF.vcproj/WTFGenerated.make: Removed. * WTF.vcproj/WTFGenerated.vcproj: Removed. * WTF.vcproj/WTFGeneratedCommon.vsprops: Removed. * WTF.vcproj/WTFGeneratedDebug.vsprops: Removed. * WTF.vcproj/WTFGeneratedDebugAll.vsprops: Removed. * WTF.vcproj/WTFGeneratedDebugCairoCFLite.vsprops: Removed. * WTF.vcproj/WTFGeneratedProduction.vsprops: Removed. * WTF.vcproj/WTFGeneratedRelease.vsprops: Removed. * WTF.vcproj/WTFGeneratedReleaseCairoCFLite.vsprops: Removed. * WTF.vcproj/WTFPostBuild.cmd: Removed. * WTF.vcproj/WTFPreBuild.cmd: Removed. * WTF.vcproj/WTFProduction.vsprops: Removed. * WTF.vcproj/WTFRelease.vsprops: Removed. * WTF.vcproj/WTFReleaseCairoCFLite.vsprops: Removed. * WTF.vcproj/build-generated-files.sh: Removed. * WTF.vcproj/copy-files.cmd: Removed. * WTF.vcproj/work-around-vs-dependency-tracking-bugs.py: Removed. 2013-06-03 Patrick Gansterer Unreviewed WinCE build fix after r150833. * wtf/DateMath.cpp: (WTF::calculateDSTOffset): 2013-06-03 Gyuyoung Kim [WTF] Add OwnArrayPtr vectortraits template https://bugs.webkit.org/show_bug.cgi?id=117131 Reviewed by Darin Adler. To support Vector>, which will be used by EFL port. * wtf/VectorTraits.h: 2013-05-31 Rafael Brandao Fix double hash lookup in PageMapMemoryUsageRecorder::visit https://bugs.webkit.org/show_bug.cgi?id=117071 Reviewed by Andreas Kling. * wtf/FastMalloc.cpp: (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary): 2013-05-31 Brent Fulgham [Windows] Speculative build fix for pre-VS2010 compilers * wtf/Platform.h: Only treat WTF as DLL for VS2010 builds 2013-05-31 Zan Dobersek Move MD5, SHA1 unit tests from WTF to TestWebKitAPI https://bugs.webkit.org/show_bug.cgi?id=116445 Reviewed by Benjamin Poulain. Remove the MD5 and SHA1 test cases from the WTF code. The same cases are now built and run under TestWebKitAPI. * wtf/MD5.cpp: (WTF::MD5::MD5): * wtf/SHA1.cpp: (WTF::SHA1::SHA1): 2013-05-30 Roger Fong Another unreviewed build fix for Mac. * wtf/text/WTFString.h: (WTF::String::fromUTF8WithLatin1Fallback): 2013-05-30 Roger Fong Unreviewed build fix for Mac. * wtf/OSAllocator.h: * wtf/text/WTFString.h: (WTF::String::fromUTF8): 2013-05-30 Roger Fong Get rid of JavaScript exports file on AppleWin port. https://bugs.webkit.org/show_bug.cgi?id=117050. Reviewed by Darin Adler. This requires turning WTF into a shared library and adding the WTF_EXPORT_PRIVATE to some methods where it was missed. * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTFCommon.props: * wtf/DateMath.h: * wtf/ExportMacros.h: * wtf/FilePrintStream.h: * wtf/OSAllocator.h: * wtf/PageAllocationAligned.h: * wtf/Platform.h: * wtf/PrintStream.h: * wtf/StackBounds.h: * wtf/StringPrintStream.h: * wtf/ThreadSpecific.h: * wtf/WTFThreadData.h: * wtf/dtoa/cached-powers.h: * wtf/dtoa/double-conversion.h: * wtf/text/WTFString.h: * wtf/unicode/Collator.h: * wtf/unicode/UTF8.h: 2013-05-29 Kent Tamura Remove ENABLE_INPUT_MULTIPLE_FIELDS_UI. https://bugs.webkit.org/show_bug.cgi?id=116796 Reviewed by Ryosuke Niwa. * wtf/FeatureDefines.h: 2013-05-27 Gavin Barraclough String(new Date(2010,10,1)) is wrong in KRAT, YAKT https://bugs.webkit.org/show_bug.cgi?id=106750 Reviewed by Darin Adler. First part of a fix, simplfy date handling code, instead of operating separately on the UTC-standard and standard-DST offsets, just generate a combined UTC-local offset (this is what we actually need, and what the OS gives us). * wtf/DateMath.cpp: (WTF::calculateUTCOffset): (WTF::calculateDSTOffset): - made static, now not called from outside of this file. (WTF::calculateLocalTimeOffset): - This combines the 2038 related adjustment from calculateDSTOffset with the maxUnixTime adjustment from calculateDSTOffsetSimple. Then, if HAVE(TM_GMTOFF) just call getLocalTime, if not use calculateUTCOffset/calculateDSTOffset. (WTF::parseDateFromNullTerminatedCharacters): - call calculateLocalTimeOffset instead of calculateUTCOffset/calculateDSTOffset * wtf/DateMath.h: (WTF::LocalTimeOffset::LocalTimeOffset): (LocalTimeOffset): (WTF::LocalTimeOffset::operator==): - new struct type, a tuple of UTC-local offset & isDST flag. - replaced calculateUTCOffset/calculateDSTOffset with calculateLocalTimeOffset * wtf/GregorianDateTime.cpp: (WTF::GregorianDateTime::setToCurrentLocalTime): - call calculateLocalTimeOffset instead of calculateUTCOffset/calculateDSTOffset 2013-05-27 Patrick Gansterer Use correct stack size on Solaris and OpenBSD https://bugs.webkit.org/show_bug.cgi?id=114978 Recommit after wrong rollout in r150621. * wtf/StackBounds.cpp: (WTF): (WTF::StackBounds::initialize): 2013-05-27 Patrick Gansterer Use ICU_INCLUDE_DIRS in BlackBerry CMake files https://bugs.webkit.org/show_bug.cgi?id=116210 Reviewed by Rob Buis. Set and use the ICU_INCLUDE_DIRS variable to avoid duplicated adding of the ICU include directory. * wtf/PlatformBlackBerry.cmake: 2013-05-27 Ádám Kallai [Qt] Enable parallel GC. Probably it has been fixed in r131791. https://bugs.webkit.org/show_bug.cgi?id=90957 Reviewed by Csaba Osztrogonác. * wtf/Platform.h: 2013-05-26 Patrick Gansterer [WINCE] Add wtf_bsearch() https://bugs.webkit.org/show_bug.cgi?id=116528 Reviewed by Darin Adler. r149833 introduced usage of ::bsearch(), which does not exist on Windwos CE. Add our own implementation of this function as wtf_bsearch and define bsearch as wtf_bsearch to fix compilation on Windwos CE. * wtf/StdLibExtras.h: (wtf_bsearch): 2013-05-26 Kent Tamura Remove ENABLE_CALENDAR_PICKER https://bugs.webkit.org/show_bug.cgi?id=116795 Reviewed by Ryosuke Niwa. * wtf/FeatureDefines.h: 2013-05-24 Benjamin Poulain Inline TCMalloc_Central_FreeList's RemoveRange and FetchFromSpansSafe https://bugs.webkit.org/show_bug.cgi?id=116700 Reviewed by Darin Adler. The two functions only have one call site each. * wtf/FastMalloc.cpp: (WTF::TCMalloc_Central_FreeList::RemoveRange): (WTF::TCMalloc_Central_FreeList::FetchFromSpansSafe): 2013-05-24 Filip Pizlo We broke !(0/0) https://bugs.webkit.org/show_bug.cgi?id=116736 Reviewed by Gavin Barraclough. * wtf/MathExtras.h: (isNotZeroAndOrdered): (isZeroOrUnordered): 2013-05-24 Anders Carlsson Remove PagePopup code https://bugs.webkit.org/show_bug.cgi?id=116732 Reviewed by Andreas Kling. Remove ENABLE_PAGE_POPUP. * wtf/FeatureDefines.h: 2013-05-25 Jer Noble Mac: Set the default audio buffer size to a large value for