Move some commands from ./CMakeLists.txt to Source/cmake
[WebKit-https.git] / Source / WTF / ChangeLog
1 2015-08-17  Alex Christensen  <achristensen@webkit.org>
2
3         Move some commands from ./CMakeLists.txt to Source/cmake
4         https://bugs.webkit.org/show_bug.cgi?id=148003
5
6         Reviewed by Brent Fulgham.
7
8         * CMakeLists.txt:
9         Added commands needed to build WTF by itself.
10
11 2015-08-14  Filip Pizlo  <fpizlo@apple.com>
12
13         Use WTF::Lock and WTF::Condition instead of WTF::Mutex, WTF::ThreadCondition, std::mutex, and std::condition_variable
14         https://bugs.webkit.org/show_bug.cgi?id=147999
15
16         Reviewed by Geoffrey Garen.
17
18         Relanding after fixing a deadlock on Linux.
19
20         * wtf/Condition.h: "using WTF::Condition".
21         * wtf/Lock.h:
22         (WTF::LockBase::lock):
23         (WTF::LockBase::tryLock): Add tryLock() because it turns out that we use it sometimes.
24         (WTF::LockBase::try_lock): unique_lock needs this.
25         (WTF::LockBase::unlock):
26         * wtf/ParkingLot.cpp:
27         (WTF::ParkingLot::parkConditionally): Work around a Linux C++ bug where wait_until with time_point::max() immediately returns and doesn't flash the lock.
28
29 2015-08-14  Keith Miller  <keith_miller@apple.com>
30
31         cryptographicallyRandomValuesFromOS should use arc4random_buf on Darwin.
32         https://bugs.webkit.org/show_bug.cgi?id=148038
33
34         Reviewed by Geoffrey Garen.
35
36         Currently, we open a file descriptor to /dev/urandom, which can sometimes
37         fail to open. Using arc4random_buf instead should get around this issue.
38
39         * wtf/OSRandomSource.cpp:
40         (WTF::cryptographicallyRandomValuesFromOS):
41
42 2015-08-14  Commit Queue  <commit-queue@webkit.org>
43
44         Unreviewed, rolling out r188444.
45         https://bugs.webkit.org/show_bug.cgi?id=148029
46
47         Broke GTK and EFL (see bug #148027) (Requested by philn on
48         #webkit).
49
50         Reverted changeset:
51
52         "Use WTF::Lock and WTF::Condition instead of WTF::Mutex,
53         WTF::ThreadCondition, std::mutex, and std::condition_variable"
54         https://bugs.webkit.org/show_bug.cgi?id=147999
55         http://trac.webkit.org/changeset/188444
56
57 2015-08-13  Filip Pizlo  <fpizlo@apple.com>
58
59         Use WTF::Lock and WTF::Condition instead of WTF::Mutex, WTF::ThreadCondition, std::mutex, and std::condition_variable
60         https://bugs.webkit.org/show_bug.cgi?id=147999
61
62         Reviewed by Geoffrey Garen.
63
64         * wtf/Condition.h: "using WTF::Condition".
65         * wtf/Lock.h:
66         (WTF::LockBase::lock):
67         (WTF::LockBase::tryLock): Add tryLock() because it turns out that we use it sometimes.
68         (WTF::LockBase::try_lock): unique_lock needs this.
69         (WTF::LockBase::unlock):
70
71 2015-08-13  Commit Queue  <commit-queue@webkit.org>
72
73         Unreviewed, rolling out r188428.
74         https://bugs.webkit.org/show_bug.cgi?id=148015
75
76         broke cmake build (Requested by alexchristensen on #webkit).
77
78         Reverted changeset:
79
80         "Move some commands from ./CMakeLists.txt to Source/cmake"
81         https://bugs.webkit.org/show_bug.cgi?id=148003
82         http://trac.webkit.org/changeset/188428
83
84 2015-08-13  Alex Christensen  <achristensen@webkit.org>
85
86         Move some commands from ./CMakeLists.txt to Source/cmake
87         https://bugs.webkit.org/show_bug.cgi?id=148003
88
89         Reviewed by Brent Fulgham.
90
91         * CMakeLists.txt:
92         Added commands needed to build WTF by itself.
93
94 2015-08-13  Mark Lam  <mark.lam@apple.com>
95
96         WorkQueue::dispatchAfter() on Windows fires early.
97         https://bugs.webkit.org/show_bug.cgi?id=147992
98
99         Reviewed by Brent Fulgham.
100
101         The Windows implementation of WorkQueue::dispatchAfter() uses CreateTimerQueueTimer().
102         Unfortunately, CreateTimerQueueTimer() is sloppy and can fire early.  We need to compensate
103         for this slop to ensure that the specified duration does expire before the callback function
104         is called.  Otherwise, the JSC watchdog (which depends on this) can fail randomly.
105
106         * wtf/win/WorkQueueWin.cpp:
107         (WTF::WorkQueue::dispatchAfter):
108
109 2015-08-13  Filip Pizlo  <fpizlo@apple.com>
110
111         WTF should have a compact Condition object to use with Lock
112         https://bugs.webkit.org/show_bug.cgi?id=147986
113
114         Reviewed by Geoffrey Garen.
115
116         Adds a condition variable implementation based on ParkingLot, called simply WTF::Condition.
117         It can be used with WTF::Lock or actually any lock implementation. It should even work with
118         WTF::SpinLock, WTF::Mutex, or std::mutex. Best of all, Condition only requires one byte.
119
120         ParkingLot almost contained all of the functionality needed to implemenet wait/notify. We
121         could have implemented Condition using a 32-bit (or even 64-bit) version that protects
122         against a notify that happens just before we park. But, this changes the ParkingLot API to
123         give us the ability to run some code between when ParkingLot enqueues the current thread
124         and when it actually sleeps. This callback is called with no locks held, so it can call
125         unlock() on any kind of lock, so long as that lock's unlock() method doesn't recurse into
126         ParkingLot::parkConditionally(). That seems unlikely; unlock() is more likely to call
127         ParkingLot::unparkOne() or unparkAll(). WTF::Lock will never call parkConditionally()
128         inside unlock(), so WTF::Lock is definitely appropriate for use with Condition.
129
130         Condition supports most of the API that std::condition_variable supports. It does some
131         things to try to reduce footgun potential. The preferred timeout form is waitUntil() which
132         takes an absolute time from the steady_clock. The only relative timeout form also takes a
133         predicate callback, so it's impossible to write the subtly incorrect
134         "while (...) wait_for(...)" idiom.
135
136         This patch doesn't actually introduce any uses of WTF::Condition other than the unit tests.
137         I'll start switching code over to using WTF::Condition in another patch.
138
139         * WTF.vcxproj/WTF.vcxproj:
140         * WTF.xcodeproj/project.pbxproj:
141         * wtf/CMakeLists.txt:
142         * wtf/Condition.h: Added.
143         (WTF::Condition::Condition):
144         (WTF::Condition::waitUntil):
145         (WTF::Condition::waitFor):
146         (WTF::Condition::wait):
147         (WTF::Condition::notifyOne):
148         (WTF::Condition::notifyAll):
149         * wtf/Lock.cpp:
150         (WTF::LockBase::unlockSlow): Make this useful assertion be a release assertion. It catches cases where you unlock the lock even though you don't hold it.
151         * wtf/ParkingLot.cpp:
152         (WTF::ParkingLot::parkConditionally): Add the beforeSleep() callback.
153         (WTF::ParkingLot::unparkOne):
154         * wtf/ParkingLot.h:
155         (WTF::ParkingLot::compareAndPark):
156
157 2015-08-12  Anders Carlsson  <andersca@apple.com>
158
159         Use WTF::Optional in WindowFeatures
160         https://bugs.webkit.org/show_bug.cgi?id=147956
161
162         Reviewed by Sam Weinig.
163
164         Add new operators to WTF::Optional to make it more like std::optional.
165
166         * wtf/Optional.h:
167         (WTF::Optional::operator->):
168         (WTF::Optional::operator*):
169
170 2015-08-12  Filip Pizlo  <fpizlo@apple.com>
171
172         WTF::Lock should not suffer from the thundering herd
173         https://bugs.webkit.org/show_bug.cgi?id=147947
174
175         Reviewed by Geoffrey Garen.
176
177         This changes Lock::unlockSlow() to use unparkOne() instead of unparkAll(). The problem with
178         doing this is that it's not obvious after calling unparkOne() if there are any other threads
179         that are still parked on the lock's queue. If we assume that there are and leave the
180         hasParkedBit set, then future calls to unlock() will take the slow path. We don't want that
181         if there aren't actually any threads parked. On the other hand, if we assume that there
182         aren't any threads parked and clear the hasParkedBit, then if there actually were some
183         threads parked, then they may never be awoken since future calls to unlock() won't take slow
184         path and so won't call unparkOne(). In other words, we need a way to be very precise about
185         when we clear the hasParkedBit and we need to do it in a race-free way: it can't be the case
186         that we clear the bit just as some thread gets parked on the queue.
187
188         A similar problem arises in futexes, and one of the solutions is to have a thread that
189         acquires a lock after parking sets the hasParkedBit. This is what Rusty Russel's usersem
190         does. It's a subtle algorithm. Also, it means that if a thread barges in before the unparked
191         thread runs, then that barging thread will not know that there are threads parked. This
192         could increase the severity of barging.
193
194         Since ParkingLot is a user-level API, we don't have to worry about the kernel-user security
195         issues and so we can expose callbacks while ParkingLot is holding its internal locks. This
196         change does exactly that for unparkOne(). The new variant of unparkOne() will call a user
197         function while the queue from which we are unparking is locked. The callback is told basic
198         stats about the queue: did we unpark a thread this time, and could there be more threads to
199         unpark in the future. The callback runs while it's impossible for the queue state to change,
200         since the ParkingLot's internal locks for the queue is held. This means that
201         Lock::unlockSlow() can either clear, or leave, the hasParkedBit while releasing the lock
202         inside the callback from unparkOne(). This takes care of the thundering herd problem while
203         also reducing the greed that arises from barging threads.
204
205         This required some careful reworking of the ParkingLot algorithm. The first thing I noticed
206         was that the ThreadData::shouldPark flag was useless, since it's set exactly when
207         ThreadData::address is non-null. Then I had to make sure that dequeue() could lazily create
208         both hashtables and buckets, since the "callback is called while queue is locked" invariant
209         requires that we didn't exit early due to the hashtable or bucket not being present. Note
210         that all of this is done in such a way that the old unparkOne() and unparkAll() don't have
211         to create any buckets, though they now may create the hashtable. We don't care as much about
212         the hashtable being created by unpark since it's just such an unlikely scenario and it would
213         only happen once.
214
215         This change reduces the kernel CPU usage of WTF::Lock for the long critical section test by
216         about 8x and makes it always perform as well as WTF::WordLock and WTF::Mutex for that
217         benchmark.
218
219         * benchmarks/LockSpeedTest.cpp:
220         * wtf/Lock.cpp:
221         (WTF::LockBase::unlockSlow):
222         * wtf/Lock.h:
223         (WTF::LockBase::isLocked):
224         (WTF::LockBase::isFullyReset):
225         * wtf/ParkingLot.cpp:
226         (WTF::ParkingLot::parkConditionally):
227         (WTF::ParkingLot::unparkOne):
228         (WTF::ParkingLot::unparkAll):
229         * wtf/ParkingLot.h:
230         * wtf/WordLock.h:
231         (WTF::WordLock::isLocked):
232         (WTF::WordLock::isFullyReset):
233
234 2015-08-11  Filip Pizlo  <fpizlo@apple.com>
235
236         Always use a byte-sized lock implementation
237         https://bugs.webkit.org/show_bug.cgi?id=147908
238
239         Reviewed by Geoffrey Garen.
240
241         At the start of my locking algorithm crusade, I implemented Lock, which is a sizeof(void*)
242         lock implementation with some nice theoretical properties and good performance. Then I added
243         the ParkingLot abstraction and ByteLock. ParkingLot uses Lock in its implementation.
244         ByteLock uses ParkingLot to create a sizeof(char) lock implementation that performs like
245         Lock.
246
247         It turns out that ByteLock is always at least as good as Lock, and sometimes a lot better:
248         it requires 8x less memory on 64-bit systems. It's hard to construct a benchmark where
249         ByteLock is significantly slower than Lock, and when you do construct such a benchmark,
250         tweaking it a bit can also create a scenario where ByteLock is significantly faster than
251         Lock.
252
253         So, the thing that we call "Lock" should really use ByteLock's algorithm, since it is more
254         compact and just as fast. That's what this patch does.
255
256         But we still need to keep the old Lock algorithm, because it's used to implement ParkingLot,
257         which in turn is used to implement ByteLock. So this patch does this transformation:
258
259         - Move the algorithm in Lock into files called WordLock.h|cpp. Make ParkingLot use
260           WordLock.
261
262         - Move the algorithm in ByteLock into Lock.h|cpp. Make everyone who used ByteLock use Lock
263           instead. All other users of Lock now get the byte-sized lock implementation.
264
265         - Remove the old ByteLock files.
266
267         * WTF.vcxproj/WTF.vcxproj:
268         * WTF.xcodeproj/project.pbxproj:
269         * benchmarks/LockSpeedTest.cpp:
270         (main):
271         * wtf/WordLock.cpp: Added.
272         (WTF::WordLock::lockSlow):
273         (WTF::WordLock::unlockSlow):
274         * wtf/WordLock.h: Added.
275         (WTF::WordLock::WordLock):
276         (WTF::WordLock::lock):
277         (WTF::WordLock::unlock):
278         (WTF::WordLock::isHeld):
279         (WTF::WordLock::isLocked):
280         * wtf/ByteLock.cpp: Removed.
281         * wtf/ByteLock.h: Removed.
282         * wtf/CMakeLists.txt:
283         * wtf/Lock.cpp:
284         (WTF::LockBase::lockSlow):
285         (WTF::LockBase::unlockSlow):
286         * wtf/Lock.h:
287         (WTF::LockBase::lock):
288         (WTF::LockBase::unlock):
289         (WTF::LockBase::isHeld):
290         (WTF::LockBase::isLocked):
291         (WTF::Lock::Lock):
292         * wtf/ParkingLot.cpp:
293
294 2015-08-11  Filip Pizlo  <fpizlo@apple.com>
295
296         Remove ByteSpinLock
297         https://bugs.webkit.org/show_bug.cgi?id=147900
298
299         Rubber stamped by Mark Lam.
300
301         * WTF.xcodeproj/project.pbxproj:
302         * wtf/ByteSpinLock.h: Removed.
303
304 2015-08-11  Brent Fulgham  <bfulgham@apple.com>
305
306         [Win] Switch Windows build to Visual Studio 2015
307         https://bugs.webkit.org/show_bug.cgi?id=147887
308         <rdar://problem/22235098>
309
310         Reviewed by Alex Christensen.
311
312         Update Visual Studio project file settings to use the current Visual
313         Studio and compiler. Continue targeting binaries to run on our minimum
314         supported configuration of Windows 7.
315
316         * WTF.vcxproj/WTF.vcxproj:
317         * WTF.vcxproj/WTFGenerated.vcxproj:
318
319 2015-08-10  Filip Pizlo  <fpizlo@apple.com>
320
321         WTF should have a ParkingLot for parking sleeping threads, so that locks can fit in 1.6 bits
322         https://bugs.webkit.org/show_bug.cgi?id=147665
323
324         Reviewed by Mark Lam.
325
326         This change adds a major new abstraction for concurrency algorithms in WebKit. It's called a
327         ParkingLot, and it makes available a thread parking queue for each virtual address in memory.
328         The queues are maintained by a data-access-parallel concurrent hashtable implementation. The
329         memory usage is bounded at around half a KB per thread.
330
331         The ParkingLot makes it easy to turn any spinlock-based concurrency protocol into one that
332         parks threads after a while. Because queue state management is up to the ParkingLot and not
333         the user's data structure, this patch uses it to implement a full adaptive mutex in one byte.
334         In fact, only three states of that byte are used (0 = available, 1 = locked, 2 = locked and
335         there are parked threads). Hence the joke that ParkingLot allows locks that fit in 1.6 bits.
336
337         ByteLock is used as a replacement for ByteSpinLock in JavaScriptCore.
338
339         The API tests for this also demo how to create a completely fair (FIFO) binary semamphore. The
340         comment in Lock.h shows how we could accelerate Lock performance using ParkingLot. After we
341         are sure that this code works, we can expand the use of ParkingLot. That's covered by
342         https://bugs.webkit.org/show_bug.cgi?id=147841.
343
344         * WTF.vcxproj/WTF.vcxproj:
345         * WTF.xcodeproj/project.pbxproj:
346         * benchmarks/LockSpeedTest.cpp:
347         (main):
348         * wtf/Atomics.h:
349         (WTF::Atomic::compareExchangeWeak):
350         (WTF::Atomic::compareExchangeStrong):
351         * wtf/ByteLock.cpp: Added.
352         (WTF::ByteLock::lockSlow):
353         (WTF::ByteLock::unlockSlow):
354         * wtf/ByteLock.h: Added.
355         (WTF::ByteLock::ByteLock):
356         (WTF::ByteLock::lock):
357         (WTF::ByteLock::unlock):
358         (WTF::ByteLock::isHeld):
359         (WTF::ByteLock::isLocked):
360         * wtf/CMakeLists.txt:
361         * wtf/Lock.h:
362         * wtf/ParkingLot.cpp: Added.
363         (WTF::ParkingLot::parkConditionally):
364         (WTF::ParkingLot::unparkOne):
365         (WTF::ParkingLot::unparkAll):
366         (WTF::ParkingLot::forEach):
367         * wtf/ParkingLot.h: Added.
368         (WTF::ParkingLot::compareAndPark):
369
370 2015-08-11  Brent Fulgham  <bfulgham@apple.com>
371
372         [Win] Unreviewed gardening.
373
374         * WTF.vcxproj/WTF.vcxproj.filters: Place file references so that files appear in correct
375         folders in IDE.
376
377 2015-08-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
378
379         Compile warning (-Wsign-compare) on 32-bits at WebCore/platform/FileSystem.cpp
380         https://bugs.webkit.org/show_bug.cgi?id=146414
381
382         Reviewed by Darin Adler.
383
384         Added convertSafely routine based on isInBounds routine.
385         Updated BoundChecker by adding a third boolean parameter to this template giving whether Target has greater or equal precision than Source.
386         Removed BoundCheckElider, which is no longer necessary and had some issues.
387
388         * wtf/CheckedArithmetic.h:
389         (WTF::isInBounds):
390         (WTF::convertSafely):
391
392 2015-08-07  Filip Pizlo  <fpizlo@apple.com>
393
394         Lightweight locks should be adaptive
395         https://bugs.webkit.org/show_bug.cgi?id=147545
396
397         Reviewed by Geoffrey Garen.
398
399         A common idiom in WebKit is to use spinlocks. We use them because the lock acquisition
400         overhead is lower than system locks and because they take dramatically less space than system
401         locks. The speed and space advantages of spinlocks can be astonishing: an uncontended spinlock
402         acquire is up to 10x faster and under microcontention - short critical section with two or
403         more threads taking turns - spinlocks are up to 100x faster. Spinlocks take only 1 byte or 4
404         bytes depending on the flavor, while system locks take 64 bytes or more. Clearly, WebKit
405         should continue to avoid system locks - they are just far too slow and far too big.
406
407         But there is a problem with this idiom. System lock implementations will sleep a thread when
408         it attempts to acquire a lock that is held, while spinlocks will cause the thread to burn CPU.
409         In WebKit spinlocks, the thread will repeatedly call sched_yield(). This is awesome for
410         microcontention, but awful when the lock will not be released for a while. In fact, when
411         critical sections take tens of microseconds or more, the CPU time cost of our spinlocks is
412         almost 100x more than the CPU time cost of a system lock. This case doesn't arise too
413         frequently in our current uses of spinlocks, but that's probably because right now there are
414         places where we make a conscious decision to use system locks - even though they use more
415         memory and are slower - because we don't want to waste CPU cycles when a thread has to wait a
416         while to acquire the lock.
417
418         The solution is to just implement a modern adaptive mutex in WTF. Luckily, this isn't a new
419         concept. This patch implements a mutex that is reminiscent of the kinds of low-overhead locks
420         that JVMs use. The actual implementation here is inspired by some of the ideas from [1]. The
421         idea is simple: the fast path is an inlined CAS to immediately acquire a lock that isn't held,
422         the slow path tries some number of spins to acquire the lock, and if that fails, the thread is
423         put on a queue and put to sleep. The queue is made up of statically allocated thread nodes and
424         the lock itself is a tagged pointer: either it is just bits telling us the complete lock state
425         (not held or held) or it is a pointer to the head of a queue of threads waiting to acquire the
426         lock. This approach gives WTF::Lock three different levels of adaptation: an inlined fast path
427         if the lock is not contended, a short burst of spinning for microcontention, and a full-blown
428         queue for critical sections that are held for a long time.
429
430         On a locking microbenchmark, this new Lock exhibits the following performance
431         characteristics:
432
433         - Lock+unlock on an uncontended no-op critical section: 2x slower than SpinLock and 3x faster
434           than a system mutex.
435
436         - Lock+unlock on a contended no-op critical section: 2x slower than SpinLock and 100x faster
437           than a system mutex.
438
439         - CPU time spent in lock() on a lock held for a while: same as system mutex, 90x less than a
440           SpinLock.
441
442         - Memory usage: sizeof(void*), so on 64-bit it's 8x less than a system mutex but 2x worse than
443           a SpinLock.
444
445         This patch replaces all uses of SpinLock with Lock, since our critical sections are not
446         no-ops so if you do basically anything in your critical section, the Lock overhead will be
447         invisible. Also, in all places where we used SpinLock, we could tolerate 8 bytes of overhead
448         instead of 4. Performance benchmarking using JSC macrobenchmarks shows no difference, which is
449         as it should be: the purpose of this change is to reduce CPU time wasted, not wallclock time.
450         This patch doesn't replace any uses of ByteSpinLock, since we expect that the space benefits
451         of having a lock that just uses a byte are still better than the CPU wastage benefits of
452         Lock. But, this work will enable some future work to create locks that will fit in just 1.6
453         bits: https://bugs.webkit.org/show_bug.cgi?id=147665.
454         
455         Rolling this back in after fixing Lock::unlockSlow() for architectures that have a truly weak
456         CAS. Since the Lock::unlock() fast path can go to slow path spuriously, it may go there even if
457         there aren't any threads on the Lock's queue. So, unlockSlow() must be able to deal with the
458         possibility of a null queue head.
459
460         [1] http://www.filpizlo.com/papers/pizlo-pppj2011-fable.pdf
461
462         * WTF.vcxproj/WTF.vcxproj:
463         * WTF.xcodeproj/project.pbxproj:
464         * benchmarks: Added.
465         * benchmarks/LockSpeedTest.cpp: Added.
466         (main):
467         * wtf/Atomics.h:
468         (WTF::Atomic::compareExchangeWeak):
469         (WTF::Atomic::compareExchangeStrong):
470         * wtf/CMakeLists.txt:
471         * wtf/Lock.cpp: Added.
472         (WTF::LockBase::lockSlow):
473         (WTF::LockBase::unlockSlow):
474         * wtf/Lock.h: Added.
475         (WTF::LockBase::lock):
476         (WTF::LockBase::unlock):
477         (WTF::LockBase::isHeld):
478         (WTF::LockBase::isLocked):
479         (WTF::Lock::Lock):
480         * wtf/MetaAllocator.cpp:
481         (WTF::MetaAllocator::release):
482         (WTF::MetaAllocatorHandle::shrink):
483         (WTF::MetaAllocator::allocate):
484         (WTF::MetaAllocator::currentStatistics):
485         (WTF::MetaAllocator::addFreshFreeSpace):
486         (WTF::MetaAllocator::debugFreeSpaceSize):
487         * wtf/MetaAllocator.h:
488         * wtf/SpinLock.h:
489         * wtf/ThreadingPthreads.cpp:
490         * wtf/ThreadingWin.cpp:
491         * wtf/text/AtomicString.cpp:
492         * wtf/text/AtomicStringImpl.cpp:
493         (WTF::AtomicStringTableLocker::AtomicStringTableLocker):
494
495 2015-08-05  Filip Pizlo  <fpizlo@apple.com>
496
497         Unreviewed, roll out http://trac.webkit.org/changeset/187972.
498
499         * wtf/Atomics.cpp:
500         (WTF::getSwapLock):
501         (WTF::atomicStep):
502         * wtf/MessageQueue.h:
503         (WTF::MessageQueue::infiniteTime):
504         (WTF::MessageQueue<DataType>::append):
505         (WTF::MessageQueue<DataType>::appendAndKill):
506         (WTF::MessageQueue<DataType>::appendAndCheckEmpty):
507         (WTF::MessageQueue<DataType>::prepend):
508         (WTF::MessageQueue<DataType>::removeIf):
509         (WTF::MessageQueue<DataType>::isEmpty):
510         (WTF::MessageQueue<DataType>::kill):
511         (WTF::MessageQueue<DataType>::killed):
512         * wtf/ParallelJobsGeneric.cpp:
513         (WTF::ParallelEnvironment::ThreadPrivate::execute):
514         (WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
515         (WTF::ParallelEnvironment::ThreadPrivate::workerThread):
516         * wtf/ParallelJobsGeneric.h:
517         * wtf/RunLoop.cpp:
518         (WTF::RunLoop::performWork):
519         (WTF::RunLoop::dispatch):
520         * wtf/RunLoop.h:
521         * wtf/ThreadSpecificWin.cpp:
522         (WTF::destructorsList):
523         (WTF::destructorsMutex):
524         (WTF::threadSpecificKeyCreate):
525         (WTF::threadSpecificKeyDelete):
526         (WTF::ThreadSpecificThreadExit):
527         * wtf/Threading.cpp:
528         (WTF::threadEntryPoint):
529         (WTF::createThread):
530         * wtf/ThreadingPrimitives.h:
531         * wtf/ThreadingPthreads.cpp:
532         (WTF::threadMapMutex):
533         (WTF::initializeThreading):
534         (WTF::identifierByPthreadHandle):
535         (WTF::establishIdentifierForPthreadHandle):
536         (WTF::changeThreadPriority):
537         (WTF::waitForThreadCompletion):
538         (WTF::detachThread):
539         (WTF::threadDidExit):
540         (WTF::currentThread):
541         (WTF::Mutex::Mutex):
542         (WTF::Mutex::~Mutex):
543         (WTF::Mutex::lock):
544         (WTF::Mutex::tryLock):
545         (WTF::Mutex::unlock):
546         (WTF::ThreadCondition::~ThreadCondition):
547         (WTF::ThreadCondition::wait):
548         (WTF::ThreadCondition::timedWait):
549         (WTF::DeprecatedMutex::DeprecatedMutex): Deleted.
550         (WTF::DeprecatedMutex::~DeprecatedMutex): Deleted.
551         (WTF::DeprecatedMutex::lock): Deleted.
552         (WTF::DeprecatedMutex::tryLock): Deleted.
553         (WTF::DeprecatedMutex::unlock): Deleted.
554         * wtf/ThreadingWin.cpp:
555         (WTF::initializeCurrentThreadInternal):
556         (WTF::threadMapMutex):
557         (WTF::initializeThreading):
558         (WTF::storeThreadHandleByIdentifier):
559         (WTF::threadHandleForIdentifier):
560         (WTF::clearThreadHandleForIdentifier):
561         (WTF::currentThread):
562         (WTF::Mutex::Mutex):
563         (WTF::Mutex::~Mutex):
564         (WTF::Mutex::lock):
565         (WTF::Mutex::tryLock):
566         (WTF::Mutex::unlock):
567         (WTF::ThreadCondition::~ThreadCondition):
568         (WTF::ThreadCondition::wait):
569         (WTF::ThreadCondition::timedWait):
570         (WTF::DeprecatedMutex::DeprecatedMutex): Deleted.
571         (WTF::DeprecatedMutex::~DeprecatedMutex): Deleted.
572         (WTF::DeprecatedMutex::lock): Deleted.
573         (WTF::DeprecatedMutex::tryLock): Deleted.
574         (WTF::DeprecatedMutex::unlock): Deleted.
575         * wtf/WorkQueue.h:
576         * wtf/dtoa.cpp:
577         * wtf/dtoa.h:
578         * wtf/efl/DispatchQueueEfl.cpp:
579         (DispatchQueue::dispatch):
580         (DispatchQueue::performWork):
581         (DispatchQueue::performTimerWork):
582         (DispatchQueue::insertTimerWorkItem):
583         (DispatchQueue::wakeUpThread):
584         (DispatchQueue::getNextTimeOut):
585         * wtf/efl/DispatchQueueEfl.h:
586         * wtf/efl/RunLoopEfl.cpp:
587         (WTF::RunLoop::wakeUpEvent):
588         (WTF::RunLoop::wakeUp):
589         * wtf/threads/BinarySemaphore.cpp:
590         (WTF::BinarySemaphore::signal):
591         (WTF::BinarySemaphore::wait):
592         * wtf/threads/BinarySemaphore.h:
593         * wtf/win/WorkQueueWin.cpp:
594         (WTF::WorkQueue::handleCallback):
595         (WTF::WorkQueue::platformInvalidate):
596         (WTF::WorkQueue::dispatch):
597         (WTF::WorkQueue::timerCallback):
598         (WTF::WorkQueue::dispatchAfter):
599
600 2015-08-05  Filip Pizlo  <fpizlo@apple.com>
601
602         Unreviewed, fix Windows.
603
604         * wtf/ThreadSpecificWin.cpp:
605         (WTF::destructorsList):
606         (WTF::destructorsMutex):
607         (WTF::threadSpecificKeyCreate):
608         (WTF::threadSpecificKeyDelete):
609         (WTF::ThreadSpecificThreadExit):
610
611 2015-08-04  Filip Pizlo  <fpizlo@apple.com>
612
613         Rename Mutex to DeprecatedMutex
614         https://bugs.webkit.org/show_bug.cgi?id=147675
615
616         Reviewed by Geoffrey Garen.
617
618         * wtf/Atomics.cpp:
619         (WTF::getSwapLock):
620         (WTF::atomicStep):
621         * wtf/MessageQueue.h:
622         (WTF::MessageQueue::infiniteTime):
623         (WTF::MessageQueue<DataType>::append):
624         (WTF::MessageQueue<DataType>::appendAndKill):
625         (WTF::MessageQueue<DataType>::appendAndCheckEmpty):
626         (WTF::MessageQueue<DataType>::prepend):
627         (WTF::MessageQueue<DataType>::removeIf):
628         (WTF::MessageQueue<DataType>::isEmpty):
629         (WTF::MessageQueue<DataType>::kill):
630         (WTF::MessageQueue<DataType>::killed):
631         * wtf/ParallelJobsGeneric.cpp:
632         (WTF::ParallelEnvironment::ThreadPrivate::execute):
633         (WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
634         (WTF::ParallelEnvironment::ThreadPrivate::workerThread):
635         * wtf/ParallelJobsGeneric.h:
636         * wtf/RunLoop.cpp:
637         (WTF::RunLoop::performWork):
638         (WTF::RunLoop::dispatch):
639         * wtf/RunLoop.h:
640         * wtf/Threading.cpp:
641         (WTF::threadEntryPoint):
642         (WTF::createThread):
643         * wtf/ThreadingPrimitives.h:
644         * wtf/ThreadingPthreads.cpp:
645         (WTF::threadMapMutex):
646         (WTF::initializeThreading):
647         (WTF::identifierByPthreadHandle):
648         (WTF::establishIdentifierForPthreadHandle):
649         (WTF::changeThreadPriority):
650         (WTF::waitForThreadCompletion):
651         (WTF::detachThread):
652         (WTF::threadDidExit):
653         (WTF::currentThread):
654         (WTF::DeprecatedMutex::DeprecatedMutex):
655         (WTF::DeprecatedMutex::~DeprecatedMutex):
656         (WTF::DeprecatedMutex::lock):
657         (WTF::DeprecatedMutex::tryLock):
658         (WTF::DeprecatedMutex::unlock):
659         (WTF::ThreadCondition::~ThreadCondition):
660         (WTF::ThreadCondition::wait):
661         (WTF::ThreadCondition::timedWait):
662         (WTF::Mutex::Mutex): Deleted.
663         (WTF::Mutex::~Mutex): Deleted.
664         (WTF::Mutex::lock): Deleted.
665         (WTF::Mutex::tryLock): Deleted.
666         (WTF::Mutex::unlock): Deleted.
667         * wtf/ThreadingWin.cpp:
668         (WTF::initializeCurrentThreadInternal):
669         (WTF::threadMapMutex):
670         (WTF::initializeThreading):
671         (WTF::storeThreadHandleByIdentifier):
672         (WTF::threadHandleForIdentifier):
673         (WTF::clearThreadHandleForIdentifier):
674         (WTF::currentThread):
675         (WTF::DeprecatedMutex::DeprecatedMutex):
676         (WTF::DeprecatedMutex::~DeprecatedMutex):
677         (WTF::DeprecatedMutex::lock):
678         (WTF::DeprecatedMutex::tryLock):
679         (WTF::DeprecatedMutex::unlock):
680         (WTF::ThreadCondition::~ThreadCondition):
681         (WTF::ThreadCondition::wait):
682         (WTF::ThreadCondition::timedWait):
683         (WTF::Mutex::Mutex): Deleted.
684         (WTF::Mutex::~Mutex): Deleted.
685         (WTF::Mutex::lock): Deleted.
686         (WTF::Mutex::tryLock): Deleted.
687         (WTF::Mutex::unlock): Deleted.
688         * wtf/WorkQueue.h:
689         * wtf/dtoa.cpp:
690         * wtf/dtoa.h:
691         * wtf/efl/DispatchQueueEfl.cpp:
692         (DispatchQueue::dispatch):
693         (DispatchQueue::performWork):
694         (DispatchQueue::performTimerWork):
695         (DispatchQueue::insertTimerWorkItem):
696         (DispatchQueue::wakeUpThread):
697         (DispatchQueue::getNextTimeOut):
698         * wtf/efl/DispatchQueueEfl.h:
699         * wtf/efl/RunLoopEfl.cpp:
700         (WTF::RunLoop::wakeUpEvent):
701         (WTF::RunLoop::wakeUp):
702         * wtf/threads/BinarySemaphore.cpp:
703         (WTF::BinarySemaphore::signal):
704         (WTF::BinarySemaphore::wait):
705         * wtf/threads/BinarySemaphore.h:
706         * wtf/win/WorkQueueWin.cpp:
707         (WTF::WorkQueue::handleCallback):
708         (WTF::WorkQueue::platformInvalidate):
709         (WTF::WorkQueue::dispatch):
710         (WTF::WorkQueue::timerCallback):
711         (WTF::WorkQueue::dispatchAfter):
712
713 2015-08-04  Alex Christensen  <achristensen@webkit.org>
714
715         Fix quirks with CMake and VS2015
716         https://bugs.webkit.org/show_bug.cgi?id=147663
717
718         Reviewed by Brent Fulgham.
719
720         * wtf/Platform.h:
721         Build fix after r187908
722
723 2015-08-04  Brent Fulgham  <bfulgham@apple.com>
724
725         [Win] Update Apple Windows build for VS2015
726         https://bugs.webkit.org/show_bug.cgi?id=147653
727
728         Reviewed by Dean Jackson.
729
730         * WTF.vcxproj/WTF.vcxproj.filters: Drive-by-fix to place files in
731         proper project locations in the IDE.
732         * wtf/Platform.h: Don't define the _HAS_EXCEPTIONS macro when building with
733         Visual Studio 2015.
734
735 2015-08-04  Commit Queue  <commit-queue@webkit.org>
736
737         Unreviewed, rolling out r187815 and r187817.
738         https://bugs.webkit.org/show_bug.cgi?id=147644
739
740         Caused lots of Windows crashes (Requested by smfr on #webkit).
741
742         Reverted changesets:
743
744         "[WTF] Turn tryMakeString(), makeString() into variadic
745         templates"
746         https://bugs.webkit.org/show_bug.cgi?id=147142
747         http://trac.webkit.org/changeset/187815
748
749         "Unreviewed build fix."
750         http://trac.webkit.org/changeset/187817
751
752 2015-08-04  Alex Christensen  <achristensen@webkit.org>
753
754         Enable WebGL on Windows CMake build.
755         https://bugs.webkit.org/show_bug.cgi?id=143311
756
757         Reviewed by Csaba Osztrogonác.
758
759         * wtf/FeatureDefines.h:
760         Made the CMake feature defines the same as the non-CMake feature defines.
761
762 2015-08-03  Csaba Osztrogonác  <ossy@webkit.org>
763
764         Introduce COMPILER(GCC_OR_CLANG) guard and make COMPILER(GCC) true only for GCC
765         https://bugs.webkit.org/show_bug.cgi?id=146833
766
767         Reviewed by Alexey Proskuryakov.
768
769         * wtf/Assertions.cpp:
770         * wtf/Assertions.h: Removed redundant COMPILER(CLANG) guard.
771         * wtf/Atomics.cpp:
772         * wtf/Atomics.h:
773         (WTF::weakCompareAndSwap):
774         (WTF::compilerFence):
775         * wtf/Compiler.h:
776          - Renamed COMPILER(GCC) to COMPILER(GCC_OR_CLANG), because it is true for both compiler.
777          - Added COMPILER(GCC) which is true only for GCC.
778          - Moved all GCC related stuff to one block and removed redundant guards accordingly.
779          - Removed the unused default false definition of GCC_VERSION_AT_LEAST for non GCC compilers.
780         * wtf/ExportMacros.h:
781         * wtf/FastMalloc.h:
782         * wtf/Platform.h:
783         * wtf/StdLibExtras.h:
784         * wtf/Vector.h:
785         * wtf/text/ASCIIFastPath.h:
786         (WTF::copyLCharsFromUCharSource):
787
788 2015-08-03  Zan Dobersek  <zdobersek@igalia.com>
789
790         Unreviewed build fix.
791
792         * wtf/text/StringConcatenate.h: Include <tuple> to avoid missing
793         std::tuple<> class definitions.
794
795 2015-08-03  Zan Dobersek  <zdobersek@igalia.com>
796
797         [WTF] Turn tryMakeString(), makeString() into variadic templates
798         https://bugs.webkit.org/show_bug.cgi?id=147142
799
800         Reviewed by Sam Weinig.
801
802         Built upon the original work by Anders Carlsson, Mark Rowe and Sam Weinig.
803
804         Implement tryMakeString() and makeString() as variadic templates, replacing
805         the argument count-based overloads.
806
807         tryMakeString() now constructs a stack-based tuple of necessary StringTypeAdapter
808         objects and utilizes the StringAdapterTuple struct template to operate on that
809         tuple, recursively calling the necessary operations on each element in the tuple.
810         This effectively mimics the process of previous tryMakeString() implementation,
811         but makes it scalable to a tuple of elements that are to be concatenated.
812
813         StringAppend class template now stores two StringTypeAdapter objects for the
814         two passed-in string objects, packed in a tuple, calling
815         StringAdapterTuple<>::createString() directly when concatenating the two objects
816         into one String.
817
818         * wtf/text/StringConcatenate.h:
819         (WTF::StringTypeAdapter<char>::length):
820         (WTF::StringTypeAdapter<char>::is8Bit):
821         (WTF::StringAdapterTuple::sumWithOverflow):
822         (WTF::StringAdapterTuple::is8Bit):
823         (WTF::StringAdapterTuple::writeTo):
824         (WTF::StringAdapterTuple::createString):
825         (WTF::tryMakeString):
826         (WTF::makeString):
827         (WTF::sumWithOverflow): Deleted.
828         * wtf/text/StringOperators.h:
829         (WTF::StringAppend::StringAppend):
830         (WTF::StringAppend::operator String):
831         (WTF::StringAppend::is8Bit):
832         (WTF::StringAppend::writeTo):
833         (WTF::StringAppend::length):
834         (WTF::StringAppend::string1):
835         (WTF::StringAppend::string2):
836
837 2015-08-03  Anders Carlsson  <andersca@apple.com>
838
839         Make it possible to use String::utf8() in the debugger
840         https://bugs.webkit.org/show_bug.cgi?id=147566
841
842         Reviewed by Tim Horton.
843
844         Add a new utf8() overload that doesn't take any parameters and just calls utf8(LenientConversion), since lldb doesn't support evaluating
845         function calls with default parameters at the moment.
846
847         * wtf/text/WTFString.cpp:
848         (WTF::String::utf8):
849         * wtf/text/WTFString.h:
850
851 2015-08-02  Benjamin Poulain  <bpoulain@apple.com>
852
853         Investigate HashTable::HashTable(const HashTable&) and HashTable::operator=(const HashTable&) performance for hash-based static analyses
854         https://bugs.webkit.org/show_bug.cgi?id=118455
855
856         Reviewed by Filip Pizlo.
857
858         Previously, when copying a HashTable, we would start from scratch
859         with an empty table and insert elements one by one, growing-rehashing
860         the table as needed.
861
862         With this patch, we have 2 improvements to remove most of the cost.
863
864         First, we compute a good size from the start. This removes all the
865         reallocations and rehashs.
866         This is where the biggest gain comes from.
867
868         The second part is a simpler version of add() when we know that
869         we cannot find a bucket with the same key and there cannot
870         be any deleted bucket.
871         This removes most branches from the hot loop, cutting another 25%
872         of the time.
873
874         * wtf/HashTable.h:
875         (WTF::KeyTraits>::addUniqueForInitialization):
876         (WTF::KeyTraits>::HashTable):
877
878 2015-08-01  Myles C. Maxfield  <mmaxfield@apple.com>
879
880         HashTraits<AtomicString> can use SimpleClassHashTraits
881         https://bugs.webkit.org/show_bug.cgi?id=147528
882
883         Reviewed by Andreas Kling.
884
885         No point in duplicating the code inside SimpleClassHashTraits.
886
887         * wtf/text/AtomicStringHash.h:
888         (WTF::HashTraits<WTF::AtomicString>::constructDeletedValue): Deleted.
889         (WTF::HashTraits<WTF::AtomicString>::isDeletedValue): Deleted.
890
891 2015-08-01  Alex Christensen  <achristensen@webkit.org>
892
893         Fix compile errors with VS2015
894         https://bugs.webkit.org/show_bug.cgi?id=147526
895
896         Reviewed by Myles Maxfield.
897
898         * wtf/StringExtras.h:
899         (snprintf):
900         (wtf_vsnprintf):
901         VS2015 has an implementation of snprintf.
902
903 2015-07-31  Alex Christensen  <achristensen@webkit.org>
904
905         Prepare for VS2015
906         https://bugs.webkit.org/show_bug.cgi?id=146579
907
908         Reviewed by Jon Honeycutt.
909
910         * wtf/StdLibExtras.h:
911         (std::exchange):
912         Added preprocessor macros around functions implemented in VS2015's standard library.
913
914 2015-07-30  Chris Dumez  <cdumez@apple.com>
915
916         Mark more classes as fast allocated
917         https://bugs.webkit.org/show_bug.cgi?id=147440
918
919         Reviewed by Sam Weinig.
920
921         Mark more classes as fast allocated for performance. We heap-allocate
922         objects of those types throughout the code base.
923
924         * wtf/Bag.h:
925         * wtf/SegmentedVector.h:
926         * wtf/SentinelLinkedList.h:
927
928 2015-07-29  Basile Clement  <basile_clement@apple.com>
929
930         Remove native call inlining
931         https://bugs.webkit.org/show_bug.cgi?id=147417
932
933         Rubber-stamped by Filip Pizlo.
934
935         * wtf/Platform.h:
936
937 2015-07-28  Yusuke Suzuki  <utatane.tea@gmail.com>
938
939         [ES6] Add ENABLE_ES6_MODULES compile time flag with the default value "false"
940         https://bugs.webkit.org/show_bug.cgi?id=147350
941
942         Reviewed by Sam Weinig.
943
944         * wtf/FeatureDefines.h:
945
946 2015-07-28  Filip Pizlo  <fpizlo@apple.com>
947
948         Unreviewed, fix Windows build.
949
950         * wtf/MetaAllocatorHandle.h:
951         (WTF::MetaAllocatorHandle::key):
952
953 2015-07-27  Filip Pizlo  <fpizlo@apple.com>
954
955         Add logging when executable code gets deallocated
956         https://bugs.webkit.org/show_bug.cgi?id=147355
957
958         Reviewed by Mark Lam.
959
960         * wtf/MetaAllocator.cpp:
961         (WTF::MetaAllocatorHandle::dump): It's useful to be able to dump these.
962         * wtf/MetaAllocatorHandle.h:
963
964 2015-07-28  Benjamin Poulain  <bpoulain@apple.com>
965
966         Speed up StringBuilder::appendQuotedJSONString()
967         https://bugs.webkit.org/show_bug.cgi?id=147352
968
969         Reviewed by Andreas Kling.
970
971         * wtf/text/StringBuilder.cpp:
972         (WTF::appendQuotedJSONStringInternal):
973         The cases '"' and '\\' are not that uncommon, and they can easily
974         be handled in the original branch testing for them.
975
976         This is about 2.5% better on the JSON.stringify test.
977
978 2015-07-27  Alex Christensen  <achristensen@webkit.org>
979
980         Progress towards building AppleWin with CMake
981         https://bugs.webkit.org/show_bug.cgi?id=147325
982
983         Reviewed by Martin Robinson.
984
985         * wtf/PlatformWin.cmake:
986         Link with CoreFoundation.lib.
987
988 2015-07-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>
989
990         REGRESSION (bmalloc): WebKit performance tests don't report memory stats.
991         https://bugs.webkit.org/show_bug.cgi?id=141247
992
993         Reviewed by Geoffrey Garen.
994
995         Meanwhile a better way of getting memory stats with bmalloc is not found
996         (see bug 136592), we can report as memory stats the resident set size
997         information that the operating system provides to us.
998
999         This at least should be good enough to get back the memory stats on the
1000         performance tests and being able to track down memory usage regressions
1001         at https://perf.webkit.org
1002
1003         * wtf/FastMalloc.cpp:
1004         (WTF::fastMallocStatistics): Report maxrss data as committedVMBytes.
1005
1006 2015-07-24  Csaba Osztrogonác  <ossy@webkit.org>
1007
1008         Remove the unused GCC workaround - std::is_trivially_destructible
1009         https://bugs.webkit.org/show_bug.cgi?id=147226
1010
1011         Reviewed by Darin Adler.
1012
1013         * wtf/StdLibExtras.h:
1014
1015 2015-07-23  Alex Christensen  <achristensen@webkit.org>
1016
1017         Remove compile and runtime flags for promises.
1018         https://bugs.webkit.org/show_bug.cgi?id=147244
1019
1020         Reviewed by Yusuke Suzuki.
1021
1022         * wtf/FeatureDefines.h:
1023
1024 2015-07-22  Sukolsak Sakshuwong  <sukolsak@gmail.com>
1025
1026         Add ENABLE_WEBASSEMBLY feature flag for WebAssembly
1027         https://bugs.webkit.org/show_bug.cgi?id=147212
1028
1029         Reviewed by Filip Pizlo.
1030
1031         * wtf/FeatureDefines.h:
1032
1033 2015-07-22  Filip Pizlo  <fpizlo@apple.com>
1034
1035         Introduce release assert for using threads before threading is initialized
1036         https://bugs.webkit.org/show_bug.cgi?id=147200
1037
1038         Reviewed by Michael Saboff.
1039         
1040         This will help bugs where you use createThread() before calling initializeThreading().
1041
1042         * wtf/ThreadIdentifierDataPthreads.cpp:
1043         (WTF::ThreadIdentifierData::initialize):
1044
1045 2015-07-21  Daniel Bates  <dabates@apple.com>
1046
1047         WTFCrash() in WebKit::WebProcess::networkConnection()
1048         https://bugs.webkit.org/show_bug.cgi?id=147112
1049         <rdar://problem/18477459>
1050
1051         Reviewed by Gavin Barraclough.
1052
1053         Add explicit boolean conversion function and remove overload of operator! to support
1054         checking whether an activity token is valid more directly than using the overloaded operator!.
1055
1056         * wtf/RefCounter.h:
1057         (WTF::RefCounter::Token::operator bool): Added.
1058         (WTF::RefCounter::Token::operator!): Deleted.
1059
1060 2015-07-20  Mark Lam  <mark.lam@apple.com>
1061
1062         Rollout r187020 and r187021: breaks JSC API tests on debug builds.
1063         https://bugs.webkit.org/show_bug.cgi?id=147110
1064
1065         * wtf/WTFThreadData.cpp:
1066         (WTF::WTFThreadData::WTFThreadData):
1067         * wtf/WTFThreadData.h:
1068         (WTF::WTFThreadData::stack):
1069
1070 2015-07-20  Alex Christensen  <achristensen@webkit.org>
1071
1072         Resurrect CMake build on Windows.
1073         https://bugs.webkit.org/show_bug.cgi?id=147083
1074
1075         Reviewed by Gyuyoung Kim.
1076
1077         * wtf/PlatformWin.cmake:
1078
1079 2015-07-20  Per Arne Vollan  <peavo@outlook.com>
1080
1081         JavaScriptCore performance is very bad on Windows
1082         https://bugs.webkit.org/show_bug.cgi?id=146448
1083
1084         Reviewed by Mark Lam.
1085
1086         Updating the stack bounds is time consuming.
1087         Only update the stack bounds when a new fiber is running.
1088
1089         * wtf/WTFThreadData.cpp:
1090         (WTF::WTFThreadData::WTFThreadData):
1091         * wtf/WTFThreadData.h:
1092         (WTF::WTFThreadData::stack):
1093
1094 2015-07-20  Julien Brianceau  <julien.brianceau@gmail.com>
1095
1096         Use isnan from std namespace in Stopwatch.h.
1097         https://bugs.webkit.org/show_bug.cgi?id=146911
1098
1099         Reviewed by Žan Doberšek.
1100
1101         * wtf/Stopwatch.h:
1102         (WTF::Stopwatch::isActive):
1103         (WTF::Stopwatch::start):
1104         (WTF::Stopwatch::stop):
1105         (WTF::Stopwatch::elapsedTime):
1106
1107 2015-07-16  Benjamin Poulain  <bpoulain@apple.com>
1108
1109         [Content extensions] Combine suffixes when generating NFAs
1110         https://bugs.webkit.org/show_bug.cgi?id=146961
1111
1112         Reviewed by Alex Christensen.
1113
1114         * wtf/Vector.h:
1115         (WTF::minCapacity>::Vector):
1116         (WTF::=):
1117         Copying a vector with a different inline capacity was broken due to
1118         the addition of MinimumCapacity.
1119
1120         This feature was needed by this patch so I fixed WTF.
1121
1122 2015-07-15  Anders Carlsson  <andersca@apple.com>
1123
1124         Make JavaScriptCore SPI headers used by WebCore SPI headers self-contained
1125         https://bugs.webkit.org/show_bug.cgi?id=146978
1126
1127         Reviewed by Dan Bernstein.
1128
1129         * wtf/ExportMacros.h:
1130
1131 2015-07-14  Anders Carlsson  <andersca@apple.com>
1132
1133         Assertions.h should include ExportMacros.h
1134         https://bugs.webkit.org/show_bug.cgi?id=146948
1135
1136         Reviewed by Tim Horton.
1137
1138         * wtf/Assertions.h:
1139
1140 2015-07-11  Joseph Pecoraro  <pecoraro@apple.com>
1141
1142         Unreviewed build fix, restrict APP_LINKS to just iOS.
1143
1144         * wtf/Platform.h:
1145
1146 2015-07-09  Tim Horton  <timothy_horton@apple.com>
1147
1148         Use CoreAnimation fences instead of synchronous IPC to synchronize resize
1149         https://bugs.webkit.org/show_bug.cgi?id=146294
1150         <rdar://problem/21090193>
1151
1152         Reviewed by Anders Carlsson.
1153
1154         * wtf/Platform.h:
1155         Add HAVE(COREANIMATION_FENCES)
1156
1157 2015-07-04  Chris Dumez  <cdumez@apple.com>
1158
1159         Drop RefPtr::clear() method
1160         https://bugs.webkit.org/show_bug.cgi?id=146556
1161
1162         Reviewed by Brady Eidson.
1163
1164         Drop RefPtr::clear() method in favor of "= nullptr;" pattern.
1165         Also made the "= nullptr;" pattern as efficient as clear()
1166         by providing a operator=(nullptr_t) overload. Local micro-
1167         benchmarking showed that "= nullptr;" used to be ~1.7% slower
1168         than clear().
1169
1170 2015-07-03  Dan Bernstein  <mitz@apple.com>
1171
1172         [Xcode] Update some build settings as recommended by Xcode 7
1173         https://bugs.webkit.org/show_bug.cgi?id=146597
1174
1175         Reviewed by Sam Weinig.
1176
1177         * Configurations/Base.xcconfig: Enabled CLANG_WARN_UNREACHABLE_CODE and
1178         GCC_NO_COMMON_BLOCKS. Removed GCC_MODEL_TUNING.
1179
1180         * WTF.xcodeproj/project.pbxproj: Updated LastUpgradeCheck.
1181
1182 2015-07-01  Alex Christensen  <achristensen@webkit.org>
1183
1184         Re-enable WebGL on WinCairo
1185         https://bugs.webkit.org/show_bug.cgi?id=146537
1186
1187         Reviewed by Csaba Osztrogonác.
1188
1189         * wtf/FeatureDefines.h:
1190         Enable WebGL on WinCairo again.
1191
1192 2015-07-01  Alex Christensen  <achristensen@webkit.org>
1193
1194         Ignore Visual Studio warning in SegmentedVector
1195         https://bugs.webkit.org/show_bug.cgi?id=146514
1196
1197         Reviewed by Andreas Kling.
1198
1199         * wtf/SegmentedVector.h:
1200         (WTF::SegmentedVector::deleteAllSegments):
1201         Use pragmas to ignore the 0 element array warning.
1202
1203 2015-07-01  Dean Jackson  <dino@apple.com>
1204
1205         Disable the experimental WebGL2 implementation
1206         https://bugs.webkit.org/show_bug.cgi?id=146526
1207         <rdar://problem/21641235>
1208
1209         Reviewed by Myles Maxfield.
1210
1211         Add (and disable) an ENABLE_WEBGL2 flag.
1212
1213         * wtf/FeatureDefines.h:
1214
1215 2015-06-30  Alex Christensen  <achristensen@webkit.org>
1216
1217         [Win] Unreviewed build fix after r186169.
1218
1219         * wtf/FeatureDefines.h:
1220         Temporarily disable WebGL on WinCairo. It was already temporarily disabled on AppleWin.
1221
1222 2015-06-30  Andy VanWagoner  <thetalecrafter@gmail.com>
1223
1224         Implement ECMAScript Internationalization API
1225         https://bugs.webkit.org/show_bug.cgi?id=90906
1226
1227         Reviewed by Benjamin Poulain.
1228
1229         * wtf/FeatureDefines.h: add ENABLE_INTL flag
1230
1231 2015-06-30  Keith Miller  <keith_miller@apple.com>
1232
1233         Errors in read() are not handled in WTF::cryptographicallyRandomValuesFromOS.
1234         https://bugs.webkit.org/show_bug.cgi?id=146473
1235
1236         Reviewed by Filip Pizlo.
1237
1238         We were not checking if errors occurred in WTF::cryptographicallyRandomValuesFromOS.
1239         We now buffer the data until enough bits of entropy exist to fill the buffer
1240         rather than crash. Additionally, added two crash functions so we can distinguish
1241         between the two reasons why we crashed in traces.
1242
1243         * wtf/OSRandomSource.cpp:
1244         (WTF::crashUnableToOpenFD):
1245         (WTF::crashUnableToReadFromFD):
1246         (WTF::cryptographicallyRandomValuesFromOS):
1247
1248 2015-06-29  Dean Jackson  <dino@apple.com>
1249
1250         Temporarily disable PICTURE_SIZES
1251         https://bugs.webkit.org/show_bug.cgi?id=146435
1252         <rdar://problem/21087013>
1253
1254         Reviewed by Tim Horton.
1255
1256         Temporarily disable PICTURE_SIZES because it causes problems with out
1257         of date <picture> polyfills.
1258
1259         * wtf/FeatureDefines.h:
1260
1261 2015-06-26  Antti Koivisto  <antti@apple.com>
1262
1263         Network process hangs fetching disk cache entries
1264         https://bugs.webkit.org/show_bug.cgi?id=146348
1265         <rdar://problem/21528072>
1266
1267         Reviewed by Anders Carlsson.
1268
1269         RunLoop::dispatch may deadlock if invoked with std::function that captures an object that calls RunLoop::dispatch in destructor.
1270
1271         * wtf/RunLoop.cpp:
1272         (WTF::RunLoop::performWork):
1273
1274             Don't reuse std::function variable in loop. We may end up destroying previously held std::function in assignment
1275             while holding the runloop mutex. With this change std::function is always destroyed with mutex unlocked.
1276
1277 2015-06-24  Commit Queue  <commit-queue@webkit.org>
1278
1279         Unreviewed, rolling out r185906.
1280         https://bugs.webkit.org/show_bug.cgi?id=146276
1281
1282         MSVC doesn't yet provide a const-qualified std::array<T,
1283         N>::size(), failing to compile the static_assert (Requested by
1284         zdobersek on #webkit).
1285
1286         Reverted changeset:
1287
1288         "Improve the source code generated by make_names.pl"
1289         https://bugs.webkit.org/show_bug.cgi?id=146208
1290         http://trac.webkit.org/changeset/185906
1291
1292 2015-06-24  Zan Dobersek  <zdobersek@igalia.com>
1293
1294         Improve the source code generated by make_names.pl
1295         https://bugs.webkit.org/show_bug.cgi?id=146208
1296
1297         Reviewed by Darin Adler.
1298
1299         * wtf/text/StringImpl.h:
1300         (WTF::StringImpl::assertHashIsCorrect): Make this method const-qualified.
1301
1302 2015-06-22  Darin Adler  <darin@apple.com>
1303
1304         Make Array.join work directly on substrings without reifying them
1305         https://bugs.webkit.org/show_bug.cgi?id=146191
1306
1307         Reviewed by Andreas Kling.
1308
1309         * wtf/Vector.h: Added an overload of uncheckedAppend like the one we added
1310         a while back, a non-template function that forwards through to the function
1311         template. This lets us call uncheckedAppend on an argument list and have it
1312         properly convert it to the Vector's element type.
1313
1314         * wtf/text/StringView.h:
1315         (WTF::StringView::getCharactersWithUpconvert): Changed to not use memcpy;
1316         saw some indication the hand-written loop was faster when profiling. Also
1317         use m_length directly when we know we are dealing with an 8-bit string,
1318         since the masking that the index function does is not needed in that case.
1319         (WTF::StringView::UpconvertedCharacters::UpconvertedCharacters): Ditto.
1320         (WTF::StringView::toString): Ditto.
1321         (WTF::StringView::toFloat): Ditto.
1322         (WTF::StringView::toInt): Ditto.
1323         (WTF::StringView::toStringWithoutCopying): Ditto.
1324         (WTF::StringView::find): Ditto.
1325
1326 2015-06-22  YunQiang Su  <wzssyqa@gmail.com>
1327
1328         [WTF] Platform.h: use _ABI64 instead of _MIPS_SIM_ABI64 to determine MIPS N64
1329         https://bugs.webkit.org/show_bug.cgi?id=145113
1330
1331         Reviewed by Csaba Osztrogonác.
1332
1333         * wtf/Platform.h:
1334
1335 2015-06-22  Anders Carlsson  <andersca@apple.com>
1336
1337         Fix build.
1338
1339         * wtf/threads/BinarySemaphore.cpp:
1340
1341 2015-06-22  Anders Carlsson  <andersca@apple.com>
1342
1343         Get rid of the Windows specific BinarySemaphore implementation
1344         https://bugs.webkit.org/show_bug.cgi?id=146216
1345
1346         Reviewed by Andreas Kling.
1347
1348         The fact that the Windows implementation uses a HEVENT internally was only useful
1349         to the Windows port of WebKit2; we can get rid of it now.
1350
1351         * WTF.vcxproj/WTF.vcxproj:
1352         * WTF.vcxproj/WTF.vcxproj.filters:
1353         * wtf/threads/BinarySemaphore.h:
1354         (WTF::BinarySemaphore::event): Deleted.
1355         * wtf/threads/win/BinarySemaphoreWin.cpp: Removed.
1356         (WTF::BinarySemaphore::BinarySemaphore): Deleted.
1357         (WTF::BinarySemaphore::~BinarySemaphore): Deleted.
1358         (WTF::BinarySemaphore::signal): Deleted.
1359         (WTF::BinarySemaphore::wait): Deleted.
1360
1361 2015-06-21  Gavin Barraclough  <barraclough@apple.com>
1362
1363         Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
1364         https://bugs.webkit.org/show_bug.cgi?id=146198
1365
1366         Unreviewed rollout.
1367
1368         * wtf/glib/GUniquePtr.h:
1369
1370 2015-06-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1371
1372         [EFL][GTK] Define GLIB_VERSION_MIN_REQUIRED and require glib 2.36 for GTK
1373         https://bugs.webkit.org/show_bug.cgi?id=146181
1374
1375         Reviewed by Martin Robinson.
1376
1377         Define GLIB_VERSION_MIN_REQUIRED to avoid deprecation warnings.
1378
1379         * wtf/Platform.h:
1380
1381 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
1382
1383         [SOUP] Define SOUP_VERSION_MIN_REQUIRED
1384         https://bugs.webkit.org/show_bug.cgi?id=146165
1385
1386         Reviewed by Martin Robinson.
1387
1388         Define SOUP_VERSION_MIN_REQUIRED to avoid deprecation warnings.
1389
1390         * wtf/Platform.h:
1391
1392 2015-06-19  Mark Lam  <mark.lam@apple.com>
1393
1394         Gardening: build fixes for GTK and EFL for CheckedArithmetic change.
1395
1396         Not reviewed.
1397
1398         * wtf/CheckedArithmetic.h:
1399         (WTF::Checked::operator<):
1400         (WTF::Checked::operator<=):
1401         (WTF::Checked::operator>):
1402         (WTF::Checked::operator>=):
1403
1404 2015-06-19  Mark Lam  <mark.lam@apple.com>
1405
1406         CheckedArithmetic's operator bool() and operator==() is broken.
1407         https://bugs.webkit.org/show_bug.cgi?id=146129
1408
1409         Reviewed by Geoffrey Garen and Oliver Hunt.
1410
1411         The existing operator UnspecifiedBoolType*() in CheckedArithmetic is erroneously
1412         allowing the Checked value to be implicitly casted into pointer types.  This is
1413         because it is doing a reinterpret_cast<UnspecifiedBoolType*>(1) whereas the idiom
1414         relies on the address of a member e.g. &Checked::m_value.  As a result,
1415         ImageBufferData::putData() was getting an implicit cast of a Checked value to
1416         (void*)1 and doing incorrect pointer comparisons on it.
1417
1418         Also, 2 of CheckedArithmetic's operator==() will crash if used on an overflowed
1419         value, while a 3rd one does not.  The 3rd one should be consistent and also crash
1420         if used on an overflowed Checked value.
1421
1422         In this fix, we replace operator UnspecifiedBoolType*() with an explicit operator
1423         bool().  We also add the missing operators <, <=, >, and >=.  That takes care of
1424         the comparisons in ImageBufferData::putData().
1425
1426         * wtf/CheckedArithmetic.h:
1427         (WTF::CrashOnOverflow::overflowed):
1428         (WTF::CrashOnOverflow::crash):
1429         (WTF::RecordOverflow::crash):
1430
1431         (WTF::Checked::operator!):
1432         (WTF::Checked::operator bool):
1433         (WTF::Checked::unsafeGet):
1434         - Don't call CRASH() directly.  Delegate to the handler.
1435
1436         (WTF::Checked::operator==):
1437         - Should call the handler's crash() to be consistent with the other 2 versions of
1438           operator== which will crash in unsafeGet() if used on an overflowed Checked
1439           value.
1440
1441         (WTF::Checked::operator<):
1442         (WTF::Checked::operator<=):
1443         (WTF::Checked::operator>):
1444         (WTF::Checked::operator>=):
1445         - Add missing operators.
1446
1447         (WTF::Checked::operator UnspecifiedBoolType*): Deleted.
1448
1449 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
1450
1451         [WK2] Fix unused-private-field warning in WebProcess/Plugins/PluginView.<h|cpp>
1452         https://bugs.webkit.org/show_bug.cgi?id=145252
1453
1454         Reviewed by Tim Horton.
1455
1456         * wtf/FeatureDefines.h: Moved the definition of ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC
1457         here from Source/WebKit2/WebProcess/WebPage/WebPage.h
1458
1459 2015-06-17  Andreas Kling  <akling@apple.com>
1460
1461         SegmentedVector should waste less memory.
1462         <https://webkit.org/b/146069>
1463
1464         Reviewed by Anders Carlsson.
1465
1466         We were wasting sizeof(Vector) on every segment in SegmentVector.
1467         The segments were using inline capacity, and would never go beyond it,
1468         so all the size/capacity/out-of-line-buffer metadata was useless.
1469
1470         Change the internal representation to Vector<T[SegmentSize]> instead.
1471         This saves 16 bytes per segment, so lower SegmentSize -> bigger savings!
1472
1473         * wtf/SegmentedVector.h:
1474         (WTF::SegmentedVectorIterator::operator*):
1475         (WTF::SegmentedVectorIterator::operator->):
1476         (WTF::SegmentedVectorIterator::operator++):
1477         (WTF::SegmentedVectorIterator::operator==):
1478         (WTF::SegmentedVectorIterator::operator!=):
1479         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
1480         (WTF::SegmentedVector::at):
1481         (WTF::SegmentedVector::append):
1482         (WTF::SegmentedVector::removeLast):
1483         (WTF::SegmentedVector::grow):
1484         (WTF::SegmentedVector::begin):
1485         (WTF::SegmentedVector::end):
1486         (WTF::SegmentedVector::deleteAllSegments):
1487         (WTF::SegmentedVector::ensureSegmentsFor):
1488         (WTF::SegmentedVector::ensureSegment):
1489         (WTF::SegmentedVector::allocateSegment):
1490         (WTF::SegmentedVectorIterator::operator=): Deleted.
1491         (WTF::SegmentedVector::SegmentedVector): Deleted.
1492
1493 2015-06-16  Andreas Kling  <akling@apple.com>
1494
1495         Remove unused template parameter InlineCapacity from SegmentedVector.
1496         <https://webkit.org/b/146044>
1497
1498         Reviewed by Anders Carlsson.
1499
1500         * wtf/SegmentedVector.h:
1501         (WTF::SegmentedVectorIterator::operator=):
1502         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
1503         (WTF::SegmentedVector::at):
1504
1505 2015-06-16  Mark Lam  <mark.lam@apple.com>
1506
1507         Use NakedPtr<Exception>& to return exception results.
1508         https://bugs.webkit.org/show_bug.cgi?id=145870
1509
1510         Reviewed by Anders Carlsson and Filip Pizlo.
1511
1512         Introducing the NakedPtr class.
1513
1514         * WTF.xcodeproj/project.pbxproj:
1515         * wtf/NakedPtr.h: Added.
1516         (WTF::NakedPtr::NakedPtr):
1517         (WTF::NakedPtr::get):
1518         (WTF::NakedPtr::clear):
1519         (WTF::NakedPtr::operator*):
1520         (WTF::NakedPtr::operator->):
1521         (WTF::NakedPtr::operator T*):
1522         (WTF::NakedPtr::operator!):
1523         (WTF::NakedPtr::operator bool):
1524         (WTF::=):
1525         (WTF::NakedPtr<T>::swap):
1526         (WTF::swap):
1527
1528 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
1529
1530         [GLib] Move files under Source/WTF/wtf/gobject to Source/WTF/wtf/glib
1531         https://bugs.webkit.org/show_bug.cgi?id=145799
1532
1533         Reviewed by Carlos Garcia Campos.
1534
1535         Move the GLib-specific files to the Source/WTF/wtf/glib/ directory.
1536         'gobject' wasn't the most appropriate name for the directory since
1537         GObject is a submodule of GLib, but a lot of the code there didn't
1538         have much to do with GObject specifically.
1539
1540         Build rules for the moved files are also updated.
1541
1542         * WTF.vcxproj/WTF.vcxproj:
1543         * WTF.vcxproj/WTF.vcxproj.filters:
1544         * wtf/Platform.h:
1545         * wtf/PlatformEfl.cmake:
1546         * wtf/PlatformGTK.cmake:
1547         * wtf/RunLoop.h:
1548         * wtf/WorkQueue.h:
1549         * wtf/glib/GLibUtilities.cpp: Renamed from Source/WTF/wtf/gobject/GlibUtilities.cpp.
1550         (getCurrentExecutablePath):
1551         * wtf/glib/GLibUtilities.h: Renamed from Source/WTF/wtf/gobject/GlibUtilities.h.
1552         * wtf/glib/GMainLoopSource.cpp: Renamed from Source/WTF/wtf/gobject/GMainLoopSource.cpp.
1553         (WTF::GMainLoopSource::create):
1554         (WTF::GMainLoopSource::GMainLoopSource):
1555         (WTF::GMainLoopSource::~GMainLoopSource):
1556         (WTF::GMainLoopSource::isScheduled):
1557         (WTF::GMainLoopSource::isActive):
1558         (WTF::GMainLoopSource::cancel):
1559         (WTF::GMainLoopSource::scheduleIdleSource):
1560         (WTF::GMainLoopSource::schedule):
1561         (WTF::GMainLoopSource::scheduleTimeoutSource):
1562         (WTF::GMainLoopSource::scheduleAfterDelay):
1563         (WTF::createMicrosecondsTimeoutSource):
1564         (WTF::GMainLoopSource::scheduleAndDeleteOnDestroy):
1565         (WTF::GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy):
1566         (WTF::GMainLoopSource::prepareVoidCallback):
1567         (WTF::GMainLoopSource::finishVoidCallback):
1568         (WTF::GMainLoopSource::voidCallback):
1569         (WTF::GMainLoopSource::prepareBoolCallback):
1570         (WTF::GMainLoopSource::finishBoolCallback):
1571         (WTF::GMainLoopSource::boolCallback):
1572         (WTF::GMainLoopSource::socketCallback):
1573         (WTF::GMainLoopSource::voidSourceCallback):
1574         (WTF::GMainLoopSource::boolSourceCallback):
1575         (WTF::GMainLoopSource::socketSourceCallback):
1576         (WTF::GMainLoopSource::Context::destroySource):
1577         * wtf/glib/GMainLoopSource.h: Renamed from Source/WTF/wtf/gobject/GMainLoopSource.h.
1578         (WTF::GMainLoopSource::Context::operator=):
1579         * wtf/glib/GMutexLocker.h: Renamed from Source/WTF/wtf/gobject/GMutexLocker.h.
1580         (WTF::MutexWrapper<GMutex>::lock):
1581         (WTF::MutexWrapper<GMutex>::unlock):
1582         (WTF::MutexWrapper<GRecMutex>::lock):
1583         (WTF::MutexWrapper<GRecMutex>::unlock):
1584         (WTF::GMutexLocker::GMutexLocker):
1585         (WTF::GMutexLocker::~GMutexLocker):
1586         (WTF::GMutexLocker::lock):
1587         (WTF::GMutexLocker::unlock):
1588         * wtf/glib/GRefPtr.cpp: Renamed from Source/WTF/wtf/gobject/GRefPtr.cpp.
1589         (WTF::refGPtr):
1590         (WTF::derefGPtr):
1591         * wtf/glib/GRefPtr.h: Renamed from Source/WTF/wtf/gobject/GRefPtr.h.
1592         (WTF::GRefPtr::GRefPtr):
1593         (WTF::GRefPtr::~GRefPtr):
1594         (WTF::GRefPtr::clear):
1595         (WTF::GRefPtr::outPtr):
1596         (WTF::GRefPtr::isHashTableDeletedValue):
1597         (WTF::GRefPtr::get):
1598         (WTF::GRefPtr::operator*):
1599         (WTF::GRefPtr::operator->):
1600         (WTF::GRefPtr::operator!):
1601         (WTF::GRefPtr::operator UnspecifiedBoolType):
1602         (WTF::GRefPtr::hashTableDeletedValue):
1603         (WTF::=):
1604         (WTF::GRefPtr<T>::swap):
1605         (WTF::swap):
1606         (WTF::operator==):
1607         (WTF::operator!=):
1608         (WTF::static_pointer_cast):
1609         (WTF::const_pointer_cast):
1610         (WTF::adoptGRef):
1611         (WTF::refGPtr):
1612         (WTF::derefGPtr):
1613         * wtf/glib/GThreadSafeMainLoopSource.cpp: Renamed from Source/WTF/wtf/gobject/GThreadSafeMainLoopSource.cpp.
1614         (WTF::GThreadSafeMainLoopSource::GThreadSafeMainLoopSource):
1615         (WTF::GThreadSafeMainLoopSource::~GThreadSafeMainLoopSource):
1616         (WTF::GThreadSafeMainLoopSource::cancel):
1617         (WTF::GThreadSafeMainLoopSource::schedule):
1618         (WTF::GThreadSafeMainLoopSource::scheduleAfterDelay):
1619         (WTF::GThreadSafeMainLoopSource::prepareVoidCallback):
1620         (WTF::GThreadSafeMainLoopSource::finishVoidCallback):
1621         (WTF::GThreadSafeMainLoopSource::voidCallback):
1622         (WTF::GThreadSafeMainLoopSource::prepareBoolCallback):
1623         (WTF::GThreadSafeMainLoopSource::finishBoolCallback):
1624         (WTF::GThreadSafeMainLoopSource::boolCallback):
1625         * wtf/glib/GThreadSafeMainLoopSource.h: Renamed from Source/WTF/wtf/gobject/GThreadSafeMainLoopSource.h.
1626         * wtf/glib/GTypedefs.h: Renamed from Source/WTF/wtf/gobject/GTypedefs.h.
1627         * wtf/glib/GUniquePtr.h: Renamed from Source/WTF/wtf/gobject/GUniquePtr.h.
1628         (WTF::GPtrDeleter::operator()):
1629         (WTF::GUniqueOutPtr::GUniqueOutPtr):
1630         (WTF::GUniqueOutPtr::~GUniqueOutPtr):
1631         (WTF::GUniqueOutPtr::outPtr):
1632         (WTF::GUniqueOutPtr::release):
1633         (WTF::GUniqueOutPtr::operator*):
1634         (WTF::GUniqueOutPtr::operator->):
1635         (WTF::GUniqueOutPtr::get):
1636         (WTF::GUniqueOutPtr::operator!):
1637         (WTF::GUniqueOutPtr::operator UnspecifiedBoolType):
1638         (WTF::GUniqueOutPtr::reset):
1639         * wtf/glib/MainThreadGLib.cpp:
1640         * wtf/gobject/GMainLoopSource.cpp:
1641         (WTF::GMainLoopSource::create): Deleted.
1642         (WTF::GMainLoopSource::GMainLoopSource): Deleted.
1643         (WTF::GMainLoopSource::~GMainLoopSource): Deleted.
1644         (WTF::GMainLoopSource::isScheduled): Deleted.
1645         (WTF::GMainLoopSource::isActive): Deleted.
1646         (WTF::GMainLoopSource::cancel): Deleted.
1647         (WTF::GMainLoopSource::scheduleIdleSource): Deleted.
1648         (WTF::GMainLoopSource::schedule): Deleted.
1649         (WTF::GMainLoopSource::scheduleTimeoutSource): Deleted.
1650         (WTF::GMainLoopSource::scheduleAfterDelay): Deleted.
1651         (WTF::createMicrosecondsTimeoutSource): Deleted.
1652         (WTF::GMainLoopSource::scheduleAndDeleteOnDestroy): Deleted.
1653         (WTF::GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy): Deleted.
1654         (WTF::GMainLoopSource::prepareVoidCallback): Deleted.
1655         (WTF::GMainLoopSource::finishVoidCallback): Deleted.
1656         (WTF::GMainLoopSource::voidCallback): Deleted.
1657         (WTF::GMainLoopSource::prepareBoolCallback): Deleted.
1658         (WTF::GMainLoopSource::finishBoolCallback): Deleted.
1659         (WTF::GMainLoopSource::boolCallback): Deleted.
1660         (WTF::GMainLoopSource::socketCallback): Deleted.
1661         (WTF::GMainLoopSource::voidSourceCallback): Deleted.
1662         (WTF::GMainLoopSource::boolSourceCallback): Deleted.
1663         (WTF::GMainLoopSource::socketSourceCallback): Deleted.
1664         (WTF::GMainLoopSource::Context::destroySource): Deleted.
1665         * wtf/gobject/GMainLoopSource.h:
1666         (WTF::GMainLoopSource::Context::operator=): Deleted.
1667         * wtf/gobject/GMutexLocker.h:
1668         (WTF::MutexWrapper<GMutex>::lock): Deleted.
1669         (WTF::MutexWrapper<GMutex>::unlock): Deleted.
1670         (WTF::MutexWrapper<GRecMutex>::lock): Deleted.
1671         (WTF::MutexWrapper<GRecMutex>::unlock): Deleted.
1672         (WTF::GMutexLocker::GMutexLocker): Deleted.
1673         (WTF::GMutexLocker::~GMutexLocker): Deleted.
1674         (WTF::GMutexLocker::lock): Deleted.
1675         (WTF::GMutexLocker::unlock): Deleted.
1676         * wtf/gobject/GRefPtr.cpp:
1677         (WTF::refGPtr): Deleted.
1678         (WTF::derefGPtr): Deleted.
1679         * wtf/gobject/GRefPtr.h:
1680         (WTF::GRefPtr::GRefPtr): Deleted.
1681         (WTF::GRefPtr::~GRefPtr): Deleted.
1682         (WTF::GRefPtr::clear): Deleted.
1683         (WTF::GRefPtr::outPtr): Deleted.
1684         (WTF::GRefPtr::isHashTableDeletedValue): Deleted.
1685         (WTF::GRefPtr::get): Deleted.
1686         (WTF::GRefPtr::operator*): Deleted.
1687         (WTF::GRefPtr::operator->): Deleted.
1688         (WTF::GRefPtr::operator!): Deleted.
1689         (WTF::GRefPtr::operator UnspecifiedBoolType): Deleted.
1690         (WTF::GRefPtr::hashTableDeletedValue): Deleted.
1691         (WTF::=): Deleted.
1692         (WTF::GRefPtr<T>::swap): Deleted.
1693         (WTF::swap): Deleted.
1694         (WTF::operator==): Deleted.
1695         (WTF::operator!=): Deleted.
1696         (WTF::static_pointer_cast): Deleted.
1697         (WTF::const_pointer_cast): Deleted.
1698         (WTF::adoptGRef): Deleted.
1699         (WTF::refGPtr): Deleted.
1700         (WTF::derefGPtr): Deleted.
1701         * wtf/gobject/GThreadSafeMainLoopSource.cpp:
1702         (WTF::GThreadSafeMainLoopSource::GThreadSafeMainLoopSource): Deleted.
1703         (WTF::GThreadSafeMainLoopSource::~GThreadSafeMainLoopSource): Deleted.
1704         (WTF::GThreadSafeMainLoopSource::cancel): Deleted.
1705         (WTF::GThreadSafeMainLoopSource::schedule): Deleted.
1706         (WTF::GThreadSafeMainLoopSource::scheduleAfterDelay): Deleted.
1707         (WTF::GThreadSafeMainLoopSource::prepareVoidCallback): Deleted.
1708         (WTF::GThreadSafeMainLoopSource::finishVoidCallback): Deleted.
1709         (WTF::GThreadSafeMainLoopSource::voidCallback): Deleted.
1710         (WTF::GThreadSafeMainLoopSource::prepareBoolCallback): Deleted.
1711         (WTF::GThreadSafeMainLoopSource::finishBoolCallback): Deleted.
1712         (WTF::GThreadSafeMainLoopSource::boolCallback): Deleted.
1713         * wtf/gobject/GUniquePtr.h:
1714         (WTF::GPtrDeleter::operator()): Deleted.
1715         (WTF::GUniqueOutPtr::GUniqueOutPtr): Deleted.
1716         (WTF::GUniqueOutPtr::~GUniqueOutPtr): Deleted.
1717         (WTF::GUniqueOutPtr::outPtr): Deleted.
1718         (WTF::GUniqueOutPtr::release): Deleted.
1719         (WTF::GUniqueOutPtr::operator*): Deleted.
1720         (WTF::GUniqueOutPtr::operator->): Deleted.
1721         (WTF::GUniqueOutPtr::get): Deleted.
1722         (WTF::GUniqueOutPtr::operator!): Deleted.
1723         (WTF::GUniqueOutPtr::operator UnspecifiedBoolType): Deleted.
1724         (WTF::GUniqueOutPtr::reset): Deleted.
1725         * wtf/gobject/GlibUtilities.cpp:
1726         (getCurrentExecutablePath): Deleted.
1727
1728 2015-06-10  Basile Clement  <basile_clement@apple.com>
1729
1730         Unreviewed, fix an typo in unused template code.
1731
1732         * wtf/TinyPtrSet.h:
1733         (WTF::TinyPtrSet::iterator::operator*): s/at(index)/at(m_index)/
1734
1735 2015-06-09  Csaba Osztrogonác  <ossy@webkit.org>
1736
1737         [cmake] Fix the style issues in cmake project files
1738         https://bugs.webkit.org/show_bug.cgi?id=145755
1739
1740         Reviewed by Darin Adler.
1741
1742         * wtf/CMakeLists.txt:
1743
1744 2015-06-08  Alexey Proskuryakov  <ap@apple.com>
1745
1746         Build fix.
1747
1748         * wtf/TinyPtrSet.h: (WTF::TinyPtrSet::isEmpty): s/poointer/pointer/
1749
1750 2015-06-07  Filip Pizlo  <fpizlo@apple.com>
1751
1752         The tiny set magic in StructureSet should be available in WTF
1753         https://bugs.webkit.org/show_bug.cgi?id=145722
1754
1755         Reviewed by Geoffrey Garen.
1756         
1757         As the management of structure sets evolved in JSC, the StructureSet data structure grew
1758         increasingly smart. It's got some smart stuff for managing small sets of pointers. I
1759         wanted to take the generic logic out of JSC and put it into a reusable templatized class
1760         in WTF.
1761         
1762         * WTF.vcxproj/WTF.vcxproj:
1763         * WTF.xcodeproj/project.pbxproj:
1764         * wtf/CMakeLists.txt:
1765         * wtf/TinyPtrSet.h: Added.
1766         (WTF::TinyPtrSet::TinyPtrSet):
1767         (WTF::TinyPtrSet::operator=):
1768         (WTF::TinyPtrSet::~TinyPtrSet):
1769         (WTF::TinyPtrSet::clear):
1770         (WTF::TinyPtrSet::onlyEntry):
1771         (WTF::TinyPtrSet::isEmpty):
1772         (WTF::TinyPtrSet::add):
1773         (WTF::TinyPtrSet::remove):
1774         (WTF::TinyPtrSet::contains):
1775         (WTF::TinyPtrSet::merge):
1776         (WTF::TinyPtrSet::forEach):
1777         (WTF::TinyPtrSet::genericFilter):
1778         (WTF::TinyPtrSet::filter):
1779         (WTF::TinyPtrSet::exclude):
1780         (WTF::TinyPtrSet::isSubsetOf):
1781         (WTF::TinyPtrSet::isSupersetOf):
1782         (WTF::TinyPtrSet::overlaps):
1783         (WTF::TinyPtrSet::size):
1784         (WTF::TinyPtrSet::at):
1785         (WTF::TinyPtrSet::operator[]):
1786         (WTF::TinyPtrSet::last):
1787         (WTF::TinyPtrSet::iterator::iterator):
1788         (WTF::TinyPtrSet::iterator::operator*):
1789         (WTF::TinyPtrSet::iterator::operator++):
1790         (WTF::TinyPtrSet::iterator::operator==):
1791         (WTF::TinyPtrSet::iterator::operator!=):
1792         (WTF::TinyPtrSet::begin):
1793         (WTF::TinyPtrSet::end):
1794         (WTF::TinyPtrSet::operator==):
1795         (WTF::TinyPtrSet::addOutOfLine):
1796         (WTF::TinyPtrSet::containsOutOfLine):
1797         (WTF::TinyPtrSet::copyFrom):
1798         (WTF::TinyPtrSet::copyFromOutOfLine):
1799         (WTF::TinyPtrSet::OutOfLineList::create):
1800         (WTF::TinyPtrSet::OutOfLineList::destroy):
1801         (WTF::TinyPtrSet::OutOfLineList::list):
1802         (WTF::TinyPtrSet::OutOfLineList::OutOfLineList):
1803         (WTF::TinyPtrSet::deleteListIfNecessary):
1804         (WTF::TinyPtrSet::isThin):
1805         (WTF::TinyPtrSet::pointer):
1806         (WTF::TinyPtrSet::singleEntry):
1807         (WTF::TinyPtrSet::list):
1808         (WTF::TinyPtrSet::set):
1809         (WTF::TinyPtrSet::setEmpty):
1810         (WTF::TinyPtrSet::getReservedFlag):
1811         (WTF::TinyPtrSet::setReservedFlag):
1812
1813 2015-06-05  Chris Dumez  <cdumez@apple.com>
1814
1815         [WK2][iOS] Limit the number of vnodes used by the WebContent processes
1816         https://bugs.webkit.org/show_bug.cgi?id=145672
1817         <rdar://problem/21126637>
1818
1819         Reviewed by Antti Koivisto.
1820
1821         * wtf/RefCounter.h:
1822         (WTF::RefCounter::value):
1823
1824         Expose the actual refcount instead of a boolean value.
1825
1826 2015-06-05  Alex Christensen  <achristensen@webkit.org>
1827
1828         [Web Timing] Use new SPI to enable data collection.
1829         https://bugs.webkit.org/show_bug.cgi?id=145650
1830         rdar://problem/21203358
1831
1832         Reviewed by Chris Dumez.
1833
1834         * wtf/Platform.h:
1835         Added HAVE_TIMINGDATAOPTIONS for platform and version dependent feature.
1836
1837 2015-06-05  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1838
1839         [Streams API] ReadableStream should store callbacks as a Deque
1840         https://bugs.webkit.org/show_bug.cgi?id=145641
1841
1842         Reviewed by Darin Adler.
1843
1844         * wtf/Deque.h:
1845         (WTF::Deque::append): Adding not templated append method, forwarding to templated append method.
1846
1847 2015-06-02  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1848
1849         [Streams API] Delegate ReadableStreamReader reference counting to ReadableStream
1850         https://bugs.webkit.org/show_bug.cgi?id=144907
1851
1852         Reviewed by Darin Adler.
1853
1854         * wtf/Vector.h:
1855         (WTF::Vector::append): Adding not templated append method, forwarding to ValueType templated append method.
1856
1857 2015-06-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1858
1859         Heap-use-after-free read of size 4 in JavaScriptCore: WTF::StringImpl::isSymbol() (StringImpl.h:496)
1860         https://bugs.webkit.org/show_bug.cgi?id=145532
1861
1862         Reviewed by Geoffrey Garen.
1863
1864         Return `RefPtr<AtomicStringImpl>` instead of `AtomicStringImpl*`.
1865
1866         * wtf/text/AtomicStringImpl.cpp:
1867         (WTF::AtomicStringImpl::lookUpSlowCase):
1868         (WTF::AtomicStringImpl::lookUpInternal):
1869         * wtf/text/AtomicStringImpl.h:
1870         (WTF::AtomicStringImpl::lookUp):
1871
1872 2015-06-01  Anders Carlsson  <andersca@apple.com>
1873
1874         Use xpc_connection_set_oneshot_instance where possible
1875         https://bugs.webkit.org/show_bug.cgi?id=145535
1876         rdar://problem/21109994
1877
1878         Reviewed by Sam Weinig.
1879
1880         Add SPI declaration.
1881
1882         * wtf/spi/darwin/XPCSPI.h:
1883
1884 2015-05-29  Anders Carlsson  <andersca@apple.com>
1885
1886         Missing #import of Platform.h in several WTF headers
1887         https://bugs.webkit.org/show_bug.cgi?id=145475
1888         rdar://problem/21161818
1889
1890         Reviewed by Darin Adler.
1891
1892         Add Platform.h #includes.
1893
1894         * wtf/Assertions.h:
1895         * wtf/RetainPtr.h:
1896
1897 2015-05-29  Commit Queue  <commit-queue@webkit.org>
1898
1899         Unreviewed, rolling out r184949.
1900         https://bugs.webkit.org/show_bug.cgi?id=145458
1901
1902         Ends up generating worse code for HashTable move constructors
1903         (Requested by zdobersek on #webkit).
1904
1905         Reverted changeset:
1906
1907         "Clean up HashTable constructors"
1908         https://bugs.webkit.org/show_bug.cgi?id=145369
1909         http://trac.webkit.org/changeset/184949
1910
1911 2015-05-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1912
1913         Purge PassRefPtr in StringConcatenate.h
1914         https://bugs.webkit.org/show_bug.cgi?id=145376
1915
1916         Reviewed by Darin Adler.
1917
1918         Replace PassRefPtr with RefPtr. Additionally use nullptr instead of 0.
1919
1920         * wtf/text/StringConcatenate.h:
1921         (WTF::tryMakeString):
1922         (WTF::makeString):
1923
1924 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
1925
1926         Clean up HashTable constructors
1927         https://bugs.webkit.org/show_bug.cgi?id=145369
1928
1929         Reviewed by Andreas Kling.
1930
1931         Use nullptr to initialize pointer member variables in the HashTable
1932         default constructor. Copy and move constructors can use constructor
1933         delegation instead of replicating all member initializations. Move
1934         constructor should simply call HashTable::swap() instead of replicating
1935         all the swap operations.
1936
1937         * wtf/HashTable.h:
1938         (WTF::KeyTraits>::HashTable):
1939
1940 2015-05-27  Alexey Proskuryakov  <ap@apple.com>
1941
1942         [Mac] Fix clang static analyzer build
1943         https://bugs.webkit.org/show_bug.cgi?id=145426
1944         rdar://problem/20947408
1945
1946         Reviewed by Dan Bernstein.
1947
1948         * wtf/spi/darwin/XPCSPI.h: Correct declarations of xpc_retain and xpc_release.
1949
1950 2015-05-27  Dean Jackson  <dino@apple.com>
1951
1952         img.currentSrc problem in strict mode with old picturefill
1953         https://bugs.webkit.org/show_bug.cgi?id=144095
1954         <rdar://problem/21087013>
1955
1956         Reviewed by Simon Fraser.
1957
1958         Add a PICTURE_SIZES flag.
1959
1960         * wtf/FeatureDefines.h:
1961
1962 2015-05-26  Andreas Kling  <akling@apple.com>
1963
1964         StringView should have find(StringView, start).
1965         <https://webkit.org/b/145351>
1966
1967         Reviewed by Darin Adler.
1968
1969         Move the class agnostic guts of StringImpl's find() implementation from StringImpl
1970         to StringCommon.h and templatize the code into a findCommon() helper.
1971
1972         StringImpl::find() and StringView::find() now both call findCommon().
1973
1974         * wtf/text/StringCommon.h:
1975         (WTF::findInner):
1976         (WTF::find):
1977         (WTF::findCommon):
1978         * wtf/text/StringImpl.cpp:
1979         (WTF::StringImpl::find):
1980         (WTF::findInner): Deleted.
1981         * wtf/text/StringImpl.h:
1982         (WTF::find): Deleted.
1983         * wtf/text/StringView.cpp:
1984         (WTF::StringView::find):
1985         * wtf/text/StringView.h:
1986
1987
1988 2015-05-26  Dan Bernstein  <mitz@apple.com>
1989
1990         <rdar://problem/21104551> Update build settings
1991
1992         Reviewed by Anders Carlsson.
1993
1994         * Configurations/DebugRelease.xcconfig:
1995
1996 2015-05-23  Dan Bernstein  <mitz@apple.com>
1997
1998         Remove unused definitions of WEBKIT_VERSION_MIN_REQUIRED
1999         https://bugs.webkit.org/show_bug.cgi?id=145345
2000
2001         Reviewed by Sam Weinig.
2002
2003         * Configurations/Base.xcconfig: Also changed to use $(inherited).
2004
2005 2015-05-23  Yusuke Suzuki  <utatane.tea@gmail.com>
2006
2007         Introduce UniquedStringImpl and SymbolImpl to separate symbolic strings from AtomicStringImpl
2008         https://bugs.webkit.org/show_bug.cgi?id=144848
2009
2010         Reviewed by Darin Adler.
2011
2012         he current AtomicStringImpl accidentally means the symbol OR atomic StringImpl.
2013         t's not correct to its name and it's error prone.
2014
2015         In this patch, we'll introduce/changes classes into WTF.
2016
2017         1. UniquedStringImpl
2018         It's derived class from StringImpl. And it represents symbol || atomic StringImpl.
2019
2020         2. SymbolImpl
2021         It's derived class from UniquedStringImpl. Only symbol strings can become this.
2022         It ensures the given StringImpl is symbol in compile time.
2023
2024         3. AtomicStringImpl
2025         It's derived class from UniquedStringImpl. Only atomic (non-normal && non-symbol) strings can become this.
2026         It ensures the given StringImpl is atomic in compile time.
2027
2028         And, in this time, I just accept UniqueStringImpl in AtomicString. As the result,
2029         1. Now AtomicStringImpl issue is fixed. Its SymbolImpl is separated and UniquedStringImpl is introduced.
2030         2. But AtomicString still have both symbol and atomic strings.
2031         This should be solved in the separated patch.
2032
2033         * WTF.vcxproj/WTF.vcxproj:
2034         * WTF.vcxproj/WTF.vcxproj.filters:
2035         * WTF.xcodeproj/project.pbxproj:
2036         * wtf/CMakeLists.txt:
2037         * wtf/PrintStream.cpp:
2038         * wtf/PrintStream.h:
2039         (WTF::printInternal):
2040         * wtf/text/AtomicString.h:
2041         (WTF::AtomicString::AtomicString):
2042         * wtf/text/AtomicStringImpl.h:
2043         * wtf/text/StringImpl.cpp:
2044         (WTF::StringImpl::~StringImpl):
2045         (WTF::StringImpl::createSymbol):
2046         (WTF::StringImpl::createSymbolEmpty):
2047         * wtf/text/StringImpl.h:
2048         * wtf/text/SymbolImpl.h: Copied from Source/JavaScriptCore/runtime/PrivateName.h.
2049         * wtf/text/SymbolRegistry.cpp:
2050         (WTF::SymbolRegistry::symbolForKey):
2051         (WTF::SymbolRegistry::keyForSymbol):
2052         (WTF::SymbolRegistry::remove):
2053         * wtf/text/SymbolRegistry.h:
2054         * wtf/text/UniquedStringImpl.h: Copied from Source/JavaScriptCore/runtime/PrivateName.h.
2055
2056 2015-05-20  Zan Dobersek  <zdobersek@igalia.com>
2057
2058         [GTK] Move MainThreadGtk, RunLoopGtk, WorkQueueGtk under Source/WTF/wtf/glib/
2059         https://bugs.webkit.org/show_bug.cgi?id=145117
2060
2061         Reviewed by Csaba Osztrogonác.
2062
2063         Move the MainThreadGtk, RunLoopGtk and WorkQueueGtk implementation files from
2064         Source/WTF/wtf/gtk/ to Source/WTF/wtf/glib/. These implementations are not
2065         GTK-specific and only depend on GLib, so they are renamed as well.
2066
2067         There are other such implementations under Source/WTF/wtf/gobject/ (GObject
2068         is just a subset of GLib) that will be moved under the new directory in
2069         future patches.
2070
2071         * wtf/PlatformGTK.cmake:
2072         * wtf/glib/MainThreadGLib.cpp: Renamed from Source/WTF/wtf/gtk/MainThreadGtk.cpp.
2073         (WTF::initializeMainThreadPlatform):
2074         (WTF::scheduleDispatchFunctionsOnMainThread):
2075         * wtf/glib/RunLoopGLib.cpp: Renamed from Source/WTF/wtf/gtk/RunLoopGtk.cpp.
2076         (WTF::RunLoop::RunLoop):
2077         (WTF::RunLoop::~RunLoop):
2078         (WTF::RunLoop::run):
2079         (WTF::RunLoop::stop):
2080         (WTF::RunLoop::wakeUp):
2081         (WTF::RunLoop::TimerBase::TimerBase):
2082         (WTF::RunLoop::TimerBase::~TimerBase):
2083         (WTF::RunLoop::TimerBase::start):
2084         (WTF::RunLoop::TimerBase::stop):
2085         (WTF::RunLoop::TimerBase::isActive):
2086         * wtf/glib/WorkQueueGLib.cpp: Renamed from Source/WTF/wtf/gtk/WorkQueueGtk.cpp.
2087         (WTF::WorkQueue::platformInitialize):
2088         (WTF::WorkQueue::platformInvalidate):
2089         (WTF::WorkQueue::registerSocketEventHandler):
2090         (WTF::WorkQueue::unregisterSocketEventHandler):
2091         (WTF::WorkQueue::dispatch):
2092         (WTF::WorkQueue::dispatchAfter):
2093
2094 2015-05-19  Andreas Kling  <akling@apple.com>
2095
2096         Give StringView a utf8() API.
2097         <https://webkit.org/b/145201>
2098
2099         Reviewed by Anders Carlsson
2100
2101         Added an LChar version of StringImpl::utf8ForCharacters() and use that to give
2102         StringView a utf8() API just like String has.
2103
2104         * wtf/text/StringImpl.cpp:
2105         (WTF::StringImpl::utf8ForCharacters):
2106         * wtf/text/StringImpl.h:
2107         * wtf/text/StringView.cpp:
2108         (WTF::StringView::utf8):
2109         * wtf/text/StringView.h:
2110
2111 2015-05-19  Yusuke Suzuki  <utatane.tea@gmail.com>
2112
2113         Move AtomicStringImpl table related operations from AtomicString to AtomicStringImpl
2114         https://bugs.webkit.org/show_bug.cgi?id=145109
2115
2116         Reviewed by Darin Adler.
2117
2118         Now AtomicStringImpl table operations are located in AtomicString.
2119         But they should be under AtomicStringImpl.
2120         This patch simply moves these operations to AtomicStringImpl.
2121
2122         And this patch renames static AtomicString::find to static AtomicStringImpl::lookUp
2123         because it conflicts with AtomicStringImpl's member function name.
2124
2125         * WTF.vcxproj/WTF.vcxproj:
2126         * WTF.vcxproj/WTF.vcxproj.filters:
2127         * WTF.vcxproj/copy-files.cmd:
2128         * WTF.xcodeproj/project.pbxproj:
2129         * wtf/CMakeLists.txt:
2130         * wtf/PlatformMac.cmake:
2131         * wtf/PlatformWin.cmake:
2132         * wtf/text/AtomicString.cpp:
2133         (WTF::AtomicString::lower):
2134         (WTF::AtomicString::convertToASCIILowercase):
2135         (WTF::AtomicString::fromUTF8Internal):
2136         (WTF::AtomicStringTableLocker::AtomicStringTableLocker): Deleted.
2137         (WTF::stringTable): Deleted.
2138         (WTF::addToStringTable): Deleted.
2139         (WTF::CStringTranslator::hash): Deleted.
2140         (WTF::CStringTranslator::equal): Deleted.
2141         (WTF::CStringTranslator::translate): Deleted.
2142         (WTF::AtomicString::add): Deleted.
2143         (WTF::UCharBufferTranslator::hash): Deleted.
2144         (WTF::UCharBufferTranslator::equal): Deleted.
2145         (WTF::UCharBufferTranslator::translate): Deleted.
2146         (WTF::HashAndCharactersTranslator::hash): Deleted.
2147         (WTF::HashAndCharactersTranslator::equal): Deleted.
2148         (WTF::HashAndCharactersTranslator::translate): Deleted.
2149         (WTF::HashAndUTF8CharactersTranslator::hash): Deleted.
2150         (WTF::HashAndUTF8CharactersTranslator::equal): Deleted.
2151         (WTF::HashAndUTF8CharactersTranslator::translate): Deleted.
2152         (WTF::SubstringTranslator::translate): Deleted.
2153         (WTF::SubstringTranslator8::hash): Deleted.
2154         (WTF::SubstringTranslator8::equal): Deleted.
2155         (WTF::SubstringTranslator16::hash): Deleted.
2156         (WTF::SubstringTranslator16::equal): Deleted.
2157         (WTF::LCharBufferTranslator::hash): Deleted.
2158         (WTF::LCharBufferTranslator::equal): Deleted.
2159         (WTF::LCharBufferTranslator::translate): Deleted.
2160         (WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
2161         (WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
2162         (WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
2163         (WTF::AtomicString::addFromLiteralData): Deleted.
2164         (WTF::AtomicString::addSlowCase): Deleted.
2165         (WTF::AtomicString::remove): Deleted.
2166         (WTF::AtomicString::findSlowCase): Deleted.
2167         (WTF::AtomicString::findInternal): Deleted.
2168         (WTF::AtomicString::isInAtomicStringTable): Deleted.
2169         * wtf/text/AtomicString.h:
2170         (WTF::AtomicString::AtomicString):
2171         (WTF::AtomicString::fromUTF8):
2172         (WTF::AtomicString::find): Deleted.
2173         (WTF::AtomicString::add): Deleted.
2174         (WTF::AtomicString::addWithStringTableProvider): Deleted.
2175         * wtf/text/AtomicStringImpl.cpp: Copied from Source/WTF/wtf/text/AtomicString.cpp.
2176         (WTF::AtomicStringTableLocker::AtomicStringTableLocker):
2177         (WTF::stringTable):
2178         (WTF::addToStringTable):
2179         (WTF::CStringTranslator::hash):
2180         (WTF::CStringTranslator::equal):
2181         (WTF::CStringTranslator::translate):
2182         (WTF::AtomicStringImpl::add):
2183         (WTF::UCharBufferTranslator::hash):
2184         (WTF::UCharBufferTranslator::equal):
2185         (WTF::UCharBufferTranslator::translate):
2186         (WTF::HashAndCharactersTranslator::hash):
2187         (WTF::HashAndCharactersTranslator::equal):
2188         (WTF::HashAndCharactersTranslator::translate):
2189         (WTF::HashAndUTF8CharactersTranslator::hash):
2190         (WTF::HashAndUTF8CharactersTranslator::equal):
2191         (WTF::HashAndUTF8CharactersTranslator::translate):
2192         (WTF::SubstringTranslator::translate):
2193         (WTF::SubstringTranslator8::hash):
2194         (WTF::SubstringTranslator8::equal):
2195         (WTF::SubstringTranslator16::hash):
2196         (WTF::SubstringTranslator16::equal):
2197         (WTF::LCharBufferTranslator::hash):
2198         (WTF::LCharBufferTranslator::equal):
2199         (WTF::LCharBufferTranslator::translate):
2200         (WTF::CharBufferFromLiteralDataTranslator::hash):
2201         (WTF::CharBufferFromLiteralDataTranslator::equal):
2202         (WTF::CharBufferFromLiteralDataTranslator::translate):
2203         (WTF::AtomicStringImpl::addLiteral):
2204         (WTF::AtomicStringImpl::addSlowCase):
2205         (WTF::AtomicStringImpl::remove):
2206         (WTF::AtomicStringImpl::lookUpSlowCase):
2207         (WTF::AtomicStringImpl::addUTF8):
2208         (WTF::AtomicStringImpl::lookUpInternal):
2209         (WTF::AtomicStringImpl::isInAtomicStringTable):
2210         * wtf/text/AtomicStringImpl.h:
2211         (WTF::AtomicStringImpl::lookUp):
2212         (WTF::AtomicStringImpl::add):
2213         (WTF::AtomicStringImpl::addWithStringTableProvider):
2214         (WTF::AtomicStringImpl::AtomicStringImpl): Deleted.
2215         * wtf/text/StringImpl.cpp:
2216         (WTF::StringImpl::~StringImpl):
2217         * wtf/text/StringImpl.h:
2218         * wtf/text/WTFString.h:
2219         (WTF::String::String):
2220         * wtf/text/cf/AtomicStringCF.cpp:
2221         (WTF::AtomicString::add): Deleted.
2222         * wtf/text/cf/AtomicStringImplCF.cpp: Renamed from Source/WTF/wtf/text/cf/AtomicStringCF.cpp.
2223         (WTF::AtomicStringImpl::add):
2224
2225 2015-05-19  Ting-Wei Lan  <lantw44@gmail.com>
2226
2227         [SOUP] Use st_birthtime to get creation time of files on systems support it
2228         https://bugs.webkit.org/show_bug.cgi?id=144989
2229
2230         Reviewed by Carlos Garcia Campos.
2231
2232         Define HAVE(STAT_BIRTHTIME) as 1 on operating systems supporting
2233         getting creation time of files using st_birthtime in stat.
2234
2235         * wtf/Platform.h:
2236
2237 2015-05-19  Chris Dumez  <cdumez@apple.com>
2238
2239         Mark static variables as const when possible
2240         https://bugs.webkit.org/show_bug.cgi?id=145161
2241
2242         Reviewed by Andreas Kling.
2243
2244         * wtf/dtoa.cpp:
2245         (WTF::pow5mult):
2246
2247 2015-05-19  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2248
2249         [EFL] Remove unnecessary PLATFORM(EFL) macro in EFL specific files
2250         https://bugs.webkit.org/show_bug.cgi?id=145160
2251
2252         Reviewed by Csaba Osztrogonác.
2253
2254         * wtf/efl/EflTypedefs.h: Remove PLATFORM(EFL).
2255         * wtf/efl/UniquePtrEfl.h: ditto.
2256
2257 2015-05-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2258
2259         [CMake] Ignore warnings in system headers
2260         https://bugs.webkit.org/show_bug.cgi?id=144747
2261
2262         Reviewed by Darin Adler.
2263
2264         Separate include directories into WebKit project includes and system includes. Suppress all
2265         warnings from headers in system include directories using the SYSTEM argument to
2266         the include_directories command.
2267
2268         * wtf/CMakeLists.txt:
2269         * wtf/PlatformEfl.cmake:
2270         * wtf/PlatformGTK.cmake:
2271
2272 2015-05-18  Myles C. Maxfield  <mmaxfield@apple.com>
2273
2274         Addressing post-review comments on r184353
2275         https://bugs.webkit.org/show_bug.cgi?id=145146
2276
2277         Reviewed by Benjamin Poulain.
2278
2279         Create an overload for equalIgnoringASCIICase() for AtomicString and string literals.
2280
2281         * wtf/text/AtomicString.h:
2282         (WTF::equalIgnoringASCIICase):
2283
2284 2015-05-18  Skachkov Alexandr  <gskachkov@gmail.com>
2285
2286         [ES6] Arrow function syntax. Feature flag for arrow function
2287         https://bugs.webkit.org/show_bug.cgi?id=145108
2288
2289         Reviewed by Ryosuke Niwa.
2290
2291         Added feature flag ENABLE_ES6_ARROWFUNCTION_SYNTAX for arrow function
2292
2293         * wtf/FeatureDefines.h:
2294
2295 2015-05-17  Benjamin Poulain  <benjamin@webkit.org>
2296
2297         Do not use fastMallocGoodSize anywhere
2298         https://bugs.webkit.org/show_bug.cgi?id=145103
2299
2300         Reviewed by Michael Saboff.
2301
2302         It is silly we see fastMallocGoodSize in profiles, it does absolutely nothing.
2303
2304         This patch keeps fastMallocGoodSize() around for older code linking
2305         with newer WebKit, but remove any use of it inside WebKit.
2306
2307         * wtf/FastMalloc.cpp:
2308         (WTF::fastMallocGoodSize):
2309         * wtf/FastMalloc.h:
2310         * wtf/Vector.h:
2311         (WTF::VectorBufferBase::allocateBuffer):
2312         (WTF::VectorBufferBase::tryAllocateBuffer):
2313         (WTF::VectorBufferBase::reallocateBuffer):
2314
2315 2015-05-15  Dan Bernstein  <mitz@apple.com>
2316
2317         Build fix for some versions of clang.
2318
2319         * wtf/SaturatedArithmetic.h:
2320         (signedAddOverflows):
2321         (signedSubtractOverflows):
2322
2323 2015-05-14  Dan Bernstein  <mitz@apple.com>
2324
2325         Reverted r177753, now that <rdar://problem/19347133> is fixed.
2326
2327         Rubber-stamped by Benjamin Poulain.
2328
2329         * wtf/SaturatedArithmetic.h:
2330         (signedAddOverflows):
2331         (signedSubtractOverflows):
2332
2333 2015-05-14  Myles C. Maxfield  <mmaxfield@apple.com>
2334
2335         Add String literal overloads to equalIgnoringASCIICase()
2336         https://bugs.webkit.org/show_bug.cgi?id=145008
2337
2338         Reviewed by Benjamin Poulain.
2339
2340         Create an overload for equalIgnoringASCIICase for string literals.
2341
2342         * wtf/text/StringImpl.h:
2343         (WTF::equalIgnoringASCIICase): Use a non-templated helper function.
2344         * wtf/text/StringImpl.cpp:
2345         (WTF::equalIgnoringASCIICase): Implement it.
2346         * wtf/text/StringView.h:
2347         (WTF::equalIgnoringASCIICase): Use a non-templated helper function.
2348         * wtf/text/StringView.cpp:
2349         (WTF::equalIgnoringASCIICase): Implement it.
2350         * wtf/text/WTFString.h:
2351         (WTF::equalIgnoringASCIICase): Delegate to StringImpl's implementation.
2352
2353 2015-05-14  Žan Doberšek  <zdobersek@igalia.com>
2354
2355         [GTK] RunLoop constructor should properly retrieve or establish the thread-default GMainContext
2356         https://bugs.webkit.org/show_bug.cgi?id=144732
2357
2358         Reviewed by Carlos Garcia Campos.
2359
2360         RunLoop constructor in the GTK implementation should use the
2361         existing thread-default context, create a new one if not on
2362         the main thread, or use the global-default one if on the main
2363         thread.
2364
2365         In RunLoop::run(), the GMainContext should then be pushed as
2366         the thread-default before calling g_main_loop_run(), and popped
2367         off when the main loop stops.
2368
2369         * wtf/gtk/RunLoopGtk.cpp:
2370         (WTF::RunLoop::RunLoop):
2371         (WTF::RunLoop::run):
2372
2373 2015-05-13  Oliver Hunt  <oliver@apple.com>
2374        Ensure that all the smart pointer types in WTF clear their pointer before deref
2375        https://bugs.webkit.org/show_bug.cgi?id=143789
2376
2377        Reviewed by Ryosuke Niwa.
2378
2379        In order to prevent use after free bugs caused by destructors
2380        that end up trying to access the smart pointer itself, we should
2381        make sure we always clear the m_ptr field before calling deref.
2382
2383        Essentially the UaF path is:
2384        struct Foo : RefCounted<Foo> {
2385          Wibble* m_wibble;
2386          void doSomething();
2387          ~Foo() { m_wibble->doSomethingLikeCleanup(); }
2388        };
2389
2390        struct Wibble {
2391          void doSomethingLikeCleanup()
2392          {
2393            if (m_foo) {
2394                /* if this branch is not here we get a null deref */
2395                m_foo->doSomething();
2396            }
2397          }
2398          void replaceFoo(Foo* foo) { m_foo = foo; }
2399          RefPtr<Foo> m_foo;
2400        };
2401
2402        Wibble* someWibble = /* a Wibble with m_foo->m_refCount == 1 */;
2403                             /* and m_foo points to someWibble       */;
2404
2405        someWibble->replaceFoo(someOtherFoo);
2406        + someWibble->m_foo->m_ptr->deref();
2407          + someWibble->m_foo->m_ptr->~Foo()
2408            + someWibble->m_foo->m_ptr->m_wibble->doSomethingLikeCleanup()
2409              + someWibble->m_foo->m_ptr->m_wibble /* someWibble */ ->m_foo->m_ptr /*logically dead*/ ->doSomething()
2410
2411        By clearing m_ptr first we either force a null pointer deref or
2412        we force our code down a path that does not use the dead smart
2413        pointer.
2414
2415        * wtf/PassRefPtr.h:
2416        (WTF::PassRefPtr::~PassRefPtr):
2417        * wtf/Ref.h:
2418        (WTF::Ref::~Ref):
2419        (WTF::Ref::operator=):
2420        * wtf/RefPtr.h:
2421        (WTF::RefPtr::~RefPtr):
2422        * wtf/RetainPtr.h:
2423        (WTF::RetainPtr::~RetainPtr):
2424        (WTF::RetainPtr<T>::clear):
2425
2426 2015-05-12  Michael Saboff  <msaboff@apple.com>
2427
2428         If JSC cannot get executable memory, it shouldn't call madvise
2429         https://bugs.webkit.org/show_bug.cgi?id=144931
2430
2431         Reviewed by Mark Lam.
2432
2433         Made calling madvise conditional on really getting mmapped memory.
2434
2435         * wtf/OSAllocatorPosix.cpp:
2436         (WTF::OSAllocator::reserveUncommitted):
2437
2438 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
2439
2440         [Win] Move Windows build target to Windows 7 (or newer)
2441         https://bugs.webkit.org/show_bug.cgi?id=144890
2442         <rdar://problem/20707307>
2443
2444         Reviewed by Anders Carlsson.
2445
2446         Update linked SDK and minimal Windows level to be compatible with
2447         Windows 7 or newer.
2448
2449         * WTF.vcxproj/WTF.vcxproj:
2450         * WTF.vcxproj/WTFGenerated.vcxproj:
2451         * config.h:
2452
2453 2015-05-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2454
2455         [GTK] WorkQueue objects are not released
2456         https://bugs.webkit.org/show_bug.cgi?id=144824
2457
2458         Reviewed by Žan Doberšek.
2459
2460         Do not keep a reference of the WorkQueue for the entire life of
2461         its worker thread, since every task scheduled on the WorkQueue
2462         already takes a reference. Instead, take a reference of the main
2463         loop to make sure that when the worker thread starts, the main
2464         loop hasn't been released to avoid runtime warnings (see
2465         webkit.org/b/140998). Also removed the g_main_context_pop_thread_default()
2466         from the thread body, since the thread-specific context queue will
2467         be freed anyway when the thread exits.
2468         If the WorkQueue is released early, before the thread has started,
2469         schedule a main loop quit in the context, to make sure it will
2470         be the first thing run by the main loop and the thread will exit.
2471
2472         * wtf/WorkQueue.h: Remove unused event loop mutex.
2473         * wtf/gtk/WorkQueueGtk.cpp:
2474         (WTF::WorkQueue::platformInitialize):
2475         (WTF::WorkQueue::platformInvalidate):
2476
2477 2015-05-09  Yoav Weiss  <yoav@yoav.ws>
2478
2479         Remove the PICTURE_SIZES build flag
2480         https://bugs.webkit.org/show_bug.cgi?id=144679
2481
2482         Reviewed by Benjamin Poulain.
2483
2484         Removed the PICTURE_SIZES build time flag.
2485
2486         * wtf/FeatureDefines.h:
2487
2488 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
2489
2490         Remove convenience constructors for TextRun
2491         https://bugs.webkit.org/show_bug.cgi?id=144752
2492
2493         Reviewed by Anders Carlsson.
2494
2495         No reason why StringView shouldn't have a StringImpl* constructor.
2496
2497         Test: StringView8Bit in TestWebKitAPI
2498
2499         * wtf/text/StringView.h: Add the constructor.
2500
2501 2015-05-08  Commit Queue  <commit-queue@webkit.org>
2502
2503         Unreviewed, rolling out r183996.
2504         https://bugs.webkit.org/show_bug.cgi?id=144806
2505
2506         ASan detected use-after free (Requested by ap on #webkit).
2507
2508         Reverted changeset:
2509
2510         "Remove convenience constructors for TextRun"
2511         https://bugs.webkit.org/show_bug.cgi?id=144752
2512         http://trac.webkit.org/changeset/183996
2513
2514 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
2515
2516         Remove convenience constructors for TextRun
2517         https://bugs.webkit.org/show_bug.cgi?id=144752
2518
2519         Reviewed by Anders Carlsson.
2520
2521         No reason why StringView shouldn't have a StringImpl* constructor.
2522
2523         Test: StringView8Bit in TestWebKitAPI
2524
2525         * wtf/text/StringView.h: Add the constructor.
2526
2527 2015-05-08  Andreas Kling  <akling@apple.com>
2528
2529         Optimize serialization of quoted JSON strings.
2530         <https://webkit.org/b/144754>
2531
2532         Reviewed by Darin Adler.
2533
2534         Add a StringBuilder API for appending a quoted JSON string. This is used by
2535         JSON.stringify() to implement efficient appending of strings while escaping
2536         quotes, control characters and \uNNNN-style characters.
2537
2538         The main benefit comes from only doing a single buffer expansion up front,
2539         instead of doing it every time we append something. The fudge factor is pretty
2540         large, since the maximum number of output characters per input character is 6.
2541
2542         The first landing of this patch had two bugs in it:
2543
2544         - Made \uNNNN escapes uppercase hexadecimal instead of lowercase.
2545         - Didn't preallocate enough space for 8-bit input strings.
2546
2547         Both were caught by existing tests on our bots, and both were due to last-minute
2548         changes before landing. :/
2549
2550         * wtf/text/StringBuilder.cpp:
2551         (WTF::appendQuotedJSONStringInternal):
2552         (WTF::StringBuilder::appendQuotedJSONString):
2553         * wtf/text/StringBuilder.h:
2554
2555 2015-05-07  Commit Queue  <commit-queue@webkit.org>
2556
2557         Unreviewed, rolling out r183961.
2558         https://bugs.webkit.org/show_bug.cgi?id=144784
2559
2560         Broke js/dom/JSON-stringify.html (Requested by kling on
2561         #webkit).
2562
2563         Reverted changeset:
2564
2565         "Optimize serialization of quoted JSON strings."
2566         https://bugs.webkit.org/show_bug.cgi?id=144754
2567         http://trac.webkit.org/changeset/183961
2568
2569 2015-05-07  Andreas Kling  <akling@apple.com>
2570
2571         Optimize serialization of quoted JSON strings.
2572         <https://webkit.org/b/144754>
2573
2574         Reviewed by Darin Adler.
2575
2576         Add a StringBuilder API for appending a quoted JSON string. This is used by
2577         JSON.stringify() to implement efficient appending of strings while escaping
2578         quotes, control characters and \uNNNN-style characters.
2579
2580         The main benefit comes from only doing a single buffer expansion up front,
2581         instead of doing it every time we append something. The fudge factor is pretty
2582         large for 16-bit strings, since the maximum number of output characters per
2583         input character is 6.
2584
2585         * wtf/text/StringBuilder.cpp:
2586         (WTF::appendQuotedJSONStringInternal):
2587         (WTF::StringBuilder::appendQuotedJSONString):
2588         * wtf/text/StringBuilder.h:
2589
2590 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
2591
2592         [GTK] All spell checking layout tests fail
2593         https://bugs.webkit.org/show_bug.cgi?id=144648
2594
2595         Reviewed by Carlos Garcia Campos.
2596
2597         * wtf/Platform.h: Activate UNIFIED_TEXT_CHECKING for GTK+.
2598
2599 2015-05-07  Dan Bernstein  <mitz@apple.com>
2600
2601         <rdar://problem/19317140> [Xcode] Remove usage of AspenFamily.xcconfig in Source/
2602         https://bugs.webkit.org/show_bug.cgi?id=144727
2603
2604         Reviewed by Darin Adler.
2605
2606         * Configurations/Base.xcconfig: Don’t include AspenFamily.xcconfig, and define
2607         INSTALL_PATH_PREFIX and LD_DYLIB_INSTALL_NAME for the iOS 8.x Simulator.
2608
2609 2015-05-07  Žan Doberšek  <zdobersek@igalia.com>
2610
2611         [GTK] Clean up RunLoop implementation
2612         https://bugs.webkit.org/show_bug.cgi?id=144729
2613
2614         Reviewed by Carlos Garcia Campos.
2615
2616         Clean up the RunLoop implementation for the GTK port,
2617         removing unnecessary methods and using simpler variable names.
2618
2619         Nested GMainLoops in RunLoop::run() are now created for the
2620         RunLoop's GMainContext, and not for the default context (enforced
2621         through the null argument to g_main_loop_new()).
2622
2623         * wtf/RunLoop.h:
2624         * wtf/gtk/RunLoopGtk.cpp:
2625         (WTF::RunLoop::RunLoop):
2626         (WTF::RunLoop::~RunLoop):
2627         (WTF::RunLoop::run):
2628         (WTF::RunLoop::stop):
2629         (WTF::RunLoop::wakeUp):
2630         (WTF::RunLoop::TimerBase::start):
2631         (WTF::RunLoop::innermostLoop): Deleted.
2632         (WTF::RunLoop::pushNestedMainLoop): Deleted.
2633         (WTF::RunLoop::popNestedMainLoop): Deleted.
2634
2635 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2636
2637         [GTK] Async operations running in the WorkQueue thread should schedule their sources to the WorkQueue main lopp
2638         https://bugs.webkit.org/show_bug.cgi?id=144541
2639
2640         Reviewed by Žan Doberšek.
2641
2642         They are currently sent to the main thread run loop, because we
2643         are not setting the WorkQueue main context as the default one in
2644         the worker thread.
2645
2646         * wtf/gtk/WorkQueueGtk.cpp:
2647         (WTF::WorkQueue::platformInitialize): Call
2648         g_main_context_push_thread_default() to set the WorkQueue main
2649         context as the default of the thread before running the main loop,
2650         and g_main_context_pop_thread_default() when the main loop quits.
2651
2652 2015-05-04  Commit Queue  <commit-queue@webkit.org>
2653
2654         Unreviewed, rolling out r183661.
2655         https://bugs.webkit.org/show_bug.cgi?id=144594
2656
2657         Caused ~3.5MB regression on membuster(!) (Requested by kling_
2658         on #webkit).
2659
2660         Reverted changeset:
2661
2662         "Decrease minimum Vector size."
2663         https://bugs.webkit.org/show_bug.cgi?id=144453
2664         http://trac.webkit.org/changeset/183661
2665
2666 2015-05-04  Zan Dobersek  <zdobersek@igalia.com>
2667
2668         [WTF] Remove Functional.h inclusions
2669         https://bugs.webkit.org/show_bug.cgi?id=144400
2670
2671         Reviewed by Darin Adler.
2672
2673         Remove most of the Functional.h header inclusions. The header is preserved
2674         since it's still used by older versions of Safari, and for the callOnMainThread()
2675         stub in DeprecatedSymbolsUsedBySafari.mm.
2676
2677         * wtf/MainThread.cpp:
2678         * wtf/RunLoop.h:
2679         * wtf/WorkQueue.cpp:
2680         * wtf/WorkQueue.h:
2681         * wtf/efl/DispatchQueueEfl.h:
2682         * wtf/efl/DispatchQueueWorkItemEfl.h:
2683
2684 2015-05-02  Commit Queue  <commit-queue@webkit.org>
2685
2686         Unreviewed, rolling out r183722.
2687         https://bugs.webkit.org/show_bug.cgi?id=144534
2688
2689         Made all the tests assert (Requested by ap on #webkit).
2690
2691         Reverted changeset:
2692
2693         "Generated static StringImpls should have static flag set."
2694         https://bugs.webkit.org/show_bug.cgi?id=144516
2695         http://trac.webkit.org/changeset/183722
2696
2697 2015-05-02  Andreas Kling  <akling@apple.com>
2698
2699         Generated static StringImpls should have static flag set.
2700         <https://webkit.org/b/144516>
2701
2702         Reviewed by Darin Adler.
2703
2704         Discovered this while tracking down a string ref leak. Turns out that the strings
2705         generated by StaticString.pm were not getting the static flag set on them.
2706
2707         The only practical difference from this AFAICT is that now the garbage collector
2708         will correctly see that these strings have no extra memory cost to worry about.
2709
2710         * wtf/text/StringImpl.h:
2711
2712 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
2713
2714         USE(...) macro should expect unprefixed variables
2715         https://bugs.webkit.org/show_bug.cgi?id=144454
2716
2717         Reviewed by Daniel Bates.
2718
2719         * wtf/Assertions.cpp: Replace all occurrences WTF_USE with USE.
2720         * wtf/Platform.h: Replace all occurrences WTF_USE with USE. Modify the USE
2721         macro to look for unprefixed variables.
2722         * wtf/WTFThreadData.h: Replace all occurrences WTF_USE with USE.
2723
2724 2015-05-01  Joseph Pecoraro  <pecoraro@apple.com>
2725
2726         Enable ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX by default on all ports (Windows was missed)
2727         https://bugs.webkit.org/show_bug.cgi?id=144495
2728
2729         Reviewed by Csaba Osztrogonác.
2730
2731         * wtf/FeatureDefines.h:
2732         This covers all ports that haven't defined the flag otherwise.
2733
2734 2015-04-30  Alex Christensen  <achristensen@webkit.org>
2735
2736         Decrease minimum Vector size.
2737         https://bugs.webkit.org/show_bug.cgi?id=144453
2738
2739         Reviewed by Andreas Kling.
2740
2741         * wtf/Vector.h:
2742         Make the default min size 4 to save memory on small Vectors.
2743
2744 2015-04-30  Yusuke Suzuki  <utatane.tea@gmail.com>
2745
2746         Use the default hash value for Symbolized StringImpl
2747         https://bugs.webkit.org/show_bug.cgi?id=144347
2748
2749         Reviewed by Darin Adler.
2750
2751         Use a default hash value calculation for symbolized StringImpl.
2752
2753         * wtf/text/StringImpl.cpp:
2754         (WTF::StringImpl::createSymbol):
2755         * wtf/text/StringImpl.h:
2756         (WTF::StringImpl::StringImpl):
2757         (WTF::StringImpl::symbolAwareHash):
2758         (WTF::StringImpl::existingSymbolAwareHash):
2759         (WTF::StringImpl::hashForSymbol):
2760         * wtf/text/StringStatics.cpp:
2761         (WTF::StringImpl::nextHashForSymbol):
2762         (WTF::StringImpl::hashAndFlagsForSymbol): Deleted.
2763
2764 2015-04-29  Alexey Proskuryakov  <ap@apple.com>
2765
2766         LazyNeverDestroyed is not thread safe in debug builds, causing assertions
2767         https://bugs.webkit.org/show_bug.cgi?id=144378
2768
2769         Reviewed by Darin Adler.
2770
2771         * wtf/NeverDestroyed.h:
2772
2773 2015-04-28  Geoffrey Garen  <ggaren@apple.com>
2774
2775         It shouldn't take 1846 lines of code and 5 FIXMEs to sort an array.
2776         https://bugs.webkit.org/show_bug.cgi?id=144013
2777
2778         Reviewed by Mark Lam.
2779
2780         Remove this custom tree implementation because it is unused. (It was
2781         previously used to achieve a stable array sort in certain cases.)
2782
2783         * WTF.vcxproj/WTF.vcxproj:
2784         * WTF.vcxproj/WTF.vcxproj.filters:
2785         * WTF.xcodeproj/project.pbxproj:
2786         * wtf/AVLTree.h: Removed.
2787         * wtf/CMakeLists.txt:
2788
2789 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
2790
2791         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
2792         https://bugs.webkit.org/show_bug.cgi?id=132159
2793
2794         Reviewed by Darin Adler.
2795
2796         * wtf/Platform.h:
2797
2798         Opt-in using ENABLE(PLATFORM_FONT_LOOKUP)
2799
2800 2015-04-29  Yusuke Suzuki  <utatane.tea@gmail.com>
2801
2802         REGRESSION (r183373): ASSERT failed in wtf/SHA1.h
2803         https://bugs.webkit.org/show_bug.cgi?id=144257
2804
2805         Reviewed by Darin Adler.
2806
2807         * wtf/SHA1.h:
2808         (WTF::SHA1::addBytes):
2809
2810 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
2811
2812         [CMake] [GTK] Organize and clean up unused CMake variables
2813         https://bugs.webkit.org/show_bug.cgi?id=144364
2814
2815         Reviewed by Gyuyoung Kim.
2816
2817         * wtf/PlatformGTK.cmake: Add variables specific to this project.
2818
2819 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2820
2821         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
2822         https://bugs.webkit.org/show_bug.cgi?id=144304
2823
2824         Reviewed by Geoffrey Garen.
2825
2826         No longer check ENABLE_LLINT_C_LOOP to determine the value of ENABLE_JIT.
2827
2828         * wtf/Platform.h:
2829
2830 2015-04-28  Commit Queue  <commit-queue@webkit.org>
2831
2832         Unreviewed, rolling out r183514.
2833         https://bugs.webkit.org/show_bug.cgi?id=144359
2834
2835         It broke cloop test bots (Requested by mcatanzaro on #webkit).
2836
2837         Reverted changeset:
2838
2839         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
2840         https://bugs.webkit.org/show_bug.cgi?id=144304
2841         http://trac.webkit.org/changeset/183514
2842
2843 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2844
2845         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
2846         https://bugs.webkit.org/show_bug.cgi?id=144304
2847
2848         Reviewed by Geoffrey Garen.
2849
2850         No longer check ENABLE_LLINT_C_LOOP to determine the value of ENABLE_JIT.
2851
2852         * wtf/Platform.h:
2853
2854 2015-04-28  Alex Christensen  <achristensen@webkit.org>
2855
2856         Properly reset deleted count when clearing HashTables.
2857         https://bugs.webkit.org/show_bug.cgi?id=144343
2858
2859         Reviewed by Andreas Kling.
2860
2861         * wtf/HashTable.h:
2862         (WTF::KeyTraits>::clear):
2863         Reset m_deletedCount, which appears to have been forgotten.
2864
2865 2015-04-28  Alex Christensen  <achristensen@webkit.org>
2866
2867         [Content Extensions] Use less memory for CombinedURLFilters.
2868         https://bugs.webkit.org/show_bug.cgi?id=144290
2869
2870         Reviewed by Andreas Kling.
2871
2872         * wtf/Forward.h:
2873         * wtf/Vector.h:
2874         Added a minCapacity template parameter to allow changing the minimum size of an 
2875         allocated buffer. The default minCapacity is kept at 16 unless otherwise specified 
2876         to have no change on existing code, but this could be changed later. A smaller 
2877         default minCapacity would use less memory with small Vectors but spend more time 
2878         copying when expanding to large Vectors.
2879
2880 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
2881
2882         [Win] Deactivate WebGL until Windows tests work properly
2883         https://bugs.webkit.org/show_bug.cgi?id=144291
2884         <rdar://problem/20707307>
2885
2886         Reviewed by Zalan Bujtas.
2887
2888         * wtf/FeatureDefines.h: Force WebGL off for Windows builds.
2889
2890 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2891
2892         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
2893         https://bugs.webkit.org/show_bug.cgi?id=144193
2894
2895         Reviewed by Darin Adler.
2896
2897         * wtf/FeatureDefines.h:
2898         * wtf/Platform.h:
2899
2900 2015-04-22  Martin Robinson  <mrobinson@igalia.com>
2901
2902         [CMake] Autogenerate cmakeconfig.h.cmake
2903         https://bugs.webkit.org/show_bug.cgi?id=143997
2904
2905         Reviewed by Csaba Osztrogonác.
2906
2907         * wtf/Platform.h: Move a GTK-specific setting from cmakeconfig.h to here.
2908
2909 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
2910
2911         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
2912         https://bugs.webkit.org/show_bug.cgi?id=144182
2913
2914         Reviewed by Simon Fraser.
2915
2916         * wtf/FeatureDefines.h: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2917
2918 2015-04-24  Commit Queue  <commit-queue@webkit.org>
2919
2920         Unreviewed, rolling out r183288.
2921         https://bugs.webkit.org/show_bug.cgi?id=144189
2922
2923         Made js/sort-with-side-effecting-comparisons.html time out in
2924         debug builds (Requested by ap on #webkit).
2925
2926         Reverted changeset:
2927
2928         "It shouldn't take 1846 lines of code and 5 FIXMEs to sort an
2929         array."
2930         https://bugs.webkit.org/show_bug.cgi?id=144013
2931         http://trac.webkit.org/changeset/183288
2932
2933 2015-04-21  Geoffrey Garen  <ggaren@apple.com>
2934
2935         It shouldn't take 1846 lines of code and 5 FIXMEs to sort an array.
2936         https://bugs.webkit.org/show_bug.cgi?id=144013
2937
2938         Reviewed by Mark Lam.
2939
2940         Remove this custom tree implementation because it is unused. (It was
2941         previously used to achieve a stable array sort in certain cases.)
2942
2943         * WTF.vcxproj/WTF.vcxproj:
2944         * WTF.vcxproj/WTF.vcxproj.filters:
2945         * WTF.xcodeproj/project.pbxproj:
2946         * wtf/AVLTree.h: Removed.
2947         * wtf/CMakeLists.txt:
2948
2949 2015-04-24  Darin Adler  <darin@apple.com>
2950
2951         Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
2952         https://bugs.webkit.org/show_bug.cgi?id=128007
2953
2954         Reviewed by Anders Carlsson.
2955
2956         * WTF.vcxproj/WTF.vcxproj: Removed OwnPtr source files.
2957         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
2958         * WTF.xcodeproj/project.pbxproj: Ditto.
2959         * wtf/CMakeLists.txt: Ditto.
2960
2961         * wtf/Forward.h: Removed OwnPtr and PassOwnPtr.
2962         * wtf/HashTraits.h: Ditto.
2963
2964         * wtf/OwnPtr.h: Removed.
2965         * wtf/OwnPtrCommon.h: Removed.
2966         * wtf/PassOwnPtr.h: Removed.
2967
2968         * wtf/SizeLimits.cpp: Removed OwnPtr.
2969         * wtf/VectorTraits.h: Removed OwnPtr specialization.
2970
2971 2015-04-23  Jer Noble  <jer.noble@apple.com>
2972
2973         Disable HAVE_AVKIT on AppleTV
2974         https://bugs.webkit.org/show_bug.cgi?id=144142
2975
2976         Reviewed by Dan Bernstein.
2977
2978         * wtf/Platform.h:
2979
2980 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
2981
2982         [iOS] WebKit services should inherit environment variables for home
2983         https://bugs.webkit.org/show_bug.cgi?id=144078
2984         rdar://problem/20571678
2985
2986         Reviewed by Dan Bernstein.
2987
2988         * wtf/spi/darwin/XPCSPI.h: Added xpc_copy_bootstrap and xpc_dictionary_apply.
2989
2990 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
2991
2992         Undo the WTF part of the previous build fix, we don't use private headers in WTF.
2993
2994         * WTF.xcodeproj/project.pbxproj:
2995
2996 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
2997
2998         Build fix.
2999
3000         * WTF.xcodeproj/project.pbxproj: Make RAMSize.h a private header, now that it's used
3001         from outside WTF.
3002
3003 2015-04-23  Andreas Kling  <akling@apple.com>
3004
3005         There should only be one way to get the system memory size.
3006         <https://webkit.org/b/144081>
3007
3008         Reviewed by Antti Koivisto.
3009
3010         Merge all the logic from other RAM size fetcher helpers into WTF's.
3011
3012         Darwin ports now use host_info() instead of sysctl(), since that was the more common way
3013         of doing this.
3014
3015         Also bumped the fallback answer from 128 MB to 512 MB to bring it closer to today's hardware.
3016
3017         Finally, the number is rounded up to the next multiple of 128 MB, to avoid misunderstandings
3018         on some systems where the number returned by the kernel is slightly lower than the marketing
3019         number. Removed the "fudging" that was used in some places, since this fixes that cleanly.
3020
3021         * wtf/RAMSize.cpp:
3022         (WTF::computeRAMSize):
3023
3024 2015-04-22  Darin Adler  <darin@apple.com>
3025
3026         Eliminate remaining uses of OwnPtr and PassOwnPtr in WebCore outside the editing and platform directories
3027         https://bugs.webkit.org/show_bug.cgi?id=143949
3028
3029         Reviewed by Andreas Kling.
3030
3031         * wtf/MathExtras.h:
3032         (wtf_ceil): Deleted. This was a workaround for a bug that was introduced in Leopard and
3033         fixed in Snow Leopard <rdar://problem/6286405>, so we don't need the workaround any more.
3034
3035 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
3036
3037         [Mac] In nightlies and local builds, WebKit services can get terminated under memory pressure
3038         https://bugs.webkit.org/show_bug.cgi?id=144052
3039         rdar://problem/19754404
3040
3041         Build fix. Landing a forward declaration that should have been part of the original patch.
3042
3043         * wtf/spi/darwin/XPCSPI.h:
3044
3045 2015-04-21  Chris Dumez  <cdumez@apple.com>
3046
3047         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
3048         https://bugs.webkit.org/show_bug.cgi?id=143970
3049
3050         Reviewed by Darin Adler.
3051
3052         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
3053         constructor explicit as it copies the vector and it is easy to call it
3054         by mistake.
3055
3056         * wtf/RefCountedArray.h:
3057         (WTF::RefCountedArray::RefCountedArray):
3058         * wtf/Vector.h:
3059
3060 2015-04-21  Darin Adler  <darin@apple.com>
3061
3062         Remove some stray uses of OwnPtr and PassOwnPtr in WTF (outside of the template definitions and traits)
3063         https://bugs.webkit.org/show_bug.cgi?id=143944
3064
3065         Reviewed by Andreas Kling.
3066
3067         * wtf/FilePrintStream.h: Removed unneeded include.
3068         * wtf/HashTable.h: Fixed class template name in comment.
3069         * wtf/HashTraits.h: Removed unneeded forward declaration.
3070         * wtf/ListHashSet.h: Removed unneeded includes.
3071         * wtf/ThreadingWin.cpp: Removed unneeded includes.
3072         (WTF::wtfThreadEntryPoint): Changed code to use unique_ptr.
3073         (WTF::createThreadInternal): Changed code to use make_unique and release.
3074         * wtf/efl/RunLoopEfl.cpp: Removed unneeded includes.
3075
3076 2015-04-19  Darin Adler  <darin@apple.com>
3077
3078         Update RefPtr documentation and deprecation
3079         https://bugs.webkit.org/show_bug.cgi?id=143936
3080
3081         Reviewed by Andreas Kling.
3082
3083         * WTF.vcxproj/WTF.vcxproj: Removed PassRef.h
3084         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
3085         * WTF.xcodeproj/project.pbxproj: Ditto.
3086         * wtf/CMakeLists.txt: Ditto.
3087
3088 2015-04-17  Alexey Proskuryakov  <ap@apple.com>
3089
3090         Use ASan poisoning to taint moved-out-of Refs
3091         https://bugs.webkit.org/show_bug.cgi?id=143894
3092         rdar://problem/19443723
3093
3094         Reviewed by Darin Adler.
3095
3096         * wtf/Ref.h: (WTF::Ref::~Ref):
3097
3098 2015-04-17  Alexey Proskuryakov  <ap@apple.com>
3099
3100         Remove unused BoundsCheckedPointer
3101         https://bugs.webkit.org/show_bug.cgi?id=143896
3102
3103         Reviewed by Geoffrey Garen.
3104
3105         * WTF.vcxproj/WTF.vcxproj:
3106         * WTF.vcxproj/WTF.vcxproj.filters:
3107         * WTF.xcodeproj/project.pbxproj:
3108         * wtf/BoundsCheckedPointer.h: Removed.
3109         * wtf/CMakeLists.txt:
3110
3111 2015-04-16  Yusuke Suzuki  <utatane.tea@gmail.com>
3112
3113         [ES6] Implement Symbol.for and Symbol.keyFor
3114         https://bugs.webkit.org/show_bug.cgi?id=143404
3115
3116         Reviewed by Geoffrey Garen.
3117
3118         When we register symbolized StringImpl* into SymbolRegistry, symbolized StringImpl* is aware of that.
3119         And when destructing it, it removes its reference from SymbolRegistry as if atomic StringImpl do so with AtomicStringTable.
3120         While AtomicStringTable (in WebCore case) exists in thread local storage,
3121         SymbolRegistry exists per VM and StringImpl* has a reference to the registered SymbolRegistry.
3122
3123         Since StringImpl has isSymbol etc. members, it's class is aware of Symbol use cases.
3124         So introduce SymbolRegistry in WTF layers as if AtomicStringTable.
3125
3126         * WTF.vcxproj/WTF.vcxproj:
3127         * WTF.vcxproj/WTF.vcxproj.filters:
3128         * WTF.xcodeproj/project.pbxproj:
3129         * wtf/CMakeLists.txt:
3130         * wtf/text/AtomicString.cpp:
3131         (WTF::AtomicString::addSlowCase):
3132         (WTF::AtomicString::findSlowCase):
3133         (WTF::AtomicString::findInternal):
3134         (WTF::AtomicString::find): Deleted.
3135         * wtf/text/AtomicString.h:
3136         (WTF::AtomicString::find):
3137         * wtf/text/StringImpl.cpp:
3138         (WTF::StringImpl::~StringImpl):
3139         (WTF::StringImpl::createSymbol):
3140         (WTF::StringImpl::createSymbolEmpty):
3141         * wtf/text/StringImpl.h:
3142         (WTF::StringImpl::StringImpl):
3143         (WTF::StringImpl::extractFoldedStringInSymbol):
3144         (WTF::StringImpl::symbolRegistry):
3145         (WTF::StringImpl::createSymbolEmpty): Deleted.
3146         * wtf/text/SymbolRegistry.cpp: Copied from Source/JavaScriptCore/runtime/SymbolConstructor.h.
3147         (WTF::SymbolRegistry::~SymbolRegistry):
3148         (WTF::SymbolRegistry::symbolForKey):
3149         (WTF::SymbolRegistry::keyForSymbol):
3150         (WTF::SymbolRegistry::remove):
3151         * wtf/text/SymbolRegistry.h: Added.
3152         (WTF::SymbolRegistryKey::hash):
3153         (WTF::SymbolRegistryKey::impl):
3154         (WTF::SymbolRegistryKey::isHashTableDeletedValue):
3155         (WTF::SymbolRegistryKey::hashTableDeletedValue):
3156         (WTF::DefaultHash<SymbolRegistryKey>::Hash::hash):
3157         (WTF::DefaultHash<SymbolRegistryKey>::Hash::equal):
3158         (WTF::HashTraits<SymbolRegistryKey>::isEmptyValue):
3159         (WTF::SymbolRegistryKey::SymbolRegistryKey):
3160
3161 2015-04-16  Antti Koivisto  <antti@apple.com>
3162
3163         Use CommonCrypto for SHA1 and MD5
3164         https://bugs.webkit.org/show_bug.cgi?id=143826
3165
3166         Reviewed by Anders Carlsson.
3167
3168         CommonCrypto SHA1 implementation is ~4x faster than the naive WTF one. Use it when available.
3169
3170         These are covered by existing API tests.
3171
3172         * wtf/MD5.cpp:
3173         (WTF::MD5::MD5):
3174         (WTF::MD5::addBytes):
3175         (WTF::MD5::checksum):
3176         * wtf/MD5.h:
3177         * wtf/SHA1.cpp:
3178         (WTF::SHA1::SHA1):
3179         (WTF::SHA1::addBytes):
3180         (WTF::SHA1::computeHash):
3181
3182             Remove the side effect where computeHash resets the state. No one relies on it.
3183
3184         (WTF::SHA1::hexDigest):
3185         (WTF::SHA1::computeHexDigest):
3186         * wtf/SHA1.h:
3187
3188 2015-04-16  Csaba Osztrogonác  <ossy@webkit.org>
3189
3190         Remove the unnecessary WTF_CHANGES define
3191         https://bugs.webkit.org/show_bug.cgi?id=143825
3192
3193         Reviewed by Andreas Kling.
3194
3195         * config.h:
3196
3197 2015-04-15  Руслан Ижбулатов  <lrn1986@gmail.com>
3198
3199         Harmonize binary semaphore ifdefs
3200
3201         They should be either OS(WINDOWS) (in which case we'd need
3202         BinarySemaphoreWin.cpp, which is not shipped by WebKitGTK)
3203         or PLATFORM(WIN) (in which case Mutex/ThreadCondition-based
3204         implementation is used).
3205
3206         This fixes errors like:
3207           CXX      Source/WTF/wtf/threads/libWTF_la-BinarySemaphore.lo
3208         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In constructor 'WTF::BinarySemaphore::BinarySemaphore()':
3209         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:34:7: error: class 'WTF::BinarySemaphore' does not have any field named 'm_isSet'
3210              : m_isSet(false)
3211                ^
3212         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In member function 'void WTF::BinarySemaphore::signal()':
3213         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:44:24: error: 'm_mutex' was not declared in this scope
3214              MutexLocker locker(m_mutex);
3215                                 ^
3216         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:46:5: error: 'm_isSet' was not declared in this scope
3217              m_isSet = true;
3218              ^
3219         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:47:5: error: 'm_condition' was not declared in this scope
3220              m_condition.signal();
3221              ^
3222         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In member function 'bool WTF::BinarySemaphore::wait(double)':
3223         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:52:24: error: 'm_mutex' was not declared in this scope
3224              MutexLocker locker(m_mutex);
3225                                 ^
3226         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:55:13: error: 'm_isSet' was not declared in this scope
3227              while (!m_isSet) {
3228                      ^
3229         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:56:21: error: 'm_condition' was not declared in this scope
3230                  timedOut = !m_condition.timedWait(m_mutex, absoluteTime);
3231                              ^
3232         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:62:5: error: 'm_isSet' was not declared in this scope
3233              m_isSet = false;
3234              ^
3235         GNUmakefile:52762: recipe for target 'Source/WTF/wtf/threads/libWTF_la-BinarySemaphore.lo' failed
3236
3237         [W32] Inconsistent ifdefs in BinarySemaphore.h and BinarySemaphore.cpp
3238         https://bugs.webkit.org/show_bug.cgi?id=143756
3239
3240         Reviewed by Darin Adler.
3241
3242         * wtf/threads/BinarySemaphore.h:
3243
3244 2015-04-12  Michael Catanzaro  <mcatanzaro@igalia.com>
3245
3246         Fix -Wparentheses warning with GCC 5 in SaturatedArithmetic.h
3247         https://bugs.webkit.org/show_bug.cgi?id=143457
3248
3249         Reviewed by Benjamin Poulain.
3250
3251         Tested by WTF.SaturatedArithmeticAddition and WTF.SaturatedArithmeticSubtraction.
3252
3253         * wtf/SaturatedArithmetic.h:
3254         (signedAddOverflows): Use && instead of & to avoid triggering -Wparentheses in newer
3255         versions of GCC and Clang, and to improve the clarity of the function.
3256         (signedSubtractOverflows): Changed correspondingly, although there was no warning here.
3257
3258 2015-04-08  Sam Weinig  <sam@webkit.org>
3259
3260         Allow LaunchServices to handle URLs on link navigations
3261         <rdar://problem/19446826>
3262         https://bugs.webkit.org/show_bug.cgi?id=143544
3263
3264         Reviewed by Anders Carlsson.
3265
3266         * wtf/Platform.h:
3267         Add HAVE macro for this functionality.
3268
3269 2015-04-09  Andy Estes  <aestes@apple.com>
3270
3271         [Cocoa] Add a HAVE(AVKIT) and use it
3272         https://bugs.webkit.org/show_bug.cgi?id=143593
3273
3274         Reviewed by David Kilzer.
3275
3276         * wtf/Platform.h: Defined HAVE(AVKIT) to be true on all Cocoa platforms except Watch OS.
3277
3278 2015-04-09  Andy Estes  <aestes@apple.com>
3279
3280         [Content Filtering] Add a HAVE(PARENTAL_CONTROLS) and use it
3281         https://bugs.webkit.org/show_bug.cgi?id=143559
3282
3283         Reviewed by David Kilzer.
3284
3285         Added PLATFORM(WATCHOS). Used PLATFORM() since Watch OS is just a variant of OS(IOS).
3286         Defined HAVE(PARENTAL_CONTROLS) to be true on all Cocoa platforms except Watch OS.
3287
3288         * wtf/Platform.h:
3289
3290 2015-04-08  Alex Christensen  <achristensen@webkit.org> and Patrick Gansterer  <paroga@webkit.org>
3291
3292         Add CMake build system for WinCairo port.
3293         https://bugs.webkit.org/show_bug.cgi?id=115944
3294
3295         Reviewed by Chris Dumez.
3296
3297         * wtf/FeatureDefines.h:
3298         * wtf/PlatformWin.cmake:
3299
3300 2015-04-05  Antti Koivisto  <antti@apple.com>
3301
3302         Bloom filter should support longer hashes
3303         https://bugs.webkit.org/show_bug.cgi?id=143419
3304
3305         Reviewed by Dan Bernstein.
3306
3307         It currently supports 'unsigned' hash only which is inconvenient and doesn't have enough independent bits for larger filters.
3308
3309         Support arbitrarily sized hashes of type std::array<uint8_t, hashSize> (like SHA1::Digest and MD5::Digest).
3310
3311         * wtf/BloomFilter.h:
3312         (WTF::BloomFilter<keyBits>::keysFromHash):
3313         (WTF::BloomFilter<keyBits>::mayContain):
3314         (WTF::BloomFilter<keyBits>::add):
3315
3316 2015-04-03  Antti Koivisto  <antti@apple.com>
3317
3318         Add non-counting Bloom filter implementation
3319         https://bugs.webkit.org/show_bug.cgi?id=143366
3320
3321         Reviewed by Sam Weinig.
3322
3323         Add a traditional single-bit-per-bucket Bloom filter in addition to the existing counting implementation.
3324
3325         - rename BloomFilter -> CountingBloomFilter.
3326         - add a new basic BloomFilter type.
3327         - update some terminology to match http://en.wikipedia.org/wiki/Bloom_filter and modernize the code a bit.
3328         - add API tests.
3329
3330         * wtf/BloomFilter.h:
3331         (WTF::BloomFilter::BloomFilter):
3332         (WTF::BloomFilter::add):
3333
3334             Also support merging.
3335
3336         (WTF::BloomFilter::mayContain):
3337         (WTF::BloomFilter::arrayIndex):
3338         (WTF::BloomFilter::bitMask):
3339         (WTF::BloomFilter<keyBits>::mayContain):
3340         (WTF::BloomFilter<keyBits>::add):
3341         (WTF::BloomFilter<keyBits>::isBitSet):
3342         (WTF::BloomFilter<keyBits>::setBit):
3343         (WTF::BloomFilter<keyBits>::clear):
3344         (WTF::CountingBloomFilter::CountingBloomFilter):
3345         (WTF::CountingBloomFilter::mayContain):
3346         (WTF::CountingBloomFilter::firstBucket):
3347         (WTF::CountingBloomFilter::secondBucket):
3348         (WTF::CountingBloomFilter<keyBits>::add):
3349         (WTF::CountingBloomFilter<keyBits>::remove):
3350         (WTF::CountingBloomFilter<keyBits>::clear):
3351         (WTF::CountingBloomFilter<keyBits>::likelyEmpty):
3352         (WTF::CountingBloomFilter<keyBits>::isClear):
3353         (WTF::BloomFilter::maximumCount): Deleted.
3354         (WTF::BloomFilter::firstSlot): Deleted.
3355         (WTF::BloomFilter::secondSlot): Deleted.
3356         (WTF::BloomFilter<keyBits>::remove): Deleted.
3357         (WTF::BloomFilter<keyBits>::likelyEmpty): Deleted.
3358         (WTF::BloomFilter<keyBits>::isClear): Deleted.
3359
3360 015-04-01  Antti Koivisto  <antti@apple.com>
3361
3362         Value assignment operator of Optional should be stricter
3363         https://bugs.webkit.org/show_bug.cgi?id=143303
3364
3365         Reviewed by Andreas Kling.
3366
3367         struct Foo { mutable Optional<std::chrono::seconds> s; };
3368         Foo foo, foo2;
3369         foo = foo2;
3370
3371         doesn't build because it tries to use wrong operator=.
3372
3373         * wtf/Optional.h:
3374
3375             Add enable_if test similar to std::experimental::optional.
3376
3377 2015-04-01  Alex Christensen  <achristensen@webkit.org>
3378
3379         Progress towards CMake on Windows and Mac.
3380         https://bugs.webkit.org/show_bug.cgi?id=143293
3381
3382         Reviewed by Filip Pizlo.
3383
3384         * wtf/CMakeLists.txt:
3385         Don't use bmalloc on Windows yet.
3386         * wtf/FeatureDefines.h:
3387         Temporarily disabled WebGL on Windows CMake builds.
3388         * wtf/PlatformMac.cmake:
3389         Tell open source builders where to find unicode headers.
3390
3391 2015-03-31  Alexey Proskuryakov  <ap@apple.com>
3392
3393         Fix the build after <http://trac.webkit.org/changeset/182205>.
3394
3395         * wtf/text/StringImpl.h: (WTF::StringImpl::extractFoldedStringInSymbol):
3396         A function cannot be both exported and inline.
3397
3398 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
3399
3400         Clean up Identifier factories to clarify the meaning of StringImpl*
3401         https://bugs.webkit.org/show_bug.cgi?id=143146
3402
3403         Reviewed by Filip Pizlo.
3404
3405         Introduce StringKind into `StringImpl`. There's 3 kinds
3406         1. StringNormal (non-atomic, non-symbol)
3407         2. StringAtomic (atomic, non-symbol)
3408         3. StringSymbol (non-atomic, symbol)
3409         They are mutually exclusive.
3410
3411         * wtf/text/AtomicString.cpp:
3412         (WTF::AtomicString::addSlowCase):
3413         (WTF::AtomicString::findSlowCase):
3414         When registering a string into AtomicStringTable,
3415         it should not be a symbol string
3416         because symbol and atomic types are mutually exclusive.
3417         When a symbol string comes, we extract an owner string
3418         from a symbol string by using `StringImpl::extractFoldedStringInSymbol()`.
3419         It always succeeds because a symbol (non empty) string
3420         is always BufferSubstring and has an owner string.
3421         Empty symbol string doesn't have an owner string.
3422         This case is filtered by `!string.length()` guard.
3423         * wtf/text/AtomicString.h:
3424         (WTF::AtomicString::add):
3425         (WTF::AtomicString::addWithStringTableProvider):
3426         * wtf/text/StringImpl.cpp:
3427         (WTF::StringImpl::~StringImpl):
3428         (WTF::StringImpl::createSymbol):
3429         (WTF::StringImpl::createUnique): Deleted.
3430         * wtf/text/StringImpl.h:
3431         (WTF::StringImpl::StringImpl):
3432         (WTF::StringImpl::createSymbolEmpty):
3433         (WTF::StringImpl::flagIsAtomic):
3434         (WTF::StringImpl::flagIsSymbol):
3435         (WTF::StringImpl::maskStringKind):
3436         (WTF::StringImpl::stringKind):
3437         (WTF::StringImpl::isSymbol):
3438         (WTF::StringImpl::isAtomic):
3439         (WTF::StringImpl::setIsAtomic):
3440         (WTF::StringImpl::extractFoldedStringInSymbol):
3441         (WTF::StringImpl::createUniqueEmpty): Deleted.
3442         (WTF::StringImpl::flagIsUnique): Deleted.
3443         (WTF::StringImpl::isUnique): Deleted.
3444         * wtf/text/StringStatics.cpp:
3445         (WTF::StringImpl::hashAndFlagsForSymbol):
3446         (WTF::StringImpl::hashAndFlagsForUnique): Deleted.
3447
3448 2015-03-30  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3449
3450         [CMake][EFL] Remove redundant library link and include path
3451         https://bugs.webkit.org/show_bug.cgi?id=143221
3452
3453         Reviewed by Csaba Osztrogonác.
3454
3455         * wtf/PlatformEfl.cmake: Remove unnecessary library link and include path.
3456
3457 2015-03-27  Myles C. Maxfield  <mmaxfield@apple.com>
3458
3459         Support building WTF on Windows without Cygwin
3460         https://bugs.webkit.org/show_bug.cgi?id=143084
3461
3462         Reviewed by Brent Fulgham.
3463
3464         Windows doesn't have "touch".
3465
3466         * WTF.vcxproj/WTFGenerated.make:
3467
3468 2015-03-26  Alex Christensen  <achristensen@webkit.org>
3469
3470         Progress towards CMake on Mac.
3471         https://bugs.webkit.org/show_bug.cgi?id=143112
3472
3473         Reviewed by Chris Dumez.
3474
3475         * wtf/PlatformMac.cmake:
3476
3477 2015-03-25  Filip Pizlo  <fpizlo@apple.com>
3478
3479         Unreviewed, we have edited this file in 2015.
3480
3481         * wtf/Platform.h:
3482
3483 2015-03-25  Filip Pizlo  <fpizlo@apple.com>
3484
3485         Heap variables shouldn't end up in the stack frame
3486         https://bugs.webkit.org/show_bug.cgi?id=141174
3487
3488         Reviewed by Geoffrey Garen.
3489
3490         * wtf/FastBitVector.h:
3491         (WTF::FastBitVector::resize): Small change: don't resize if you don't have to resize.
3492
3493 2015-03-25  Filip Pizlo  <fpizlo@apple.com>
3494
3495         Change Atomic methods from using the_wrong_naming_conventions to using theRightNamingConventions. Also make seq_cst the default.
3496
3497         Rubber stamped by Geoffrey Garen.
3498
3499         * wtf/Atomics.h:
3500         (WTF::Atomic::load):
3501         (WTF::Atomic::store):
3502         (WTF::Atomic::compareExchangeWeak):
3503         (WTF::Atomic::compareExchangeStrong):
3504         (WTF::Atomic::compare_exchange_weak): Deleted.
3505         (WTF::Atomic::compare_exchange_strong): Deleted.
3506         * wtf/ByteSpinLock.h:
3507         (WTF::ByteSpinLock::lock):
3508         * wtf/SpinLock.h:
3509         (WTF::SpinLockBase::lock):
3510
3511 2015-03-24  Beth Dakin  <bdakin@apple.com>
3512
3513         Add events related to force click gesture
3514         https://bugs.webkit.org/show_bug.cgi?id=142836
3515         -and corresponding-
3516         rdar://problem/20210239
3517
3518         Reviewed by Dean Jackson.
3519
3520         New enable flag for the events.
3521         * wtf/FeatureDefines.h:
3522
3523 2015-03-23  Filip Pizlo  <fpizlo@apple.com>
3524
3525         JSC should have a low-cost asynchronous disassembler
3526         https://bugs.webkit.org/show_bug.cgi?id=142997
3527
3528         Reviewed by Mark Lam.
3529
3530         * wtf/StringPrintStream.h:
3531
3532 2015-03-22  Benjamin Poulain  <benjamin@webkit.org>
3533
3534         CSS Selectors: fix attribute case-insensitive matching of Contain and List
3535         https://bugs.webkit.org/show_bug.cgi?id=142932
3536
3537         Reviewed by Darin Adler.
3538
3539         Add some utility functions to the string classes to find substrings
3540         using ASCII case-insensitive comparisons.
3541
3542         * wtf/text/AtomicString.h:
3543         (WTF::AtomicString::contains):
3544         Add the light version that only lock one register.
3545
3546         (WTF::AtomicString::containsIgnoringASCIICase):
3547         (WTF::AtomicString::findIgnoringASCIICase):
3548
3549         * wtf/text/StringCommon.h:
3550         (WTF::findIgnoringASCIICase):
3551         This is the common implementation used by StringView and StringImpl.
3552
3553         * wtf/text/StringImpl.cpp:
3554         (WTF::StringImpl::findIgnoringASCIICase):
3555         * wtf/text/StringImpl.h:
3556         * wtf/text/StringView.cpp:
3557         (WTF::StringView::containsIgnoringASCIICase):
3558         (WTF::StringView::findIgnoringASCIICase):
3559         * wtf/text/StringView.h:
3560         * wtf/text/WTFString.h:
3561         (WTF::String::findIgnoringASCIICase):
3562         (WTF::String::contains):
3563         (WTF::String::containsIgnoringASCIICase):
3564
3565 2015-03-19  Andreas Kling  <akling@apple.com>
3566
3567         DFGAllocator should use bmalloc's aligned allocator.
3568         <https://webkit.org/b/142871>
3569
3570         Reviewed by Geoffrey Garen.
3571
3572         Remove PageAllocationAligned since it has no more clients.
3573
3574         * WTF.vcxproj/WTF.vcxproj:
3575         * WTF.vcxproj/WTF.vcxproj.filters:
3576         * WTF.xcodeproj/project.pbxproj:
3577         * wtf/CMakeLists.txt:
3578         * wtf/PageAllocationAligned.cpp: Removed.
3579         * wtf/PageAllocationAligned.h: Removed.
3580
3581 2015-03-18  Dhi Aurrahman  <diorahman@rockybars.com>
3582
3583         Fix StringView misplaced implementations after r181525 and r181558
3584         https://bugs.webkit.org/show_bug.cgi?id=142772
3585
3586         Reviewed by Darin Adler.
3587
3588         Fix misplaced implementations in StringView::startsWithIgnoringASCIICase and 
3589         StringView::endsWith. 
3590
3591         Add some tests in [1] to cover the StringView::startsWith, 
3592         StringView::startsWithIgnoringASCIICase, StringView::endsWith and 
3593         StringView::endsWithIgnoringASCIICase implementations.
3594
3595         [1] Tools/TestWebKitAPI/Tests/WTF/StringView.cpp.
3596
3597         * wtf/text/StringView.cpp: