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