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