Rename the source files for the WTF persistent coders.
[WebKit.git] / Source / WTF / ChangeLog
1 2017-08-10  Brady Eidson  <beidson@apple.com>
2
3         Rename the source files for the WTF persistent coders.
4         https://bugs.webkit.org/show_bug.cgi?id=175441
5
6         Reviewed by Tim Horton.
7
8         * WTF.xcodeproj/project.pbxproj:
9         * wtf/CMakeLists.txt:
10
11         * wtf/persistence/PersistentCoder.h: Renamed from Source/WTF/wtf/persistence/Coder.h.
12         * wtf/persistence/PersistentCoders.cpp: Renamed from Source/WTF/wtf/persistence/Coders.cpp.
13         * wtf/persistence/PersistentCoders.h: Renamed from Source/WTF/wtf/persistence/Coders.h.
14         * wtf/persistence/PersistentDecoder.cpp: Renamed from Source/WTF/wtf/persistence/Decoder.cpp.
15         * wtf/persistence/PersistentDecoder.h: Renamed from Source/WTF/wtf/persistence/Decoder.h.
16         * wtf/persistence/PersistentEncoder.cpp: Renamed from Source/WTF/wtf/persistence/Encoder.cpp.
17         * wtf/persistence/PersistentEncoder.h: Renamed from Source/WTF/wtf/persistence/Encoder.h.
18
19 2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
20
21         Unreviewed, attempt to fix build failure with VC2017
22
23         * wtf/PriorityQueue.h:
24
25 2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
26
27         Run more WTF tests
28         https://bugs.webkit.org/show_bug.cgi?id=174970
29
30         Reviewed by Michael Catanzaro.
31
32         CHAR_BIT is not defined.
33
34         * wtf/LEBDecoder.h:
35
36 2017-08-09  Yusuke Suzuki  <utatane.tea@gmail.com>
37
38         [WTF] ThreadSpecific should not introduce additional indirection
39         https://bugs.webkit.org/show_bug.cgi?id=175187
40
41         Reviewed by Mark Lam.
42
43         ThreadSpecific sets Data* to the TLS. And Data holds T*, which
44         is fast allocated actual data. But ideally, we should store T
45         instance directly in Data instead of introducing an additional
46         indirection.
47
48         This patch adds storage in Data in order to embed the instance of T. The constructor
49         for Data will invoke the constructor for T on the embedded storage. We also drop
50         ThreadSpecific::replace which is only used by the web thread to set its thread specific
51         ThreadGlobalData to the one shared from the main thread. The existing implementation
52         relies on the main thread and the web thread never exiting in order for the shared
53         ThreadGlobalData to stay alive. We can achieve the same semantics by using a
54         ThreadSpecific<std::unique_ptr<T>> to hold the ThreadGlobalData instance instead.
55
56         * wtf/ThreadSpecific.h:
57         (WTF::ThreadSpecific::Data::construct):
58         (WTF::ThreadSpecific::Data::Data):
59         We make it fast allocated since we previously allocated ThreadSpecific T data by fastMalloc.
60
61         (WTF::ThreadSpecific::Data::~Data):
62         (WTF::ThreadSpecific::Data::storagePointer const):
63         (WTF::canBeGCThread>::get):
64         We also drop RELEASE_ASSERT from ::get(). We already inserted this assert to setAndConstruct(),
65         so when creating the member to this TLS, we execute this release assert. So it is
66         not necessary to execute this assertion every time we get data from this TLS.
67
68         (WTF::canBeGCThread>::set):
69         (WTF::canBeGCThread>::destroy):
70         (WTF::canBeGCThread>::setAndConstruct):
71         (WTF::T):
72         (WTF::canBeGCThread>::replace): Deleted.
73
74 2017-08-10  Tim Horton  <timothy_horton@apple.com>
75
76         Fix a silly typo in Compiler.h
77
78         * wtf/Compiler.h:
79         Heature, indeed.
80
81 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
82
83         Remove ENABLE_GAMEPAD_DEPRECATED
84         https://bugs.webkit.org/show_bug.cgi?id=175361
85
86         Reviewed by Carlos Garcia Campos.
87
88         * wtf/FeatureDefines.h:
89
90 2017-08-09  Don Olmstead  <don.olmstead@sony.com>
91
92         [WTF] Move TextStream into WTF
93         https://bugs.webkit.org/show_bug.cgi?id=175211
94
95         Reviewed by Myles C. Maxfield.
96
97         * WTF.xcodeproj/project.pbxproj:
98         * wtf/CMakeLists.txt:
99         * wtf/text/TextStream.cpp: Renamed from Source/WebCore/platform/text/TextStream.cpp.
100         (WTF::TextStream::writeIndent):
101         * wtf/text/TextStream.h: Renamed from Source/WebCore/platform/text/TextStream.h.
102         (WTF::TextStream::FormatNumberRespectingIntegers::FormatNumberRespectingIntegers):
103
104 2017-08-09  Commit Queue  <commit-queue@webkit.org>
105
106         Unreviewed, rolling out r220466, r220477, and r220487.
107         https://bugs.webkit.org/show_bug.cgi?id=175411
108
109         This change broke existing API tests and follow up fixes did
110         not resolve all the issues. (Requested by ryanhaddad on
111         #webkit).
112
113         Reverted changesets:
114
115         https://bugs.webkit.org/show_bug.cgi?id=175244
116         http://trac.webkit.org/changeset/220466
117
118         "WTF::Function does not allow for reference / non-default
119         constructible return types"
120         https://bugs.webkit.org/show_bug.cgi?id=175244
121         http://trac.webkit.org/changeset/220477
122
123         https://bugs.webkit.org/show_bug.cgi?id=175244
124         http://trac.webkit.org/changeset/220487
125
126 2017-08-09  Sam Weinig  <sam@webkit.org>
127
128         WTF::Function does not allow for reference / non-default constructible return types
129         https://bugs.webkit.org/show_bug.cgi?id=175244
130
131         Reviewed by Chris Dumez.
132
133         When Function, then NoncopyableFunction, was templatized to allow non-void return values
134         in r201493, it maintained the behavior of being callable even if the Function was null.
135         To accomplish this, when null, the default construction of the return parameter was used.
136         This means Function can't be used with return types that are not default constructible,
137         such as reference types and Ref.
138
139         This behavior of returning something when null is surprising, as this is not how normal
140         functions behave, and not very useful. Instead, we now assert that the function is not
141         null when being called.
142
143         * wtf/Function.h:
144         (WTF::Function operator(...)):
145         Instead of allowing a null callable wrapper by returning the default construction of
146         the return type, assert that the wrapper is there when calling a Function.
147
148 2017-08-09  Ryan Haddad  <ryanhaddad@apple.com>
149
150         Unreviewed, rolling out r220457.
151
152         This change introduced API test failures.
153
154         Reverted changeset:
155
156         "WTF::Function does not allow for reference / non-default
157         constructible return types"
158         https://bugs.webkit.org/show_bug.cgi?id=175244
159         http://trac.webkit.org/changeset/220457
160
161 2017-08-09  Sam Weinig  <sam@webkit.org>
162
163         WTF::Function does not allow for reference / non-default constructible return types
164         https://bugs.webkit.org/show_bug.cgi?id=175244
165
166         Reviewed by Chris Dumez.
167
168         When Function, then NoncopyableFunction, was templatized to allow non-void return values
169         in r201493, it maintained the behavior of being callable even if the Function was null.
170         To accomplish this, when null, the default construction of the return parameter was used.
171         This means Function can't be used with return types that are not default constructible,
172         such as reference types and Ref.
173
174         This behavior of returning something when null is surprising, as this is not how normal
175         functions behave, and not very useful. Instead, we now assert that the function is not
176         null when being called.
177
178         * wtf/Function.h:
179         (WTF::Function operator(...)):
180         Instead of allowing a null callable wrapper by returning the default construction of
181         the return type, assert that the wrapper is there when calling a Function.
182
183 2017-08-08  Filip Pizlo  <fpizlo@apple.com>
184
185         Baseline JIT should do caging
186         https://bugs.webkit.org/show_bug.cgi?id=175037
187
188         Reviewed by Mark Lam.
189
190         * wtf/Gigacage.h:
191         (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
192         (Gigacage::isDisablingPrimitiveGigacageDisabled):
193         (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
194         (Gigacage::canPrimitiveGigacageBeDisabled):
195         (Gigacage::basePtr):
196
197 2017-08-08  Ryan Haddad  <ryanhaddad@apple.com>
198
199         Unreviewed, rolling out r220368.
200
201         This change caused WK1 tests to exit early with crashes.
202
203         Reverted changeset:
204
205         "Baseline JIT should do caging"
206         https://bugs.webkit.org/show_bug.cgi?id=175037
207         http://trac.webkit.org/changeset/220368
208
209 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
210
211         [CMake] Properly test if compiler supports compiler flags
212         https://bugs.webkit.org/show_bug.cgi?id=174490
213
214         Reviewed by Konstantin Tokarev.
215
216         * wtf/Compiler.h:
217
218 2017-08-07  Filip Pizlo  <fpizlo@apple.com>
219
220         Baseline JIT should do caging
221         https://bugs.webkit.org/show_bug.cgi?id=175037
222
223         Reviewed by Mark Lam.
224
225         * wtf/Gigacage.h:
226         (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
227         (Gigacage::isDisablingPrimitiveGigacageDisabled):
228         (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
229         (Gigacage::canPrimitiveGigacageBeDisabled):
230
231 2017-08-07  Filip Pizlo  <fpizlo@apple.com>
232
233         Unreviewed, try to fix Windows build.
234
235         * wtf/Gigacage.cpp:
236         * wtf/Gigacage.h:
237
238 2017-08-06  Filip Pizlo  <fpizlo@apple.com>
239
240         Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
241         https://bugs.webkit.org/show_bug.cgi?id=174919
242
243         Reviewed by Keith Miller.
244         
245         This mirrors the changes from bmalloc/Gigacage.h.
246         
247         Also it teaches CagedPtr how to reason about multiple gigacages.
248
249         * wtf/CagedPtr.h:
250         (WTF::CagedPtr::get const):
251         (WTF::CagedPtr::operator[] const):
252         * wtf/Gigacage.cpp:
253         (Gigacage::tryMalloc):
254         (Gigacage::tryAllocateVirtualPages):
255         (Gigacage::freeVirtualPages):
256         (Gigacage::tryAlignedMalloc):
257         (Gigacage::alignedFree):
258         (Gigacage::free):
259         * wtf/Gigacage.h:
260         (Gigacage::disablePrimitiveGigacage):
261         (Gigacage::addPrimitiveDisableCallback):
262         (Gigacage::removePrimitiveDisableCallback):
263         (Gigacage::name):
264         (Gigacage::basePtr):
265         (Gigacage::caged):
266         (Gigacage::isCaged):
267         (Gigacage::tryAlignedMalloc):
268         (Gigacage::alignedFree):
269         (Gigacage::free):
270         (Gigacage::disableGigacage): Deleted.
271         (Gigacage::addDisableCallback): Deleted.
272         (Gigacage::removeDisableCallback): Deleted.
273
274 2017-08-07  Brian Burg  <bburg@apple.com>
275
276         Remove CANVAS_PATH compilation guard
277         https://bugs.webkit.org/show_bug.cgi?id=175207
278
279         Reviewed by Sam Weinig.
280
281         * wtf/FeatureDefines.h:
282
283 2017-08-05  Filip Pizlo  <fpizlo@apple.com>
284
285         REGRESSION (r219895-219897): Number of leaks on Open Source went from 9240 to 235983 and is now at 302372
286         https://bugs.webkit.org/show_bug.cgi?id=175083
287
288         Reviewed by Oliver Hunt.
289         
290         Adds a classic ReadWriteLock class. I wrote my own because I can never remember if the pthread one is
291         guaranted to bias in favor of writers or not.
292
293         * WTF.xcodeproj/project.pbxproj:
294         * wtf/Condition.h:
295         (WTF::ConditionBase::construct):
296         (WTF::Condition::Condition):
297         * wtf/Lock.h:
298         (WTF::LockBase::construct):
299         (WTF::Lock::Lock):
300         * wtf/ReadWriteLock.cpp: Added.
301         (WTF::ReadWriteLockBase::construct):
302         (WTF::ReadWriteLockBase::readLock):
303         (WTF::ReadWriteLockBase::readUnlock):
304         (WTF::ReadWriteLockBase::writeLock):
305         (WTF::ReadWriteLockBase::writeUnlock):
306         * wtf/ReadWriteLock.h: Added.
307         (WTF::ReadWriteLockBase::ReadLock::tryLock):
308         (WTF::ReadWriteLockBase::ReadLock::lock):
309         (WTF::ReadWriteLockBase::ReadLock::unlock):
310         (WTF::ReadWriteLockBase::WriteLock::tryLock):
311         (WTF::ReadWriteLockBase::WriteLock::lock):
312         (WTF::ReadWriteLockBase::WriteLock::unlock):
313         (WTF::ReadWriteLockBase::read):
314         (WTF::ReadWriteLockBase::write):
315         (WTF::ReadWriteLock::ReadWriteLock):
316
317 2017-08-04  Matt Lewis  <jlewis3@apple.com>
318
319         Unreviewed, rolling out r220271.
320
321         Rolling out due to Layout Test failing on iOS Simulator.
322
323         Reverted changeset:
324
325         "Remove STREAMS_API compilation guard"
326         https://bugs.webkit.org/show_bug.cgi?id=175165
327         http://trac.webkit.org/changeset/220271
328
329 2017-08-04  Youenn Fablet  <youenn@apple.com>
330
331         Remove STREAMS_API compilation guard
332         https://bugs.webkit.org/show_bug.cgi?id=175165
333
334         Reviewed by Darin Adler.
335
336         * wtf/FeatureDefines.h:
337
338 2017-08-03  Brian Burg  <bburg@apple.com>
339
340         Remove ENABLE(WEB_SOCKET) guards
341         https://bugs.webkit.org/show_bug.cgi?id=167044
342
343         Reviewed by Joseph Pecoraro.
344
345         * wtf/FeatureDefines.h:
346
347 2017-08-03  Youenn Fablet  <youenn@apple.com>
348
349         Remove FETCH_API compilation guard
350         https://bugs.webkit.org/show_bug.cgi?id=175154
351
352         Reviewed by Chris Dumez.
353
354         * wtf/FeatureDefines.h:
355
356 2017-08-03  Brady Eidson  <beidson@apple.com>
357
358         Add SW IDLs and stub out basic functionality.
359         https://bugs.webkit.org/show_bug.cgi?id=175115
360
361         Reviewed by Chris Dumez.
362
363         * wtf/FeatureDefines.h:
364
365 2017-08-03  Yusuke Suzuki  <utatane.tea@gmail.com>
366
367         Unreviewed, build fix for Windows port
368         https://bugs.webkit.org/show_bug.cgi?id=175013
369
370         * wtf/Threading.h:
371
372 2017-08-03  Yusuke Suzuki  <utatane.tea@gmail.com>
373
374         Merge ThreadHolder to WTF::Thread itself
375         https://bugs.webkit.org/show_bug.cgi?id=175013
376
377         Reviewed by Mark Lam.
378
379         Currently, we store ThreadHolder* to the TLS, and ThreadHolder* holds Ref<Thread>.
380         When we get Thread& from the current thread TLS, we need to dereference the ThreadHolder*.
381         However, ideally, we can store Thread* directly to the current thread TLS.
382         While the ThreadHolder design is beautiful, it's worth optimizing by storing Thread* directly
383         since Thread::current() is so frequently executed.
384
385         This patch merges ThreadHolder to Thread. And we now store Thread* directly in the TLS.
386         When storing it to TLS, we call leakRef() to keep Thread ref count incremented by the TLS.
387         And when destroying the TLS, we call `deref()` to ensure that Thread* is dereferenced from
388         the TLS.
389
390         * WTF.xcodeproj/project.pbxproj:
391         * wtf/CMakeLists.txt:
392         * wtf/ThreadHolder.cpp: Removed.
393         * wtf/ThreadHolder.h: Removed.
394         * wtf/ThreadHolderPthreads.cpp: Removed.
395         * wtf/ThreadHolderWin.cpp: Removed.
396         * wtf/Threading.cpp:
397         (WTF::Thread::entryPoint):
398         (WTF::initializeThreading):
399         * wtf/Threading.h:
400         (WTF::Thread::currentMayBeNull):
401         (WTF::Thread::current):
402         * wtf/ThreadingPthreads.cpp:
403         (WTF::Thread::waitForCompletion):
404         (WTF::Thread::initializeCurrentTLS):
405         (WTF::Thread::initializeTLSKey):
406         (WTF::Thread::initializeTLS):
407         (WTF::Thread::destructTLS):
408         (WTF::Thread::createCurrentThread): Deleted.
409         * wtf/ThreadingWin.cpp:
410         (WTF::Thread::initializeCurrentTLS):
411         (WTF::threadMapMutex):
412         (WTF::Thread::initializeTLSKey):
413         (WTF::Thread::currentDying):
414         (WTF::Thread::get):
415         (WTF::Thread::initializeTLS):
416         (WTF::Thread::destructTLS):
417         (WTF::waitForThreadCompletion):
418         (WTF::Thread::createCurrentThread): Deleted.
419
420 2017-08-03  Yusuke Suzuki  <utatane.tea@gmail.com>
421
422         [Linux][WTF] Use one global semaphore to notify thread suspend and resume completion
423         https://bugs.webkit.org/show_bug.cgi?id=175124
424
425         Reviewed by Carlos Garcia Campos.
426
427         POSIX sem_t is used to notify thread suspend and resume completion in Linux ports
428         since sem_post is async-signal-safe function. Since we guard suspend() and resume()
429         with one global lock, this semaphore is also guarded by this lock. So we do not need
430         to have semaphore per WTF::Thread.
431
432         This patch introduces one global Semaphore. And drop per thread semaphore.
433
434         * wtf/Threading.h:
435         * wtf/ThreadingPthreads.cpp:
436         (WTF::Thread::~Thread):
437         (WTF::Semaphore::Semaphore):
438         (WTF::Semaphore::~Semaphore):
439         (WTF::Semaphore::wait):
440         (WTF::Semaphore::post):
441         (WTF::Thread::signalHandlerSuspendResume):
442         (WTF::Thread::initializePlatformThreading):
443         (WTF::Thread::suspend):
444         (WTF::Thread::resume):
445         (WTF::Thread::Thread): Deleted.
446         * wtf/ThreadingWin.cpp:
447         (WTF::Thread::Thread): Deleted.
448
449 2017-08-03  Yusuke Suzuki  <utatane.tea@gmail.com>
450
451         [Linux][WTF] Reduce sizeof(WTF::Thread) by using a pointer to PlatformRegisters
452         https://bugs.webkit.org/show_bug.cgi?id=175119
453
454         Reviewed by Carlos Garcia Campos.
455
456         sizeof(PlatformRegisters) is so large. In my Linux box, it is 256. It enlarges the sizeof(WTF::Thread).
457         However, it is not necessary to hold it in WTF::Thread member. Thread's ucontext data and its stack is
458         effective while suspending the thread. So, we can just use the pointer to the PlatformRegister instead
459         of copying it to the member of the WTF::Thread.
460
461         * wtf/Threading.h:
462         * wtf/ThreadingPthreads.cpp:
463         (WTF::Thread::signalHandlerSuspendResume):
464         (WTF::Thread::getRegisters):
465
466 2017-08-02  Yusuke Suzuki  <utatane.tea@gmail.com>
467
468         Unreviewed, build fix for Windows port
469         https://bugs.webkit.org/show_bug.cgi?id=174716
470
471         This ugliness will be fixed in https://bugs.webkit.org/show_bug.cgi?id=175013.
472
473         * wtf/ThreadHolder.h:
474         * wtf/Threading.h:
475
476 2017-08-02  Yusuke Suzuki  <utatane.tea@gmail.com>
477
478         Merge WTFThreadData to Thread::current
479         https://bugs.webkit.org/show_bug.cgi?id=174716
480
481         Reviewed by Mark Lam.
482
483         We placed thread specific data in WTFThreadData previously. But now, we have a new good place
484         to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
485         sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
486         This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
487         to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
488         Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
489         before calling WTF::initializeThreading.
490
491         * WTF.xcodeproj/project.pbxproj:
492         * wtf/CMakeLists.txt:
493         * wtf/LockAlgorithm.h:
494         * wtf/LockAlgorithmInlines.h:
495         * wtf/MainThread.h:
496         * wtf/ParkingLot.cpp:
497         * wtf/StackStats.cpp:
498         (WTF::StackStats::PerThreadStats::PerThreadStats):
499         (WTF::StackStats::CheckPoint::CheckPoint):
500         (WTF::StackStats::CheckPoint::~CheckPoint):
501         (WTF::StackStats::probe):
502         (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
503         * wtf/ThreadHolder.cpp:
504         (WTF::ThreadHolder::initializeCurrent):
505         * wtf/ThreadHolder.h:
506         (WTF::ThreadHolder::ThreadHolder):
507         (WTF::ThreadHolder::currentMayBeNull):
508         (WTF::ThreadHolder::current):
509         * wtf/ThreadHolderPthreads.cpp:
510         (WTF::ThreadHolder::initializeKey):
511         (WTF::ThreadHolder::initialize):
512         (WTF::ThreadHolder::destruct):
513         (WTF::ThreadHolder::initializeOnce): Deleted.
514         (WTF::ThreadHolder::current): Deleted.
515         * wtf/ThreadHolderWin.cpp:
516         (WTF::ThreadHolder::initializeKey):
517         (WTF::ThreadHolder::currentDying):
518         (WTF::ThreadHolder::initialize):
519         (WTF::ThreadHolder::initializeOnce): Deleted.
520         (WTF::ThreadHolder::current): Deleted.
521         * wtf/Threading.cpp:
522         (WTF::Thread::initializeInThread):
523         (WTF::Thread::entryPoint):
524         (WTF::Thread::create):
525         (WTF::Thread::didExit):
526         (WTF::initializeThreading):
527         (WTF::Thread::currentMayBeNull): Deleted.
528         * wtf/Threading.h:
529         (WTF::Thread::current):
530         (WTF::Thread::atomicStringTable):
531         (WTF::Thread::setCurrentAtomicStringTable):
532         (WTF::Thread::stackStats):
533         (WTF::Thread::savedStackPointerAtVMEntry):
534         (WTF::Thread::setSavedStackPointerAtVMEntry):
535         (WTF::Thread::savedLastStackTop):
536         (WTF::Thread::setSavedLastStackTop):
537         * wtf/ThreadingPrimitives.h:
538         * wtf/ThreadingPthreads.cpp:
539         (WTF::Thread::createCurrentThread):
540         (WTF::Thread::current): Deleted.
541         * wtf/ThreadingWin.cpp:
542         (WTF::Thread::createCurrentThread):
543         (WTF::Thread::current): Deleted.
544         * wtf/WTFThreadData.cpp: Removed.
545         * wtf/WTFThreadData.h: Removed.
546         * wtf/text/AtomicString.cpp:
547         * wtf/text/AtomicStringImpl.cpp:
548         (WTF::stringTable):
549         * wtf/text/AtomicStringTable.cpp:
550         (WTF::AtomicStringTable::create):
551         * wtf/text/AtomicStringTable.h:
552
553 2017-08-02  Joseph Pecoraro  <pecoraro@apple.com>
554
555         NeverDestroyed related leaks seen on bots
556         https://bugs.webkit.org/show_bug.cgi?id=175113
557
558         Reviewed by Yusuke Suzuki.
559
560         * wtf/NeverDestroyed.h:
561         (WTF::NeverDestroyed::NeverDestroyed):
562         Previously the result of makeNeverDestroyed was not always moving into
563         the `static NeverDestroyed` static local variable. In some cases it would
564         re-invoke the constructor, creating a new NeverDestroyed object. In the
565         case of a Vector it was causing leaks.
566
567         Adding a move constructor convinces the compiler to move the result
568         of makeNeverDestroyed into the NeverDestroyed static. It doesn't actually
569         invoke the move constructor here, which I believe means it is deciding
570         to perform optional copy elision optimization.
571         'http://en.cppreference.com/w/cpp/language/copy_elision
572
573 2017-08-02  Filip Pizlo  <fpizlo@apple.com>
574
575         All C++ accesses to JSObject::m_butterfly should do caging
576         https://bugs.webkit.org/show_bug.cgi?id=175039
577
578         Reviewed by Keith Miller.
579         
580         Adds a smart pointer class that does various kinds of caging for you.
581
582         * WTF.xcodeproj/project.pbxproj:
583         * wtf/CMakeLists.txt:
584         * wtf/CagedPtr.h: Added.
585         (WTF::CagedPtr::CagedPtr):
586         (WTF::CagedPtr::get const):
587         (WTF::CagedPtr::getMayBeNull const):
588         (WTF::CagedPtr::operator== const):
589         (WTF::CagedPtr::operator!= const):
590         (WTF::CagedPtr::operator bool const):
591         (WTF::CagedPtr::operator* const):
592         (WTF::CagedPtr::operator-> const):
593
594 2017-08-02  Filip Pizlo  <fpizlo@apple.com>
595
596         We should be OK with the gigacage being disabled on gmalloc
597         https://bugs.webkit.org/show_bug.cgi?id=175082
598
599         Reviewed by Michael Saboff.
600
601         * wtf/Gigacage.h:
602         (Gigacage::shouldBeEnabled):
603
604 2017-08-01  Filip Pizlo  <fpizlo@apple.com>
605
606         Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
607         https://bugs.webkit.org/show_bug.cgi?id=174727
608
609         Reviewed by Mark Lam.
610         
611         For the Gigacage project to have minimal impact, we need to have some abstraction that allows code to
612         avoid having to guard itself with #if's. This adds a Gigacage abstraction that overlays the Gigacage
613         namespace from bmalloc, which always lets you call things like Gigacage::caged and Gigacage::tryMalloc.
614         
615         Because of how many places need to possibly allocate in a gigacage, or possibly perform caged accesses,
616         it's better to hide the question of whether or not it's enabled inside this API.
617
618         * WTF.xcodeproj/project.pbxproj:
619         * wtf/CMakeLists.txt:
620         * wtf/FastMalloc.cpp:
621         * wtf/Gigacage.cpp: Added.
622         (Gigacage::tryMalloc):
623         (Gigacage::tryAllocateVirtualPages):
624         (Gigacage::freeVirtualPages):
625         (Gigacage::tryAlignedMalloc):
626         (Gigacage::alignedFree):
627         (Gigacage::free):
628         * wtf/Gigacage.h: Added.
629         (Gigacage::ensureGigacage):
630         (Gigacage::disableGigacage):
631         (Gigacage::addDisableCallback):
632         (Gigacage::removeDisableCallback):
633         (Gigacage::caged):
634         (Gigacage::isCaged):
635         (Gigacage::tryAlignedMalloc):
636         (Gigacage::alignedFree):
637         (Gigacage::free):
638
639 2017-07-31  Matt Lewis  <jlewis3@apple.com>
640
641         Unreviewed, rolling out r220060.
642
643         This broke our internal builds. Contact reviewer of patch for
644         more information.
645
646         Reverted changeset:
647
648         "Merge WTFThreadData to Thread::current"
649         https://bugs.webkit.org/show_bug.cgi?id=174716
650         http://trac.webkit.org/changeset/220060
651
652 2017-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
653
654         Merge WTFThreadData to Thread::current
655         https://bugs.webkit.org/show_bug.cgi?id=174716
656
657         Reviewed by Sam Weinig.
658
659         We placed thread specific data in WTFThreadData previously. But now, we have a new good place
660         to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
661         sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
662         This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
663         to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
664         Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
665         before calling WTF::initializeThreading.
666
667         * WTF.xcodeproj/project.pbxproj:
668         * wtf/CMakeLists.txt:
669         * wtf/LockAlgorithm.h:
670         * wtf/LockAlgorithmInlines.h:
671         * wtf/MainThread.h:
672         * wtf/ParkingLot.cpp:
673         * wtf/StackStats.cpp:
674         (WTF::StackStats::PerThreadStats::PerThreadStats):
675         (WTF::StackStats::CheckPoint::CheckPoint):
676         (WTF::StackStats::CheckPoint::~CheckPoint):
677         (WTF::StackStats::probe):
678         (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
679         * wtf/ThreadHolder.cpp:
680         (WTF::ThreadHolder::initializeCurrent):
681         * wtf/ThreadHolder.h:
682         (WTF::ThreadHolder::ThreadHolder):
683         (WTF::ThreadHolder::currentMayBeNull):
684         (WTF::ThreadHolder::current):
685         * wtf/ThreadHolderPthreads.cpp:
686         (WTF::ThreadHolder::initialize):
687         (WTF::ThreadHolder::destruct):
688         (WTF::ThreadHolder::current): Deleted.
689         * wtf/ThreadHolderWin.cpp:
690         (WTF::ThreadHolder::currentDying):
691         (WTF::ThreadHolder::initialize):
692         (WTF::ThreadHolder::current): Deleted.
693         * wtf/Threading.cpp:
694         (WTF::Thread::initializeInThread):
695         (WTF::Thread::entryPoint):
696         (WTF::Thread::didExit):
697         (WTF::initializeThreading):
698         (WTF::Thread::currentMayBeNull): Deleted.
699         * wtf/Threading.h:
700         (WTF::Thread::atomicStringTable):
701         (WTF::Thread::setCurrentAtomicStringTable):
702         (WTF::Thread::stackStats):
703         (WTF::Thread::savedStackPointerAtVMEntry):
704         (WTF::Thread::setSavedStackPointerAtVMEntry):
705         (WTF::Thread::savedLastStackTop):
706         (WTF::Thread::setSavedLastStackTop):
707         (WTF::Thread::current):
708         * wtf/ThreadingPrimitives.h:
709         * wtf/ThreadingPthreads.cpp:
710         (WTF::Thread::createCurrentThread):
711         (WTF::Thread::current): Deleted.
712         * wtf/ThreadingWin.cpp:
713         (WTF::Thread::createCurrentThread):
714         (WTF::Thread::current): Deleted.
715         * wtf/WTFThreadData.cpp: Removed.
716         * wtf/WTFThreadData.h: Removed.
717         * wtf/text/AtomicString.cpp:
718         * wtf/text/AtomicStringImpl.cpp:
719         (WTF::stringTable):
720         * wtf/text/AtomicStringTable.cpp:
721         (WTF::AtomicStringTable::create):
722         * wtf/text/AtomicStringTable.h:
723
724 2017-07-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
725
726         Created a bool pretty printer at WTF for debugging purposes
727         https://bugs.webkit.org/show_bug.cgi?id=174893
728
729         Reviewed by Darin Adler.
730
731         * wtf/PrintStream.cpp:
732         (WTF::printInternal): The overload taking bool uses boolForPrinting
733         * wtf/PrintStream.h:
734         (WTF::boolForPrinting): Converts a bool in "true" or "false".
735
736 2017-07-30  Yusuke Suzuki  <utatane.tea@gmail.com>
737
738         [WTF] Introduce Private Symbols
739         https://bugs.webkit.org/show_bug.cgi?id=174935
740
741         Reviewed by Darin Adler.
742
743         Upcoming proposal of class fields[1] requires private fields.
744         The simple way to implement it is adding a property with a private symbol.
745         Currently, we have private symbols for internal properties. They are usual
746         Symbols managed by the hash table. So basically private symbols are statically
747         created in BuiltinNames. However this new proposal encourages users to create
748         such private symbols more and more.
749
750         So, this patch introduces notion of "Private" into WTF SymbolImpl. This patch
751         adds PrivateSymbolImpl. This is SymbolImpl with "Private" flag. We do not need
752         to look up the symbol from the hash table to check whether the given symbol
753         is a private one.
754
755         [1]: https://github.com/tc39/proposal-class-fields
756
757         * wtf/text/StringImpl.h:
758         * wtf/text/SymbolImpl.cpp:
759         (WTF::PrivateSymbolImpl::create):
760         (WTF::PrivateSymbolImpl::createNullSymbol):
761         * wtf/text/SymbolImpl.h:
762         (WTF::SymbolImpl::isPrivate):
763         (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
764         (WTF::SymbolImpl::SymbolImpl):
765         (WTF::PrivateSymbolImpl::PrivateSymbolImpl):
766
767 2017-07-30  Brady Eidson  <beidson@apple.com>
768
769         Add URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks.
770         https://bugs.webkit.org/show_bug.cgi?id=174958
771
772         Reviewed by Darin Adler.
773
774         This patch adds a new template class "InstanceCounted<T>".
775         
776         For each specialization, "InstanceCounted" will keep track of the total number of
777         instances in existence.
778         
779         This makes explicate leak checking in API tests possible.
780         
781         Since this adds some runtime and storage overhead the code that actually does anything
782         is only compiled in debug builds.
783         
784         * WTF.xcodeproj/project.pbxproj:
785         * wtf/InstanceCounted.h: Added.
786         (WTF::InstanceCounted::InstanceCounted):
787         (WTF::InstanceCounted::instanceCount):
788         (WTF::InstanceCounted::~InstanceCounted):
789
790 2017-07-27  Yusuke Suzuki  <utatane.tea@gmail.com>
791
792         [WTF] Drop Thread initialization wait in some platforms by introducing StackBounds::newThreadStackBounds(PlatformThreadHandle&)
793         https://bugs.webkit.org/show_bug.cgi?id=174303
794
795         Reviewed by Mark Lam.
796
797         Currently, the caller thread of Thread::create() need to wait for completion of the initialization of the target thread.
798         This is because we need to initialize Thread::m_stack in the target thread. Before this patch, a target thread's
799         StackBounds can only be retrieved by the target thread itself. However, this potentially causes context-switching between
800         the caller and the target threads and hurts efficiency of creating threads.
801
802         Fortunately, in some platforms (including major platforms except for Windows), we can get StackBounds of a target
803         thread from a caller thread. This allows us to avoid waiting for completion of thread initialization.
804
805         In this patch, we introduce HAVE_STACK_BOUNDS_FOR_NEW_THREAD and StackBounds::newThreadStackBounds. When creating
806         a new thread, we will use StackBounds::newThreadStackBounds to get StackBounds if possible. As a result, we
807         do not need to wait for completion of thread initialization to ensure m_stack field of Thread is initialized.
808
809         While some documents claim that it is possible on Windows to get the StackBounds of another thread[1], the method relies on
810         undocumented Windows NT APIs (NtQueryInformationThread, NtReadVirtualMemory etc.). So in this patch, we just
811         use the conservative approach simply waiting for completion of thread initialization.
812
813         [1]: https://stackoverflow.com/questions/3918375/how-to-get-thread-stack-information-on-windows
814
815         * wtf/Platform.h:
816         * wtf/StackBounds.cpp:
817         (WTF::StackBounds::newThreadStackBounds):
818         (WTF::StackBounds::currentThreadStackBoundsInternal):
819         (WTF::StackBounds::initialize): Deleted.
820         * wtf/StackBounds.h:
821         (WTF::StackBounds::currentThreadStackBounds):
822         (WTF::StackBounds::StackBounds):
823         * wtf/Threading.cpp:
824         (WTF::Thread::NewThreadContext::NewThreadContext):
825         (WTF::Thread::entryPoint):
826         (WTF::Thread::create):
827         (WTF::Thread::initialize): Deleted.
828         * wtf/Threading.h:
829         * wtf/ThreadingPrimitives.h:
830         * wtf/ThreadingPthreads.cpp:
831         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
832         (WTF::wtfThreadEntryPoint):
833         (WTF::Thread::establishHandle):
834         (WTF::Thread::initializeCurrentThreadInternal):
835         (WTF::Thread::current):
836         * wtf/ThreadingWin.cpp:
837         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
838         (WTF::Thread::initializeCurrentThreadInternal):
839         (WTF::Thread::current):
840         * wtf/win/MainThreadWin.cpp:
841         (WTF::initializeMainThreadPlatform):
842
843 2017-07-27  JF Bastien  <jfbastien@apple.com>
844
845         Update lock benchmarks
846         https://bugs.webkit.org/show_bug.cgi?id=174907
847
848         Reviewed by Filip Pizlo.
849
850         * benchmarks/ConditionSpeedTest.cpp:
851         (main):
852         * benchmarks/LockFairnessTest.cpp:
853         * benchmarks/LockSpeedTest.cpp:
854         * benchmarks/ToyLocks.h:
855
856 2017-07-26  Brian Burg  <bburg@apple.com>
857
858         Remove WEB_TIMING feature flag
859         https://bugs.webkit.org/show_bug.cgi?id=174795
860
861         Reviewed by Alex Christensen.
862
863         * wtf/FeatureDefines.h:
864
865 2017-07-26  Claudio Saavedra  <csaavedra@igalia.com>
866
867         [WPE] Enable KeyboardEvent key and code attributes
868         https://bugs.webkit.org/show_bug.cgi?id=174822
869
870         Reviewed by Žan Doberšek.
871
872         There is no reason for this to be disabled from what I see.
873
874         * wtf/FeatureDefines.h: Enable KeyboardEvent key and code attributes.
875
876 2017-07-23  Filip Pizlo  <fpizlo@apple.com>
877
878         B3 should do LICM
879         https://bugs.webkit.org/show_bug.cgi?id=174750
880
881         Reviewed by Keith Miller and Saam Barati.
882         
883         Moved DFG::NaturalLoops to WTF. The new templatized NaturalLoops<> uses the same Graph abstraction as
884         Dominators<>. This allows us to add a B3::NaturalLoops for free.
885         
886         Also made small tweaks to RangeSet, which the LICM uses.
887
888         * WTF.xcodeproj/project.pbxproj:
889         * wtf/CMakeLists.txt:
890         * wtf/Dominators.h:
891         * wtf/NaturalLoops.h: Added.
892         (WTF::NaturalLoop::NaturalLoop):
893         (WTF::NaturalLoop::graph):
894         (WTF::NaturalLoop::header):
895         (WTF::NaturalLoop::size):
896         (WTF::NaturalLoop::at):
897         (WTF::NaturalLoop::operator[]):
898         (WTF::NaturalLoop::contains):
899         (WTF::NaturalLoop::index):
900         (WTF::NaturalLoop::isOuterMostLoop):
901         (WTF::NaturalLoop::dump):
902         (WTF::NaturalLoop::addBlock):
903         (WTF::NaturalLoops::NaturalLoops):
904         (WTF::NaturalLoops::graph):
905         (WTF::NaturalLoops::numLoops):
906         (WTF::NaturalLoops::loop):
907         (WTF::NaturalLoops::headerOf):
908         (WTF::NaturalLoops::innerMostLoopOf):
909         (WTF::NaturalLoops::innerMostOuterLoop):
910         (WTF::NaturalLoops::belongsTo):
911         (WTF::NaturalLoops::loopDepth):
912         (WTF::NaturalLoops::loopsOf):
913         (WTF::NaturalLoops::dump):
914         * wtf/RangeSet.h:
915         (WTF::RangeSet::begin):
916         (WTF::RangeSet::end):
917         (WTF::RangeSet::addAll):
918
919 2017-07-23  Michael Catanzaro  <mcatanzaro@igalia.com>
920
921         Implement FALLTHROUGH attribute for C with GCC
922         https://bugs.webkit.org/show_bug.cgi?id=174555
923
924         Reviewed by Darin Adler.
925
926         My previous attempt to silence the JSC -Wimplicit-fallthrough warnings failed because they
927         are coming from a C file, and our FALLTHROUGH macro is only implemented for C++. So
928         implement it for C as well, using C attribute syntax.
929  
930         Note this is only possible to do for GCC, because Clang only supports this attribute using
931         the [[C++ attribute syntax]].
932
933         * wtf/Compiler.h:
934
935 2017-07-14  Filip Pizlo  <fpizlo@apple.com>
936
937         It should be easy to decide how WebKit yields
938         https://bugs.webkit.org/show_bug.cgi?id=174298
939
940         Reviewed by Saam Barati.
941         
942         Created a Thread::yield() abstraction for sched_yield(), and made WTF use it everywhere that it
943         had previously used std::this_thread::yield().
944         
945         To make it less annoying to experiment with changes to the lock algorithm in the future, this also
946         moves the meat of the algorithm into LockAlgorithmInlines.h. Only two files include that header.
947         Since LockAlgorithm.h no longer includes ParkingLot.h, a bunch of files in WK now need to include
948         timing headers (Seconds, MonotonicTime, etc) manually.
949
950         * WTF.xcodeproj/project.pbxproj:
951         * benchmarks/ToyLocks.h:
952         * wtf/CMakeLists.txt:
953         * wtf/Lock.cpp:
954         * wtf/LockAlgorithm.h:
955         (WTF::LockAlgorithm::lockSlow): Deleted.
956         (WTF::LockAlgorithm::unlockSlow): Deleted.
957         * wtf/LockAlgorithmInlines.h: Added.
958         (WTF::hasParkedBit>::lockSlow):
959         (WTF::hasParkedBit>::unlockSlow):
960         * wtf/MainThread.cpp:
961         * wtf/RunLoopTimer.h:
962         * wtf/Threading.cpp:
963         * wtf/Threading.h:
964         * wtf/ThreadingPthreads.cpp:
965         (WTF::Thread::yield):
966         * wtf/ThreadingWin.cpp:
967         (WTF::Thread::yield):
968         * wtf/WordLock.cpp:
969         (WTF::WordLockBase::lockSlow):
970         (WTF::WordLockBase::unlockSlow):
971
972 2017-07-22  Yusuke Suzuki  <utatane.tea@gmail.com>
973
974         [WTF] Extend ThreadGroup::add results from bool to ThreadGroupAddResult
975         https://bugs.webkit.org/show_bug.cgi?id=174705
976
977         Reviewed by Mark Lam.
978
979         After starting using ThreadGroup to bookkeep active threads for Signals,
980         we would like to know tristate of ThreadGroup::add result, NewlyAdded, AlreadyAdded, NotAdded.
981         This patch extends the result of ThreadGroup::add from bool to ThreadGroupAddResult tristate.
982         Note that NotAdded is returned if the target thread is dying.
983
984         * wtf/ThreadGroup.cpp:
985         (WTF::ThreadGroup::add):
986         (WTF::ThreadGroup::addCurrentThread):
987         * wtf/ThreadGroup.h:
988         * wtf/Threading.cpp:
989         (WTF::Thread::addToThreadGroup):
990         * wtf/Threading.h:
991         * wtf/threads/Signals.cpp:
992         (WTF::registerThreadForMachExceptionHandling):
993
994 2017-07-21  Commit Queue  <commit-queue@webkit.org>
995
996         Unreviewed, rolling out r219732.
997         https://bugs.webkit.org/show_bug.cgi?id=174748
998
999         static is not threadsafe in WebKit tree (Requested by
1000         yusukesuzuki on #webkit).
1001
1002         Reverted changeset:
1003
1004         "[WTF] Drop initializeDate"
1005         https://bugs.webkit.org/show_bug.cgi?id=174714
1006         http://trac.webkit.org/changeset/219732
1007
1008 2017-07-21  Yusuke Suzuki  <utatane.tea@gmail.com>
1009
1010         [WTF] Drop initializeDate
1011         https://bugs.webkit.org/show_bug.cgi?id=174714
1012
1013         Reviewed by Darin Adler.
1014
1015         minYear static variable will be initialized in an exclusive manner, which is ensured by C++ "static" semantics.
1016         Thus, we do not need to call initializeDate() explicitly.
1017
1018         * wtf/DateMath.cpp:
1019         (WTF::equivalentYearForDST):
1020         (WTF::initializeDates): Deleted.
1021         * wtf/Threading.cpp:
1022         (WTF::initializeThreading):
1023
1024 2017-07-21  Yusuke Suzuki  <utatane.tea@gmail.com>
1025
1026         [JSC] Introduce static symbols
1027         https://bugs.webkit.org/show_bug.cgi?id=158863
1028
1029         Reviewed by Darin Adler.
1030
1031         We add a new class StaticSymbolImpl. StaticSymbolImpl can offer
1032         the way to create static SymbolImpl. It can be shared between
1033         multiple VMs and multiple threads.
1034
1035         * wtf/text/SymbolImpl.h:
1036         (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
1037         (WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&):
1038         For StaticSymbolImpl's hashForSymbol, we use usual string hash value.
1039         Since all the SymbolImpls are unique, basically, any value is OK here.
1040         Non-confilicting to the other SymbolImpls is ideal.
1041
1042 2017-07-21  Yusuke Suzuki  <utatane.tea@gmail.com>
1043
1044         [WTF] Newly added AtomicStringImpl should use BufferInternal static string if StringImpl is static
1045         https://bugs.webkit.org/show_bug.cgi?id=174501
1046
1047         Reviewed by Darin Adler.
1048
1049         When creating AtomicStringImpl from static StringImpl, we can just use createWithoutCopying
1050         to create a BufferInternal AtomicStringImpl which m_data{8,16} is static string's one.
1051
1052         * wtf/text/AtomicStringImpl.cpp:
1053         (WTF::CStringTranslator::hash):
1054         (WTF::CStringTranslator::equal):
1055         (WTF::CStringTranslator::translate):
1056         (WTF::AtomicStringImpl::add):
1057         (WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer):
1058         (WTF::UCharBufferTranslator::hash):
1059         (WTF::UCharBufferTranslator::equal):
1060         (WTF::UCharBufferTranslator::translate):
1061         (WTF::LCharBufferTranslator::hash):
1062         (WTF::LCharBufferTranslator::equal):
1063         (WTF::LCharBufferTranslator::translate):
1064         (WTF::BufferFromStaticDataTranslator::hash):
1065         (WTF::BufferFromStaticDataTranslator::equal):
1066         (WTF::BufferFromStaticDataTranslator::translate):
1067         (WTF::AtomicStringImpl::addLiteral):
1068         (WTF::addSymbol):
1069         (WTF::addStatic):
1070         (WTF::AtomicStringImpl::addSlowCase):
1071         (WTF::AtomicStringImpl::lookUp):
1072         (WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
1073         (WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
1074         (WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
1075         (WTF::addSubstring): Deleted.
1076         * wtf/text/StringImpl.h:
1077
1078 2017-07-21  Konstantin Tokarev  <annulen@yandex.ru>
1079
1080        [cmake] Unreviewed, add definitions necessary to use ICU shipped with macOS
1081
1082        macOS system ICU libraries are built with U_DISABLE_RENAMING=1 and
1083        U_SHOW_CPLUSPLUS_API=0. After r219155 we have to pass this definitons
1084        explicitly, because ICU headers in the tree are not modified anymore.
1085
1086         * wtf/PlatformMac.cmake: Rely on ICU_LIBRARIES instead of passing ICU
1087         library name explicitly in WTF_LIBRARIES.
1088
1089 2017-07-20  Chris Dumez  <cdumez@apple.com>
1090
1091         Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
1092         https://bugs.webkit.org/show_bug.cgi?id=174660
1093
1094         Reviewed by Geoffrey Garen.
1095
1096         Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
1097         This essentially replaces a branch to figure out if the new size is less or greater than the
1098         current size by an assertion.
1099
1100         * wtf/IndexSparseSet.h:
1101         (WTF::OverflowHandler>::IndexSparseSet):
1102         (WTF::OverflowHandler>::clear):
1103         * wtf/Insertion.h:
1104         (WTF::executeInsertions):
1105         * wtf/RangeSet.h:
1106         (WTF::RangeSet::compact):
1107         * wtf/Vector.h:
1108         (WTF::removeRepeatedElements):
1109         * wtf/persistence/Coders.h:
1110
1111 2017-07-20  Yusuke Suzuki  <utatane.tea@gmail.com>
1112
1113         [WTF] Use ThreadGroup to bookkeep active threads for Mach exception
1114         https://bugs.webkit.org/show_bug.cgi?id=174678
1115
1116         Reviewed by Mark Lam.
1117
1118         We can use ThreadGroup to bookkeep active threads for Mach exceptions.
1119         When the thread dies, it is automatically removed from the thread groups.
1120         So we do not need to call unregisterThreadForMachExceptionHandling.
1121
1122         * wtf/ThreadGroup.cpp:
1123         (WTF::ThreadGroup::~ThreadGroup):
1124         (WTF::ThreadGroup::add):
1125         * wtf/ThreadGroup.h:
1126         * wtf/ThreadHolder.cpp:
1127         (WTF::ThreadHolder::~ThreadHolder):
1128         * wtf/Threading.cpp:
1129         (WTF::Thread::addToThreadGroup):
1130         (WTF::Thread::removeFromThreadGroup):
1131         * wtf/Threading.h:
1132         * wtf/threads/Signals.cpp:
1133         (WTF::setExceptionPorts):
1134         (WTF::activeThreads):
1135         (WTF::registerThreadForMachExceptionHandling):
1136         (WTF::installSignalHandler):
1137         (WTF::unregisterThreadForMachExceptionHandling): Deleted.
1138         * wtf/threads/Signals.h:
1139
1140 2017-07-19  Yusuke Suzuki  <utatane.tea@gmail.com>
1141
1142         [WTF] Remove unnecessary indirection of WTF::Thread entry point
1143         https://bugs.webkit.org/show_bug.cgi?id=174291
1144
1145         Reviewed by Mark Lam.
1146
1147         Now wtfThreadEntryPoint is almost the same. Only the difference is function signature due to platform APIs.
1148         We remove ThreadFunctionInvocation indirection in ThreadingPthread.cpp and ThreadingWin.cpp.
1149
1150         Also, ThreadFunctionInvocation keeps a RefPtr to the Thread object. This was previously needed to keep the
1151         Thread object alive until the thread itself could install the ThreadHolder into its thread local storage.
1152         The ThreadHolder has a Ref that keeps the Thread object alive for the lifetime of the thread. Since
1153         Thread::create() now waits for the thread to be initialized before returning and Thread::create() hold a Ref
1154         to the Thread object, we are guaranteed that the Thread object will be alive long enough for it to be installed
1155         in the thread's ThreadHolder, and we no longer need ThreadFunctionInvocation.
1156
1157         And we also simplify ThreadHolder::initialize a bit. Now Thread::create waits for the completion of Thread
1158         initialization. So, after establishing thread handle, we can call ThreadHolder::initialize before completing
1159         Thread initialization.
1160
1161         Also we drop errno.h ifdefs in ThreadingWin.cpp. This is introduced to support WinCE. But now WinCE port is removed.
1162
1163         * WTF.xcodeproj/project.pbxproj:
1164         * wtf/ThreadFunctionInvocation.h: Removed.
1165         * wtf/ThreadHolder.h:
1166         * wtf/ThreadHolderWin.cpp:
1167         (WTF::ThreadHolder::initialize):
1168         * wtf/Threading.cpp:
1169         (WTF::Thread::entryPoint):
1170         (WTF::Thread::create):
1171         (WTF::threadEntryPoint): Deleted.
1172         * wtf/Threading.h:
1173         * wtf/ThreadingPthreads.cpp:
1174         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1175         (WTF::wtfThreadEntryPoint):
1176         (WTF::Thread::establishHandle):
1177         (WTF::Thread::initializeCurrentThreadInternal):
1178         (WTF::Thread::current):
1179         (WTF::Thread::establishPlatformSpecificHandle):
1180         (WTF::Thread::createInternal): Deleted.
1181         (WTF::Thread::establish): Deleted.
1182         * wtf/ThreadingWin.cpp:
1183         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1184         (WTF::Thread::initializeCurrentThreadInternal):
1185         (WTF::wtfThreadEntryPoint):
1186         (WTF::Thread::establishHandle):
1187         (WTF::Thread::current):
1188         (WTF::Thread::establishPlatformSpecificHandle):
1189         (WTF::Thread::createInternal): Deleted.
1190         (WTF::Thread::establish): Deleted.
1191         * wtf/win/MainThreadWin.cpp:
1192         (WTF::initializeMainThreadPlatform):
1193
1194 2017-07-19  Yusuke Suzuki  <utatane.tea@gmail.com>
1195
1196         [WTF] Implement WTF::ThreadGroup
1197         https://bugs.webkit.org/show_bug.cgi?id=174081
1198
1199         Reviewed by Mark Lam.
1200
1201         This patch implements WTF::ThreadGroup. It implements core of JSC::MachineThreads with more reliable way.
1202         JSC::MachineThreads was complicated because of managing dead threads. Each JSC::MachineThreads has its
1203         own TLS with a registered destructor. And everytime a thread dies, the registered TLS destructor is called.
1204         And this destructor will remove the current dying thread from JSC::MachineThreads.
1205
1206         However the above implementation is tricky. And each JSC::MachineThreads requires own TLS space, which is
1207         not considered in WTF's Windows ThreadSpecific implementation. Current design works well since we only
1208         have small number of MachineThreads right now.
1209
1210         Instead, we use more reliable way. After introducing WTF::Thread, WTF::Thread has WTF::Thread::didExit,
1211         which is called when associated TLS (with WTF::Thread) is destroyed. We leverage this mechanism to remove
1212         WTF::Thread from MachineThreads.
1213
1214         This patch introduces WTF::ThreadGroup. It is tightly integrated with WTF::Thread: WTF::Thread knows
1215         ThreadGroups which includes this thread. And WTF::ThreadGroup of course knows WTF::Threads added to it.
1216         WTF::Thread::didExit carefully remove itself from WTF::ThreadGroups.
1217
1218         The most important part of this patch is locking. WTF::Thread can die. And WTF::ThreadGroup can die.
1219         If we take a design using two fine grain locks in WTF::Thread and WTF::ThreadGroup, we easily encounter
1220         dead lock. Consider the following case.
1221
1222         1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold a lock of THG, and hold a lock of TH (locking order is THG -> TH).
1223         2. When TH dies, TH need to hold a lock of TH to iterate THGs. And we hold a lock of THG to unregister TH from it (locking order is TH -> THG).
1224         3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (locking order is THG -> TH).
1225         4. When destroying THG, we need to hold a lock of TH to unregister THG from TH. We can hold a lock of THG before that (locking order is THG -> TH).
1226
1227         Then, it easily causes dead lock. We cannot swap the locking order of (2) since iterating THG requires a lock of TH.
1228         To solve this problem, we use std::shared_ptr and std::weak_ptr.
1229
1230         1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold THG, and hold a lock of TH. (THG -> TH)
1231         2. When TH dies, TH first hold lock of TH. And we use std::weak_ptr<>::lock() to retain non-destructed ThreadGroups.
1232         If some of ThreadGroups are dying, we just ignore them. It is ok because such a ThreadGroup will be destructed. So we do not need to unregister this thread from
1233         such a ThreadGroup. Then, we have Vector<std::shared_ptr<ThreadGroup>>. So we unlock a lock of TH. To unregister a thread from thread group, we first hold a
1234         lock of THG and then hold a lock of TH. Both lifetime is ensured: THG is retained by std::shared_ptr. And TH is itself. (TH), (THG -> TH).
1235         3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (THG -> TH).
1236         4. When destroying THG, we hold a lock of THG. And hold a lock of TH. During holding THG's lock, registered thread never dies because (2) holds THG lock. (THG -> TH).
1237
1238         We also fix suspend and resume locking mechanism to avoid dead lock. We should hold the global lock when suspending and resuming.
1239         If we use per-thread lock, the suspended thread can hold the lock of the other threads. It causes dead lock.
1240
1241         * WTF.xcodeproj/project.pbxproj:
1242         * wtf/AutomaticThread.cpp:
1243         * wtf/CMakeLists.txt:
1244         * wtf/CrossThreadCopier.h:
1245         * wtf/ParkingLot.h:
1246         * wtf/ThreadGroup.cpp: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
1247         (WTF::ThreadGroup::~ThreadGroup):
1248         (WTF::ThreadGroup::add):
1249         (WTF::ThreadGroup::addCurrentThread):
1250         * wtf/ThreadGroup.h: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
1251         (WTF::ThreadGroup::create):
1252         (WTF::ThreadGroup::threads):
1253         (WTF::ThreadGroup::getLock):
1254         (WTF::ThreadGroup::weakFromThis):
1255         * wtf/Threading.cpp:
1256         (WTF::shouldRemoveThreadFromThreadGroup):
1257         (WTF::Thread::didExit):
1258         (WTF::Thread::addToThreadGroup):
1259         (WTF::Thread::removeFromThreadGroup):
1260         * wtf/Threading.h:
1261         * wtf/ThreadingPthreads.cpp:
1262         (WTF::Thread::resume):
1263         (WTF::Thread::getRegisters):
1264         * wtf/ThreadingWin.cpp:
1265         (WTF::Thread::resume):
1266         (WTF::Thread::getRegisters):
1267
1268 2017-07-18  Andy Estes  <aestes@apple.com>
1269
1270         [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS
1271         https://bugs.webkit.org/show_bug.cgi?id=174631
1272
1273         Reviewed by Tim Horton.
1274
1275         * Configurations/Base.xcconfig:
1276
1277 2017-07-18  Yusuke Suzuki  <utatane.tea@gmail.com>
1278
1279         WTF::Thread should have the threads stack bounds.
1280         https://bugs.webkit.org/show_bug.cgi?id=173975
1281
1282         Reviewed by Mark Lam.
1283
1284         We move StackBounds from WTFThreadData to WTF::Thread.
1285         One important thing is that we should make valid StackBounds
1286         visible to Thread::create() caller. When the caller get
1287         WTF::Thread from Thread::create(), this WTF::Thread should
1288         have a valid StackBounds. But StackBounds information can be
1289         retrived only in the WTF::Thread's thread itself.
1290
1291         We also clean up WTF::initializeThreading. StringImpl::empty()
1292         is now statically initialized by using constexpr constructor.
1293         Thus we do not need to call StringImpl::empty() explicitly here.
1294         And WTF::initializeThreading() does not have any main thread
1295         affinity right now in all the platforms. So we fix the comment
1296         in Threading.h. Then, now, WTF::initializeThreading() is called
1297         in UI thread when using Web thread in iOS.
1298
1299         * wtf/StackBounds.h:
1300         (WTF::StackBounds::emptyBounds):
1301         (WTF::StackBounds::StackBounds):
1302         * wtf/Threading.cpp:
1303         (WTF::threadEntryPoint):
1304         (WTF::Thread::create):
1305         (WTF::Thread::currentMayBeNull):
1306         (WTF::Thread::initialize):
1307         (WTF::initializeThreading):
1308         * wtf/Threading.h:
1309         (WTF::Thread::stack):
1310         * wtf/ThreadingPthreads.cpp:
1311         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1312         (WTF::Thread::current):
1313         (WTF::initializeCurrentThreadEvenIfNonWTFCreated): Deleted.
1314         (WTF::Thread::currentMayBeNull): Deleted.
1315         * wtf/ThreadingWin.cpp:
1316         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1317         (WTF::Thread::initializeCurrentThreadInternal):
1318         (WTF::Thread::current):
1319         * wtf/WTFThreadData.cpp:
1320         (WTF::WTFThreadData::WTFThreadData):
1321         * wtf/WTFThreadData.h:
1322         (WTF::WTFThreadData::stack):
1323
1324 2017-07-18  Andy Estes  <aestes@apple.com>
1325
1326         [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION
1327         https://bugs.webkit.org/show_bug.cgi?id=174631
1328
1329         Reviewed by Sam Weinig.
1330
1331         * Configurations/Base.xcconfig:
1332
1333 2017-07-18  Andy Estes  <aestes@apple.com>
1334
1335         [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION
1336         https://bugs.webkit.org/show_bug.cgi?id=174631
1337
1338         Reviewed by Dan Bernstein.
1339
1340         * Configurations/Base.xcconfig:
1341
1342 2017-07-18  Andy Estes  <aestes@apple.com>
1343
1344         [Xcode] Enable CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING
1345         https://bugs.webkit.org/show_bug.cgi?id=174631
1346
1347         Reviewed by Darin Adler.
1348
1349         * Configurations/Base.xcconfig:
1350
1351 2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>
1352
1353         [cmake] Set library types before their targets are created
1354         https://bugs.webkit.org/show_bug.cgi?id=174600
1355
1356         Reviewed by Michael Catanzaro.
1357
1358         Since r219560 library targets are created before PlatformXXX.cmake
1359         files are processed, however library type must be passed in
1360         add_library() call and cannot be changed afterwards. Set these
1361         variables in OptionsXXX.cmake.
1362
1363         * wtf/PlatformGTK.cmake:
1364         * wtf/PlatformMac.cmake:
1365
1366 2017-07-17  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1367
1368         Move USE_AVFOUNDATION definition on Windows to wtf/Platform.h
1369         https://bugs.webkit.org/show_bug.cgi?id=174356
1370
1371         Reviewed by Brent Fulgham.
1372
1373         Move the definition of USE_AVFOUNDATION on Windows to wtf/platform.h
1374
1375         Add a custom command to generate AVFoundationHeaderDetection.h, which
1376         is renamed from WebCoreHeaderDetection.h
1377
1378         * AVFoundationSupport.py: Moved from Source/WebCore/AVFoundationSupport.py.
1379         * wtf/Platform.h:
1380         * wtf/PlatformWin.cmake:
1381
1382 2017-07-17  Darin Adler  <darin@apple.com>
1383
1384         Improve use of NeverDestroyed
1385         https://bugs.webkit.org/show_bug.cgi?id=174348
1386
1387         Reviewed by Sam Weinig.
1388
1389         * wtf/HashSet.h: Added an overload of HashSet::add that takes an initializer list of
1390         const references. This is handy to add a bunch of values all at once. Later we can
1391         consider optimizing to grow the hash table only once instead of deciding whether to
1392         grow repeatedly as we add each value.
1393         (WTF::copyToVector): Changed to use std::copy, removing 4 of the 6 lines of code here.
1394
1395         * wtf/MemoryPressureHandler.cpp: Include NeverDestroyed.h here ...
1396         * wtf/MemoryPressureHandler.h: ... not here.
1397
1398         * wtf/NeverDestroyed.h: Added the ability to have a const NeverDestroyed.
1399         Added a makeNeverDestroyed function that deduces the type from the argument.
1400         With auto, this can be used to avoid writing out a long type twice.
1401
1402         * wtf/ThreadingPthreads.cpp: Removed unneeded include of NeverDestroyed.h.
1403         * wtf/text/AtomicString.cpp: Ditto.
1404
1405 2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>
1406
1407         [CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called
1408         https://bugs.webkit.org/show_bug.cgi?id=174557
1409
1410         Reviewed by Michael Catanzaro.
1411
1412         * wtf/CMakeLists.txt:
1413
1414 2017-07-14  Jonathan Bedard  <jbedard@apple.com>
1415
1416         Add iOS 11 SPI
1417         https://bugs.webkit.org/show_bug.cgi?id=174430
1418         <rdar://problem/33269288>
1419
1420         Reviewed by Tim Horton.
1421
1422         * Configurations/WTF.xcconfig: Exclude MachExceptions.def when building iOS 11 for
1423         the iOS simulator.
1424
1425 2017-07-14  Commit Queue  <commit-queue@webkit.org>
1426
1427         Unreviewed, rolling out r219510.
1428         https://bugs.webkit.org/show_bug.cgi?id=174525
1429
1430         Need to revert length() == 0 check for null string (Requested
1431         by yusukesuzuki on #webkit).
1432
1433         Reverted changeset:
1434
1435         "[WTF] Newly added AtomicStringImpl should use BufferInternal
1436         static string if StringImpl is static"
1437         https://bugs.webkit.org/show_bug.cgi?id=174501
1438         http://trac.webkit.org/changeset/219510
1439
1440 2017-07-14  Yusuke Suzuki  <utatane.tea@gmail.com>
1441
1442         [WTF] Newly added AtomicStringImpl should use BufferInternal static string if StringImpl is static
1443         https://bugs.webkit.org/show_bug.cgi?id=174501
1444
1445         Reviewed by Darin Adler.
1446
1447         When creating AtomicStringImpl from static StringImpl, we can just use createWithoutCopying
1448         to create a BufferInternal AtomicStringImpl which m_data{8,16} is static string's one.
1449
1450         * wtf/text/AtomicStringImpl.cpp:
1451         (WTF::CStringTranslator::hash):
1452         (WTF::CStringTranslator::equal):
1453         (WTF::CStringTranslator::translate):
1454         (WTF::AtomicStringImpl::add):
1455         (WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer):
1456         (WTF::UCharBufferTranslator::hash):
1457         (WTF::UCharBufferTranslator::equal):
1458         (WTF::UCharBufferTranslator::translate):
1459         (WTF::LCharBufferTranslator::hash):
1460         (WTF::LCharBufferTranslator::equal):
1461         (WTF::LCharBufferTranslator::translate):
1462         (WTF::BufferFromStaticDataTranslator::hash):
1463         (WTF::BufferFromStaticDataTranslator::equal):
1464         (WTF::BufferFromStaticDataTranslator::translate):
1465         (WTF::AtomicStringImpl::addLiteral):
1466         (WTF::addSymbol):
1467         (WTF::addStatic):
1468         (WTF::AtomicStringImpl::addSlowCase):
1469         (WTF::AtomicStringImpl::lookUp):
1470         (WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
1471         (WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
1472         (WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
1473         (WTF::addSubstring): Deleted.
1474         * wtf/text/StringImpl.h:
1475
1476 2017-07-14  Yusuke Suzuki  <utatane.tea@gmail.com>
1477
1478         [WTF] Use std::unique_ptr for StackTrace
1479         https://bugs.webkit.org/show_bug.cgi?id=174495
1480
1481         Reviewed by Alex Christensen.
1482
1483         Instead of returning pointer to heap allocated StackTrace,
1484         we should return std::unique_ptr<StackTrace>.
1485         And we also move WTFGetBackTrace from Assertions.cpp to
1486         StackTrace.cpp to consolidate stack trace related operations
1487         into StackTrace.cpp.
1488
1489         * wtf/Assertions.cpp:
1490         * wtf/StackTrace.cpp:
1491         (WTFGetBacktrace):
1492         (WTF::StackTrace::captureStackTrace):
1493         * wtf/StackTrace.h:
1494
1495 2017-07-13  Yusuke Suzuki  <utatane.tea@gmail.com>
1496
1497         Unreviewed, annotate inline for operator==/!= for FastAllocator
1498         https://bugs.webkit.org/show_bug.cgi?id=174366
1499
1500         * wtf/FastMalloc.h:
1501         (WTF::operator==):
1502         (WTF::operator!=):
1503
1504 2017-07-12  Commit Queue  <commit-queue@webkit.org>
1505
1506         Unreviewed, rolling out r219176.
1507         https://bugs.webkit.org/show_bug.cgi?id=174436
1508
1509         "Can cause infinite recursion on iOS" (Requested by mlam on
1510         #webkit).
1511
1512         Reverted changeset:
1513
1514         "WTF::Thread should have the threads stack bounds."
1515         https://bugs.webkit.org/show_bug.cgi?id=173975
1516         http://trac.webkit.org/changeset/219176
1517
1518 2017-07-12  Adrian Perez de Castro  <aperez@igalia.com>
1519
1520         [WTF] Failure to build when the compiler specifically targets ARMv8-A / defines __ARM_ARCH_8A__
1521         https://bugs.webkit.org/show_bug.cgi?id=174425
1522
1523         Reviewed by Michael Catanzaro.
1524
1525         * wtf/Platform.h: Also check for __ARCH_ARM_8A__ to detect ARMv8.
1526
1527 2017-07-12  Michael Saboff  <msaboff@apple.com>
1528
1529         Unreviewed build fix when both DATA_LOG_TO_FILE and DATA_LOG_FILENAME are defined.
1530
1531         * wtf/DataLog.cpp:
1532         (WTF::initializeLogFileOnce): Changed declaration of logBasename from
1533         char* logBasename to const char* logBasename.
1534
1535 2017-07-12  Matt Lewis  <jlewis3@apple.com>
1536
1537         Unreviewed, rolling out r219401.
1538
1539         This revision rolled out the previous patch, but after talking
1540         with reviewer, a rebaseline is what was needed.Rolling back in
1541         before rebaseline.
1542
1543         Reverted changeset:
1544
1545         "Unreviewed, rolling out r219379."
1546         https://bugs.webkit.org/show_bug.cgi?id=174400
1547         http://trac.webkit.org/changeset/219401
1548
1549 2017-07-12  Matt Lewis  <jlewis3@apple.com>
1550
1551         Unreviewed, rolling out r219379.
1552
1553         This revision caused a consistent failure in the test
1554         fast/dom/Window/property-access-on-cached-window-after-frame-
1555         removed.html.
1556
1557         Reverted changeset:
1558
1559         "Remove NAVIGATOR_HWCONCURRENCY"
1560         https://bugs.webkit.org/show_bug.cgi?id=174400
1561         http://trac.webkit.org/changeset/219379
1562
1563 2017-07-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1564
1565         Unreviewed, attempt to fix Windows build
1566         https://bugs.webkit.org/show_bug.cgi?id=174366
1567
1568         * wtf/FastMalloc.h:
1569         (WTF::operator==):
1570         (WTF::operator!=):
1571         (WTF::FastAllocator::operator==): Deleted.
1572         (WTF::FastAllocator::operator!=): Deleted.
1573
1574 2017-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1575
1576         [GTK][WPE] Enable FILE_LOCK and implement lockFile and unlockFile
1577         https://bugs.webkit.org/show_bug.cgi?id=174357
1578
1579         Reviewed by Michael Catanzaro.
1580
1581         * wtf/Platform.h: Enable FILE_LOCK in GTK and WPE ports.
1582
1583 2017-07-11  Dean Jackson  <dino@apple.com>
1584
1585         Remove NAVIGATOR_HWCONCURRENCY
1586         https://bugs.webkit.org/show_bug.cgi?id=174400
1587
1588         Reviewed by Sam Weinig.
1589
1590         * wtf/FeatureDefines.h:
1591
1592 2017-07-11  Dean Jackson  <dino@apple.com>
1593
1594         Rolling out r219372.
1595
1596         * wtf/FeatureDefines.h:
1597
1598 2017-07-11  Dean Jackson  <dino@apple.com>
1599
1600         Remove NAVIGATOR_HWCONCURRENCY
1601         https://bugs.webkit.org/show_bug.cgi?id=174400
1602
1603         Reviewed by Sam Weinig.
1604
1605         * wtf/FeatureDefines.h:
1606
1607 2017-07-11  Yusuke Suzuki  <utatane.tea@gmail.com>
1608
1609         [WTF] Drop unnecessary AtomicString constructor since we have constexpr hash function
1610         https://bugs.webkit.org/show_bug.cgi?id=174347
1611
1612         Reviewed by Alex Christensen.
1613
1614         Previously, we calculate hash value in perl script and generate source code with that value.
1615         This AtomicString constructor takes this pre-calculated hash value to efficiently construct
1616         itself. But now, we have constexpr hash function, then we do not need to specify hash value
1617         directly in this way. Thus we drop this functionality.
1618
1619         * wtf/text/AtomicString.h:
1620         * wtf/text/AtomicStringImpl.cpp:
1621         (WTF::HashAndCharactersTranslator::hash): Deleted.
1622         (WTF::HashAndCharactersTranslator::equal): Deleted.
1623         (WTF::HashAndCharactersTranslator::translate): Deleted.
1624         * wtf/text/AtomicStringImpl.h:
1625         (WTF::AtomicStringImpl::add):
1626
1627 2017-07-10  Per Arne Vollan  <pvollan@apple.com>
1628
1629         [Win] Link error when building WTF from WTF.proj project file.
1630         https://bugs.webkit.org/show_bug.cgi?id=174316
1631         <rdar://problem/33178200>
1632
1633         Reviewed by Brent Fulgham.
1634
1635         WTF_CPU_X86 cmake variable needs to be set for link libraries directories to be correct.
1636
1637         * WTF.vcxproj/WTF.proj:
1638
1639 2017-07-03  Brian Burg  <bburg@apple.com>
1640
1641         Web Replay: remove some unused code
1642         https://bugs.webkit.org/show_bug.cgi?id=173903
1643
1644         Rubber-stamped by Joseph Pecoraro.
1645
1646         * wtf/FeatureDefines.h:
1647
1648 2017-07-10  Brady Eidson  <beidson@apple.com>
1649
1650         Cleanup lifetime issues of UniqueIDBDatabase and IDBBackingStore.
1651         <rdar://problem/32908525> and https://bugs.webkit.org/show_bug.cgi?id=174244
1652
1653         Reviewed by David Kilzer and Alex Christensen. 
1654
1655         Add proper "kill" support to CrossThreadQueue, as well as isEmpty() support.
1656
1657         * wtf/CrossThreadQueue.h:
1658         (WTF::CrossThreadQueue<DataType>::append):
1659         (WTF::CrossThreadQueue<DataType>::kill):
1660         (WTF::CrossThreadQueue<DataType>::isKilled):
1661         (WTF::CrossThreadQueue<DataType>::isEmpty):
1662         (WTF::CrossThreadQueue::isKilled): Deleted.
1663
1664 2017-07-09  Yusuke Suzuki  <utatane.tea@gmail.com>
1665
1666         [JSC] Use fastMalloc / fastFree for STL containers
1667         https://bugs.webkit.org/show_bug.cgi?id=174297
1668
1669         Reviewed by Sam Weinig.
1670
1671         * wtf/FastMalloc.h:
1672         (WTF::FastAllocator::FastAllocator):
1673         (WTF::FastAllocator::allocate):
1674         (WTF::FastAllocator::deallocate):
1675         (WTF::FastAllocator::operator==):
1676         (WTF::FastAllocator::operator!=):
1677
1678 2017-07-07  Brent Fulgham  <bfulgham@apple.com>
1679
1680         [WK2] Use a rolling 30-day uptime for processing statistics
1681         https://bugs.webkit.org/show_bug.cgi?id=174235
1682         <rdar://problem/33164381>
1683
1684         Reviewed by Chris Dumez.
1685
1686         Modify Deque to allow it to be used in a template specialization in KeyedDecoder.
1687
1688         * wtf/Deque.h:
1689
1690 2017-07-07  Commit Queue  <commit-queue@webkit.org>
1691
1692         Unreviewed, rolling out r219238, r219239, and r219241.
1693         https://bugs.webkit.org/show_bug.cgi?id=174265
1694
1695         "fast/workers/dedicated-worker-lifecycle.html is flaky"
1696         (Requested by yusukesuzuki on #webkit).
1697
1698         Reverted changesets:
1699
1700         "[WTF] Implement WTF::ThreadGroup"
1701         https://bugs.webkit.org/show_bug.cgi?id=174081
1702         http://trac.webkit.org/changeset/219238
1703
1704         "Unreviewed, build fix after r219238"
1705         https://bugs.webkit.org/show_bug.cgi?id=174081
1706         http://trac.webkit.org/changeset/219239
1707
1708         "Unreviewed, CLoop build fix after r219238"
1709         https://bugs.webkit.org/show_bug.cgi?id=174081
1710         http://trac.webkit.org/changeset/219241
1711
1712 2017-07-07  Yusuke Suzuki  <utatane.tea@gmail.com>
1713
1714         Unreviewed, Windows build fix after r219233 part 4
1715         https://bugs.webkit.org/show_bug.cgi?id=174231
1716
1717         * wtf/Assertions.h:
1718
1719 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
1720
1721         Unreviewed, Windows build fix after r219233 part 3
1722         https://bugs.webkit.org/show_bug.cgi?id=174231
1723
1724         * wtf/Assertions.h:
1725         (compilerFenceForCrash):
1726
1727 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
1728
1729         Unreviewed, Windows build fix after r219233 part 2
1730         https://bugs.webkit.org/show_bug.cgi?id=174231
1731
1732         * wtf/Assertions.h:
1733
1734 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
1735
1736         Unreviewed, Windows build fix after r219233
1737         https://bugs.webkit.org/show_bug.cgi?id=174231
1738
1739         * wtf/Compiler.h:
1740
1741 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
1742
1743         Unreviewed, build fix after r219238
1744         https://bugs.webkit.org/show_bug.cgi?id=174081
1745
1746         * wtf/Threading.cpp:
1747         (WTF::Thread::addToThreadGroup):
1748
1749 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1750
1751         [WTF] Implement WTF::ThreadGroup
1752         https://bugs.webkit.org/show_bug.cgi?id=174081
1753
1754         Reviewed by Mark Lam.
1755
1756         This patch implements WTF::ThreadGroup. It implements core of JSC::MachineThreads with more reliable way.
1757         JSC::MachineThreads was complicated because of managing dead threads. Each JSC::MachineThreads has its
1758         own TLS with a registered destructor. And everytime a thread dies, the registered TLS destructor is called.
1759         And this destructor will remove the current dying thread from JSC::MachineThreads.
1760
1761         However the above implementation is tricky. And each JSC::MachineThreads requires own TLS space, which is
1762         not considered in WTF's Windows ThreadSpecific implementation. Current design works well since we only
1763         have small number of MachineThreads right now.
1764
1765         Instead, we use more reliable way. After introducing WTF::Thread, WTF::Thread has WTF::Thread::didExit,
1766         which is called when associated TLS (with WTF::Thread) is destroyed. We leverage this mechanism to remove
1767         WTF::Thread from MachineThreads.
1768
1769         This patch introduces WTF::ThreadGroup. It is tightly integrated with WTF::Thread: WTF::Thread knows
1770         ThreadGroups which includes this thread. And WTF::ThreadGroup of course knows WTF::Threads added to it.
1771         WTF::Thread::didExit carefully remove itself from WTF::ThreadGroups.
1772
1773         The most important part of this patch is locking. WTF::Thread can die. And WTF::ThreadGroup can die.
1774         If we take a design using two fine grain locks in WTF::Thread and WTF::ThreadGroup, we easily encounter
1775         dead lock. Consider the following case.
1776
1777         1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold a lock of THG, and hold a lock of TH (locking order is THG -> TH).
1778         2. When TH dies, TH need to hold a lock of TH to iterate THGs. And we hold a lock of THG to unregister TH from it (locking order is TH -> THG).
1779         3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (locking order is THG -> TH).
1780         4. When destroying THG, we need to hold a lock of TH to unregister THG from TH. We can hold a lock of THG before that (locking order is THG -> TH).
1781
1782         Then, it easily causes dead lock. We cannot swap the locking order of (2) since iterating THG requires a lock of TH.
1783         To solve this problem, we introduce one global lock ThreadGroup::destructionMutex (GL).
1784
1785         1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold GL, and hold a lock of THG. Do not hold a
1786         lock of TH. TH's thread groups information is guarded by GL instead of a lock of TH (locking order is GL -> THG).
1787         2. When TH dies, TH need to hold GL to iterate THGs. And we hold a lock of THG to unregister TH from it (locking order is GL -> THG).
1788         3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (locking order is THG -> TH).
1789         4. When destroying THG, we need to hold GL to unregister THG from TH. We can hold a lock of THG after that (locking order is GL -> THG).
1790
1791         We still have a lock of THG. By separating GL and THG's lock, we can hold a lock of THG while completely unrelated TH is destructed which takes a lock of GL and unrelated THG.
1792
1793         * WTF.xcodeproj/project.pbxproj:
1794         * wtf/AutomaticThread.cpp:
1795         * wtf/CMakeLists.txt:
1796         * wtf/CrossThreadCopier.h:
1797         * wtf/ParkingLot.h:
1798         * wtf/ThreadGroup.cpp: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
1799         (WTF::ThreadGroup::destructionMutex):
1800         (WTF::ThreadGroup::~ThreadGroup):
1801         (WTF::ThreadGroup::add):
1802         (WTF::ThreadGroup::addCurrentThread):
1803         (WTF::ThreadGroup::removeCurrentThread):
1804         * wtf/ThreadGroup.h: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
1805         (WTF::ThreadGroup::create):
1806         (WTF::ThreadGroup::threads):
1807         (WTF::ThreadGroup::getLock):
1808         * wtf/Threading.cpp:
1809         (WTF::Thread::didExit):
1810         (WTF::Thread::addToThreadGroup):
1811         (WTF::Thread::removeFromThreadGroup):
1812         * wtf/Threading.h:
1813         (WTF::Thread::canAddToThreadGroup):
1814
1815 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
1816
1817         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
1818         https://bugs.webkit.org/show_bug.cgi?id=174150
1819
1820         Reviewed by Mark Lam.
1821
1822         This patch cleans up StringStatics.cpp and remove it from the tree.
1823
1824         1. Move StringImpl methods to appropriate place, "StringImpl.cpp".
1825
1826         StringImpl::hashSlowCase() and StringImpl::concurrentHash() are defined in
1827         StringStatics.cpp. But they should be defined in StringImpl.cpp.
1828         This patch just moves them to StringImpl.cpp.
1829
1830         2. Use LazyNeverDestroyed to initialize AtomicString atoms like emptyAtom.
1831
1832         Previously, we initialized AtomicString atoms like emptyAtom in a hacky way.
1833         We first define them as extern global variables. However, AtomicString has
1834         a non-trivial constructor. Thus, we cannot do this because it requires global
1835         constructor calls. This is why we have StringStatics.cpp. In this file, we
1836         include "StaticConstructors.h". After including this file, all the global
1837         constructor call disabled in Windows. And in GCC environment, we allocate
1838         void* storage for that variable. And we use placement new in AtomicString::init()
1839         to initialize these storage.
1840         However, we already have better way for that: LazyNeverDestroyed. It just allocates
1841         storage like the above. And it does not have any global constructors. Thus
1842         we can just declare it as a global variable. And we initialize them lazily in
1843         AtomicString::init(). This way effectively avoids "StaticConstructors.h" hacky way.
1844         And it makes "StringStatics.cpp" unnecessary.
1845         Then, we just move these variables and AtomicString::init() to AtomicString.cpp.
1846
1847         And we also change emptyAtom to emptyAtom() to get the value from LazyNeverDestroyed<>.
1848
1849         * WTF.xcodeproj/project.pbxproj:
1850         * wtf/CMakeLists.txt:
1851         * wtf/text/AtomicString.cpp:
1852         (WTF::AtomicString::convertASCIICase):
1853         (WTF::AtomicString::fromUTF8Internal):
1854         (WTF::AtomicString::init):
1855         * wtf/text/AtomicString.h:
1856         (WTF::nullAtom):
1857         (WTF::emptyAtom):
1858         (WTF::starAtom):
1859         (WTF::xmlAtom):
1860         (WTF::xmlnsAtom):
1861         (WTF::AtomicString::fromUTF8):
1862         * wtf/text/StringBuilder.h:
1863         (WTF::StringBuilder::toAtomicString):
1864         * wtf/text/StringImpl.cpp:
1865         (WTF::StringImpl::hashSlowCase):
1866         (WTF::StringImpl::concurrentHash):
1867         * wtf/text/StringStatics.cpp: Removed.
1868
1869 2017-07-06  Keith Miller  <keith_miller@apple.com>
1870
1871         Add extra insurance to prevent clang from making crash traces sad
1872         https://bugs.webkit.org/show_bug.cgi?id=174231
1873
1874         Reviewed by Saam Barati.
1875
1876         This patch makes it slightly harder for Clang to coalesce our crash calls.
1877         Additionally, it also makes Clang never tail call the WTFCrashWithInfo so
1878         our stack trace should always be "reasonable".
1879
1880         * wtf/Assertions.h:
1881         * wtf/Compiler.h:
1882
1883 2017-07-06  Matt Lewis  <jlewis3@apple.com>
1884
1885         Unreviewed, rolling out r219178.
1886
1887         This caused a consistent failure with the API test
1888         StringBuilderTest.ToAtomicStringOnEmpty on all Debug testers.
1889
1890         Reverted changeset:
1891
1892         "[WTF] Clean up StringStatics.cpp by using
1893         LazyNeverDestroyed<> for Atoms"
1894         https://bugs.webkit.org/show_bug.cgi?id=174150
1895         http://trac.webkit.org/changeset/219178
1896
1897 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
1898
1899         [WTF] Move SoftLinking.h into WTF
1900         https://bugs.webkit.org/show_bug.cgi?id=174000
1901
1902         Reviewed by Alex Christensen.
1903
1904         * WTF.xcodeproj/project.pbxproj:
1905         * wtf/SoftLinking.h: Copied from Source/WebCore/platform/ios/QuickLookSoftLink.mm.
1906         * wtf/cocoa/SoftLinking.h: Renamed from Source/WebCore/platform/cocoa/SoftLinking.h.
1907         * wtf/win/SoftLinking.h: Renamed from Source/WebCore/platform/win/SoftLinking.h.
1908
1909 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1910
1911         Upgrade GCC baseline
1912         https://bugs.webkit.org/show_bug.cgi?id=174155
1913
1914         Reviewed by Michael Catanzaro.
1915
1916         * wtf/Compiler.h:
1917
1918 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1919
1920         WTF::StringImpl::copyChars segfaults when built with GCC 7
1921         https://bugs.webkit.org/show_bug.cgi?id=173407
1922
1923         Reviewed by Andreas Kling.
1924
1925         With GCC 7, StringImpl::copyChars() behaves as unexpected.
1926         This function violates strict aliasing rule.
1927
1928         This optimization is originally introduced to improve performance
1929         in SunSpider's string tests in 2008. When running it in my Linux
1930         box, it no longer causes any observable difference. So, we just
1931         remove this optimization.
1932
1933                                         baseline                  patched
1934
1935         string-base64                7.7544+-0.1761            7.6138+-0.2071          might be 1.0185x faster
1936         string-fasta                10.5429+-0.2746     ?     10.7500+-0.2669        ? might be 1.0196x slower
1937         string-tagcloud             14.8588+-0.2828           14.8039+-0.3039
1938         string-unpack-code          36.1769+-0.4251           35.3397+-0.5398          might be 1.0237x faster
1939         string-validate-input        8.5182+-0.2206            8.3514+-0.2179          might be 1.0200x faster
1940
1941         * wtf/text/StringImpl.h:
1942         (WTF::StringImpl::copyChars):
1943
1944 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1945
1946         Use std::lock_guard instead of std::unique_lock if move semantics and try_lock is not necessary
1947         https://bugs.webkit.org/show_bug.cgi?id=174148
1948
1949         Reviewed by Mark Lam.
1950
1951         It is not necessary to use std::unique_lock if we do not use additional features compared to std::lock_guard.
1952
1953         (WTF::ThreadHolder::get):
1954         (WTF::ThreadHolder::initialize):
1955         (WTF::ThreadHolder::destruct):
1956         * wtf/Threading.cpp:
1957         (WTF::Thread::didExit):
1958         * wtf/ThreadingPthreads.cpp:
1959         (WTF::Thread::changePriority):
1960         (WTF::Thread::waitForCompletion):
1961         (WTF::Thread::detach):
1962         (WTF::Thread::signal):
1963         (WTF::Thread::resume):
1964         (WTF::Thread::getRegisters):
1965         (WTF::Thread::establish):
1966         * wtf/ThreadingWin.cpp:
1967         (WTF::Thread::changePriority):
1968         (WTF::Thread::waitForCompletion):
1969         (WTF::Thread::detach):
1970         (WTF::Thread::resume):
1971         (WTF::Thread::getRegisters):
1972         (WTF::Thread::establish):
1973         * wtf/WordLock.cpp:
1974         (WTF::WordLockBase::unlockSlow):
1975
1976 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1977
1978         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
1979         https://bugs.webkit.org/show_bug.cgi?id=174150
1980
1981         Reviewed by Mark Lam.
1982
1983         This patch cleans up StringStatics.cpp and remove it from the tree.
1984
1985         1. Move StringImpl methods to appropriate place, "StringImpl.cpp".
1986
1987         StringImpl::hashSlowCase() and StringImpl::concurrentHash() are defined in
1988         StringStatics.cpp. But they should be defined in StringImpl.cpp.
1989         This patch just moves them to StringImpl.cpp.
1990
1991         2. Use LazyNeverDestroyed to initialize AtomicString atoms like emptyAtom.
1992
1993         Previously, we initialized AtomicString atoms like emptyAtom in a hacky way.
1994         We first define them as extern global variables. However, AtomicString has
1995         a non-trivial constructor. Thus, we cannot do this because it requires global
1996         constructor calls. This is why we have StringStatics.cpp. In this file, we
1997         include "StaticConstructors.h". After including this file, all the global
1998         constructor call disabled in Windows. And in GCC environment, we allocate
1999         void* storage for that variable. And we use placement new in AtomicString::init()
2000         to initialize these storage.
2001         However, we already have better way for that: LazyNeverDestroyed. It just allocates
2002         storage like the above. And it does not have any global constructors. Thus
2003         we can just declare it as a global variable. And we initialize them lazily in
2004         AtomicString::init(). This way effectively avoids "StaticConstructors.h" hacky way.
2005         And it makes "StringStatics.cpp" unnecessary.
2006         Then, we just move these variables and AtomicString::init() to AtomicString.cpp.
2007
2008         And we also change emptyAtom to emptyAtom() to get the value from LazyNeverDestroyed<>.
2009
2010         * WTF.xcodeproj/project.pbxproj:
2011         * wtf/CMakeLists.txt:
2012         * wtf/text/AtomicString.cpp:
2013         (WTF::AtomicString::convertASCIICase):
2014         (WTF::AtomicString::fromUTF8Internal):
2015         (WTF::AtomicString::init):
2016         * wtf/text/AtomicString.h:
2017         (WTF::nullAtom):
2018         (WTF::emptyAtom):
2019         (WTF::starAtom):
2020         (WTF::xmlAtom):
2021         (WTF::xmlnsAtom):
2022         (WTF::AtomicString::fromUTF8):
2023         * wtf/text/StringBuilder.h:
2024         (WTF::StringBuilder::toAtomicString):
2025         * wtf/text/StringImpl.cpp:
2026         (WTF::StringImpl::hashSlowCase):
2027         (WTF::StringImpl::concurrentHash):
2028         * wtf/text/StringStatics.cpp: Removed.
2029
2030 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2031
2032         WTF::Thread should have the threads stack bounds.
2033         https://bugs.webkit.org/show_bug.cgi?id=173975
2034
2035         Reviewed by Keith Miller.
2036
2037         We move StackBounds from WTFThreadData to WTF::Thread.
2038         One important thing is that we should make valid StackBounds
2039         visible to Thread::create() caller. When the caller get
2040         WTF::Thread from Thread::create(), this WTF::Thread should
2041         have a valid StackBounds. But StackBounds information can be
2042         retrived only in the WTF::Thread's thread itself.
2043
2044         We also clean up WTF::initializeThreading. StringImpl::empty()
2045         is now statically initialized by using constexpr constructor.
2046         Thus we do not need to call StringImpl::empty() explicitly here.
2047         And WTF::initializeThreading() does not have any main thread
2048         affinity right now in all the platforms. So we fix the comment
2049         in Threading.h. Then, now, WTF::initializeThreading() is called
2050         in UI thread when using Web thread in iOS.
2051
2052         * wtf/StackBounds.h:
2053         (WTF::StackBounds::emptyBounds):
2054         (WTF::StackBounds::StackBounds):
2055         * wtf/StackStats.cpp:
2056         (WTF::StackStats::PerThreadStats::PerThreadStats):
2057         * wtf/Threading.cpp:
2058         (WTF::threadEntryPoint):
2059         (WTF::Thread::create):
2060         (WTF::Thread::currentMayBeNull):
2061         (WTF::Thread::initialize):
2062         (WTF::initializeThreading):
2063         * wtf/Threading.h:
2064         (WTF::Thread::stack):
2065         * wtf/ThreadingPthreads.cpp:
2066         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
2067         (WTF::Thread::current):
2068         (WTF::initializeCurrentThreadEvenIfNonWTFCreated): Deleted.
2069         (WTF::Thread::currentMayBeNull): Deleted.
2070         * wtf/ThreadingWin.cpp:
2071         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
2072         (WTF::Thread::initializeCurrentThreadInternal):
2073         (WTF::Thread::current):
2074         * wtf/WTFThreadData.cpp:
2075         (WTF::WTFThreadData::WTFThreadData):
2076         * wtf/WTFThreadData.h:
2077         (WTF::WTFThreadData::stack): Deleted.
2078
2079 2017-07-05  Keith Miller  <keith_miller@apple.com>
2080
2081         Crashing with information should have an abort reason
2082         https://bugs.webkit.org/show_bug.cgi?id=174185
2083
2084         Reviewed by Saam Barati.
2085
2086         Fix an ifdef to actually work with X86_64. It turns out X64_64 is
2087         not an architecture... Whoops.
2088
2089         * wtf/Assertions.cpp:
2090
2091 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
2092
2093         Remove copy of ICU headers from WebKit
2094         https://bugs.webkit.org/show_bug.cgi?id=116407
2095
2096         Reviewed by Alex Christensen.
2097
2098         Add an extra rsync command to CopyWTFHeaders which copies the ICU headers
2099         to DSTROOT/usr/local/include/. These headers already live inside a
2100         "unicode" folder, so an example path of a header is
2101         DSTROOT/usr/local/include/unicode/uchar.h. This is already in the search
2102         path of the other WebKit projects, so those other projects can remove
2103         their explicit listing of the old place these headers lived.
2104
2105         Also add the remaining ICU 55.1 headers which the other projects (like
2106         WebCore) need. Revert any local changes to these headers in favor of
2107         using the GCC_PREPROCESSOR_DEFINITIONS build setting. This is so we can
2108         compile the same way against unmodified headers.
2109
2110         * Configurations/Base.xcconfig:
2111         * Configurations/CopyWTFHeaders.xcconfig:
2112         * WTF.xcodeproj/project.pbxproj:
2113         * icu/unicode/alphaindex.h: Added.
2114         * icu/unicode/appendable.h: Added.
2115         * icu/unicode/basictz.h: Added.
2116         * icu/unicode/brkiter.h: Added.
2117         (BreakIterator::isBufferClone):
2118         * icu/unicode/bytestrie.h: Added.
2119         * icu/unicode/bytestriebuilder.h: Added.
2120         * icu/unicode/calendar.h: Added.
2121         (Calendar::createInstance):
2122         (Calendar::roll):
2123         (Calendar::internalSet):
2124         (Calendar::weekNumber):
2125         * icu/unicode/caniter.h: Added.
2126         * icu/unicode/chariter.h: Renamed from Source/WebCore/icu/unicode/chariter.h.
2127         * icu/unicode/choicfmt.h: Added.
2128         * icu/unicode/coleitr.h: Added.
2129         (CollationElementIterator::primaryOrder):
2130         (CollationElementIterator::secondaryOrder):
2131         (CollationElementIterator::tertiaryOrder):
2132         (CollationElementIterator::isIgnorable):
2133         * icu/unicode/coll.h: Added.
2134         * icu/unicode/compactdecimalformat.h: Added.
2135         * icu/unicode/curramt.h: Added.
2136         (CurrencyAmount::getCurrency):
2137         (CurrencyAmount::getISOCurrency):
2138         * icu/unicode/currpinf.h: Added.
2139         (CurrencyPluralInfo::operator!=):
2140         * icu/unicode/currunit.h: Added.
2141         (CurrencyUnit::getISOCurrency):
2142         * icu/unicode/datefmt.h: Added.
2143         * icu/unicode/dbbi.h: Added.
2144         * icu/unicode/dcfmtsym.h: Added.
2145         (DecimalFormatSymbols::getSymbol):
2146         (DecimalFormatSymbols::getConstSymbol):
2147         (DecimalFormatSymbols::setSymbol):
2148         (DecimalFormatSymbols::getLocale):
2149         (DecimalFormatSymbols::getCurrencyPattern):
2150         * icu/unicode/decimfmt.h: Added.
2151         (DecimalFormat::getConstSymbol):
2152         * icu/unicode/docmain.h: Added.
2153         * icu/unicode/dtfmtsym.h: Added.
2154         * icu/unicode/dtintrv.h: Added.
2155         (DateInterval::getFromDate):
2156         (DateInterval::getToDate):
2157         (DateInterval::operator!=):
2158         * icu/unicode/dtitvfmt.h: Added.
2159         (DateIntervalFormat::operator!=):
2160         * icu/unicode/dtitvinf.h: Added.
2161         (DateIntervalInfo::operator!=):
2162         * icu/unicode/dtptngen.h: Added.
2163         * icu/unicode/dtrule.h: Added.
2164         * icu/unicode/enumset.h: Added.
2165         (EnumSet::EnumSet):
2166         (EnumSet::~EnumSet):
2167         (EnumSet::clear):
2168         (EnumSet::add):
2169         (EnumSet::remove):
2170         (EnumSet::contains):
2171         (EnumSet::set):
2172         (EnumSet::get):
2173         (EnumSet::isValidEnum):
2174         (EnumSet::isValidValue):
2175         (EnumSet::operator=):
2176         (EnumSet::getAll):
2177         (EnumSet::flag):
2178         * icu/unicode/errorcode.h: Added.
2179         * icu/unicode/fieldpos.h: Added.
2180         (FieldPosition::operator=):
2181         (FieldPosition::operator==):
2182         (FieldPosition::operator!=):
2183         * icu/unicode/filteredbrk.h: Added.
2184         * icu/unicode/fmtable.h: Added.
2185         (Formattable::getDate):
2186         (Formattable::getString):
2187         (Formattable::getLong):
2188         (Formattable::toUFormattable):
2189         (Formattable::fromUFormattable):
2190         * icu/unicode/format.h: Added.
2191         * icu/unicode/fpositer.h: Added.
2192         * icu/unicode/gender.h: Added.
2193         * icu/unicode/gregocal.h: Added.
2194         * icu/unicode/icudataver.h: Added.
2195         * icu/unicode/icuplug.h: Added.
2196         * icu/unicode/idna.h: Added.
2197         * icu/unicode/listformatter.h: Added.
2198         (ListFormatData::ListFormatData):
2199         * icu/unicode/locdspnm.h: Added.
2200         (LocaleDisplayNames::createInstance):
2201         * icu/unicode/locid.h: Added.
2202         (Locale::operator!=):
2203         (Locale::getCountry):
2204         (Locale::getLanguage):
2205         (Locale::getScript):
2206         (Locale::getVariant):
2207         (Locale::getName):
2208         (Locale::isBogus):
2209         * icu/unicode/measfmt.h: Added.
2210         * icu/unicode/measunit.h: Added.
2211         * icu/unicode/measure.h: Added.
2212         (Measure::getNumber):
2213         (Measure::getUnit):
2214         * icu/unicode/messagepattern.h: Added.
2215         * icu/unicode/msgfmt.h: Added.
2216         * icu/unicode/normalizer2.h: Added.
2217         * icu/unicode/normlzr.h: Added.
2218         (Normalizer::operator!= ):
2219         (Normalizer::quickCheck):
2220         (Normalizer::isNormalized):
2221         (Normalizer::compare):
2222         * icu/unicode/numfmt.h: Added.
2223         (NumberFormat::isParseIntegerOnly):
2224         (NumberFormat::isLenient):
2225         * icu/unicode/numsys.h: Added.
2226         * icu/unicode/parsepos.h: Added.
2227         (ParsePosition::operator=):
2228         (ParsePosition::operator==):
2229         (ParsePosition::operator!=):
2230         (ParsePosition::getIndex):
2231         (ParsePosition::setIndex):
2232         (ParsePosition::getErrorIndex):
2233         (ParsePosition::setErrorIndex):
2234         * icu/unicode/plurfmt.h: Added.
2235         * icu/unicode/plurrule.h: Added.
2236         * icu/unicode/rbbi.h: Added.
2237         (RuleBasedBreakIterator::operator!=):
2238         * icu/unicode/rbnf.h: Added.
2239         (RuleBasedNumberFormat::isLenient):
2240         (RuleBasedNumberFormat::getDefaultRuleSet):
2241         * icu/unicode/rbtz.h: Added.
2242         * icu/unicode/regex.h: Added.
2243         * icu/unicode/region.h: Added.
2244         * icu/unicode/reldatefmt.h: Added.
2245         * icu/unicode/resbund.h: Added.
2246         * icu/unicode/schriter.h: Added.
2247         * icu/unicode/scientificnumberformatter.h: Added.
2248         * icu/unicode/search.h: Added.
2249         (SearchIterator::operator!=):
2250         * icu/unicode/selfmt.h: Added.
2251         * icu/unicode/simpletz.h: Added.
2252         (SimpleTimeZone::setStartRule):
2253         (SimpleTimeZone::setEndRule):
2254         (SimpleTimeZone::getOffset):
2255         * icu/unicode/smpdtfmt.h: Added.
2256         (SimpleDateFormat::get2DigitYearStart):
2257         * icu/unicode/sortkey.h: Added.
2258         (CollationKey::operator!=):
2259         (CollationKey::isBogus):
2260         (CollationKey::getByteArray):
2261         * icu/unicode/stringtriebuilder.h: Added.
2262         * icu/unicode/stsearch.h: Added.
2263         * icu/unicode/symtable.h: Added.
2264         * icu/unicode/tblcoll.h: Added.
2265         * icu/unicode/timezone.h: Added.
2266         (TimeZone::getID):
2267         (TimeZone::setID):
2268         * icu/unicode/tmunit.h: Added.
2269         * icu/unicode/tmutamt.h: Added.
2270         (TimeUnitAmount::operator!=):
2271         * icu/unicode/tmutfmt.h: Added.
2272         (TimeUnitFormat::operator!=):
2273         * icu/unicode/translit.h: Added.
2274         (Transliterator::getMaximumContextLength):
2275         (Transliterator::setID):
2276         (Transliterator::integerToken):
2277         (Transliterator::pointerToken):
2278         * icu/unicode/tzfmt.h: Added.
2279         * icu/unicode/tznames.h: Added.
2280         * icu/unicode/tzrule.h: Added.
2281         * icu/unicode/tztrans.h: Added.
2282         * icu/unicode/ubidi.h: Added.
2283         * icu/unicode/ucal.h: Renamed from Source/JavaScriptCore/icu/unicode/ucal.h.
2284         * icu/unicode/ucasemap.h: Added.
2285         * icu/unicode/ucat.h: Added.
2286         * icu/unicode/ucharstrie.h: Added.
2287         * icu/unicode/ucharstriebuilder.h: Added.
2288         * icu/unicode/uchriter.h: Added.
2289         * icu/unicode/uclean.h: Added.
2290         * icu/unicode/ucnv_cb.h: Renamed from Source/WebCore/icu/unicode/ucnv_cb.h.
2291         * icu/unicode/ucnvsel.h: Added.
2292         * icu/unicode/ucoleitr.h: Renamed from Source/WebCore/icu/unicode/ucoleitr.h.
2293         * icu/unicode/uconfig.h:
2294         * icu/unicode/ucsdet.h: Renamed from Source/WebCore/icu/unicode/ucsdet.h.
2295         * icu/unicode/udat.h: Renamed from Source/JavaScriptCore/icu/unicode/udat.h.
2296         * icu/unicode/udata.h: Added.
2297         * icu/unicode/udateintervalformat.h: Added.
2298         * icu/unicode/udatpg.h: Renamed from Source/JavaScriptCore/icu/unicode/udatpg.h.
2299         * icu/unicode/udisplaycontext.h: Renamed from Source/JavaScriptCore/icu/unicode/udisplaycontext.h.
2300         * icu/unicode/ufieldpositer.h: Renamed from Source/JavaScriptCore/icu/unicode/ufieldpositer.h.
2301         * icu/unicode/uformattable.h: Renamed from Source/JavaScriptCore/icu/unicode/uformattable.h.
2302         * icu/unicode/ugender.h: Added.
2303         * icu/unicode/uidna.h: Renamed from Source/WebCore/icu/unicode/uidna.h.
2304         * icu/unicode/uldnames.h: Added.
2305         * icu/unicode/ulistformatter.h: Added.
2306         * icu/unicode/ulocdata.h: Added.
2307         * icu/unicode/umisc.h: Renamed from Source/JavaScriptCore/icu/unicode/umisc.h.
2308         * icu/unicode/umsg.h: Added.
2309         * icu/unicode/unifilt.h: Added.
2310         * icu/unicode/unifunct.h: Added.
2311         * icu/unicode/unimatch.h: Added.
2312         * icu/unicode/unirepl.h: Added.
2313         * icu/unicode/uniset.h: Added.
2314         (UnicodeSet::operator!=):
2315         (UnicodeSet::isFrozen):
2316         (UnicodeSet::containsSome):
2317         (UnicodeSet::isBogus):
2318         (UnicodeSet::fromUSet):
2319         (UnicodeSet::toUSet):
2320         (UnicodeSet::span):
2321         (UnicodeSet::spanBack):
2322         * icu/unicode/unum.h: Renamed from Source/JavaScriptCore/icu/unicode/unum.h.
2323         * icu/unicode/unumsys.h: Renamed from Source/JavaScriptCore/icu/unicode/unumsys.h.
2324         * icu/unicode/upluralrules.h: Added.
2325         * icu/unicode/uregex.h: Added.
2326         * icu/unicode/uregion.h: Added.
2327         * icu/unicode/urep.h: Added.
2328         * icu/unicode/ures.h: Added.
2329         (ures_getUnicodeString):
2330         (ures_getNextUnicodeString):
2331         (ures_getUnicodeStringByIndex):
2332         (ures_getUnicodeStringByKey):
2333         * icu/unicode/usearch.h: Renamed from Source/WebCore/icu/unicode/usearch.h.
2334         * icu/unicode/usetiter.h: Added.
2335         (UnicodeSetIterator::isString):
2336         (UnicodeSetIterator::getCodepoint):
2337         (UnicodeSetIterator::getCodepointEnd):
2338         * icu/unicode/ushape.h: Renamed from Source/WebCore/icu/unicode/ushape.h.
2339         * icu/unicode/uspoof.h: Added.
2340         * icu/unicode/usprep.h: Added.
2341         * icu/unicode/ustdio.h: Added.
2342         * icu/unicode/ustream.h: Added.
2343         * icu/unicode/ustringtrie.h: Added.
2344         * icu/unicode/utf32.h: Added.
2345         * icu/unicode/utmscale.h: Added.
2346         * icu/unicode/utrace.h: Added.
2347         * icu/unicode/utrans.h: Added.
2348         * icu/unicode/utypes.h:
2349         * icu/unicode/vtzone.h: Added.
2350
2351 2017-07-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2352
2353         [WTF] Make double-conversion's cache data constant and drop double_conversion::initialize()
2354         https://bugs.webkit.org/show_bug.cgi?id=174124
2355
2356         Reviewed by Saam Barati.
2357
2358         We annotate double-conversion's cache data as const and constexpr. And move it out of function.
2359         Since they are not involving global constructors, they are compiled as rodata and initialized
2360         without calling double_conversion::initialize().
2361
2362         And we drop double_conversion::initialize() function since it is no longer necessary.
2363
2364         * wtf/Threading.cpp:
2365         (WTF::initializeThreading):
2366         * wtf/dtoa/cached-powers.cc:
2367         * wtf/dtoa/cached-powers.h:
2368
2369 2017-07-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2370
2371         [WTF] Initialize srandom and srand with cryptographically random number
2372         https://bugs.webkit.org/show_bug.cgi?id=174123
2373
2374         Reviewed by Mark Lam.
2375
2376         Use cryptographically random number instead of current time as a seed.
2377
2378         * wtf/RandomNumberSeed.h:
2379         (WTF::initializeRandomNumberGenerator):
2380
2381 2017-07-04  Joseph Pecoraro  <pecoraro@apple.com>
2382
2383         Xcode duplicate UUID for DisallowCType.h and DispatchPtr.h
2384         https://bugs.webkit.org/show_bug.cgi?id=174117
2385
2386         Reviewed by Alexey Proskuryakov.
2387
2388         * WTF.xcodeproj/project.pbxproj:
2389         Give DisallowCType.h and DispatchPtr.h different UUIDs.
2390
2391 2017-07-03  Saam Barati  <sbarati@apple.com>
2392
2393         LayoutTest workers/bomb.html is a Crash
2394         https://bugs.webkit.org/show_bug.cgi?id=167757
2395         <rdar://problem/33086462>
2396
2397         Reviewed by Keith Miller.
2398
2399         * wtf/AutomaticThread.cpp:
2400         (WTF::AutomaticThreadCondition::waitFor):
2401         * wtf/AutomaticThread.h:
2402
2403 2017-07-03  Commit Queue  <commit-queue@webkit.org>
2404
2405         Unreviewed, rolling out r219060.
2406         https://bugs.webkit.org/show_bug.cgi?id=174108
2407
2408         crashing constantly when initializing UIWebView (Requested by
2409         thorton on #webkit).
2410
2411         Reverted changeset:
2412
2413         "WTF::Thread should have the threads stack bounds."
2414         https://bugs.webkit.org/show_bug.cgi?id=173975
2415         http://trac.webkit.org/changeset/219060
2416
2417 2017-07-03  Matt Lewis  <jlewis3@apple.com>
2418
2419         Unreviewed, rolling out r219103.
2420
2421         Caused multiple build failures.
2422
2423         Reverted changeset:
2424
2425         "Remove copy of ICU headers from WebKit"
2426         https://bugs.webkit.org/show_bug.cgi?id=116407
2427         http://trac.webkit.org/changeset/219103
2428
2429 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
2430
2431         Remove copy of ICU headers from WebKit
2432         https://bugs.webkit.org/show_bug.cgi?id=116407
2433
2434         Reviewed by Alex Christensen.
2435
2436         Add an extra rsync command to CopyWTFHeaders which copies the ICU headers
2437         to DSTROOT/usr/local/include/. These headers already live inside a
2438         "unicode" folder, so an example path of a header is
2439         DSTROOT/usr/local/include/unicode/uchar.h. This is already in the search
2440         path of the other WebKit projects, so those other projects can remove
2441         their explicit listing of the old place these headers lived.
2442
2443         Also add the remaining ICU 55.1 headers which the other projects (like
2444         WebCore) need. Revert any local changes to these headers in favor of
2445         using the GCC_PREPROCESSOR_DEFINITIONS build setting. This is so we can
2446         compile the same way against unmodified headers.
2447
2448         * Configurations/Base.xcconfig:
2449         * Configurations/CopyWTFHeaders.xcconfig:
2450         * WTF.xcodeproj/project.pbxproj:
2451         * icu/unicode/alphaindex.h: Added.
2452         * icu/unicode/appendable.h: Added.
2453         * icu/unicode/basictz.h: Added.
2454         * icu/unicode/brkiter.h: Added.
2455         (BreakIterator::isBufferClone):
2456         * icu/unicode/bytestrie.h: Added.
2457         * icu/unicode/bytestriebuilder.h: Added.
2458         * icu/unicode/calendar.h: Added.
2459         (Calendar::createInstance):
2460         (Calendar::roll):
2461         (Calendar::internalSet):
2462         (Calendar::weekNumber):
2463         * icu/unicode/caniter.h: Added.
2464         * icu/unicode/chariter.h: Renamed from Source/WebCore/icu/unicode/chariter.h.
2465         * icu/unicode/choicfmt.h: Added.
2466         * icu/unicode/coleitr.h: Added.
2467         (CollationElementIterator::primaryOrder):
2468         (CollationElementIterator::secondaryOrder):
2469         (CollationElementIterator::tertiaryOrder):
2470         (CollationElementIterator::isIgnorable):
2471         * icu/unicode/coll.h: Added.
2472         * icu/unicode/compactdecimalformat.h: Added.
2473         * icu/unicode/curramt.h: Added.
2474         (CurrencyAmount::getCurrency):
2475         (CurrencyAmount::getISOCurrency):
2476         * icu/unicode/currpinf.h: Added.
2477         (CurrencyPluralInfo::operator!=):
2478         * icu/unicode/currunit.h: Added.
2479         (CurrencyUnit::getISOCurrency):
2480         * icu/unicode/datefmt.h: Added.
2481         * icu/unicode/dbbi.h: Added.
2482         * icu/unicode/dcfmtsym.h: Added.
2483         (DecimalFormatSymbols::getSymbol):
2484         (DecimalFormatSymbols::getConstSymbol):
2485         (DecimalFormatSymbols::setSymbol):
2486         (DecimalFormatSymbols::getLocale):
2487         (DecimalFormatSymbols::getCurrencyPattern):
2488         * icu/unicode/decimfmt.h: Added.
2489         (DecimalFormat::getConstSymbol):
2490         * icu/unicode/docmain.h: Added.
2491         * icu/unicode/dtfmtsym.h: Added.
2492         * icu/unicode/dtintrv.h: Added.
2493         (DateInterval::getFromDate):
2494         (DateInterval::getToDate):
2495         (DateInterval::operator!=):
2496         * icu/unicode/dtitvfmt.h: Added.
2497         (DateIntervalFormat::operator!=):
2498         * icu/unicode/dtitvinf.h: Added.
2499         (DateIntervalInfo::operator!=):
2500         * icu/unicode/dtptngen.h: Added.
2501         * icu/unicode/dtrule.h: Added.
2502         * icu/unicode/enumset.h: Added.
2503         (EnumSet::EnumSet):
2504         (EnumSet::~EnumSet):
2505         (EnumSet::clear):
2506         (EnumSet::add):
2507         (EnumSet::remove):
2508         (EnumSet::contains):
2509         (EnumSet::set):
2510         (EnumSet::get):
2511         (EnumSet::isValidEnum):
2512         (EnumSet::isValidValue):
2513         (EnumSet::operator=):
2514         (EnumSet::getAll):
2515         (EnumSet::flag):
2516         * icu/unicode/errorcode.h: Added.
2517         * icu/unicode/fieldpos.h: Added.
2518         (FieldPosition::operator=):
2519         (FieldPosition::operator==):
2520         (FieldPosition::operator!=):
2521         * icu/unicode/filteredbrk.h: Added.
2522         * icu/unicode/fmtable.h: Added.
2523         (Formattable::getDate):
2524         (Formattable::getString):
2525         (Formattable::getLong):
2526         (Formattable::toUFormattable):
2527         (Formattable::fromUFormattable):
2528         * icu/unicode/format.h: Added.
2529         * icu/unicode/fpositer.h: Added.
2530         * icu/unicode/gender.h: Added.
2531         * icu/unicode/gregocal.h: Added.
2532         * icu/unicode/icudataver.h: Added.
2533         * icu/unicode/icuplug.h: Added.
2534         * icu/unicode/idna.h: Added.
2535         * icu/unicode/listformatter.h: Added.
2536         (ListFormatData::ListFormatData):
2537         * icu/unicode/locdspnm.h: Added.
2538         (LocaleDisplayNames::createInstance):
2539         * icu/unicode/locid.h: Added.
2540         (Locale::operator!=):
2541         (Locale::getCountry):
2542         (Locale::getLanguage):
2543         (Locale::getScript):
2544         (Locale::getVariant):
2545         (Locale::getName):
2546         (Locale::isBogus):
2547         * icu/unicode/measfmt.h: Added.
2548         * icu/unicode/measunit.h: Added.
2549         * icu/unicode/measure.h: Added.
2550         (Measure::getNumber):
2551         (Measure::getUnit):
2552         * icu/unicode/messagepattern.h: Added.
2553         * icu/unicode/msgfmt.h: Added.
2554         * icu/unicode/normalizer2.h: Added.
2555         * icu/unicode/normlzr.h: Added.
2556         (Normalizer::operator!= ):
2557         (Normalizer::quickCheck):
2558         (Normalizer::isNormalized):
2559         (Normalizer::compare):
2560         * icu/unicode/numfmt.h: Added.
2561         (NumberFormat::isParseIntegerOnly):
2562         (NumberFormat::isLenient):
2563         * icu/unicode/numsys.h: Added.
2564         * icu/unicode/parsepos.h: Added.
2565         (ParsePosition::operator=):
2566         (ParsePosition::operator==):
2567         (ParsePosition::operator!=):
2568         (ParsePosition::getIndex):
2569         (ParsePosition::setIndex):
2570         (ParsePosition::getErrorIndex):
2571         (ParsePosition::setErrorIndex):
2572         * icu/unicode/plurfmt.h: Added.
2573         * icu/unicode/plurrule.h: Added.
2574         * icu/unicode/rbbi.h: Added.
2575         (RuleBasedBreakIterator::operator!=):
2576         * icu/unicode/rbnf.h: Added.
2577         (RuleBasedNumberFormat::isLenient):
2578         (RuleBasedNumberFormat::getDefaultRuleSet):
2579         * icu/unicode/rbtz.h: Added.
2580         * icu/unicode/regex.h: Added.
2581         * icu/unicode/region.h: Added.
2582         * icu/unicode/reldatefmt.h: Added.
2583         * icu/unicode/resbund.h: Added.
2584         * icu/unicode/schriter.h: Added.
2585         * icu/unicode/scientificnumberformatter.h: Added.
2586         * icu/unicode/search.h: Added.
2587         (SearchIterator::operator!=):
2588         * icu/unicode/selfmt.h: Added.
2589         * icu/unicode/simpletz.h: Added.
2590         (SimpleTimeZone::setStartRule):
2591         (SimpleTimeZone::setEndRule):
2592         (SimpleTimeZone::getOffset):
2593         * icu/unicode/smpdtfmt.h: Added.
2594         (SimpleDateFormat::get2DigitYearStart):
2595         * icu/unicode/sortkey.h: Added.
2596         (CollationKey::operator!=):
2597         (CollationKey::isBogus):
2598         (CollationKey::getByteArray):
2599         * icu/unicode/stringtriebuilder.h: Added.
2600         * icu/unicode/stsearch.h: Added.
2601         * icu/unicode/symtable.h: Added.
2602         * icu/unicode/tblcoll.h: Added.
2603         * icu/unicode/timezone.h: Added.
2604         (TimeZone::getID):
2605         (TimeZone::setID):
2606         * icu/unicode/tmunit.h: Added.
2607         * icu/unicode/tmutamt.h: Added.
2608         (TimeUnitAmount::operator!=):
2609         * icu/unicode/tmutfmt.h: Added.
2610         (TimeUnitFormat::operator!=):
2611         * icu/unicode/translit.h: Added.
2612         (Transliterator::getMaximumContextLength):
2613         (Transliterator::setID):
2614         (Transliterator::integerToken):
2615         (Transliterator::pointerToken):
2616         * icu/unicode/tzfmt.h: Added.
2617         * icu/unicode/tznames.h: Added.
2618         * icu/unicode/tzrule.h: Added.
2619         * icu/unicode/tztrans.h: Added.
2620         * icu/unicode/ubidi.h: Added.
2621         * icu/unicode/ucal.h: Renamed from Source/JavaScriptCore/icu/unicode/ucal.h.
2622         * icu/unicode/ucasemap.h: Added.
2623         * icu/unicode/ucat.h: Added.
2624         * icu/unicode/ucharstrie.h: Added.
2625         * icu/unicode/ucharstriebuilder.h: Added.
2626         * icu/unicode/uchriter.h: Added.
2627         * icu/unicode/uclean.h: Added.
2628         * icu/unicode/ucnv_cb.h: Renamed from Source/WebCore/icu/unicode/ucnv_cb.h.
2629         * icu/unicode/ucnvsel.h: Added.
2630         * icu/unicode/ucoleitr.h: Renamed from Source/WebCore/icu/unicode/ucoleitr.h.
2631         * icu/unicode/uconfig.h:
2632         * icu/unicode/ucsdet.h: Renamed from Source/WebCore/icu/unicode/ucsdet.h.
2633         * icu/unicode/udat.h: Renamed from Source/JavaScriptCore/icu/unicode/udat.h.
2634         * icu/unicode/udata.h: Added.
2635         * icu/unicode/udateintervalformat.h: Added.
2636         * icu/unicode/udatpg.h: Renamed from Source/JavaScriptCore/icu/unicode/udatpg.h.
2637         * icu/unicode/udisplaycontext.h: Renamed from Source/JavaScriptCore/icu/unicode/udisplaycontext.h.
2638         * icu/unicode/ufieldpositer.h: Renamed from Source/JavaScriptCore/icu/unicode/ufieldpositer.h.
2639         * icu/unicode/uformattable.h: Renamed from Source/JavaScriptCore/icu/unicode/uformattable.h.
2640         * icu/unicode/ugender.h: Added.
2641         * icu/unicode/uidna.h: Renamed from Source/WebCore/icu/unicode/uidna.h.
2642         * icu/unicode/uldnames.h: Added.
2643         * icu/unicode/ulistformatter.h: Added.
2644         * icu/unicode/ulocdata.h: Added.
2645         * icu/unicode/umisc.h: Renamed from Source/JavaScriptCore/icu/unicode/umisc.h.
2646         * icu/unicode/umsg.h: Added.
2647         * icu/unicode/unifilt.h: Added.
2648         * icu/unicode/unifunct.h: Added.
2649         * icu/unicode/unimatch.h: Added.
2650         * icu/unicode/unirepl.h: Added.
2651         * icu/unicode/uniset.h: Added.
2652         (UnicodeSet::operator!=):
2653         (UnicodeSet::isFrozen):
2654         (UnicodeSet::containsSome):
2655         (UnicodeSet::isBogus):
2656         (UnicodeSet::fromUSet):
2657         (UnicodeSet::toUSet):
2658         (UnicodeSet::span):
2659         (UnicodeSet::spanBack):
2660         * icu/unicode/unum.h: Renamed from Source/JavaScriptCore/icu/unicode/unum.h.
2661         * icu/unicode/unumsys.h: Renamed from Source/JavaScriptCore/icu/unicode/unumsys.h.
2662         * icu/unicode/upluralrules.h: Added.
2663         * icu/unicode/uregex.h: Added.
2664         * icu/unicode/uregion.h: Added.
2665         * icu/unicode/urep.h: Added.
2666         * icu/unicode/ures.h: Added.
2667         (ures_getUnicodeString):
2668         (ures_getNextUnicodeString):
2669         (ures_getUnicodeStringByIndex):
2670         (ures_getUnicodeStringByKey):
2671         * icu/unicode/usearch.h: Renamed from Source/WebCore/icu/unicode/usearch.h.
2672         * icu/unicode/usetiter.h: Added.
2673         (UnicodeSetIterator::isString):
2674         (UnicodeSetIterator::getCodepoint):
2675         (UnicodeSetIterator::getCodepointEnd):
2676         * icu/unicode/ushape.h: Renamed from Source/WebCore/icu/unicode/ushape.h.
2677         * icu/unicode/usprep.h: Added.
2678         * icu/unicode/ustdio.h: Added.
2679         * icu/unicode/ustream.h: Added.
2680         * icu/unicode/ustringtrie.h: Added.
2681         * icu/unicode/utf32.h: Added.
2682         * icu/unicode/utmscale.h: Added.
2683         * icu/unicode/utrace.h: Added.
2684         * icu/unicode/utrans.h: Added.
2685         * icu/unicode/utypes.h:
2686         * icu/unicode/vtzone.h: Added.
2687
2688 2017-07-03  Keith Miller  <keith_miller@apple.com>
2689
2690         Fix ifndef in Assertions.h
2691         https://bugs.webkit.org/show_bug.cgi?id=174104
2692
2693         Reviewed by Saam Barati.
2694
2695         The ifndef should have been checking for
2696         CRASH_WITH_SECURITY_IMPLICATION_AND_INFO since that is what the
2697         ifndef defines.
2698
2699         * wtf/Assertions.h:
2700
2701 2017-07-03  Andy Estes  <aestes@apple.com>
2702
2703         [Xcode] Add an experimental setting to build with ccache
2704         https://bugs.webkit.org/show_bug.cgi?id=173875
2705
2706         Reviewed by Tim Horton.
2707
2708         * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.
2709
2710 2017-07-03  Daewoong Jang  <daewoong.jang@navercorp.com>
2711
2712         Remove an unused function export
2713         https://bugs.webkit.org/show_bug.cgi?id=174084
2714
2715         Reviewed by Yusuke Suzuki.
2716
2717         * wtf/Threading.h:
2718
2719 2017-07-02  Yusuke Suzuki  <utatane.tea@gmail.com>
2720
2721         WTF::Thread should have the threads stack bounds.
2722         https://bugs.webkit.org/show_bug.cgi?id=173975
2723
2724         Reviewed by Mark Lam.
2725
2726         We move StackBounds from WTFThreadData to WTF::Thread.
2727         One important thing is that we should make valid StackBounds
2728         visible to Thread::create() caller. When the caller get
2729         WTF::Thread from Thread::create(), this WTF::Thread should
2730         have a valid StackBounds. But StackBounds information can be
2731         retrived only in the WTF::Thread's thread itself.
2732
2733         * wtf/StackBounds.h:
2734         (WTF::StackBounds::emptyBounds):
2735         (WTF::StackBounds::StackBounds):
2736         * wtf/StackStats.cpp:
2737         (WTF::StackStats::PerThreadStats::PerThreadStats):
2738         * wtf/Threading.cpp:
2739         (WTF::threadEntryPoint):
2740         (WTF::Thread::create):
2741         (WTF::Thread::currentMayBeNull):
2742         (WTF::Thread::initialize):
2743         * wtf/Threading.h:
2744         (WTF::Thread::stack):
2745         * wtf/ThreadingPthreads.cpp:
2746         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
2747         (WTF::Thread::current):
2748         (WTF::initializeCurrentThreadEvenIfNonWTFCreated): Deleted.
2749         (WTF::Thread::currentMayBeNull): Deleted.
2750         * wtf/ThreadingWin.cpp:
2751         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
2752         (WTF::Thread::initializeCurrentThreadInternal):
2753         (WTF::Thread::current):
2754         * wtf/WTFThreadData.cpp:
2755         (WTF::WTFThreadData::WTFThreadData):
2756         * wtf/WTFThreadData.h:
2757         (WTF::WTFThreadData::stack): Deleted.
2758
2759 2017-07-01  Dan Bernstein  <mitz@apple.com>
2760
2761         [iOS] Remove code only needed when building for iOS 9.x
2762         https://bugs.webkit.org/show_bug.cgi?id=174068
2763
2764         Reviewed by Tim Horton.
2765
2766         * wtf/Platform.h:
2767         * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
2768         * wtf/spi/darwin/dyldSPI.h:
2769
2770 2017-07-01  Caio Lima  <ticaiolima@gmail.com>
2771
2772         [JSC] WTFGetBacktrace can return numberOfFrames == 0 in some architectures
2773         https://bugs.webkit.org/show_bug.cgi?id=172768
2774
2775         Reviewed by Mark Lam.
2776
2777         In some architectures, like ARMv6 running on a Raspberry pi, the
2778         backtrace function from "execinfo.h" is returning 0. In
2779         that case, the RELEASE_ASSERT in StackTrace::captureStackTrace
2780         fails causing a runtime crash.
2781         This patch is adding a guard for the case described above to
2782         avoid a runtime crash in such case.
2783
2784         * wtf/StackTrace.cpp:
2785         (WTF::StackTrace::captureStackTrace):
2786
2787 2017-07-01  Dan Bernstein  <mitz@apple.com>
2788
2789         [macOS] Remove code only needed when building for OS X Yosemite
2790         https://bugs.webkit.org/show_bug.cgi?id=174067
2791
2792         Reviewed by Tim Horton.
2793
2794         * Configurations/Base.xcconfig:
2795         * Configurations/DebugRelease.xcconfig:
2796         * wtf/Platform.h:
2797         * wtf/mac/AppKitCompatibilityDeclarations.h:
2798         * wtf/spi/cocoa/SecuritySPI.h:
2799         * wtf/text/TextBreakIterator.cpp:
2800
2801 2017-07-01  Joseph Pecoraro  <pecoraro@apple.com>
2802
2803         Add a warning if WEBGL2 is enabled without WEBGL
2804         https://bugs.webkit.org/show_bug.cgi?id=174054
2805
2806         Reviewed by Sam Weinig.
2807
2808         * wtf/FeatureDefines.h:
2809
2810 2017-06-30  Keith Miller  <keith_miller@apple.com>
2811
2812         Force crashWithInfo to be out of line.
2813         https://bugs.webkit.org/show_bug.cgi?id=174028
2814
2815         Reviewed by Filip Pizlo.
2816
2817         The first pass at making crashes hold information about why they
2818         were crashing had the problem that it would inline the assertion.
2819         This meant that clang could coalesce DFG_ASSERTS with other
2820         assertion failures in the same function. This patch moves it out
2821         of line to help fix that issue.
2822
2823         * wtf/Assertions.cpp:
2824         (WTFCrashWithInfo):
2825         * wtf/Assertions.h:
2826         (WTF::isIntegralType):
2827
2828 2017-06-30  Yusuke Suzuki  <utatane.tea@gmail.com>
2829
2830         [WTF] Drop SymbolRegistry::keyForSymbol
2831         https://bugs.webkit.org/show_bug.cgi?id=174052
2832
2833         Reviewed by Sam Weinig.
2834
2835         Since we can know whether a given symbol is registered by checking RegisteredSymbolImpl,
2836         we do not need to query key string for a given symbol by using SymbolRegistry::keyForSymbol.
2837
2838         * wtf/text/SymbolImpl.h:
2839         (WTF::SymbolImpl::extractFoldedString): Deleted.
2840         * wtf/text/SymbolRegistry.cpp:
2841         (WTF::SymbolRegistry::keyForSymbol): Deleted.
2842         * wtf/text/SymbolRegistry.h:
2843
2844 2017-06-29  Jer Noble  <jer.noble@apple.com>
2845
2846         Make Legacy EME API controlled by RuntimeEnabled setting.
2847         https://bugs.webkit.org/show_bug.cgi?id=173994
2848
2849         Reviewed by Sam Weinig.
2850
2851         * wtf/FeatureDefines.h:
2852
2853 2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>
2854
2855         Ran sort-Xcode-project-file.
2856
2857         * WTF.xcodeproj/project.pbxproj:
2858
2859 2017-06-30  Matt Lewis  <jlewis3@apple.com>
2860
2861         Unreviewed, rolling out r218992.
2862
2863         The patch broke the iOS device builds.
2864
2865         Reverted changeset:
2866
2867         "DFG_ASSERT should allow stuffing registers before trapping."
2868         https://bugs.webkit.org/show_bug.cgi?id=174005
2869         http://trac.webkit.org/changeset/218992
2870
2871 2017-06-30  Keith Miller  <keith_miller@apple.com>
2872
2873         DFG_ASSERT should allow stuffing registers before trapping.
2874         https://bugs.webkit.org/show_bug.cgi?id=174005
2875
2876         Reviewed by Mark Lam.
2877
2878         Add new template functions that enable stuffing up to five values
2879         into registers before crashing.
2880
2881         * wtf/Assertions.h:
2882         (CRASH_WITH_INFO):
2883
2884 2017-06-28  Brent Fulgham  <bfulgham@apple.com>
2885
2886         Teach ResourceLoadStatistics to recognize changes in the file system
2887         https://bugs.webkit.org/show_bug.cgi?id=173800
2888         <rdar://problem/32937842>
2889
2890         Reviewed by Chris Dumez.
2891
2892         * wtf/DispatchPtr.h: Added (moved from WebKit2)
2893         * wtf/Platform.h: Make sure USE_FILE_LOCK is enabled.
2894
2895 2017-06-28  David Kilzer  <ddkilzer@apple.com>
2896
2897         Fix typo in comment: WordResult => WorkResult
2898
2899         * wtf/AutomaticThread.h:
2900
2901 2017-06-27  Caio Lima  <ticaiolima@gmail.com>
2902
2903         [ESnext] Implement Object Rest - Implementing Object Rest Destructuring
2904         https://bugs.webkit.org/show_bug.cgi?id=167962
2905
2906         Reviewed by Saam Barati.
2907
2908         * wtf/HashSet.h:
2909         (WTF::=):
2910
2911 2017-06-26  Yusuke Suzuki  <utatane.tea@gmail.com>
2912
2913         [WTF] Drop Thread::create(obsolete things) API since we can use lambda
2914         https://bugs.webkit.org/show_bug.cgi?id=173825
2915
2916         Reviewed by Saam Barati.
2917
2918         Thread::create(ThreadFunction, void* data, const char* name) is a bit old API.
2919         Since we have C++ lambda, the above API is simply unnecessary. And C++ lambda
2920         based one is better since the above API needs casting data to and from void*.
2921
2922         * wtf/Function.h:
2923         Avoid ambiguity.
2924         * wtf/ParallelJobsGeneric.cpp:
2925         (WTF::ParallelEnvironment::ThreadPrivate::tryLockFor):
2926         (WTF::ParallelEnvironment::ThreadPrivate::workerThread): Deleted.
2927         * wtf/ParallelJobsGeneric.h:
2928         * wtf/Threading.cpp:
2929         * wtf/ThreadingWin.cpp:
2930         (WTF::createThread):
2931
2932 2017-06-25  Yusuke Suzuki  <utatane.tea@gmail.com>
2933
2934         initializeThreading() [first] causes WTFCrash due to maxSingleAllocationSize not being initialized
2935         https://bugs.webkit.org/show_bug.cgi?id=173720
2936
2937         Reviewed by Mark Lam.
2938
2939         When using std::numeric_limits<size_t>::max() for global variable's initialization,
2940         it seems that it invokes static constructor to initialize this in VC++.
2941         We avoid this edge case by introducing a workaround using SIZE_MAX here.
2942
2943         When I perform git-grep, there is only one site (this) using std::numeric_limits<>::xxx()
2944         to initialize global variable.
2945
2946         * wtf/FastMalloc.cpp:
2947
2948 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
2949
2950         Remove excessive headers from JavaScriptCore
2951         https://bugs.webkit.org/show_bug.cgi?id=173812
2952
2953         Reviewed by Darin Adler.
2954
2955         * wtf/Bag.h:
2956
2957 2017-06-23  Keith Miller  <keith_miller@apple.com>
2958
2959         Switch VMTraps to use halt instructions rather than breakpoint instructions
2960         https://bugs.webkit.org/show_bug.cgi?id=173677
2961         <rdar://problem/32178892>
2962
2963         Reviewed by JF Bastien.
2964
2965         Remove the Trap signal handler code since it plays badly with lldb and combine
2966         SIGBUS with SIGSEGV since distiguishing them is generally non-portable.
2967
2968         Also, update the platform code to only use signaling VMTraps
2969         on where we have an appropriate instruction (x86 and ARM64).
2970
2971         * wtf/Platform.h:
2972         * wtf/threads/Signals.cpp:
2973         (WTF::fromMachException):
2974         (WTF::toMachMask):
2975         (WTF::installSignalHandler):
2976         (WTF::jscSignalHandler):
2977         * wtf/threads/Signals.h:
2978         (WTF::toSystemSignal):
2979         (WTF::fromSystemSignal):
2980
2981 2017-06-23  Antti Koivisto  <antti@apple.com>
2982
2983         Add notifyutil registrations for going in and out of simulated low memory state
2984         https://bugs.webkit.org/show_bug.cgi?id=173797
2985
2986         Reviewed by Andreas Kling.
2987
2988         Add
2989
2990         notifyutil -p org.WebKit.lowMemory.begin
2991         notifyutil -p org.WebKit.lowMemory.end
2992
2993         for debugging.
2994
2995         * wtf/cocoa/MemoryPressureHandlerCocoa.mm:
2996         (WTF::MemoryPressureHandler::install):
2997
2998 2017-06-23  Konstantin Tokarev  <annulen@yandex.ru>
2999
3000         Remove more unused headers from WTF
3001         https://bugs.webkit.org/show_bug.cgi?id=173761
3002
3003         Reviewed by Yusuke Suzuki.
3004
3005         * wtf/Liveness.h:
3006         * wtf/PageAllocation.h:
3007         * wtf/ParallelJobs.h:
3008
3009 2017-06-22  Andreas Kling  <akling@apple.com>
3010
3011         Rename MemoryPressureHandler::setTabCount to setPageCount
3012         https://bugs.webkit.org/show_bug.cgi?id=173750
3013
3014         Reviewed by Daniel Bates.
3015
3016         This function is counting WebCore::Page objects (excluding utility Pages used
3017         by SVG-as-image and the web inspector) so let's name it appropriately.
3018         Not all WebKit clients have tabs.
3019
3020         * wtf/MemoryPressureHandler.cpp:
3021         (WTF::MemoryPressureHandler::setPageCount):
3022         (WTF::MemoryPressureHandler::thresholdForMemoryKill):
3023         (WTF::MemoryPressureHandler::measurementTimerFired):
3024         (WTF::MemoryPressureHandler::setTabCount): Deleted.
3025         * wtf/MemoryPressureHandler.h:
3026
3027 2017-06-21  Andreas Kling  <akling@apple.com>
3028
3029         Increase memory kill limits for WebContent processes that manage multiple tabs.
3030         https://bugs.webkit.org/show_bug.cgi?id=173674
3031
3032         Reviewed by Geoffrey Garen.
3033
3034         When opening <a target=_blank> links, we currently have to use the same WebContent
3035         process for the new tab, to support scripting the window.opener object.
3036         This means that some WebContent processes end up hosting multiple tabs, making it
3037         more likely that those processes will hit the memory limits.
3038
3039         Address this by adding some additional allowance for multi-tab processes:
3040
3041             For each additional tab, up to 4 tabs, add 1GB to the memory kill limit.
3042
3043         * wtf/MemoryPressureHandler.cpp:
3044         (WTF::thresholdForMemoryKillWithProcessState):
3045         (WTF::MemoryPressureHandler::setTabCount):
3046         (WTF::MemoryPressureHandler::thresholdForMemoryKill):
3047         (WTF::MemoryPressureHandler::measurementTimerFired):
3048         * wtf/MemoryPressureHandler.h:
3049
3050 2017-06-21  Chris Dumez  <cdumez@apple.com>
3051
3052         Allow constructing a WTF:Function from a function pointer
3053         https://bugs.webkit.org/show_bug.cgi?id=173660
3054
3055         Reviewed by Alex Christensen.
3056
3057         Allow constructing a WTF:Function from a function pointer and
3058         assigning a function pointer to a WTF:Function.
3059
3060         * wtf/Function.h:
3061
3062 2017-06-20  Simon Fraser  <simon.fraser@apple.com>
3063
3064         Remove WILL_REVEAL_EDGE_EVENTS code
3065         https://bugs.webkit.org/show_bug.cgi?id=173632
3066
3067         Reviewed by Sam Weinig, Beth Dakin.
3068
3069         Remove will-reveal-edge events, which never took off.
3070
3071         * wtf/FeatureDefines.h:
3072
3073 2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>
3074
3075         Remove excessive include directives from WTF
3076         https://bugs.webkit.org/show_bug.cgi?id=173553
3077
3078         Reviewed by Saam Barati.
3079
3080         * wtf/AutomaticThread.h:
3081         * wtf/BagToHashMap.h:
3082         * wtf/CrossThreadCopier.h:
3083         * wtf/CrossThreadQueue.h:
3084         * wtf/DateMath.h:
3085         * wtf/Expected.h:
3086         * wtf/HashMap.h:
3087         * wtf/Indenter.h:
3088         * wtf/MessageQueue.h:
3089         * wtf/MetaAllocator.h:
3090         * wtf/MetaAllocatorHandle.h:
3091         * wtf/RandomNumberSeed.h:
3092         * wtf/Ref.h:
3093         * wtf/RefPtr.h:
3094         * wtf/RunLoop.h:
3095         * wtf/SchedulePair.h:
3096         * wtf/StackStats.h:
3097         * wtf/SynchronizedFixedQueue.h:
3098         * wtf/ThreadMessage.h:
3099         * wtf/Threading.cpp:
3100         * wtf/Threading.h:
3101         * wtf/ThreadingPthreads.cpp:
3102         * wtf/ThreadingWin.cpp:
3103         * wtf/WTFThreadData.h:
3104         * wtf/WorkQueue.h:
3105         * wtf/glib/GRefPtr.h:
3106         * wtf/text/AtomicStringTable.h:
3107         * wtf/text/LineBreakIteratorPoolICU.h:
3108
3109 2017-06-20  Yusuke Suzuki  <utatane.tea@gmail.com>
3110
3111         [WTF] Enable WTF::Signals only when HAVE(MACHINE_CONTEXT) is true
3112         https://bugs.webkit.org/show_bug.cgi?id=173590
3113
3114         Reviewed by Carlos Garcia Campos.
3115
3116         WTF::Signals require a feature rewriting a value of a machine context.
3117         This is only available under HAVE(MACHINE_CONTEXT).
3118         This patch disables WTF::Signals on !HAVE(MACHINE_CONTEXT) environments.
3119
3120         * wtf/threads/Signals.cpp:
3121         * wtf/threads/Signals.h:
3122
3123 2017-06-20  Yusuke Suzuki  <utatane.tea@gmail.com>
3124
3125         [WTF] Rebaseline std::optional
3126         https://bugs.webkit.org/show_bug.cgi?id=173582
3127
3128         Reviewed by JF Bastien.
3129
3130         Update the copy of our std::optional to the latest version.
3131         It adds std::optional::has_value() and std::optional::reset().
3132
3133         * wtf/Optional.h:
3134
3135 2017-06-18  Yusuke Suzuki  <utatane.tea@gmail.com>
3136
3137         [WTF] Include execinfo.h and dlfcn.h based on platform defines
3138         https://bugs.webkit.org/show_bug.cgi?id=173531
3139
3140         Reviewed by Alex Christensen.
3141
3142         execinfo.h and dlfcn.h can be missing in some libc libraries.
3143         When including it, we should honor platform defines like HAVE(DLADDR).
3144
3145         * wtf/StackTrace.cpp:
3146
3147 2017-06-18  Darin Adler  <darin@apple.com>
3148
3149         Fix Ref to deref before assignment, add tests for this to RefPtr, Ref, Function
3150         https://bugs.webkit.org/show_bug.cgi?id=173526
3151
3152         Reviewed by Sam Weinig.
3153
3154         * wtf/Ref.h: Changed operator= to not be defined inside the class definition.
3155         Added swap functions. Changed operator= implementations to use swap in the
3156         conventional manner, the same way that RefPtr does.
3157
3158 2017-06-18  Chris Dumez  <cdumez@apple.com>
3159
3160         Use WTF::Function instead of std::function in WTF/
3161         https://bugs.webkit.org/show_bug.cgi?id=173519
3162
3163         Reviewed by Sam Weinig.
3164
3165         Use WTF::Function instead of std::function in WTF/ to avoid
3166         copying.
3167
3168         * wtf/Brigand.h:
3169         * wtf/Condition.h:
3170         * wtf/Expected.h:
3171         * wtf/FunctionDispatcher.h:
3172         * wtf/MainThread.h:
3173         * wtf/MemoryPressureHandler.h:
3174         (WTF::MemoryPressureHandler::setMemoryKillCallback):
3175         (WTF::MemoryPressureHandler::setMemoryPressureStatusChangedCallback):
3176         (WTF::MemoryPressureHandler::setDidExceedInactiveLimitWhileActiveCallback):
3177         * wtf/Optional.h:
3178         * wtf/ParkingLot.h:
3179         * wtf/RefCounter.h:
3180         (WTF::RefCounter<T>::RefCounter):
3181         * wtf/WorkQueue.h:
3182         * wtf/linux/MemoryPressureHandlerLinux.cpp:
3183         (WTF::MemoryPressureHandler::EventFDPoller::EventFDPoller):
3184         * wtf/text/WTFString.cpp:
3185         (WTF::String::split):
3186         * wtf/text/WTFString.h:
3187
3188 2017-06-16  Alex Christensen  <achristensen@webkit.org>
3189
3190         Fix Mac CMake build.
3191
3192         * wtf/PlatformMac.cmake:
3193         Generate MachExceptionsServer.h
3194
3195 2017-06-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3196
3197         [iOS DnD] Upstream iOS drag and drop implementation into OpenSource WebKit
3198         https://bugs.webkit.org/show_bug.cgi?id=173366
3199         <rdar://problem/32767014>
3200
3201         Reviewed by Tim Horton.
3202
3203         Define ENABLE_DRAG_SUPPORT as 1 by default and 0 for iOS, and define ENABLE_DATA_INTERACTION as 0 by default.
3204         These are overridden to both be 1 for iOS 11+ in the FeatureDefines.xcconfig within each individual project.
3205
3206         * wtf/Platform.h:
3207
3208 2017-06-15  Chris Dumez  <cdumez@apple.com>
3209
3210         Fix typo in XPCSPI.h
3211         https://bugs.webkit.org/show_bug.cgi?id=173426
3212
3213         Reviewed by Alex Christensen.
3214
3215         We should check if xpc_release is defined before defining it,
3216         not xpc_retain.
3217
3218         * wtf/spi/darwin/XPCSPI.h:
3219
3220 2017-06-15  Konstantin Tokarev  <annulen@yandex.ru>
3221
3222         Implement FALLTHROUGH macro for compilers other than Clang
3223         https://bugs.webkit.org/show_bug.cgi?id=173385
3224
3225         Reviewed by Alex Christensen.
3226
3227         FALLTHROUGH should be able to use [[gnu::fallthrough]] attribute of
3228         GCC, and [[fallthrough]] from C++17, whichever is available.
3229
3230         * wtf/Compiler.h:
3231
3232 2017-06-14  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
3233
3234         MediaSource duration attribute should not be equal to Infinity when set to a value greater than 2^64
3235         https://bugs.webkit.org/show_bug.cgi?id=171668
3236
3237         Reviewed by Jer Noble.
3238
3239         MediaSource duration attribute is a double represented in MediaSource by a MediaTime instance created with
3240         MediaTime::CreateWithDouble(). This method implements an overflow control mechanism which sets MediaTime to
3241         Infinity when the double value passed as argument is greater than 2^64.
3242
3243         This patch removes the overflow control mechanism when time value is represented as a double. This patch also
3244         modifies the behavior of mathematical operations between a double MediaTime and rational MediaTime: the rational
3245         MediaTime is converted to a double before applying the operation. Double MediaTime precision is the same as for
3246         double. Overflow mechanisms still apply to the conversion of a double MediaTime to rational with setTimescale()
3247         method. No behavior change for rational MediaTime.
3248
3249         * wtf/MediaTime.cpp:
3250         (WTF::MediaTime::createWithFloat):
3251         (WTF::MediaTime::createWithDouble):
3252         (WTF::MediaTime::operator+):
3253         (WTF::MediaTime::operator-):
3254
3255 2017-06-13  Zan Dobersek  <zdobersek@igalia.com>
3256
3257         [GTK][WPE] Use CMAKE_THREAD_LIBS_INIT in WTF platform CMake files
3258         https://bugs.webkit.org/show_bug.cgi?id=173310
3259
3260         Reviewed by Xabier Rodriguez-Calvar.
3261
3262         In the WTF platform CMake files for the GTK+ and WPE ports, use the
3263         CMAKE_THREAD_LIBS_INIT variable to specify the threading library we
3264         should be linking against. On some platforms this variable will be
3265         empty because the given compiler will automatically handle the -pthread
3266         compiler flag and sort out linking on its own.
3267
3268         The same approach is already used for the JSCOnly configuration.
3269
3270         * wtf/PlatformGTK.cmake:
3271         * wtf/PlatformWPE.cmake:
3272
3273 2017-06-13  Youenn Fablet  <youenn@apple.com>
3274
3275         Filter SDP from ICE candidates in case of local ICE candidate filtering
3276         https://bugs.webkit.org/show_bug.cgi?id=173120
3277
3278         Reviewed by Eric Carlson.
3279
3280         Adding split helper routine with functor parameter.
3281
3282         * wtf/text/WTFString.cpp:
3283         (WTF::String::split):
3284         * wtf/text/WTFString.h:
3285         (WTF::String::contains):
3286
3287 2017-06-13  Don Olmstead  <don.olmstead@sony.com>
3288
3289         [WTF] Remove redundant includes in config.h
3290         https://bugs.webkit.org/show_bug.cgi?id=173292
3291
3292         Reviewed by Alex Christensen.
3293
3294         * config.h:
3295         * wtf/ExportMacros.h:
3296
3297 2017-06-12  Jer Noble  <jer.noble@apple.com>
3298
3299         Screen sleeps while doing WebRTC video
3300         https://bugs.webkit.org/show_bug.cgi?id=173278
3301
3302         Reviewed by Eric Carlson.
3303
3304         Drive-by fix: add some generic methods for iterating over collections.
3305
3306         * WTF.xcodeproj/project.pbxproj:
3307         * wtf/Algorithms.h: Added.
3308         (WTF::forEach):
3309         (WTF::anyOf):
3310         (WTF::allOf):
3311
3312 2017-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3313
3314         [GTK] Move WebKit GType macros to WTF
3315         https://bugs.webkit.org/show_bug.cgi?id=173249
3316
3317         Reviewed by Žan Doberšek.
3318
3319         They can be used by glib-based ports and eventually by JavaScriptCore glib bindings too.
3320
3321         * wtf/glib/WTFGType.h: Copied from Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h.
3322
3323 2017-06-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3324
3325         [WTF] Make ThreadMessage portable
3326         https://bugs.webkit.org/show_bug.cgi?id=172073
3327
3328         Reviewed by Keith Miller.
3329
3330         Recently, we change ThreadMessage semantics: message handler
3331         can be executed in the sender thread.
3332         This allows ThreadMessage to be implemented in a portable way.
3333
3334         This patch implements ThreadMessage for all the platforms.
3335         We use platform-independent Thread APIs, suspend(), resume(),
3336         and getRegisters().
3337
3338         * wtf/PlatformRegisters.h:
3339         (WTF::registersFromUContext):
3340         * wtf/ThreadMessage.cpp:
3341         (WTF::sendMessageScoped):
3342         (WTF::ThreadMessageData::ThreadMessageData): Deleted.
3343         (): Deleted.
3344         (WTF::initializeThreadMessages): Deleted.
3345         (WTF::sendMessageUsingSignal): Deleted.
3346         (WTF::sendMessageUsingMach): Deleted.
3347         (WTF::deliverMessagesUsingMach): Deleted.
3348         * wtf/ThreadMessage.h:
3349         * wtf/Threading.cpp:
3350         (WTF::initializeThreading):
3351         * wtf/Threading.h:
3352         (WTF::Thread::threadMessages): Deleted.
3353         * wtf/ThreadingPthreads.cpp:
3354         (WTF::Thread::signalHandlerSuspendResume):
3355         (WTF::threadStateMetadata):
3356         (WTF::Thread::getRegisters):
3357         * wtf/threads/Signals.cpp:
3358         (WTF::handleSignalsWithMach):
3359
3360 2017-06-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3361
3362         [WTF] Drop unnecessary includes in Threading.h
3363         https://bugs.webkit.org/show_bug.cgi?id=173167
3364
3365         Reviewed by Darin Adler.
3366
3367         Threading.h includes bunch of headers. But some of them are not necessary.
3368         This patch cleans up it a bit.
3369
3370         * wtf/Assertions.cpp:
3371         * wtf/LocklessBag.h:
3372         * wtf/Threading.h:
3373         * wtf/ThreadingPrimitives.h:
3374
3375 2017-06-10  Yusuke Suzuki  <utatane.tea@gmail.com>
3376
3377         [WTF] Add RegisteredSymbolImpl
3378         https://bugs.webkit.org/show_bug.cgi?id=173230
3379
3380         Reviewed by Mark Lam.
3381
3382         Most symbols are not registered in SymbolRegistry. However, we currently always
3383         allocate a pointer member to point to a SymbolRegistry, and this pointer is always null.
3384         SymbolImpl is immutable, and it will never be registered with a SymbolRegistry
3385         after it is created. Hence, this member is wasteful.
3386
3387         Instead, we add a new derived class RegisteredSymbolImpl, which will set a flag in
3388         SymbolImpl to indicate that it is registered with a SymbolRegistry. The only way to
3389         create a RegisteredSymbolImpl is via a factory method provided by the SymbolRegistry.
3390         The factory method will pass the SymbolRegistry this pointer to the RegisteredSymbolImpl's
3391         constructor for initializing the RegisteredSymbolImpl's m_symbolRegistry field.
3392         By doing so,
3393
3394         1. We do not need to set m_symbolRegistry after creating a Symbol. It is clean.
3395         2. We reduce the size of SymbolImpls that do not need to be registered.
3396
3397         * wtf/text/StringImpl.cpp:
3398         (WTF::StringImpl::~StringImpl):
3399         * wtf/text/StringImpl.h:
3400         * wtf/text/SymbolImpl.cpp:
3401         (WTF::SymbolImpl::create):
3402         (WTF::RegisteredSymbolImpl::create):
3403         * wtf/text/SymbolImpl.h:
3404         (WTF::SymbolImpl::hashForSymbol):
3405         (WTF::SymbolImpl::isRegistered):
3406         (WTF::SymbolImpl::SymbolImpl):
3407         (WTF::RegisteredSymbolImpl::symbolRegistry):
3408         (WTF::RegisteredSymbolImpl::clearSymbolRegistry):
3409         (WTF::RegisteredSymbolImpl::RegisteredSymbolImpl):
3410         (WTF::SymbolImpl::symbolRegistry):
3411         * wtf/text/SymbolRegistry.cpp:
3412         (WTF::SymbolRegistry::~SymbolRegistry):
3413         (WTF::SymbolRegistry::symbolForKey):
3414         (WTF::SymbolRegistry::keyForSymbol):
3415         (WTF::SymbolRegistry::remove):
3416         * wtf/text/SymbolRegistry.h:
3417
3418 2017-06-10  Dan Bernstein  <mitz@apple.com>
3419
3420         Reverted r218056 because it made the IDE reindex constantly.
3421
3422         * Configurations/DebugRelease.xcconfig:
3423
3424 2017-06-10  Dan Bernstein  <mitz@apple.com>
3425
3426         [Xcode] With Xcode 9 developer beta, everything rebuilds when switching between command-line and IDE
3427         https://bugs.webkit.org/show_bug.cgi?id=173223
3428
3429         Reviewed by Sam Weinig.
3430
3431         The rebuilds were happening due to a difference in the compiler options that the IDE and
3432         xcodebuild were specifying. Only the IDE was passing the -index-store-path option. To make
3433         xcodebuild pass that option, too, set CLANG_INDEX_STORE_ENABLE to YES if it is unset, and
3434         specify an appropriate path in CLANG_INDEX_STORE_PATH.
3435
3436         * Configurations/DebugRelease.xcconfig:
3437
3438 2017-06-09  Chris Dumez  <cdumez@apple.com>
3439
3440         Update Thread::create() to take in a WTF::Function instead of a std::function
3441         https://bugs.webkit.org/show_bug.cgi?id=173175
3442
3443         Reviewed by Mark Lam.
3444
3445         Update Thread::create() to take in a WTF::Function instead of a std::function. Unlike
3446         std::function, WTF:Function is not copyable and does not make implicit copies of captured
3447         variables. Doing captures such as [string = string.isolatedCopy()] when passing an
3448         std::function to another thread has lead to bugs in the past due to implicit copying of
3449         the captured string.
3450
3451         * wtf/Threading.cpp:
3452         (WTF::Thread::create):
3453         * wtf/Threading.h:
3454
3455 2017-06-09  Chris Dumez  <cdumez@apple.com>
3456
3457         Update WorkQueue::concurrentApply() to take a WTF::Function instead of an std::function
3458         https://bugs.webkit.org/show_bug.cgi?id=173165
3459
3460         Reviewed by Saam Barati.
3461
3462         Update WorkQueue::concurrentApply() to take a WTF::Function instead of an std::function
3463         as std::function has issues with regards to thread safety.
3464
3465         * wtf/WorkQueue.h:
3466         * wtf/cocoa/WorkQueueCocoa.cpp:
3467         (WTF::WorkQueue::concurrentApply):
3468
3469 2017-06-08  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3470
3471         MediaTime class has rounding issues in different platforms
3472         https://bugs.webkit.org/show_bug.cgi?id=172640
3473
3474         Reviewed by Jer Noble.
3475
3476         The way a timescale is set when creating a MediaTime from a double
3477         can create rounding issues in different platforms because in some
3478         rounding is made and in others, it truncates. This way we ensure a
3479         common behavior.
3480
3481         Dumping MediaTimes is also confusing and by the output you don't
3482         know if it's containing a double or a fraction. Now, if it
3483         contains a double, it only prints the double because printing the
3484         fraction is misleading (it currently prints the double read as an
3485         integer) and if it contains a fraction it shows the fraction and
3486         its double representation separated by an = instead of a ,.
3487
3488         * wtf/MediaTime.cpp:
3489         (WTF::MediaTime::createWithDouble): When creating MediaTime from
3490         double, we round instead of leaving it to the cast operation.
3491         (WTF::MediaTime::dump):
3492
3493 2017-06-07  Jer Noble  <jer.noble@apple.com>
3494
3495         Refactoring: MediaEngineSupportParameters should take a ContentType rather than separate type & codecs strings
3496         https://bugs.webkit.org/show_bug.cgi?id=173038
3497
3498         Reviewed by Eric Carlson.
3499
3500         Drive by fix: add a version of split that takes a UChar and returns a Vector<String>.
3501
3502         * wtf/text/WTFString.h:
3503         (WTF::String::split):
3504
3505 2017-06-07  Zan Dobersek  <zdobersek@igalia.com>
3506
3507         [GCrypt] RSA-PSS support
3508         https://bugs.webkit.org/show_bug.cgi?id=172856
3509
3510         Reviewed by Jiewen Tan.
3511
3512         * wtf/Platform.h: Define HAVE_RSA_PSS to 1 for USE(GCRYPT). Support for RSA-PSS
3513         is provided by default through the libgcrypt library.
3514
3515 2017-06-06  Chris Dumez  <cdumez@apple.com>
3516
3517         Unreviewed, rolling out r214974.
3518
3519         Causes some tabs to start using a huge amount of CPU after 8
3520         minutes in the background
3521
3522         Reverted changeset:
3523
3524         "Make inactive web processes behave as though under memory
3525         pressure."
3526         https://bugs.webkit.org/show_bug.cgi?id=170042
3527         http://trac.webkit.org/changeset/214974
3528
3529 2017-06-06  Don Olmstead  <don.olmstead@am.sony.com>
3530
3531         [WebCore] Enable REQUEST_ANIMATION_FRAME_TIMER for all ports
3532         https://bugs.webkit.org/show_bug.cgi?id=172780
3533
3534         Reviewed by Alex Christensen.
3535
3536         * wtf/Platform.h:
3537
3538 2017-06-06  Darin Adler  <darin@apple.com>
3539
3540         Cut down use of WTF_ARRAY_LENGTH
3541         https://bugs.webkit.org/show_bug.cgi?id=172997
3542
3543         Reviewed by Chris Dumez.
3544
3545         * wtf/DateMath.cpp:
3546         (WTF::equalLettersIgnoringASCIICase): Added helper function template.
3547         (WTF::parseDateFromNullTerminatedCharacters): Use a modern for loop instead of
3548         WTF_ARRAY_LENGTH. Use startsWithLettersIgnoringASCIICase and
3549         equalLettersIgnoringASCIICase instead of strncasecmp.
3550
3551         * wtf/text/IntegerToStringConversion.h:
3552         (WTF::numberToStringImpl): Use std::end instead of WTF_ARRAY_LENGTH.
3553         (WTF::writeNumberToBufferImpl): Ditto.
3554
3555 2017-06-06  Filip Pizlo  <fpizlo@apple.com>
3556
3557         index out of bound in bytecodebasicblock
3558         https://bugs.webkit.org/show_bug.cgi?id=172963
3559
3560         Reviewed by Saam Barati and Mark Lam.
3561
3562         * wtf/Assertions.h:
3563         (UNREACHABLE_FOR_PLATFORM):
3564
3565 2017-06-05  Jer Noble  <jer.noble@apple.com>
3566
3567         Allow clients to specify a list of codecs which should require hardware decode support.
3568         https://bugs.webkit.org/show_bug.cgi?id=172787
3569
3570         Reviewed by Alex Christensen.
3571
3572         Add a couple of convenience methods:
3573         - a String::split() that returns a vector (rather than taking an out-reference to a vector).
3574         - A Vector::map() template which takes a Callable and returns a Vector of a different type.
3575
3576         * wtf/Vector.h:
3577         (WTF::Vector::map):
3578         * wtf/text/WTFString.h:
3579         (WTF::String::split):
3580
3581 2017-06-04  Konstantin Tokarev  <annulen@yandex.ru>
3582
3583         Fix build of Windows-specific code with ICU 59.1
3584         https://bugs.webkit.org/show_bug.cgi?id=172729
3585
3586         Reviewed by Darin Adler.
3587
3588         * wtf/text/win/WCharStringExtras.h: Added new header file wuth helper
3589         functions for conversion between WTF::String and wchart_t*.
3590         (WTF::stringToNullTerminatedWChar):
3591         (WTF::wcharToString):
3592         (WTF::nullTerminatedWCharToString):
3593
3594 2017-06-02  Stephan Szabo  <stephan.szabo@am.sony.com>
3595
3596         [JSCOnly] Build static jsc.exe on Windows
3597         https://bugs.webkit.org/show_bug.cgi?id=172833
3598
3599         Reviewed by Konstantin Tokarev.
3600
3601         * wtf/PlatformJSCOnly.cmake:
3602
3603 2017-06-02  Simon Fraser  <simon.fraser@apple.com>
3604
3605         Get <chrono> out of StdLibExtras.h
3606         https://bugs.webkit.org/show_bug.cgi?id=172744
3607
3608         Reviewed by Zalan Bujtas.
3609
3610         We hates std::chrono. Don't include it everywhere to discourage use.
3611
3612         * wtf/StdLibExtras.h:
3613
3614 2017-06-02  Filip Pizlo  <fpizlo@apple.com>
3615
3616         Atomics.load and Atomics.store need to be fully fenced
3617         https://bugs.webkit.org/show_bug.cgi?id=172844
3618
3619         Reviewed by Keith Miller.
3620         
3621         Add loadFullyFenced and storeFullyFenced to Atomic<>.
3622
3623         * wtf/Atomics.h:
3624         (WTF::Atomic::loadFullyFenced):
3625         (WTF::Atomic::storeRelaxed):
3626         (WTF::Atomic::storeFullyFenced):
3627         (WTF::atomicLoadFullyFenced):
3628         (WTF::atomicStoreFullyFenced):
3629
3630 2017-06-01  Keith Miller  <keith_miller@apple.com>
3631
3632         Undo rollout in r217638 with bug fix
3633         https://bugs.webkit.org/show_bug.cgi?id=172824
3634
3635         Unreviewed, reland patch with unused set_state code removed.
3636
3637         * Configurations/WTF.xcconfig:
3638         * WTF.xcodeproj/project.pbxproj:
3639         * wtf/Platform.h:
3640         * wtf/PlatformRegisters.h:
3641         (WTF::registersFromUContext):
3642         * wtf/StackBounds.h:
3643         (WTF::StackBounds::StackBounds):
3644         * wtf/ThreadHolder.cpp:
3645         (WTF::ThreadHolder::~ThreadHolder):
3646         * wtf/ThreadMessage.cpp:
3647         (WTF::sendMessageUsingSignal):
3648         (WTF::sendMessageUsingMach):
3649         (WTF::deliverMessagesUsingMach):
3650         (WTF::sendMessageScoped):
3651         * wtf/ThreadMessage.h:
3652         (WTF::sendMessage):
3653         * wtf/Threading.h:
3654         (WTF::Thread::machThread):
3655         * wtf/mac/MachExceptions.defs: Copied from Source/WTF/wtf/ThreadMessage.h.
3656         * wtf/threads/Signals.cpp:
3657         (WTF::startMachExceptionHandlerThread):
3658         (WTF::fromMachException):
3659         (WTF::toMachMask):
3660         (WTF::handleSignalsWithMach):
3661         (WTF::setExceptionPorts):
3662         (WTF::activeThreads):
3663         (WTF::registerThreadForMachExceptionHandling):
3664         (WTF::unregisterThreadForMachExceptionHandling):
3665         (WTF::installSignalHandler):
3666         (WTF::jscSignalHandler):
3667         * wtf/threads/Signals.h:
3668
3669 2017-05-31  Commit Queue  <commit-queue@webkit.org>
3670
3671         Unreviewed, rolling out r217611 and r217631.
3672         https://bugs.webkit.org/show_bug.cgi?id=172785
3673
3674         "caused wasm-hashset-many.html to become flaky." (Requested by
3675         keith_miller on #webkit).
3676
3677         Reverted changesets:
3678
3679         "Reland r216808, underlying lldb bug has been fixed."
3680         https://bugs.webkit.org/show_bug.cgi?id=172759
3681         http://trac.webkit.org/changeset/217611
3682
3683         "Use dispatch queues for mach exceptions"
3684         https://bugs.webkit.org/show_bug.cgi?id=172775
3685         http://trac.webkit.org/changeset/217631
3686
3687 2017-05-31  Keith Miller  <keith_miller@apple.com>
3688
3689         Use dispatch queues for mach exceptions
3690         https://bugs.webkit.org/show_bug.cgi?id=172775
3691
3692         Reviewed by Geoffrey Garen.
3693
3694         This patch adds support for using a dispatch queue to handle our
3695         mach exceptions. We use a high priority concurrent dispatch queue
3696         to handle our mach exceptions. We don't know the priority of the
3697         thread whose exception we are handling so the most conservative
3698         answer is to respond with a high priority. These events are both
3699         rare and usually quite fast so it is likely not a significant cost
3700         when the thread with an exception has a low priority.
3701
3702         * wtf/threads/Signals.cpp:
3703         (WTF::startMachExceptionHandlerThread):
3704
3705 2017-05-31  Keith Miller  <keith_miller@apple.com>
3706
3707         Reland r216808, underlying lldb bug has been fixed.
3708         https://bugs.webkit.org/show_bug.cgi?id=172759
3709
3710         Unreviewed, relanding old patch. See: rdar://problem/31183352
3711
3712         * Configurations/WTF.xcconfig:
3713         * WTF.xcodeproj/project.pbxproj:
3714         * wtf/Platform.h:
3715         * wtf/PlatformRegisters.h:
3716         (WTF::registersFromUContext):
3717         * wtf/StackBounds.h:
3718         (WTF::StackBounds::StackBounds):
3719         * wtf/ThreadHolder.cpp:
3720         (WTF::ThreadHolder::~ThreadHolder):
3721         * wtf/ThreadMessage.cpp:
3722         (WTF::sendMessageUsingSignal):
3723         (WTF::sendMessageUsingMach):
3724         (WTF::deliverMessagesUsingMach):
3725         (WTF::sendMessageScoped):
3726         * wtf/ThreadMessage.h:
3727         (WTF::sendMessage):
3728         * wtf/Threading.h:
3729         (WTF::Thread::machThread):
3730         * wtf/mac/MachExceptions.defs: Copied from Source/WTF/wtf/ThreadMessage.h.
3731         * wtf/threads/Signals.cpp:
3732         (WTF::startMachExceptionHandlerThread):
3733         (WTF::fromMachException):
3734         (WTF::toMachMask):
3735         (WTF::handleSignalsWithMach):
3736         (WTF::setExceptionPorts):
3737         (WTF::activeThreads):
3738         (WTF::registerThreadForMachExceptionHandling):
3739         (WTF::unregisterThreadForMachExceptionHandling):
3740         (WTF::installSignalHandler):
3741         (WTF::jscSignalHandler):
3742         * wtf/threads/Signals.h:
3743
3744 2017-05-31  Matt Lewis  <jlewis3@apple.com>
3745
3746         Unreviewed, rolling out r217603.
3747
3748         This patch broke the internal builds.
3749
3750         Reverted changeset:
3751
3752         "Get <chrono> out of StdLibExtras.h"
3753         https://bugs.webkit.org/show_bug.cgi?id=172744
3754         http://trac.webkit.org/changeset/217603
3755
3756 2017-05-31  Simon Fraser  <simon.fraser@apple.com>
3757
3758         Get <chrono> out of StdLibExtras.h
3759         https://bugs.webkit.org/show_bug.cgi?id=172744
3760
3761         Reviewed by Saam Barati.
3762
3763         We hates std::chrono. Don't include it everywhere to discourage use.
3764
3765         * wtf/StdLibExtras.h:
3766
3767 2017-05-30  Ryosuke Niwa  <rniwa@webkit.org>
3768
3769         Only include DataDetectorsUI headers in iOS
3770         https://bugs.webkit.org/show_bug.cgi?id=172633
3771
3772         Reviewed by David Kilzer.
3773
3774         Enable data detectors only on iOS and not other variants of iOS.
3775
3776         * wtf/FeatureDefines.h:
3777         * wtf/Platform.h:
3778
3779 2017-05-29  Yusuke Suzuki  <utatane.tea@gmail.com>
3780
3781         Unreviewed, disable faster Interpreter::getOpcodeID for ARM_THUMB2 with non-Darwin OSes
3782         https://bugs.webkit.org/show_bug.cgi?id=172686
3783
3784         Because of test failures.
3785
3786         * wtf/Platform.h:
3787
3788 2017-05-28  Dan Bernstein  <mitz@apple.com>
3789
3790         [Xcode] ALWAYS_SEARCH_USER_PATHS is set to YES
3791         https://bugs.webkit.org/show_bug.cgi?id=172691
3792
3793         Reviewed by Tim Horton.
3794
3795         * Configurations/Base.xcconfig: Set ALWAYS_SEARCH_USER_PATHS to NO.
3796
3797 2017-05-28  Yusuke Suzuki  <utatane.tea@gmail.com>
3798
3799         [JSC][Linux][FreeBSD] Use faster Interpreter::getOpcodeID()
3800         https://bugs.webkit.org/show_bug.cgi?id=172686
3801
3802         Reviewed by Mark Lam.
3803
3804         As of r217526, JSC gets faster Interpreter::getOpcodeID() by
3805         embedding OpcodeID value just before the LLInt machine code
3806         handler pointer. By doing so, we can retrieve OpcodeID from
3807         the LLInt machine code handler by dereferencing the code
3808         pointer. `*((int*)ptr - 1)`.
3809
3810         This patch allows Linux and FreeBSD environments to use this
3811         optimization.
3812
3813         * wtf/Platform.h:
3814
3815 2017-05-28  Mark Lam  <mark.lam@apple.com>
3816
3817         Implement a faster Interpreter::getOpcodeID().
3818         https://bugs.webkit.org/show_bug.cgi?id=172669
3819
3820         Reviewed by Saam Barati.
3821
3822         Added the USE(LLINT_EMBEDDED_OPCODE_ID) configuration.
3823
3824         * wtf/Platform.h:
3825
3826 2017-05-26  Brent Fulgham  <bfulgham@apple.com>
3827
3828         [WK2] Address thread safety issues with ResourceLoadStatistics
3829         https://bugs.webkit.org/show_bug.cgi?id=172519
3830         <rdar://problem/31707642>
3831
3832         Reviewed by Chris Dumez.
3833
3834         Add a new specialization for HashSet.
3835
3836         * wtf/CrossThreadCopier.h:
3837
3838 2017-05-26  Ryan Haddad  <ryanhaddad@apple.com>
3839
3840         Unreviewed, rolling out r217458.
3841
3842         This change caused 55 JSC test failures.
3843
3844         Reverted changeset:
3845
3846         "Date should use historical data if it's available."
3847         https://bugs.webkit.org/show_bug.cgi?id=172592
3848         http://trac.webkit.org/changeset/217458
3849
3850 2017-05-25  Keith Miller  <keith_miller@apple.com>
3851
3852         Date should use historical data if it's available.
3853         https://bugs.webkit.org/show_bug.cgi?id=172592
3854
3855         Reviewed by Mark Lam.
3856
3857         The spec previously disallowed using historical data for Dates.
3858         This is no longer the case. Additionally, not using historical
3859         data, when available, seems unfortunate for users. This patch
3860         removes the code dropping historical data.
3861
3862         * wtf/DateMath.cpp:
3863         (WTF::calculateLocalTimeOffset):
3864         (WTF::msToMilliseconds): Deleted.
3865
3866 2017-05-25  Yusuke Suzuki  <utatane.tea@gmail.com>
3867
3868         [Win] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key)
3869         https://bugs.webkit.org/show_bug.cgi?id=172586
3870
3871         Reviewed by Brent Fulgham.
3872
3873         In ThreadHolder for Windows, we need to construct HashMap<ThreadIdentifier, ThreadHolder*>.
3874         The problem is that ThreadHolder::platformInitialize touches Thread::id() even before Thread
3875         is not established. In that case, id() returns incorrect value.
3876
3877         But, calling ThreadHolder::initialize() after waiting for completion of Thread::establish() is
3878         not a good idea. Since we already have NewThreadContext->creationMutex, we can wait for completion
3879         of Thread::establish() easily. However, if we do so, Thread::create() returns RefPtr<Thread> that
3880         may not call ThreadHolder::initialize() in its thread yet. In that case, ThreadHolder::get() fails.
3881         Thus, Windows WTF::waitForThreadCompletion implementation becomes broken. We can add a new mutex
3882         to wait for completion of ThreadHolder::initialize in the creator of the thread (like a ping-pong!).
3883         But it overly complicates the implementation.
3884
3885         The following is overly complicated initialization phase.
3886
3887         Creator -> AC mutex(1) -------> establishment -> RL mutex(1) ----------------------> AC mutex(2) ->
3888
3889                                Thread -----------------> AC mutex(1) -> ThreadHolder init -> RL mutex(2) ->
3890
3891         So, instead, in this patch, we just use Thread::currentID(). When calling ThreadHolder::initialize(),
3892         we pass ThreadIdentifier by using Thread::currentID(). This implementation works great because,
3893
3894         1. ThreadHolder::initialize requires ThreadIdentifier only in Windows environment because Pthread
3895            ThreadHolder does not create HashMap<>. And this is used for obsolete Threading APIs. Thus this
3896            hack will be removed in the near future.
3897
3898         2. In Windows, Thread::currentID() can return a valid value without using ThreadHolder. And it does
3899            not require Thread establishment. So, calling currentID() to initialize ThreadHolder is ok in
3900            Windows.
3901
3902         * wtf/ThreadHolder.cpp:
3903         (WTF::ThreadHolder::initialize): Deleted.
3904         * wtf/ThreadHolder.h:
3905         * wtf/ThreadHolderPthreads.cpp:
3906         (WTF::ThreadHolder::initialize):
3907         * wtf/ThreadHolderWin.cpp:
3908         (WTF::ThreadHolder::initialize):
3909         (WTF::ThreadHolder::platformInitialize): Deleted.
3910         * wtf/ThreadingWin.cpp:
3911         (WTF::wtfThreadEntryPoint):
3912
3913 2017-05-25  Adrian Perez de Castro  <aperez@igalia.com>
3914
3915         Clang warns about (intended) returning pointer to stack location in WTF/wtf/ThreadingPthreads.cpp
3916         https://bugs.webkit.org/show_bug.cgi?id=172595
3917
3918         Reviewed by Mark Lam.
3919
3920         * wtf/ThreadingPthreads.cpp: Use a #pragma to silence Clang warning about returning a
3921         pointer to the stack (which is intended)
3922
3923 2017-05-25  David Kilzer  <ddkilzer@apple.com>
3924
3925         REGRESSION (r217416): Using #pragma once in WTFString.h broke the build
3926
3927         * wtf/text/WTFString.h: Switch back to #ifndef/#define/#endif.
3928
3929 2017-05-25  David Kilzer  <ddkilzer@apple.com>
3930
3931         Make a change to force a build on the Apple bots
3932
3933         * wtf/text/WTFString.h: Use #pragma once.
3934
3935 2017-05-24  Andreas Kling  <akling@apple.com>
3936
3937         Disable memory kill mechanisms when running with FastMalloc disabled.
3938         https://bugs.webkit.org/show_bug.cgi?id=172550
3939         <rdar://problem/32181908>
3940
3941         Reviewed by Antti Koivisto.
3942
3943         If someone is using WebKit with a non-standard allocator, they are likely trying to debug
3944         or test something, and suddenly getting killed is not gonna help with that.
3945
3946         * wtf/MemoryPressureHandler.cpp:
3947         (WTF::MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor):
3948
3949 2017-05-22  Jiewen Tan  <jiewen_tan@apple.com>
3950
3951         [WebCrypto] Support RSA-PSS
3952         https://bugs.webkit.org/show_bug.cgi?id=170869
3953         <rdar://problem/31640672>
3954
3955         Reviewed by Brent Fulgham.
3956
3957         * wtf/Platform.h:
3958         Add a flag to enable RSA-PSS in the future.
3959
3960 2017-05-23  Myles C. Maxfield  <mmaxfield@apple.com>
3961
3962         Remove dead ENABLE(FONT_LOAD_EVENTS) code
3963         https://bugs.webkit.org/show_bug.cgi?id=172517
3964
3965         Rubber-stamped by Simon Fraser.
3966
3967         * wtf/FeatureDefines.h:
3968
3969 2017-05-23  Don Olmstead  <don.olmstead@am.sony.com>
3970
3971         [WTF] Export additional symbols in threading
3972         https://bugs.webkit.org/show_bug.cgi?id=171952
3973
3974         Reviewed by Konstantin Tokarev.
3975
3976         * wtf/ThreadMessage.h:
3977         * wtf/threads/Signals.h:
3978
3979 2017-05-23  Tomas Popela  <tpopela@redhat.com>
3980
3981         [WTF] Compilation fails with system malloc
3982         https://bugs.webkit.org/show_bug.cgi?id=172445
3983
3984         Reviewed by Michael Catanzaro.
3985
3986         We are using the bmalloc even if the system malloc should be used.
3987         Don't use bmalloc if the system malloc is requested and add the
3988         missing implementation for computeRAMSize() on UNIX that's utilizing
3989         the sysinfo() call.
3990
3991         * wtf/RAMSize.cpp:
3992         (WTF::computeRAMSize):
3993
3994 2017-05-22  Brian Burg  <bburg@apple.com>
3995
3996         Add a debugging macro that sleeps a thread until a debugger attaches
3997         https://bugs.webkit.org/show_bug.cgi?id=171575
3998
3999         Reviewed by Mark Lam.
4000
4001         This is really useful for debugging early errors if for some reason you can't
4002         launch a process directly from the debugger easily, such as Web Content processes.
4003
4004         * WTF.xcodeproj/project.pbxproj:
4005         * wtf/Assertions.h:
4006         Always define the WTFBreakpointTrap() macro. Still make it an error if the CPU
4007         type isn't supported for OS(DARWIN); if used on other platforms, cause a WTFCrash()
4008         with a comment that indicates this is not implemented.
4009
4010         * wtf/DebugUtilities.h: Added.
4011
4012 2017-05-19  Don Olmstead  <don.olmstead@am.sony.com>
4013
4014         [WTF] Remove PLATFORM(WIN) references
4015         https://bugs.webkit.org/show_bug.cgi?id=172301
4016
4017         Reviewed by Yusuke Suzuki.
4018
4019         * wtf/MemoryPressureHandler.cpp:
4020         * wtf/MemoryPressureHandler.h:
4021         * wtf/Platform.h:
4022
4023 2017-05-19  Don Olmstead  <don.olmstead@am.sony.com>
4024
4025         [CMake] Add HAVE check for __int128_t
4026         https://bugs.webkit.org/show_bug.cgi?id=172317
4027
4028         Reviewed by Yusuke Suzuki.
4029
4030         * wtf/MediaTime.cpp:
4031         (WTF::MediaTime::setTimeScale):
4032         * wtf/Platform.h:
4033
4034 2017-05-18  Andreas Kling  <akling@apple.com>
4035
4036         [WK2] Notify WebPageProxy client when an active process goes over the inactive memory limit
4037         https://bugs.webkit.org/show_bug.cgi?id=172244
4038         <rdar://problem/31800943>
4039
4040         Reviewed by Geoffrey Garen.
4041
4042         Add an installable callback to MemoryPressureHandler that gets invoked when an active process
4043         exceeds the kill limit for an inactive process.
4044
4045         This allows a UI client to become aware that backgrounding a tab may cause it to get killed.
4046
4047         * wtf/MemoryPressureHandler.cpp:
4048         (WTF::thresholdForMemoryKillWithProcessState):
4049         (WTF::MemoryPressureHandler::thresholdForMemoryKill):
4050         (WTF::MemoryPressureHandler::measurementTimerFired):
4051         (WTF::MemoryPressureHandler::doesExceedInactiveLimitWhileActive):
4052         (WTF::MemoryPressureHandler::doesNotExceedInactiveLimitWhileActive):
4053         * wtf/MemoryPressureHandler.h:
4054         (WTF::MemoryPressureHandler::setDidExceedInactiveLimitWhileActiveCallback):
4055
4056 2017-05-18  Geoffrey Garen  <ggaren@apple.com>
4057
4058         AutomaticThread should wait longer before timing out
4059         https://bugs.webkit.org/show_bug.cgi?id=172292
4060
4061         Reviewed by Filip Pizlo.
4062
4063         Increased the idle timeout from 1s => 10s.
4064
4065         This reduces the number of thread restarts on JetStream from
4066         ~150 => ~0. It also matches other thread pool APIs on Darwin.
4067
4068         Intuitively, it seems wrong for helper threads to idle exit during
4069         hardcore benchmarking.
4070
4071         This patch in combination with a bmalloc fix seems to be a 1%-2% JetStream
4072         speedup on my Mac Pro.
4073
4074         A nice side-benefit is that per-thread traces are easier to read.
4075
4076         * wtf/AutomaticThread.cpp:
4077         (WTF::AutomaticThread::start):
4078         * wtf/AutomaticThread.h:
4079
4080 2017-05-18  Don Olmstead  <don.olmstead@am.sony.com>
4081
4082         [Win] Remove usage of _snprintf
4083         https://bugs.webkit.org/show_bug.cgi?id=172251
4084
4085         Reviewed by Per Arne Vollan.
4086
4087         * wtf/DataLog.cpp:
4088         (WTF::initializeLogFileOnce):
4089         (WTF::setDataFile):
4090
4091 2017-05-15  Mark Lam  <mark.lam@apple.com>
4092
4093         Rolling out r214038 and r213697: Crashes when using computed properties with rest destructuring and object spread.
4094         https://bugs.webkit.org/show_bug.cgi?id=172147
4095
4096         Rubber-stamped by Saam Barati.
4097
4098         * wtf/HashSet.h:
4099         (WTF::=):
4100
4101 2017-05-14  Chris Dumez  <cdumez@apple.com>
4102
4103         Drop PassRefPtr class from WTF
4104         https://bugs.webkit.org/show_bug.cgi?id=172091
4105
4106         Reviewed by Alex Christensen.
4107
4108         Drop PassRefPtr class from WTF as it is no longer used or needed.
4109         Also drop RefPtr::release() for the same reasons.
4110
4111         * WTF.xcodeproj/project.pbxproj:
4112         * wtf/CMakeLists.txt:
4113         * wtf/CrossThreadCopier.cpp:
4114         * wtf/CrossThreadCopier.h:
4115         * wtf/Forward.h:
4116         * wtf/PassRefPtr.h: Removed.
4117         * wtf/RefPtr.h:
4118         (WTF::refIfNotNull):
4119         (WTF::derefIfNotNull):
4120         (WTF::RefPtr::RefPtr):
4121         (WTF::RefPtr::release): Deleted.
4122         * wtf/SizeLimits.cpp:
4123         * wtf/Vector.h:
4124
4125 2017-05-13  Chris Dumez  <cdumez@apple.com>
4126
4127         Stop using RefPtr::release()
4128         https://bugs.webkit.org/show_bug.cgi?id=172074
4129
4130         Reviewed by Geoffrey Garen.
4131
4132         * wtf/win/WorkQueueWin.cpp:
4133         (WTF::WorkQueue::dispatchAfter):
4134
4135 2017-05-13  Commit Queue  <commit-queue@webkit.org>
4136
4137         Unreviewed, rolling out r216808.
4138         https://bugs.webkit.org/show_bug.cgi?id=172075
4139
4140         caused lldb to hang when debugging (Requested by smfr on
4141         #webkit).
4142
4143         Reverted changeset:
4144
4145         "Use Mach exceptions instead of signals where possible"
4146         https://bugs.webkit.org/show_bug.cgi?id=171865
4147         http://trac.webkit.org/changeset/216808
4148
4149 2017-05-12  Keith Miller  <keith_miller@apple.com>
4150
4151         Use Mach exceptions instead of signals where possible
4152         https://bugs.webkit.org/show_bug.cgi?id=171865
4153
4154         Reviewed by Mark Lam.
4155
4156         This patch enables using mach exceptions on darwin. The way the
4157         mach exception api works is that we create a mach port, which is
4158         like a file descriptor.  We then wait for a message to arrive on
4159         that port in a thread. When another thread raises an exception (say
4160         due to a bad memory access) the OS sends our thread a message. The
4161         payload of that message is the register file of the crashing
4162         thread. We then call our custom handlers that change the state as
4163         needed. In order to restart the thread we send a payload back to
4164         the OS with an updated register file along with a success message
4165         header.
4166
4167         This patch also makes thread messages work without signals by
4168         simply suspending the thread, and then running the message at that
4169         time.
4170
4171         You can read more about mach exceptions here:
4172         http://www.cs.cmu.edu/afs/cs/project/mach/public/doc/unpublished/exception.ps
4173         and the Mach interface Generator (MiG) here:
4174         http://www.cs.cmu.edu/afs/cs/project/mach/public/doc/unpublished/mig.ps
4175
4176         * Configurations/WTF.xcconfig:
4177         * WTF.xcodeproj/project.pbxproj:
4178         * wtf/Platform.h:
4179         * wtf/PlatformRegisters.h:
4180         (WTF::registersFromUContext):
4181         * wtf/StackBounds.h:
4182         (WTF::StackBounds::StackBounds):
4183         * wtf/ThreadHolder.cpp:
4184         (WTF::ThreadHolder::~ThreadHolder):
4185         * wtf/ThreadMessage.cpp:
4186         (WTF::sendMessageUsingSignal):
4187         (WTF::sendMessageUsingMach):
4188         (WTF::deliverMessagesUsingMach):
4189         (WTF::sendMessageScoped):
4190         * wtf/ThreadMessage.h:
4191         (WTF::sendMessage):
4192         * wtf/Threading.h:
4193         (WTF::Thread::machThread):
4194         * wtf/mac/MachExceptions.defs: Copied from Source/WTF/wtf/ThreadMessage.h.
4195         * wtf/threads/Signals.cpp:
4196         (WTF::startMachExceptionHandlerThread):
4197         (WTF::fromMachException):
4198         (WTF::toMachMask):
4199         (WTF::handleSignalsWithMach):
4200         (WTF::setExceptionPorts):
4201         (WTF::activeThreads):
4202         (WTF::registerThreadForMachExceptionHandling):
4203         (WTF::unregisterThreadForMachExceptionHandling):
4204         (WTF::installSignalHandler):
4205         (WTF::jscSignalHandler):
4206         * wtf/threads/Signals.h:
4207
4208 2017-05-12  Ting-Wei Lan  <lantw44@gmail.com>
4209
4210         Include algorithm before using std::min
4211         https://bugs.webkit.org/show_bug.cgi?id=171733
4212
4213         Reviewed by Chris Dumez.
4214
4215         * wtf/text/StringCommon.h:
4216
4217 2017-05-12  Andreas Kling  <akling@apple.com>
4218
4219         More aggressive memory kill limits.
4220         https://bugs.webkit.org/show_bug.cgi?id=172037
4221         <rdar://problem/31969082>
4222
4223         Reviewed by Michael Saboff.
4224
4225         Bring down the memory kill limits to 4GB for active processes, and 2GB for inactive.
4226         Also make MemoryUsagePolicy::Strict kick in above 1.5GB.
4227
4228         * wtf/MemoryPressureHandler.cpp:
4229         (WTF::MemoryPressureHandler::thresholdForMemoryKill):
4230         (WTF::thresholdForPolicy):
4231
4232 2017-05-12  Michael Saboff  <msaboff@apple.com>
4233
4234         [iOS] Use memory footprint to dynamically adjust behavior of allocators
4235         https://bugs.webkit.org/show_bug.cgi?id=171944
4236
4237         Reviewed by Filip Pizlo.
4238
4239         Moved the non-Windows implementation of RAMSize() to bmalloc/AvailableMemory.cpp and
4240         called the function availableMemory().
4241
4242         * wtf/RAMSize.cpp:
4243         (WTF::computeRAMSize):
4244
4245 2017-05-12  Claudio Saavedra  <csaavedra@igalia.com>
4246
4247         [WPE] Add MemoryFootprintLinux to build
4248
4249         Unreviewed build fix after r216731.
4250
4251         * wtf/PlatformWPE.cmake:
4252
4253 2017-05-12  Csaba Osztrogonác  <ossy@webkit.org>
4254
4255         Unreviewed trivial JSCOnly buildfix after r216731.
4256         https://bugs.webkit.org/show_bug.cgi?id=171693
4257
4258         * wtf/PlatformJSCOnly.cmake:
4259
4260 2017-05-11  Yusuke Suzuki  <utatane.tea@gmail.com>
4261
4262         [Win] Implement memoryFootprint for Windows
4263         https://bugs.webkit.org/show_bug.cgi?id=171693
4264
4265         Reviewed by Alex Christensen.
4266
4267         This patch implements memoryFootprint for Windows. In Windows, we calculate the size
4268         of private working set. This can be done by enumerating private pages in working set.
4269
4270         And we also split MemoryFootprint.cpp to cocoa, linux, and win versions.
4271
4272         * WTF.xcodeproj/project.pbxproj:
4273         * wtf/CMakeLists.txt:
4274         * wtf/MallocPtr.h:
4275         (WTF::MallocPtr::operator*):
4276         (WTF::MallocPtr::operator->):
4277         * wtf/PlatformGTK.cmake:
4278         * wtf/PlatformJSCOnly.cmake:
4279         * wtf/PlatformMac.cmake:
4280         * wtf/PlatformWin.cmake:
4281         * wtf/cocoa/MemoryFootprintCocoa.cpp: Copied from Source/WTF/wtf/MemoryFootprint.cpp.
4282         (WTF::memoryFootprint):
4283         * wtf/linux/MemoryFootprintLinux.cpp: Renamed from Source/WTF/wtf/MemoryFootprint.cpp.
4284         (WTF::forEachLine):
4285         (WTF::memoryFootprint):
4286         * wtf/win/MemoryFootprintWin.cpp: Added.
4287         (WTF::memoryFootprint):
4288
4289 2017-05-11  Don Olmstead  <don.olmstead@am.sony.com>
4290
4291         [CMake] Add HAVE check for regex.h
4292         https://bugs.webkit.org/show_bug.cgi?id=171950
4293
4294         Reviewed by Michael Catanzaro.
4295
4296         * wtf/Platform.h:
4297
4298 2017-05-11  Chris Dumez  <cdumez@apple.com>
4299
4300         Annotate Ref::ptr() with RETURNS_NONNULL
4301         https://bugs.webkit.org/show_bug.cgi?id=171996
4302
4303         Reviewed by Andreas Kling.
<