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