1 2019-07-01 Philippe Normand <pnormand@igalia.com>
3 [GStreamer] Cannot play Bert's Bytes radio stream from http://radio.dos.nl/
4 https://bugs.webkit.org/show_bug.cgi?id=198376
6 Reviewed by Xabier Rodriguez-Calvar.
8 * wtf/glib/GLibUtilities.h:
9 (enumToString): Utility function to get a string representation of of a GLib enum.
11 2019-06-22 Darin Adler <darin@apple.com>
13 Streamline some string code, focusing on functions that were using substringSharingImpl
14 https://bugs.webkit.org/show_bug.cgi?id=198898
16 Reviewed by Daniel Bates.
19 (WTF::URLHelpers::applyHostNameFunctionToURLString): Change code using
20 substringSharingImpl so it could call String::find to call StringView::contains
21 instead. Also rewrote lambdas to be simpler and likely more efficient.
22 Rewrote another case using substringSharingImpl so it could call String::find
23 to call StringView::find instead.
25 * wtf/text/StringView.cpp:
26 (WTF::StringView::startsWith const): Added.
28 * wtf/text/StringView.h: Tweaked style a bit, and added an overload of
29 StringView::contains that takes a CodeUnitMatchFunction and an overload
30 of startsWith that cakes a UChar.
32 2019-06-28 Konstantin Tokarev <annulen@yandex.ru>
34 Remove traces of ENABLE_ICONDATABASE remaining after its removal in 219733
35 https://bugs.webkit.org/show_bug.cgi?id=199317
37 Reviewed by Michael Catanzaro.
39 While IconDatabase and all code using it was removed,
40 ENABLE_ICONDATABASE still exists as build option and C++ macro.
42 * wtf/FeatureDefines.h:
44 2019-06-27 Konstantin Tokarev <annulen@yandex.ru>
46 Avoid using WTF::Function for passing local function pointers and closures in URLHelpers.cpp
47 https://bugs.webkit.org/show_bug.cgi?id=199271
49 Reviewed by Yusuke Suzuki.
51 WTF::Function allocates memory on heap, which is totally redundant in this
55 (WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
57 2019-06-27 Timothy Hatcher <timothy@apple.com>
59 Move WebKitLegacy off of a couple AppKit ivars.
60 https://bugs.webkit.org/show_bug.cgi?id=199279
61 rdar://problem/34983438
63 Reviewed by Tim Horton.
65 * wtf/Platform.h: Added HAVE_SUBVIEWS_IVAR_SPI.
67 2019-06-27 Beth Dakin <bdakin@apple.com>
69 Upstream use of MACCATALYST
70 https://bugs.webkit.org/show_bug.cgi?id=199245
71 rdar://problem/51687723
73 Reviewed by Tim Horton.
75 * Configurations/SDKVariant.xcconfig:
76 * wtf/FeatureDefines.h:
79 2019-06-27 Don Olmstead <don.olmstead@sony.com>
81 [FTW] Build JavaScriptCore
82 https://bugs.webkit.org/show_bug.cgi?id=199254
84 Reviewed by Brent Fulgham.
86 * wtf/PlatformFTW.cmake: Added.
88 2019-06-27 Fujii Hironori <Hironori.Fujii@sony.com>
90 [CMake] Bump cmake_minimum_required version to 3.10
91 https://bugs.webkit.org/show_bug.cgi?id=199181
93 Reviewed by Don Olmstead.
97 2019-06-26 Konstantin Tokarev <annulen@yandex.ru>
99 Remove unneeded #include <wtf/glib/GRefPtr.h>
100 https://bugs.webkit.org/show_bug.cgi?id=199228
102 Reviewed by Michael Catanzaro.
104 * wtf/MemoryPressureHandler.h:
106 2019-06-26 Myles C. Maxfield <mmaxfield@apple.com>
108 REGRESSION: ( r246394 ) webgpu/whlsl-buffer-fragment.html and webgpu/whlsl-buffer-vertex.html are failing
109 https://bugs.webkit.org/show_bug.cgi?id=199012
111 Reviewed by Saam Barati.
115 2019-06-25 Keith Miller <keith_miller@apple.com>
117 CagedPtr doesn't merge PAC bits back into the resulting caged pointer.
118 https://bugs.webkit.org/show_bug.cgi?id=199214
120 Reviewed by Yusuke Suzuki.
122 The current code means that caging will just strip the any failed
123 authentication bits. Adding this code doesn't appear to be a
124 regression on iPhone Xs.
127 (WTF::CagedPtr::get const):
128 (WTF::CagedPtr::getMayBeNull const):
129 (WTF::CagedPtr::getUnsafe const):
130 (WTF::CagedPtr::mergePointers):
132 2019-06-25 Sam Weinig <weinig@apple.com>
134 Experiment with simple structured bindings use
135 https://bugs.webkit.org/show_bug.cgi?id=198905
137 Reviewed by Darin Adler.
139 * wtf/URLHelpers.cpp:
140 (WTF::URLHelpers::mapHostNames):
141 Simplify code using c++ structured bindings (https://en.cppreference.com/w/cpp/language/structured_binding)
142 to see if all the platforms will work with it.
144 2019-06-25 Adam Barth <abarth@webkit.org>
146 [fuchsia] Update to newer zx_clock_get syscall
147 https://bugs.webkit.org/show_bug.cgi?id=199191
149 Reviewed by Sam Weinig.
151 Fuchsia has changed the zx_clock_get syscall to return the clock value
152 via an out parameter rather than via its return value. This change
153 makes zx_clock_get consistent with all the other syscalls.
155 This patch updates our use of zx_clock_get to use the new syscall. The
156 old syscall is no longer supported by Fuchsia.
158 * wtf/fuchsia/CPUTimeFuchsia.cpp:
159 (WTF::CPUTime::get): Switch to using the out parameter.
160 (WTF::CPUTime::forCurrentThread): Switch to using the out parameter.
162 2019-06-25 Michael Catanzaro <mcatanzaro@igalia.com>
164 Fully rename WebKitGTK+ -> WebKitGTK everywhere
165 https://bugs.webkit.org/show_bug.cgi?id=199159
167 Reviewed by Carlos Garcia Campos.
170 (WTF::URLParser::internationalDomainNameTranscoder):
172 2019-06-25 Michael Catanzaro <mcatanzaro@igalia.com>
175 https://bugs.webkit.org/show_bug.cgi?id=198914
177 Reviewed by Darin Adler.
179 Remove now-stale GCC version check.
183 2019-06-23 Simon Fraser <simon.fraser@apple.com>
185 Add OverflowScrollProxyNodes to the scrolling tree
186 https://bugs.webkit.org/show_bug.cgi?id=199132
188 Reviewed by Antti Koivisto.
190 Setting indent is useful if you want to make a new stream with the indent of an
193 * wtf/text/TextStream.h:
194 (WTF::TextStream::setIndent):
196 2019-06-20 Fujii Hironori <Hironori.Fujii@sony.com>
198 Try to use C++14 std::enable_if_t in CheckedArithmetic.h again
199 https://bugs.webkit.org/show_bug.cgi?id=199099
201 Reviewed by Ross Kirsling.
203 r242235 changed CheckedArithmetic to not use C++14. Let's try
206 * wtf/CheckedArithmetic.h: Use C++14 std::make_unsigned_t and std::enable_if_t.
208 2019-06-18 Darin Adler <darin@apple.com>
210 Tidy up the remaining bits of the AtomicString to AtomString rename
211 https://bugs.webkit.org/show_bug.cgi?id=198990
213 Reviewed by Michael Catanzaro.
215 * wtf/text/AtomString.cpp: Fix a comment.
216 * wtf/text/AtomString.h: Tweak formatting a bit. Use nullptr instead of 0.
217 Removed "using AtomicString = AtomString".
218 * wtf/text/AtomStringImpl.cpp:
219 (WTF::CStringTranslator::translate): Use setIsAtom instead of setIsAtomic.
220 (WTF::UCharBufferTranslator::translate): Ditto.
221 (WTF::HashAndUTF8CharactersTranslator::translate): Ditto.
222 (WTF::SubstringTranslator::translate): Ditto.
223 (WTF::LCharBufferTranslator::translate): Ditto.
224 (WTF::BufferFromStaticDataTranslator::translate): Ditto.
225 (WTF::AtomStringImpl::addSlowCase): Ditto.
226 (WTF::AtomStringImpl::lookUpSlowCase): Updated assertion message.
228 * wtf/text/AtomStringImpl.h: Tweaked the implementation of add.
229 Updated comments to say AtomString.
231 * wtf/text/AtomStringTable.cpp:
232 (WTF::AtomStringTable::~AtomStringTable): Use setIsAtom.
234 * wtf/text/StringImpl.h: Updated name of StringAtomic and
235 s_hashFlagStringKindIsAtom. Renamed to flagIsAtom and setIsAtom.
237 * wtf/text/WTFString.cpp:
238 (WTF::String::isSafeToSendToAnotherThread const): Updated comment.
240 2019-06-20 Carlos Garcia Campos <cgarcia@igalia.com>
242 [GTK] Remove support for GTK2 plugins
243 https://bugs.webkit.org/show_bug.cgi?id=199065
245 Reviewed by Sergio Villar Senin.
248 * wtf/glib/GTypedefs.h:
250 2019-06-19 Yusuke Suzuki <ysuzuki@apple.com>
252 [bmalloc] IsoHeap's initialization is racy with IsoHeap::isInitialized
253 https://bugs.webkit.org/show_bug.cgi?id=199053
255 Reviewed by Saam Barati.
257 Add constexpr static functions to generate pseudo random numbers from __LINE__.
260 (WTF::WeakRandom::nextState):
261 (WTF::WeakRandom::generate):
262 (WTF::WeakRandom::advance):
264 2019-06-19 Fujii Hironori <Hironori.Fujii@sony.com>
266 Add WTF::crossThreadCopy(T&&) to utilize String::isolatedCopy() &&
267 https://bugs.webkit.org/show_bug.cgi?id=198957
269 Reviewed by Alex Christensen.
271 &&-qualified String::isolatedCopy() has a optimization path which
272 does just WTFMove if it isSafeToSendToAnotherThread which means
273 the object hasOneRef.
275 However, WTF::crossThreadCopy was using only &-qualified
276 isolatedCopy. To use the optimization, added
277 WTF::crossThreadCopy(T&&) overloading.
279 * wtf/CrossThreadCopier.h:
280 (WTF::crossThreadCopy): Added a overload of (T&&).
281 * wtf/CrossThreadTask.h:
282 (WTF::createCrossThreadTask): Removed explicit template arguments of crossThreadCopy.
284 2019-06-19 Devin Rousso <drousso@apple.com>
286 Web Inspector: Network: replace CFNetwork SPI with new API where able
287 https://bugs.webkit.org/show_bug.cgi?id=198762
289 Reviewed by Timothy Hatcher.
293 2019-06-19 Alex Christensen <achristensen@webkit.org>
295 Add a unit test for client certificate authentication
296 https://bugs.webkit.org/show_bug.cgi?id=197800
298 Reviewed by Youenn Fablet.
300 * wtf/spi/cocoa/SecuritySPI.h:
301 Move declarations from ArgumentCodersCF.cpp so they can be shared.
303 2019-06-19 Adrian Perez de Castro <aperez@igalia.com>
305 [WPE][GTK] Fix build with unified sources disabled
306 https://bugs.webkit.org/show_bug.cgi?id=198752
308 Reviewed by Michael Catanzaro.
310 * wtf/text/StringBuilder.h: Add missing include of StringConcatenateNumbers.h
312 2019-06-19 Zan Dobersek <zdobersek@igalia.com>
314 USE_ANGLE macro can be evaluated without being defined
315 https://bugs.webkit.org/show_bug.cgi?id=198991
317 Reviewed by Carlos Garcia Campos.
319 * wtf/Platform.h: On platforms not yet defining USE_ANGLE, the
320 incompatibility check with some other flags leads to the macro being
321 evaluated even when it was not defined, producing compiler warnings.
322 To avoid this, the macro should be defined to 0 before the check in
323 case it was not defined already.
325 2019-06-18 Dean Jackson <dino@apple.com>
327 UIContextMenuInteraction implementation for WKContentView
328 https://bugs.webkit.org/show_bug.cgi?id=198986
329 <rdar://problem/51875189>
331 Reviewed by Andy Estes.
333 Add USE_UICONTEXTMENU for iOS 13+.
337 2019-06-18 Kenneth Russell <kbr@chromium.org>
339 Add preliminary ANGLE backend to WebCore
340 https://bugs.webkit.org/show_bug.cgi?id=197755
342 Reviewed by Dean Jackson.
344 Add a USE_ANGLE definition to wtf/Platform.h (currently disabled)
345 which, when enabled, uses ANGLE instead of the OpenGL or OpenGL ES
350 2019-06-17 Jiewen Tan <jiewen_tan@apple.com>
352 Move SOAuthorization from WebKitAdditions to WebKit
353 https://bugs.webkit.org/show_bug.cgi?id=198874
354 <rdar://problem/47573431>
356 Reviewed by Brent Fulgham.
359 Adds a feature flag to detect AppSSO framework.
361 2019-06-17 Ryan Haddad <ryanhaddad@apple.com>
363 Unreviewed, rolling out r246501.
365 Breaks Apple internal builds.
369 "Support using ANGLE as the backend for the WebGL
371 https://bugs.webkit.org/show_bug.cgi?id=197755
372 https://trac.webkit.org/changeset/246501
374 2019-06-17 Kenneth Russell <kbr@chromium.org>
376 Support using ANGLE as the backend for the WebGL implementation
377 https://bugs.webkit.org/show_bug.cgi?id=197755
379 Reviewed by Dean Jackson.
381 Add a USE_ANGLE definition to wtf/Platform.h (currently disabled)
382 which, when enabled, uses ANGLE instead of the OpenGL or OpenGL ES
387 2019-06-16 Darin Adler <darin@apple.com>
389 Rename AtomicString to AtomString
390 https://bugs.webkit.org/show_bug.cgi?id=195276
392 Reviewed by Michael Catanzaro.
394 * many files: Let do-webcore-rename do the renaming.
396 * wtf/text/AtomString.h: After renaming, added AtomicString as a synonym for
397 now; helps smooth things over with a tiny bit of Apple internal software so
398 we don't have to do this all at once. Can remove it soon.
400 2019-06-16 Eric Carlson <eric.carlson@apple.com>
402 [MediaStream] Avoid roundoff error when setting AVCapture min/max frame rate
403 https://bugs.webkit.org/show_bug.cgi?id=198875
404 <rdar://problem/51768374>
406 Reviewed by Youenn Fablet.
409 (WTF::LogArgument<MediaTime>::toString):
410 (WTF::LogArgument<MediaTimeRange>::toString):
412 2019-06-12 Antoine Quint <graouts@apple.com>
414 Show the web page URL when sharing an AR model
415 https://bugs.webkit.org/show_bug.cgi?id=198812
416 <rdar://problem/48689498>
418 Reviewed by Dean Jackson.
422 2019-06-12 Youenn Fablet <youenn@apple.com>
424 Use NSURLSession for WebSocket
425 https://bugs.webkit.org/show_bug.cgi?id=198568
427 Reviewed by Geoffrey Garen.
430 Introduce compile flag for WebSocket NSURLSession
432 2019-06-12 Commit Queue <commit-queue@webkit.org>
434 Unreviewed, rolling out r246322.
435 https://bugs.webkit.org/show_bug.cgi?id=198796
437 "It's a huge page load regression on iOS" (Requested by
438 saamyjoon on #webkit).
443 https://bugs.webkit.org/show_bug.cgi?id=198726
444 https://trac.webkit.org/changeset/246322
446 2019-06-10 Simon Fraser <simon.fraser@apple.com>
448 Add logging for UI-side compositing hit-testing
449 https://bugs.webkit.org/show_bug.cgi?id=198739
451 Reviewed by Antti Koivisto.
453 Make it possible to output an Objective-C object to TextStream, which will
454 log its -description.
456 Also add a template for OptionSet<> printing.
458 * WTF.xcodeproj/project.pbxproj:
459 * wtf/text/TextStream.h:
461 * wtf/text/cocoa/TextStreamCocoa.mm: Added.
462 (WTF::TextStream::operator<<):
464 2019-06-11 Saam Barati <sbarati@apple.com>
467 https://bugs.webkit.org/show_bug.cgi?id=198726
469 Reviewed by Keith Miller.
471 * WTF.xcodeproj/project.pbxproj:
472 * wtf/CMakeLists.txt:
474 (WTF::CagedPtr::CagedPtr):
475 (WTF::CagedPtr::get const):
476 (WTF::CagedPtr::getMayBeNull const):
477 (WTF::CagedPtr::operator=):
478 (WTF::CagedPtr::operator== const):
479 (WTF::CagedPtr::operator!= const):
480 (WTF::CagedPtr::operator bool const):
481 (WTF::CagedPtr::operator* const):
482 (WTF::CagedPtr::operator-> const):
483 (WTF::CagedPtr::operator[] const):
484 (WTF::CagedPtr::getUnsafe const): Deleted.
485 (WTF::CagedPtr::at const): Deleted.
486 (WTF::CagedPtr::recage): Deleted.
487 * wtf/CagedUniquePtr.h:
488 (WTF::CagedUniquePtr::CagedUniquePtr):
489 (WTF::CagedUniquePtr::create):
490 (WTF::CagedUniquePtr::operator=):
491 (WTF::CagedUniquePtr::~CagedUniquePtr):
492 (WTF::CagedUniquePtr::destroy):
495 (Gigacage::cagedMayBeNull): Deleted.
497 (WTF::tagArrayPtr): Deleted.
498 (WTF::untagArrayPtr): Deleted.
499 (WTF::removeArrayPtrTag): Deleted.
500 (WTF::retagArrayPtr): Deleted.
501 * wtf/TaggedArrayStoragePtr.h:
502 (WTF::TaggedArrayStoragePtr::TaggedArrayStoragePtr): Deleted.
503 (WTF::TaggedArrayStoragePtr::get const): Deleted.
504 (WTF::TaggedArrayStoragePtr::getUnsafe const): Deleted.
505 (WTF::TaggedArrayStoragePtr::resize): Deleted.
506 (WTF::TaggedArrayStoragePtr::operator bool const): Deleted.
508 2019-06-10 Andy Estes <aestes@apple.com>
510 [iOS] Use PDFKit SPI for taking snapshots when the hosting app is not entitled for global capture
511 https://bugs.webkit.org/show_bug.cgi?id=198731
512 <rdar://problem/46215174>
514 Reviewed by Tim Horton.
516 * wtf/FeatureDefines.h:
518 2019-06-10 Sam Weinig <weinig@apple.com>
520 Remove Dashboard support
521 https://bugs.webkit.org/show_bug.cgi?id=198615
523 Reviewed by Ryosuke Niwa.
525 * wtf/FeatureDefines.h:
527 2019-06-10 Timothy Hatcher <timothy@apple.com>
529 Integrate dark mode support for iOS.
530 https://bugs.webkit.org/show_bug.cgi?id=198687
531 rdar://problem/51545643
533 Reviewed by Tim Horton.
537 2019-06-08 Andy Estes <aestes@apple.com>
539 [Apple Pay] If we have a bound interface identifier, set it on new PKPaymentRequests
540 https://bugs.webkit.org/show_bug.cgi?id=198690
541 <rdar://problem/48041803>
543 Reviewed by Tim Horton.
545 * wtf/FeatureDefines.h: Defined HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER, and cleaned up some
548 2019-06-06 Caio Lima <ticaiolima@gmail.com>
550 [JSCOnly] JSCOnly port is not building on macOS
551 https://bugs.webkit.org/show_bug.cgi?id=198563
553 Reviewed by Don Olmstead.
555 We are adding `<mach/vm_types.h>` to fix build issues when compiling
556 JSCOnly port on macOS.
558 * wtf/WTFAssertions.cpp:
560 2019-06-03 Commit Queue <commit-queue@webkit.org>
562 Unreviewed, rolling out r246022.
563 https://bugs.webkit.org/show_bug.cgi?id=198486
565 Causing Internal build failures and JSC test failures
566 (Requested by ShawnRoberts on #webkit).
570 "Reenable Gigacage on ARM64."
571 https://bugs.webkit.org/show_bug.cgi?id=198453
572 https://trac.webkit.org/changeset/246022
574 2019-06-03 Darin Adler <darin@apple.com>
576 Finish cleanup of String::number for floating point
577 https://bugs.webkit.org/show_bug.cgi?id=198471
579 Reviewed by Yusuke Suzuki.
581 * wtf/JSONValues.cpp:
582 (WTF::JSONImpl::Value::writeJSON const): Use appendNumber instead of
583 appendECMAScriptNumber, since that's now the default.
585 * wtf/text/StringBuilder.cpp:
586 (WTF::StringBuilder::appendNumber): Renamed from appendShortestFormNumber.
587 * wtf/text/StringBuilder.h: Removed appendShortestFormNumber and
588 appendECMAScriptNumber, replacing both with overload of appendNumber.
590 * wtf/text/WTFString.cpp:
591 (WTF::String::number): Renamed from numberToStringShortest.
592 * wtf/text/WTFString.h: Removed numberToStringShortest and
593 numberToStringECMAScript, replacing both with overload of number.
595 2019-06-02 Keith Miller <keith_miller@apple.com>
597 Reenable Gigacage on ARM64.
598 https://bugs.webkit.org/show_bug.cgi?id=198453
600 Reviewed by Filip Pizlo.
603 (WTF::CagedPtr::authenticatingLoad):
604 (WTF::CagedPtr::get const):
605 (WTF::CagedPtr::getMayBeNull const):
607 2019-05-31 Alex Christensen <achristensen@webkit.org>
609 URLParser::parseIPv6Host should properly parse 0's around compression
610 https://bugs.webkit.org/show_bug.cgi?id=198424
612 Reviewed by Tim Horton.
615 (WTF::URLParser::parseIPv6Host):
617 2019-05-31 Alex Christensen <achristensen@webkit.org>
619 URLParser::parseHostAndPort should not allow non-port characters after an ipv6 host
620 https://bugs.webkit.org/show_bug.cgi?id=198428
621 <rdar://problem/51209196>
623 Reviewed by Tim Horton.
625 This matches Chrome and Firefox.
628 (WTF::URLParser::parseHostAndPort):
630 2019-05-31 Tim Horton <timothy_horton@apple.com>
632 Optionally respect device management restrictions when loading from the network
633 https://bugs.webkit.org/show_bug.cgi?id=198318
634 <rdar://problem/44263806>
636 Reviewed by Alex Christensen.
639 Add a HAVE flag for DeviceManagement.framework.
640 It does exist in the simulator, but does not function; pretend it doesn't exist.
642 2019-05-31 Geoffrey Garen <ggaren@apple.com>
645 https://bugs.webkit.org/show_bug.cgi?id=198390
647 Reviewed by Chris Dumez.
650 (WTF::HashTraits<Ref<WeakPtrImpl>>::isReleasedWeakValue):
651 (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator):
652 Updated for rename to WeakPtrImpl.
654 (WTF::WeakHashSet::WeakHashSetConstIterator::get const): Updated for new
655 get() interface. Also, switched to iterator operator* to help clarify
656 the double dereference here.
658 (WTF::WeakHashSet::add):
659 (WTF::WeakHashSet::remove):
660 (WTF::WeakHashSet::contains const):
661 (WTF::WeakHashSet::computeSize const):
662 (WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Deleted.
663 Updated for rename to WeakPtrImpl.
666 (WTF::WeakPtrImpl::create):
667 (WTF::WeakPtrImpl::~WeakPtrImpl): Renamed WeakReference to WeakPtrImpl.
668 Now we don't need a comment explaining that this class is the backing
669 implementation of WeakPtr.
671 (WTF::WeakPtrImpl::get): Return the pointer type we stored, rather than
672 the pointer type requested by our client. It's a little too surprising
673 for a field to store one pointer type and load another.
675 (WTF::WeakPtrImpl::WeakPtrImpl): Fixed a theoretical type safety bug.
676 Make sure to store T::WeakValueType* instead of T*, since they might
677 not be the same pointer value. (In practice, T and T::WeakValueType*
678 are always the same type in this constructor because WeakPtrFactory
679 makes them so, but it's best not to depend on implementation details
682 (WTF::WeakPtr::get const): Updated for new get() interface.
684 (WTF::WeakPtr::operator bool const):
685 (WTF::WeakPtr::operator=):
686 (WTF::WeakPtr::clear):
687 (WTF::WeakPtr::WeakPtr): Updated for WeakPtrImpl rename.
689 (WTF::WeakPtrFactory::~WeakPtrFactory): Updated for WeakPtrImpl rename.
691 (WTF::WeakPtrFactory::createWeakPtr const): ASSERT that the passed-in
692 pointer is equal to the stored pointer. As a space optimization, we
693 require our client to remind us what we point to each time a weak
694 pointer is created -- but nothing guarantees that our client will do
697 (WTF::WeakPtrFactory::revokeAll): Updated for WeakPtrImpl rename.
699 (WTF::CanMakeWeakPtr::weakPtrFactory const):
700 (WTF::CanMakeWeakPtr::weakPtrFactory): Use idiomatic accessor naming.
702 (WTF::weak_ptr_impl_cast): Fixed a theoretical type safety bug.
703 Previously, if Base and Derived both inherited CanMakeWeakPtr, and
704 you casted WeakPtr<Base> to WeakPtr<Derived> (or vice versa), and
705 casting Base <-> Derived required pointer fixup, the previous
706 compile-time check would accept the cast, even though the stored pointer
709 (WTF::WeakPtr<T>::WeakPtr):
712 (WTF::WeakReference::create): Deleted.
713 (WTF::WeakReference::~WeakReference): Deleted.
714 (WTF::WeakReference::get const): Deleted.
715 (WTF::WeakReference::operator bool const): Deleted.
716 (WTF::WeakReference::clear): Deleted.
717 (WTF::WeakReference::WeakReference): Deleted.
718 (WTF::weak_reference_cast): Deleted. Updated for rename to WeakPtrImpl.
720 Don't export WeakPtrImpl because it's an implmenetation detail and
721 it shouldn't be easy to use outside WTF.
723 2019-05-31 Don Olmstead <don.olmstead@sony.com>
725 [CMake] Add WebKit::WTF target
726 https://bugs.webkit.org/show_bug.cgi?id=198400
728 Reviewed by Konstantin Tokarev.
730 Create the WebKit::WTF target and use that to propagate headers. Use
731 WEBKIT_COPY_FILES instead of WEBKIT_MAKE_FORWARDING_HEADERS.
733 * wtf/CMakeLists.txt:
735 2019-05-30 Saam Barati <sbarati@apple.com>
737 [WHLSL] Enforce variable lifetimes
738 https://bugs.webkit.org/show_bug.cgi?id=195794
739 <rdar://problem/50746293>
741 Reviewed by Myles C. Maxfield.
745 2019-05-30 Keith Rollin <krollin@apple.com>
747 Fix yet more deprecated uses of -[UIApplication interfaceOrientation]
748 https://bugs.webkit.org/show_bug.cgi?id=198381
749 <rdar://problem/51265846>
751 Reviewed by Wenson Hsieh.
753 r245267, r245272, and r245874 fixed many instances of this issue; this
754 change fixes the issue for tvOS.
756 * wtf/FeatureDefines.h:
758 2019-05-29 David Kilzer <ddkilzer@apple.com>
760 Clean up a few #include statements in WTF
761 <https://webkit.org/b/198351>
763 Reviewed by Alex Christensen.
765 * benchmarks/HashSetDFGReplay.cpp:
766 - Add missing "config.h" include.
767 * wtf/ParallelJobsGeneric.cpp:
768 - Replace include of ParallelJobs.h with
769 ParallelJobsGeneric.h.
770 * wtf/StackBounds.cpp:
771 - Fix include ordering of StackBounds.h.
773 2019-05-29 Keith Rollin <krollin@apple.com>
775 Followup to r245267 and r245272: fix even more deprecated uses of -[UIApplication interfaceOrientation]
776 https://bugs.webkit.org/show_bug.cgi?id=198348
777 <rdar://problem/51234077>
779 Reviewed by Wenson Hsieh.
781 r245267 and r245272 fixed many instances of this issue; this change
782 fixes the issue for watchOS.
784 * wtf/FeatureDefines.h:
786 2019-05-29 David Kilzer <ddkilzer@apple.com>
788 IndexedDatabase Server thread in com.apple.WebKit.Networking process leaks objects into an autoreleasePool that's never cleared
789 <https://webkit.org/b/198346>
790 <rdar://problem/50895658>
792 Reviewed by Brent Fulgham.
794 * wtf/CrossThreadTaskHandler.cpp:
795 (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler):
796 - Add optional second argument to enable use of an
797 AutodrainedPool when running the runloop.
798 (WTF::CrossThreadTaskHandler::taskRunLoop):
799 - Create an AutodrainedPool if requested when
800 CrossThreadTaskHandler was created.
801 * wtf/CrossThreadTaskHandler.h:
802 (WTF::CrossThreadTaskHandler::AutodrainedPoolForRunLoop):
803 - Add enum class for enabling an AutodrainedPool for
804 CrossThreadTaskHandler::taskRunLoop().
805 (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler):
806 - Add optional second argument to enable use of an
807 AutodrainedPool when running the runloop.
809 2019-05-29 Geoffrey Garen <ggaren@apple.com>
811 WeakPtr breaks vtables when upcasting to base classes
812 https://bugs.webkit.org/show_bug.cgi?id=188799
814 Reviewed by Youenn Fablet.
816 This patch switches from reinterpret_cast to static_cast when loading
817 from WeakReference storage.
819 We know which type to cast *to* because it's specified by the type of
822 We know which type to cast *from* because it's specified by a typedef
825 (Our convention is that we store a pointer to the class that derives
826 from CanMakeWeakPtr. We cast from that pointer to derived pointers when
827 we get(). This means that #include of the derived type header is now
828 required in order to get() the pointer.)
831 (WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Definition
832 is now eagerly required because WeakReference is not a template anymore.
834 (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
835 (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
836 (WTF::WeakHashSet::remove):
837 (WTF::WeakHashSet::contains const):
838 (WTF::WeakHashSet::computesEmpty const):
839 (WTF::WeakHashSet::hasNullReferences const):
840 (WTF::WeakHashSet::computeSize const):
841 (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue): Deleted.
842 Updated for new WeakReference get() API.
844 * wtf/WeakPtr.h: Use a macro for TestAPI support. We can't use template
845 specialization because WeakReference is not a class template anymore.
846 (Or maybe we could have kept it working with a dummy template argument?
847 Felt weird, so I switched.)
849 (WTF::WeakReference::create):
850 (WTF::WeakReference::~WeakReference):
851 (WTF::WeakReference::get const):
852 (WTF::WeakReference::operator bool const):
853 (WTF::WeakReference::WeakReference): WeakReference is just a void* now.
854 It's the caller's responsibility, when creating and getting, to use
855 a consistent storage type. We ensure a canonical storage type using a
856 typedef inside CanMakeWeakPtr.
858 (WTF::WeakPtr::WeakPtr):
859 (WTF::WeakPtr::get const):
860 (WTF::WeakPtr::operator bool const):
861 (WTF::WeakPtr::operator-> const):
862 (WTF::WeakPtr::operator* const): Adopted new WeakReference API.
864 (WTF::WeakPtrFactory::createWeakPtr const): No need for reinterpret_cast.
866 (WTF::weak_reference_cast): This isn't required for correctness, but it's
867 nice to show a complier error at WeakPtr construction sites when you know
868 that the types won't work. Otherwise, you get compiler errors at
869 dereference sites, which are slightly more mysterious ways of saying that
870 you constructed your WeakPtr incorrectly.
872 (WTF::WeakPtr<T>::WeakPtr):
875 (WTF::weak_reference_upcast): Deleted.
876 (WTF::weak_reference_downcast): Deleted.
878 2019-05-29 Ryan Haddad <ryanhaddad@apple.com>
880 Unreviewed, rolling out r245857.
882 Breaks internal builds.
886 "WeakPtr breaks vtables when upcasting to base classes"
887 https://bugs.webkit.org/show_bug.cgi?id=188799
888 https://trac.webkit.org/changeset/245857
890 2019-05-28 Geoffrey Garen <ggaren@apple.com>
892 WeakPtr breaks vtables when upcasting to base classes
893 https://bugs.webkit.org/show_bug.cgi?id=188799
895 Reviewed by Youenn Fablet.
897 This patch switches from reinterpret_cast to static_cast when loading
898 from WeakReference storage.
900 We know which type to cast *to* because it's specified by the type of
903 We know which type to cast *from* because it's specified by a typedef
906 (Our convention is that we store a pointer to the class that derives
907 from CanMakeWeakPtr. We cast from that pointer to derived pointers when
908 we get(). This means that #include of the derived type header is now
909 required in order to get() the pointer.)
912 (WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Definition
913 is now eagerly required because WeakReference is not a template anymore.
915 (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
916 (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
917 (WTF::WeakHashSet::remove):
918 (WTF::WeakHashSet::contains const):
919 (WTF::WeakHashSet::computesEmpty const):
920 (WTF::WeakHashSet::hasNullReferences const):
921 (WTF::WeakHashSet::computeSize const):
922 (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue): Deleted.
923 Updated for new WeakReference get() API.
925 * wtf/WeakPtr.h: Use a macro for TestAPI support. We can't use template
926 specialization because WeakReference is not a class template anymore.
927 (Or maybe we could have kept it working with a dummy template argument?
928 Felt weird, so I switched.)
930 (WTF::WeakReference::create):
931 (WTF::WeakReference::~WeakReference):
932 (WTF::WeakReference::get const):
933 (WTF::WeakReference::operator bool const):
934 (WTF::WeakReference::WeakReference): WeakReference is just a void* now.
935 It's the caller's responsibility, when creating and getting, to use
936 a consistent storage type. We ensure a canonical storage type using a
937 typedef inside CanMakeWeakPtr.
939 (WTF::WeakPtr::WeakPtr):
940 (WTF::WeakPtr::get const):
941 (WTF::WeakPtr::operator bool const):
942 (WTF::WeakPtr::operator-> const):
943 (WTF::WeakPtr::operator* const): Adopted new WeakReference API.
945 (WTF::WeakPtrFactory::createWeakPtr const): No need for reinterpret_cast.
947 (WTF::weak_reference_cast): This isn't required for correctness, but it's
948 nice to show a complier error at WeakPtr construction sites when you know
949 that the types won't work. Otherwise, you get compiler errors at
950 dereference sites, which are slightly more mysterious ways of saying that
951 you constructed your WeakPtr incorrectly.
953 (WTF::WeakPtr<T>::WeakPtr):
956 (WTF::weak_reference_upcast): Deleted.
957 (WTF::weak_reference_downcast): Deleted.
959 2019-05-27 Chris Dumez <cdumez@apple.com>
961 Use a strongly-typed identifier for pages
962 https://bugs.webkit.org/show_bug.cgi?id=198206
964 Reviewed by Youenn Fablet.
966 * wtf/ObjectIdentifier.h:
969 2019-05-23 Don Olmstead <don.olmstead@sony.com>
971 [CMake] Use target oriented design for bmalloc
972 https://bugs.webkit.org/show_bug.cgi?id=198046
974 Reviewed by Konstantin Tokarev.
976 Use WebKit::bmalloc target.
978 * wtf/CMakeLists.txt:
980 2019-05-23 Ross Kirsling <ross.kirsling@sony.com>
982 [PlayStation] Implement platformUserPreferredLanguages.
983 https://bugs.webkit.org/show_bug.cgi?id=198149
985 Reviewed by Fujii Hironori.
987 * wtf/PlatformPlayStation.cmake:
988 * wtf/playstation/LanguagePlayStation.cpp: Added.
989 (WTF::platformUserPreferredLanguages):
991 2019-05-22 Myles C. Maxfield <mmaxfield@apple.com>
993 font-optical-sizing applies the wrong variation value
994 https://bugs.webkit.org/show_bug.cgi?id=197528
995 <rdar://problem/50152854>
997 Reviewed by Antti Koivisto.
1001 2019-05-22 Ryan Haddad <ryanhaddad@apple.com>
1003 Unreviewed, rolling out r245598.
1005 Breaks watchOS build.
1009 "font-optical-sizing applies the wrong variation value"
1010 https://bugs.webkit.org/show_bug.cgi?id=197528
1011 https://trac.webkit.org/changeset/245598
1013 2019-05-21 Ross Kirsling <ross.kirsling@sony.com>
1015 [PlayStation] Don't call fcntl.
1016 https://bugs.webkit.org/show_bug.cgi?id=197961
1018 Reviewed by Fujii Hironori.
1020 * wtf/PlatformGTK.cmake:
1021 * wtf/PlatformJSCOnly.cmake:
1022 * wtf/PlatformPlayStation.cmake:
1023 * wtf/PlatformWPE.cmake:
1024 * wtf/UniStdExtras.h:
1025 * wtf/playstation/UniStdExtrasPlayStation.cpp: Added.
1026 (WTF::setCloseOnExec):
1027 (WTF::dupCloseOnExec):
1029 * wtf/unix/UniStdExtrasUnix.cpp: Renamed from Source/WTF/wtf/UniStdExtras.cpp.
1031 Move UniStdExtras to unix/, add a PlayStation version that doesn't use fcntl, add an abstraction for O_NONBLOCK.
1033 2019-05-20 Tadeu Zagallo <tzagallo@apple.com>
1035 Only cache bytecode for API clients in data vaults
1036 https://bugs.webkit.org/show_bug.cgi?id=197898
1038 Reviewed by Keith Miller.
1040 Add SPI to check if a filesystem path is restricted as a data vault.
1042 * WTF.xcodeproj/project.pbxproj:
1043 * wtf/spi/darwin/DataVaultSPI.h: Added.
1045 2019-05-20 Carlos Garcia Campos <cgarcia@igalia.com>
1047 [GLIB] Repeating timer is not stopped when stop is called from the callback
1048 https://bugs.webkit.org/show_bug.cgi?id=197986
1050 Reviewed by Michael Catanzaro.
1052 In case of repeating timers we always update the ready time to fire interval after the user callback is called.
1054 * wtf/glib/RunLoopGLib.cpp:
1055 (WTF::RunLoop::TimerBase::stop): Reset m_fireInterval and m_isRepeating.
1057 2019-05-19 Darin Adler <darin@apple.com>
1059 Change String::number to use "shortest" instead of "fixed precision 6 digits"
1060 https://bugs.webkit.org/show_bug.cgi?id=178319
1062 Reviewed by Sam Weinig.
1064 * wtf/text/StringBuilder.h: Delete appendNumber for floating point and
1065 appendECMAScriptNumber for single-precision.
1067 * wtf/text/WTFString.h: Delete String::number for floating point and
1068 numberToStringECMAScript for single-precision.
1070 2019-05-18 Tadeu Zagallo <tzagallo@apple.com>
1072 Add extra information to dumpJITMemory
1073 https://bugs.webkit.org/show_bug.cgi?id=197998
1075 Reviewed by Saam Barati.
1077 Add a new trace point code for JSC::dumpJITMemory
1079 * wtf/SystemTracing.h:
1081 2019-05-17 Don Olmstead <don.olmstead@sony.com>
1083 [CMake] Use builtin FindICU
1084 https://bugs.webkit.org/show_bug.cgi?id=197934
1086 Reviewed by Michael Catanzaro.
1088 Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES. Use ICU:: targets which end
1089 up propagating to all consumers of WTF.
1091 * wtf/CMakeLists.txt:
1092 * wtf/PlatformPlayStation.cmake:
1094 2019-05-17 Commit Queue <commit-queue@webkit.org>
1096 Unreviewed, rolling out r245418.
1097 https://bugs.webkit.org/show_bug.cgi?id=197989
1099 New API test causing crashes on Mojave testers (Requested by
1100 ShawnRoberts on #webkit).
1104 "Add a unit test for client certificate authentication"
1105 https://bugs.webkit.org/show_bug.cgi?id=197800
1106 https://trac.webkit.org/changeset/245418
1108 2019-05-16 Keith Miller <keith_miller@apple.com>
1110 Wasm should cage the memory base pointers in structs
1111 https://bugs.webkit.org/show_bug.cgi?id=197620
1113 Reviewed by Saam Barati.
1115 Rename reauthenticate to recage.
1118 (WTF::CagedPtr::recage):
1119 (WTF::CagedPtr::reauthenticate): Deleted.
1121 2019-05-16 Alex Christensen <achristensen@webkit.org>
1123 Add a unit test for client certificate authentication
1124 https://bugs.webkit.org/show_bug.cgi?id=197800
1126 Reviewed by Youenn Fablet.
1128 * wtf/spi/cocoa/SecuritySPI.h:
1129 Move declarations from ArgumentCodersCF.cpp so they can be shared.
1131 2019-05-16 Eike Rathke <erack@redhat.com>
1133 Fix memcpy() call for big endian
1134 https://bugs.webkit.org/show_bug.cgi?id=197945
1136 Reviewed by Michael Catanzaro.
1141 2019-05-15 Ross Kirsling <ross.kirsling@sony.com>
1143 [PlayStation] WTFCrash should preserve register state.
1144 https://bugs.webkit.org/show_bug.cgi?id=197932
1146 Reviewed by Don Olmstead.
1148 * wtf/Assertions.cpp:
1150 Let r196397 apply to PlayStation port as well.
1152 2019-05-15 Simon Fraser <simon.fraser@apple.com>
1154 Make LOG_WITH_STREAM more efficient
1155 https://bugs.webkit.org/show_bug.cgi?id=197905
1157 Reviewed by Alex Christensen.
1159 Add a streamable repeat() class that can be used to output a series of characters.
1160 This is useful for indenting output.
1162 * wtf/text/TextStream.h:
1163 (WTF::TextStream::repeat::repeat):
1164 (WTF::TextStream::operator<<):
1166 2019-05-15 VÃctor Manuel Jáquez Leal <vjaquez@igalia.com>
1168 compilation failure with clang 9
1169 https://bugs.webkit.org/show_bug.cgi?id=197911
1171 Reviewed by Alex Christensen.
1173 Use std namespace for nullptr_t in tagArrayPtr templates.
1178 2019-05-14 Commit Queue <commit-queue@webkit.org>
1180 Unreviewed, rolling out r245281.
1181 https://bugs.webkit.org/show_bug.cgi?id=197887
1183 Broke API Test TestWebKitAPI.Challenge.ClientCertificate
1184 (Requested by aakashjain on #webkit).
1188 "Add a unit test for client certificate authentication"
1189 https://bugs.webkit.org/show_bug.cgi?id=197800
1190 https://trac.webkit.org/changeset/245281
1192 2019-05-14 Alex Christensen <achristensen@webkit.org>
1194 Add a unit test for client certificate authentication
1195 https://bugs.webkit.org/show_bug.cgi?id=197800
1197 Reviewed by Youenn Fablet.
1199 * wtf/spi/cocoa/SecuritySPI.h:
1200 Move declarations from ArgumentCodersCF.cpp so they can be shared.
1202 2019-05-13 Robin Morisset <rmorisset@apple.com>
1204 IndexSet::isEmpty should use BitVector::isEmpty() instead of size()
1205 https://bugs.webkit.org/show_bug.cgi?id=197857
1207 Reviewed by Darin Adler.
1210 (WTF::IndexSet::isEmpty const):
1212 2019-05-13 Youenn Fablet <youenn@apple.com>
1214 [Mac] Use realpath for dlopen_preflight
1215 https://bugs.webkit.org/show_bug.cgi?id=197803
1217 Reviewed by Eric Carlson.
1219 * wtf/cocoa/SoftLinking.h:
1221 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
1223 Unreviewed, wrokaround for MACH_VM_MAX_ADDRESS in ARM32_64
1224 https://bugs.webkit.org/show_bug.cgi?id=197730
1226 Interestingly, MACH_VM_MAX_ADDRESS is larger than 32bit in ARM32_64, I think this is a bug.
1227 But for now, we workaround for this case by using `CPU(ADDRESS64)`.
1229 * wtf/WTFAssertions.cpp:
1231 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
1233 [WTF] Remove Threading workaround for support libraries in Windows
1234 https://bugs.webkit.org/show_bug.cgi?id=197350
1236 Reviewed by Darin Adler.
1238 We kept old APIs for some support libraries at 2017. This patch removes them.
1241 * wtf/win/ThreadingWin.cpp:
1242 (WTF::createThread): Deleted.
1243 (WTF::waitForThreadCompletion): Deleted.
1245 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
1247 [WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
1248 https://bugs.webkit.org/show_bug.cgi?id=197146
1250 Reviewed by Saam Barati.
1252 Since GCThread and CompilationThread flags exist in WTF, we put these flags into WTF::Thread directly instead of holding them in ThreadSpecific<>.
1253 And this patch removes dependency from Threading.h to ThreadSpecific.h. ThreadSpecific.h's OS threading primitives are moved to ThreadingPrimitives.h,
1254 and Threading.h relies on it instead.
1256 * wtf/CompilationThread.cpp:
1257 (WTF::isCompilationThread):
1258 (WTF::initializeCompilationThreads): Deleted.
1259 (WTF::exchangeIsCompilationThread): Deleted.
1260 * wtf/CompilationThread.h:
1261 (WTF::CompilationScope::CompilationScope):
1262 (WTF::CompilationScope::~CompilationScope):
1263 (WTF::CompilationScope::leaveEarly):
1264 * wtf/MainThread.cpp:
1265 (WTF::initializeMainThread):
1266 (WTF::initializeMainThreadToProcessMainThread):
1267 (WTF::isMainThreadOrGCThread):
1268 (WTF::initializeGCThreads): Deleted.
1269 (WTF::registerGCThread): Deleted.
1270 (WTF::mayBeGCThread): Deleted.
1272 * wtf/ThreadSpecific.h:
1273 (WTF::canBeGCThread>::ThreadSpecific):
1274 (WTF::canBeGCThread>::set):
1275 (WTF::threadSpecificKeyCreate): Deleted.
1276 (WTF::threadSpecificKeyDelete): Deleted.
1277 (WTF::threadSpecificSet): Deleted.
1278 (WTF::threadSpecificGet): Deleted.
1279 * wtf/Threading.cpp:
1280 (WTF::Thread::exchangeIsCompilationThread):
1281 (WTF::Thread::registerGCThread):
1282 (WTF::Thread::mayBeGCThread):
1284 (WTF::Thread::isCompilationThread const):
1285 (WTF::Thread::gcThreadType const):
1286 (WTF::Thread::joinableState const):
1287 (WTF::Thread::hasExited const):
1288 (WTF::Thread::Thread):
1289 (WTF::Thread::joinableState): Deleted.
1290 (WTF::Thread::hasExited): Deleted.
1291 * wtf/ThreadingPrimitives.h:
1292 (WTF::threadSpecificKeyCreate):
1293 (WTF::threadSpecificKeyDelete):
1294 (WTF::threadSpecificSet):
1295 (WTF::threadSpecificGet):
1296 * wtf/win/ThreadSpecificWin.cpp:
1299 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
1301 Unreviewed, follow-up after r245214
1302 https://bugs.webkit.org/show_bug.cgi?id=197730
1304 Suggested by Sam. We should have static_assert with MACH_VM_MAX_ADDRESS.
1306 * wtf/WTFAssertions.cpp:
1308 2019-05-13 Youenn Fablet <youenn@apple.com>
1310 Use kDNSServiceFlagsKnownUnique for DNSServiceRegisterRecord only on platforms supporting it
1311 https://bugs.webkit.org/show_bug.cgi?id=197802
1313 Reviewed by Eric Carlson.
1317 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
1319 [JSC] Compress miscelaneous JIT related data structures with Packed<>
1320 https://bugs.webkit.org/show_bug.cgi?id=197830
1322 Reviewed by Saam Barati.
1327 2019-05-13 Michael Catanzaro <mcatanzaro@igalia.com>
1329 Unreviewed, fix unused variable warnings in release builds
1331 * wtf/URLHelpers.cpp:
1332 (WTF::URLHelpers::escapeUnsafeCharacters):
1334 2019-05-12 Yusuke Suzuki <ysuzuki@apple.com>
1336 [JSC] Compress Watchpoint size by using enum type and Packed<> data structure
1337 https://bugs.webkit.org/show_bug.cgi?id=197730
1339 Reviewed by Filip Pizlo.
1341 This patch introduces a new data structures, WTF::Packed, WTF::PackedPtr, and WTF::PackedAlignedPtr.
1345 WTF::Packed is data storage. We can read and write trivial (in C++ term [1]) data to this storage. The difference to
1346 the usual storage is that the alignment of this storage is always 1. We access the underlying data by using unalignedLoad/unalignedStore.
1347 This class offers alignment = 1 data structure instead of missing the following characteristics.
1349 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
1350 in a racy way. (e.g. fields accessed optimistically from the concurrent compilers).
1352 2. We cannot take reference / pointer to the underlying storage since they are unaligned.
1354 3. Access to this storage is unaligned access. The code is using memcpy, and the compiler will convert to an appropriate unaligned access
1355 in certain architectures (x86_64 / ARM64). It could be slow. So use it for non performance sensitive & memory sensitive places.
1359 WTF::PackedPtr is a specialization of WTF::Packed<T*>. And it is basically WTF::PackedAlignedPtr with alignment = 1. We further compact
1360 the pointer by leveraging the platform specific knowledge. In 64bit architectures, the effective width of pointers are less than 64 bit.
1361 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
1362 x86_64 and 5 bytes in Darwin ARM64.
1364 - WTF::PackedAlignedPtr
1366 WTF::PackedAlignedPtr is the WTF::PackedPtr with alignment information of the T. If we use this alignment information, we could reduce the
1367 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
1368 this information in Darwin ARM64 platform allows us to make packed JSCell pointer 4 bytes (36 - 4 bits). We do not use passed alignment
1369 information if it is not profitable.
1371 We also have PackedPtrTraits. This is new PtrTraits and use it for various data structures such as Bag<>.
1373 [1]: https://en.cppreference.com/w/cpp/types/is_trivial
1375 * WTF.xcodeproj/project.pbxproj:
1378 (WTF::Bag::iterator::operator++):
1379 * wtf/CMakeLists.txt:
1380 * wtf/DumbPtrTraits.h:
1381 * wtf/DumbValueTraits.h:
1383 (WTF::clzConstexpr):
1385 (WTF::ctzConstexpr):
1387 (WTF::getLSBSetConstexpr):
1388 (WTF::getMSBSetConstexpr):
1389 * wtf/Packed.h: Added.
1390 (WTF::Packed::Packed):
1391 (WTF::Packed::get const):
1393 (WTF::Packed::operator=):
1394 (WTF::Packed::exchange):
1395 (WTF::Packed::swap):
1397 (WTF::PackedPtrTraits::exchange):
1398 (WTF::PackedPtrTraits::swap):
1399 (WTF::PackedPtrTraits::unwrap):
1401 * wtf/SentinelLinkedList.h:
1402 (WTF::BasicRawSentinelNode::BasicRawSentinelNode):
1403 (WTF::BasicRawSentinelNode::prev):
1404 (WTF::BasicRawSentinelNode::next):
1405 (WTF::PtrTraits>::remove):
1406 (WTF::PtrTraits>::prepend):
1407 (WTF::PtrTraits>::append):
1408 (WTF::RawNode>::SentinelLinkedList):
1409 (WTF::RawNode>::remove):
1410 (WTF::BasicRawSentinelNode<T>::remove): Deleted.
1411 (WTF::BasicRawSentinelNode<T>::prepend): Deleted.
1412 (WTF::BasicRawSentinelNode<T>::append): Deleted.
1413 * wtf/StdLibExtras.h:
1414 (WTF::roundUpToMultipleOfImpl):
1415 (WTF::roundUpToMultipleOfImpl0): Deleted.
1416 * wtf/UnalignedAccess.h:
1417 (WTF::unalignedLoad):
1418 (WTF::unalignedStore):
1420 2019-05-10 Saam barati <sbarati@apple.com>
1422 Bag's move operator= leaks memory
1423 https://bugs.webkit.org/show_bug.cgi?id=197757
1425 Reviewed by Keith Miller.
1427 It was unused. So I'm just removing it. We can implement it properly
1431 (WTF::Bag::operator=): Deleted.
1433 2019-05-10 Fujii Hironori <Hironori.Fujii@sony.com>
1435 [WinCairo] storage/indexeddb tests are timing out
1436 https://bugs.webkit.org/show_bug.cgi?id=196289
1438 Reviewed by Alex Christensen.
1440 * wtf/FileSystem.h: Added hardLink.
1441 * wtf/glib/FileSystemGlib.cpp:
1442 (WTF::FileSystemImpl::hardLink):
1443 (WTF::FileSystemImpl::hardLinkOrCopyFile):
1444 * wtf/posix/FileSystemPOSIX.cpp:
1445 (WTF::FileSystemImpl::hardLink):
1446 (WTF::FileSystemImpl::hardLinkOrCopyFile):
1447 * wtf/win/FileSystemWin.cpp:
1448 (WTF::FileSystemImpl::hardLink):
1449 (WTF::FileSystemImpl::hardLinkOrCopyFile):
1450 Added hardLink. Let hardLinkOrCopyFile use the hardLink.
1452 2019-05-10 Yusuke Suzuki <ysuzuki@apple.com>
1454 [WTF] Remove "private:" from Noncopyable and Nonmovable macros
1455 https://bugs.webkit.org/show_bug.cgi?id=197767
1457 Reviewed by Saam Barati.
1459 We no longer need "private:".
1461 * wtf/Noncopyable.h:
1464 2019-05-08 Zan Dobersek <zdobersek@igalia.com>
1466 [GLib] Rework WPE RunLoopSourcePriority values
1467 https://bugs.webkit.org/show_bug.cgi?id=197167
1469 Reviewed by Carlos Garcia Campos.
1471 The GLib priorities for the WPE port were initially aligned on the -70
1472 value, theory being that this would help avoid any default-priority
1473 GSources spawned in different dependency libraries affecting our
1474 scheduling. Today it seems that extra caution might not be really
1477 This change aligns the base priority value with GLib's default priority
1478 value of 0. We maintain the relativity of priority values by effectively
1479 increasing each priority by 70.
1481 * wtf/glib/RunLoopSourcePriority.h:
1483 2019-05-08 Alex Christensen <achristensen@webkit.org>
1485 Add SPI to set HSTS storage directory
1486 https://bugs.webkit.org/show_bug.cgi?id=197259
1488 Reviewed by Brady Eidson.
1492 2019-05-08 Keith Miller <keith_miller@apple.com>
1494 Remove Gigacage from arm64 and use PAC for arm64e instead
1495 https://bugs.webkit.org/show_bug.cgi?id=197110
1497 Reviewed by Saam Barati.
1499 This patch changes the Gigacage to use PAC on arm64e. As part of
1500 this process all platforms must provide their length when
1501 materializing the caged pointer. Since it would be somewhat
1502 confusing to have two parameters for an operator [] those methods
1503 have been removed. Lastly, this patch removes the specializations
1504 for void* caged pointers, instead opting to use enable_if on the
1505 methods that would normally fail on void* e.g. anything that
1508 * WTF.xcodeproj/project.pbxproj:
1509 * wtf/CMakeLists.txt:
1511 (WTF::CagedPtr::CagedPtr):
1512 (WTF::CagedPtr::get const):
1513 (WTF::CagedPtr::getMayBeNull const):
1514 (WTF::CagedPtr::getUnsafe const):
1515 (WTF::CagedPtr::at const):
1516 (WTF::CagedPtr::reauthenticate):
1517 (WTF::CagedPtr::operator=):
1518 (WTF::CagedPtr::operator== const):
1519 (WTF::CagedPtr::operator bool const):
1520 (WTF::CagedPtr::operator* const): Deleted.
1521 (WTF::CagedPtr::operator-> const): Deleted.
1522 (WTF::CagedPtr::operator[] const): Deleted.
1524 * wtf/CagedUniquePtr.h:
1525 (WTF::CagedUniquePtr::CagedUniquePtr):
1526 (WTF::CagedUniquePtr::create):
1527 (WTF::CagedUniquePtr::~CagedUniquePtr):
1528 (WTF::CagedUniquePtr::destroy):
1531 (Gigacage::cagedMayBeNull):
1534 (WTF::untagArrayPtr):
1535 (WTF::removeArrayPtrTag):
1536 (WTF::retagArrayPtr):
1537 * wtf/TaggedArrayStoragePtr.h: Copied from Source/JavaScriptCore/runtime/ArrayBufferView.cpp.
1538 (WTF::TaggedArrayStoragePtr::TaggedArrayStoragePtr):
1539 (WTF::TaggedArrayStoragePtr::get const):
1540 (WTF::TaggedArrayStoragePtr::getUnsafe const):
1541 (WTF::TaggedArrayStoragePtr::resize):
1542 (WTF::TaggedArrayStoragePtr::operator bool const):
1544 2019-05-08 Robin Morisset <rmorisset@apple.com>
1546 WTF::TimingScope should show the total duration and not just the mean
1547 https://bugs.webkit.org/show_bug.cgi?id=197672
1549 Reviewed by Alex Christensen.
1551 * wtf/TimingScope.cpp:
1552 (WTF::TimingScope::scopeDidEnd):
1554 2019-05-07 Yusuke Suzuki <ysuzuki@apple.com>
1556 [JSC] LLIntPrototypeLoadAdaptiveStructureWatchpoint does not require Bag<>
1557 https://bugs.webkit.org/show_bug.cgi?id=197645
1559 Reviewed by Saam Barati.
1561 * WTF.xcodeproj/project.pbxproj:
1562 * wtf/CMakeLists.txt:
1563 * wtf/Nonmovable.h: Copied from Source/JavaScriptCore/bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h.
1565 (WTF::minCapacity>::uncheckedConstructAndAppend):
1567 2019-05-07 Eric Carlson <eric.carlson@apple.com>
1569 Define media buffering policy
1570 https://bugs.webkit.org/show_bug.cgi?id=196979
1571 <rdar://problem/28383861>
1573 Reviewed by Jer Noble.
1577 2019-05-07 Robin Morisset <rmorisset@apple.com>
1579 WTF::BitVector should have an isEmpty() method
1580 https://bugs.webkit.org/show_bug.cgi?id=197637
1582 Reviewed by Keith Miller.
1584 * wtf/BitVector.cpp:
1585 (WTF::BitVector::isEmptySlow const):
1587 (WTF::BitVector::isEmpty const):
1589 2019-05-07 Brent Fulgham <bfulgham@apple.com>
1591 Correct JSON parser to address unterminated escape character
1592 https://bugs.webkit.org/show_bug.cgi?id=197582
1593 <rdar://problem/50459177>
1595 Reviewed by Alex Christensen.
1597 Correct JSON parser code to properly deal with unterminated escape
1600 * wtf/JSONValues.cpp:
1601 (WTF::JSONImpl::decodeString):
1602 (WTF::JSONImpl::parseStringToken):
1604 2019-05-07 Alex Christensen <achristensen@webkit.org>
1606 Add a release assertion that Functions can only be constructed from non-null CompletionHandlers
1607 https://bugs.webkit.org/show_bug.cgi?id=197641
1609 Reviewed by Chris Dumez.
1611 This will help us find the cause of rdar://problem/48679972 by seeing the crash when the Function is dispatched,
1612 not when it's called with no interesting stack trace. I manually verified this assertion is hit in such a case.
1613 We should also have no legitimate use of creating a Function out of a null CompletionHandler then never calling it.
1615 * wtf/CompletionHandler.h:
1616 (WTF::Detail::CallableWrapper<CompletionHandler<Out):
1618 (WTF::Detail::CallableWrapperBase::~CallableWrapperBase):
1619 (WTF::Detail::CallableWrapper::CallableWrapper):
1620 (WTF::Function<Out):
1622 2019-05-06 Christopher Reid <chris.reid@sony.com>
1624 [JSC] Respect already defined USE_LLINT_EMBEDDED_OPCODE_ID compiler variable.
1625 https://bugs.webkit.org/show_bug.cgi?id=197633
1627 Reviewed by Don Olmstead.
1629 When the variable `USE_LLINT_EMBEDDED_OPCODE_ID` is defined, stop defining
1630 its value with platform default one.
1634 2019-05-03 Sihui Liu <sihui_liu@apple.com>
1636 Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
1637 https://bugs.webkit.org/show_bug.cgi?id=197390
1638 <rdar://problem/42685773>
1640 Reviewed by Geoffrey Garen.
1642 * wtf/FileSystem.cpp:
1643 (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
1644 (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
1646 * wtf/cocoa/FileSystemCocoa.mm:
1647 (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
1648 (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
1650 2019-05-03 Commit Queue <commit-queue@webkit.org>
1652 Unreviewed, rolling out r244881.
1653 https://bugs.webkit.org/show_bug.cgi?id=197559
1655 Breaks compilation of jsconly on linux, breaking compilation
1656 for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
1657 guijemont on #webkit).
1661 "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
1663 https://bugs.webkit.org/show_bug.cgi?id=197174
1664 https://trac.webkit.org/changeset/244881
1666 2019-05-02 Alex Christensen <achristensen@webkit.org>
1668 Mark U+01C0 as a homograph of U+006C
1669 https://bugs.webkit.org/show_bug.cgi?id=197526
1670 <rdar://problem/50301904>
1672 Reviewed by Tim Horton.
1674 * wtf/URLHelpers.cpp:
1675 (WTF::URLHelpers::isLookalikeCharacter):
1677 2019-05-02 Don Olmstead <don.olmstead@sony.com>
1679 [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
1680 https://bugs.webkit.org/show_bug.cgi?id=197174
1682 Reviewed by Alex Christensen.
1684 Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES.
1686 * wtf/CMakeLists.txt:
1688 2019-05-01 Darin Adler <darin@apple.com>
1690 WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
1691 https://bugs.webkit.org/show_bug.cgi?id=195535
1693 Reviewed by Alexey Proskuryakov.
1695 * wtf/text/AtomicString.cpp:
1696 (WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
1697 end is nullptr; this behavior used to be implemented inside the
1698 calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
1700 * wtf/text/AtomicStringImpl.cpp:
1701 (WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
1704 * wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
1705 AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
1706 the AtomicString class and its behavior changed subtly in this patch; it's helpful
1707 to document that it's not exported.
1709 * wtf/text/StringImpl.cpp:
1710 (WTF::StringImpl::utf8Impl): Don't pass "true" for strictness to convertUTF16ToUTF8
1711 since strict is the default. Also updated for changes to ConversionResult.
1712 (WTF::StringImpl::utf8ForCharacters): Updated for change to convertLatin1ToUTF8.
1713 (WTF::StringImpl::tryGetUtf8ForRange const): Ditto.
1715 * wtf/text/StringView.cpp: Removed uneeded include of UTF8Conversion.h.
1717 * wtf/text/WTFString.cpp:
1718 (WTF::String::fromUTF8): Updated for change to convertUTF8ToUTF16.
1720 * wtf/unicode/UTF8Conversion.cpp:
1721 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII): Deleted.
1722 (WTF::Unicode::inlineUTF8SequenceLength): Deleted.
1723 (WTF::Unicode::UTF8SequenceLength): Deleted.
1724 (WTF::Unicode::decodeUTF8Sequence): Deleted.
1725 (WTF::Unicode::convertLatin1ToUTF8): Use U8_APPEND, enabling us to remove
1726 almost everything in the function. Also changed resturn value to be a boolean
1727 to indicate success since there is only one possible failure (target exhausted).
1728 There is room for further simplification, since most callers have lengths rather
1729 than end pointers for the source buffer, and all but one caller supplies a buffer
1730 size known to be sufficient, so those don't need a return value, nor do they need
1731 to pass an end of buffer pointer.
1732 (WTF::Unicode::convertUTF16ToUTF8): Use U_IS_LEAD, U_IS_TRAIL,
1733 U16_GET_SUPPLEMENTARY, U_IS_SURROGATE, and U8_APPEND. Also changed behavior
1734 for non-strict mode so that unpaired surrogates will be turned into the
1735 replacement character instead of invalid UTF-8 sequences, because U8_APPEND
1736 won't create an invalid UTF-8 sequence, and because we don't need to do that
1737 for any good reason at any call site.
1738 (WTF::Unicode::isLegalUTF8): Deleted.
1739 (WTF::Unicode::readUTF8Sequence): Deleted.
1740 (WTF::Unicode::convertUTF8ToUTF16): Use U8_NEXT instead of
1741 inlineUTF8SequenceLength, isLegalUTF8, and readUTF8Sequence. Use
1742 U16_APPEND instead of lots of code that does the same thing. There is
1743 room for further simplification since most callers don't need the "all ASCII"
1744 feature and could probably pass the arguments in a more natural way.
1745 (WTF::Unicode::calculateStringHashAndLengthFromUTF8MaskingTop8Bits):
1746 Use U8_NEXT instead of isLegalUTF8, readUTF8Sequence, and various
1747 error handling checks for things that are handled by U8_NEXT. Also removed
1748 support for passing nullptr for end to specify a null-terminated string.
1749 (WTF::Unicode::equalUTF16WithUTF8): Ditto.
1751 * wtf/unicode/UTF8Conversion.h: Removed UTF8SequenceLength and
1752 decodeUTF8Sequence. Changed the ConversionResult to match WebKit coding
1753 style, with an eye toward perhaps removing it in the future. Changed
1754 the convertUTF8ToUTF16 return value to a boolean and removed the "strict"
1755 argument since no caller was passing false. Changed the convertLatin1ToUTF8
1756 return value to a boolean. Tweaked comments.
1758 2019-05-01 Shawn Roberts <sroberts@apple.com>
1760 Unreviewed, rolling out r244821.
1766 "WebKit has too much of its own UTF-8 code and should rely
1767 more on ICU's UTF-8 support"
1768 https://bugs.webkit.org/show_bug.cgi?id=195535
1769 https://trac.webkit.org/changeset/244821
1771 2019-05-01 Shawn Roberts <sroberts@apple.com>
1773 Unreviewed, rolling out r244822.
1775 Causing 4 Test262 failures on JSC Release and Debug
1779 https://trac.webkit.org/changeset/244822 https://trac.webkit.org/changeset/244821
1781 2019-04-29 Darin Adler <darin@apple.com>
1783 WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
1784 https://bugs.webkit.org/show_bug.cgi?id=195535
1786 Reviewed by Alexey Proskuryakov.
1788 * wtf/text/AtomicString.cpp:
1789 (WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
1790 end is nullptr; this behavior used to be implemented inside the
1791 calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
1793 * wtf/text/AtomicStringImpl.cpp:
1794 (WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
1797 * wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
1798 AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
1799 the AtomicString class and its behavior changed subtly in this patch; it's helpful
1800 to document that it's not exported.
1802 * wtf/text/StringImpl.cpp:
1803 (WTF::StringImpl::utf8Impl): Don't pass "true" for strictness to convertUTF16ToUTF8
1804 since strict is the default. Also updated for changes to ConversionResult.
1805 (WTF::StringImpl::utf8ForCharacters): Updated for change to convertLatin1ToUTF8.
1806 (WTF::StringImpl::tryGetUtf8ForRange const): Ditto.
1808 * wtf/text/StringView.cpp: Removed uneeded include of UTF8Conversion.h.
1810 * wtf/text/WTFString.cpp:
1811 (WTF::String::fromUTF8): Updated for change to convertUTF8ToUTF16.
1813 * wtf/unicode/UTF8Conversion.cpp:
1814 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII): Deleted.
1815 (WTF::Unicode::inlineUTF8SequenceLength): Deleted.
1816 (WTF::Unicode::UTF8SequenceLength): Deleted.
1817 (WTF::Unicode::decodeUTF8Sequence): Deleted.
1818 (WTF::Unicode::convertLatin1ToUTF8): Use U8_APPEND, enabling us to remove
1819 almost everything in the function. Also changed resturn value to be a boolean
1820 to indicate success since there is only one possible failure (target exhausted).
1821 There is room for further simplification, since most callers have lengths rather
1822 than end pointers for the source buffer, and all but one caller supplies a buffer
1823 size known to be sufficient, so those don't need a return value, nor do they need
1824 to pass an end of buffer pointer.
1825 (WTF::Unicode::convertUTF16ToUTF8): Use U_IS_LEAD, U_IS_TRAIL,
1826 U16_GET_SUPPLEMENTARY, U_IS_SURROGATE, and U8_APPEND. Also changed behavior
1827 for non-strict mode so that unpaired surrogates will be turned into the
1828 replacement character instead of invalid UTF-8 sequences, because U8_APPEND
1829 won't create an invalid UTF-8 sequence, and because we don't need to do that
1830 for any good reason at any call site.
1831 (WTF::Unicode::isLegalUTF8): Deleted.
1832 (WTF::Unicode::readUTF8Sequence): Deleted.
1833 (WTF::Unicode::convertUTF8ToUTF16): Use U8_NEXT instead of
1834 inlineUTF8SequenceLength, isLegalUTF8, and readUTF8Sequence. Use
1835 U16_APPEND instead of lots of code that does the same thing. There is
1836 room for further simplification since most callers don't need the "all ASCII"
1837 feature and could probably pass the arguments in a more natural way.
1838 (WTF::Unicode::calculateStringHashAndLengthFromUTF8MaskingTop8Bits):
1839 Use U8_NEXT instead of isLegalUTF8, readUTF8Sequence, and various
1840 error handling checks for things that are handled by U8_NEXT. Also removed
1841 support for passing nullptr for end to specify a null-terminated string.
1842 (WTF::Unicode::equalUTF16WithUTF8): Ditto.
1844 * wtf/unicode/UTF8Conversion.h: Removed UTF8SequenceLength and
1845 decodeUTF8Sequence. Changed the ConversionResult to match WebKit coding
1846 style, with an eye toward perhaps removing it in the future. Changed
1847 the convertUTF8ToUTF16 return value to a boolean and removed the "strict"
1848 argument since no caller was passing false. Changed the convertLatin1ToUTF8
1849 return value to a boolean. Tweaked comments.
1851 2019-04-30 John Wilander <wilander@apple.com>
1853 Add logging of Ad Click Attribution errors and events to a dedicated channel
1854 https://bugs.webkit.org/show_bug.cgi?id=197332
1855 <rdar://problem/49918800>
1857 Reviewed by Youenn Fablet.
1859 Added missing RELEASE_LOG_INFO and RELEASE_LOG_INFO_IF dummies
1860 for RELEASE_LOG_DISABLED.
1864 2019-04-30 Youenn Fablet <youenn@apple.com>
1866 Make Document audio producers use WeakPtr
1867 https://bugs.webkit.org/show_bug.cgi?id=197382
1869 Reviewed by Eric Carlson.
1871 * wtf/WeakHashSet.h:
1872 (WTF::WeakHashSet::hasNullReferences const):
1874 2019-04-30 Commit Queue <commit-queue@webkit.org>
1876 Unreviewed, rolling out r244773.
1877 https://bugs.webkit.org/show_bug.cgi?id=197436
1879 Causing assertion failures on debug queues (Requested by
1880 ShawnRoberts on #webkit).
1884 "Make Document audio producers use WeakPtr"
1885 https://bugs.webkit.org/show_bug.cgi?id=197382
1886 https://trac.webkit.org/changeset/244773
1888 2019-04-30 Youenn Fablet <youenn@apple.com>
1890 Make Document audio producers use WeakPtr
1891 https://bugs.webkit.org/show_bug.cgi?id=197382
1893 Reviewed by Eric Carlson.
1895 * wtf/WeakHashSet.h:
1896 (WTF::WeakHashSet::hasNullReferences const):
1898 2019-04-29 Alex Christensen <achristensen@webkit.org>
1900 <rdar://problem/50299396> Fix internal High Sierra build
1901 https://bugs.webkit.org/show_bug.cgi?id=197388
1903 * Configurations/Base.xcconfig:
1905 2019-04-29 Yusuke Suzuki <ysuzuki@apple.com>
1907 JITStubRoutineSet wastes 180KB of HashTable capacity on can.com
1908 https://bugs.webkit.org/show_bug.cgi?id=186732
1910 Reviewed by Saam Barati.
1913 (WTF::Range::contains const):
1915 2019-04-29 Basuke Suzuki <Basuke.Suzuki@sony.com>
1917 [Win] Add flag to enable version information stamping and disable by default.
1918 https://bugs.webkit.org/show_bug.cgi?id=197249
1919 <rdar://problem/50224412>
1921 Reviewed by Ross Kirsling.
1923 This feature is only used in AppleWin port. Add flag for this task and make it OFF by default.
1924 Then enable it by default on AppleWin.
1926 * wtf/CMakeLists.txt:
1928 2019-04-26 Don Olmstead <don.olmstead@sony.com>
1930 Add WTF::findIgnoringASCIICaseWithoutLength to replace strcasestr
1931 https://bugs.webkit.org/show_bug.cgi?id=197291
1933 Reviewed by Konstantin Tokarev.
1935 Adds an implementation of strcasestr within WTF.
1937 * wtf/text/StringCommon.h:
1938 (WTF::findIgnoringASCIICaseWithoutLength):
1940 2019-04-26 Sihui Liu <sihui_liu@apple.com>
1942 Stop IDB transactions to release locked database files when network process is ready to suspend
1943 https://bugs.webkit.org/show_bug.cgi?id=196372
1944 <rdar://problem/48930116>
1946 Reviewed by Brady Eidson.
1948 Provide a method to suspend the thread and block main thread until the thread is suspended.
1950 * wtf/CrossThreadTaskHandler.cpp:
1951 (WTF::CrossThreadTaskHandler::taskRunLoop):
1952 (WTF::CrossThreadTaskHandler::suspendAndWait):
1953 (WTF::CrossThreadTaskHandler::resume):
1954 * wtf/CrossThreadTaskHandler.h:
1956 2019-04-25 Fujii Hironori <Hironori.Fujii@sony.com>
1958 Unreviewed, rolling out r244669.
1960 Windows ports can't clean build.
1964 "[Win] Add flag to enable version information stamping and
1965 disable by default."
1966 https://bugs.webkit.org/show_bug.cgi?id=197249
1967 https://trac.webkit.org/changeset/244669
1969 2019-04-25 Basuke Suzuki <Basuke.Suzuki@sony.com>
1971 [Win] Add flag to enable version information stamping and disable by default.
1972 https://bugs.webkit.org/show_bug.cgi?id=197249
1974 Reviewed by Ross Kirsling.
1976 This feature is only used in AppleWin port. Add flag for this task and make it OFF by default.
1977 Then enable it by default on AppleWin.
1979 * wtf/CMakeLists.txt:
1981 2019-04-25 Timothy Hatcher <timothy@apple.com>
1983 Disable date and time inputs on iOSMac.
1984 https://bugs.webkit.org/show_bug.cgi?id=197287
1985 rdar://problem/46794376
1987 Reviewed by Wenson Hsieh.
1989 * wtf/FeatureDefines.h:
1991 2019-04-25 Alex Christensen <achristensen@webkit.org>
1993 Fix High Sierra build after r244653
1994 https://bugs.webkit.org/show_bug.cgi?id=197131
1996 * wtf/StdLibExtras.h:
1997 High Sierra thinks __cplusplus is 201406 even when using C++17.
1998 Removing the __cplusplus check resolves the build failure on High Sierra.
1999 We can clean up StdLibExtras more later.
2001 2019-04-25 Alex Christensen <achristensen@webkit.org>
2004 https://bugs.webkit.org/show_bug.cgi?id=197131
2006 Reviewed by Darin Adler.
2008 * Configurations/Base.xcconfig:
2009 * wtf/CMakeLists.txt:
2013 2019-04-25 Alex Christensen <achristensen@webkit.org>
2015 Remove DeprecatedOptional
2016 https://bugs.webkit.org/show_bug.cgi?id=197161
2018 Reviewed by Darin Adler.
2020 * WTF.xcodeproj/project.pbxproj:
2021 * wtf/CMakeLists.txt:
2022 * wtf/DeprecatedOptional.h: Removed.
2024 2019-04-24 Carlos Garcia Campos <cgarcia@igalia.com>
2026 [GTK] Hardcoded text color in input fields
2027 https://bugs.webkit.org/show_bug.cgi?id=126907
2029 Reviewed by Michael Catanzaro.
2031 Define HAVE_OS_DARK_MODE_SUPPORT for GTK port.
2035 2019-04-24 Tim Horton <timothy_horton@apple.com>
2037 Clean up WKActionSheetAssistant's use of LaunchServices
2038 https://bugs.webkit.org/show_bug.cgi?id=194645
2039 <rdar://problem/47707952>
2041 Reviewed by Andy Estes.
2045 2019-04-24 chris fleizach <cfleizach@apple.com>
2047 AX: Remove deprecated Accessibility Object Model events
2048 https://bugs.webkit.org/show_bug.cgi?id=197073
2049 <rdar://problem/50027819>
2051 Reviewed by Ryosuke Niwa.
2055 2019-04-23 Commit Queue <commit-queue@webkit.org>
2057 Unreviewed, rolling out r244558.
2058 https://bugs.webkit.org/show_bug.cgi?id=197219
2060 Causing crashes on iOS Sim Release and Debug (Requested by
2061 ShawnRoberts on #webkit).
2065 "Remove DeprecatedOptional"
2066 https://bugs.webkit.org/show_bug.cgi?id=197161
2067 https://trac.webkit.org/changeset/244558
2069 2019-04-23 Alex Christensen <achristensen@webkit.org>
2071 Remove DeprecatedOptional
2072 https://bugs.webkit.org/show_bug.cgi?id=197161
2074 Reviewed by Darin Adler.
2076 This was added in r209326 to be compatible with a shipping version of Safari.
2077 We have released several versions of Safari since then, so do what the comments say and remove it.
2078 The existence of this std::optional makes migrating to C++17 harder, and there's no reason to keep it.
2080 * WTF.xcodeproj/project.pbxproj:
2081 * wtf/CMakeLists.txt:
2082 * wtf/DeprecatedOptional.h: Removed.
2084 2019-04-21 Zan Dobersek <zdobersek@igalia.com>
2086 [WTF] Generic memoryFootprint() implementation should use bmalloc on Linux
2087 https://bugs.webkit.org/show_bug.cgi?id=196963
2089 Reviewed by Don Olmstead.
2091 Have the generic memoryFootprint() implementation use bmalloc's
2092 memoryFootprint() API on Linux, whenever the system malloc option is
2093 not enabled. Limitation to Linux platforms is due to the bmalloc
2094 implementation being limited to those configurations (excluding iOS
2095 which doesn't use MemoryFootprintGeneric.cpp).
2097 * wtf/PlatformWPE.cmake: Switch to building MemoryFootprintGeneric.cpp.
2098 * wtf/generic/MemoryFootprintGeneric.cpp:
2099 (WTF::memoryFootprint):
2101 2019-04-19 Ryosuke Niwa <rniwa@webkit.org>
2103 HashTable::removeIf always shrinks the hash table by half even if there is nothing left
2104 https://bugs.webkit.org/show_bug.cgi?id=196681
2105 <rdar://problem/49917764>
2107 Reviewed by Darin Adler.
2109 Address Darin's comments by removing the explicit type from std::max.
2112 (WTF::KeyTraits>::computeBestTableSize):
2113 (WTF::KeyTraits>::shrinkToBestSize):
2115 2019-04-18 Chris Dumez <cdumez@apple.com>
2117 [iOS] Improve detection of when web views go to background / foreground
2118 https://bugs.webkit.org/show_bug.cgi?id=197035
2119 <rdar://problem/45281182>
2121 Reviewed by Tim Horton.
2123 Add build time flag.
2125 * wtf/FeatureDefines.h:
2127 2019-04-18 Jer Noble <jer.noble@apple.com>
2129 Add support for parsing FairPlayStreaming PSSH boxes.
2130 https://bugs.webkit.org/show_bug.cgi?id=197064
2132 Reviewed by Eric Carlson.
2136 2019-04-18 Yusuke Suzuki <ysuzuki@apple.com>
2138 [WTF] StringBuilder should set correct m_is8Bit flag when merging
2139 https://bugs.webkit.org/show_bug.cgi?id=197053
2141 Reviewed by Saam Barati.
2143 When appending StringBuilder to the other StringBuilder, we have a path that does not set m_is8Bit flag correctly.
2144 This patch correctly sets this flag. And we also change 0 to nullptr when we are using 0 as a pointer.
2146 * wtf/text/StringBuilder.cpp:
2147 (WTF::StringBuilder::reserveCapacity):
2148 (WTF::StringBuilder::appendUninitializedSlow):
2149 (WTF::StringBuilder::append):
2150 * wtf/text/StringBuilder.h:
2151 (WTF::StringBuilder::append):
2152 (WTF::StringBuilder::characters8 const):
2153 (WTF::StringBuilder::characters16 const):
2154 (WTF::StringBuilder::clear):
2156 2019-04-17 Tim Horton <timothy_horton@apple.com>
2158 Adopt different scroll view flashing SPI
2159 https://bugs.webkit.org/show_bug.cgi?id=197043
2160 <rdar://problem/49996476>
2162 Reviewed by Wenson Hsieh.
2166 2019-04-17 Jer Noble <jer.noble@apple.com>
2168 Enable HAVE_AVFOUNDATION_VIDEO_OUTPUT on PLATFORM(IOSMAC)
2169 https://bugs.webkit.org/show_bug.cgi?id=196994
2170 <rdar://problem/44158331>
2172 Reviewed by Alex Christensen.
2176 2019-04-16 Stephan Szabo <stephan.szabo@sony.com>
2178 [PlayStation] Update port for system library changes
2179 https://bugs.webkit.org/show_bug.cgi?id=196978
2181 Reviewed by Ross Kirsling.
2183 * wtf/PlatformPlayStation.cmake:
2184 Remove reference to deleted system library
2186 2019-04-16 Jer Noble <jer.noble@apple.com>
2188 Enable HAVE_AVKIT on PLATFORM(IOSMAC)
2189 https://bugs.webkit.org/show_bug.cgi?id=196987
2191 Reviewed by Tim Horton.
2195 2019-04-16 Robin Morisset <rmorisset@apple.com>
2197 [WTF] holdLock should be marked WARN_UNUSED_RETURN
2198 https://bugs.webkit.org/show_bug.cgi?id=196922
2200 Reviewed by Keith Miller.
2204 2019-04-16 Don Olmstead <don.olmstead@sony.com>
2206 [CMake] Set WTF_SCRIPTS_DIR
2207 https://bugs.webkit.org/show_bug.cgi?id=196917
2209 Reviewed by Konstantin Tokarev.
2211 Use WTF_SCRIPTS_DIR for copying the unified sources script.
2213 * wtf/CMakeLists.txt:
2215 2019-04-15 Myles C. Maxfield <mmaxfield@apple.com>
2217 [Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
2218 https://bugs.webkit.org/show_bug.cgi?id=196846
2219 <rdar://problem/49499971>
2221 Reviewed by Simon Fraser and Darin Adler.
2227 2019-04-12 Ryosuke Niwa <rniwa@webkit.org>
2229 HashTable::removeIf always shrinks the hash table by half even if there is nothing left
2230 https://bugs.webkit.org/show_bug.cgi?id=196681
2232 Reviewed by Darin Adler.
2234 Made HashTable::removeIf shrink to the "best size", which is the least power of two bigger
2235 than twice the key count as already used in the copy constructor.
2238 (WTF::HashTable::computeBestTableSize): Extracted from the copy constructor.
2239 (WTF::HashTable::shrinkToBestSize): Added.
2240 (WTF::HashTable::removeIf): Use shrinkToBestSize instead of shrink.
2241 (WTF::HashTable::HashTable):
2243 2019-04-12 Eric Carlson <eric.carlson@apple.com>
2245 Update AudioSession route sharing policy
2246 https://bugs.webkit.org/show_bug.cgi?id=196776
2247 <rdar://problem/46501611>
2249 Reviewed by Jer Noble.
2251 * wtf/Platform.h: Define HAVE_ROUTE_SHARING_POLICY_LONG_FORM_VIDEO.
2253 2019-04-10 Said Abou-Hallawa <sabouhallawa@apple.com>
2255 requestAnimationFrame should execute before the next frame
2256 https://bugs.webkit.org/show_bug.cgi?id=177484
2258 Reviewed by Simon Fraser.
2260 Add trace points for the page RenderingUpdate.
2262 * wtf/SystemTracing.h:
2264 2019-04-10 Claudio Saavedra <csaavedra@igalia.com>
2266 Do not generate empty unified sources when unified builds are disabled
2267 https://bugs.webkit.org/show_bug.cgi?id=196767
2269 Reviewed by Konstantin Tokarev.
2271 If unified builds are disabled, the ruby script to generate them
2272 is still used to list the sources that need to be
2273 compiled. Currently, the script always generates bundled unified
2274 sources, even if it's being used just to list all the sources. So
2275 when the unified builds are disabled and no files are going to be
2276 bundled, the script generates one empty file per bundle manager
2277 (that is, one C++ and one ObjectiveC), that gets added to the
2278 sources to be compiled.
2280 * Scripts/generate-unified-source-bundles.rb: Only go through the
2281 bundle managers file generation when not running in
2282 PrintAllSources mode, to avoid generating empty bundle files.
2284 2019-04-10 Enrique Ocaña González <eocanha@igalia.com>
2286 [WPE] Avoid async IO starving timers
2287 https://bugs.webkit.org/show_bug.cgi?id=196733
2289 Reviewed by Carlos Garcia Campos.
2291 If AsyncIONetwork and DiskCacheRead priorities are higher than
2292 MainThreadSharedTimer the timers get starved. This causes the NetworkProcess
2293 to accumulate MB of data instead of handing it down to the WebProcess (done
2294 using a Timer). This eventually causes an Out Of Memory kill on the
2295 NetworkProcess on some embedded platforms with low memory limits.
2297 This patch levels the three priorities to the same value, while still leaving
2298 DiskCacheWrite with less priority than DiskCacheRead.
2300 * wtf/glib/RunLoopSourcePriority.h: Changed RunLoopSourcePriority values for WPE.
2302 2019-04-09 Don Olmstead <don.olmstead@sony.com>
2304 [CMake] WTF derived sources should only be referenced inside WTF
2305 https://bugs.webkit.org/show_bug.cgi?id=196706
2307 Reviewed by Konstantin Tokarev.
2309 Use ${WTF_DERIVED_SOURCES_DIR} instead of ${DERIVED_SOURCES_DIR} within WTF.
2311 * wtf/CMakeLists.txt:
2312 * wtf/PlatformJSCOnly.cmake:
2313 * wtf/PlatformMac.cmake:
2315 2019-04-09 Don Olmstead <don.olmstead@sony.com>
2317 [CMake] Apple builds should use ICU_INCLUDE_DIRS
2318 https://bugs.webkit.org/show_bug.cgi?id=196720
2320 Reviewed by Konstantin Tokarev.
2322 Copy ICU headers for Apple builds into ICU_INCLUDE_DIRS.
2325 * wtf/PlatformMac.cmake:
2327 2019-04-08 Don Olmstead <don.olmstead@sony.com>
2329 [CMake][WinCairo] Separate copied headers into different directories
2330 https://bugs.webkit.org/show_bug.cgi?id=196655
2332 Reviewed by Michael Catanzaro.
2334 * wtf/CMakeLists.txt:
2336 2019-04-08 Guillaume Emont <guijemont@igalia.com>
2339 https://bugs.webkit.org/show_bug.cgi?id=196689
2341 Reviewed by Žan Doberšek.
2343 Since the bytecode change, we enabled the baseline JIT on mips in
2344 r240432, but DFG is still missing. With this change, all tests are
2345 passing on a ci20 board.
2347 * wtf/Platform.h: Enable DFG on MIPS by default.
2349 2019-04-06 Ryosuke Niwa <rniwa@webkit.org>
2351 Added tests for WeakHashSet::computesEmpty and WeakHashSet::computeSize
2352 https://bugs.webkit.org/show_bug.cgi?id=196669
2354 Reviewed by Geoffrey Garen.
2356 Removed the superflous type names from forward declarations, and made WeakHashSet::add
2357 take a const object to match other container types in WTF.
2359 * wtf/WeakHashSet.h:
2360 (WTF::WeakHashSet::add):
2363 2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
2365 Make WeakPtr<Element> possible and deploy it in form associated elements code
2366 https://bugs.webkit.org/show_bug.cgi?id=196626
2368 Reviewed by Antti Koivisto.
2370 Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
2371 a subclass type U of a type T used to define WeakReference<T>.
2373 Also added computesEmpty, which is slightly more efficient than computeSize
2374 when m_set is either empty or when there are non-released weak references in the set.
2376 * wtf/WeakHashSet.h:
2377 (WTF::WeakHashSet::remove):
2378 (WTF::WeakHashSet::contains const):
2379 (WTF::WeakHashSet::computesEmpty const): Added.
2380 * wtf/WeakPtr.h: Added an explicit forward declaration of WeakHashSet to avoid
2381 build failures in GTK+ and WPE ports.
2383 2019-04-05 Eric Carlson <eric.carlson@apple.com>
2385 Remove AUDIO_TOOLBOX_AUDIO_SESSION
2386 https://bugs.webkit.org/show_bug.cgi?id=196653
2387 <rdar://problem/49652098>
2389 Reviewed by Jer Noble.
2393 2019-04-05 Michael Catanzaro <mcatanzaro@igalia.com>
2395 Unreviewed manual rollout of r243929
2396 https://bugs.webkit.org/show_bug.cgi?id=196626
2398 * wtf/WeakHashSet.h:
2399 (WTF::WeakHashSet::remove):
2400 (WTF::WeakHashSet::contains const):
2401 (WTF::WeakHashSet::computesEmpty const): Deleted.
2403 2019-04-05 Commit Queue <commit-queue@webkit.org>
2405 Unreviewed, rolling out r243833.
2406 https://bugs.webkit.org/show_bug.cgi?id=196645
2408 This change breaks build of WPE and GTK ports (Requested by
2409 annulen on #webkit).
2413 "[CMake][WTF] Mirror XCode header directories"
2414 https://bugs.webkit.org/show_bug.cgi?id=191662
2415 https://trac.webkit.org/changeset/243833
2417 2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
2419 Make WeakPtr<Element> possible and deploy it in form associated elements code
2420 https://bugs.webkit.org/show_bug.cgi?id=196626
2422 Reviewed by Antti Koivisto.
2424 Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
2425 a subclass type U of a type T used to define WeakReference<T>.
2427 Also added computesEmpty, which is slightly more efficient than computeSize
2428 when m_set is either empty or when there are non-released weak references in the set.
2430 * wtf/WeakHashSet.h:
2431 (WTF::WeakHashSet::remove):
2432 (WTF::WeakHashSet::contains const):
2433 (WTF::WeakHashSet::computesEmpty const): Added.
2435 2019-04-04 Yusuke Suzuki <ysuzuki@apple.com>
2437 [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
2438 https://bugs.webkit.org/show_bug.cgi?id=196475
2440 Reviewed by Saam Barati.
2442 * wtf/ForbidHeapAllocation.h:
2444 * wtf/IsoMallocInlines.h:
2446 2019-04-03 Don Olmstead <don.olmstead@sony.com>
2448 [CMake][WTF] Mirror XCode header directories
2449 https://bugs.webkit.org/show_bug.cgi?id=191662
2451 Reviewed by Konstantin Tokarev.
2453 Rename WTF forwarding header target to WTFFramework and update the install location
2454 to WTF_FRAMEWORK_HEADERS_DIR.
2456 * wtf/CMakeLists.txt:
2458 2019-04-03 Joseph Pecoraro <pecoraro@apple.com>
2460 Web Inspector: Remote Inspector indicate callback should always happen on the main thread
2461 https://bugs.webkit.org/show_bug.cgi?id=196513
2462 <rdar://problem/49498284>
2464 Reviewed by Devin Rousso.
2467 * wtf/cocoa/MainThreadCocoa.mm:
2468 (WTF::dispatchAsyncOnMainThreadWithWebThreadLockIfNeeded):
2469 * wtf/ios/WebCoreThread.cpp:
2470 * wtf/ios/WebCoreThread.h:
2472 2019-04-02 Keith Rollin <krollin@apple.com>
2474 Inhibit CFNetwork logging in private sessions
2475 https://bugs.webkit.org/show_bug.cgi?id=196268
2476 <rdar://problem/48210793>
2478 Fix a conditional in Platform.h where IOS should have been used
2479 instead of IOS_FAMILY. The latter happened to work, but we really want
2480 to be using the proper symbol here.
2482 Reviewed by Alexey Proskuryakov.
2486 2019-04-01 Michael Catanzaro <mcatanzaro@igalia.com>
2488 Stop trying to support building JSC with clang 3.8
2489 https://bugs.webkit.org/show_bug.cgi?id=195947
2490 <rdar://problem/49069219>
2492 Reviewed by Darin Adler.
2494 It seems WebKit hasn't built with clang 3.8 in a while, no devs are using this compiler, we
2495 don't know how much effort it would be to make JSC work again, and it's making the code
2496 worse. Remove my hacks to support clang 3.8 from WTF.
2498 * wtf/MetaAllocator.cpp:
2499 (WTF::MetaAllocator::allocate):
2500 * wtf/text/StringConcatenate.h:
2501 (WTF::tryMakeStringFromAdapters):
2503 2019-03-31 Yusuke Suzuki <ysuzuki@apple.com>
2505 [JSC] Butterfly allocation from LargeAllocation should try "realloc" behavior if collector thread is not active
2506 https://bugs.webkit.org/show_bug.cgi?id=196160
2508 Reviewed by Saam Barati.
2511 (WTF::FastMalloc::tryRealloc):
2513 (Gigacage::tryRealloc):
2516 2019-03-31 Andy Estes <aestes@apple.com>
2518 [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
2519 https://bugs.webkit.org/show_bug.cgi?id=196433
2520 <rdar://problem/49293305>
2522 Reviewed by Tim Horton.
2524 * wtf/NeverDestroyed.h:
2525 (WTF::NeverDestroyed::operator->):
2526 (WTF::NeverDestroyed::operator-> const):
2528 2019-03-28 Fujii Hironori <Hironori.Fujii@sony.com>
2530 Unreviewed build fix.
2532 * wtf/CMakeLists.txt: Added SpanningTree.h to WTF_PUBLIC_HEADERS.
2534 2019-03-28 Saam Barati <sbarati@apple.com>
2536 BackwardsGraph needs to consider back edges as the backward's root successor
2537 https://bugs.webkit.org/show_bug.cgi?id=195991
2539 Reviewed by Filip Pizlo.
2541 Previously, our backwards graph analysis was slightly wrong. The idea of
2542 backwards graph is that the root of the graph has edges to terminals in
2543 the original graph. And then the original directed edges in the graph are flipped.
2545 However, we weren't considering loops as a form of terminality. For example,
2546 we wouldn't consider an infinite loop as a terminal. So there were no edges
2547 from the root to a node in the infinite loop. This lead us to make mistakes
2548 when we used backwards dominators to compute control flow equivalence.
2550 This is better understood in an example:
2564 In the previous version of this algorithm, the only edge from the backwards
2565 root would be to the block containing the return. This would lead us to
2566 believe that the loading of the structureID backwards dominates the preheader,
2567 leading us to believe it's control flow equivalent to preheader. This is
2568 obviously wrong, since we can loop forever if "v" isn't a cell.
2570 The solution here is to treat any backedge in the graph as a "terminal" node.
2571 Since a backedge implies the existence of a loop.
2573 In the above example, the backwards root now has an edge to both blocks with
2574 "continue". This prevents us from falsely claiming that the return is control
2575 flow equivalent with the preheader.
2577 This patch uses DFS spanning trees to compute back edges. An edge
2578 u->v is a back edge when u is a descendent of v in the DFS spanning
2581 * WTF.xcodeproj/project.pbxproj:
2582 * wtf/BackwardsGraph.h:
2583 (WTF::BackwardsGraph::BackwardsGraph):
2584 * wtf/SpanningTree.h: Added.
2585 (SpanningTree::SpanningTree):
2586 (SpanningTree::isDescendent):
2588 2019-03-28 Tim Horton <timothy_horton@apple.com>
2593 It is no longer necessary to exclude this from PLATFORM(IOSMAC).
2595 2019-03-27 Per Arne Vollan <pvollan@apple.com>
2597 Layout Test js/math-clz32.html is failing
2598 https://bugs.webkit.org/show_bug.cgi?id=196209
2600 Reviewed by Ross Kirsling.
2602 Use the correct number of loop iterations when counting leading zeros. Also, the
2603 count was off by one for the Win64 case.
2608 2019-03-26 Keith Rollin <krollin@apple.com>
2610 Inhibit CFNetwork logging in private sessions
2611 https://bugs.webkit.org/show_bug.cgi?id=196268
2612 <rdar://problem/48210793>
2614 Reviewed by Alex Christensen.
2616 Before performing any logging, the NetworkProcess checks to see if
2617 it's performing an operation associated with a private (ephemeral)
2618 browsing session. If so, it skips the logging. However, networking
2619 layers below the NetworkProcess don't know about private browsing, so
2620 they would still perform their own logging. CFNetwork now has a flag
2621 that lets us control that, so set it to False if private browsing.
2625 2019-03-25 Alex Christensen <achristensen@webkit.org>
2627 Expected shouldn't assume its contained types are copyable
2628 https://bugs.webkit.org/show_bug.cgi?id=195986
2630 Reviewed by JF Bastien.
2633 (std::experimental::fundamentals_v3::__expected_detail::constexpr_base::constexpr_base):
2634 (std::experimental::fundamentals_v3::operator==):
2635 (std::experimental::fundamentals_v3::operator!=):
2637 (std::experimental::fundamentals_v3::unexpected::unexpected):
2639 2019-03-24 Keith Miller <keith_miller@apple.com>
2641 Unreviewed, forgot to refactor variable name for windows build in
2648 2019-03-24 Andy Estes <aestes@apple.com>
2650 [watchOS] Remove unused Proximity Networking code
2651 https://bugs.webkit.org/show_bug.cgi?id=196188
2653 Reviewed by Tim Horton.
2655 * wtf/FeatureDefines.h:
2657 2019-03-23 Keith Miller <keith_miller@apple.com>
2659 Refactor clz/ctz and fix getLSBSet.
2660 https://bugs.webkit.org/show_bug.cgi?id=196162
2662 Reviewed by Saam Barati.
2664 This patch makes clz32/64 and ctz32 generic so they work on any
2665 numeric type. Since these methods work on any type we don't need
2666 to have a separate implementation of getLSBSet, which also
2667 happened to be getMSBSet. This patch also adds getMSBSet as there
2668 may be users who want that in the future.
2675 (getLSBSet): Deleted.
2676 (WTF::clz32): Deleted.
2677 (WTF::clz64): Deleted.
2678 (WTF::ctz32): Deleted.
2680 2019-03-22 Keith Rollin <krollin@apple.com>
2682 Enable ThinLTO support in Production builds
2683 https://bugs.webkit.org/show_bug.cgi?id=190758
2684 <rdar://problem/45413233>
2686 Reviewed by Daniel Bates.
2688 Enable building with Thin LTO in Production when using Xcode 10.2 or
2689 later. This change results in a 1.45% progression in PLT5. Full
2690 Production build times increase about 2-3%. Incremental build times
2691 are more severely affected, and so LTO is not enabled for local
2694 LTO is enabled only on macOS for now, until rdar://problem/49013399,
2695 which affects ARM builds, is fixed.
2697 To change the LTO setting when building locally:
2699 - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
2701 - If building with `build-webkit`, specify --lto-mode={none,thin,full}
2702 on the command line.
2703 - If building with `build-root`, specify --lto={none,thin,full} on the
2705 - If building with Xcode, create a LocalOverrides.xcconfig file at the
2706 top level of your repository directory (if needed) and define
2707 WK_LTO_MODE to full, thin, or none.
2709 * Configurations/Base.xcconfig:
2711 2019-03-22 Tim Horton <timothy_horton@apple.com>
2713 Fix the build after r243354
2717 2019-03-22 Tim Horton <timothy_horton@apple.com>
2719 Fix the build after r243354
2720 https://bugs.webkit.org/show_bug.cgi?id=196138
2721 <rdar://problem/49145951>
2725 2019-03-21 Eric Carlson <eric.carlson@apple.com>
2727 Add UI process WebRTC runtime logging.
2728 https://bugs.webkit.org/show_bug.cgi?id=196020
2729 <rdar://problem/49071443>
2731 Reviewed by Youenn Fablet.
2734 (WTF::LogArgument::toString): Add long long and unsigned long long variants.
2736 2019-03-20 Simon Fraser <simon.fraser@apple.com>
2738 Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
2739 https://bugs.webkit.org/show_bug.cgi?id=196049
2741 Reviewed by Tim Horton.
2743 This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
2744 overflow scrolling in general, so rename it.
2746 * wtf/FeatureDefines.h:
2748 2019-03-20 Mark Lam <mark.lam@apple.com>
2750 Open source arm64e code.
2751 https://bugs.webkit.org/show_bug.cgi?id=196012
2752 <rdar://problem/49066237>
2754 Reviewed by Keith Miller.
2756 * WTF.xcodeproj/project.pbxproj:
2759 * wtf/PlatformRegisters.cpp: Added.
2760 (WTF::threadStateLRInternal):
2761 (WTF::threadStatePCInternal):
2762 * wtf/PlatformRegisters.h:
2763 * wtf/PointerPreparations.h:
2764 * wtf/PtrTag.cpp: Added.
2767 (WTF::registerPtrTagLookup):
2768 (WTF::reportBadTag):
2770 (WTF::removeCodePtrTag):
2771 (WTF::tagCodePtrImpl):
2773 (WTF::untagCodePtrImplHelper):
2774 (WTF::untagCodePtrImpl):
2775 (WTF::untagCodePtr):
2776 (WTF::retagCodePtrImplHelper):
2777 (WTF::retagCodePtrImpl):
2778 (WTF::retagCodePtr):
2779 (WTF::tagCFunctionPtrImpl):
2780 (WTF::tagCFunctionPtr):
2781 (WTF::untagCFunctionPtrImpl):
2782 (WTF::untagCFunctionPtr):
2784 (WTF::assertIsCFunctionPtr):
2785 (WTF::assertIsNullOrCFunctionPtr):
2786 (WTF::assertIsNotTagged):
2787 (WTF::assertIsTagged):
2788 (WTF::assertIsNullOrTagged):
2789 (WTF::isTaggedWith):
2790 (WTF::assertIsTaggedWith):
2791 (WTF::assertIsNullOrTaggedWith):
2792 (WTF::usesPointerTagging):
2793 (WTF::registerPtrTagLookup):
2794 (WTF::reportBadTag):
2795 (WTF::tagForPtr): Deleted.
2797 2019-03-20 Keith Rollin <krollin@apple.com>
2799 Update checks that determine if WebKit is system WebKit
2800 https://bugs.webkit.org/show_bug.cgi?id=195756
2802 Reviewed by Alexey Proskuryakov.
2804 The system WebKit can be installed in additional locations, so check
2805 for and allow those, too.
2809 2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
2811 Unreviewed, further attempt to fix clang 3.8 build
2812 https://bugs.webkit.org/show_bug.cgi?id=195947
2814 * wtf/MetaAllocator.cpp:
2815 (WTF::MetaAllocator::allocate):
2817 2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
2819 REGRESSION(r243115) breaks build for clang 3.8
2820 https://bugs.webkit.org/show_bug.cgi?id=195947
2822 Reviewed by Chris Dumez.
2824 * wtf/text/StringConcatenate.h:
2825 (WTF::tryMakeStringFromAdapters):
2827 2019-03-20 Tim Horton <timothy_horton@apple.com>
2829 Add an platform-driven spell-checking mechanism
2830 https://bugs.webkit.org/show_bug.cgi?id=195795
2832 Reviewed by Ryosuke Niwa.
2837 2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
2839 Build cleanly with GCC 9
2840 https://bugs.webkit.org/show_bug.cgi?id=195920
2842 Reviewed by Chris Dumez.
2844 WebKit triggers three new GCC 9 warnings:
2847 -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
2848 declared copy constructor and assignment operator if one of them is user-provided.
2851 Solution is to either add a copy constructor or copy assignment operator, if required, or
2852 else remove one if it is redundant.
2855 -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
2856 -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
2859 These account for most of this patch. Solution is to just remove the bad WTFMove().
2861 Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
2862 These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
2863 would be safer to not use memcpy on nontrivial types, but that's too complex for this
2864 patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
2866 * wtf/CheckedArithmetic.h:
2867 (WTF::Checked::Checked):
2868 * wtf/MetaAllocator.cpp:
2869 (WTF::MetaAllocator::allocate):
2870 * wtf/URLParser.cpp:
2871 (WTF::CodePointIterator::operator!= const):
2872 (WTF::CodePointIterator::operator=): Deleted.
2873 * wtf/text/StringView.h:
2874 (WTF::StringView::CodePoints::Iterator::operator=): Deleted.
2876 2019-03-19 Alex Christensen <achristensen@webkit.org>
2878 Make WTFLogChannelState and WTFLogLevel enum classes
2879 https://bugs.webkit.org/show_bug.cgi?id=195904
2881 Reviewed by Eric Carlson.
2883 * wtf/Assertions.cpp:
2886 (WTF::Logger::logAlways const):
2887 (WTF::Logger::error const):
2888 (WTF::Logger::warning const):
2889 (WTF::Logger::info const):
2890 (WTF::Logger::debug const):
2891 (WTF::Logger::willLog const):
2893 * wtf/MemoryPressureHandler.cpp:
2894 * wtf/RefCountedLeakCounter.cpp:
2896 2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
2898 Unreviewed, rolling out r243132.
2904 "Make WTFLogChannelState and WTFLogLevel enum classes"
2905 https://bugs.webkit.org/show_bug.cgi?id=195904
2906 https://trac.webkit.org/changeset/243132
2908 2019-03-18 Alex Christensen <achristensen@webkit.org>
2910 Make WTFLogChannelState and WTFLogLevel enum classes
2911 https://bugs.webkit.org/show_bug.cgi?id=195904
2913 Reviewed by Eric Carlson.
2915 * wtf/Assertions.cpp:
2918 (WTF::Logger::logAlways const):
2919 (WTF::Logger::error const):
2920 (WTF::Logger::warning const):
2921 (WTF::Logger::info const):
2922 (WTF::Logger::debug const):
2923 (WTF::Logger::willLog const):
2925 * wtf/MemoryPressureHandler.cpp:
2926 * wtf/RefCountedLeakCounter.cpp:
2928 2019-03-18 Darin Adler <darin@apple.com>
2930 Cut down on use of StringBuffer, possibly leading toward removing it entirely
2931 https://bugs.webkit.org/show_bug.cgi?id=195870
2933 Reviewed by Daniel Bates.
2935 * wtf/URL.cpp: Remove a now-inaccurate comment mentioning StringBuffer.
2937 * wtf/text/StringView.cpp:
2938 (WTF::convertASCIICase): Use createUninitialized instead of StringBuffer.
2940 2019-03-18 Xan Lopez <xan@igalia.com>
2942 [WTF] Remove redundant std::move in StringConcatenate
2943 https://bugs.webkit.org/show_bug.cgi?id=195798
2945 Reviewed by Darin Adler.
2947 Remove redundant calls to WTFMove in return values for this
2948 method. C++ will already do an implicit move here since we are
2949 returning a local value where copy/move elision is not applicable.
2951 * wtf/text/StringConcatenate.h:
2952 (WTF::tryMakeStringFromAdapters):
2954 2019-03-16 Darin Adler <darin@apple.com>
2956 Improve normalization code, including moving from unorm.h to unorm2.h
2957 https://bugs.webkit.org/show_bug.cgi?id=195330
2959 Reviewed by Michael Catanzaro.
2961 * wtf/URLHelpers.cpp: Removed unneeded include of unorm.h since the
2962 normalization code is now in StringView.cpp.
2963 (WTF::URLHelpers::escapeUnsafeCharacters): Renamed from
2964 createStringWithEscapedUnsafeCharacters since it now only creates
2965 a new string if one is needed. Use unsigned for string lengths, since
2966 that's what WTF::String uses, not size_t. Added a first loop so that
2967 we can return the string unmodified if no lookalike characters are
2968 found. Removed unnecessary round trip from UTF-16 and then back in
2969 the case where the character is not a lookalike.
2970 (WTF::URLHelpers::toNormalizationFormC): Deleted. Moved this logic
2971 into the WTF::normalizedNFC function in StringView.cpp.
2972 (WTF::URLHelpers::userVisibleURL): Call escapeUnsafeCharacters and
2973 normalizedNFC. The normalizedNFC function is better in multiple ways,
2974 but primarily it handles 8-bit strings and other already-normalized
2975 strings much more efficiently.
2977 * wtf/text/StringView.cpp:
2978 (WTF::normalizedNFC): Added. This has two overloads. One is for when
2979 we already have a String, and want to re-use it if no normalization
2980 is needed, and another is when we only have a StringView, and may need
2981 to allocate a String to hold the result. Includes a fast special case
2982 for 8-bit and already-normalized strings, and uses the same strategy
2983 that JSC::normalize was already using: calls unorm2_normalize twice,
2984 first just to determine the length.
2986 * wtf/text/StringView.h: Added normalizedNFC, which can be called with
2987 either a StringView or a String. Also moved StringViewWithUnderlyingString
2988 here from JSString.h, here for use as the return value of normalizedNFC;
2989 it is used for a similar purpose in the JavaScriptCore rope implementation.
2990 Also removed an inaccurate comment.
2992 2019-03-16 Diego Pino Garcia <dpino@igalia.com>
2994 [GTK] [WPE] Fix compilation errors due to undefined ALWAYS_LOG_IF
2995 https://bugs.webkit.org/show_bug.cgi?id=195850
2997 Unreviewed build fix after r243033.
2999 * wtf/LoggerHelper.h:
3001 2019-03-15 Per Arne Vollan <pvollan@apple.com>
3003 [iOS] Block the accessibility server when accessibility is not enabled.
3004 https://bugs.webkit.org/show_bug.cgi?id=195342
3006 Reviewed by Brent Fulgham.
3008 Add SPI to issue a mach extension to a process by pid. Also, add a macro for
3009 the availability of this SPI.
3012 * wtf/spi/darwin/SandboxSPI.h:
3014 2019-03-15 Eric Carlson <eric.carlson@apple.com>
3016 Add media stream release logging
3017 https://bugs.webkit.org/show_bug.cgi?id=195823
3019 Reviewed by Youenn Fablet.
3021 * wtf/LoggerHelper.h: Add LOG_IF variants that check a condition before logging.
3023 2019-03-15 Truitt Savell <tsavell@apple.com>
3025 Unreviewed, rolling out r243008.
3027 This revision broke High Sierra builders
3031 "[iOS] Block the accessibility server when accessibility is
3033 https://bugs.webkit.org/show_bug.cgi?id=195342
3034 https://trac.webkit.org/changeset/243008
3036 2019-03-15 Per Arne Vollan <pvollan@apple.com>
3038 [iOS] Block the accessibility server when accessibility is not enabled.
3039 https://bugs.webkit.org/show_bug.cgi?id=195342
3041 Reviewed by Brent Fulgham.
3043 Add SPI to issue a mach extension to a process by pid.
3045 * wtf/spi/darwin/SandboxSPI.h:
3047 2019-03-13 Sam Weinig <sam@webkit.org>
3049 Add utility function to allow easy reverse range-based iteration of a container
3050 https://bugs.webkit.org/show_bug.cgi?id=195542
3052 Reviewed by Antti Koivisto.
3054 Add functions to create an IteratorRange<T> that will iterate a container backwards. It
3055 works with any container that is compatible with std::rbegin() and std::rend(). It is
3056 expected to be used in conjunction with range-based for-loops like so:
3058 for (auto& value : WTF::makeReversedRange(myContainer))
3061 * wtf/IteratorRange.h:
3062 (WTF::makeReversedRange):
3064 2019-03-13 Keith Rollin <krollin@apple.com>
3066 Add support for new StagedFrameworks layout
3067 https://bugs.webkit.org/show_bug.cgi?id=195543
3069 Reviewed by Alexey Proskuryakov.
3071 Opportunistic cleanup: remove unused JAVASCRIPTCORE_FRAMEWORKS_DIR
3074 * Configurations/Base.xcconfig:
3076 2019-03-13 Dominik Infuehr <dinfuehr@igalia.com>
3078 String overflow when using StringBuilder in JSC::createError
3079 https://bugs.webkit.org/show_bug.cgi?id=194957
3081 Reviewed by Mark Lam.
3083 When calculating the new capacity of a StringBuilder object,
3084 use a limit of MaxLength instead of MaxLength+1. Allocating
3085 a string of size MaxLength+1 always fails. This means that expanding
3086 a StringBuilder only worked when the newly doubled capacity is less or
3089 * wtf/text/StringBuilder.cpp:
3091 2019-03-13 Chris Dumez <cdumez@apple.com>
3093 Better build fix after r242901.
3095 Reviewed by Jer Noble.
3098 (WTF::LogArgument::toString):
3100 2019-03-13 Jer Noble <jer.noble@apple.com>
3102 Add AggregateLogger, a Logger specialization for singleton classes.
3103 https://bugs.webkit.org/show_bug.cgi?id=195644
3105 Reviewed by Eric Carlson.
3107 Add a new class, AggregateLogger, which will log messages to each of its aggregated loggers.
3109 Drive-by fixes: allow "const void*" to be directly logged by converting the pointer to a hex string.
3111 * WTF.xcodeproj/project.pbxproj:
3112 * wtf/AggregateLogger.h: Added.
3113 (WTF::AggregateLogger::create):
3114 (WTF::AggregateLogger::addLogger):
3115 (WTF::AggregateLogger::removeLogger):
3116 (WTF::AggregateLogger::logAlways const):
3117 (WTF::AggregateLogger::error const):
3118 (WTF::AggregateLogger::warning const):
3119 (WTF::AggregateLogger::info const):
3120 (WTF::AggregateLogger::debug const):
3121 (WTF::AggregateLogger::willLog const):
3122 (WTF::AggregateLogger::AggregateLogger):
3123 (WTF::AggregateLogger::log const):
3129 2019-03-12 Commit Queue <commit-queue@webkit.org>
3131 Unreviewed, rolling out r242747.
3132 https://bugs.webkit.org/show_bug.cgi?id=195641
3134 Performance measurement is difficult in this period, rolling
3135 out it and rolling in later to isolate it from the other
3136 sensitive patches (Requested by yusukesuzuki on #webkit).
3140 "[JSC] Make StaticStringImpl & StaticSymbolImpl actually
3142 https://bugs.webkit.org/show_bug.cgi?id=194212
3143 https://trac.webkit.org/changeset/242747
3145 2019-03-12 Robin Morisset <rmorisset@apple.com>
3147 A lot more classes have padding that can be reduced by reordering their fields
3148 https://bugs.webkit.org/show_bug.cgi?id=195579
3150 Reviewed by Mark Lam.
3152 * wtf/CrossThreadQueue.h:
3154 * wtf/MemoryPressureHandler.h:
3155 * wtf/MetaAllocator.h:
3156 * wtf/Threading.cpp:
3158 2019-03-11 Alex Christensen <achristensen@webkit.org>
3160 WTF::Expected should use std::addressof instead of operator&
3161 https://bugs.webkit.org/show_bug.cgi?id=195604
3163 Reviewed by Myles Maxfield.
3165 The latter was causing problems with types that do tricky things with constructors and operator&,
3166 specifically UniqueRef but I made a reduced test case. When it used operator&, it would get the contained
3167 type and call the constructor that takes a contained type instead of the move constructor.
3170 (std::experimental::fundamentals_v3::__expected_detail::base::base):
3171 (std::experimental::fundamentals_v3::expected::swap):
3173 2019-03-11 Ross Kirsling <ross.kirsling@sony.com>
3175 Add Optional to Forward.h.
3176 https://bugs.webkit.org/show_bug.cgi?id=195586
3178 Reviewed by Darin Adler.
3181 Add forward declaration for Optional.
3186 * wtf/MemoryFootprint.h:
3187 * wtf/URLHelpers.cpp:
3189 * wtf/cocoa/CPUTimeCocoa.cpp:
3190 * wtf/fuchsia/CPUTimeFuchsia.cpp:
3191 * wtf/unix/CPUTimeUnix.cpp:
3192 * wtf/win/CPUTimeWin.cpp:
3193 Remove unnecessary includes from headers.
3195 2019-03-11 Andy Estes <aestes@apple.com>
3197 [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
3198 https://bugs.webkit.org/show_bug.cgi?id=195530
3199 <rdar://problem/48747164>
3201 Reviewed by Alex Christensen.
3203 * wtf/FeatureDefines.h: Defined ENABLE_APPLE_PAY_REMOTE_UI.
3205 2019-03-11 Yusuke Suzuki <ysuzuki@apple.com>
3207 [JSC] Make StaticStringImpl & StaticSymbolImpl actually static
3208 https://bugs.webkit.org/show_bug.cgi?id=194212
3210 Reviewed by Mark Lam.
3212 Avoid mutation onto refcounts if `isStatic()` returns true so that the content of StaticStringImpl never gets modified.
3214 * wtf/text/StringImpl.h:
3215 (WTF::StringImpl::ref):
3216 (WTF::StringImpl::deref):
3218 2019-03-11 Sihui Liu <sihui_liu@apple.com>
3220 Crash under WebCore::IDBDatabase::connectionToServerLost
3221 https://bugs.webkit.org/show_bug.cgi?id=195563
3222 <rdar://problem/37193655>
3224 CrossThreadTask should protect callee if it is ThreadSafeRefCounted.
3226 Reviewed by Geoffrey Garen.
3228 * wtf/CrossThreadTask.h:
3229 (WTF::createCrossThreadTask):
3231 2019-03-11 Ryan Haddad <ryanhaddad@apple.com>
3233 Unreviewed, rolling out r242688, r242643, r242624.
3235 Caused multiple layout test failures and crashes on iOS and macOS.
3239 "requestAnimationFrame should execute before the next frame"
3240 https://bugs.webkit.org/show_bug.cgi?id=177484
3241 https://trac.webkit.org/changeset/242624/webkit
3243 * wtf/SystemTracing.h:
3245 2019-03-11 Darin Adler <darin@apple.com>
3247 Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
3248 https://bugs.webkit.org/show_bug.cgi?id=195533
3250 Reviewed by Brent Fulgham.
3252 Soon, we will change String::number and StringBuilder::appendNumber for floating
3253 point to use "shortest form" serialization instead of the current default, which is
3254 "6-digit fixed precision stripping trailing zeros". To prepare to do this safely
3255 without accidentally changing any behavior, changing callers to call the explicit
3256 versions. Later, we may want to return and change many of them to use shortest form
3257 instead, but that may require rebaselining tests, and in some extreme cases, getting
3258 rid of flawed logic that converts between different single and double precision
3259 floating point; such problems may be hidden by fixed precision serialization.
3261 Since "shortest form" is already the behavior for AtomicString::number and
3262 for makeString, no changes required for clients of either of those.
3265 (WTF::LogArgument::toString): Use numberToStringFixedPrecision.
3266 * wtf/MediaTime.cpp:
3267 (WTF::MediaTime::toString const): Use appendFixedPrecisionNumber.
3268 * wtf/text/ValueToString.h:
3269 (WTF::ValueToString<float>::string): Use numberToStringFixedPrecision.
3270 (WTF::ValueToString<double>::string): Ditto.
3272 2019-03-11 Truitt Savell <tsavell@apple.com>
3274 Unreviewed, rolling out r242702.
3276 Broke High Sierra builders.
3280 "Add utility function to allow easy reverse range-based
3281 iteration of a container"
3282 https://bugs.webkit.org/show_bug.cgi?id=195542
3283 https://trac.webkit.org/changeset/242702
3285 2019-03-11 Sam Weinig <sam@webkit.org>
3287 Add utility function to allow easy reverse range-based iteration of a container
3288 https://bugs.webkit.org/show_bug.cgi?id=195542
3290 Reviewed by Antti Koivisto.
3292 Add functions to create an IteratorRange<T> that will iterate a container backwards. It
3293 works with any container that is compatible with std::rbegin() and std::rend(). It is
3294 expected to be used in conjunction with range-based for-loops like so:
3296 for (auto& value : WTF::makeReversedRange(myContainer))
3299 * wtf/IteratorRange.h:
3300 (WTF::makeReversedRange):
3302 2019-03-10 Yusuke Suzuki <utatane.tea@gmail.com> and Fujii Hironori <Hironori.Fujii@sony.com>
3304 [WTF] Align assumption in RunLoopWin to the other platform's RunLoop
3305 https://bugs.webkit.org/show_bug.cgi?id=181151
3307 Reviewed by Don Olmstead.
3309 This patch fixes RunLoop in Windows to align it to the implementations in the other platforms
3310 to use RunLoop more aggressively.
3313 (WTF::RunLoop::Timer::Timer):
3314 * wtf/win/MainThreadWin.cpp:
3315 (initializeMainThreadPlatform): Call RunLoop::registerRunLoopMessageWindowClass.
3316 * wtf/win/RunLoopWin.cpp:
3317 (WTF::RunLoop::wndProc):
3318 (WTF::RunLoop::iterate):
3319 (WTF::RunLoop::stop):
3320 PostQuitMessage is only available in the RunLoop's thread. We should post a message and call
3321 it inside this task.
3323 (WTF::RunLoop::registerRunLoopMessageWindowClass):
3324 Changed the return type from bool to void, and added RELEASE_ASSERT to check the return value of RegisterClass.
3326 (WTF::RunLoop::~RunLoop):
3327 When the RunLoop's thread is freed, its associated window is freed. We do not need to do here.
3329 (WTF::RunLoop::TimerBase::timerFired):
3330 (WTF::RunLoop::TimerBase::TimerBase):
3331 (WTF::RunLoop::TimerBase::start):
3332 (WTF::RunLoop::TimerBase::stop):
3333 (WTF::RunLoop::TimerBase::isActive const):
3334 (WTF::RunLoop::TimerBase::secondsUntilFire const):
3335 (WTF::generateTimerID): Deleted.
3336 We can use TimerBase's pointer as ID since it is uintptr_t.
3338 2019-03-07 Said Abou-Hallawa <sabouhallawa@apple.com>
3340 requestAnimationFrame should execute before the next frame
3341 https://bugs.webkit.org/show_bug.cgi?id=177484
3343 Reviewed by Simon Fraser.
3345 Add trace points for the page RenderingUpdate.
3347 * wtf/SystemTracing.h:
3349 2019-03-06 Ross Kirsling <ross.kirsling@sony.com>
3351 [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
3352 https://bugs.webkit.org/show_bug.cgi?id=195346
3354 Reviewed by Fujii Hironori.
3356 * wtf/PlatformWin.cmake:
3357 * wtf/text/AtomicString.h:
3358 (WTF::AtomicString::AtomicString):
3359 * wtf/text/WTFString.h:
3360 (WTF::String::String):
3361 * wtf/text/win/StringWin.cpp: Added.
3362 (WTF::String::wideCharacters const): Renamed from WTF::stringToNullTerminatedWChar.
3363 * wtf/text/win/WCharStringExtras.h:
3366 (WTF::stringToNullTerminatedWChar): Deleted.
3367 (WTF::wcharToString): Deleted.
3368 (WTF::nullTerminatedWCharToString): Deleted.
3369 Add static_assert-guarded reinterpret_cast wrappers for going between UChar* and wchar_t*.
3370 Move existing to/from-String helpers into the String (and AtomicString) class(es).
3372 * wtf/win/FileSystemWin.cpp:
3373 (WTF::FileSystemImpl::getFindData):
3374 (WTF::FileSystemImpl::getFinalPathName):
3375 (WTF::FileSystemImpl::createSymbolicLink):
3376 (WTF::FileSystemImpl::deleteFile):
3377 (WTF::FileSystemImpl::deleteEmptyDirectory):
3378 (WTF::FileSystemImpl::moveFile):
3379 (WTF::FileSystemImpl::pathByAppendingComponent):
3380 (WTF::FileSystemImpl::fileSystemRepresentation):
3381 (WTF::FileSystemImpl::makeAllDirectories):
3382 (WTF::FileSystemImpl::pathGetFileName):
3383 (WTF::FileSystemImpl::storageDirectory):
3384 (WTF::FileSystemImpl::generateTemporaryPath):
3385 (WTF::FileSystemImpl::openTemporaryFile):
3386 (WTF::FileSystemImpl::openFile):
3387 (WTF::FileSystemImpl::hardLinkOrCopyFile):
3388 (WTF::FileSystemImpl::deleteNonEmptyDirectory):
3389 * wtf/win/LanguageWin.cpp:
3391 * wtf/win/PathWalker.cpp:
3392 (WTF::PathWalker::PathWalker):
3393 Use wchar helpers as needed.
3395 2019-02-28 Ryosuke Niwa <rniwa@webkit.org>
3398 https://bugs.webkit.org/show_bug.cgi?id=195152
3400 Reviewed by Antti Koivisto.
3402 Added WeakHashSet which is a HashSet of WeakPtr. When the object pointed by WeakPtr is deleted,
3403 WeakHashSet treats the key to be no longer in the set. That is, WeakHashSet::contains returns false
3404 and const_iterator skips such a WeakPtr in the set.
3406 We decided not to make HashSet<WeahPtr<T>> work because it involves weird semantics such as making
3407 find(X) delete the table entry as remove(find(X)) would be a no-op otherwise as find(X) would return
3408 necessarily need to return HashSet<WeakPtr<T>>::end().
3410 Furthermore, we cannot determine the true size of this set in O(1) because the objected pointed by
3411 some of WeakPtr in the set may have already been deleted. This has implications that we can't have
3412 size(), isEmpty(), random(), etc... as O(1) operation.
3414 WeakHashSet is implemented as HashSet<WeakReference<T>>. HashTable::rehash has been updated to delete
3415 WeakReference<T>'s whose m_ptr has become null, and HashTable::expand first deletes any such entry
3416 before deciding an actual expansion is needed. This is accomplished via newly added hash trait,
3417 hasIsReleasedWeakValueFunction, and HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue which
3418 returns true for when WeakReference<T> pointed by Ref<WeakReference<T>> has null m_ptr, not to be
3419 confused with Ref<WeakReference<T>> itself pointing to a null WeakReference<T>.
3421 * WTF.xcodeproj/project.pbxproj:
3422 * wtf/CMakeLists.txt:
3425 (WTF::HashSet<T, U, V>::checkConsistency const): Added.
3427 (WTF::HashTable::isReleasedWeakBucket): Added.
3428 (WTF::HashTable::expand): Delete WeakReference<T> with null m_ptr first. This updates m_keyCount
3429 and may make mustRehashInPlace() return true.
3430 (WTF::HashTable::deleteReleasedWeakBuckets): Added.
3431 (WTF::HashTable::rehash): Delete WeakReference<T> with null m_ptr. Also refactored the code a bit
3432 to avoid keep repeating oldTable[i].
3434 (WTF::HashTraits<T>::isHashTraitsReleasedWeakValue): Added.
3435 (WTF::RefHashTraits<T>): Extracted from HashTraits<Ref<P>> to share code with
3436 HashTraits<Ref<WeakReference<T>>>.
3437 (WTF::HashTraitsReleasedWeakValueChecker<Traits, hasIsReleasedWeakValueFunction>): Added.
3438 (WTF::isHashTraitsReleasedWeakValue<Traits, hasIsReleasedWeakValueFunction>): Added.
3439 * wtf/WeakHashSet.h: Added.
3440 (WTF::WeakHashSet): Added.
3441 (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator):
3442 (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
3443 (WTF::WeakHashSet::WeakHashSetConstIterator::operator* const):
3444 (WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const):
3445 (WTF::WeakHashSet::WeakHashSetConstIterator::operator++):
3446 (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
3447 (WTF::WeakHashSet::WeakHashSetConstIterator::operator== const):
3448 (WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const):
3449 (WTF::WeakHashSet::WeakHashSet):
3450 (WTF::WeakHashSet::begin const):
3451 (WTF::WeakHashSet::end const):
3452 (WTF::WeakHashSet::add):
3453 (WTF::WeakHashSet::remove):
3454 (WTF::WeakHashSet::contains const):
3455 (WTF::WeakHashSet::capacity const):
3456 (WTF::WeakHashSet::computeSize const): Deletes any WeakReference<T> with null m_ptr first.
3457 (WTF::WeakHashSet::checkConsistency const):
3458 (WTF::HashTraits<Ref<WeakReference<T>>>): Added. This hash traits triggers the new code in HashTable's
3459 expand and rehash methods to delete WeakReference<T> with null m_ptr.
3460 (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue):
3462 (WTF::WeakReference::~WeakReference): Added so that we can keep track the number of live WeakReference
3463 in API tests by template specializations.
3465 2019-03-03 Darin Adler <darin@apple.com>
3467 Prepare to improve handling of conversion of float to strings
3468 https://bugs.webkit.org/show_bug.cgi?id=195262
3470 Reviewed by Daniel Bates.
3473 (WTF::truncateTrailingZeros): Renamed from
3474 formatStringTruncatingTrailingZerosIfNeeded and removed the calls
3475 to double_conversion::StringBuilder::Finalizer, since the caller
3477 (WTF::numberToFixedPrecisionString): Added an overload for float
3478 and updated to use the new truncateTrailingZeros.
3479 (WTF::numberToFixedWidthString): Added an overload for float.
3481 * wtf/text/AtomicString.cpp:
3482 (WTF::AtomicString::number): Added float overload. This is a
3483 behavior change, but in all cases for the better. The old behavior
3484 was to convert to double first and then do "shortest form"
3485 conversion, and it's always better to just do that as float.
3486 * wtf/text/AtomicString.h: Added float overload of AtomicString::number.
3488 * wtf/text/StringBuilder.cpp:
3489 (WTF::StringBuilder::appendFixedPrecisionNumber): Added float
3491 (WTF::StringBuilder::appendShortestFormNumber): Renamed from
3492 appendECMAScriptNumber and did the above.
3493 (WTF::StringBuilder::appendFixedWidthNumber): Ditto.
3494 * wtf/text/StringBuilder.h: Added overloads for float and
3495 appendShortestFormNumber. The appendNumber and appendECMAScriptNumber
3496 functions are now inlines in the header, since they are expressed
3497 entirely in terms of the other functions.
3499 * wtf/text/WTFString.cpp:
3500 (WTF::String::numberToStringFixedPrecision): Added float overload.
3501 Removed unnecessary explicit conversion to String.
3502 (WTF::String::numberToStringShortest): Renamed from
3503 numberToStringECMAScript and did the above.
3504 (WTF::String::numberToStringFixedWidth): Ditto.
3506 * wtf/text/WTFString.h: Added overloads for float and
3507 numberToStringShortest. The number and numberToStringECMAScript
3508 functions are now inlines in the header, since they are expressed
3509 entirely in terms of the other functions.
3511 2019-03-04 Andy Estes <aestes@apple.com>
3513 [Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
3514 https://bugs.webkit.org/show_bug.cgi?id=195080
3515 <rdar://problem/48421558>
3517 Reviewed by Antti Koivisto.
3519 * wtf/FeatureDefines.h:
3521 2019-03-04 Michael Catanzaro <mcatanzaro@igalia.com>
3523 URLHelpers should use unorm2_quickCheck before converting to NFC
3524 https://bugs.webkit.org/show_bug.cgi?id=194272
3526 Reviewed by Darin Adler.
3528 If the string is already in normalization form C, don't try to normalize it.
3530 * wtf/URLHelpers.cpp:
3531 (WTF::URLHelpers::toNormalizationFormC):
3533 2019-03-02 Darin Adler <darin@apple.com>
3535 Retire legacy dtoa function and DecimalNumber class
3536 https://bugs.webkit.org/show_bug.cgi?id=195253
3538 Reviewed by Daniel Bates.
3540 * WTF.xcodeproj/project.pbxproj: Removed DecimalNumber.cpp/h.
3541 * wtf/CMakeLists.txt: Ditto.
3543 * wtf/DecimalNumber.cpp: Removed.
3544 * wtf/DecimalNumber.h: Removed.
3546 * wtf/JSONValues.cpp:
3547 (WTF::JSONImpl::Value::writeJSON const): Use
3548 StringBuilder::appendECMAScriptNumber instead of custom logic
3549 using the DecimalNumber class.
3552 (WTF::storeInc): Deleted.
3553 (WTF::BigInt): Deleted.
3554 (WTF::multadd): Deleted.
3555 (WTF::hi0bits): Deleted.
3556 (WTF::lo0bits): Deleted.
3557 (WTF::i2b): Deleted.
3558 (WTF::mult): Deleted.
3559 (WTF::P5Node::P5Node): Deleted.
3560 (WTF::pow5mult): Deleted.
3561 (WTF::lshift): Deleted.
3562 (WTF::cmp): Deleted.
3563 (WTF::diff): Deleted.
3564 (WTF::d2b): Deleted.
3565 (WTF::quorem): Deleted.
3566 (WTF::dtoa): Deleted.
3568 * wtf/dtoa.h: Removed DtoaBuffer, dtoa, and NumberToStringBufferLength.
3570 2019-02-27 Darin Adler <darin@apple.com>
3572 Fixed makeString(float) to do shortest-form serialization without first converting to double
3573 https://bugs.webkit.org/show_bug.cgi?id=195142
3575 Reviewed by Daniel Bates.
3577 * wtf/DecimalNumber.cpp: Removed unneeded includes.
3579 * wtf/DecimalNumber.h: Removed unused constructors; over time we will be
3580 deprecating DecimalNumber, so we should removed the unused parts. Also
3581 marked the constructor explicit, removed types used only for arguments for
3582 the constructors, and removed the sign, exponent, significand, and precision
3585 * wtf/JSONValues.cpp:
3586 (WTF::JSONImpl::Value::writeJSON const): Updated for changes to DecimalNumber
3587 switched from NumberToLStringBuffer to NumberToStringBuffer, and for use of
3588 std::array instead of C arrays.
3590 * wtf/dtoa.cpp: Removed unused dtoaRoundSF and dtoaRoundDP functions.
3591 (WTF::dtoa): Updated to use std::array instead of C arrays.
3592 (WTF::dtoaRoundSF): Removed.
3593 (WTF::dtoaRoundDP): Removed.
3594 (WTF::numberToString): Added an overload for float and updated to use std::array.
3595 (WTF::formatStringTruncatingTrailingZerosIfNeeded): Updated to use std::array.
3596 (WTF::numberToFixedPrecisionString): Ditto.
3597 (WTF::numberToFixedWidthString): Ditto.
3599 * wtf/dtoa.h: Changed arrays to be std::array instead of C arrays so the
3600 array types will be checked. Removed dtoaRoundSF and dtoaRoundDP.
3601 Added float overloads for numberToString, numberToFixedPrecisionString,
3602 and numberToFixedWidthString. The only one of these that is called at this
3603 time is numberToString, called by the floating point StringTypeAdapter in
3604 StringConcatenateNummbers.h.
3606 * wtf/text/StringConcatenateNumbers.h: Updated for std::array.
3608 2019-03-01 Darin Adler <darin@apple.com>
3610 Finish removing String::format
3611 https://bugs.webkit.org/show_bug.cgi?id=194893
3613 Reviewed by Daniel Bates.
3615 * wtf/Assertions.cpp:
3616 (WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
3617 (WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.
3619 * wtf/HexNumber.h: Deleted unneeded toString function.
3621 * wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
3622 StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
3623 a bit. Use function templates for writeTo functions rather than having two of each.
3624 Removed unused toString functions. Optimized case where we use have a UChar* and
3625 a length of zero to not force the result to be 16-bit. Also gets rid of a small
3626 NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
3627 static member helper functions to compute string lengths. Added the pad function
3628 and the PaddingSpecification struct template, so we can add padding to anything
3629 we can turn into a string. Got rid&nbs