1 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
3 Unreviewed, wrokaround for MACH_VM_MAX_ADDRESS in ARM32_64
4 https://bugs.webkit.org/show_bug.cgi?id=197730
6 Interestingly, MACH_VM_MAX_ADDRESS is larger than 32bit in ARM32_64, I think this is a bug.
7 But for now, we workaround for this case by using `CPU(ADDRESS64)`.
9 * wtf/WTFAssertions.cpp:
11 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
13 [WTF] Remove Threading workaround for support libraries in Windows
14 https://bugs.webkit.org/show_bug.cgi?id=197350
16 Reviewed by Darin Adler.
18 We kept old APIs for some support libraries at 2017. This patch removes them.
21 * wtf/win/ThreadingWin.cpp:
22 (WTF::createThread): Deleted.
23 (WTF::waitForThreadCompletion): Deleted.
25 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
27 [WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
28 https://bugs.webkit.org/show_bug.cgi?id=197146
30 Reviewed by Saam Barati.
32 Since GCThread and CompilationThread flags exist in WTF, we put these flags into WTF::Thread directly instead of holding them in ThreadSpecific<>.
33 And this patch removes dependency from Threading.h to ThreadSpecific.h. ThreadSpecific.h's OS threading primitives are moved to ThreadingPrimitives.h,
34 and Threading.h relies on it instead.
36 * wtf/CompilationThread.cpp:
37 (WTF::isCompilationThread):
38 (WTF::initializeCompilationThreads): Deleted.
39 (WTF::exchangeIsCompilationThread): Deleted.
40 * wtf/CompilationThread.h:
41 (WTF::CompilationScope::CompilationScope):
42 (WTF::CompilationScope::~CompilationScope):
43 (WTF::CompilationScope::leaveEarly):
45 (WTF::initializeMainThread):
46 (WTF::initializeMainThreadToProcessMainThread):
47 (WTF::isMainThreadOrGCThread):
48 (WTF::initializeGCThreads): Deleted.
49 (WTF::registerGCThread): Deleted.
50 (WTF::mayBeGCThread): Deleted.
52 * wtf/ThreadSpecific.h:
53 (WTF::canBeGCThread>::ThreadSpecific):
54 (WTF::canBeGCThread>::set):
55 (WTF::threadSpecificKeyCreate): Deleted.
56 (WTF::threadSpecificKeyDelete): Deleted.
57 (WTF::threadSpecificSet): Deleted.
58 (WTF::threadSpecificGet): Deleted.
60 (WTF::Thread::exchangeIsCompilationThread):
61 (WTF::Thread::registerGCThread):
62 (WTF::Thread::mayBeGCThread):
64 (WTF::Thread::isCompilationThread const):
65 (WTF::Thread::gcThreadType const):
66 (WTF::Thread::joinableState const):
67 (WTF::Thread::hasExited const):
68 (WTF::Thread::Thread):
69 (WTF::Thread::joinableState): Deleted.
70 (WTF::Thread::hasExited): Deleted.
71 * wtf/ThreadingPrimitives.h:
72 (WTF::threadSpecificKeyCreate):
73 (WTF::threadSpecificKeyDelete):
74 (WTF::threadSpecificSet):
75 (WTF::threadSpecificGet):
76 * wtf/win/ThreadSpecificWin.cpp:
79 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
81 Unreviewed, follow-up after r245214
82 https://bugs.webkit.org/show_bug.cgi?id=197730
84 Suggested by Sam. We should have static_assert with MACH_VM_MAX_ADDRESS.
86 * wtf/WTFAssertions.cpp:
88 2019-05-13 Youenn Fablet <youenn@apple.com>
90 Use kDNSServiceFlagsKnownUnique for DNSServiceRegisterRecord only on platforms supporting it
91 https://bugs.webkit.org/show_bug.cgi?id=197802
93 Reviewed by Eric Carlson.
97 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
99 [JSC] Compress miscelaneous JIT related data structures with Packed<>
100 https://bugs.webkit.org/show_bug.cgi?id=197830
102 Reviewed by Saam Barati.
107 2019-05-13 Michael Catanzaro <mcatanzaro@igalia.com>
109 Unreviewed, fix unused variable warnings in release builds
111 * wtf/URLHelpers.cpp:
112 (WTF::URLHelpers::escapeUnsafeCharacters):
114 2019-05-12 Yusuke Suzuki <ysuzuki@apple.com>
116 [JSC] Compress Watchpoint size by using enum type and Packed<> data structure
117 https://bugs.webkit.org/show_bug.cgi?id=197730
119 Reviewed by Filip Pizlo.
121 This patch introduces a new data structures, WTF::Packed, WTF::PackedPtr, and WTF::PackedAlignedPtr.
125 WTF::Packed is data storage. We can read and write trivial (in C++ term [1]) data to this storage. The difference to
126 the usual storage is that the alignment of this storage is always 1. We access the underlying data by using unalignedLoad/unalignedStore.
127 This class offers alignment = 1 data structure instead of missing the following characteristics.
129 1. Load / Store are non atomic even if the data size is within a pointer width. We should not use this for a member which can be accessed
130 in a racy way. (e.g. fields accessed optimistically from the concurrent compilers).
132 2. We cannot take reference / pointer to the underlying storage since they are unaligned.
134 3. Access to this storage is unaligned access. The code is using memcpy, and the compiler will convert to an appropriate unaligned access
135 in certain architectures (x86_64 / ARM64). It could be slow. So use it for non performance sensitive & memory sensitive places.
139 WTF::PackedPtr is a specialization of WTF::Packed<T*>. And it is basically WTF::PackedAlignedPtr with alignment = 1. We further compact
140 the pointer by leveraging the platform specific knowledge. In 64bit architectures, the effective width of pointers are less than 64 bit.
141 In x86_64, it is 48 bits. And Darwin ARM64 is further smaller, 36 bits. This information allows us to compact the pointer to 6 bytes in
142 x86_64 and 5 bytes in Darwin ARM64.
144 - WTF::PackedAlignedPtr
146 WTF::PackedAlignedPtr is the WTF::PackedPtr with alignment information of the T. If we use this alignment information, we could reduce the
147 size of packed pointer further in some cases. For example, since we guarantee that JSCells are 16 byte aligned, low 4 bits are empty. Leveraging
148 this information in Darwin ARM64 platform allows us to make packed JSCell pointer 4 bytes (36 - 4 bits). We do not use passed alignment
149 information if it is not profitable.
151 We also have PackedPtrTraits. This is new PtrTraits and use it for various data structures such as Bag<>.
153 [1]: https://en.cppreference.com/w/cpp/types/is_trivial
155 * WTF.xcodeproj/project.pbxproj:
158 (WTF::Bag::iterator::operator++):
159 * wtf/CMakeLists.txt:
160 * wtf/DumbPtrTraits.h:
161 * wtf/DumbValueTraits.h:
167 (WTF::getLSBSetConstexpr):
168 (WTF::getMSBSetConstexpr):
169 * wtf/Packed.h: Added.
170 (WTF::Packed::Packed):
171 (WTF::Packed::get const):
173 (WTF::Packed::operator=):
174 (WTF::Packed::exchange):
177 (WTF::PackedPtrTraits::exchange):
178 (WTF::PackedPtrTraits::swap):
179 (WTF::PackedPtrTraits::unwrap):
181 * wtf/SentinelLinkedList.h:
182 (WTF::BasicRawSentinelNode::BasicRawSentinelNode):
183 (WTF::BasicRawSentinelNode::prev):
184 (WTF::BasicRawSentinelNode::next):
185 (WTF::PtrTraits>::remove):
186 (WTF::PtrTraits>::prepend):
187 (WTF::PtrTraits>::append):
188 (WTF::RawNode>::SentinelLinkedList):
189 (WTF::RawNode>::remove):
190 (WTF::BasicRawSentinelNode<T>::remove): Deleted.
191 (WTF::BasicRawSentinelNode<T>::prepend): Deleted.
192 (WTF::BasicRawSentinelNode<T>::append): Deleted.
193 * wtf/StdLibExtras.h:
194 (WTF::roundUpToMultipleOfImpl):
195 (WTF::roundUpToMultipleOfImpl0): Deleted.
196 * wtf/UnalignedAccess.h:
197 (WTF::unalignedLoad):
198 (WTF::unalignedStore):
200 2019-05-10 Saam barati <sbarati@apple.com>
202 Bag's move operator= leaks memory
203 https://bugs.webkit.org/show_bug.cgi?id=197757
205 Reviewed by Keith Miller.
207 It was unused. So I'm just removing it. We can implement it properly
211 (WTF::Bag::operator=): Deleted.
213 2019-05-10 Fujii Hironori <Hironori.Fujii@sony.com>
215 [WinCairo] storage/indexeddb tests are timing out
216 https://bugs.webkit.org/show_bug.cgi?id=196289
218 Reviewed by Alex Christensen.
220 * wtf/FileSystem.h: Added hardLink.
221 * wtf/glib/FileSystemGlib.cpp:
222 (WTF::FileSystemImpl::hardLink):
223 (WTF::FileSystemImpl::hardLinkOrCopyFile):
224 * wtf/posix/FileSystemPOSIX.cpp:
225 (WTF::FileSystemImpl::hardLink):
226 (WTF::FileSystemImpl::hardLinkOrCopyFile):
227 * wtf/win/FileSystemWin.cpp:
228 (WTF::FileSystemImpl::hardLink):
229 (WTF::FileSystemImpl::hardLinkOrCopyFile):
230 Added hardLink. Let hardLinkOrCopyFile use the hardLink.
232 2019-05-10 Yusuke Suzuki <ysuzuki@apple.com>
234 [WTF] Remove "private:" from Noncopyable and Nonmovable macros
235 https://bugs.webkit.org/show_bug.cgi?id=197767
237 Reviewed by Saam Barati.
239 We no longer need "private:".
244 2019-05-08 Zan Dobersek <zdobersek@igalia.com>
246 [GLib] Rework WPE RunLoopSourcePriority values
247 https://bugs.webkit.org/show_bug.cgi?id=197167
249 Reviewed by Carlos Garcia Campos.
251 The GLib priorities for the WPE port were initially aligned on the -70
252 value, theory being that this would help avoid any default-priority
253 GSources spawned in different dependency libraries affecting our
254 scheduling. Today it seems that extra caution might not be really
257 This change aligns the base priority value with GLib's default priority
258 value of 0. We maintain the relativity of priority values by effectively
259 increasing each priority by 70.
261 * wtf/glib/RunLoopSourcePriority.h:
263 2019-05-08 Alex Christensen <achristensen@webkit.org>
265 Add SPI to set HSTS storage directory
266 https://bugs.webkit.org/show_bug.cgi?id=197259
268 Reviewed by Brady Eidson.
272 2019-05-08 Keith Miller <keith_miller@apple.com>
274 Remove Gigacage from arm64 and use PAC for arm64e instead
275 https://bugs.webkit.org/show_bug.cgi?id=197110
277 Reviewed by Saam Barati.
279 This patch changes the Gigacage to use PAC on arm64e. As part of
280 this process all platforms must provide their length when
281 materializing the caged pointer. Since it would be somewhat
282 confusing to have two parameters for an operator [] those methods
283 have been removed. Lastly, this patch removes the specializations
284 for void* caged pointers, instead opting to use enable_if on the
285 methods that would normally fail on void* e.g. anything that
288 * WTF.xcodeproj/project.pbxproj:
289 * wtf/CMakeLists.txt:
291 (WTF::CagedPtr::CagedPtr):
292 (WTF::CagedPtr::get const):
293 (WTF::CagedPtr::getMayBeNull const):
294 (WTF::CagedPtr::getUnsafe const):
295 (WTF::CagedPtr::at const):
296 (WTF::CagedPtr::reauthenticate):
297 (WTF::CagedPtr::operator=):
298 (WTF::CagedPtr::operator== const):
299 (WTF::CagedPtr::operator bool const):
300 (WTF::CagedPtr::operator* const): Deleted.
301 (WTF::CagedPtr::operator-> const): Deleted.
302 (WTF::CagedPtr::operator[] const): Deleted.
304 * wtf/CagedUniquePtr.h:
305 (WTF::CagedUniquePtr::CagedUniquePtr):
306 (WTF::CagedUniquePtr::create):
307 (WTF::CagedUniquePtr::~CagedUniquePtr):
308 (WTF::CagedUniquePtr::destroy):
311 (Gigacage::cagedMayBeNull):
314 (WTF::untagArrayPtr):
315 (WTF::removeArrayPtrTag):
316 (WTF::retagArrayPtr):
317 * wtf/TaggedArrayStoragePtr.h: Copied from Source/JavaScriptCore/runtime/ArrayBufferView.cpp.
318 (WTF::TaggedArrayStoragePtr::TaggedArrayStoragePtr):
319 (WTF::TaggedArrayStoragePtr::get const):
320 (WTF::TaggedArrayStoragePtr::getUnsafe const):
321 (WTF::TaggedArrayStoragePtr::resize):
322 (WTF::TaggedArrayStoragePtr::operator bool const):
324 2019-05-08 Robin Morisset <rmorisset@apple.com>
326 WTF::TimingScope should show the total duration and not just the mean
327 https://bugs.webkit.org/show_bug.cgi?id=197672
329 Reviewed by Alex Christensen.
331 * wtf/TimingScope.cpp:
332 (WTF::TimingScope::scopeDidEnd):
334 2019-05-07 Yusuke Suzuki <ysuzuki@apple.com>
336 [JSC] LLIntPrototypeLoadAdaptiveStructureWatchpoint does not require Bag<>
337 https://bugs.webkit.org/show_bug.cgi?id=197645
339 Reviewed by Saam Barati.
341 * WTF.xcodeproj/project.pbxproj:
342 * wtf/CMakeLists.txt:
343 * wtf/Nonmovable.h: Copied from Source/JavaScriptCore/bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h.
345 (WTF::minCapacity>::uncheckedConstructAndAppend):
347 2019-05-07 Eric Carlson <eric.carlson@apple.com>
349 Define media buffering policy
350 https://bugs.webkit.org/show_bug.cgi?id=196979
351 <rdar://problem/28383861>
353 Reviewed by Jer Noble.
357 2019-05-07 Robin Morisset <rmorisset@apple.com>
359 WTF::BitVector should have an isEmpty() method
360 https://bugs.webkit.org/show_bug.cgi?id=197637
362 Reviewed by Keith Miller.
365 (WTF::BitVector::isEmptySlow const):
367 (WTF::BitVector::isEmpty const):
369 2019-05-07 Brent Fulgham <bfulgham@apple.com>
371 Correct JSON parser to address unterminated escape character
372 https://bugs.webkit.org/show_bug.cgi?id=197582
373 <rdar://problem/50459177>
375 Reviewed by Alex Christensen.
377 Correct JSON parser code to properly deal with unterminated escape
380 * wtf/JSONValues.cpp:
381 (WTF::JSONImpl::decodeString):
382 (WTF::JSONImpl::parseStringToken):
384 2019-05-07 Alex Christensen <achristensen@webkit.org>
386 Add a release assertion that Functions can only be constructed from non-null CompletionHandlers
387 https://bugs.webkit.org/show_bug.cgi?id=197641
389 Reviewed by Chris Dumez.
391 This will help us find the cause of rdar://problem/48679972 by seeing the crash when the Function is dispatched,
392 not when it's called with no interesting stack trace. I manually verified this assertion is hit in such a case.
393 We should also have no legitimate use of creating a Function out of a null CompletionHandler then never calling it.
395 * wtf/CompletionHandler.h:
396 (WTF::Detail::CallableWrapper<CompletionHandler<Out):
398 (WTF::Detail::CallableWrapperBase::~CallableWrapperBase):
399 (WTF::Detail::CallableWrapper::CallableWrapper):
402 2019-05-06 Christopher Reid <chris.reid@sony.com>
404 [JSC] Respect already defined USE_LLINT_EMBEDDED_OPCODE_ID compiler variable.
405 https://bugs.webkit.org/show_bug.cgi?id=197633
407 Reviewed by Don Olmstead.
409 When the variable `USE_LLINT_EMBEDDED_OPCODE_ID` is defined, stop defining
410 its value with platform default one.
414 2019-05-03 Sihui Liu <sihui_liu@apple.com>
416 Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
417 https://bugs.webkit.org/show_bug.cgi?id=197390
418 <rdar://problem/42685773>
420 Reviewed by Geoffrey Garen.
422 * wtf/FileSystem.cpp:
423 (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
424 (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
426 * wtf/cocoa/FileSystemCocoa.mm:
427 (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
428 (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
430 2019-05-03 Commit Queue <commit-queue@webkit.org>
432 Unreviewed, rolling out r244881.
433 https://bugs.webkit.org/show_bug.cgi?id=197559
435 Breaks compilation of jsconly on linux, breaking compilation
436 for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
437 guijemont on #webkit).
441 "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
443 https://bugs.webkit.org/show_bug.cgi?id=197174
444 https://trac.webkit.org/changeset/244881
446 2019-05-02 Alex Christensen <achristensen@webkit.org>
448 Mark U+01C0 as a homograph of U+006C
449 https://bugs.webkit.org/show_bug.cgi?id=197526
450 <rdar://problem/50301904>
452 Reviewed by Tim Horton.
454 * wtf/URLHelpers.cpp:
455 (WTF::URLHelpers::isLookalikeCharacter):
457 2019-05-02 Don Olmstead <don.olmstead@sony.com>
459 [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
460 https://bugs.webkit.org/show_bug.cgi?id=197174
462 Reviewed by Alex Christensen.
464 Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES.
466 * wtf/CMakeLists.txt:
468 2019-05-01 Darin Adler <darin@apple.com>
470 WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
471 https://bugs.webkit.org/show_bug.cgi?id=195535
473 Reviewed by Alexey Proskuryakov.
475 * wtf/text/AtomicString.cpp:
476 (WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
477 end is nullptr; this behavior used to be implemented inside the
478 calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
480 * wtf/text/AtomicStringImpl.cpp:
481 (WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
484 * wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
485 AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
486 the AtomicString class and its behavior changed subtly in this patch; it's helpful
487 to document that it's not exported.
489 * wtf/text/StringImpl.cpp:
490 (WTF::StringImpl::utf8Impl): Don't pass "true" for strictness to convertUTF16ToUTF8
491 since strict is the default. Also updated for changes to ConversionResult.
492 (WTF::StringImpl::utf8ForCharacters): Updated for change to convertLatin1ToUTF8.
493 (WTF::StringImpl::tryGetUtf8ForRange const): Ditto.
495 * wtf/text/StringView.cpp: Removed uneeded include of UTF8Conversion.h.
497 * wtf/text/WTFString.cpp:
498 (WTF::String::fromUTF8): Updated for change to convertUTF8ToUTF16.
500 * wtf/unicode/UTF8Conversion.cpp:
501 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII): Deleted.
502 (WTF::Unicode::inlineUTF8SequenceLength): Deleted.
503 (WTF::Unicode::UTF8SequenceLength): Deleted.
504 (WTF::Unicode::decodeUTF8Sequence): Deleted.
505 (WTF::Unicode::convertLatin1ToUTF8): Use U8_APPEND, enabling us to remove
506 almost everything in the function. Also changed resturn value to be a boolean
507 to indicate success since there is only one possible failure (target exhausted).
508 There is room for further simplification, since most callers have lengths rather
509 than end pointers for the source buffer, and all but one caller supplies a buffer
510 size known to be sufficient, so those don't need a return value, nor do they need
511 to pass an end of buffer pointer.
512 (WTF::Unicode::convertUTF16ToUTF8): Use U_IS_LEAD, U_IS_TRAIL,
513 U16_GET_SUPPLEMENTARY, U_IS_SURROGATE, and U8_APPEND. Also changed behavior
514 for non-strict mode so that unpaired surrogates will be turned into the
515 replacement character instead of invalid UTF-8 sequences, because U8_APPEND
516 won't create an invalid UTF-8 sequence, and because we don't need to do that
517 for any good reason at any call site.
518 (WTF::Unicode::isLegalUTF8): Deleted.
519 (WTF::Unicode::readUTF8Sequence): Deleted.
520 (WTF::Unicode::convertUTF8ToUTF16): Use U8_NEXT instead of
521 inlineUTF8SequenceLength, isLegalUTF8, and readUTF8Sequence. Use
522 U16_APPEND instead of lots of code that does the same thing. There is
523 room for further simplification since most callers don't need the "all ASCII"
524 feature and could probably pass the arguments in a more natural way.
525 (WTF::Unicode::calculateStringHashAndLengthFromUTF8MaskingTop8Bits):
526 Use U8_NEXT instead of isLegalUTF8, readUTF8Sequence, and various
527 error handling checks for things that are handled by U8_NEXT. Also removed
528 support for passing nullptr for end to specify a null-terminated string.
529 (WTF::Unicode::equalUTF16WithUTF8): Ditto.
531 * wtf/unicode/UTF8Conversion.h: Removed UTF8SequenceLength and
532 decodeUTF8Sequence. Changed the ConversionResult to match WebKit coding
533 style, with an eye toward perhaps removing it in the future. Changed
534 the convertUTF8ToUTF16 return value to a boolean and removed the "strict"
535 argument since no caller was passing false. Changed the convertLatin1ToUTF8
536 return value to a boolean. Tweaked comments.
538 2019-05-01 Shawn Roberts <sroberts@apple.com>
540 Unreviewed, rolling out r244821.
546 "WebKit has too much of its own UTF-8 code and should rely
547 more on ICU's UTF-8 support"
548 https://bugs.webkit.org/show_bug.cgi?id=195535
549 https://trac.webkit.org/changeset/244821
551 2019-05-01 Shawn Roberts <sroberts@apple.com>
553 Unreviewed, rolling out r244822.
555 Causing 4 Test262 failures on JSC Release and Debug
559 https://trac.webkit.org/changeset/244822 https://trac.webkit.org/changeset/244821
561 2019-04-29 Darin Adler <darin@apple.com>
563 WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
564 https://bugs.webkit.org/show_bug.cgi?id=195535
566 Reviewed by Alexey Proskuryakov.
568 * wtf/text/AtomicString.cpp:
569 (WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
570 end is nullptr; this behavior used to be implemented inside the
571 calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
573 * wtf/text/AtomicStringImpl.cpp:
574 (WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
577 * wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
578 AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
579 the AtomicString class and its behavior changed subtly in this patch; it's helpful
580 to document that it's not exported.
582 * wtf/text/StringImpl.cpp:
583 (WTF::StringImpl::utf8Impl): Don't pass "true" for strictness to convertUTF16ToUTF8
584 since strict is the default. Also updated for changes to ConversionResult.
585 (WTF::StringImpl::utf8ForCharacters): Updated for change to convertLatin1ToUTF8.
586 (WTF::StringImpl::tryGetUtf8ForRange const): Ditto.
588 * wtf/text/StringView.cpp: Removed uneeded include of UTF8Conversion.h.
590 * wtf/text/WTFString.cpp:
591 (WTF::String::fromUTF8): Updated for change to convertUTF8ToUTF16.
593 * wtf/unicode/UTF8Conversion.cpp:
594 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII): Deleted.
595 (WTF::Unicode::inlineUTF8SequenceLength): Deleted.
596 (WTF::Unicode::UTF8SequenceLength): Deleted.
597 (WTF::Unicode::decodeUTF8Sequence): Deleted.
598 (WTF::Unicode::convertLatin1ToUTF8): Use U8_APPEND, enabling us to remove
599 almost everything in the function. Also changed resturn value to be a boolean
600 to indicate success since there is only one possible failure (target exhausted).
601 There is room for further simplification, since most callers have lengths rather
602 than end pointers for the source buffer, and all but one caller supplies a buffer
603 size known to be sufficient, so those don't need a return value, nor do they need
604 to pass an end of buffer pointer.
605 (WTF::Unicode::convertUTF16ToUTF8): Use U_IS_LEAD, U_IS_TRAIL,
606 U16_GET_SUPPLEMENTARY, U_IS_SURROGATE, and U8_APPEND. Also changed behavior
607 for non-strict mode so that unpaired surrogates will be turned into the
608 replacement character instead of invalid UTF-8 sequences, because U8_APPEND
609 won't create an invalid UTF-8 sequence, and because we don't need to do that
610 for any good reason at any call site.
611 (WTF::Unicode::isLegalUTF8): Deleted.
612 (WTF::Unicode::readUTF8Sequence): Deleted.
613 (WTF::Unicode::convertUTF8ToUTF16): Use U8_NEXT instead of
614 inlineUTF8SequenceLength, isLegalUTF8, and readUTF8Sequence. Use
615 U16_APPEND instead of lots of code that does the same thing. There is
616 room for further simplification since most callers don't need the "all ASCII"
617 feature and could probably pass the arguments in a more natural way.
618 (WTF::Unicode::calculateStringHashAndLengthFromUTF8MaskingTop8Bits):
619 Use U8_NEXT instead of isLegalUTF8, readUTF8Sequence, and various
620 error handling checks for things that are handled by U8_NEXT. Also removed
621 support for passing nullptr for end to specify a null-terminated string.
622 (WTF::Unicode::equalUTF16WithUTF8): Ditto.
624 * wtf/unicode/UTF8Conversion.h: Removed UTF8SequenceLength and
625 decodeUTF8Sequence. Changed the ConversionResult to match WebKit coding
626 style, with an eye toward perhaps removing it in the future. Changed
627 the convertUTF8ToUTF16 return value to a boolean and removed the "strict"
628 argument since no caller was passing false. Changed the convertLatin1ToUTF8
629 return value to a boolean. Tweaked comments.
631 2019-04-30 John Wilander <wilander@apple.com>
633 Add logging of Ad Click Attribution errors and events to a dedicated channel
634 https://bugs.webkit.org/show_bug.cgi?id=197332
635 <rdar://problem/49918800>
637 Reviewed by Youenn Fablet.
639 Added missing RELEASE_LOG_INFO and RELEASE_LOG_INFO_IF dummies
640 for RELEASE_LOG_DISABLED.
644 2019-04-30 Youenn Fablet <youenn@apple.com>
646 Make Document audio producers use WeakPtr
647 https://bugs.webkit.org/show_bug.cgi?id=197382
649 Reviewed by Eric Carlson.
652 (WTF::WeakHashSet::hasNullReferences const):
654 2019-04-30 Commit Queue <commit-queue@webkit.org>
656 Unreviewed, rolling out r244773.
657 https://bugs.webkit.org/show_bug.cgi?id=197436
659 Causing assertion failures on debug queues (Requested by
660 ShawnRoberts on #webkit).
664 "Make Document audio producers use WeakPtr"
665 https://bugs.webkit.org/show_bug.cgi?id=197382
666 https://trac.webkit.org/changeset/244773
668 2019-04-30 Youenn Fablet <youenn@apple.com>
670 Make Document audio producers use WeakPtr
671 https://bugs.webkit.org/show_bug.cgi?id=197382
673 Reviewed by Eric Carlson.
676 (WTF::WeakHashSet::hasNullReferences const):
678 2019-04-29 Alex Christensen <achristensen@webkit.org>
680 <rdar://problem/50299396> Fix internal High Sierra build
681 https://bugs.webkit.org/show_bug.cgi?id=197388
683 * Configurations/Base.xcconfig:
685 2019-04-29 Yusuke Suzuki <ysuzuki@apple.com>
687 JITStubRoutineSet wastes 180KB of HashTable capacity on can.com
688 https://bugs.webkit.org/show_bug.cgi?id=186732
690 Reviewed by Saam Barati.
693 (WTF::Range::contains const):
695 2019-04-29 Basuke Suzuki <Basuke.Suzuki@sony.com>
697 [Win] Add flag to enable version information stamping and disable by default.
698 https://bugs.webkit.org/show_bug.cgi?id=197249
699 <rdar://problem/50224412>
701 Reviewed by Ross Kirsling.
703 This feature is only used in AppleWin port. Add flag for this task and make it OFF by default.
704 Then enable it by default on AppleWin.
706 * wtf/CMakeLists.txt:
708 2019-04-26 Don Olmstead <don.olmstead@sony.com>
710 Add WTF::findIgnoringASCIICaseWithoutLength to replace strcasestr
711 https://bugs.webkit.org/show_bug.cgi?id=197291
713 Reviewed by Konstantin Tokarev.
715 Adds an implementation of strcasestr within WTF.
717 * wtf/text/StringCommon.h:
718 (WTF::findIgnoringASCIICaseWithoutLength):
720 2019-04-26 Sihui Liu <sihui_liu@apple.com>
722 Stop IDB transactions to release locked database files when network process is ready to suspend
723 https://bugs.webkit.org/show_bug.cgi?id=196372
724 <rdar://problem/48930116>
726 Reviewed by Brady Eidson.
728 Provide a method to suspend the thread and block main thread until the thread is suspended.
730 * wtf/CrossThreadTaskHandler.cpp:
731 (WTF::CrossThreadTaskHandler::taskRunLoop):
732 (WTF::CrossThreadTaskHandler::suspendAndWait):
733 (WTF::CrossThreadTaskHandler::resume):
734 * wtf/CrossThreadTaskHandler.h:
736 2019-04-25 Fujii Hironori <Hironori.Fujii@sony.com>
738 Unreviewed, rolling out r244669.
740 Windows ports can't clean build.
744 "[Win] Add flag to enable version information stamping and
746 https://bugs.webkit.org/show_bug.cgi?id=197249
747 https://trac.webkit.org/changeset/244669
749 2019-04-25 Basuke Suzuki <Basuke.Suzuki@sony.com>
751 [Win] Add flag to enable version information stamping and disable by default.
752 https://bugs.webkit.org/show_bug.cgi?id=197249
754 Reviewed by Ross Kirsling.
756 This feature is only used in AppleWin port. Add flag for this task and make it OFF by default.
757 Then enable it by default on AppleWin.
759 * wtf/CMakeLists.txt:
761 2019-04-25 Timothy Hatcher <timothy@apple.com>
763 Disable date and time inputs on iOSMac.
764 https://bugs.webkit.org/show_bug.cgi?id=197287
765 rdar://problem/46794376
767 Reviewed by Wenson Hsieh.
769 * wtf/FeatureDefines.h:
771 2019-04-25 Alex Christensen <achristensen@webkit.org>
773 Fix High Sierra build after r244653
774 https://bugs.webkit.org/show_bug.cgi?id=197131
776 * wtf/StdLibExtras.h:
777 High Sierra thinks __cplusplus is 201406 even when using C++17.
778 Removing the __cplusplus check resolves the build failure on High Sierra.
779 We can clean up StdLibExtras more later.
781 2019-04-25 Alex Christensen <achristensen@webkit.org>
784 https://bugs.webkit.org/show_bug.cgi?id=197131
786 Reviewed by Darin Adler.
788 * Configurations/Base.xcconfig:
789 * wtf/CMakeLists.txt:
793 2019-04-25 Alex Christensen <achristensen@webkit.org>
795 Remove DeprecatedOptional
796 https://bugs.webkit.org/show_bug.cgi?id=197161
798 Reviewed by Darin Adler.
800 * WTF.xcodeproj/project.pbxproj:
801 * wtf/CMakeLists.txt:
802 * wtf/DeprecatedOptional.h: Removed.
804 2019-04-24 Carlos Garcia Campos <cgarcia@igalia.com>
806 [GTK] Hardcoded text color in input fields
807 https://bugs.webkit.org/show_bug.cgi?id=126907
809 Reviewed by Michael Catanzaro.
811 Define HAVE_OS_DARK_MODE_SUPPORT for GTK port.
815 2019-04-24 Tim Horton <timothy_horton@apple.com>
817 Clean up WKActionSheetAssistant's use of LaunchServices
818 https://bugs.webkit.org/show_bug.cgi?id=194645
819 <rdar://problem/47707952>
821 Reviewed by Andy Estes.
825 2019-04-24 chris fleizach <cfleizach@apple.com>
827 AX: Remove deprecated Accessibility Object Model events
828 https://bugs.webkit.org/show_bug.cgi?id=197073
829 <rdar://problem/50027819>
831 Reviewed by Ryosuke Niwa.
835 2019-04-23 Commit Queue <commit-queue@webkit.org>
837 Unreviewed, rolling out r244558.
838 https://bugs.webkit.org/show_bug.cgi?id=197219
840 Causing crashes on iOS Sim Release and Debug (Requested by
841 ShawnRoberts on #webkit).
845 "Remove DeprecatedOptional"
846 https://bugs.webkit.org/show_bug.cgi?id=197161
847 https://trac.webkit.org/changeset/244558
849 2019-04-23 Alex Christensen <achristensen@webkit.org>
851 Remove DeprecatedOptional
852 https://bugs.webkit.org/show_bug.cgi?id=197161
854 Reviewed by Darin Adler.
856 This was added in r209326 to be compatible with a shipping version of Safari.
857 We have released several versions of Safari since then, so do what the comments say and remove it.
858 The existence of this std::optional makes migrating to C++17 harder, and there's no reason to keep it.
860 * WTF.xcodeproj/project.pbxproj:
861 * wtf/CMakeLists.txt:
862 * wtf/DeprecatedOptional.h: Removed.
864 2019-04-21 Zan Dobersek <zdobersek@igalia.com>
866 [WTF] Generic memoryFootprint() implementation should use bmalloc on Linux
867 https://bugs.webkit.org/show_bug.cgi?id=196963
869 Reviewed by Don Olmstead.
871 Have the generic memoryFootprint() implementation use bmalloc's
872 memoryFootprint() API on Linux, whenever the system malloc option is
873 not enabled. Limitation to Linux platforms is due to the bmalloc
874 implementation being limited to those configurations (excluding iOS
875 which doesn't use MemoryFootprintGeneric.cpp).
877 * wtf/PlatformWPE.cmake: Switch to building MemoryFootprintGeneric.cpp.
878 * wtf/generic/MemoryFootprintGeneric.cpp:
879 (WTF::memoryFootprint):
881 2019-04-19 Ryosuke Niwa <rniwa@webkit.org>
883 HashTable::removeIf always shrinks the hash table by half even if there is nothing left
884 https://bugs.webkit.org/show_bug.cgi?id=196681
885 <rdar://problem/49917764>
887 Reviewed by Darin Adler.
889 Address Darin's comments by removing the explicit type from std::max.
892 (WTF::KeyTraits>::computeBestTableSize):
893 (WTF::KeyTraits>::shrinkToBestSize):
895 2019-04-18 Chris Dumez <cdumez@apple.com>
897 [iOS] Improve detection of when web views go to background / foreground
898 https://bugs.webkit.org/show_bug.cgi?id=197035
899 <rdar://problem/45281182>
901 Reviewed by Tim Horton.
905 * wtf/FeatureDefines.h:
907 2019-04-18 Jer Noble <jer.noble@apple.com>
909 Add support for parsing FairPlayStreaming PSSH boxes.
910 https://bugs.webkit.org/show_bug.cgi?id=197064
912 Reviewed by Eric Carlson.
916 2019-04-18 Yusuke Suzuki <ysuzuki@apple.com>
918 [WTF] StringBuilder should set correct m_is8Bit flag when merging
919 https://bugs.webkit.org/show_bug.cgi?id=197053
921 Reviewed by Saam Barati.
923 When appending StringBuilder to the other StringBuilder, we have a path that does not set m_is8Bit flag correctly.
924 This patch correctly sets this flag. And we also change 0 to nullptr when we are using 0 as a pointer.
926 * wtf/text/StringBuilder.cpp:
927 (WTF::StringBuilder::reserveCapacity):
928 (WTF::StringBuilder::appendUninitializedSlow):
929 (WTF::StringBuilder::append):
930 * wtf/text/StringBuilder.h:
931 (WTF::StringBuilder::append):
932 (WTF::StringBuilder::characters8 const):
933 (WTF::StringBuilder::characters16 const):
934 (WTF::StringBuilder::clear):
936 2019-04-17 Tim Horton <timothy_horton@apple.com>
938 Adopt different scroll view flashing SPI
939 https://bugs.webkit.org/show_bug.cgi?id=197043
940 <rdar://problem/49996476>
942 Reviewed by Wenson Hsieh.
946 2019-04-17 Jer Noble <jer.noble@apple.com>
948 Enable HAVE_AVFOUNDATION_VIDEO_OUTPUT on PLATFORM(IOSMAC)
949 https://bugs.webkit.org/show_bug.cgi?id=196994
950 <rdar://problem/44158331>
952 Reviewed by Alex Christensen.
956 2019-04-16 Stephan Szabo <stephan.szabo@sony.com>
958 [PlayStation] Update port for system library changes
959 https://bugs.webkit.org/show_bug.cgi?id=196978
961 Reviewed by Ross Kirsling.
963 * wtf/PlatformPlayStation.cmake:
964 Remove reference to deleted system library
966 2019-04-16 Jer Noble <jer.noble@apple.com>
968 Enable HAVE_AVKIT on PLATFORM(IOSMAC)
969 https://bugs.webkit.org/show_bug.cgi?id=196987
971 Reviewed by Tim Horton.
975 2019-04-16 Robin Morisset <rmorisset@apple.com>
977 [WTF] holdLock should be marked WARN_UNUSED_RETURN
978 https://bugs.webkit.org/show_bug.cgi?id=196922
980 Reviewed by Keith Miller.
984 2019-04-16 Don Olmstead <don.olmstead@sony.com>
986 [CMake] Set WTF_SCRIPTS_DIR
987 https://bugs.webkit.org/show_bug.cgi?id=196917
989 Reviewed by Konstantin Tokarev.
991 Use WTF_SCRIPTS_DIR for copying the unified sources script.
993 * wtf/CMakeLists.txt:
995 2019-04-15 Myles C. Maxfield <mmaxfield@apple.com>
997 [Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
998 https://bugs.webkit.org/show_bug.cgi?id=196846
999 <rdar://problem/49499971>
1001 Reviewed by Simon Fraser and Darin Adler.
1007 2019-04-12 Ryosuke Niwa <rniwa@webkit.org>
1009 HashTable::removeIf always shrinks the hash table by half even if there is nothing left
1010 https://bugs.webkit.org/show_bug.cgi?id=196681
1012 Reviewed by Darin Adler.
1014 Made HashTable::removeIf shrink to the "best size", which is the least power of two bigger
1015 than twice the key count as already used in the copy constructor.
1018 (WTF::HashTable::computeBestTableSize): Extracted from the copy constructor.
1019 (WTF::HashTable::shrinkToBestSize): Added.
1020 (WTF::HashTable::removeIf): Use shrinkToBestSize instead of shrink.
1021 (WTF::HashTable::HashTable):
1023 2019-04-12 Eric Carlson <eric.carlson@apple.com>
1025 Update AudioSession route sharing policy
1026 https://bugs.webkit.org/show_bug.cgi?id=196776
1027 <rdar://problem/46501611>
1029 Reviewed by Jer Noble.
1031 * wtf/Platform.h: Define HAVE_ROUTE_SHARING_POLICY_LONG_FORM_VIDEO.
1033 2019-04-10 Said Abou-Hallawa <sabouhallawa@apple.com>
1035 requestAnimationFrame should execute before the next frame
1036 https://bugs.webkit.org/show_bug.cgi?id=177484
1038 Reviewed by Simon Fraser.
1040 Add trace points for the page RenderingUpdate.
1042 * wtf/SystemTracing.h:
1044 2019-04-10 Claudio Saavedra <csaavedra@igalia.com>
1046 Do not generate empty unified sources when unified builds are disabled
1047 https://bugs.webkit.org/show_bug.cgi?id=196767
1049 Reviewed by Konstantin Tokarev.
1051 If unified builds are disabled, the ruby script to generate them
1052 is still used to list the sources that need to be
1053 compiled. Currently, the script always generates bundled unified
1054 sources, even if it's being used just to list all the sources. So
1055 when the unified builds are disabled and no files are going to be
1056 bundled, the script generates one empty file per bundle manager
1057 (that is, one C++ and one ObjectiveC), that gets added to the
1058 sources to be compiled.
1060 * Scripts/generate-unified-source-bundles.rb: Only go through the
1061 bundle managers file generation when not running in
1062 PrintAllSources mode, to avoid generating empty bundle files.
1064 2019-04-10 Enrique Ocaña González <eocanha@igalia.com>
1066 [WPE] Avoid async IO starving timers
1067 https://bugs.webkit.org/show_bug.cgi?id=196733
1069 Reviewed by Carlos Garcia Campos.
1071 If AsyncIONetwork and DiskCacheRead priorities are higher than
1072 MainThreadSharedTimer the timers get starved. This causes the NetworkProcess
1073 to accumulate MB of data instead of handing it down to the WebProcess (done
1074 using a Timer). This eventually causes an Out Of Memory kill on the
1075 NetworkProcess on some embedded platforms with low memory limits.
1077 This patch levels the three priorities to the same value, while still leaving
1078 DiskCacheWrite with less priority than DiskCacheRead.
1080 * wtf/glib/RunLoopSourcePriority.h: Changed RunLoopSourcePriority values for WPE.
1082 2019-04-09 Don Olmstead <don.olmstead@sony.com>
1084 [CMake] WTF derived sources should only be referenced inside WTF
1085 https://bugs.webkit.org/show_bug.cgi?id=196706
1087 Reviewed by Konstantin Tokarev.
1089 Use ${WTF_DERIVED_SOURCES_DIR} instead of ${DERIVED_SOURCES_DIR} within WTF.
1091 * wtf/CMakeLists.txt:
1092 * wtf/PlatformJSCOnly.cmake:
1093 * wtf/PlatformMac.cmake:
1095 2019-04-09 Don Olmstead <don.olmstead@sony.com>
1097 [CMake] Apple builds should use ICU_INCLUDE_DIRS
1098 https://bugs.webkit.org/show_bug.cgi?id=196720
1100 Reviewed by Konstantin Tokarev.
1102 Copy ICU headers for Apple builds into ICU_INCLUDE_DIRS.
1105 * wtf/PlatformMac.cmake:
1107 2019-04-08 Don Olmstead <don.olmstead@sony.com>
1109 [CMake][WinCairo] Separate copied headers into different directories
1110 https://bugs.webkit.org/show_bug.cgi?id=196655
1112 Reviewed by Michael Catanzaro.
1114 * wtf/CMakeLists.txt:
1116 2019-04-08 Guillaume Emont <guijemont@igalia.com>
1119 https://bugs.webkit.org/show_bug.cgi?id=196689
1121 Reviewed by Žan Doberšek.
1123 Since the bytecode change, we enabled the baseline JIT on mips in
1124 r240432, but DFG is still missing. With this change, all tests are
1125 passing on a ci20 board.
1127 * wtf/Platform.h: Enable DFG on MIPS by default.
1129 2019-04-06 Ryosuke Niwa <rniwa@webkit.org>
1131 Added tests for WeakHashSet::computesEmpty and WeakHashSet::computeSize
1132 https://bugs.webkit.org/show_bug.cgi?id=196669
1134 Reviewed by Geoffrey Garen.
1136 Removed the superflous type names from forward declarations, and made WeakHashSet::add
1137 take a const object to match other container types in WTF.
1139 * wtf/WeakHashSet.h:
1140 (WTF::WeakHashSet::add):
1143 2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
1145 Make WeakPtr<Element> possible and deploy it in form associated elements code
1146 https://bugs.webkit.org/show_bug.cgi?id=196626
1148 Reviewed by Antti Koivisto.
1150 Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
1151 a subclass type U of a type T used to define WeakReference<T>.
1153 Also added computesEmpty, which is slightly more efficient than computeSize
1154 when m_set is either empty or when there are non-released weak references in the set.
1156 * wtf/WeakHashSet.h:
1157 (WTF::WeakHashSet::remove):
1158 (WTF::WeakHashSet::contains const):
1159 (WTF::WeakHashSet::computesEmpty const): Added.
1160 * wtf/WeakPtr.h: Added an explicit forward declaration of WeakHashSet to avoid
1161 build failures in GTK+ and WPE ports.
1163 2019-04-05 Eric Carlson <eric.carlson@apple.com>
1165 Remove AUDIO_TOOLBOX_AUDIO_SESSION
1166 https://bugs.webkit.org/show_bug.cgi?id=196653
1167 <rdar://problem/49652098>
1169 Reviewed by Jer Noble.
1173 2019-04-05 Michael Catanzaro <mcatanzaro@igalia.com>
1175 Unreviewed manual rollout of r243929
1176 https://bugs.webkit.org/show_bug.cgi?id=196626
1178 * wtf/WeakHashSet.h:
1179 (WTF::WeakHashSet::remove):
1180 (WTF::WeakHashSet::contains const):
1181 (WTF::WeakHashSet::computesEmpty const): Deleted.
1183 2019-04-05 Commit Queue <commit-queue@webkit.org>
1185 Unreviewed, rolling out r243833.
1186 https://bugs.webkit.org/show_bug.cgi?id=196645
1188 This change breaks build of WPE and GTK ports (Requested by
1189 annulen on #webkit).
1193 "[CMake][WTF] Mirror XCode header directories"
1194 https://bugs.webkit.org/show_bug.cgi?id=191662
1195 https://trac.webkit.org/changeset/243833
1197 2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
1199 Make WeakPtr<Element> possible and deploy it in form associated elements code
1200 https://bugs.webkit.org/show_bug.cgi?id=196626
1202 Reviewed by Antti Koivisto.
1204 Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
1205 a subclass type U of a type T used to define WeakReference<T>.
1207 Also added computesEmpty, which is slightly more efficient than computeSize
1208 when m_set is either empty or when there are non-released weak references in the set.
1210 * wtf/WeakHashSet.h:
1211 (WTF::WeakHashSet::remove):
1212 (WTF::WeakHashSet::contains const):
1213 (WTF::WeakHashSet::computesEmpty const): Added.
1215 2019-04-04 Yusuke Suzuki <ysuzuki@apple.com>
1217 [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
1218 https://bugs.webkit.org/show_bug.cgi?id=196475
1220 Reviewed by Saam Barati.
1222 * wtf/ForbidHeapAllocation.h:
1224 * wtf/IsoMallocInlines.h:
1226 2019-04-03 Don Olmstead <don.olmstead@sony.com>
1228 [CMake][WTF] Mirror XCode header directories
1229 https://bugs.webkit.org/show_bug.cgi?id=191662
1231 Reviewed by Konstantin Tokarev.
1233 Rename WTF forwarding header target to WTFFramework and update the install location
1234 to WTF_FRAMEWORK_HEADERS_DIR.
1236 * wtf/CMakeLists.txt:
1238 2019-04-03 Joseph Pecoraro <pecoraro@apple.com>
1240 Web Inspector: Remote Inspector indicate callback should always happen on the main thread
1241 https://bugs.webkit.org/show_bug.cgi?id=196513
1242 <rdar://problem/49498284>
1244 Reviewed by Devin Rousso.
1247 * wtf/cocoa/MainThreadCocoa.mm:
1248 (WTF::dispatchAsyncOnMainThreadWithWebThreadLockIfNeeded):
1249 * wtf/ios/WebCoreThread.cpp:
1250 * wtf/ios/WebCoreThread.h:
1252 2019-04-02 Keith Rollin <krollin@apple.com>
1254 Inhibit CFNetwork logging in private sessions
1255 https://bugs.webkit.org/show_bug.cgi?id=196268
1256 <rdar://problem/48210793>
1258 Fix a conditional in Platform.h where IOS should have been used
1259 instead of IOS_FAMILY. The latter happened to work, but we really want
1260 to be using the proper symbol here.
1262 Reviewed by Alexey Proskuryakov.
1266 2019-04-01 Michael Catanzaro <mcatanzaro@igalia.com>
1268 Stop trying to support building JSC with clang 3.8
1269 https://bugs.webkit.org/show_bug.cgi?id=195947
1270 <rdar://problem/49069219>
1272 Reviewed by Darin Adler.
1274 It seems WebKit hasn't built with clang 3.8 in a while, no devs are using this compiler, we
1275 don't know how much effort it would be to make JSC work again, and it's making the code
1276 worse. Remove my hacks to support clang 3.8 from WTF.
1278 * wtf/MetaAllocator.cpp:
1279 (WTF::MetaAllocator::allocate):
1280 * wtf/text/StringConcatenate.h:
1281 (WTF::tryMakeStringFromAdapters):
1283 2019-03-31 Yusuke Suzuki <ysuzuki@apple.com>
1285 [JSC] Butterfly allocation from LargeAllocation should try "realloc" behavior if collector thread is not active
1286 https://bugs.webkit.org/show_bug.cgi?id=196160
1288 Reviewed by Saam Barati.
1291 (WTF::FastMalloc::tryRealloc):
1293 (Gigacage::tryRealloc):
1296 2019-03-31 Andy Estes <aestes@apple.com>
1298 [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
1299 https://bugs.webkit.org/show_bug.cgi?id=196433
1300 <rdar://problem/49293305>
1302 Reviewed by Tim Horton.
1304 * wtf/NeverDestroyed.h:
1305 (WTF::NeverDestroyed::operator->):
1306 (WTF::NeverDestroyed::operator-> const):
1308 2019-03-28 Fujii Hironori <Hironori.Fujii@sony.com>
1310 Unreviewed build fix.
1312 * wtf/CMakeLists.txt: Added SpanningTree.h to WTF_PUBLIC_HEADERS.
1314 2019-03-28 Saam Barati <sbarati@apple.com>
1316 BackwardsGraph needs to consider back edges as the backward's root successor
1317 https://bugs.webkit.org/show_bug.cgi?id=195991
1319 Reviewed by Filip Pizlo.
1321 Previously, our backwards graph analysis was slightly wrong. The idea of
1322 backwards graph is that the root of the graph has edges to terminals in
1323 the original graph. And then the original directed edges in the graph are flipped.
1325 However, we weren't considering loops as a form of terminality. For example,
1326 we wouldn't consider an infinite loop as a terminal. So there were no edges
1327 from the root to a node in the infinite loop. This lead us to make mistakes
1328 when we used backwards dominators to compute control flow equivalence.
1330 This is better understood in an example:
1344 In the previous version of this algorithm, the only edge from the backwards
1345 root would be to the block containing the return. This would lead us to
1346 believe that the loading of the structureID backwards dominates the preheader,
1347 leading us to believe it's control flow equivalent to preheader. This is
1348 obviously wrong, since we can loop forever if "v" isn't a cell.
1350 The solution here is to treat any backedge in the graph as a "terminal" node.
1351 Since a backedge implies the existence of a loop.
1353 In the above example, the backwards root now has an edge to both blocks with
1354 "continue". This prevents us from falsely claiming that the return is control
1355 flow equivalent with the preheader.
1357 This patch uses DFS spanning trees to compute back edges. An edge
1358 u->v is a back edge when u is a descendent of v in the DFS spanning
1361 * WTF.xcodeproj/project.pbxproj:
1362 * wtf/BackwardsGraph.h:
1363 (WTF::BackwardsGraph::BackwardsGraph):
1364 * wtf/SpanningTree.h: Added.
1365 (SpanningTree::SpanningTree):
1366 (SpanningTree::isDescendent):
1368 2019-03-28 Tim Horton <timothy_horton@apple.com>
1373 It is no longer necessary to exclude this from PLATFORM(IOSMAC).
1375 2019-03-27 Per Arne Vollan <pvollan@apple.com>
1377 Layout Test js/math-clz32.html is failing
1378 https://bugs.webkit.org/show_bug.cgi?id=196209
1380 Reviewed by Ross Kirsling.
1382 Use the correct number of loop iterations when counting leading zeros. Also, the
1383 count was off by one for the Win64 case.
1388 2019-03-26 Keith Rollin <krollin@apple.com>
1390 Inhibit CFNetwork logging in private sessions
1391 https://bugs.webkit.org/show_bug.cgi?id=196268
1392 <rdar://problem/48210793>
1394 Reviewed by Alex Christensen.
1396 Before performing any logging, the NetworkProcess checks to see if
1397 it's performing an operation associated with a private (ephemeral)
1398 browsing session. If so, it skips the logging. However, networking
1399 layers below the NetworkProcess don't know about private browsing, so
1400 they would still perform their own logging. CFNetwork now has a flag
1401 that lets us control that, so set it to False if private browsing.
1405 2019-03-25 Alex Christensen <achristensen@webkit.org>
1407 Expected shouldn't assume its contained types are copyable
1408 https://bugs.webkit.org/show_bug.cgi?id=195986
1410 Reviewed by JF Bastien.
1413 (std::experimental::fundamentals_v3::__expected_detail::constexpr_base::constexpr_base):
1414 (std::experimental::fundamentals_v3::operator==):
1415 (std::experimental::fundamentals_v3::operator!=):
1417 (std::experimental::fundamentals_v3::unexpected::unexpected):
1419 2019-03-24 Keith Miller <keith_miller@apple.com>
1421 Unreviewed, forgot to refactor variable name for windows build in
1428 2019-03-24 Andy Estes <aestes@apple.com>
1430 [watchOS] Remove unused Proximity Networking code
1431 https://bugs.webkit.org/show_bug.cgi?id=196188
1433 Reviewed by Tim Horton.
1435 * wtf/FeatureDefines.h:
1437 2019-03-23 Keith Miller <keith_miller@apple.com>
1439 Refactor clz/ctz and fix getLSBSet.
1440 https://bugs.webkit.org/show_bug.cgi?id=196162
1442 Reviewed by Saam Barati.
1444 This patch makes clz32/64 and ctz32 generic so they work on any
1445 numeric type. Since these methods work on any type we don't need
1446 to have a separate implementation of getLSBSet, which also
1447 happened to be getMSBSet. This patch also adds getMSBSet as there
1448 may be users who want that in the future.
1455 (getLSBSet): Deleted.
1456 (WTF::clz32): Deleted.
1457 (WTF::clz64): Deleted.
1458 (WTF::ctz32): Deleted.
1460 2019-03-22 Keith Rollin <krollin@apple.com>
1462 Enable ThinLTO support in Production builds
1463 https://bugs.webkit.org/show_bug.cgi?id=190758
1464 <rdar://problem/45413233>
1466 Reviewed by Daniel Bates.
1468 Enable building with Thin LTO in Production when using Xcode 10.2 or
1469 later. This change results in a 1.45% progression in PLT5. Full
1470 Production build times increase about 2-3%. Incremental build times
1471 are more severely affected, and so LTO is not enabled for local
1474 LTO is enabled only on macOS for now, until rdar://problem/49013399,
1475 which affects ARM builds, is fixed.
1477 To change the LTO setting when building locally:
1479 - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
1481 - If building with `build-webkit`, specify --lto-mode={none,thin,full}
1482 on the command line.
1483 - If building with `build-root`, specify --lto={none,thin,full} on the
1485 - If building with Xcode, create a LocalOverrides.xcconfig file at the
1486 top level of your repository directory (if needed) and define
1487 WK_LTO_MODE to full, thin, or none.
1489 * Configurations/Base.xcconfig:
1491 2019-03-22 Tim Horton <timothy_horton@apple.com>
1493 Fix the build after r243354
1497 2019-03-22 Tim Horton <timothy_horton@apple.com>
1499 Fix the build after r243354
1500 https://bugs.webkit.org/show_bug.cgi?id=196138
1501 <rdar://problem/49145951>
1505 2019-03-21 Eric Carlson <eric.carlson@apple.com>
1507 Add UI process WebRTC runtime logging.
1508 https://bugs.webkit.org/show_bug.cgi?id=196020
1509 <rdar://problem/49071443>
1511 Reviewed by Youenn Fablet.
1514 (WTF::LogArgument::toString): Add long long and unsigned long long variants.
1516 2019-03-20 Simon Fraser <simon.fraser@apple.com>
1518 Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
1519 https://bugs.webkit.org/show_bug.cgi?id=196049
1521 Reviewed by Tim Horton.
1523 This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
1524 overflow scrolling in general, so rename it.
1526 * wtf/FeatureDefines.h:
1528 2019-03-20 Mark Lam <mark.lam@apple.com>
1530 Open source arm64e code.
1531 https://bugs.webkit.org/show_bug.cgi?id=196012
1532 <rdar://problem/49066237>
1534 Reviewed by Keith Miller.
1536 * WTF.xcodeproj/project.pbxproj:
1539 * wtf/PlatformRegisters.cpp: Added.
1540 (WTF::threadStateLRInternal):
1541 (WTF::threadStatePCInternal):
1542 * wtf/PlatformRegisters.h:
1543 * wtf/PointerPreparations.h:
1544 * wtf/PtrTag.cpp: Added.
1547 (WTF::registerPtrTagLookup):
1548 (WTF::reportBadTag):
1550 (WTF::removeCodePtrTag):
1551 (WTF::tagCodePtrImpl):
1553 (WTF::untagCodePtrImplHelper):
1554 (WTF::untagCodePtrImpl):
1555 (WTF::untagCodePtr):
1556 (WTF::retagCodePtrImplHelper):
1557 (WTF::retagCodePtrImpl):
1558 (WTF::retagCodePtr):
1559 (WTF::tagCFunctionPtrImpl):
1560 (WTF::tagCFunctionPtr):
1561 (WTF::untagCFunctionPtrImpl):
1562 (WTF::untagCFunctionPtr):
1564 (WTF::assertIsCFunctionPtr):
1565 (WTF::assertIsNullOrCFunctionPtr):
1566 (WTF::assertIsNotTagged):
1567 (WTF::assertIsTagged):
1568 (WTF::assertIsNullOrTagged):
1569 (WTF::isTaggedWith):
1570 (WTF::assertIsTaggedWith):
1571 (WTF::assertIsNullOrTaggedWith):
1572 (WTF::usesPointerTagging):
1573 (WTF::registerPtrTagLookup):
1574 (WTF::reportBadTag):
1575 (WTF::tagForPtr): Deleted.
1577 2019-03-20 Keith Rollin <krollin@apple.com>
1579 Update checks that determine if WebKit is system WebKit
1580 https://bugs.webkit.org/show_bug.cgi?id=195756
1582 Reviewed by Alexey Proskuryakov.
1584 The system WebKit can be installed in additional locations, so check
1585 for and allow those, too.
1589 2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
1591 Unreviewed, further attempt to fix clang 3.8 build
1592 https://bugs.webkit.org/show_bug.cgi?id=195947
1594 * wtf/MetaAllocator.cpp:
1595 (WTF::MetaAllocator::allocate):
1597 2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
1599 REGRESSION(r243115) breaks build for clang 3.8
1600 https://bugs.webkit.org/show_bug.cgi?id=195947
1602 Reviewed by Chris Dumez.
1604 * wtf/text/StringConcatenate.h:
1605 (WTF::tryMakeStringFromAdapters):
1607 2019-03-20 Tim Horton <timothy_horton@apple.com>
1609 Add an platform-driven spell-checking mechanism
1610 https://bugs.webkit.org/show_bug.cgi?id=195795
1612 Reviewed by Ryosuke Niwa.
1617 2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
1619 Build cleanly with GCC 9
1620 https://bugs.webkit.org/show_bug.cgi?id=195920
1622 Reviewed by Chris Dumez.
1624 WebKit triggers three new GCC 9 warnings:
1627 -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
1628 declared copy constructor and assignment operator if one of them is user-provided.
1631 Solution is to either add a copy constructor or copy assignment operator, if required, or
1632 else remove one if it is redundant.
1635 -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
1636 -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
1639 These account for most of this patch. Solution is to just remove the bad WTFMove().
1641 Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
1642 These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
1643 would be safer to not use memcpy on nontrivial types, but that's too complex for this
1644 patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
1646 * wtf/CheckedArithmetic.h:
1647 (WTF::Checked::Checked):
1648 * wtf/MetaAllocator.cpp:
1649 (WTF::MetaAllocator::allocate):
1650 * wtf/URLParser.cpp:
1651 (WTF::CodePointIterator::operator!= const):
1652 (WTF::CodePointIterator::operator=): Deleted.
1653 * wtf/text/StringView.h:
1654 (WTF::StringView::CodePoints::Iterator::operator=): Deleted.
1656 2019-03-19 Alex Christensen <achristensen@webkit.org>
1658 Make WTFLogChannelState and WTFLogLevel enum classes
1659 https://bugs.webkit.org/show_bug.cgi?id=195904
1661 Reviewed by Eric Carlson.
1663 * wtf/Assertions.cpp:
1666 (WTF::Logger::logAlways const):
1667 (WTF::Logger::error const):
1668 (WTF::Logger::warning const):
1669 (WTF::Logger::info const):
1670 (WTF::Logger::debug const):
1671 (WTF::Logger::willLog const):
1673 * wtf/MemoryPressureHandler.cpp:
1674 * wtf/RefCountedLeakCounter.cpp:
1676 2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
1678 Unreviewed, rolling out r243132.
1684 "Make WTFLogChannelState and WTFLogLevel enum classes"
1685 https://bugs.webkit.org/show_bug.cgi?id=195904
1686 https://trac.webkit.org/changeset/243132
1688 2019-03-18 Alex Christensen <achristensen@webkit.org>
1690 Make WTFLogChannelState and WTFLogLevel enum classes
1691 https://bugs.webkit.org/show_bug.cgi?id=195904
1693 Reviewed by Eric Carlson.
1695 * wtf/Assertions.cpp:
1698 (WTF::Logger::logAlways const):
1699 (WTF::Logger::error const):
1700 (WTF::Logger::warning const):
1701 (WTF::Logger::info const):
1702 (WTF::Logger::debug const):
1703 (WTF::Logger::willLog const):
1705 * wtf/MemoryPressureHandler.cpp:
1706 * wtf/RefCountedLeakCounter.cpp:
1708 2019-03-18 Darin Adler <darin@apple.com>
1710 Cut down on use of StringBuffer, possibly leading toward removing it entirely
1711 https://bugs.webkit.org/show_bug.cgi?id=195870
1713 Reviewed by Daniel Bates.
1715 * wtf/URL.cpp: Remove a now-inaccurate comment mentioning StringBuffer.
1717 * wtf/text/StringView.cpp:
1718 (WTF::convertASCIICase): Use createUninitialized instead of StringBuffer.
1720 2019-03-18 Xan Lopez <xan@igalia.com>
1722 [WTF] Remove redundant std::move in StringConcatenate
1723 https://bugs.webkit.org/show_bug.cgi?id=195798
1725 Reviewed by Darin Adler.
1727 Remove redundant calls to WTFMove in return values for this
1728 method. C++ will already do an implicit move here since we are
1729 returning a local value where copy/move elision is not applicable.
1731 * wtf/text/StringConcatenate.h:
1732 (WTF::tryMakeStringFromAdapters):
1734 2019-03-16 Darin Adler <darin@apple.com>
1736 Improve normalization code, including moving from unorm.h to unorm2.h
1737 https://bugs.webkit.org/show_bug.cgi?id=195330
1739 Reviewed by Michael Catanzaro.
1741 * wtf/URLHelpers.cpp: Removed unneeded include of unorm.h since the
1742 normalization code is now in StringView.cpp.
1743 (WTF::URLHelpers::escapeUnsafeCharacters): Renamed from
1744 createStringWithEscapedUnsafeCharacters since it now only creates
1745 a new string if one is needed. Use unsigned for string lengths, since
1746 that's what WTF::String uses, not size_t. Added a first loop so that
1747 we can return the string unmodified if no lookalike characters are
1748 found. Removed unnecessary round trip from UTF-16 and then back in
1749 the case where the character is not a lookalike.
1750 (WTF::URLHelpers::toNormalizationFormC): Deleted. Moved this logic
1751 into the WTF::normalizedNFC function in StringView.cpp.
1752 (WTF::URLHelpers::userVisibleURL): Call escapeUnsafeCharacters and
1753 normalizedNFC. The normalizedNFC function is better in multiple ways,
1754 but primarily it handles 8-bit strings and other already-normalized
1755 strings much more efficiently.
1757 * wtf/text/StringView.cpp:
1758 (WTF::normalizedNFC): Added. This has two overloads. One is for when
1759 we already have a String, and want to re-use it if no normalization
1760 is needed, and another is when we only have a StringView, and may need
1761 to allocate a String to hold the result. Includes a fast special case
1762 for 8-bit and already-normalized strings, and uses the same strategy
1763 that JSC::normalize was already using: calls unorm2_normalize twice,
1764 first just to determine the length.
1766 * wtf/text/StringView.h: Added normalizedNFC, which can be called with
1767 either a StringView or a String. Also moved StringViewWithUnderlyingString
1768 here from JSString.h, here for use as the return value of normalizedNFC;
1769 it is used for a similar purpose in the JavaScriptCore rope implementation.
1770 Also removed an inaccurate comment.
1772 2019-03-16 Diego Pino Garcia <dpino@igalia.com>
1774 [GTK] [WPE] Fix compilation errors due to undefined ALWAYS_LOG_IF
1775 https://bugs.webkit.org/show_bug.cgi?id=195850
1777 Unreviewed build fix after r243033.
1779 * wtf/LoggerHelper.h:
1781 2019-03-15 Per Arne Vollan <pvollan@apple.com>
1783 [iOS] Block the accessibility server when accessibility is not enabled.
1784 https://bugs.webkit.org/show_bug.cgi?id=195342
1786 Reviewed by Brent Fulgham.
1788 Add SPI to issue a mach extension to a process by pid. Also, add a macro for
1789 the availability of this SPI.
1792 * wtf/spi/darwin/SandboxSPI.h:
1794 2019-03-15 Eric Carlson <eric.carlson@apple.com>
1796 Add media stream release logging
1797 https://bugs.webkit.org/show_bug.cgi?id=195823
1799 Reviewed by Youenn Fablet.
1801 * wtf/LoggerHelper.h: Add LOG_IF variants that check a condition before logging.
1803 2019-03-15 Truitt Savell <tsavell@apple.com>
1805 Unreviewed, rolling out r243008.
1807 This revision broke High Sierra builders
1811 "[iOS] Block the accessibility server when accessibility is
1813 https://bugs.webkit.org/show_bug.cgi?id=195342
1814 https://trac.webkit.org/changeset/243008
1816 2019-03-15 Per Arne Vollan <pvollan@apple.com>
1818 [iOS] Block the accessibility server when accessibility is not enabled.
1819 https://bugs.webkit.org/show_bug.cgi?id=195342
1821 Reviewed by Brent Fulgham.
1823 Add SPI to issue a mach extension to a process by pid.
1825 * wtf/spi/darwin/SandboxSPI.h:
1827 2019-03-13 Sam Weinig <sam@webkit.org>
1829 Add utility function to allow easy reverse range-based iteration of a container
1830 https://bugs.webkit.org/show_bug.cgi?id=195542
1832 Reviewed by Antti Koivisto.
1834 Add functions to create an IteratorRange<T> that will iterate a container backwards. It
1835 works with any container that is compatible with std::rbegin() and std::rend(). It is
1836 expected to be used in conjunction with range-based for-loops like so:
1838 for (auto& value : WTF::makeReversedRange(myContainer))
1841 * wtf/IteratorRange.h:
1842 (WTF::makeReversedRange):
1844 2019-03-13 Keith Rollin <krollin@apple.com>
1846 Add support for new StagedFrameworks layout
1847 https://bugs.webkit.org/show_bug.cgi?id=195543
1849 Reviewed by Alexey Proskuryakov.
1851 Opportunistic cleanup: remove unused JAVASCRIPTCORE_FRAMEWORKS_DIR
1854 * Configurations/Base.xcconfig:
1856 2019-03-13 Dominik Infuehr <dinfuehr@igalia.com>
1858 String overflow when using StringBuilder in JSC::createError
1859 https://bugs.webkit.org/show_bug.cgi?id=194957
1861 Reviewed by Mark Lam.
1863 When calculating the new capacity of a StringBuilder object,
1864 use a limit of MaxLength instead of MaxLength+1. Allocating
1865 a string of size MaxLength+1 always fails. This means that expanding
1866 a StringBuilder only worked when the newly doubled capacity is less or
1869 * wtf/text/StringBuilder.cpp:
1871 2019-03-13 Chris Dumez <cdumez@apple.com>
1873 Better build fix after r242901.
1875 Reviewed by Jer Noble.
1878 (WTF::LogArgument::toString):
1880 2019-03-13 Jer Noble <jer.noble@apple.com>
1882 Add AggregateLogger, a Logger specialization for singleton classes.
1883 https://bugs.webkit.org/show_bug.cgi?id=195644
1885 Reviewed by Eric Carlson.
1887 Add a new class, AggregateLogger, which will log messages to each of its aggregated loggers.
1889 Drive-by fixes: allow "const void*" to be directly logged by converting the pointer to a hex string.
1891 * WTF.xcodeproj/project.pbxproj:
1892 * wtf/AggregateLogger.h: Added.
1893 (WTF::AggregateLogger::create):
1894 (WTF::AggregateLogger::addLogger):
1895 (WTF::AggregateLogger::removeLogger):
1896 (WTF::AggregateLogger::logAlways const):
1897 (WTF::AggregateLogger::error const):
1898 (WTF::AggregateLogger::warning const):
1899 (WTF::AggregateLogger::info const):
1900 (WTF::AggregateLogger::debug const):
1901 (WTF::AggregateLogger::willLog const):
1902 (WTF::AggregateLogger::AggregateLogger):
1903 (WTF::AggregateLogger::log const):
1909 2019-03-12 Commit Queue <commit-queue@webkit.org>
1911 Unreviewed, rolling out r242747.
1912 https://bugs.webkit.org/show_bug.cgi?id=195641
1914 Performance measurement is difficult in this period, rolling
1915 out it and rolling in later to isolate it from the other
1916 sensitive patches (Requested by yusukesuzuki on #webkit).
1920 "[JSC] Make StaticStringImpl & StaticSymbolImpl actually
1922 https://bugs.webkit.org/show_bug.cgi?id=194212
1923 https://trac.webkit.org/changeset/242747
1925 2019-03-12 Robin Morisset <rmorisset@apple.com>
1927 A lot more classes have padding that can be reduced by reordering their fields
1928 https://bugs.webkit.org/show_bug.cgi?id=195579
1930 Reviewed by Mark Lam.
1932 * wtf/CrossThreadQueue.h:
1934 * wtf/MemoryPressureHandler.h:
1935 * wtf/MetaAllocator.h:
1936 * wtf/Threading.cpp:
1938 2019-03-11 Alex Christensen <achristensen@webkit.org>
1940 WTF::Expected should use std::addressof instead of operator&
1941 https://bugs.webkit.org/show_bug.cgi?id=195604
1943 Reviewed by Myles Maxfield.
1945 The latter was causing problems with types that do tricky things with constructors and operator&,
1946 specifically UniqueRef but I made a reduced test case. When it used operator&, it would get the contained
1947 type and call the constructor that takes a contained type instead of the move constructor.
1950 (std::experimental::fundamentals_v3::__expected_detail::base::base):
1951 (std::experimental::fundamentals_v3::expected::swap):
1953 2019-03-11 Ross Kirsling <ross.kirsling@sony.com>
1955 Add Optional to Forward.h.
1956 https://bugs.webkit.org/show_bug.cgi?id=195586
1958 Reviewed by Darin Adler.
1961 Add forward declaration for Optional.
1966 * wtf/MemoryFootprint.h:
1967 * wtf/URLHelpers.cpp:
1969 * wtf/cocoa/CPUTimeCocoa.cpp:
1970 * wtf/fuchsia/CPUTimeFuchsia.cpp:
1971 * wtf/unix/CPUTimeUnix.cpp:
1972 * wtf/win/CPUTimeWin.cpp:
1973 Remove unnecessary includes from headers.
1975 2019-03-11 Andy Estes <aestes@apple.com>
1977 [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
1978 https://bugs.webkit.org/show_bug.cgi?id=195530
1979 <rdar://problem/48747164>
1981 Reviewed by Alex Christensen.
1983 * wtf/FeatureDefines.h: Defined ENABLE_APPLE_PAY_REMOTE_UI.
1985 2019-03-11 Yusuke Suzuki <ysuzuki@apple.com>
1987 [JSC] Make StaticStringImpl & StaticSymbolImpl actually static
1988 https://bugs.webkit.org/show_bug.cgi?id=194212
1990 Reviewed by Mark Lam.
1992 Avoid mutation onto refcounts if `isStatic()` returns true so that the content of StaticStringImpl never gets modified.
1994 * wtf/text/StringImpl.h:
1995 (WTF::StringImpl::ref):
1996 (WTF::StringImpl::deref):
1998 2019-03-11 Sihui Liu <sihui_liu@apple.com>
2000 Crash under WebCore::IDBDatabase::connectionToServerLost
2001 https://bugs.webkit.org/show_bug.cgi?id=195563
2002 <rdar://problem/37193655>
2004 CrossThreadTask should protect callee if it is ThreadSafeRefCounted.
2006 Reviewed by Geoffrey Garen.
2008 * wtf/CrossThreadTask.h:
2009 (WTF::createCrossThreadTask):
2011 2019-03-11 Ryan Haddad <ryanhaddad@apple.com>
2013 Unreviewed, rolling out r242688, r242643, r242624.
2015 Caused multiple layout test failures and crashes on iOS and macOS.
2019 "requestAnimationFrame should execute before the next frame"
2020 https://bugs.webkit.org/show_bug.cgi?id=177484
2021 https://trac.webkit.org/changeset/242624/webkit
2023 * wtf/SystemTracing.h:
2025 2019-03-11 Darin Adler <darin@apple.com>
2027 Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
2028 https://bugs.webkit.org/show_bug.cgi?id=195533
2030 Reviewed by Brent Fulgham.
2032 Soon, we will change String::number and StringBuilder::appendNumber for floating
2033 point to use "shortest form" serialization instead of the current default, which is
2034 "6-digit fixed precision stripping trailing zeros". To prepare to do this safely
2035 without accidentally changing any behavior, changing callers to call the explicit
2036 versions. Later, we may want to return and change many of them to use shortest form
2037 instead, but that may require rebaselining tests, and in some extreme cases, getting
2038 rid of flawed logic that converts between different single and double precision
2039 floating point; such problems may be hidden by fixed precision serialization.
2041 Since "shortest form" is already the behavior for AtomicString::number and
2042 for makeString, no changes required for clients of either of those.
2045 (WTF::LogArgument::toString): Use numberToStringFixedPrecision.
2046 * wtf/MediaTime.cpp:
2047 (WTF::MediaTime::toString const): Use appendFixedPrecisionNumber.
2048 * wtf/text/ValueToString.h:
2049 (WTF::ValueToString<float>::string): Use numberToStringFixedPrecision.
2050 (WTF::ValueToString<double>::string): Ditto.
2052 2019-03-11 Truitt Savell <tsavell@apple.com>
2054 Unreviewed, rolling out r242702.
2056 Broke High Sierra builders.
2060 "Add utility function to allow easy reverse range-based
2061 iteration of a container"
2062 https://bugs.webkit.org/show_bug.cgi?id=195542
2063 https://trac.webkit.org/changeset/242702
2065 2019-03-11 Sam Weinig <sam@webkit.org>
2067 Add utility function to allow easy reverse range-based iteration of a container
2068 https://bugs.webkit.org/show_bug.cgi?id=195542
2070 Reviewed by Antti Koivisto.
2072 Add functions to create an IteratorRange<T> that will iterate a container backwards. It
2073 works with any container that is compatible with std::rbegin() and std::rend(). It is
2074 expected to be used in conjunction with range-based for-loops like so:
2076 for (auto& value : WTF::makeReversedRange(myContainer))
2079 * wtf/IteratorRange.h:
2080 (WTF::makeReversedRange):
2082 2019-03-10 Yusuke Suzuki <utatane.tea@gmail.com> and Fujii Hironori <Hironori.Fujii@sony.com>
2084 [WTF] Align assumption in RunLoopWin to the other platform's RunLoop
2085 https://bugs.webkit.org/show_bug.cgi?id=181151
2087 Reviewed by Don Olmstead.
2089 This patch fixes RunLoop in Windows to align it to the implementations in the other platforms
2090 to use RunLoop more aggressively.
2093 (WTF::RunLoop::Timer::Timer):
2094 * wtf/win/MainThreadWin.cpp:
2095 (initializeMainThreadPlatform): Call RunLoop::registerRunLoopMessageWindowClass.
2096 * wtf/win/RunLoopWin.cpp:
2097 (WTF::RunLoop::wndProc):
2098 (WTF::RunLoop::iterate):
2099 (WTF::RunLoop::stop):
2100 PostQuitMessage is only available in the RunLoop's thread. We should post a message and call
2101 it inside this task.
2103 (WTF::RunLoop::registerRunLoopMessageWindowClass):
2104 Changed the return type from bool to void, and added RELEASE_ASSERT to check the return value of RegisterClass.
2106 (WTF::RunLoop::~RunLoop):
2107 When the RunLoop's thread is freed, its associated window is freed. We do not need to do here.
2109 (WTF::RunLoop::TimerBase::timerFired):
2110 (WTF::RunLoop::TimerBase::TimerBase):
2111 (WTF::RunLoop::TimerBase::start):
2112 (WTF::RunLoop::TimerBase::stop):
2113 (WTF::RunLoop::TimerBase::isActive const):
2114 (WTF::RunLoop::TimerBase::secondsUntilFire const):
2115 (WTF::generateTimerID): Deleted.
2116 We can use TimerBase's pointer as ID since it is uintptr_t.
2118 2019-03-07 Said Abou-Hallawa <sabouhallawa@apple.com>
2120 requestAnimationFrame should execute before the next frame
2121 https://bugs.webkit.org/show_bug.cgi?id=177484
2123 Reviewed by Simon Fraser.
2125 Add trace points for the page RenderingUpdate.
2127 * wtf/SystemTracing.h:
2129 2019-03-06 Ross Kirsling <ross.kirsling@sony.com>
2131 [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
2132 https://bugs.webkit.org/show_bug.cgi?id=195346
2134 Reviewed by Fujii Hironori.
2136 * wtf/PlatformWin.cmake:
2137 * wtf/text/AtomicString.h:
2138 (WTF::AtomicString::AtomicString):
2139 * wtf/text/WTFString.h:
2140 (WTF::String::String):
2141 * wtf/text/win/StringWin.cpp: Added.
2142 (WTF::String::wideCharacters const): Renamed from WTF::stringToNullTerminatedWChar.
2143 * wtf/text/win/WCharStringExtras.h:
2146 (WTF::stringToNullTerminatedWChar): Deleted.
2147 (WTF::wcharToString): Deleted.
2148 (WTF::nullTerminatedWCharToString): Deleted.
2149 Add static_assert-guarded reinterpret_cast wrappers for going between UChar* and wchar_t*.
2150 Move existing to/from-String helpers into the String (and AtomicString) class(es).
2152 * wtf/win/FileSystemWin.cpp:
2153 (WTF::FileSystemImpl::getFindData):
2154 (WTF::FileSystemImpl::getFinalPathName):
2155 (WTF::FileSystemImpl::createSymbolicLink):
2156 (WTF::FileSystemImpl::deleteFile):
2157 (WTF::FileSystemImpl::deleteEmptyDirectory):
2158 (WTF::FileSystemImpl::moveFile):
2159 (WTF::FileSystemImpl::pathByAppendingComponent):
2160 (WTF::FileSystemImpl::fileSystemRepresentation):
2161 (WTF::FileSystemImpl::makeAllDirectories):
2162 (WTF::FileSystemImpl::pathGetFileName):
2163 (WTF::FileSystemImpl::storageDirectory):
2164 (WTF::FileSystemImpl::generateTemporaryPath):
2165 (WTF::FileSystemImpl::openTemporaryFile):
2166 (WTF::FileSystemImpl::openFile):
2167 (WTF::FileSystemImpl::hardLinkOrCopyFile):
2168 (WTF::FileSystemImpl::deleteNonEmptyDirectory):
2169 * wtf/win/LanguageWin.cpp:
2171 * wtf/win/PathWalker.cpp:
2172 (WTF::PathWalker::PathWalker):
2173 Use wchar helpers as needed.
2175 2019-02-28 Ryosuke Niwa <rniwa@webkit.org>
2178 https://bugs.webkit.org/show_bug.cgi?id=195152
2180 Reviewed by Antti Koivisto.
2182 Added WeakHashSet which is a HashSet of WeakPtr. When the object pointed by WeakPtr is deleted,
2183 WeakHashSet treats the key to be no longer in the set. That is, WeakHashSet::contains returns false
2184 and const_iterator skips such a WeakPtr in the set.
2186 We decided not to make HashSet<WeahPtr<T>> work because it involves weird semantics such as making
2187 find(X) delete the table entry as remove(find(X)) would be a no-op otherwise as find(X) would return
2188 necessarily need to return HashSet<WeakPtr<T>>::end().
2190 Furthermore, we cannot determine the true size of this set in O(1) because the objected pointed by
2191 some of WeakPtr in the set may have already been deleted. This has implications that we can't have
2192 size(), isEmpty(), random(), etc... as O(1) operation.
2194 WeakHashSet is implemented as HashSet<WeakReference<T>>. HashTable::rehash has been updated to delete
2195 WeakReference<T>'s whose m_ptr has become null, and HashTable::expand first deletes any such entry
2196 before deciding an actual expansion is needed. This is accomplished via newly added hash trait,
2197 hasIsReleasedWeakValueFunction, and HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue which
2198 returns true for when WeakReference<T> pointed by Ref<WeakReference<T>> has null m_ptr, not to be
2199 confused with Ref<WeakReference<T>> itself pointing to a null WeakReference<T>.
2201 * WTF.xcodeproj/project.pbxproj:
2202 * wtf/CMakeLists.txt:
2205 (WTF::HashSet<T, U, V>::checkConsistency const): Added.
2207 (WTF::HashTable::isReleasedWeakBucket): Added.
2208 (WTF::HashTable::expand): Delete WeakReference<T> with null m_ptr first. This updates m_keyCount
2209 and may make mustRehashInPlace() return true.
2210 (WTF::HashTable::deleteReleasedWeakBuckets): Added.
2211 (WTF::HashTable::rehash): Delete WeakReference<T> with null m_ptr. Also refactored the code a bit
2212 to avoid keep repeating oldTable[i].
2214 (WTF::HashTraits<T>::isHashTraitsReleasedWeakValue): Added.
2215 (WTF::RefHashTraits<T>): Extracted from HashTraits<Ref<P>> to share code with
2216 HashTraits<Ref<WeakReference<T>>>.
2217 (WTF::HashTraitsReleasedWeakValueChecker<Traits, hasIsReleasedWeakValueFunction>): Added.
2218 (WTF::isHashTraitsReleasedWeakValue<Traits, hasIsReleasedWeakValueFunction>): Added.
2219 * wtf/WeakHashSet.h: Added.
2220 (WTF::WeakHashSet): Added.
2221 (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator):
2222 (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
2223 (WTF::WeakHashSet::WeakHashSetConstIterator::operator* const):
2224 (WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const):
2225 (WTF::WeakHashSet::WeakHashSetConstIterator::operator++):
2226 (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
2227 (WTF::WeakHashSet::WeakHashSetConstIterator::operator== const):
2228 (WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const):
2229 (WTF::WeakHashSet::WeakHashSet):
2230 (WTF::WeakHashSet::begin const):
2231 (WTF::WeakHashSet::end const):
2232 (WTF::WeakHashSet::add):
2233 (WTF::WeakHashSet::remove):
2234 (WTF::WeakHashSet::contains const):
2235 (WTF::WeakHashSet::capacity const):
2236 (WTF::WeakHashSet::computeSize const): Deletes any WeakReference<T> with null m_ptr first.
2237 (WTF::WeakHashSet::checkConsistency const):
2238 (WTF::HashTraits<Ref<WeakReference<T>>>): Added. This hash traits triggers the new code in HashTable's
2239 expand and rehash methods to delete WeakReference<T> with null m_ptr.
2240 (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue):
2242 (WTF::WeakReference::~WeakReference): Added so that we can keep track the number of live WeakReference
2243 in API tests by template specializations.
2245 2019-03-03 Darin Adler <darin@apple.com>
2247 Prepare to improve handling of conversion of float to strings
2248 https://bugs.webkit.org/show_bug.cgi?id=195262
2250 Reviewed by Daniel Bates.
2253 (WTF::truncateTrailingZeros): Renamed from
2254 formatStringTruncatingTrailingZerosIfNeeded and removed the calls
2255 to double_conversion::StringBuilder::Finalizer, since the caller
2257 (WTF::numberToFixedPrecisionString): Added an overload for float
2258 and updated to use the new truncateTrailingZeros.
2259 (WTF::numberToFixedWidthString): Added an overload for float.
2261 * wtf/text/AtomicString.cpp:
2262 (WTF::AtomicString::number): Added float overload. This is a
2263 behavior change, but in all cases for the better. The old behavior
2264 was to convert to double first and then do "shortest form"
2265 conversion, and it's always better to just do that as float.
2266 * wtf/text/AtomicString.h: Added float overload of AtomicString::number.
2268 * wtf/text/StringBuilder.cpp:
2269 (WTF::StringBuilder::appendFixedPrecisionNumber): Added float
2271 (WTF::StringBuilder::appendShortestFormNumber): Renamed from
2272 appendECMAScriptNumber and did the above.
2273 (WTF::StringBuilder::appendFixedWidthNumber): Ditto.
2274 * wtf/text/StringBuilder.h: Added overloads for float and
2275 appendShortestFormNumber. The appendNumber and appendECMAScriptNumber
2276 functions are now inlines in the header, since they are expressed
2277 entirely in terms of the other functions.
2279 * wtf/text/WTFString.cpp:
2280 (WTF::String::numberToStringFixedPrecision): Added float overload.
2281 Removed unnecessary explicit conversion to String.
2282 (WTF::String::numberToStringShortest): Renamed from
2283 numberToStringECMAScript and did the above.
2284 (WTF::String::numberToStringFixedWidth): Ditto.
2286 * wtf/text/WTFString.h: Added overloads for float and
2287 numberToStringShortest. The number and numberToStringECMAScript
2288 functions are now inlines in the header, since they are expressed
2289 entirely in terms of the other functions.
2291 2019-03-04 Andy Estes <aestes@apple.com>
2293 [Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
2294 https://bugs.webkit.org/show_bug.cgi?id=195080
2295 <rdar://problem/48421558>
2297 Reviewed by Antti Koivisto.
2299 * wtf/FeatureDefines.h:
2301 2019-03-04 Michael Catanzaro <mcatanzaro@igalia.com>
2303 URLHelpers should use unorm2_quickCheck before converting to NFC
2304 https://bugs.webkit.org/show_bug.cgi?id=194272
2306 Reviewed by Darin Adler.
2308 If the string is already in normalization form C, don't try to normalize it.
2310 * wtf/URLHelpers.cpp:
2311 (WTF::URLHelpers::toNormalizationFormC):
2313 2019-03-02 Darin Adler <darin@apple.com>
2315 Retire legacy dtoa function and DecimalNumber class
2316 https://bugs.webkit.org/show_bug.cgi?id=195253
2318 Reviewed by Daniel Bates.
2320 * WTF.xcodeproj/project.pbxproj: Removed DecimalNumber.cpp/h.
2321 * wtf/CMakeLists.txt: Ditto.
2323 * wtf/DecimalNumber.cpp: Removed.
2324 * wtf/DecimalNumber.h: Removed.
2326 * wtf/JSONValues.cpp:
2327 (WTF::JSONImpl::Value::writeJSON const): Use
2328 StringBuilder::appendECMAScriptNumber instead of custom logic
2329 using the DecimalNumber class.
2332 (WTF::storeInc): Deleted.
2333 (WTF::BigInt): Deleted.
2334 (WTF::multadd): Deleted.
2335 (WTF::hi0bits): Deleted.
2336 (WTF::lo0bits): Deleted.
2337 (WTF::i2b): Deleted.
2338 (WTF::mult): Deleted.
2339 (WTF::P5Node::P5Node): Deleted.
2340 (WTF::pow5mult): Deleted.
2341 (WTF::lshift): Deleted.
2342 (WTF::cmp): Deleted.
2343 (WTF::diff): Deleted.
2344 (WTF::d2b): Deleted.
2345 (WTF::quorem): Deleted.
2346 (WTF::dtoa): Deleted.
2348 * wtf/dtoa.h: Removed DtoaBuffer, dtoa, and NumberToStringBufferLength.
2350 2019-02-27 Darin Adler <darin@apple.com>
2352 Fixed makeString(float) to do shortest-form serialization without first converting to double
2353 https://bugs.webkit.org/show_bug.cgi?id=195142
2355 Reviewed by Daniel Bates.
2357 * wtf/DecimalNumber.cpp: Removed unneeded includes.
2359 * wtf/DecimalNumber.h: Removed unused constructors; over time we will be
2360 deprecating DecimalNumber, so we should removed the unused parts. Also
2361 marked the constructor explicit, removed types used only for arguments for
2362 the constructors, and removed the sign, exponent, significand, and precision
2365 * wtf/JSONValues.cpp:
2366 (WTF::JSONImpl::Value::writeJSON const): Updated for changes to DecimalNumber
2367 switched from NumberToLStringBuffer to NumberToStringBuffer, and for use of
2368 std::array instead of C arrays.
2370 * wtf/dtoa.cpp: Removed unused dtoaRoundSF and dtoaRoundDP functions.
2371 (WTF::dtoa): Updated to use std::array instead of C arrays.
2372 (WTF::dtoaRoundSF): Removed.
2373 (WTF::dtoaRoundDP): Removed.
2374 (WTF::numberToString): Added an overload for float and updated to use std::array.
2375 (WTF::formatStringTruncatingTrailingZerosIfNeeded): Updated to use std::array.
2376 (WTF::numberToFixedPrecisionString): Ditto.
2377 (WTF::numberToFixedWidthString): Ditto.
2379 * wtf/dtoa.h: Changed arrays to be std::array instead of C arrays so the
2380 array types will be checked. Removed dtoaRoundSF and dtoaRoundDP.
2381 Added float overloads for numberToString, numberToFixedPrecisionString,
2382 and numberToFixedWidthString. The only one of these that is called at this
2383 time is numberToString, called by the floating point StringTypeAdapter in
2384 StringConcatenateNummbers.h.
2386 * wtf/text/StringConcatenateNumbers.h: Updated for std::array.
2388 2019-03-01 Darin Adler <darin@apple.com>
2390 Finish removing String::format
2391 https://bugs.webkit.org/show_bug.cgi?id=194893
2393 Reviewed by Daniel Bates.
2395 * wtf/Assertions.cpp:
2396 (WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
2397 (WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.
2399 * wtf/HexNumber.h: Deleted unneeded toString function.
2401 * wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
2402 StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
2403 a bit. Use function templates for writeTo functions rather than having two of each.
2404 Removed unused toString functions. Optimized case where we use have a UChar* and
2405 a length of zero to not force the result to be 16-bit. Also gets rid of a small
2406 NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
2407 static member helper functions to compute string lengths. Added the pad function
2408 and the PaddingSpecification struct template, so we can add padding to anything
2409 we can turn into a string. Got rid of the special case overload for single
2410 arguments, since it only worked for things that the String constructor can handle.
2411 Instead we will now use StringTypeAdapter, which works for more types. Possibly
2412 less optimal for some special cases, which we could specialize for later if we like.
2413 * wtf/text/StringConcatenateNumbers.h: Ditto.
2414 * wtf/text/StringOperators.h: Ditto.
2415 * wtf/text/StringView.h: Ditto.
2417 * wtf/text/WTFString.cpp:
2418 (WTF::createWithFormatAndArguments): Deleted.
2419 (WTF::String::format): Deleted.
2420 * wtf/text/WTFString.h: Deleted declaration of String::format.
2422 2019-03-01 Alex Christensen <achristensen@webkit.org>
2424 Revert r241223, r241235, and r241287
2425 https://bugs.webkit.org/show_bug.cgi?id=194427
2428 * wtf/spi/darwin/XPCSPI.h:
2430 2019-03-01 Simon Fraser <simon.fraser@apple.com>
2432 Add a system trace scope for event region building
2433 https://bugs.webkit.org/show_bug.cgi?id=195226
2435 Reviewed by Jon Lee.
2437 This trace scope measures the time spend converting element rects into Region objects,
2438 which can be large on some pages.
2440 The value for "Display Refresh Dispatch to main thread" was wrong and I fixed it.
2442 * wtf/SystemTracing.h:
2444 2019-02-28 Yusuke Suzuki <ysuzuki@apple.com>
2446 [JSC] sizeof(JSString) should be 16
2447 https://bugs.webkit.org/show_bug.cgi?id=194375
2449 Reviewed by Saam Barati.
2451 * wtf/text/StringImpl.h:
2452 (WTF::StringImpl::flagIs8Bit):
2453 (WTF::StringImpl::flagIsAtomic):
2454 (WTF::StringImpl::flagIsSymbol):
2455 (WTF::StringImpl::maskStringKind):
2456 * wtf/text/WTFString.cpp:
2458 * wtf/text/WTFString.h:
2460 2019-02-28 Mark Lam <mark.lam@apple.com>
2462 Change CheckedArithmetic to not use std::enable_if_t.
2463 https://bugs.webkit.org/show_bug.cgi?id=195187
2464 <rdar://problem/48464665>
2466 Reviewed by Keith Miller.
2468 Because C++11 does not like std::enable_if_t and there's a need to use this file with C++11.
2470 * wtf/CheckedArithmetic.h:
2472 2019-02-27 Simon Fraser <simon.fraser@apple.com>
2474 Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
2476 * wtf/Assertions.cpp:
2477 (WTF::createWithFormatAndArguments): Deleted.
2479 (WTF::StringTypeAdapter<HexNumberBuffer>::toString const):
2480 * wtf/text/StringConcatenate.h:
2482 (WTF::pad): Deleted.
2483 (WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::StringTypeAdapter): Deleted.
2484 (WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::length const): Deleted.
2485 (WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::is8Bit const): Deleted.
2486 (WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::writeTo const): Deleted.
2487 * wtf/text/StringConcatenateNumbers.h:
2488 (WTF::FormattedNumber::fixedPrecision):
2489 (WTF::FormattedNumber::fixedWidth):
2490 (WTF::StringTypeAdapter<FormattedNumber>::toString const):
2491 * wtf/text/StringOperators.h:
2492 (WTF::StringAppend::StringAppend):
2493 * wtf/text/StringView.h:
2494 (WTF::StringView::invalidate):
2495 * wtf/text/WTFString.cpp:
2496 (WTF::createWithFormatAndArguments):
2497 (WTF::String::format):
2498 * wtf/text/WTFString.h:
2500 2019-02-26 Mark Lam <mark.lam@apple.com>
2502 Remove remaining poisoning code.
2503 https://bugs.webkit.org/show_bug.cgi?id=194138
2505 Reviewed by Saam Barati.
2507 This patch removes the instantiation of Poisoned variants of the various containers
2508 but retains the ability of those containers to work with pointer traits. This
2509 allows us to use them with smart pointers in the future (just like we used to with
2510 Poisoned values). At minimum, this ability will be useful when we want to insert
2511 an observer into the container storage type for debugging purposes, or to collect
2512 statistics for profiling.
2514 * WTF.xcodeproj/project.pbxproj:
2516 * wtf/CMakeLists.txt:
2518 * wtf/Poisoned.cpp: Removed.
2519 * wtf/Poisoned.h: Removed.
2520 * wtf/PoisonedUniquePtr.h: Removed.
2522 * wtf/RefCountedArray.h:
2524 * wtf/WTFAssertions.cpp:
2526 2019-02-26 Keith Miller <keith_miller@apple.com>
2528 Code quality cleanup in NeverDestroyed
2529 https://bugs.webkit.org/show_bug.cgi?id=194824
2531 Reviewed by Yusuke Suzuki.
2533 First, move data members to the end of the class per WebKit
2534 style. Also, add forbid heap allocation since we expect the
2535 NeverDestroyed classes to be static.
2537 * wtf/NeverDestroyed.h:
2539 2019-02-25 Xabier Rodriguez Calvar <calvaris@igalia.com>
2541 Fix WTFLogVerbose variadic parameters forwarding
2542 https://bugs.webkit.org/show_bug.cgi?id=194920
2544 Reviewed by Alex Christensen.
2546 WTFLogVerbose was passing the va_list to WTFLog but this function
2547 also used variadic parameters and this is not allowed in C (that
2548 part of the code is extern "C").
2550 * wtf/Assertions.cpp:
2551 (WTF::WTFLogVaList): Created to take a va_list argument instead of
2552 variadic parameters.
2553 (WTF::WTFLog): Kept with variadic parameters, which are
2554 transformed to va_list and passed to WTFLogVaList.
2555 (WTF::WTFLogVerbose): Use WTFLogVaList instead of WTFLog.
2557 2019-02-25 Sam Weinig <sam@webkit.org>
2559 Update double-conversion to the latest version
2560 https://bugs.webkit.org/show_bug.cgi?id=194994
2562 Import the latest version of the double-conversion library based on
2563 https://github.com/google/double-conversion/commit/990c44707c70832dc1ce1578048c2198bafd3307
2565 In additon to importing the code, the following changes were applied (or re-applied) to maintain
2566 parity with what we had previously:
2567 - Add #include "config.h" to each cpp file.
2568 - Put everything inside the WTF namespace.
2569 - Changed all in library includes to be of the form #include <wtf/dtoa/FILE.h>.
2570 - Renamed double_conversion::Vector<> to double_conversion::BufferReference<>.
2571 - Replaced duplicated functions with ASCIICType.h variants
2572 - Made CachedPower table a constexpr.
2573 - Exported (via WTF_EXPORT_PRIVATE) several functions in double-conversion.h.
2574 - Made substantial changes to StringToDoubleConverter to avoid unnecessary overhead of
2575 parameterization, as we only ever want one configuration. Instead of constructing a
2576 configured class and calling StringToDouble on it, StringToDouble is now a static
2577 function. This allows a bunch of now dead code (hex support, octal support, etc.) to
2578 be eliminated. As StringToDoubleConverter now supports single precision floats, some
2579 additional templating of StringToIeee was added to avoid extra unnecessary branching.
2580 - Added RemoveCharacters function to double_conversion::StringBuilder.
2582 Reviewed by Darin Adler.
2584 * WTF.xcodeproj/project.pbxproj:
2585 * wtf/CMakeLists.txt:
2586 * wtf/dtoa/AUTHORS: Added.
2587 * wtf/dtoa/README: Removed.
2588 * wtf/dtoa/README.md: Added.
2589 * wtf/dtoa/bignum-dtoa.cc:
2590 * wtf/dtoa/bignum-dtoa.h:
2591 * wtf/dtoa/bignum.cc:
2592 * wtf/dtoa/bignum.h:
2593 (WTF::double_conversion::Bignum::Times10):
2594 (WTF::double_conversion::Bignum::Equal):
2595 (WTF::double_conversion::Bignum::LessEqual):
2596 (WTF::double_conversion::Bignum::Less):
2597 (WTF::double_conversion::Bignum::PlusEqual):
2598 (WTF::double_conversion::Bignum::PlusLessEqual):
2599 (WTF::double_conversion::Bignum::PlusLess):
2600 (WTF::double_conversion::Bignum::EnsureCapacity):
2601 (WTF::double_conversion::Bignum::BigitLength const):
2602 * wtf/dtoa/cached-powers.cc:
2603 * wtf/dtoa/cached-powers.h:
2604 * wtf/dtoa/diy-fp.cc:
2605 * wtf/dtoa/diy-fp.h:
2606 (WTF::double_conversion::DiyFp::DiyFp):
2607 (WTF::double_conversion::DiyFp::Subtract):
2608 (WTF::double_conversion::DiyFp::Minus):
2609 (WTF::double_conversion::DiyFp::Times):
2610 (WTF::double_conversion::DiyFp::Normalize):
2611 (WTF::double_conversion::DiyFp::f const):
2612 (WTF::double_conversion::DiyFp::e const):
2613 (WTF::double_conversion::DiyFp::set_f):
2614 (WTF::double_conversion::DiyFp::set_e):
2615 * wtf/dtoa/double-conversion.cc:
2616 * wtf/dtoa/double-conversion.h:
2617 (WTF::double_conversion::DoubleToStringConverter::DoubleToStringConverter):
2618 (WTF::double_conversion::DoubleToStringConverter::ToShortest const):
2619 (WTF::double_conversion::DoubleToStringConverter::ToShortestSingle const):
2620 (WTF::double_conversion::StringToDoubleConverter::StringToDoubleConverter):
2621 * wtf/dtoa/double.h: Removed.
2622 * wtf/dtoa/fast-dtoa.cc:
2623 * wtf/dtoa/fast-dtoa.h:
2624 * wtf/dtoa/fixed-dtoa.cc:
2625 * wtf/dtoa/fixed-dtoa.h:
2626 * wtf/dtoa/ieee.h: Added.
2627 (WTF::double_conversion::double_to_uint64):
2628 (WTF::double_conversion::uint64_to_double):
2629 (WTF::double_conversion::float_to_uint32):
2630 (WTF::double_conversion::uint32_to_float):
2631 (WTF::double_conversion::Double::Double):
2632 (WTF::double_conversion::Double::AsDiyFp const):
2633 (WTF::double_conversion::Double::AsNormalizedDiyFp const):
2634 (WTF::double_conversion::Double::AsUint64 const):
2635 (WTF::double_conversion::Double::NextDouble const):
2636 (WTF::double_conversion::Double::PreviousDouble const):
2637 (WTF::double_conversion::Double::Exponent const):
2638 (WTF::double_conversion::Double::Significand const):
2639 (WTF::double_conversion::Double::IsDenormal const):
2640 (WTF::double_conversion::Double::IsSpecial const):
2641 (WTF::double_conversion::Double::IsNan const):
2642 (WTF::double_conversion::Double::IsInfinite const):
2643 (WTF::double_conversion::Double::Sign const):
2644 (WTF::double_conversion::Double::UpperBoundary const):
2645 (WTF::double_conversion::Double::NormalizedBoundaries const):
2646 (WTF::double_conversion::Double::LowerBoundaryIsCloser const):
2647 (WTF::double_conversion::Double::value const):
2648 (WTF::double_conversion::Double::SignificandSizeForOrderOfMagnitude):
2649 (WTF::double_conversion::Double::Infinity):
2650 (WTF::double_conversion::Double::NaN):
2651 (WTF::double_conversion::Double::DiyFpToUint64):
2652 (WTF::double_conversion::Single::Single):
2653 (WTF::double_conversion::Single::AsDiyFp const):
2654 (WTF::double_conversion::Single::AsUint32 const):
2655 (WTF::double_conversion::Single::Exponent const):
2656 (WTF::double_conversion::Single::Significand const):
2657 (WTF::double_conversion::Single::IsDenormal const):
2658 (WTF::double_conversion::Single::IsSpecial const):
2659 (WTF::double_conversion::Single::IsNan const):
2660 (WTF::double_conversion::Single::IsInfinite const):
2661 (WTF::double_conversion::Single::Sign const):
2662 (WTF::double_conversion::Single::NormalizedBoundaries const):
2663 (WTF::double_conversion::Single::UpperBoundary const):
2664 (WTF::double_conversion::Single::LowerBoundaryIsCloser const):
2665 (WTF::double_conversion::Single::value const):
2666 (WTF::double_conversion::Single::Infinity):
2667 (WTF::double_conversion::Single::NaN):
2668 * wtf/dtoa/strtod.cc:
2669 * wtf/dtoa/strtod.h:
2672 (WTF::double_conversion::Max):
2673 (WTF::double_conversion::Min):
2674 (WTF::double_conversion::StrLength):
2675 (WTF::double_conversion::BufferReference::BufferReference):
2676 (WTF::double_conversion::BufferReference::SubVector):
2677 (WTF::double_conversion::BufferReference::length const):
2678 (WTF::double_conversion::BufferReference::is_empty const):
2679 (WTF::double_conversion::BufferReference::start const):
2680 (WTF::double_conversion::BufferReference::operator[] const):
2681 (WTF::double_conversion::BufferReference::first):
2682 (WTF::double_conversion::BufferReference::last):
2683 (WTF::double_conversion::StringBuilder::StringBuilder):
2684 (WTF::double_conversion::StringBuilder::~StringBuilder):
2685 (WTF::double_conversion::StringBuilder::size const):
2686 (WTF::double_conversion::StringBuilder::position const):
2687 (WTF::double_conversion::StringBuilder::Reset):
2688 (WTF::double_conversion::StringBuilder::AddCharacter):
2689 (WTF::double_conversion::StringBuilder::AddString):
2690 (WTF::double_conversion::StringBuilder::AddSubstring):
2691 (WTF::double_conversion::StringBuilder::AddPadding):
2692 (WTF::double_conversion::StringBuilder::RemoveCharacters):
2693 (WTF::double_conversion::StringBuilder::Finalize):
2694 (WTF::double_conversion::StringBuilder::is_finalized const):
2695 (WTF::double_conversion::BitCast):
2696 (WTF::double_conversion::BufferReference::SubBufferReference): Deleted.
2697 (WTF::double_conversion::StringBuilder::SetPosition): Deleted.
2699 2019-02-20 Darin Adler <darin@apple.com>
2701 Finish removing String::format
2702 https://bugs.webkit.org/show_bug.cgi?id=194893
2704 Reviewed by Daniel Bates.
2706 * wtf/Assertions.cpp:
2707 (WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
2708 (WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.
2710 * wtf/HexNumber.h: Deleted unneeded toString function.
2712 * wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
2713 StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
2714 a bit. Use function templates for writeTo functions rather than having two of each.
2715 Removed unused toString functions. Optimized case where we use have a UChar* and
2716 a length of zero to not force the result to be 16-bit. Also gets rid of a small
2717 NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
2718 static member helper functions to compute string lengths. Added the pad function
2719 and the PaddingSpecification struct template, so we can add padding to anything
2720 we can turn into a string. Got rid of the special case overload for single
2721 arguments, since it only worked for things that the String constructor can handle.
2722 Instead we will now use StringTypeAdapter, which works for more types. Possibly
2723 less optimal for some special cases, which we could specialize for later if we like.
2724 * wtf/text/StringConcatenateNumbers.h: Ditto.
2725 * wtf/text/StringOperators.h: Ditto.
2726 * wtf/text/StringView.h: Ditto.
2728 * wtf/text/WTFString.cpp:
2729 (WTF::createWithFormatAndArguments): Deleted.
2730 (WTF::String::format): Deleted.
2731 * wtf/text/WTFString.h: Deleted declaration of String::format.
2733 2019-02-23 Michael Catanzaro <mcatanzaro@igalia.com>
2735 Unreviewed, fix find/replace error from r232178
2737 Looks like this was the only such error in that commit.
2739 * wtf/URLHelpers.cpp:
2740 (WTF::URLHelpers::isLookalikeCharacter):
2742 2019-02-23 Mark Lam <mark.lam@apple.com>
2744 Add an exception check and some assertions in StringPrototype.cpp.
2745 https://bugs.webkit.org/show_bug.cgi?id=194962
2746 <rdar://problem/48013416>
2748 Reviewed by Yusuke Suzuki and Saam Barati.
2750 Add an AssertNoOverflow overflow handler which allows us to do CheckedArithmetic
2751 for assertion purpose only on debug builds but sacrifices no performance on
2754 * wtf/CheckedArithmetic.h:
2755 (WTF::AssertNoOverflow::overflowed):
2756 (WTF::AssertNoOverflow::clearOverflow):
2757 (WTF::AssertNoOverflow::crash):
2758 (WTF::AssertNoOverflow::hasOverflowed const):
2759 (WTF::observesOverflow):
2760 (WTF::observesOverflow<AssertNoOverflow>):
2763 (WTF::safeMultiply):
2764 (WTF::Checked::operator+=):
2765 (WTF::Checked::operator-=):
2766 (WTF::Checked::operator*=):
2771 2019-02-23 Keith Miller <keith_miller@apple.com>
2773 Add new mac target numbers
2774 https://bugs.webkit.org/show_bug.cgi?id=194955
2776 Reviewed by Tim Horton.
2778 * Configurations/Base.xcconfig:
2779 * Configurations/DebugRelease.xcconfig:
2781 2019-02-21 Antoine Quint <graouts@apple.com>
2783 Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
2784 https://bugs.webkit.org/show_bug.cgi?id=194531
2785 <rdar://problem/47714562>
2787 Reviewed by Tim Horton.
2789 Follow-up commit to ensure this SPI is only called on newer versions of iOS.
2793 2019-02-21 Dean Jackson <dino@apple.com>
2795 Rotation animations sometimes use the wrong origin (affects apple.com)
2796 https://bugs.webkit.org/show_bug.cgi?id=194878
2797 <rdar://problem/43908047>
2799 Follow-up commit to ensure this change only affects newer versions
2802 * wtf/Platform.h: Add a version check.
2804 2019-02-20 Alex Christensen <achristensen@webkit.org>
2806 URL percent-encode operations should use checked arithmetic for buffer allocation length
2807 https://bugs.webkit.org/show_bug.cgi?id=194877
2808 <rdar://problem/48212062>
2810 Reviewed by Tim Horton.
2812 * wtf/URLHelpers.cpp:
2813 (WTF::URLHelpers::userVisibleURL):
2814 * wtf/cocoa/NSURLExtras.mm:
2815 (WTF::dataWithUserTypedString):
2817 2019-02-20 Dean Jackson <dino@apple.com>
2819 Rotation animations sometimes use the wrong origin (affects apple.com)
2820 https://bugs.webkit.org/show_bug.cgi?id=194878
2821 <rdar://problem/43908047>
2823 Reviewed by Simon Fraser.
2825 * wtf/Platform.h: Add HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED).
2827 2019-02-20 Andy Estes <aestes@apple.com>
2829 [Xcode] Add SDKVariant.xcconfig to various Xcode projects
2830 https://bugs.webkit.org/show_bug.cgi?id=194869
2832 Rubber-stamped by Jer Noble.
2834 * WTF.xcodeproj/project.pbxproj:
2836 2019-02-20 Adrian Perez de Castro <aperez@igalia.com>
2838 [WPE][GTK] Enable support for CONTENT_EXTENSIONS
2839 https://bugs.webkit.org/show_bug.cgi?id=167941
2841 Reviewed by Carlos Garcia Campos.
2843 Add specialization of the refGPtr() and derefGPtr() templates for GMappedFile.
2845 * wtf/glib/GRefPtr.cpp:
2846 (WTF::refGPtr): Added.
2847 (WTF::derefGPtr): Added.
2848 * wtf/glib/GRefPtr.h: Declare template specializations.
2850 2019-02-19 Commit Queue <commit-queue@webkit.org>
2852 Unreviewed, rolling out r241770.
2853 https://bugs.webkit.org/show_bug.cgi?id=194833
2855 Caused crashes (Requested by smfr on #webkit).
2859 "Code quality cleanup in NeverDestroyed"
2860 https://bugs.webkit.org/show_bug.cgi?id=194824
2861 https://trac.webkit.org/changeset/241770
2863 2019-02-19 Keith Miller <keith_miller@apple.com>
2865 Code quality cleanup in NeverDestroyed
2866 https://bugs.webkit.org/show_bug.cgi?id=194824
2868 Reviewed by Yusuke Suzuki.
2870 First, move data members to the end of the class per WebKit
2871 style. Also, add forbid heap allocation since we expect the
2872 NeverDestroyed classes to be static.
2874 * wtf/NeverDestroyed.h:
2876 2019-02-16 Darin Adler <darin@apple.com>
2878 Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
2879 https://bugs.webkit.org/show_bug.cgi?id=194752
2881 Reviewed by Daniel Bates.
2883 * WTF.xcodeproj/project.pbxproj: Added HexNumber.cpp and Logger.cpp.
2884 * wtf/CMakeLists.txt: Ditto.
2886 * wtf/HexNumber.cpp: Added.
2887 (WTF::Internal::appendHex): Non-inline, non-template hex formatting logic.
2890 (WTF::Internal::appendHex): Refactored main logic of appendUnsignedAsHex and
2891 appendUnsignedAsHexFixedSize so they can be reused in a function named hex for
2892 use with StringTypeAdapter.
2893 (WTF::appendUnsignedAsHex): Ditto.
2894 (WTF::appendUnsignedAsHexFixedSize): Ditto.
2896 (WTF::StringTypeAdapter<HexNumberBuffer>): Added.
2898 * wtf/Logger.cpp: Added.
2899 (WTF::Logger::LogSiteIdentifier::toString const): Made this a non-template
2900 function and moved it here so that we don't need to include HexNumber.h
2901 in Logger.h. Since HexNumber.h has substantial code in it, it's good if we
2902 don't include it in any other headers.
2905 (WTF::LogArgument<Logger::LogSiteIdentifier>::toString): Changed to call
2906 a non-template function, LogSiteIdentifier::toString.
2908 * wtf/text/StringConcatenateNumbers.h: Replaced overloaded writeTo functions
2909 with function templates and used StringImpl::copyCharacters instead of
2912 2019-02-18 Joseph Pecoraro <pecoraro@apple.com>
2914 Web Inspector: Better categorize CPU usage per-thread / worker
2915 https://bugs.webkit.org/show_bug.cgi?id=194564
2917 Reviewed by Devin Rousso.
2920 * wtf/Threading.cpp:
2921 (WTF::Thread::allThreadsMutex):
2922 (WTF::Thread::create):
2923 (WTF::Thread::didExit):
2924 Add a set of all WTF::Thread created threads.
2926 2019-02-18 Tadeu Zagallo <tzagallo@apple.com>
2928 Bytecode cache should a have a boot-specific validation
2929 https://bugs.webkit.org/show_bug.cgi?id=194769
2930 <rdar://problem/48149509>
2932 Reviewed by Keith Miller.
2934 Add helper to get kern.bootsessionuuid from sysctl
2937 (WTF::bootSessionUUIDString):
2940 2019-02-17 David Kilzer <ddkilzer@apple.com>
2942 Unreviewed, rolling out r241620.
2944 "Causes use-after-free crashes running layout tests with ASan and GuardMalloc."
2945 (Requested by ddkilzer on #webkit.)
2949 "[WTF] Add environment variable helpers"
2950 https://bugs.webkit.org/show_bug.cgi?id=192405
2951 https://trac.webkit.org/changeset/241620
2953 2019-02-15 Ross Kirsling <ross.kirsling@sony.com>
2955 [WTF] Add environment variable helpers
2956 https://bugs.webkit.org/show_bug.cgi?id=192405
2958 Reviewed by Michael Catanzaro.
2960 Create a new Environment API as a platform-independent, thread-safe(r)
2961 way to get and set environment variables.
2963 * WTF.xcodeproj/project.pbxproj:
2964 * wtf/CMakeLists.txt:
2965 * wtf/Environment.h: Added.
2966 * wtf/PlatformGTK.cmake:
2967 * wtf/PlatformJSCOnly.cmake:
2968 * wtf/PlatformMac.cmake:
2969 * wtf/PlatformPlayStation.cmake:
2970 * wtf/PlatformWPE.cmake:
2971 * wtf/PlatformWin.cmake:
2972 * wtf/posix/EnvironmentPOSIX.cpp: Added.
2973 * wtf/win/EnvironmentWin.cpp: Added.
2974 Introduce WTF::Environment.
2976 * wtf/Threading.cpp:
2977 (WTF::threadingIsInitialized):
2978 (WTF::initializeThreading):
2980 Introduce WTF::threadingIsInitialized() so that we can ASSERT that it's
2981 false before setting an environment variable through the new API.
2984 (WTF::initializeLogFileOnce):
2985 * wtf/NumberOfCores.cpp:
2986 (WTF::numberOfProcessorCores):
2987 * wtf/posix/FileSystemPOSIX.cpp:
2988 (WTF::FileSystemImpl::openTemporaryFile):
2989 Utilize WTF::Environment where possible.
2991 2019-02-15 Brian Burg <bburg@apple.com>
2993 [Mac] WebInspectorUI.framework does not need to be soft-linked anymore
2994 https://bugs.webkit.org/show_bug.cgi?id=194411
2995 <rdar://problem/47787614>
2997 Reviewed by Joseph Pecoraro.
2999 * wtf/cocoa/SoftLinking.h:
3000 Remove macro that now has no uses.
3002 2019-02-15 Commit Queue <commit-queue@webkit.org>
3004 Unreviewed, rolling out r241559 and r241566.
3005 https://bugs.webkit.org/show_bug.cgi?id=194710
3007 Causes layout test crashes under GuardMalloc (Requested by
3008 ryanhaddad on #webkit).
3010 Reverted changesets:
3012 "[WTF] Add environment variable helpers"
3013 https://bugs.webkit.org/show_bug.cgi?id=192405
3014 https://trac.webkit.org/changeset/241559
3016 "Unreviewed build fix for WinCairo Debug after r241559."
3017 https://trac.webkit.org/changeset/241566
3019 2019-02-15 Truitt Savell <tsavell@apple.com>
3021 Unreviewed, rolling out r241564.
3023 Caused 50+ Timeouts on Mac WK2, mostly in the http/ directory
3027 "[Mac] WebInspectorUI.framework does not need to be soft-
3029 https://bugs.webkit.org/show_bug.cgi?id=194411
3030 https://trac.webkit.org/changeset/241564
3032 2019-02-15 Dominik Infuehr <dinfuehr@igalia.com>
3034 Fix deadlock on Linux/x64 between SamplingProfiler and VMTraps
3035 https://bugs.webkit.org/show_bug.cgi?id=194014
3037 Reviewed by Michael Catanzaro.
3039 Do not block SIGUSR1 when installing signal handlers, since this signal
3040 is used to suspend/resume machine threads on Linux.
3042 ftl-ai-filter-phantoms-should-clear-clear-value.js deadlocked with
3043 enabled watchdog and sampling.
3045 Deadlock happened in the following situation:
3047 Thread 1 (Sampling): SamplingProfiler.cpp:takeSample takes all needed locks
3048 and then tries to suspend the main thread.
3050 Thread 2 (Watchdog/VMTraps): Before the Sampling-Thread suspends the main thread
3051 a signal is caught and the signal handler is invoked (VMTraps.cpp:SignalSender).
3052 SignalSender tries to lock codeBlockSet, but this is already locked by the
3055 The SamplingProfiler can only give up the lock when it suspends
3056 the thread. However since the VMTraps signal handler is active, all other signals blocked,
3057 therefore the SamplingProfiler also waits until its signal handler is invoked.
3059 This patch fixes this by not blocking SIGUSR1 in installSignalHandler, since
3060 it is used to suspend/resume threads on Linux.
3063 * wtf/posix/ThreadingPOSIX.cpp:
3064 * wtf/threads/Signals.cpp:
3065 (WTF::installSignalHandler):
3067 2019-02-15 Saam barati <sbarati@apple.com>
3069 [WebAssembly] Write a new register allocator for Air O0 and make BBQ use it
3070 https://bugs.webkit.org/show_bug.cgi?id=194036
3072 Reviewed by Yusuke Suzuki.
3075 (WTF::IndexMap::at):
3076 (WTF::IndexMap::at const):
3077 (WTF::IndexMap::operator[]):
3078 (WTF::IndexMap::operator[] const):
3080 2019-02-14 Brian Burg <bburg@apple.com>
3082 [Mac] WebInspectorUI.framework does not need to be soft-linked anymore
3083 https://bugs.webkit.org/show_bug.cgi?id=194411
3084 <rdar://problem/47787614>
3086 Reviewed by Joseph Pecoraro.
3088 * wtf/cocoa/SoftLinking.h:
3089 Remove macro that now has no uses.
3091 2019-02-14 Ross Kirsling <ross.kirsling@sony.com>
3093 [WTF] Add environment variable helpers
3094 https://bugs.webkit.org/show_bug.cgi?id=192405
3096 Reviewed by Michael Catanzaro.
3098 Create a new Environment API as a platform-independent, thread-safe(r)
3099 way to get and set environment variables.
3101 * WTF.xcodeproj/project.pbxproj:
3102 * wtf/CMakeLists.txt:
3103 * wtf/Environment.h: Added.
3104 * wtf/PlatformGTK.cmake:
3105 * wtf/PlatformJSCOnly.cmake:
3106 * wtf/PlatformMac.cmake:
3107 * wtf/PlatformPlayStation.cmake:
3108 * wtf/PlatformWPE.cmake:
3109 * wtf/PlatformWin.cmake:
3110 * wtf/posix/EnvironmentPOSIX.cpp: Added.
3111 * wtf/win/EnvironmentWin.cpp: Added.
3112 Introduce WTF::Environment.
3114 * wtf/Threading.cpp:
3115 (WTF::threadingIsInitialized):
3116 (WTF::initializeThreading):
3118 Introduce WTF::threadingIsInitialized() so that we can ASSERT that it's
3119 false before setting an environment variable through the new API.
3122 (WTF::initializeLogFileOnce):
3123 * wtf/NumberOfCores.cpp:
3124 (WTF::numberOfProcessorCores):
3125 * wtf/posix/FileSystemPOSIX.cpp:
3126 (WTF::FileSystemImpl::openTemporaryFile):
3127 Utilize WTF::Environment where possible.
3129 2019-02-13 Yusuke Suzuki <ysuzuki@apple.com>
3131 We should only make rope strings when concatenating strings long enough.
3132 https://bugs.webkit.org/show_bug.cgi?id=194465
3134 Reviewed by Mark Lam.
3136 * wtf/text/StringImpl.h:
3137 (WTF::StringImpl::headerSize):
3139 2019-02-12 Tim Horton <timothy_horton@apple.com>
3141 Remove WKLegacyPDFView
3142 https://bugs.webkit.org/show_bug.cgi?id=194559
3144 Reviewed by Andy Estes.
3146 * wtf/FeatureDefines.h:
3148 2019-02-12 David Kilzer <ddkilzer@apple.com>
3150 REGRESSION (r238955, r240494): Soft-linking optional Lookup.framework triggers release assertion when missing
3151 <https://webkit.org/b/194529>
3152 <rdar://problem/47924449>
3154 Reviewed by Eric Carlson.
3156 * wtf/cocoa/SoftLinking.h:
3157 (SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_IS_OPTIONAL): Rename
3158 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_ASSERTION() to this
3159 and change `assertion` argument to `isOptional`. Pass
3160 `isOptional` to framework##Library() method to control assertion
3161 behavior. Only check RELEASE_ASSERT() if `!isOptional`, else
3162 that code should be optimized out by the compiler. This fixes
3164 (NO_ASSERT): Remove macro since it's no longer used.
3165 (SOFT_LINK_IS_OPTIONAL): Add macro to use for soft-linking
3167 (SOFT_LINK_IS_NOT_OPTIONAL): Add macro to use for soft-linking
3168 non-optional classes.
3169 (SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT): Update to use new
3170 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_IS_OPTIONAL() macro.
3171 (SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT): Ditto.
3172 (SOFT_LINK_CLASS_FOR_SOURCE): Ditto.
3173 (SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL): Ditto.
3175 2019-02-12 Andy Estes <aestes@apple.com>
3177 [iOSMac] Enable Parental Controls Content Filtering
3178 https://bugs.webkit.org/show_bug.cgi?id=194521
3181 Reviewed by Tim Horton.
3185 2019-02-11 Myles C. Maxfield <mmaxfield@apple.com>
3187 [Cocoa] Ask platform for generic font family mappings
3188 https://bugs.webkit.org/show_bug.cgi?id=187723
3189 <rdar://problem/41892438>
3191 Reviewed by Brent Fulgham.
3193 Add an ENABLE in Platform.
3197 2019-02-11 Truitt Savell <tsavell@apple.com>
3199 Unreviewed, rolling out r241229.
3201 Revision broke internal builds for watchOS.
3205 "[Cocoa] Ask platform for generic font family mappings"
3206 https://bugs.webkit.org/show_bug.cgi?id=187723
3207 https://trac.webkit.org/changeset/241229
3209 2019-02-10 Darin Adler <darin@apple.com>
3211 Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
3212 https://bugs.webkit.org/show_bug.cgi?id=194485
3214 Reviewed by Daniel Bates.
3216 * wtf/HexNumber.h: Removed unused functions placeByteAsHexCompressIfPossible and
3217 placeByteAsHex. Can always bring them back if someone needs them. Updated
3218 appendUnsignedAsHex to be a template so we can use it on any integer type,
3219 got rid of unnecessary use of Vector and unnecessary reversing, and got rid of
3220 appendUnsigned64AsHex since callers can now just use appendUnsignedAsHex.
3221 Rewrote appendUnsignedAsHexFixedSize to share mode code rather than replicating.
3223 * wtf/Logger.h: Use appendUnsignedAsHex instead of appendUnsigned64AsHex.
3225 * wtf/URL.cpp: Removed unnecessary include of HexNumber.h.
3227 * wtf/cocoa/NSURLExtras.h: Added missing include of Foundation.h that was
3228 worked around in NSURLExtras.mm.
3229 * wtf/cocoa/NSURLExtras.mm: Removed unnecessary includes of HexNumber.h
3232 2019-02-09 Darin Adler <darin@apple.com>
3234 Eliminate unnecessary String temporaries by using StringConcatenateNumbers
3235 https://bugs.webkit.org/show_bug.cgi?id=194021
3237 Reviewed by Geoffrey Garen.
3240 (WTF::URL::setPort): Remove String::number and let makeString do the conversion
3241 without allocating/destroying a String. Added a cast to "unsigned" to sidestep the
3242 ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
3243 and sometimes used for UTF-16 code units (UChar) and can be the same type.
3245 * wtf/text/StringConcatenateNumbers.h:
3246 Changed FormattedNumber::fixedPrecision to more closely match String::number and
3247 StringBuilder::appendNumber by defaulting to truncating trailing zeros and using
3248 a named enumeration for the truncation policy rather than a boolean.
3251 2019-02-09 Yusuke Suzuki <ysuzuki@apple.com>
3253 Unreviewed, rolling in r241237 again
3254 https://bugs.webkit.org/show_bug.cgi?id=194469
3256 After the measurement, this patch was unrelated to recent regression.
3258 * wtf/text/StringImpl.h:
3259 (WTF::StringImpl::isSubString const):
3260 (WTF::StringImpl::createSubstringSharingImpl):
3262 2019-02-09 Commit Queue <commit-queue@webkit.org>
3264 Unreviewed, rolling out r241237.
3265 https://bugs.webkit.org/show_bug.cgi?id=194474
3267 Shows significant memory increase in WSL (Requested by
3268 yusukesuzuki on #webkit).
3272 "[WTF] Use BufferInternal StringImpl if substring StringImpl
3274 https://bugs.webkit.org/show_bug.cgi?id=194469
3275 https://trac.webkit.org/changeset/241237
3277 2019-02-08 Yusuke Suzuki <ysuzuki@apple.com>
3279 [WTF] Use BufferInternal StringImpl if substring StringImpl takes more memory
3280 https://bugs.webkit.org/show_bug.cgi?id=194469
3282 Reviewed by Geoffrey Garen.
3284 Because pointer is large and aligned in 64bit in 64bit architecture, BufferSubstring StringImpl
3285 implementation takes more memory than BufferInternal StringImpl implementation for small strings.
3286 And BufferInternal StringImpl does not have a problem like, small substring StringImpl keeps super
3287 large owner StringImpl. This patch calculates the required size of memory and selects the more efficient one.
3289 * wtf/text/StringImpl.h:
3290 (WTF::StringImpl::isSubString const):
3291 (WTF::StringImpl::createSubstringSharingImpl):
3293 2019-02-08 Alex Christensen <achristensen@webkit.org>
3295 Add SPI to use networking daemon instead of XPC service
3296 https://bugs.webkit.org/show_bug.cgi?id=194427
3298 Reviewed by Geoffrey Garen.
3300 * wtf/spi/darwin/XPCSPI.h:
3301 Instead of using XPC bootstrap SPI, we just send a separate message.
3302 xpc_copy_bootstrap does not seem to work in daemons.
3304 2019-02-08 Truitt Savell <tsavell@apple.com>
3306 Unreviewed, rolling out r241197.
3308 Broke iOS Simulator Debug build and casued 1 API failure on
3313 "Add SPI to use networking daemon instead of XPC service"
3314 https://bugs.webkit.org/show_bug.cgi?id=194427
3315 https://trac.webkit.org/changeset/241197
3317 2019-02-08 Alex Christensen <achristensen@webkit.org>
3319 Add SPI to use networking daemon instead of XPC service
3320 https://bugs.webkit.org/show_bug.cgi?id=194427
3322 Reviewed by Geoffrey Garen.
3324 * wtf/spi/darwin/XPCSPI.h:
3325 Instead of using XPC bootstrap SPI, we just send a separate message.
3326 xpc_copy_bootstrap does not seem to work in daemons.
3328 2019-02-08 Benjamin Poulain <benjamin@webkit.org>
3330 clampTo(): do not convert the input to double when dealing with integers
3331 https://bugs.webkit.org/show_bug.cgi?id=194263
3332 <rdar://problem/47692312>
3334 Reviewed by Darin Adler.
3336 Previously, every use of clampTo() was converting the input to double,
3337 doing the comparison in double, then casting back to whatever type was needed.
3339 In many case, that was very wasteful. WebKit has many cases of clampTo() with
3340 the same type as input/output, or with integer types of different size/sign.
3342 This patch adds a few versions of clampTo() for the common cases seen in WebKit.
3343 In each case, I tried to minimize the amount of conversion needed at runtime.
3348 2019-02-07 Chris Dumez <cdumez@apple.com>
3350 Mark more heap-allocated classes as fast allocated
3351 https://bugs.webkit.org/show_bug.cgi?id=194422
3353 Reviewed by Ryosuke Niwa.
3356 (WTF::Function<Out):
3359 * wtf/text/StringView.cpp:
3361 2019-02-07 Per Arne Vollan <pvollan@apple.com>
3363 [macOS] Block coreservicesd in sandbox.
3364 https://bugs.webkit.org/show_bug.cgi?id=192670
3366 Reviewed by Alexey Proskuryakov.
3368 Add HAVE_CSCHECKFIXDISABLE define.
3372 2019-02-07 Eric Carlson <eric.carlson@apple.com>
3374 [MSE] Convert debug-only logging to runtime logging
3375 https://bugs.webkit.org/show_bug.cgi?id=194348
3376 <rdar://problem/47566449>
3378 Reviewed by Jer Noble.
3380 * wtf/LoggerHelper.h:
3381 (WTF::LoggerHelper::childLogIdentifier const): Helper to generate a log identifier for an
3382 object that is associated with another logging object.
3383 * wtf/MediaTime.cpp:
3384 (WTF::MediaTime::toJSONObject const):
3385 (WTF::MediaTime::toJSONString const):
3386 (WTF::MediaTimeRange::toJSONString const):
3387 (WTF::toJSONStringInternal): Deleted.
3390 2019-02-05 Keith Rollin <krollin@apple.com>
3392 Enable the automatic checking and regenerations of .xcfilelists during builds
3393 https://bugs.webkit.org/show_bug.cgi?id=194124
3394 <rdar://problem/47721277>
3396 Reviewed by Tim Horton.
3398 Bug 193790 add a facility for checking -- during build time -- that
3399 any needed .xcfilelist files are up-to-date and for updating them if
3400 they are not. This facility was initially opt-in by setting
3401 WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
3402 the process seemed robust. Its now time to enable this facility and
3403 make it opt-out. If there is a need to disable this facility, set and
3404 export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
3405 running `make` or `build-webkit`, or before running Xcode from the
3408 Additionally, remove the step that generates a list of source files
3409 going into the UnifiedSources build step. It's only necessarily to
3410 specify Sources.txt and SourcesCocoa.txt as inputs.
3412 * Scripts/generate-unified-source-bundles.rb:
3414 2019-02-05 Yusuke Suzuki <ysuzuki@apple.com>
3416 [JSC] Shrink sizeof(UnlinkedCodeBlock)
3417 https://bugs.webkit.org/show_bug.cgi?id=194281
3419 Reviewed by Michael Saboff.
3423 2019-02-05 Zan Dobersek <zdobersek@igalia.com>
3425 [GLib] Stop URI-escaping file system representations
3426 https://bugs.webkit.org/show_bug.cgi?id=194213
3428 Reviewed by Carlos Garcia Campos.
3430 Stop URI-escaping of file representation strings in
3431 FileSystem::stringFromFileSystemRepresentation(), and URI-unescaping
3432 of strings in FileSystem::fileSystemRepresentation().
3434 This behavior deviates from POSIX and CF implementations and is
3435 currently breaking IndexedDB-specific calculation of database sizes due
3436 to directory components used in that process that are URL-based and are
3437 as such URI-escaped. When unescaped, those single directory components
3438 explode into multiple directory components, leading to incorrect total
3439 database size calculation when iterating the database directory.
3441 FileSystem::stringFromFileSystemRepresentation() now retrieves GLib's
3442 filename charsets and in worst case converts the filesystem
3443 representation to UTF-8 before String::fromUTF8() is used.
3444 FileSystem::fileSystemRepresentation() reverses that process, taking
3445 String's UTF-8 data and converting it to target charset if necessary.
3447 Other FileSystem functions are adjusted to convert passed-in String
3448 objects to filesystem representations.
3450 * wtf/glib/FileSystemGlib.cpp:
3451 (WTF::FileSystemImpl::stringFromFileSystemRepresentation):
3452 (WTF::FileSystemImpl::fileSystemRepresentation):
3453 (WTF::FileSystemImpl::validRepresentation):
3454 (WTF::FileSystemImpl::filenameForDisplay):
3455 (WTF::FileSystemImpl::fileExists):
3456 (WTF::FileSystemImpl::deleteFile):
3457 (WTF::FileSystemImpl::deleteEmptyDirectory):
3458 (WTF::FileSystemImpl::getFileStat):
3459 (WTF::FileSystemImpl::getFileLStat):
3460 (WTF::FileSystemImpl::makeAllDirectories):
3461 (WTF::FileSystemImpl::createSymbolicLink):
3462 (WTF::FileSystemImpl::pathGetFileName):
3463 (WTF::FileSystemImpl::getVolumeFreeSpace):
3464 (WTF::FileSystemImpl::directoryName):
3465 (WTF::FileSystemImpl::listDirectory):
3466 (WTF::FileSystemImpl::openFile):
3467 (WTF::FileSystemImpl::moveFile):
3468 (WTF::FileSystemImpl::hardLinkOrCopyFile):
3469 (WTF::FileSystemImpl::getFileDeviceId): Align with POSIX implementation
3470 and treat input CString as an existing filesystem representation.
3471 (WTF::FileSystemImpl::unescapedFilename): Deleted.
3473 2019-02-04 Ms2ger <Ms2ger@igalia.com>
3475 [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
3476 https://bugs.webkit.org/show_bug.cgi?id=174816
3478 Reviewed by Michael Catanzaro.
3480 Translate userVisibleString and dependent code into platform-neutral C++
3481 in wtf/URLHelpers.{h,cpp}.
3483 * WTF.xcodeproj/project.pbxproj:
3484 * wtf/CMakeLists.txt:
3485 * wtf/URLHelpers.cpp: Added.
3486 (WTF::URLHelpers::loadIDNScriptWhiteList):
3487 (WTF::URLHelpers::isArmenianLookalikeCharacter):
3488 (WTF::URLHelpers::isArmenianScriptCharacter):
3489 (WTF::URLHelpers::isASCIIDigitOrValidHostCharacter):
3490 (WTF::URLHelpers::isLookalikeCharacter):
3491 (WTF::URLHelpers::whiteListIDNScript):
3492 (WTF::URLHelpers::initializeDefaultIDNScriptWhiteList):
3493 (WTF::URLHelpers::allCharactersInIDNScriptWhiteList):
3494 (WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
3495 (WTF::URLHelpers::isRussianDomainNameCharacter):
3496 (WTF::URLHelpers::allCharactersAllowedByTLDRules):
3497 (WTF::URLHelpers::mapHostName):
3498 (WTF::URLHelpers::collectRangesThatNeedMapping):
3499 (WTF::URLHelpers::applyHostNameFunctionToMailToURLString):
3500 (WTF::URLHelpers::applyHostNameFunctionToURLString):
3501 (WTF::URLHelpers::mapHostNames):
3502 (WTF::URLHelpers::createStringWithEscapedUnsafeCharacters):
3503 (WTF::URLHelpers::toNormalizationFormC):
3504 (WTF::URLHelpers::userVisibleURL):
3505 * wtf/URLHelpers.h: Added.
3506 * wtf/cocoa/NSURLExtras.mm:
3507 (WTF::URLHelpers::loadIDNScriptWhiteList):
3508 (WTF::decodePercentEscapes):
3509 (WTF::decodeHostName):
3510 (WTF::encodeHostName):
3511 (WTF::URLWithUserTypedString):
3512 (WTF::userVisibleString):
3514 2019-02-03 Commit Queue <commit-queue@webkit.org>
3516 Unreviewed, rolling out r240896.
3517 https://bugs.webkit.org/show_bug.cgi?id=194202
3519 "Fixes leaks, but is probably not the correct fix." (Requested
3520 by ddkilzer on #webkit).
3524 "Leak of WTF::StringImpl under SymbolImpl::createNullSymbol()
3525 (48 bytes) in com.apple.WebKit.WebContent running layout
3527 https://bugs.webkit.org/show_bug.cgi?id=193291
3528 https://trac.webkit.org/changeset/240896
3530 2019-02-02 David Kilzer <ddkilzer@apple.com>
3532 Leak of WTF::StringImpl under SymbolImpl::createNullSymbol() (48 bytes) in com.apple.WebKit.WebContent running layout tests
3533 <https://webkit.org/b/193291>
3534 <rdar://problem/46655953>
3536 Reviewed by Keith Miller.
3538 * wtf/text/SymbolImpl.h:
3539 (WTF::SymbolImpl::~SymbolImpl): Fix the leak by implementing the
3540 class destructor that calls StringImpl::deref() on `m_owner`.
3541 Two of the three constructors leak the StringImpl when setting
3542 `m_owner`, so we need to balance that by manually calling
3545 2018-12-16 Darin Adler <darin@apple.com>
3547 Convert additional String::format clients to alternative approaches
3548 https://bugs.webkit.org/show_bug.cgi?id=192746
3550 Reviewed by Alexey Proskuryakov.
3552 * wtf/JSONValues.cpp:
3553 (WTF::appendDoubleQuotedStringEscapedCharacter): Renamed from
3554 escapeChar and reordered arguments to make sense as an append function.
3555 (WTF::appendDoubleQuotedString): Renamed from doubleQuoteString,
3556 reordered arguments to make sense as an append function, take a
3557 StringView instead of a String, used early exit to make the code
3558 a bit easier to read. Use the ASCIIHexDigit functions to construct
3559 a hex number a nibble at a time rather than using String::format.
3560 (WTF::JSONImpl::Value::writeJSON const): Update for name change.
3561 (WTF::JSONImpl::ObjectBase::writeJSON const): Ditto.
3563 2019-01-31 Carlos Garcia Campos <cgarcia@igalia.com>
3565 Unreviewed. Fix WPE compile warnings due to deprecated glib API.
3569 2019-01-29 Chris Dumez <cdumez@apple.com>
3571 Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
3572 https://bugs.webkit.org/show_bug.cgi?id=193848
3574 Reviewed by Youenn Fablet.
3576 Move WTF::generateObjectIdentifier()'s internal counter out-of-line so make sure it never gets
3577 duplicated at each call site. This has caused some hard-to-debug issues with duplicate
3578 identifiers such as Bug 193761.
3580 Also move it to ObjectIdentifier and rename it to generate() as this make call sites nicer
3581 when they have a typedef for the ObjectIdentifier<T> type.
3583 * WTF.xcodeproj/project.pbxproj:
3584 * wtf/CMakeLists.txt:
3585 * wtf/ObjectIdentifier.cpp: Copied from Source/WebCore/platform/Pro