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