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