1 2019-05-23 Ross Kirsling <ross.kirsling@sony.com>
3 [PlayStation] Implement platformUserPreferredLanguages.
4 https://bugs.webkit.org/show_bug.cgi?id=198149
6 Reviewed by Fujii Hironori.
8 * wtf/PlatformPlayStation.cmake:
9 * wtf/playstation/LanguagePlayStation.cpp: Added.
10 (WTF::platformUserPreferredLanguages):
12 2019-05-22 Myles C. Maxfield <mmaxfield@apple.com>
14 font-optical-sizing applies the wrong variation value
15 https://bugs.webkit.org/show_bug.cgi?id=197528
16 <rdar://problem/50152854>
18 Reviewed by Antti Koivisto.
22 2019-05-22 Ryan Haddad <ryanhaddad@apple.com>
24 Unreviewed, rolling out r245598.
30 "font-optical-sizing applies the wrong variation value"
31 https://bugs.webkit.org/show_bug.cgi?id=197528
32 https://trac.webkit.org/changeset/245598
34 2019-05-21 Ross Kirsling <ross.kirsling@sony.com>
36 [PlayStation] Don't call fcntl.
37 https://bugs.webkit.org/show_bug.cgi?id=197961
39 Reviewed by Fujii Hironori.
41 * wtf/PlatformGTK.cmake:
42 * wtf/PlatformJSCOnly.cmake:
43 * wtf/PlatformPlayStation.cmake:
44 * wtf/PlatformWPE.cmake:
46 * wtf/playstation/UniStdExtrasPlayStation.cpp: Added.
47 (WTF::setCloseOnExec):
48 (WTF::dupCloseOnExec):
50 * wtf/unix/UniStdExtrasUnix.cpp: Renamed from Source/WTF/wtf/UniStdExtras.cpp.
52 Move UniStdExtras to unix/, add a PlayStation version that doesn't use fcntl, add an abstraction for O_NONBLOCK.
54 2019-05-20 Tadeu Zagallo <tzagallo@apple.com>
56 Only cache bytecode for API clients in data vaults
57 https://bugs.webkit.org/show_bug.cgi?id=197898
59 Reviewed by Keith Miller.
61 Add SPI to check if a filesystem path is restricted as a data vault.
63 * WTF.xcodeproj/project.pbxproj:
64 * wtf/spi/darwin/DataVaultSPI.h: Added.
66 2019-05-20 Carlos Garcia Campos <cgarcia@igalia.com>
68 [GLIB] Repeating timer is not stopped when stop is called from the callback
69 https://bugs.webkit.org/show_bug.cgi?id=197986
71 Reviewed by Michael Catanzaro.
73 In case of repeating timers we always update the ready time to fire interval after the user callback is called.
75 * wtf/glib/RunLoopGLib.cpp:
76 (WTF::RunLoop::TimerBase::stop): Reset m_fireInterval and m_isRepeating.
78 2019-05-19 Darin Adler <darin@apple.com>
80 Change String::number to use "shortest" instead of "fixed precision 6 digits"
81 https://bugs.webkit.org/show_bug.cgi?id=178319
83 Reviewed by Sam Weinig.
85 * wtf/text/StringBuilder.h: Delete appendNumber for floating point and
86 appendECMAScriptNumber for single-precision.
88 * wtf/text/WTFString.h: Delete String::number for floating point and
89 numberToStringECMAScript for single-precision.
91 2019-05-18 Tadeu Zagallo <tzagallo@apple.com>
93 Add extra information to dumpJITMemory
94 https://bugs.webkit.org/show_bug.cgi?id=197998
96 Reviewed by Saam Barati.
98 Add a new trace point code for JSC::dumpJITMemory
100 * wtf/SystemTracing.h:
102 2019-05-17 Don Olmstead <don.olmstead@sony.com>
104 [CMake] Use builtin FindICU
105 https://bugs.webkit.org/show_bug.cgi?id=197934
107 Reviewed by Michael Catanzaro.
109 Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES. Use ICU:: targets which end
110 up propagating to all consumers of WTF.
112 * wtf/CMakeLists.txt:
113 * wtf/PlatformPlayStation.cmake:
115 2019-05-17 Commit Queue <commit-queue@webkit.org>
117 Unreviewed, rolling out r245418.
118 https://bugs.webkit.org/show_bug.cgi?id=197989
120 New API test causing crashes on Mojave testers (Requested by
121 ShawnRoberts on #webkit).
125 "Add a unit test for client certificate authentication"
126 https://bugs.webkit.org/show_bug.cgi?id=197800
127 https://trac.webkit.org/changeset/245418
129 2019-05-16 Keith Miller <keith_miller@apple.com>
131 Wasm should cage the memory base pointers in structs
132 https://bugs.webkit.org/show_bug.cgi?id=197620
134 Reviewed by Saam Barati.
136 Rename reauthenticate to recage.
139 (WTF::CagedPtr::recage):
140 (WTF::CagedPtr::reauthenticate): Deleted.
142 2019-05-16 Alex Christensen <achristensen@webkit.org>
144 Add a unit test for client certificate authentication
145 https://bugs.webkit.org/show_bug.cgi?id=197800
147 Reviewed by Youenn Fablet.
149 * wtf/spi/cocoa/SecuritySPI.h:
150 Move declarations from ArgumentCodersCF.cpp so they can be shared.
152 2019-05-16 Eike Rathke <erack@redhat.com>
154 Fix memcpy() call for big endian
155 https://bugs.webkit.org/show_bug.cgi?id=197945
157 Reviewed by Michael Catanzaro.
162 2019-05-15 Ross Kirsling <ross.kirsling@sony.com>
164 [PlayStation] WTFCrash should preserve register state.
165 https://bugs.webkit.org/show_bug.cgi?id=197932
167 Reviewed by Don Olmstead.
169 * wtf/Assertions.cpp:
171 Let r196397 apply to PlayStation port as well.
173 2019-05-15 Simon Fraser <simon.fraser@apple.com>
175 Make LOG_WITH_STREAM more efficient
176 https://bugs.webkit.org/show_bug.cgi?id=197905
178 Reviewed by Alex Christensen.
180 Add a streamable repeat() class that can be used to output a series of characters.
181 This is useful for indenting output.
183 * wtf/text/TextStream.h:
184 (WTF::TextStream::repeat::repeat):
185 (WTF::TextStream::operator<<):
187 2019-05-15 Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
189 compilation failure with clang 9
190 https://bugs.webkit.org/show_bug.cgi?id=197911
192 Reviewed by Alex Christensen.
194 Use std namespace for nullptr_t in tagArrayPtr templates.
199 2019-05-14 Commit Queue <commit-queue@webkit.org>
201 Unreviewed, rolling out r245281.
202 https://bugs.webkit.org/show_bug.cgi?id=197887
204 Broke API Test TestWebKitAPI.Challenge.ClientCertificate
205 (Requested by aakashjain on #webkit).
209 "Add a unit test for client certificate authentication"
210 https://bugs.webkit.org/show_bug.cgi?id=197800
211 https://trac.webkit.org/changeset/245281
213 2019-05-14 Alex Christensen <achristensen@webkit.org>
215 Add a unit test for client certificate authentication
216 https://bugs.webkit.org/show_bug.cgi?id=197800
218 Reviewed by Youenn Fablet.
220 * wtf/spi/cocoa/SecuritySPI.h:
221 Move declarations from ArgumentCodersCF.cpp so they can be shared.
223 2019-05-13 Robin Morisset <rmorisset@apple.com>
225 IndexSet::isEmpty should use BitVector::isEmpty() instead of size()
226 https://bugs.webkit.org/show_bug.cgi?id=197857
228 Reviewed by Darin Adler.
231 (WTF::IndexSet::isEmpty const):
233 2019-05-13 Youenn Fablet <youenn@apple.com>
235 [Mac] Use realpath for dlopen_preflight
236 https://bugs.webkit.org/show_bug.cgi?id=197803
238 Reviewed by Eric Carlson.
240 * wtf/cocoa/SoftLinking.h:
242 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
244 Unreviewed, wrokaround for MACH_VM_MAX_ADDRESS in ARM32_64
245 https://bugs.webkit.org/show_bug.cgi?id=197730
247 Interestingly, MACH_VM_MAX_ADDRESS is larger than 32bit in ARM32_64, I think this is a bug.
248 But for now, we workaround for this case by using `CPU(ADDRESS64)`.
250 * wtf/WTFAssertions.cpp:
252 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
254 [WTF] Remove Threading workaround for support libraries in Windows
255 https://bugs.webkit.org/show_bug.cgi?id=197350
257 Reviewed by Darin Adler.
259 We kept old APIs for some support libraries at 2017. This patch removes them.
262 * wtf/win/ThreadingWin.cpp:
263 (WTF::createThread): Deleted.
264 (WTF::waitForThreadCompletion): Deleted.
266 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
268 [WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
269 https://bugs.webkit.org/show_bug.cgi?id=197146
271 Reviewed by Saam Barati.
273 Since GCThread and CompilationThread flags exist in WTF, we put these flags into WTF::Thread directly instead of holding them in ThreadSpecific<>.
274 And this patch removes dependency from Threading.h to ThreadSpecific.h. ThreadSpecific.h's OS threading primitives are moved to ThreadingPrimitives.h,
275 and Threading.h relies on it instead.
277 * wtf/CompilationThread.cpp:
278 (WTF::isCompilationThread):
279 (WTF::initializeCompilationThreads): Deleted.
280 (WTF::exchangeIsCompilationThread): Deleted.
281 * wtf/CompilationThread.h:
282 (WTF::CompilationScope::CompilationScope):
283 (WTF::CompilationScope::~CompilationScope):
284 (WTF::CompilationScope::leaveEarly):
285 * wtf/MainThread.cpp:
286 (WTF::initializeMainThread):
287 (WTF::initializeMainThreadToProcessMainThread):
288 (WTF::isMainThreadOrGCThread):
289 (WTF::initializeGCThreads): Deleted.
290 (WTF::registerGCThread): Deleted.
291 (WTF::mayBeGCThread): Deleted.
293 * wtf/ThreadSpecific.h:
294 (WTF::canBeGCThread>::ThreadSpecific):
295 (WTF::canBeGCThread>::set):
296 (WTF::threadSpecificKeyCreate): Deleted.
297 (WTF::threadSpecificKeyDelete): Deleted.
298 (WTF::threadSpecificSet): Deleted.
299 (WTF::threadSpecificGet): Deleted.
301 (WTF::Thread::exchangeIsCompilationThread):
302 (WTF::Thread::registerGCThread):
303 (WTF::Thread::mayBeGCThread):
305 (WTF::Thread::isCompilationThread const):
306 (WTF::Thread::gcThreadType const):
307 (WTF::Thread::joinableState const):
308 (WTF::Thread::hasExited const):
309 (WTF::Thread::Thread):
310 (WTF::Thread::joinableState): Deleted.
311 (WTF::Thread::hasExited): Deleted.
312 * wtf/ThreadingPrimitives.h:
313 (WTF::threadSpecificKeyCreate):
314 (WTF::threadSpecificKeyDelete):
315 (WTF::threadSpecificSet):
316 (WTF::threadSpecificGet):
317 * wtf/win/ThreadSpecificWin.cpp:
320 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
322 Unreviewed, follow-up after r245214
323 https://bugs.webkit.org/show_bug.cgi?id=197730
325 Suggested by Sam. We should have static_assert with MACH_VM_MAX_ADDRESS.
327 * wtf/WTFAssertions.cpp:
329 2019-05-13 Youenn Fablet <youenn@apple.com>
331 Use kDNSServiceFlagsKnownUnique for DNSServiceRegisterRecord only on platforms supporting it
332 https://bugs.webkit.org/show_bug.cgi?id=197802
334 Reviewed by Eric Carlson.
338 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
340 [JSC] Compress miscelaneous JIT related data structures with Packed<>
341 https://bugs.webkit.org/show_bug.cgi?id=197830
343 Reviewed by Saam Barati.
348 2019-05-13 Michael Catanzaro <mcatanzaro@igalia.com>
350 Unreviewed, fix unused variable warnings in release builds
352 * wtf/URLHelpers.cpp:
353 (WTF::URLHelpers::escapeUnsafeCharacters):
355 2019-05-12 Yusuke Suzuki <ysuzuki@apple.com>
357 [JSC] Compress Watchpoint size by using enum type and Packed<> data structure
358 https://bugs.webkit.org/show_bug.cgi?id=197730
360 Reviewed by Filip Pizlo.
362 This patch introduces a new data structures, WTF::Packed, WTF::PackedPtr, and WTF::PackedAlignedPtr.
366 WTF::Packed is data storage. We can read and write trivial (in C++ term [1]) data to this storage. The difference to
367 the usual storage is that the alignment of this storage is always 1. We access the underlying data by using unalignedLoad/unalignedStore.
368 This class offers alignment = 1 data structure instead of missing the following characteristics.
370 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
371 in a racy way. (e.g. fields accessed optimistically from the concurrent compilers).
373 2. We cannot take reference / pointer to the underlying storage since they are unaligned.
375 3. Access to this storage is unaligned access. The code is using memcpy, and the compiler will convert to an appropriate unaligned access
376 in certain architectures (x86_64 / ARM64). It could be slow. So use it for non performance sensitive & memory sensitive places.
380 WTF::PackedPtr is a specialization of WTF::Packed<T*>. And it is basically WTF::PackedAlignedPtr with alignment = 1. We further compact
381 the pointer by leveraging the platform specific knowledge. In 64bit architectures, the effective width of pointers are less than 64 bit.
382 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
383 x86_64 and 5 bytes in Darwin ARM64.
385 - WTF::PackedAlignedPtr
387 WTF::PackedAlignedPtr is the WTF::PackedPtr with alignment information of the T. If we use this alignment information, we could reduce the
388 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
389 this information in Darwin ARM64 platform allows us to make packed JSCell pointer 4 bytes (36 - 4 bits). We do not use passed alignment
390 information if it is not profitable.
392 We also have PackedPtrTraits. This is new PtrTraits and use it for various data structures such as Bag<>.
394 [1]: https://en.cppreference.com/w/cpp/types/is_trivial
396 * WTF.xcodeproj/project.pbxproj:
399 (WTF::Bag::iterator::operator++):
400 * wtf/CMakeLists.txt:
401 * wtf/DumbPtrTraits.h:
402 * wtf/DumbValueTraits.h:
408 (WTF::getLSBSetConstexpr):
409 (WTF::getMSBSetConstexpr):
410 * wtf/Packed.h: Added.
411 (WTF::Packed::Packed):
412 (WTF::Packed::get const):
414 (WTF::Packed::operator=):
415 (WTF::Packed::exchange):
418 (WTF::PackedPtrTraits::exchange):
419 (WTF::PackedPtrTraits::swap):
420 (WTF::PackedPtrTraits::unwrap):
422 * wtf/SentinelLinkedList.h:
423 (WTF::BasicRawSentinelNode::BasicRawSentinelNode):
424 (WTF::BasicRawSentinelNode::prev):
425 (WTF::BasicRawSentinelNode::next):
426 (WTF::PtrTraits>::remove):
427 (WTF::PtrTraits>::prepend):
428 (WTF::PtrTraits>::append):
429 (WTF::RawNode>::SentinelLinkedList):
430 (WTF::RawNode>::remove):
431 (WTF::BasicRawSentinelNode<T>::remove): Deleted.
432 (WTF::BasicRawSentinelNode<T>::prepend): Deleted.
433 (WTF::BasicRawSentinelNode<T>::append): Deleted.
434 * wtf/StdLibExtras.h:
435 (WTF::roundUpToMultipleOfImpl):
436 (WTF::roundUpToMultipleOfImpl0): Deleted.
437 * wtf/UnalignedAccess.h:
438 (WTF::unalignedLoad):
439 (WTF::unalignedStore):
441 2019-05-10 Saam barati <sbarati@apple.com>
443 Bag's move operator= leaks memory
444 https://bugs.webkit.org/show_bug.cgi?id=197757
446 Reviewed by Keith Miller.
448 It was unused. So I'm just removing it. We can implement it properly
452 (WTF::Bag::operator=): Deleted.
454 2019-05-10 Fujii Hironori <Hironori.Fujii@sony.com>
456 [WinCairo] storage/indexeddb tests are timing out
457 https://bugs.webkit.org/show_bug.cgi?id=196289
459 Reviewed by Alex Christensen.
461 * wtf/FileSystem.h: Added hardLink.
462 * wtf/glib/FileSystemGlib.cpp:
463 (WTF::FileSystemImpl::hardLink):
464 (WTF::FileSystemImpl::hardLinkOrCopyFile):
465 * wtf/posix/FileSystemPOSIX.cpp:
466 (WTF::FileSystemImpl::hardLink):
467 (WTF::FileSystemImpl::hardLinkOrCopyFile):
468 * wtf/win/FileSystemWin.cpp:
469 (WTF::FileSystemImpl::hardLink):
470 (WTF::FileSystemImpl::hardLinkOrCopyFile):
471 Added hardLink. Let hardLinkOrCopyFile use the hardLink.
473 2019-05-10 Yusuke Suzuki <ysuzuki@apple.com>
475 [WTF] Remove "private:" from Noncopyable and Nonmovable macros
476 https://bugs.webkit.org/show_bug.cgi?id=197767
478 Reviewed by Saam Barati.
480 We no longer need "private:".
485 2019-05-08 Zan Dobersek <zdobersek@igalia.com>
487 [GLib] Rework WPE RunLoopSourcePriority values
488 https://bugs.webkit.org/show_bug.cgi?id=197167
490 Reviewed by Carlos Garcia Campos.
492 The GLib priorities for the WPE port were initially aligned on the -70
493 value, theory being that this would help avoid any default-priority
494 GSources spawned in different dependency libraries affecting our
495 scheduling. Today it seems that extra caution might not be really
498 This change aligns the base priority value with GLib's default priority
499 value of 0. We maintain the relativity of priority values by effectively
500 increasing each priority by 70.
502 * wtf/glib/RunLoopSourcePriority.h:
504 2019-05-08 Alex Christensen <achristensen@webkit.org>
506 Add SPI to set HSTS storage directory
507 https://bugs.webkit.org/show_bug.cgi?id=197259
509 Reviewed by Brady Eidson.
513 2019-05-08 Keith Miller <keith_miller@apple.com>
515 Remove Gigacage from arm64 and use PAC for arm64e instead
516 https://bugs.webkit.org/show_bug.cgi?id=197110
518 Reviewed by Saam Barati.
520 This patch changes the Gigacage to use PAC on arm64e. As part of
521 this process all platforms must provide their length when
522 materializing the caged pointer. Since it would be somewhat
523 confusing to have two parameters for an operator [] those methods
524 have been removed. Lastly, this patch removes the specializations
525 for void* caged pointers, instead opting to use enable_if on the
526 methods that would normally fail on void* e.g. anything that
529 * WTF.xcodeproj/project.pbxproj:
530 * wtf/CMakeLists.txt:
532 (WTF::CagedPtr::CagedPtr):
533 (WTF::CagedPtr::get const):
534 (WTF::CagedPtr::getMayBeNull const):
535 (WTF::CagedPtr::getUnsafe const):
536 (WTF::CagedPtr::at const):
537 (WTF::CagedPtr::reauthenticate):
538 (WTF::CagedPtr::operator=):
539 (WTF::CagedPtr::operator== const):
540 (WTF::CagedPtr::operator bool const):
541 (WTF::CagedPtr::operator* const): Deleted.
542 (WTF::CagedPtr::operator-> const): Deleted.
543 (WTF::CagedPtr::operator[] const): Deleted.
545 * wtf/CagedUniquePtr.h:
546 (WTF::CagedUniquePtr::CagedUniquePtr):
547 (WTF::CagedUniquePtr::create):
548 (WTF::CagedUniquePtr::~CagedUniquePtr):
549 (WTF::CagedUniquePtr::destroy):
552 (Gigacage::cagedMayBeNull):
555 (WTF::untagArrayPtr):
556 (WTF::removeArrayPtrTag):
557 (WTF::retagArrayPtr):
558 * wtf/TaggedArrayStoragePtr.h: Copied from Source/JavaScriptCore/runtime/ArrayBufferView.cpp.
559 (WTF::TaggedArrayStoragePtr::TaggedArrayStoragePtr):
560 (WTF::TaggedArrayStoragePtr::get const):
561 (WTF::TaggedArrayStoragePtr::getUnsafe const):
562 (WTF::TaggedArrayStoragePtr::resize):
563 (WTF::TaggedArrayStoragePtr::operator bool const):
565 2019-05-08 Robin Morisset <rmorisset@apple.com>
567 WTF::TimingScope should show the total duration and not just the mean
568 https://bugs.webkit.org/show_bug.cgi?id=197672
570 Reviewed by Alex Christensen.
572 * wtf/TimingScope.cpp:
573 (WTF::TimingScope::scopeDidEnd):
575 2019-05-07 Yusuke Suzuki <ysuzuki@apple.com>
577 [JSC] LLIntPrototypeLoadAdaptiveStructureWatchpoint does not require Bag<>
578 https://bugs.webkit.org/show_bug.cgi?id=197645
580 Reviewed by Saam Barati.
582 * WTF.xcodeproj/project.pbxproj:
583 * wtf/CMakeLists.txt:
584 * wtf/Nonmovable.h: Copied from Source/JavaScriptCore/bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h.
586 (WTF::minCapacity>::uncheckedConstructAndAppend):
588 2019-05-07 Eric Carlson <eric.carlson@apple.com>
590 Define media buffering policy
591 https://bugs.webkit.org/show_bug.cgi?id=196979
592 <rdar://problem/28383861>
594 Reviewed by Jer Noble.
598 2019-05-07 Robin Morisset <rmorisset@apple.com>
600 WTF::BitVector should have an isEmpty() method
601 https://bugs.webkit.org/show_bug.cgi?id=197637
603 Reviewed by Keith Miller.
606 (WTF::BitVector::isEmptySlow const):
608 (WTF::BitVector::isEmpty const):
610 2019-05-07 Brent Fulgham <bfulgham@apple.com>
612 Correct JSON parser to address unterminated escape character
613 https://bugs.webkit.org/show_bug.cgi?id=197582
614 <rdar://problem/50459177>
616 Reviewed by Alex Christensen.
618 Correct JSON parser code to properly deal with unterminated escape
621 * wtf/JSONValues.cpp:
622 (WTF::JSONImpl::decodeString):
623 (WTF::JSONImpl::parseStringToken):
625 2019-05-07 Alex Christensen <achristensen@webkit.org>
627 Add a release assertion that Functions can only be constructed from non-null CompletionHandlers
628 https://bugs.webkit.org/show_bug.cgi?id=197641
630 Reviewed by Chris Dumez.
632 This will help us find the cause of rdar://problem/48679972 by seeing the crash when the Function is dispatched,
633 not when it's called with no interesting stack trace. I manually verified this assertion is hit in such a case.
634 We should also have no legitimate use of creating a Function out of a null CompletionHandler then never calling it.
636 * wtf/CompletionHandler.h:
637 (WTF::Detail::CallableWrapper<CompletionHandler<Out):
639 (WTF::Detail::CallableWrapperBase::~CallableWrapperBase):
640 (WTF::Detail::CallableWrapper::CallableWrapper):
643 2019-05-06 Christopher Reid <chris.reid@sony.com>
645 [JSC] Respect already defined USE_LLINT_EMBEDDED_OPCODE_ID compiler variable.
646 https://bugs.webkit.org/show_bug.cgi?id=197633
648 Reviewed by Don Olmstead.
650 When the variable `USE_LLINT_EMBEDDED_OPCODE_ID` is defined, stop defining
651 its value with platform default one.
655 2019-05-03 Sihui Liu <sihui_liu@apple.com>
657 Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
658 https://bugs.webkit.org/show_bug.cgi?id=197390
659 <rdar://problem/42685773>
661 Reviewed by Geoffrey Garen.
663 * wtf/FileSystem.cpp:
664 (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
665 (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
667 * wtf/cocoa/FileSystemCocoa.mm:
668 (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
669 (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
671 2019-05-03 Commit Queue <commit-queue@webkit.org>
673 Unreviewed, rolling out r244881.
674 https://bugs.webkit.org/show_bug.cgi?id=197559
676 Breaks compilation of jsconly on linux, breaking compilation
677 for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
678 guijemont on #webkit).
682 "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
684 https://bugs.webkit.org/show_bug.cgi?id=197174
685 https://trac.webkit.org/changeset/244881
687 2019-05-02 Alex Christensen <achristensen@webkit.org>
689 Mark U+01C0 as a homograph of U+006C
690 https://bugs.webkit.org/show_bug.cgi?id=197526
691 <rdar://problem/50301904>
693 Reviewed by Tim Horton.
695 * wtf/URLHelpers.cpp:
696 (WTF::URLHelpers::isLookalikeCharacter):
698 2019-05-02 Don Olmstead <don.olmstead@sony.com>
700 [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
701 https://bugs.webkit.org/show_bug.cgi?id=197174
703 Reviewed by Alex Christensen.
705 Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES.
707 * wtf/CMakeLists.txt:
709 2019-05-01 Darin Adler <darin@apple.com>
711 WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
712 https://bugs.webkit.org/show_bug.cgi?id=195535
714 Reviewed by Alexey Proskuryakov.
716 * wtf/text/AtomicString.cpp:
717 (WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
718 end is nullptr; this behavior used to be implemented inside the
719 calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
721 * wtf/text/AtomicStringImpl.cpp:
722 (WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
725 * wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
726 AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
727 the AtomicString class and its behavior changed subtly in this patch; it's helpful
728 to document that it's not exported.
730 * wtf/text/StringImpl.cpp:
731 (WTF::StringImpl::utf8Impl): Don't pass "true" for strictness to convertUTF16ToUTF8
732 since strict is the default. Also updated for changes to ConversionResult.
733 (WTF::StringImpl::utf8ForCharacters): Updated for change to convertLatin1ToUTF8.
734 (WTF::StringImpl::tryGetUtf8ForRange const): Ditto.
736 * wtf/text/StringView.cpp: Removed uneeded include of UTF8Conversion.h.
738 * wtf/text/WTFString.cpp:
739 (WTF::String::fromUTF8): Updated for change to convertUTF8ToUTF16.
741 * wtf/unicode/UTF8Conversion.cpp:
742 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII): Deleted.
743 (WTF::Unicode::inlineUTF8SequenceLength): Deleted.
744 (WTF::Unicode::UTF8SequenceLength): Deleted.
745 (WTF::Unicode::decodeUTF8Sequence): Deleted.
746 (WTF::Unicode::convertLatin1ToUTF8): Use U8_APPEND, enabling us to remove
747 almost everything in the function. Also changed resturn value to be a boolean
748 to indicate success since there is only one possible failure (target exhausted).
749 There is room for further simplification, since most callers have lengths rather
750 than end pointers for the source buffer, and all but one caller supplies a buffer
751 size known to be sufficient, so those don't need a return value, nor do they need
752 to pass an end of buffer pointer.
753 (WTF::Unicode::convertUTF16ToUTF8): Use U_IS_LEAD, U_IS_TRAIL,
754 U16_GET_SUPPLEMENTARY, U_IS_SURROGATE, and U8_APPEND. Also changed behavior
755 for non-strict mode so that unpaired surrogates will be turned into the
756 replacement character instead of invalid UTF-8 sequences, because U8_APPEND
757 won't create an invalid UTF-8 sequence, and because we don't need to do that
758 for any good reason at any call site.
759 (WTF::Unicode::isLegalUTF8): Deleted.
760 (WTF::Unicode::readUTF8Sequence): Deleted.
761 (WTF::Unicode::convertUTF8ToUTF16): Use U8_NEXT instead of
762 inlineUTF8SequenceLength, isLegalUTF8, and readUTF8Sequence. Use
763 U16_APPEND instead of lots of code that does the same thing. There is
764 room for further simplification since most callers don't need the "all ASCII"
765 feature and could probably pass the arguments in a more natural way.
766 (WTF::Unicode::calculateStringHashAndLengthFromUTF8MaskingTop8Bits):
767 Use U8_NEXT instead of isLegalUTF8, readUTF8Sequence, and various
768 error handling checks for things that are handled by U8_NEXT. Also removed
769 support for passing nullptr for end to specify a null-terminated string.
770 (WTF::Unicode::equalUTF16WithUTF8): Ditto.
772 * wtf/unicode/UTF8Conversion.h: Removed UTF8SequenceLength and
773 decodeUTF8Sequence. Changed the ConversionResult to match WebKit coding
774 style, with an eye toward perhaps removing it in the future. Changed
775 the convertUTF8ToUTF16 return value to a boolean and removed the "strict"
776 argument since no caller was passing false. Changed the convertLatin1ToUTF8
777 return value to a boolean. Tweaked comments.
779 2019-05-01 Shawn Roberts <sroberts@apple.com>
781 Unreviewed, rolling out r244821.
787 "WebKit has too much of its own UTF-8 code and should rely
788 more on ICU's UTF-8 support"
789 https://bugs.webkit.org/show_bug.cgi?id=195535
790 https://trac.webkit.org/changeset/244821
792 2019-05-01 Shawn Roberts <sroberts@apple.com>
794 Unreviewed, rolling out r244822.
796 Causing 4 Test262 failures on JSC Release and Debug
800 https://trac.webkit.org/changeset/244822 https://trac.webkit.org/changeset/244821
802 2019-04-29 Darin Adler <darin@apple.com>
804 WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
805 https://bugs.webkit.org/show_bug.cgi?id=195535
807 Reviewed by Alexey Proskuryakov.
809 * wtf/text/AtomicString.cpp:
810 (WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
811 end is nullptr; this behavior used to be implemented inside the
812 calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
814 * wtf/text/AtomicStringImpl.cpp:
815 (WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
818 * wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
819 AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
820 the AtomicString class and its behavior changed subtly in this patch; it's helpful
821 to document that it's not exported.
823 * wtf/text/StringImpl.cpp:
824 (WTF::StringImpl::utf8Impl): Don't pass "true" for strictness to convertUTF16ToUTF8
825 since strict is the default. Also updated for changes to ConversionResult.
826 (WTF::StringImpl::utf8ForCharacters): Updated for change to convertLatin1ToUTF8.
827 (WTF::StringImpl::tryGetUtf8ForRange const): Ditto.
829 * wtf/text/StringView.cpp: Removed uneeded include of UTF8Conversion.h.
831 * wtf/text/WTFString.cpp:
832 (WTF::String::fromUTF8): Updated for change to convertUTF8ToUTF16.
834 * wtf/unicode/UTF8Conversion.cpp:
835 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII): Deleted.
836 (WTF::Unicode::inlineUTF8SequenceLength): Deleted.
837 (WTF::Unicode::UTF8SequenceLength): Deleted.
838 (WTF::Unicode::decodeUTF8Sequence): Deleted.
839 (WTF::Unicode::convertLatin1ToUTF8): Use U8_APPEND, enabling us to remove
840 almost everything in the function. Also changed resturn value to be a boolean
841 to indicate success since there is only one possible failure (target exhausted).
842 There is room for further simplification, since most callers have lengths rather
843 than end pointers for the source buffer, and all but one caller supplies a buffer
844 size known to be sufficient, so those don't need a return value, nor do they need
845 to pass an end of buffer pointer.
846 (WTF::Unicode::convertUTF16ToUTF8): Use U_IS_LEAD, U_IS_TRAIL,
847 U16_GET_SUPPLEMENTARY, U_IS_SURROGATE, and U8_APPEND. Also changed behavior
848 for non-strict mode so that unpaired surrogates will be turned into the
849 replacement character instead of invalid UTF-8 sequences, because U8_APPEND
850 won't create an invalid UTF-8 sequence, and because we don't need to do that
851 for any good reason at any call site.
852 (WTF::Unicode::isLegalUTF8): Deleted.
853 (WTF::Unicode::readUTF8Sequence): Deleted.
854 (WTF::Unicode::convertUTF8ToUTF16): Use U8_NEXT instead of
855 inlineUTF8SequenceLength, isLegalUTF8, and readUTF8Sequence. Use
856 U16_APPEND instead of lots of code that does the same thing. There is
857 room for further simplification since most callers don't need the "all ASCII"
858 feature and could probably pass the arguments in a more natural way.
859 (WTF::Unicode::calculateStringHashAndLengthFromUTF8MaskingTop8Bits):
860 Use U8_NEXT instead of isLegalUTF8, readUTF8Sequence, and various
861 error handling checks for things that are handled by U8_NEXT. Also removed
862 support for passing nullptr for end to specify a null-terminated string.
863 (WTF::Unicode::equalUTF16WithUTF8): Ditto.
865 * wtf/unicode/UTF8Conversion.h: Removed UTF8SequenceLength and
866 decodeUTF8Sequence. Changed the ConversionResult to match WebKit coding
867 style, with an eye toward perhaps removing it in the future. Changed
868 the convertUTF8ToUTF16 return value to a boolean and removed the "strict"
869 argument since no caller was passing false. Changed the convertLatin1ToUTF8
870 return value to a boolean. Tweaked comments.
872 2019-04-30 John Wilander <wilander@apple.com>
874 Add logging of Ad Click Attribution errors and events to a dedicated channel
875 https://bugs.webkit.org/show_bug.cgi?id=197332
876 <rdar://problem/49918800>
878 Reviewed by Youenn Fablet.
880 Added missing RELEASE_LOG_INFO and RELEASE_LOG_INFO_IF dummies
881 for RELEASE_LOG_DISABLED.
885 2019-04-30 Youenn Fablet <youenn@apple.com>
887 Make Document audio producers use WeakPtr
888 https://bugs.webkit.org/show_bug.cgi?id=197382
890 Reviewed by Eric Carlson.
893 (WTF::WeakHashSet::hasNullReferences const):
895 2019-04-30 Commit Queue <commit-queue@webkit.org>
897 Unreviewed, rolling out r244773.
898 https://bugs.webkit.org/show_bug.cgi?id=197436
900 Causing assertion failures on debug queues (Requested by
901 ShawnRoberts on #webkit).
905 "Make Document audio producers use WeakPtr"
906 https://bugs.webkit.org/show_bug.cgi?id=197382
907 https://trac.webkit.org/changeset/244773
909 2019-04-30 Youenn Fablet <youenn@apple.com>
911 Make Document audio producers use WeakPtr
912 https://bugs.webkit.org/show_bug.cgi?id=197382
914 Reviewed by Eric Carlson.
917 (WTF::WeakHashSet::hasNullReferences const):
919 2019-04-29 Alex Christensen <achristensen@webkit.org>
921 <rdar://problem/50299396> Fix internal High Sierra build
922 https://bugs.webkit.org/show_bug.cgi?id=197388
924 * Configurations/Base.xcconfig:
926 2019-04-29 Yusuke Suzuki <ysuzuki@apple.com>
928 JITStubRoutineSet wastes 180KB of HashTable capacity on can.com
929 https://bugs.webkit.org/show_bug.cgi?id=186732
931 Reviewed by Saam Barati.
934 (WTF::Range::contains const):
936 2019-04-29 Basuke Suzuki <Basuke.Suzuki@sony.com>
938 [Win] Add flag to enable version information stamping and disable by default.
939 https://bugs.webkit.org/show_bug.cgi?id=197249
940 <rdar://problem/50224412>
942 Reviewed by Ross Kirsling.
944 This feature is only used in AppleWin port. Add flag for this task and make it OFF by default.
945 Then enable it by default on AppleWin.
947 * wtf/CMakeLists.txt:
949 2019-04-26 Don Olmstead <don.olmstead@sony.com>
951 Add WTF::findIgnoringASCIICaseWithoutLength to replace strcasestr
952 https://bugs.webkit.org/show_bug.cgi?id=197291
954 Reviewed by Konstantin Tokarev.
956 Adds an implementation of strcasestr within WTF.
958 * wtf/text/StringCommon.h:
959 (WTF::findIgnoringASCIICaseWithoutLength):
961 2019-04-26 Sihui Liu <sihui_liu@apple.com>
963 Stop IDB transactions to release locked database files when network process is ready to suspend
964 https://bugs.webkit.org/show_bug.cgi?id=196372
965 <rdar://problem/48930116>
967 Reviewed by Brady Eidson.
969 Provide a method to suspend the thread and block main thread until the thread is suspended.
971 * wtf/CrossThreadTaskHandler.cpp:
972 (WTF::CrossThreadTaskHandler::taskRunLoop):
973 (WTF::CrossThreadTaskHandler::suspendAndWait):
974 (WTF::CrossThreadTaskHandler::resume):
975 * wtf/CrossThreadTaskHandler.h:
977 2019-04-25 Fujii Hironori <Hironori.Fujii@sony.com>
979 Unreviewed, rolling out r244669.
981 Windows ports can't clean build.
985 "[Win] Add flag to enable version information stamping and
987 https://bugs.webkit.org/show_bug.cgi?id=197249
988 https://trac.webkit.org/changeset/244669
990 2019-04-25 Basuke Suzuki <Basuke.Suzuki@sony.com>
992 [Win] Add flag to enable version information stamping and disable by default.
993 https://bugs.webkit.org/show_bug.cgi?id=197249
995 Reviewed by Ross Kirsling.
997 This feature is only used in AppleWin port. Add flag for this task and make it OFF by default.
998 Then enable it by default on AppleWin.
1000 * wtf/CMakeLists.txt:
1002 2019-04-25 Timothy Hatcher <timothy@apple.com>
1004 Disable date and time inputs on iOSMac.
1005 https://bugs.webkit.org/show_bug.cgi?id=197287
1006 rdar://problem/46794376
1008 Reviewed by Wenson Hsieh.
1010 * wtf/FeatureDefines.h:
1012 2019-04-25 Alex Christensen <achristensen@webkit.org>
1014 Fix High Sierra build after r244653
1015 https://bugs.webkit.org/show_bug.cgi?id=197131
1017 * wtf/StdLibExtras.h:
1018 High Sierra thinks __cplusplus is 201406 even when using C++17.
1019 Removing the __cplusplus check resolves the build failure on High Sierra.
1020 We can clean up StdLibExtras more later.
1022 2019-04-25 Alex Christensen <achristensen@webkit.org>
1025 https://bugs.webkit.org/show_bug.cgi?id=197131
1027 Reviewed by Darin Adler.
1029 * Configurations/Base.xcconfig:
1030 * wtf/CMakeLists.txt:
1034 2019-04-25 Alex Christensen <achristensen@webkit.org>
1036 Remove DeprecatedOptional
1037 https://bugs.webkit.org/show_bug.cgi?id=197161
1039 Reviewed by Darin Adler.
1041 * WTF.xcodeproj/project.pbxproj:
1042 * wtf/CMakeLists.txt:
1043 * wtf/DeprecatedOptional.h: Removed.
1045 2019-04-24 Carlos Garcia Campos <cgarcia@igalia.com>
1047 [GTK] Hardcoded text color in input fields
1048 https://bugs.webkit.org/show_bug.cgi?id=126907
1050 Reviewed by Michael Catanzaro.
1052 Define HAVE_OS_DARK_MODE_SUPPORT for GTK port.
1056 2019-04-24 Tim Horton <timothy_horton@apple.com>
1058 Clean up WKActionSheetAssistant's use of LaunchServices
1059 https://bugs.webkit.org/show_bug.cgi?id=194645
1060 <rdar://problem/47707952>
1062 Reviewed by Andy Estes.
1066 2019-04-24 chris fleizach <cfleizach@apple.com>
1068 AX: Remove deprecated Accessibility Object Model events
1069 https://bugs.webkit.org/show_bug.cgi?id=197073
1070 <rdar://problem/50027819>
1072 Reviewed by Ryosuke Niwa.
1076 2019-04-23 Commit Queue <commit-queue@webkit.org>
1078 Unreviewed, rolling out r244558.
1079 https://bugs.webkit.org/show_bug.cgi?id=197219
1081 Causing crashes on iOS Sim Release and Debug (Requested by
1082 ShawnRoberts on #webkit).
1086 "Remove DeprecatedOptional"
1087 https://bugs.webkit.org/show_bug.cgi?id=197161
1088 https://trac.webkit.org/changeset/244558
1090 2019-04-23 Alex Christensen <achristensen@webkit.org>
1092 Remove DeprecatedOptional
1093 https://bugs.webkit.org/show_bug.cgi?id=197161
1095 Reviewed by Darin Adler.
1097 This was added in r209326 to be compatible with a shipping version of Safari.
1098 We have released several versions of Safari since then, so do what the comments say and remove it.
1099 The existence of this std::optional makes migrating to C++17 harder, and there's no reason to keep it.
1101 * WTF.xcodeproj/project.pbxproj:
1102 * wtf/CMakeLists.txt:
1103 * wtf/DeprecatedOptional.h: Removed.
1105 2019-04-21 Zan Dobersek <zdobersek@igalia.com>
1107 [WTF] Generic memoryFootprint() implementation should use bmalloc on Linux
1108 https://bugs.webkit.org/show_bug.cgi?id=196963
1110 Reviewed by Don Olmstead.
1112 Have the generic memoryFootprint() implementation use bmalloc's
1113 memoryFootprint() API on Linux, whenever the system malloc option is
1114 not enabled. Limitation to Linux platforms is due to the bmalloc
1115 implementation being limited to those configurations (excluding iOS
1116 which doesn't use MemoryFootprintGeneric.cpp).
1118 * wtf/PlatformWPE.cmake: Switch to building MemoryFootprintGeneric.cpp.
1119 * wtf/generic/MemoryFootprintGeneric.cpp:
1120 (WTF::memoryFootprint):
1122 2019-04-19 Ryosuke Niwa <rniwa@webkit.org>
1124 HashTable::removeIf always shrinks the hash table by half even if there is nothing left
1125 https://bugs.webkit.org/show_bug.cgi?id=196681
1126 <rdar://problem/49917764>
1128 Reviewed by Darin Adler.
1130 Address Darin's comments by removing the explicit type from std::max.
1133 (WTF::KeyTraits>::computeBestTableSize):
1134 (WTF::KeyTraits>::shrinkToBestSize):
1136 2019-04-18 Chris Dumez <cdumez@apple.com>
1138 [iOS] Improve detection of when web views go to background / foreground
1139 https://bugs.webkit.org/show_bug.cgi?id=197035
1140 <rdar://problem/45281182>
1142 Reviewed by Tim Horton.
1144 Add build time flag.
1146 * wtf/FeatureDefines.h:
1148 2019-04-18 Jer Noble <jer.noble@apple.com>
1150 Add support for parsing FairPlayStreaming PSSH boxes.
1151 https://bugs.webkit.org/show_bug.cgi?id=197064
1153 Reviewed by Eric Carlson.
1157 2019-04-18 Yusuke Suzuki <ysuzuki@apple.com>
1159 [WTF] StringBuilder should set correct m_is8Bit flag when merging
1160 https://bugs.webkit.org/show_bug.cgi?id=197053
1162 Reviewed by Saam Barati.
1164 When appending StringBuilder to the other StringBuilder, we have a path that does not set m_is8Bit flag correctly.
1165 This patch correctly sets this flag. And we also change 0 to nullptr when we are using 0 as a pointer.
1167 * wtf/text/StringBuilder.cpp:
1168 (WTF::StringBuilder::reserveCapacity):
1169 (WTF::StringBuilder::appendUninitializedSlow):
1170 (WTF::StringBuilder::append):
1171 * wtf/text/StringBuilder.h:
1172 (WTF::StringBuilder::append):
1173 (WTF::StringBuilder::characters8 const):
1174 (WTF::StringBuilder::characters16 const):
1175 (WTF::StringBuilder::clear):
1177 2019-04-17 Tim Horton <timothy_horton@apple.com>
1179 Adopt different scroll view flashing SPI
1180 https://bugs.webkit.org/show_bug.cgi?id=197043
1181 <rdar://problem/49996476>
1183 Reviewed by Wenson Hsieh.
1187 2019-04-17 Jer Noble <jer.noble@apple.com>
1189 Enable HAVE_AVFOUNDATION_VIDEO_OUTPUT on PLATFORM(IOSMAC)
1190 https://bugs.webkit.org/show_bug.cgi?id=196994
1191 <rdar://problem/44158331>
1193 Reviewed by Alex Christensen.
1197 2019-04-16 Stephan Szabo <stephan.szabo@sony.com>
1199 [PlayStation] Update port for system library changes
1200 https://bugs.webkit.org/show_bug.cgi?id=196978
1202 Reviewed by Ross Kirsling.
1204 * wtf/PlatformPlayStation.cmake:
1205 Remove reference to deleted system library
1207 2019-04-16 Jer Noble <jer.noble@apple.com>
1209 Enable HAVE_AVKIT on PLATFORM(IOSMAC)
1210 https://bugs.webkit.org/show_bug.cgi?id=196987
1212 Reviewed by Tim Horton.
1216 2019-04-16 Robin Morisset <rmorisset@apple.com>
1218 [WTF] holdLock should be marked WARN_UNUSED_RETURN
1219 https://bugs.webkit.org/show_bug.cgi?id=196922
1221 Reviewed by Keith Miller.
1225 2019-04-16 Don Olmstead <don.olmstead@sony.com>
1227 [CMake] Set WTF_SCRIPTS_DIR
1228 https://bugs.webkit.org/show_bug.cgi?id=196917
1230 Reviewed by Konstantin Tokarev.
1232 Use WTF_SCRIPTS_DIR for copying the unified sources script.
1234 * wtf/CMakeLists.txt:
1236 2019-04-15 Myles C. Maxfield <mmaxfield@apple.com>
1238 [Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
1239 https://bugs.webkit.org/show_bug.cgi?id=196846
1240 <rdar://problem/49499971>
1242 Reviewed by Simon Fraser and Darin Adler.
1248 2019-04-12 Ryosuke Niwa <rniwa@webkit.org>
1250 HashTable::removeIf always shrinks the hash table by half even if there is nothing left
1251 https://bugs.webkit.org/show_bug.cgi?id=196681
1253 Reviewed by Darin Adler.
1255 Made HashTable::removeIf shrink to the "best size", which is the least power of two bigger
1256 than twice the key count as already used in the copy constructor.
1259 (WTF::HashTable::computeBestTableSize): Extracted from the copy constructor.
1260 (WTF::HashTable::shrinkToBestSize): Added.
1261 (WTF::HashTable::removeIf): Use shrinkToBestSize instead of shrink.
1262 (WTF::HashTable::HashTable):
1264 2019-04-12 Eric Carlson <eric.carlson@apple.com>
1266 Update AudioSession route sharing policy
1267 https://bugs.webkit.org/show_bug.cgi?id=196776
1268 <rdar://problem/46501611>
1270 Reviewed by Jer Noble.
1272 * wtf/Platform.h: Define HAVE_ROUTE_SHARING_POLICY_LONG_FORM_VIDEO.
1274 2019-04-10 Said Abou-Hallawa <sabouhallawa@apple.com>
1276 requestAnimationFrame should execute before the next frame
1277 https://bugs.webkit.org/show_bug.cgi?id=177484
1279 Reviewed by Simon Fraser.
1281 Add trace points for the page RenderingUpdate.
1283 * wtf/SystemTracing.h:
1285 2019-04-10 Claudio Saavedra <csaavedra@igalia.com>
1287 Do not generate empty unified sources when unified builds are disabled
1288 https://bugs.webkit.org/show_bug.cgi?id=196767
1290 Reviewed by Konstantin Tokarev.
1292 If unified builds are disabled, the ruby script to generate them
1293 is still used to list the sources that need to be
1294 compiled. Currently, the script always generates bundled unified
1295 sources, even if it's being used just to list all the sources. So
1296 when the unified builds are disabled and no files are going to be
1297 bundled, the script generates one empty file per bundle manager
1298 (that is, one C++ and one ObjectiveC), that gets added to the
1299 sources to be compiled.
1301 * Scripts/generate-unified-source-bundles.rb: Only go through the
1302 bundle managers file generation when not running in
1303 PrintAllSources mode, to avoid generating empty bundle files.
1305 2019-04-10 Enrique Ocaña González <eocanha@igalia.com>
1307 [WPE] Avoid async IO starving timers
1308 https://bugs.webkit.org/show_bug.cgi?id=196733
1310 Reviewed by Carlos Garcia Campos.
1312 If AsyncIONetwork and DiskCacheRead priorities are higher than
1313 MainThreadSharedTimer the timers get starved. This causes the NetworkProcess
1314 to accumulate MB of data instead of handing it down to the WebProcess (done
1315 using a Timer). This eventually causes an Out Of Memory kill on the
1316 NetworkProcess on some embedded platforms with low memory limits.
1318 This patch levels the three priorities to the same value, while still leaving
1319 DiskCacheWrite with less priority than DiskCacheRead.
1321 * wtf/glib/RunLoopSourcePriority.h: Changed RunLoopSourcePriority values for WPE.
1323 2019-04-09 Don Olmstead <don.olmstead@sony.com>
1325 [CMake] WTF derived sources should only be referenced inside WTF
1326 https://bugs.webkit.org/show_bug.cgi?id=196706
1328 Reviewed by Konstantin Tokarev.
1330 Use ${WTF_DERIVED_SOURCES_DIR} instead of ${DERIVED_SOURCES_DIR} within WTF.
1332 * wtf/CMakeLists.txt:
1333 * wtf/PlatformJSCOnly.cmake:
1334 * wtf/PlatformMac.cmake:
1336 2019-04-09 Don Olmstead <don.olmstead@sony.com>
1338 [CMake] Apple builds should use ICU_INCLUDE_DIRS
1339 https://bugs.webkit.org/show_bug.cgi?id=196720
1341 Reviewed by Konstantin Tokarev.
1343 Copy ICU headers for Apple builds into ICU_INCLUDE_DIRS.
1346 * wtf/PlatformMac.cmake:
1348 2019-04-08 Don Olmstead <don.olmstead@sony.com>
1350 [CMake][WinCairo] Separate copied headers into different directories
1351 https://bugs.webkit.org/show_bug.cgi?id=196655
1353 Reviewed by Michael Catanzaro.
1355 * wtf/CMakeLists.txt:
1357 2019-04-08 Guillaume Emont <guijemont@igalia.com>
1360 https://bugs.webkit.org/show_bug.cgi?id=196689
1362 Reviewed by Žan Doberšek.
1364 Since the bytecode change, we enabled the baseline JIT on mips in
1365 r240432, but DFG is still missing. With this change, all tests are
1366 passing on a ci20 board.
1368 * wtf/Platform.h: Enable DFG on MIPS by default.
1370 2019-04-06 Ryosuke Niwa <rniwa@webkit.org>
1372 Added tests for WeakHashSet::computesEmpty and WeakHashSet::computeSize
1373 https://bugs.webkit.org/show_bug.cgi?id=196669
1375 Reviewed by Geoffrey Garen.
1377 Removed the superflous type names from forward declarations, and made WeakHashSet::add
1378 take a const object to match other container types in WTF.
1380 * wtf/WeakHashSet.h:
1381 (WTF::WeakHashSet::add):
1384 2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
1386 Make WeakPtr<Element> possible and deploy it in form associated elements code
1387 https://bugs.webkit.org/show_bug.cgi?id=196626
1389 Reviewed by Antti Koivisto.
1391 Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
1392 a subclass type U of a type T used to define WeakReference<T>.
1394 Also added computesEmpty, which is slightly more efficient than computeSize
1395 when m_set is either empty or when there are non-released weak references in the set.
1397 * wtf/WeakHashSet.h:
1398 (WTF::WeakHashSet::remove):
1399 (WTF::WeakHashSet::contains const):
1400 (WTF::WeakHashSet::computesEmpty const): Added.
1401 * wtf/WeakPtr.h: Added an explicit forward declaration of WeakHashSet to avoid
1402 build failures in GTK+ and WPE ports.
1404 2019-04-05 Eric Carlson <eric.carlson@apple.com>
1406 Remove AUDIO_TOOLBOX_AUDIO_SESSION
1407 https://bugs.webkit.org/show_bug.cgi?id=196653
1408 <rdar://problem/49652098>
1410 Reviewed by Jer Noble.
1414 2019-04-05 Michael Catanzaro <mcatanzaro@igalia.com>
1416 Unreviewed manual rollout of r243929
1417 https://bugs.webkit.org/show_bug.cgi?id=196626
1419 * wtf/WeakHashSet.h:
1420 (WTF::WeakHashSet::remove):
1421 (WTF::WeakHashSet::contains const):
1422 (WTF::WeakHashSet::computesEmpty const): Deleted.
1424 2019-04-05 Commit Queue <commit-queue@webkit.org>
1426 Unreviewed, rolling out r243833.
1427 https://bugs.webkit.org/show_bug.cgi?id=196645
1429 This change breaks build of WPE and GTK ports (Requested by
1430 annulen on #webkit).
1434 "[CMake][WTF] Mirror XCode header directories"
1435 https://bugs.webkit.org/show_bug.cgi?id=191662
1436 https://trac.webkit.org/changeset/243833
1438 2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
1440 Make WeakPtr<Element> possible and deploy it in form associated elements code
1441 https://bugs.webkit.org/show_bug.cgi?id=196626
1443 Reviewed by Antti Koivisto.
1445 Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
1446 a subclass type U of a type T used to define WeakReference<T>.
1448 Also added computesEmpty, which is slightly more efficient than computeSize
1449 when m_set is either empty or when there are non-released weak references in the set.
1451 * wtf/WeakHashSet.h:
1452 (WTF::WeakHashSet::remove):
1453 (WTF::WeakHashSet::contains const):
1454 (WTF::WeakHashSet::computesEmpty const): Added.
1456 2019-04-04 Yusuke Suzuki <ysuzuki@apple.com>
1458 [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
1459 https://bugs.webkit.org/show_bug.cgi?id=196475
1461 Reviewed by Saam Barati.
1463 * wtf/ForbidHeapAllocation.h:
1465 * wtf/IsoMallocInlines.h:
1467 2019-04-03 Don Olmstead <don.olmstead@sony.com>
1469 [CMake][WTF] Mirror XCode header directories
1470 https://bugs.webkit.org/show_bug.cgi?id=191662
1472 Reviewed by Konstantin Tokarev.
1474 Rename WTF forwarding header target to WTFFramework and update the install location
1475 to WTF_FRAMEWORK_HEADERS_DIR.
1477 * wtf/CMakeLists.txt:
1479 2019-04-03 Joseph Pecoraro <pecoraro@apple.com>
1481 Web Inspector: Remote Inspector indicate callback should always happen on the main thread
1482 https://bugs.webkit.org/show_bug.cgi?id=196513
1483 <rdar://problem/49498284>
1485 Reviewed by Devin Rousso.
1488 * wtf/cocoa/MainThreadCocoa.mm:
1489 (WTF::dispatchAsyncOnMainThreadWithWebThreadLockIfNeeded):
1490 * wtf/ios/WebCoreThread.cpp:
1491 * wtf/ios/WebCoreThread.h:
1493 2019-04-02 Keith Rollin <krollin@apple.com>
1495 Inhibit CFNetwork logging in private sessions
1496 https://bugs.webkit.org/show_bug.cgi?id=196268
1497 <rdar://problem/48210793>
1499 Fix a conditional in Platform.h where IOS should have been used
1500 instead of IOS_FAMILY. The latter happened to work, but we really want
1501 to be using the proper symbol here.
1503 Reviewed by Alexey Proskuryakov.
1507 2019-04-01 Michael Catanzaro <mcatanzaro@igalia.com>
1509 Stop trying to support building JSC with clang 3.8
1510 https://bugs.webkit.org/show_bug.cgi?id=195947
1511 <rdar://problem/49069219>
1513 Reviewed by Darin Adler.
1515 It seems WebKit hasn't built with clang 3.8 in a while, no devs are using this compiler, we
1516 don't know how much effort it would be to make JSC work again, and it's making the code
1517 worse. Remove my hacks to support clang 3.8 from WTF.
1519 * wtf/MetaAllocator.cpp:
1520 (WTF::MetaAllocator::allocate):
1521 * wtf/text/StringConcatenate.h:
1522 (WTF::tryMakeStringFromAdapters):
1524 2019-03-31 Yusuke Suzuki <ysuzuki@apple.com>
1526 [JSC] Butterfly allocation from LargeAllocation should try "realloc" behavior if collector thread is not active
1527 https://bugs.webkit.org/show_bug.cgi?id=196160
1529 Reviewed by Saam Barati.
1532 (WTF::FastMalloc::tryRealloc):
1534 (Gigacage::tryRealloc):
1537 2019-03-31 Andy Estes <aestes@apple.com>
1539 [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
1540 https://bugs.webkit.org/show_bug.cgi?id=196433
1541 <rdar://problem/49293305>
1543 Reviewed by Tim Horton.
1545 * wtf/NeverDestroyed.h:
1546 (WTF::NeverDestroyed::operator->):
1547 (WTF::NeverDestroyed::operator-> const):
1549 2019-03-28 Fujii Hironori <Hironori.Fujii@sony.com>
1551 Unreviewed build fix.
1553 * wtf/CMakeLists.txt: Added SpanningTree.h to WTF_PUBLIC_HEADERS.
1555 2019-03-28 Saam Barati <sbarati@apple.com>
1557 BackwardsGraph needs to consider back edges as the backward's root successor
1558 https://bugs.webkit.org/show_bug.cgi?id=195991
1560 Reviewed by Filip Pizlo.
1562 Previously, our backwards graph analysis was slightly wrong. The idea of
1563 backwards graph is that the root of the graph has edges to terminals in
1564 the original graph. And then the original directed edges in the graph are flipped.
1566 However, we weren't considering loops as a form of terminality. For example,
1567 we wouldn't consider an infinite loop as a terminal. So there were no edges
1568 from the root to a node in the infinite loop. This lead us to make mistakes
1569 when we used backwards dominators to compute control flow equivalence.
1571 This is better understood in an example:
1585 In the previous version of this algorithm, the only edge from the backwards
1586 root would be to the block containing the return. This would lead us to
1587 believe that the loading of the structureID backwards dominates the preheader,
1588 leading us to believe it's control flow equivalent to preheader. This is
1589 obviously wrong, since we can loop forever if "v" isn't a cell.
1591 The solution here is to treat any backedge in the graph as a "terminal" node.
1592 Since a backedge implies the existence of a loop.
1594 In the above example, the backwards root now has an edge to both blocks with
1595 "continue". This prevents us from falsely claiming that the return is control
1596 flow equivalent with the preheader.
1598 This patch uses DFS spanning trees to compute back edges. An edge
1599 u->v is a back edge when u is a descendent of v in the DFS spanning
1602 * WTF.xcodeproj/project.pbxproj:
1603 * wtf/BackwardsGraph.h:
1604 (WTF::BackwardsGraph::BackwardsGraph):
1605 * wtf/SpanningTree.h: Added.
1606 (SpanningTree::SpanningTree):
1607 (SpanningTree::isDescendent):
1609 2019-03-28 Tim Horton <timothy_horton@apple.com>
1614 It is no longer necessary to exclude this from PLATFORM(IOSMAC).
1616 2019-03-27 Per Arne Vollan <pvollan@apple.com>
1618 Layout Test js/math-clz32.html is failing
1619 https://bugs.webkit.org/show_bug.cgi?id=196209
1621 Reviewed by Ross Kirsling.
1623 Use the correct number of loop iterations when counting leading zeros. Also, the
1624 count was off by one for the Win64 case.
1629 2019-03-26 Keith Rollin <krollin@apple.com>
1631 Inhibit CFNetwork logging in private sessions
1632 https://bugs.webkit.org/show_bug.cgi?id=196268
1633 <rdar://problem/48210793>
1635 Reviewed by Alex Christensen.
1637 Before performing any logging, the NetworkProcess checks to see if
1638 it's performing an operation associated with a private (ephemeral)
1639 browsing session. If so, it skips the logging. However, networking
1640 layers below the NetworkProcess don't know about private browsing, so
1641 they would still perform their own logging. CFNetwork now has a flag
1642 that lets us control that, so set it to False if private browsing.
1646 2019-03-25 Alex Christensen <achristensen@webkit.org>
1648 Expected shouldn't assume its contained types are copyable
1649 https://bugs.webkit.org/show_bug.cgi?id=195986
1651 Reviewed by JF Bastien.
1654 (std::experimental::fundamentals_v3::__expected_detail::constexpr_base::constexpr_base):
1655 (std::experimental::fundamentals_v3::operator==):
1656 (std::experimental::fundamentals_v3::operator!=):
1658 (std::experimental::fundamentals_v3::unexpected::unexpected):
1660 2019-03-24 Keith Miller <keith_miller@apple.com>
1662 Unreviewed, forgot to refactor variable name for windows build in
1669 2019-03-24 Andy Estes <aestes@apple.com>
1671 [watchOS] Remove unused Proximity Networking code
1672 https://bugs.webkit.org/show_bug.cgi?id=196188
1674 Reviewed by Tim Horton.
1676 * wtf/FeatureDefines.h:
1678 2019-03-23 Keith Miller <keith_miller@apple.com>
1680 Refactor clz/ctz and fix getLSBSet.
1681 https://bugs.webkit.org/show_bug.cgi?id=196162
1683 Reviewed by Saam Barati.
1685 This patch makes clz32/64 and ctz32 generic so they work on any
1686 numeric type. Since these methods work on any type we don't need
1687 to have a separate implementation of getLSBSet, which also
1688 happened to be getMSBSet. This patch also adds getMSBSet as there
1689 may be users who want that in the future.
1696 (getLSBSet): Deleted.
1697 (WTF::clz32): Deleted.
1698 (WTF::clz64): Deleted.
1699 (WTF::ctz32): Deleted.
1701 2019-03-22 Keith Rollin <krollin@apple.com>
1703 Enable ThinLTO support in Production builds
1704 https://bugs.webkit.org/show_bug.cgi?id=190758
1705 <rdar://problem/45413233>
1707 Reviewed by Daniel Bates.
1709 Enable building with Thin LTO in Production when using Xcode 10.2 or
1710 later. This change results in a 1.45% progression in PLT5. Full
1711 Production build times increase about 2-3%. Incremental build times
1712 are more severely affected, and so LTO is not enabled for local
1715 LTO is enabled only on macOS for now, until rdar://problem/49013399,
1716 which affects ARM builds, is fixed.
1718 To change the LTO setting when building locally:
1720 - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
1722 - If building with `build-webkit`, specify --lto-mode={none,thin,full}
1723 on the command line.
1724 - If building with `build-root`, specify --lto={none,thin,full} on the
1726 - If building with Xcode, create a LocalOverrides.xcconfig file at the
1727 top level of your repository directory (if needed) and define
1728 WK_LTO_MODE to full, thin, or none.
1730 * Configurations/Base.xcconfig:
1732 2019-03-22 Tim Horton <timothy_horton@apple.com>
1734 Fix the build after r243354
1738 2019-03-22 Tim Horton <timothy_horton@apple.com>
1740 Fix the build after r243354
1741 https://bugs.webkit.org/show_bug.cgi?id=196138
1742 <rdar://problem/49145951>
1746 2019-03-21 Eric Carlson <eric.carlson@apple.com>
1748 Add UI process WebRTC runtime logging.
1749 https://bugs.webkit.org/show_bug.cgi?id=196020
1750 <rdar://problem/49071443>
1752 Reviewed by Youenn Fablet.
1755 (WTF::LogArgument::toString): Add long long and unsigned long long variants.
1757 2019-03-20 Simon Fraser <simon.fraser@apple.com>
1759 Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
1760 https://bugs.webkit.org/show_bug.cgi?id=196049
1762 Reviewed by Tim Horton.
1764 This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
1765 overflow scrolling in general, so rename it.
1767 * wtf/FeatureDefines.h:
1769 2019-03-20 Mark Lam <mark.lam@apple.com>
1771 Open source arm64e code.
1772 https://bugs.webkit.org/show_bug.cgi?id=196012
1773 <rdar://problem/49066237>
1775 Reviewed by Keith Miller.
1777 * WTF.xcodeproj/project.pbxproj:
1780 * wtf/PlatformRegisters.cpp: Added.
1781 (WTF::threadStateLRInternal):
1782 (WTF::threadStatePCInternal):
1783 * wtf/PlatformRegisters.h:
1784 * wtf/PointerPreparations.h:
1785 * wtf/PtrTag.cpp: Added.
1788 (WTF::registerPtrTagLookup):
1789 (WTF::reportBadTag):
1791 (WTF::removeCodePtrTag):
1792 (WTF::tagCodePtrImpl):
1794 (WTF::untagCodePtrImplHelper):
1795 (WTF::untagCodePtrImpl):
1796 (WTF::untagCodePtr):
1797 (WTF::retagCodePtrImplHelper):
1798 (WTF::retagCodePtrImpl):
1799 (WTF::retagCodePtr):
1800 (WTF::tagCFunctionPtrImpl):
1801 (WTF::tagCFunctionPtr):
1802 (WTF::untagCFunctionPtrImpl):
1803 (WTF::untagCFunctionPtr):
1805 (WTF::assertIsCFunctionPtr):
1806 (WTF::assertIsNullOrCFunctionPtr):
1807 (WTF::assertIsNotTagged):
1808 (WTF::assertIsTagged):
1809 (WTF::assertIsNullOrTagged):
1810 (WTF::isTaggedWith):
1811 (WTF::assertIsTaggedWith):
1812 (WTF::assertIsNullOrTaggedWith):
1813 (WTF::usesPointerTagging):
1814 (WTF::registerPtrTagLookup):
1815 (WTF::reportBadTag):
1816 (WTF::tagForPtr): Deleted.
1818 2019-03-20 Keith Rollin <krollin@apple.com>
1820 Update checks that determine if WebKit is system WebKit
1821 https://bugs.webkit.org/show_bug.cgi?id=195756
1823 Reviewed by Alexey Proskuryakov.
1825 The system WebKit can be installed in additional locations, so check
1826 for and allow those, too.
1830 2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
1832 Unreviewed, further attempt to fix clang 3.8 build
1833 https://bugs.webkit.org/show_bug.cgi?id=195947
1835 * wtf/MetaAllocator.cpp:
1836 (WTF::MetaAllocator::allocate):
1838 2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
1840 REGRESSION(r243115) breaks build for clang 3.8
1841 https://bugs.webkit.org/show_bug.cgi?id=195947
1843 Reviewed by Chris Dumez.
1845 * wtf/text/StringConcatenate.h:
1846 (WTF::tryMakeStringFromAdapters):
1848 2019-03-20 Tim Horton <timothy_horton@apple.com>
1850 Add an platform-driven spell-checking mechanism
1851 https://bugs.webkit.org/show_bug.cgi?id=195795
1853 Reviewed by Ryosuke Niwa.
1858 2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
1860 Build cleanly with GCC 9
1861 https://bugs.webkit.org/show_bug.cgi?id=195920
1863 Reviewed by Chris Dumez.
1865 WebKit triggers three new GCC 9 warnings:
1868 -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
1869 declared copy constructor and assignment operator if one of them is user-provided.
1872 Solution is to either add a copy constructor or copy assignment operator, if required, or
1873 else remove one if it is redundant.
1876 -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
1877 -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
1880 These account for most of this patch. Solution is to just remove the bad WTFMove().
1882 Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
1883 These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
1884 would be safer to not use memcpy on nontrivial types, but that's too complex for this
1885 patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
1887 * wtf/CheckedArithmetic.h:
1888 (WTF::Checked::Checked):
1889 * wtf/MetaAllocator.cpp:
1890 (WTF::MetaAllocator::allocate):
1891 * wtf/URLParser.cpp:
1892 (WTF::CodePointIterator::operator!= const):
1893 (WTF::CodePointIterator::operator=): Deleted.
1894 * wtf/text/StringView.h:
1895 (WTF::StringView::CodePoints::Iterator::operator=): Deleted.
1897 2019-03-19 Alex Christensen <achristensen@webkit.org>
1899 Make WTFLogChannelState and WTFLogLevel enum classes
1900 https://bugs.webkit.org/show_bug.cgi?id=195904
1902 Reviewed by Eric Carlson.
1904 * wtf/Assertions.cpp:
1907 (WTF::Logger::logAlways const):
1908 (WTF::Logger::error const):
1909 (WTF::Logger::warning const):
1910 (WTF::Logger::info const):
1911 (WTF::Logger::debug const):
1912 (WTF::Logger::willLog const):
1914 * wtf/MemoryPressureHandler.cpp:
1915 * wtf/RefCountedLeakCounter.cpp:
1917 2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
1919 Unreviewed, rolling out r243132.
1925 "Make WTFLogChannelState and WTFLogLevel enum classes"
1926 https://bugs.webkit.org/show_bug.cgi?id=195904
1927 https://trac.webkit.org/changeset/243132
1929 2019-03-18 Alex Christensen <achristensen@webkit.org>
1931 Make WTFLogChannelState and WTFLogLevel enum classes
1932 https://bugs.webkit.org/show_bug.cgi?id=195904
1934 Reviewed by Eric Carlson.
1936 * wtf/Assertions.cpp:
1939 (WTF::Logger::logAlways const):
1940 (WTF::Logger::error const):
1941 (WTF::Logger::warning const):
1942 (WTF::Logger::info const):
1943 (WTF::Logger::debug const):
1944 (WTF::Logger::willLog const):
1946 * wtf/MemoryPressureHandler.cpp:
1947 * wtf/RefCountedLeakCounter.cpp:
1949 2019-03-18 Darin Adler <darin@apple.com>
1951 Cut down on use of StringBuffer, possibly leading toward removing it entirely
1952 https://bugs.webkit.org/show_bug.cgi?id=195870
1954 Reviewed by Daniel Bates.
1956 * wtf/URL.cpp: Remove a now-inaccurate comment mentioning StringBuffer.
1958 * wtf/text/StringView.cpp:
1959 (WTF::convertASCIICase): Use createUninitialized instead of StringBuffer.
1961 2019-03-18 Xan Lopez <xan@igalia.com>
1963 [WTF] Remove redundant std::move in StringConcatenate
1964 https://bugs.webkit.org/show_bug.cgi?id=195798
1966 Reviewed by Darin Adler.
1968 Remove redundant calls to WTFMove in return values for this
1969 method. C++ will already do an implicit move here since we are
1970 returning a local value where copy/move elision is not applicable.
1972 * wtf/text/StringConcatenate.h:
1973 (WTF::tryMakeStringFromAdapters):
1975 2019-03-16 Darin Adler <darin@apple.com>
1977 Improve normalization code, including moving from unorm.h to unorm2.h
1978 https://bugs.webkit.org/show_bug.cgi?id=195330
1980 Reviewed by Michael Catanzaro.
1982 * wtf/URLHelpers.cpp: Removed unneeded include of unorm.h since the
1983 normalization code is now in StringView.cpp.
1984 (WTF::URLHelpers::escapeUnsafeCharacters): Renamed from
1985 createStringWithEscapedUnsafeCharacters since it now only creates
1986 a new string if one is needed. Use unsigned for string lengths, since
1987 that's what WTF::String uses, not size_t. Added a first loop so that
1988 we can return the string unmodified if no lookalike characters are
1989 found. Removed unnecessary round trip from UTF-16 and then back in
1990 the case where the character is not a lookalike.
1991 (WTF::URLHelpers::toNormalizationFormC): Deleted. Moved this logic
1992 into the WTF::normalizedNFC function in StringView.cpp.
1993 (WTF::URLHelpers::userVisibleURL): Call escapeUnsafeCharacters and
1994 normalizedNFC. The normalizedNFC function is better in multiple ways,
1995 but primarily it handles 8-bit strings and other already-normalized
1996 strings much more efficiently.
1998 * wtf/text/StringView.cpp:
1999 (WTF::normalizedNFC): Added. This has two overloads. One is for when
2000 we already have a String, and want to re-use it if no normalization
2001 is needed, and another is when we only have a StringView, and may need
2002 to allocate a String to hold the result. Includes a fast special case
2003 for 8-bit and already-normalized strings, and uses the same strategy
2004 that JSC::normalize was already using: calls unorm2_normalize twice,
2005 first just to determine the length.
2007 * wtf/text/StringView.h: Added normalizedNFC, which can be called with
2008 either a StringView or a String. Also moved StringViewWithUnderlyingString
2009 here from JSString.h, here for use as the return value of normalizedNFC;
2010 it is used for a similar purpose in the JavaScriptCore rope implementation.
2011 Also removed an inaccurate comment.
2013 2019-03-16 Diego Pino Garcia <dpino@igalia.com>
2015 [GTK] [WPE] Fix compilation errors due to undefined ALWAYS_LOG_IF
2016 https://bugs.webkit.org/show_bug.cgi?id=195850
2018 Unreviewed build fix after r243033.
2020 * wtf/LoggerHelper.h:
2022 2019-03-15 Per Arne Vollan <pvollan@apple.com>
2024 [iOS] Block the accessibility server when accessibility is not enabled.
2025 https://bugs.webkit.org/show_bug.cgi?id=195342
2027 Reviewed by Brent Fulgham.
2029 Add SPI to issue a mach extension to a process by pid. Also, add a macro for
2030 the availability of this SPI.
2033 * wtf/spi/darwin/SandboxSPI.h:
2035 2019-03-15 Eric Carlson <eric.carlson@apple.com>
2037 Add media stream release logging
2038 https://bugs.webkit.org/show_bug.cgi?id=195823
2040 Reviewed by Youenn Fablet.
2042 * wtf/LoggerHelper.h: Add LOG_IF variants that check a condition before logging.
2044 2019-03-15 Truitt Savell <tsavell@apple.com>
2046 Unreviewed, rolling out r243008.
2048 This revision broke High Sierra builders
2052 "[iOS] Block the accessibility server when accessibility is
2054 https://bugs.webkit.org/show_bug.cgi?id=195342
2055 https://trac.webkit.org/changeset/243008
2057 2019-03-15 Per Arne Vollan <pvollan@apple.com>
2059 [iOS] Block the accessibility server when accessibility is not enabled.
2060 https://bugs.webkit.org/show_bug.cgi?id=195342
2062 Reviewed by Brent Fulgham.
2064 Add SPI to issue a mach extension to a process by pid.
2066 * wtf/spi/darwin/SandboxSPI.h:
2068 2019-03-13 Sam Weinig <sam@webkit.org>
2070 Add utility function to allow easy reverse range-based iteration of a container
2071 https://bugs.webkit.org/show_bug.cgi?id=195542
2073 Reviewed by Antti Koivisto.
2075 Add functions to create an IteratorRange<T> that will iterate a container backwards. It
2076 works with any container that is compatible with std::rbegin() and std::rend(). It is
2077 expected to be used in conjunction with range-based for-loops like so:
2079 for (auto& value : WTF::makeReversedRange(myContainer))
2082 * wtf/IteratorRange.h:
2083 (WTF::makeReversedRange):
2085 2019-03-13 Keith Rollin <krollin@apple.com>
2087 Add support for new StagedFrameworks layout
2088 https://bugs.webkit.org/show_bug.cgi?id=195543
2090 Reviewed by Alexey Proskuryakov.
2092 Opportunistic cleanup: remove unused JAVASCRIPTCORE_FRAMEWORKS_DIR
2095 * Configurations/Base.xcconfig:
2097 2019-03-13 Dominik Infuehr <dinfuehr@igalia.com>
2099 String overflow when using StringBuilder in JSC::createError
2100 https://bugs.webkit.org/show_bug.cgi?id=194957
2102 Reviewed by Mark Lam.
2104 When calculating the new capacity of a StringBuilder object,
2105 use a limit of MaxLength instead of MaxLength+1. Allocating
2106 a string of size MaxLength+1 always fails. This means that expanding
2107 a StringBuilder only worked when the newly doubled capacity is less or
2110 * wtf/text/StringBuilder.cpp:
2112 2019-03-13 Chris Dumez <cdumez@apple.com>
2114 Better build fix after r242901.
2116 Reviewed by Jer Noble.
2119 (WTF::LogArgument::toString):
2121 2019-03-13 Jer Noble <jer.noble@apple.com>
2123 Add AggregateLogger, a Logger specialization for singleton classes.
2124 https://bugs.webkit.org/show_bug.cgi?id=195644
2126 Reviewed by Eric Carlson.
2128 Add a new class, AggregateLogger, which will log messages to each of its aggregated loggers.
2130 Drive-by fixes: allow "const void*" to be directly logged by converting the pointer to a hex string.
2132 * WTF.xcodeproj/project.pbxproj:
2133 * wtf/AggregateLogger.h: Added.
2134 (WTF::AggregateLogger::create):
2135 (WTF::AggregateLogger::addLogger):
2136 (WTF::AggregateLogger::removeLogger):
2137 (WTF::AggregateLogger::logAlways const):
2138 (WTF::AggregateLogger::error const):
2139 (WTF::AggregateLogger::warning const):
2140 (WTF::AggregateLogger::info const):
2141 (WTF::AggregateLogger::debug const):
2142 (WTF::AggregateLogger::willLog const):
2143 (WTF::AggregateLogger::AggregateLogger):
2144 (WTF::AggregateLogger::log const):
2150 2019-03-12 Commit Queue <commit-queue@webkit.org>
2152 Unreviewed, rolling out r242747.
2153 https://bugs.webkit.org/show_bug.cgi?id=195641
2155 Performance measurement is difficult in this period, rolling
2156 out it and rolling in later to isolate it from the other
2157 sensitive patches (Requested by yusukesuzuki on #webkit).
2161 "[JSC] Make StaticStringImpl & StaticSymbolImpl actually
2163 https://bugs.webkit.org/show_bug.cgi?id=194212
2164 https://trac.webkit.org/changeset/242747
2166 2019-03-12 Robin Morisset <rmorisset@apple.com>
2168 A lot more classes have padding that can be reduced by reordering their fields
2169 https://bugs.webkit.org/show_bug.cgi?id=195579
2171 Reviewed by Mark Lam.
2173 * wtf/CrossThreadQueue.h:
2175 * wtf/MemoryPressureHandler.h:
2176 * wtf/MetaAllocator.h:
2177 * wtf/Threading.cpp:
2179 2019-03-11 Alex Christensen <achristensen@webkit.org>
2181 WTF::Expected should use std::addressof instead of operator&
2182 https://bugs.webkit.org/show_bug.cgi?id=195604
2184 Reviewed by Myles Maxfield.
2186 The latter was causing problems with types that do tricky things with constructors and operator&,
2187 specifically UniqueRef but I made a reduced test case. When it used operator&, it would get the contained
2188 type and call the constructor that takes a contained type instead of the move constructor.
2191 (std::experimental::fundamentals_v3::__expected_detail::base::base):
2192 (std::experimental::fundamentals_v3::expected::swap):
2194 2019-03-11 Ross Kirsling <ross.kirsling@sony.com>
2196 Add Optional to Forward.h.
2197 https://bugs.webkit.org/show_bug.cgi?id=195586
2199 Reviewed by Darin Adler.
2202 Add forward declaration for Optional.
2207 * wtf/MemoryFootprint.h:
2208 * wtf/URLHelpers.cpp:
2210 * wtf/cocoa/CPUTimeCocoa.cpp:
2211 * wtf/fuchsia/CPUTimeFuchsia.cpp:
2212 * wtf/unix/CPUTimeUnix.cpp:
2213 * wtf/win/CPUTimeWin.cpp:
2214 Remove unnecessary includes from headers.
2216 2019-03-11 Andy Estes <aestes@apple.com>
2218 [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
2219 https://bugs.webkit.org/show_bug.cgi?id=195530
2220 <rdar://problem/48747164>
2222 Reviewed by Alex Christensen.
2224 * wtf/FeatureDefines.h: Defined ENABLE_APPLE_PAY_REMOTE_UI.
2226 2019-03-11 Yusuke Suzuki <ysuzuki@apple.com>
2228 [JSC] Make StaticStringImpl & StaticSymbolImpl actually static
2229 https://bugs.webkit.org/show_bug.cgi?id=194212
2231 Reviewed by Mark Lam.
2233 Avoid mutation onto refcounts if `isStatic()` returns true so that the content of StaticStringImpl never gets modified.
2235 * wtf/text/StringImpl.h:
2236 (WTF::StringImpl::ref):
2237 (WTF::StringImpl::deref):
2239 2019-03-11 Sihui Liu <sihui_liu@apple.com>
2241 Crash under WebCore::IDBDatabase::connectionToServerLost
2242 https://bugs.webkit.org/show_bug.cgi?id=195563
2243 <rdar://problem/37193655>
2245 CrossThreadTask should protect callee if it is ThreadSafeRefCounted.
2247 Reviewed by Geoffrey Garen.
2249 * wtf/CrossThreadTask.h:
2250 (WTF::createCrossThreadTask):
2252 2019-03-11 Ryan Haddad <ryanhaddad@apple.com>
2254 Unreviewed, rolling out r242688, r242643, r242624.
2256 Caused multiple layout test failures and crashes on iOS and macOS.
2260 "requestAnimationFrame should execute before the next frame"
2261 https://bugs.webkit.org/show_bug.cgi?id=177484
2262 https://trac.webkit.org/changeset/242624/webkit
2264 * wtf/SystemTracing.h:
2266 2019-03-11 Darin Adler <darin@apple.com>
2268 Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
2269 https://bugs.webkit.org/show_bug.cgi?id=195533
2271 Reviewed by Brent Fulgham.
2273 Soon, we will change String::number and StringBuilder::appendNumber for floating
2274 point to use "shortest form" serialization instead of the current default, which is
2275 "6-digit fixed precision stripping trailing zeros". To prepare to do this safely
2276 without accidentally changing any behavior, changing callers to call the explicit
2277 versions. Later, we may want to return and change many of them to use shortest form
2278 instead, but that may require rebaselining tests, and in some extreme cases, getting
2279 rid of flawed logic that converts between different single and double precision
2280 floating point; such problems may be hidden by fixed precision serialization.
2282 Since "shortest form" is already the behavior for AtomicString::number and
2283 for makeString, no changes required for clients of either of those.
2286 (WTF::LogArgument::toString): Use numberToStringFixedPrecision.
2287 * wtf/MediaTime.cpp:
2288 (WTF::MediaTime::toString const): Use appendFixedPrecisionNumber.
2289 * wtf/text/ValueToString.h:
2290 (WTF::ValueToString<float>::string): Use numberToStringFixedPrecision.
2291 (WTF::ValueToString<double>::string): Ditto.
2293 2019-03-11 Truitt Savell <tsavell@apple.com>
2295 Unreviewed, rolling out r242702.
2297 Broke High Sierra builders.
2301 "Add utility function to allow easy reverse range-based
2302 iteration of a container"
2303 https://bugs.webkit.org/show_bug.cgi?id=195542
2304 https://trac.webkit.org/changeset/242702
2306 2019-03-11 Sam Weinig <sam@webkit.org>
2308 Add utility function to allow easy reverse range-based iteration of a container
2309 https://bugs.webkit.org/show_bug.cgi?id=195542
2311 Reviewed by Antti Koivisto.
2313 Add functions to create an IteratorRange<T> that will iterate a container backwards. It
2314 works with any container that is compatible with std::rbegin() and std::rend(). It is
2315 expected to be used in conjunction with range-based for-loops like so:
2317 for (auto& value : WTF::makeReversedRange(myContainer))
2320 * wtf/IteratorRange.h:
2321 (WTF::makeReversedRange):
2323 2019-03-10 Yusuke Suzuki <utatane.tea@gmail.com> and Fujii Hironori <Hironori.Fujii@sony.com>
2325 [WTF] Align assumption in RunLoopWin to the other platform's RunLoop
2326 https://bugs.webkit.org/show_bug.cgi?id=181151
2328 Reviewed by Don Olmstead.
2330 This patch fixes RunLoop in Windows to align it to the implementations in the other platforms
2331 to use RunLoop more aggressively.
2334 (WTF::RunLoop::Timer::Timer):
2335 * wtf/win/MainThreadWin.cpp:
2336 (initializeMainThreadPlatform): Call RunLoop::registerRunLoopMessageWindowClass.
2337 * wtf/win/RunLoopWin.cpp:
2338 (WTF::RunLoop::wndProc):
2339 (WTF::RunLoop::iterate):
2340 (WTF::RunLoop::stop):
2341 PostQuitMessage is only available in the RunLoop's thread. We should post a message and call
2342 it inside this task.
2344 (WTF::RunLoop::registerRunLoopMessageWindowClass):
2345 Changed the return type from bool to void, and added RELEASE_ASSERT to check the return value of RegisterClass.
2347 (WTF::RunLoop::~RunLoop):
2348 When the RunLoop's thread is freed, its associated window is freed. We do not need to do here.
2350 (WTF::RunLoop::TimerBase::timerFired):
2351 (WTF::RunLoop::TimerBase::TimerBase):
2352 (WTF::RunLoop::TimerBase::start):
2353 (WTF::RunLoop::TimerBase::stop):
2354 (WTF::RunLoop::TimerBase::isActive const):
2355 (WTF::RunLoop::TimerBase::secondsUntilFire const):
2356 (WTF::generateTimerID): Deleted.
2357 We can use TimerBase's pointer as ID since it is uintptr_t.
2359 2019-03-07 Said Abou-Hallawa <sabouhallawa@apple.com>
2361 requestAnimationFrame should execute before the next frame
2362 https://bugs.webkit.org/show_bug.cgi?id=177484
2364 Reviewed by Simon Fraser.
2366 Add trace points for the page RenderingUpdate.
2368 * wtf/SystemTracing.h:
2370 2019-03-06 Ross Kirsling <ross.kirsling@sony.com>
2372 [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
2373 https://bugs.webkit.org/show_bug.cgi?id=195346
2375 Reviewed by Fujii Hironori.
2377 * wtf/PlatformWin.cmake:
2378 * wtf/text/AtomicString.h:
2379 (WTF::AtomicString::AtomicString):
2380 * wtf/text/WTFString.h:
2381 (WTF::String::String):
2382 * wtf/text/win/StringWin.cpp: Added.
2383 (WTF::String::wideCharacters const): Renamed from WTF::stringToNullTerminatedWChar.
2384 * wtf/text/win/WCharStringExtras.h:
2387 (WTF::stringToNullTerminatedWChar): Deleted.
2388 (WTF::wcharToString): Deleted.
2389 (WTF::nullTerminatedWCharToString): Deleted.
2390 Add static_assert-guarded reinterpret_cast wrappers for going between UChar* and wchar_t*.
2391 Move existing to/from-String helpers into the String (and AtomicString) class(es).
2393 * wtf/win/FileSystemWin.cpp:
2394 (WTF::FileSystemImpl::getFindData):
2395 (WTF::FileSystemImpl::getFinalPathName):
2396 (WTF::FileSystemImpl::createSymbolicLink):
2397 (WTF::FileSystemImpl::deleteFile):
2398 (WTF::FileSystemImpl::deleteEmptyDirectory):
2399 (WTF::FileSystemImpl::moveFile):
2400 (WTF::FileSystemImpl::pathByAppendingComponent):
2401 (WTF::FileSystemImpl::fileSystemRepresentation):
2402 (WTF::FileSystemImpl::makeAllDirectories):
2403 (WTF::FileSystemImpl::pathGetFileName):
2404 (WTF::FileSystemImpl::storageDirectory):
2405 (WTF::FileSystemImpl::generateTemporaryPath):
2406 (WTF::FileSystemImpl::openTemporaryFile):
2407 (WTF::FileSystemImpl::openFile):
2408 (WTF::FileSystemImpl::hardLinkOrCopyFile):
2409 (WTF::FileSystemImpl::deleteNonEmptyDirectory):
2410 * wtf/win/LanguageWin.cpp:
2412 * wtf/win/PathWalker.cpp:
2413 (WTF::PathWalker::PathWalker):
2414 Use wchar helpers as needed.
2416 2019-02-28 Ryosuke Niwa <rniwa@webkit.org>
2419 https://bugs.webkit.org/show_bug.cgi?id=195152
2421 Reviewed by Antti Koivisto.
2423 Added WeakHashSet which is a HashSet of WeakPtr. When the object pointed by WeakPtr is deleted,
2424 WeakHashSet treats the key to be no longer in the set. That is, WeakHashSet::contains returns false
2425 and const_iterator skips such a WeakPtr in the set.
2427 We decided not to make HashSet<WeahPtr<T>> work because it involves weird semantics such as making
2428 find(X) delete the table entry as remove(find(X)) would be a no-op otherwise as find(X) would return
2429 necessarily need to return HashSet<WeakPtr<T>>::end().
2431 Furthermore, we cannot determine the true size of this set in O(1) because the objected pointed by
2432 some of WeakPtr in the set may have already been deleted. This has implications that we can't have
2433 size(), isEmpty(), random(), etc... as O(1) operation.
2435 WeakHashSet is implemented as HashSet<WeakReference<T>>. HashTable::rehash has been updated to delete
2436 WeakReference<T>'s whose m_ptr has become null, and HashTable::expand first deletes any such entry
2437 before deciding an actual expansion is needed. This is accomplished via newly added hash trait,
2438 hasIsReleasedWeakValueFunction, and HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue which
2439 returns true for when WeakReference<T> pointed by Ref<WeakReference<T>> has null m_ptr, not to be
2440 confused with Ref<WeakReference<T>> itself pointing to a null WeakReference<T>.
2442 * WTF.xcodeproj/project.pbxproj:
2443 * wtf/CMakeLists.txt:
2446 (WTF::HashSet<T, U, V>::checkConsistency const): Added.
2448 (WTF::HashTable::isReleasedWeakBucket): Added.
2449 (WTF::HashTable::expand): Delete WeakReference<T> with null m_ptr first. This updates m_keyCount
2450 and may make mustRehashInPlace() return true.
2451 (WTF::HashTable::deleteReleasedWeakBuckets): Added.
2452 (WTF::HashTable::rehash): Delete WeakReference<T> with null m_ptr. Also refactored the code a bit
2453 to avoid keep repeating oldTable[i].
2455 (WTF::HashTraits<T>::isHashTraitsReleasedWeakValue): Added.
2456 (WTF::RefHashTraits<T>): Extracted from HashTraits<Ref<P>> to share code with
2457 HashTraits<Ref<WeakReference<T>>>.
2458 (WTF::HashTraitsReleasedWeakValueChecker<Traits, hasIsReleasedWeakValueFunction>): Added.
2459 (WTF::isHashTraitsReleasedWeakValue<Traits, hasIsReleasedWeakValueFunction>): Added.
2460 * wtf/WeakHashSet.h: Added.
2461 (WTF::WeakHashSet): Added.
2462 (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator):
2463 (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
2464 (WTF::WeakHashSet::WeakHashSetConstIterator::operator* const):
2465 (WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const):
2466 (WTF::WeakHashSet::WeakHashSetConstIterator::operator++):
2467 (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
2468 (WTF::WeakHashSet::WeakHashSetConstIterator::operator== const):
2469 (WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const):
2470 (WTF::WeakHashSet::WeakHashSet):
2471 (WTF::WeakHashSet::begin const):
2472 (WTF::WeakHashSet::end const):
2473 (WTF::WeakHashSet::add):
2474 (WTF::WeakHashSet::remove):
2475 (WTF::WeakHashSet::contains const):
2476 (WTF::WeakHashSet::capacity const):
2477 (WTF::WeakHashSet::computeSize const): Deletes any WeakReference<T> with null m_ptr first.
2478 (WTF::WeakHashSet::checkConsistency const):
2479 (WTF::HashTraits<Ref<WeakReference<T>>>): Added. This hash traits triggers the new code in HashTable's
2480 expand and rehash methods to delete WeakReference<T> with null m_ptr.
2481 (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue):
2483 (WTF::WeakReference::~WeakReference): Added so that we can keep track the number of live WeakReference
2484 in API tests by template specializations.
2486 2019-03-03 Darin Adler <darin@apple.com>
2488 Prepare to improve handling of conversion of float to strings
2489 https://bugs.webkit.org/show_bug.cgi?id=195262
2491 Reviewed by Daniel Bates.
2494 (WTF::truncateTrailingZeros): Renamed from
2495 formatStringTruncatingTrailingZerosIfNeeded and removed the calls
2496 to double_conversion::StringBuilder::Finalizer, since the caller
2498 (WTF::numberToFixedPrecisionString): Added an overload for float
2499 and updated to use the new truncateTrailingZeros.
2500 (WTF::numberToFixedWidthString): Added an overload for float.
2502 * wtf/text/AtomicString.cpp:
2503 (WTF::AtomicString::number): Added float overload. This is a
2504 behavior change, but in all cases for the better. The old behavior
2505 was to convert to double first and then do "shortest form"
2506 conversion, and it's always better to just do that as float.
2507 * wtf/text/AtomicString.h: Added float overload of AtomicString::number.
2509 * wtf/text/StringBuilder.cpp:
2510 (WTF::StringBuilder::appendFixedPrecisionNumber): Added float
2512 (WTF::StringBuilder::appendShortestFormNumber): Renamed from
2513 appendECMAScriptNumber and did the above.
2514 (WTF::StringBuilder::appendFixedWidthNumber): Ditto.
2515 * wtf/text/StringBuilder.h: Added overloads for float and
2516 appendShortestFormNumber. The appendNumber and appendECMAScriptNumber
2517 functions are now inlines in the header, since they are expressed
2518 entirely in terms of the other functions.
2520 * wtf/text/WTFString.cpp:
2521 (WTF::String::numberToStringFixedPrecision): Added float overload.
2522 Removed unnecessary explicit conversion to String.
2523 (WTF::String::numberToStringShortest): Renamed from
2524 numberToStringECMAScript and did the above.
2525 (WTF::String::numberToStringFixedWidth): Ditto.
2527 * wtf/text/WTFString.h: Added overloads for float and
2528 numberToStringShortest. The number and numberToStringECMAScript
2529 functions are now inlines in the header, since they are expressed
2530 entirely in terms of the other functions.
2532 2019-03-04 Andy Estes <aestes@apple.com>
2534 [Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
2535 https://bugs.webkit.org/show_bug.cgi?id=195080
2536 <rdar://problem/48421558>
2538 Reviewed by Antti Koivisto.
2540 * wtf/FeatureDefines.h:
2542 2019-03-04 Michael Catanzaro <mcatanzaro@igalia.com>
2544 URLHelpers should use unorm2_quickCheck before converting to NFC
2545 https://bugs.webkit.org/show_bug.cgi?id=194272
2547 Reviewed by Darin Adler.
2549 If the string is already in normalization form C, don't try to normalize it.
2551 * wtf/URLHelpers.cpp:
2552 (WTF::URLHelpers::toNormalizationFormC):
2554 2019-03-02 Darin Adler <darin@apple.com>
2556 Retire legacy dtoa function and DecimalNumber class
2557 https://bugs.webkit.org/show_bug.cgi?id=195253
2559 Reviewed by Daniel Bates.
2561 * WTF.xcodeproj/project.pbxproj: Removed DecimalNumber.cpp/h.
2562 * wtf/CMakeLists.txt: Ditto.
2564 * wtf/DecimalNumber.cpp: Removed.
2565 * wtf/DecimalNumber.h: Removed.
2567 * wtf/JSONValues.cpp:
2568 (WTF::JSONImpl::Value::writeJSON const): Use
2569 StringBuilder::appendECMAScriptNumber instead of custom logic
2570 using the DecimalNumber class.
2573 (WTF::storeInc): Deleted.
2574 (WTF::BigInt): Deleted.
2575 (WTF::multadd): Deleted.
2576 (WTF::hi0bits): Deleted.
2577 (WTF::lo0bits): Deleted.
2578 (WTF::i2b): Deleted.
2579 (WTF::mult): Deleted.
2580 (WTF::P5Node::P5Node): Deleted.
2581 (WTF::pow5mult): Deleted.
2582 (WTF::lshift): Deleted.
2583 (WTF::cmp): Deleted.
2584 (WTF::diff): Deleted.
2585 (WTF::d2b): Deleted.
2586 (WTF::quorem): Deleted.
2587 (WTF::dtoa): Deleted.
2589 * wtf/dtoa.h: Removed DtoaBuffer, dtoa, and NumberToStringBufferLength.
2591 2019-02-27 Darin Adler <darin@apple.com>
2593 Fixed makeString(float) to do shortest-form serialization without first converting to double
2594 https://bugs.webkit.org/show_bug.cgi?id=195142
2596 Reviewed by Daniel Bates.
2598 * wtf/DecimalNumber.cpp: Removed unneeded includes.
2600 * wtf/DecimalNumber.h: Removed unused constructors; over time we will be
2601 deprecating DecimalNumber, so we should removed the unused parts. Also
2602 marked the constructor explicit, removed types used only for arguments for
2603 the constructors, and removed the sign, exponent, significand, and precision
2606 * wtf/JSONValues.cpp:
2607 (WTF::JSONImpl::Value::writeJSON const): Updated for changes to DecimalNumber
2608 switched from NumberToLStringBuffer to NumberToStringBuffer, and for use of
2609 std::array instead of C arrays.
2611 * wtf/dtoa.cpp: Removed unused dtoaRoundSF and dtoaRoundDP functions.
2612 (WTF::dtoa): Updated to use std::array instead of C arrays.
2613 (WTF::dtoaRoundSF): Removed.
2614 (WTF::dtoaRoundDP): Removed.
2615 (WTF::numberToString): Added an overload for float and updated to use std::array.
2616 (WTF::formatStringTruncatingTrailingZerosIfNeeded): Updated to use std::array.
2617 (WTF::numberToFixedPrecisionString): Ditto.
2618 (WTF::numberToFixedWidthString): Ditto.
2620 * wtf/dtoa.h: Changed arrays to be std::array instead of C arrays so the
2621 array types will be checked. Removed dtoaRoundSF and dtoaRoundDP.
2622 Added float overloads for numberToString, numberToFixedPrecisionString,
2623 and numberToFixedWidthString. The only one of these that is called at this
2624 time is numberToString, called by the floating point StringTypeAdapter in
2625 StringConcatenateNummbers.h.
2627 * wtf/text/StringConcatenateNumbers.h: Updated for std::array.
2629 2019-03-01 Darin Adler <darin@apple.com>
2631 Finish removing String::format
2632 https://bugs.webkit.org/show_bug.cgi?id=194893
2634 Reviewed by Daniel Bates.
2636 * wtf/Assertions.cpp:
2637 (WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
2638 (WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.
2640 * wtf/HexNumber.h: Deleted unneeded toString function.
2642 * wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
2643 StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
2644 a bit. Use function templates for writeTo functions rather than having two of each.
2645 Removed unused toString functions. Optimized case where we use have a UChar* and
2646 a length of zero to not force the result to be 16-bit. Also gets rid of a small
2647 NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
2648 static member helper functions to compute string lengths. Added the pad function
2649 and the PaddingSpecification struct template, so we can add padding to anything
2650 we can turn into a string. Got rid of the special case overload for single
2651 arguments, since it only worked for things that the String constructor can handle.
2652 Instead we will now use StringTypeAdapter, which works for more types. Possibly
2653 less optimal for some special cases, which we could specialize for later if we like.
2654 * wtf/text/StringConcatenateNumbers.h: Ditto.
2655 * wtf/text/StringOperators.h: Ditto.
2656 * wtf/text/StringView.h: Ditto.
2658 * wtf/text/WTFString.cpp:
2659 (WTF::createWithFormatAndArguments): Deleted.
2660 (WTF::String::format): Deleted.
2661 * wtf/text/WTFString.h: Deleted declaration of String::format.
2663 2019-03-01 Alex Christensen <achristensen@webkit.org>
2665 Revert r241223, r241235, and r241287
2666 https://bugs.webkit.org/show_bug.cgi?id=194427
2669 * wtf/spi/darwin/XPCSPI.h:
2671 2019-03-01 Simon Fraser <simon.fraser@apple.com>
2673 Add a system trace scope for event region building
2674 https://bugs.webkit.org/show_bug.cgi?id=195226
2676 Reviewed by Jon Lee.
2678 This trace scope measures the time spend converting element rects into Region objects,
2679 which can be large on some pages.
2681 The value for "Display Refresh Dispatch to main thread" was wrong and I fixed it.
2683 * wtf/SystemTracing.h:
2685 2019-02-28 Yusuke Suzuki <ysuzuki@apple.com>
2687 [JSC] sizeof(JSString) should be 16
2688 https://bugs.webkit.org/show_bug.cgi?id=194375
2690 Reviewed by Saam Barati.
2692 * wtf/text/StringImpl.h:
2693 (WTF::StringImpl::flagIs8Bit):
2694 (WTF::StringImpl::flagIsAtomic):
2695 (WTF::StringImpl::flagIsSymbol):
2696 (WTF::StringImpl::maskStringKind):
2697 * wtf/text/WTFString.cpp:
2699 * wtf/text/WTFString.h:
2701 2019-02-28 Mark Lam <mark.lam@apple.com>
2703 Change CheckedArithmetic to not use std::enable_if_t.
2704 https://bugs.webkit.org/show_bug.cgi?id=195187
2705 <rdar://problem/48464665>
2707 Reviewed by Keith Miller.
2709 Because C++11 does not like std::enable_if_t and there's a need to use this file with C++11.
2711 * wtf/CheckedArithmetic.h:
2713 2019-02-27 Simon Fraser <simon.fraser@apple.com>
2715 Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
2717 * wtf/Assertions.cpp:
2718 (WTF::createWithFormatAndArguments): Deleted.
2720 (WTF::StringTypeAdapter<HexNumberBuffer>::toString const):
2721 * wtf/text/StringConcatenate.h:
2723 (WTF::pad): Deleted.
2724 (WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::StringTypeAdapter): Deleted.
2725 (WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::length const): Deleted.
2726 (WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::is8Bit const): Deleted.
2727 (WTF::StringTypeAdapter<PaddingSpecification<UnderlyingAdapterType>>::writeTo const): Deleted.
2728 * wtf/text/StringConcatenateNumbers.h:
2729 (WTF::FormattedNumber::fixedPrecision):
2730 (WTF::FormattedNumber::fixedWidth):
2731 (WTF::StringTypeAdapter<FormattedNumber>::toString const):
2732 * wtf/text/StringOperators.h:
2733 (WTF::StringAppend::StringAppend):
2734 * wtf/text/StringView.h:
2735 (WTF::StringView::invalidate):
2736 * wtf/text/WTFString.cpp:
2737 (WTF::createWithFormatAndArguments):
2738 (WTF::String::format):
2739 * wtf/text/WTFString.h:
2741 2019-02-26 Mark Lam <mark.lam@apple.com>
2743 Remove remaining poisoning code.
2744 https://bugs.webkit.org/show_bug.cgi?id=194138
2746 Reviewed by Saam Barati.
2748 This patch removes the instantiation of Poisoned variants of the various containers
2749 but retains the ability of those containers to work with pointer traits. This
2750 allows us to use them with smart pointers in the future (just like we used to with
2751 Poisoned values). At minimum, this ability will be useful when we want to insert
2752 an observer into the container storage type for debugging purposes, or to collect
2753 statistics for profiling.
2755 * WTF.xcodeproj/project.pbxproj:
2757 * wtf/CMakeLists.txt:
2759 * wtf/Poisoned.cpp: Removed.
2760 * wtf/Poisoned.h: Removed.
2761 * wtf/PoisonedUniquePtr.h: Removed.
2763 * wtf/RefCountedArray.h:
2765 * wtf/WTFAssertions.cpp:
2767 2019-02-26 Keith Miller <keith_miller@apple.com>
2769 Code quality cleanup in NeverDestroyed
2770 https://bugs.webkit.org/show_bug.cgi?id=194824
2772 Reviewed by Yusuke Suzuki.
2774 First, move data members to the end of the class per WebKit
2775 style. Also, add forbid heap allocation since we expect the
2776 NeverDestroyed classes to be static.
2778 * wtf/NeverDestroyed.h:
2780 2019-02-25 Xabier Rodriguez Calvar <calvaris@igalia.com>
2782 Fix WTFLogVerbose variadic parameters forwarding
2783 https://bugs.webkit.org/show_bug.cgi?id=194920
2785 Reviewed by Alex Christensen.
2787 WTFLogVerbose was passing the va_list to WTFLog but this function
2788 also used variadic parameters and this is not allowed in C (that
2789 part of the code is extern "C").
2791 * wtf/Assertions.cpp:
2792 (WTF::WTFLogVaList): Created to take a va_list argument instead of
2793 variadic parameters.
2794 (WTF::WTFLog): Kept with variadic parameters, which are
2795 transformed to va_list and passed to WTFLogVaList.
2796 (WTF::WTFLogVerbose): Use WTFLogVaList instead of WTFLog.
2798 2019-02-25 Sam Weinig <sam@webkit.org>
2800 Update double-conversion to the latest version
2801 https://bugs.webkit.org/show_bug.cgi?id=194994
2803 Import the latest version of the double-conversion library based on
2804 https://github.com/google/double-conversion/commit/990c44707c70832dc1ce1578048c2198bafd3307
2806 In additon to importing the code, the following changes were applied (or re-applied) to maintain
2807 parity with what we had previously:
2808 - Add #include "config.h" to each cpp file.
2809 - Put everything inside the WTF namespace.
2810 - Changed all in library includes to be of the form #include <wtf/dtoa/FILE.h>.
2811 - Renamed double_conversion::Vector<> to double_conversion::BufferReference<>.
2812 - Replaced duplicated functions with ASCIICType.h variants
2813 - Made CachedPower table a constexpr.
2814 - Exported (via WTF_EXPORT_PRIVATE) several functions in double-conversion.h.
2815 - Made substantial changes to StringToDoubleConverter to avoid unnecessary overhead of
2816 parameterization, as we only ever want one configuration. Instead of constructing a
2817 configured class and calling StringToDouble on it, StringToDouble is now a static
2818 function. This allows a bunch of now dead code (hex support, octal support, etc.) to
2819 be eliminated. As StringToDoubleConverter now supports single precision floats, some
2820 additional templating of StringToIeee was added to avoid extra unnecessary branching.
2821 - Added RemoveCharacters function to double_conversion::StringBuilder.
2823 Reviewed by Darin Adler.
2825 * WTF.xcodeproj/project.pbxproj:
2826 * wtf/CMakeLists.txt:
2827 * wtf/dtoa/AUTHORS: Added.
2828 * wtf/dtoa/README: Removed.
2829 * wtf/dtoa/README.md: Added.
2830 * wtf/dtoa/bignum-dtoa.cc:
2831 * wtf/dtoa/bignum-dtoa.h:
2832 * wtf/dtoa/bignum.cc:
2833 * wtf/dtoa/bignum.h:
2834 (WTF::double_conversion::Bignum::Times10):
2835 (WTF::double_conversion::Bignum::Equal):
2836 (WTF::double_conversion::Bignum::LessEqual):
2837 (WTF::double_conversion::Bignum::Less):
2838 (WTF::double_conversion::Bignum::PlusEqual):
2839 (WTF::double_conversion::Bignum::PlusLessEqual):
2840 (WTF::double_conversion::Bignum::PlusLess):
2841 (WTF::double_conversion::Bignum::EnsureCapacity):
2842 (WTF::double_conversion::Bignum::BigitLength const):
2843 * wtf/dtoa/cached-powers.cc:
2844 * wtf/dtoa/cached-powers.h:
2845 * wtf/dtoa/diy-fp.cc:
2846 * wtf/dtoa/diy-fp.h:
2847 (WTF::double_conversion::DiyFp::DiyFp):
2848 (WTF::double_conversion::DiyFp::Subtract):
2849 (WTF::double_conversion::DiyFp::Minus):
2850 (WTF::double_conversion::DiyFp::Times):
2851 (WTF::double_conversion::DiyFp::Normalize):
2852 (WTF::double_conversion::DiyFp::f const):
2853 (WTF::double_conversion::DiyFp::e const):
2854 (WTF::double_conversion::DiyFp::set_f):
2855 (WTF::double_conversion::DiyFp::set_e):
2856 * wtf/dtoa/double-conversion.cc:
2857 * wtf/dtoa/double-conversion.h:
2858 (WTF::double_conversion::DoubleToStringConverter::DoubleToStringConverter):
2859 (WTF::double_conversion::DoubleToStringConverter::ToShortest const):
2860 (WTF::double_conversion::DoubleToStringConverter::ToShortestSingle const):
2861 (WTF::double_conversion::StringToDoubleConverter::StringToDoubleConverter):
2862 * wtf/dtoa/double.h: Removed.
2863 * wtf/dtoa/fast-dtoa.cc:
2864 * wtf/dtoa/fast-dtoa.h:
2865 * wtf/dtoa/fixed-dtoa.cc:
2866 * wtf/dtoa/fixed-dtoa.h:
2867 * wtf/dtoa/ieee.h: Added.
2868 (WTF::double_conversion::double_to_uint64):
2869 (WTF::double_conversion::uint64_to_double):
2870 (WTF::double_conversion::float_to_uint32):
2871 (WTF::double_conversion::uint32_to_float):
2872 (WTF::double_conversion::Double::Double):
2873 (WTF::double_conversion::Double::AsDiyFp const):
2874 (WTF::double_conversion::Double::AsNormalizedDiyFp const):
2875 (WTF::double_conversion::Double::AsUint64 const):
2876 (WTF::double_conversion::Double::NextDouble const):
2877 (WTF::double_conversion::Double::PreviousDouble const):
2878 (WTF::double_conversion::Double::Exponent const):
2879 (WTF::double_conversion::Double::Significand const):
2880 (WTF::double_conversion::Double::IsDenormal const):
2881 (WTF::double_conversion::Double::IsSpecial const):
2882 (WTF::double_conversion::Double::IsNan const):
2883 (WTF::double_conversion::Double::IsInfinite const):
2884 (WTF::double_conversion::Double::Sign const):
2885 (WTF::double_conversion::Double::UpperBoundary const):
2886 (WTF::double_conversion::Double::NormalizedBoundaries const):
2887 (WTF::double_conversion::Double::LowerBoundaryIsCloser const):
2888 (WTF::double_conversion::Double::value const):
2889 (WTF::double_conversion::Double::SignificandSizeForOrderOfMagnitude):
2890 (WTF::double_conversion::Double::Infinity):
2891 (WTF::double_conversion::Double::NaN):
2892 (WTF::double_conversion::Double::DiyFpToUint64):
2893 (WTF::double_conversion::Single::Single):
2894 (WTF::double_conversion::Single::AsDiyFp const):
2895 (WTF::double_conversion::Single::AsUint32 const):
2896 (WTF::double_conversion::Single::Exponent const):
2897 (WTF::double_conversion::Single::Significand const):
2898 (WTF::double_conversion::Single::IsDenormal const):
2899 (WTF::double_conversion::Single::IsSpecial const):
2900 (WTF::double_conversion::Single::IsNan const):
2901 (WTF::double_conversion::Single::IsInfinite const):
2902 (WTF::double_conversion::Single::Sign const):
2903 (WTF::double_conversion::Single::NormalizedBoundaries const):
2904 (WTF::double_conversion::Single::UpperBoundary const):
2905 (WTF::double_conversion::Single::LowerBoundaryIsCloser const):
2906 (WTF::double_conversion::Single::value const):
2907 (WTF::double_conversion::Single::Infinity):
2908 (WTF::double_conversion::Single::NaN):
2909 * wtf/dtoa/strtod.cc:
2910 * wtf/dtoa/strtod.h:
2913 (WTF::double_conversion::Max):
2914 (WTF::double_conversion::Min):
2915 (WTF::double_conversion::StrLength):
2916 (WTF::double_conversion::BufferReference::BufferReference):
2917 (WTF::double_conversion::BufferReference::SubVector):
2918 (WTF::double_conversion::BufferReference::length const):
2919 (WTF::double_conversion::BufferReference::is_empty const):
2920 (WTF::double_conversion::BufferReference::start const):
2921 (WTF::double_conversion::BufferReference::operator[] const):
2922 (WTF::double_conversion::BufferReference::first):
2923 (WTF::double_conversion::BufferReference::last):
2924 (WTF::double_conversion::StringBuilder::StringBuilder):
2925 (WTF::double_conversion::StringBuilder::~StringBuilder):
2926 (WTF::double_conversion::StringBuilder::size const):
2927 (WTF::double_conversion::StringBuilder::position const):
2928 (WTF::double_conversion::StringBuilder::Reset):
2929 (WTF::double_conversion::StringBuilder::AddCharacter):
2930 (WTF::double_conversion::StringBuilder::AddString):
2931 (WTF::double_conversion::StringBuilder::AddSubstring):
2932 (WTF::double_conversion::StringBuilder::AddPadding):
2933 (WTF::double_conversion::StringBuilder::RemoveCharacters):
2934 (WTF::double_conversion::StringBuilder::Finalize):
2935 (WTF::double_conversion::StringBuilder::is_finalized const):
2936 (WTF::double_conversion::BitCast):
2937 (WTF::double_conversion::BufferReference::SubBufferReference): Deleted.
2938 (WTF::double_conversion::StringBuilder::SetPosition): Deleted.
2940 2019-02-20 Darin Adler <darin@apple.com>
2942 Finish removing String::format
2943 https://bugs.webkit.org/show_bug.cgi?id=194893
2945 Reviewed by Daniel Bates.
2947 * wtf/Assertions.cpp:
2948 (WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
2949 (WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.
2951 * wtf/HexNumber.h: Deleted unneeded toString function.
2953 * wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
2954 StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
2955 a bit. Use function templates for writeTo functions rather than having two of each.
2956 Removed unused toString functions. Optimized case where we use have a UChar* and
2957 a length of zero to not force the result to be 16-bit. Also gets rid of a small
2958 NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
2959 static member helper functions to compute string lengths. Added the pad function
2960 and the PaddingSpecification struct template, so we can add padding to anything
2961 we can turn into a string. Got rid of the special case overload for single
2962 arguments, since it only worked for things that the String constructor can handle.
2963 Instead we will now use StringTypeAdapter, which works for more types. Possibly
2964 less optimal for some special cases, which we could specialize for later if we like.
2965 * wtf/text/StringConcatenateNumbers.h: Ditto.
2966 * wtf/text/StringOperators.h: Ditto.
2967 * wtf/text/StringView.h: Ditto.
2969 * wtf/text/WTFString.cpp:
2970 (WTF::createWithFormatAndArguments): Deleted.
2971 (WTF::String::format): Deleted.
2972 * wtf/text/WTFString.h: Deleted declaration of String::format.
2974 2019-02-23 Michael Catanzaro <mcatanzaro@igalia.com>
2976 Unreviewed, fix find/replace error from r232178
2978 Looks like this was the only such error in that commit.
2980 * wtf/URLHelpers.cpp:
2981 (WTF::URLHelpers::isLookalikeCharacter):
2983 2019-02-23 Mark Lam <mark.lam@apple.com>
2985 Add an exception check and some assertions in StringPrototype.cpp.
2986 https://bugs.webkit.org/show_bug.cgi?id=194962
2987 <rdar://problem/48013416>
2989 Reviewed by Yusuke Suzuki and Saam Barati.
2991 Add an AssertNoOverflow overflow handler which allows us to do CheckedArithmetic
2992 for assertion purpose only on debug builds but sacrifices no performance on
2995 * wtf/CheckedArithmetic.h:
2996 (WTF::AssertNoOverflow::overflowed):
2997 (WTF::AssertNoOverflow::clearOverflow):
2998 (WTF::AssertNoOverflow::crash):
2999 (WTF::AssertNoOverflow::hasOverflowed const):
3000 (WTF::observesOverflow):
3001 (WTF::observesOverflow<AssertNoOverflow>):
3004 (WTF::safeMultiply):
3005 (WTF::Checked::operator+=):
3006 (WTF::Checked::operator-=):
3007 (WTF::Checked::operator*=):
3012 2019-02-23 Keith Miller <keith_miller@apple.com>
3014 Add new mac target numbers
3015 https://bugs.webkit.org/show_bug.cgi?id=194955
3017 Reviewed by Tim Horton.
3019 * Configurations/Base.xcconfig:
3020 * Configurations/DebugRelease.xcconfig:
3022 2019-02-21 Antoine Quint <graouts@apple.com>
3024 Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI
3025 https://bugs.webkit.org/show_bug.cgi?id=194531
3026 <rdar://problem/47714562>
3028 Reviewed by Tim Horton.
3030 Follow-up commit to ensure this SPI is only called on newer versions of iOS.
3034 2019-02-21 Dean Jackson <dino@apple.com>
3036 Rotation animations sometimes use the wrong origin (affects apple.com)
3037 https://bugs.webkit.org/show_bug.cgi?id=194878
3038 <rdar://problem/43908047>
3040 Follow-up commit to ensure this change only affects newer versions
3043 * wtf/Platform.h: Add a version check.
3045 2019-02-20 Alex Christensen <achristensen@webkit.org>
3047 URL percent-encode operations should use checked arithmetic for buffer allocation length
3048 https://bugs.webkit.org/show_bug.cgi?id=194877
3049 <rdar://problem/48212062>
3051 Reviewed by Tim Horton.
3053 * wtf/URLHelpers.cpp:
3054 (WTF::URLHelpers::userVisibleURL):
3055 * wtf/cocoa/NSURLExtras.mm:
3056 (WTF::dataWithUserTypedString):
3058 2019-02-20 Dean Jackson <dino@apple.com>
3060 Rotation animations sometimes use the wrong origin (affects apple.com)
3061 https://bugs.webkit.org/show_bug.cgi?id=194878
3062 <rdar://problem/43908047>
3064 Reviewed by Simon Fraser.
3066 * wtf/Platform.h: Add HAVE(CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED).
3068 2019-02-20 Andy Estes <aestes@apple.com>
3070 [Xcode] Add SDKVariant.xcconfig to various Xcode projects
3071 https://bugs.webkit.org/show_bug.cgi?id=194869
3073 Rubber-stamped by Jer Noble.
3075 * WTF.xcodeproj/project.pbxproj:
3077 2019-02-20 Adrian Perez de Castro <aperez@igalia.com>
3079 [WPE][GTK] Enable support for CONTENT_EXTENSIONS
3080 https://bugs.webkit.org/show_bug.cgi?id=167941
3082 Reviewed by Carlos Garcia Campos.
3084 Add specialization of the refGPtr() and derefGPtr() templates for GMappedFile.
3086 * wtf/glib/GRefPtr.cpp:
3087 (WTF::refGPtr): Added.
3088 (WTF::derefGPtr): Added.
3089 * wtf/glib/GRefPtr.h: Declare template specializations.
3091 2019-02-19 Commit Queue <commit-queue@webkit.org>
3093 Unreviewed, rolling out r241770.
3094 https://bugs.webkit.org/show_bug.cgi?id=194833
3096 Caused crashes (Requested by smfr on #webkit).
3100 "Code quality cleanup in NeverDestroyed"
3101 https://bugs.webkit.org/show_bug.cgi?id=194824
3102 https://trac.webkit.org/changeset/241770
3104 2019-02-19 Keith Miller <keith_miller@apple.com>
3106 Code quality cleanup in NeverDestroyed
3107 https://bugs.webkit.org/show_bug.cgi?id=194824
3109 Reviewed by Yusuke Suzuki.
3111 First, move data members to the end of the class per WebKit
3112 style. Also, add forbid heap allocation since we expect the
3113 NeverDestroyed classes to be static.
3115 * wtf/NeverDestroyed.h:
3117 2019-02-16 Darin Adler <darin@apple.com>
3119 Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
3120 https://bugs.webkit.org/show_bug.cgi?id=194752
3122 Reviewed by Daniel Bates.
3124 * WTF.xcodeproj/project.pbxproj: Added HexNumber.cpp and Logger.cpp.
3125 * wtf/CMakeLists.txt: Ditto.
3127 * wtf/HexNumber.cpp: Added.
3128 (WTF::Internal::appendHex): Non-inline, non-template hex formatting logic.
3131 (WTF::Internal::appendHex): Refactored main logic of appendUnsignedAsHex and
3132 appendUnsignedAsHexFixedSize so they can be reused in a function named hex for
3133 use with StringTypeAdapter.
3134 (WTF::appendUnsignedAsHex): Ditto.
3135 (WTF::appendUnsignedAsHexFixedSize): Ditto.
3137 (WTF::StringTypeAdapter<HexNumberBuffer>): Added.
3139 * wtf/Logger.cpp: Added.
3140 (WTF::Logger::LogSiteIdentifier::toString const): Made this a non-template
3141 function and moved it here so that we don't need to include HexNumber.h
3142 in Logger.h. Since HexNumber.h has substantial code in it, it's good if we
3143 don't include it in any other headers.
3146 (WTF::LogArgument<Logger::LogSiteIdentifier>::toString): Changed to call
3147 a non-template function, LogSiteIdentifier::toString.
3149 * wtf/text/StringConcatenateNumbers.h: Replaced overloaded writeTo functions
3150 with function templates and used StringImpl::copyCharacters instead of
3153 2019-02-18 Joseph Pecoraro <pecoraro@apple.com>
3155 Web Inspector: Better categorize CPU usage per-thread / worker
3156 https://bugs.webkit.org/show_bug.cgi?id=194564
3158 Reviewed by Devin Rousso.
3161 * wtf/Threading.cpp:
3162 (WTF::Thread::allThreadsMutex):
3163 (WTF::Thread::create):
3164 (WTF::Thread::didExit):
3165 Add a set of all WTF::Thread created threads.
3167 2019-02-18 Tadeu Zagallo <tzagallo@apple.com>
3169 Bytecode cache should a have a boot-specific validation
3170 https://bugs.webkit.org/show_bug.cgi?id=194769
3171 <rdar://problem/48149509>
3173 Reviewed by Keith Miller.
3175 Add helper to get kern.bootsessionuuid from sysctl
3178 (WTF::bootSessionUUIDString):
3181 2019-02-17 David Kilzer <ddkilzer@apple.com>
3183 Unreviewed, rolling out r241620.
3185 "Causes use-after-free crashes running layout tests with ASan and GuardMalloc."
3186 (Requested by ddkilzer on #webkit.)
3190 "[WTF] Add environment variable helpers"
3191 https://bugs.webkit.org/show_bug.cgi?id=192405
3192 https://trac.webkit.org/changeset/241620
3194 2019-02-15 Ross Kirsling <ross.kirsling@sony.com>
3196 [WTF] Add environment variable helpers
3197 https://bugs.webkit.org/show_bug.cgi?id=192405
3199 Reviewed by Michael Catanzaro.
3201 Create a new Environment API as a platform-independent, thread-safe(r)
3202 way to get and set environment variables.
3204 * WTF.xcodeproj/project.pbxproj:
3205 * wtf/CMakeLists.txt:
3206 * wtf/Environment.h: Added.
3207 * wtf/PlatformGTK.cmake:
3208 * wtf/PlatformJSCOnly.cmake:
3209 * wtf/PlatformMac.cmake:
3210 * wtf/PlatformPlayStation.cmake:
3211 * wtf/PlatformWPE.cmake:
3212 * wtf/PlatformWin.cmake:
3213 * wtf/posix/EnvironmentPOSIX.cpp: Added.
3214 * wtf/win/EnvironmentWin.cpp: Added.
3215 Introduce WTF::Environment.
3217 * wtf/Threading.cpp:
3218 (WTF::threadingIsInitialized):
3219 (WTF::initializeThreading):
3221 Introduce WTF::threadingIsInitialized() so that we can ASSERT that it's
3222 false before setting an environment variable through the new API.
3225 (WTF::initializeLogFileOnce):
3226 * wtf/NumberOfCores.cpp:
3227 (WTF::numberOfProcessorCores):
3228 * wtf/posix/FileSystemPOSIX.cpp:
3229 (WTF::FileSystemImpl::openTemporaryFile):
3230 Utilize WTF::Environment where possible.
3232 2019-02-15 Brian Burg <bburg@apple.com>
3234 [Mac] WebInspectorUI.framework does not need to be soft-linked anymore
3235 https://bugs.webkit.org/show_bug.cgi?id=194411
3236 <rdar://problem/47787614>
3238 Reviewed by Joseph Pecoraro.
3240 * wtf/cocoa/SoftLinking.h:
3241 Remove macro that now has no uses.
3243 2019-02-15 Commit Queue <commit-queue@webkit.org>
3245 Unreviewed, rolling out r241559 and r241566.
3246 https://bugs.webkit.org/show_bug.cgi?id=194710
3248 Causes layout test crashes under GuardMalloc (Requested by
3249 ryanhaddad on #webkit).
3251 Reverted changesets:
3253 "[WTF] Add environment variable helpers"
3254 https://bugs.webkit.org/show_bug.cgi?id=192405
3255 https://trac.webkit.org/changeset/241559
3257 "Unreviewed build fix for WinCairo Debug after r241559."
3258 https://trac.webkit.org/changeset/241566
3260 2019-02-15 Truitt Savell <tsavell@apple.com>
3262 Unreviewed, rolling out r241564.
3264 Caused 50+ Timeouts on Mac WK2, mostly in the http/ directory
3268 "[Mac] WebInspectorUI.framework does not need to be soft-
3270 https://bugs.webkit.org/show_bug.cgi?id=194411
3271 https://trac.webkit.org/changeset/241564
3273 2019-02-15 Dominik Infuehr <dinfuehr@igalia.com>
3275 Fix deadlock on Linux/x64 between SamplingProfiler and VMTraps
3276 https://bugs.webkit.org/show_bug.cgi?id=194014
3278 Reviewed by Michael Catanzaro.
3280 Do not block SIGUSR1 when installing signal handlers, since this signal
3281 is used to suspend/resume machine threads on Linux.
3283 ftl-ai-filter-phantoms-should-clear-clear-value.js deadlocked with
3284 enabled watchdog and sampling.
3286 Deadlock happened in the following situation:
3288 Thread 1 (Sampling): SamplingProfiler.cpp:takeSample takes all needed locks
3289 and then tries to suspend the main thread.
3291 Thread 2 (Watchdog/VMTraps): Before the Sampling-Thread suspends the main thread
3292 a signal is caught and the signal handler is invoked (VMTraps.cpp:SignalSender).
3293 SignalSender tries to lock codeBlockSet, but this is already locked by the
3296 The SamplingProfiler can only give up the lock when it suspends
3297 the thread. However since the VMTraps signal handler is active, all other signals blocked,
3298 therefore the SamplingProfiler also waits until its signal handler is invoked.
3300 This patch fixes this by not blocking SIGUSR1 in installSignalHandler, since
3301 it is used to suspend/resume threads on Linux.
3304 * wtf/posix/ThreadingPOSIX.cpp:
3305 * wtf/threads/Signals.cpp:
3306 (WTF::installSignalHandler):
3308 2019-02-15 Saam barati <sbarati@apple.com>
3310 [WebAssembly] Write a new register allocator for Air O0 and make BBQ use it
3311 https://bugs.webkit.org/show_bug.cgi?id=194036
3313 Reviewed by Yusuke Suzuki.
3316 (WTF::IndexMap::at):
3317 (WTF::IndexMap::at const):
3318 (WTF::IndexMap::operator[]):
3319 (WTF::IndexMap::operator[] const):
3321 2019-02-14 Brian Burg <bburg@apple.com>
3323 [Mac] WebInspectorUI.framework does not need to be soft-linked anymore
3324 https://bugs.webkit.org/show_bug.cgi?id=194411
3325 <rdar://problem/47787614>
3327 Reviewed by Joseph Pecoraro.
3329 * wtf/cocoa/SoftLinking.h:
3330 Remove macro that now has no uses.
3332 2019-02-14 Ross Kirsling <ross.kirsling@sony.com>
3334 [WTF] Add environment variable helpers
3335 https://bugs.webkit.org/show_bug.cgi?id=192405
3337 Reviewed by Michael Catanzaro.
3339 Create a new Environment API as a platform-independent, thread-safe(r)
3340 way to get and set environment variables.
3342 * WTF.xcodeproj/project.pbxproj:
3343 * wtf/CMakeLists.txt:
3344 * wtf/Environment.h: Added.
3345 * wtf/PlatformGTK.cmake:
3346 * wtf/PlatformJSCOnly.cmake:
3347 * wtf/PlatformMac.cmake:
3348 * wtf/PlatformPlayStation.cmake:
3349 * wtf/PlatformWPE.cmake:
3350 * wtf/PlatformWin.cmake:
3351 * wtf/posix/EnvironmentPOSIX.cpp: Added.
3352 * wtf/win/EnvironmentWin.cpp: Added.
3353 Introduce WTF::Environment.
3355 * wtf/Threading.cpp:
3356 (WTF::threadingIsInitialized):
3357 (WTF::initializeThreading):
3359 Introduce WTF::threadingIsInitialized() so that we can ASSERT that it's
3360 false before setting an environment variable through the new API.
3363 (WTF::initializeLogFileOnce):
3364 * wtf/NumberOfCores.cpp:
3365 (WTF::numberOfProcessorCores):
3366 * wtf/posix/FileSystemPOSIX.cpp:
3367 (WTF::FileSystemImpl::openTemporaryFile):
3368 Utilize WTF::Environment where possible.
3370 2019-02-13 Yusuke Suzuki <ysuzuki@apple.com>
3372 We should only make rope strings when concatenating strings long enough.
3373 https://bugs.webkit.org/show_bug.cgi?id=194465
3375 Reviewed by Mark Lam.
3377 * wtf/text/StringImpl.h:
3378 (WTF::StringImpl::headerSize):
3380 2019-02-12 Tim Horton <timothy_horton@apple.com>
3382 Remove WKLegacyPDFView
3383 https://bugs.webkit.org/show_bug.cgi?id=194559
3385 Reviewed by Andy Estes.
3387 * wtf/FeatureDefines.h:
3389 2019-02-12 David Kilzer <ddkilzer@apple.com>
3391 REGRESSION (r238955, r240494): Soft-linking optional Lookup.framework triggers release assertion when missing
3392 <https://webkit.org/b/194529>
3393 <rdar://problem/47924449>
3395 Reviewed by Eric Carlson.
3397 * wtf/cocoa/SoftLinking.h:
3398 (SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_IS_OPTIONAL): Rename
3399 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_ASSERTION() to this
3400 and change `assertion` argument to `isOptional`. Pass
3401 `isOptional` to framework##Library() method to control assertion
3402 behavior. Only check RELEASE_ASSERT() if `!isOptional`, else
3403 that code should be optimized out by the compiler. This fixes
3405 (NO_ASSERT): Remove macro since it's no longer used.
3406 (SOFT_LINK_IS_OPTIONAL): Add macro to use for soft-linking
3408 (SOFT_LINK_IS_NOT_OPTIONAL): Add macro to use for soft-linking
3409 non-optional classes.
3410 (SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT): Update to use new
3411 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_IS_OPTIONAL() macro.
3412 (SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT): Ditto.
3413 (SOFT_LINK_CLASS_FOR_SOURCE): Ditto.
3414 (SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL): Ditto.
3416 2019-02-12 Andy Estes <aestes@apple.com>
3418 [iOSMac] Enable Parental Controls Content Filtering
3419 https://bugs.webkit.org/show_bug.cgi?id=194521
3422 Reviewed by Tim Horton.
3426 2019-02-11 Myles C. Maxfield <mmaxfield@apple.com>
3428 [Cocoa] Ask platform for generic font family mappings
3429 https://bugs.webkit.org/show_bug.cgi?id=187723
3430 <rdar://problem/41892438>
3432 Reviewed by Brent Fulgham.
3434 Add an ENABLE in Platform.
3438 2019-02-11 Truitt Savell <tsavell@apple.com>
3440 Unreviewed, rolling out r241229.
3442 Revision broke internal builds for watchOS.
3446 "[Cocoa] Ask platform for generic font family mappings"
3447 https://bugs.webkit.org/show_bug.cgi?id=187723
3448 https://trac.webkit.org/changeset/241229
3450 2019-02-10 Darin Adler <darin@apple.com>
3452 Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
3453 https://bugs.webkit.org/show_bug.cgi?id=194485
3455 Reviewed by Daniel Bates.
3457 * wtf/HexNumber.h: Removed unused functions placeByteAsHexCompressIfPossible and
3458 placeByteAsHex. Can always bring them back if someone needs them. Updated
3459 appendUnsignedAsHex to be a template so we can use it on any integer type,
3460 got rid of unnecessary use of Vector and unnecessary reversing, and got rid of
3461 appendUnsigned64AsHex since callers can now just use appendUnsignedAsHex.
3462 Rewrote appendUnsignedAsHexFixedSize to share mode code rather than replicating.
3464 * wtf/Logger.h: Use appendUnsignedAsHex instead of appendUnsigned64AsHex.
3466 * wtf/URL.cpp: Removed unnecessary include of HexNumber.h.
3468 * wtf/cocoa/NSURLExtras.h: Added missing include of Foundation.h that was
3469 worked around in NSURLExtras.mm.
3470 * wtf/cocoa/NSURLExtras.mm: Removed unnecessary includes of HexNumber.h
3473 2019-02-09 Darin Adler <darin@apple.com>
3475 Eliminate unnecessary String temporaries by using StringConcatenateNumbers
3476 https://bugs.webkit.org/show_bug.cgi?id=194021
3478 Reviewed by Geoffrey Garen.
3481 (WTF::URL::setPort): Remove String::number and let makeString do the conversion
3482 without allocating/destroying a String. Added a cast to "unsigned" to sidestep the
3483 ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
3484 and sometimes used for UTF-16 code units (UChar) and can be the same type.
3486 * wtf/text/StringConcatenateNumbers.h:
3487 Changed FormattedNumber::fixedPrecision to more closely match String::number and
3488 StringBuilder::appendNumber by defaulting to truncating trailing zeros and using
3489 a named enumeration for the truncation policy rather than a boolean.
3492 2019-02-09 Yusuke Suzuki <ysuzuki@apple.com>
3494 Unreviewed, rolling in r241237 again
3495 https://bugs.webkit.org/show_bug.cgi?id=194469
3497 After the measurement, this patch was unrelated to recent regression.
3499 * wtf/text/StringImpl.h:
3500 (WTF::StringImpl::isSubString const):
3501 (WTF::StringImpl::createSubstringSharingImpl):
3503 2019-02-09 Commit Queue <commit-queue@webkit.org>
3505 Unreviewed, rolling out r241237.
3506 https://bugs.webkit.org/show_bug.cgi?id=194474
3508 Shows significant memory increase in WSL (Requested by
3509 yusukesuzuki on #webkit).
3513 "[WTF] Use BufferInternal StringImpl if substring StringImpl
3515 https://bugs.webkit.org/show_bug.cgi?id=194469
3516 https://trac.webkit.org/changeset/241237
3518 2019-02-08 Yusuke Suzuki <ysuzuki@apple.com>
3520 [WTF] Use BufferInternal StringImpl if substring StringImpl takes more memory
3521 https://bugs.webkit.org/show_bug.cgi?id=194469
3523 Reviewed by Geoffrey Garen.
3525 Because pointer is large and aligned in 64bit in 64bit architecture, BufferSubstring StringImpl
3526 implementation takes more memory than BufferInternal StringImpl implementation for small strings.
3527 And BufferInternal StringImpl does not have a problem like, small substring StringImpl keeps super
3528 large owner StringImpl. This patch calculates the required size of memory and selects the more efficient one.
3530 * wtf/text/StringImpl.h:
3531 (WTF::StringImpl::isSubString const):
3532 (WTF::StringImpl::createSubstringSharingImpl):
3534 2019-02-08 Alex Christensen <achristensen@webkit.org>
3536 Add SPI to use networking daemon instead of XPC service
3537 https://bugs.webkit.org/show_bug.cgi?id=194427
3539 Reviewed by Geoffrey Garen.
3541 * wtf/spi/darwin/XPCSPI.h:
3542 Instead of using XPC bootstrap SPI, we just send a separate message.
3543 xpc_copy_bootstrap does not seem to work in daemons.
3545 2019-02-08 Truitt Savell <tsavell@apple.com>
3547 Unreviewed, rolling out r241197.
3549 Broke iOS Simulator Debug build and casued 1 API failure on
3554 "Add SPI to use networking daemon instead of XPC service"
3555 https://bugs.webkit.org/show_bug.cgi?id=194427
3556 https://trac.webkit.org/changeset/241197
3558 2019-02-08 Alex Christensen <achristensen@webkit.org>
3560 Add SPI to use networking daemon instead of XPC service
3561 https://bugs.webkit.org/show_bug.cgi?id=194427
3563 Reviewed by Geoffrey Garen.
3565 * wtf/spi/darwin/XPCSPI.h:
3566 Instead of using XPC bootstrap SPI, we just send a separate message.
3567 xpc_copy_bootstrap does not seem to work in daemons.
3569 2019-02-08 Benjamin Poulain <benjamin@webkit.org>
3571 clampTo(): do not convert the input to double when dealing with integers
3572 https://bugs.webkit.org/show_bug.cgi?id=194263
3573 <rdar://problem/47692312>
3575 Reviewed by Darin Adler.
3577 Previously, every use of clampTo() was converting the input to double,
3578 doing the comparison in double, then casting back to whatever type was needed.
3580 In many case, that was very wasteful. WebKit has many cases of clampTo() with
3581 the same type as input/output, or with integer types of different size/sign.
3583 This patch adds a few versions of clampTo() for the common cases seen in WebKit.
3584 In each case, I tried to minimize the amount of conversion needed at runtime.
3589 2019-02-07 Chris Dumez <cdumez@apple.com>
3591 Mark more heap-allocated classes as fast allocated
3592 https://bugs.webkit.org/show_bug.cgi?id=194422
3594 Reviewed by Ryosuke Niwa.
3597 (WTF::Function<Out):
3600 * wtf/text/StringView.cpp:
3602 2019-02-07 Per Arne Vollan <pvollan@apple.com>