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