ebe0db15ee85b782cc274b4e5504185e8a8aa339
[WebKit.git] / Source / WTF / ChangeLog
1 2015-08-07  Filip Pizlo  <fpizlo@apple.com>
2
3         Lightweight locks should be adaptive
4         https://bugs.webkit.org/show_bug.cgi?id=147545
5
6         Reviewed by Geoffrey Garen.
7
8         A common idiom in WebKit is to use spinlocks. We use them because the lock acquisition
9         overhead is lower than system locks and because they take dramatically less space than system
10         locks. The speed and space advantages of spinlocks can be astonishing: an uncontended spinlock
11         acquire is up to 10x faster and under microcontention - short critical section with two or
12         more threads taking turns - spinlocks are up to 100x faster. Spinlocks take only 1 byte or 4
13         bytes depending on the flavor, while system locks take 64 bytes or more. Clearly, WebKit
14         should continue to avoid system locks - they are just far too slow and far too big.
15
16         But there is a problem with this idiom. System lock implementations will sleep a thread when
17         it attempts to acquire a lock that is held, while spinlocks will cause the thread to burn CPU.
18         In WebKit spinlocks, the thread will repeatedly call sched_yield(). This is awesome for
19         microcontention, but awful when the lock will not be released for a while. In fact, when
20         critical sections take tens of microseconds or more, the CPU time cost of our spinlocks is
21         almost 100x more than the CPU time cost of a system lock. This case doesn't arise too
22         frequently in our current uses of spinlocks, but that's probably because right now there are
23         places where we make a conscious decision to use system locks - even though they use more
24         memory and are slower - because we don't want to waste CPU cycles when a thread has to wait a
25         while to acquire the lock.
26
27         The solution is to just implement a modern adaptive mutex in WTF. Luckily, this isn't a new
28         concept. This patch implements a mutex that is reminiscent of the kinds of low-overhead locks
29         that JVMs use. The actual implementation here is inspired by some of the ideas from [1]. The
30         idea is simple: the fast path is an inlined CAS to immediately acquire a lock that isn't held,
31         the slow path tries some number of spins to acquire the lock, and if that fails, the thread is
32         put on a queue and put to sleep. The queue is made up of statically allocated thread nodes and
33         the lock itself is a tagged pointer: either it is just bits telling us the complete lock state
34         (not held or held) or it is a pointer to the head of a queue of threads waiting to acquire the
35         lock. This approach gives WTF::Lock three different levels of adaptation: an inlined fast path
36         if the lock is not contended, a short burst of spinning for microcontention, and a full-blown
37         queue for critical sections that are held for a long time.
38
39         On a locking microbenchmark, this new Lock exhibits the following performance
40         characteristics:
41
42         - Lock+unlock on an uncontended no-op critical section: 2x slower than SpinLock and 3x faster
43           than a system mutex.
44
45         - Lock+unlock on a contended no-op critical section: 2x slower than SpinLock and 100x faster
46           than a system mutex.
47
48         - CPU time spent in lock() on a lock held for a while: same as system mutex, 90x less than a
49           SpinLock.
50
51         - Memory usage: sizeof(void*), so on 64-bit it's 8x less than a system mutex but 2x worse than
52           a SpinLock.
53
54         This patch replaces all uses of SpinLock with Lock, since our critical sections are not
55         no-ops so if you do basically anything in your critical section, the Lock overhead will be
56         invisible. Also, in all places where we used SpinLock, we could tolerate 8 bytes of overhead
57         instead of 4. Performance benchmarking using JSC macrobenchmarks shows no difference, which is
58         as it should be: the purpose of this change is to reduce CPU time wasted, not wallclock time.
59         This patch doesn't replace any uses of ByteSpinLock, since we expect that the space benefits
60         of having a lock that just uses a byte are still better than the CPU wastage benefits of
61         Lock. But, this work will enable some future work to create locks that will fit in just 1.6
62         bits: https://bugs.webkit.org/show_bug.cgi?id=147665.
63         
64         Rolling this back in after fixing Lock::unlockSlow() for architectures that have a truly weak
65         CAS. Since the Lock::unlock() fast path can go to slow path spuriously, it may go there even if
66         there aren't any threads on the Lock's queue. So, unlockSlow() must be able to deal with the
67         possibility of a null queue head.
68
69         [1] http://www.filpizlo.com/papers/pizlo-pppj2011-fable.pdf
70
71         * WTF.vcxproj/WTF.vcxproj:
72         * WTF.xcodeproj/project.pbxproj:
73         * benchmarks: Added.
74         * benchmarks/LockSpeedTest.cpp: Added.
75         (main):
76         * wtf/Atomics.h:
77         (WTF::Atomic::compareExchangeWeak):
78         (WTF::Atomic::compareExchangeStrong):
79         * wtf/CMakeLists.txt:
80         * wtf/Lock.cpp: Added.
81         (WTF::LockBase::lockSlow):
82         (WTF::LockBase::unlockSlow):
83         * wtf/Lock.h: Added.
84         (WTF::LockBase::lock):
85         (WTF::LockBase::unlock):
86         (WTF::LockBase::isHeld):
87         (WTF::LockBase::isLocked):
88         (WTF::Lock::Lock):
89         * wtf/MetaAllocator.cpp:
90         (WTF::MetaAllocator::release):
91         (WTF::MetaAllocatorHandle::shrink):
92         (WTF::MetaAllocator::allocate):
93         (WTF::MetaAllocator::currentStatistics):
94         (WTF::MetaAllocator::addFreshFreeSpace):
95         (WTF::MetaAllocator::debugFreeSpaceSize):
96         * wtf/MetaAllocator.h:
97         * wtf/SpinLock.h:
98         * wtf/ThreadingPthreads.cpp:
99         * wtf/ThreadingWin.cpp:
100         * wtf/text/AtomicString.cpp:
101         * wtf/text/AtomicStringImpl.cpp:
102         (WTF::AtomicStringTableLocker::AtomicStringTableLocker):
103
104 2015-08-05  Filip Pizlo  <fpizlo@apple.com>
105
106         Unreviewed, roll out http://trac.webkit.org/changeset/187972.
107
108         * wtf/Atomics.cpp:
109         (WTF::getSwapLock):
110         (WTF::atomicStep):
111         * wtf/MessageQueue.h:
112         (WTF::MessageQueue::infiniteTime):
113         (WTF::MessageQueue<DataType>::append):
114         (WTF::MessageQueue<DataType>::appendAndKill):
115         (WTF::MessageQueue<DataType>::appendAndCheckEmpty):
116         (WTF::MessageQueue<DataType>::prepend):
117         (WTF::MessageQueue<DataType>::removeIf):
118         (WTF::MessageQueue<DataType>::isEmpty):
119         (WTF::MessageQueue<DataType>::kill):
120         (WTF::MessageQueue<DataType>::killed):
121         * wtf/ParallelJobsGeneric.cpp:
122         (WTF::ParallelEnvironment::ThreadPrivate::execute):
123         (WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
124         (WTF::ParallelEnvironment::ThreadPrivate::workerThread):
125         * wtf/ParallelJobsGeneric.h:
126         * wtf/RunLoop.cpp:
127         (WTF::RunLoop::performWork):
128         (WTF::RunLoop::dispatch):
129         * wtf/RunLoop.h:
130         * wtf/ThreadSpecificWin.cpp:
131         (WTF::destructorsList):
132         (WTF::destructorsMutex):
133         (WTF::threadSpecificKeyCreate):
134         (WTF::threadSpecificKeyDelete):
135         (WTF::ThreadSpecificThreadExit):
136         * wtf/Threading.cpp:
137         (WTF::threadEntryPoint):
138         (WTF::createThread):
139         * wtf/ThreadingPrimitives.h:
140         * wtf/ThreadingPthreads.cpp:
141         (WTF::threadMapMutex):
142         (WTF::initializeThreading):
143         (WTF::identifierByPthreadHandle):
144         (WTF::establishIdentifierForPthreadHandle):
145         (WTF::changeThreadPriority):
146         (WTF::waitForThreadCompletion):
147         (WTF::detachThread):
148         (WTF::threadDidExit):
149         (WTF::currentThread):
150         (WTF::Mutex::Mutex):
151         (WTF::Mutex::~Mutex):
152         (WTF::Mutex::lock):
153         (WTF::Mutex::tryLock):
154         (WTF::Mutex::unlock):
155         (WTF::ThreadCondition::~ThreadCondition):
156         (WTF::ThreadCondition::wait):
157         (WTF::ThreadCondition::timedWait):
158         (WTF::DeprecatedMutex::DeprecatedMutex): Deleted.
159         (WTF::DeprecatedMutex::~DeprecatedMutex): Deleted.
160         (WTF::DeprecatedMutex::lock): Deleted.
161         (WTF::DeprecatedMutex::tryLock): Deleted.
162         (WTF::DeprecatedMutex::unlock): Deleted.
163         * wtf/ThreadingWin.cpp:
164         (WTF::initializeCurrentThreadInternal):
165         (WTF::threadMapMutex):
166         (WTF::initializeThreading):
167         (WTF::storeThreadHandleByIdentifier):
168         (WTF::threadHandleForIdentifier):
169         (WTF::clearThreadHandleForIdentifier):
170         (WTF::currentThread):
171         (WTF::Mutex::Mutex):
172         (WTF::Mutex::~Mutex):
173         (WTF::Mutex::lock):
174         (WTF::Mutex::tryLock):
175         (WTF::Mutex::unlock):
176         (WTF::ThreadCondition::~ThreadCondition):
177         (WTF::ThreadCondition::wait):
178         (WTF::ThreadCondition::timedWait):
179         (WTF::DeprecatedMutex::DeprecatedMutex): Deleted.
180         (WTF::DeprecatedMutex::~DeprecatedMutex): Deleted.
181         (WTF::DeprecatedMutex::lock): Deleted.
182         (WTF::DeprecatedMutex::tryLock): Deleted.
183         (WTF::DeprecatedMutex::unlock): Deleted.
184         * wtf/WorkQueue.h:
185         * wtf/dtoa.cpp:
186         * wtf/dtoa.h:
187         * wtf/efl/DispatchQueueEfl.cpp:
188         (DispatchQueue::dispatch):
189         (DispatchQueue::performWork):
190         (DispatchQueue::performTimerWork):
191         (DispatchQueue::insertTimerWorkItem):
192         (DispatchQueue::wakeUpThread):
193         (DispatchQueue::getNextTimeOut):
194         * wtf/efl/DispatchQueueEfl.h:
195         * wtf/efl/RunLoopEfl.cpp:
196         (WTF::RunLoop::wakeUpEvent):
197         (WTF::RunLoop::wakeUp):
198         * wtf/threads/BinarySemaphore.cpp:
199         (WTF::BinarySemaphore::signal):
200         (WTF::BinarySemaphore::wait):
201         * wtf/threads/BinarySemaphore.h:
202         * wtf/win/WorkQueueWin.cpp:
203         (WTF::WorkQueue::handleCallback):
204         (WTF::WorkQueue::platformInvalidate):
205         (WTF::WorkQueue::dispatch):
206         (WTF::WorkQueue::timerCallback):
207         (WTF::WorkQueue::dispatchAfter):
208
209 2015-08-05  Filip Pizlo  <fpizlo@apple.com>
210
211         Unreviewed, fix Windows.
212
213         * wtf/ThreadSpecificWin.cpp:
214         (WTF::destructorsList):
215         (WTF::destructorsMutex):
216         (WTF::threadSpecificKeyCreate):
217         (WTF::threadSpecificKeyDelete):
218         (WTF::ThreadSpecificThreadExit):
219
220 2015-08-04  Filip Pizlo  <fpizlo@apple.com>
221
222         Rename Mutex to DeprecatedMutex
223         https://bugs.webkit.org/show_bug.cgi?id=147675
224
225         Reviewed by Geoffrey Garen.
226
227         * wtf/Atomics.cpp:
228         (WTF::getSwapLock):
229         (WTF::atomicStep):
230         * wtf/MessageQueue.h:
231         (WTF::MessageQueue::infiniteTime):
232         (WTF::MessageQueue<DataType>::append):
233         (WTF::MessageQueue<DataType>::appendAndKill):
234         (WTF::MessageQueue<DataType>::appendAndCheckEmpty):
235         (WTF::MessageQueue<DataType>::prepend):
236         (WTF::MessageQueue<DataType>::removeIf):
237         (WTF::MessageQueue<DataType>::isEmpty):
238         (WTF::MessageQueue<DataType>::kill):
239         (WTF::MessageQueue<DataType>::killed):
240         * wtf/ParallelJobsGeneric.cpp:
241         (WTF::ParallelEnvironment::ThreadPrivate::execute):
242         (WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
243         (WTF::ParallelEnvironment::ThreadPrivate::workerThread):
244         * wtf/ParallelJobsGeneric.h:
245         * wtf/RunLoop.cpp:
246         (WTF::RunLoop::performWork):
247         (WTF::RunLoop::dispatch):
248         * wtf/RunLoop.h:
249         * wtf/Threading.cpp:
250         (WTF::threadEntryPoint):
251         (WTF::createThread):
252         * wtf/ThreadingPrimitives.h:
253         * wtf/ThreadingPthreads.cpp:
254         (WTF::threadMapMutex):
255         (WTF::initializeThreading):
256         (WTF::identifierByPthreadHandle):
257         (WTF::establishIdentifierForPthreadHandle):
258         (WTF::changeThreadPriority):
259         (WTF::waitForThreadCompletion):
260         (WTF::detachThread):
261         (WTF::threadDidExit):
262         (WTF::currentThread):
263         (WTF::DeprecatedMutex::DeprecatedMutex):
264         (WTF::DeprecatedMutex::~DeprecatedMutex):
265         (WTF::DeprecatedMutex::lock):
266         (WTF::DeprecatedMutex::tryLock):
267         (WTF::DeprecatedMutex::unlock):
268         (WTF::ThreadCondition::~ThreadCondition):
269         (WTF::ThreadCondition::wait):
270         (WTF::ThreadCondition::timedWait):
271         (WTF::Mutex::Mutex): Deleted.
272         (WTF::Mutex::~Mutex): Deleted.
273         (WTF::Mutex::lock): Deleted.
274         (WTF::Mutex::tryLock): Deleted.
275         (WTF::Mutex::unlock): Deleted.
276         * wtf/ThreadingWin.cpp:
277         (WTF::initializeCurrentThreadInternal):
278         (WTF::threadMapMutex):
279         (WTF::initializeThreading):
280         (WTF::storeThreadHandleByIdentifier):
281         (WTF::threadHandleForIdentifier):
282         (WTF::clearThreadHandleForIdentifier):
283         (WTF::currentThread):
284         (WTF::DeprecatedMutex::DeprecatedMutex):
285         (WTF::DeprecatedMutex::~DeprecatedMutex):
286         (WTF::DeprecatedMutex::lock):
287         (WTF::DeprecatedMutex::tryLock):
288         (WTF::DeprecatedMutex::unlock):
289         (WTF::ThreadCondition::~ThreadCondition):
290         (WTF::ThreadCondition::wait):
291         (WTF::ThreadCondition::timedWait):
292         (WTF::Mutex::Mutex): Deleted.
293         (WTF::Mutex::~Mutex): Deleted.
294         (WTF::Mutex::lock): Deleted.
295         (WTF::Mutex::tryLock): Deleted.
296         (WTF::Mutex::unlock): Deleted.
297         * wtf/WorkQueue.h:
298         * wtf/dtoa.cpp:
299         * wtf/dtoa.h:
300         * wtf/efl/DispatchQueueEfl.cpp:
301         (DispatchQueue::dispatch):
302         (DispatchQueue::performWork):
303         (DispatchQueue::performTimerWork):
304         (DispatchQueue::insertTimerWorkItem):
305         (DispatchQueue::wakeUpThread):
306         (DispatchQueue::getNextTimeOut):
307         * wtf/efl/DispatchQueueEfl.h:
308         * wtf/efl/RunLoopEfl.cpp:
309         (WTF::RunLoop::wakeUpEvent):
310         (WTF::RunLoop::wakeUp):
311         * wtf/threads/BinarySemaphore.cpp:
312         (WTF::BinarySemaphore::signal):
313         (WTF::BinarySemaphore::wait):
314         * wtf/threads/BinarySemaphore.h:
315         * wtf/win/WorkQueueWin.cpp:
316         (WTF::WorkQueue::handleCallback):
317         (WTF::WorkQueue::platformInvalidate):
318         (WTF::WorkQueue::dispatch):
319         (WTF::WorkQueue::timerCallback):
320         (WTF::WorkQueue::dispatchAfter):
321
322 2015-08-04  Alex Christensen  <achristensen@webkit.org>
323
324         Fix quirks with CMake and VS2015
325         https://bugs.webkit.org/show_bug.cgi?id=147663
326
327         Reviewed by Brent Fulgham.
328
329         * wtf/Platform.h:
330         Build fix after r187908
331
332 2015-08-04  Brent Fulgham  <bfulgham@apple.com>
333
334         [Win] Update Apple Windows build for VS2015
335         https://bugs.webkit.org/show_bug.cgi?id=147653
336
337         Reviewed by Dean Jackson.
338
339         * WTF.vcxproj/WTF.vcxproj.filters: Drive-by-fix to place files in
340         proper project locations in the IDE.
341         * wtf/Platform.h: Don't define the _HAS_EXCEPTIONS macro when building with
342         Visual Studio 2015.
343
344 2015-08-04  Commit Queue  <commit-queue@webkit.org>
345
346         Unreviewed, rolling out r187815 and r187817.
347         https://bugs.webkit.org/show_bug.cgi?id=147644
348
349         Caused lots of Windows crashes (Requested by smfr on #webkit).
350
351         Reverted changesets:
352
353         "[WTF] Turn tryMakeString(), makeString() into variadic
354         templates"
355         https://bugs.webkit.org/show_bug.cgi?id=147142
356         http://trac.webkit.org/changeset/187815
357
358         "Unreviewed build fix."
359         http://trac.webkit.org/changeset/187817
360
361 2015-08-04  Alex Christensen  <achristensen@webkit.org>
362
363         Enable WebGL on Windows CMake build.
364         https://bugs.webkit.org/show_bug.cgi?id=143311
365
366         Reviewed by Csaba Osztrogonác.
367
368         * wtf/FeatureDefines.h:
369         Made the CMake feature defines the same as the non-CMake feature defines.
370
371 2015-08-03  Csaba Osztrogonác  <ossy@webkit.org>
372
373         Introduce COMPILER(GCC_OR_CLANG) guard and make COMPILER(GCC) true only for GCC
374         https://bugs.webkit.org/show_bug.cgi?id=146833
375
376         Reviewed by Alexey Proskuryakov.
377
378         * wtf/Assertions.cpp:
379         * wtf/Assertions.h: Removed redundant COMPILER(CLANG) guard.
380         * wtf/Atomics.cpp:
381         * wtf/Atomics.h:
382         (WTF::weakCompareAndSwap):
383         (WTF::compilerFence):
384         * wtf/Compiler.h:
385          - Renamed COMPILER(GCC) to COMPILER(GCC_OR_CLANG), because it is true for both compiler.
386          - Added COMPILER(GCC) which is true only for GCC.
387          - Moved all GCC related stuff to one block and removed redundant guards accordingly.
388          - Removed the unused default false definition of GCC_VERSION_AT_LEAST for non GCC compilers.
389         * wtf/ExportMacros.h:
390         * wtf/FastMalloc.h:
391         * wtf/Platform.h:
392         * wtf/StdLibExtras.h:
393         * wtf/Vector.h:
394         * wtf/text/ASCIIFastPath.h:
395         (WTF::copyLCharsFromUCharSource):
396
397 2015-08-03  Zan Dobersek  <zdobersek@igalia.com>
398
399         Unreviewed build fix.
400
401         * wtf/text/StringConcatenate.h: Include <tuple> to avoid missing
402         std::tuple<> class definitions.
403
404 2015-08-03  Zan Dobersek  <zdobersek@igalia.com>
405
406         [WTF] Turn tryMakeString(), makeString() into variadic templates
407         https://bugs.webkit.org/show_bug.cgi?id=147142
408
409         Reviewed by Sam Weinig.
410
411         Built upon the original work by Anders Carlsson, Mark Rowe and Sam Weinig.
412
413         Implement tryMakeString() and makeString() as variadic templates, replacing
414         the argument count-based overloads.
415
416         tryMakeString() now constructs a stack-based tuple of necessary StringTypeAdapter
417         objects and utilizes the StringAdapterTuple struct template to operate on that
418         tuple, recursively calling the necessary operations on each element in the tuple.
419         This effectively mimics the process of previous tryMakeString() implementation,
420         but makes it scalable to a tuple of elements that are to be concatenated.
421
422         StringAppend class template now stores two StringTypeAdapter objects for the
423         two passed-in string objects, packed in a tuple, calling
424         StringAdapterTuple<>::createString() directly when concatenating the two objects
425         into one String.
426
427         * wtf/text/StringConcatenate.h:
428         (WTF::StringTypeAdapter<char>::length):
429         (WTF::StringTypeAdapter<char>::is8Bit):
430         (WTF::StringAdapterTuple::sumWithOverflow):
431         (WTF::StringAdapterTuple::is8Bit):
432         (WTF::StringAdapterTuple::writeTo):
433         (WTF::StringAdapterTuple::createString):
434         (WTF::tryMakeString):
435         (WTF::makeString):
436         (WTF::sumWithOverflow): Deleted.
437         * wtf/text/StringOperators.h:
438         (WTF::StringAppend::StringAppend):
439         (WTF::StringAppend::operator String):
440         (WTF::StringAppend::is8Bit):
441         (WTF::StringAppend::writeTo):
442         (WTF::StringAppend::length):
443         (WTF::StringAppend::string1):
444         (WTF::StringAppend::string2):
445
446 2015-08-03  Anders Carlsson  <andersca@apple.com>
447
448         Make it possible to use String::utf8() in the debugger
449         https://bugs.webkit.org/show_bug.cgi?id=147566
450
451         Reviewed by Tim Horton.
452
453         Add a new utf8() overload that doesn't take any parameters and just calls utf8(LenientConversion), since lldb doesn't support evaluating
454         function calls with default parameters at the moment.
455
456         * wtf/text/WTFString.cpp:
457         (WTF::String::utf8):
458         * wtf/text/WTFString.h:
459
460 2015-08-02  Benjamin Poulain  <bpoulain@apple.com>
461
462         Investigate HashTable::HashTable(const HashTable&) and HashTable::operator=(const HashTable&) performance for hash-based static analyses
463         https://bugs.webkit.org/show_bug.cgi?id=118455
464
465         Reviewed by Filip Pizlo.
466
467         Previously, when copying a HashTable, we would start from scratch
468         with an empty table and insert elements one by one, growing-rehashing
469         the table as needed.
470
471         With this patch, we have 2 improvements to remove most of the cost.
472
473         First, we compute a good size from the start. This removes all the
474         reallocations and rehashs.
475         This is where the biggest gain comes from.
476
477         The second part is a simpler version of add() when we know that
478         we cannot find a bucket with the same key and there cannot
479         be any deleted bucket.
480         This removes most branches from the hot loop, cutting another 25%
481         of the time.
482
483         * wtf/HashTable.h:
484         (WTF::KeyTraits>::addUniqueForInitialization):
485         (WTF::KeyTraits>::HashTable):
486
487 2015-08-01  Myles C. Maxfield  <mmaxfield@apple.com>
488
489         HashTraits<AtomicString> can use SimpleClassHashTraits
490         https://bugs.webkit.org/show_bug.cgi?id=147528
491
492         Reviewed by Andreas Kling.
493
494         No point in duplicating the code inside SimpleClassHashTraits.
495
496         * wtf/text/AtomicStringHash.h:
497         (WTF::HashTraits<WTF::AtomicString>::constructDeletedValue): Deleted.
498         (WTF::HashTraits<WTF::AtomicString>::isDeletedValue): Deleted.
499
500 2015-08-01  Alex Christensen  <achristensen@webkit.org>
501
502         Fix compile errors with VS2015
503         https://bugs.webkit.org/show_bug.cgi?id=147526
504
505         Reviewed by Myles Maxfield.
506
507         * wtf/StringExtras.h:
508         (snprintf):
509         (wtf_vsnprintf):
510         VS2015 has an implementation of snprintf.
511
512 2015-07-31  Alex Christensen  <achristensen@webkit.org>
513
514         Prepare for VS2015
515         https://bugs.webkit.org/show_bug.cgi?id=146579
516
517         Reviewed by Jon Honeycutt.
518
519         * wtf/StdLibExtras.h:
520         (std::exchange):
521         Added preprocessor macros around functions implemented in VS2015's standard library.
522
523 2015-07-30  Chris Dumez  <cdumez@apple.com>
524
525         Mark more classes as fast allocated
526         https://bugs.webkit.org/show_bug.cgi?id=147440
527
528         Reviewed by Sam Weinig.
529
530         Mark more classes as fast allocated for performance. We heap-allocate
531         objects of those types throughout the code base.
532
533         * wtf/Bag.h:
534         * wtf/SegmentedVector.h:
535         * wtf/SentinelLinkedList.h:
536
537 2015-07-29  Basile Clement  <basile_clement@apple.com>
538
539         Remove native call inlining
540         https://bugs.webkit.org/show_bug.cgi?id=147417
541
542         Rubber-stamped by Filip Pizlo.
543
544         * wtf/Platform.h:
545
546 2015-07-28  Yusuke Suzuki  <utatane.tea@gmail.com>
547
548         [ES6] Add ENABLE_ES6_MODULES compile time flag with the default value "false"
549         https://bugs.webkit.org/show_bug.cgi?id=147350
550
551         Reviewed by Sam Weinig.
552
553         * wtf/FeatureDefines.h:
554
555 2015-07-28  Filip Pizlo  <fpizlo@apple.com>
556
557         Unreviewed, fix Windows build.
558
559         * wtf/MetaAllocatorHandle.h:
560         (WTF::MetaAllocatorHandle::key):
561
562 2015-07-27  Filip Pizlo  <fpizlo@apple.com>
563
564         Add logging when executable code gets deallocated
565         https://bugs.webkit.org/show_bug.cgi?id=147355
566
567         Reviewed by Mark Lam.
568
569         * wtf/MetaAllocator.cpp:
570         (WTF::MetaAllocatorHandle::dump): It's useful to be able to dump these.
571         * wtf/MetaAllocatorHandle.h:
572
573 2015-07-28  Benjamin Poulain  <bpoulain@apple.com>
574
575         Speed up StringBuilder::appendQuotedJSONString()
576         https://bugs.webkit.org/show_bug.cgi?id=147352
577
578         Reviewed by Andreas Kling.
579
580         * wtf/text/StringBuilder.cpp:
581         (WTF::appendQuotedJSONStringInternal):
582         The cases '"' and '\\' are not that uncommon, and they can easily
583         be handled in the original branch testing for them.
584
585         This is about 2.5% better on the JSON.stringify test.
586
587 2015-07-27  Alex Christensen  <achristensen@webkit.org>
588
589         Progress towards building AppleWin with CMake
590         https://bugs.webkit.org/show_bug.cgi?id=147325
591
592         Reviewed by Martin Robinson.
593
594         * wtf/PlatformWin.cmake:
595         Link with CoreFoundation.lib.
596
597 2015-07-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>
598
599         REGRESSION (bmalloc): WebKit performance tests don't report memory stats.
600         https://bugs.webkit.org/show_bug.cgi?id=141247
601
602         Reviewed by Geoffrey Garen.
603
604         Meanwhile a better way of getting memory stats with bmalloc is not found
605         (see bug 136592), we can report as memory stats the resident set size
606         information that the operating system provides to us.
607
608         This at least should be good enough to get back the memory stats on the
609         performance tests and being able to track down memory usage regressions
610         at https://perf.webkit.org
611
612         * wtf/FastMalloc.cpp:
613         (WTF::fastMallocStatistics): Report maxrss data as committedVMBytes.
614
615 2015-07-24  Csaba Osztrogonác  <ossy@webkit.org>
616
617         Remove the unused GCC workaround - std::is_trivially_destructible
618         https://bugs.webkit.org/show_bug.cgi?id=147226
619
620         Reviewed by Darin Adler.
621
622         * wtf/StdLibExtras.h:
623
624 2015-07-23  Alex Christensen  <achristensen@webkit.org>
625
626         Remove compile and runtime flags for promises.
627         https://bugs.webkit.org/show_bug.cgi?id=147244
628
629         Reviewed by Yusuke Suzuki.
630
631         * wtf/FeatureDefines.h:
632
633 2015-07-22  Sukolsak Sakshuwong  <sukolsak@gmail.com>
634
635         Add ENABLE_WEBASSEMBLY feature flag for WebAssembly
636         https://bugs.webkit.org/show_bug.cgi?id=147212
637
638         Reviewed by Filip Pizlo.
639
640         * wtf/FeatureDefines.h:
641
642 2015-07-22  Filip Pizlo  <fpizlo@apple.com>
643
644         Introduce release assert for using threads before threading is initialized
645         https://bugs.webkit.org/show_bug.cgi?id=147200
646
647         Reviewed by Michael Saboff.
648         
649         This will help bugs where you use createThread() before calling initializeThreading().
650
651         * wtf/ThreadIdentifierDataPthreads.cpp:
652         (WTF::ThreadIdentifierData::initialize):
653
654 2015-07-21  Daniel Bates  <dabates@apple.com>
655
656         WTFCrash() in WebKit::WebProcess::networkConnection()
657         https://bugs.webkit.org/show_bug.cgi?id=147112
658         <rdar://problem/18477459>
659
660         Reviewed by Gavin Barraclough.
661
662         Add explicit boolean conversion function and remove overload of operator! to support
663         checking whether an activity token is valid more directly than using the overloaded operator!.
664
665         * wtf/RefCounter.h:
666         (WTF::RefCounter::Token::operator bool): Added.
667         (WTF::RefCounter::Token::operator!): Deleted.
668
669 2015-07-20  Mark Lam  <mark.lam@apple.com>
670
671         Rollout r187020 and r187021: breaks JSC API tests on debug builds.
672         https://bugs.webkit.org/show_bug.cgi?id=147110
673
674         * wtf/WTFThreadData.cpp:
675         (WTF::WTFThreadData::WTFThreadData):
676         * wtf/WTFThreadData.h:
677         (WTF::WTFThreadData::stack):
678
679 2015-07-20  Alex Christensen  <achristensen@webkit.org>
680
681         Resurrect CMake build on Windows.
682         https://bugs.webkit.org/show_bug.cgi?id=147083
683
684         Reviewed by Gyuyoung Kim.
685
686         * wtf/PlatformWin.cmake:
687
688 2015-07-20  Per Arne Vollan  <peavo@outlook.com>
689
690         JavaScriptCore performance is very bad on Windows
691         https://bugs.webkit.org/show_bug.cgi?id=146448
692
693         Reviewed by Mark Lam.
694
695         Updating the stack bounds is time consuming.
696         Only update the stack bounds when a new fiber is running.
697
698         * wtf/WTFThreadData.cpp:
699         (WTF::WTFThreadData::WTFThreadData):
700         * wtf/WTFThreadData.h:
701         (WTF::WTFThreadData::stack):
702
703 2015-07-20  Julien Brianceau  <julien.brianceau@gmail.com>
704
705         Use isnan from std namespace in Stopwatch.h.
706         https://bugs.webkit.org/show_bug.cgi?id=146911
707
708         Reviewed by Žan Doberšek.
709
710         * wtf/Stopwatch.h:
711         (WTF::Stopwatch::isActive):
712         (WTF::Stopwatch::start):
713         (WTF::Stopwatch::stop):
714         (WTF::Stopwatch::elapsedTime):
715
716 2015-07-16  Benjamin Poulain  <bpoulain@apple.com>
717
718         [Content extensions] Combine suffixes when generating NFAs
719         https://bugs.webkit.org/show_bug.cgi?id=146961
720
721         Reviewed by Alex Christensen.
722
723         * wtf/Vector.h:
724         (WTF::minCapacity>::Vector):
725         (WTF::=):
726         Copying a vector with a different inline capacity was broken due to
727         the addition of MinimumCapacity.
728
729         This feature was needed by this patch so I fixed WTF.
730
731 2015-07-15  Anders Carlsson  <andersca@apple.com>
732
733         Make JavaScriptCore SPI headers used by WebCore SPI headers self-contained
734         https://bugs.webkit.org/show_bug.cgi?id=146978
735
736         Reviewed by Dan Bernstein.
737
738         * wtf/ExportMacros.h:
739
740 2015-07-14  Anders Carlsson  <andersca@apple.com>
741
742         Assertions.h should include ExportMacros.h
743         https://bugs.webkit.org/show_bug.cgi?id=146948
744
745         Reviewed by Tim Horton.
746
747         * wtf/Assertions.h:
748
749 2015-07-11  Joseph Pecoraro  <pecoraro@apple.com>
750
751         Unreviewed build fix, restrict APP_LINKS to just iOS.
752
753         * wtf/Platform.h:
754
755 2015-07-09  Tim Horton  <timothy_horton@apple.com>
756
757         Use CoreAnimation fences instead of synchronous IPC to synchronize resize
758         https://bugs.webkit.org/show_bug.cgi?id=146294
759         <rdar://problem/21090193>
760
761         Reviewed by Anders Carlsson.
762
763         * wtf/Platform.h:
764         Add HAVE(COREANIMATION_FENCES)
765
766 2015-07-04  Chris Dumez  <cdumez@apple.com>
767
768         Drop RefPtr::clear() method
769         https://bugs.webkit.org/show_bug.cgi?id=146556
770
771         Reviewed by Brady Eidson.
772
773         Drop RefPtr::clear() method in favor of "= nullptr;" pattern.
774         Also made the "= nullptr;" pattern as efficient as clear()
775         by providing a operator=(nullptr_t) overload. Local micro-
776         benchmarking showed that "= nullptr;" used to be ~1.7% slower
777         than clear().
778
779 2015-07-03  Dan Bernstein  <mitz@apple.com>
780
781         [Xcode] Update some build settings as recommended by Xcode 7
782         https://bugs.webkit.org/show_bug.cgi?id=146597
783
784         Reviewed by Sam Weinig.
785
786         * Configurations/Base.xcconfig: Enabled CLANG_WARN_UNREACHABLE_CODE and
787         GCC_NO_COMMON_BLOCKS. Removed GCC_MODEL_TUNING.
788
789         * WTF.xcodeproj/project.pbxproj: Updated LastUpgradeCheck.
790
791 2015-07-01  Alex Christensen  <achristensen@webkit.org>
792
793         Re-enable WebGL on WinCairo
794         https://bugs.webkit.org/show_bug.cgi?id=146537
795
796         Reviewed by Csaba Osztrogonác.
797
798         * wtf/FeatureDefines.h:
799         Enable WebGL on WinCairo again.
800
801 2015-07-01  Alex Christensen  <achristensen@webkit.org>
802
803         Ignore Visual Studio warning in SegmentedVector
804         https://bugs.webkit.org/show_bug.cgi?id=146514
805
806         Reviewed by Andreas Kling.
807
808         * wtf/SegmentedVector.h:
809         (WTF::SegmentedVector::deleteAllSegments):
810         Use pragmas to ignore the 0 element array warning.
811
812 2015-07-01  Dean Jackson  <dino@apple.com>
813
814         Disable the experimental WebGL2 implementation
815         https://bugs.webkit.org/show_bug.cgi?id=146526
816         <rdar://problem/21641235>
817
818         Reviewed by Myles Maxfield.
819
820         Add (and disable) an ENABLE_WEBGL2 flag.
821
822         * wtf/FeatureDefines.h:
823
824 2015-06-30  Alex Christensen  <achristensen@webkit.org>
825
826         [Win] Unreviewed build fix after r186169.
827
828         * wtf/FeatureDefines.h:
829         Temporarily disable WebGL on WinCairo. It was already temporarily disabled on AppleWin.
830
831 2015-06-30  Andy VanWagoner  <thetalecrafter@gmail.com>
832
833         Implement ECMAScript Internationalization API
834         https://bugs.webkit.org/show_bug.cgi?id=90906
835
836         Reviewed by Benjamin Poulain.
837
838         * wtf/FeatureDefines.h: add ENABLE_INTL flag
839
840 2015-06-30  Keith Miller  <keith_miller@apple.com>
841
842         Errors in read() are not handled in WTF::cryptographicallyRandomValuesFromOS.
843         https://bugs.webkit.org/show_bug.cgi?id=146473
844
845         Reviewed by Filip Pizlo.
846
847         We were not checking if errors occurred in WTF::cryptographicallyRandomValuesFromOS.
848         We now buffer the data until enough bits of entropy exist to fill the buffer
849         rather than crash. Additionally, added two crash functions so we can distinguish
850         between the two reasons why we crashed in traces.
851
852         * wtf/OSRandomSource.cpp:
853         (WTF::crashUnableToOpenFD):
854         (WTF::crashUnableToReadFromFD):
855         (WTF::cryptographicallyRandomValuesFromOS):
856
857 2015-06-29  Dean Jackson  <dino@apple.com>
858
859         Temporarily disable PICTURE_SIZES
860         https://bugs.webkit.org/show_bug.cgi?id=146435
861         <rdar://problem/21087013>
862
863         Reviewed by Tim Horton.
864
865         Temporarily disable PICTURE_SIZES because it causes problems with out
866         of date <picture> polyfills.
867
868         * wtf/FeatureDefines.h:
869
870 2015-06-26  Antti Koivisto  <antti@apple.com>
871
872         Network process hangs fetching disk cache entries
873         https://bugs.webkit.org/show_bug.cgi?id=146348
874         <rdar://problem/21528072>
875
876         Reviewed by Anders Carlsson.
877
878         RunLoop::dispatch may deadlock if invoked with std::function that captures an object that calls RunLoop::dispatch in destructor.
879
880         * wtf/RunLoop.cpp:
881         (WTF::RunLoop::performWork):
882
883             Don't reuse std::function variable in loop. We may end up destroying previously held std::function in assignment
884             while holding the runloop mutex. With this change std::function is always destroyed with mutex unlocked.
885
886 2015-06-24  Commit Queue  <commit-queue@webkit.org>
887
888         Unreviewed, rolling out r185906.
889         https://bugs.webkit.org/show_bug.cgi?id=146276
890
891         MSVC doesn't yet provide a const-qualified std::array<T,
892         N>::size(), failing to compile the static_assert (Requested by
893         zdobersek on #webkit).
894
895         Reverted changeset:
896
897         "Improve the source code generated by make_names.pl"
898         https://bugs.webkit.org/show_bug.cgi?id=146208
899         http://trac.webkit.org/changeset/185906
900
901 2015-06-24  Zan Dobersek  <zdobersek@igalia.com>
902
903         Improve the source code generated by make_names.pl
904         https://bugs.webkit.org/show_bug.cgi?id=146208
905
906         Reviewed by Darin Adler.
907
908         * wtf/text/StringImpl.h:
909         (WTF::StringImpl::assertHashIsCorrect): Make this method const-qualified.
910
911 2015-06-22  Darin Adler  <darin@apple.com>
912
913         Make Array.join work directly on substrings without reifying them
914         https://bugs.webkit.org/show_bug.cgi?id=146191
915
916         Reviewed by Andreas Kling.
917
918         * wtf/Vector.h: Added an overload of uncheckedAppend like the one we added
919         a while back, a non-template function that forwards through to the function
920         template. This lets us call uncheckedAppend on an argument list and have it
921         properly convert it to the Vector's element type.
922
923         * wtf/text/StringView.h:
924         (WTF::StringView::getCharactersWithUpconvert): Changed to not use memcpy;
925         saw some indication the hand-written loop was faster when profiling. Also
926         use m_length directly when we know we are dealing with an 8-bit string,
927         since the masking that the index function does is not needed in that case.
928         (WTF::StringView::UpconvertedCharacters::UpconvertedCharacters): Ditto.
929         (WTF::StringView::toString): Ditto.
930         (WTF::StringView::toFloat): Ditto.
931         (WTF::StringView::toInt): Ditto.
932         (WTF::StringView::toStringWithoutCopying): Ditto.
933         (WTF::StringView::find): Ditto.
934
935 2015-06-22  YunQiang Su  <wzssyqa@gmail.com>
936
937         [WTF] Platform.h: use _ABI64 instead of _MIPS_SIM_ABI64 to determine MIPS N64
938         https://bugs.webkit.org/show_bug.cgi?id=145113
939
940         Reviewed by Csaba Osztrogonác.
941
942         * wtf/Platform.h:
943
944 2015-06-22  Anders Carlsson  <andersca@apple.com>
945
946         Fix build.
947
948         * wtf/threads/BinarySemaphore.cpp:
949
950 2015-06-22  Anders Carlsson  <andersca@apple.com>
951
952         Get rid of the Windows specific BinarySemaphore implementation
953         https://bugs.webkit.org/show_bug.cgi?id=146216
954
955         Reviewed by Andreas Kling.
956
957         The fact that the Windows implementation uses a HEVENT internally was only useful
958         to the Windows port of WebKit2; we can get rid of it now.
959
960         * WTF.vcxproj/WTF.vcxproj:
961         * WTF.vcxproj/WTF.vcxproj.filters:
962         * wtf/threads/BinarySemaphore.h:
963         (WTF::BinarySemaphore::event): Deleted.
964         * wtf/threads/win/BinarySemaphoreWin.cpp: Removed.
965         (WTF::BinarySemaphore::BinarySemaphore): Deleted.
966         (WTF::BinarySemaphore::~BinarySemaphore): Deleted.
967         (WTF::BinarySemaphore::signal): Deleted.
968         (WTF::BinarySemaphore::wait): Deleted.
969
970 2015-06-21  Gavin Barraclough  <barraclough@apple.com>
971
972         Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
973         https://bugs.webkit.org/show_bug.cgi?id=146198
974
975         Unreviewed rollout.
976
977         * wtf/glib/GUniquePtr.h:
978
979 2015-06-20  Michael Catanzaro  <mcatanzaro@igalia.com>
980
981         [EFL][GTK] Define GLIB_VERSION_MIN_REQUIRED and require glib 2.36 for GTK
982         https://bugs.webkit.org/show_bug.cgi?id=146181
983
984         Reviewed by Martin Robinson.
985
986         Define GLIB_VERSION_MIN_REQUIRED to avoid deprecation warnings.
987
988         * wtf/Platform.h:
989
990 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
991
992         [SOUP] Define SOUP_VERSION_MIN_REQUIRED
993         https://bugs.webkit.org/show_bug.cgi?id=146165
994
995         Reviewed by Martin Robinson.
996
997         Define SOUP_VERSION_MIN_REQUIRED to avoid deprecation warnings.
998
999         * wtf/Platform.h:
1000
1001 2015-06-19  Mark Lam  <mark.lam@apple.com>
1002
1003         Gardening: build fixes for GTK and EFL for CheckedArithmetic change.
1004
1005         Not reviewed.
1006
1007         * wtf/CheckedArithmetic.h:
1008         (WTF::Checked::operator<):
1009         (WTF::Checked::operator<=):
1010         (WTF::Checked::operator>):
1011         (WTF::Checked::operator>=):
1012
1013 2015-06-19  Mark Lam  <mark.lam@apple.com>
1014
1015         CheckedArithmetic's operator bool() and operator==() is broken.
1016         https://bugs.webkit.org/show_bug.cgi?id=146129
1017
1018         Reviewed by Geoffrey Garen and Oliver Hunt.
1019
1020         The existing operator UnspecifiedBoolType*() in CheckedArithmetic is erroneously
1021         allowing the Checked value to be implicitly casted into pointer types.  This is
1022         because it is doing a reinterpret_cast<UnspecifiedBoolType*>(1) whereas the idiom
1023         relies on the address of a member e.g. &Checked::m_value.  As a result,
1024         ImageBufferData::putData() was getting an implicit cast of a Checked value to
1025         (void*)1 and doing incorrect pointer comparisons on it.
1026
1027         Also, 2 of CheckedArithmetic's operator==() will crash if used on an overflowed
1028         value, while a 3rd one does not.  The 3rd one should be consistent and also crash
1029         if used on an overflowed Checked value.
1030
1031         In this fix, we replace operator UnspecifiedBoolType*() with an explicit operator
1032         bool().  We also add the missing operators <, <=, >, and >=.  That takes care of
1033         the comparisons in ImageBufferData::putData().
1034
1035         * wtf/CheckedArithmetic.h:
1036         (WTF::CrashOnOverflow::overflowed):
1037         (WTF::CrashOnOverflow::crash):
1038         (WTF::RecordOverflow::crash):
1039
1040         (WTF::Checked::operator!):
1041         (WTF::Checked::operator bool):
1042         (WTF::Checked::unsafeGet):
1043         - Don't call CRASH() directly.  Delegate to the handler.
1044
1045         (WTF::Checked::operator==):
1046         - Should call the handler's crash() to be consistent with the other 2 versions of
1047           operator== which will crash in unsafeGet() if used on an overflowed Checked
1048           value.
1049
1050         (WTF::Checked::operator<):
1051         (WTF::Checked::operator<=):
1052         (WTF::Checked::operator>):
1053         (WTF::Checked::operator>=):
1054         - Add missing operators.
1055
1056         (WTF::Checked::operator UnspecifiedBoolType*): Deleted.
1057
1058 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
1059
1060         [WK2] Fix unused-private-field warning in WebProcess/Plugins/PluginView.<h|cpp>
1061         https://bugs.webkit.org/show_bug.cgi?id=145252
1062
1063         Reviewed by Tim Horton.
1064
1065         * wtf/FeatureDefines.h: Moved the definition of ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC
1066         here from Source/WebKit2/WebProcess/WebPage/WebPage.h
1067
1068 2015-06-17  Andreas Kling  <akling@apple.com>
1069
1070         SegmentedVector should waste less memory.
1071         <https://webkit.org/b/146069>
1072
1073         Reviewed by Anders Carlsson.
1074
1075         We were wasting sizeof(Vector) on every segment in SegmentVector.
1076         The segments were using inline capacity, and would never go beyond it,
1077         so all the size/capacity/out-of-line-buffer metadata was useless.
1078
1079         Change the internal representation to Vector<T[SegmentSize]> instead.
1080         This saves 16 bytes per segment, so lower SegmentSize -> bigger savings!
1081
1082         * wtf/SegmentedVector.h:
1083         (WTF::SegmentedVectorIterator::operator*):
1084         (WTF::SegmentedVectorIterator::operator->):
1085         (WTF::SegmentedVectorIterator::operator++):
1086         (WTF::SegmentedVectorIterator::operator==):
1087         (WTF::SegmentedVectorIterator::operator!=):
1088         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
1089         (WTF::SegmentedVector::at):
1090         (WTF::SegmentedVector::append):
1091         (WTF::SegmentedVector::removeLast):
1092         (WTF::SegmentedVector::grow):
1093         (WTF::SegmentedVector::begin):
1094         (WTF::SegmentedVector::end):
1095         (WTF::SegmentedVector::deleteAllSegments):
1096         (WTF::SegmentedVector::ensureSegmentsFor):
1097         (WTF::SegmentedVector::ensureSegment):
1098         (WTF::SegmentedVector::allocateSegment):
1099         (WTF::SegmentedVectorIterator::operator=): Deleted.
1100         (WTF::SegmentedVector::SegmentedVector): Deleted.
1101
1102 2015-06-16  Andreas Kling  <akling@apple.com>
1103
1104         Remove unused template parameter InlineCapacity from SegmentedVector.
1105         <https://webkit.org/b/146044>
1106
1107         Reviewed by Anders Carlsson.
1108
1109         * wtf/SegmentedVector.h:
1110         (WTF::SegmentedVectorIterator::operator=):
1111         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
1112         (WTF::SegmentedVector::at):
1113
1114 2015-06-16  Mark Lam  <mark.lam@apple.com>
1115
1116         Use NakedPtr<Exception>& to return exception results.
1117         https://bugs.webkit.org/show_bug.cgi?id=145870
1118
1119         Reviewed by Anders Carlsson and Filip Pizlo.
1120
1121         Introducing the NakedPtr class.
1122
1123         * WTF.xcodeproj/project.pbxproj:
1124         * wtf/NakedPtr.h: Added.
1125         (WTF::NakedPtr::NakedPtr):
1126         (WTF::NakedPtr::get):
1127         (WTF::NakedPtr::clear):
1128         (WTF::NakedPtr::operator*):
1129         (WTF::NakedPtr::operator->):
1130         (WTF::NakedPtr::operator T*):
1131         (WTF::NakedPtr::operator!):
1132         (WTF::NakedPtr::operator bool):
1133         (WTF::=):
1134         (WTF::NakedPtr<T>::swap):
1135         (WTF::swap):
1136
1137 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
1138
1139         [GLib] Move files under Source/WTF/wtf/gobject to Source/WTF/wtf/glib
1140         https://bugs.webkit.org/show_bug.cgi?id=145799
1141
1142         Reviewed by Carlos Garcia Campos.
1143
1144         Move the GLib-specific files to the Source/WTF/wtf/glib/ directory.
1145         'gobject' wasn't the most appropriate name for the directory since
1146         GObject is a submodule of GLib, but a lot of the code there didn't
1147         have much to do with GObject specifically.
1148
1149         Build rules for the moved files are also updated.
1150
1151         * WTF.vcxproj/WTF.vcxproj:
1152         * WTF.vcxproj/WTF.vcxproj.filters:
1153         * wtf/Platform.h:
1154         * wtf/PlatformEfl.cmake:
1155         * wtf/PlatformGTK.cmake:
1156         * wtf/RunLoop.h:
1157         * wtf/WorkQueue.h:
1158         * wtf/glib/GLibUtilities.cpp: Renamed from Source/WTF/wtf/gobject/GlibUtilities.cpp.
1159         (getCurrentExecutablePath):
1160         * wtf/glib/GLibUtilities.h: Renamed from Source/WTF/wtf/gobject/GlibUtilities.h.
1161         * wtf/glib/GMainLoopSource.cpp: Renamed from Source/WTF/wtf/gobject/GMainLoopSource.cpp.
1162         (WTF::GMainLoopSource::create):
1163         (WTF::GMainLoopSource::GMainLoopSource):
1164         (WTF::GMainLoopSource::~GMainLoopSource):
1165         (WTF::GMainLoopSource::isScheduled):
1166         (WTF::GMainLoopSource::isActive):
1167         (WTF::GMainLoopSource::cancel):
1168         (WTF::GMainLoopSource::scheduleIdleSource):
1169         (WTF::GMainLoopSource::schedule):
1170         (WTF::GMainLoopSource::scheduleTimeoutSource):
1171         (WTF::GMainLoopSource::scheduleAfterDelay):
1172         (WTF::createMicrosecondsTimeoutSource):
1173         (WTF::GMainLoopSource::scheduleAndDeleteOnDestroy):
1174         (WTF::GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy):
1175         (WTF::GMainLoopSource::prepareVoidCallback):
1176         (WTF::GMainLoopSource::finishVoidCallback):
1177         (WTF::GMainLoopSource::voidCallback):
1178         (WTF::GMainLoopSource::prepareBoolCallback):
1179         (WTF::GMainLoopSource::finishBoolCallback):
1180         (WTF::GMainLoopSource::boolCallback):
1181         (WTF::GMainLoopSource::socketCallback):
1182         (WTF::GMainLoopSource::voidSourceCallback):
1183         (WTF::GMainLoopSource::boolSourceCallback):
1184         (WTF::GMainLoopSource::socketSourceCallback):
1185         (WTF::GMainLoopSource::Context::destroySource):
1186         * wtf/glib/GMainLoopSource.h: Renamed from Source/WTF/wtf/gobject/GMainLoopSource.h.
1187         (WTF::GMainLoopSource::Context::operator=):
1188         * wtf/glib/GMutexLocker.h: Renamed from Source/WTF/wtf/gobject/GMutexLocker.h.
1189         (WTF::MutexWrapper<GMutex>::lock):
1190         (WTF::MutexWrapper<GMutex>::unlock):
1191         (WTF::MutexWrapper<GRecMutex>::lock):
1192         (WTF::MutexWrapper<GRecMutex>::unlock):
1193         (WTF::GMutexLocker::GMutexLocker):
1194         (WTF::GMutexLocker::~GMutexLocker):
1195         (WTF::GMutexLocker::lock):
1196         (WTF::GMutexLocker::unlock):
1197         * wtf/glib/GRefPtr.cpp: Renamed from Source/WTF/wtf/gobject/GRefPtr.cpp.
1198         (WTF::refGPtr):
1199         (WTF::derefGPtr):
1200         * wtf/glib/GRefPtr.h: Renamed from Source/WTF/wtf/gobject/GRefPtr.h.
1201         (WTF::GRefPtr::GRefPtr):
1202         (WTF::GRefPtr::~GRefPtr):
1203         (WTF::GRefPtr::clear):
1204         (WTF::GRefPtr::outPtr):
1205         (WTF::GRefPtr::isHashTableDeletedValue):
1206         (WTF::GRefPtr::get):
1207         (WTF::GRefPtr::operator*):
1208         (WTF::GRefPtr::operator->):
1209         (WTF::GRefPtr::operator!):
1210         (WTF::GRefPtr::operator UnspecifiedBoolType):
1211         (WTF::GRefPtr::hashTableDeletedValue):
1212         (WTF::=):
1213         (WTF::GRefPtr<T>::swap):
1214         (WTF::swap):
1215         (WTF::operator==):
1216         (WTF::operator!=):
1217         (WTF::static_pointer_cast):
1218         (WTF::const_pointer_cast):
1219         (WTF::adoptGRef):
1220         (WTF::refGPtr):
1221         (WTF::derefGPtr):
1222         * wtf/glib/GThreadSafeMainLoopSource.cpp: Renamed from Source/WTF/wtf/gobject/GThreadSafeMainLoopSource.cpp.
1223         (WTF::GThreadSafeMainLoopSource::GThreadSafeMainLoopSource):
1224         (WTF::GThreadSafeMainLoopSource::~GThreadSafeMainLoopSource):
1225         (WTF::GThreadSafeMainLoopSource::cancel):
1226         (WTF::GThreadSafeMainLoopSource::schedule):
1227         (WTF::GThreadSafeMainLoopSource::scheduleAfterDelay):
1228         (WTF::GThreadSafeMainLoopSource::prepareVoidCallback):
1229         (WTF::GThreadSafeMainLoopSource::finishVoidCallback):
1230         (WTF::GThreadSafeMainLoopSource::voidCallback):
1231         (WTF::GThreadSafeMainLoopSource::prepareBoolCallback):
1232         (WTF::GThreadSafeMainLoopSource::finishBoolCallback):
1233         (WTF::GThreadSafeMainLoopSource::boolCallback):
1234         * wtf/glib/GThreadSafeMainLoopSource.h: Renamed from Source/WTF/wtf/gobject/GThreadSafeMainLoopSource.h.
1235         * wtf/glib/GTypedefs.h: Renamed from Source/WTF/wtf/gobject/GTypedefs.h.
1236         * wtf/glib/GUniquePtr.h: Renamed from Source/WTF/wtf/gobject/GUniquePtr.h.
1237         (WTF::GPtrDeleter::operator()):
1238         (WTF::GUniqueOutPtr::GUniqueOutPtr):
1239         (WTF::GUniqueOutPtr::~GUniqueOutPtr):
1240         (WTF::GUniqueOutPtr::outPtr):
1241         (WTF::GUniqueOutPtr::release):
1242         (WTF::GUniqueOutPtr::operator*):
1243         (WTF::GUniqueOutPtr::operator->):
1244         (WTF::GUniqueOutPtr::get):
1245         (WTF::GUniqueOutPtr::operator!):
1246         (WTF::GUniqueOutPtr::operator UnspecifiedBoolType):
1247         (WTF::GUniqueOutPtr::reset):
1248         * wtf/glib/MainThreadGLib.cpp:
1249         * wtf/gobject/GMainLoopSource.cpp:
1250         (WTF::GMainLoopSource::create): Deleted.
1251         (WTF::GMainLoopSource::GMainLoopSource): Deleted.
1252         (WTF::GMainLoopSource::~GMainLoopSource): Deleted.
1253         (WTF::GMainLoopSource::isScheduled): Deleted.
1254         (WTF::GMainLoopSource::isActive): Deleted.
1255         (WTF::GMainLoopSource::cancel): Deleted.
1256         (WTF::GMainLoopSource::scheduleIdleSource): Deleted.
1257         (WTF::GMainLoopSource::schedule): Deleted.
1258         (WTF::GMainLoopSource::scheduleTimeoutSource): Deleted.
1259         (WTF::GMainLoopSource::scheduleAfterDelay): Deleted.
1260         (WTF::createMicrosecondsTimeoutSource): Deleted.
1261         (WTF::GMainLoopSource::scheduleAndDeleteOnDestroy): Deleted.
1262         (WTF::GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy): Deleted.
1263         (WTF::GMainLoopSource::prepareVoidCallback): Deleted.
1264         (WTF::GMainLoopSource::finishVoidCallback): Deleted.
1265         (WTF::GMainLoopSource::voidCallback): Deleted.
1266         (WTF::GMainLoopSource::prepareBoolCallback): Deleted.
1267         (WTF::GMainLoopSource::finishBoolCallback): Deleted.
1268         (WTF::GMainLoopSource::boolCallback): Deleted.
1269         (WTF::GMainLoopSource::socketCallback): Deleted.
1270         (WTF::GMainLoopSource::voidSourceCallback): Deleted.
1271         (WTF::GMainLoopSource::boolSourceCallback): Deleted.
1272         (WTF::GMainLoopSource::socketSourceCallback): Deleted.
1273         (WTF::GMainLoopSource::Context::destroySource): Deleted.
1274         * wtf/gobject/GMainLoopSource.h:
1275         (WTF::GMainLoopSource::Context::operator=): Deleted.
1276         * wtf/gobject/GMutexLocker.h:
1277         (WTF::MutexWrapper<GMutex>::lock): Deleted.
1278         (WTF::MutexWrapper<GMutex>::unlock): Deleted.
1279         (WTF::MutexWrapper<GRecMutex>::lock): Deleted.
1280         (WTF::MutexWrapper<GRecMutex>::unlock): Deleted.
1281         (WTF::GMutexLocker::GMutexLocker): Deleted.
1282         (WTF::GMutexLocker::~GMutexLocker): Deleted.
1283         (WTF::GMutexLocker::lock): Deleted.
1284         (WTF::GMutexLocker::unlock): Deleted.
1285         * wtf/gobject/GRefPtr.cpp:
1286         (WTF::refGPtr): Deleted.
1287         (WTF::derefGPtr): Deleted.
1288         * wtf/gobject/GRefPtr.h:
1289         (WTF::GRefPtr::GRefPtr): Deleted.
1290         (WTF::GRefPtr::~GRefPtr): Deleted.
1291         (WTF::GRefPtr::clear): Deleted.
1292         (WTF::GRefPtr::outPtr): Deleted.
1293         (WTF::GRefPtr::isHashTableDeletedValue): Deleted.
1294         (WTF::GRefPtr::get): Deleted.
1295         (WTF::GRefPtr::operator*): Deleted.
1296         (WTF::GRefPtr::operator->): Deleted.
1297         (WTF::GRefPtr::operator!): Deleted.
1298         (WTF::GRefPtr::operator UnspecifiedBoolType): Deleted.
1299         (WTF::GRefPtr::hashTableDeletedValue): Deleted.
1300         (WTF::=): Deleted.
1301         (WTF::GRefPtr<T>::swap): Deleted.
1302         (WTF::swap): Deleted.
1303         (WTF::operator==): Deleted.
1304         (WTF::operator!=): Deleted.
1305         (WTF::static_pointer_cast): Deleted.
1306         (WTF::const_pointer_cast): Deleted.
1307         (WTF::adoptGRef): Deleted.
1308         (WTF::refGPtr): Deleted.
1309         (WTF::derefGPtr): Deleted.
1310         * wtf/gobject/GThreadSafeMainLoopSource.cpp:
1311         (WTF::GThreadSafeMainLoopSource::GThreadSafeMainLoopSource): Deleted.
1312         (WTF::GThreadSafeMainLoopSource::~GThreadSafeMainLoopSource): Deleted.
1313         (WTF::GThreadSafeMainLoopSource::cancel): Deleted.
1314         (WTF::GThreadSafeMainLoopSource::schedule): Deleted.
1315         (WTF::GThreadSafeMainLoopSource::scheduleAfterDelay): Deleted.
1316         (WTF::GThreadSafeMainLoopSource::prepareVoidCallback): Deleted.
1317         (WTF::GThreadSafeMainLoopSource::finishVoidCallback): Deleted.
1318         (WTF::GThreadSafeMainLoopSource::voidCallback): Deleted.
1319         (WTF::GThreadSafeMainLoopSource::prepareBoolCallback): Deleted.
1320         (WTF::GThreadSafeMainLoopSource::finishBoolCallback): Deleted.
1321         (WTF::GThreadSafeMainLoopSource::boolCallback): Deleted.
1322         * wtf/gobject/GUniquePtr.h:
1323         (WTF::GPtrDeleter::operator()): Deleted.
1324         (WTF::GUniqueOutPtr::GUniqueOutPtr): Deleted.
1325         (WTF::GUniqueOutPtr::~GUniqueOutPtr): Deleted.
1326         (WTF::GUniqueOutPtr::outPtr): Deleted.
1327         (WTF::GUniqueOutPtr::release): Deleted.
1328         (WTF::GUniqueOutPtr::operator*): Deleted.
1329         (WTF::GUniqueOutPtr::operator->): Deleted.
1330         (WTF::GUniqueOutPtr::get): Deleted.
1331         (WTF::GUniqueOutPtr::operator!): Deleted.
1332         (WTF::GUniqueOutPtr::operator UnspecifiedBoolType): Deleted.
1333         (WTF::GUniqueOutPtr::reset): Deleted.
1334         * wtf/gobject/GlibUtilities.cpp:
1335         (getCurrentExecutablePath): Deleted.
1336
1337 2015-06-10  Basile Clement  <basile_clement@apple.com>
1338
1339         Unreviewed, fix an typo in unused template code.
1340
1341         * wtf/TinyPtrSet.h:
1342         (WTF::TinyPtrSet::iterator::operator*): s/at(index)/at(m_index)/
1343
1344 2015-06-09  Csaba Osztrogonác  <ossy@webkit.org>
1345
1346         [cmake] Fix the style issues in cmake project files
1347         https://bugs.webkit.org/show_bug.cgi?id=145755
1348
1349         Reviewed by Darin Adler.
1350
1351         * wtf/CMakeLists.txt:
1352
1353 2015-06-08  Alexey Proskuryakov  <ap@apple.com>
1354
1355         Build fix.
1356
1357         * wtf/TinyPtrSet.h: (WTF::TinyPtrSet::isEmpty): s/poointer/pointer/
1358
1359 2015-06-07  Filip Pizlo  <fpizlo@apple.com>
1360
1361         The tiny set magic in StructureSet should be available in WTF
1362         https://bugs.webkit.org/show_bug.cgi?id=145722
1363
1364         Reviewed by Geoffrey Garen.
1365         
1366         As the management of structure sets evolved in JSC, the StructureSet data structure grew
1367         increasingly smart. It's got some smart stuff for managing small sets of pointers. I
1368         wanted to take the generic logic out of JSC and put it into a reusable templatized class
1369         in WTF.
1370         
1371         * WTF.vcxproj/WTF.vcxproj:
1372         * WTF.xcodeproj/project.pbxproj:
1373         * wtf/CMakeLists.txt:
1374         * wtf/TinyPtrSet.h: Added.
1375         (WTF::TinyPtrSet::TinyPtrSet):
1376         (WTF::TinyPtrSet::operator=):
1377         (WTF::TinyPtrSet::~TinyPtrSet):
1378         (WTF::TinyPtrSet::clear):
1379         (WTF::TinyPtrSet::onlyEntry):
1380         (WTF::TinyPtrSet::isEmpty):
1381         (WTF::TinyPtrSet::add):
1382         (WTF::TinyPtrSet::remove):
1383         (WTF::TinyPtrSet::contains):
1384         (WTF::TinyPtrSet::merge):
1385         (WTF::TinyPtrSet::forEach):
1386         (WTF::TinyPtrSet::genericFilter):
1387         (WTF::TinyPtrSet::filter):
1388         (WTF::TinyPtrSet::exclude):
1389         (WTF::TinyPtrSet::isSubsetOf):
1390         (WTF::TinyPtrSet::isSupersetOf):
1391         (WTF::TinyPtrSet::overlaps):
1392         (WTF::TinyPtrSet::size):
1393         (WTF::TinyPtrSet::at):
1394         (WTF::TinyPtrSet::operator[]):
1395         (WTF::TinyPtrSet::last):
1396         (WTF::TinyPtrSet::iterator::iterator):
1397         (WTF::TinyPtrSet::iterator::operator*):
1398         (WTF::TinyPtrSet::iterator::operator++):
1399         (WTF::TinyPtrSet::iterator::operator==):
1400         (WTF::TinyPtrSet::iterator::operator!=):
1401         (WTF::TinyPtrSet::begin):
1402         (WTF::TinyPtrSet::end):
1403         (WTF::TinyPtrSet::operator==):
1404         (WTF::TinyPtrSet::addOutOfLine):
1405         (WTF::TinyPtrSet::containsOutOfLine):
1406         (WTF::TinyPtrSet::copyFrom):
1407         (WTF::TinyPtrSet::copyFromOutOfLine):
1408         (WTF::TinyPtrSet::OutOfLineList::create):
1409         (WTF::TinyPtrSet::OutOfLineList::destroy):
1410         (WTF::TinyPtrSet::OutOfLineList::list):
1411         (WTF::TinyPtrSet::OutOfLineList::OutOfLineList):
1412         (WTF::TinyPtrSet::deleteListIfNecessary):
1413         (WTF::TinyPtrSet::isThin):
1414         (WTF::TinyPtrSet::pointer):
1415         (WTF::TinyPtrSet::singleEntry):
1416         (WTF::TinyPtrSet::list):
1417         (WTF::TinyPtrSet::set):
1418         (WTF::TinyPtrSet::setEmpty):
1419         (WTF::TinyPtrSet::getReservedFlag):
1420         (WTF::TinyPtrSet::setReservedFlag):
1421
1422 2015-06-05  Chris Dumez  <cdumez@apple.com>
1423
1424         [WK2][iOS] Limit the number of vnodes used by the WebContent processes
1425         https://bugs.webkit.org/show_bug.cgi?id=145672
1426         <rdar://problem/21126637>
1427
1428         Reviewed by Antti Koivisto.
1429
1430         * wtf/RefCounter.h:
1431         (WTF::RefCounter::value):
1432
1433         Expose the actual refcount instead of a boolean value.
1434
1435 2015-06-05  Alex Christensen  <achristensen@webkit.org>
1436
1437         [Web Timing] Use new SPI to enable data collection.
1438         https://bugs.webkit.org/show_bug.cgi?id=145650
1439         rdar://problem/21203358
1440
1441         Reviewed by Chris Dumez.
1442
1443         * wtf/Platform.h:
1444         Added HAVE_TIMINGDATAOPTIONS for platform and version dependent feature.
1445
1446 2015-06-05  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1447
1448         [Streams API] ReadableStream should store callbacks as a Deque
1449         https://bugs.webkit.org/show_bug.cgi?id=145641
1450
1451         Reviewed by Darin Adler.
1452
1453         * wtf/Deque.h:
1454         (WTF::Deque::append): Adding not templated append method, forwarding to templated append method.
1455
1456 2015-06-02  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1457
1458         [Streams API] Delegate ReadableStreamReader reference counting to ReadableStream
1459         https://bugs.webkit.org/show_bug.cgi?id=144907
1460
1461         Reviewed by Darin Adler.
1462
1463         * wtf/Vector.h:
1464         (WTF::Vector::append): Adding not templated append method, forwarding to ValueType templated append method.
1465
1466 2015-06-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1467
1468         Heap-use-after-free read of size 4 in JavaScriptCore: WTF::StringImpl::isSymbol() (StringImpl.h:496)
1469         https://bugs.webkit.org/show_bug.cgi?id=145532
1470
1471         Reviewed by Geoffrey Garen.
1472
1473         Return `RefPtr<AtomicStringImpl>` instead of `AtomicStringImpl*`.
1474
1475         * wtf/text/AtomicStringImpl.cpp:
1476         (WTF::AtomicStringImpl::lookUpSlowCase):
1477         (WTF::AtomicStringImpl::lookUpInternal):
1478         * wtf/text/AtomicStringImpl.h:
1479         (WTF::AtomicStringImpl::lookUp):
1480
1481 2015-06-01  Anders Carlsson  <andersca@apple.com>
1482
1483         Use xpc_connection_set_oneshot_instance where possible
1484         https://bugs.webkit.org/show_bug.cgi?id=145535
1485         rdar://problem/21109994
1486
1487         Reviewed by Sam Weinig.
1488
1489         Add SPI declaration.
1490
1491         * wtf/spi/darwin/XPCSPI.h:
1492
1493 2015-05-29  Anders Carlsson  <andersca@apple.com>
1494
1495         Missing #import of Platform.h in several WTF headers
1496         https://bugs.webkit.org/show_bug.cgi?id=145475
1497         rdar://problem/21161818
1498
1499         Reviewed by Darin Adler.
1500
1501         Add Platform.h #includes.
1502
1503         * wtf/Assertions.h:
1504         * wtf/RetainPtr.h:
1505
1506 2015-05-29  Commit Queue  <commit-queue@webkit.org>
1507
1508         Unreviewed, rolling out r184949.
1509         https://bugs.webkit.org/show_bug.cgi?id=145458
1510
1511         Ends up generating worse code for HashTable move constructors
1512         (Requested by zdobersek on #webkit).
1513
1514         Reverted changeset:
1515
1516         "Clean up HashTable constructors"
1517         https://bugs.webkit.org/show_bug.cgi?id=145369
1518         http://trac.webkit.org/changeset/184949
1519
1520 2015-05-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1521
1522         Purge PassRefPtr in StringConcatenate.h
1523         https://bugs.webkit.org/show_bug.cgi?id=145376
1524
1525         Reviewed by Darin Adler.
1526
1527         Replace PassRefPtr with RefPtr. Additionally use nullptr instead of 0.
1528
1529         * wtf/text/StringConcatenate.h:
1530         (WTF::tryMakeString):
1531         (WTF::makeString):
1532
1533 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
1534
1535         Clean up HashTable constructors
1536         https://bugs.webkit.org/show_bug.cgi?id=145369
1537
1538         Reviewed by Andreas Kling.
1539
1540         Use nullptr to initialize pointer member variables in the HashTable
1541         default constructor. Copy and move constructors can use constructor
1542         delegation instead of replicating all member initializations. Move
1543         constructor should simply call HashTable::swap() instead of replicating
1544         all the swap operations.
1545
1546         * wtf/HashTable.h:
1547         (WTF::KeyTraits>::HashTable):
1548
1549 2015-05-27  Alexey Proskuryakov  <ap@apple.com>
1550
1551         [Mac] Fix clang static analyzer build
1552         https://bugs.webkit.org/show_bug.cgi?id=145426
1553         rdar://problem/20947408
1554
1555         Reviewed by Dan Bernstein.
1556
1557         * wtf/spi/darwin/XPCSPI.h: Correct declarations of xpc_retain and xpc_release.
1558
1559 2015-05-27  Dean Jackson  <dino@apple.com>
1560
1561         img.currentSrc problem in strict mode with old picturefill
1562         https://bugs.webkit.org/show_bug.cgi?id=144095
1563         <rdar://problem/21087013>
1564
1565         Reviewed by Simon Fraser.
1566
1567         Add a PICTURE_SIZES flag.
1568
1569         * wtf/FeatureDefines.h:
1570
1571 2015-05-26  Andreas Kling  <akling@apple.com>
1572
1573         StringView should have find(StringView, start).
1574         <https://webkit.org/b/145351>
1575
1576         Reviewed by Darin Adler.
1577
1578         Move the class agnostic guts of StringImpl's find() implementation from StringImpl
1579         to StringCommon.h and templatize the code into a findCommon() helper.
1580
1581         StringImpl::find() and StringView::find() now both call findCommon().
1582
1583         * wtf/text/StringCommon.h:
1584         (WTF::findInner):
1585         (WTF::find):
1586         (WTF::findCommon):
1587         * wtf/text/StringImpl.cpp:
1588         (WTF::StringImpl::find):
1589         (WTF::findInner): Deleted.
1590         * wtf/text/StringImpl.h:
1591         (WTF::find): Deleted.
1592         * wtf/text/StringView.cpp:
1593         (WTF::StringView::find):
1594         * wtf/text/StringView.h:
1595
1596
1597 2015-05-26  Dan Bernstein  <mitz@apple.com>
1598
1599         <rdar://problem/21104551> Update build settings
1600
1601         Reviewed by Anders Carlsson.
1602
1603         * Configurations/DebugRelease.xcconfig:
1604
1605 2015-05-23  Dan Bernstein  <mitz@apple.com>
1606
1607         Remove unused definitions of WEBKIT_VERSION_MIN_REQUIRED
1608         https://bugs.webkit.org/show_bug.cgi?id=145345
1609
1610         Reviewed by Sam Weinig.
1611
1612         * Configurations/Base.xcconfig: Also changed to use $(inherited).
1613
1614 2015-05-23  Yusuke Suzuki  <utatane.tea@gmail.com>
1615
1616         Introduce UniquedStringImpl and SymbolImpl to separate symbolic strings from AtomicStringImpl
1617         https://bugs.webkit.org/show_bug.cgi?id=144848
1618
1619         Reviewed by Darin Adler.
1620
1621         he current AtomicStringImpl accidentally means the symbol OR atomic StringImpl.
1622         t's not correct to its name and it's error prone.
1623
1624         In this patch, we'll introduce/changes classes into WTF.
1625
1626         1. UniquedStringImpl
1627         It's derived class from StringImpl. And it represents symbol || atomic StringImpl.
1628
1629         2. SymbolImpl
1630         It's derived class from UniquedStringImpl. Only symbol strings can become this.
1631         It ensures the given StringImpl is symbol in compile time.
1632
1633         3. AtomicStringImpl
1634         It's derived class from UniquedStringImpl. Only atomic (non-normal && non-symbol) strings can become this.
1635         It ensures the given StringImpl is atomic in compile time.
1636
1637         And, in this time, I just accept UniqueStringImpl in AtomicString. As the result,
1638         1. Now AtomicStringImpl issue is fixed. Its SymbolImpl is separated and UniquedStringImpl is introduced.
1639         2. But AtomicString still have both symbol and atomic strings.
1640         This should be solved in the separated patch.
1641
1642         * WTF.vcxproj/WTF.vcxproj:
1643         * WTF.vcxproj/WTF.vcxproj.filters:
1644         * WTF.xcodeproj/project.pbxproj:
1645         * wtf/CMakeLists.txt:
1646         * wtf/PrintStream.cpp:
1647         * wtf/PrintStream.h:
1648         (WTF::printInternal):
1649         * wtf/text/AtomicString.h:
1650         (WTF::AtomicString::AtomicString):
1651         * wtf/text/AtomicStringImpl.h:
1652         * wtf/text/StringImpl.cpp:
1653         (WTF::StringImpl::~StringImpl):
1654         (WTF::StringImpl::createSymbol):
1655         (WTF::StringImpl::createSymbolEmpty):
1656         * wtf/text/StringImpl.h:
1657         * wtf/text/SymbolImpl.h: Copied from Source/JavaScriptCore/runtime/PrivateName.h.
1658         * wtf/text/SymbolRegistry.cpp:
1659         (WTF::SymbolRegistry::symbolForKey):
1660         (WTF::SymbolRegistry::keyForSymbol):
1661         (WTF::SymbolRegistry::remove):
1662         * wtf/text/SymbolRegistry.h:
1663         * wtf/text/UniquedStringImpl.h: Copied from Source/JavaScriptCore/runtime/PrivateName.h.
1664
1665 2015-05-20  Zan Dobersek  <zdobersek@igalia.com>
1666
1667         [GTK] Move MainThreadGtk, RunLoopGtk, WorkQueueGtk under Source/WTF/wtf/glib/
1668         https://bugs.webkit.org/show_bug.cgi?id=145117
1669
1670         Reviewed by Csaba Osztrogonác.
1671
1672         Move the MainThreadGtk, RunLoopGtk and WorkQueueGtk implementation files from
1673         Source/WTF/wtf/gtk/ to Source/WTF/wtf/glib/. These implementations are not
1674         GTK-specific and only depend on GLib, so they are renamed as well.
1675
1676         There are other such implementations under Source/WTF/wtf/gobject/ (GObject
1677         is just a subset of GLib) that will be moved under the new directory in
1678         future patches.
1679
1680         * wtf/PlatformGTK.cmake:
1681         * wtf/glib/MainThreadGLib.cpp: Renamed from Source/WTF/wtf/gtk/MainThreadGtk.cpp.
1682         (WTF::initializeMainThreadPlatform):
1683         (WTF::scheduleDispatchFunctionsOnMainThread):
1684         * wtf/glib/RunLoopGLib.cpp: Renamed from Source/WTF/wtf/gtk/RunLoopGtk.cpp.
1685         (WTF::RunLoop::RunLoop):
1686         (WTF::RunLoop::~RunLoop):
1687         (WTF::RunLoop::run):
1688         (WTF::RunLoop::stop):
1689         (WTF::RunLoop::wakeUp):
1690         (WTF::RunLoop::TimerBase::TimerBase):
1691         (WTF::RunLoop::TimerBase::~TimerBase):
1692         (WTF::RunLoop::TimerBase::start):
1693         (WTF::RunLoop::TimerBase::stop):
1694         (WTF::RunLoop::TimerBase::isActive):
1695         * wtf/glib/WorkQueueGLib.cpp: Renamed from Source/WTF/wtf/gtk/WorkQueueGtk.cpp.
1696         (WTF::WorkQueue::platformInitialize):
1697         (WTF::WorkQueue::platformInvalidate):
1698         (WTF::WorkQueue::registerSocketEventHandler):
1699         (WTF::WorkQueue::unregisterSocketEventHandler):
1700         (WTF::WorkQueue::dispatch):
1701         (WTF::WorkQueue::dispatchAfter):
1702
1703 2015-05-19  Andreas Kling  <akling@apple.com>
1704
1705         Give StringView a utf8() API.
1706         <https://webkit.org/b/145201>
1707
1708         Reviewed by Anders Carlsson
1709
1710         Added an LChar version of StringImpl::utf8ForCharacters() and use that to give
1711         StringView a utf8() API just like String has.
1712
1713         * wtf/text/StringImpl.cpp:
1714         (WTF::StringImpl::utf8ForCharacters):
1715         * wtf/text/StringImpl.h:
1716         * wtf/text/StringView.cpp:
1717         (WTF::StringView::utf8):
1718         * wtf/text/StringView.h:
1719
1720 2015-05-19  Yusuke Suzuki  <utatane.tea@gmail.com>
1721
1722         Move AtomicStringImpl table related operations from AtomicString to AtomicStringImpl
1723         https://bugs.webkit.org/show_bug.cgi?id=145109
1724
1725         Reviewed by Darin Adler.
1726
1727         Now AtomicStringImpl table operations are located in AtomicString.
1728         But they should be under AtomicStringImpl.
1729         This patch simply moves these operations to AtomicStringImpl.
1730
1731         And this patch renames static AtomicString::find to static AtomicStringImpl::lookUp
1732         because it conflicts with AtomicStringImpl's member function name.
1733
1734         * WTF.vcxproj/WTF.vcxproj:
1735         * WTF.vcxproj/WTF.vcxproj.filters:
1736         * WTF.vcxproj/copy-files.cmd:
1737         * WTF.xcodeproj/project.pbxproj:
1738         * wtf/CMakeLists.txt:
1739         * wtf/PlatformMac.cmake:
1740         * wtf/PlatformWin.cmake:
1741         * wtf/text/AtomicString.cpp:
1742         (WTF::AtomicString::lower):
1743         (WTF::AtomicString::convertToASCIILowercase):
1744         (WTF::AtomicString::fromUTF8Internal):
1745         (WTF::AtomicStringTableLocker::AtomicStringTableLocker): Deleted.
1746         (WTF::stringTable): Deleted.
1747         (WTF::addToStringTable): Deleted.
1748         (WTF::CStringTranslator::hash): Deleted.
1749         (WTF::CStringTranslator::equal): Deleted.
1750         (WTF::CStringTranslator::translate): Deleted.
1751         (WTF::AtomicString::add): Deleted.
1752         (WTF::UCharBufferTranslator::hash): Deleted.
1753         (WTF::UCharBufferTranslator::equal): Deleted.
1754         (WTF::UCharBufferTranslator::translate): Deleted.
1755         (WTF::HashAndCharactersTranslator::hash): Deleted.
1756         (WTF::HashAndCharactersTranslator::equal): Deleted.
1757         (WTF::HashAndCharactersTranslator::translate): Deleted.
1758         (WTF::HashAndUTF8CharactersTranslator::hash): Deleted.
1759         (WTF::HashAndUTF8CharactersTranslator::equal): Deleted.
1760         (WTF::HashAndUTF8CharactersTranslator::translate): Deleted.
1761         (WTF::SubstringTranslator::translate): Deleted.
1762         (WTF::SubstringTranslator8::hash): Deleted.
1763         (WTF::SubstringTranslator8::equal): Deleted.
1764         (WTF::SubstringTranslator16::hash): Deleted.
1765         (WTF::SubstringTranslator16::equal): Deleted.
1766         (WTF::LCharBufferTranslator::hash): Deleted.
1767         (WTF::LCharBufferTranslator::equal): Deleted.
1768         (WTF::LCharBufferTranslator::translate): Deleted.
1769         (WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
1770         (WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
1771         (WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
1772         (WTF::AtomicString::addFromLiteralData): Deleted.
1773         (WTF::AtomicString::addSlowCase): Deleted.
1774         (WTF::AtomicString::remove): Deleted.
1775         (WTF::AtomicString::findSlowCase): Deleted.
1776         (WTF::AtomicString::findInternal): Deleted.
1777         (WTF::AtomicString::isInAtomicStringTable): Deleted.
1778         * wtf/text/AtomicString.h:
1779         (WTF::AtomicString::AtomicString):
1780         (WTF::AtomicString::fromUTF8):
1781         (WTF::AtomicString::find): Deleted.
1782         (WTF::AtomicString::add): Deleted.
1783         (WTF::AtomicString::addWithStringTableProvider): Deleted.
1784         * wtf/text/AtomicStringImpl.cpp: Copied from Source/WTF/wtf/text/AtomicString.cpp.
1785         (WTF::AtomicStringTableLocker::AtomicStringTableLocker):
1786         (WTF::stringTable):
1787         (WTF::addToStringTable):
1788         (WTF::CStringTranslator::hash):
1789         (WTF::CStringTranslator::equal):
1790         (WTF::CStringTranslator::translate):
1791         (WTF::AtomicStringImpl::add):
1792         (WTF::UCharBufferTranslator::hash):
1793         (WTF::UCharBufferTranslator::equal):
1794         (WTF::UCharBufferTranslator::translate):
1795         (WTF::HashAndCharactersTranslator::hash):
1796         (WTF::HashAndCharactersTranslator::equal):
1797         (WTF::HashAndCharactersTranslator::translate):
1798         (WTF::HashAndUTF8CharactersTranslator::hash):
1799         (WTF::HashAndUTF8CharactersTranslator::equal):
1800         (WTF::HashAndUTF8CharactersTranslator::translate):
1801         (WTF::SubstringTranslator::translate):
1802         (WTF::SubstringTranslator8::hash):
1803         (WTF::SubstringTranslator8::equal):
1804         (WTF::SubstringTranslator16::hash):
1805         (WTF::SubstringTranslator16::equal):
1806         (WTF::LCharBufferTranslator::hash):
1807         (WTF::LCharBufferTranslator::equal):
1808         (WTF::LCharBufferTranslator::translate):
1809         (WTF::CharBufferFromLiteralDataTranslator::hash):
1810         (WTF::CharBufferFromLiteralDataTranslator::equal):
1811         (WTF::CharBufferFromLiteralDataTranslator::translate):
1812         (WTF::AtomicStringImpl::addLiteral):
1813         (WTF::AtomicStringImpl::addSlowCase):
1814         (WTF::AtomicStringImpl::remove):
1815         (WTF::AtomicStringImpl::lookUpSlowCase):
1816         (WTF::AtomicStringImpl::addUTF8):
1817         (WTF::AtomicStringImpl::lookUpInternal):
1818         (WTF::AtomicStringImpl::isInAtomicStringTable):
1819         * wtf/text/AtomicStringImpl.h:
1820         (WTF::AtomicStringImpl::lookUp):
1821         (WTF::AtomicStringImpl::add):
1822         (WTF::AtomicStringImpl::addWithStringTableProvider):
1823         (WTF::AtomicStringImpl::AtomicStringImpl): Deleted.
1824         * wtf/text/StringImpl.cpp:
1825         (WTF::StringImpl::~StringImpl):
1826         * wtf/text/StringImpl.h:
1827         * wtf/text/WTFString.h:
1828         (WTF::String::String):
1829         * wtf/text/cf/AtomicStringCF.cpp:
1830         (WTF::AtomicString::add): Deleted.
1831         * wtf/text/cf/AtomicStringImplCF.cpp: Renamed from Source/WTF/wtf/text/cf/AtomicStringCF.cpp.
1832         (WTF::AtomicStringImpl::add):
1833
1834 2015-05-19  Ting-Wei Lan  <lantw44@gmail.com>
1835
1836         [SOUP] Use st_birthtime to get creation time of files on systems support it
1837         https://bugs.webkit.org/show_bug.cgi?id=144989
1838
1839         Reviewed by Carlos Garcia Campos.
1840
1841         Define HAVE(STAT_BIRTHTIME) as 1 on operating systems supporting
1842         getting creation time of files using st_birthtime in stat.
1843
1844         * wtf/Platform.h:
1845
1846 2015-05-19  Chris Dumez  <cdumez@apple.com>
1847
1848         Mark static variables as const when possible
1849         https://bugs.webkit.org/show_bug.cgi?id=145161
1850
1851         Reviewed by Andreas Kling.
1852
1853         * wtf/dtoa.cpp:
1854         (WTF::pow5mult):
1855
1856 2015-05-19  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1857
1858         [EFL] Remove unnecessary PLATFORM(EFL) macro in EFL specific files
1859         https://bugs.webkit.org/show_bug.cgi?id=145160
1860
1861         Reviewed by Csaba Osztrogonác.
1862
1863         * wtf/efl/EflTypedefs.h: Remove PLATFORM(EFL).
1864         * wtf/efl/UniquePtrEfl.h: ditto.
1865
1866 2015-05-18  Michael Catanzaro  <mcatanzaro@igalia.com>
1867
1868         [CMake] Ignore warnings in system headers
1869         https://bugs.webkit.org/show_bug.cgi?id=144747
1870
1871         Reviewed by Darin Adler.
1872
1873         Separate include directories into WebKit project includes and system includes. Suppress all
1874         warnings from headers in system include directories using the SYSTEM argument to
1875         the include_directories command.
1876
1877         * wtf/CMakeLists.txt:
1878         * wtf/PlatformEfl.cmake:
1879         * wtf/PlatformGTK.cmake:
1880
1881 2015-05-18  Myles C. Maxfield  <mmaxfield@apple.com>
1882
1883         Addressing post-review comments on r184353
1884         https://bugs.webkit.org/show_bug.cgi?id=145146
1885
1886         Reviewed by Benjamin Poulain.
1887
1888         Create an overload for equalIgnoringASCIICase() for AtomicString and string literals.
1889
1890         * wtf/text/AtomicString.h:
1891         (WTF::equalIgnoringASCIICase):
1892
1893 2015-05-18  Skachkov Alexandr  <gskachkov@gmail.com>
1894
1895         [ES6] Arrow function syntax. Feature flag for arrow function
1896         https://bugs.webkit.org/show_bug.cgi?id=145108
1897
1898         Reviewed by Ryosuke Niwa.
1899
1900         Added feature flag ENABLE_ES6_ARROWFUNCTION_SYNTAX for arrow function
1901
1902         * wtf/FeatureDefines.h:
1903
1904 2015-05-17  Benjamin Poulain  <benjamin@webkit.org>
1905
1906         Do not use fastMallocGoodSize anywhere
1907         https://bugs.webkit.org/show_bug.cgi?id=145103
1908
1909         Reviewed by Michael Saboff.
1910
1911         It is silly we see fastMallocGoodSize in profiles, it does absolutely nothing.
1912
1913         This patch keeps fastMallocGoodSize() around for older code linking
1914         with newer WebKit, but remove any use of it inside WebKit.
1915
1916         * wtf/FastMalloc.cpp:
1917         (WTF::fastMallocGoodSize):
1918         * wtf/FastMalloc.h:
1919         * wtf/Vector.h:
1920         (WTF::VectorBufferBase::allocateBuffer):
1921         (WTF::VectorBufferBase::tryAllocateBuffer):
1922         (WTF::VectorBufferBase::reallocateBuffer):
1923
1924 2015-05-15  Dan Bernstein  <mitz@apple.com>
1925
1926         Build fix for some versions of clang.
1927
1928         * wtf/SaturatedArithmetic.h:
1929         (signedAddOverflows):
1930         (signedSubtractOverflows):
1931
1932 2015-05-14  Dan Bernstein  <mitz@apple.com>
1933
1934         Reverted r177753, now that <rdar://problem/19347133> is fixed.
1935
1936         Rubber-stamped by Benjamin Poulain.
1937
1938         * wtf/SaturatedArithmetic.h:
1939         (signedAddOverflows):
1940         (signedSubtractOverflows):
1941
1942 2015-05-14  Myles C. Maxfield  <mmaxfield@apple.com>
1943
1944         Add String literal overloads to equalIgnoringASCIICase()
1945         https://bugs.webkit.org/show_bug.cgi?id=145008
1946
1947         Reviewed by Benjamin Poulain.
1948
1949         Create an overload for equalIgnoringASCIICase for string literals.
1950
1951         * wtf/text/StringImpl.h:
1952         (WTF::equalIgnoringASCIICase): Use a non-templated helper function.
1953         * wtf/text/StringImpl.cpp:
1954         (WTF::equalIgnoringASCIICase): Implement it.
1955         * wtf/text/StringView.h:
1956         (WTF::equalIgnoringASCIICase): Use a non-templated helper function.
1957         * wtf/text/StringView.cpp:
1958         (WTF::equalIgnoringASCIICase): Implement it.
1959         * wtf/text/WTFString.h:
1960         (WTF::equalIgnoringASCIICase): Delegate to StringImpl's implementation.
1961
1962 2015-05-14  Žan Doberšek  <zdobersek@igalia.com>
1963
1964         [GTK] RunLoop constructor should properly retrieve or establish the thread-default GMainContext
1965         https://bugs.webkit.org/show_bug.cgi?id=144732
1966
1967         Reviewed by Carlos Garcia Campos.
1968
1969         RunLoop constructor in the GTK implementation should use the
1970         existing thread-default context, create a new one if not on
1971         the main thread, or use the global-default one if on the main
1972         thread.
1973
1974         In RunLoop::run(), the GMainContext should then be pushed as
1975         the thread-default before calling g_main_loop_run(), and popped
1976         off when the main loop stops.
1977
1978         * wtf/gtk/RunLoopGtk.cpp:
1979         (WTF::RunLoop::RunLoop):
1980         (WTF::RunLoop::run):
1981
1982 2015-05-13  Oliver Hunt  <oliver@apple.com>
1983        Ensure that all the smart pointer types in WTF clear their pointer before deref
1984        https://bugs.webkit.org/show_bug.cgi?id=143789
1985
1986        Reviewed by Ryosuke Niwa.
1987
1988        In order to prevent use after free bugs caused by destructors
1989        that end up trying to access the smart pointer itself, we should
1990        make sure we always clear the m_ptr field before calling deref.
1991
1992        Essentially the UaF path is:
1993        struct Foo : RefCounted<Foo> {
1994          Wibble* m_wibble;
1995          void doSomething();
1996          ~Foo() { m_wibble->doSomethingLikeCleanup(); }
1997        };
1998
1999        struct Wibble {
2000          void doSomethingLikeCleanup()
2001          {
2002            if (m_foo) {
2003                /* if this branch is not here we get a null deref */
2004                m_foo->doSomething();
2005            }
2006          }
2007          void replaceFoo(Foo* foo) { m_foo = foo; }
2008          RefPtr<Foo> m_foo;
2009        };
2010
2011        Wibble* someWibble = /* a Wibble with m_foo->m_refCount == 1 */;
2012                             /* and m_foo points to someWibble       */;
2013
2014        someWibble->replaceFoo(someOtherFoo);
2015        + someWibble->m_foo->m_ptr->deref();
2016          + someWibble->m_foo->m_ptr->~Foo()
2017            + someWibble->m_foo->m_ptr->m_wibble->doSomethingLikeCleanup()
2018              + someWibble->m_foo->m_ptr->m_wibble /* someWibble */ ->m_foo->m_ptr /*logically dead*/ ->doSomething()
2019
2020        By clearing m_ptr first we either force a null pointer deref or
2021        we force our code down a path that does not use the dead smart
2022        pointer.
2023
2024        * wtf/PassRefPtr.h:
2025        (WTF::PassRefPtr::~PassRefPtr):
2026        * wtf/Ref.h:
2027        (WTF::Ref::~Ref):
2028        (WTF::Ref::operator=):
2029        * wtf/RefPtr.h:
2030        (WTF::RefPtr::~RefPtr):
2031        * wtf/RetainPtr.h:
2032        (WTF::RetainPtr::~RetainPtr):
2033        (WTF::RetainPtr<T>::clear):
2034
2035 2015-05-12  Michael Saboff  <msaboff@apple.com>
2036
2037         If JSC cannot get executable memory, it shouldn't call madvise
2038         https://bugs.webkit.org/show_bug.cgi?id=144931
2039
2040         Reviewed by Mark Lam.
2041
2042         Made calling madvise conditional on really getting mmapped memory.
2043
2044         * wtf/OSAllocatorPosix.cpp:
2045         (WTF::OSAllocator::reserveUncommitted):
2046
2047 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
2048
2049         [Win] Move Windows build target to Windows 7 (or newer)
2050         https://bugs.webkit.org/show_bug.cgi?id=144890
2051         <rdar://problem/20707307>
2052
2053         Reviewed by Anders Carlsson.
2054
2055         Update linked SDK and minimal Windows level to be compatible with
2056         Windows 7 or newer.
2057
2058         * WTF.vcxproj/WTF.vcxproj:
2059         * WTF.vcxproj/WTFGenerated.vcxproj:
2060         * config.h:
2061
2062 2015-05-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2063
2064         [GTK] WorkQueue objects are not released
2065         https://bugs.webkit.org/show_bug.cgi?id=144824
2066
2067         Reviewed by Žan Doberšek.
2068
2069         Do not keep a reference of the WorkQueue for the entire life of
2070         its worker thread, since every task scheduled on the WorkQueue
2071         already takes a reference. Instead, take a reference of the main
2072         loop to make sure that when the worker thread starts, the main
2073         loop hasn't been released to avoid runtime warnings (see
2074         webkit.org/b/140998). Also removed the g_main_context_pop_thread_default()
2075         from the thread body, since the thread-specific context queue will
2076         be freed anyway when the thread exits.
2077         If the WorkQueue is released early, before the thread has started,
2078         schedule a main loop quit in the context, to make sure it will
2079         be the first thing run by the main loop and the thread will exit.
2080
2081         * wtf/WorkQueue.h: Remove unused event loop mutex.
2082         * wtf/gtk/WorkQueueGtk.cpp:
2083         (WTF::WorkQueue::platformInitialize):
2084         (WTF::WorkQueue::platformInvalidate):
2085
2086 2015-05-09  Yoav Weiss  <yoav@yoav.ws>
2087
2088         Remove the PICTURE_SIZES build flag
2089         https://bugs.webkit.org/show_bug.cgi?id=144679
2090
2091         Reviewed by Benjamin Poulain.
2092
2093         Removed the PICTURE_SIZES build time flag.
2094
2095         * wtf/FeatureDefines.h:
2096
2097 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
2098
2099         Remove convenience constructors for TextRun
2100         https://bugs.webkit.org/show_bug.cgi?id=144752
2101
2102         Reviewed by Anders Carlsson.
2103
2104         No reason why StringView shouldn't have a StringImpl* constructor.
2105
2106         Test: StringView8Bit in TestWebKitAPI
2107
2108         * wtf/text/StringView.h: Add the constructor.
2109
2110 2015-05-08  Commit Queue  <commit-queue@webkit.org>
2111
2112         Unreviewed, rolling out r183996.
2113         https://bugs.webkit.org/show_bug.cgi?id=144806
2114
2115         ASan detected use-after free (Requested by ap on #webkit).
2116
2117         Reverted changeset:
2118
2119         "Remove convenience constructors for TextRun"
2120         https://bugs.webkit.org/show_bug.cgi?id=144752
2121         http://trac.webkit.org/changeset/183996
2122
2123 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
2124
2125         Remove convenience constructors for TextRun
2126         https://bugs.webkit.org/show_bug.cgi?id=144752
2127
2128         Reviewed by Anders Carlsson.
2129
2130         No reason why StringView shouldn't have a StringImpl* constructor.
2131
2132         Test: StringView8Bit in TestWebKitAPI
2133
2134         * wtf/text/StringView.h: Add the constructor.
2135
2136 2015-05-08  Andreas Kling  <akling@apple.com>
2137
2138         Optimize serialization of quoted JSON strings.
2139         <https://webkit.org/b/144754>
2140
2141         Reviewed by Darin Adler.
2142
2143         Add a StringBuilder API for appending a quoted JSON string. This is used by
2144         JSON.stringify() to implement efficient appending of strings while escaping
2145         quotes, control characters and \uNNNN-style characters.
2146
2147         The main benefit comes from only doing a single buffer expansion up front,
2148         instead of doing it every time we append something. The fudge factor is pretty
2149         large, since the maximum number of output characters per input character is 6.
2150
2151         The first landing of this patch had two bugs in it:
2152
2153         - Made \uNNNN escapes uppercase hexadecimal instead of lowercase.
2154         - Didn't preallocate enough space for 8-bit input strings.
2155
2156         Both were caught by existing tests on our bots, and both were due to last-minute
2157         changes before landing. :/
2158
2159         * wtf/text/StringBuilder.cpp:
2160         (WTF::appendQuotedJSONStringInternal):
2161         (WTF::StringBuilder::appendQuotedJSONString):
2162         * wtf/text/StringBuilder.h:
2163
2164 2015-05-07  Commit Queue  <commit-queue@webkit.org>
2165
2166         Unreviewed, rolling out r183961.
2167         https://bugs.webkit.org/show_bug.cgi?id=144784
2168
2169         Broke js/dom/JSON-stringify.html (Requested by kling on
2170         #webkit).
2171
2172         Reverted changeset:
2173
2174         "Optimize serialization of quoted JSON strings."
2175         https://bugs.webkit.org/show_bug.cgi?id=144754
2176         http://trac.webkit.org/changeset/183961
2177
2178 2015-05-07  Andreas Kling  <akling@apple.com>
2179
2180         Optimize serialization of quoted JSON strings.
2181         <https://webkit.org/b/144754>
2182
2183         Reviewed by Darin Adler.
2184
2185         Add a StringBuilder API for appending a quoted JSON string. This is used by
2186         JSON.stringify() to implement efficient appending of strings while escaping
2187         quotes, control characters and \uNNNN-style characters.
2188
2189         The main benefit comes from only doing a single buffer expansion up front,
2190         instead of doing it every time we append something. The fudge factor is pretty
2191         large for 16-bit strings, since the maximum number of output characters per
2192         input character is 6.
2193
2194         * wtf/text/StringBuilder.cpp:
2195         (WTF::appendQuotedJSONStringInternal):
2196         (WTF::StringBuilder::appendQuotedJSONString):
2197         * wtf/text/StringBuilder.h:
2198
2199 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
2200
2201         [GTK] All spell checking layout tests fail
2202         https://bugs.webkit.org/show_bug.cgi?id=144648
2203
2204         Reviewed by Carlos Garcia Campos.
2205
2206         * wtf/Platform.h: Activate UNIFIED_TEXT_CHECKING for GTK+.
2207
2208 2015-05-07  Dan Bernstein  <mitz@apple.com>
2209
2210         <rdar://problem/19317140> [Xcode] Remove usage of AspenFamily.xcconfig in Source/
2211         https://bugs.webkit.org/show_bug.cgi?id=144727
2212
2213         Reviewed by Darin Adler.
2214
2215         * Configurations/Base.xcconfig: Don’t include AspenFamily.xcconfig, and define
2216         INSTALL_PATH_PREFIX and LD_DYLIB_INSTALL_NAME for the iOS 8.x Simulator.
2217
2218 2015-05-07  Žan Doberšek  <zdobersek@igalia.com>
2219
2220         [GTK] Clean up RunLoop implementation
2221         https://bugs.webkit.org/show_bug.cgi?id=144729
2222
2223         Reviewed by Carlos Garcia Campos.
2224
2225         Clean up the RunLoop implementation for the GTK port,
2226         removing unnecessary methods and using simpler variable names.
2227
2228         Nested GMainLoops in RunLoop::run() are now created for the
2229         RunLoop's GMainContext, and not for the default context (enforced
2230         through the null argument to g_main_loop_new()).
2231
2232         * wtf/RunLoop.h:
2233         * wtf/gtk/RunLoopGtk.cpp:
2234         (WTF::RunLoop::RunLoop):
2235         (WTF::RunLoop::~RunLoop):
2236         (WTF::RunLoop::run):
2237         (WTF::RunLoop::stop):
2238         (WTF::RunLoop::wakeUp):
2239         (WTF::RunLoop::TimerBase::start):
2240         (WTF::RunLoop::innermostLoop): Deleted.
2241         (WTF::RunLoop::pushNestedMainLoop): Deleted.
2242         (WTF::RunLoop::popNestedMainLoop): Deleted.
2243
2244 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2245
2246         [GTK] Async operations running in the WorkQueue thread should schedule their sources to the WorkQueue main lopp
2247         https://bugs.webkit.org/show_bug.cgi?id=144541
2248
2249         Reviewed by Žan Doberšek.
2250
2251         They are currently sent to the main thread run loop, because we
2252         are not setting the WorkQueue main context as the default one in
2253         the worker thread.
2254
2255         * wtf/gtk/WorkQueueGtk.cpp:
2256         (WTF::WorkQueue::platformInitialize): Call
2257         g_main_context_push_thread_default() to set the WorkQueue main
2258         context as the default of the thread before running the main loop,
2259         and g_main_context_pop_thread_default() when the main loop quits.
2260
2261 2015-05-04  Commit Queue  <commit-queue@webkit.org>
2262
2263         Unreviewed, rolling out r183661.
2264         https://bugs.webkit.org/show_bug.cgi?id=144594
2265
2266         Caused ~3.5MB regression on membuster(!) (Requested by kling_
2267         on #webkit).
2268
2269         Reverted changeset:
2270
2271         "Decrease minimum Vector size."
2272         https://bugs.webkit.org/show_bug.cgi?id=144453
2273         http://trac.webkit.org/changeset/183661
2274
2275 2015-05-04  Zan Dobersek  <zdobersek@igalia.com>
2276
2277         [WTF] Remove Functional.h inclusions
2278         https://bugs.webkit.org/show_bug.cgi?id=144400
2279
2280         Reviewed by Darin Adler.
2281
2282         Remove most of the Functional.h header inclusions. The header is preserved
2283         since it's still used by older versions of Safari, and for the callOnMainThread()
2284         stub in DeprecatedSymbolsUsedBySafari.mm.
2285
2286         * wtf/MainThread.cpp:
2287         * wtf/RunLoop.h:
2288         * wtf/WorkQueue.cpp:
2289         * wtf/WorkQueue.h:
2290         * wtf/efl/DispatchQueueEfl.h:
2291         * wtf/efl/DispatchQueueWorkItemEfl.h:
2292
2293 2015-05-02  Commit Queue  <commit-queue@webkit.org>
2294
2295         Unreviewed, rolling out r183722.
2296         https://bugs.webkit.org/show_bug.cgi?id=144534
2297
2298         Made all the tests assert (Requested by ap on #webkit).
2299
2300         Reverted changeset:
2301
2302         "Generated static StringImpls should have static flag set."
2303         https://bugs.webkit.org/show_bug.cgi?id=144516
2304         http://trac.webkit.org/changeset/183722
2305
2306 2015-05-02  Andreas Kling  <akling@apple.com>
2307
2308         Generated static StringImpls should have static flag set.
2309         <https://webkit.org/b/144516>
2310
2311         Reviewed by Darin Adler.
2312
2313         Discovered this while tracking down a string ref leak. Turns out that the strings
2314         generated by StaticString.pm were not getting the static flag set on them.
2315
2316         The only practical difference from this AFAICT is that now the garbage collector
2317         will correctly see that these strings have no extra memory cost to worry about.
2318
2319         * wtf/text/StringImpl.h:
2320
2321 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
2322
2323         USE(...) macro should expect unprefixed variables
2324         https://bugs.webkit.org/show_bug.cgi?id=144454
2325
2326         Reviewed by Daniel Bates.
2327
2328         * wtf/Assertions.cpp: Replace all occurrences WTF_USE with USE.
2329         * wtf/Platform.h: Replace all occurrences WTF_USE with USE. Modify the USE
2330         macro to look for unprefixed variables.
2331         * wtf/WTFThreadData.h: Replace all occurrences WTF_USE with USE.
2332
2333 2015-05-01  Joseph Pecoraro  <pecoraro@apple.com>
2334
2335         Enable ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX by default on all ports (Windows was missed)
2336         https://bugs.webkit.org/show_bug.cgi?id=144495
2337
2338         Reviewed by Csaba Osztrogonác.
2339
2340         * wtf/FeatureDefines.h:
2341         This covers all ports that haven't defined the flag otherwise.
2342
2343 2015-04-30  Alex Christensen  <achristensen@webkit.org>
2344
2345         Decrease minimum Vector size.
2346         https://bugs.webkit.org/show_bug.cgi?id=144453
2347
2348         Reviewed by Andreas Kling.
2349
2350         * wtf/Vector.h:
2351         Make the default min size 4 to save memory on small Vectors.
2352
2353 2015-04-30  Yusuke Suzuki  <utatane.tea@gmail.com>
2354
2355         Use the default hash value for Symbolized StringImpl
2356         https://bugs.webkit.org/show_bug.cgi?id=144347
2357
2358         Reviewed by Darin Adler.
2359
2360         Use a default hash value calculation for symbolized StringImpl.
2361
2362         * wtf/text/StringImpl.cpp:
2363         (WTF::StringImpl::createSymbol):
2364         * wtf/text/StringImpl.h:
2365         (WTF::StringImpl::StringImpl):
2366         (WTF::StringImpl::symbolAwareHash):
2367         (WTF::StringImpl::existingSymbolAwareHash):
2368         (WTF::StringImpl::hashForSymbol):
2369         * wtf/text/StringStatics.cpp:
2370         (WTF::StringImpl::nextHashForSymbol):
2371         (WTF::StringImpl::hashAndFlagsForSymbol): Deleted.
2372
2373 2015-04-29  Alexey Proskuryakov  <ap@apple.com>
2374
2375         LazyNeverDestroyed is not thread safe in debug builds, causing assertions
2376         https://bugs.webkit.org/show_bug.cgi?id=144378
2377
2378         Reviewed by Darin Adler.
2379
2380         * wtf/NeverDestroyed.h:
2381
2382 2015-04-28  Geoffrey Garen  <ggaren@apple.com>
2383
2384         It shouldn't take 1846 lines of code and 5 FIXMEs to sort an array.
2385         https://bugs.webkit.org/show_bug.cgi?id=144013
2386
2387         Reviewed by Mark Lam.
2388
2389         Remove this custom tree implementation because it is unused. (It was
2390         previously used to achieve a stable array sort in certain cases.)
2391
2392         * WTF.vcxproj/WTF.vcxproj:
2393         * WTF.vcxproj/WTF.vcxproj.filters:
2394         * WTF.xcodeproj/project.pbxproj:
2395         * wtf/AVLTree.h: Removed.
2396         * wtf/CMakeLists.txt:
2397
2398 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
2399
2400         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
2401         https://bugs.webkit.org/show_bug.cgi?id=132159
2402
2403         Reviewed by Darin Adler.
2404
2405         * wtf/Platform.h:
2406
2407         Opt-in using ENABLE(PLATFORM_FONT_LOOKUP)
2408
2409 2015-04-29  Yusuke Suzuki  <utatane.tea@gmail.com>
2410
2411         REGRESSION (r183373): ASSERT failed in wtf/SHA1.h
2412         https://bugs.webkit.org/show_bug.cgi?id=144257
2413
2414         Reviewed by Darin Adler.
2415
2416         * wtf/SHA1.h:
2417         (WTF::SHA1::addBytes):
2418
2419 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
2420
2421         [CMake] [GTK] Organize and clean up unused CMake variables
2422         https://bugs.webkit.org/show_bug.cgi?id=144364
2423
2424         Reviewed by Gyuyoung Kim.
2425
2426         * wtf/PlatformGTK.cmake: Add variables specific to this project.
2427
2428 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2429
2430         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
2431         https://bugs.webkit.org/show_bug.cgi?id=144304
2432
2433         Reviewed by Geoffrey Garen.
2434
2435         No longer check ENABLE_LLINT_C_LOOP to determine the value of ENABLE_JIT.
2436
2437         * wtf/Platform.h:
2438
2439 2015-04-28  Commit Queue  <commit-queue@webkit.org>
2440
2441         Unreviewed, rolling out r183514.
2442         https://bugs.webkit.org/show_bug.cgi?id=144359
2443
2444         It broke cloop test bots (Requested by mcatanzaro on #webkit).
2445
2446         Reverted changeset:
2447
2448         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
2449         https://bugs.webkit.org/show_bug.cgi?id=144304
2450         http://trac.webkit.org/changeset/183514
2451
2452 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2453
2454         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
2455         https://bugs.webkit.org/show_bug.cgi?id=144304
2456
2457         Reviewed by Geoffrey Garen.
2458
2459         No longer check ENABLE_LLINT_C_LOOP to determine the value of ENABLE_JIT.
2460
2461         * wtf/Platform.h:
2462
2463 2015-04-28  Alex Christensen  <achristensen@webkit.org>
2464
2465         Properly reset deleted count when clearing HashTables.
2466         https://bugs.webkit.org/show_bug.cgi?id=144343
2467
2468         Reviewed by Andreas Kling.
2469
2470         * wtf/HashTable.h:
2471         (WTF::KeyTraits>::clear):
2472         Reset m_deletedCount, which appears to have been forgotten.
2473
2474 2015-04-28  Alex Christensen  <achristensen@webkit.org>
2475
2476         [Content Extensions] Use less memory for CombinedURLFilters.
2477         https://bugs.webkit.org/show_bug.cgi?id=144290
2478
2479         Reviewed by Andreas Kling.
2480
2481         * wtf/Forward.h:
2482         * wtf/Vector.h:
2483         Added a minCapacity template parameter to allow changing the minimum size of an 
2484         allocated buffer. The default minCapacity is kept at 16 unless otherwise specified 
2485         to have no change on existing code, but this could be changed later. A smaller 
2486         default minCapacity would use less memory with small Vectors but spend more time 
2487         copying when expanding to large Vectors.
2488
2489 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
2490
2491         [Win] Deactivate WebGL until Windows tests work properly
2492         https://bugs.webkit.org/show_bug.cgi?id=144291
2493         <rdar://problem/20707307>
2494
2495         Reviewed by Zalan Bujtas.
2496
2497         * wtf/FeatureDefines.h: Force WebGL off for Windows builds.
2498
2499 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2500
2501         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
2502         https://bugs.webkit.org/show_bug.cgi?id=144193
2503
2504         Reviewed by Darin Adler.
2505
2506         * wtf/FeatureDefines.h:
2507         * wtf/Platform.h:
2508
2509 2015-04-22  Martin Robinson  <mrobinson@igalia.com>
2510
2511         [CMake] Autogenerate cmakeconfig.h.cmake
2512         https://bugs.webkit.org/show_bug.cgi?id=143997
2513
2514         Reviewed by Csaba Osztrogonác.
2515
2516         * wtf/Platform.h: Move a GTK-specific setting from cmakeconfig.h to here.
2517
2518 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
2519
2520         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
2521         https://bugs.webkit.org/show_bug.cgi?id=144182
2522
2523         Reviewed by Simon Fraser.
2524
2525         * wtf/FeatureDefines.h: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2526
2527 2015-04-24  Commit Queue  <commit-queue@webkit.org>
2528
2529         Unreviewed, rolling out r183288.
2530         https://bugs.webkit.org/show_bug.cgi?id=144189
2531
2532         Made js/sort-with-side-effecting-comparisons.html time out in
2533         debug builds (Requested by ap on #webkit).
2534
2535         Reverted changeset:
2536
2537         "It shouldn't take 1846 lines of code and 5 FIXMEs to sort an
2538         array."
2539         https://bugs.webkit.org/show_bug.cgi?id=144013
2540         http://trac.webkit.org/changeset/183288
2541
2542 2015-04-21  Geoffrey Garen  <ggaren@apple.com>
2543
2544         It shouldn't take 1846 lines of code and 5 FIXMEs to sort an array.
2545         https://bugs.webkit.org/show_bug.cgi?id=144013
2546
2547         Reviewed by Mark Lam.
2548
2549         Remove this custom tree implementation because it is unused. (It was
2550         previously used to achieve a stable array sort in certain cases.)
2551
2552         * WTF.vcxproj/WTF.vcxproj:
2553         * WTF.vcxproj/WTF.vcxproj.filters:
2554         * WTF.xcodeproj/project.pbxproj:
2555         * wtf/AVLTree.h: Removed.
2556         * wtf/CMakeLists.txt:
2557
2558 2015-04-24  Darin Adler  <darin@apple.com>
2559
2560         Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
2561         https://bugs.webkit.org/show_bug.cgi?id=128007
2562
2563         Reviewed by Anders Carlsson.
2564
2565         * WTF.vcxproj/WTF.vcxproj: Removed OwnPtr source files.
2566         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
2567         * WTF.xcodeproj/project.pbxproj: Ditto.
2568         * wtf/CMakeLists.txt: Ditto.
2569
2570         * wtf/Forward.h: Removed OwnPtr and PassOwnPtr.
2571         * wtf/HashTraits.h: Ditto.
2572
2573         * wtf/OwnPtr.h: Removed.
2574         * wtf/OwnPtrCommon.h: Removed.
2575         * wtf/PassOwnPtr.h: Removed.
2576
2577         * wtf/SizeLimits.cpp: Removed OwnPtr.
2578         * wtf/VectorTraits.h: Removed OwnPtr specialization.
2579
2580 2015-04-23  Jer Noble  <jer.noble@apple.com>
2581
2582         Disable HAVE_AVKIT on AppleTV
2583         https://bugs.webkit.org/show_bug.cgi?id=144142
2584
2585         Reviewed by Dan Bernstein.
2586
2587         * wtf/Platform.h:
2588
2589 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
2590
2591         [iOS] WebKit services should inherit environment variables for home
2592         https://bugs.webkit.org/show_bug.cgi?id=144078
2593         rdar://problem/20571678
2594
2595         Reviewed by Dan Bernstein.
2596
2597         * wtf/spi/darwin/XPCSPI.h: Added xpc_copy_bootstrap and xpc_dictionary_apply.
2598
2599 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
2600
2601         Undo the WTF part of the previous build fix, we don't use private headers in WTF.
2602
2603         * WTF.xcodeproj/project.pbxproj:
2604
2605 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
2606
2607         Build fix.
2608
2609         * WTF.xcodeproj/project.pbxproj: Make RAMSize.h a private header, now that it's used
2610         from outside WTF.
2611
2612 2015-04-23  Andreas Kling  <akling@apple.com>
2613
2614         There should only be one way to get the system memory size.
2615         <https://webkit.org/b/144081>
2616
2617         Reviewed by Antti Koivisto.
2618
2619         Merge all the logic from other RAM size fetcher helpers into WTF's.
2620
2621         Darwin ports now use host_info() instead of sysctl(), since that was the more common way
2622         of doing this.
2623
2624         Also bumped the fallback answer from 128 MB to 512 MB to bring it closer to today's hardware.
2625
2626         Finally, the number is rounded up to the next multiple of 128 MB, to avoid misunderstandings
2627         on some systems where the number returned by the kernel is slightly lower than the marketing
2628         number. Removed the "fudging" that was used in some places, since this fixes that cleanly.
2629
2630         * wtf/RAMSize.cpp:
2631         (WTF::computeRAMSize):
2632
2633 2015-04-22  Darin Adler  <darin@apple.com>
2634
2635         Eliminate remaining uses of OwnPtr and PassOwnPtr in WebCore outside the editing and platform directories
2636         https://bugs.webkit.org/show_bug.cgi?id=143949
2637
2638         Reviewed by Andreas Kling.
2639
2640         * wtf/MathExtras.h:
2641         (wtf_ceil): Deleted. This was a workaround for a bug that was introduced in Leopard and
2642         fixed in Snow Leopard <rdar://problem/6286405>, so we don't need the workaround any more.
2643
2644 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
2645
2646         [Mac] In nightlies and local builds, WebKit services can get terminated under memory pressure
2647         https://bugs.webkit.org/show_bug.cgi?id=144052
2648         rdar://problem/19754404
2649
2650         Build fix. Landing a forward declaration that should have been part of the original patch.
2651
2652         * wtf/spi/darwin/XPCSPI.h:
2653
2654 2015-04-21  Chris Dumez  <cdumez@apple.com>
2655
2656         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
2657         https://bugs.webkit.org/show_bug.cgi?id=143970
2658
2659         Reviewed by Darin Adler.
2660
2661         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
2662         constructor explicit as it copies the vector and it is easy to call it
2663         by mistake.
2664
2665         * wtf/RefCountedArray.h:
2666         (WTF::RefCountedArray::RefCountedArray):
2667         * wtf/Vector.h:
2668
2669 2015-04-21  Darin Adler  <darin@apple.com>
2670
2671         Remove some stray uses of OwnPtr and PassOwnPtr in WTF (outside of the template definitions and traits)
2672         https://bugs.webkit.org/show_bug.cgi?id=143944
2673
2674         Reviewed by Andreas Kling.
2675
2676         * wtf/FilePrintStream.h: Removed unneeded include.
2677         * wtf/HashTable.h: Fixed class template name in comment.
2678         * wtf/HashTraits.h: Removed unneeded forward declaration.
2679         * wtf/ListHashSet.h: Removed unneeded includes.
2680         * wtf/ThreadingWin.cpp: Removed unneeded includes.
2681         (WTF::wtfThreadEntryPoint): Changed code to use unique_ptr.
2682         (WTF::createThreadInternal): Changed code to use make_unique and release.
2683         * wtf/efl/RunLoopEfl.cpp: Removed unneeded includes.
2684
2685 2015-04-19  Darin Adler  <darin@apple.com>
2686
2687         Update RefPtr documentation and deprecation
2688         https://bugs.webkit.org/show_bug.cgi?id=143936
2689
2690         Reviewed by Andreas Kling.
2691
2692         * WTF.vcxproj/WTF.vcxproj: Removed PassRef.h
2693         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
2694         * WTF.xcodeproj/project.pbxproj: Ditto.
2695         * wtf/CMakeLists.txt: Ditto.
2696
2697 2015-04-17  Alexey Proskuryakov  <ap@apple.com>
2698
2699         Use ASan poisoning to taint moved-out-of Refs
2700         https://bugs.webkit.org/show_bug.cgi?id=143894
2701         rdar://problem/19443723
2702
2703         Reviewed by Darin Adler.
2704
2705         * wtf/Ref.h: (WTF::Ref::~Ref):
2706
2707 2015-04-17  Alexey Proskuryakov  <ap@apple.com>
2708
2709         Remove unused BoundsCheckedPointer
2710         https://bugs.webkit.org/show_bug.cgi?id=143896
2711
2712         Reviewed by Geoffrey Garen.
2713
2714         * WTF.vcxproj/WTF.vcxproj:
2715         * WTF.vcxproj/WTF.vcxproj.filters:
2716         * WTF.xcodeproj/project.pbxproj:
2717         * wtf/BoundsCheckedPointer.h: Removed.
2718         * wtf/CMakeLists.txt:
2719
2720 2015-04-16  Yusuke Suzuki  <utatane.tea@gmail.com>
2721
2722         [ES6] Implement Symbol.for and Symbol.keyFor
2723         https://bugs.webkit.org/show_bug.cgi?id=143404
2724
2725         Reviewed by Geoffrey Garen.
2726
2727         When we register symbolized StringImpl* into SymbolRegistry, symbolized StringImpl* is aware of that.
2728         And when destructing it, it removes its reference from SymbolRegistry as if atomic StringImpl do so with AtomicStringTable.
2729         While AtomicStringTable (in WebCore case) exists in thread local storage,
2730         SymbolRegistry exists per VM and StringImpl* has a reference to the registered SymbolRegistry.
2731
2732         Since StringImpl has isSymbol etc. members, it's class is aware of Symbol use cases.
2733         So introduce SymbolRegistry in WTF layers as if AtomicStringTable.
2734
2735         * WTF.vcxproj/WTF.vcxproj:
2736         * WTF.vcxproj/WTF.vcxproj.filters:
2737         * WTF.xcodeproj/project.pbxproj:
2738         * wtf/CMakeLists.txt:
2739         * wtf/text/AtomicString.cpp:
2740         (WTF::AtomicString::addSlowCase):
2741         (WTF::AtomicString::findSlowCase):
2742         (WTF::AtomicString::findInternal):
2743         (WTF::AtomicString::find): Deleted.
2744         * wtf/text/AtomicString.h:
2745         (WTF::AtomicString::find):
2746         * wtf/text/StringImpl.cpp:
2747         (WTF::StringImpl::~StringImpl):
2748         (WTF::StringImpl::createSymbol):
2749         (WTF::StringImpl::createSymbolEmpty):
2750         * wtf/text/StringImpl.h:
2751         (WTF::StringImpl::StringImpl):
2752         (WTF::StringImpl::extractFoldedStringInSymbol):
2753         (WTF::StringImpl::symbolRegistry):
2754         (WTF::StringImpl::createSymbolEmpty): Deleted.
2755         * wtf/text/SymbolRegistry.cpp: Copied from Source/JavaScriptCore/runtime/SymbolConstructor.h.
2756         (WTF::SymbolRegistry::~SymbolRegistry):
2757         (WTF::SymbolRegistry::symbolForKey):
2758         (WTF::SymbolRegistry::keyForSymbol):
2759         (WTF::SymbolRegistry::remove):
2760         * wtf/text/SymbolRegistry.h: Added.
2761         (WTF::SymbolRegistryKey::hash):
2762         (WTF::SymbolRegistryKey::impl):
2763         (WTF::SymbolRegistryKey::isHashTableDeletedValue):
2764         (WTF::SymbolRegistryKey::hashTableDeletedValue):
2765         (WTF::DefaultHash<SymbolRegistryKey>::Hash::hash):
2766         (WTF::DefaultHash<SymbolRegistryKey>::Hash::equal):
2767         (WTF::HashTraits<SymbolRegistryKey>::isEmptyValue):
2768         (WTF::SymbolRegistryKey::SymbolRegistryKey):
2769
2770 2015-04-16  Antti Koivisto  <antti@apple.com>
2771
2772         Use CommonCrypto for SHA1 and MD5
2773         https://bugs.webkit.org/show_bug.cgi?id=143826
2774
2775         Reviewed by Anders Carlsson.
2776
2777         CommonCrypto SHA1 implementation is ~4x faster than the naive WTF one. Use it when available.
2778
2779         These are covered by existing API tests.
2780
2781         * wtf/MD5.cpp:
2782         (WTF::MD5::MD5):
2783         (WTF::MD5::addBytes):
2784         (WTF::MD5::checksum):
2785         * wtf/MD5.h:
2786         * wtf/SHA1.cpp:
2787         (WTF::SHA1::SHA1):
2788         (WTF::SHA1::addBytes):
2789         (WTF::SHA1::computeHash):
2790
2791             Remove the side effect where computeHash resets the state. No one relies on it.
2792
2793         (WTF::SHA1::hexDigest):
2794         (WTF::SHA1::computeHexDigest):
2795         * wtf/SHA1.h:
2796
2797 2015-04-16  Csaba Osztrogonác  <ossy@webkit.org>
2798
2799         Remove the unnecessary WTF_CHANGES define
2800         https://bugs.webkit.org/show_bug.cgi?id=143825
2801
2802         Reviewed by Andreas Kling.
2803
2804         * config.h:
2805
2806 2015-04-15  Руслан Ижбулатов  <lrn1986@gmail.com>
2807
2808         Harmonize binary semaphore ifdefs
2809
2810         They should be either OS(WINDOWS) (in which case we'd need
2811         BinarySemaphoreWin.cpp, which is not shipped by WebKitGTK)
2812         or PLATFORM(WIN) (in which case Mutex/ThreadCondition-based
2813         implementation is used).
2814
2815         This fixes errors like:
2816           CXX      Source/WTF/wtf/threads/libWTF_la-BinarySemaphore.lo
2817         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In constructor 'WTF::BinarySemaphore::BinarySemaphore()':
2818         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:34:7: error: class 'WTF::BinarySemaphore' does not have any field named 'm_isSet'
2819              : m_isSet(false)
2820                ^
2821         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In member function 'void WTF::BinarySemaphore::signal()':
2822         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:44:24: error: 'm_mutex' was not declared in this scope
2823              MutexLocker locker(m_mutex);
2824                                 ^
2825         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:46:5: error: 'm_isSet' was not declared in this scope
2826              m_isSet = true;
2827              ^
2828         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:47:5: error: 'm_condition' was not declared in this scope
2829              m_condition.signal();
2830              ^
2831         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In member function 'bool WTF::BinarySemaphore::wait(double)':
2832         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:52:24: error: 'm_mutex' was not declared in this scope
2833              MutexLocker locker(m_mutex);
2834                                 ^
2835         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:55:13: error: 'm_isSet' was not declared in this scope
2836              while (!m_isSet) {
2837                      ^
2838         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:56:21: error: 'm_condition' was not declared in this scope
2839                  timedOut = !m_condition.timedWait(m_mutex, absoluteTime);
2840                              ^
2841         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:62:5: error: 'm_isSet' was not declared in this scope
2842              m_isSet = false;
2843              ^
2844         GNUmakefile:52762: recipe for target 'Source/WTF/wtf/threads/libWTF_la-BinarySemaphore.lo' failed
2845
2846         [W32] Inconsistent ifdefs in BinarySemaphore.h and BinarySemaphore.cpp
2847         https://bugs.webkit.org/show_bug.cgi?id=143756
2848
2849         Reviewed by Darin Adler.
2850
2851         * wtf/threads/BinarySemaphore.h:
2852
2853 2015-04-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2854
2855         Fix -Wparentheses warning with GCC 5 in SaturatedArithmetic.h
2856         https://bugs.webkit.org/show_bug.cgi?id=143457
2857
2858         Reviewed by Benjamin Poulain.
2859
2860         Tested by WTF.SaturatedArithmeticAddition and WTF.SaturatedArithmeticSubtraction.
2861
2862         * wtf/SaturatedArithmetic.h:
2863         (signedAddOverflows): Use && instead of & to avoid triggering -Wparentheses in newer
2864         versions of GCC and Clang, and to improve the clarity of the function.
2865         (signedSubtractOverflows): Changed correspondingly, although there was no warning here.
2866
2867 2015-04-08  Sam Weinig  <sam@webkit.org>
2868
2869         Allow LaunchServices to handle URLs on link navigations
2870         <rdar://problem/19446826>
2871         https://bugs.webkit.org/show_bug.cgi?id=143544
2872
2873         Reviewed by Anders Carlsson.
2874
2875         * wtf/Platform.h:
2876         Add HAVE macro for this functionality.
2877
2878 2015-04-09  Andy Estes  <aestes@apple.com>
2879
2880         [Cocoa] Add a HAVE(AVKIT) and use it
2881         https://bugs.webkit.org/show_bug.cgi?id=143593
2882
2883         Reviewed by David Kilzer.
2884
2885         * wtf/Platform.h: Defined HAVE(AVKIT) to be true on all Cocoa platforms except Watch OS.
2886
2887 2015-04-09  Andy Estes  <aestes@apple.com>
2888
2889         [Content Filtering] Add a HAVE(PARENTAL_CONTROLS) and use it
2890         https://bugs.webkit.org/show_bug.cgi?id=143559
2891
2892         Reviewed by David Kilzer.
2893
2894         Added PLATFORM(WATCHOS). Used PLATFORM() since Watch OS is just a variant of OS(IOS).
2895         Defined HAVE(PARENTAL_CONTROLS) to be true on all Cocoa platforms except Watch OS.
2896
2897         * wtf/Platform.h:
2898
2899 2015-04-08  Alex Christensen  <achristensen@webkit.org> and Patrick Gansterer  <paroga@webkit.org>
2900
2901         Add CMake build system for WinCairo port.
2902         https://bugs.webkit.org/show_bug.cgi?id=115944
2903
2904         Reviewed by Chris Dumez.
2905
2906         * wtf/FeatureDefines.h:
2907         * wtf/PlatformWin.cmake:
2908
2909 2015-04-05  Antti Koivisto  <antti@apple.com>
2910
2911         Bloom filter should support longer hashes
2912         https://bugs.webkit.org/show_bug.cgi?id=143419
2913
2914         Reviewed by Dan Bernstein.
2915
2916         It currently supports 'unsigned' hash only which is inconvenient and doesn't have enough independent bits for larger filters.
2917
2918         Support arbitrarily sized hashes of type std::array<uint8_t, hashSize> (like SHA1::Digest and MD5::Digest).
2919
2920         * wtf/BloomFilter.h:
2921         (WTF::BloomFilter<keyBits>::keysFromHash):
2922         (WTF::BloomFilter<keyBits>::mayContain):
2923         (WTF::BloomFilter<keyBits>::add):
2924
2925 2015-04-03  Antti Koivisto  <antti@apple.com>
2926
2927         Add non-counting Bloom filter implementation
2928         https://bugs.webkit.org/show_bug.cgi?id=143366
2929
2930         Reviewed by Sam Weinig.
2931
2932         Add a traditional single-bit-per-bucket Bloom filter in addition to the existing counting implementation.
2933
2934         - rename BloomFilter -> CountingBloomFilter.
2935         - add a new basic BloomFilter type.
2936         - update some terminology to match http://en.wikipedia.org/wiki/Bloom_filter and modernize the code a bit.
2937         - add API tests.
2938
2939         * wtf/BloomFilter.h:
2940         (WTF::BloomFilter::BloomFilter):
2941         (WTF::BloomFilter::add):
2942
2943             Also support merging.
2944
2945         (WTF::BloomFilter::mayContain):
2946         (WTF::BloomFilter::arrayIndex):
2947         (WTF::BloomFilter::bitMask):
2948         (WTF::BloomFilter<keyBits>::mayContain):
2949         (WTF::BloomFilter<keyBits>::add):
2950         (WTF::BloomFilter<keyBits>::isBitSet):
2951         (WTF::BloomFilter<keyBits>::setBit):
2952         (WTF::BloomFilter<keyBits>::clear):
2953         (WTF::CountingBloomFilter::CountingBloomFilter):
2954         (WTF::CountingBloomFilter::mayContain):
2955         (WTF::CountingBloomFilter::firstBucket):
2956         (WTF::CountingBloomFilter::secondBucket):
2957         (WTF::CountingBloomFilter<keyBits>::add):
2958         (WTF::CountingBloomFilter<keyBits>::remove):
2959         (WTF::CountingBloomFilter<keyBits>::clear):
2960         (WTF::CountingBloomFilter<keyBits>::likelyEmpty):
2961         (WTF::CountingBloomFilter<keyBits>::isClear):
2962         (WTF::BloomFilter::maximumCount): Deleted.
2963         (WTF::BloomFilter::firstSlot): Deleted.
2964         (WTF::BloomFilter::secondSlot): Deleted.
2965         (WTF::BloomFilter<keyBits>::remove): Deleted.
2966         (WTF::BloomFilter<keyBits>::likelyEmpty): Deleted.
2967         (WTF::BloomFilter<keyBits>::isClear): Deleted.
2968
2969 015-04-01  Antti Koivisto  <antti@apple.com>
2970
2971         Value assignment operator of Optional should be stricter
2972         https://bugs.webkit.org/show_bug.cgi?id=143303
2973
2974         Reviewed by Andreas Kling.
2975
2976         struct Foo { mutable Optional<std::chrono::seconds> s; };
2977         Foo foo, foo2;
2978         foo = foo2;
2979
2980         doesn't build because it tries to use wrong operator=.
2981
2982         * wtf/Optional.h:
2983
2984             Add enable_if test similar to std::experimental::optional.
2985
2986 2015-04-01  Alex Christensen  <achristensen@webkit.org>
2987
2988         Progress towards CMake on Windows and Mac.
2989         https://bugs.webkit.org/show_bug.cgi?id=143293
2990
2991         Reviewed by Filip Pizlo.
2992
2993         * wtf/CMakeLists.txt:
2994         Don't use bmalloc on Windows yet.
2995         * wtf/FeatureDefines.h:
2996         Temporarily disabled WebGL on Windows CMake builds.
2997         * wtf/PlatformMac.cmake:
2998         Tell open source builders where to find unicode headers.
2999
3000 2015-03-31  Alexey Proskuryakov  <ap@apple.com>
3001
3002         Fix the build after <http://trac.webkit.org/changeset/182205>.
3003
3004         * wtf/text/StringImpl.h: (WTF::StringImpl::extractFoldedStringInSymbol):
3005         A function cannot be both exported and inline.
3006
3007 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
3008
3009         Clean up Identifier factories to clarify the meaning of StringImpl*
3010         https://bugs.webkit.org/show_bug.cgi?id=143146
3011
3012         Reviewed by Filip Pizlo.
3013
3014         Introduce StringKind into `StringImpl`. There's 3 kinds
3015         1. StringNormal (non-atomic, non-symbol)
3016         2. StringAtomic (atomic, non-symbol)
3017         3. StringSymbol (non-atomic, symbol)
3018         They are mutually exclusive.
3019
3020         * wtf/text/AtomicString.cpp:
3021         (WTF::AtomicString::addSlowCase):
3022         (WTF::AtomicString::findSlowCase):
3023         When registering a string into AtomicStringTable,
3024         it should not be a symbol string
3025         because symbol and atomic types are mutually exclusive.
3026         When a symbol string comes, we extract an owner string
3027         from a symbol string by using `StringImpl::extractFoldedStringInSymbol()`.
3028         It always succeeds because a symbol (non empty) string
3029         is always BufferSubstring and has an owner string.
3030         Empty symbol string doesn't have an owner string.
3031         This case is filtered by `!string.length()` guard.
3032         * wtf/text/AtomicString.h:
3033         (WTF::AtomicString::add):
3034         (WTF::AtomicString::addWithStringTableProvider):
3035         * wtf/text/StringImpl.cpp:
3036         (WTF::StringImpl::~StringImpl):
3037         (WTF::StringImpl::createSymbol):
3038         (WTF::StringImpl::createUnique): Deleted.
3039         * wtf/text/StringImpl.h:
3040         (WTF::StringImpl::StringImpl):
3041         (WTF::StringImpl::createSymbolEmpty):
3042         (WTF::StringImpl::flagIsAtomic):
3043         (WTF::StringImpl::flagIsSymbol):
3044         (WTF::StringImpl::maskStringKind):
3045         (WTF::StringImpl::stringKind):
3046         (WTF::StringImpl::isSymbol):
3047         (WTF::StringImpl::isAtomic):
3048         (WTF::StringImpl::setIsAtomic):
3049         (WTF::StringImpl::extractFoldedStringInSymbol):
3050         (WTF::StringImpl::createUniqueEmpty): Deleted.
3051         (WTF::StringImpl::flagIsUnique): Deleted.
3052         (WTF::StringImpl::isUnique): Deleted.
3053         * wtf/text/StringStatics.cpp:
3054         (WTF::StringImpl::hashAndFlagsForSymbol):
3055         (WTF::StringImpl::hashAndFlagsForUnique): Deleted.
3056
3057 2015-03-30  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3058
3059         [CMake][EFL] Remove redundant library link and include path
3060         https://bugs.webkit.org/show_bug.cgi?id=143221
3061
3062         Reviewed by Csaba Osztrogonác.
3063
3064         * wtf/PlatformEfl.cmake: Remove unnecessary library link and include path.
3065
3066 2015-03-27  Myles C. Maxfield  <mmaxfield@apple.com>
3067
3068         Support building WTF on Windows without Cygwin
3069         https://bugs.webkit.org/show_bug.cgi?id=143084
3070
3071         Reviewed by Brent Fulgham.
3072
3073         Windows doesn't have "touch".
3074
3075         * WTF.vcxproj/WTFGenerated.make:
3076
3077 2015-03-26  Alex Christensen  <achristensen@webkit.org>
3078
3079         Progress towards CMake on Mac.
3080         https://bugs.webkit.org/show_bug.cgi?id=143112
3081
3082         Reviewed by Chris Dumez.
3083
3084         * wtf/PlatformMac.cmake:
3085
3086 2015-03-25  Filip Pizlo  <fpizlo@apple.com>
3087
3088         Unreviewed, we have edited this file in 2015.
3089
3090         * wtf/Platform.h:
3091
3092 2015-03-25  Filip Pizlo  <fpizlo@apple.com>
3093
3094         Heap variables shouldn't end up in the stack frame
3095         https://bugs.webkit.org/show_bug.cgi?id=141174
3096
3097         Reviewed by Geoffrey Garen.
3098
3099         * wtf/FastBitVector.h:
3100         (WTF::FastBitVector::resize): Small change: don't resize if you don't have to resize.
3101
3102 2015-03-25  Filip Pizlo  <fpizlo@apple.com>
3103
3104         Change Atomic methods from using the_wrong_naming_conventions to using theRightNamingConventions. Also make seq_cst the default.
3105
3106         Rubber stamped by Geoffrey Garen.
3107
3108         * wtf/Atomics.h:
3109         (WTF::Atomic::load):
3110         (WTF::Atomic::store):
3111         (WTF::Atomic::compareExchangeWeak):
3112         (WTF::Atomic::compareExchangeStrong):
3113         (WTF::Atomic::compare_exchange_weak): Deleted.
3114         (WTF::Atomic::compare_exchange_strong): Deleted.
3115         * wtf/ByteSpinLock.h:
3116         (WTF::ByteSpinLock::lock):
3117         * wtf/SpinLock.h:
3118         (WTF::SpinLockBase::lock):
3119
3120 2015-03-24  Beth Dakin  <bdakin@apple.com>
3121
3122         Add events related to force click gesture
3123         https://bugs.webkit.org/show_bug.cgi?id=142836
3124         -and corresponding-
3125         rdar://problem/20210239
3126
3127         Reviewed by Dean Jackson.
3128
3129         New enable flag for the events.
3130         * wtf/FeatureDefines.h:
3131
3132 2015-03-23  Filip Pizlo  <fpizlo@apple.com>
3133
3134         JSC should have a low-cost asynchronous disassembler
3135         https://bugs.webkit.org/show_bug.cgi?id=142997
3136
3137         Reviewed by Mark Lam.
3138
3139         * wtf/StringPrintStream.h:
3140
3141 2015-03-22  Benjamin Poulain  <benjamin@webkit.org>
3142
3143         CSS Selectors: fix attribute case-insensitive matching of Contain and List
3144         https://bugs.webkit.org/show_bug.cgi?id=142932
3145
3146         Reviewed by Darin Adler.
3147
3148         Add some utility functions to the string classes to find substrings
3149         using ASCII case-insensitive comparisons.
3150
3151         * wtf/text/AtomicString.h:
3152         (WTF::AtomicString::contains):
3153         Add the light version that only lock one register.
3154
3155         (WTF::AtomicString::containsIgnoringASCIICase):
3156         (WTF::AtomicString::findIgnoringASCIICase):
3157
3158         * wtf/text/StringCommon.h:
3159         (WTF::findIgnoringASCIICase):
3160         This is the common implementation used by StringView and StringImpl.
3161
3162         * wtf/text/StringImpl.cpp:
3163         (WTF::StringImpl::findIgnoringASCIICase):
3164         * wtf/text/StringImpl.h:
3165         * wtf/text/StringView.cpp:
3166         (WTF::StringView::containsIgnoringASCIICase):
3167         (WTF::StringView::findIgnoringASCIICase):
3168         * wtf/text/StringView.h:
3169         * wtf/text/WTFString.h:
3170         (WTF::String::findIgnoringASCIICase):
3171         (WTF::String::contains):
3172         (WTF::String::containsIgnoringASCIICase):
3173
3174 2015-03-19  Andreas Kling  <akling@apple.com>
3175
3176         DFGAllocator should use bmalloc's aligned allocator.
3177         <https://webkit.org/b/142871>
3178
3179         Reviewed by Geoffrey Garen.
3180
3181         Remove PageAllocationAligned since it has no more clients.
3182
3183         * WTF.vcxproj/WTF.vcxproj:
3184         * WTF.vcxproj/WTF.vcxproj.filters:
3185         * WTF.xcodeproj/project.pbxproj:
3186         * wtf/CMakeLists.txt:
3187         * wtf/PageAllocationAligned.cpp: Removed.
3188         * wtf/PageAllocationAligned.h: Removed.
3189
3190 2015-03-18  Dhi Aurrahman  <diorahman@rockybars.com>
3191
3192         Fix StringView misplaced implementations after r181525 and r181558
3193         https://bugs.webkit.org/show_bug.cgi?id=142772
3194
3195         Reviewed by Darin Adler.
3196
3197         Fix misplaced implementations in StringView::startsWithIgnoringASCIICase and 
3198         StringView::endsWith. 
3199
3200         Add some tests in [1] to cover the StringView::startsWith, 
3201         StringView::startsWithIgnoringASCIICase, StringView::endsWith and 
3202         StringView::endsWithIgnoringASCIICase implementations.
3203
3204         [1] Tools/TestWebKitAPI/Tests/WTF/StringView.cpp.
3205
3206         * wtf/text/StringView.cpp:
3207         (WTF::StringView::startsWithIgnoringASCIICase):
3208         (WTF::StringView::endsWith):
3209         (WTF::StringView::endsWithIgnoringASCIICase):
3210
3211 2015-03-17  Michael Saboff  <msaboff@apple.com>
3212
3213         Windows X86-64 should use the fixed executable allocator
3214         https://bugs.webkit.org/show_bug.cgi?id=142749
3215
3216         Reviewed by Filip Pizlo.
3217
3218         Set ENABLE_EXECUTABLE_ALLOCATOR_FIXED for Windows.
3219         Needed to export MetaAllocator::currentStatistics() for use in JavaScriptCore.
3220
3221         * wtf/MetaAllocator.h:
3222         * wtf/Platform.h:
3223
3224 2015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
3225
3226         Enable ES6 classes by default
3227         https://bugs.webkit.org/show_bug.cgi?id=142774
3228
3229         Reviewed by Gavin Barraclough.
3230
3231         * wtf/FeatureDefines.h:
3232
3233 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
3234
3235         [ARM] Enable generating idiv instructions if it is supported
3236         https://bugs.webkit.org/show_bug.cgi?id=142725
3237
3238         Reviewed by Michael Saboff.
3239
3240         * wtf/Platform.h: Set HAVE_ARM_IDIV_INSTRUCTIONS based on GCC macro too.
3241
3242 2015-03-16  Benjamin Poulain  <benjamin@webkit.org>
3243
3244         Fix StringView after r181525
3245         Unreviewed.
3246
3247         Fix 2 silly mistakes I made in r181525.
3248
3249         * wtf/text/StringView.cpp:
3250         (WTF::StringView::startsWith):
3251         (WTF::StringView::startsWithIgnoringASCIICase):
3252         (WTF::StringView::endsWith):
3253         (WTF::StringView::endsWithIgnoringASCIICase):
3254         The implementation was inside the #ifdef.
3255
3256         * wtf/text/StringView.h:
3257         The symbols were not exported.
3258
3259 2015-03-16  Max Stepin  <maxstepin@gmail.com>
3260
3261         Add APNG support
3262         https://bugs.webkit.org/show_bug.cgi?id=17022
3263
3264         Reviewed by Carlos Garcia Campos.
3265
3266         * wtf/FeatureDefines.h:
3267
3268 2015-03-15  Benjamin Poulain  <benjamin@webkit.org>
3269
3270         CSS: fix the case-insensitive matching of the attribute selectors Begin, End and Hyphen
3271         https://bugs.webkit.org/show_bug.cgi?id=142715
3272
3273         Reviewed by Brent Fulgham.
3274
3275         Add the necessary infrastructure to test startsWith() and endsWith() with
3276         ASCII case-insentive comparisons.
3277
3278         * wtf/text/AtomicString.h:
3279         (WTF::AtomicString::startsWith):
3280         (WTF::AtomicString::startsWithIgnoringASCIICase):
3281         (WTF::AtomicString::endsWith):
3282         (WTF::AtomicString::endsWithIgnoringASCIICase):
3283
3284         * wtf/text/StringCommon.h:
3285         (WTF::loadUnaligned):
3286         (WTF::equal):
3287         I moved the low level equal() code from StringImpl to StringCommon
3288         since it is used by both StringImpl and StringView.
3289
3290         (WTF::equalCommon):
3291         (WTF::equalIgnoringASCIICaseCommon):
3292         Ideally we should drop the "Common" part of the name but StringView
3293         wants this inline for some reason. I prefered keeping the current behavior
3294         since I don't know how StringView's matching performance was evaluated.
3295
3296         (WTF::startsWith):
3297         (WTF::startsWithIgnoringASCIICase):
3298         (WTF::endsWith):
3299         (WTF::endsWithIgnoringASCIICase):
3300         Make all that code shared between StringView and Stringimpl.
3301
3302         * wtf/text/StringImpl.cpp:
3303         (WTF::StringImpl::startsWith):
3304         (WTF::StringImpl::startsWithIgnoringASCIICase):
3305         (WTF::StringImpl::endsWith):
3306         (WTF::StringImpl::endsWithIgnoringASCIICase):
3307         (WTF::equal):
3308         (WTF::stringImplContentEqual): Deleted.
3309         * wtf/text/StringImpl.h:
3310         (WTF::loadUnaligned): Deleted.
3311         (WTF::equal): Deleted.
3312
3313         * wtf/text/StringView.cpp:
3314         (WTF::StringView::startsWith):
3315         (WTF::StringView::startsWithIgnoringASCIICase):
3316         (WTF::StringView::endsWith):
3317         (WTF::StringView::endsWithIgnoringASCIICase):
3318         * wtf/text/StringView.h:
3319         Since those are new, we can safely make them out-of-line and
3320         evaluate the inlining impact as needed.
3321
3322         * wtf/text/WTFString.h:
3323         (WTF::String::startsWithIgnoringASCIICase):
3324         (WTF::String::endsWith):
3325         (WTF::String::endsWithIgnoringASCIICase):
3326
3327 2015-03-15  Benjamin Poulain  <bpoulain@apple.com>
3328
3329         Change the exact attribute matching to be ASCII case-insensitive
3330         https://bugs.webkit.org/show_bug.cgi?id=142609
3331
3332         Reviewed by Darin Adler.
3333
3334         Add support for ASCII case insensitive comparisons to all the string
3335         classes.
3336
3337         The new file StringCommon.h has the common algorithm to avoid repeating
3338         the same code with different types.
3339
3340         * WTF.vcxproj/WTF.vcxproj:
3341         * WTF.vcxproj/WTF.vcxproj.filters:
3342         * wtf/ASCIICType.h:
3343         (WTF::toASCIILower):
3344         * wtf/CMakeLists.txt:
3345         * wtf/text/AtomicString.h:
3346         (WTF::equalIgnoringASCIICase):
3347         * wtf/text/StringCommon.h: Added.
3348         (WTF::equalIgnoringASCIICase):
3349         (WTF::equalIgnoringASCIICaseCommon):
3350         * wtf/text/StringImpl.cpp:
3351         (WTF::equalIgnoringASCIICase):
3352         (WTF::equalIgnoringASCIICaseNonNull):
3353         (WTF::StringImpl::utf8Impl):
3354         (WTF::StringImpl::defaultWritingDirection): Deleted.
3355         (WTF::StringImpl::adopt): Deleted.
3356         (WTF::StringImpl::sizeInBytes): Deleted.
3357         (WTF::putUTF8Triple): Deleted.
3358         (WTF::StringImpl::utf8): Deleted.
3359         * wtf/text/StringImpl.h:
3360         (WTF::StringImpl::isSubString): Deleted.
3361         (WTF::find): Deleted.
3362
3363 2015-03-14  Michael Saboff  <msaboff@apple.com>
3364
3365         Disable Yarr JIT for ARMv7k
3366         https://bugs.webkit.org/show_bug.cgi?id=142645
3367
3368         Rubber stamped by Geoffrey Garen.
3369
3370         Changed the setting of ENABLE_YARR_JIT to be predicated on ENABLED_JIT.
3371
3372         * wtf/Platform.h:
3373
3374 2015-03-14  Michael Saboff  <msaboff@apple.com>
3375
3376         ES6: Add binary and octal literal support
3377         https://bugs.webkit.org/show_bug.cgi?id=142681
3378
3379         Reviewed by Ryosuke Niwa.
3380
3381         * wtf/ASCIICType.h:
3382         (WTF::isASCIIBinaryDigit): New support function.
3383         (WTF::isASCIIOctalDigit): Updated to use logical and (&&) instead of binary and (&).
3384
3385 2015-03-13  Mark Lam  <mark.lam@apple.com>
3386
3387         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
3388         <https://webkit.org/b/142674>
3389
3390         Reviewed by Filip Pizlo.
3391
3392         We no longer use TCMalloc in our code, and we now have C++11.  This replaces the
3393         TCMalloc_SpinLock with a new WTF::SpinLock based on WTF::Atomic (which is a
3394         wrapper around std::atomic).
3395
3396         Note that there is a StaticSpinLock and a SpinLock:
3397
3398         1. StaticSpinLock is an alias for SpinLockBase, and its initialization relies on
3399            static / global std:atomic being automatically initialized to 0 at compile time.
3400            Hence, StaticSpinLock should only be used for statics / globals (including
3401            static members of classes / structs).
3402
3403         2. SpinLock is derived from SpinLockBase, and adds a default constructor to
3404            initialize its internal atomic value to 0.  Because SpinLock has a constructor,
3405            it cannot be used for statics / globals.  Objects that want to embed a spin
3406            lock as an instance field should use SpinLock so that it is initialized properly.
3407            std::atomic will not automatically initialize instance fields to 0.  Hence,
3408            StaticSpinLock will not work correctly as instance fields of a class / struct.
3409
3410         * WTF.vcxproj/WTF.vcxproj:
3411         * WTF.vcxproj/WTF.vcxproj.filters:
3412         * WTF.xcodeproj/project.pbxproj:
3413         * wtf/CMakeLists.txt:
3414         * wtf/MetaAllocator.cpp:
3415         (WTF::MetaAllocator::~MetaAllocator):
3416         (WTF::MetaAllocator::MetaAllocator):
3417         * wtf/MetaAllocator.h:
3418         * wtf/SpinLock.h: Added.
3419         (WTF::SpinLockBase::lock):
3420         (WTF::SpinLockBase::unlock):
3421         (WTF::SpinLockBase::isLocked):
3422         (WTF::SpinLockBase::slowLock):
3423         (WTF::SpinLock::SpinLock):
3424         * wtf/TCSpinLock.h: Removed.
3425         * wtf/text/AtomicString.cpp:
3426
3427 2015-03-13  Mark Lam  <mark.lam@apple.com>
3428
3429         Introduce WTF::Atomic to wrap std::atomic for a friendlier CAS.
3430         <https://webkit.org/b/142661>
3431
3432         Reviewed by Filip Pizlo.
3433
3434         The CAS functions provided by std::atomic takes a reference to the expected
3435         value and modifies it if the CAS fails.  However, in a lot of our CAS usage,
3436         we don't want the expected value to change.  The solution to this is to
3437         provide a WTF::Atomic struct that wraps std::atomic, and provide CAS
3438         methods that won't alter the expected value if the CAS fails.
3439
3440         The method names in WTF::Atomic are chosen to be identical to those
3441         in std::atomic so that WTF::Atomic can be a simple drop in replacement
3442         for std::atomic.
3443
3444         Also changed ByteSpinLock to use WTF::Atomic instead of std::atomic.
3445
3446         * wtf/Atomics.h:
3447         (WTF::Atomic::load):
3448         (WTF::Atomic::store):
3449         (WTF::Atomic::compare_exchange_weak):
3450         (WTF::Atomic::compare_exchange_strong):
3451         * wtf/ByteSpinLock.h:
3452         (WTF::ByteSpinLock::ByteSpinLock):
3453         (WTF::ByteSpinLock::lock):
3454
3455 2015-03-12  Filip Pizlo  <fpizlo@apple.com>
3456
3457         Bytecode liveness analysis should have more lambdas and fewer sets
3458         https://bugs.webkit.org/show_bug.cgi?id=142647
3459
3460         Reviewed by Mark Lam.
3461         
3462         Add a method for iterating each set bit in a FastBitVector. Uses a functor as a callback since
3463         this allows for a more efficient algorithm.
3464
3465         * wtf/FastBitVector.h:
3466         (WTF::FastBitVector::forEachSetBit):
3467
3468 2015-03-12  Michael Saboff  <msaboff@apple.com>
3469
3470         Disable Yarr JIT for ARMv7k
3471         https://bugs.webkit.org/show_bug.cgi?id=142645
3472
3473         Reviewed by Oliver Hunt.
3474
3475         Make the setting of ENABLE_YARR_JIT match ENABLE_JIT for ARMv7k.
3476
3477         * wtf/Platform.h:
3478
3479 2015-03-12  Mark Lam  <mark.lam@apple.com>
3480
3481         Change WTF::ByteSpinLock to use std::atomic.
3482         <https://webkit.org/b/142644>
3483
3484         Reviewed by Filip Pizlo.
3485
3486         * wtf/ByteSpinLock.h:
3487         (WTF::ByteSpinLock::ByteSpinLock):
3488         (WTF::ByteSpinLock::lock):
3489         (WTF::ByteSpinLock::unlock):
3490         (WTF::ByteSpinLock::isHeld):
3491
3492 2015-03-12  Csaba Osztrogonác  <ossy@webkit.org>
3493
3494         [ARM][Linux] GC sometimes stuck in an infinite loop if parallel GC is enabled
3495         https://bugs.webkit.org/show_bug.cgi?id=141290
3496
3497         Reviewed by Carlos Garcia Campos.
3498
3499         * wtf/Platform.h: Enable parallel GC after r181319.
3500
3501 2015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
3502
3503         Use out-of-band messaging for RenderBox::firstLineBaseline() and RenderBox::inlineBlockBaseline()
3504         https://bugs.webkit.org/show_bug.cgi?id=142569
3505
3506         Reviewed by David Hyatt.
3507
3508         Provide a callback to Optional::valueOrCompute() which is evaluated only if necessary.
3509
3510         * wtf/Optional.h:
3511         (WTF::Optional::valueOrCompute):
3512
3513 2015-03-10  Brent Fulgham  <bfulgham@apple.com>
3514
3515         [Win] 17 different JSC tests started to fail in DST
3516         https://bugs.webkit.org/show_bug.cgi?id=142531
3517
3518         Reviewed by Chris Dumez.
3519
3520         The stock 'GetTimeZoneInformation' call does not always match the actual Daylight
3521         Savings calendar. This results in a period of time when these tests fail.
3522
3523         If available, we should take advantage of the new 'GetTimeZoneInformationForYear',
3524         which accesses a dynamic calendar of DST dates, which is presumbably updated by
3525         Microsoft from year-to-year.
3526
3527         * wtf/DateMath.cpp:
3528         (WTF::timeZoneInformationForYearFunction): New function to conditionally access
3529         some Vista (and newer) functionality.
3530         (WTF::calculateUTCOffset): Call new function (if available) to calculate proper UTC
3531         time offset.
3532
3533 2015-03-10  Alex Christensen  <achristensen@webkit.org>
3534
3535         Use unsigned for HashSet size.
3536         https://bugs.webkit.org/show_bug.cgi?id=142518
3537
3538         Reviewed by Benjamin Poulain.
3539
3540         * wtf/HashCountedSet.h:
3541         (WTF::Traits>::size):
3542         (WTF::Traits>::capacity):
3543         * wtf/HashMap.h:
3544         (WTF::X>::size):
3545         (WTF::X>::capacity):
3546         * wtf/HashSet.h:
3547         (WTF::V>::size):
3548         (WTF::V>::capacity):
3549         * wtf/HashTable.h:
3550         (WTF::HashTable::Stats::recordCollisionAtCount):
3551         (WTF::HashTable::Stats::dumpStats):
3552         (WTF::HashTable::size):
3553         (WTF::HashTable::capacity):
3554         (WTF::KeyTraits>::deallocateTable):
3555         (WTF::KeyTraits>::checkTableConsistencyExceptSize):
3556         * wtf/HashTraits.h:
3557         * wtf/ListHashSet.h:
3558         (WTF::U>::size):
3559         (WTF::U>::capacity):
3560
3561 2015-03-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
3562
3563         Remove PassRefPtr from svg/properties classes.
3564         https://bugs.webkit.org/show_bug.cgi?id=142063.
3565
3566         Reviewed by Darin Adler.
3567
3568         * wtf/Ref.h:
3569         (WTF::static_reference_cast): Add a stat_cast function to Ref<>.
3570
3571 2015-03-10  Mark Lam  <mark.lam@apple.com>
3572
3573         [Win] JSC Build Warnings Need to be Resolved.
3574         <https://webkit.org/b/142366>
3575
3576         Reviewed by Brent Fulgham.
3577
3578         * wtf/Compiler.h:
3579         - MSVC also does not have the CONSIDERS_UNREACHABLE_CODE quirk.
3580
3581 2015-03-10  Geoffrey Garen  <ggaren@apple.com>
3582
3583         bmalloc: tryFastMalloc shouldn't crash
3584         https://bugs.webkit.org/show_bug.cgi?id=142443
3585
3586         Reviewed by Sam Weinig.
3587
3588         Rolling back in r181307 with a check for whether bmalloc is enabled, to
3589         avoid crashes when running with ASan and GuardMalloc.
3590
3591         * wtf/FastMalloc.cpp:
3592         (WTF::fastMalloc):
3593         (WTF::fastRealloc):
3594         (WTF::fastAlignedMalloc):
3595         (WTF::tryFastMalloc):
3596         (WTF::tryFastRealloc): Deleted.
3597         * wtf/FastMalloc.h:
3598
3599 2015-03-10  Michael Catanzaro  <mcatanzaro@igalia.com>
3600
3601         GCC: CRASH() should be annotated with NORETURN
3602         https://bugs.webkit.org/show_bug.cgi?id=142524
3603
3604         Reviewed by Anders Carlsson.
3605
3606         Add COMPILER(GCC) to #ifdefs that already exist for Clang.
3607
3608         * wtf/Assertions.cpp:
3609         * wtf/Assertions.h:
3610
3611 2015-03-09  Commit Queue  <commit-queue@webkit.org>
3612
3613         Unreviewed, rolling out r181307.
3614         https://bugs.webkit.org/show_bug.cgi?id=142525
3615
3616         Broke ASan tests (Requested by ap on #webkit).
3617
3618         Reverted changeset:
3619
3620         "bmalloc: tryFastMalloc shouldn't crash"
3621         https://bugs.webkit.org/show_bug.cgi?id=142443
3622         http://trac.webkit.org/changeset/181307
3623
3624 2015-03-09  Geoffrey Garen  <ggaren@apple.com>
3625
3626         bmalloc: tryFastMalloc shouldn't crash
3627         https://bugs.webkit.org/show_bug.cgi?id=142443
3628
3629         Reviewed by Darin Adler.
3630
3631         * wtf/FastMalloc.cpp:
3632         (WTF::fastMalloc):
3633         (WTF::fastRealloc):
3634         (WTF::fastAlignedMalloc): Don't check for null. bmalloc automatically
3635         crashes on allocation failure, and we'd rather not pay for an extra check.
3636
3637         (WTF::tryFastMalloc): Added an opt-out API to return null rather than
3638         crashing, since some clients need this.
3639
3640         (WTF::tryFastRealloc): Deleted. Unused.
3641
3642         * wtf/FastMalloc.h:
3643
3644 2015-03-09  Mark Lam  <mark.lam@apple.com>
3645
3646         8-bit version of weakCompareAndSwap() can cause an infinite loop.
3647         https://webkit.org/b/142513>
3648
3649         Reviewed by Filip Pizlo.
3650
3651         Presently, Bitmap::concurrentTestAndSet() uses the 8-bit version of
3652         weakCompareAndSwap() (which compares and swaps an uint8_t value).
3653         Bitmap::concurrentTestAndSet() has a loop that checks if a bit in the
3654         byte of interest has been set.  If not, it will call the 8-bit CAS
3655         function to set the bit.
3656
3657         Under the covers, for ARM, the 8-bit CAS function actually works with a
3658         32-bit CAS.  The 8-bit CAS will first fetch the 32-bit value in memory
3659         that should contain the 8-bit value, and check if it contains the
3660         expected byte.  If the value in memory doesn't have the expected byte,
3661         it will return early to its caller.  The expectation is that the caller
3662         will reload the byte from memory and call the 8-bit CAS again.
3663
3664         Unfortunately, this code path that returns early does not have a
3665         compiler fence.  Without a compiler fence, the C++ compiler can
3666         optimize away the reloading of the expected byte value, leaving it
3667         unchanged.  As a result, we'll have a infinite loop here that checks a
3668         value that will never change, and the loop will not terminate until the
3669         value changes.
3670
3671         The fix is to eliminate the early return check in the 8-bit CAS, and
3672         have it always call down to the 32-bit CAS.  The 32-bit CAS has a
3673         compiler fence which will prevent this issue.
3674
3675         * wtf/Atomics.h:
3676         (WTF::weakCompareAndSwap):
3677
3678 2015-03-09  Martin Robinson  <mrobinson@igalia.com>
3679
3680         [EFL] Move DispatchQueue to WTF
3681         https://bugs.webkit.org/show_bug.cgi?id=142493
3682
3683         Reviewed by Csaba Osztrogonác.
3684
3685         * wtf/PlatformEfl.cmake: Add DispatchQueue to the source list.
3686         * wtf/efl/DispatchQueueEfl.cpp: Renamed from Source/WebKit2/Platform/efl/DispatchQueueEfl.cpp.
3687         * wtf/efl/DispatchQueueEfl.h: Renamed from Source/WebKit2/Platform/efl/DispatchQueueEfl.h.
3688         * wtf/efl/DispatchQueueWorkItemEfl.h: Renamed from Source/WebKit2/Platform/efl/DispatchQueueWorkItemEfl.h.
3689
3690 2015-03-08  Brent Fulgham  <bfulgham@apple.com>
3691
3692         [Win] WTF::WorkQueue does not balance ref/deref properly
3693         https://bugs.webkit.org/show_bug.cgi?id=142471
3694
3695         Reviewed by Antti Koivisto.
3696
3697         Make sure we deref the count when we execute a function in the
3698         WorkQueue.
3699
3700         * wtf/win/WorkQueueWin.cpp:
3701         (WTF::WorkQueue::performWorkOnRegisteredWorkThread):
3702
3703 2015-03-07  Brent Fulgham  <bfulgham@apple.com>
3704
3705         [Win] Revive WTF::WorkQueue on Windows
3706         https://bugs.webkit.org/show_bug.cgi?id=142432
3707
3708         Reviewed by Darin Adler.
3709
3710         Revive the Windows implementation of WTF::WorkQueue.
3711
3712         * WTF.vcxproj/WTF.vcxproj:
3713         * WTF.vcxproj/WTF.vcxproj.filters:
3714         * wtf/WorkQueue.h:
3715         * wtf/win/WorkItemWin.cpp: Added.
3716         * wtf/win/WorkItemWin.h: Added.
3717         * wtf/win/WorkQueueWin.cpp: Added.
3718
3719 2015-03-06  Geoffrey Garen  <ggaren@apple.com>
3720
3721         Fix crashes seen on the the Windows buildbots after my last patch.
3722
3723         Unreviewed.
3724
3725         * wtf/FastMalloc.cpp:
3726         (WTF::fastAlignedMalloc): Let's pass these arguments in the right order.
3727
3728 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
3729
3730         Crash in -[WebCascadeList objectAtIndex:] + 195
3731         https://bugs.webkit.org/show_bug.cgi?id=141274
3732
3733         Reviewed by David Kilzer.
3734
3735         * wtf/WeakPtr.h:
3736         (WTF::WeakPtrFactory::createWeakPtr): WebCascadeList uses a const FontCascade,
3737         and it calls createWeakPtr() on it. Therefore, createWeakPtr has to be marked
3738         const.
3739         (WTF::WeakPtrFactory::operator=): Removed because it was broken and had no
3740         callers
3741
3742 2015-03-06  Simon Fraser  <simon.fraser@apple.com>
3743
3744         Allow tree dumping functions to be used in release builds by switching a flag
3745         https://bugs.webkit.org/show_bug.cgi?id=142379
3746
3747         Reviewed by Zalan Bujtas.
3748
3749         There are various tree dumping functions that are useful for debugging, and sometimes
3750         you want to be able to use them in release builds. Currently they are surrounded by
3751         #ifndef NDEBUG. Change this to #if ENABLE(TREE_DEBUGGING), which is defined to 0 or 1
3752         in wtf/Platform.h
3753
3754         * wtf/Platform.h:
3755
3756 2015-03-05  Chris Dumez  <cdumez@apple.com>
3757
3758         Regression(r173761): ASSERTION FAILED: !is8Bit() in StringImpl::characters16()
3759         https://bugs.webkit.org/show_bug.cgi?id=142350
3760
3761         Reviewed by Michael Saboff and Benjamin Poulain.
3762
3763         Fix ASSERTION FAILED: !is8Bit() in StringImpl::characters16() from
3764         WTF::equalInner() after r173761. The code was incorrectly assuming that
3765         if stringImpl is 16-bit, then matchString is 16-bit too, which is not
3766         correct.
3767
3768         Also rename WTFString::startsWith() / endsWith() taking an offset to
3769         hasInfixStartingAt() / hasInfixEndingAt() for clarity. It seems odd
3770         to call it startsWith even though it won't technically *start* with
3771         the pattern if the input offset is greater than zero.
3772
3773         Also drop the caseSensitive argument as it is never used (always true
3774         at call sites.
3775
3776         * wtf/text/StringImpl.cpp:
3777         (WTF::equalInner):
3778         (WTF::StringImpl::hasInfixStartingAt):
3779         (WTF::StringImpl::hasInfixEndingAt):
3780         (WTF::StringImpl::startsWith): Deleted.
3781         (WTF::StringImpl::endsWith): Deleted.
3782         * wtf/text/StringImpl.h:
3783         * wtf/text/WTFString.h:
3784         (WTF::String::hasInfixStartingAt):
3785         (WTF::String::hasInfixEndingAt):
3786         (WTF::String::startsWith): Deleted.
3787         (WTF::String::endsWith): Deleted.
3788
3789 2015-03-05  Chris Dumez  <cdumez@apple.com>
3790
3791         NetworkCache efficacy logging is using too much CPU
3792         https://bugs.webkit.org/show_bug.cgi?id=142186
3793         <rdar://problem/19632080>
3794
3795         Reviewed by Antti Koivisto.
3796
3797         * wtf/HashMap.h:
3798         (WTF::copyToVector):
3799         Add copyToVector() utility function for HashMap that uses an std::pair<key, value>
3800         as element type.
3801
3802         * wtf/text/WTFString.h:
3803         (WTF::StringCapture::StringCapture):
3804         (WTF::StringCapture::operator=):
3805         Add default constructor and assignment operator to StringCapture so that
3806         it can be used in a Vector.
3807
3808 2015-03-05  Antti Koivisto  <antti@apple.com>
3809
3810         Support WorkQueue QOS classes on Mavericks
3811         https://bugs.webkit.org/show_bug.cgi?id=142328
3812
3813         Reviewed by Anders Carlsson.
3814
3815         "The priority of a dispatch queue is inherited from its target queue.  In order to
3816         change the priority of a queue created with dispatch_queue_create(), use the
3817         dispatch_get_global_queue() function to obtain a target queue of the desired prior-
3818         ity."
3819
3820         * wtf/cocoa/WorkQueueCocoa.cpp:
3821         (WTF::targetQueueForQOSClass):
3822         (WTF::WorkQueue::platformInitialize):
3823
3824 2015-03-03  Anders Carlsson  <andersca@apple.com>
3825
3826         Remove unused compression code
3827         https://bugs.webkit.org/show_bug.cgi?id=142237
3828
3829         Reviewed by Geoffrey Garen.
3830
3831         * WTF.vcxproj/WTF.vcxproj:
3832         * WTF.vcxproj/WTF.vcxproj.filters:
3833         * WTF.xcodeproj/project.pbxproj:
3834         * wtf/CMakeLists.txt:
3835         * wtf/Compression.cpp: Removed.
3836         * wtf/Compression.h: Removed.
3837
3838 2015-03-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3839
3840         [WK2] Remove unnecessary create() factory functions.
3841         https://bugs.webkit.org/show_bug.cgi?id=142161
3842
3843         Reviewed by Chris Dumez.
3844
3845         We can replace some create() factory functions with std::make_unique(). Because
3846         it just returns new instance. Even some of those functions have used std::unique_ptr<>
3847         instead of std::make_unique<>. Fixed all.
3848
3849         * wtf/efl/WorkQueueEfl.cpp:
3850         (WorkQueue::dispatch):
3851
3852 2015-03-02  Filip Pizlo  <fpizlo@apple.com>
3853
3854         DFG compile time measurements should really report milliseconds
3855         https://bugs.webkit.org/show_bug.cgi?id=142209
3856
3857         Reviewed by Benjamin Poulain.
3858         
3859         This bug was introduced because currentTimeMS() calls were converted to
3860         monotonicallyIncreasingTime() calls. Perhaps this bug would be less likely if there was a
3861         monotonicallyIncreasingTimeMS() function available, so this patch adds it.
3862
3863         * wtf/CurrentTime.h:
3864         (WTF::monotonicallyIncreasingTimeMS):
3865
3866 2015-02-27  Darin Adler  <darin@apple.com>
3867
3868         Remove unused PossiblyNull
3869         https://bugs.webkit.org/show_bug.cgi?id=142124
3870
3871         Reviewed by Andreas Kling.
3872
3873         * WTF.vcxproj/WTF.vcxproj: Removed the file.
3874         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
3875         * WTF.xcodeproj/project.pbxproj: Ditto.
3876         * wtf/CMakeLists.txt: Ditto.
3877         * wtf/PossiblyNull.h: Removed.
3878
3879         * wtf/FastMalloc.h: Moved everything to the left.
3880         Moved member functions out of the TryMallocReturnValue class definition.
3881         (WTF::TryMallocReturnValue::operator PossiblyNull<T>): Deleted.
3882         (WTF::TryMallocReturnValue::getValue): Marked inline, changed to work
3883         only with pointer types, not arbitrary non-pointer types.
3884
3885 2015-02-26  Brent Fulgham  <bfulgham@apple.com>
3886
3887         [Win] Make build logs more legible by reducing noise
3888         https://bugs.webkit.org/show_bug.cgi?id=142034
3889
3890         Reviewed by Alexey Proskuryakov.
3891
3892         Modify batch files, makefiles, and DOS commands to remove
3893         uninteresting/unhelpful output.
3894
3895         * WTF.vcxproj/WTFGenerated.make:
3896         * WTF.vcxproj/WTFPreBuild.cmd:
3897         * WTF.vcxproj/copy-files.cmd:
3898
3899 2015-02-26  Landry Breuil  <landry@openbsd.org>
3900
3901         Revert bug 19975, now that gcc 4.7 is required.
3902         https://bugs.webkit.org/show_bug.cgi?id=129927
3903
3904         Reviewed by Andreas Kling.
3905
3906         isfinite() and signbit() are provided by gcc's cmath header.
3907
3908         * wtf/MathExtras.h:
3909
3910 2015-02-26  Csaba Osztrogonác  <ossy@webkit.org>
3911
3912         UNREACHABLE_FOR_PLATFORM() should be release assert
3913         https://bugs.webkit.org/show_bug.cgi?id=141904
3914
3915         Reviewed by Darin Adler.
3916
3917         * wtf/Assertions.h:
3918         (UNREACHABLE_FOR_PLATFORM):
3919
3920 2015-02-25  Filip Pizlo  <fpizlo@apple.com>
3921
3922         Enable concurrent JIT on GTK
3923         https://bugs.webkit.org/show_bug.cgi?id=142007
3924
3925         Reviewed by Benjamin Poulain.
3926
3927         Seems weird that GTK keeps it off. No good reason for that as far as I can tell.
3928
3929         * wtf/Platform.h:
3930
3931 2015-02-23  Brent Fulgham  <bfulgham@apple.com>
3932
3933         WTF::WeakPtr should rename 'forgot' to 'clear' and support nullptr assignment
3934         https://bugs.webkit.org/show_bug.cgi?id=141935
3935
3936         Reviewed by Myles C. Maxfield.
3937
3938         * wtf/WeakPtr.h:
3939         (WTF::WeakPtr::operator=): Added 'nullptr_t' overload.
3940         (WTF::WeakPtr::clear): Renamed from 'forget'
3941         (WTF::WeakPtr::forget): Deleted.
3942
3943 2015-02-23  Brent Fulgham  <bfulgham@apple.com>
3944
3945         WTF::WeakPtr should have a 'forget' method
3946         https://bugs.webkit.org/show_bug.cgi?id=141923
3947
3948         Reviewed by Myles C. Maxfield.
3949
3950         * wtf/WeakPtr.h:
3951         (WTF::WeakPtr::forget): Added.
3952
3953 2015-02-20  Geoffrey Garen  <ggaren@apple.com>
3954
3955         Remove TCMalloc
3956         https://bugs.webkit.org/show_bug.cgi?id=141844
3957
3958         Reviewed by Andreas Kling.
3959
3960         It's unused.
3961
3962         * WTF.vcxproj/WTF.vcxproj:
3963         * WTF.vcxproj/WTF.vcxproj.filters:
3964         * WTF.xcodeproj/project.pbxproj:
3965         * wtf/CMakeLists.txt:
3966         * wtf/FastMalloc.cpp:
3967         (WTF::EntropySource<4>::value): Deleted.
3968         (WTF::EntropySource<8>::value): Deleted.
3969         (WTF::internalEntropyValue): Deleted.
3970         (WTF::freedObjectStartPoison): Deleted.
3971         (WTF::freedObjectEndPoison): Deleted.
3972         (WTF::ClassIndex): Deleted.
3973         (WTF::HardenedSLL::create): Deleted.
3974         (WTF::HardenedSLL::null): Deleted.
3975         (WTF::HardenedSLL::setValue): Deleted.
3976         (WTF::HardenedSLL::value): Deleted.
3977         (WTF::HardenedSLL::operator!): Deleted.
3978         (WTF::HardenedSLL::operator UnspecifiedBoolType): Deleted.
3979         (WTF::HardenedSLL::operator!=): Deleted.
3980         (WTF::HardenedSLL::operator==): Deleted.
3981         (WTF::LgFloor): Deleted.
3982         (WTF::SLL_Next): Deleted.
3983         (WTF::SLL_SetNext): Deleted.
3984         (WTF::SLL_Push): Deleted.
3985         (WTF::SLL_Pop): Deleted.
3986         (WTF::SLL_PopRange): Deleted.
3987         (WTF::SLL_PushRange): Deleted.
3988         (WTF::SizeClass): Deleted.
3989         (WTF::ByteSizeForClass): Deleted.
3990         (WTF::NumMoveSize): Deleted.
3991         (WTF::InitSizeClasses): Deleted.
3992         (WTF::MetaDataAlloc): Deleted.
3993         (WTF::PageHeapAllocator::Init): Deleted.
3994         (WTF::PageHeapAllocator::New): Deleted.
3995         (WTF::PageHeapAllocator::Delete): Deleted.
3996         (WTF::PageHeapAllocator::inuse): Deleted.
3997         (WTF::pages): Deleted.
3998         (WTF::AllocationSize): Deleted.
3999         (WTF::spanInitializerCookie): Deleted.
4000         (WTF::Span::next): Deleted.
4001         (WTF::Span::remoteNext): Deleted.
4002         (WTF::Span::prev): Deleted.
4003         (WTF::Span::setNext): Deleted.
4004         (WTF::Span::setPrev): Deleted.
4005         (WTF::Span::initCookie): Deleted.
4006         (WTF::Span::clearCookie): Deleted.
4007         (WTF::Span::isValid): Deleted.
4008         (WTF::Event): Deleted.
4009         (WTF::NewSpan): Deleted.
4010         (WTF::DeleteSpan): Deleted.
4011         (WTF::DLL_Init): Deleted.
4012         (WTF::DLL_Remove): Deleted.
4013         (WTF::DLL_IsEmpty): Deleted.
4014         (WTF::DLL_Length): Deleted.
4015         (WTF::DLL_Print): Deleted.
4016         (WTF::DLL_Prepend): Deleted.
4017         (WTF::TCMalloc_Central_FreeList::length): Deleted.
4018         (WTF::TCMalloc_Central_FreeList::tc_length): Deleted.
4019         (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Deleted.
4020         (WTF::TCMalloc_Central_FreeList::entropy): Deleted.
4021         (WTF::FastMallocZone::goodSize): Deleted.
4022         (WTF::FastMallocZone::check): Deleted.
4023         (WTF::FastMallocZone::print): Deleted.
4024         (WTF::FastMallocZone::log): Deleted.
4025         (WTF::FastMallocZone::forceLock): Deleted.
4026         (WTF::FastMallocZone::forceUnlock): Deleted.
4027         (WTF::FastMallocZone::statistics): Deleted.
4028         (WTF::FastMallocZone::zoneValloc): Deleted.
4029         (WTF::FastMallocZone::zoneDestroy): Deleted.
4030         (WTF::MallocHook::record): Deleted.
4031         (WTF::MallocHook::recordAllocation): Deleted.
4032         (WTF::MallocHook::recordDeallocation): Deleted.
4033         (WTF::MallocHook::init): Deleted.
4034         (WTF::MallocHook::InvokeNewHook): Deleted.
4035         (WTF::MallocHook::InvokeDeleteHook): Deleted.
4036         (WTF::KernelSupportsTLS): Deleted.
4037         (WTF::CheckIfKernelSupportsTLS): Deleted.
4038         (WTF::TCMalloc_PageHeap::GetDescriptor): Deleted.
4039         (WTF::TCMalloc_PageHeap::GetDescriptorEnsureSafe): Deleted.
4040         (WTF::TCMalloc_PageHeap::SystemBytes): Deleted.
4041         (WTF::TCMalloc_PageHeap::FreeBytes): Deleted.
4042         (WTF::TCMalloc_PageHeap::GetSizeClassIfCached): Deleted.
4043         (WTF::TCMalloc_PageHeap::CacheSizeClass): Deleted.
4044         (WTF::TCMalloc_PageHeap::RecordSpan): Deleted.
4045         (WTF::TCMalloc_PageHeap::init): Deleted.
4046         (WTF::TCMalloc_PageHeap::initializeScavenger): Deleted.
4047         (WTF::TCMalloc_PageHeap::isScavengerSuspended): Deleted.
4048         (WTF::TCMalloc_PageHeap::scheduleScavenger): Deleted.
4049         (WTF::TCMalloc_PageHeap::rescheduleScavenger): Deleted.
4050         (WTF::TCMalloc_PageHeap::suspendScavenger): Deleted.
4051         (WTF::TCMalloc_PageHeap::scavengerTimerFired): Deleted.
4052         (WTF::TCMalloc_PageHeap::runScavengerThread): Deleted.
4053         (WTF::TCMalloc_PageHeap::signalScavenger): Deleted.
4054         (WTF::TCMalloc_PageHeap::scavenge): Deleted.
4055         (WTF::TCMalloc_PageHeap::shouldScavenge): Deleted.
4056         (WTF::TCMalloc_PageHeap::New): Deleted.
4057         (WTF::TCMalloc_PageHeap::AllocLarge): Deleted.
4058         (WTF::TCMalloc_PageHeap::Split): Deleted.
4059         (WTF::TCMalloc_PageHeap::Carve): Deleted.
4060         (WTF::mergeDecommittedStates): Deleted.
4061         (WTF::TCMalloc_PageHeap::Delete): Deleted.
4062         (WTF::TCMalloc_PageHeap::IncrementalScavenge): Deleted.
4063         (WTF::TCMalloc_PageHeap::RegisterSizeClass): Deleted.
4064         (WTF::TCMalloc_PageHeap::ReturnedBytes): Deleted.
4065         (WTF::PagesToMB): Deleted.
4066         (WTF::TCMalloc_PageHeap::Dump): Deleted.
4067         (WTF::TCMalloc_PageHeap::GrowHeap): Deleted.
4068         (WTF::TCMalloc_PageHeap::Check): Deleted.
4069         (WTF::TCMalloc_PageHeap::CheckList): Deleted.
4070         (WTF::TCMalloc_PageHeap::ReleaseFreeList): Deleted.
4071         (WTF::TCMalloc_PageHeap::ReleaseFreePages): Deleted.
4072         (WTF::TCMalloc_ThreadCache_FreeList::Init): Deleted.
4073         (WTF::TCMalloc_ThreadCache_FreeList::length): Deleted.
4074         (WTF::TCMalloc_ThreadCache_FreeList::empty): Deleted.
4075         (WTF::TCMalloc_ThreadCache_FreeList::lowwatermark): Deleted.
4076         (WTF::TCMalloc_ThreadCache_FreeList::clear_lowwatermark): Deleted.
4077         (WTF::TCMalloc_ThreadCache_FreeList::Push): Deleted.
4078         (WTF::TCMalloc_ThreadCache_FreeList::PushRange): Deleted.
4079         (WTF::TCMalloc_ThreadCache_FreeList::PopRange): Deleted.
4080         (WTF::TCMalloc_ThreadCache_FreeList::Pop): Deleted.
4081         (WTF::TCMalloc_ThreadCache_FreeList::Validate): Deleted.
4082         (WTF::TCMalloc_ThreadCache_FreeList::enumerateFreeObjects): Deleted.
4083         (WTF::TCMalloc_ThreadCache::freelist_length): Deleted.
4084         (WTF::TCMalloc_ThreadCache::Size): Deleted.
4085         (WTF::TCMalloc_ThreadCache::enumerateFreeObjects): Deleted.
4086         (WTF::getPageHeap): Deleted.
4087         (WTF::fastMallocGoodSize): Deleted.
4088         (WTF::TCMalloc_PageHeap::periodicScavenge): Deleted.
4089         (WTF::TCMalloc_PageHeap::scavengerThread): Deleted.
4090         (WTF::setThreadHeap): Deleted.
4091         (WTF::TCMalloc_Central_FreeList::Init): Deleted.
4092         (WTF::TCMalloc_Central_FreeList::ReleaseListToSpans): Deleted.
4093         (WTF::TCMalloc_Central_FreeList::ReleaseToSpans): Deleted.
4094         (WTF::TCMalloc_Central_FreeList::EvictRandomSizeClass): Deleted.
4095         (WTF::TCMalloc_Central_FreeList::MakeCacheSpace): Deleted.
4096         (WTF::TCMalloc_Central_FreeList::ShrinkCache): Deleted.
4097         (WTF::TCMalloc_Central_FreeList::InsertRange): Deleted.
4098         (WTF::TCMalloc_Central_FreeList::RemoveRange): Deleted.
4099         (WTF::TCMalloc_Central_FreeList::FetchFromSpansSafe): Deleted.
4100         (WTF::TCMalloc_Central_FreeList::FetchFromSpans): Deleted.
4101         (WTF::TCMalloc_Central_FreeList::Populate): Deleted.
4102         (WTF::TCMalloc_ThreadCache::SampleAllocation): Deleted.
4103         (WTF::TCMalloc_ThreadCache::Init): Deleted.
4104         (WTF::TCMalloc_ThreadCache::Cleanup): Deleted.
4105         (WTF::TCMalloc_ThreadCache::Allocate): Deleted.
4106         (WTF::TCMalloc_ThreadCache::Deallocate): Deleted.
4107         (WTF::TCMalloc_ThreadCache::FetchFromCentralCache): Deleted.
4108         (WTF::TCMalloc_ThreadCache::ReleaseToCentralCache): Deleted.
4109         (WTF::TCMalloc_ThreadCache::Scavenge): Deleted.
4110         (WTF::TCMalloc_ThreadCache::PickNextSample): Deleted.
4111         (WTF::TCMalloc_ThreadCache::InitModule): Deleted.
4112         (WTF::TCMalloc_ThreadCache::NewHeap): Deleted.
4113         (WTF::TCMalloc_ThreadCache::GetThreadHeap): Deleted.
4114         (WTF::TCMalloc_ThreadCache::GetCache): Deleted.
4115         (WTF::TCMalloc_ThreadCache::GetCacheIfPresent): Deleted.
4116         (WTF::TCMalloc_ThreadCache::InitTSD): Deleted.
4117         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary): Deleted.
4118         * wtf/TCPackedCache.h: Removed.
4119         * wtf/TCPageMap.h: Removed.
4120         * wtf/TCSystemAlloc.cpp: Removed.
4121         * wtf/TCSystemAlloc.h: Removed.
4122
4123 2015-02-20  Alexey Proskuryakov  <ap@apple.com>
4124
4125         Remove svn:keywords property.
4126
4127         As far as I can tell, the property had no effect on any of these files, but also,
4128         when it has effect it's likely harmful.
4129
4130         * wtf/DecimalNumber.cpp: Removed property svn:keywords.
4131         * wtf/spi/darwin/XPCSPI.h: Removed property svn:keywords.
4132
4133 2015-02-20  Csaba Osztrogonác  <ossy@webkit.org>
4134
4135         EFL URTBF
4136
4137         * wtf/PlatformEfl.cmake:
4138
4139 2015-02-20  Simon Fraser  <simon.fraser@apple.com>
4140
4141         RunLoop::dispatch() should drop the mutex before calling wakeUp().
4142         https://bugs.webkit.org/show_bug.cgi?id=141820
4143
4144         Reviewed by Alexey Proskuryakov.
4145         
4146         RunLoop::wakeUp() calls into CoreFoundation which could take time,
4147         so scope the mutex just to protect m_functionQueue.
4148
4149         * wtf/RunLoop.cpp:
4150         (WTF::RunLoop::dispatch):
4151
4152 2015-02-20  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
4153
4154         Unreviewed, EFL build fix since r180410.
4155
4156         * wtf/PlatformEfl.cmake: Add WEBKIT2/Platform/efl path in order to include DispatchQueueEfl.h.
4157
4158 2015-02-20  Antti Koivisto  <antti@apple.com>
4159
4160         Move WorkQueue from WK2 to WTF
4161         https://bugs.webkit.org/show_bug.cgi?id=141797
4162
4163         Reviewed by Anders Carlsson.
4164
4165         It may be useful in WebCore.
4166
4167         Windows implementation is still missing.
4168
4169         * WTF.xcodeproj/project.pbxproj:
4170         * wtf/CMakeLists.txt:
4171         * wtf/PlatformGTK.cmake:
4172         * wtf/WorkQueue.cpp: Copied from Source/WebKit2/Platform/WorkQueue.cpp.
4173         * wtf/WorkQueue.h: Copied from Source/WebKit2/Platform/WorkQueue.h.
4174         * wtf/cocoa: Added.
4175         * wtf/cocoa/WorkQueueCocoa.cpp: Copied from Source/WebKit2/Platform/mac/WorkQueueMac.cpp.
4176         * wtf/efl/WorkQueueEfl.cpp: Copied from Source/WebKit2/Platform/efl/WorkQueueEfl.cpp.
4177         * wtf/gtk/WorkQueueGtk.cpp: Copied from Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp.
4178
4179 2015-02-13  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
4180
4181         [EFL] Enable bmalloc for EFL port 
4182         https://bugs.webkit.org/show_bug.cgi?id=141459
4183
4184         Reviewed by Csaba Osztrogonác.
4185
4186         * wtf/CMakeLists.txt: Remove TCSystemAlloc.cpp/h.
4187         * wtf/FastMalloc.cpp: Enable BMALLOC for EFL port.
4188
4189 2015-02-13  Anders Carlsson  <andersca@apple.com>
4190
4191         Add a move constructor and move assignment operator to Deque
4192         https://bugs.webkit.org/show_bug.cgi?id=141571
4193
4194         Reviewed by Andreas Kling.
4195
4196         * wtf/Deque.h:
4197         (WTF::inlineCapacity>::Deque):
4198         (WTF::=): Deleted.
4199
4200 2015-02-13  Anders Carlsson  <andersca@apple.com>
4201
4202         Add an initializer list constructor to Deque
4203         https://bugs.webkit.org/show_bug.cgi?id=141565
4204
4205         Reviewed by Andreas Kling.
4206
4207         * wtf/Deque.h:
4208         (WTF::inlineCapacity>::Deque):
4209
4210 2015-02-13  Anders Carlsson  <andersca@apple.com>
4211
4212         Re-indent Deque.h
4213
4214         Rubber-stamped by Antti Koivisto.
4215
4216         * wtf/Deque.h:
4217
4218 2015-02-11  Brent Fulgham  <bfulgham@apple.com>
4219
4220         [Win] [64-bit] Work around MSVC2013 Runtime Bug
4221         https://bugs.webkit.org/show_bug.cgi?id=141498
4222         <rdar://problem/19803642>
4223
4224         Reviewed by Anders Carlsson.
4225
4226         Disable FMA3 instruction use in the MSVC math library to
4227         work around a VS2013 runtime crash. We can remove this
4228         workaround when we switch to VS2015.
4229
4230         * WTF.vcxproj/WTF.vcxproj: Add new files.
4231         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
4232         * wtf/win/WTFDLL.cpp: Added.
4233
4234 2015-02-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
4235
4236         [EFL][GTK] Use bmalloc instead of tcmalloc
4237         https://bugs.webkit.org/show_bug.cgi?id=140162
4238
4239         Reviewed by Carlos Garcia Campos.
4240
4241         * wtf/CMakeLists.txt:
4242         * wtf/FastMalloc.cpp:
4243             Enable bmalloc on GTK ports, but EFL port will enable it when bmalloc supports
4244             memory statistics.
4245
4246 2015-02-10  Darin Adler  <darin@apple.com>
4247
4248         Add the crash-on-failure behavior to bmalloc-based fastMalloc
4249         https://bugs.webkit.org/show_bug.cgi?id=141434
4250
4251         Reviewed by Alexey Proskuryakov.
4252
4253         * wtf/FastMalloc.cpp: Removed unneeded includes.
4254         (WTF::fastMalloc): Added null check and CRASH.
4255         (WTF::fastCalloc): Added overflow checking, null check, and CRASH.
4256         (WTF::fastRealloc): Added null check and CRASH.
4257         (WTF::fastMallocSize): Added FIXME comment.
4258         (WTF::fastMallocGoodSize): Added FIXME comment.
4259         (WTF::fastAlignedMalloc): Added null check and CRASH.
4260         (WTF::tryFastMalloc): Changed to call bmalloc directly instead of
4261         calling fastMalloc, since fastMalloc will now crash on failure.
4262         (WTF::tryFastRealloc): Changed to call bmalloc directly instead of
4263         calling fastRealloc, since fastRealloc will now crash on failure.
4264         (WTF::tryFastCalloc): Added overflow checking.
4265         (WTF::fastMallocStatistics): Added FIXME comment.
4266
4267 2015-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
4268
4269         [GTK] GMutexLocker build issue
4270         https://bugs.webkit.org/show_bug.cgi?id=141381
4271
4272         Reviewed by Žan Doberšek.
4273
4274         Remove using WTF::GMutexLocker from the header, since newer glib
4275         versions have a GMutexLocker in the public API.
4276
4277         * wtf/gobject/GMutexLocker.h:
4278
4279 2015-02-09  Alexey Proskuryakov  <ap@apple.com>
4280
4281         REGRESSION: tryFastCalloc is no longer "try"
4282         https://bugs.webkit.org/show_bug.cgi?id=141406
4283
4284         Reviewed by Darin Adler.
4285
4286         This causes crashes on some WebKit regression test bots.
4287
4288         * wtf/FastMalloc.cpp: (WTF::tryFastCalloc): Fix what looks like a copy/paste mistake.
4289
4290 2015-02-07  Csaba Osztrogonác  <ossy@webkit.org>
4291
4292         [ARM] GC sometimes stuck in an infinite loop if parallel GC is enabled
4293         https://bugs.webkit.org/show_bug.cgi?id=141290
4294
4295         Reviewed by Anders Carlsson.
4296
4297         * wtf/Platform.h:
4298
4299 2015-02-07  Chris Dumez  <cdumez@apple.com>
4300
4301         Add Vector::removeFirstMatching() / removeAllMatching() methods taking lambda functions
4302         https://bugs.webkit.org/show_bug.cgi?id=141321
4303
4304         Reviewed by Darin Adler.
4305
4306         Add Vector::removeFirstMatching() / removeAllMatching() methods taking
4307         lambda functions to match the element(s) to remove. This simplifies the
4308         code a bit. Vector::removeAllMatching() is also more efficient than the
4309         manual removal alternative.
4310
4311         * wtf/Vector.h:
4312
4313 2015-02-06  Commit Queue  <commit-queue@webkit.org>
4314
4315         Unreviewed, rolling out r179743.
4316         https://bugs.webkit.org/show_bug.cgi?id=141335
4317
4318         caused missing symbols in non-WebKit clients of WTF::Vector
4319         (Requested by kling on #webkit).
4320
4321         Reverted changeset:
4322
4323         "Remove WTF::fastMallocGoodSize()."
4324         https://bugs.webkit.org/show_bug.cgi?id=141020
4325         http://trac.webkit.org/changeset/179743
4326
4327 2015-02-06  Andreas Kling  <akling@apple.com>
4328
4329         Remove WTF::fastMallocGoodSize().
4330         <https://webkit.org/b/141020>
4331
4332         Reviewed by Anders Carlsson.
4333
4334         bmalloc's good-size API just returns exactly whatever you pass it,
4335         so it's of no utility to us anymore.
4336
4337         This gets rid of a bunch of pointless out-of-line calls in Vector
4338         construction and growth.
4339
4340         * wtf/Compression.cpp:
4341         (WTF::GenericCompressedData::create):
4342         * wtf/FastMalloc.cpp:
4343         (WTF::fastMallocGoodSize): Deleted.
4344         * wtf/FastMalloc.h:
4345         * wtf/Vector.h:
4346         (WTF::VectorBufferBase::allocateBuffer):
4347         (WTF::VectorBufferBase::tryAllocateBuffer):
4348         (WTF::VectorBufferBase::reallocateBuffer):
4349
4350 2015-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
4351
4352         [Streams API] Implement a barebone ReadableStream interface
4353         https://bugs.webkit.org/show_bug.cgi?id=141045
4354
4355         Reviewed by Benjamin Poulain.
4356
4357         * wtf/FeatureDefines.h:
4358
4359 2015-02-04  Alexey Proskuryakov  <ap@apple.com>
4360
4361         Optimized equal() functions in StringImpl.h are not ASan compatible
4362         https://bugs.webkit.org/show_bug.cgi?id=141258
4363
4364         Reviewed by Daniel Bates.
4365
4366         * wtf/text/StringImpl.h: (WTF::equal): Add custom implementations for ASan.
4367
4368 2015-02-04  Chris Dumez  <cdumez@apple.com>
4369
4370         Add removeFirst(value) / removeAll(value) methods to WTF::Vector
4371         https://bugs.webkit.org/show_bug.cgi?id=141192
4372
4373         Reviewed by Benjamin Poulain.
4374
4375         Add removeFirst(value) / removeAll(value) convenience methods to
4376         WTF::Vector to reduce complexity a bit at call sites.
4377
4378         I am planning to add overloads for these taking a lambda function for
4379         matching in a follow-up patch as well. I have seen quite a few
4380         Vector::remove(index) call sites that would benefit from it.
4381
4382         * wtf/Vector.h:
4383         (WTF::OverflowHandler>::removeFirst):
4384         (WTF::OverflowHandler>::removeAll):
4385
4386 2015-02-02  Dhi Aurrahman  <diorahman@rockybars.com>
4387
4388         Optimize matchesLangPseudoClass() of :lang()
4389         https://bugs.webkit.org/show_bug.cgi?id=140873
4390