1 2019-07-02 Keith Miller <keith_miller@apple.com>
3 PACCage should first cage leaving PAC bits intact then authenticate
4 https://bugs.webkit.org/show_bug.cgi?id=199372
6 Reviewed by Saam Barati.
9 (WTF::CagedPtr::get const):
10 (WTF::CagedPtr::getMayBeNull const):
11 (WTF::CagedPtr::mergePointers):
13 2019-07-01 Philippe Normand <pnormand@igalia.com>
15 [GStreamer] Cannot play Bert's Bytes radio stream from http://radio.dos.nl/
16 https://bugs.webkit.org/show_bug.cgi?id=198376
18 Reviewed by Xabier Rodriguez-Calvar.
20 * wtf/glib/GLibUtilities.h:
21 (enumToString): Utility function to get a string representation of of a GLib enum.
23 2019-06-22 Darin Adler <darin@apple.com>
25 Streamline some string code, focusing on functions that were using substringSharingImpl
26 https://bugs.webkit.org/show_bug.cgi?id=198898
28 Reviewed by Daniel Bates.
31 (WTF::URLHelpers::applyHostNameFunctionToURLString): Change code using
32 substringSharingImpl so it could call String::find to call StringView::contains
33 instead. Also rewrote lambdas to be simpler and likely more efficient.
34 Rewrote another case using substringSharingImpl so it could call String::find
35 to call StringView::find instead.
37 * wtf/text/StringView.cpp:
38 (WTF::StringView::startsWith const): Added.
40 * wtf/text/StringView.h: Tweaked style a bit, and added an overload of
41 StringView::contains that takes a CodeUnitMatchFunction and an overload
42 of startsWith that cakes a UChar.
44 2019-06-28 Konstantin Tokarev <annulen@yandex.ru>
46 Remove traces of ENABLE_ICONDATABASE remaining after its removal in 219733
47 https://bugs.webkit.org/show_bug.cgi?id=199317
49 Reviewed by Michael Catanzaro.
51 While IconDatabase and all code using it was removed,
52 ENABLE_ICONDATABASE still exists as build option and C++ macro.
54 * wtf/FeatureDefines.h:
56 2019-06-27 Konstantin Tokarev <annulen@yandex.ru>
58 Avoid using WTF::Function for passing local function pointers and closures in URLHelpers.cpp
59 https://bugs.webkit.org/show_bug.cgi?id=199271
61 Reviewed by Yusuke Suzuki.
63 WTF::Function allocates memory on heap, which is totally redundant in this
67 (WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
69 2019-06-27 Timothy Hatcher <timothy@apple.com>
71 Move WebKitLegacy off of a couple AppKit ivars.
72 https://bugs.webkit.org/show_bug.cgi?id=199279
73 rdar://problem/34983438
75 Reviewed by Tim Horton.
77 * wtf/Platform.h: Added HAVE_SUBVIEWS_IVAR_SPI.
79 2019-06-27 Beth Dakin <bdakin@apple.com>
81 Upstream use of MACCATALYST
82 https://bugs.webkit.org/show_bug.cgi?id=199245
83 rdar://problem/51687723
85 Reviewed by Tim Horton.
87 * Configurations/SDKVariant.xcconfig:
88 * wtf/FeatureDefines.h:
91 2019-06-27 Don Olmstead <don.olmstead@sony.com>
93 [FTW] Build JavaScriptCore
94 https://bugs.webkit.org/show_bug.cgi?id=199254
96 Reviewed by Brent Fulgham.
98 * wtf/PlatformFTW.cmake: Added.
100 2019-06-27 Fujii Hironori <Hironori.Fujii@sony.com>
102 [CMake] Bump cmake_minimum_required version to 3.10
103 https://bugs.webkit.org/show_bug.cgi?id=199181
105 Reviewed by Don Olmstead.
109 2019-06-26 Konstantin Tokarev <annulen@yandex.ru>
111 Remove unneeded #include <wtf/glib/GRefPtr.h>
112 https://bugs.webkit.org/show_bug.cgi?id=199228
114 Reviewed by Michael Catanzaro.
116 * wtf/MemoryPressureHandler.h:
118 2019-06-26 Myles C. Maxfield <mmaxfield@apple.com>
120 REGRESSION: ( r246394 ) webgpu/whlsl-buffer-fragment.html and webgpu/whlsl-buffer-vertex.html are failing
121 https://bugs.webkit.org/show_bug.cgi?id=199012
123 Reviewed by Saam Barati.
127 2019-06-25 Keith Miller <keith_miller@apple.com>
129 CagedPtr doesn't merge PAC bits back into the resulting caged pointer.
130 https://bugs.webkit.org/show_bug.cgi?id=199214
132 Reviewed by Yusuke Suzuki.
134 The current code means that caging will just strip the any failed
135 authentication bits. Adding this code doesn't appear to be a
136 regression on iPhone Xs.
139 (WTF::CagedPtr::get const):
140 (WTF::CagedPtr::getMayBeNull const):
141 (WTF::CagedPtr::getUnsafe const):
142 (WTF::CagedPtr::mergePointers):
144 2019-06-25 Sam Weinig <weinig@apple.com>
146 Experiment with simple structured bindings use
147 https://bugs.webkit.org/show_bug.cgi?id=198905
149 Reviewed by Darin Adler.
151 * wtf/URLHelpers.cpp:
152 (WTF::URLHelpers::mapHostNames):
153 Simplify code using c++ structured bindings (https://en.cppreference.com/w/cpp/language/structured_binding)
154 to see if all the platforms will work with it.
156 2019-06-25 Adam Barth <abarth@webkit.org>
158 [fuchsia] Update to newer zx_clock_get syscall
159 https://bugs.webkit.org/show_bug.cgi?id=199191
161 Reviewed by Sam Weinig.
163 Fuchsia has changed the zx_clock_get syscall to return the clock value
164 via an out parameter rather than via its return value. This change
165 makes zx_clock_get consistent with all the other syscalls.
167 This patch updates our use of zx_clock_get to use the new syscall. The
168 old syscall is no longer supported by Fuchsia.
170 * wtf/fuchsia/CPUTimeFuchsia.cpp:
171 (WTF::CPUTime::get): Switch to using the out parameter.
172 (WTF::CPUTime::forCurrentThread): Switch to using the out parameter.
174 2019-06-25 Michael Catanzaro <mcatanzaro@igalia.com>
176 Fully rename WebKitGTK+ -> WebKitGTK everywhere
177 https://bugs.webkit.org/show_bug.cgi?id=199159
179 Reviewed by Carlos Garcia Campos.
182 (WTF::URLParser::internationalDomainNameTranscoder):
184 2019-06-25 Michael Catanzaro <mcatanzaro@igalia.com>
187 https://bugs.webkit.org/show_bug.cgi?id=198914
189 Reviewed by Darin Adler.
191 Remove now-stale GCC version check.
195 2019-06-23 Simon Fraser <simon.fraser@apple.com>
197 Add OverflowScrollProxyNodes to the scrolling tree
198 https://bugs.webkit.org/show_bug.cgi?id=199132
200 Reviewed by Antti Koivisto.
202 Setting indent is useful if you want to make a new stream with the indent of an
205 * wtf/text/TextStream.h:
206 (WTF::TextStream::setIndent):
208 2019-06-20 Fujii Hironori <Hironori.Fujii@sony.com>
210 Try to use C++14 std::enable_if_t in CheckedArithmetic.h again
211 https://bugs.webkit.org/show_bug.cgi?id=199099
213 Reviewed by Ross Kirsling.
215 r242235 changed CheckedArithmetic to not use C++14. Let's try
218 * wtf/CheckedArithmetic.h: Use C++14 std::make_unsigned_t and std::enable_if_t.
220 2019-06-18 Darin Adler <darin@apple.com>
222 Tidy up the remaining bits of the AtomicString to AtomString rename
223 https://bugs.webkit.org/show_bug.cgi?id=198990
225 Reviewed by Michael Catanzaro.
227 * wtf/text/AtomString.cpp: Fix a comment.
228 * wtf/text/AtomString.h: Tweak formatting a bit. Use nullptr instead of 0.
229 Removed "using AtomicString = AtomString".
230 * wtf/text/AtomStringImpl.cpp:
231 (WTF::CStringTranslator::translate): Use setIsAtom instead of setIsAtomic.
232 (WTF::UCharBufferTranslator::translate): Ditto.
233 (WTF::HashAndUTF8CharactersTranslator::translate): Ditto.
234 (WTF::SubstringTranslator::translate): Ditto.
235 (WTF::LCharBufferTranslator::translate): Ditto.
236 (WTF::BufferFromStaticDataTranslator::translate): Ditto.
237 (WTF::AtomStringImpl::addSlowCase): Ditto.
238 (WTF::AtomStringImpl::lookUpSlowCase): Updated assertion message.
240 * wtf/text/AtomStringImpl.h: Tweaked the implementation of add.
241 Updated comments to say AtomString.
243 * wtf/text/AtomStringTable.cpp:
244 (WTF::AtomStringTable::~AtomStringTable): Use setIsAtom.
246 * wtf/text/StringImpl.h: Updated name of StringAtomic and
247 s_hashFlagStringKindIsAtom. Renamed to flagIsAtom and setIsAtom.
249 * wtf/text/WTFString.cpp:
250 (WTF::String::isSafeToSendToAnotherThread const): Updated comment.
252 2019-06-20 Carlos Garcia Campos <cgarcia@igalia.com>
254 [GTK] Remove support for GTK2 plugins
255 https://bugs.webkit.org/show_bug.cgi?id=199065
257 Reviewed by Sergio Villar Senin.
260 * wtf/glib/GTypedefs.h:
262 2019-06-19 Yusuke Suzuki <ysuzuki@apple.com>
264 [bmalloc] IsoHeap's initialization is racy with IsoHeap::isInitialized
265 https://bugs.webkit.org/show_bug.cgi?id=199053
267 Reviewed by Saam Barati.
269 Add constexpr static functions to generate pseudo random numbers from __LINE__.
272 (WTF::WeakRandom::nextState):
273 (WTF::WeakRandom::generate):
274 (WTF::WeakRandom::advance):
276 2019-06-19 Fujii Hironori <Hironori.Fujii@sony.com>
278 Add WTF::crossThreadCopy(T&&) to utilize String::isolatedCopy() &&
279 https://bugs.webkit.org/show_bug.cgi?id=198957
281 Reviewed by Alex Christensen.
283 &&-qualified String::isolatedCopy() has a optimization path which
284 does just WTFMove if it isSafeToSendToAnotherThread which means
285 the object hasOneRef.
287 However, WTF::crossThreadCopy was using only &-qualified
288 isolatedCopy. To use the optimization, added
289 WTF::crossThreadCopy(T&&) overloading.
291 * wtf/CrossThreadCopier.h:
292 (WTF::crossThreadCopy): Added a overload of (T&&).
293 * wtf/CrossThreadTask.h:
294 (WTF::createCrossThreadTask): Removed explicit template arguments of crossThreadCopy.
296 2019-06-19 Devin Rousso <drousso@apple.com>
298 Web Inspector: Network: replace CFNetwork SPI with new API where able
299 https://bugs.webkit.org/show_bug.cgi?id=198762
301 Reviewed by Timothy Hatcher.
305 2019-06-19 Alex Christensen <achristensen@webkit.org>
307 Add a unit test for client certificate authentication
308 https://bugs.webkit.org/show_bug.cgi?id=197800
310 Reviewed by Youenn Fablet.
312 * wtf/spi/cocoa/SecuritySPI.h:
313 Move declarations from ArgumentCodersCF.cpp so they can be shared.
315 2019-06-19 Adrian Perez de Castro <aperez@igalia.com>
317 [WPE][GTK] Fix build with unified sources disabled
318 https://bugs.webkit.org/show_bug.cgi?id=198752
320 Reviewed by Michael Catanzaro.
322 * wtf/text/StringBuilder.h: Add missing include of StringConcatenateNumbers.h
324 2019-06-19 Zan Dobersek <zdobersek@igalia.com>
326 USE_ANGLE macro can be evaluated without being defined
327 https://bugs.webkit.org/show_bug.cgi?id=198991
329 Reviewed by Carlos Garcia Campos.
331 * wtf/Platform.h: On platforms not yet defining USE_ANGLE, the
332 incompatibility check with some other flags leads to the macro being
333 evaluated even when it was not defined, producing compiler warnings.
334 To avoid this, the macro should be defined to 0 before the check in
335 case it was not defined already.
337 2019-06-18 Dean Jackson <dino@apple.com>
339 UIContextMenuInteraction implementation for WKContentView
340 https://bugs.webkit.org/show_bug.cgi?id=198986
341 <rdar://problem/51875189>
343 Reviewed by Andy Estes.
345 Add USE_UICONTEXTMENU for iOS 13+.
349 2019-06-18 Kenneth Russell <kbr@chromium.org>
351 Add preliminary ANGLE backend to WebCore
352 https://bugs.webkit.org/show_bug.cgi?id=197755
354 Reviewed by Dean Jackson.
356 Add a USE_ANGLE definition to wtf/Platform.h (currently disabled)
357 which, when enabled, uses ANGLE instead of the OpenGL or OpenGL ES
362 2019-06-17 Jiewen Tan <jiewen_tan@apple.com>
364 Move SOAuthorization from WebKitAdditions to WebKit
365 https://bugs.webkit.org/show_bug.cgi?id=198874
366 <rdar://problem/47573431>
368 Reviewed by Brent Fulgham.
371 Adds a feature flag to detect AppSSO framework.
373 2019-06-17 Ryan Haddad <ryanhaddad@apple.com>
375 Unreviewed, rolling out r246501.
377 Breaks Apple internal builds.
381 "Support using ANGLE as the backend for the WebGL
383 https://bugs.webkit.org/show_bug.cgi?id=197755
384 https://trac.webkit.org/changeset/246501
386 2019-06-17 Kenneth Russell <kbr@chromium.org>
388 Support using ANGLE as the backend for the WebGL implementation
389 https://bugs.webkit.org/show_bug.cgi?id=197755
391 Reviewed by Dean Jackson.
393 Add a USE_ANGLE definition to wtf/Platform.h (currently disabled)
394 which, when enabled, uses ANGLE instead of the OpenGL or OpenGL ES
399 2019-06-16 Darin Adler <darin@apple.com>
401 Rename AtomicString to AtomString
402 https://bugs.webkit.org/show_bug.cgi?id=195276
404 Reviewed by Michael Catanzaro.
406 * many files: Let do-webcore-rename do the renaming.
408 * wtf/text/AtomString.h: After renaming, added AtomicString as a synonym for
409 now; helps smooth things over with a tiny bit of Apple internal software so
410 we don't have to do this all at once. Can remove it soon.
412 2019-06-16 Eric Carlson <eric.carlson@apple.com>
414 [MediaStream] Avoid roundoff error when setting AVCapture min/max frame rate
415 https://bugs.webkit.org/show_bug.cgi?id=198875
416 <rdar://problem/51768374>
418 Reviewed by Youenn Fablet.
421 (WTF::LogArgument<MediaTime>::toString):
422 (WTF::LogArgument<MediaTimeRange>::toString):
424 2019-06-12 Antoine Quint <graouts@apple.com>
426 Show the web page URL when sharing an AR model
427 https://bugs.webkit.org/show_bug.cgi?id=198812
428 <rdar://problem/48689498>
430 Reviewed by Dean Jackson.
434 2019-06-12 Youenn Fablet <youenn@apple.com>
436 Use NSURLSession for WebSocket
437 https://bugs.webkit.org/show_bug.cgi?id=198568
439 Reviewed by Geoffrey Garen.
442 Introduce compile flag for WebSocket NSURLSession
444 2019-06-12 Commit Queue <commit-queue@webkit.org>
446 Unreviewed, rolling out r246322.
447 https://bugs.webkit.org/show_bug.cgi?id=198796
449 "It's a huge page load regression on iOS" (Requested by
450 saamyjoon on #webkit).
455 https://bugs.webkit.org/show_bug.cgi?id=198726
456 https://trac.webkit.org/changeset/246322
458 2019-06-10 Simon Fraser <simon.fraser@apple.com>
460 Add logging for UI-side compositing hit-testing
461 https://bugs.webkit.org/show_bug.cgi?id=198739
463 Reviewed by Antti Koivisto.
465 Make it possible to output an Objective-C object to TextStream, which will
466 log its -description.
468 Also add a template for OptionSet<> printing.
470 * WTF.xcodeproj/project.pbxproj:
471 * wtf/text/TextStream.h:
473 * wtf/text/cocoa/TextStreamCocoa.mm: Added.
474 (WTF::TextStream::operator<<):
476 2019-06-11 Saam Barati <sbarati@apple.com>
479 https://bugs.webkit.org/show_bug.cgi?id=198726
481 Reviewed by Keith Miller.
483 * WTF.xcodeproj/project.pbxproj:
484 * wtf/CMakeLists.txt:
486 (WTF::CagedPtr::CagedPtr):
487 (WTF::CagedPtr::get const):
488 (WTF::CagedPtr::getMayBeNull const):
489 (WTF::CagedPtr::operator=):
490 (WTF::CagedPtr::operator== const):
491 (WTF::CagedPtr::operator!= const):
492 (WTF::CagedPtr::operator bool const):
493 (WTF::CagedPtr::operator* const):
494 (WTF::CagedPtr::operator-> const):
495 (WTF::CagedPtr::operator[] const):
496 (WTF::CagedPtr::getUnsafe const): Deleted.
497 (WTF::CagedPtr::at const): Deleted.
498 (WTF::CagedPtr::recage): Deleted.
499 * wtf/CagedUniquePtr.h:
500 (WTF::CagedUniquePtr::CagedUniquePtr):
501 (WTF::CagedUniquePtr::create):
502 (WTF::CagedUniquePtr::operator=):
503 (WTF::CagedUniquePtr::~CagedUniquePtr):
504 (WTF::CagedUniquePtr::destroy):
507 (Gigacage::cagedMayBeNull): Deleted.
509 (WTF::tagArrayPtr): Deleted.
510 (WTF::untagArrayPtr): Deleted.
511 (WTF::removeArrayPtrTag): Deleted.
512 (WTF::retagArrayPtr): Deleted.
513 * wtf/TaggedArrayStoragePtr.h:
514 (WTF::TaggedArrayStoragePtr::TaggedArrayStoragePtr): Deleted.
515 (WTF::TaggedArrayStoragePtr::get const): Deleted.
516 (WTF::TaggedArrayStoragePtr::getUnsafe const): Deleted.
517 (WTF::TaggedArrayStoragePtr::resize): Deleted.
518 (WTF::TaggedArrayStoragePtr::operator bool const): Deleted.
520 2019-06-10 Andy Estes <aestes@apple.com>
522 [iOS] Use PDFKit SPI for taking snapshots when the hosting app is not entitled for global capture
523 https://bugs.webkit.org/show_bug.cgi?id=198731
524 <rdar://problem/46215174>
526 Reviewed by Tim Horton.
528 * wtf/FeatureDefines.h:
530 2019-06-10 Sam Weinig <weinig@apple.com>
532 Remove Dashboard support
533 https://bugs.webkit.org/show_bug.cgi?id=198615
535 Reviewed by Ryosuke Niwa.
537 * wtf/FeatureDefines.h:
539 2019-06-10 Timothy Hatcher <timothy@apple.com>
541 Integrate dark mode support for iOS.
542 https://bugs.webkit.org/show_bug.cgi?id=198687
543 rdar://problem/51545643
545 Reviewed by Tim Horton.
549 2019-06-08 Andy Estes <aestes@apple.com>
551 [Apple Pay] If we have a bound interface identifier, set it on new PKPaymentRequests
552 https://bugs.webkit.org/show_bug.cgi?id=198690
553 <rdar://problem/48041803>
555 Reviewed by Tim Horton.
557 * wtf/FeatureDefines.h: Defined HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER, and cleaned up some
560 2019-06-06 Caio Lima <ticaiolima@gmail.com>
562 [JSCOnly] JSCOnly port is not building on macOS
563 https://bugs.webkit.org/show_bug.cgi?id=198563
565 Reviewed by Don Olmstead.
567 We are adding `<mach/vm_types.h>` to fix build issues when compiling
568 JSCOnly port on macOS.
570 * wtf/WTFAssertions.cpp:
572 2019-06-03 Commit Queue <commit-queue@webkit.org>
574 Unreviewed, rolling out r246022.
575 https://bugs.webkit.org/show_bug.cgi?id=198486
577 Causing Internal build failures and JSC test failures
578 (Requested by ShawnRoberts on #webkit).
582 "Reenable Gigacage on ARM64."
583 https://bugs.webkit.org/show_bug.cgi?id=198453
584 https://trac.webkit.org/changeset/246022
586 2019-06-03 Darin Adler <darin@apple.com>
588 Finish cleanup of String::number for floating point
589 https://bugs.webkit.org/show_bug.cgi?id=198471
591 Reviewed by Yusuke Suzuki.
593 * wtf/JSONValues.cpp:
594 (WTF::JSONImpl::Value::writeJSON const): Use appendNumber instead of
595 appendECMAScriptNumber, since that's now the default.
597 * wtf/text/StringBuilder.cpp:
598 (WTF::StringBuilder::appendNumber): Renamed from appendShortestFormNumber.
599 * wtf/text/StringBuilder.h: Removed appendShortestFormNumber and
600 appendECMAScriptNumber, replacing both with overload of appendNumber.
602 * wtf/text/WTFString.cpp:
603 (WTF::String::number): Renamed from numberToStringShortest.
604 * wtf/text/WTFString.h: Removed numberToStringShortest and
605 numberToStringECMAScript, replacing both with overload of number.
607 2019-06-02 Keith Miller <keith_miller@apple.com>
609 Reenable Gigacage on ARM64.
610 https://bugs.webkit.org/show_bug.cgi?id=198453
612 Reviewed by Filip Pizlo.
615 (WTF::CagedPtr::authenticatingLoad):
616 (WTF::CagedPtr::get const):
617 (WTF::CagedPtr::getMayBeNull const):
619 2019-05-31 Alex Christensen <achristensen@webkit.org>
621 URLParser::parseIPv6Host should properly parse 0's around compression
622 https://bugs.webkit.org/show_bug.cgi?id=198424
624 Reviewed by Tim Horton.
627 (WTF::URLParser::parseIPv6Host):
629 2019-05-31 Alex Christensen <achristensen@webkit.org>
631 URLParser::parseHostAndPort should not allow non-port characters after an ipv6 host
632 https://bugs.webkit.org/show_bug.cgi?id=198428
633 <rdar://problem/51209196>
635 Reviewed by Tim Horton.
637 This matches Chrome and Firefox.
640 (WTF::URLParser::parseHostAndPort):
642 2019-05-31 Tim Horton <timothy_horton@apple.com>
644 Optionally respect device management restrictions when loading from the network
645 https://bugs.webkit.org/show_bug.cgi?id=198318
646 <rdar://problem/44263806>
648 Reviewed by Alex Christensen.
651 Add a HAVE flag for DeviceManagement.framework.
652 It does exist in the simulator, but does not function; pretend it doesn't exist.
654 2019-05-31 Geoffrey Garen <ggaren@apple.com>
657 https://bugs.webkit.org/show_bug.cgi?id=198390
659 Reviewed by Chris Dumez.
662 (WTF::HashTraits<Ref<WeakPtrImpl>>::isReleasedWeakValue):
663 (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator):
664 Updated for rename to WeakPtrImpl.
666 (WTF::WeakHashSet::WeakHashSetConstIterator::get const): Updated for new
667 get() interface. Also, switched to iterator operator* to help clarify
668 the double dereference here.
670 (WTF::WeakHashSet::add):
671 (WTF::WeakHashSet::remove):
672 (WTF::WeakHashSet::contains const):
673 (WTF::WeakHashSet::computeSize const):
674 (WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Deleted.
675 Updated for rename to WeakPtrImpl.
678 (WTF::WeakPtrImpl::create):
679 (WTF::WeakPtrImpl::~WeakPtrImpl): Renamed WeakReference to WeakPtrImpl.
680 Now we don't need a comment explaining that this class is the backing
681 implementation of WeakPtr.
683 (WTF::WeakPtrImpl::get): Return the pointer type we stored, rather than
684 the pointer type requested by our client. It's a little too surprising
685 for a field to store one pointer type and load another.
687 (WTF::WeakPtrImpl::WeakPtrImpl): Fixed a theoretical type safety bug.
688 Make sure to store T::WeakValueType* instead of T*, since they might
689 not be the same pointer value. (In practice, T and T::WeakValueType*
690 are always the same type in this constructor because WeakPtrFactory
691 makes them so, but it's best not to depend on implementation details
694 (WTF::WeakPtr::get const): Updated for new get() interface.
696 (WTF::WeakPtr::operator bool const):
697 (WTF::WeakPtr::operator=):
698 (WTF::WeakPtr::clear):
699 (WTF::WeakPtr::WeakPtr): Updated for WeakPtrImpl rename.
701 (WTF::WeakPtrFactory::~WeakPtrFactory): Updated for WeakPtrImpl rename.
703 (WTF::WeakPtrFactory::createWeakPtr const): ASSERT that the passed-in
704 pointer is equal to the stored pointer. As a space optimization, we
705 require our client to remind us what we point to each time a weak
706 pointer is created -- but nothing guarantees that our client will do
709 (WTF::WeakPtrFactory::revokeAll): Updated for WeakPtrImpl rename.
711 (WTF::CanMakeWeakPtr::weakPtrFactory const):
712 (WTF::CanMakeWeakPtr::weakPtrFactory): Use idiomatic accessor naming.
714 (WTF::weak_ptr_impl_cast): Fixed a theoretical type safety bug.
715 Previously, if Base and Derived both inherited CanMakeWeakPtr, and
716 you casted WeakPtr<Base> to WeakPtr<Derived> (or vice versa), and
717 casting Base <-> Derived required pointer fixup, the previous
718 compile-time check would accept the cast, even though the stored pointer
721 (WTF::WeakPtr<T>::WeakPtr):
724 (WTF::WeakReference::create): Deleted.
725 (WTF::WeakReference::~WeakReference): Deleted.
726 (WTF::WeakReference::get const): Deleted.
727 (WTF::WeakReference::operator bool const): Deleted.
728 (WTF::WeakReference::clear): Deleted.
729 (WTF::WeakReference::WeakReference): Deleted.
730 (WTF::weak_reference_cast): Deleted. Updated for rename to WeakPtrImpl.
732 Don't export WeakPtrImpl because it's an implmenetation detail and
733 it shouldn't be easy to use outside WTF.
735 2019-05-31 Don Olmstead <don.olmstead@sony.com>
737 [CMake] Add WebKit::WTF target
738 https://bugs.webkit.org/show_bug.cgi?id=198400
740 Reviewed by Konstantin Tokarev.
742 Create the WebKit::WTF target and use that to propagate headers. Use
743 WEBKIT_COPY_FILES instead of WEBKIT_MAKE_FORWARDING_HEADERS.
745 * wtf/CMakeLists.txt:
747 2019-05-30 Saam Barati <sbarati@apple.com>
749 [WHLSL] Enforce variable lifetimes
750 https://bugs.webkit.org/show_bug.cgi?id=195794
751 <rdar://problem/50746293>
753 Reviewed by Myles C. Maxfield.
757 2019-05-30 Keith Rollin <krollin@apple.com>
759 Fix yet more deprecated uses of -[UIApplication interfaceOrientation]
760 https://bugs.webkit.org/show_bug.cgi?id=198381
761 <rdar://problem/51265846>
763 Reviewed by Wenson Hsieh.
765 r245267, r245272, and r245874 fixed many instances of this issue; this
766 change fixes the issue for tvOS.
768 * wtf/FeatureDefines.h:
770 2019-05-29 David Kilzer <ddkilzer@apple.com>
772 Clean up a few #include statements in WTF
773 <https://webkit.org/b/198351>
775 Reviewed by Alex Christensen.
777 * benchmarks/HashSetDFGReplay.cpp:
778 - Add missing "config.h" include.
779 * wtf/ParallelJobsGeneric.cpp:
780 - Replace include of ParallelJobs.h with
781 ParallelJobsGeneric.h.
782 * wtf/StackBounds.cpp:
783 - Fix include ordering of StackBounds.h.
785 2019-05-29 Keith Rollin <krollin@apple.com>
787 Followup to r245267 and r245272: fix even more deprecated uses of -[UIApplication interfaceOrientation]
788 https://bugs.webkit.org/show_bug.cgi?id=198348
789 <rdar://problem/51234077>
791 Reviewed by Wenson Hsieh.
793 r245267 and r245272 fixed many instances of this issue; this change
794 fixes the issue for watchOS.
796 * wtf/FeatureDefines.h:
798 2019-05-29 David Kilzer <ddkilzer@apple.com>
800 IndexedDatabase Server thread in com.apple.WebKit.Networking process leaks objects into an autoreleasePool that's never cleared
801 <https://webkit.org/b/198346>
802 <rdar://problem/50895658>
804 Reviewed by Brent Fulgham.
806 * wtf/CrossThreadTaskHandler.cpp:
807 (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler):
808 - Add optional second argument to enable use of an
809 AutodrainedPool when running the runloop.
810 (WTF::CrossThreadTaskHandler::taskRunLoop):
811 - Create an AutodrainedPool if requested when
812 CrossThreadTaskHandler was created.
813 * wtf/CrossThreadTaskHandler.h:
814 (WTF::CrossThreadTaskHandler::AutodrainedPoolForRunLoop):
815 - Add enum class for enabling an AutodrainedPool for
816 CrossThreadTaskHandler::taskRunLoop().
817 (WTF::CrossThreadTaskHandler::CrossThreadTaskHandler):
818 - Add optional second argument to enable use of an
819 AutodrainedPool when running the runloop.
821 2019-05-29 Geoffrey Garen <ggaren@apple.com>
823 WeakPtr breaks vtables when upcasting to base classes
824 https://bugs.webkit.org/show_bug.cgi?id=188799
826 Reviewed by Youenn Fablet.
828 This patch switches from reinterpret_cast to static_cast when loading
829 from WeakReference storage.
831 We know which type to cast *to* because it's specified by the type of
834 We know which type to cast *from* because it's specified by a typedef
837 (Our convention is that we store a pointer to the class that derives
838 from CanMakeWeakPtr. We cast from that pointer to derived pointers when
839 we get(). This means that #include of the derived type header is now
840 required in order to get() the pointer.)
843 (WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Definition
844 is now eagerly required because WeakReference is not a template anymore.
846 (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
847 (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
848 (WTF::WeakHashSet::remove):
849 (WTF::WeakHashSet::contains const):
850 (WTF::WeakHashSet::computesEmpty const):
851 (WTF::WeakHashSet::hasNullReferences const):
852 (WTF::WeakHashSet::computeSize const):
853 (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue): Deleted.
854 Updated for new WeakReference get() API.
856 * wtf/WeakPtr.h: Use a macro for TestAPI support. We can't use template
857 specialization because WeakReference is not a class template anymore.
858 (Or maybe we could have kept it working with a dummy template argument?
859 Felt weird, so I switched.)
861 (WTF::WeakReference::create):
862 (WTF::WeakReference::~WeakReference):
863 (WTF::WeakReference::get const):
864 (WTF::WeakReference::operator bool const):
865 (WTF::WeakReference::WeakReference): WeakReference is just a void* now.
866 It's the caller's responsibility, when creating and getting, to use
867 a consistent storage type. We ensure a canonical storage type using a
868 typedef inside CanMakeWeakPtr.
870 (WTF::WeakPtr::WeakPtr):
871 (WTF::WeakPtr::get const):
872 (WTF::WeakPtr::operator bool const):
873 (WTF::WeakPtr::operator-> const):
874 (WTF::WeakPtr::operator* const): Adopted new WeakReference API.
876 (WTF::WeakPtrFactory::createWeakPtr const): No need for reinterpret_cast.
878 (WTF::weak_reference_cast): This isn't required for correctness, but it's
879 nice to show a complier error at WeakPtr construction sites when you know
880 that the types won't work. Otherwise, you get compiler errors at
881 dereference sites, which are slightly more mysterious ways of saying that
882 you constructed your WeakPtr incorrectly.
884 (WTF::WeakPtr<T>::WeakPtr):
887 (WTF::weak_reference_upcast): Deleted.
888 (WTF::weak_reference_downcast): Deleted.
890 2019-05-29 Ryan Haddad <ryanhaddad@apple.com>
892 Unreviewed, rolling out r245857.
894 Breaks internal builds.
898 "WeakPtr breaks vtables when upcasting to base classes"
899 https://bugs.webkit.org/show_bug.cgi?id=188799
900 https://trac.webkit.org/changeset/245857
902 2019-05-28 Geoffrey Garen <ggaren@apple.com>
904 WeakPtr breaks vtables when upcasting to base classes
905 https://bugs.webkit.org/show_bug.cgi?id=188799
907 Reviewed by Youenn Fablet.
909 This patch switches from reinterpret_cast to static_cast when loading
910 from WeakReference storage.
912 We know which type to cast *to* because it's specified by the type of
915 We know which type to cast *from* because it's specified by a typedef
918 (Our convention is that we store a pointer to the class that derives
919 from CanMakeWeakPtr. We cast from that pointer to derived pointers when
920 we get(). This means that #include of the derived type header is now
921 required in order to get() the pointer.)
924 (WTF::HashTraits<Ref<WeakReference>>::isReleasedWeakValue): Definition
925 is now eagerly required because WeakReference is not a template anymore.
927 (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
928 (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
929 (WTF::WeakHashSet::remove):
930 (WTF::WeakHashSet::contains const):
931 (WTF::WeakHashSet::computesEmpty const):
932 (WTF::WeakHashSet::hasNullReferences const):
933 (WTF::WeakHashSet::computeSize const):
934 (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue): Deleted.
935 Updated for new WeakReference get() API.
937 * wtf/WeakPtr.h: Use a macro for TestAPI support. We can't use template
938 specialization because WeakReference is not a class template anymore.
939 (Or maybe we could have kept it working with a dummy template argument?
940 Felt weird, so I switched.)
942 (WTF::WeakReference::create):
943 (WTF::WeakReference::~WeakReference):
944 (WTF::WeakReference::get const):
945 (WTF::WeakReference::operator bool const):
946 (WTF::WeakReference::WeakReference): WeakReference is just a void* now.
947 It's the caller's responsibility, when creating and getting, to use
948 a consistent storage type. We ensure a canonical storage type using a
949 typedef inside CanMakeWeakPtr.
951 (WTF::WeakPtr::WeakPtr):
952 (WTF::WeakPtr::get const):
953 (WTF::WeakPtr::operator bool const):
954 (WTF::WeakPtr::operator-> const):
955 (WTF::WeakPtr::operator* const): Adopted new WeakReference API.
957 (WTF::WeakPtrFactory::createWeakPtr const): No need for reinterpret_cast.
959 (WTF::weak_reference_cast): This isn't required for correctness, but it's
960 nice to show a complier error at WeakPtr construction sites when you know
961 that the types won't work. Otherwise, you get compiler errors at
962 dereference sites, which are slightly more mysterious ways of saying that
963 you constructed your WeakPtr incorrectly.
965 (WTF::WeakPtr<T>::WeakPtr):
968 (WTF::weak_reference_upcast): Deleted.
969 (WTF::weak_reference_downcast): Deleted.
971 2019-05-27 Chris Dumez <cdumez@apple.com>
973 Use a strongly-typed identifier for pages
974 https://bugs.webkit.org/show_bug.cgi?id=198206
976 Reviewed by Youenn Fablet.
978 * wtf/ObjectIdentifier.h:
981 2019-05-23 Don Olmstead <don.olmstead@sony.com>
983 [CMake] Use target oriented design for bmalloc
984 https://bugs.webkit.org/show_bug.cgi?id=198046
986 Reviewed by Konstantin Tokarev.
988 Use WebKit::bmalloc target.
990 * wtf/CMakeLists.txt:
992 2019-05-23 Ross Kirsling <ross.kirsling@sony.com>
994 [PlayStation] Implement platformUserPreferredLanguages.
995 https://bugs.webkit.org/show_bug.cgi?id=198149
997 Reviewed by Fujii Hironori.
999 * wtf/PlatformPlayStation.cmake:
1000 * wtf/playstation/LanguagePlayStation.cpp: Added.
1001 (WTF::platformUserPreferredLanguages):
1003 2019-05-22 Myles C. Maxfield <mmaxfield@apple.com>
1005 font-optical-sizing applies the wrong variation value
1006 https://bugs.webkit.org/show_bug.cgi?id=197528
1007 <rdar://problem/50152854>
1009 Reviewed by Antti Koivisto.
1013 2019-05-22 Ryan Haddad <ryanhaddad@apple.com>
1015 Unreviewed, rolling out r245598.
1017 Breaks watchOS build.
1021 "font-optical-sizing applies the wrong variation value"
1022 https://bugs.webkit.org/show_bug.cgi?id=197528
1023 https://trac.webkit.org/changeset/245598
1025 2019-05-21 Ross Kirsling <ross.kirsling@sony.com>
1027 [PlayStation] Don't call fcntl.
1028 https://bugs.webkit.org/show_bug.cgi?id=197961
1030 Reviewed by Fujii Hironori.
1032 * wtf/PlatformGTK.cmake:
1033 * wtf/PlatformJSCOnly.cmake:
1034 * wtf/PlatformPlayStation.cmake:
1035 * wtf/PlatformWPE.cmake:
1036 * wtf/UniStdExtras.h:
1037 * wtf/playstation/UniStdExtrasPlayStation.cpp: Added.
1038 (WTF::setCloseOnExec):
1039 (WTF::dupCloseOnExec):
1041 * wtf/unix/UniStdExtrasUnix.cpp: Renamed from Source/WTF/wtf/UniStdExtras.cpp.
1043 Move UniStdExtras to unix/, add a PlayStation version that doesn't use fcntl, add an abstraction for O_NONBLOCK.
1045 2019-05-20 Tadeu Zagallo <tzagallo@apple.com>
1047 Only cache bytecode for API clients in data vaults
1048 https://bugs.webkit.org/show_bug.cgi?id=197898
1050 Reviewed by Keith Miller.
1052 Add SPI to check if a filesystem path is restricted as a data vault.
1054 * WTF.xcodeproj/project.pbxproj:
1055 * wtf/spi/darwin/DataVaultSPI.h: Added.
1057 2019-05-20 Carlos Garcia Campos <cgarcia@igalia.com>
1059 [GLIB] Repeating timer is not stopped when stop is called from the callback
1060 https://bugs.webkit.org/show_bug.cgi?id=197986
1062 Reviewed by Michael Catanzaro.
1064 In case of repeating timers we always update the ready time to fire interval after the user callback is called.
1066 * wtf/glib/RunLoopGLib.cpp:
1067 (WTF::RunLoop::TimerBase::stop): Reset m_fireInterval and m_isRepeating.
1069 2019-05-19 Darin Adler <darin@apple.com>
1071 Change String::number to use "shortest" instead of "fixed precision 6 digits"
1072 https://bugs.webkit.org/show_bug.cgi?id=178319
1074 Reviewed by Sam Weinig.
1076 * wtf/text/StringBuilder.h: Delete appendNumber for floating point and
1077 appendECMAScriptNumber for single-precision.
1079 * wtf/text/WTFString.h: Delete String::number for floating point and
1080 numberToStringECMAScript for single-precision.
1082 2019-05-18 Tadeu Zagallo <tzagallo@apple.com>
1084 Add extra information to dumpJITMemory
1085 https://bugs.webkit.org/show_bug.cgi?id=197998
1087 Reviewed by Saam Barati.
1089 Add a new trace point code for JSC::dumpJITMemory
1091 * wtf/SystemTracing.h:
1093 2019-05-17 Don Olmstead <don.olmstead@sony.com>
1095 [CMake] Use builtin FindICU
1096 https://bugs.webkit.org/show_bug.cgi?id=197934
1098 Reviewed by Michael Catanzaro.
1100 Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES. Use ICU:: targets which end
1101 up propagating to all consumers of WTF.
1103 * wtf/CMakeLists.txt:
1104 * wtf/PlatformPlayStation.cmake:
1106 2019-05-17 Commit Queue <commit-queue@webkit.org>
1108 Unreviewed, rolling out r245418.
1109 https://bugs.webkit.org/show_bug.cgi?id=197989
1111 New API test causing crashes on Mojave testers (Requested by
1112 ShawnRoberts on #webkit).
1116 "Add a unit test for client certificate authentication"
1117 https://bugs.webkit.org/show_bug.cgi?id=197800
1118 https://trac.webkit.org/changeset/245418
1120 2019-05-16 Keith Miller <keith_miller@apple.com>
1122 Wasm should cage the memory base pointers in structs
1123 https://bugs.webkit.org/show_bug.cgi?id=197620
1125 Reviewed by Saam Barati.
1127 Rename reauthenticate to recage.
1130 (WTF::CagedPtr::recage):
1131 (WTF::CagedPtr::reauthenticate): Deleted.
1133 2019-05-16 Alex Christensen <achristensen@webkit.org>
1135 Add a unit test for client certificate authentication
1136 https://bugs.webkit.org/show_bug.cgi?id=197800
1138 Reviewed by Youenn Fablet.
1140 * wtf/spi/cocoa/SecuritySPI.h:
1141 Move declarations from ArgumentCodersCF.cpp so they can be shared.
1143 2019-05-16 Eike Rathke <erack@redhat.com>
1145 Fix memcpy() call for big endian
1146 https://bugs.webkit.org/show_bug.cgi?id=197945
1148 Reviewed by Michael Catanzaro.
1153 2019-05-15 Ross Kirsling <ross.kirsling@sony.com>
1155 [PlayStation] WTFCrash should preserve register state.
1156 https://bugs.webkit.org/show_bug.cgi?id=197932
1158 Reviewed by Don Olmstead.
1160 * wtf/Assertions.cpp:
1162 Let r196397 apply to PlayStation port as well.
1164 2019-05-15 Simon Fraser <simon.fraser@apple.com>
1166 Make LOG_WITH_STREAM more efficient
1167 https://bugs.webkit.org/show_bug.cgi?id=197905
1169 Reviewed by Alex Christensen.
1171 Add a streamable repeat() class that can be used to output a series of characters.
1172 This is useful for indenting output.
1174 * wtf/text/TextStream.h:
1175 (WTF::TextStream::repeat::repeat):
1176 (WTF::TextStream::operator<<):
1178 2019-05-15 VÃctor Manuel Jáquez Leal <vjaquez@igalia.com>
1180 compilation failure with clang 9
1181 https://bugs.webkit.org/show_bug.cgi?id=197911
1183 Reviewed by Alex Christensen.
1185 Use std namespace for nullptr_t in tagArrayPtr templates.
1190 2019-05-14 Commit Queue <commit-queue@webkit.org>
1192 Unreviewed, rolling out r245281.
1193 https://bugs.webkit.org/show_bug.cgi?id=197887
1195 Broke API Test TestWebKitAPI.Challenge.ClientCertificate
1196 (Requested by aakashjain on #webkit).
1200 "Add a unit test for client certificate authentication"
1201 https://bugs.webkit.org/show_bug.cgi?id=197800
1202 https://trac.webkit.org/changeset/245281
1204 2019-05-14 Alex Christensen <achristensen@webkit.org>
1206 Add a unit test for client certificate authentication
1207 https://bugs.webkit.org/show_bug.cgi?id=197800
1209 Reviewed by Youenn Fablet.
1211 * wtf/spi/cocoa/SecuritySPI.h:
1212 Move declarations from ArgumentCodersCF.cpp so they can be shared.
1214 2019-05-13 Robin Morisset <rmorisset@apple.com>
1216 IndexSet::isEmpty should use BitVector::isEmpty() instead of size()
1217 https://bugs.webkit.org/show_bug.cgi?id=197857
1219 Reviewed by Darin Adler.
1222 (WTF::IndexSet::isEmpty const):
1224 2019-05-13 Youenn Fablet <youenn@apple.com>
1226 [Mac] Use realpath for dlopen_preflight
1227 https://bugs.webkit.org/show_bug.cgi?id=197803
1229 Reviewed by Eric Carlson.
1231 * wtf/cocoa/SoftLinking.h:
1233 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
1235 Unreviewed, wrokaround for MACH_VM_MAX_ADDRESS in ARM32_64
1236 https://bugs.webkit.org/show_bug.cgi?id=197730
1238 Interestingly, MACH_VM_MAX_ADDRESS is larger than 32bit in ARM32_64, I think this is a bug.
1239 But for now, we workaround for this case by using `CPU(ADDRESS64)`.
1241 * wtf/WTFAssertions.cpp:
1243 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
1245 [WTF] Remove Threading workaround for support libraries in Windows
1246 https://bugs.webkit.org/show_bug.cgi?id=197350
1248 Reviewed by Darin Adler.
1250 We kept old APIs for some support libraries at 2017. This patch removes them.
1253 * wtf/win/ThreadingWin.cpp:
1254 (WTF::createThread): Deleted.
1255 (WTF::waitForThreadCompletion): Deleted.
1257 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
1259 [WTF] Simplify GCThread and CompilationThread flags by adding them to WTF::Thread
1260 https://bugs.webkit.org/show_bug.cgi?id=197146
1262 Reviewed by Saam Barati.
1264 Since GCThread and CompilationThread flags exist in WTF, we put these flags into WTF::Thread directly instead of holding them in ThreadSpecific<>.
1265 And this patch removes dependency from Threading.h to ThreadSpecific.h. ThreadSpecific.h's OS threading primitives are moved to ThreadingPrimitives.h,
1266 and Threading.h relies on it instead.
1268 * wtf/CompilationThread.cpp:
1269 (WTF::isCompilationThread):
1270 (WTF::initializeCompilationThreads): Deleted.
1271 (WTF::exchangeIsCompilationThread): Deleted.
1272 * wtf/CompilationThread.h:
1273 (WTF::CompilationScope::CompilationScope):
1274 (WTF::CompilationScope::~CompilationScope):
1275 (WTF::CompilationScope::leaveEarly):
1276 * wtf/MainThread.cpp:
1277 (WTF::initializeMainThread):
1278 (WTF::initializeMainThreadToProcessMainThread):
1279 (WTF::isMainThreadOrGCThread):
1280 (WTF::initializeGCThreads): Deleted.
1281 (WTF::registerGCThread): Deleted.
1282 (WTF::mayBeGCThread): Deleted.
1284 * wtf/ThreadSpecific.h:
1285 (WTF::canBeGCThread>::ThreadSpecific):
1286 (WTF::canBeGCThread>::set):
1287 (WTF::threadSpecificKeyCreate): Deleted.
1288 (WTF::threadSpecificKeyDelete): Deleted.
1289 (WTF::threadSpecificSet): Deleted.
1290 (WTF::threadSpecificGet): Deleted.
1291 * wtf/Threading.cpp:
1292 (WTF::Thread::exchangeIsCompilationThread):
1293 (WTF::Thread::registerGCThread):
1294 (WTF::Thread::mayBeGCThread):
1296 (WTF::Thread::isCompilationThread const):
1297 (WTF::Thread::gcThreadType const):
1298 (WTF::Thread::joinableState const):
1299 (WTF::Thread::hasExited const):
1300 (WTF::Thread::Thread):
1301 (WTF::Thread::joinableState): Deleted.
1302 (WTF::Thread::hasExited): Deleted.
1303 * wtf/ThreadingPrimitives.h:
1304 (WTF::threadSpecificKeyCreate):
1305 (WTF::threadSpecificKeyDelete):
1306 (WTF::threadSpecificSet):
1307 (WTF::threadSpecificGet):
1308 * wtf/win/ThreadSpecificWin.cpp:
1311 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
1313 Unreviewed, follow-up after r245214
1314 https://bugs.webkit.org/show_bug.cgi?id=197730
1316 Suggested by Sam. We should have static_assert with MACH_VM_MAX_ADDRESS.
1318 * wtf/WTFAssertions.cpp:
1320 2019-05-13 Youenn Fablet <youenn@apple.com>
1322 Use kDNSServiceFlagsKnownUnique for DNSServiceRegisterRecord only on platforms supporting it
1323 https://bugs.webkit.org/show_bug.cgi?id=197802
1325 Reviewed by Eric Carlson.
1329 2019-05-13 Yusuke Suzuki <ysuzuki@apple.com>
1331 [JSC] Compress miscelaneous JIT related data structures with Packed<>
1332 https://bugs.webkit.org/show_bug.cgi?id=197830
1334 Reviewed by Saam Barati.
1339 2019-05-13 Michael Catanzaro <mcatanzaro@igalia.com>
1341 Unreviewed, fix unused variable warnings in release builds
1343 * wtf/URLHelpers.cpp:
1344 (WTF::URLHelpers::escapeUnsafeCharacters):
1346 2019-05-12 Yusuke Suzuki <ysuzuki@apple.com>
1348 [JSC] Compress Watchpoint size by using enum type and Packed<> data structure
1349 https://bugs.webkit.org/show_bug.cgi?id=197730
1351 Reviewed by Filip Pizlo.
1353 This patch introduces a new data structures, WTF::Packed, WTF::PackedPtr, and WTF::PackedAlignedPtr.
1357 WTF::Packed is data storage. We can read and write trivial (in C++ term [1]) data to this storage. The difference to
1358 the usual storage is that the alignment of this storage is always 1. We access the underlying data by using unalignedLoad/unalignedStore.
1359 This class offers alignment = 1 data structure instead of missing the following characteristics.
1361 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
1362 in a racy way. (e.g. fields accessed optimistically from the concurrent compilers).
1364 2. We cannot take reference / pointer to the underlying storage since they are unaligned.
1366 3. Access to this storage is unaligned access. The code is using memcpy, and the compiler will convert to an appropriate unaligned access
1367 in certain architectures (x86_64 / ARM64). It could be slow. So use it for non performance sensitive & memory sensitive places.
1371 WTF::PackedPtr is a specialization of WTF::Packed<T*>. And it is basically WTF::PackedAlignedPtr with alignment = 1. We further compact
1372 the pointer by leveraging the platform specific knowledge. In 64bit architectures, the effective width of pointers are less than 64 bit.
1373 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
1374 x86_64 and 5 bytes in Darwin ARM64.
1376 - WTF::PackedAlignedPtr
1378 WTF::PackedAlignedPtr is the WTF::PackedPtr with alignment information of the T. If we use this alignment information, we could reduce the
1379 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
1380 this information in Darwin ARM64 platform allows us to make packed JSCell pointer 4 bytes (36 - 4 bits). We do not use passed alignment
1381 information if it is not profitable.
1383 We also have PackedPtrTraits. This is new PtrTraits and use it for various data structures such as Bag<>.
1385 [1]: https://en.cppreference.com/w/cpp/types/is_trivial
1387 * WTF.xcodeproj/project.pbxproj:
1390 (WTF::Bag::iterator::operator++):
1391 * wtf/CMakeLists.txt:
1392 * wtf/DumbPtrTraits.h:
1393 * wtf/DumbValueTraits.h:
1395 (WTF::clzConstexpr):
1397 (WTF::ctzConstexpr):
1399 (WTF::getLSBSetConstexpr):
1400 (WTF::getMSBSetConstexpr):
1401 * wtf/Packed.h: Added.
1402 (WTF::Packed::Packed):
1403 (WTF::Packed::get const):
1405 (WTF::Packed::operator=):
1406 (WTF::Packed::exchange):
1407 (WTF::Packed::swap):
1409 (WTF::PackedPtrTraits::exchange):
1410 (WTF::PackedPtrTraits::swap):
1411 (WTF::PackedPtrTraits::unwrap):
1413 * wtf/SentinelLinkedList.h:
1414 (WTF::BasicRawSentinelNode::BasicRawSentinelNode):
1415 (WTF::BasicRawSentinelNode::prev):
1416 (WTF::BasicRawSentinelNode::next):
1417 (WTF::PtrTraits>::remove):
1418 (WTF::PtrTraits>::prepend):
1419 (WTF::PtrTraits>::append):
1420 (WTF::RawNode>::SentinelLinkedList):
1421 (WTF::RawNode>::remove):
1422 (WTF::BasicRawSentinelNode<T>::remove): Deleted.
1423 (WTF::BasicRawSentinelNode<T>::prepend): Deleted.
1424 (WTF::BasicRawSentinelNode<T>::append): Deleted.
1425 * wtf/StdLibExtras.h:
1426 (WTF::roundUpToMultipleOfImpl):
1427 (WTF::roundUpToMultipleOfImpl0): Deleted.
1428 * wtf/UnalignedAccess.h:
1429 (WTF::unalignedLoad):
1430 (WTF::unalignedStore):
1432 2019-05-10 Saam barati <sbarati@apple.com>
1434 Bag's move operator= leaks memory
1435 https://bugs.webkit.org/show_bug.cgi?id=197757
1437 Reviewed by Keith Miller.
1439 It was unused. So I'm just removing it. We can implement it properly
1443 (WTF::Bag::operator=): Deleted.
1445 2019-05-10 Fujii Hironori <Hironori.Fujii@sony.com>
1447 [WinCairo] storage/indexeddb tests are timing out
1448 https://bugs.webkit.org/show_bug.cgi?id=196289
1450 Reviewed by Alex Christensen.
1452 * wtf/FileSystem.h: Added hardLink.
1453 * wtf/glib/FileSystemGlib.cpp:
1454 (WTF::FileSystemImpl::hardLink):
1455 (WTF::FileSystemImpl::hardLinkOrCopyFile):
1456 * wtf/posix/FileSystemPOSIX.cpp:
1457 (WTF::FileSystemImpl::hardLink):
1458 (WTF::FileSystemImpl::hardLinkOrCopyFile):
1459 * wtf/win/FileSystemWin.cpp:
1460 (WTF::FileSystemImpl::hardLink):
1461 (WTF::FileSystemImpl::hardLinkOrCopyFile):
1462 Added hardLink. Let hardLinkOrCopyFile use the hardLink.
1464 2019-05-10 Yusuke Suzuki <ysuzuki@apple.com>
1466 [WTF] Remove "private:" from Noncopyable and Nonmovable macros
1467 https://bugs.webkit.org/show_bug.cgi?id=197767
1469 Reviewed by Saam Barati.
1471 We no longer need "private:".
1473 * wtf/Noncopyable.h:
1476 2019-05-08 Zan Dobersek <zdobersek@igalia.com>
1478 [GLib] Rework WPE RunLoopSourcePriority values
1479 https://bugs.webkit.org/show_bug.cgi?id=197167
1481 Reviewed by Carlos Garcia Campos.
1483 The GLib priorities for the WPE port were initially aligned on the -70
1484 value, theory being that this would help avoid any default-priority
1485 GSources spawned in different dependency libraries affecting our
1486 scheduling. Today it seems that extra caution might not be really
1489 This change aligns the base priority value with GLib's default priority
1490 value of 0. We maintain the relativity of priority values by effectively
1491 increasing each priority by 70.
1493 * wtf/glib/RunLoopSourcePriority.h:
1495 2019-05-08 Alex Christensen <achristensen@webkit.org>
1497 Add SPI to set HSTS storage directory
1498 https://bugs.webkit.org/show_bug.cgi?id=197259
1500 Reviewed by Brady Eidson.
1504 2019-05-08 Keith Miller <keith_miller@apple.com>
1506 Remove Gigacage from arm64 and use PAC for arm64e instead
1507 https://bugs.webkit.org/show_bug.cgi?id=197110
1509 Reviewed by Saam Barati.
1511 This patch changes the Gigacage to use PAC on arm64e. As part of
1512 this process all platforms must provide their length when
1513 materializing the caged pointer. Since it would be somewhat
1514 confusing to have two parameters for an operator [] those methods
1515 have been removed. Lastly, this patch removes the specializations
1516 for void* caged pointers, instead opting to use enable_if on the
1517 methods that would normally fail on void* e.g. anything that
1520 * WTF.xcodeproj/project.pbxproj:
1521 * wtf/CMakeLists.txt:
1523 (WTF::CagedPtr::CagedPtr):
1524 (WTF::CagedPtr::get const):
1525 (WTF::CagedPtr::getMayBeNull const):
1526 (WTF::CagedPtr::getUnsafe const):
1527 (WTF::CagedPtr::at const):
1528 (WTF::CagedPtr::reauthenticate):
1529 (WTF::CagedPtr::operator=):
1530 (WTF::CagedPtr::operator== const):
1531 (WTF::CagedPtr::operator bool const):
1532 (WTF::CagedPtr::operator* const): Deleted.
1533 (WTF::CagedPtr::operator-> const): Deleted.
1534 (WTF::CagedPtr::operator[] const): Deleted.
1536 * wtf/CagedUniquePtr.h:
1537 (WTF::CagedUniquePtr::CagedUniquePtr):
1538 (WTF::CagedUniquePtr::create):
1539 (WTF::CagedUniquePtr::~CagedUniquePtr):
1540 (WTF::CagedUniquePtr::destroy):
1543 (Gigacage::cagedMayBeNull):
1546 (WTF::untagArrayPtr):
1547 (WTF::removeArrayPtrTag):
1548 (WTF::retagArrayPtr):
1549 * wtf/TaggedArrayStoragePtr.h: Copied from Source/JavaScriptCore/runtime/ArrayBufferView.cpp.
1550 (WTF::TaggedArrayStoragePtr::TaggedArrayStoragePtr):
1551 (WTF::TaggedArrayStoragePtr::get const):
1552 (WTF::TaggedArrayStoragePtr::getUnsafe const):
1553 (WTF::TaggedArrayStoragePtr::resize):
1554 (WTF::TaggedArrayStoragePtr::operator bool const):
1556 2019-05-08 Robin Morisset <rmorisset@apple.com>
1558 WTF::TimingScope should show the total duration and not just the mean
1559 https://bugs.webkit.org/show_bug.cgi?id=197672
1561 Reviewed by Alex Christensen.
1563 * wtf/TimingScope.cpp:
1564 (WTF::TimingScope::scopeDidEnd):
1566 2019-05-07 Yusuke Suzuki <ysuzuki@apple.com>
1568 [JSC] LLIntPrototypeLoadAdaptiveStructureWatchpoint does not require Bag<>
1569 https://bugs.webkit.org/show_bug.cgi?id=197645
1571 Reviewed by Saam Barati.
1573 * WTF.xcodeproj/project.pbxproj:
1574 * wtf/CMakeLists.txt:
1575 * wtf/Nonmovable.h: Copied from Source/JavaScriptCore/bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.h.
1577 (WTF::minCapacity>::uncheckedConstructAndAppend):
1579 2019-05-07 Eric Carlson <eric.carlson@apple.com>
1581 Define media buffering policy
1582 https://bugs.webkit.org/show_bug.cgi?id=196979
1583 <rdar://problem/28383861>
1585 Reviewed by Jer Noble.
1589 2019-05-07 Robin Morisset <rmorisset@apple.com>
1591 WTF::BitVector should have an isEmpty() method
1592 https://bugs.webkit.org/show_bug.cgi?id=197637
1594 Reviewed by Keith Miller.
1596 * wtf/BitVector.cpp:
1597 (WTF::BitVector::isEmptySlow const):
1599 (WTF::BitVector::isEmpty const):
1601 2019-05-07 Brent Fulgham <bfulgham@apple.com>
1603 Correct JSON parser to address unterminated escape character
1604 https://bugs.webkit.org/show_bug.cgi?id=197582
1605 <rdar://problem/50459177>
1607 Reviewed by Alex Christensen.
1609 Correct JSON parser code to properly deal with unterminated escape
1612 * wtf/JSONValues.cpp:
1613 (WTF::JSONImpl::decodeString):
1614 (WTF::JSONImpl::parseStringToken):
1616 2019-05-07 Alex Christensen <achristensen@webkit.org>
1618 Add a release assertion that Functions can only be constructed from non-null CompletionHandlers
1619 https://bugs.webkit.org/show_bug.cgi?id=197641
1621 Reviewed by Chris Dumez.
1623 This will help us find the cause of rdar://problem/48679972 by seeing the crash when the Function is dispatched,
1624 not when it's called with no interesting stack trace. I manually verified this assertion is hit in such a case.
1625 We should also have no legitimate use of creating a Function out of a null CompletionHandler then never calling it.
1627 * wtf/CompletionHandler.h:
1628 (WTF::Detail::CallableWrapper<CompletionHandler<Out):
1630 (WTF::Detail::CallableWrapperBase::~CallableWrapperBase):
1631 (WTF::Detail::CallableWrapper::CallableWrapper):
1632 (WTF::Function<Out):
1634 2019-05-06 Christopher Reid <chris.reid@sony.com>
1636 [JSC] Respect already defined USE_LLINT_EMBEDDED_OPCODE_ID compiler variable.
1637 https://bugs.webkit.org/show_bug.cgi?id=197633
1639 Reviewed by Don Olmstead.
1641 When the variable `USE_LLINT_EMBEDDED_OPCODE_ID` is defined, stop defining
1642 its value with platform default one.
1646 2019-05-03 Sihui Liu <sihui_liu@apple.com>
1648 Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
1649 https://bugs.webkit.org/show_bug.cgi?id=197390
1650 <rdar://problem/42685773>
1652 Reviewed by Geoffrey Garen.
1654 * wtf/FileSystem.cpp:
1655 (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
1656 (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
1658 * wtf/cocoa/FileSystemCocoa.mm:
1659 (WTF::FileSystemImpl::isSafeToUseMemoryMapForPath):
1660 (WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath):
1662 2019-05-03 Commit Queue <commit-queue@webkit.org>
1664 Unreviewed, rolling out r244881.
1665 https://bugs.webkit.org/show_bug.cgi?id=197559
1667 Breaks compilation of jsconly on linux, breaking compilation
1668 for jsc-i386-ews, jsc-mips-ews and jsc-armv7-ews (Requested by
1669 guijemont on #webkit).
1673 "[CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into
1675 https://bugs.webkit.org/show_bug.cgi?id=197174
1676 https://trac.webkit.org/changeset/244881
1678 2019-05-02 Alex Christensen <achristensen@webkit.org>
1680 Mark U+01C0 as a homograph of U+006C
1681 https://bugs.webkit.org/show_bug.cgi?id=197526
1682 <rdar://problem/50301904>
1684 Reviewed by Tim Horton.
1686 * wtf/URLHelpers.cpp:
1687 (WTF::URLHelpers::isLookalikeCharacter):
1689 2019-05-02 Don Olmstead <don.olmstead@sony.com>
1691 [CMake] Refactor WEBKIT_MAKE_FORWARDING_HEADERS into WEBKIT_COPY_FILES
1692 https://bugs.webkit.org/show_bug.cgi?id=197174
1694 Reviewed by Alex Christensen.
1696 Replace WEBKIT_MAKE_FORWARDING_HEADERS with WEBKIT_COPY_FILES.
1698 * wtf/CMakeLists.txt:
1700 2019-05-01 Darin Adler <darin@apple.com>
1702 WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
1703 https://bugs.webkit.org/show_bug.cgi?id=195535
1705 Reviewed by Alexey Proskuryakov.
1707 * wtf/text/AtomicString.cpp:
1708 (WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
1709 end is nullptr; this behavior used to be implemented inside the
1710 calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
1712 * wtf/text/AtomicStringImpl.cpp:
1713 (WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
1716 * wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
1717 AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
1718 the AtomicString class and its behavior changed subtly in this patch; it's helpful
1719 to document that it's not exported.
1721 * wtf/text/StringImpl.cpp:
1722 (WTF::StringImpl::utf8Impl): Don't pass "true" for strictness to convertUTF16ToUTF8
1723 since strict is the default. Also updated for changes to ConversionResult.
1724 (WTF::StringImpl::utf8ForCharacters): Updated for change to convertLatin1ToUTF8.
1725 (WTF::StringImpl::tryGetUtf8ForRange const): Ditto.
1727 * wtf/text/StringView.cpp: Removed uneeded include of UTF8Conversion.h.
1729 * wtf/text/WTFString.cpp:
1730 (WTF::String::fromUTF8): Updated for change to convertUTF8ToUTF16.
1732 * wtf/unicode/UTF8Conversion.cpp:
1733 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII): Deleted.
1734 (WTF::Unicode::inlineUTF8SequenceLength): Deleted.
1735 (WTF::Unicode::UTF8SequenceLength): Deleted.
1736 (WTF::Unicode::decodeUTF8Sequence): Deleted.
1737 (WTF::Unicode::convertLatin1ToUTF8): Use U8_APPEND, enabling us to remove
1738 almost everything in the function. Also changed resturn value to be a boolean
1739 to indicate success since there is only one possible failure (target exhausted).
1740 There is room for further simplification, since most callers have lengths rather
1741 than end pointers for the source buffer, and all but one caller supplies a buffer
1742 size known to be sufficient, so those don't need a return value, nor do they need
1743 to pass an end of buffer pointer.
1744 (WTF::Unicode::convertUTF16ToUTF8): Use U_IS_LEAD, U_IS_TRAIL,
1745 U16_GET_SUPPLEMENTARY, U_IS_SURROGATE, and U8_APPEND. Also changed behavior
1746 for non-strict mode so that unpaired surrogates will be turned into the
1747 replacement character instead of invalid UTF-8 sequences, because U8_APPEND
1748 won't create an invalid UTF-8 sequence, and because we don't need to do that
1749 for any good reason at any call site.
1750 (WTF::Unicode::isLegalUTF8): Deleted.
1751 (WTF::Unicode::readUTF8Sequence): Deleted.
1752 (WTF::Unicode::convertUTF8ToUTF16): Use U8_NEXT instead of
1753 inlineUTF8SequenceLength, isLegalUTF8, and readUTF8Sequence. Use
1754 U16_APPEND instead of lots of code that does the same thing. There is
1755 room for further simplification since most callers don't need the "all ASCII"
1756 feature and could probably pass the arguments in a more natural way.
1757 (WTF::Unicode::calculateStringHashAndLengthFromUTF8MaskingTop8Bits):
1758 Use U8_NEXT instead of isLegalUTF8, readUTF8Sequence, and various
1759 error handling checks for things that are handled by U8_NEXT. Also removed
1760 support for passing nullptr for end to specify a null-terminated string.
1761 (WTF::Unicode::equalUTF16WithUTF8): Ditto.
1763 * wtf/unicode/UTF8Conversion.h: Removed UTF8SequenceLength and
1764 decodeUTF8Sequence. Changed the ConversionResult to match WebKit coding
1765 style, with an eye toward perhaps removing it in the future. Changed
1766 the convertUTF8ToUTF16 return value to a boolean and removed the "strict"
1767 argument since no caller was passing false. Changed the convertLatin1ToUTF8
1768 return value to a boolean. Tweaked comments.
1770 2019-05-01 Shawn Roberts <sroberts@apple.com>
1772 Unreviewed, rolling out r244821.
1778 "WebKit has too much of its own UTF-8 code and should rely
1779 more on ICU's UTF-8 support"
1780 https://bugs.webkit.org/show_bug.cgi?id=195535
1781 https://trac.webkit.org/changeset/244821
1783 2019-05-01 Shawn Roberts <sroberts@apple.com>
1785 Unreviewed, rolling out r244822.
1787 Causing 4 Test262 failures on JSC Release and Debug
1791 https://trac.webkit.org/changeset/244822 https://trac.webkit.org/changeset/244821
1793 2019-04-29 Darin Adler <darin@apple.com>
1795 WebKit has too much of its own UTF-8 code and should rely more on ICU's UTF-8 support
1796 https://bugs.webkit.org/show_bug.cgi?id=195535
1798 Reviewed by Alexey Proskuryakov.
1800 * wtf/text/AtomicString.cpp:
1801 (WTF::AtomicString::fromUTF8Internal): Added code to compute string length when the
1802 end is nullptr; this behavior used to be implemented inside the
1803 calculateStringHashAndLengthFromUTF8MaskingTop8Bits function.
1805 * wtf/text/AtomicStringImpl.cpp:
1806 (WTF::HashAndUTF8CharactersTranslator::translate): Updated for change to
1809 * wtf/text/AtomicStringImpl.h: Took the WTF_EXPORT_PRIVATE off of the
1810 AtomicStringImpl::addUTF8 function. This is used only inside a non-inlined function in
1811 the AtomicString class and its behavior changed subtly in this patch; it's helpful
1812 to document that it's not exported.
1814 * wtf/text/StringImpl.cpp:
1815 (WTF::StringImpl::utf8Impl): Don't pass "true" for strictness to convertUTF16ToUTF8
1816 since strict is the default. Also updated for changes to ConversionResult.
1817 (WTF::StringImpl::utf8ForCharacters): Updated for change to convertLatin1ToUTF8.
1818 (WTF::StringImpl::tryGetUtf8ForRange const): Ditto.
1820 * wtf/text/StringView.cpp: Removed uneeded include of UTF8Conversion.h.
1822 * wtf/text/WTFString.cpp:
1823 (WTF::String::fromUTF8): Updated for change to convertUTF8ToUTF16.
1825 * wtf/unicode/UTF8Conversion.cpp:
1826 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII): Deleted.
1827 (WTF::Unicode::inlineUTF8SequenceLength): Deleted.
1828 (WTF::Unicode::UTF8SequenceLength): Deleted.
1829 (WTF::Unicode::decodeUTF8Sequence): Deleted.
1830 (WTF::Unicode::convertLatin1ToUTF8): Use U8_APPEND, enabling us to remove
1831 almost everything in the function. Also changed resturn value to be a boolean
1832 to indicate success since there is only one possible failure (target exhausted).
1833 There is room for further simplification, since most callers have lengths rather
1834 than end pointers for the source buffer, and all but one caller supplies a buffer
1835 size known to be sufficient, so those don't need a return value, nor do they need
1836 to pass an end of buffer pointer.
1837 (WTF::Unicode::convertUTF16ToUTF8): Use U_IS_LEAD, U_IS_TRAIL,
1838 U16_GET_SUPPLEMENTARY, U_IS_SURROGATE, and U8_APPEND. Also changed behavior
1839 for non-strict mode so that unpaired surrogates will be turned into the
1840 replacement character instead of invalid UTF-8 sequences, because U8_APPEND
1841 won't create an invalid UTF-8 sequence, and because we don't need to do that
1842 for any good reason at any call site.
1843 (WTF::Unicode::isLegalUTF8): Deleted.
1844 (WTF::Unicode::readUTF8Sequence): Deleted.
1845 (WTF::Unicode::convertUTF8ToUTF16): Use U8_NEXT instead of
1846 inlineUTF8SequenceLength, isLegalUTF8, and readUTF8Sequence. Use
1847 U16_APPEND instead of lots of code that does the same thing. There is
1848 room for further simplification since most callers don't need the "all ASCII"
1849 feature and could probably pass the arguments in a more natural way.
1850 (WTF::Unicode::calculateStringHashAndLengthFromUTF8MaskingTop8Bits):
1851 Use U8_NEXT instead of isLegalUTF8, readUTF8Sequence, and various
1852 error handling checks for things that are handled by U8_NEXT. Also removed
1853 support for passing nullptr for end to specify a null-terminated string.
1854 (WTF::Unicode::equalUTF16WithUTF8): Ditto.
1856 * wtf/unicode/UTF8Conversion.h: Removed UTF8SequenceLength and
1857 decodeUTF8Sequence. Changed the ConversionResult to match WebKit coding
1858 style, with an eye toward perhaps removing it in the future. Changed
1859 the convertUTF8ToUTF16 return value to a boolean and removed the "strict"
1860 argument since no caller was passing false. Changed the convertLatin1ToUTF8
1861 return value to a boolean. Tweaked comments.
1863 2019-04-30 John Wilander <wilander@apple.com>
1865 Add logging of Ad Click Attribution errors and events to a dedicated channel
1866 https://bugs.webkit.org/show_bug.cgi?id=197332
1867 <rdar://problem/49918800>
1869 Reviewed by Youenn Fablet.
1871 Added missing RELEASE_LOG_INFO and RELEASE_LOG_INFO_IF dummies
1872 for RELEASE_LOG_DISABLED.
1876 2019-04-30 Youenn Fablet <youenn@apple.com>
1878 Make Document audio producers use WeakPtr
1879 https://bugs.webkit.org/show_bug.cgi?id=197382
1881 Reviewed by Eric Carlson.
1883 * wtf/WeakHashSet.h:
1884 (WTF::WeakHashSet::hasNullReferences const):
1886 2019-04-30 Commit Queue <commit-queue@webkit.org>
1888 Unreviewed, rolling out r244773.
1889 https://bugs.webkit.org/show_bug.cgi?id=197436
1891 Causing assertion failures on debug queues (Requested by
1892 ShawnRoberts on #webkit).
1896 "Make Document audio producers use WeakPtr"
1897 https://bugs.webkit.org/show_bug.cgi?id=197382
1898 https://trac.webkit.org/changeset/244773
1900 2019-04-30 Youenn Fablet <youenn@apple.com>
1902 Make Document audio producers use WeakPtr
1903 https://bugs.webkit.org/show_bug.cgi?id=197382
1905 Reviewed by Eric Carlson.
1907 * wtf/WeakHashSet.h:
1908 (WTF::WeakHashSet::hasNullReferences const):
1910 2019-04-29 Alex Christensen <achristensen@webkit.org>
1912 <rdar://problem/50299396> Fix internal High Sierra build
1913 https://bugs.webkit.org/show_bug.cgi?id=197388
1915 * Configurations/Base.xcconfig:
1917 2019-04-29 Yusuke Suzuki <ysuzuki@apple.com>
1919 JITStubRoutineSet wastes 180KB of HashTable capacity on can.com
1920 https://bugs.webkit.org/show_bug.cgi?id=186732
1922 Reviewed by Saam Barati.
1925 (WTF::Range::contains const):
1927 2019-04-29 Basuke Suzuki <Basuke.Suzuki@sony.com>
1929 [Win] Add flag to enable version information stamping and disable by default.
1930 https://bugs.webkit.org/show_bug.cgi?id=197249
1931 <rdar://problem/50224412>
1933 Reviewed by Ross Kirsling.
1935 This feature is only used in AppleWin port. Add flag for this task and make it OFF by default.
1936 Then enable it by default on AppleWin.
1938 * wtf/CMakeLists.txt:
1940 2019-04-26 Don Olmstead <don.olmstead@sony.com>
1942 Add WTF::findIgnoringASCIICaseWithoutLength to replace strcasestr
1943 https://bugs.webkit.org/show_bug.cgi?id=197291
1945 Reviewed by Konstantin Tokarev.
1947 Adds an implementation of strcasestr within WTF.
1949 * wtf/text/StringCommon.h:
1950 (WTF::findIgnoringASCIICaseWithoutLength):
1952 2019-04-26 Sihui Liu <sihui_liu@apple.com>
1954 Stop IDB transactions to release locked database files when network process is ready to suspend
1955 https://bugs.webkit.org/show_bug.cgi?id=196372
1956 <rdar://problem/48930116>
1958 Reviewed by Brady Eidson.
1960 Provide a method to suspend the thread and block main thread until the thread is suspended.
1962 * wtf/CrossThreadTaskHandler.cpp:
1963 (WTF::CrossThreadTaskHandler::taskRunLoop):
1964 (WTF::CrossThreadTaskHandler::suspendAndWait):
1965 (WTF::CrossThreadTaskHandler::resume):
1966 * wtf/CrossThreadTaskHandler.h:
1968 2019-04-25 Fujii Hironori <Hironori.Fujii@sony.com>
1970 Unreviewed, rolling out r244669.
1972 Windows ports can't clean build.
1976 "[Win] Add flag to enable version information stamping and
1977 disable by default."
1978 https://bugs.webkit.org/show_bug.cgi?id=197249
1979 https://trac.webkit.org/changeset/244669
1981 2019-04-25 Basuke Suzuki <Basuke.Suzuki@sony.com>
1983 [Win] Add flag to enable version information stamping and disable by default.
1984 https://bugs.webkit.org/show_bug.cgi?id=197249
1986 Reviewed by Ross Kirsling.
1988 This feature is only used in AppleWin port. Add flag for this task and make it OFF by default.
1989 Then enable it by default on AppleWin.
1991 * wtf/CMakeLists.txt:
1993 2019-04-25 Timothy Hatcher <timothy@apple.com>
1995 Disable date and time inputs on iOSMac.
1996 https://bugs.webkit.org/show_bug.cgi?id=197287
1997 rdar://problem/46794376
1999 Reviewed by Wenson Hsieh.
2001 * wtf/FeatureDefines.h:
2003 2019-04-25 Alex Christensen <achristensen@webkit.org>
2005 Fix High Sierra build after r244653
2006 https://bugs.webkit.org/show_bug.cgi?id=197131
2008 * wtf/StdLibExtras.h:
2009 High Sierra thinks __cplusplus is 201406 even when using C++17.
2010 Removing the __cplusplus check resolves the build failure on High Sierra.
2011 We can clean up StdLibExtras more later.
2013 2019-04-25 Alex Christensen <achristensen@webkit.org>
2016 https://bugs.webkit.org/show_bug.cgi?id=197131
2018 Reviewed by Darin Adler.
2020 * Configurations/Base.xcconfig:
2021 * wtf/CMakeLists.txt:
2025 2019-04-25 Alex Christensen <achristensen@webkit.org>
2027 Remove DeprecatedOptional
2028 https://bugs.webkit.org/show_bug.cgi?id=197161
2030 Reviewed by Darin Adler.
2032 * WTF.xcodeproj/project.pbxproj:
2033 * wtf/CMakeLists.txt:
2034 * wtf/DeprecatedOptional.h: Removed.
2036 2019-04-24 Carlos Garcia Campos <cgarcia@igalia.com>
2038 [GTK] Hardcoded text color in input fields
2039 https://bugs.webkit.org/show_bug.cgi?id=126907
2041 Reviewed by Michael Catanzaro.
2043 Define HAVE_OS_DARK_MODE_SUPPORT for GTK port.
2047 2019-04-24 Tim Horton <timothy_horton@apple.com>
2049 Clean up WKActionSheetAssistant's use of LaunchServices
2050 https://bugs.webkit.org/show_bug.cgi?id=194645
2051 <rdar://problem/47707952>
2053 Reviewed by Andy Estes.
2057 2019-04-24 chris fleizach <cfleizach@apple.com>
2059 AX: Remove deprecated Accessibility Object Model events
2060 https://bugs.webkit.org/show_bug.cgi?id=197073
2061 <rdar://problem/50027819>
2063 Reviewed by Ryosuke Niwa.
2067 2019-04-23 Commit Queue <commit-queue@webkit.org>
2069 Unreviewed, rolling out r244558.
2070 https://bugs.webkit.org/show_bug.cgi?id=197219
2072 Causing crashes on iOS Sim Release and Debug (Requested by
2073 ShawnRoberts on #webkit).
2077 "Remove DeprecatedOptional"
2078 https://bugs.webkit.org/show_bug.cgi?id=197161
2079 https://trac.webkit.org/changeset/244558
2081 2019-04-23 Alex Christensen <achristensen@webkit.org>
2083 Remove DeprecatedOptional
2084 https://bugs.webkit.org/show_bug.cgi?id=197161
2086 Reviewed by Darin Adler.
2088 This was added in r209326 to be compatible with a shipping version of Safari.
2089 We have released several versions of Safari since then, so do what the comments say and remove it.
2090 The existence of this std::optional makes migrating to C++17 harder, and there's no reason to keep it.
2092 * WTF.xcodeproj/project.pbxproj:
2093 * wtf/CMakeLists.txt:
2094 * wtf/DeprecatedOptional.h: Removed.
2096 2019-04-21 Zan Dobersek <zdobersek@igalia.com>
2098 [WTF] Generic memoryFootprint() implementation should use bmalloc on Linux
2099 https://bugs.webkit.org/show_bug.cgi?id=196963
2101 Reviewed by Don Olmstead.
2103 Have the generic memoryFootprint() implementation use bmalloc's
2104 memoryFootprint() API on Linux, whenever the system malloc option is
2105 not enabled. Limitation to Linux platforms is due to the bmalloc
2106 implementation being limited to those configurations (excluding iOS
2107 which doesn't use MemoryFootprintGeneric.cpp).
2109 * wtf/PlatformWPE.cmake: Switch to building MemoryFootprintGeneric.cpp.
2110 * wtf/generic/MemoryFootprintGeneric.cpp:
2111 (WTF::memoryFootprint):
2113 2019-04-19 Ryosuke Niwa <rniwa@webkit.org>
2115 HashTable::removeIf always shrinks the hash table by half even if there is nothing left
2116 https://bugs.webkit.org/show_bug.cgi?id=196681
2117 <rdar://problem/49917764>
2119 Reviewed by Darin Adler.
2121 Address Darin's comments by removing the explicit type from std::max.
2124 (WTF::KeyTraits>::computeBestTableSize):
2125 (WTF::KeyTraits>::shrinkToBestSize):
2127 2019-04-18 Chris Dumez <cdumez@apple.com>
2129 [iOS] Improve detection of when web views go to background / foreground
2130 https://bugs.webkit.org/show_bug.cgi?id=197035
2131 <rdar://problem/45281182>
2133 Reviewed by Tim Horton.
2135 Add build time flag.
2137 * wtf/FeatureDefines.h:
2139 2019-04-18 Jer Noble <jer.noble@apple.com>
2141 Add support for parsing FairPlayStreaming PSSH boxes.
2142 https://bugs.webkit.org/show_bug.cgi?id=197064
2144 Reviewed by Eric Carlson.
2148 2019-04-18 Yusuke Suzuki <ysuzuki@apple.com>
2150 [WTF] StringBuilder should set correct m_is8Bit flag when merging
2151 https://bugs.webkit.org/show_bug.cgi?id=197053
2153 Reviewed by Saam Barati.
2155 When appending StringBuilder to the other StringBuilder, we have a path that does not set m_is8Bit flag correctly.
2156 This patch correctly sets this flag. And we also change 0 to nullptr when we are using 0 as a pointer.
2158 * wtf/text/StringBuilder.cpp:
2159 (WTF::StringBuilder::reserveCapacity):
2160 (WTF::StringBuilder::appendUninitializedSlow):
2161 (WTF::StringBuilder::append):
2162 * wtf/text/StringBuilder.h:
2163 (WTF::StringBuilder::append):
2164 (WTF::StringBuilder::characters8 const):
2165 (WTF::StringBuilder::characters16 const):
2166 (WTF::StringBuilder::clear):
2168 2019-04-17 Tim Horton <timothy_horton@apple.com>
2170 Adopt different scroll view flashing SPI
2171 https://bugs.webkit.org/show_bug.cgi?id=197043
2172 <rdar://problem/49996476>
2174 Reviewed by Wenson Hsieh.
2178 2019-04-17 Jer Noble <jer.noble@apple.com>
2180 Enable HAVE_AVFOUNDATION_VIDEO_OUTPUT on PLATFORM(IOSMAC)
2181 https://bugs.webkit.org/show_bug.cgi?id=196994
2182 <rdar://problem/44158331>
2184 Reviewed by Alex Christensen.
2188 2019-04-16 Stephan Szabo <stephan.szabo@sony.com>
2190 [PlayStation] Update port for system library changes
2191 https://bugs.webkit.org/show_bug.cgi?id=196978
2193 Reviewed by Ross Kirsling.
2195 * wtf/PlatformPlayStation.cmake:
2196 Remove reference to deleted system library
2198 2019-04-16 Jer Noble <jer.noble@apple.com>
2200 Enable HAVE_AVKIT on PLATFORM(IOSMAC)
2201 https://bugs.webkit.org/show_bug.cgi?id=196987
2203 Reviewed by Tim Horton.
2207 2019-04-16 Robin Morisset <rmorisset@apple.com>
2209 [WTF] holdLock should be marked WARN_UNUSED_RETURN
2210 https://bugs.webkit.org/show_bug.cgi?id=196922
2212 Reviewed by Keith Miller.
2216 2019-04-16 Don Olmstead <don.olmstead@sony.com>
2218 [CMake] Set WTF_SCRIPTS_DIR
2219 https://bugs.webkit.org/show_bug.cgi?id=196917
2221 Reviewed by Konstantin Tokarev.
2223 Use WTF_SCRIPTS_DIR for copying the unified sources script.
2225 * wtf/CMakeLists.txt:
2227 2019-04-15 Myles C. Maxfield <mmaxfield@apple.com>
2229 [Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
2230 https://bugs.webkit.org/show_bug.cgi?id=196846
2231 <rdar://problem/49499971>
2233 Reviewed by Simon Fraser and Darin Adler.
2239 2019-04-12 Ryosuke Niwa <rniwa@webkit.org>
2241 HashTable::removeIf always shrinks the hash table by half even if there is nothing left
2242 https://bugs.webkit.org/show_bug.cgi?id=196681
2244 Reviewed by Darin Adler.
2246 Made HashTable::removeIf shrink to the "best size", which is the least power of two bigger
2247 than twice the key count as already used in the copy constructor.
2250 (WTF::HashTable::computeBestTableSize): Extracted from the copy constructor.
2251 (WTF::HashTable::shrinkToBestSize): Added.
2252 (WTF::HashTable::removeIf): Use shrinkToBestSize instead of shrink.
2253 (WTF::HashTable::HashTable):
2255 2019-04-12 Eric Carlson <eric.carlson@apple.com>
2257 Update AudioSession route sharing policy
2258 https://bugs.webkit.org/show_bug.cgi?id=196776
2259 <rdar://problem/46501611>
2261 Reviewed by Jer Noble.
2263 * wtf/Platform.h: Define HAVE_ROUTE_SHARING_POLICY_LONG_FORM_VIDEO.
2265 2019-04-10 Said Abou-Hallawa <sabouhallawa@apple.com>
2267 requestAnimationFrame should execute before the next frame
2268 https://bugs.webkit.org/show_bug.cgi?id=177484
2270 Reviewed by Simon Fraser.
2272 Add trace points for the page RenderingUpdate.
2274 * wtf/SystemTracing.h:
2276 2019-04-10 Claudio Saavedra <csaavedra@igalia.com>
2278 Do not generate empty unified sources when unified builds are disabled
2279 https://bugs.webkit.org/show_bug.cgi?id=196767
2281 Reviewed by Konstantin Tokarev.
2283 If unified builds are disabled, the ruby script to generate them
2284 is still used to list the sources that need to be
2285 compiled. Currently, the script always generates bundled unified
2286 sources, even if it's being used just to list all the sources. So
2287 when the unified builds are disabled and no files are going to be
2288 bundled, the script generates one empty file per bundle manager
2289 (that is, one C++ and one ObjectiveC), that gets added to the
2290 sources to be compiled.
2292 * Scripts/generate-unified-source-bundles.rb: Only go through the
2293 bundle managers file generation when not running in
2294 PrintAllSources mode, to avoid generating empty bundle files.
2296 2019-04-10 Enrique Ocaña González <eocanha@igalia.com>
2298 [WPE] Avoid async IO starving timers
2299 https://bugs.webkit.org/show_bug.cgi?id=196733
2301 Reviewed by Carlos Garcia Campos.
2303 If AsyncIONetwork and DiskCacheRead priorities are higher than
2304 MainThreadSharedTimer the timers get starved. This causes the NetworkProcess
2305 to accumulate MB of data instead of handing it down to the WebProcess (done
2306 using a Timer). This eventually causes an Out Of Memory kill on the
2307 NetworkProcess on some embedded platforms with low memory limits.
2309 This patch levels the three priorities to the same value, while still leaving
2310 DiskCacheWrite with less priority than DiskCacheRead.
2312 * wtf/glib/RunLoopSourcePriority.h: Changed RunLoopSourcePriority values for WPE.
2314 2019-04-09 Don Olmstead <don.olmstead@sony.com>
2316 [CMake] WTF derived sources should only be referenced inside WTF
2317 https://bugs.webkit.org/show_bug.cgi?id=196706
2319 Reviewed by Konstantin Tokarev.
2321 Use ${WTF_DERIVED_SOURCES_DIR} instead of ${DERIVED_SOURCES_DIR} within WTF.
2323 * wtf/CMakeLists.txt:
2324 * wtf/PlatformJSCOnly.cmake:
2325 * wtf/PlatformMac.cmake:
2327 2019-04-09 Don Olmstead <don.olmstead@sony.com>
2329 [CMake] Apple builds should use ICU_INCLUDE_DIRS
2330 https://bugs.webkit.org/show_bug.cgi?id=196720
2332 Reviewed by Konstantin Tokarev.
2334 Copy ICU headers for Apple builds into ICU_INCLUDE_DIRS.
2337 * wtf/PlatformMac.cmake:
2339 2019-04-08 Don Olmstead <don.olmstead@sony.com>
2341 [CMake][WinCairo] Separate copied headers into different directories
2342 https://bugs.webkit.org/show_bug.cgi?id=196655
2344 Reviewed by Michael Catanzaro.
2346 * wtf/CMakeLists.txt:
2348 2019-04-08 Guillaume Emont <guijemont@igalia.com>
2351 https://bugs.webkit.org/show_bug.cgi?id=196689
2353 Reviewed by Žan Doberšek.
2355 Since the bytecode change, we enabled the baseline JIT on mips in
2356 r240432, but DFG is still missing. With this change, all tests are
2357 passing on a ci20 board.
2359 * wtf/Platform.h: Enable DFG on MIPS by default.
2361 2019-04-06 Ryosuke Niwa <rniwa@webkit.org>
2363 Added tests for WeakHashSet::computesEmpty and WeakHashSet::computeSize
2364 https://bugs.webkit.org/show_bug.cgi?id=196669
2366 Reviewed by Geoffrey Garen.
2368 Removed the superflous type names from forward declarations, and made WeakHashSet::add
2369 take a const object to match other container types in WTF.
2371 * wtf/WeakHashSet.h:
2372 (WTF::WeakHashSet::add):
2375 2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
2377 Make WeakPtr<Element> possible and deploy it in form associated elements code
2378 https://bugs.webkit.org/show_bug.cgi?id=196626
2380 Reviewed by Antti Koivisto.
2382 Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
2383 a subclass type U of a type T used to define WeakReference<T>.
2385 Also added computesEmpty, which is slightly more efficient than computeSize
2386 when m_set is either empty or when there are non-released weak references in the set.
2388 * wtf/WeakHashSet.h:
2389 (WTF::WeakHashSet::remove):
2390 (WTF::WeakHashSet::contains const):
2391 (WTF::WeakHashSet::computesEmpty const): Added.
2392 * wtf/WeakPtr.h: Added an explicit forward declaration of WeakHashSet to avoid
2393 build failures in GTK+ and WPE ports.
2395 2019-04-05 Eric Carlson <eric.carlson@apple.com>
2397 Remove AUDIO_TOOLBOX_AUDIO_SESSION
2398 https://bugs.webkit.org/show_bug.cgi?id=196653
2399 <rdar://problem/49652098>
2401 Reviewed by Jer Noble.
2405 2019-04-05 Michael Catanzaro <mcatanzaro@igalia.com>
2407 Unreviewed manual rollout of r243929
2408 https://bugs.webkit.org/show_bug.cgi?id=196626
2410 * wtf/WeakHashSet.h:
2411 (WTF::WeakHashSet::remove):
2412 (WTF::WeakHashSet::contains const):
2413 (WTF::WeakHashSet::computesEmpty const): Deleted.
2415 2019-04-05 Commit Queue <commit-queue@webkit.org>
2417 Unreviewed, rolling out r243833.
2418 https://bugs.webkit.org/show_bug.cgi?id=196645
2420 This change breaks build of WPE and GTK ports (Requested by
2421 annulen on #webkit).
2425 "[CMake][WTF] Mirror XCode header directories"
2426 https://bugs.webkit.org/show_bug.cgi?id=191662
2427 https://trac.webkit.org/changeset/243833
2429 2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
2431 Make WeakPtr<Element> possible and deploy it in form associated elements code
2432 https://bugs.webkit.org/show_bug.cgi?id=196626
2434 Reviewed by Antti Koivisto.
2436 Make it possible to call WeakHashSet::remove and WeakHashSet::contains with
2437 a subclass type U of a type T used to define WeakReference<T>.
2439 Also added computesEmpty, which is slightly more efficient than computeSize
2440 when m_set is either empty or when there are non-released weak references in the set.
2442 * wtf/WeakHashSet.h:
2443 (WTF::WeakHashSet::remove):
2444 (WTF::WeakHashSet::contains const):
2445 (WTF::WeakHashSet::computesEmpty const): Added.
2447 2019-04-04 Yusuke Suzuki <ysuzuki@apple.com>
2449 [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
2450 https://bugs.webkit.org/show_bug.cgi?id=196475
2452 Reviewed by Saam Barati.
2454 * wtf/ForbidHeapAllocation.h:
2456 * wtf/IsoMallocInlines.h:
2458 2019-04-03 Don Olmstead <don.olmstead@sony.com>
2460 [CMake][WTF] Mirror XCode header directories
2461 https://bugs.webkit.org/show_bug.cgi?id=191662
2463 Reviewed by Konstantin Tokarev.
2465 Rename WTF forwarding header target to WTFFramework and update the install location
2466 to WTF_FRAMEWORK_HEADERS_DIR.
2468 * wtf/CMakeLists.txt:
2470 2019-04-03 Joseph Pecoraro <pecoraro@apple.com>
2472 Web Inspector: Remote Inspector indicate callback should always happen on the main thread
2473 https://bugs.webkit.org/show_bug.cgi?id=196513
2474 <rdar://problem/49498284>
2476 Reviewed by Devin Rousso.
2479 * wtf/cocoa/MainThreadCocoa.mm:
2480 (WTF::dispatchAsyncOnMainThreadWithWebThreadLockIfNeeded):
2481 * wtf/ios/WebCoreThread.cpp:
2482 * wtf/ios/WebCoreThread.h:
2484 2019-04-02 Keith Rollin <krollin@apple.com>
2486 Inhibit CFNetwork logging in private sessions
2487 https://bugs.webkit.org/show_bug.cgi?id=196268
2488 <rdar://problem/48210793>
2490 Fix a conditional in Platform.h where IOS should have been used
2491 instead of IOS_FAMILY. The latter happened to work, but we really want
2492 to be using the proper symbol here.
2494 Reviewed by Alexey Proskuryakov.
2498 2019-04-01 Michael Catanzaro <mcatanzaro@igalia.com>
2500 Stop trying to support building JSC with clang 3.8
2501 https://bugs.webkit.org/show_bug.cgi?id=195947
2502 <rdar://problem/49069219>
2504 Reviewed by Darin Adler.
2506 It seems WebKit hasn't built with clang 3.8 in a while, no devs are using this compiler, we
2507 don't know how much effort it would be to make JSC work again, and it's making the code
2508 worse. Remove my hacks to support clang 3.8 from WTF.
2510 * wtf/MetaAllocator.cpp:
2511 (WTF::MetaAllocator::allocate):
2512 * wtf/text/StringConcatenate.h:
2513 (WTF::tryMakeStringFromAdapters):
2515 2019-03-31 Yusuke Suzuki <ysuzuki@apple.com>
2517 [JSC] Butterfly allocation from LargeAllocation should try "realloc" behavior if collector thread is not active
2518 https://bugs.webkit.org/show_bug.cgi?id=196160
2520 Reviewed by Saam Barati.
2523 (WTF::FastMalloc::tryRealloc):
2525 (Gigacage::tryRealloc):
2528 2019-03-31 Andy Estes <aestes@apple.com>
2530 [iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
2531 https://bugs.webkit.org/show_bug.cgi?id=196433
2532 <rdar://problem/49293305>
2534 Reviewed by Tim Horton.
2536 * wtf/NeverDestroyed.h:
2537 (WTF::NeverDestroyed::operator->):
2538 (WTF::NeverDestroyed::operator-> const):
2540 2019-03-28 Fujii Hironori <Hironori.Fujii@sony.com>
2542 Unreviewed build fix.
2544 * wtf/CMakeLists.txt: Added SpanningTree.h to WTF_PUBLIC_HEADERS.
2546 2019-03-28 Saam Barati <sbarati@apple.com>
2548 BackwardsGraph needs to consider back edges as the backward's root successor
2549 https://bugs.webkit.org/show_bug.cgi?id=195991
2551 Reviewed by Filip Pizlo.
2553 Previously, our backwards graph analysis was slightly wrong. The idea of
2554 backwards graph is that the root of the graph has edges to terminals in
2555 the original graph. And then the original directed edges in the graph are flipped.
2557 However, we weren't considering loops as a form of terminality. For example,
2558 we wouldn't consider an infinite loop as a terminal. So there were no edges
2559 from the root to a node in the infinite loop. This lead us to make mistakes
2560 when we used backwards dominators to compute control flow equivalence.
2562 This is better understood in an example:
2576 In the previous version of this algorithm, the only edge from the backwards
2577 root would be to the block containing the return. This would lead us to
2578 believe that the loading of the structureID backwards dominates the preheader,
2579 leading us to believe it's control flow equivalent to preheader. This is
2580 obviously wrong, since we can loop forever if "v" isn't a cell.
2582 The solution here is to treat any backedge in the graph as a "terminal" node.
2583 Since a backedge implies the existence of a loop.
2585 In the above example, the backwards root now has an edge to both blocks with
2586 "continue". This prevents us from falsely claiming that the return is control
2587 flow equivalent with the preheader.
2589 This patch uses DFS spanning trees to compute back edges. An edge
2590 u->v is a back edge when u is a descendent of v in the DFS spanning
2593 * WTF.xcodeproj/project.pbxproj:
2594 * wtf/BackwardsGraph.h:
2595 (WTF::BackwardsGraph::BackwardsGraph):
2596 * wtf/SpanningTree.h: Added.
2597 (SpanningTree::SpanningTree):
2598 (SpanningTree::isDescendent):
2600 2019-03-28 Tim Horton <timothy_horton@apple.com>
2605 It is no longer necessary to exclude this from PLATFORM(IOSMAC).
2607 2019-03-27 Per Arne Vollan <pvollan@apple.com>
2609 Layout Test js/math-clz32.html is failing
2610 https://bugs.webkit.org/show_bug.cgi?id=196209
2612 Reviewed by Ross Kirsling.
2614 Use the correct number of loop iterations when counting leading zeros. Also, the
2615 count was off by one for the Win64 case.
2620 2019-03-26 Keith Rollin <krollin@apple.com>
2622 Inhibit CFNetwork logging in private sessions
2623 https://bugs.webkit.org/show_bug.cgi?id=196268
2624 <rdar://problem/48210793>
2626 Reviewed by Alex Christensen.
2628 Before performing any logging, the NetworkProcess checks to see if
2629 it's performing an operation associated with a private (ephemeral)
2630 browsing session. If so, it skips the logging. However, networking
2631 layers below the NetworkProcess don't know about private browsing, so
2632 they would still perform their own logging. CFNetwork now has a flag
2633 that lets us control that, so set it to False if private browsing.
2637 2019-03-25 Alex Christensen <achristensen@webkit.org>
2639 Expected shouldn't assume its contained types are copyable
2640 https://bugs.webkit.org/show_bug.cgi?id=195986
2642 Reviewed by JF Bastien.
2645 (std::experimental::fundamentals_v3::__expected_detail::constexpr_base::constexpr_base):
2646 (std::experimental::fundamentals_v3::operator==):
2647 (std::experimental::fundamentals_v3::operator!=):
2649 (std::experimental::fundamentals_v3::unexpected::unexpected):
2651 2019-03-24 Keith Miller <keith_miller@apple.com>
2653 Unreviewed, forgot to refactor variable name for windows build in
2660 2019-03-24 Andy Estes <aestes@apple.com>
2662 [watchOS] Remove unused Proximity Networking code
2663 https://bugs.webkit.org/show_bug.cgi?id=196188
2665 Reviewed by Tim Horton.
2667 * wtf/FeatureDefines.h:
2669 2019-03-23 Keith Miller <keith_miller@apple.com>
2671 Refactor clz/ctz and fix getLSBSet.
2672 https://bugs.webkit.org/show_bug.cgi?id=196162
2674 Reviewed by Saam Barati.
2676 This patch makes clz32/64 and ctz32 generic so they work on any
2677 numeric type. Since these methods work on any type we don't need
2678 to have a separate implementation of getLSBSet, which also
2679 happened to be getMSBSet. This patch also adds getMSBSet as there
2680 may be users who want that in the future.
2687 (getLSBSet): Deleted.
2688 (WTF::clz32): Deleted.
2689 (WTF::clz64): Deleted.
2690 (WTF::ctz32): Deleted.
2692 2019-03-22 Keith Rollin <krollin@apple.com>
2694 Enable ThinLTO support in Production builds
2695 https://bugs.webkit.org/show_bug.cgi?id=190758
2696 <rdar://problem/45413233>
2698 Reviewed by Daniel Bates.
2700 Enable building with Thin LTO in Production when using Xcode 10.2 or
2701 later. This change results in a 1.45% progression in PLT5. Full
2702 Production build times increase about 2-3%. Incremental build times
2703 are more severely affected, and so LTO is not enabled for local
2706 LTO is enabled only on macOS for now, until rdar://problem/49013399,
2707 which affects ARM builds, is fixed.
2709 To change the LTO setting when building locally:
2711 - If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
2713 - If building with `build-webkit`, specify --lto-mode={none,thin,full}
2714 on the command line.
2715 - If building with `build-root`, specify --lto={none,thin,full} on the
2717 - If building with Xcode, create a LocalOverrides.xcconfig file at the
2718 top level of your repository directory (if needed) and define
2719 WK_LTO_MODE to full, thin, or none.
2721 * Configurations/Base.xcconfig:
2723 2019-03-22 Tim Horton <timothy_horton@apple.com>
2725 Fix the build after r243354
2729 2019-03-22 Tim Horton <timothy_horton@apple.com>
2731 Fix the build after r243354
2732 https://bugs.webkit.org/show_bug.cgi?id=196138
2733 <rdar://problem/49145951>
2737 2019-03-21 Eric Carlson <eric.carlson@apple.com>
2739 Add UI process WebRTC runtime logging.
2740 https://bugs.webkit.org/show_bug.cgi?id=196020
2741 <rdar://problem/49071443>
2743 Reviewed by Youenn Fablet.
2746 (WTF::LogArgument::toString): Add long long and unsigned long long variants.
2748 2019-03-20 Simon Fraser <simon.fraser@apple.com>
2750 Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
2751 https://bugs.webkit.org/show_bug.cgi?id=196049
2753 Reviewed by Tim Horton.
2755 This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
2756 overflow scrolling in general, so rename it.
2758 * wtf/FeatureDefines.h:
2760 2019-03-20 Mark Lam <mark.lam@apple.com>
2762 Open source arm64e code.
2763 https://bugs.webkit.org/show_bug.cgi?id=196012
2764 <rdar://problem/49066237>
2766 Reviewed by Keith Miller.
2768 * WTF.xcodeproj/project.pbxproj:
2771 * wtf/PlatformRegisters.cpp: Added.
2772 (WTF::threadStateLRInternal):
2773 (WTF::threadStatePCInternal):
2774 * wtf/PlatformRegisters.h:
2775 * wtf/PointerPreparations.h:
2776 * wtf/PtrTag.cpp: Added.
2779 (WTF::registerPtrTagLookup):
2780 (WTF::reportBadTag):
2782 (WTF::removeCodePtrTag):
2783 (WTF::tagCodePtrImpl):
2785 (WTF::untagCodePtrImplHelper):
2786 (WTF::untagCodePtrImpl):
2787 (WTF::untagCodePtr):
2788 (WTF::retagCodePtrImplHelper):
2789 (WTF::retagCodePtrImpl):
2790 (WTF::retagCodePtr):
2791 (WTF::tagCFunctionPtrImpl):
2792 (WTF::tagCFunctionPtr):
2793 (WTF::untagCFunctionPtrImpl):
2794 (WTF::untagCFunctionPtr):
2796 (WTF::assertIsCFunctionPtr):
2797 (WTF::assertIsNullOrCFunctionPtr):
2798 (WTF::assertIsNotTagged):
2799 (WTF::assertIsTagged):
2800 (WTF::assertIsNullOrTagged):
2801 (WTF::isTaggedWith):
2802 (WTF::assertIsTaggedWith):
2803 (WTF::assertIsNullOrTaggedWith):
2804 (WTF::usesPointerTagging):
2805 (WTF::registerPtrTagLookup):
2806 (WTF::reportBadTag):
2807 (WTF::tagForPtr): Deleted.
2809 2019-03-20 Keith Rollin <krollin@apple.com>
2811 Update checks that determine if WebKit is system WebKit
2812 https://bugs.webkit.org/show_bug.cgi?id=195756
2814 Reviewed by Alexey Proskuryakov.
2816 The system WebKit can be installed in additional locations, so check
2817 for and allow those, too.
2821 2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
2823 Unreviewed, further attempt to fix clang 3.8 build
2824 https://bugs.webkit.org/show_bug.cgi?id=195947
2826 * wtf/MetaAllocator.cpp:
2827 (WTF::MetaAllocator::allocate):
2829 2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
2831 REGRESSION(r243115) breaks build for clang 3.8
2832 https://bugs.webkit.org/show_bug.cgi?id=195947
2834 Reviewed by Chris Dumez.
2836 * wtf/text/StringConcatenate.h:
2837 (WTF::tryMakeStringFromAdapters):
2839 2019-03-20 Tim Horton <timothy_horton@apple.com>
2841 Add an platform-driven spell-checking mechanism
2842 https://bugs.webkit.org/show_bug.cgi?id=195795
2844 Reviewed by Ryosuke Niwa.
2849 2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
2851 Build cleanly with GCC 9
2852 https://bugs.webkit.org/show_bug.cgi?id=195920
2854 Reviewed by Chris Dumez.
2856 WebKit triggers three new GCC 9 warnings:
2859 -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
2860 declared copy constructor and assignment operator if one of them is user-provided.
2863 Solution is to either add a copy constructor or copy assignment operator, if required, or
2864 else remove one if it is redundant.
2867 -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
2868 -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
2871 These account for most of this patch. Solution is to just remove the bad WTFMove().
2873 Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
2874 These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
2875 would be safer to not use memcpy on nontrivial types, but that's too complex for this
2876 patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
2878 * wtf/CheckedArithmetic.h:
2879 (WTF::Checked::Checked):
2880 * wtf/MetaAllocator.cpp:
2881 (WTF::MetaAllocator::allocate):
2882 * wtf/URLParser.cpp:
2883 (WTF::CodePointIterator::operator!= const):
2884 (WTF::CodePointIterator::operator=): Deleted.
2885 * wtf/text/StringView.h:
2886 (WTF::StringView::CodePoints::Iterator::operator=): Deleted.
2888 2019-03-19 Alex Christensen <achristensen@webkit.org>
2890 Make WTFLogChannelState and WTFLogLevel enum classes
2891 https://bugs.webkit.org/show_bug.cgi?id=195904
2893 Reviewed by Eric Carlson.
2895 * wtf/Assertions.cpp:
2898 (WTF::Logger::logAlways const):
2899 (WTF::Logger::error const):
2900 (WTF::Logger::warning const):
2901 (WTF::Logger::info const):
2902 (WTF::Logger::debug const):
2903 (WTF::Logger::willLog const):
2905 * wtf/MemoryPressureHandler.cpp:
2906 * wtf/RefCountedLeakCounter.cpp:
2908 2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
2910 Unreviewed, rolling out r243132.
2916 "Make WTFLogChannelState and WTFLogLevel enum classes"
2917 https://bugs.webkit.org/show_bug.cgi?id=195904
2918 https://trac.webkit.org/changeset/243132
2920 2019-03-18 Alex Christensen <achristensen@webkit.org>
2922 Make WTFLogChannelState and WTFLogLevel enum classes
2923 https://bugs.webkit.org/show_bug.cgi?id=195904
2925 Reviewed by Eric Carlson.
2927 * wtf/Assertions.cpp:
2930 (WTF::Logger::logAlways const):
2931 (WTF::Logger::error const):
2932 (WTF::Logger::warning const):
2933 (WTF::Logger::info const):
2934 (WTF::Logger::debug const):
2935 (WTF::Logger::willLog const):
2937 * wtf/MemoryPressureHandler.cpp:
2938 * wtf/RefCountedLeakCounter.cpp:
2940 2019-03-18 Darin Adler <darin@apple.com>
2942 Cut down on use of StringBuffer, possibly leading toward removing it entirely
2943 https://bugs.webkit.org/show_bug.cgi?id=195870
2945 Reviewed by Daniel Bates.
2947 * wtf/URL.cpp: Remove a now-inaccurate comment mentioning StringBuffer.
2949 * wtf/text/StringView.cpp:
2950 (WTF::convertASCIICase): Use createUninitialized instead of StringBuffer.
2952 2019-03-18 Xan Lopez <xan@igalia.com>
2954 [WTF] Remove redundant std::move in StringConcatenate
2955 https://bugs.webkit.org/show_bug.cgi?id=195798
2957 Reviewed by Darin Adler.
2959 Remove redundant calls to WTFMove in return values for this
2960 method. C++ will already do an implicit move here since we are
2961 returning a local value where copy/move elision is not applicable.
2963 * wtf/text/StringConcatenate.h:
2964 (WTF::tryMakeStringFromAdapters):
2966 2019-03-16 Darin Adler <darin@apple.com>
2968 Improve normalization code, including moving from unorm.h to unorm2.h
2969 https://bugs.webkit.org/show_bug.cgi?id=195330
2971 Reviewed by Michael Catanzaro.
2973 * wtf/URLHelpers.cpp: Removed unneeded include of unorm.h since the
2974 normalization code is now in StringView.cpp.
2975 (WTF::URLHelpers::escapeUnsafeCharacters): Renamed from
2976 createStringWithEscapedUnsafeCharacters since it now only creates
2977 a new string if one is needed. Use unsigned for string lengths, since
2978 that's what WTF::String uses, not size_t. Added a first loop so that
2979 we can return the string unmodified if no lookalike characters are
2980 found. Removed unnecessary round trip from UTF-16 and then back in
2981 the case where the character is not a lookalike.
2982 (WTF::URLHelpers::toNormalizationFormC): Deleted. Moved this logic
2983 into the WTF::normalizedNFC function in StringView.cpp.
2984 (WTF::URLHelpers::userVisibleURL): Call escapeUnsafeCharacters and
2985 normalizedNFC. The normalizedNFC function is better in multiple ways,
2986 but primarily it handles 8-bit strings and other already-normalized
2987 strings much more efficiently.
2989 * wtf/text/StringView.cpp:
2990 (WTF::normalizedNFC): Added. This has two overloads. One is for when
2991 we already have a String, and want to re-use it if no normalization
2992 is needed, and another is when we only have a StringView, and may need
2993 to allocate a String to hold the result. Includes a fast special case
2994 for 8-bit and already-normalized strings, and uses the same strategy
2995 that JSC::normalize was already using: calls unorm2_normalize twice,
2996 first just to determine the length.
2998 * wtf/text/StringView.h: Added normalizedNFC, which can be called with
2999 either a StringView or a String. Also moved StringViewWithUnderlyingString
3000 here from JSString.h, here for use as the return value of normalizedNFC;
3001 it is used for a similar purpose in the JavaScriptCore rope implementation.
3002 Also removed an inaccurate comment.
3004 2019-03-16 Diego Pino Garcia <dpino@igalia.com>
3006 [GTK] [WPE] Fix compilation errors due to undefined ALWAYS_LOG_IF
3007 https://bugs.webkit.org/show_bug.cgi?id=195850
3009 Unreviewed build fix after r243033.
3011 * wtf/LoggerHelper.h:
3013 2019-03-15 Per Arne Vollan <pvollan@apple.com>
3015 [iOS] Block the accessibility server when accessibility is not enabled.
3016 https://bugs.webkit.org/show_bug.cgi?id=195342
3018 Reviewed by Brent Fulgham.
3020 Add SPI to issue a mach extension to a process by pid. Also, add a macro for
3021 the availability of this SPI.
3024 * wtf/spi/darwin/SandboxSPI.h:
3026 2019-03-15 Eric Carlson <eric.carlson@apple.com>
3028 Add media stream release logging
3029 https://bugs.webkit.org/show_bug.cgi?id=195823
3031 Reviewed by Youenn Fablet.
3033 * wtf/LoggerHelper.h: Add LOG_IF variants that check a condition before logging.
3035 2019-03-15 Truitt Savell <tsavell@apple.com>
3037 Unreviewed, rolling out r243008.
3039 This revision broke High Sierra builders
3043 "[iOS] Block the accessibility server when accessibility is
3045 https://bugs.webkit.org/show_bug.cgi?id=195342
3046 https://trac.webkit.org/changeset/243008
3048 2019-03-15 Per Arne Vollan <pvollan@apple.com>
3050 [iOS] Block the accessibility server when accessibility is not enabled.
3051 https://bugs.webkit.org/show_bug.cgi?id=195342
3053 Reviewed by Brent Fulgham.
3055 Add SPI to issue a mach extension to a process by pid.
3057 * wtf/spi/darwin/SandboxSPI.h:
3059 2019-03-13 Sam Weinig <sam@webkit.org>
3061 Add utility function to allow easy reverse range-based iteration of a container
3062 https://bugs.webkit.org/show_bug.cgi?id=195542
3064 Reviewed by Antti Koivisto.
3066 Add functions to create an IteratorRange<T> that will iterate a container backwards. It
3067 works with any container that is compatible with std::rbegin() and std::rend(). It is
3068 expected to be used in conjunction with range-based for-loops like so:
3070 for (auto& value : WTF::makeReversedRange(myContainer))
3073 * wtf/IteratorRange.h:
3074 (WTF::makeReversedRange):
3076 2019-03-13 Keith Rollin <krollin@apple.com>
3078 Add support for new StagedFrameworks layout
3079 https://bugs.webkit.org/show_bug.cgi?id=195543
3081 Reviewed by Alexey Proskuryakov.
3083 Opportunistic cleanup: remove unused JAVASCRIPTCORE_FRAMEWORKS_DIR
3086 * Configurations/Base.xcconfig:
3088 2019-03-13 Dominik Infuehr <dinfuehr@igalia.com>
3090 String overflow when using StringBuilder in JSC::createError
3091 https://bugs.webkit.org/show_bug.cgi?id=194957
3093 Reviewed by Mark Lam.
3095 When calculating the new capacity of a StringBuilder object,
3096 use a limit of MaxLength instead of MaxLength+1. Allocating
3097 a string of size MaxLength+1 always fails. This means that expanding
3098 a StringBuilder only worked when the newly doubled capacity is less or
3101 * wtf/text/StringBuilder.cpp:
3103 2019-03-13 Chris Dumez <cdumez@apple.com>
3105 Better build fix after r242901.
3107 Reviewed by Jer Noble.
3110 (WTF::LogArgument::toString):
3112 2019-03-13 Jer Noble <jer.noble@apple.com>
3114 Add AggregateLogger, a Logger specialization for singleton classes.
3115 https://bugs.webkit.org/show_bug.cgi?id=195644
3117 Reviewed by Eric Carlson.
3119 Add a new class, AggregateLogger, which will log messages to each of its aggregated loggers.
3121 Drive-by fixes: allow "const void*" to be directly logged by converting the pointer to a hex string.
3123 * WTF.xcodeproj/project.pbxproj:
3124 * wtf/AggregateLogger.h: Added.
3125 (WTF::AggregateLogger::create):
3126 (WTF::AggregateLogger::addLogger):
3127 (WTF::AggregateLogger::removeLogger):
3128 (WTF::AggregateLogger::logAlways const):
3129 (WTF::AggregateLogger::error const):
3130 (WTF::AggregateLogger::warning const):
3131 (WTF::AggregateLogger::info const):
3132 (WTF::AggregateLogger::debug const):
3133 (WTF::AggregateLogger::willLog const):
3134 (WTF::AggregateLogger::AggregateLogger):
3135 (WTF::AggregateLogger::log const):
3141 2019-03-12 Commit Queue <commit-queue@webkit.org>
3143 Unreviewed, rolling out r242747.
3144 https://bugs.webkit.org/show_bug.cgi?id=195641
3146 Performance measurement is difficult in this period, rolling
3147 out it and rolling in later to isolate it from the other
3148 sensitive patches (Requested by yusukesuzuki on #webkit).
3152 "[JSC] Make StaticStringImpl & StaticSymbolImpl actually
3154 https://bugs.webkit.org/show_bug.cgi?id=194212
3155 https://trac.webkit.org/changeset/242747
3157 2019-03-12 Robin Morisset <rmorisset@apple.com>
3159 A lot more classes have padding that can be reduced by reordering their fields
3160 https://bugs.webkit.org/show_bug.cgi?id=195579
3162 Reviewed by Mark Lam.
3164 * wtf/CrossThreadQueue.h:
3166 * wtf/MemoryPressureHandler.h:
3167 * wtf/MetaAllocator.h:
3168 * wtf/Threading.cpp:
3170 2019-03-11 Alex Christensen <achristensen@webkit.org>
3172 WTF::Expected should use std::addressof instead of operator&
3173 https://bugs.webkit.org/show_bug.cgi?id=195604
3175 Reviewed by Myles Maxfield.
3177 The latter was causing problems with types that do tricky things with constructors and operator&,
3178 specifically UniqueRef but I made a reduced test case. When it used operator&, it would get the contained
3179 type and call the constructor that takes a contained type instead of the move constructor.
3182 (std::experimental::fundamentals_v3::__expected_detail::base::base):
3183 (std::experimental::fundamentals_v3::expected::swap):
3185 2019-03-11 Ross Kirsling <ross.kirsling@sony.com>
3187 Add Optional to Forward.h.
3188 https://bugs.webkit.org/show_bug.cgi?id=195586
3190 Reviewed by Darin Adler.
3193 Add forward declaration for Optional.
3198 * wtf/MemoryFootprint.h:
3199 * wtf/URLHelpers.cpp:
3201 * wtf/cocoa/CPUTimeCocoa.cpp:
3202 * wtf/fuchsia/CPUTimeFuchsia.cpp:
3203 * wtf/unix/CPUTimeUnix.cpp:
3204 * wtf/win/CPUTimeWin.cpp:
3205 Remove unnecessary includes from headers.
3207 2019-03-11 Andy Estes <aestes@apple.com>
3209 [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
3210 https://bugs.webkit.org/show_bug.cgi?id=195530
3211 <rdar://problem/48747164>
3213 Reviewed by Alex Christensen.
3215 * wtf/FeatureDefines.h: Defined ENABLE_APPLE_PAY_REMOTE_UI.
3217 2019-03-11 Yusuke Suzuki <ysuzuki@apple.com>
3219 [JSC] Make StaticStringImpl & StaticSymbolImpl actually static
3220 https://bugs.webkit.org/show_bug.cgi?id=194212
3222 Reviewed by Mark Lam.
3224 Avoid mutation onto refcounts if `isStatic()` returns true so that the content of StaticStringImpl never gets modified.
3226 * wtf/text/StringImpl.h:
3227 (WTF::StringImpl::ref):
3228 (WTF::StringImpl::deref):
3230 2019-03-11 Sihui Liu <sihui_liu@apple.com>
3232 Crash under WebCore::IDBDatabase::connectionToServerLost
3233 https://bugs.webkit.org/show_bug.cgi?id=195563
3234 <rdar://problem/37193655>
3236 CrossThreadTask should protect callee if it is ThreadSafeRefCounted.
3238 Reviewed by Geoffrey Garen.
3240 * wtf/CrossThreadTask.h:
3241 (WTF::createCrossThreadTask):
3243 2019-03-11 Ryan Haddad <ryanhaddad@apple.com>
3245 Unreviewed, rolling out r242688, r242643, r242624.
3247 Caused multiple layout test failures and crashes on iOS and macOS.
3251 "requestAnimationFrame should execute before the next frame"
3252 https://bugs.webkit.org/show_bug.cgi?id=177484
3253 https://trac.webkit.org/changeset/242624/webkit
3255 * wtf/SystemTracing.h:
3257 2019-03-11 Darin Adler <darin@apple.com>
3259 Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
3260 https://bugs.webkit.org/show_bug.cgi?id=195533
3262 Reviewed by Brent Fulgham.
3264 Soon, we will change String::number and StringBuilder::appendNumber for floating
3265 point to use "shortest form" serialization instead of the current default, which is
3266 "6-digit fixed precision stripping trailing zeros". To prepare to do this safely
3267 without accidentally changing any behavior, changing callers to call the explicit
3268 versions. Later, we may want to return and change many of them to use shortest form
3269 instead, but that may require rebaselining tests, and in some extreme cases, getting
3270 rid of flawed logic that converts between different single and double precision
3271 floating point; such problems may be hidden by fixed precision serialization.
3273 Since "shortest form" is already the behavior for AtomicString::number and
3274 for makeString, no changes required for clients of either of those.
3277 (WTF::LogArgument::toString): Use numberToStringFixedPrecision.
3278 * wtf/MediaTime.cpp:
3279 (WTF::MediaTime::toString const): Use appendFixedPrecisionNumber.
3280 * wtf/text/ValueToString.h:
3281 (WTF::ValueToString<float>::string): Use numberToStringFixedPrecision.
3282 (WTF::ValueToString<double>::string): Ditto.
3284 2019-03-11 Truitt Savell <tsavell@apple.com>
3286 Unreviewed, rolling out r242702.
3288 Broke High Sierra builders.
3292 "Add utility function to allow easy reverse range-based
3293 iteration of a container"
3294 https://bugs.webkit.org/show_bug.cgi?id=195542
3295 https://trac.webkit.org/changeset/242702
3297 2019-03-11 Sam Weinig <sam@webkit.org>
3299 Add utility function to allow easy reverse range-based iteration of a container
3300 https://bugs.webkit.org/show_bug.cgi?id=195542
3302 Reviewed by Antti Koivisto.
3304 Add functions to create an IteratorRange<T> that will iterate a container backwards. It
3305 works with any container that is compatible with std::rbegin() and std::rend(). It is
3306 expected to be used in conjunction with range-based for-loops like so:
3308 for (auto& value : WTF::makeReversedRange(myContainer))
3311 * wtf/IteratorRange.h:
3312 (WTF::makeReversedRange):
3314 2019-03-10 Yusuke Suzuki <utatane.tea@gmail.com> and Fujii Hironori <Hironori.Fujii@sony.com>
3316 [WTF] Align assumption in RunLoopWin to the other platform's RunLoop
3317 https://bugs.webkit.org/show_bug.cgi?id=181151
3319 Reviewed by Don Olmstead.
3321 This patch fixes RunLoop in Windows to align it to the implementations in the other platforms
3322 to use RunLoop more aggressively.
3325 (WTF::RunLoop::Timer::Timer):
3326 * wtf/win/MainThreadWin.cpp:
3327 (initializeMainThreadPlatform): Call RunLoop::registerRunLoopMessageWindowClass.
3328 * wtf/win/RunLoopWin.cpp:
3329 (WTF::RunLoop::wndProc):
3330 (WTF::RunLoop::iterate):
3331 (WTF::RunLoop::stop):
3332 PostQuitMessage is only available in the RunLoop's thread. We should post a message and call
3333 it inside this task.
3335 (WTF::RunLoop::registerRunLoopMessageWindowClass):
3336 Changed the return type from bool to void, and added RELEASE_ASSERT to check the return value of RegisterClass.
3338 (WTF::RunLoop::~RunLoop):
3339 When the RunLoop's thread is freed, its associated window is freed. We do not need to do here.
3341 (WTF::RunLoop::TimerBase::timerFired):
3342 (WTF::RunLoop::TimerBase::TimerBase):
3343 (WTF::RunLoop::TimerBase::start):
3344 (WTF::RunLoop::TimerBase::stop):
3345 (WTF::RunLoop::TimerBase::isActive const):
3346 (WTF::RunLoop::TimerBase::secondsUntilFire const):
3347 (WTF::generateTimerID): Deleted.
3348 We can use TimerBase's pointer as ID since it is uintptr_t.
3350 2019-03-07 Said Abou-Hallawa <sabouhallawa@apple.com>
3352 requestAnimationFrame should execute before the next frame
3353 https://bugs.webkit.org/show_bug.cgi?id=177484
3355 Reviewed by Simon Fraser.
3357 Add trace points for the page RenderingUpdate.
3359 * wtf/SystemTracing.h:
3361 2019-03-06 Ross Kirsling <ross.kirsling@sony.com>
3363 [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
3364 https://bugs.webkit.org/show_bug.cgi?id=195346
3366 Reviewed by Fujii Hironori.
3368 * wtf/PlatformWin.cmake:
3369 * wtf/text/AtomicString.h:
3370 (WTF::AtomicString::AtomicString):
3371 * wtf/text/WTFString.h:
3372 (WTF::String::String):
3373 * wtf/text/win/StringWin.cpp: Added.
3374 (WTF::String::wideCharacters const): Renamed from WTF::stringToNullTerminatedWChar.
3375 * wtf/text/win/WCharStringExtras.h:
3378 (WTF::stringToNullTerminatedWChar): Deleted.
3379 (WTF::wcharToString): Deleted.
3380 (WTF::nullTerminatedWCharToString): Deleted.
3381 Add static_assert-guarded reinterpret_cast wrappers for going between UChar* and wchar_t*.
3382 Move existing to/from-String helpers into the String (and AtomicString) class(es).
3384 * wtf/win/FileSystemWin.cpp:
3385 (WTF::FileSystemImpl::getFindData):
3386 (WTF::FileSystemImpl::getFinalPathName):
3387 (WTF::FileSystemImpl::createSymbolicLink):
3388 (WTF::FileSystemImpl::deleteFile):
3389 (WTF::FileSystemImpl::deleteEmptyDirectory):
3390 (WTF::FileSystemImpl::moveFile):
3391 (WTF::FileSystemImpl::pathByAppendingComponent):
3392 (WTF::FileSystemImpl::fileSystemRepresentation):
3393 (WTF::FileSystemImpl::makeAllDirectories):
3394 (WTF::FileSystemImpl::pathGetFileName):
3395 (WTF::FileSystemImpl::storageDirectory):
3396 (WTF::FileSystemImpl::generateTemporaryPath):
3397 (WTF::FileSystemImpl::openTemporaryFile):
3398 (WTF::FileSystemImpl::openFile):
3399 (WTF::FileSystemImpl::hardLinkOrCopyFile):
3400 (WTF::FileSystemImpl::deleteNonEmptyDirectory):
3401 * wtf/win/LanguageWin.cpp:
3403 * wtf/win/PathWalker.cpp:
3404 (WTF::PathWalker::PathWalker):
3405 Use wchar helpers as needed.
3407 2019-02-28 Ryosuke Niwa <rniwa@webkit.org>
3410 https://bugs.webkit.org/show_bug.cgi?id=195152
3412 Reviewed by Antti Koivisto.
3414 Added WeakHashSet which is a HashSet of WeakPtr. When the object pointed by WeakPtr is deleted,
3415 WeakHashSet treats the key to be no longer in the set. That is, WeakHashSet::contains returns false
3416 and const_iterator skips such a WeakPtr in the set.
3418 We decided not to make HashSet<WeahPtr<T>> work because it involves weird semantics such as making
3419 find(X) delete the table entry as remove(find(X)) would be a no-op otherwise as find(X) would return
3420 necessarily need to return HashSet<WeakPtr<T>>::end().
3422 Furthermore, we cannot determine the true size of this set in O(1) because the objected pointed by
3423 some of WeakPtr in the set may have already been deleted. This has implications that we can't have
3424 size(), isEmpty(), random(), etc... as O(1) operation.
3426 WeakHashSet is implemented as HashSet<WeakReference<T>>. HashTable::rehash has been updated to delete
3427 WeakReference<T>'s whose m_ptr has become null, and HashTable::expand first deletes any such entry
3428 before deciding an actual expansion is needed. This is accomplished via newly added hash trait,
3429 hasIsReleasedWeakValueFunction, and HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue which
3430 returns true for when WeakReference<T> pointed by Ref<WeakReference<T>> has null m_ptr, not to be
3431 confused with Ref<WeakReference<T>> itself pointing to a null WeakReference<T>.
3433 * WTF.xcodeproj/project.pbxproj:
3434 * wtf/CMakeLists.txt:
3437 (WTF::HashSet<T, U, V>::checkConsistency const): Added.
3439 (WTF::HashTable::isReleasedWeakBucket): Added.
3440 (WTF::HashTable::expand): Delete WeakReference<T> with null m_ptr first. This updates m_keyCount
3441 and may make mustRehashInPlace() return true.
3442 (WTF::HashTable::deleteReleasedWeakBuckets): Added.
3443 (WTF::HashTable::rehash): Delete WeakReference<T> with null m_ptr. Also refactored the code a bit
3444 to avoid keep repeating oldTable[i].
3446 (WTF::HashTraits<T>::isHashTraitsReleasedWeakValue): Added.
3447 (WTF::RefHashTraits<T>): Extracted from HashTraits<Ref<P>> to share code with
3448 HashTraits<Ref<WeakReference<T>>>.
3449 (WTF::HashTraitsReleasedWeakValueChecker<Traits, hasIsReleasedWeakValueFunction>): Added.
3450 (WTF::isHashTraitsReleasedWeakValue<Traits, hasIsReleasedWeakValueFunction>): Added.
3451 * wtf/WeakHashSet.h: Added.
3452 (WTF::WeakHashSet): Added.
3453 (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator):
3454 (WTF::WeakHashSet::WeakHashSetConstIterator::get const):
3455 (WTF::WeakHashSet::WeakHashSetConstIterator::operator* const):
3456 (WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const):
3457 (WTF::WeakHashSet::WeakHashSetConstIterator::operator++):
3458 (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets):
3459 (WTF::WeakHashSet::WeakHashSetConstIterator::operator== const):
3460 (WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const):
3461 (WTF::WeakHashSet::WeakHashSet):
3462 (WTF::WeakHashSet::begin const):
3463 (WTF::WeakHashSet::end const):
3464 (WTF::WeakHashSet::add):
3465 (WTF::WeakHashSet::remove):
3466 (WTF::WeakHashSet::contains const):
3467 (WTF::WeakHashSet::capacity const):
3468 (WTF::WeakHashSet::computeSize const): Deletes any WeakReference<T> with null m_ptr first.
3469 (WTF::WeakHashSet::checkConsistency const):
3470 (WTF::HashTraits<Ref<WeakReference<T>>>): Added. This hash traits triggers the new code in HashTable's
3471 expand and rehash methods to delete WeakReference<T> with null m_ptr.
3472 (WTF::HashTraits<Ref<WeakReference<T>>>::isReleasedWeakValue):
3474 (WTF::WeakReference::~WeakReference): Added so that we can keep track the number of live WeakReference
3475 in API tests by template specializations.
3477 2019-03-03 Darin Adler <darin@apple.com>
3479 Prepare to improve handling of conversion of float to strings
3480 https://bugs.webkit.org/show_bug.cgi?id=195262
3482 Reviewed by Daniel Bates.
3485 (WTF::truncateTrailingZeros): Renamed from
3486 formatStringTruncatingTrailingZerosIfNeeded and removed the calls
3487 to double_conversion::StringBuilder::Finalizer, since the caller
3489 (WTF::numberToFixedPrecisionString): Added an overload for float
3490 and updated to use the new truncateTrailingZeros.
3491 (WTF::numberToFixedWidthString): Added an overload for float.
3493 * wtf/text/AtomicString.cpp:
3494 (WTF::AtomicString::number): Added float overload. This is a
3495 behavior change, but in all cases for the better. The old behavior
3496 was to convert to double first and then do "shortest form"
3497 conversion, and it's always better to just do that as float.
3498 * wtf/text/AtomicString.h: Added float overload of AtomicString::number.
3500 * wtf/text/StringBuilder.cpp:
3501 (WTF::StringBuilder::appendFixedPrecisionNumber): Added float
3503 (WTF::StringBuilder::appendShortestFormNumber): Renamed from
3504 appendECMAScriptNumber and did the above.
3505 (WTF::StringBuilder::appendFixedWidthNumber): Ditto.
3506 * wtf/text/StringBuilder.h: Added overloads for float and
3507 appendShortestFormNumber. The appendNumber and appendECMAScriptNumber
3508 functions are now inlines in the header, since they are expressed
3509 entirely in terms of the other functions.
3511 * wtf/text/WTFString.cpp:
3512 (WTF::String::numberToStringFixedPrecision): Added float overload.
3513 Removed unnecessary explicit conversion to String.
3514 (WTF::String::numberToStringShortest): Renamed from
3515 numberToStringECMAScript and did the above.
3516 (WTF::String::numberToStringFixedWidth): Ditto.
3518 * wtf/text/WTFString.h: Added overloads for float and
3519 numberToStringShortest. The number and numberToStringECMAScript
3520 functions are now inlines in the header, since they are expressed
3521 entirely in terms of the other functions.
3523 2019-03-04 Andy Estes <aestes@apple.com>
3525 [Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
3526 https://bugs.webkit.org/show_bug.cgi?id=195080
3527 <rdar://problem/48421558>
3529 Reviewed by Antti Koivisto.
3531 * wtf/FeatureDefines.h:
3533 2019-03-04 Michael Catanzaro <mcatanzaro@igalia.com>
3535 URLHelpers should use unorm2_quickCheck before converting to NFC
3536 https://bugs.webkit.org/show_bug.cgi?id=194272
3538 Reviewed by Darin Adler.
3540 If the string is already in normalization form C, don't try to normalize it.
3542 * wtf/URLHelpers.cpp:
3543 (WTF::URLHelpers::toNormalizationFormC):
3545 2019-03-02 Darin Adler <darin@apple.com>
3547 Retire legacy dtoa function and DecimalNumber class
3548 https://bugs.webkit.org/show_bug.cgi?id=195253
3550 Reviewed by Daniel Bates.
3552 * WTF.xcodeproj/project.pbxproj: Removed DecimalNumber.cpp/h.
3553 * wtf/CMakeLists.txt: Ditto.
3555 * wtf/DecimalNumber.cpp: Removed.
3556 * wtf/DecimalNumber.h: Removed.
3558 * wtf/JSONValues.cpp:
3559 (WTF::JSONImpl::Value::writeJSON const): Use
3560 StringBuilder::appendECMAScriptNumber instead of custom logic
3561 using the DecimalNumber class.
3564 (WTF::storeInc): Deleted.
3565 (WTF::BigInt): Deleted.
3566 (WTF::multadd): Deleted.
3567 (WTF::hi0bits): Deleted.
3568 (WTF::lo0bits): Deleted.
3569 (WTF::i2b): Deleted.
3570 (WTF::mult): Deleted.
3571 (WTF::P5Node::P5Node): Deleted.
3572 (WTF::pow5mult): Deleted.
3573 (WTF::lshift): Deleted.
3574 (WTF::cmp): Deleted.
3575 (WTF::diff): Deleted.
3576 (WTF::d2b): Deleted.
3577 (WTF::quorem): Deleted.
3578 (WTF::dtoa): Deleted.
3580 * wtf/dtoa.h: Removed DtoaBuffer, dtoa, and NumberToStringBufferLength.
3582 2019-02-27 Darin Adler <darin@apple.com>
3584 Fixed makeString(float) to do shortest-form serialization without first converting to double
3585 https://bugs.webkit.org/show_bug.cgi?id=195142
3587 Reviewed by Daniel Bates.
3589 * wtf/DecimalNumber.cpp: Removed unneeded includes.
3591 * wtf/DecimalNumber.h: Removed unused constructors; over time we will be
3592 deprecating DecimalNumber, so we should removed the unused parts. Also
3593 marked the constructor explicit, removed types used only for arguments for
3594 the constructors, and removed the sign, exponent, significand, and precision
3597 * wtf/JSONValues.cpp:
3598 (WTF::JSONImpl::Value::writeJSON const): Updated for changes to DecimalNumber
3599 switched from NumberToLStringBuffer to NumberToStringBuffer, and for use of
3600 std::array instead of C arrays.
3602 * wtf/dtoa.cpp: Removed unused dtoaRoundSF and dtoaRoundDP functions.
3603 (WTF::dtoa): Updated to use std::array instead of C arrays.
3604 (WTF::dtoaRoundSF): Removed.
3605 (WTF::dtoaRoundDP): Removed.
3606 (WTF::numberToString): Added an overload for float and updated to use std::array.
3607 (WTF::formatStringTruncatingTrailingZerosIfNeeded): Updated to use std::array.
3608 (WTF::numberToFixedPrecisionString): Ditto.
3609 (WTF::numberToFixedWidthString): Ditto.
3611 * wtf/dtoa.h: Changed arrays to be std::array instead of C arrays so the
3612 array types will be checked. Removed dtoaRoundSF and dtoaRoundDP.
3613 Added float overloads for numberToString, numberToFixedPrecisionString,
3614 and numberToFixedWidthString. The only one of these that is called at this
3615 time is numberToString, called by the floating point StringTypeAdapter in
3616 StringConcatenateNummbers.h.
3618 * wtf/text/StringConcatenateNumbers.h: Updated for std::array.
3620 2019-03-01 Darin Adler <darin@apple.com>
3622 Finish removing String::format
3623 https://bugs.webkit.org/show_bug.cgi?id=194893
3625 Reviewed by Daniel Bates.
3627 * wtf/Assertions.cpp:
3628 (WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
3629 (WTFLog): Use WTF::createWithFormatAndArgume