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