[WTF] Remove XXXLockBase since constexpr constructor can initialize static variables...
[WebKit-https.git] / Source / WTF / ChangeLog
1 2017-12-06  Yusuke Suzuki  <utatane.tea@gmail.com>
2
3         [WTF] Remove XXXLockBase since constexpr constructor can initialize static variables without calling global constructors
4         https://bugs.webkit.org/show_bug.cgi?id=180495
5
6         Reviewed by Mark Lam.
7
8         Very nice feature of C++11 is that constexpr constructor can initialize static global variables
9         without calling global constructors. We do not need to have XXXLockBase with derived XXXLock
10         class since StaticXXXLock can have constructors as long as it is constexpr.
11         We remove bunch of these classes, and set `XXXLock() = default;` explicitly for readability.
12         C++11's default constructor is constexpr as long as its member's default constructor / default
13         initializer is constexpr.
14
15         * wtf/Condition.h:
16         (WTF::ConditionBase::construct): Deleted.
17         (WTF::ConditionBase::waitUntil): Deleted.
18         (WTF::ConditionBase::waitFor): Deleted.
19         (WTF::ConditionBase::wait): Deleted.
20         (WTF::ConditionBase::notifyOne): Deleted.
21         (WTF::ConditionBase::notifyAll): Deleted.
22         (WTF::Condition::Condition): Deleted.
23         * wtf/CountingLock.h:
24         (WTF::CountingLock::CountingLock): Deleted.
25         (WTF::CountingLock::~CountingLock): Deleted.
26         * wtf/Lock.cpp:
27         (WTF::Lock::lockSlow):
28         (WTF::Lock::unlockSlow):
29         (WTF::Lock::unlockFairlySlow):
30         (WTF::Lock::safepointSlow):
31         (WTF::LockBase::lockSlow): Deleted.
32         (WTF::LockBase::unlockSlow): Deleted.
33         (WTF::LockBase::unlockFairlySlow): Deleted.
34         (WTF::LockBase::safepointSlow): Deleted.
35         * wtf/Lock.h:
36         (WTF::LockBase::construct): Deleted.
37         (WTF::LockBase::lock): Deleted.
38         (WTF::LockBase::tryLock): Deleted.
39         (WTF::LockBase::try_lock): Deleted.
40         (WTF::LockBase::unlock): Deleted.
41         (WTF::LockBase::unlockFairly): Deleted.
42         (WTF::LockBase::safepoint): Deleted.
43         (WTF::LockBase::isHeld const): Deleted.
44         (WTF::LockBase::isLocked const): Deleted.
45         (WTF::LockBase::isFullyReset const): Deleted.
46         (WTF::Lock::Lock): Deleted.
47         * wtf/ReadWriteLock.cpp:
48         (WTF::ReadWriteLock::readLock):
49         (WTF::ReadWriteLock::readUnlock):
50         (WTF::ReadWriteLock::writeLock):
51         (WTF::ReadWriteLock::writeUnlock):
52         (WTF::ReadWriteLockBase::construct): Deleted.
53         (WTF::ReadWriteLockBase::readLock): Deleted.
54         (WTF::ReadWriteLockBase::readUnlock): Deleted.
55         (WTF::ReadWriteLockBase::writeLock): Deleted.
56         (WTF::ReadWriteLockBase::writeUnlock): Deleted.
57         * wtf/ReadWriteLock.h:
58         (WTF::ReadWriteLock::read):
59         (WTF::ReadWriteLock::write):
60         (WTF::ReadWriteLockBase::ReadLock::tryLock): Deleted.
61         (WTF::ReadWriteLockBase::ReadLock::lock): Deleted.
62         (WTF::ReadWriteLockBase::ReadLock::unlock): Deleted.
63         (WTF::ReadWriteLockBase::WriteLock::tryLock): Deleted.
64         (WTF::ReadWriteLockBase::WriteLock::lock): Deleted.
65         (WTF::ReadWriteLockBase::WriteLock::unlock): Deleted.
66         (WTF::ReadWriteLockBase::read): Deleted.
67         (WTF::ReadWriteLockBase::write): Deleted.
68         (WTF::ReadWriteLock::ReadWriteLock): Deleted.
69         * wtf/RecursiveLockAdapter.h:
70         (WTF::RecursiveLockAdapter::RecursiveLockAdapter): Deleted.
71         * wtf/WordLock.cpp:
72         (WTF::WordLock::lockSlow):
73         (WTF::WordLock::unlockSlow):
74         (WTF::WordLockBase::lockSlow): Deleted.
75         (WTF::WordLockBase::unlockSlow): Deleted.
76         * wtf/WordLock.h:
77         (WTF::WordLockBase::lock): Deleted.
78         (WTF::WordLockBase::unlock): Deleted.
79         (WTF::WordLockBase::isHeld const): Deleted.
80         (WTF::WordLockBase::isLocked const): Deleted.
81         (WTF::WordLockBase::isFullyReset const): Deleted.
82         (WTF::WordLock::WordLock): Deleted.
83         * wtf/WorkQueue.cpp:
84
85 2017-12-05  Stephan Szabo  <stephan.szabo@sony.com>
86
87         Switch windows build to Visual Studio 2017
88         https://bugs.webkit.org/show_bug.cgi?id=172412
89
90         Reviewed by Per Arne Vollan.
91
92         * WTF.vcxproj/WTF.proj:
93         * wtf/Compiler.h:
94
95 2017-12-05  Andy Estes  <aestes@apple.com>
96
97         [Darwin] Simplify use of TargetConditionals
98         https://bugs.webkit.org/show_bug.cgi?id=180455
99         <rdar://problem/35142971>
100
101         Reviewed by Tim Horton.
102
103         There's no need to check if TARGET_* macros are defined on Darwin platforms, since
104         TargetConditionals.h always defines them. Also, we can simplify
105         (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) to TARGET_OS_IPHONE.
106
107         * wtf/Platform.h:
108
109 2017-12-05  Matt Lewis  <jlewis3@apple.com>
110
111         Unreviewed, rolling out r225430.
112
113         This caused an API failure on release.
114
115         Reverted changeset:
116
117         "Move DateComponents into WTF"
118         https://bugs.webkit.org/show_bug.cgi?id=180211
119         https://trac.webkit.org/changeset/225430
120
121 2017-12-05  Michael Saboff  <msaboff@apple.com>
122
123         Make WebKit build for ARM64_32
124         https://bugs.webkit.org/show_bug.cgi?id=180447
125
126         Reviewed by Mark Lam.
127
128         Add the 'w' (32bit) pointer qualifier for ARM64_32 pointers in inline assembly.
129
130         * wtf/darwin/WeakLinking.h:
131         (WTF::isNullFunctionPointer):
132
133 2017-12-05  Filip Pizlo  <fpizlo@apple.com>
134
135         bmalloc IsoHeap needs to allow a thread to deallocate some size for the first time
136         https://bugs.webkit.org/show_bug.cgi?id=180443
137
138         Reviewed by Saam Barati.
139         
140         With this change it's possible to reenable isoheaps on iOS.
141
142         * wtf/IsoMalloc.h:
143         * wtf/IsoMallocInlines.h:
144
145 2017-12-05  Yusuke Suzuki  <utatane.tea@gmail.com>
146
147         [WTF] Remove m_atomicStringTableDestructor in Thread by querying the condition at thread destruction
148         https://bugs.webkit.org/show_bug.cgi?id=180429
149
150         Reviewed by Alex Christensen.
151
152         We now have a pointer to the AtomicStringTable::destroy in Thread.
153         This pointer becomes nullptr only when the thread is the web thread not to destroy AtomicStringTable
154         twice in the UI thread and the web thread.
155
156         Instead of having a pointer in each Thread, we query whether the current thread is the web thread at
157         Thread destruction. And use this information to call AtomicStringTable::destroy. Then, we can drop
158         m_atomicStringTableDestructor field in Thread.
159
160         * wtf/Threading.cpp:
161         (WTF::Thread::didExit):
162         * wtf/Threading.h:
163         * wtf/mac/MainThreadMac.mm:
164         * wtf/text/AtomicStringTable.cpp:
165         (WTF::AtomicStringTable::create):
166         (WTF::AtomicStringTable::destroy):
167         * wtf/text/AtomicStringTable.h:
168
169 2017-12-01  Filip Pizlo  <fpizlo@apple.com>
170
171         GC constraint solving should be parallel
172         https://bugs.webkit.org/show_bug.cgi?id=179934
173
174         Reviewed by JF Bastien.
175         
176         This does some changes to make it easier to do parallel constraint solving:
177         
178         - I finally removed dependencyWith. This was a silly construct whose only purpose is to confuse
179           people about what it means to have a dependency chain. I took that as an opportunity to grealy
180           simplify the GC's use of dependency chaining.
181         
182         - Added more logic to Deque<>, since I use it for part of the load balancer.
183         
184         - Made it possible to profile lock contention. See
185           https://bugs.webkit.org/show_bug.cgi?id=180250#c0 for some preliminary measurements.
186         
187         - Introduced holdLockIf, which makes it easy to perform predicated lock acquisition. We use that
188           to pick a lock in WebCore.
189         
190         - Introduced CountingLock. It's like WTF::Lock except it also enables optimistic read transactions
191           sorta like Java's StampedLock.
192
193         * WTF.xcodeproj/project.pbxproj:
194         * wtf/Atomics.h:
195         (WTF::dependency):
196         (WTF::DependencyWith::DependencyWith): Deleted.
197         (WTF::dependencyWith): Deleted.
198         * wtf/BitVector.h:
199         (WTF::BitVector::iterator::operator++):
200         * wtf/CMakeLists.txt:
201         * wtf/ConcurrentPtrHashSet.cpp: Added.
202         (WTF::ConcurrentPtrHashSet::ConcurrentPtrHashSet):
203         (WTF::ConcurrentPtrHashSet::~ConcurrentPtrHashSet):
204         (WTF::ConcurrentPtrHashSet::deleteOldTables):
205         (WTF::ConcurrentPtrHashSet::clear):
206         (WTF::ConcurrentPtrHashSet::initialize):
207         (WTF::ConcurrentPtrHashSet::addSlow):
208         (WTF::ConcurrentPtrHashSet::resizeIfNecessary):
209         (WTF::ConcurrentPtrHashSet::resizeAndAdd):
210         (WTF::ConcurrentPtrHashSet::Table::create):
211         * wtf/ConcurrentPtrHashSet.h: Added.
212         (WTF::ConcurrentPtrHashSet::contains):
213         (WTF::ConcurrentPtrHashSet::add):
214         (WTF::ConcurrentPtrHashSet::size const):
215         (WTF::ConcurrentPtrHashSet::Table::maxLoad const):
216         (WTF::ConcurrentPtrHashSet::hash):
217         (WTF::ConcurrentPtrHashSet::cast):
218         (WTF::ConcurrentPtrHashSet::containsImpl const):
219         (WTF::ConcurrentPtrHashSet::addImpl):
220         * wtf/Deque.h:
221         (WTF::inlineCapacity>::takeFirst):
222         * wtf/FastMalloc.h:
223         * wtf/Lock.cpp:
224         (WTF::LockBase::lockSlow):
225         * wtf/Locker.h:
226         (WTF::holdLockIf):
227         * wtf/ScopedLambda.h:
228         * wtf/SharedTask.h:
229         (WTF::SharedTask<PassedResultType):
230         (WTF::SharedTask<ResultType): Deleted.
231         * wtf/StackShot.h: Added.
232         (WTF::StackShot::StackShot):
233         (WTF::StackShot::operator=):
234         (WTF::StackShot::array const):
235         (WTF::StackShot::size const):
236         (WTF::StackShot::operator bool const):
237         (WTF::StackShot::operator== const):
238         (WTF::StackShot::hash const):
239         (WTF::StackShot::isHashTableDeletedValue const):
240         (WTF::StackShot::operator> const):
241         (WTF::StackShot::deletedValueArray):
242         (WTF::StackShotHash::hash):
243         (WTF::StackShotHash::equal):
244         * wtf/StackShotProfiler.h: Added.
245         (WTF::StackShotProfiler::StackShotProfiler):
246         (WTF::StackShotProfiler::profile):
247         (WTF::StackShotProfiler::run):
248
249 2017-12-05  Yusuke Suzuki  <utatane.tea@gmail.com>
250
251         [WTF] Use m_suspendCount instead of m_suspended flag in Thread
252         https://bugs.webkit.org/show_bug.cgi?id=180427
253
254         Reviewed by Carlos Garcia Campos.
255
256         When resuming the thread, signal handler is reinvoked once before `sigsuspend` is resumed.
257         But this handler should not do anything since it is just a signal for `sigsuspend`.
258         Previously, we use m_suspenedd flag to distinguish between suspending and resuming signal
259         handler invocations.
260
261         But this additional m_suspended flag is not necessary since we can use m_suspendCount instead.
262         This patch drops m_suspended and use m_suspendCount. Since semaphore operations emit full memory
263         barrier, m_suspendCount is loaded and stored as we expect.
264
265         * wtf/Threading.h:
266         * wtf/ThreadingPthreads.cpp:
267         (WTF::Thread::signalHandlerSuspendResume):
268         (WTF::Thread::suspend):
269         (WTF::Thread::resume):
270
271 2017-12-04  Simon Fraser  <simon.fraser@apple.com>
272
273         Minor DisplayRefreshMonitor-related cleanup
274         https://bugs.webkit.org/show_bug.cgi?id=179802
275
276         Reviewed by Sam Weinig.
277
278         New trace point for when the CVDisplayLink fires on its own thread.
279
280         * wtf/SystemTracing.h:
281
282 2017-12-04  JF Bastien  <jfbastien@apple.com>
283
284         Update std::expected to match libc++ coding style
285         https://bugs.webkit.org/show_bug.cgi?id=180264
286
287         Reviewed by Alex Christensen.
288
289         As of https://wg21.link/p0323r4 std::expected is on its way to the
290         Library Fundamentals v3 TS (LEWG and EWG voted for this, but LWG
291         hasn't done wording review yet, hence "on its way"). The API is
292         therefore pretty close to what will be in the TS, and I've gotten
293         requests for an easily usable implementation of std::expected. I
294         talked to our clang team and they'll help me migrate our
295         implementation to libc++, but our implementation has to look more
296         like libc++ than it does now. Once in libc++ I'll maintain changes
297         on both sides to make sure neither is out-of-date for too long.
298
299         - Fork std::unexpected into its own header.
300         - Add mild support for an exception-based implementation, but
301           don't do noexcept yet.
302         - Rename everything to follow STL style, and keep a global using
303           or variable alias where possible to reduce WebKit code churn.
304         - Minor API updates to remove things that aren't in the proposal
305           anymore.
306
307         * wtf/Expected.h:
308         (std::experimental::fundamentals_v3::bad_expected_access<void>::bad_expected_access):
309         (std::experimental::fundamentals_v3::bad_expected_access::bad_expected_access):
310         (std::experimental::fundamentals_v3::bad_expected_access::error):
311         (std::experimental::fundamentals_v3::bad_expected_access::error const):
312         (std::experimental::fundamentals_v3::__expected_detail::constexpr_base::constexpr_base):
313         (std::experimental::fundamentals_v3::__expected_detail::base::base):
314         (std::experimental::fundamentals_v3::__expected_detail::base::~base):
315         (std::experimental::fundamentals_v3::expected::expected):
316         (std::experimental::fundamentals_v3::expected::operator=):
317         (std::experimental::fundamentals_v3::expected::swap):
318         (std::experimental::fundamentals_v3::expected::operator-> const):
319         (std::experimental::fundamentals_v3::expected::operator->):
320         (std::experimental::fundamentals_v3::expected::operator* const):
321         (std::experimental::fundamentals_v3::expected::operator*):
322         (std::experimental::fundamentals_v3::expected::has_value const):
323         (std::experimental::fundamentals_v3::expected::value const):
324         (std::experimental::fundamentals_v3::expected::value):
325         (std::experimental::fundamentals_v3::expected::error const):
326         (std::experimental::fundamentals_v3::expected::error):
327         (std::experimental::fundamentals_v3::expected::value_or const):
328         (std::experimental::fundamentals_v3::expected::value_or):
329         (std::experimental::fundamentals_v3::operator==):
330         (std::experimental::fundamentals_v3::operator!=):
331         (std::experimental::fundamentals_v3::swap):
332         (WTF::Unexpected::Unexpected): Deleted.
333         (WTF::Unexpected::value const): Deleted.
334         (WTF::Unexpected::value): Deleted.
335         (WTF::operator==): Deleted.
336         (WTF::operator!=): Deleted.
337         (WTF::makeUnexpected): Deleted.
338         (WTF::ExpectedDetail::Throw): Deleted.
339         (WTF::ExpectedDetail::destroy): Deleted.
340         (WTF::ExpectedDetail::std::is_trivially_destructible<T>::value): Deleted.
341         (WTF::ExpectedDetail::ConstexprBase::ConstexprBase): Deleted.
342         (WTF::ExpectedDetail::Base::Base): Deleted.
343         (WTF::ExpectedDetail::Base::~Base): Deleted.
344         (WTF::Expected::Expected): Deleted.
345         (WTF::Expected::operator=): Deleted.
346         (WTF::Expected::swap): Deleted.
347         (WTF::Expected::operator-> const): Deleted.
348         (WTF::Expected::operator->): Deleted.
349         (WTF::Expected::operator* const): Deleted.
350         (WTF::Expected::operator*): Deleted.
351         (WTF::Expected::operator bool const): Deleted.
352         (WTF::Expected::hasValue const): Deleted.
353         (WTF::Expected::value const): Deleted.
354         (WTF::Expected::value): Deleted.
355         (WTF::Expected::error const): Deleted.
356         (WTF::Expected::error): Deleted.
357         (WTF::Expected::getUnexpected const): Deleted.
358         (WTF::Expected::valueOr const): Deleted.
359         (WTF::Expected::valueOr): Deleted.
360         (WTF::swap): Deleted.
361         (WTF::makeExpected): Deleted.
362         (WTF::makeExpectedFromError): Deleted.
363         * wtf/Forward.h:
364         * wtf/Optional.h:
365         * wtf/StdLibExtras.h:
366         * wtf/Unexpected.h: Added.
367         (std::experimental::fundamentals_v3::unexpected::unexpected):
368         (std::experimental::fundamentals_v3::unexpected::value const):
369         (std::experimental::fundamentals_v3::unexpected::value):
370         (std::experimental::fundamentals_v3::operator==):
371         (std::experimental::fundamentals_v3::operator!=):
372         (makeUnexpected):
373
374 2017-12-03  Tomas Popela  <tpopela@redhat.com>
375
376         Build fails on x86_64 and arm64 with BMalloc disabled
377         https://bugs.webkit.org/show_bug.cgi?id=180188
378
379         Reviewed by Carlos Garcia Campos.
380
381         Add missing methods in WTF's Gigacage.h and fix g_gigacageBasePtr
382         definition.
383
384         * wtf/Gigacage.cpp:
385         * wtf/Gigacage.h:
386         (Gigacage::basePtr):
387         (Gigacage::isEnabled):
388
389 2017-12-03  Yusuke Suzuki  <utatane.tea@gmail.com>
390
391         WTF shouldn't have both Thread and ThreadIdentifier
392         https://bugs.webkit.org/show_bug.cgi?id=180308
393
394         Reviewed by Darin Adler.
395
396         We should use a pointer of WTF::Thread instead of ThreadIdentifier.
397
398         One problem is that Windows support library uses WTF::createThread,
399         which returns ThreadIdentifier. So we cannot drop ThreadIdentifier
400         in Windows environment. This patch keeps ThreadIdentifier in Windows.
401
402         * wtf/MainThread.cpp:
403         (WTF::initializeMainThread):
404         (WTF::isMainThread):
405         (WTF::canAccessThreadLocalDataForThread):
406         * wtf/MainThread.h:
407         * wtf/ParkingLot.cpp:
408         (WTF::ParkingLot::parkConditionallyImpl):
409         (WTF::ParkingLot::unparkOne):
410         (WTF::ParkingLot::unparkOneImpl):
411         (WTF::ParkingLot::unparkCount):
412         * wtf/RecursiveLockAdapter.h:
413         (WTF::RecursiveLockAdapter::lock):
414         (WTF::RecursiveLockAdapter::unlock):
415         (WTF::RecursiveLockAdapter::tryLock):
416         * wtf/Threading.cpp:
417         (WTF::Thread::dump const):
418         * wtf/Threading.h:
419         (WTF::Thread::id const):
420         (WTF::Thread::operator==): Deleted.
421         (WTF::Thread::operator!=): Deleted.
422         (WTF::currentThread): Deleted.
423         * wtf/ThreadingPrimitives.h:
424         * wtf/ThreadingPthreads.cpp:
425         (WTF::Thread::waitForCompletion):
426         (WTF::Thread::detach):
427         (WTF::Thread::initializeCurrentTLS):
428         (WTF::Thread::suspend):
429         (WTF::Thread::establishPlatformSpecificHandle):
430         (WTF::Thread::currentID): Deleted.
431         * wtf/ThreadingWin.cpp:
432         (WTF::Thread::waitForCompletion):
433         (WTF::Thread::suspend):
434         (WTF::Thread::currentDying):
435         * wtf/mac/MainThreadMac.mm:
436         (WTF::initializeApplicationUIThread):
437         (WTF::initializeWebThreadPlatform):
438         (WTF::canAccessThreadLocalDataForThread):
439         (WTF::initializeApplicationUIThreadIdentifier): Deleted.
440         (WTF::initializeWebThreadIdentifier): Deleted.
441
442 2017-12-03  Darin Adler  <darin@apple.com>
443
444         Add WTF::Hasher, an easier to use replacement for WTF::IntegerHasher
445         https://bugs.webkit.org/show_bug.cgi?id=180318
446
447         Reviewed by JF Bastien.
448
449         * WTF.xcodeproj/project.pbxproj: Added Hasher.h.
450         * wtf/CMakeLists.txt: Ditto.
451
452         * wtf/Forward.h: Added Hasher and TextStream.
453
454         * wtf/Hasher.h: Moved StringHasher into a separate header. Added Hasher.
455         Marked IntegerHasher deprecated.
456
457         * wtf/text/CString.cpp: Include StringHasher.h instead of Hasher.h.
458         * wtf/text/StringHash.h: Ditto.
459
460         * wtf/text/StringHasher.h: Added. Moved StringHasher here from Hasher.h.
461
462         * wtf/text/StringImpl.h: Include StringHasher.h instead of Hasher.h.
463
464         * wtf/text/WTFString.h: Added a hash function. This was useful in some
465         adoption I was doing in WebCore, not included in this patch.
466
467         * wtf/unicode/UTF8.cpp: Include StringHasher.h instead of Hasher.h.
468
469 2017-12-02  Brady Eidson  <beidson@apple.com>
470
471         Factor out the "databaseTaskQueue" parts of IDBServer into something reusable.
472         https://bugs.webkit.org/show_bug.cgi?id=180298
473
474         Reviewed by Chris Dumez.
475
476         * WTF.xcodeproj/project.pbxproj:
477         * wtf/CMakeLists.txt:
478
479         * wtf/CrossThreadTaskHandler.cpp: Added.
480         (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler):
481         (WTF::CrossThreadTaskHandler::~CrossThreadTaskHandler):
482         (WTF::CrossThreadTaskHandler::postTask):
483         (WTF::CrossThreadTaskHandler::postTaskReply):
484         (WTF::CrossThreadTaskHandler::taskRunLoop):
485         (WTF::CrossThreadTaskHandler::handleTaskRepliesOnMainThread):
486         * wtf/CrossThreadTaskHandler.h: Added.
487
488 2017-12-01  Mark Lam  <mark.lam@apple.com>
489
490         Let's scramble ClassInfo pointers in cells.
491         https://bugs.webkit.org/show_bug.cgi?id=180291
492         <rdar://problem/35807620>
493
494         Reviewed by JF Bastien.
495
496         * wtf/ScrambledPtr.h:
497         (WTF::ScrambledPtr::descrambled const):
498         (WTF::ScrambledPtr::bits const):
499         (WTF::ScrambledPtr::operator==):
500         (WTF::ScrambledPtr::operator=):
501         (WTF::ScrambledPtr::scramble):
502         (WTF::ScrambledPtr::descramble):
503         (WTF::ScrambledPtr:: const): Deleted.
504         (WTF::ScrambledPtr::scrambledBits const): Deleted.
505
506 2017-12-01  Christopher Reid  <chris.reid@sony.com>
507
508         Move DateComponents into WTF
509         https://bugs.webkit.org/show_bug.cgi?id=180211
510
511         Reviewed by Myles C. Maxfield.
512
513         Moved DateComponents from WebCore/platform into WTF.
514         Removed isLeapYear from DateComponents as DateMath already has that function.
515
516         * WTF.xcodeproj/project.pbxproj:
517         * wtf/CMakeLists.txt:
518         * wtf/DateComponents.cpp: Renamed from Source\WebCore\platform\DateComponents.cpp.
519         * wtf/DateComponents.h: Renamed from Source\WebCore\platform\DateComponents.h.
520
521 2017-12-01  Youenn Fablet  <youenn@apple.com>
522
523         Implement https://w3c.github.io/ServiceWorker/#clients-get
524         https://bugs.webkit.org/show_bug.cgi?id=180167
525
526         Reviewed by Chris Dumez.
527
528         * wtf/text/StringView.h:
529         (WTF::StringView::toUInt64Strict const):
530         * wtf/text/WTFString.h:
531
532 2017-12-01  Brian Burg  <bburg@apple.com>
533
534         Web Inspector: move Inspector::Protocol::Array<T> to JSON namespace
535         https://bugs.webkit.org/show_bug.cgi?id=173662
536
537         Reviewed by Joseph Pecoraro.
538
539         Move Inspector::Protocol::Array<T> to JSON::ArrayOf<T>.
540
541         * wtf/JSONValues.h:
542         (WTF::JSONImpl::ArrayOf::ArrayOf):
543         (WTF::JSONImpl::ArrayOf::openAccessors):
544         (WTF::JSONImpl::ArrayOf::addItem):
545         (WTF::JSONImpl::ArrayOf::create):
546
547 2017-12-01  Brady Eidson  <beidson@apple.com>
548
549         Add Internals.terminateServiceWorker, and the ability to restart service workers for postMessage.
550         https://bugs.webkit.org/show_bug.cgi?id=180170
551
552         Reviewed by Chris Dumez.
553
554         * wtf/CompletionHandler.h:
555         (WTF::CompletionHandler<Out):
556
557 2017-11-30  Yusuke Suzuki  <utatane.tea@gmail.com>
558
559         [JSC] Remove easy toRemove & map.remove() use in OAS phase
560         https://bugs.webkit.org/show_bug.cgi?id=180208
561
562         Reviewed by Mark Lam.
563
564         * wtf/HashMap.h:
565         (WTF::X>::removeIf):
566         * wtf/HashSet.h:
567         (WTF::V>::removeIf):
568         * wtf/HashTable.h:
569         (WTF::KeyTraits>::removeIf):
570
571 2017-11-30  Commit Queue  <commit-queue@webkit.org>
572
573         Unreviewed, rolling out r225362.
574         https://bugs.webkit.org/show_bug.cgi?id=180225
575
576         removeIf predicate function can touch remove target set
577         (Requested by yusukesuzuki on #webkit).
578
579         Reverted changeset:
580
581         "[JSC] Remove easy toRemove & map.remove() use"
582         https://bugs.webkit.org/show_bug.cgi?id=180208
583         https://trac.webkit.org/changeset/225362
584
585 2017-11-30  Mark Lam  <mark.lam@apple.com>
586
587         Let's scramble MacroAssemblerCodePtr values.
588         https://bugs.webkit.org/show_bug.cgi?id=180169
589         <rdar://problem/35758340>
590
591         Reviewed by Filip Pizlo, Saam Barati, and JF Bastien.
592
593         Introduce a ScrambledPtr class to facilitate scrambling.
594
595         * WTF.xcodeproj/project.pbxproj:
596         * wtf/CMakeLists.txt:
597         * wtf/ScrambledPtr.cpp: Added.
598         (WTF::makeScrambledPtrKey):
599         * wtf/ScrambledPtr.h: Added.
600         (WTF::ScrambledPtr::ScrambledPtr):
601         (WTF::ScrambledPtr::paranoidAssertIsScrambled const):
602         (WTF::ScrambledPtr::paranoidAssertIsNotScrambled const):
603         (WTF::ScrambledPtr:: const):
604         (WTF::ScrambledPtr::operator-> const):
605         (WTF::ScrambledPtr::scrambledBits const):
606         (WTF::ScrambledPtr::operator! const):
607         (WTF::ScrambledPtr::operator bool const):
608         (WTF::ScrambledPtr::operator== const):
609         (WTF::ScrambledPtr::operator==):
610         (WTF::ScrambledPtr::scramble):
611         (WTF::ScrambledPtr::descramble):
612
613 2017-11-30  Yusuke Suzuki  <utatane.tea@gmail.com>
614
615         [JSC] Remove easy toRemove & map.remove() use
616         https://bugs.webkit.org/show_bug.cgi?id=180208
617
618         Reviewed by Mark Lam.
619
620         Return bool from removeIf. It is true if removeIf removes at least one entry.
621         This interface is similar to existing HashSet::remove, which returns true
622         if it actually removes entry.
623
624         * wtf/HashMap.h:
625         (WTF::X>::removeIf):
626         * wtf/HashSet.h:
627         (WTF::V>::removeIf):
628         * wtf/HashTable.h:
629         (WTF::KeyTraits>::removeIf):
630
631 2017-11-30  Chris Dumez  <cdumez@apple.com>
632
633         Populate self.registration.installing/waiting/active inside service workers
634         https://bugs.webkit.org/show_bug.cgi?id=180168
635
636         Reviewed by Brady Eidson.
637
638         Add CrossThreadCopier support for std::optional<>.
639
640         * wtf/CrossThreadCopier.h:
641
642 2017-11-29  JF Bastien  <jfbastien@apple.com>
643
644         WTF / bmalloc: don't write to 0xbbadbeef when ASAN is looking
645         https://bugs.webkit.org/show_bug.cgi?id=180175
646
647         Reviewed by Mark Lam.
648
649         ASAN knows that 0xbbadbeef is a bbad aaddress, and tells us so
650         when we write to it, say in an assert. That creates bbad error
651         reports where ASAN thinks we write to an invalid address, instead
652         of thinking that we hit an assertion. In some cases, tooling that
653         use fuzzers aggregate similar issues, and think that we just have
654         the one bug and not a bunch of different asserts.
655
656         * wtf/Assertions.cpp:
657         * wtf/Assertions.h:
658
659 2017-11-29  Filip Pizlo  <fpizlo@apple.com>
660
661         GC should support isoheaps
662         https://bugs.webkit.org/show_bug.cgi?id=179288
663
664         Reviewed by Saam Barati.
665         
666         One of my favorite data structures in the GC is a singly-linked list that knows its tail, so that
667         things get added to it at the end rather that at the beginning. In this patch, I use this to put
668         the same node on multiple lists, which our existing linked list templates also don't support.
669         
670         This adds a new linked list that does those things:
671         
672         - It supports append(). It could also support prepend(), but currently there is no need for it.
673         
674         - It supports nodes that are on multiple lists. The GC uses std::mem_fn() to create a lambda that the
675           list uses to set next.
676
677         * WTF.xcodeproj/project.pbxproj:
678         * wtf/SinglyLinkedListWithTail.h: Added.
679         (WTF::SinglyLinkedListWithTail::isEmpty const):
680         (WTF::SinglyLinkedListWithTail::append):
681         (WTF::SinglyLinkedListWithTail::first const):
682         (WTF::SinglyLinkedListWithTail::last const):
683
684 2017-11-29  Stanislav Ocovaj  <stanislav.ocovaj@rt-rk.com>
685
686         [DFG][MIPS] Enable DFG JIT on MIPS.
687         https://bugs.webkit.org/show_bug.cgi?id=175447
688
689         Reviewed by Carlos Alberto Lopez Perez.
690
691         * wtf/Platform.h:
692
693 2017-11-29  Matt Lewis  <jlewis3@apple.com>
694
695         Unreviewed, rolling out r225286.
696
697         The source files within this patch have been marked as
698         executable.
699
700         Reverted changeset:
701
702         "[MIPS][JSC] Implement MacroAssembler::probe support on MIPS"
703         https://bugs.webkit.org/show_bug.cgi?id=175447
704         https://trac.webkit.org/changeset/225286
705
706 2017-11-29  Stanislav Ocovaj  <stanislav.ocovaj@rt-rk.com>
707
708         [DFG][MIPS] Enable DFG JIT on MIPS.
709         https://bugs.webkit.org/show_bug.cgi?id=175447
710
711         Reviewed by Carlos Alberto Lopez Perez.
712
713         * wtf/Platform.h:
714
715 2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
716
717         Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
718         https://bugs.webkit.org/show_bug.cgi?id=173793
719
720         Reviewed by Joseph Pecoraro.
721
722         Based on patch by Brian Burg.
723
724         Move the implementation into WTF. Put the actual implementation inside
725         namespace WTF::JSONImpl so that the symbols in libwtf start with the WTF prefix.
726         Also provide a top-level JSON namespace so that clients can write JSON::Value.
727         This is essentially a typedef for the entire WTF::JSONImpl namespace.
728
729         * WTF.xcodeproj/project.pbxproj:
730         * wtf/CMakeLists.txt:
731         * wtf/JSONValues.cpp: Renamed from Source/JavaScriptCore/inspector/InspectorValues.cpp.
732         (JSON::Value::null):
733         (JSON::Value::create):
734         (JSON::Value::asValue):
735         (JSON::Value::asObject):
736         (JSON::Value::asArray):
737         (JSON::Value::parseJSON):
738         (JSON::Value::toJSONString const):
739         (JSON::Value::asBoolean const):
740         (JSON::Value::asDouble const):
741         (JSON::Value::asInteger const):
742         (JSON::Value::asString const):
743         (JSON::Value::writeJSON const):
744         (JSON::Value::memoryCost const):
745         (JSON::ObjectBase::~ObjectBase):
746         (JSON::ObjectBase::asObject):
747         (JSON::ObjectBase::openAccessors):
748         (JSON::ObjectBase::memoryCost const):
749         (JSON::ObjectBase::getBoolean const):
750         (JSON::ObjectBase::getString const):
751         (JSON::ObjectBase::getObject const):
752         (JSON::ObjectBase::getArray const):
753         (JSON::ObjectBase::getValue const):
754         (JSON::ObjectBase::remove):
755         (JSON::ObjectBase::writeJSON const):
756         (JSON::ObjectBase::ObjectBase):
757         (JSON::ArrayBase::~ArrayBase):
758         (JSON::ArrayBase::asArray):
759         (JSON::ArrayBase::writeJSON const):
760         (JSON::ArrayBase::ArrayBase):
761         (JSON::ArrayBase::get const):
762         (JSON::Object::create):
763         (JSON::Array::create):
764         (JSON::ArrayBase::memoryCost const):
765         * wtf/JSONValues.h: Renamed from Source/JavaScriptCore/inspector/InspectorValues.h.
766         (JSON::ObjectBase::find):
767         (JSON::ObjectBase::find const):
768         (JSON::ObjectBase::setBoolean):
769         (JSON::ObjectBase::setInteger):
770         (JSON::ObjectBase::setDouble):
771         (JSON::ObjectBase::setString):
772         (JSON::ObjectBase::setValue):
773         (JSON::ObjectBase::setObject):
774         (JSON::ObjectBase::setArray):
775         (JSON::ArrayBase::pushBoolean):
776         (JSON::ArrayBase::pushInteger):
777         (JSON::ArrayBase::pushDouble):
778         (JSON::ArrayBase::pushString):
779         (JSON::ArrayBase::pushValue):
780         (JSON::ArrayBase::pushObject):
781         (JSON::ArrayBase::pushArray):
782
783 2017-11-28  Simon Fraser  <simon.fraser@apple.com>
784
785         Modernize GraphicsLayer dumping
786         https://bugs.webkit.org/show_bug.cgi?id=180067
787
788         Reviewed by Sam Weinig.
789         
790         Expose the current indent.
791
792         * wtf/text/TextStream.h:
793         (WTF::TextStream::indent const):
794
795 2017-11-27  Chris Dumez  <cdumez@apple.com>
796
797         Move callOnMainThreadAndWait() from SocketStreamHandleImplCFNet.cpp to MainThread.h
798         https://bugs.webkit.org/show_bug.cgi?id=180060
799
800         Reviewed by Alex Christensen.
801
802         Move callOnMainThreadAndWait() from SocketStreamHandleImplCFNet.cpp to MainThread.h so that it can be reused.
803
804         * wtf/MainThread.cpp:
805         (WTF::callOnMainThreadAndWait):
806         * wtf/MainThread.h:
807
808 2017-11-27  Simon Fraser  <simon.fraser@apple.com>
809
810         Use TextStream's indent tracking, rather than passing indent to all the externalRepresentation() functions
811         https://bugs.webkit.org/show_bug.cgi?id=180027
812
813         Reviewed by Jon Lee.
814
815         Remove all the indent arguments, and make use of TextStream::IndentScope to control
816         output indentation.
817
818         Add an indent stream manipulator so you can say
819           ts << indent << "text"
820         to write the indent.
821
822         * wtf/text/TextStream.h:
823         (WTF::TextStream::IndentScope::IndentScope):
824         (WTF::TextStream::IndentScope::~IndentScope):
825
826 2016-08-05  Darin Adler  <darin@apple.com>
827
828         Fix some minor problems in the StringImpl header
829         https://bugs.webkit.org/show_bug.cgi?id=160630
830
831         Reviewed by Brent Fulgham.
832
833         * wtf/text/AtomicString.h: Update since CharacterMatchFunctionPtr is now
834         CodeUnitMatchFunction.
835
836         * wtf/text/StringCommon.h: Added CodeUnitMatchFunction, which replaces
837         CharacterMatchFunctionPtr.
838
839         * wtf/text/StringImpl.cpp:
840         (WTF::StringImpl::stripMatchedCharacters): Changed template argument name
841         to CodeUnitPredicate to help make it clear this works on code units, not
842         code points.
843         (WTF::UCharPredicate): Deleted.
844         (WTF::SpaceOrNewlinePredicate): Deleted.
845         (WTF::StringImpl::stripWhiteSpace): Removed unneeded use of predicate class to
846         turn a function into a functor; functions already work fine as functors without
847         a class wrapping them.
848         (WTF::StringImpl::stripLeadingAndTrailingCharacters): Ditto. Also renamed
849         from stripWhiteSpace, since it strips arbitrary characters.
850         (WTF::StringImpl::removeCharacters): Fixed various minor style issues and
851         updated to new type name.
852         (WTF::StringImpl::simplifyMatchedCharactersToSpace): Ditto.
853         (WTF::StringImpl::simplifyWhiteSpace): More of the same.
854         (WTF::StringImpl::find): Ditto.
855
856         * wtf/text/StringImpl.h: Removed unneeded include of uchar.h, since it's
857         included by StringCommon.h. Removed =CharacterMatchFunctionPtr and
858         IsWhiteSpaceFunctionPtr, both replaced by CodeUnitMatchFunction. Fixed
859         a mistake recently introduced in isSpaceOrNewline, which was unnecessarily,
860         inefficiently using ICU for non-ASCII Latin-1 characters.
861
862         * wtf/text/StringView.h: Use CodeUnitMatchFunction instead of CharacterMatchFunction.
863
864         * wtf/text/WTFString.cpp:
865         (WTF::String::stripLeadingAndTrailingCharacters): Updated function name and type.
866         (WTF::String::simplifyWhiteSpace): Updated type.
867         (WTF::String::removeCharacters): Updated type.
868         * wtf/text/WTFString.h: Ditto.
869
870 2017-11-23  Darin Adler  <darin@apple.com>
871
872         Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby
873         https://bugs.webkit.org/show_bug.cgi?id=179981
874
875         Reviewed by Sam Weinig.
876
877         * wtf/OptionSet.h: Added some operators so it's easier to use | and - with individual
878         options from the set.
879
880 2017-11-23  Darin Adler  <darin@apple.com>
881
882         Reduce WTF::String operations that do unnecessary Unicode operations instead of ASCII
883         https://bugs.webkit.org/show_bug.cgi?id=179907
884
885         Reviewed by Sam Weinig.
886
887         * wtf/text/ASCIIFastPath.h: Moved the using for charactersAreAllASCII here since
888         the function is defined here.
889
890         * wtf/text/AtomicString.h: Removed overloads of contains, find, startsWith, and
891         endsWith that take a boolean indicating whether they should be "case sensitive".
892         When false, this was doing Unicode case folding, and no callers needed that.
893         Also tweaked formatting and argument names.
894
895         * wtf/text/IntegerToStringConversion.h: Added an include of LChar.h since this file
896         uses that. Also tweaked formatting a bit.
897
898         * wtf/text/StringImpl.cpp:
899         (WTF::StringImpl::containsOnlyWhitespace): Deleted. Despite its name sounding like
900         it used the full Unicode whitespace definition, this actually checked isASCIISpace.
901         Callers now all use isAllSpecialCharacters instead with the whitespace definition
902         that is appropriate to each call site.
903         (WTF::latin1CaseFoldTable): Deleted.
904         (WTF::equalCompatibilityCaseless): Deleted.
905         (WTF::StringImpl::findIgnoringCase): Deleted.
906         (WTF::findIgnoringCaseInner): Deleted.
907         (WTF::reverseFindIgnoringCaseInner): Deleted.
908         (WTF::StringImpl::reverseFindIgnoringCase): Deleted.
909         (WTF::equalInner): Removed boolean caseSensitive argument.
910         (WTF::StringImpl::startsWith): Ditto.
911         (WTF::StringImpl::endsWith): Ditto.
912
913         * wtf/text/StringImpl.h: Moved TextCaseSensitivity out into a different header.
914         Moved ASCIIFastPath.h include here from WTFString.h. Moved isAllSpecialCharacters
915         free function here from WTFString.h. Moved lots of function bodies out of class
916         definitions to make the class definitions easier to read. Sorted things a bit.
917         Tweaked formatting. Marked constructor that takes one argument explicit. Added
918         an isEmpty function like the one in String. Renamed copyChars to copyCharacters.
919         Added isAllASCII, isAllLatin1 and isAllSpecialCharacters functions. Removed
920         boolean caseSensitive arguments from various functions. Removed findIgnoringCase
921         and reverseFindIgnoringCase. Added a FIXME to codePointCompare about the way it
922         treats null and empty strings as equal. Changed length argument in remove to
923         unsigned to match other lengths.
924
925         * wtf/text/WTFString.cpp:
926         (WTF::String::removeInternal): Changed length argument to be unsigned.
927         (WTF::createWithFormatAndArguments): Use emptyString.
928         (WTF::String::isSafeToSendToAnotherThread const): Rewrote to be easier to read.
929
930         * wtf/text/WTFString.h: Moved ASCIIFastPath.h to StringImpl.h. Moved lots of
931         function bodies out of class definitions to make the class definitions easier
932         to read, made others one-liners. Removed the String::at function but kept the
933         String::characterAt function; the two were identical. Removed boolean
934         caseSensitive arguments from various functions. Removed findIgnoringCase and
935         reverseFindIgnoringCase. Renamed containsOnlyASCII to isAllASCII and
936         containsOnlyLatin1 to isAllLatin1 to match the naming of isAllSpecialCharacters.
937         Moved the inline implementations of functions that are defined above further
938         down, after things like the ASCIILiteral class and various functions.
939
940         * wtf/text/icu/UTextProviderLatin1.cpp: Updated name of copyChars.
941
942 2017-11-22  Stephan Szabo  <stephan.szabo@sony.com>
943
944         tuple related items are used in WTF without including tuple
945         https://bugs.webkit.org/show_bug.cgi?id=179926
946
947         Reviewed by Darin Adler.
948
949         * wtf/HashFunctions.h:
950         * wtf/PrintStream.h:
951         * wtf/threads/Signals.h:
952
953 2017-11-21  Zan Dobersek  <zdobersek@igalia.com>
954
955         Drop ENABLE_IMAGE_DECODER_DOWN_SAMPLING code
956         https://bugs.webkit.org/show_bug.cgi?id=179921
957
958         Reviewed by Carlos Garcia Campos.
959
960         * wtf/FeatureDefines.h: Remove the ENABLE_IMAGE_DECODER_DOWN_SAMPLING
961         definition.
962
963 2017-11-19  Tim Horton  <timothy_horton@apple.com>
964
965         Remove unused TOUCH_ICON_LOADING feature flag
966         https://bugs.webkit.org/show_bug.cgi?id=179873
967
968         Reviewed by Simon Fraser.
969
970         * wtf/FeatureDefines.h:
971
972 2017-11-19  Yusuke Suzuki  <utatane.tea@gmail.com>
973
974         Add CPU(UNKNOWN) to cover all the unknown CPU types
975         https://bugs.webkit.org/show_bug.cgi?id=179243
976
977         Reviewed by JF Bastien.
978
979         This patch adds a new CPU type, `CPU(UNKNOWN)` to cover all the unknown CPUs.
980         This CPU architecture tells conservative assumption to make JSC work on all
981         the unknown generic CPUs. And we make several CPUs (ALPHA, SH4, S390, S390X, IA64, IA64_32)
982         UNKNOWN.
983
984         We also make InlineASM available only for !CPU(UNKNOWN). In an unknown CPU, inline asm is not useful.
985
986         And we also introduce a generic way to detect 64bit pointer environment by using
987         __SIZEOF_POINTER__ predefined macro, or `UINTPTR_MAX > UINT32_MAX`.
988
989         * wtf/InlineASM.h:
990         * wtf/Platform.h:
991         * wtf/dtoa/utils.h:
992
993 2017-11-19  Tim Horton  <timothy_horton@apple.com>
994
995         Remove unused LEGACY_VENDOR_PREFIXES feature flag
996         https://bugs.webkit.org/show_bug.cgi?id=179872
997
998         Reviewed by Darin Adler.
999
1000         * wtf/FeatureDefines.h:
1001
1002 2017-11-19  Chris Dumez  <cdumez@apple.com>
1003
1004         Fix potential thread safety issue in ThreadSafeIdentified
1005         https://bugs.webkit.org/show_bug.cgi?id=179879
1006
1007         Reviewed by Darin Adler.
1008
1009         Fix potential thread safety issue in ThreadSafeIdentified. Protect static std::atomic
1010         initialization with an std::call_once() given that we build with
1011         --fno-threadsafe-statics.
1012
1013         * wtf/Identified.h:
1014         (WTF::Identified::Identified):
1015         (WTF::Identified::generateIdentifier):
1016         (WTF::ThreadSafeIdentified::ThreadSafeIdentified):
1017         (WTF::ThreadSafeIdentified::generateIdentifier):
1018
1019 2017-11-18  Darin Adler  <darin@apple.com>
1020
1021         Eliminate some cases of double hashing, other related refactoring
1022         https://bugs.webkit.org/show_bug.cgi?id=179867
1023
1024         Reviewed by Sam Weinig.
1025
1026         * wtf/text/StringImpl.cpp:
1027         (WTF::StringImpl::containsOnlyWhitespace): Added FIXME.
1028
1029 2017-11-19  Chris Dumez  <cdumez@apple.com>
1030
1031         Fix potential thread safety issue in generateThreadSafeObjectIdentifier()
1032         https://bugs.webkit.org/show_bug.cgi?id=179877
1033
1034         Reviewed by Sam Weinig.
1035
1036         Fix potential thread safety issue in generateThreadSafeObjectIdentifier().
1037         Protect std::atomic initialization with an std::call_once() given that we
1038         build with --fno-threadsafe-statics.
1039
1040         * wtf/ObjectIdentifier.h:
1041         (WTF::generateThreadSafeObjectIdentifier):
1042
1043 2017-11-18  Yusuke Suzuki  <utatane.tea@gmail.com>
1044
1045         [WTF] Use system endianess information instead of relying CPU information
1046         https://bugs.webkit.org/show_bug.cgi?id=179861
1047
1048         Reviewed by JF Bastien.
1049
1050         Currently, we use known CPU information to determine endianess of the current
1051         architecture. But this means that unknown CPU does not work well in WebKit
1052         withou modifying code. Instead, we use compiler or system's macro to determine
1053         endianess. This paves the way to dropping many CPUs in Platform.h by replacing
1054         them with CPU(UNKNOWN)[1].
1055
1056         [1]: https://bugs.webkit.org/show_bug.cgi?id=179243
1057
1058         * wtf/Platform.h:
1059
1060 2017-11-18  Chris Dumez  <cdumez@apple.com>
1061
1062         ASSERTION FAILED: registration in WebCore::SWServerJobQueue::scriptContextStarted(ServiceWorkerIdentifier)
1063         https://bugs.webkit.org/show_bug.cgi?id=179846
1064
1065         Reviewed by Darin Adler.
1066
1067         Add a generateThreadSafeObjectIdentifier() for generating an ObjectIdentifier
1068         in a thread-safe manner, using std::atomic.
1069
1070         * wtf/ObjectIdentifier.h:
1071         (WTF::generateObjectIdentifier):
1072         (WTF::generateThreadSafeObjectIdentifier):
1073
1074 2017-11-18  Yusuke Suzuki  <utatane.tea@gmail.com>
1075
1076         [WTF] Remove CPU(HPPA) in StackBounds by using runtime stack direction test
1077         https://bugs.webkit.org/show_bug.cgi?id=179859
1078
1079         Reviewed by JF Bastien.
1080
1081         Currently, we know that CPU(HPPA)'s stack direction is upward! But listing
1082         CPU architectures here is not a scalable way.
1083
1084         Instead, we use runtime stack direction test. By doing so, we can handle
1085         such a strange architecture without listing the CPU to Platform.h. This paves
1086         the way to dropping many CPUs in Platform.h by replacing them with CPU(UNKNOWN)[1].
1087
1088         We also fix StackBounds::isGrowingDownward().
1089
1090         [1]: https://bugs.webkit.org/show_bug.cgi?id=179243
1091
1092         * wtf/StackBounds.cpp:
1093         (WTF::StackBounds::stackDirection):
1094         (WTF::testStackDirection2):
1095         (WTF::testStackDirection):
1096         (WTF::StackBounds::newThreadStackBounds):
1097         (WTF::StackBounds::currentThreadStackBoundsInternal):
1098         * wtf/StackBounds.h:
1099         (WTF::StackBounds::isGrowingDownward const):
1100
1101 2017-11-17  Chris Dumez  <cdumez@apple.com>
1102
1103         Use a strongly typed identifier for SWServer::Connection
1104         https://bugs.webkit.org/show_bug.cgi?id=179848
1105
1106         Reviewed by Brady Eidson.
1107
1108         Make ObjectIdentifier a little more flexible to support more use cases.
1109
1110         * wtf/ObjectIdentifier.h:
1111         (WTF::ObjectIdentifier::toUInt64 const):
1112         (WTF::makeObjectIdentifier):
1113
1114 2017-11-17  Simon Fraser  <simon.fraser@apple.com>
1115
1116         Add a TimingScope class for microbenchmarking sections of code
1117         https://bugs.webkit.org/show_bug.cgi?id=179825
1118
1119         Reviewed by Zalan Bujtas.
1120         
1121         Add a class, similar to B3TimingScope, which makes it easy to microbenchmark
1122         sections of code. Use looks like:
1123         
1124         TimingScope scope("some label", 100);
1125         
1126         where this will print mean scope duration every 100 calls. Sample output:
1127         
1128             FETurbulence::platformApplySoftware: 100 calls, mean duration: 3.073181ms
1129             FETurbulence::platformApplySoftware: 200 calls, mean duration: 3.074612ms
1130             FETurbulence::platformApplySoftware: 300 calls, mean duration: 3.065722ms
1131         
1132         Because TimingScope needs to store state beween invocations, and there may be
1133         multiple TimingScopes in use at the same time, data is stored in a global
1134         hash map with atomic access.
1135
1136         * WTF.xcodeproj/project.pbxproj:
1137         * wtf/CMakeLists.txt:
1138         * wtf/TimingScope.cpp: Added.
1139         (WTF::TimingScope::scopeDidEnd):
1140         * wtf/TimingScope.h: Added.
1141         (WTF::TimingScope::TimingScope):
1142         (WTF::TimingScope::~TimingScope):
1143
1144 2017-11-17  Alex Christensen  <achristensen@webkit.org>
1145
1146         Clean up after r224952
1147         https://bugs.webkit.org/show_bug.cgi?id=179809
1148
1149         Reviewed by Brady Eidson.
1150
1151         * wtf/MainThread.cpp:
1152         (WTF::dispatchFunctionsFromMainThread):
1153         (WTF::callOnMainThread):
1154         * wtf/MainThread.h:
1155         * wtf/generic/MainThreadGeneric.cpp:
1156         (WTF::scheduleDispatchFunctionsOnMainThread):
1157         (WTF::currentRunLoopInCommonMode): Deleted.
1158         * wtf/mac/MainThreadMac.mm:
1159         (WTF::scheduleDispatchFunctionsOnMainThread):
1160         (WTF::currentRunLoopInCommonMode): Deleted.
1161         * wtf/win/MainThreadWin.cpp:
1162         (WTF::scheduleDispatchFunctionsOnMainThread):
1163         (WTF::currentRunLoopInCommonMode): Deleted.
1164
1165 2017-11-15  Alex Christensen  <achristensen@webkit.org>
1166
1167         Fix fast/events/message-port-postMessage-recursive.html after r224896
1168         https://bugs.webkit.org/show_bug.cgi?id=179749
1169
1170         Reviewed by Jer Noble.
1171
1172         * wtf/mac/MainThreadMac.mm:
1173         (WTF::currentRunLoopInCommonMode):
1174         We sometimes run the runloop in kCFRunLoopDefaultMode, which should also have the responsiveness optimization.
1175         This allows the runloop to continue to iterate when we are doing lots of things on the main thread.
1176         CFRunLoop.h has a special definition of these two constants.
1177
1178 2017-11-15  Alex Christensen  <achristensen@webkit.org>
1179
1180         WebViews scheduled in custom run loop modes should be able to do more than 50ms of work at a time
1181         https://bugs.webkit.org/show_bug.cgi?id=179742
1182         <rdar://problem/35519421>
1183
1184         Reviewed by Jer Noble.
1185         
1186         In r224687 I fixed loading from scheduled WebViews with custom run loop modes, but in 
1187         dispatchFunctionsFromMainThread we have an optimization to yield the run loop if we have already
1188         done more than 50ms of work on the main thread in this run loop iteration.  When this happens
1189         and we are running in a custom run loop mode, we disable this responsiveness optimization.
1190         We are calling CFRunLoopRunInMode or [NSRunLoop acceptInputForMode:beforeDate:] in a while loop anyways,
1191         so we would not benefit from a responsiveness optimization.  We definitely don't want to reschedule
1192         on the main thread in the common run loop mode in this case.
1193
1194         * wtf/MainThread.cpp:
1195         (WTF::dispatchFunctionsFromMainThread):
1196         * wtf/MainThread.h:
1197         * wtf/generic/MainThreadGeneric.cpp:
1198         (WTF::currentRunLoopInCommonMode):
1199         * wtf/mac/MainThreadMac.mm:
1200         (WTF::currentRunLoopInCommonMode):
1201         * wtf/win/MainThreadWin.cpp:
1202         (WTF::currentRunLoopInCommonMode):
1203
1204 2017-11-15  Ryan Haddad  <ryanhaddad@apple.com>
1205
1206         Unreviewed, rolling out r224863.
1207
1208         Introduced LayoutTest crashes on iOS Simulator.
1209
1210         Reverted changeset:
1211
1212         "Move JSONValues to WTF and convert uses of InspectorValues.h
1213         to JSONValues.h"
1214         https://bugs.webkit.org/show_bug.cgi?id=173793
1215         https://trac.webkit.org/changeset/224863
1216
1217 2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1218
1219         Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
1220         https://bugs.webkit.org/show_bug.cgi?id=173793
1221
1222         Reviewed by Brian Burg.
1223
1224         * WTF.xcodeproj/project.pbxproj:
1225         * wtf/CMakeLists.txt:
1226         * wtf/JSONValues.cpp: Renamed from Source/JavaScriptCore/inspector/InspectorValues.cpp.
1227         (JSON::Value::null):
1228         (JSON::Value::create):
1229         (JSON::Value::asValue):
1230         (JSON::Value::asObject):
1231         (JSON::Value::asArray):
1232         (JSON::Value::parseJSON):
1233         (JSON::Value::toJSONString const):
1234         (JSON::Value::asBoolean const):
1235         (JSON::Value::asDouble const):
1236         (JSON::Value::asInteger const):
1237         (JSON::Value::asString const):
1238         (JSON::Value::writeJSON const):
1239         (JSON::Value::memoryCost const):
1240         (JSON::ObjectBase::~ObjectBase):
1241         (JSON::ObjectBase::asObject):
1242         (JSON::ObjectBase::openAccessors):
1243         (JSON::ObjectBase::memoryCost const):
1244         (JSON::ObjectBase::getBoolean const):
1245         (JSON::ObjectBase::getString const):
1246         (JSON::ObjectBase::getObject const):
1247         (JSON::ObjectBase::getArray const):
1248         (JSON::ObjectBase::getValue const):
1249         (JSON::ObjectBase::remove):
1250         (JSON::ObjectBase::writeJSON const):
1251         (JSON::ObjectBase::ObjectBase):
1252         (JSON::ArrayBase::~ArrayBase):
1253         (JSON::ArrayBase::asArray):
1254         (JSON::ArrayBase::writeJSON const):
1255         (JSON::ArrayBase::ArrayBase):
1256         (JSON::ArrayBase::get const):
1257         (JSON::Object::create):
1258         (JSON::Array::create):
1259         (JSON::ArrayBase::memoryCost const):
1260         * wtf/JSONValues.h: Renamed from Source/JavaScriptCore/inspector/InspectorValues.h.
1261         (JSON::ObjectBase::find):
1262         (JSON::ObjectBase::find const):
1263         (JSON::ObjectBase::setBoolean):
1264         (JSON::ObjectBase::setInteger):
1265         (JSON::ObjectBase::setDouble):
1266         (JSON::ObjectBase::setString):
1267         (JSON::ObjectBase::setValue):
1268         (JSON::ObjectBase::setObject):
1269         (JSON::ObjectBase::setArray):
1270         (JSON::ArrayBase::pushBoolean):
1271         (JSON::ArrayBase::pushInteger):
1272         (JSON::ArrayBase::pushDouble):
1273         (JSON::ArrayBase::pushString):
1274         (JSON::ArrayBase::pushValue):
1275         (JSON::ArrayBase::pushObject):
1276         (JSON::ArrayBase::pushArray):
1277
1278 2017-11-14  Alex Christensen  <achristensen@webkit.org>
1279
1280         Remove Cocoa CFURLConnection loading code
1281         https://bugs.webkit.org/show_bug.cgi?id=179688
1282
1283         Reviewed by Antti Koivisto.
1284
1285         * wtf/SchedulePair.h:
1286         * wtf/SchedulePairMac.mm:
1287
1288 2017-11-13  Brady Eidson  <beidson@apple.com>
1289
1290         Massive "Server-process-to-context-process" connection overhaul.
1291         https://bugs.webkit.org/show_bug.cgi?id=179554
1292
1293         Reviewed by Chris Dumez.
1294
1295         * wtf/ObjectIdentifier.h:
1296         (WTF::generateObjectIdentifier):
1297         (WTF::makeObjectIdentifier): Deleted.
1298
1299 2017-11-13  JF Bastien  <jfbastien@apple.com>
1300
1301         std::expected: fix and test move
1302         https://bugs.webkit.org/show_bug.cgi?id=179617
1303
1304         Reviewed by Alex Christensen.
1305
1306         Non-copyable move types should be able to be in an expected
1307         properly.
1308
1309         * wtf/Expected.h:
1310         (WTF::Expected::value const):
1311         (WTF::Expected::error):
1312         (WTF::Expected::error const):
1313
1314 2017-11-10  Jer Noble  <jer.noble@apple.com>
1315
1316         Add a FairPlay Streaming based CDM for Modern EME
1317         https://bugs.webkit.org/show_bug.cgi?id=179499
1318         <rdar://problem/35445033>
1319
1320         Reviewed by Eric Carlson.
1321
1322         * wtf/Platform.h:
1323
1324 2017-11-10  Alex Christensen  <achristensen@webkit.org>
1325
1326         REGRESSION(r224267): WebViews scheduled with custom run loop modes don't load
1327         https://bugs.webkit.org/show_bug.cgi?id=179515
1328         <rdar://problem/35445245>
1329
1330         Reviewed by Andy Estes.
1331
1332         * wtf/MainThread.cpp:
1333         (WTF::callOnMainThread):
1334         * wtf/MainThread.h:
1335         (WTF::callOnMainThread):
1336         (WTF::scheduleDispatchFunctionsOnMainThread):
1337         * wtf/generic/MainThreadGeneric.cpp:
1338         (WTF::scheduleDispatchFunctionsOnMainThread):
1339         * wtf/mac/MainThreadMac.mm:
1340         (WTF::scheduleDispatchFunctionsOnMainThread):
1341         * wtf/win/MainThreadWin.cpp:
1342         (WTF::scheduleDispatchFunctionsOnMainThread):
1343         Add an optional parameter which is an array of run loop mode names to pass to performSelectorOnMainThread.
1344
1345 2017-11-10  Ms2ger  <Ms2ger@igalia.com>
1346
1347         Export tryFastZeroedMalloc.
1348         https://bugs.webkit.org/show_bug.cgi?id=179051
1349
1350         Reviewed by Michael Catanzaro.
1351
1352         The other functions were exported in bug 72855. There does not seem to be a
1353         reason not to export this one.
1354
1355         * wtf/FastMalloc.h:
1356
1357 2017-11-09  Chris Dumez  <cdumez@apple.com>
1358
1359         Unreviewed, rolling out r224661.
1360
1361         Broke build on several internal Mac/iOS bots
1362
1363         Reverted changeset:
1364
1365         "Ignore HSTS for partitioned, cross-origin subresource
1366         requests"
1367         https://bugs.webkit.org/show_bug.cgi?id=178993
1368         https://trac.webkit.org/changeset/224661
1369
1370 2017-11-09  John Wilander  <wilander@apple.com>
1371
1372         Ignore HSTS for partitioned, cross-origin subresource requests
1373         https://bugs.webkit.org/show_bug.cgi?id=178993
1374         <rdar://problem/34962462>
1375
1376         Reviewed by Brent Fulgham.
1377
1378         * wtf/Platform.h:
1379             Added HAVE_CFNETWORK_IGNORE_HSTS.
1380
1381 2017-11-08  Tim Horton  <timothy_horton@apple.com>
1382
1383         [ios-simulator] API test WebKit.BundleParameters is a flaky failure
1384         https://bugs.webkit.org/show_bug.cgi?id=178363
1385         <rdar://problem/35043144>
1386
1387         Reviewed by Brent Fulgham.
1388
1389         * wtf/RefCounter.h:
1390         (WTF::RefCounter<T>::Count::deref):
1391         (WTF::RefCounter<T>::Count::refCounterWasDeleted):
1392         (WTF::RefCounter<T>::~RefCounter):
1393         If a RefCounter::Count is deref()'d and drops its RefCounter's value to
1394         zero, and the RefCounter is deleted in that valueDidChangeCallback, it
1395         will delete the Counter that is in the middle of deref(). Keep track
1396         of whether we're inside the callback and defer the deletion until
1397         the end of deref().
1398
1399 2017-11-07  Maciej Stachowiak  <mjs@apple.com>
1400
1401         Get rid of unsightly hex numbers from unified build object files
1402         https://bugs.webkit.org/show_bug.cgi?id=179410
1403
1404         Reviewed by Saam Barati.
1405
1406         * Scripts/generate-unified-source-bundles.rb: For extensions other than "cpp", also include 
1407         the extension in the base name of the file, to avoid ugly Xcode-generated object file names.
1408
1409 2017-11-07  Filip Pizlo  <fpizlo@apple.com>
1410
1411         Disable isoheaps on iOS
1412
1413         Reviewed by Ryosuke Niwa.
1414
1415         * wtf/IsoMalloc.h:
1416
1417 2017-11-07  Brady Eidson  <beidson@apple.com>
1418
1419         Implement "UpdateWorkerState" and use it
1420         https://bugs.webkit.org/show_bug.cgi?id=179318
1421
1422         Reviewed by Chris Dumez.
1423
1424         * wtf/ObjectIdentifier.h:
1425         (WTF::ObjectIdentifier::loggingString const):
1426
1427 2017-11-07  Michael Saboff  <msaboff@apple.com>
1428
1429         Add SPI function pointers qualifiers for CPU(ARM64E)
1430         https://bugs.webkit.org/show_bug.cgi?id=179383
1431
1432         Reviewed by Mark Lam.
1433
1434         For ARM64E, use the appropriate SPI qualifiers for helper function pointers.
1435
1436         * wtf/BlockPtr.h:
1437         (WTF::BlockPtr<R):
1438
1439 2017-10-31  Filip Pizlo  <fpizlo@apple.com>
1440
1441         bmalloc should support strictly type-segregated isolated heaps
1442         https://bugs.webkit.org/show_bug.cgi?id=178108
1443
1444         Reviewed by Saam Barati, Simon Fraser, and Ryosuke Niwa.
1445         
1446         This just adds an easy way of using the bmalloc IsoHeap API in WebKit. If bmalloc is not
1447         enabled, these macros will just make the object FastMalloced.
1448
1449         * WTF.xcodeproj/project.pbxproj:
1450         * wtf/FastTLS.h:
1451         * wtf/IsoMalloc.h: Added.
1452         * wtf/IsoMallocInlines.h: Added.
1453
1454 2017-11-06  Christopher Reid  <chris.reid@sony.com>
1455
1456         Use enum classes within FileSystem
1457         https://bugs.webkit.org/show_bug.cgi?id=175172
1458
1459         Reviewed by Myles C. Maxfield.
1460
1461         Adding a helper function for converting enum classes to their underlying type when necessary.
1462
1463         * wtf/EnumTraits.h:
1464
1465 2017-11-06  Michael Catanzaro  <mcatanzaro@igalia.com>
1466
1467         [WPE][GTK] Always use SET_AND_EXPOSE_TO_BUILD to set build variables
1468         https://bugs.webkit.org/show_bug.cgi?id=179038
1469
1470         Reviewed by Žan Doberšek.
1471
1472         * wtf/Platform.h:
1473
1474 2017-11-03  Chris Dumez  <cdumez@apple.com>
1475
1476         Use a single identifier type to identify Service Workers
1477         https://bugs.webkit.org/show_bug.cgi?id=179192
1478
1479         Reviewed by Brady Eidson.
1480
1481         Introduce class for strongly typed identifiers. This avoids mixing up
1482         different types of identifiers.
1483
1484         * WTF.xcodeproj/project.pbxproj:
1485         * wtf/ObjectIdentifier.h: Added.
1486         (WTF::ObjectIdentifier::encode const):
1487         (WTF::ObjectIdentifier::decode):
1488         (WTF::ObjectIdentifier::operator== const):
1489         (WTF::ObjectIdentifier::operator!= const):
1490         (WTF::ObjectIdentifier::ObjectIdentifier):
1491         (WTF::makeObjectIdentifier):
1492         (WTF::ObjectIdentifierHash::hash):
1493         (WTF::ObjectIdentifierHash::equal):
1494         (WTF::HashTraits<ObjectIdentifier<T>>::emptyValue):
1495         (WTF::HashTraits<ObjectIdentifier<T>>::constructDeletedValue):
1496         (WTF::HashTraits<ObjectIdentifier<T>>::isDeletedValue):
1497
1498 2017-11-02  Ryan Haddad  <ryanhaddad@apple.com>
1499
1500         Unreviewed, rolling out r224353.
1501
1502         Breaks internal builds.
1503
1504         Reverted changeset:
1505
1506         "Ignore HSTS for partitioned, cross-origin subresource
1507         requests"
1508         https://bugs.webkit.org/show_bug.cgi?id=178993
1509         https://trac.webkit.org/changeset/224353
1510
1511 2017-11-02  John Wilander  <wilander@apple.com>
1512
1513         Ignore HSTS for partitioned, cross-origin subresource requests
1514         https://bugs.webkit.org/show_bug.cgi?id=178993
1515         <rdar://problem/34962462>
1516
1517         Reviewed by Brent Fulgham and Alex Christensen.
1518
1519         * wtf/Platform.h:
1520             Added HAVE_CFNETWORK_IGNORE_HSTS.
1521
1522 2017-11-02  Frederic Wang  <fwang@igalia.com>
1523
1524         Add references to bug 179167 in FIXME comments
1525         https://bugs.webkit.org/show_bug.cgi?id=179168
1526
1527         Reviewed by Daniel Bates.
1528
1529         * wtf/FeatureDefines.h:
1530
1531 2017-11-01  Jiewen Tan  <jiewen_tan@apple.com>
1532
1533         Let is<T>() accept RefPtrs
1534         https://bugs.webkit.org/show_bug.cgi?id=178612
1535         <rdar://problem/35102004>
1536
1537         Reviewed by Ryosuke Niwa.
1538
1539         Add support for is<T>() for RefPtrs.
1540
1541         * wtf/RefPtr.h:
1542         (WTF::is):
1543
1544 2017-11-01  Simon Fraser  <simon.fraser@apple.com>
1545
1546         Misc display list and other cleanup
1547         https://bugs.webkit.org/show_bug.cgi?id=179150
1548
1549         Reviewed by Tim Horton.
1550
1551         Add system trace points for display list recording.
1552
1553         * wtf/SystemTracing.h:
1554
1555 2017-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
1556
1557         Use LazyNeverDestroyed instead of DEFINE_GLOBAL
1558         https://bugs.webkit.org/show_bug.cgi?id=174979
1559
1560         Reviewed by Yusuke Suzuki.
1561
1562         DEFINE_GLOBAL is not used anymore. Remove it.
1563
1564         * WTF.xcodeproj/project.pbxproj: Removed StaticConstructors.h
1565         * config.h: Removed definitions of SKIP_STATIC_CONSTRUCTORS_ON_MSVC and SKIP_STATIC_CONSTRUCTORS_ON_GCC.
1566         * wtf/CMakeLists.txt: Removed StaticConstructors.h
1567         * wtf/StaticConstructors.h: Removed.
1568
1569 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1570
1571         [WPE] Fix build warnings
1572         https://bugs.webkit.org/show_bug.cgi?id=178899
1573
1574         Reviewed by Carlos Alberto Lopez Perez.
1575
1576         * wtf/PlatformWPE.cmake:
1577
1578 2017-10-27  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1579
1580         [WinCairo] Add WTF files for wincairo webkit
1581         https://bugs.webkit.org/show_bug.cgi?id=176894
1582
1583         Reviewed by Alex Christensen.
1584
1585         * wtf/PlatformWin.cmake:
1586         * wtf/WorkQueue.cpp:
1587         * wtf/WorkQueue.h:
1588         * wtf/win/Win32Handle.h:
1589         * wtf/win/WorkItemContext.cpp: Added.
1590         (WTF::WorkItemContext::WorkItemContext):
1591         (WTF::WorkItemContext::create):
1592         (WTF::WorkItemContext::~WorkItemContext):
1593         * wtf/win/WorkItemContext.h: Added.
1594         (WTF::WorkItemContext::handle):
1595         (WTF::WorkItemContext::waitHandle):
1596         (WTF::WorkItemContext::Function<void):
1597         (WTF::WorkItemContext::queue const):
1598         * wtf/win/WorkQueueWin.cpp:
1599         (WTF::WorkQueue::handleCallback):
1600         (WTF::WorkQueue::registerHandle):
1601         (WTF::WorkQueue::unregisterAndCloseHandle):
1602         (WTF::WorkQueue::unregisterWaitAndDestroyItemSoon):
1603         (WTF::WorkQueue::unregisterWaitAndDestroyItemCallback):
1604
1605 2017-10-27  Keith Miller  <keith_miller@apple.com>
1606
1607         Add unified source list files and build scripts to Xcode project navigator
1608         https://bugs.webkit.org/show_bug.cgi?id=178959
1609
1610         Reviewed by Andy Estes.
1611
1612         * WTF.xcodeproj/project.pbxproj:
1613
1614 2017-10-26  Mark Lam  <mark.lam@apple.com>
1615
1616         JSRopeString::RopeBuilder::append() should check for overflows.
1617         https://bugs.webkit.org/show_bug.cgi?id=178385
1618         <rdar://problem/35027468>
1619
1620         Reviewed by Saam Barati.
1621
1622         * wtf/CheckedArithmetic.h:
1623
1624 2017-10-25  Commit Queue  <commit-queue@webkit.org>
1625
1626         Unreviewed, rolling out r222945.
1627         https://bugs.webkit.org/show_bug.cgi?id=178818
1628
1629         "It made WasmBench crash" (Requested by saamyjoon on #webkit).
1630
1631         Reverted changeset:
1632
1633         "bmalloc mutex should be adaptive"
1634         https://bugs.webkit.org/show_bug.cgi?id=177839
1635         https://trac.webkit.org/changeset/222945
1636
1637 2017-10-25  Zan Dobersek  <zdobersek@igalia.com>
1638
1639         Make SERVICE_WORKER feature buildable on GTK, WPE
1640         https://bugs.webkit.org/show_bug.cgi?id=178574
1641
1642         Reviewed by Carlos Garcia Campos.
1643
1644         * wtf/Identified.h: Explicitly include the <atomic> header since
1645         std::atomic<> is used in the ThreadSafeIdentified definition.
1646
1647 2017-10-24  Michael Saboff  <msaboff@apple.com>
1648
1649         WTF: Eliminated PLATFORM checks for HAVE_MACH_EXCEPTIONS
1650         https://bugs.webkit.org/show_bug.cgi?id=178747
1651
1652         Reviewed by Saam Barati.
1653
1654         Removed unnecessary PLATFORM checks as they can cause build failures
1655         when the include file is present.
1656
1657         * wtf/Platform.h:
1658
1659 2017-10-23  Yusuke Suzuki  <utatane.tea@gmail.com>
1660
1661         [JSC] Use fastJoin in Array#toString
1662         https://bugs.webkit.org/show_bug.cgi?id=178062
1663
1664         Reviewed by Darin Adler.
1665
1666         A bit cleaning up to use StringImpl::copyChars instead of
1667         using for-loop directly.
1668
1669         * wtf/text/StringView.h:
1670         (WTF::StringView::getCharactersWithUpconvert const):
1671
1672 2017-10-20  Antoine Quint  <graouts@apple.com>
1673
1674         [Web Animations] Provide basic timeline and animation interfaces
1675         https://bugs.webkit.org/show_bug.cgi?id=178526
1676
1677         Reviewed by Dean Jackson.
1678
1679         Remove the WEB_ANIMATIONS compile-time flag.
1680
1681         * wtf/FeatureDefines.h:
1682
1683 2017-10-19  Keith Miller  <keith_miller@apple.com>
1684
1685         REGRESSION (r223476): WebCore exports symbols with names belonging to other frameworks
1686         https://bugs.webkit.org/show_bug.cgi?id=178424
1687
1688         Reviewed by David Kilzer.
1689
1690         This patch moves the wrapper function sharing the name of the externed function
1691         to the source file and marks it as always inline. Marking it as inline prevents
1692         the framework from exporting it.
1693
1694         * wtf/cocoa/SoftLinking.h:
1695
1696 2017-10-18  Keith Miller  <keith_miller@apple.com>
1697
1698         Setup WebCore build to start using unified sources.
1699         https://bugs.webkit.org/show_bug.cgi?id=178362
1700
1701         Reviewed by Tim Horton.
1702
1703         There are a number of changes to the bundler script. First, it is
1704         now possible to enable or disable building files based on if the
1705         associated feature flag is enabled or not. The syntax for this is
1706         similar to how we do #ifs in C++ code. e.g.
1707
1708         #if ENABLE_APPLE_PAY
1709             myApplePayFile.cpp
1710         #endif
1711
1712         would enable myApplePayFile.cpp if and only if the APPLE_PAY
1713         feature define is set.
1714
1715         I also changed comments from # to // to make it less likely they
1716         would be confused with a #if.
1717
1718         Finally, this patch enables bundling files in the same relative
1719         directory across source list files. Previously, if
1720         SourcesCocoa.txt had platform/cf/foo.cpp and SourcesMac.txt had
1721         platform/cf/bar.cpp those files would not be put in the same
1722         unified source bundle. Now, those files will be put into the same
1723         bundle but bar.cpp will always follow foo.cpp. The idea is that by
1724         putting more specific files after more general files we can avoid
1725         random build failures.
1726
1727         * Scripts/generate-unified-source-bundles.rb:
1728
1729 2017-10-18  Konstantin Tokarev  <annulen@yandex.ru>
1730
1731         REGRESSION(r217771): nullTerminatedWCharToString loses last character of input string
1732         https://bugs.webkit.org/show_bug.cgi?id=178444
1733
1734         Reviewed by Per Arne Vollan.
1735
1736         * wtf/text/win/WCharStringExtras.h:
1737         (WTF::nullTerminatedWCharToString):
1738
1739 2017-10-17  Keith Miller  <keith_miller@apple.com>
1740
1741         Change WebCore sources to work with unified source builds
1742         https://bugs.webkit.org/show_bug.cgi?id=178229
1743
1744         Rubber stamped by Tim Horton.
1745
1746         * wtf/Platform.h:
1747         * wtf/cocoa/SoftLinking.h:
1748
1749 2017-10-16  David Kilzer  <ddkilzer@apple.com>
1750
1751         Add RELEASE_ASSERT_WITH_SECURITY_IMPLICATION() macro
1752         <https://webkit.org/b/178269>
1753
1754         Reviewed by Alex Christensen.
1755
1756         * wtf/Assertions.h:
1757         (RELEASE_ASSERT_WITH_SECURITY_IMPLICATION): Add macro.
1758
1759 2017-10-14  Sam Weinig  <sam@webkit.org>
1760
1761         Remove HashCountedSet's copyToVector functions
1762         https://bugs.webkit.org/show_bug.cgi?id=178215
1763
1764         Reviewed by Daniel Bates.
1765
1766         * wtf/HashCountedSet.h:
1767         (WTF::copyToVector): Deleted.
1768         
1769             They are replaced by either copyToVector(hashCountedSet) or copyToVector(hashCountedSet.values())
1770
1771 2017-10-13  Sam Weinig  <sam@webkit.org>
1772
1773         Adopt type trait template aliases everywhere in WTF
1774         https://bugs.webkit.org/show_bug.cgi?id=178299
1775
1776         Reviewed by Yusuke Suzuki.
1777
1778         Adopt type trait template aliases (e.g. replace 'typename std::make_unsigned<Source>::type'
1779         with 'std::make_unsigned_t<Source>'). Also adopt using over typedef consistently.
1780
1781         * wtf/Atomics.h:
1782         * wtf/CagedUniquePtr.h:
1783         * wtf/CheckedArithmetic.h:
1784         * wtf/CompletionHandler.h:
1785         * wtf/Function.h:
1786         * wtf/HashCountedSet.h:
1787         * wtf/HashFunctions.h:
1788         * wtf/HashMap.h:
1789         * wtf/HashSet.h:
1790         * wtf/HashTable.h:
1791         * wtf/HashTraits.h:
1792         * wtf/IndexedContainerIterator.h:
1793         * wtf/IteratorAdaptors.h:
1794         * wtf/KeyValuePair.h:
1795         * wtf/LEBDecoder.h:
1796         * wtf/ListHashSet.h:
1797         * wtf/MathExtras.h:
1798         * wtf/NeverDestroyed.h:
1799         * wtf/OptionSet.h:
1800         * wtf/RetainPtr.h:
1801         * wtf/SizeLimits.cpp:
1802         * wtf/StdLibExtras.h:
1803         * wtf/SystemFree.h:
1804         * wtf/ThreadSpecific.h:
1805         * wtf/TypeCasts.h:
1806         * wtf/Vector.h:
1807         * wtf/text/IntegerToStringConversion.h:
1808
1809 2017-10-13  Jer Noble  <jer.noble@apple.com>
1810
1811         Performance: Skip texture upload if source image and destination texture haven't changed
1812         https://bugs.webkit.org/show_bug.cgi?id=178254
1813         <rdar://problem/34968181>
1814
1815         Reviewed by Dean Jackson.
1816
1817         Add a new class, UnsafePointer, for safely holding pointers to objects with uncontrolled lifetimes.
1818
1819         * WTF.xcodeproj/project.pbxproj:
1820         * wtf/UnsafePointer.h: Added.
1821         (WTF::UnsafePointer::UnsafePointer):
1822         (WTF::UnsafePointer::operator== const):
1823         (WTF::UnsafePointer::operator!= const):
1824         (WTF::UnsafePointer::operator bool const):
1825         (WTF::operator==):
1826         (WTF::operator!=):
1827
1828 2017-10-13  Per Arne Vollan  <pvollan@apple.com>
1829
1830         [Win] When built with VS2017, MiniBrowser crashes on startup.
1831         https://bugs.webkit.org/show_bug.cgi?id=175209
1832
1833         Reviewed by Daniel Bates.
1834
1835         Add AtomicString(const StaticStringImpl*) constructor. This is needed since
1836         this patch adds constexpr to the static, global StaticStringImpl objects
1837         generated in WebCore/bindings/scripts/StaticString.pm.
1838
1839         * wtf/text/AtomicString.h:
1840         (WTF::AtomicString::AtomicString):
1841         * wtf/text/AtomicStringImpl.cpp:
1842         (WTF::addStatic):
1843         (WTF::AtomicStringImpl::add):
1844         * wtf/text/AtomicStringImpl.h:
1845         * wtf/text/StringImpl.h:
1846         (WTF::StringImpl::assertHashIsCorrect const):
1847         (WTF::StringImpl::assertHashIsCorrect): Deleted.
1848
1849 2017-10-12  Alex Christensen  <achristensen@webkit.org>
1850
1851         Add Expected, HashMap, HashSet, and SHA1 to wtf/Forward.h
1852         https://bugs.webkit.org/show_bug.cgi?id=178243
1853
1854         Reviewed by Tim Horton.
1855
1856         * wtf/Forward.h:
1857         * wtf/HashMap.h:
1858         Move default parameters to Forward.h like we did with Vector.
1859         * wtf/HashSet.h:
1860         Also fix indentation.
1861
1862 2017-10-12  Alex Christensen  <achristensen@webkit.org>
1863
1864         Add CompletionHandler and HashCountedSet to wtf/Forward.h
1865         https://bugs.webkit.org/show_bug.cgi?id=178231
1866
1867         Reviewed by Tim Horton.
1868
1869         * wtf/Forward.h:
1870         * wtf/HashCountedSet.h:
1871
1872 2017-10-11  Sam Weinig  <sam@webkit.org>
1873
1874         Remove out-parameter variants of copyToVector
1875         https://bugs.webkit.org/show_bug.cgi?id=178155
1876
1877         Reviewed by Tim Horton.
1878
1879         * wtf/HashMap.h:
1880         (WTF::copyToVector): Deleted.
1881         * wtf/HashSet.h:
1882         (WTF::copyToVector): Deleted.
1883         
1884             Remove copyToVector.
1885         
1886         * wtf/Vector.h:
1887         (WTF::copyToVectorSpecialization):
1888         
1889             Add another version of copyToVector, called copyToVectorSpecialization, that allows
1890             you to specify the entire specialization for the Vector you want to copy to. This
1891             can be useful if you want your resulting Vector to have an inline capacity. 
1892
1893 2017-10-12  Sam Weinig  <sam@webkit.org>
1894
1895         It should be possible to iterate just the values (and not the counts) of a HashCountedSet
1896         https://bugs.webkit.org/show_bug.cgi?id=178169
1897
1898         Reviewed by Daniel Bates.
1899
1900         Cleanup (fix indentation, simplify type names, adopt using), and add a values() range to
1901         HashCountedSet. This will allow getting a Vector of all the values (and not the counts)
1902         using the new copyToVector. 
1903
1904         * wtf/HashCountedSet.h:
1905
1906 2017-10-11  Michael Saboff  <msaboff@apple.com>
1907
1908         [JSC] Add ability to build with ARMV8 ILP32 ABI
1909         https://bugs.webkit.org/show_bug.cgi?id=178194
1910
1911         Reviewed by Saam Barati.
1912
1913         For ARMV8 32 bit ABI, use JSVALUE32_64 and the CLOOP.
1914
1915         * wtf/Platform.h:
1916
1917 2017-10-11  Youenn Fablet  <youenn@apple.com>
1918
1919         Add API to clean CacheStorage data
1920         https://bugs.webkit.org/show_bug.cgi?id=178034
1921
1922         Reviewed by Chris Dumez.
1923
1924         Moving CallbackAggregator pattern into its own class for easier reuse.
1925
1926         * WTF.xcodeproj/project.pbxproj:
1927         * wtf/CallbackAggregator.h: Added.
1928         (WTF::CallbackAggregator::create):
1929         (WTF::CallbackAggregator::~CallbackAggregator):
1930         (WTF::CallbackAggregator::CallbackAggregator):
1931
1932 2017-10-10  Sam Weinig  <sam@webkit.org>
1933
1934         Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values())
1935         https://bugs.webkit.org/show_bug.cgi?id=178102
1936
1937         Reviewed by Tim Horton.
1938
1939         * wtf/HashMap.h:
1940         (WTF::copyKeysToVector): Deleted.
1941         (WTF::copyValuesToVector): Deleted.
1942         
1943             Remove copyKeysToVector and copyValuesToVector which are no longer used.
1944
1945 2017-10-09  Youenn Fablet  <youenn@apple.com>
1946
1947         Vector should be able to easily create from a list of movable only items
1948         https://bugs.webkit.org/show_bug.cgi?id=176432
1949
1950         Reviewed by Darin Adler.
1951
1952         Adding static from method to construct a Vector from movable-only items.
1953         This may also be used instead of initializer list constructor for types that would benefit of being moved.
1954
1955         * wtf/Vector.h:
1956         (WTF::Vector::Vector):
1957         (WTF::Vector::from):
1958         (WTF::Vector::uncheckedInitialize): Introduced as an optimization to set the vector size once.
1959         (WTF::Malloc>::reserveInitialCapacity):
1960
1961 2017-10-09  Tim Horton  <timothy_horton@apple.com>
1962
1963         Disable INPUT_TYPE_COLOR in FeatureDefines.h
1964         https://bugs.webkit.org/show_bug.cgi?id=178103
1965         <rdar://problem/34872127>
1966
1967         Reviewed by Simon Fraser.
1968
1969         * wtf/FeatureDefines.h:
1970         Because FeatureDefines.h overrides features that are not enabled in
1971         FeatureDefines.xcconfig, you currently have to turn INPUT_TYPE_COLOR
1972         off in two places. Since we only ever want it on for Mac, it's OK
1973         to depend on the xcconfig defining it.
1974
1975 2017-10-09  Sam Weinig  <sam@webkit.org>
1976
1977         Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
1978         https://bugs.webkit.org/show_bug.cgi?id=178072
1979
1980         Reviewed by Darin Adler.
1981
1982         Introduce SizedIteratorRange, a variant of IteratorRange that includes
1983         a reference to a backing container in order to get the size of container.
1984         This is useful for algorithms like WTF::map and WTF::copyToVector, that
1985         can use the size to efficiently allocate things of the correct size.
1986
1987         The main beneficiary are HashMap's keys() and values() functions which
1988         used to return IteratorRanges and now return SizedIteratorRange. This
1989         allows us to remove (in a future change) copyKeysToVector() and
1990         copyValuesToVector() by replacing them with copyToVector(map.keys()) and
1991         copyToVector(map.values()) respectively.
1992
1993         * wtf/HashMap.h:
1994         * wtf/IteratorRange.h:
1995         (WTF::SizedIteratorRange::SizedIteratorRange):
1996         (WTF::SizedIteratorRange::size const):
1997         (WTF::SizedIteratorRange::begin const):
1998         (WTF::SizedIteratorRange::end const):
1999         (WTF::makeSizedIteratorRange):
2000
2001 2017-10-08  Sam Weinig  <sam@webkit.org>
2002
2003         It should be possible to create a ListHashSet with a std::initializer_list.
2004         https://bugs.webkit.org/show_bug.cgi?id=178070
2005
2006         Reviewed by Darin Adler.
2007
2008         * wtf/ListHashSet.h:
2009         (WTF::U>::ListHashSet):
2010         Add a constructor that takes a std::initializer_list.
2011
2012 2017-10-08  Sam Weinig  <sam@webkit.org>
2013
2014         Address additional feedback from Darin for r223039 and sort the using declarations.
2015
2016         * wtf/Vector.h:
2017
2018 2017-10-08  Sam Weinig  <sam@webkit.org>
2019
2020         There should be a version of copyToVector that returns a Vector, rather than using an out parameter
2021         https://bugs.webkit.org/show_bug.cgi?id=177732
2022
2023         Reviewed by Saam Barati.
2024
2025         Add two new helper functions, copyToVector and copyToVectorOf, which will be able to
2026         replace the existing out parameter taking copyToVector. Like it's ancestral namesake,
2027         copyToVector takes an object that is both iterable (supports begin() and end()) and
2028         has a size, and returns a Vector with a copy of all the items iterated. The copyToVectorOf
2029         variant allow the user to specify a type to convert to, so if you have a HashSet<int>
2030         but want those as floats in a Vector, you can do:
2031         
2032             auto floatVector = copyToVectorOf<float>(intSet);
2033
2034         * wtf/Vector.h:
2035         (WTF::copyToVector):
2036         (WTF::copyToVectorOf):
2037
2038 2017-10-08  Darin Adler  <darin@apple.com>
2039
2040         Fix bugs related to setting reflected floating point DOM attributes
2041         https://bugs.webkit.org/show_bug.cgi?id=178061
2042
2043         Reviewed by Sam Weinig.
2044
2045         * wtf/dtoa.cpp:
2046         (WTF::formatStringTruncatingTrailingZerosIfNeeded): Fix a bug where
2047         this function would remove trailing zeroes from the exponent if
2048         present instead of from the mantissa. This meant that it would
2049         format 1e10 as "1.00000e+1" instead of "1e+10". Added regression
2050         tests for this to TestWebKitAPI.
2051
2052         * wtf/dtoa/utils.h:
2053         (WTF::double_conversion::StringBuilder::RemoveCharacters): Added.
2054         Used by the fix above.
2055
2056         * wtf/text/AtomicString.cpp:
2057         (WTF::AtomicString::number): Note: This function is used by code
2058         that sets the values of reflected floating point DOM attributes.
2059         Changed the function to use the rules from numberToString rather
2060         ones from numberToFixedPrecisionString. This is analogous to
2061         String::numberToStringECMAScript, and in the future we should change
2062         String and StringBuilder so this "ECMAScript" semantic is the default
2063         way to convert a floating point number to a string, and rename the fixed
2064         precision version that is currently called String::number. I audited
2065         the small number of sites calling AtomicString::number, by temporarily
2066         renaming it, and discovered that this is the correct behavior for all;
2067         none needed fixed precision. Also, fixed a mistake where this explicitly
2068         converted to String. That was defeating the purpose of having these
2069         functions in AtomicString: It would allocate a new String and then
2070         destroy it in the case where an equal string was already in the
2071         AtomicString table.
2072
2073 2017-10-06  Commit Queue  <commit-queue@webkit.org>
2074
2075         Unreviewed, rolling out r222791 and r222873.
2076         https://bugs.webkit.org/show_bug.cgi?id=178031
2077
2078         Caused crashes with workers/wasm LayoutTests (Requested by
2079         ryanhaddad on #webkit).
2080
2081         Reverted changesets:
2082
2083         "WebAssembly: no VM / JS version of everything but Instance"
2084         https://bugs.webkit.org/show_bug.cgi?id=177473
2085         http://trac.webkit.org/changeset/222791
2086
2087         "WebAssembly: address no VM / JS follow-ups"
2088         https://bugs.webkit.org/show_bug.cgi?id=177887
2089         http://trac.webkit.org/changeset/222873
2090
2091 2017-10-06  Antti Koivisto  <antti@apple.com>
2092
2093         Minor WeakPtr improvements
2094         https://bugs.webkit.org/show_bug.cgi?id=177958
2095
2096         Reviewed by Sam Weinig.
2097
2098         * wtf/WeakPtr.h:
2099         (WTF::WeakPtr::operator bool const):
2100
2101             Make explicit.
2102
2103         (WTF::WeakPtrFactory::createWeakPtr const):
2104         (WTF::makeWeakPtr):
2105
2106             Remove templating from createWeakPtr, makeWeakPtr() is now the
2107             canonical way to make derived-type WeakPtrs.
2108
2109 2017-10-04  Filip Pizlo  <fpizlo@apple.com>
2110
2111         bmalloc mutex should be adaptive
2112         https://bugs.webkit.org/show_bug.cgi?id=177839
2113
2114         Reviewed by Michael Saboff.
2115         
2116         Add some comments that I thought of while copy-pasting this code.
2117
2118         Reland after fixing ancient WordLock bug: the notify_one has to happen with the lock held
2119         to ensure it doesn't run after that thread has died.
2120
2121         * wtf/LockAlgorithmInlines.h:
2122         * wtf/WordLock.cpp:
2123
2124 2017-10-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2125
2126         Generate a compile error if release is built without compiler optimizations
2127         https://bugs.webkit.org/show_bug.cgi?id=177665
2128
2129         Reviewed by Brian Burg.
2130
2131         For GCC and Clang, generate an error at build time that will alert
2132         the developer that she is trying to build Release without any compiler
2133         optimization. A build time error is much better than an unexpected
2134         "oh, WebKit is really slow ..."  situation later.
2135
2136         If this was intended, then we tell the developer that she can continue
2137         by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
2138         flags.
2139
2140         The intention of this patch is to ensure that nobody builds Release
2141         without enabling compiler optimization by mistake.
2142
2143         * wtf/Compiler.h:
2144
2145 2017-10-05  David Kilzer  <ddkilzer@apple.com>
2146
2147         Bug 177893: Disable -Wcast-qual for new clang compiler in Apple ports
2148         <https://webkit.org/b/177893>
2149         <rdar://problem/33667497>
2150
2151         Reviewed by Tim Horton.
2152
2153         * wtf/RetainPtr.h:
2154         (WTF::RetainPtr::fromStorageType const): Disable warnings for
2155         -Wcast-qual until we can provide a safe cast function that lets
2156         us re-enable the warning.
2157
2158 2017-10-05  Matt Lewis  <jlewis3@apple.com>
2159
2160         Unreviewed, rolling out r222893.
2161
2162         This caused multiple API failures.
2163
2164         Reverted changeset:
2165
2166         "bmalloc mutex should be adaptive"
2167         https://bugs.webkit.org/show_bug.cgi?id=177839
2168         http://trac.webkit.org/changeset/222893
2169
2170 2017-10-04  Filip Pizlo  <fpizlo@apple.com>
2171
2172         bmalloc mutex should be adaptive
2173         https://bugs.webkit.org/show_bug.cgi?id=177839
2174
2175         Reviewed by Michael Saboff.
2176         
2177         Add some comments that I thought of while copy-pasting this code.
2178
2179         * wtf/LockAlgorithmInlines.h:
2180         * wtf/WordLock.cpp:
2181
2182 2017-10-04  JF Bastien  <jfbastien@apple.com>
2183
2184         WTF: Update std::expected to match current proposal
2185         https://bugs.webkit.org/show_bug.cgi?id=177881
2186
2187         Reviewed by Mark Lam.
2188
2189         The proposal is likely to be in C++20 and I've been asked to help co-champion
2190         it. I'm therefore updating our implementation to more closely match the current
2191         proposal, and to make sure it'll work for us if standardized.
2192
2193          - Rename UnexpectedType to Unexpected to match the proposal.
2194          - Remove relational operators, only equality / inequality remains.
2195          - Fix minor type signatures.
2196          - Add UnexpectedType typedef.
2197          - Uncomment rebind implementation.
2198          - Add in-place construction tag, as well as explicit error construction tag.
2199          - Add template unexpected constructor.
2200          - Note that make_unexpected isn't in the proposal anymore, but we keep it because we don't have C++17 deduction guides.
2201          - Remove hashing, which isn't in the proposal anymore.
2202
2203         * wtf/Expected.h:
2204         (WTF::Unexpected::Unexpected):
2205         (WTF::Unexpected::value const):
2206         (WTF::operator==):
2207         (WTF::operator!=):
2208         (WTF::makeUnexpected):
2209         (WTF::Expected::Expected):
2210         (WTF::Expected::operator=):
2211         (WTF::Expected::getUnexpected const):
2212
2213 2017-10-04  Ryan Haddad  <ryanhaddad@apple.com>
2214
2215         Unreviewed, rolling out r222840.
2216
2217         This change breaks internal builds.
2218
2219         Reverted changeset:
2220
2221         "Generate a compile error if release is built without compiler
2222         optimizations"
2223         https://bugs.webkit.org/show_bug.cgi?id=177665
2224         http://trac.webkit.org/changeset/222840
2225
2226 2017-10-04  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2227
2228         Generate a compile error if release is built without compiler optimizations
2229         https://bugs.webkit.org/show_bug.cgi?id=177665
2230
2231         Reviewed by Michael Catanzaro.
2232
2233         For GCC and Clang, generate an error at build time that will alert
2234         the developer that she is trying to build Release without any compiler
2235         optimization. A build time error is much better than an unexpected
2236         "oh, WebKit is really slow ..."  situation later.
2237
2238         If this was intended, then we tell the developer that she can continue
2239         by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
2240         flags.
2241
2242         The intention of this patch is to ensure that nobody builds Release
2243         without enabling compiler optimization by mistake.
2244
2245         * wtf/Compiler.h:
2246
2247 2017-10-04  Tomas Popela  <tpopela@redhat.com>
2248
2249         Allow building without WOFF enabled
2250
2251         Reviewed by Michael Catanzaro.
2252
2253         Don't force the WOFF to be turned on, but follow what is set in cmake.
2254
2255         * wtf/Platform.h:
2256
2257 2017-10-03  Saam Barati  <sbarati@apple.com>
2258
2259         Implement polymorphic prototypes
2260         https://bugs.webkit.org/show_bug.cgi?id=176391
2261
2262         Reviewed by Filip Pizlo.
2263
2264         * wtf/Box.h:
2265         (WTF::Box::operator bool const):
2266         (WTF::Box::operator bool): Deleted.
2267         Make Box movable. Also ensure its operator bool doesn't do an atomic increment.
2268         * wtf/RefPtr.h:
2269         (WTF::RefPtr::operator bool const):
2270         Add `explicit operator bool()` for RefPtr.
2271
2272 2017-10-03  Antti Koivisto  <antti@apple.com>
2273
2274         Allow assigning WeakPtr<Derived> to WeakPtr<Base>
2275         https://bugs.webkit.org/show_bug.cgi?id=177817
2276
2277         Reviewed by Geoff Garen.
2278
2279         Add templated copy/move constructors/assignment operators, similar to RefPtr.
2280
2281         * wtf/WeakPtr.h:
2282         (WTF::WeakPtrFactory::createWeakPtr const):
2283         (WTF::weak_reference_upcast):
2284         (WTF::weak_reference_downcast):
2285         (WTF::WeakPtr<T>::WeakPtr):
2286         (WTF::=):
2287         (WTF::makeWeakPtr):
2288
2289 2017-10-03  JF Bastien  <jfbastien@apple.com>
2290
2291         WebAssembly: no VM / JS version of everything but Instance
2292         https://bugs.webkit.org/show_bug.cgi?id=177473
2293
2294         Reviewed by Filip Pizlo.
2295
2296         * wtf/StdLibExtras.h:
2297         (WTF::default_construct_at): this makes code in WasmTable much
2298         more readable, and is generally useful for generic code
2299
2300 2017-10-02  Myles C. Maxfield  <mmaxfield@apple.com>
2301
2302         Move LineEnding.{h,cpp} from WebCore/platform/text to wtf/text
2303         https://bugs.webkit.org/show_bug.cgi?id=176575
2304
2305         Reviewed by Alex Christensen.
2306
2307         As part of the PAL effort, we're trying to move everything out of WebCore/platform, one-by-one.
2308         These LineEnding files belong in WTF.
2309
2310         * WTF.xcodeproj/project.pbxproj:
2311         * wtf/text/LineEnding.cpp: Renamed from Source/WebCore/platform/text/LineEnding.cpp.
2312         (WTF::normalizeLineEndingsToCRLF):
2313         * wtf/text/LineEnding.h: Renamed from Source/WebCore/platform/text/LineEnding.h.
2314
2315 2017-10-02  Geoffrey Garen  <ggaren@apple.com>
2316
2317         WeakPtr should have a move constructor
2318         https://bugs.webkit.org/show_bug.cgi?id=177789
2319
2320         Reviewed by Chris Dumez.
2321
2322         * wtf/WeakPtr.h: Now that we just have a RefPtr data member,
2323         the default operators are sufficient.
2324
2325 2017-10-02  Geoffrey Garen  <ggaren@apple.com>
2326
2327         NULL WeakPtr should not malloc!
2328         https://bugs.webkit.org/show_bug.cgi?id=177773
2329
2330         Reviewed by Antti Koivisto.
2331
2332         Translating NULL into malloc is... inefficient.
2333
2334         * wtf/WeakPtr.h:
2335         (WTF::WeakPtr::WeakPtr):
2336         (WTF::WeakPtr::operator=):
2337         (WTF::WeakPtr::clear): Make m_ref lazy so that a NULL m_ref can represent
2338         a NULL pointer. Normal dereference is no slower because we can rely on
2339         the fact that dereference of NULL should crash. operator bool() and get()
2340         incur an extra branch. That's probably worth it to avoid malloc
2341         for NULL.
2342
2343 2017-10-02  Antti Koivisto  <antti@apple.com>
2344
2345         Add makeWeakPtr variant that takes pointer
2346         https://bugs.webkit.org/show_bug.cgi?id=177767
2347
2348         Reviewed by Zalan Bujtas.
2349
2350         * wtf/WeakPtr.h:
2351         (WTF::makeWeakPtr):
2352
2353         This version deals with the nullptr.
2354
2355 2017-09-30  Antti Koivisto  <antti@apple.com>
2356
2357         Add makeWeakPtr for easier WeakPtr construction
2358         https://bugs.webkit.org/show_bug.cgi?id=177706
2359
2360         Reviewed by Sam Weinig.
2361
2362         Standalone makeWeakPtr() returns a WeakPtr of the same type as the argument.
2363
2364         For this to work the argument type needs to expose a (possibly base type) WeakPtrFactory
2365         as a public weakPtrFactory() member function.
2366
2367         * wtf/WeakPtr.h:
2368         (WTF::WeakPtr::operator-> const):
2369         (WTF::WeakPtr::operator* const): Also add operator*.
2370         (WTF::makeWeakPtr):
2371
2372 2017-09-28  Jiewen Tan  <jiewen_tan@apple.com>
2373
2374         WeakPtrFactory should allow downcasting
2375         https://bugs.webkit.org/show_bug.cgi?id=177389
2376         <rdar://problem/34604174>
2377
2378         Reviewed by Geoffrey Garen.
2379
2380         In this patch, WeakPtrFactory is enhanced with the ability to create WeakPtrs
2381         of its owner's sub classes and have them point to the same WeakReference.
2382
2383         * wtf/WeakPtr.h:
2384         (WTF::WeakPtr::WeakPtr):
2385         We cannot determine the base class of type T, thus no friends. It is made public
2386         such that WeakPtrFactory with a base class type U can create a derived type T
2387         WeakPtr.
2388         (WTF::WeakPtrFactory::createWeakPtr const):
2389
2390 2017-09-28  Don Olmstead  <don.olmstead@sony.com>
2391
2392         Sync SYSTEM_MALLOC implementation of Gigacage
2393         https://bugs.webkit.org/show_bug.cgi?id=177569
2394
2395         Reviewed by Mark Lam.
2396
2397         * wtf/Gigacage.h:
2398         (Gigacage::basePtr):
2399         (Gigacage::basePtrs):
2400
2401 2017-09-27  Per Arne Vollan  <pvollan@apple.com>
2402
2403         [Win64] Compile error, 'BasePtrs' is undefined.
2404         https://bugs.webkit.org/show_bug.cgi?id=177565
2405
2406         Reviewed by Mark Lam.
2407
2408         Copy definition of 'BasePtrs' from bmalloc/GigaCage.h.
2409
2410         * wtf/Gigacage.h:
2411
2412 2017-09-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
2413
2414         Followup (r222427): SynchronizedFixedQueue should not have a public constructor
2415         https://bugs.webkit.org/show_bug.cgi?id=177458
2416
2417         Reviewed by Tim Horton.
2418
2419         Since SynchronizedFixedQueue is now derived from ThreadSafeRefCounted<SynchronizedFixedQueue>,
2420         the standard way to have an instance of it is to call SynchronizedFixedQueue::create()
2421         which returns a Ref<SynchronizedFixedQueue>. Now it does not make sense to still
2422         have the constructor public.
2423
2424         * wtf/SynchronizedFixedQueue.h:
2425         (WTF::SynchronizedFixedQueue::SynchronizedFixedQueue):
2426
2427 2017-09-24  Keith Miller  <keith_miller@apple.com>
2428
2429         JSC build should use unified sources for derived sources
2430         https://bugs.webkit.org/show_bug.cgi?id=177421
2431
2432         Reviewed by JF Bastien.
2433
2434         The script now needs to determine if a file is from a derived
2435         source. This is only relevant for the CMake build since the
2436         script needs to provide a list of the bundled source files. If the
2437         script does not provide the full path for derived sources then
2438         CMake will be unable to find them and the build will fail.
2439
2440         Additionally, I move the error message for the Xcode build outside
2441         the main loop. This means that the error message will contain all
2442         the files you need to add to Xcode and all those files will now be
2443         written in DerivedSources so they should be easier to add.
2444
2445         * Scripts/generate-unified-source-bundles.rb:
2446
2447 2017-09-26  Zan Dobersek  <zdobersek@igalia.com>
2448
2449         Support building JavaScriptCore with the Bionic C library
2450         https://bugs.webkit.org/show_bug.cgi?id=177427
2451
2452         Reviewed by Michael Catanzaro.
2453
2454         * wtf/Platform.h: Define HAVE_MACHINE_CONTEXT when __BIONIC__
2455         is defined, i.e. when building with the Bionic C library.
2456
2457 2017-09-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
2458
2459         Images may render partial frames even after loading all the encoded data
2460         https://bugs.webkit.org/show_bug.cgi?id=177406
2461
2462         Reviewed by Simon Fraser.
2463
2464         Make it possible to create a RefPtr<SynchronizedFixedQueue>.
2465
2466         * wtf/SynchronizedFixedQueue.h:
2467         (WTF::SynchronizedFixedQueue::create):
2468         (WTF::SynchronizedFixedQueue::enqueue):
2469         (WTF::SynchronizedFixedQueue::dequeue):
2470
2471 2017-09-22  Zalan Bujtas  <zalan@apple.com>
2472
2473         WeakPtrFactory should populate m_ref lazily.
2474         https://bugs.webkit.org/show_bug.cgi?id=177375
2475
2476         Reviewed by Geoffrey Garen.
2477
2478         This helps us with the overhead of initializing WeakPtrFactory for
2479         objects that rarely end up creating the weak reference.
2480         -This is in preparation for introducing WeakPtr to RenderObject.
2481
2482         All credit to Geoffrey Garen.
2483
2484         * wtf/WeakPtr.h:
2485         (WTF::WeakReference::get const):
2486         (WTF::WeakReference::clear):
2487         (WTF::WeakReference::WeakReference):
2488         (WTF::WeakPtrFactory::~WeakPtrFactory):
2489         (WTF::WeakPtrFactory::createWeakPtr const):
2490         (WTF::WeakPtrFactory::revokeAll):
2491         (WTF::WeakPtrFactory::WeakPtrFactory): Deleted.
2492
2493 2017-09-21  Alex Christensen  <achristensen@webkit.org>
2494
2495         Make StringBuilder movable
2496         https://bugs.webkit.org/show_bug.cgi?id=177311
2497
2498         Reviewed by Chris Dumez.
2499
2500         * wtf/text/StringBuilder.h:
2501         (WTF::StringBuilder::StringBuilder):
2502
2503 2017-09-20  Keith Miller  <keith_miller@apple.com>
2504
2505         JSC should use unified sources for platform specific files.
2506         https://bugs.webkit.org/show_bug.cgi?id=177290
2507
2508         Reviewed by Michael Saboff.
2509
2510         The unified source bundler script can now handle more than one
2511         list of sources. Sources will not be bundled across source file
2512         lists. We want to ensure that changing one platform's sources
2513         doesn't break another platform's build, as much as
2514         possible. Additionally, it means that there won't be weird
2515         performance changes when files are added to an unrelated platform.
2516
2517         Remove stale reference to generate-unified-source-bundles.rb script
2518         from Xcode.
2519
2520         * Scripts/generate-unified-source-bundles.rb:
2521         * WTF.xcodeproj/project.pbxproj:
2522
2523 2017-09-20  Stephan Szabo  <stephan.szabo@sony.com>
2524
2525         [Win] WTF: Add alias for process id to use in place of direct uses of pid_t
2526         https://bugs.webkit.org/show_bug.cgi?id=177017
2527
2528         Reviewed by Alex Christensen.
2529
2530         * wtf/ProcessID.h:
2531         (WTF::getCurrentProcessID):
2532
2533 2017-09-20  Keith Miller  <keith_miller@apple.com>
2534
2535         JSC Xcode build should use unified sources for platform independent files
2536         https://bugs.webkit.org/show_bug.cgi?id=177190
2537
2538         Reviewed by Saam Barati.
2539
2540         Add a new directory for build scripts that are forwarded to subsequent framework builds.
2541
2542         * Scripts/generate-unified-source-bundles.rb: Renamed from Source/WTF/generate-unified-source-bundles.rb.
2543         * WTF.xcodeproj/project.pbxproj:
2544         * wtf/CMakeLists.txt:
2545
2546 2017-09-20  Per Arne Vollan  <pvollan@apple.com>
2547
2548         [Win] Cannot find script to generate unified sources.
2549         https://bugs.webkit.org/show_bug.cgi?id=177014
2550
2551         Reviewed by Keith Miller.
2552
2553         Copy the ruby script to WTF/Scripts in the forwarding headers folder.
2554
2555         * wtf/CMakeLists.txt:
2556
2557 2017-09-20  Alberto Garcia  <berto@igalia.com>
2558
2559         Fix HPPA and Alpha builds
2560         https://bugs.webkit.org/show_bug.cgi?id=177224
2561
2562         Reviewed by Alex Christensen.
2563
2564         * wtf/Platform.h:
2565
2566 2017-09-19  Youenn Fablet  <youenn@apple.com>
2567
2568         Allow WTF::map to use any class that is iterable and has a size getter
2569         https://bugs.webkit.org/show_bug.cgi?id=177026
2570
2571         Reviewed by Darin Adler.
2572
2573         Computing the Item type given to the lambda using the iterator instead of ValueType which is specific to Vector.
2574         Adding the possibility to pass a non const container reference and a lambda taking non const references as well. 
2575
2576         * wtf/Vector.h:
2577         (WTF::MapFunctionInspector::acceptsReference):
2578         (WTF::Mapper::map):
2579         (WTF::map):
2580
2581 2017-09-19  Jer Noble  <jer.noble@apple.com>
2582
2583         [Cocoa] Add an ImageDecoder subclass backed by AVFoundation
2584         https://bugs.webkit.org/show_bug.cgi?id=176825
2585
2586         Reviewed by Eric Carlson.
2587
2588         * wtf/Platform.h:
2589
2590 2017-09-18  Andy Estes  <aestes@apple.com>
2591
2592         [Cocoa] Upstream sandbox-related WebKitSystemInterface functions
2593         https://bugs.webkit.org/show_bug.cgi?id=177047
2594
2595         Reviewed by Daniel Bates.
2596
2597         * wtf/spi/darwin/SandboxSPI.h:
2598
2599 2017-09-18  Ryan Haddad  <ryanhaddad@apple.com>
2600
2601         Unreviewed, rolling out r222170.
2602
2603         The API test added with this change is failing.
2604
2605         Reverted changeset:
2606
2607         "Allow WTF::map to use any class that is iterable and has a
2608         size getter"
2609         https://bugs.webkit.org/show_bug.cgi?id=177026
2610         http://trac.webkit.org/changeset/222170
2611
2612 2017-09-18  Youenn Fablet  <youenn@apple.com>
2613
2614         Allow WTF::map to use any class that is iterable and has a size getter
2615         https://bugs.webkit.org/show_bug.cgi?id=177026
2616
2617         Reviewed by Darin Adler.
2618
2619         Computing the Item type given to the lambda using the iterator instead of ValueType which is specific to Vector.
2620         Adding the possibility to pass a non const container reference and a lambda taking non const references as well. 
2621
2622         * wtf/Vector.h:
2623         (WTF::MapFunctionInspector::acceptsReference):
2624         (WTF::Mapper::map):
2625         (WTF::map):
2626
2627 2017-09-15  JF Bastien  <jfbastien@apple.com>
2628
2629         WTF: use Forward.h when appropriate instead of Vector.h
2630         https://bugs.webkit.org/show_bug.cgi?id=176984
2631
2632         Reviewed by Saam Barati.
2633
2634         There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.
2635
2636         * wtf/Forward.h:
2637         * wtf/Vector.h:
2638         * wtf/text/StringVector.h:
2639
2640 2017-09-15  Keith Miller  <keith_miller@apple.com>
2641
2642         generate-unified-source-bundles.rb shouldn't write a file that isn't going to change
2643         https://bugs.webkit.org/show_bug.cgi?id=177021
2644
2645         Reviewed by Tim Horton.
2646
2647         * generate-unified-source-bundles.rb:
2648
2649 2017-09-14  Saam Barati  <sbarati@apple.com>
2650
2651         We should have a way of preventing a caller from making a tail call and we should use it for ProxyObject instead of using build flags
2652         https://bugs.webkit.org/show_bug.cgi?id=176863
2653
2654         Reviewed by Keith Miller.
2655
2656         This patch adds a way for a particular function to mark
2657         that none of its calls should be tail calls.
2658         
2659         It's useful in the following example if you don't want foo
2660         to do a tail call to bar or baz:
2661         
2662         int foo(bool b)
2663         {
2664             NO_TAIL_CALLS();
2665             if (b)
2666                 return baz();
2667             return bar();
2668         }
2669         
2670         Note that we're not saying that bar/baz should not be tail callable. bar/baz
2671         may have other callers that are allowed to tail call it. This macro just says
2672         that foo itself will not perform any tail calls.
2673
2674         * WTF.xcodeproj/project.pbxproj:
2675         * wtf/NoTailCalls.h: Added.
2676         (WTF::NoTailCalls::~NoTailCalls):
2677
2678 2017-09-14  Mark Lam  <mark.lam@apple.com>
2679
2680         AddressSanitizer: stack-buffer-underflow in JSC::Probe::Page::Page
2681         https://bugs.webkit.org/show_bug.cgi?id=176874
2682         <rdar://problem/34436415>
2683
2684         Reviewed by Saam Barati.
2685
2686         Added a convenience version of roundUpToMultipleOf() so that it can be applied to
2687         pointers without the client having to cast explicitly.
2688
2689         * wtf/StdLibExtras.h:
2690         (WTF::roundUpToMultipleOf):
2691
2692 2017-09-14  Youenn Fablet  <youenn@apple.com>
2693
2694         Allow WTF::map to take function as parameter
2695         https://bugs.webkit.org/show_bug.cgi?id=176909
2696
2697         Reviewed by Jer Noble.
2698
2699         * wtf/Vector.h:
2700         (WTF::map):
2701
2702 2017-09-13  Youenn Fablet  <youenn@apple.com>
2703
2704         Add a lambda-based map for Vectors
2705         https://bugs.webkit.org/show_bug.cgi?id=176487
2706
2707         Reviewed by Darin Adler.
2708
2709         This helper routine allows refactoring the reserveInitialCapacity/uncheckedAppend pattern, the mapper between source and destination item being a lambda.
2710
2711         * wtf/Vector.h:
2712         (WTF::Mapper::transform):
2713         (WTF::Mapper::map):
2714         (WTF::map):
2715
2716 2017-09-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2717
2718         [DFG] Optimize WeakMap::get by adding intrinsic and fixup
2719         https://bugs.webkit.org/show_bug.cgi?id=176010
2720
2721         Reviewed by Filip Pizlo.
2722
2723         Add inlineGet method with HashTranslator.
2724
2725         * wtf/HashMap.h:
2726         (WTF::X>::inlineGet const):
2727         (WTF::MappedTraits>::inlineGet const):
2728         (WTF::MappedTraits>::fastGet const): Deleted.
2729         * wtf/LoggingHashMap.h:
2730
2731 2017-09-12  Keith Miller  <keith_miller@apple.com>
2732
2733         Do unified source builds for JSC
2734         https://bugs.webkit.org/show_bug.cgi?id=176076
2735
2736         Reviewed by Geoffrey Garen.
2737
2738         This patch adds a script that will automatically bundle source
2739         files, which is currently only used by the CMake build. It's
2740         important that we use the same script to generate the bundles
2741         for the CMake build as the Xcode build. If we didn't do this then
2742         it's likely that there would be build errors that occur in only
2743         one build system. On the same note, we also need to be careful to
2744         not bundle platform specific source files with platform
2745         independent ones. There are a couple of things the script does not
2746         currently handle but are not essential for the CMake build. First,
2747         it does not handle the max bundle size restrictions that the Xcode
2748         build will require. It also does not handle C files.
2749
2750         The unified source generator script works by collecting groups of
2751         up to 8 files from the same directory. We don't bundle files from
2752         across directories since I didn't see a speedup from doing
2753         so. Additionally, splitting at the directory boundary means that
2754         it is less likely that adding a new file will force a "clean"
2755         build. This would happen because the new file will shift every
2756         subsequent file into the next unified source bundle.
2757
2758         Using unified sources appears to be a roughly 3.5x build time
2759         speed up for clean builds on my MBP and appears to have a
2760         negligible effect in incremental builds.
2761
2762         * generate-unified-source-bundles.rb: Added.
2763         * wtf/Assertions.h:
2764
2765 2017-09-12  Joseph Pecoraro  <pecoraro@apple.com>
2766
2767         QualifiedName::init should assume AtomicStrings::init was already called
2768         https://bugs.webkit.org/show_bug.cgi?id=176639
2769
2770         Reviewed by Sam Weinig.
2771
2772         * wtf/NeverDestroyed.h:
2773         (WTF::LazyNeverDestroyed::isConstructed const):
2774
2775 2017-09-12  Brent Fulgham  <bfulgham@apple.com>
2776
2777         Show punycode to user if a URL mixes Armenian Seh or Vo with other scripts
2778         https://bugs.webkit.org/show_bug.cgi?id=176578
2779         <rdar://problem/33906231>
2780
2781         Reviewed by Alex Christensen.
2782
2783         * wtf/ASCIICType.h:
2784         (WTF::isASCIIDigitOrPunctuation): Added helper function to recognize ASCII digits
2785         and punctuation characters.
2786
2787 2017-09-12  Sam Weinig  <sam@webkit.org>
2788
2789         [Cleanup] Follow up cleanup for DOMFormData implementation
2790         https://bugs.webkit.org/show_bug.cgi?id=176740
2791
2792         Reviewed by Alex Christensen.
2793
2794         * WTF.xcodeproj/project.pbxproj:
2795         * wtf/HashTraits.h:
2796         (WTF::KeyValuePair::KeyValuePair): Deleted.
2797         * wtf/KeyValuePair.h: Added.
2798         (WTF::KeyValuePair::KeyValuePair):
2799         (WTF::makeKeyValuePair):
2800
2801             Move KeyValuePair to its own header and add a makeKeyValuePair helper.
2802
2803 2017-09-11  Ryan Haddad  <ryanhaddad@apple.com>
2804
2805         Unreviewed, rolling out r221854.
2806
2807         The test added with this change fails on 32-bit JSC bots.
2808
2809         Reverted changeset:
2810
2811         "[DFG] Optimize WeakMap::get by adding intrinsic and fixup"
2812         https://bugs.webkit.org/show_bug.cgi?id=176010
2813         http://trac.webkit.org/changeset/221854
2814
2815 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
2816
2817         [DFG] Optimize WeakMap::get by adding intrinsic and fixup
2818         https://bugs.webkit.org/show_bug.cgi?id=176010
2819
2820         Reviewed by Filip Pizlo.
2821
2822         Add inlineGet method with HashTranslator.
2823
2824         * wtf/HashMap.h:
2825         (WTF::X>::inlineGet const):
2826         (WTF::MappedTraits>::inlineGet const):
2827         (WTF::MappedTraits>::fastGet const): Deleted.
2828         * wtf/LoggingHashMap.h:
2829
2830 2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
2831
2832         [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
2833         https://bugs.webkit.org/show_bug.cgi?id=176561
2834
2835         Reviewed by Brent Fulgham.
2836
2837         WebCore/platform/Language was the only* user of PlatformUserPreferredLanguages (with 1 exception).
2838         That exception is that JavaScriptCore needed the functionality of WebCore/platform/Language, but it
2839         couldn't get it because of the layering violation, so instead it erroneously called into
2840         PlatformUserPreferredLanguages instead. This patch merges these two files into WTF so JSC gets the
2841         right function and the PAL effort has one less file to move from WebCore/platform into PAL.
2842
2843         * WTF.xcodeproj/project.pbxproj:
2844         * wtf/CMakeLists.txt:
2845         * wtf/Language.cpp: Renamed from Source/WebCore/platform/Language.cpp.
2846         (WTF::addLanguageChangeObserver):
2847         (WTF::userPreferredLanguages):
2848         * wtf/Language.h: Renamed from Source/WebCore/platform/Language.h.
2849         * wtf/PlatformGTK.cmake:
2850         * wtf/PlatformJSCOnly.cmake:
2851         * wtf/PlatformMac.cmake:
2852         * wtf/PlatformUserPreferredLanguages.h: Removed.
2853         * wtf/PlatformWPE.cmake:
2854         * wtf/PlatformWin.cmake:
2855         * wtf/cf/LanguageCF.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm.
2856         (WTF::httpStyleLanguageCode):
2857         (WTF::languagePreferencesDidChange):
2858         (WTF::platformUserPreferredLanguages):
2859         * wtf/unix/LanguageUnix.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesUnix.cpp.
2860         * wtf/win/LanguageWin.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesWin.cpp.
2861
2862 2017-09-06  Eric Carlson  <eric.carlson@apple.com>
2863
2864         Require LoggingHelper overrides to provide identifier
2865         https://bugs.webkit.org/show_bug.cgi?id=176477
2866
2867         Reviewed by Jer Noble.
2868
2869         * wtf/Assertions.cpp: No more WTFLogLevelNotice.
2870         * wtf/Assertions.h: Ditto.
2871
2872 2017-09-06  Per Arne Vollan  <pvollan@apple.com>
2873
2874         [Win] WebCore failed to build, InbandTextTrackPrivateAVF: base class undefined.
2875         https://bugs.webkit.org/show_bug.cgi?id=176431
2876
2877         Reviewed by Alex Christensen.
2878
2879         AVFoundation header detection should be done in WebCore because of build dependencies. 
2880
2881         * AVFoundationSupport.py: Removed.
2882         * wtf/Platform.h:
2883         * wtf/PlatformWin.cmake:
2884
2885 2017-09-05  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2886
2887         [Win] Fix the wincairo build after r221558 and r221583
2888         https://bugs.webkit.org/show_bug.cgi?id=176353
2889
2890         Reviewed by Yusuke Suzuki.
2891
2892         * wtf/Assertions.cpp:
2893
2894 2017-09-04  Eric Carlson  <eric.carlson@apple.com>
2895
2896         Switch HTMLMediaElement to release logging
2897         https://bugs.webkit.org/show_bug.cgi?id=176065
2898
2899         Reviewed by Jer Noble.
2900
2901         * wtf/MediaTime.cpp:
2902         (WTF::MediaTime::dump const): Use toString.
2903         (WTF::MediaTime::toString const): New.
2904
2905 2017-09-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2906
2907         Remove OS(SOLARIS) support
2908         https://bugs.webkit.org/show_bug.cgi?id=176341
2909
2910         Reviewed by Sam Weinig.
2911
2912         WebKit project does not have stake holders supporting Solaris right now.
2913         And Solaris + SPARC in 64bit environment does not work well since its
2914         address space includes non-48bit area. It breaks our JSVALUE64 in JSC.
2915         In addition, Solaris a bit complicates our threading implementation
2916         because of its special threading stack.
2917
2918         This patch removes OS(SOLARIS) and COMPILER(SUNCC) support from WebKit.
2919
2920         * wtf/Compiler.h:
2921         * wtf/InlineASM.h:
2922         * wtf/MathExtras.h:
2923         (std::isfinite): Deleted.
2924         (std::signbit): Deleted.
2925         (std::isinf): Deleted.
2926         * wtf/NumberOfCores.cpp:
2927         (WTF::numberOfProcessorCores):
2928         * wtf/Platform.h:
2929         * wtf/StackBounds.cpp:
2930         * wtf/ThreadingPthreads.cpp:
2931
2932 2017-09-04  Commit Queue  <commit-queue@webkit.org>
2933
2934         Unreviewed, rolling out r221494 and r221500.
2935         https://bugs.webkit.org/show_bug.cgi?id=176258
2936
2937         This caused the windows build to fail. (Requested by mlewis13
2938         on #webkit).
2939
2940         Reverted changesets:
2941
2942         "Switch HTMLMediaElement to release logging"
2943         https://bugs.webkit.org/show_bug.cgi?id=176065
2944         http://trac.webkit.org/changeset/221494
2945
2946         "Switch HTMLMediaElement to release logging"
2947         https://bugs.webkit.org/show_bug.cgi?id=176065
2948         http://trac.webkit.org/changeset/221500
2949
2950 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
2951
2952         Remove "malloc" and "free" use
2953         https://bugs.webkit.org/show_bug.cgi?id=176310
2954
2955         Reviewed by Darin Adler.
2956
2957         Use Vector instead.
2958
2959         * wtf/Assertions.cpp:
2960
2961 2017-09-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2962
2963         Unreviewed, support libstdc++ use with clang
2964         https://bugs.webkit.org/show_bug.cgi?id=176301
2965
2966         * wtf/FastMalloc.h:
2967
2968 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
2969
2970         [WTF] Add C++03 allocator interface for GCC < 6
2971         https://bugs.webkit.org/show_bug.cgi?id=176301
2972
2973         Reviewed by Darin Adler.
2974
2975         Unfortunately, std::list in GCC < 6 does not support C++11 allocator interface.
2976         This patch adds C++03 allocator interface to FastAllocator to make it usable
2977         for std::list. It also allows us to use FastAllocator for data structures that
2978         only support C++03 interface.
2979
2980         * wtf/FastMalloc.h:
2981         (WTF::FastAllocator::allocate):
2982         (WTF::FastAllocator::construct):
2983         (WTF::FastAllocator::destroy):
2984         (WTF::FastAllocator::max_size const):
2985         (WTF::FastAllocator::select_on_container_copy_construction const):
2986
2987 2017-09-03  Chris Dumez  <cdumez@apple.com>
2988
2989         Unreviewed, rolling out r221552.
2990
2991         Broke the build
2992
2993         Reverted changeset:
2994
2995         "[WTF] Add C++03 allocator interface for GCC < 6"
2996         https://bugs.webkit.org/show_bug.cgi?id=176301
2997         http://trac.webkit.org/changeset/221552
2998
2999 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
3000
3001         [WTF] Add C++03 allocator interface for GCC < 6
3002         https://bugs.webkit.org/show_bug.cgi?id=176301
3003
3004         Reviewed by Darin Adler.
3005
3006         Unfortunately, std::list in GCC < 6 does not support C++11 allocator interface.
3007         This patch adds C++03 allocator interface to FastAllocator to make it usable
3008         for std::list. It also allows us to use FastAllocator for data structures that
3009         only support C++03 interface.
3010
3011         * wtf/FastMalloc.h:
3012         (WTF::FastAllocator::allocate):
3013         (WTF::FastAllocator::construct):
3014         (WTF::FastAllocator::destroy):
3015         (WTF::FastAllocator::max_size const):
3016         (WTF::FastAllocator::select_on_container_copy_construction const):
3017
3018 2017-09-03  Sam Weinig  <sam@webkit.org>
3019
3020         Remove CanvasProxy
3021         https://bugs.webkit.org/show_bug.cgi?id=176288
3022
3023         Reviewed by Yusuke Suzuki.
3024
3025         CanvasProxy does not appear to be in any current HTML spec
3026         and was disabled and unimplemented in our tree. Time to 
3027         get rid of it.
3028
3029         * wtf/FeatureDefines.h:
3030
3031 2017-09-01  Eric Carlson  <eric.carlson@apple.com>
3032
3033         Switch HTMLMediaElement to release logging
3034         https://bugs.webkit.org/show_bug.cgi?id=176065
3035
3036         Reviewed by Jer Noble.
3037
3038         * wtf/MediaTime.cpp:
3039         (WTF::MediaTime::dump const): Use toString.
3040         (WTF::MediaTime::toString const): New.
3041         * wtf/MediaTime.h:
3042         (PAL::LogArgument<WTF::MediaTime>::toString): Logger template.
3043
3044 2017-08-31  Don Olmstead  <don.olmstead@sony.com>
3045
3046         [CMake] Make USE_CF conditional within Windows
3047         https://bugs.webkit.org/show_bug.cgi?id=176173
3048
3049         Reviewed by Alex Christensen.
3050
3051         * wtf/Platform.h:
3052         * wtf/PlatformWin.cmake:
3053
3054 2017-08-31  Ryan Haddad  <ryanhaddad@apple.com>
3055
3056         Unreviewed, rolling out r221445.
3057
3058         This change broke Sierra Release builds.
3059
3060         Reverted changeset:
3061
3062         "Switch HTMLMediaElement to release logging"
3063         https://bugs.webkit.org/show_bug.cgi?id=176065
3064         http://trac.webkit.org/changeset/221445
3065
3066 2017-08-31  Eric Carlson  <eric.carlson@apple.com>
3067
3068         Switch HTMLMediaElement to release logging
3069         https://bugs.webkit.org/show_bug.cgi?id=176065
3070
3071         Reviewed by Jer Noble.
3072
3073         * wtf/MediaTime.cpp:
3074         (WTF::MediaTime::dump const): Use toString.
3075         (WTF::MediaTime::toString const): New.
3076         * wtf/MediaTime.h:
3077         (PAL::LogArgument<WTF::MediaTime>::toString): Logger template.
3078
3079 2017-08-31  Filip Pizlo  <fpizlo@apple.com>
3080
3081         All of the different ArrayBuffer::data's should be CagedPtr<>
3082         https://bugs.webkit.org/show_bug.cgi?id=175515
3083
3084         Reviewed by Michael Saboff.
3085         
3086         Added a specialization so that CagedPtr<void> is valid.
3087
3088         * wtf/CagedPtr.h:
3089
3090 2017-08-31  Per Arne Vollan  <pvollan@apple.com>
3091
3092         [Win] Crash under WorkQueue::performWorkOnRegisteredWorkThread in layout tests.
3093         https://bugs.webkit.org/show_bug.cgi?id=176163
3094
3095         Reviewed by Alex Christensen.
3096
3097         My previous attempt at fixing this crash in <http://trac.webkit.org/changeset/221323>
3098         was incorrect, since it is still crashing on the bot(s). The current theory of why this
3099         is failing is that the WorkQueue object deletes itself in the middle of the
3100         performWorkOnRegisteredWorkThread method when calling deref(). There is no need to
3101         increase the reference count of the work queue for each function we want to call on the
3102         work thread. It is sufficient to increase it for every work thread we start, and then
3103         dereference it when the thread ends. We should also not attempt to access members after
3104         the deref() call, which can potentially be unsafe.
3105  
3106         * wtf/win/WorkQueueWin.cpp:
3107         (WTF::WorkQueue::workThreadCallback):
3108         (WTF::WorkQueue::performWorkOnRegisteredWorkThread):
3109         (WTF::WorkQueue::dispatch):
3110
3111 2017-08-22  Filip Pizlo  <fpizlo@apple.com>
3112
3113         Strings need to be in some kind of gigacage
3114         https://bugs.webkit.org/show_bug.cgi?id=174924
3115
3116         Reviewed by Oliver Hunt.
3117         
3118         This makes all strings allocations come from the string gigacage. Because we expect string allocation
3119         to be a hot path, I created specialized allocation paths for the string gigacage. These paths are
3120         accessible via <wtf/text/StringMalloc.h>. However, those paths are equivalent to saying
3121         Gigacage::malloc and friends with the Gigacage::String kind.
3122
3123         * WTF.xcodeproj/project.pbxproj:
3124         * wtf/CMakeLists.txt:
3125         * wtf/Deque.h:
3126         * wtf/FastMalloc.cpp:
3127         (WTF::fastFree):
3128         * wtf/FastMalloc.h:
3129         (WTF::FastMalloc::malloc):
3130         (WTF::FastMalloc::tryMalloc):
3131         (WTF::FastMalloc::realloc):
3132         (WTF::FastMalloc::free):
3133         * wtf/Forward.h:
3134         * wtf/Gigacage.cpp:
3135         (Gigacage::tryMalloc):
3136         * wtf/Gigacage.h:
3137         (Gigacage::name):
3138         * wtf/Vector.h:
3139         (WTF::VectorBufferBase::allocateBuffer):
3140         (WTF::VectorBufferBase::tryAllocateBuffer):
3141         (WTF::VectorBufferBase::reallocateBuffer):
3142         (WTF::VectorBufferBase::deallocateBuffer):
3143         (WTF::Malloc>::Vector):
3144         (WTF::=):
3145         (WTF::Malloc>::contains const):
3146         (WTF::Malloc>::findMatching const):
3147         (WTF::Malloc>::find const):
3148         (WTF::Malloc>::reverseFind const):
3149         (WTF::Malloc>::appendIfNotContains):
3150         (WTF::Malloc>::fill):
3151         (WTF::Malloc>::appendRange):
3152         (WTF::Malloc>::expandCapacity):
3153         (WTF::Malloc>::tryExpandCapacity):
3154         (WTF::Malloc>::resize):
3155         (WTF::Malloc>::resizeToFit):
3156         (WTF::Malloc>::shrink):
3157         (WTF::Malloc>::grow):
3158         (WTF::Malloc>::asanSetInitialBufferSizeTo):
3159         (WTF::Malloc>::asanSetBufferSizeToFullCapacity):
3160         (WTF::Malloc>::asanBufferSizeWillChangeTo):
3161         (WTF::Malloc>::reserveCapacity):
3162         (WTF::Malloc>::tryReserveCapacity):
3163         (WTF::Malloc>::reserveInitialCapacity):
3164         (WTF::Malloc>::shrinkCapacity):
3165         (WTF::Malloc>::append):
3166         (WTF::Malloc>::tryAppend):
3167         (WTF::Malloc>::constructAndAppend):
3168         (WTF::Malloc>::tryConstructAndAppend):
3169         (WTF::Malloc>::appendSlowCase):
3170         (WTF::Malloc>::constructAndAppendSlowCase):
3171         (WTF::Malloc>::tryConstructAndAppendSlowCase):
3172         (WTF::Malloc>::uncheckedAppend):
3173         (WTF::Malloc>::appendVector):
3174         (WTF::Malloc>::insert):
3175         (WTF::Malloc>::insertVector):
3176         (WTF::Malloc>::remove):
3177         (WTF::Malloc>::removeFirst):
3178         (WTF::Malloc>::removeFirstMatching):
3179         (WTF::Malloc>::removeAll):
3180         (WTF::Malloc>::removeAllMatching):
3181         (WTF::Malloc>::reverse):
3182         (WTF::Malloc>::map const):
3183         (WTF::Malloc>::releaseBuffer):
3184         (WTF::Malloc>::checkConsistency):
3185         (WTF::swap):
3186         (WTF::operator==):
3187         (WTF::operator!=):
3188         (WTF::removeRepeatedElements):
3189         (WTF::minCapacity>::Vector): Deleted.
3190         (WTF::minCapacity>::contains const): Deleted.
3191         (WTF::minCapacity>::findMatching const): Deleted.
3192         (WTF::minCapacity>::find const): Deleted.
3193         (WTF::minCapacity>::reverseFind const): Deleted.
3194         (WTF::minCapacity>::appendIfNotContains): Deleted.
3195         (WTF::minCapacity>::fill): Deleted.
3196         (WTF::minCapacity>::appendRange): Deleted.
3197         (WTF::minCapacity>::expandCapacity): Deleted.
3198         (WTF::minCapacity>::tryExpandCapacity): Deleted.
3199         (WTF::minCapacity>::resize): Deleted.
3200         (WTF::minCapacity>::resizeToFit): Deleted.
3201         (WTF::minCapacity>::shrink): Deleted.
3202         (WTF::minCapacity>::grow): Deleted.
3203         (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted.
3204         (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted.
3205         (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted.
3206         (WTF::minCapacity>::reserveCapacity): Deleted.
3207         (WTF::minCapacity>::tryReserveCapacity): Deleted.
3208         (WTF::minCapacity>::reserveInitialCapacity): Deleted.
3209         (WTF::minCapacity>::shrinkCapacity): Deleted.
3210         (WTF::minCapacity>::append): Deleted.
3211         (WTF::minCapacity>::tryAppend): Deleted.
3212         (WTF::minCapacity>::constructAndAppend): Deleted.
3213         (WTF::minCapacity>::tryConstructAndAppend): Deleted.
3214         (WTF::minCapacity>::appendSlowCase): Deleted.
3215         (WTF::minCapacity>::constructAndAppendSlowCase): Deleted.
3216         (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted.
3217         (WTF::minCapacity>::uncheckedAppend): Deleted.
3218         (WTF::minCapacity>::appendVector): Deleted.
3219         (WTF::minCapacity>::insert): Deleted.
3220         (WTF::minCapacity>::insertVector): Deleted.
3221         (WTF::minCapacity>::remove): Deleted.
3222         (WTF::minCapacity>::removeFirst): Deleted.
3223         (WTF::minCapacity>::removeFirstMatching): Deleted.
3224         (WTF::minCapacity>::removeAll): Deleted.
3225         (WTF::minCapacity>::removeAllMatching): Deleted.
3226         (WTF::minCapacity>::reverse): Deleted.
3227         (WTF::minCapacity>::map const): Deleted.
3228         (WTF::minCapacity>::releaseBuffer): Deleted.
3229         (WTF::minCapacity>::checkConsistency): Deleted.
3230         * wtf/text/AtomicStringImpl.h:
3231         * wtf/text/CString.cpp:
3232         (WTF::CStringBuffer::createUninitialized):
3233         * wtf/text/CString.h:
3234         * wtf/text/StringBuffer.h:
3235         (WTF::StringBuffer::StringBuffer):
3236         (WTF::StringBuffer::~StringBuffer):
3237         (WTF::StringBuffer::resize):
3238         * wtf/text/StringImpl.cpp:
3239         (WTF::StringImpl::~StringImpl):
3240         (WTF::StringImpl::destroy):
3241         (WTF::StringImpl::createUninitializedInternalNonEmpty):
3242         (WTF::StringImpl::reallocateInternal):
3243         (WTF::StringImpl::releaseAssertCaged const):
3244         * wtf/text/StringImpl.h:
3245         (WTF::StringImpl::createSubstringSharingImpl):
3246         (WTF::StringImpl::tryCreateUninitialized):
3247         (WTF::StringImpl::adopt):
3248         (WTF::StringImpl::bufferOwnership const):
3249         (WTF::StringImpl::assertCaged const):
3250         * wtf/text/StringMalloc.cpp: Added.
3251         (WTF::tryStringMalloc):
3252         (WTF::stringMalloc):
3253         (WTF::stringRealloc):
3254         (WTF::stringFree):
3255         * wtf/text/StringMalloc.h: Added.
3256         (WTF::StringMalloc::malloc):
3257         (WTF::StringMalloc::tryMalloc):
3258         (WTF::StringMalloc::realloc):
3259         (WTF::StringMalloc::free):
3260         * wtf/text/StringVector.h: Added.
3261         * wtf/text/SymbolImpl.h:
3262         * wtf/text/UniquedStringImpl.h:
3263         * wtf/text/WTFString.h:
3264         (WTF::String::adopt):
3265         (WTF::String::assertCaged const):
3266         (WTF::String::releaseAssertCaged const):
3267
3268 2017-08-30  Chris Dumez  <cdumez@apple.com>
3269
3270         Implement FileSystemDirectoryReader.readEntries()
3271         https://bugs.webkit.org/show_bug.cgi?id=176091
3272         <rdar://problem/34168015>
3273
3274         Reviewed by Andreas Kling.
3275
3276         * wtf/CrossThreadCopier.h:
3277         (WTF::crossThreadCopy):
3278         * wtf/CrossThreadTask.h:
3279         Move crossThreadCopy() from CrossThreadTask.h to CrossThreadCopier.h and
3280         add "using WTF::crossThreadCopy" statement to make it more easily usable
3281         from WebCore.
3282
3283 2017-08-30  Matt Lewis  <jlewis3@apple.com>
3284
3285         Unreviewed, rolling out r221384.
3286
3287         This patch caused multiple 32-bit JSC test failures.
3288
3289         Reverted changeset:
3290
3291         "Strings need to be in some kind of gigacage"
3292         https://bugs.webkit.org/show_bug.cgi?id=174924
3293         http://trac.webkit.org/changeset/221384
3294
3295 2017-08-30  Brady Eidson  <beidson@apple.com>
3296
3297         Add "Identified" base class to replace a whole bunch of custom identifier generators.
3298         https://bugs.webkit.org/show_bug.cgi?id=176120
3299
3300         Reviewed by Alex Christensen.
3301
3302         * WTF.xcodeproj/project.pbxproj:
3303         * wtf/Identified.h: Added.
3304         (WTF::IdentifiedBase::identifier const):
3305         (WTF::IdentifiedBase::IdentifiedBase):
3306         (WTF::Identified::Identified):
3307         (WTF::ThreadSafeIdentified::ThreadSafeIdentified):
3308
3309 2017-08-22  Filip Pizlo  <fpizlo@apple.com>
3310
3311         Strings need to be in some kind of gigacage
3312         https://bugs.webkit.org/show_bug.cgi?id=174924
3313
3314         Reviewed by Oliver Hunt.
3315         
3316         This makes all strings allocations come from the string gigacage. Because we expect string allocation
3317         to be a hot path, I created specialized allocation paths for the string gigacage. These paths are
3318         accessible via <wtf/text/StringMalloc.h>. However, those paths are equivalent to saying
3319         Gigacage::malloc and friends with the Gigacage::String kind.
3320
3321         * WTF.xcodeproj/project.pbxproj:
3322         * wtf/CMakeLists.txt:
3323         * wtf/Deque.h:
3324         * wtf/FastMalloc.cpp:
3325         (WTF::fastFree):
3326         * wtf/FastMalloc.h:
3327         (WTF::FastMalloc::malloc):
3328         (WTF::FastMalloc::tryMalloc):
3329         (WTF::FastMalloc::realloc):
3330         (WTF::FastMalloc::free):
3331         * wtf/Forward.h:
3332         * wtf/Gigacage.cpp:
3333         (Gigacage::tryMalloc):
3334         * wtf/Gigacage.h:
3335         (Gigacage::name):
3336         * wtf/Vector.h:
3337         (WTF::VectorBufferBase::allocateBuffer):
3338         (WTF::VectorBufferBase::tryAllocateBuffer):
3339         (WTF::VectorBufferBase::reallocateBuffer):
3340         (WTF::VectorBufferBase::deallocateBuffer):
3341         (WTF::Malloc>::Vector):
3342         (WTF::=):
3343         (WTF::Malloc>::contains const):
3344         (WTF::Malloc>::findMatching const):
3345         (WTF::Malloc>::find const):
3346         (WTF::Malloc>::reverseFind const):
3347         (WTF::Malloc>::appendIfNotContains):
3348         (WTF::Malloc>::fill):
3349         (WTF::Malloc>::appendRange):
3350         (WTF::Malloc>::expandCapacity):
3351         (WTF::Malloc>::tryExpandCapacity):
3352         (WTF::Malloc>::resize):
3353         (WTF::Malloc>::resizeToFit):
3354         (WTF::Malloc>::shrink):
3355         (WTF::Malloc>::grow):
3356         (WTF::Malloc>::asanSetInitialBufferSizeTo):
3357         (WTF::Malloc>::asanSetBufferSizeToFullCapacity):
3358         (WTF::Malloc>::asanBufferSizeWillChangeTo):
3359         (WTF::Malloc>::reserveCapacity):
3360         (WTF::Malloc>::tryReserveCapacity):
3361         (WTF::Malloc>::reserveInitialCapacity):
3362         (WTF::Malloc>::shrinkCapacity):
3363         (WTF::Malloc>::append):
3364         (WTF::Malloc>::tryAppend):
3365         (WTF::Malloc>::constructAndAppend):
3366         (WTF::Malloc>::tryConstructAndAppend):
3367         (WTF::Malloc>::appendSlowCase):
3368         (WTF::Malloc>::constructAndAppendSlowCase):
3369         (WTF::Malloc>::tryConstructAndAppendSlowCase):
3370         (WTF::Malloc>::uncheckedAppend):
3371         (WTF::Malloc>::appendVector):
3372         (WTF::Malloc>::insert):
3373         (WTF::Malloc>::insertVector):
3374         (WTF::Malloc>::remove):
3375         (WTF::Malloc>::removeFirst):
3376         (WTF::Malloc>::removeFirstMatching):
3377         (WTF::Malloc>::removeAll):
3378         (WTF::Malloc>::removeAllMatching):
3379         (WTF::Malloc>::reverse):
3380         (WTF::Malloc>::map const):
3381         (WTF::Malloc>::releaseBuffer):
3382         (WTF::Malloc>::checkConsistency):
3383         (WTF::swap):
3384         (WTF::operator==):
3385         (WTF::operator!=):
3386         (WTF::removeRepeatedElements):
3387         (WTF::minCapacity>::Vector): Deleted.
3388         (WTF::minCapacity>::contains const): Deleted.
3389         (WTF::minCapacity>::findMatching const): Deleted.
3390         (WTF::minCapacity>::find const): Deleted.
3391         (WTF::minCapacity>::reverseFind const): Deleted.
3392         (WTF::minCapacity>::appendIfNotContains): Deleted.
3393         (WTF::minCapacity>::fill): Deleted.
3394         (WTF::minCapacity>::appendRange): Deleted.
3395         (WTF::minCapacity>::expandCapacity): Deleted.
3396         (WTF::minCapacity>::tryExpandCapacity): Deleted.
3397         (WTF::minCapacity>::resize): Deleted.
3398         (WTF::minCapacity>::resizeToFit): Deleted.
3399         (WTF::minCapacity>::shrink): Deleted.
3400         (WTF::minCapacity>::grow): Deleted.
3401         (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted.
3402         (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted.
3403         (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted.
3404         (WTF::minCapacity>::reserveCapacity): Deleted.
3405         (WTF::minCapacity>::tryReserveCapacity): Deleted.
3406         (WTF::minCapacity>::reserveInitialCapacity): Deleted.
3407         (WTF::minCapacity>::shrinkCapacity): Deleted.
3408         (WTF::minCapacity>::append): Deleted.
3409         (WTF::minCapacity>::tryAppend): Deleted.
3410         (WTF::minCapacity>::constructAndAppend): Deleted.
3411         (WTF::minCapacity>::tryConstructAndAppend): Deleted.
3412         (WTF::minCapacity>::appendSlowCase): Deleted.
3413         (WTF::minCapacity>::constructAndAppendSlowCase): Deleted.
3414         (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted.
3415         (WTF::minCapacity>::uncheckedAppend): Deleted.
3416         (WTF::minCapacity>::appendVector): Deleted.
3417         (WTF::minCapacity>::insert): Deleted.
3418         (WTF::minCapacity>::insertVector): Deleted.
3419         (WTF::minCapacity>::remove): Deleted.
3420         (WTF::minCapacity>::removeFirst): Deleted.
3421         (WTF::minCapacity>::removeFirstMatching): Deleted.
3422         (WTF::minCapacity>::removeAll): Deleted.
3423         (WTF::minCapacity>::removeAllMatching): Deleted.
3424         (WTF::minCapacity>::reverse): Deleted.
3425         (WTF::minCapacity>::map const): Deleted.
3426         (WTF::minCapacity>::releaseBuffer): Deleted.
3427         (WTF::minCapacity>::checkConsistency): Deleted.
3428         * wtf/text/AtomicStringImpl.h:
3429         * wtf/text/CString.cpp:
3430         (WTF::CStringBuffer::createUninitialized):
3431         * wtf/text/CString.h:
3432         * wtf/text/StringBuffer.h:
3433         (WTF::StringBuffer::StringBuffer):
3434         (WTF::StringBuffer::~StringBuffer):
3435         (WTF::StringBuffer::resize):
3436         * wtf/text/StringImpl.cpp:
3437         (WTF::StringImpl::~StringImpl):
3438         (WTF::StringImpl::destroy):
3439         (WTF::StringImpl::createUninitializedInternalNonEmpty):
3440         (WTF::StringImpl::reallocateInternal):
3441         (WTF::StringImpl::releaseAssertCaged const):
3442         * wtf/text/StringImpl.h:
3443         (WTF::StringImpl::createSubstringSharingImpl):
3444         (WTF::StringImpl::tryCreateUninitialized):
3445         (WTF::StringImpl::adopt):
3446         (WTF::StringImpl::bufferOwnership const):
3447         (WTF::StringImpl::assertCaged const):
3448         * wtf/text/StringMalloc.cpp: Added.
3449         (WTF::tryStringMalloc):
3450         (WTF::stringMalloc):
3451         (WTF::stringRealloc):
3452         (WTF::stringFree):
3453         * wtf/text/StringMalloc.h: Added.
3454         (WTF::StringMalloc::malloc):
3455         (WTF::StringMalloc::tryMalloc):
3456         (WTF::StringMalloc::realloc):
3457         (WTF::StringMalloc::free):
3458         * wtf/text/StringVector.h: Added.
3459         * wtf/text/SymbolImpl.h:
3460         * wtf/text/UniquedStringImpl.h:
3461         * wtf/text/WTFString.h:
3462         (WTF::String::adopt):
3463         (WTF::String::assertCaged const):
3464         (WTF::String::releaseAssertCaged const):
3465
3466 2017-08-28  Yusuke Suzuki  <utatane.tea@gmail.com>
3467
3468         [JSC] Use table based approach for JSON.stringify's Quote
3469         https://bugs.webkit.org/show_bug.cgi?id=176044
3470
3471         Reviewed by Darin Adler.
3472
3473         We change escape operation of JSON Quote from branch-based to table-based.
3474         This patch partially adopts SpiderMonkey's change to StringBuilderJSON.cpp
3475         to optimize this escaping operation. We separate changes from StringBuilder.cpp
3476         to apply MPL to StringBuilderJSON.cpp file. Since WebKit already adopts MPL in
3477         some files (like, DateMath.h), it is acceptable.
3478
3479         Kraken json-stringify-tinderbox shows 7.2% improvement.
3480
3481                                            baseline                  patched
3482
3483         json-stringify-tinderbox        40.429+-0.771      ^      37.693+-0.862         ^ definitely 1.0726x faster
3484
3485         * WTF.xcodeproj/project.pbxproj:
3486         * wtf/CMakeLists.txt:
3487         * wtf/text/StringBuilder.cpp:
3488         (WTF::appendQuotedJSONStringInternalSlow): Deleted.
3489         (WTF::appendQuotedJSONStringInternal): Deleted.
3490         (WTF::StringBuilder::appendQuotedJSONString): Deleted.
3491         * wtf/text/StringBuilderJSON.cpp: Added.
3492         (WTF::appendQuotedJSONStringInternal):
3493         (WTF::StringBuilder::appendQuotedJSONString):
3494
3495 2017-08-29  Per Arne Vollan  <pvollan@apple.com>
3496
3497         [Win] Crash under WorkQueue::performWorkOnRegisteredWorkThread in layout tests.
3498         https://bugs.webkit.org/show_bug.cgi?id=176064
3499
3500         Reviewed by Saam Barati.
3501
3502         The crash log indicates that the function pointer is null in this case.
3503
3504         * wtf/win/WorkQueueWin.cpp:
3505         (WTF::WorkQueue::dispatch):
3506
3507 2017-08-28  Andy Estes  <aestes@apple.com>
3508
3509         [Cocoa] Upstream WKGetWebDefaultCFStringEncoding()
3510         https://bugs.webkit.org/show_bug.cgi?id=176039
3511
3512         Reviewed by Alex Christensen.
3513
3514         * wtf/spi/cf/CFStringSPI.h:
3515
3516 2017-08-26  Yusuke Suzuki  <utatane.tea@gmail.com>
3517
3518         Unreviewed, suppress warnings in GTK port
3519
3520         Add printf format attribute.
3521
3522         * wtf/text/WTFString.cpp:
3523
3524 2017-08-25  Eric Carlson  <eric.carlson@apple.com>
3525
3526         Add Logger::logAlways
3527         https://bugs.webkit.org/show_bug.cgi?id=175996
3528
3529         Reviewed by Jer Noble.
3530
3531         * wtf/Assertions.cpp:
3532         * wtf/Assertions.h:
3533
3534 2017-08-25  Daniel Bates  <dabates@apple.com>
3535
3536         Demarcate code added due to lack of NSDMI for aggregates
3537         https://bugs.webkit.org/show_bug.cgi?id=175990
3538
3539         Reviewed by Andy Estes.
3540
3541         * wtf/Compiler.h:
3542
3543 2017-08-25  Don Olmstead  <don.olmstead@sony.com>
3544
3545         Define *_GIGACAGE_MASK when Gigacage is not supported
3546         https://bugs.webkit.org/show_bug.cgi?id=175994
3547
3548         Reviewed by Mark Lam.
3549
3550         * wtf/Gigacage.h:
3551
3552 2017-08-25  Eric Carlson  <eric.carlson@apple.com>
3553
3554         Add String::format variant that takes va_args
3555         https://bugs.webkit.org/show_bug.cgi?id=175988
3556
3557         Reviewed by Jer Noble.
3558
3559         * wtf/text/WTFString.cpp:
3560         (WTF::createWithFormatAndArguments): Created with the guts of String::format.
3561         (WTF::String::formatWithArguments): New, call createWithFormatAndArguments.
3562         (WTF::String::format): Move logic to createWithFormatAndArguments, use it.
3563         * wtf/text/WTFString.h:
3564
3565 2017-08-25  Saam Barati  <sbarati@apple.com>
3566
3567         Support compiling catch in the DFG
3568         https://bugs.webkit.org/show_bug.cgi?id=174590
3569         <rdar://problem/34047845>
3570
3571         Reviewed by Filip Pizlo.
3572
3573         This patch generalizes the BackwardsGraph fake root into a more generalizable
3574         class called SingleRootGraph. SingleRootGraph exposes the general graph interface
3575         used in Dominators and NaturalLoops. SingleRootGraph takes as input a graph with
3576         the normal graph interface, but also allows the input graph to contain more than
3577         one root. SingleRootGraph then exposes a single root, which it creates, that has
3578         an outgoing edge to all the roots in the original graph.
3579
3580         * WTF.xcodeproj/project.pbxproj:
3581         * wtf/BackwardsGraph.h:
3582         (WTF::BackwardsGraph::dump const):
3583         (WTF::BackwardsGraph::rootName): Deleted.
3584         (WTF::BackwardsGraph::Node::Node): Deleted.
3585         (WTF::BackwardsGraph::Node::root): Deleted.
3586         (WTF::BackwardsGraph::Node::operator== const): Deleted.
3587         (WTF::BackwardsGraph::Node::operator!= const): Deleted.
3588         (WTF::BackwardsGraph::Node::operator bool const): Deleted.
3589         (WTF::BackwardsGraph::Node::isRoot const): Deleted.
3590         (WTF::BackwardsGraph::Node::node const): Deleted.
3591         (): Deleted.
3592         (WTF::BackwardsGraph::Set::Set): Deleted.
3593         (WTF::BackwardsGraph::Set::add): Deleted.
3594         (WTF::BackwardsGraph::Set::remove): Deleted.
3595         (WTF::BackwardsGraph::Set::contains): Deleted.
3596         (WTF::BackwardsGraph::Set::dump const): Deleted.
3597         (WTF::BackwardsGraph::Map::Map): Deleted.
3598         (WTF::BackwardsGraph::Map::clear): Deleted.
3599         (WTF::BackwardsGraph::Map::size const): Deleted.
3600         (WTF::BackwardsGraph::Map::operator[]): Deleted.
3601         (WTF::BackwardsGraph::Map::operator[] const): Deleted.
3602         * wtf/Dominators.h:
3603         (WTF::Dominators::Dominators):
3604         (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOf):
3605         (WTF::Dominators::forAllBlocksInPrunedIteratedDominanceFrontierOf):
3606         (WTF::Dominators::iteratedDominanceFrontierOf const):
3607         (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl const):
3608         * wtf/SingleRootGraph.h: Added.
3609         (WTF::SingleRootGraphNode::rootName):