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