1 2017-11-02 John Wilander <wilander@apple.com>
3 Ignore HSTS for partitioned, cross-origin subresource requests
4 https://bugs.webkit.org/show_bug.cgi?id=178993
5 <rdar://problem/34962462>
7 Reviewed by Brent Fulgham and Alex Christensen.
10 Added HAVE_CFNETWORK_IGNORE_HSTS.
12 2017-11-02 Frederic Wang <fwang@igalia.com>
14 Add references to bug 179167 in FIXME comments
15 https://bugs.webkit.org/show_bug.cgi?id=179168
17 Reviewed by Daniel Bates.
19 * wtf/FeatureDefines.h:
21 2017-11-01 Jiewen Tan <jiewen_tan@apple.com>
23 Let is<T>() accept RefPtrs
24 https://bugs.webkit.org/show_bug.cgi?id=178612
25 <rdar://problem/35102004>
27 Reviewed by Ryosuke Niwa.
29 Add support for is<T>() for RefPtrs.
34 2017-11-01 Simon Fraser <simon.fraser@apple.com>
36 Misc display list and other cleanup
37 https://bugs.webkit.org/show_bug.cgi?id=179150
39 Reviewed by Tim Horton.
41 Add system trace points for display list recording.
43 * wtf/SystemTracing.h:
45 2017-11-01 Fujii Hironori <Hironori.Fujii@sony.com>
47 Use LazyNeverDestroyed instead of DEFINE_GLOBAL
48 https://bugs.webkit.org/show_bug.cgi?id=174979
50 Reviewed by Yusuke Suzuki.
52 DEFINE_GLOBAL is not used anymore. Remove it.
54 * WTF.xcodeproj/project.pbxproj: Removed StaticConstructors.h
55 * config.h: Removed definitions of SKIP_STATIC_CONSTRUCTORS_ON_MSVC and SKIP_STATIC_CONSTRUCTORS_ON_GCC.
56 * wtf/CMakeLists.txt: Removed StaticConstructors.h
57 * wtf/StaticConstructors.h: Removed.
59 2017-10-30 Michael Catanzaro <mcatanzaro@igalia.com>
61 [WPE] Fix build warnings
62 https://bugs.webkit.org/show_bug.cgi?id=178899
64 Reviewed by Carlos Alberto Lopez Perez.
66 * wtf/PlatformWPE.cmake:
68 2017-10-27 Yousuke Kimoto <yousuke.kimoto@sony.com>
70 [WinCairo] Add WTF files for wincairo webkit
71 https://bugs.webkit.org/show_bug.cgi?id=176894
73 Reviewed by Alex Christensen.
75 * wtf/PlatformWin.cmake:
78 * wtf/win/Win32Handle.h:
79 * wtf/win/WorkItemContext.cpp: Added.
80 (WTF::WorkItemContext::WorkItemContext):
81 (WTF::WorkItemContext::create):
82 (WTF::WorkItemContext::~WorkItemContext):
83 * wtf/win/WorkItemContext.h: Added.
84 (WTF::WorkItemContext::handle):
85 (WTF::WorkItemContext::waitHandle):
86 (WTF::WorkItemContext::Function<void):
87 (WTF::WorkItemContext::queue const):
88 * wtf/win/WorkQueueWin.cpp:
89 (WTF::WorkQueue::handleCallback):
90 (WTF::WorkQueue::registerHandle):
91 (WTF::WorkQueue::unregisterAndCloseHandle):
92 (WTF::WorkQueue::unregisterWaitAndDestroyItemSoon):
93 (WTF::WorkQueue::unregisterWaitAndDestroyItemCallback):
95 2017-10-27 Keith Miller <keith_miller@apple.com>
97 Add unified source list files and build scripts to Xcode project navigator
98 https://bugs.webkit.org/show_bug.cgi?id=178959
100 Reviewed by Andy Estes.
102 * WTF.xcodeproj/project.pbxproj:
104 2017-10-26 Mark Lam <mark.lam@apple.com>
106 JSRopeString::RopeBuilder::append() should check for overflows.
107 https://bugs.webkit.org/show_bug.cgi?id=178385
108 <rdar://problem/35027468>
110 Reviewed by Saam Barati.
112 * wtf/CheckedArithmetic.h:
114 2017-10-25 Commit Queue <commit-queue@webkit.org>
116 Unreviewed, rolling out r222945.
117 https://bugs.webkit.org/show_bug.cgi?id=178818
119 "It made WasmBench crash" (Requested by saamyjoon on #webkit).
123 "bmalloc mutex should be adaptive"
124 https://bugs.webkit.org/show_bug.cgi?id=177839
125 https://trac.webkit.org/changeset/222945
127 2017-10-25 Zan Dobersek <zdobersek@igalia.com>
129 Make SERVICE_WORKER feature buildable on GTK, WPE
130 https://bugs.webkit.org/show_bug.cgi?id=178574
132 Reviewed by Carlos Garcia Campos.
134 * wtf/Identified.h: Explicitly include the <atomic> header since
135 std::atomic<> is used in the ThreadSafeIdentified definition.
137 2017-10-24 Michael Saboff <msaboff@apple.com>
139 WTF: Eliminated PLATFORM checks for HAVE_MACH_EXCEPTIONS
140 https://bugs.webkit.org/show_bug.cgi?id=178747
142 Reviewed by Saam Barati.
144 Removed unnecessary PLATFORM checks as they can cause build failures
145 when the include file is present.
149 2017-10-23 Yusuke Suzuki <utatane.tea@gmail.com>
151 [JSC] Use fastJoin in Array#toString
152 https://bugs.webkit.org/show_bug.cgi?id=178062
154 Reviewed by Darin Adler.
156 A bit cleaning up to use StringImpl::copyChars instead of
157 using for-loop directly.
159 * wtf/text/StringView.h:
160 (WTF::StringView::getCharactersWithUpconvert const):
162 2017-10-20 Antoine Quint <graouts@apple.com>
164 [Web Animations] Provide basic timeline and animation interfaces
165 https://bugs.webkit.org/show_bug.cgi?id=178526
167 Reviewed by Dean Jackson.
169 Remove the WEB_ANIMATIONS compile-time flag.
171 * wtf/FeatureDefines.h:
173 2017-10-19 Keith Miller <keith_miller@apple.com>
175 REGRESSION (r223476): WebCore exports symbols with names belonging to other frameworks
176 https://bugs.webkit.org/show_bug.cgi?id=178424
178 Reviewed by David Kilzer.
180 This patch moves the wrapper function sharing the name of the externed function
181 to the source file and marks it as always inline. Marking it as inline prevents
182 the framework from exporting it.
184 * wtf/cocoa/SoftLinking.h:
186 2017-10-18 Keith Miller <keith_miller@apple.com>
188 Setup WebCore build to start using unified sources.
189 https://bugs.webkit.org/show_bug.cgi?id=178362
191 Reviewed by Tim Horton.
193 There are a number of changes to the bundler script. First, it is
194 now possible to enable or disable building files based on if the
195 associated feature flag is enabled or not. The syntax for this is
196 similar to how we do #ifs in C++ code. e.g.
202 would enable myApplePayFile.cpp if and only if the APPLE_PAY
203 feature define is set.
205 I also changed comments from # to // to make it less likely they
206 would be confused with a #if.
208 Finally, this patch enables bundling files in the same relative
209 directory across source list files. Previously, if
210 SourcesCocoa.txt had platform/cf/foo.cpp and SourcesMac.txt had
211 platform/cf/bar.cpp those files would not be put in the same
212 unified source bundle. Now, those files will be put into the same
213 bundle but bar.cpp will always follow foo.cpp. The idea is that by
214 putting more specific files after more general files we can avoid
215 random build failures.
217 * Scripts/generate-unified-source-bundles.rb:
219 2017-10-18 Konstantin Tokarev <annulen@yandex.ru>
221 REGRESSION(r217771): nullTerminatedWCharToString loses last character of input string
222 https://bugs.webkit.org/show_bug.cgi?id=178444
224 Reviewed by Per Arne Vollan.
226 * wtf/text/win/WCharStringExtras.h:
227 (WTF::nullTerminatedWCharToString):
229 2017-10-17 Keith Miller <keith_miller@apple.com>
231 Change WebCore sources to work with unified source builds
232 https://bugs.webkit.org/show_bug.cgi?id=178229
234 Rubber stamped by Tim Horton.
237 * wtf/cocoa/SoftLinking.h:
239 2017-10-16 David Kilzer <ddkilzer@apple.com>
241 Add RELEASE_ASSERT_WITH_SECURITY_IMPLICATION() macro
242 <https://webkit.org/b/178269>
244 Reviewed by Alex Christensen.
247 (RELEASE_ASSERT_WITH_SECURITY_IMPLICATION): Add macro.
249 2017-10-14 Sam Weinig <sam@webkit.org>
251 Remove HashCountedSet's copyToVector functions
252 https://bugs.webkit.org/show_bug.cgi?id=178215
254 Reviewed by Daniel Bates.
256 * wtf/HashCountedSet.h:
257 (WTF::copyToVector): Deleted.
259 They are replaced by either copyToVector(hashCountedSet) or copyToVector(hashCountedSet.values())
261 2017-10-13 Sam Weinig <sam@webkit.org>
263 Adopt type trait template aliases everywhere in WTF
264 https://bugs.webkit.org/show_bug.cgi?id=178299
266 Reviewed by Yusuke Suzuki.
268 Adopt type trait template aliases (e.g. replace 'typename std::make_unsigned<Source>::type'
269 with 'std::make_unsigned_t<Source>'). Also adopt using over typedef consistently.
272 * wtf/CagedUniquePtr.h:
273 * wtf/CheckedArithmetic.h:
274 * wtf/CompletionHandler.h:
276 * wtf/HashCountedSet.h:
277 * wtf/HashFunctions.h:
282 * wtf/IndexedContainerIterator.h:
283 * wtf/IteratorAdaptors.h:
284 * wtf/KeyValuePair.h:
288 * wtf/NeverDestroyed.h:
291 * wtf/SizeLimits.cpp:
292 * wtf/StdLibExtras.h:
294 * wtf/ThreadSpecific.h:
297 * wtf/text/IntegerToStringConversion.h:
299 2017-10-13 Jer Noble <jer.noble@apple.com>
301 Performance: Skip texture upload if source image and destination texture haven't changed
302 https://bugs.webkit.org/show_bug.cgi?id=178254
303 <rdar://problem/34968181>
305 Reviewed by Dean Jackson.
307 Add a new class, UnsafePointer, for safely holding pointers to objects with uncontrolled lifetimes.
309 * WTF.xcodeproj/project.pbxproj:
310 * wtf/UnsafePointer.h: Added.
311 (WTF::UnsafePointer::UnsafePointer):
312 (WTF::UnsafePointer::operator== const):
313 (WTF::UnsafePointer::operator!= const):
314 (WTF::UnsafePointer::operator bool const):
318 2017-10-13 Per Arne Vollan <pvollan@apple.com>
320 [Win] When built with VS2017, MiniBrowser crashes on startup.
321 https://bugs.webkit.org/show_bug.cgi?id=175209
323 Reviewed by Daniel Bates.
325 Add AtomicString(const StaticStringImpl*) constructor. This is needed since
326 this patch adds constexpr to the static, global StaticStringImpl objects
327 generated in WebCore/bindings/scripts/StaticString.pm.
329 * wtf/text/AtomicString.h:
330 (WTF::AtomicString::AtomicString):
331 * wtf/text/AtomicStringImpl.cpp:
333 (WTF::AtomicStringImpl::add):
334 * wtf/text/AtomicStringImpl.h:
335 * wtf/text/StringImpl.h:
336 (WTF::StringImpl::assertHashIsCorrect const):
337 (WTF::StringImpl::assertHashIsCorrect): Deleted.
339 2017-10-12 Alex Christensen <achristensen@webkit.org>
341 Add Expected, HashMap, HashSet, and SHA1 to wtf/Forward.h
342 https://bugs.webkit.org/show_bug.cgi?id=178243
344 Reviewed by Tim Horton.
348 Move default parameters to Forward.h like we did with Vector.
350 Also fix indentation.
352 2017-10-12 Alex Christensen <achristensen@webkit.org>
354 Add CompletionHandler and HashCountedSet to wtf/Forward.h
355 https://bugs.webkit.org/show_bug.cgi?id=178231
357 Reviewed by Tim Horton.
360 * wtf/HashCountedSet.h:
362 2017-10-11 Sam Weinig <sam@webkit.org>
364 Remove out-parameter variants of copyToVector
365 https://bugs.webkit.org/show_bug.cgi?id=178155
367 Reviewed by Tim Horton.
370 (WTF::copyToVector): Deleted.
372 (WTF::copyToVector): Deleted.
377 (WTF::copyToVectorSpecialization):
379 Add another version of copyToVector, called copyToVectorSpecialization, that allows
380 you to specify the entire specialization for the Vector you want to copy to. This
381 can be useful if you want your resulting Vector to have an inline capacity.
383 2017-10-12 Sam Weinig <sam@webkit.org>
385 It should be possible to iterate just the values (and not the counts) of a HashCountedSet
386 https://bugs.webkit.org/show_bug.cgi?id=178169
388 Reviewed by Daniel Bates.
390 Cleanup (fix indentation, simplify type names, adopt using), and add a values() range to
391 HashCountedSet. This will allow getting a Vector of all the values (and not the counts)
392 using the new copyToVector.
394 * wtf/HashCountedSet.h:
396 2017-10-11 Michael Saboff <msaboff@apple.com>
398 [JSC] Add ability to build with ARMV8 ILP32 ABI
399 https://bugs.webkit.org/show_bug.cgi?id=178194
401 Reviewed by Saam Barati.
403 For ARMV8 32 bit ABI, use JSVALUE32_64 and the CLOOP.
407 2017-10-11 Youenn Fablet <youenn@apple.com>
409 Add API to clean CacheStorage data
410 https://bugs.webkit.org/show_bug.cgi?id=178034
412 Reviewed by Chris Dumez.
414 Moving CallbackAggregator pattern into its own class for easier reuse.
416 * WTF.xcodeproj/project.pbxproj:
417 * wtf/CallbackAggregator.h: Added.
418 (WTF::CallbackAggregator::create):
419 (WTF::CallbackAggregator::~CallbackAggregator):
420 (WTF::CallbackAggregator::CallbackAggregator):
422 2017-10-10 Sam Weinig <sam@webkit.org>
424 Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values())
425 https://bugs.webkit.org/show_bug.cgi?id=178102
427 Reviewed by Tim Horton.
430 (WTF::copyKeysToVector): Deleted.
431 (WTF::copyValuesToVector): Deleted.
433 Remove copyKeysToVector and copyValuesToVector which are no longer used.
435 2017-10-09 Youenn Fablet <youenn@apple.com>
437 Vector should be able to easily create from a list of movable only items
438 https://bugs.webkit.org/show_bug.cgi?id=176432
440 Reviewed by Darin Adler.
442 Adding static from method to construct a Vector from movable-only items.
443 This may also be used instead of initializer list constructor for types that would benefit of being moved.
446 (WTF::Vector::Vector):
448 (WTF::Vector::uncheckedInitialize): Introduced as an optimization to set the vector size once.
449 (WTF::Malloc>::reserveInitialCapacity):
451 2017-10-09 Tim Horton <timothy_horton@apple.com>
453 Disable INPUT_TYPE_COLOR in FeatureDefines.h
454 https://bugs.webkit.org/show_bug.cgi?id=178103
455 <rdar://problem/34872127>
457 Reviewed by Simon Fraser.
459 * wtf/FeatureDefines.h:
460 Because FeatureDefines.h overrides features that are not enabled in
461 FeatureDefines.xcconfig, you currently have to turn INPUT_TYPE_COLOR
462 off in two places. Since we only ever want it on for Mac, it's OK
463 to depend on the xcconfig defining it.
465 2017-10-09 Sam Weinig <sam@webkit.org>
467 Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
468 https://bugs.webkit.org/show_bug.cgi?id=178072
470 Reviewed by Darin Adler.
472 Introduce SizedIteratorRange, a variant of IteratorRange that includes
473 a reference to a backing container in order to get the size of container.
474 This is useful for algorithms like WTF::map and WTF::copyToVector, that
475 can use the size to efficiently allocate things of the correct size.
477 The main beneficiary are HashMap's keys() and values() functions which
478 used to return IteratorRanges and now return SizedIteratorRange. This
479 allows us to remove (in a future change) copyKeysToVector() and
480 copyValuesToVector() by replacing them with copyToVector(map.keys()) and
481 copyToVector(map.values()) respectively.
484 * wtf/IteratorRange.h:
485 (WTF::SizedIteratorRange::SizedIteratorRange):
486 (WTF::SizedIteratorRange::size const):
487 (WTF::SizedIteratorRange::begin const):
488 (WTF::SizedIteratorRange::end const):
489 (WTF::makeSizedIteratorRange):
491 2017-10-08 Sam Weinig <sam@webkit.org>
493 It should be possible to create a ListHashSet with a std::initializer_list.
494 https://bugs.webkit.org/show_bug.cgi?id=178070
496 Reviewed by Darin Adler.
499 (WTF::U>::ListHashSet):
500 Add a constructor that takes a std::initializer_list.
502 2017-10-08 Sam Weinig <sam@webkit.org>
504 Address additional feedback from Darin for r223039 and sort the using declarations.
508 2017-10-08 Sam Weinig <sam@webkit.org>
510 There should be a version of copyToVector that returns a Vector, rather than using an out parameter
511 https://bugs.webkit.org/show_bug.cgi?id=177732
513 Reviewed by Saam Barati.
515 Add two new helper functions, copyToVector and copyToVectorOf, which will be able to
516 replace the existing out parameter taking copyToVector. Like it's ancestral namesake,
517 copyToVector takes an object that is both iterable (supports begin() and end()) and
518 has a size, and returns a Vector with a copy of all the items iterated. The copyToVectorOf
519 variant allow the user to specify a type to convert to, so if you have a HashSet<int>
520 but want those as floats in a Vector, you can do:
522 auto floatVector = copyToVectorOf<float>(intSet);
526 (WTF::copyToVectorOf):
528 2017-10-08 Darin Adler <darin@apple.com>
530 Fix bugs related to setting reflected floating point DOM attributes
531 https://bugs.webkit.org/show_bug.cgi?id=178061
533 Reviewed by Sam Weinig.
536 (WTF::formatStringTruncatingTrailingZerosIfNeeded): Fix a bug where
537 this function would remove trailing zeroes from the exponent if
538 present instead of from the mantissa. This meant that it would
539 format 1e10 as "1.00000e+1" instead of "1e+10". Added regression
540 tests for this to TestWebKitAPI.
543 (WTF::double_conversion::StringBuilder::RemoveCharacters): Added.
544 Used by the fix above.
546 * wtf/text/AtomicString.cpp:
547 (WTF::AtomicString::number): Note: This function is used by code
548 that sets the values of reflected floating point DOM attributes.
549 Changed the function to use the rules from numberToString rather
550 ones from numberToFixedPrecisionString. This is analogous to
551 String::numberToStringECMAScript, and in the future we should change
552 String and StringBuilder so this "ECMAScript" semantic is the default
553 way to convert a floating point number to a string, and rename the fixed
554 precision version that is currently called String::number. I audited
555 the small number of sites calling AtomicString::number, by temporarily
556 renaming it, and discovered that this is the correct behavior for all;
557 none needed fixed precision. Also, fixed a mistake where this explicitly
558 converted to String. That was defeating the purpose of having these
559 functions in AtomicString: It would allocate a new String and then
560 destroy it in the case where an equal string was already in the
563 2017-10-06 Commit Queue <commit-queue@webkit.org>
565 Unreviewed, rolling out r222791 and r222873.
566 https://bugs.webkit.org/show_bug.cgi?id=178031
568 Caused crashes with workers/wasm LayoutTests (Requested by
569 ryanhaddad on #webkit).
573 "WebAssembly: no VM / JS version of everything but Instance"
574 https://bugs.webkit.org/show_bug.cgi?id=177473
575 http://trac.webkit.org/changeset/222791
577 "WebAssembly: address no VM / JS follow-ups"
578 https://bugs.webkit.org/show_bug.cgi?id=177887
579 http://trac.webkit.org/changeset/222873
581 2017-10-06 Antti Koivisto <antti@apple.com>
583 Minor WeakPtr improvements
584 https://bugs.webkit.org/show_bug.cgi?id=177958
586 Reviewed by Sam Weinig.
589 (WTF::WeakPtr::operator bool const):
593 (WTF::WeakPtrFactory::createWeakPtr const):
596 Remove templating from createWeakPtr, makeWeakPtr() is now the
597 canonical way to make derived-type WeakPtrs.
599 2017-10-04 Filip Pizlo <fpizlo@apple.com>
601 bmalloc mutex should be adaptive
602 https://bugs.webkit.org/show_bug.cgi?id=177839
604 Reviewed by Michael Saboff.
606 Add some comments that I thought of while copy-pasting this code.
608 Reland after fixing ancient WordLock bug: the notify_one has to happen with the lock held
609 to ensure it doesn't run after that thread has died.
611 * wtf/LockAlgorithmInlines.h:
614 2017-10-05 Carlos Alberto Lopez Perez <clopez@igalia.com>
616 Generate a compile error if release is built without compiler optimizations
617 https://bugs.webkit.org/show_bug.cgi?id=177665
619 Reviewed by Brian Burg.
621 For GCC and Clang, generate an error at build time that will alert
622 the developer that she is trying to build Release without any compiler
623 optimization. A build time error is much better than an unexpected
624 "oh, WebKit is really slow ..." situation later.
626 If this was intended, then we tell the developer that she can continue
627 by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
630 The intention of this patch is to ensure that nobody builds Release
631 without enabling compiler optimization by mistake.
635 2017-10-05 David Kilzer <ddkilzer@apple.com>
637 Bug 177893: Disable -Wcast-qual for new clang compiler in Apple ports
638 <https://webkit.org/b/177893>
639 <rdar://problem/33667497>
641 Reviewed by Tim Horton.
644 (WTF::RetainPtr::fromStorageType const): Disable warnings for
645 -Wcast-qual until we can provide a safe cast function that lets
646 us re-enable the warning.
648 2017-10-05 Matt Lewis <jlewis3@apple.com>
650 Unreviewed, rolling out r222893.
652 This caused multiple API failures.
656 "bmalloc mutex should be adaptive"
657 https://bugs.webkit.org/show_bug.cgi?id=177839
658 http://trac.webkit.org/changeset/222893
660 2017-10-04 Filip Pizlo <fpizlo@apple.com>
662 bmalloc mutex should be adaptive
663 https://bugs.webkit.org/show_bug.cgi?id=177839
665 Reviewed by Michael Saboff.
667 Add some comments that I thought of while copy-pasting this code.
669 * wtf/LockAlgorithmInlines.h:
672 2017-10-04 JF Bastien <jfbastien@apple.com>
674 WTF: Update std::expected to match current proposal
675 https://bugs.webkit.org/show_bug.cgi?id=177881
677 Reviewed by Mark Lam.
679 The proposal is likely to be in C++20 and I've been asked to help co-champion
680 it. I'm therefore updating our implementation to more closely match the current
681 proposal, and to make sure it'll work for us if standardized.
683 - Rename UnexpectedType to Unexpected to match the proposal.
684 - Remove relational operators, only equality / inequality remains.
685 - Fix minor type signatures.
686 - Add UnexpectedType typedef.
687 - Uncomment rebind implementation.
688 - Add in-place construction tag, as well as explicit error construction tag.
689 - Add template unexpected constructor.
690 - Note that make_unexpected isn't in the proposal anymore, but we keep it because we don't have C++17 deduction guides.
691 - Remove hashing, which isn't in the proposal anymore.
694 (WTF::Unexpected::Unexpected):
695 (WTF::Unexpected::value const):
698 (WTF::makeUnexpected):
699 (WTF::Expected::Expected):
700 (WTF::Expected::operator=):
701 (WTF::Expected::getUnexpected const):
703 2017-10-04 Ryan Haddad <ryanhaddad@apple.com>
705 Unreviewed, rolling out r222840.
707 This change breaks internal builds.
711 "Generate a compile error if release is built without compiler
713 https://bugs.webkit.org/show_bug.cgi?id=177665
714 http://trac.webkit.org/changeset/222840
716 2017-10-04 Carlos Alberto Lopez Perez <clopez@igalia.com>
718 Generate a compile error if release is built without compiler optimizations
719 https://bugs.webkit.org/show_bug.cgi?id=177665
721 Reviewed by Michael Catanzaro.
723 For GCC and Clang, generate an error at build time that will alert
724 the developer that she is trying to build Release without any compiler
725 optimization. A build time error is much better than an unexpected
726 "oh, WebKit is really slow ..." situation later.
728 If this was intended, then we tell the developer that she can continue
729 by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
732 The intention of this patch is to ensure that nobody builds Release
733 without enabling compiler optimization by mistake.
737 2017-10-04 Tomas Popela <tpopela@redhat.com>
739 Allow building without WOFF enabled
741 Reviewed by Michael Catanzaro.
743 Don't force the WOFF to be turned on, but follow what is set in cmake.
747 2017-10-03 Saam Barati <sbarati@apple.com>
749 Implement polymorphic prototypes
750 https://bugs.webkit.org/show_bug.cgi?id=176391
752 Reviewed by Filip Pizlo.
755 (WTF::Box::operator bool const):
756 (WTF::Box::operator bool): Deleted.
757 Make Box movable. Also ensure its operator bool doesn't do an atomic increment.
759 (WTF::RefPtr::operator bool const):
760 Add `explicit operator bool()` for RefPtr.
762 2017-10-03 Antti Koivisto <antti@apple.com>
764 Allow assigning WeakPtr<Derived> to WeakPtr<Base>
765 https://bugs.webkit.org/show_bug.cgi?id=177817
767 Reviewed by Geoff Garen.
769 Add templated copy/move constructors/assignment operators, similar to RefPtr.
772 (WTF::WeakPtrFactory::createWeakPtr const):
773 (WTF::weak_reference_upcast):
774 (WTF::weak_reference_downcast):
775 (WTF::WeakPtr<T>::WeakPtr):
779 2017-10-03 JF Bastien <jfbastien@apple.com>
781 WebAssembly: no VM / JS version of everything but Instance
782 https://bugs.webkit.org/show_bug.cgi?id=177473
784 Reviewed by Filip Pizlo.
786 * wtf/StdLibExtras.h:
787 (WTF::default_construct_at): this makes code in WasmTable much
788 more readable, and is generally useful for generic code
790 2017-10-02 Myles C. Maxfield <mmaxfield@apple.com>
792 Move LineEnding.{h,cpp} from WebCore/platform/text to wtf/text
793 https://bugs.webkit.org/show_bug.cgi?id=176575
795 Reviewed by Alex Christensen.
797 As part of the PAL effort, we're trying to move everything out of WebCore/platform, one-by-one.
798 These LineEnding files belong in WTF.
800 * WTF.xcodeproj/project.pbxproj:
801 * wtf/text/LineEnding.cpp: Renamed from Source/WebCore/platform/text/LineEnding.cpp.
802 (WTF::normalizeLineEndingsToCRLF):
803 * wtf/text/LineEnding.h: Renamed from Source/WebCore/platform/text/LineEnding.h.
805 2017-10-02 Geoffrey Garen <ggaren@apple.com>
807 WeakPtr should have a move constructor
808 https://bugs.webkit.org/show_bug.cgi?id=177789
810 Reviewed by Chris Dumez.
812 * wtf/WeakPtr.h: Now that we just have a RefPtr data member,
813 the default operators are sufficient.
815 2017-10-02 Geoffrey Garen <ggaren@apple.com>
817 NULL WeakPtr should not malloc!
818 https://bugs.webkit.org/show_bug.cgi?id=177773
820 Reviewed by Antti Koivisto.
822 Translating NULL into malloc is... inefficient.
825 (WTF::WeakPtr::WeakPtr):
826 (WTF::WeakPtr::operator=):
827 (WTF::WeakPtr::clear): Make m_ref lazy so that a NULL m_ref can represent
828 a NULL pointer. Normal dereference is no slower because we can rely on
829 the fact that dereference of NULL should crash. operator bool() and get()
830 incur an extra branch. That's probably worth it to avoid malloc
833 2017-10-02 Antti Koivisto <antti@apple.com>
835 Add makeWeakPtr variant that takes pointer
836 https://bugs.webkit.org/show_bug.cgi?id=177767
838 Reviewed by Zalan Bujtas.
843 This version deals with the nullptr.
845 2017-09-30 Antti Koivisto <antti@apple.com>
847 Add makeWeakPtr for easier WeakPtr construction
848 https://bugs.webkit.org/show_bug.cgi?id=177706
850 Reviewed by Sam Weinig.
852 Standalone makeWeakPtr() returns a WeakPtr of the same type as the argument.
854 For this to work the argument type needs to expose a (possibly base type) WeakPtrFactory
855 as a public weakPtrFactory() member function.
858 (WTF::WeakPtr::operator-> const):
859 (WTF::WeakPtr::operator* const): Also add operator*.
862 2017-09-28 Jiewen Tan <jiewen_tan@apple.com>
864 WeakPtrFactory should allow downcasting
865 https://bugs.webkit.org/show_bug.cgi?id=177389
866 <rdar://problem/34604174>
868 Reviewed by Geoffrey Garen.
870 In this patch, WeakPtrFactory is enhanced with the ability to create WeakPtrs
871 of its owner's sub classes and have them point to the same WeakReference.
874 (WTF::WeakPtr::WeakPtr):
875 We cannot determine the base class of type T, thus no friends. It is made public
876 such that WeakPtrFactory with a base class type U can create a derived type T
878 (WTF::WeakPtrFactory::createWeakPtr const):
880 2017-09-28 Don Olmstead <don.olmstead@sony.com>
882 Sync SYSTEM_MALLOC implementation of Gigacage
883 https://bugs.webkit.org/show_bug.cgi?id=177569
885 Reviewed by Mark Lam.
889 (Gigacage::basePtrs):
891 2017-09-27 Per Arne Vollan <pvollan@apple.com>
893 [Win64] Compile error, 'BasePtrs' is undefined.
894 https://bugs.webkit.org/show_bug.cgi?id=177565
896 Reviewed by Mark Lam.
898 Copy definition of 'BasePtrs' from bmalloc/GigaCage.h.
902 2017-09-26 Said Abou-Hallawa <sabouhallawa@apple.com>
904 Followup (r222427): SynchronizedFixedQueue should not have a public constructor
905 https://bugs.webkit.org/show_bug.cgi?id=177458
907 Reviewed by Tim Horton.
909 Since SynchronizedFixedQueue is now derived from ThreadSafeRefCounted<SynchronizedFixedQueue>,
910 the standard way to have an instance of it is to call SynchronizedFixedQueue::create()
911 which returns a Ref<SynchronizedFixedQueue>. Now it does not make sense to still
912 have the constructor public.
914 * wtf/SynchronizedFixedQueue.h:
915 (WTF::SynchronizedFixedQueue::SynchronizedFixedQueue):
917 2017-09-24 Keith Miller <keith_miller@apple.com>
919 JSC build should use unified sources for derived sources
920 https://bugs.webkit.org/show_bug.cgi?id=177421
922 Reviewed by JF Bastien.
924 The script now needs to determine if a file is from a derived
925 source. This is only relevant for the CMake build since the
926 script needs to provide a list of the bundled source files. If the
927 script does not provide the full path for derived sources then
928 CMake will be unable to find them and the build will fail.
930 Additionally, I move the error message for the Xcode build outside
931 the main loop. This means that the error message will contain all
932 the files you need to add to Xcode and all those files will now be
933 written in DerivedSources so they should be easier to add.
935 * Scripts/generate-unified-source-bundles.rb:
937 2017-09-26 Zan Dobersek <zdobersek@igalia.com>
939 Support building JavaScriptCore with the Bionic C library
940 https://bugs.webkit.org/show_bug.cgi?id=177427
942 Reviewed by Michael Catanzaro.
944 * wtf/Platform.h: Define HAVE_MACHINE_CONTEXT when __BIONIC__
945 is defined, i.e. when building with the Bionic C library.
947 2017-09-23 Said Abou-Hallawa <sabouhallawa@apple.com>
949 Images may render partial frames even after loading all the encoded data
950 https://bugs.webkit.org/show_bug.cgi?id=177406
952 Reviewed by Simon Fraser.
954 Make it possible to create a RefPtr<SynchronizedFixedQueue>.
956 * wtf/SynchronizedFixedQueue.h:
957 (WTF::SynchronizedFixedQueue::create):
958 (WTF::SynchronizedFixedQueue::enqueue):
959 (WTF::SynchronizedFixedQueue::dequeue):
961 2017-09-22 Zalan Bujtas <zalan@apple.com>
963 WeakPtrFactory should populate m_ref lazily.
964 https://bugs.webkit.org/show_bug.cgi?id=177375
966 Reviewed by Geoffrey Garen.
968 This helps us with the overhead of initializing WeakPtrFactory for
969 objects that rarely end up creating the weak reference.
970 -This is in preparation for introducing WeakPtr to RenderObject.
972 All credit to Geoffrey Garen.
975 (WTF::WeakReference::get const):
976 (WTF::WeakReference::clear):
977 (WTF::WeakReference::WeakReference):
978 (WTF::WeakPtrFactory::~WeakPtrFactory):
979 (WTF::WeakPtrFactory::createWeakPtr const):
980 (WTF::WeakPtrFactory::revokeAll):
981 (WTF::WeakPtrFactory::WeakPtrFactory): Deleted.
983 2017-09-21 Alex Christensen <achristensen@webkit.org>
985 Make StringBuilder movable
986 https://bugs.webkit.org/show_bug.cgi?id=177311
988 Reviewed by Chris Dumez.
990 * wtf/text/StringBuilder.h:
991 (WTF::StringBuilder::StringBuilder):
993 2017-09-20 Keith Miller <keith_miller@apple.com>
995 JSC should use unified sources for platform specific files.
996 https://bugs.webkit.org/show_bug.cgi?id=177290
998 Reviewed by Michael Saboff.
1000 The unified source bundler script can now handle more than one
1001 list of sources. Sources will not be bundled across source file
1002 lists. We want to ensure that changing one platform's sources
1003 doesn't break another platform's build, as much as
1004 possible. Additionally, it means that there won't be weird
1005 performance changes when files are added to an unrelated platform.
1007 Remove stale reference to generate-unified-source-bundles.rb script
1010 * Scripts/generate-unified-source-bundles.rb:
1011 * WTF.xcodeproj/project.pbxproj:
1013 2017-09-20 Stephan Szabo <stephan.szabo@sony.com>
1015 [Win] WTF: Add alias for process id to use in place of direct uses of pid_t
1016 https://bugs.webkit.org/show_bug.cgi?id=177017
1018 Reviewed by Alex Christensen.
1021 (WTF::getCurrentProcessID):
1023 2017-09-20 Keith Miller <keith_miller@apple.com>
1025 JSC Xcode build should use unified sources for platform independent files
1026 https://bugs.webkit.org/show_bug.cgi?id=177190
1028 Reviewed by Saam Barati.
1030 Add a new directory for build scripts that are forwarded to subsequent framework builds.
1032 * Scripts/generate-unified-source-bundles.rb: Renamed from Source/WTF/generate-unified-source-bundles.rb.
1033 * WTF.xcodeproj/project.pbxproj:
1034 * wtf/CMakeLists.txt:
1036 2017-09-20 Per Arne Vollan <pvollan@apple.com>
1038 [Win] Cannot find script to generate unified sources.
1039 https://bugs.webkit.org/show_bug.cgi?id=177014
1041 Reviewed by Keith Miller.
1043 Copy the ruby script to WTF/Scripts in the forwarding headers folder.
1045 * wtf/CMakeLists.txt:
1047 2017-09-20 Alberto Garcia <berto@igalia.com>
1049 Fix HPPA and Alpha builds
1050 https://bugs.webkit.org/show_bug.cgi?id=177224
1052 Reviewed by Alex Christensen.
1056 2017-09-19 Youenn Fablet <youenn@apple.com>
1058 Allow WTF::map to use any class that is iterable and has a size getter
1059 https://bugs.webkit.org/show_bug.cgi?id=177026
1061 Reviewed by Darin Adler.
1063 Computing the Item type given to the lambda using the iterator instead of ValueType which is specific to Vector.
1064 Adding the possibility to pass a non const container reference and a lambda taking non const references as well.
1067 (WTF::MapFunctionInspector::acceptsReference):
1071 2017-09-19 Jer Noble <jer.noble@apple.com>
1073 [Cocoa] Add an ImageDecoder subclass backed by AVFoundation
1074 https://bugs.webkit.org/show_bug.cgi?id=176825
1076 Reviewed by Eric Carlson.
1080 2017-09-18 Andy Estes <aestes@apple.com>
1082 [Cocoa] Upstream sandbox-related WebKitSystemInterface functions
1083 https://bugs.webkit.org/show_bug.cgi?id=177047
1085 Reviewed by Daniel Bates.
1087 * wtf/spi/darwin/SandboxSPI.h:
1089 2017-09-18 Ryan Haddad <ryanhaddad@apple.com>
1091 Unreviewed, rolling out r222170.
1093 The API test added with this change is failing.
1097 "Allow WTF::map to use any class that is iterable and has a
1099 https://bugs.webkit.org/show_bug.cgi?id=177026
1100 http://trac.webkit.org/changeset/222170
1102 2017-09-18 Youenn Fablet <youenn@apple.com>
1104 Allow WTF::map to use any class that is iterable and has a size getter
1105 https://bugs.webkit.org/show_bug.cgi?id=177026
1107 Reviewed by Darin Adler.
1109 Computing the Item type given to the lambda using the iterator instead of ValueType which is specific to Vector.
1110 Adding the possibility to pass a non const container reference and a lambda taking non const references as well.
1113 (WTF::MapFunctionInspector::acceptsReference):
1117 2017-09-15 JF Bastien <jfbastien@apple.com>
1119 WTF: use Forward.h when appropriate instead of Vector.h
1120 https://bugs.webkit.org/show_bug.cgi?id=176984
1122 Reviewed by Saam Barati.
1124 There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.
1128 * wtf/text/StringVector.h:
1130 2017-09-15 Keith Miller <keith_miller@apple.com>
1132 generate-unified-source-bundles.rb shouldn't write a file that isn't going to change
1133 https://bugs.webkit.org/show_bug.cgi?id=177021
1135 Reviewed by Tim Horton.
1137 * generate-unified-source-bundles.rb:
1139 2017-09-14 Saam Barati <sbarati@apple.com>
1141 We should have a way of preventing a caller from making a tail call and we should use it for ProxyObject instead of using build flags
1142 https://bugs.webkit.org/show_bug.cgi?id=176863
1144 Reviewed by Keith Miller.
1146 This patch adds a way for a particular function to mark
1147 that none of its calls should be tail calls.
1149 It's useful in the following example if you don't want foo
1150 to do a tail call to bar or baz:
1160 Note that we're not saying that bar/baz should not be tail callable. bar/baz
1161 may have other callers that are allowed to tail call it. This macro just says
1162 that foo itself will not perform any tail calls.
1164 * WTF.xcodeproj/project.pbxproj:
1165 * wtf/NoTailCalls.h: Added.
1166 (WTF::NoTailCalls::~NoTailCalls):
1168 2017-09-14 Mark Lam <mark.lam@apple.com>
1170 AddressSanitizer: stack-buffer-underflow in JSC::Probe::Page::Page
1171 https://bugs.webkit.org/show_bug.cgi?id=176874
1172 <rdar://problem/34436415>
1174 Reviewed by Saam Barati.
1176 Added a convenience version of roundUpToMultipleOf() so that it can be applied to
1177 pointers without the client having to cast explicitly.
1179 * wtf/StdLibExtras.h:
1180 (WTF::roundUpToMultipleOf):
1182 2017-09-14 Youenn Fablet <youenn@apple.com>
1184 Allow WTF::map to take function as parameter
1185 https://bugs.webkit.org/show_bug.cgi?id=176909
1187 Reviewed by Jer Noble.
1192 2017-09-13 Youenn Fablet <youenn@apple.com>
1194 Add a lambda-based map for Vectors
1195 https://bugs.webkit.org/show_bug.cgi?id=176487
1197 Reviewed by Darin Adler.
1199 This helper routine allows refactoring the reserveInitialCapacity/uncheckedAppend pattern, the mapper between source and destination item being a lambda.
1202 (WTF::Mapper::transform):
1206 2017-09-12 Yusuke Suzuki <utatane.tea@gmail.com>
1208 [DFG] Optimize WeakMap::get by adding intrinsic and fixup
1209 https://bugs.webkit.org/show_bug.cgi?id=176010
1211 Reviewed by Filip Pizlo.
1213 Add inlineGet method with HashTranslator.
1216 (WTF::X>::inlineGet const):
1217 (WTF::MappedTraits>::inlineGet const):
1218 (WTF::MappedTraits>::fastGet const): Deleted.
1219 * wtf/LoggingHashMap.h:
1221 2017-09-12 Keith Miller <keith_miller@apple.com>
1223 Do unified source builds for JSC
1224 https://bugs.webkit.org/show_bug.cgi?id=176076
1226 Reviewed by Geoffrey Garen.
1228 This patch adds a script that will automatically bundle source
1229 files, which is currently only used by the CMake build. It's
1230 important that we use the same script to generate the bundles
1231 for the CMake build as the Xcode build. If we didn't do this then
1232 it's likely that there would be build errors that occur in only
1233 one build system. On the same note, we also need to be careful to
1234 not bundle platform specific source files with platform
1235 independent ones. There are a couple of things the script does not
1236 currently handle but are not essential for the CMake build. First,
1237 it does not handle the max bundle size restrictions that the Xcode
1238 build will require. It also does not handle C files.
1240 The unified source generator script works by collecting groups of
1241 up to 8 files from the same directory. We don't bundle files from
1242 across directories since I didn't see a speedup from doing
1243 so. Additionally, splitting at the directory boundary means that
1244 it is less likely that adding a new file will force a "clean"
1245 build. This would happen because the new file will shift every
1246 subsequent file into the next unified source bundle.
1248 Using unified sources appears to be a roughly 3.5x build time
1249 speed up for clean builds on my MBP and appears to have a
1250 negligible effect in incremental builds.
1252 * generate-unified-source-bundles.rb: Added.
1255 2017-09-12 Joseph Pecoraro <pecoraro@apple.com>
1257 QualifiedName::init should assume AtomicStrings::init was already called
1258 https://bugs.webkit.org/show_bug.cgi?id=176639
1260 Reviewed by Sam Weinig.
1262 * wtf/NeverDestroyed.h:
1263 (WTF::LazyNeverDestroyed::isConstructed const):
1265 2017-09-12 Brent Fulgham <bfulgham@apple.com>
1267 Show punycode to user if a URL mixes Armenian Seh or Vo with other scripts
1268 https://bugs.webkit.org/show_bug.cgi?id=176578
1269 <rdar://problem/33906231>
1271 Reviewed by Alex Christensen.
1274 (WTF::isASCIIDigitOrPunctuation): Added helper function to recognize ASCII digits
1275 and punctuation characters.
1277 2017-09-12 Sam Weinig <sam@webkit.org>
1279 [Cleanup] Follow up cleanup for DOMFormData implementation
1280 https://bugs.webkit.org/show_bug.cgi?id=176740
1282 Reviewed by Alex Christensen.
1284 * WTF.xcodeproj/project.pbxproj:
1286 (WTF::KeyValuePair::KeyValuePair): Deleted.
1287 * wtf/KeyValuePair.h: Added.
1288 (WTF::KeyValuePair::KeyValuePair):
1289 (WTF::makeKeyValuePair):
1291 Move KeyValuePair to its own header and add a makeKeyValuePair helper.
1293 2017-09-11 Ryan Haddad <ryanhaddad@apple.com>
1295 Unreviewed, rolling out r221854.
1297 The test added with this change fails on 32-bit JSC bots.
1301 "[DFG] Optimize WeakMap::get by adding intrinsic and fixup"
1302 https://bugs.webkit.org/show_bug.cgi?id=176010
1303 http://trac.webkit.org/changeset/221854
1305 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com>
1307 [DFG] Optimize WeakMap::get by adding intrinsic and fixup
1308 https://bugs.webkit.org/show_bug.cgi?id=176010
1310 Reviewed by Filip Pizlo.
1312 Add inlineGet method with HashTranslator.
1315 (WTF::X>::inlineGet const):
1316 (WTF::MappedTraits>::inlineGet const):
1317 (WTF::MappedTraits>::fastGet const): Deleted.
1318 * wtf/LoggingHashMap.h:
1320 2017-09-07 Myles C. Maxfield <mmaxfield@apple.com>
1322 [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
1323 https://bugs.webkit.org/show_bug.cgi?id=176561
1325 Reviewed by Brent Fulgham.
1327 WebCore/platform/Language was the only* user of PlatformUserPreferredLanguages (with 1 exception).
1328 That exception is that JavaScriptCore needed the functionality of WebCore/platform/Language, but it
1329 couldn't get it because of the layering violation, so instead it erroneously called into
1330 PlatformUserPreferredLanguages instead. This patch merges these two files into WTF so JSC gets the
1331 right function and the PAL effort has one less file to move from WebCore/platform into PAL.
1333 * WTF.xcodeproj/project.pbxproj:
1334 * wtf/CMakeLists.txt:
1335 * wtf/Language.cpp: Renamed from Source/WebCore/platform/Language.cpp.
1336 (WTF::addLanguageChangeObserver):
1337 (WTF::userPreferredLanguages):
1338 * wtf/Language.h: Renamed from Source/WebCore/platform/Language.h.
1339 * wtf/PlatformGTK.cmake:
1340 * wtf/PlatformJSCOnly.cmake:
1341 * wtf/PlatformMac.cmake:
1342 * wtf/PlatformUserPreferredLanguages.h: Removed.
1343 * wtf/PlatformWPE.cmake:
1344 * wtf/PlatformWin.cmake:
1345 * wtf/cf/LanguageCF.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm.
1346 (WTF::httpStyleLanguageCode):
1347 (WTF::languagePreferencesDidChange):
1348 (WTF::platformUserPreferredLanguages):
1349 * wtf/unix/LanguageUnix.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesUnix.cpp.
1350 * wtf/win/LanguageWin.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesWin.cpp.
1352 2017-09-06 Eric Carlson <eric.carlson@apple.com>
1354 Require LoggingHelper overrides to provide identifier
1355 https://bugs.webkit.org/show_bug.cgi?id=176477
1357 Reviewed by Jer Noble.
1359 * wtf/Assertions.cpp: No more WTFLogLevelNotice.
1360 * wtf/Assertions.h: Ditto.
1362 2017-09-06 Per Arne Vollan <pvollan@apple.com>
1364 [Win] WebCore failed to build, InbandTextTrackPrivateAVF: base class undefined.
1365 https://bugs.webkit.org/show_bug.cgi?id=176431
1367 Reviewed by Alex Christensen.
1369 AVFoundation header detection should be done in WebCore because of build dependencies.
1371 * AVFoundationSupport.py: Removed.
1373 * wtf/PlatformWin.cmake:
1375 2017-09-05 Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com>
1377 [Win] Fix the wincairo build after r221558 and r221583
1378 https://bugs.webkit.org/show_bug.cgi?id=176353
1380 Reviewed by Yusuke Suzuki.
1382 * wtf/Assertions.cpp:
1384 2017-09-04 Eric Carlson <eric.carlson@apple.com>
1386 Switch HTMLMediaElement to release logging
1387 https://bugs.webkit.org/show_bug.cgi?id=176065
1389 Reviewed by Jer Noble.
1391 * wtf/MediaTime.cpp:
1392 (WTF::MediaTime::dump const): Use toString.
1393 (WTF::MediaTime::toString const): New.
1395 2017-09-04 Yusuke Suzuki <utatane.tea@gmail.com>
1397 Remove OS(SOLARIS) support
1398 https://bugs.webkit.org/show_bug.cgi?id=176341
1400 Reviewed by Sam Weinig.
1402 WebKit project does not have stake holders supporting Solaris right now.
1403 And Solaris + SPARC in 64bit environment does not work well since its
1404 address space includes non-48bit area. It breaks our JSVALUE64 in JSC.
1405 In addition, Solaris a bit complicates our threading implementation
1406 because of its special threading stack.
1408 This patch removes OS(SOLARIS) and COMPILER(SUNCC) support from WebKit.
1413 (std::isfinite): Deleted.
1414 (std::signbit): Deleted.
1415 (std::isinf): Deleted.
1416 * wtf/NumberOfCores.cpp:
1417 (WTF::numberOfProcessorCores):
1419 * wtf/StackBounds.cpp:
1420 * wtf/ThreadingPthreads.cpp:
1422 2017-09-04 Commit Queue <commit-queue@webkit.org>
1424 Unreviewed, rolling out r221494 and r221500.
1425 https://bugs.webkit.org/show_bug.cgi?id=176258
1427 This caused the windows build to fail. (Requested by mlewis13
1430 Reverted changesets:
1432 "Switch HTMLMediaElement to release logging"
1433 https://bugs.webkit.org/show_bug.cgi?id=176065
1434 http://trac.webkit.org/changeset/221494
1436 "Switch HTMLMediaElement to release logging"
1437 https://bugs.webkit.org/show_bug.cgi?id=176065
1438 http://trac.webkit.org/changeset/221500
1440 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com>
1442 Remove "malloc" and "free" use
1443 https://bugs.webkit.org/show_bug.cgi?id=176310
1445 Reviewed by Darin Adler.
1449 * wtf/Assertions.cpp:
1451 2017-09-04 Yusuke Suzuki <utatane.tea@gmail.com>
1453 Unreviewed, support libstdc++ use with clang
1454 https://bugs.webkit.org/show_bug.cgi?id=176301
1458 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com>
1460 [WTF] Add C++03 allocator interface for GCC < 6
1461 https://bugs.webkit.org/show_bug.cgi?id=176301
1463 Reviewed by Darin Adler.
1465 Unfortunately, std::list in GCC < 6 does not support C++11 allocator interface.
1466 This patch adds C++03 allocator interface to FastAllocator to make it usable
1467 for std::list. It also allows us to use FastAllocator for data structures that
1468 only support C++03 interface.
1471 (WTF::FastAllocator::allocate):
1472 (WTF::FastAllocator::construct):
1473 (WTF::FastAllocator::destroy):
1474 (WTF::FastAllocator::max_size const):
1475 (WTF::FastAllocator::select_on_container_copy_construction const):
1477 2017-09-03 Chris Dumez <cdumez@apple.com>
1479 Unreviewed, rolling out r221552.
1485 "[WTF] Add C++03 allocator interface for GCC < 6"
1486 https://bugs.webkit.org/show_bug.cgi?id=176301
1487 http://trac.webkit.org/changeset/221552
1489 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com>
1491 [WTF] Add C++03 allocator interface for GCC < 6
1492 https://bugs.webkit.org/show_bug.cgi?id=176301
1494 Reviewed by Darin Adler.
1496 Unfortunately, std::list in GCC < 6 does not support C++11 allocator interface.
1497 This patch adds C++03 allocator interface to FastAllocator to make it usable
1498 for std::list. It also allows us to use FastAllocator for data structures that
1499 only support C++03 interface.
1502 (WTF::FastAllocator::allocate):
1503 (WTF::FastAllocator::construct):
1504 (WTF::FastAllocator::destroy):
1505 (WTF::FastAllocator::max_size const):
1506 (WTF::FastAllocator::select_on_container_copy_construction const):
1508 2017-09-03 Sam Weinig <sam@webkit.org>
1511 https://bugs.webkit.org/show_bug.cgi?id=176288
1513 Reviewed by Yusuke Suzuki.
1515 CanvasProxy does not appear to be in any current HTML spec
1516 and was disabled and unimplemented in our tree. Time to
1519 * wtf/FeatureDefines.h:
1521 2017-09-01 Eric Carlson <eric.carlson@apple.com>
1523 Switch HTMLMediaElement to release logging
1524 https://bugs.webkit.org/show_bug.cgi?id=176065
1526 Reviewed by Jer Noble.
1528 * wtf/MediaTime.cpp:
1529 (WTF::MediaTime::dump const): Use toString.
1530 (WTF::MediaTime::toString const): New.
1532 (PAL::LogArgument<WTF::MediaTime>::toString): Logger template.
1534 2017-08-31 Don Olmstead <don.olmstead@sony.com>
1536 [CMake] Make USE_CF conditional within Windows
1537 https://bugs.webkit.org/show_bug.cgi?id=176173
1539 Reviewed by Alex Christensen.
1542 * wtf/PlatformWin.cmake:
1544 2017-08-31 Ryan Haddad <ryanhaddad@apple.com>
1546 Unreviewed, rolling out r221445.
1548 This change broke Sierra Release builds.
1552 "Switch HTMLMediaElement to release logging"
1553 https://bugs.webkit.org/show_bug.cgi?id=176065
1554 http://trac.webkit.org/changeset/221445
1556 2017-08-31 Eric Carlson <eric.carlson@apple.com>
1558 Switch HTMLMediaElement to release logging
1559 https://bugs.webkit.org/show_bug.cgi?id=176065
1561 Reviewed by Jer Noble.
1563 * wtf/MediaTime.cpp:
1564 (WTF::MediaTime::dump const): Use toString.
1565 (WTF::MediaTime::toString const): New.
1567 (PAL::LogArgument<WTF::MediaTime>::toString): Logger template.
1569 2017-08-31 Filip Pizlo <fpizlo@apple.com>
1571 All of the different ArrayBuffer::data's should be CagedPtr<>
1572 https://bugs.webkit.org/show_bug.cgi?id=175515
1574 Reviewed by Michael Saboff.
1576 Added a specialization so that CagedPtr<void> is valid.
1580 2017-08-31 Per Arne Vollan <pvollan@apple.com>
1582 [Win] Crash under WorkQueue::performWorkOnRegisteredWorkThread in layout tests.
1583 https://bugs.webkit.org/show_bug.cgi?id=176163
1585 Reviewed by Alex Christensen.
1587 My previous attempt at fixing this crash in <http://trac.webkit.org/changeset/221323>
1588 was incorrect, since it is still crashing on the bot(s). The current theory of why this
1589 is failing is that the WorkQueue object deletes itself in the middle of the
1590 performWorkOnRegisteredWorkThread method when calling deref(). There is no need to
1591 increase the reference count of the work queue for each function we want to call on the
1592 work thread. It is sufficient to increase it for every work thread we start, and then
1593 dereference it when the thread ends. We should also not attempt to access members after
1594 the deref() call, which can potentially be unsafe.
1596 * wtf/win/WorkQueueWin.cpp:
1597 (WTF::WorkQueue::workThreadCallback):
1598 (WTF::WorkQueue::performWorkOnRegisteredWorkThread):
1599 (WTF::WorkQueue::dispatch):
1601 2017-08-22 Filip Pizlo <fpizlo@apple.com>
1603 Strings need to be in some kind of gigacage
1604 https://bugs.webkit.org/show_bug.cgi?id=174924
1606 Reviewed by Oliver Hunt.
1608 This makes all strings allocations come from the string gigacage. Because we expect string allocation
1609 to be a hot path, I created specialized allocation paths for the string gigacage. These paths are
1610 accessible via <wtf/text/StringMalloc.h>. However, those paths are equivalent to saying
1611 Gigacage::malloc and friends with the Gigacage::String kind.
1613 * WTF.xcodeproj/project.pbxproj:
1614 * wtf/CMakeLists.txt:
1616 * wtf/FastMalloc.cpp:
1619 (WTF::FastMalloc::malloc):
1620 (WTF::FastMalloc::tryMalloc):
1621 (WTF::FastMalloc::realloc):
1622 (WTF::FastMalloc::free):
1625 (Gigacage::tryMalloc):
1629 (WTF::VectorBufferBase::allocateBuffer):
1630 (WTF::VectorBufferBase::tryAllocateBuffer):
1631 (WTF::VectorBufferBase::reallocateBuffer):
1632 (WTF::VectorBufferBase::deallocateBuffer):
1633 (WTF::Malloc>::Vector):
1635 (WTF::Malloc>::contains const):
1636 (WTF::Malloc>::findMatching const):
1637 (WTF::Malloc>::find const):
1638 (WTF::Malloc>::reverseFind const):
1639 (WTF::Malloc>::appendIfNotContains):
1640 (WTF::Malloc>::fill):
1641 (WTF::Malloc>::appendRange):
1642 (WTF::Malloc>::expandCapacity):
1643 (WTF::Malloc>::tryExpandCapacity):
1644 (WTF::Malloc>::resize):
1645 (WTF::Malloc>::resizeToFit):
1646 (WTF::Malloc>::shrink):
1647 (WTF::Malloc>::grow):
1648 (WTF::Malloc>::asanSetInitialBufferSizeTo):
1649 (WTF::Malloc>::asanSetBufferSizeToFullCapacity):
1650 (WTF::Malloc>::asanBufferSizeWillChangeTo):
1651 (WTF::Malloc>::reserveCapacity):
1652 (WTF::Malloc>::tryReserveCapacity):
1653 (WTF::Malloc>::reserveInitialCapacity):
1654 (WTF::Malloc>::shrinkCapacity):
1655 (WTF::Malloc>::append):
1656 (WTF::Malloc>::tryAppend):
1657 (WTF::Malloc>::constructAndAppend):
1658 (WTF::Malloc>::tryConstructAndAppend):
1659 (WTF::Malloc>::appendSlowCase):
1660 (WTF::Malloc>::constructAndAppendSlowCase):
1661 (WTF::Malloc>::tryConstructAndAppendSlowCase):
1662 (WTF::Malloc>::uncheckedAppend):
1663 (WTF::Malloc>::appendVector):
1664 (WTF::Malloc>::insert):
1665 (WTF::Malloc>::insertVector):
1666 (WTF::Malloc>::remove):
1667 (WTF::Malloc>::removeFirst):
1668 (WTF::Malloc>::removeFirstMatching):
1669 (WTF::Malloc>::removeAll):
1670 (WTF::Malloc>::removeAllMatching):
1671 (WTF::Malloc>::reverse):
1672 (WTF::Malloc>::map const):
1673 (WTF::Malloc>::releaseBuffer):
1674 (WTF::Malloc>::checkConsistency):
1678 (WTF::removeRepeatedElements):
1679 (WTF::minCapacity>::Vector): Deleted.
1680 (WTF::minCapacity>::contains const): Deleted.
1681 (WTF::minCapacity>::findMatching const): Deleted.
1682 (WTF::minCapacity>::find const): Deleted.
1683 (WTF::minCapacity>::reverseFind const): Deleted.
1684 (WTF::minCapacity>::appendIfNotContains): Deleted.
1685 (WTF::minCapacity>::fill): Deleted.
1686 (WTF::minCapacity>::appendRange): Deleted.
1687 (WTF::minCapacity>::expandCapacity): Deleted.
1688 (WTF::minCapacity>::tryExpandCapacity): Deleted.
1689 (WTF::minCapacity>::resize): Deleted.
1690 (WTF::minCapacity>::resizeToFit): Deleted.
1691 (WTF::minCapacity>::shrink): Deleted.
1692 (WTF::minCapacity>::grow): Deleted.
1693 (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted.
1694 (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted.
1695 (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted.
1696 (WTF::minCapacity>::reserveCapacity): Deleted.
1697 (WTF::minCapacity>::tryReserveCapacity): Deleted.
1698 (WTF::minCapacity>::reserveInitialCapacity): Deleted.
1699 (WTF::minCapacity>::shrinkCapacity): Deleted.
1700 (WTF::minCapacity>::append): Deleted.
1701 (WTF::minCapacity>::tryAppend): Deleted.
1702 (WTF::minCapacity>::constructAndAppend): Deleted.
1703 (WTF::minCapacity>::tryConstructAndAppend): Deleted.
1704 (WTF::minCapacity>::appendSlowCase): Deleted.
1705 (WTF::minCapacity>::constructAndAppendSlowCase): Deleted.
1706 (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted.
1707 (WTF::minCapacity>::uncheckedAppend): Deleted.
1708 (WTF::minCapacity>::appendVector): Deleted.
1709 (WTF::minCapacity>::insert): Deleted.
1710 (WTF::minCapacity>::insertVector): Deleted.
1711 (WTF::minCapacity>::remove): Deleted.
1712 (WTF::minCapacity>::removeFirst): Deleted.
1713 (WTF::minCapacity>::removeFirstMatching): Deleted.
1714 (WTF::minCapacity>::removeAll): Deleted.
1715 (WTF::minCapacity>::removeAllMatching): Deleted.
1716 (WTF::minCapacity>::reverse): Deleted.
1717 (WTF::minCapacity>::map const): Deleted.
1718 (WTF::minCapacity>::releaseBuffer): Deleted.
1719 (WTF::minCapacity>::checkConsistency): Deleted.
1720 * wtf/text/AtomicStringImpl.h:
1721 * wtf/text/CString.cpp:
1722 (WTF::CStringBuffer::createUninitialized):
1723 * wtf/text/CString.h:
1724 * wtf/text/StringBuffer.h:
1725 (WTF::StringBuffer::StringBuffer):
1726 (WTF::StringBuffer::~StringBuffer):
1727 (WTF::StringBuffer::resize):
1728 * wtf/text/StringImpl.cpp:
1729 (WTF::StringImpl::~StringImpl):
1730 (WTF::StringImpl::destroy):
1731 (WTF::StringImpl::createUninitializedInternalNonEmpty):
1732 (WTF::StringImpl::reallocateInternal):
1733 (WTF::StringImpl::releaseAssertCaged const):
1734 * wtf/text/StringImpl.h:
1735 (WTF::StringImpl::createSubstringSharingImpl):
1736 (WTF::StringImpl::tryCreateUninitialized):
1737 (WTF::StringImpl::adopt):
1738 (WTF::StringImpl::bufferOwnership const):
1739 (WTF::StringImpl::assertCaged const):
1740 * wtf/text/StringMalloc.cpp: Added.
1741 (WTF::tryStringMalloc):
1742 (WTF::stringMalloc):
1743 (WTF::stringRealloc):
1745 * wtf/text/StringMalloc.h: Added.
1746 (WTF::StringMalloc::malloc):
1747 (WTF::StringMalloc::tryMalloc):
1748 (WTF::StringMalloc::realloc):
1749 (WTF::StringMalloc::free):
1750 * wtf/text/StringVector.h: Added.
1751 * wtf/text/SymbolImpl.h:
1752 * wtf/text/UniquedStringImpl.h:
1753 * wtf/text/WTFString.h:
1754 (WTF::String::adopt):
1755 (WTF::String::assertCaged const):
1756 (WTF::String::releaseAssertCaged const):
1758 2017-08-30 Chris Dumez <cdumez@apple.com>
1760 Implement FileSystemDirectoryReader.readEntries()
1761 https://bugs.webkit.org/show_bug.cgi?id=176091
1762 <rdar://problem/34168015>
1764 Reviewed by Andreas Kling.
1766 * wtf/CrossThreadCopier.h:
1767 (WTF::crossThreadCopy):
1768 * wtf/CrossThreadTask.h:
1769 Move crossThreadCopy() from CrossThreadTask.h to CrossThreadCopier.h and
1770 add "using WTF::crossThreadCopy" statement to make it more easily usable
1773 2017-08-30 Matt Lewis <jlewis3@apple.com>
1775 Unreviewed, rolling out r221384.
1777 This patch caused multiple 32-bit JSC test failures.
1781 "Strings need to be in some kind of gigacage"
1782 https://bugs.webkit.org/show_bug.cgi?id=174924
1783 http://trac.webkit.org/changeset/221384
1785 2017-08-30 Brady Eidson <beidson@apple.com>
1787 Add "Identified" base class to replace a whole bunch of custom identifier generators.
1788 https://bugs.webkit.org/show_bug.cgi?id=176120
1790 Reviewed by Alex Christensen.
1792 * WTF.xcodeproj/project.pbxproj:
1793 * wtf/Identified.h: Added.
1794 (WTF::IdentifiedBase::identifier const):
1795 (WTF::IdentifiedBase::IdentifiedBase):
1796 (WTF::Identified::Identified):
1797 (WTF::ThreadSafeIdentified::ThreadSafeIdentified):
1799 2017-08-22 Filip Pizlo <fpizlo@apple.com>
1801 Strings need to be in some kind of gigacage
1802 https://bugs.webkit.org/show_bug.cgi?id=174924
1804 Reviewed by Oliver Hunt.
1806 This makes all strings allocations come from the string gigacage. Because we expect string allocation
1807 to be a hot path, I created specialized allocation paths for the string gigacage. These paths are
1808 accessible via <wtf/text/StringMalloc.h>. However, those paths are equivalent to saying
1809 Gigacage::malloc and friends with the Gigacage::String kind.
1811 * WTF.xcodeproj/project.pbxproj:
1812 * wtf/CMakeLists.txt:
1814 * wtf/FastMalloc.cpp:
1817 (WTF::FastMalloc::malloc):
1818 (WTF::FastMalloc::tryMalloc):
1819 (WTF::FastMalloc::realloc):
1820 (WTF::FastMalloc::free):
1823 (Gigacage::tryMalloc):
1827 (WTF::VectorBufferBase::allocateBuffer):
1828 (WTF::VectorBufferBase::tryAllocateBuffer):
1829 (WTF::VectorBufferBase::reallocateBuffer):
1830 (WTF::VectorBufferBase::deallocateBuffer):
1831 (WTF::Malloc>::Vector):
1833 (WTF::Malloc>::contains const):
1834 (WTF::Malloc>::findMatching const):
1835 (WTF::Malloc>::find const):
1836 (WTF::Malloc>::reverseFind const):
1837 (WTF::Malloc>::appendIfNotContains):
1838 (WTF::Malloc>::fill):
1839 (WTF::Malloc>::appendRange):
1840 (WTF::Malloc>::expandCapacity):
1841 (WTF::Malloc>::tryExpandCapacity):
1842 (WTF::Malloc>::resize):
1843 (WTF::Malloc>::resizeToFit):
1844 (WTF::Malloc>::shrink):
1845 (WTF::Malloc>::grow):
1846 (WTF::Malloc>::asanSetInitialBufferSizeTo):
1847 (WTF::Malloc>::asanSetBufferSizeToFullCapacity):
1848 (WTF::Malloc>::asanBufferSizeWillChangeTo):
1849 (WTF::Malloc>::reserveCapacity):
1850 (WTF::Malloc>::tryReserveCapacity):
1851 (WTF::Malloc>::reserveInitialCapacity):
1852 (WTF::Malloc>::shrinkCapacity):
1853 (WTF::Malloc>::append):
1854 (WTF::Malloc>::tryAppend):
1855 (WTF::Malloc>::constructAndAppend):
1856 (WTF::Malloc>::tryConstructAndAppend):
1857 (WTF::Malloc>::appendSlowCase):
1858 (WTF::Malloc>::constructAndAppendSlowCase):
1859 (WTF::Malloc>::tryConstructAndAppendSlowCase):
1860 (WTF::Malloc>::uncheckedAppend):
1861 (WTF::Malloc>::appendVector):
1862 (WTF::Malloc>::insert):
1863 (WTF::Malloc>::insertVector):
1864 (WTF::Malloc>::remove):
1865 (WTF::Malloc>::removeFirst):
1866 (WTF::Malloc>::removeFirstMatching):
1867 (WTF::Malloc>::removeAll):
1868 (WTF::Malloc>::removeAllMatching):
1869 (WTF::Malloc>::reverse):
1870 (WTF::Malloc>::map const):
1871 (WTF::Malloc>::releaseBuffer):
1872 (WTF::Malloc>::checkConsistency):
1876 (WTF::removeRepeatedElements):
1877 (WTF::minCapacity>::Vector): Deleted.
1878 (WTF::minCapacity>::contains const): Deleted.
1879 (WTF::minCapacity>::findMatching const): Deleted.
1880 (WTF::minCapacity>::find const): Deleted.
1881 (WTF::minCapacity>::reverseFind const): Deleted.
1882 (WTF::minCapacity>::appendIfNotContains): Deleted.
1883 (WTF::minCapacity>::fill): Deleted.
1884 (WTF::minCapacity>::appendRange): Deleted.
1885 (WTF::minCapacity>::expandCapacity): Deleted.
1886 (WTF::minCapacity>::tryExpandCapacity): Deleted.
1887 (WTF::minCapacity>::resize): Deleted.
1888 (WTF::minCapacity>::resizeToFit): Deleted.
1889 (WTF::minCapacity>::shrink): Deleted.
1890 (WTF::minCapacity>::grow): Deleted.
1891 (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted.
1892 (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted.
1893 (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted.
1894 (WTF::minCapacity>::reserveCapacity): Deleted.
1895 (WTF::minCapacity>::tryReserveCapacity): Deleted.
1896 (WTF::minCapacity>::reserveInitialCapacity): Deleted.
1897 (WTF::minCapacity>::shrinkCapacity): Deleted.
1898 (WTF::minCapacity>::append): Deleted.
1899 (WTF::minCapacity>::tryAppend): Deleted.
1900 (WTF::minCapacity>::constructAndAppend): Deleted.
1901 (WTF::minCapacity>::tryConstructAndAppend): Deleted.
1902 (WTF::minCapacity>::appendSlowCase): Deleted.
1903 (WTF::minCapacity>::constructAndAppendSlowCase): Deleted.
1904 (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted.
1905 (WTF::minCapacity>::uncheckedAppend): Deleted.
1906 (WTF::minCapacity>::appendVector): Deleted.
1907 (WTF::minCapacity>::insert): Deleted.
1908 (WTF::minCapacity>::insertVector): Deleted.
1909 (WTF::minCapacity>::remove): Deleted.
1910 (WTF::minCapacity>::removeFirst): Deleted.
1911 (WTF::minCapacity>::removeFirstMatching): Deleted.
1912 (WTF::minCapacity>::removeAll): Deleted.
1913 (WTF::minCapacity>::removeAllMatching): Deleted.
1914 (WTF::minCapacity>::reverse): Deleted.
1915 (WTF::minCapacity>::map const): Deleted.
1916 (WTF::minCapacity>::releaseBuffer): Deleted.
1917 (WTF::minCapacity>::checkConsistency): Deleted.
1918 * wtf/text/AtomicStringImpl.h:
1919 * wtf/text/CString.cpp:
1920 (WTF::CStringBuffer::createUninitialized):
1921 * wtf/text/CString.h:
1922 * wtf/text/StringBuffer.h:
1923 (WTF::StringBuffer::StringBuffer):
1924 (WTF::StringBuffer::~StringBuffer):
1925 (WTF::StringBuffer::resize):
1926 * wtf/text/StringImpl.cpp:
1927 (WTF::StringImpl::~StringImpl):
1928 (WTF::StringImpl::destroy):
1929 (WTF::StringImpl::createUninitializedInternalNonEmpty):
1930 (WTF::StringImpl::reallocateInternal):
1931 (WTF::StringImpl::releaseAssertCaged const):
1932 * wtf/text/StringImpl.h:
1933 (WTF::StringImpl::createSubstringSharingImpl):
1934 (WTF::StringImpl::tryCreateUninitialized):
1935 (WTF::StringImpl::adopt):
1936 (WTF::StringImpl::bufferOwnership const):
1937 (WTF::StringImpl::assertCaged const):
1938 * wtf/text/StringMalloc.cpp: Added.
1939 (WTF::tryStringMalloc):
1940 (WTF::stringMalloc):
1941 (WTF::stringRealloc):
1943 * wtf/text/StringMalloc.h: Added.
1944 (WTF::StringMalloc::malloc):
1945 (WTF::StringMalloc::tryMalloc):
1946 (WTF::StringMalloc::realloc):
1947 (WTF::StringMalloc::free):
1948 * wtf/text/StringVector.h: Added.
1949 * wtf/text/SymbolImpl.h:
1950 * wtf/text/UniquedStringImpl.h:
1951 * wtf/text/WTFString.h:
1952 (WTF::String::adopt):
1953 (WTF::String::assertCaged const):
1954 (WTF::String::releaseAssertCaged const):
1956 2017-08-28 Yusuke Suzuki <utatane.tea@gmail.com>
1958 [JSC] Use table based approach for JSON.stringify's Quote
1959 https://bugs.webkit.org/show_bug.cgi?id=176044
1961 Reviewed by Darin Adler.
1963 We change escape operation of JSON Quote from branch-based to table-based.
1964 This patch partially adopts SpiderMonkey's change to StringBuilderJSON.cpp
1965 to optimize this escaping operation. We separate changes from StringBuilder.cpp
1966 to apply MPL to StringBuilderJSON.cpp file. Since WebKit already adopts MPL in
1967 some files (like, DateMath.h), it is acceptable.
1969 Kraken json-stringify-tinderbox shows 7.2% improvement.
1973 json-stringify-tinderbox 40.429+-0.771 ^ 37.693+-0.862 ^ definitely 1.0726x faster
1975 * WTF.xcodeproj/project.pbxproj:
1976 * wtf/CMakeLists.txt:
1977 * wtf/text/StringBuilder.cpp:
1978 (WTF::appendQuotedJSONStringInternalSlow): Deleted.
1979 (WTF::appendQuotedJSONStringInternal): Deleted.
1980 (WTF::StringBuilder::appendQuotedJSONString): Deleted.
1981 * wtf/text/StringBuilderJSON.cpp: Added.
1982 (WTF::appendQuotedJSONStringInternal):
1983 (WTF::StringBuilder::appendQuotedJSONString):
1985 2017-08-29 Per Arne Vollan <pvollan@apple.com>
1987 [Win] Crash under WorkQueue::performWorkOnRegisteredWorkThread in layout tests.
1988 https://bugs.webkit.org/show_bug.cgi?id=176064
1990 Reviewed by Saam Barati.
1992 The crash log indicates that the function pointer is null in this case.
1994 * wtf/win/WorkQueueWin.cpp:
1995 (WTF::WorkQueue::dispatch):
1997 2017-08-28 Andy Estes <aestes@apple.com>
1999 [Cocoa] Upstream WKGetWebDefaultCFStringEncoding()
2000 https://bugs.webkit.org/show_bug.cgi?id=176039
2002 Reviewed by Alex Christensen.
2004 * wtf/spi/cf/CFStringSPI.h:
2006 2017-08-26 Yusuke Suzuki <utatane.tea@gmail.com>
2008 Unreviewed, suppress warnings in GTK port
2010 Add printf format attribute.
2012 * wtf/text/WTFString.cpp:
2014 2017-08-25 Eric Carlson <eric.carlson@apple.com>
2016 Add Logger::logAlways
2017 https://bugs.webkit.org/show_bug.cgi?id=175996
2019 Reviewed by Jer Noble.
2021 * wtf/Assertions.cpp:
2024 2017-08-25 Daniel Bates <dabates@apple.com>
2026 Demarcate code added due to lack of NSDMI for aggregates
2027 https://bugs.webkit.org/show_bug.cgi?id=175990
2029 Reviewed by Andy Estes.
2033 2017-08-25 Don Olmstead <don.olmstead@sony.com>
2035 Define *_GIGACAGE_MASK when Gigacage is not supported
2036 https://bugs.webkit.org/show_bug.cgi?id=175994
2038 Reviewed by Mark Lam.
2042 2017-08-25 Eric Carlson <eric.carlson@apple.com>
2044 Add String::format variant that takes va_args
2045 https://bugs.webkit.org/show_bug.cgi?id=175988
2047 Reviewed by Jer Noble.
2049 * wtf/text/WTFString.cpp:
2050 (WTF::createWithFormatAndArguments): Created with the guts of String::format.
2051 (WTF::String::formatWithArguments): New, call createWithFormatAndArguments.
2052 (WTF::String::format): Move logic to createWithFormatAndArguments, use it.
2053 * wtf/text/WTFString.h:
2055 2017-08-25 Saam Barati <sbarati@apple.com>
2057 Support compiling catch in the DFG
2058 https://bugs.webkit.org/show_bug.cgi?id=174590
2059 <rdar://problem/34047845>
2061 Reviewed by Filip Pizlo.
2063 This patch generalizes the BackwardsGraph fake root into a more generalizable
2064 class called SingleRootGraph. SingleRootGraph exposes the general graph interface
2065 used in Dominators and NaturalLoops. SingleRootGraph takes as input a graph with
2066 the normal graph interface, but also allows the input graph to contain more than
2067 one root. SingleRootGraph then exposes a single root, which it creates, that has
2068 an outgoing edge to all the roots in the original graph.
2070 * WTF.xcodeproj/project.pbxproj:
2071 * wtf/BackwardsGraph.h:
2072 (WTF::BackwardsGraph::dump const):
2073 (WTF::BackwardsGraph::rootName): Deleted.
2074 (WTF::BackwardsGraph::Node::Node): Deleted.
2075 (WTF::BackwardsGraph::Node::root): Deleted.
2076 (WTF::BackwardsGraph::Node::operator== const): Deleted.
2077 (WTF::BackwardsGraph::Node::operator!= const): Deleted.
2078 (WTF::BackwardsGraph::Node::operator bool const): Deleted.
2079 (WTF::BackwardsGraph::Node::isRoot const): Deleted.
2080 (WTF::BackwardsGraph::Node::node const): Deleted.
2082 (WTF::BackwardsGraph::Set::Set): Deleted.
2083 (WTF::BackwardsGraph::Set::add): Deleted.
2084 (WTF::BackwardsGraph::Set::remove): Deleted.
2085 (WTF::BackwardsGraph::Set::contains): Deleted.
2086 (WTF::BackwardsGraph::Set::dump const): Deleted.
2087 (WTF::BackwardsGraph::Map::Map): Deleted.
2088 (WTF::BackwardsGraph::Map::clear): Deleted.
2089 (WTF::BackwardsGraph::Map::size const): Deleted.
2090 (WTF::BackwardsGraph::Map::operator[]): Deleted.
2091 (WTF::BackwardsGraph::Map::operator[] const): Deleted.
2093 (WTF::Dominators::Dominators):
2094 (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOf):
2095 (WTF::Dominators::forAllBlocksInPrunedIteratedDominanceFrontierOf):
2096 (WTF::Dominators::iteratedDominanceFrontierOf const):
2097 (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl const):
2098 * wtf/SingleRootGraph.h: Added.
2099 (WTF::SingleRootGraphNode::rootName):
2100 (WTF::SingleRootGraphNode::SingleRootGraphNode):
2101 (WTF::SingleRootGraphNode::root):
2102 (WTF::SingleRootGraphNode::operator== const):
2103 (WTF::SingleRootGraphNode::operator!= const):
2104 (WTF::SingleRootGraphNode::operator bool const):
2105 (WTF::SingleRootGraphNode::isRoot const):
2106 (WTF::SingleRootGraphNode::node const):
2107 (WTF::SingleRootGraphSet::add):
2108 (WTF::SingleRootGraphSet::remove):
2109 (WTF::SingleRootGraphSet::contains):
2110 (WTF::SingleRootGraphSet::dump const):
2111 (WTF::SingleRootMap::SingleRootMap):
2112 (WTF::SingleRootMap::clear):
2113 (WTF::SingleRootMap::size const):
2114 (WTF::SingleRootMap::operator[]):
2115 (WTF::SingleRootMap::operator[] const):
2116 (WTF::SingleRootGraph::SingleRootGraph):
2117 (WTF::SingleRootGraph::root const):
2118 (WTF::SingleRootGraph::newMap):
2119 (WTF::SingleRootGraph::successors const):
2120 (WTF::SingleRootGraph::predecessors const):
2121 (WTF::SingleRootGraph::index const):
2122 (WTF::SingleRootGraph::node const):
2123 (WTF::SingleRootGraph::numNodes const):
2124 (WTF::SingleRootGraph::dump const):
2125 (WTF::SingleRootGraph::assertIsConsistent const):
2127 2017-08-24 Commit Queue <commit-queue@webkit.org>
2129 Unreviewed, rolling out r221119, r221124, and r221143.
2130 https://bugs.webkit.org/show_bug.cgi?id=175973
2132 "I think it regressed JSBench by 20%" (Requested by saamyjoon
2135 Reverted changesets:
2137 "Support compiling catch in the DFG"
2138 https://bugs.webkit.org/show_bug.cgi?id=174590
2139 http://trac.webkit.org/changeset/221119
2141 "Unreviewed, build fix in GTK port"
2142 https://bugs.webkit.org/show_bug.cgi?id=174590
2143 http://trac.webkit.org/changeset/221124
2145 "DFG::JITCode::osrEntry should get sorted since we perform a
2146 binary search on it"
2147 https://bugs.webkit.org/show_bug.cgi?id=175893
2148 http://trac.webkit.org/changeset/221143
2150 2017-08-23 Filip Pizlo <fpizlo@apple.com>
2152 Reduce Gigacage sizes
2153 https://bugs.webkit.org/show_bug.cgi?id=175920
2155 Reviewed by Mark Lam.
2157 Provide filler API for the no-bmalloc/no-Gigacage case.
2162 2017-08-23 Yusuke Suzuki <utatane.tea@gmail.com>
2164 Unreviewed, build fix in GTK port
2165 https://bugs.webkit.org/show_bug.cgi?id=174590
2167 * wtf/SingleRootGraph.h:
2168 (WTF::SingleRootGraph::successors const):
2169 (WTF::SingleRootGraph::predecessors const):
2171 2017-08-23 Saam Barati <sbarati@apple.com>
2173 Support compiling catch in the DFG
2174 https://bugs.webkit.org/show_bug.cgi?id=174590
2176 Reviewed by Filip Pizlo.
2178 This patch generalizes the BackwardsGraph fake root into a more generalizable
2179 class called SingleRootGraph. SingleRootGraph exposes the general graph interface
2180 used in Dominators and NaturalLoops. SingleRootGraph takes as input a graph with
2181 the normal graph interface, but also allows the input graph to contain more than
2182 one root. SingleRootGraph then exposes a single root, which it creates, that has
2183 an outgoing edge to all the roots in the original graph.
2185 * WTF.xcodeproj/project.pbxproj:
2186 * wtf/BackwardsGraph.h:
2187 (WTF::BackwardsGraph::dump const):
2188 (WTF::BackwardsGraph::rootName): Deleted.
2189 (WTF::BackwardsGraph::Node::Node): Deleted.
2190 (WTF::BackwardsGraph::Node::root): Deleted.
2191 (WTF::BackwardsGraph::Node::operator== const): Deleted.
2192 (WTF::BackwardsGraph::Node::operator!= const): Deleted.
2193 (WTF::BackwardsGraph::Node::operator bool const): Deleted.
2194 (WTF::BackwardsGraph::Node::isRoot const): Deleted.
2195 (WTF::BackwardsGraph::Node::node const): Deleted.
2197 (WTF::BackwardsGraph::Set::Set): Deleted.
2198 (WTF::BackwardsGraph::Set::add): Deleted.
2199 (WTF::BackwardsGraph::Set::remove): Deleted.
2200 (WTF::BackwardsGraph::Set::contains): Deleted.
2201 (WTF::BackwardsGraph::Set::dump const): Deleted.
2202 (WTF::BackwardsGraph::Map::Map): Deleted.
2203 (WTF::BackwardsGraph::Map::clear): Deleted.
2204 (WTF::BackwardsGraph::Map::size const): Deleted.
2205 (WTF::BackwardsGraph::Map::operator[]): Deleted.
2206 (WTF::BackwardsGraph::Map::operator[] const): Deleted.
2208 (WTF::Dominators::Dominators):
2209 (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOf):
2210 (WTF::Dominators::forAllBlocksInPrunedIteratedDominanceFrontierOf):
2211 (WTF::Dominators::iteratedDominanceFrontierOf const):
2212 (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl const):
2213 * wtf/SingleRootGraph.h: Added.
2214 (WTF::SingleRootGraphNode::rootName):
2215 (WTF::SingleRootGraphNode::SingleRootGraphNode):
2216 (WTF::SingleRootGraphNode::root):
2217 (WTF::SingleRootGraphNode::operator== const):
2218 (WTF::SingleRootGraphNode::operator!= const):
2219 (WTF::SingleRootGraphNode::operator bool const):
2220 (WTF::SingleRootGraphNode::isRoot const):
2221 (WTF::SingleRootGraphNode::node const):
2222 (WTF::SingleRootGraphSet::add):
2223 (WTF::SingleRootGraphSet::remove):
2224 (WTF::SingleRootGraphSet::contains):
2225 (WTF::SingleRootGraphSet::dump const):
2226 (WTF::SingleRootMap::SingleRootMap):
2227 (WTF::SingleRootMap::clear):
2228 (WTF::SingleRootMap::size const):
2229 (WTF::SingleRootMap::operator[]):
2230 (WTF::SingleRootMap::operator[] const):
2231 (WTF::SingleRootGraph::SingleRootGraph):
2232 (WTF::SingleRootGraph::root const):
2233 (WTF::SingleRootGraph::newMap):
2234 (WTF::SingleRootGraph::successors const):
2235 (WTF::SingleRootGraph::predecessors const):
2236 (WTF::SingleRootGraph::index const):
2237 (WTF::SingleRootGraph::node const):
2238 (WTF::SingleRootGraph::numNodes const):
2239 (WTF::SingleRootGraph::dump const):
2240 (WTF::SingleRootGraph::assertIsConsistent const):
2242 2017-08-23 Youenn Fablet <youenn@apple.com>
2244 [Cache API] Enable persistent coder to encode FetchOptions
2245 https://bugs.webkit.org/show_bug.cgi?id=175883
2247 Reviewed by Alex Christensen.
2249 Enabling encoding/decoding of enums with EnumTraits.
2250 This code is similar to the one of IPC encoder/decoder.
2252 * wtf/persistence/PersistentDecoder.h:
2253 (WTF::Persistence::Decoder::decode):
2254 * wtf/persistence/PersistentEncoder.h:
2255 (WTF::Persistence::Encoder::encode):
2257 2017-08-23 Per Arne Vollan <pvollan@apple.com>
2259 [Win] Compile error, include file <wtf/AVFoundationHeaderDetection.h> is not found.
2260 https://bugs.webkit.org/show_bug.cgi?id=175853
2262 Reviewed by Brent Fulgham.
2264 Copy generated WTF header files to the same place as we copy forwarding headers.
2266 * WTF.vcxproj/WTF.proj:
2268 2017-08-22 Chris Dumez <cdumez@apple.com>
2270 Introduce a new CompletionHandler type and use it for NetworkDataTaskClient's completion handlers to help catch bugs
2271 https://bugs.webkit.org/show_bug.cgi?id=175832
2273 Reviewed by Alex Christensen.
2275 Introduce a new CompletionHandler type which wraps a WTF::Function and ensures via assertions
2276 that the function is always called once and only once.
2278 * WTF.xcodeproj/project.pbxproj:
2279 * wtf/CompletionHandler.h: Added.
2280 (WTF::CompletionHandler<Out):
2282 2017-08-22 Alex Christensen <achristensen@webkit.org>
2284 Fix Windows build after r221017.
2285 https://bugs.webkit.org/show_bug.cgi?id=157053
2287 * wtf/PlatformWin.cmake:
2289 2017-08-22 Per Arne Vollan <pvollan@apple.com>
2291 Implement 64-bit MacroAssembler::probe support for Windows.
2292 https://bugs.webkit.org/show_bug.cgi?id=175724
2294 Reviewed by Mark Lam.
2296 Enable masm probe and DFG.
2300 2017-08-21 Mark Lam <mark.lam@apple.com>
2302 [Follow up]: Add back the ability to disable MASM_PROBE from the build.
2303 https://bugs.webkit.org/show_bug.cgi?id=175656
2304 <rdar://problem/33933720>
2308 Fixed a typo: should be "OS(WINDOWS)", not "OS(WINDOW)".
2312 2017-08-21 Carlos Alberto Lopez Perez <clopez@igalia.com>
2314 [GTK] ARMv7 build fails to build MacroAssemblerARMv7.cpp.
2315 https://bugs.webkit.org/show_bug.cgi?id=175514
2317 Reviewed by Keith Miller.
2319 * wtf/Platform.h: Enable DFG and MASM_PROBE back for GTK ARM_THUMB2.
2321 2017-08-20 Sam Weinig <sam@webkit.org>
2323 StringView could use a function to strip leading/trailing characters without allocation
2324 https://bugs.webkit.org/show_bug.cgi?id=175757
2326 Reviewed by Darin Adler.
2328 There are many places in WebCore/WebKit that we call functions like,
2329 WebCore::stripLeadingAndTrailingHTMLSpaces, or String::stripWhiteSpace() only to use
2330 the allocated String as a temporary for either another transformation or a comparison.
2331 Now that we have StringView, we can avoid that extra allocation, by having returning a
2332 StringView substring in these scenarios.
2334 For instance, the check (from ScriptElement.cpp:287):
2336 if (!stripLeadingAndTrailingHTMLSpaces(sourceURL).isEmpty()) {
2340 currently allocates a string just to make this check. With a new
2341 stripLeadingAndTrailingHTMLSpaces such as:
2343 StringView stripLeadingAndTrailingHTMLSpaces(StringView stringView)
2345 return stringView.stripLeadingAndTrailingMatchedCharacters([] (auto c) {
2346 return isHTMLSpace(c);
2350 We could instead have exact same code from ScriptElement.cpp now avoid an allocation.
2352 * wtf/text/StringView.h:
2353 (WTF::StringView::stripLeadingAndTrailingMatchedCharacters):
2355 2017-08-21 Eric Carlson <eric.carlson@apple.com>
2357 Add WTFLogChannel level to allow runtime log filtering
2358 https://bugs.webkit.org/show_bug.cgi?id=175731
2359 <rdar://problem/33967234>
2361 Reviewed by Jer Noble.
2363 Add WTFLog*, LOG, and RELEASE_LOG variants that take a "log level" parameter so code
2364 can include logging statements that are only conditionally emitted.
2366 * wtf/Assertions.cpp:
2368 * wtf/MemoryPressureHandler.cpp:
2369 * wtf/RefCountedLeakCounter.cpp:
2371 2017-08-20 Mark Lam <mark.lam@apple.com>
2373 Gardening: fix CLoop build.
2374 https://bugs.webkit.org/show_bug.cgi?id=175688
2375 <rdar://problem/33436870>
2379 Disable MASM_PROBE if !ENABLE(JIT).
2383 2017-08-18 Ryan Haddad <ryanhaddad@apple.com>
2385 Unreviewed, rolling out r220938.
2387 The API tests added with this change are failing.
2391 "Add WTFLogChannel level to allow runtime log filtering"
2392 https://bugs.webkit.org/show_bug.cgi?id=175731
2393 http://trac.webkit.org/changeset/220938
2395 2017-08-18 Eric Carlson <eric.carlson@apple.com>
2397 Add WTFLogChannel level to allow runtime log filtering
2398 https://bugs.webkit.org/show_bug.cgi?id=175731
2399 <rdar://problem/33967234>
2401 Reviewed by Jer Noble.
2403 Add WTFLog*, LOG, and RELEASE_LOG variants that take a "log level" parameter so code
2404 can include logging statements that are only conditionally emitted.
2406 * wtf/Assertions.cpp:
2408 * wtf/MemoryPressureHandler.cpp:
2409 * wtf/RefCountedLeakCounter.cpp:
2411 2017-08-18 Per Arne Vollan <pvollan@apple.com>
2413 Implement 32-bit MacroAssembler::probe support for Windows.
2414 https://bugs.webkit.org/show_bug.cgi?id=175449
2416 Reviewed by Mark Lam.
2418 Enable the DFG on Win32.
2422 2017-08-17 Mark Lam <mark.lam@apple.com>
2424 Only use 16 VFP registers if !CPU(ARM_NEON).
2425 https://bugs.webkit.org/show_bug.cgi?id=175514
2427 Reviewed by JF Bastien.
2429 If CPU(ARM_NEON) is not enabled, we'll conservatively assume only VFP2 support is
2430 available. Hence, we'll only the first 16 FPDoubleRegisterIDs are available.
2433 NEON registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJACABEJ.html
2434 VFP2 and VFP3 registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CIHDIBDG.html
2435 NEON to VFP register mapping: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJAIJHFC.html
2437 This is mostly for GTK toolchains which may target older ARM CPUs which only have
2442 2017-08-16 Mark Lam <mark.lam@apple.com>
2444 Add back the ability to disable MASM_PROBE from the build.
2445 https://bugs.webkit.org/show_bug.cgi?id=175656
2446 <rdar://problem/33933720>
2448 Reviewed by Yusuke Suzuki.
2452 2017-08-16 Mark Lam <mark.lam@apple.com>
2454 Gardening: fix GTK ARM_THUMB2 build.
2455 https://bugs.webkit.org/show_bug.cgi?id=175446
2459 Disable the use of the DFG for GTK ARM_THUMB2 builds until
2460 https://bugs.webkit.org/show_bug.cgi?id=175514 is fixed.
2464 2017-08-16 Andy Estes <aestes@apple.com>
2466 [Payment Request] Add an ENABLE flag and an experimental feature preference
2467 https://bugs.webkit.org/show_bug.cgi?id=175622
2469 Reviewed by Tim Horton.
2471 * wtf/FeatureDefines.h:
2473 2017-08-14 Simon Fraser <simon.fraser@apple.com>
2475 Remove Proximity Events and related code
2476 https://bugs.webkit.org/show_bug.cgi?id=175545
2478 Reviewed by Daniel Bates.
2480 No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS)
2481 and other related code.
2483 * wtf/FeatureDefines.h:
2485 2017-08-14 Simon Fraser <simon.fraser@apple.com>
2487 Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
2488 https://bugs.webkit.org/show_bug.cgi?id=175504
2490 Reviewed by Sam Weinig.
2492 * wtf/FeatureDefines.h:
2494 2017-08-14 Simon Fraser <simon.fraser@apple.com>
2496 Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
2497 https://bugs.webkit.org/show_bug.cgi?id=175557
2499 Reviewed by Jon Lee.
2501 No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.
2503 * wtf/FeatureDefines.h:
2505 2017-08-12 Filip Pizlo <fpizlo@apple.com>
2507 Put the ScopedArgumentsTable's ScopeOffset array in some gigacage
2508 https://bugs.webkit.org/show_bug.cgi?id=174921
2510 Reviewed by Mark Lam.
2512 If you want to std::unique_ptr a class that knows that it should be in the Gigacage, then we
2513 would create the Gigacage equivalent of WTF_MAKE_FAST_ALLOCATED and it would just work.
2515 But this does not work if we want to std::unique_ptr a primitive type. So, this patch adds a
2516 solution for this problem: CagedUniquePtr<>. This will handle allocation
2517 (CagedUniquePtr<>::create()) and deallocation (in the style of std::unique_ptr). It has three
2521 - Arrays that don't have destructors.
2522 - Arrays that have destructors.
2524 Just like std::unique_ptr, the array case is triggered by saying "[]" at the end of the type.
2526 Unlike std::unique_ptr and most other smart pointers, the whole point of this smart pointer is
2527 to dictate where the thing you're pointing at is allocated. For this reason, it has to know how
2528 to do things like the array destructor protocol. So it creates its own: the CagedUniquePtr for
2529 arrays with destructors is a fat pointer that remembers the length of the array.
2531 CagedUniquePtr<> makes it impossible to leak/release the pointer. This is stricter than what
2532 std::unique_ptr does, and is probably appropriate for all of the places where we would use this
2535 So far, we only use it for ScopedArgumentsTable::m_arguments, but I suspect that it will be
2536 useful in other places.
2538 * WTF.xcodeproj/project.pbxproj:
2539 * wtf/CMakeLists.txt:
2540 * wtf/CagedUniquePtr.h: Added.
2541 (WTF::CagedUniquePtr::CagedUniquePtr):
2542 (WTF::CagedUniquePtr::create):
2543 (WTF::CagedUniquePtr::operator=):
2544 (WTF::CagedUniquePtr::~CagedUniquePtr):
2545 (WTF::CagedUniquePtr::get const):
2546 (WTF::CagedUniquePtr::getMayBeNull const):
2547 (WTF::CagedUniquePtr::operator== const):
2548 (WTF::CagedUniquePtr::operator!= const):
2549 (WTF::CagedUniquePtr::operator bool const):
2550 (WTF::CagedUniquePtr::operator* const):
2551 (WTF::CagedUniquePtr::operator-> const):
2552 (WTF::CagedUniquePtr::operator[] const):
2553 (WTF::CagedUniquePtr::destroy):
2555 (Gigacage::tryMallocArray):
2557 (Gigacage::mallocArray):
2560 2017-08-11 Ryosuke Niwa <rniwa@webkit.org>
2562 Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
2563 https://bugs.webkit.org/show_bug.cgi?id=175474
2565 Reviewed by Wenson Hsieh.
2567 * wtf/FeatureDefines.h:
2569 2017-08-11 Don Olmstead <don.olmstead@sony.com>
2571 [WTF] Move ValueToString into WTF
2572 https://bugs.webkit.org/show_bug.cgi?id=175469
2574 Reviewed by Sam Weinig.
2576 * WTF.xcodeproj/project.pbxproj:
2577 * wtf/CMakeLists.txt:
2578 * wtf/text/ValueToString.h: Renamed from Source/WebCore/platform/ValueToString.h.
2580 2017-08-11 Tim Horton <timothy_horton@apple.com>
2582 Fix the build with modern Clang's -Wexpansion-to-defined
2583 https://bugs.webkit.org/show_bug.cgi?id=175467
2584 <rdar://problem/33667497>
2586 Reviewed by Simon Fraser.
2588 * wtf/FeatureDefines.h:
2590 Avoid object-like macros that expand to include defined(), because this
2591 behaves inconsistently between different compilers (though in ways
2592 that don't matter for these particular defines, which aren't used on MSVC),
2593 and Clang has added a warning for it.
2595 Move ENABLE_WEBASSEMBLY to Platform.h since it depends on things that
2596 are defined there and can't be evaluated at time-of-use because of the
2597 aforementioned new rules. Previously, there was a cycle between
2598 ENABLE_WEBASSEMBLY and ENABLE_B3_JIT -- break that so that it just
2599 goes FTL_JIT->B3_JIT->WASM instead.
2601 2017-08-10 Sam Weinig <sam@webkit.org>
2603 WTF::Function does not allow for reference / non-default constructible return types
2604 https://bugs.webkit.org/show_bug.cgi?id=175244
2606 Reviewed by Chris Dumez.
2608 When Function, then NoncopyableFunction, was templatized to allow non-void return values
2609 in r201493, it maintained the behavior of being callable even if the Function was null.
2610 To accomplish this, when null, the default construction of the return parameter was used.
2611 This means Function can't be used with return types that are not default constructible,
2612 such as reference types and Ref.
2614 This behavior of returning something when null is surprising, as this is not how normal
2615 functions behave, and not very useful. Instead, we now assert that the function is not
2616 null when being called.
2619 (WTF::Function operator(...)):
2620 Instead of allowing a null callable wrapper by returning the default construction of
2621 the return type, assert that the wrapper is there when calling a Function.
2623 2017-08-10 Mark Lam <mark.lam@apple.com>
2625 Make the MASM_PROBE mechanism mandatory for DFG and FTL builds.
2626 https://bugs.webkit.org/show_bug.cgi?id=175446
2627 <rdar://problem/33836545>
2629 Reviewed by Saam Barati.
2631 This is needed in order to support https://bugs.webkit.org/show_bug.cgi?id=174645.
2632 One consequence of this is that the DFG will now be disabled for the MIPS and
2634 https://bugs.webkit.org/show_bug.cgi?id=175447
2635 https://bugs.webkit.org/show_bug.cgi?id=175449
2637 Also, we should only ENABLE_SIGNAL_BASED_VM_TRAPS if the DFG is enabled. It was
2638 never meaningful to use SIGNAL_BASED_VM_TRAPS with the baseline JIT anyway. This
2639 is a mis-configuration error that is now fixed.
2643 2017-08-10 Brady Eidson <beidson@apple.com>
2645 Rename the source files for the WTF persistent coders.
2646 https://bugs.webkit.org/show_bug.cgi?id=175441
2648 Reviewed by Tim Horton.
2650 * WTF.xcodeproj/project.pbxproj:
2651 * wtf/CMakeLists.txt:
2653 * wtf/persistence/PersistentCoder.h: Renamed from Source/WTF/wtf/persistence/Coder.h.
2654 * wtf/persistence/PersistentCoders.cpp: Renamed from Source/WTF/wtf/persistence/Coders.cpp.
2655 * wtf/persistence/PersistentCoders.h: Renamed from Source/WTF/wtf/persistence/Coders.h.
2656 * wtf/persistence/PersistentDecoder.cpp: Renamed from Source/WTF/wtf/persistence/Decoder.cpp.
2657 * wtf/persistence/PersistentDecoder.h: Renamed from Source/WTF/wtf/persistence/Decoder.h.
2658 * wtf/persistence/PersistentEncoder.cpp: Renamed from Source/WTF/wtf/persistence/Encoder.cpp.
2659 * wtf/persistence/PersistentEncoder.h: Renamed from Source/WTF/wtf/persistence/Encoder.h.
2661 2017-08-10 Yusuke Suzuki <utatane.tea@gmail.com>
2663 Unreviewed, attempt to fix build failure with VC2017
2665 * wtf/PriorityQueue.h:
2667 2017-08-10 Yusuke Suzuki <utatane.tea@gmail.com>
2670 https://bugs.webkit.org/show_bug.cgi?id=174970
2672 Reviewed by Michael Catanzaro.
2674 CHAR_BIT is not defined.
2678 2017-08-09 Yusuke Suzuki <utatane.tea@gmail.com>
2680 [WTF] ThreadSpecific should not introduce additional indirection
2681 https://bugs.webkit.org/show_bug.cgi?id=175187
2683 Reviewed by Mark Lam.
2685 ThreadSpecific sets Data* to the TLS. And Data holds T*, which
2686 is fast allocated actual data. But ideally, we should store T
2687 instance directly in Data instead of introducing an additional
2690 This patch adds storage in Data in order to embed the instance of T. The constructor
2691 for Data will invoke the constructor for T on the embedded storage. We also drop
2692 ThreadSpecific::replace which is only used by the web thread to set its thread specific
2693 ThreadGlobalData to the one shared from the main thread. The existing implementation
2694 relies on the main thread and the web thread never exiting in order for the shared
2695 ThreadGlobalData to stay alive. We can achieve the same semantics by using a
2696 ThreadSpecific<std::unique_ptr<T>> to hold the ThreadGlobalData instance instead.
2698 * wtf/ThreadSpecific.h:
2699 (WTF::ThreadSpecific::Data::construct):
2700 (WTF::ThreadSpecific::Data::Data):
2701 We make it fast allocated since we previously allocated ThreadSpecific T data by fastMalloc.
2703 (WTF::ThreadSpecific::Data::~Data):
2704 (WTF::ThreadSpecific::Data::storagePointer const):
2705 (WTF::canBeGCThread>::get):
2706 We also drop RELEASE_ASSERT from ::get(). We already inserted this assert to setAndConstruct(),
2707 so when creating the member to this TLS, we execute this release assert. So it is
2708 not necessary to execute this assertion every time we get data from this TLS.
2710 (WTF::canBeGCThread>::set):
2711 (WTF::canBeGCThread>::destroy):
2712 (WTF::canBeGCThread>::setAndConstruct):
2714 (WTF::canBeGCThread>::replace): Deleted.
2716 2017-08-10 Tim Horton <timothy_horton@apple.com>
2718 Fix a silly typo in Compiler.h
2723 2017-08-10 Michael Catanzaro <mcatanzaro@igalia.com>
2725 Remove ENABLE_GAMEPAD_DEPRECATED
2726 https://bugs.webkit.org/show_bug.cgi?id=175361
2728 Reviewed by Carlos Garcia Campos.
2730 * wtf/FeatureDefines.h:
2732 2017-08-09 Don Olmstead <don.olmstead@sony.com>
2734 [WTF] Move TextStream into WTF
2735 https://bugs.webkit.org/show_bug.cgi?id=175211
2737 Reviewed by Myles C. Maxfield.
2739 * WTF.xcodeproj/project.pbxproj:
2740 * wtf/CMakeLists.txt:
2741 * wtf/text/TextStream.cpp: Renamed from Source/WebCore/platform/text/TextStream.cpp.
2742 (WTF::TextStream::writeIndent):
2743 * wtf/text/TextStream.h: Renamed from Source/WebCore/platform/text/TextStream.h.
2744 (WTF::TextStream::FormatNumberRespectingIntegers::FormatNumberRespectingIntegers):
2746 2017-08-09 Commit Queue <commit-queue@webkit.org>
2748 Unreviewed, rolling out r220466, r220477, and r220487.
2749 https://bugs.webkit.org/show_bug.cgi?id=175411
2751 This change broke existing API tests and follow up fixes did
2752 not resolve all the issues. (Requested by ryanhaddad on
2755 Reverted changesets:
2757 https://bugs.webkit.org/show_bug.cgi?id=175244
2758 http://trac.webkit.org/changeset/220466
2760 "WTF::Function does not allow for reference / non-default
2761 constructible return types"
2762 https://bugs.webkit.org/show_bug.cgi?id=175244
2763 http://trac.webkit.org/changeset/220477
2765 https://bugs.webkit.org/show_bug.cgi?id=175244
2766 http://trac.webkit.org/changeset/220487
2768 2017-08-09 Sam Weinig <sam@webkit.org>
2770 WTF::Function does not allow for reference / non-default constructible return types
2771 https://bugs.webkit.org/show_bug.cgi?id=175244
2773 Reviewed by Chris Dumez.
2775 When Function, then NoncopyableFunction, was templatized to allow non-void return values
2776 in r201493, it maintained the behavior of being callable even if the Function was null.
2777 To accomplish this, when null, the default construction of the return parameter was used.
2778 This means Function can't be used with return types that are not default constructible,
2779 such as reference types and Ref.
2781 This behavior of returning something when null is surprising, as this is not how normal
2782 functions behave, and not very useful. Instead, we now assert that the function is not
2783 null when being called.
2786 (WTF::Function operator(...)):
2787 Instead of allowing a null callable wrapper by returning the default construction of
2788 the return type, assert that the wrapper is there when calling a Function.
2790 2017-08-09 Ryan Haddad <ryanhaddad@apple.com>
2792 Unreviewed, rolling out r220457.
2794 This change introduced API test failures.
2798 "WTF::Function does not allow for reference / non-default
2799 constructible return types"
2800 https://bugs.webkit.org/show_bug.cgi?id=175244
2801 http://trac.webkit.org/changeset/220457
2803 2017-08-09 Sam Weinig <sam@webkit.org>
2805 WTF::Function does not allow for reference / non-default constructible return types
2806 https://bugs.webkit.org/show_bug.cgi?id=175244
2808 Reviewed by Chris Dumez.
2810 When Function, then NoncopyableFunction, was templatized to allow non-void return values
2811 in r201493, it maintained the behavior of being callable even if the Function was null.
2812 To accomplish this, when null, the default construction of the return parameter was used.
2813 This means Function can't be used with return types that are not default constructible,
2814 such as reference types and Ref.
2816 This behavior of returning something when null is surprising, as this is not how normal
2817 functions behave, and not very useful. Instead, we now assert that the function is not
2818 null when being called.
2821 (WTF::Function operator(...)):
2822 Instead of allowing a null callable wrapper by returning the default construction of
2823 the return type, assert that the wrapper is there when calling a Function.
2825 2017-08-08 Filip Pizlo <fpizlo@apple.com>
2827 Baseline JIT should do caging
2828 https://bugs.webkit.org/show_bug.cgi?id=175037
2830 Reviewed by Mark Lam.
2833 (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
2834 (Gigacage::isDisablingPrimitiveGigacageDisabled):
2835 (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
2836 (Gigacage::canPrimitiveGigacageBeDisabled):
2837 (Gigacage::basePtr):
2839 2017-08-08 Ryan Haddad <ryanhaddad@apple.com>
2841 Unreviewed, rolling out r220368.
2843 This change caused WK1 tests to exit early with crashes.
2847 "Baseline JIT should do caging"
2848 https://bugs.webkit.org/show_bug.cgi?id=175037
2849 http://trac.webkit.org/changeset/220368
2851 2017-08-08 Michael Catanzaro <mcatanzaro@igalia.com>
2853 [CMake] Properly test if compiler supports compiler flags
2854 https://bugs.webkit.org/show_bug.cgi?id=174490
2856 Reviewed by Konstantin Tokarev.
2860 2017-08-07 Filip Pizlo <fpizlo@apple.com>
2862 Baseline JIT should do caging
2863 https://bugs.webkit.org/show_bug.cgi?id=175037
2865 Reviewed by Mark Lam.
2868 (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
2869 (Gigacage::isDisablingPrimitiveGigacageDisabled):
2870 (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
2871 (Gigacage::canPrimitiveGigacageBeDisabled):
2873 2017-08-07 Filip Pizlo <fpizlo@apple.com>
2875 Unreviewed, try to fix Windows build.
2880 2017-08-06 Filip Pizlo <fpizlo@apple.com>
2882 Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
2883 https://bugs.webkit.org/show_bug.cgi?id=174919
2885 Reviewed by Keith Miller.
2887 This mirrors the changes from bmalloc/Gigacage.h.
2889 Also it teaches CagedPtr how to reason about multiple gigacages.
2892 (WTF::CagedPtr::get const):
2893 (WTF::CagedPtr::operator[] const):
2895 (Gigacage::tryMalloc):
2896 (Gigacage::tryAllocateVirtualPages):
2897 (Gigacage::freeVirtualPages):
2898 (Gigacage::tryAlignedMalloc):
2899 (Gigacage::alignedFree):
2902 (Gigacage::disablePrimitiveGigacage):
2903 (Gigacage::addPrimitiveDisableCallback):
2904 (Gigacage::removePrimitiveDisableCallback):
2906 (Gigacage::basePtr):
2908 (Gigacage::isCaged):
2909 (Gigacage::tryAlignedMalloc):
2910 (Gigacage::alignedFree):
2912 (Gigacage::disableGigacage): Deleted.
2913 (Gigacage::addDisableCallback): Deleted.
2914 (Gigacage::removeDisableCallback): Deleted.
2916 2017-08-07 Brian Burg <bburg@apple.com>
2918 Remove CANVAS_PATH compilation guard
2919 https://bugs.webkit.org/show_bug.cgi?id=175207
2921 Reviewed by Sam Weinig.
2923 * wtf/FeatureDefines.h:
2925 2017-08-05 Filip Pizlo <fpizlo@apple.com>
2927 REGRESSION (r219895-219897): Number of leaks on Open Source went from 9240 to 235983 and is now at 302372
2928 https://bugs.webkit.org/show_bug.cgi?id=175083
2930 Reviewed by Oliver Hunt.
2932 Adds a classic ReadWriteLock class. I wrote my own because I can never remember if the pthread one is
2933 guaranted to bias in favor of writers or not.
2935 * WTF.xcodeproj/project.pbxproj:
2937 (WTF::ConditionBase::construct):
2938 (WTF::Condition::Condition):
2940 (WTF::LockBase::construct):
2942 * wtf/ReadWriteLock.cpp: Added.
2943 (WTF::ReadWriteLockBase::construct):
2944 (WTF::ReadWriteLockBase::readLock):
2945 (WTF::ReadWriteLockBase::readUnlock):
2946 (WTF::ReadWriteLockBase::writeLock):
2947 (WTF::ReadWriteLockBase::writeUnlock):
2948 * wtf/ReadWriteLock.h: Added.
2949 (WTF::ReadWriteLockBase::ReadLock::tryLock):
2950 (WTF::ReadWriteLockBase::ReadLock::lock):
2951 (WTF::ReadWriteLockBase::ReadLock::unlock):
2952 (WTF::ReadWriteLockBase::WriteLock::tryLock):
2953 (WTF::ReadWriteLockBase::WriteLock::lock):
2954 (WTF::ReadWriteLockBase::WriteLock::unlock):
2955 (WTF::ReadWriteLockBase::read):
2956 (WTF::ReadWriteLockBase::write):
2957 (WTF::ReadWriteLock::ReadWriteLock):
2959 2017-08-04 Matt Lewis <jlewis3@apple.com>
2961 Unreviewed, rolling out r220271.
2963 Rolling out due to Layout Test failing on iOS Simulator.
2967 "Remove STREAMS_API compilation guard"
2968 https://bugs.webkit.org/show_bug.cgi?id=175165
2969 http://trac.webkit.org/changeset/220271
2971 2017-08-04 Youenn Fablet <youenn@apple.com>
2973 Remove STREAMS_API compilation guard
2974 https://bugs.webkit.org/show_bug.cgi?id=175165
2976 Reviewed by Darin Adler.
2978 * wtf/FeatureDefines.h:
2980 2017-08-03 Brian Burg <bburg@apple.com>
2982 Remove ENABLE(WEB_SOCKET) guards
2983 https://bugs.webkit.org/show_bug.cgi?id=167044
2985 Reviewed by Joseph Pecoraro.
2987 * wtf/FeatureDefines.h:
2989 2017-08-03 Youenn Fablet <youenn@apple.com>
2991 Remove FETCH_API compilation guard
2992 https://bugs.webkit.org/show_bug.cgi?id=175154
2994 Reviewed by Chris Dumez.
2996 * wtf/FeatureDefines.h:
2998 2017-08-03 Brady Eidson <beidson@apple.com>
3000 Add SW IDLs and stub out basic functionality.
3001 https://bugs.webkit.org/show_bug.cgi?id=175115
3003 Reviewed by Chris Dumez.
3005 * wtf/FeatureDefines.h:
3007 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
3009 Unreviewed, build fix for Windows port
3010 https://bugs.webkit.org/show_bug.cgi?id=175013
3014 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
3016 Merge ThreadHolder to WTF::Thread itself
3017 https://bugs.webkit.org/show_bug.cgi?id=175013
3019 Reviewed by Mark Lam.
3021 Currently, we store ThreadHolder* to the TLS, and ThreadHolder* holds Ref<Thread>.
3022 When we get Thread& from the current thread TLS, we need to dereference the ThreadHolder*.
3023 However, ideally, we can store Thread* directly to the current thread TLS.
3024 While the ThreadHolder design is beautiful, it's worth optimizing by storing Thread* directly
3025 since Thread::current() is so frequently executed.
3027 This patch merges ThreadHolder to Thread. And we now store Thread* directly in the TLS.
3028 When storing it to TLS, we call leakRef() to keep Thread ref count incremented by the TLS.
3029 And when destroying the TLS, we call `deref()` to ensure that Thread* is dereferenced from
3032 * WTF.xcodeproj/project.pbxproj:
3033 * wtf/CMakeLists.txt:
3034 * wtf/ThreadHolder.cpp: Removed.
3035 * wtf/ThreadHolder.h: Removed.
3036 * wtf/ThreadHolderPthreads.cpp: Removed.
3037 * wtf/ThreadHolderWin.cpp: Removed.
3038 * wtf/Threading.cpp:
3039 (WTF::Thread::entryPoint):
3040 (WTF::initializeThreading):
3042 (WTF::Thread::currentMayBeNull):
3043 (WTF::Thread::current):
3044 * wtf/ThreadingPthreads.cpp:
3045 (WTF::Thread::waitForCompletion):
3046 (WTF::Thread::initializeCurrentTLS):
3047 (WTF::Thread::initializeTLSKey):
3048 (WTF::Thread::initializeTLS):
3049 (WTF::Thread::destructTLS):
3050 (WTF::Thread::createCurrentThread): Deleted.
3051 * wtf/ThreadingWin.cpp:
3052 (WTF::Thread::initializeCurrentTLS):
3053 (WTF::threadMapMutex):
3054 (WTF::Thread::initializeTLSKey):
3055 (WTF::Thread::currentDying):
3057 (WTF::Thread::initializeTLS):
3058 (WTF::Thread::destructTLS):
3059 (WTF::waitForThreadCompletion):
3060 (WTF::Thread::createCurrentThread): Deleted.
3062 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
3064 [Linux][WTF] Use one global semaphore to notify thread suspend and resume completion
3065 https://bugs.webkit.org/show_bug.cgi?id=175124
3067 Reviewed by Carlos Garcia Campos.
3069 POSIX sem_t is used to notify thread suspend and resume completion in Linux ports
3070 since sem_post is async-signal-safe function. Since we guard suspend() and resume()
3071 with one global lock, this semaphore is also guarded by this lock. So we do not need
3072 to have semaphore per WTF::Thread.
3074 This patch introduces one global Semaphore. And drop per thread semaphore.
3077 * wtf/ThreadingPthreads.cpp:
3078 (WTF::Thread::~Thread):
3079 (WTF::Semaphore::Semaphore):
3080 (WTF::Semaphore::~Semaphore):
3081 (WTF::Semaphore::wait):
3082 (WTF::Semaphore::post):
3083 (WTF::Thread::signalHandlerSuspendResume):
3084 (WTF::Thread::initializePlatformThreading):
3085 (WTF::Thread::suspend):
3086 (WTF::Thread::resume):
3087 (WTF::Thread::Thread): Deleted.
3088 * wtf/ThreadingWin.cpp:
3089 (WTF::Thread::Thread): Deleted.
3091 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
3093 [Linux][WTF] Reduce sizeof(WTF::Thread) by using a pointer to PlatformRegisters
3094 https://bugs.webkit.org/show_bug.cgi?id=175119
3096 Reviewed by Carlos Garcia Campos.
3098 sizeof(PlatformRegisters) is so large. In my Linux box, it is 256. It enlarges the sizeof(WTF::Thread).
3099 However, it is not necessary to hold it in WTF::Thread member. Thread's ucontext data and its stack is
3100 effective while suspending the thread. So, we can just use the pointer to the PlatformRegister instead
3101 of copying it to the member of the WTF::Thread.
3104 * wtf/ThreadingPthreads.cpp:
3105 (WTF::Thread::signalHandlerSuspendResume):
3106 (WTF::Thread::getRegisters):
3108 2017-08-02 Yusuke Suzuki <utatane.tea@gmail.com>
3110 Unreviewed, build fix for Windows port
3111 https://bugs.webkit.org/show_bug.cgi?id=174716
3113 This ugliness will be fixed in https://bugs.webkit.org/show_bug.cgi?id=175013.
3115 * wtf/ThreadHolder.h:
3118 2017-08-02 Yusuke Suzuki <utatane.tea@gmail.com>
3120 Merge WTFThreadData to Thread::current
3121 https://bugs.webkit.org/show_bug.cgi?id=174716
3123 Reviewed by Mark Lam.
3125 We placed thread specific data in WTFThreadData previously. But now, we have a new good place
3126 to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
3127 sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
3128 This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
3129 to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
3130 Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
3131 before calling WTF::initializeThreading.
3133 * WTF.xcodeproj/project.pbxproj:
3134 * wtf/CMakeLists.txt:
3135 * wtf/LockAlgorithm.h:
3136 * wtf/LockAlgorithmInlines.h:
3138 * wtf/ParkingLot.cpp:
3139 * wtf/StackStats.cpp:
3140 (WTF::StackStats::PerThreadStats::PerThreadStats):
3141 (WTF::StackStats::CheckPoint::CheckPoint):
3142 (WTF::StackStats::CheckPoint::~CheckPoint):
3143 (WTF::StackStats::probe):
3144 (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
3145 * wtf/ThreadHolder.cpp:
3146 (WTF::ThreadHolder::initializeCurrent):
3147 * wtf/ThreadHolder.h:
3148 (WTF::ThreadHolder::ThreadHolder):
3149 (WTF::ThreadHolder::currentMayBeNull):
3150 (WTF::ThreadHolder::current):
3151 * wtf/ThreadHolderPthreads.cpp:
3152 (WTF::ThreadHolder::initializeKey):
3153 (WTF::ThreadHolder::initialize):
3154 (WTF::ThreadHolder::destruct):
3155 (WTF::ThreadHolder::initializeOnce): Deleted.
3156 (WTF::ThreadHolder::current): Deleted.
3157 * wtf/ThreadHolderWin.cpp:
3158 (WTF::ThreadHolder::initializeKey):
3159 (WTF::ThreadHolder::currentDying):
3160 (WTF::ThreadHolder::initialize):
3161 (WTF::ThreadHolder::initializeOnce): Deleted.
3162 (WTF::ThreadHolder::current): Deleted.
3163 * wtf/Threading.cpp:
3164 (WTF::Thread::initializeInThread):
3165 (WTF::Thread::entryPoint):
3166 (WTF::Thread::create):
3167 (WTF::Thread::didExit):
3168 (WTF::initializeThreading):
3169 (WTF::Thread::currentMayBeNull): Deleted.
3171 (WTF::Thread::current):
3172 (WTF::Thread::atomicStringTable):
3173 (WTF::Thread::setCurrentAtomicStringTable):
3174 (WTF::Thread::stackStats):
3175 (WTF::Thread::savedStackPointerAtVMEntry):
3176 (WTF::Thread::setSavedStackPointerAtVMEntry):
3177 (WTF::Thread::savedLastStackTop):
3178 (WTF::Thread::setSavedLastStackTop):
3179 * wtf/ThreadingPrimitives.h:
3180 * wtf/ThreadingPthreads.cpp:
3181 (WTF::Thread::createCurrentThread):
3182 (WTF::Thread::current): Deleted.
3183 * wtf/ThreadingWin.cpp:
3184 (WTF::Thread::createCurrentThread):
3185 (WTF::Thread::current): Deleted.
3186 * wtf/WTFThreadData.cpp: Removed.
3187 * wtf/WTFThreadData.h: Removed.
3188 * wtf/text/AtomicString.cpp:
3189 * wtf/text/AtomicStringImpl.cpp:
3191 * wtf/text/AtomicStringTable.cpp:
3192 (WTF::AtomicStringTable::create):
3193 * wtf/text/AtomicStringTable.h:
3195 2017-08-02 Joseph Pecoraro <pecoraro@apple.com>
3197 NeverDestroyed related leaks seen on bots
3198 https://bugs.webkit.org/show_bug.cgi?id=175113
3200 Reviewed by Yusuke Suzuki.
3202 * wtf/NeverDestroyed.h:
3203 (WTF::NeverDestroyed::NeverDestroyed):
3204 Previously the result of makeNeverDestroyed was not always moving into
3205 the `static NeverDestroyed` static local variable. In some cases it would
3206 re-invoke the constructor, creating a new NeverDestroyed object. In the
3207 case of a Vector it was causing leaks.
3209 Adding a move constructor convinces the compiler to move the result
3210 of makeNeverDestroyed into the NeverDestroyed static. It doesn't actually
3211 invoke the move constructor here, which I believe means it is deciding
3212 to perform optional copy elision optimization.
3213 'http://en.cppreference.com/w/cpp/language/copy_elision
3215 2017-08-02 Filip Pizlo <fpizlo@apple.com>
3217 All C++ accesses to JSObject::m_butterfly should do caging
3218 https://bugs.webkit.org/show_bug.cgi?id=175039
3220 Reviewed by Keith Miller.
3222 Adds a smart pointer class that does various kinds of caging for you.
3224 * WTF.xcodeproj/project.pbxproj:
3225 * wtf/CMakeLists.txt:
3226 * wtf/CagedPtr.h: Added.
3227 (WTF::CagedPtr::CagedPtr):
3228 (WTF::CagedPtr::get const):
3229 (WTF::CagedPtr::getMayBeNull const):
3230 (WTF::CagedPtr::operator== const):
3231 (WTF::CagedPtr::operator!= const):
3232 (WTF::CagedPtr::operator bool const):
3233 (WTF::CagedPtr::operator* const):
3234 (WTF::CagedPtr::operator-> const):
3236 2017-08-02 Filip Pizlo <fpizlo@apple.com>
3238 We should be OK with the gigacage being disabled on gmalloc
3239 https://bugs.webkit.org/show_bug.cgi?id=175082
3241 Reviewed by Michael Saboff.
3244 (Gigacage::shouldBeEnabled):
3246 2017-08-01 Filip Pizlo <fpizlo@apple.com>
3248 Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
3249 https://bugs.webkit.org/show_bug.cgi?id=174727
3251 Reviewed by Mark Lam.
3253 For the Gigacage project to have minimal impact, we need to have some abstraction that allows code to
3254 avoid having to guard itself with #if's. This adds a Gigacage abstraction that overlays the Gigacage
3255 namespace from bmalloc, which always lets you call things like Gigacage::caged and Gigacage::tryMalloc.
3257 Because of how many places need to possibly allocate in a gigacage, or possibly perform caged accesses,
3258 it's better to hide the question of whether or not it's enabled inside this API.
3260 * WTF.xcodeproj/project.pbxproj:
3261 * wtf/CMakeLists.txt:
3262 * wtf/FastMalloc.cpp:
3263 * wtf/Gigacage.cpp: Added.
3264 (Gigacage::tryMalloc):
3265 (Gigacage::tryAllocateVirtualPages):
3266 (Gigacage::freeVirtualPages):
3267 (Gigacage::tryAlignedMalloc):
3268 (Gigacage::alignedFree):
3270 * wtf/Gigacage.h: Added.
3271 (Gigacage::ensureGigacage):
3272 (Gigacage::disableGigacage):
3273 (Gigacage::addDisableCallback):
3274 (Gigacage::removeDisableCallback):
3276 (Gigacage::isCaged):
3277 (Gigacage::tryAlignedMalloc):
3278 (Gigacage::alignedFree):
3281 2017-07-31 Matt Lewis <jlewis3@apple.com>
3283 Unreviewed, rolling out r220060.
3285 This broke our internal builds. Contact reviewer of patch for
3290 "Merge WTFThreadData to Thread::current"
3291 https://bugs.webkit.org/show_bug.cgi?id=174716
3292 http://trac.webkit.org/changeset/220060
3294 2017-07-31 Yusuke Suzuki <utatane.tea@gmail.com>
3296 Merge WTFThreadData to Thread::current
3297 https://bugs.webkit.org/show_bug.cgi?id=174716
3299 Reviewed by Sam Weinig.
3301 We placed thread specific data in WTFThreadData previously. But now, we have a new good place
3302 to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
3303 sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
3304 This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
3305 to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
3306 Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
3307 before calling WTF::initializeThreading.
3309 * WTF.xcodeproj/project.pbxproj:
3310 * wtf/CMakeLists.txt:
3311 * wtf/LockAlgorithm.h:
3312 * wtf/LockAlgorithmInlines.h:
3314 * wtf/ParkingLot.cpp:
3315 * wtf/StackStats.cpp:
3316 (WTF::StackStats::PerThreadStats::PerThreadStats):
3317 (WTF::StackStats::CheckPoint::CheckPoint):
3318 (WTF::StackStats::CheckPoint::~CheckPoint):
3319 (WTF::StackStats::probe):
3320 (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
3321 * wtf/ThreadHolder.cpp:
3322 (WTF::ThreadHolder::initializeCurrent):
3323 * wtf/ThreadHolder.h:
3324 (WTF::ThreadHolder::ThreadHolder):
3325 (WTF::ThreadHolder::currentMayBeNull):
3326 (WTF::ThreadHolder::current):
3327 * wtf/ThreadHolderPthreads.cpp:
3328 (WTF::ThreadHolder::initialize):
3329 (WTF::ThreadHolder::destruct):
3330 (WTF::ThreadHolder::current): Deleted.
3331 * wtf/ThreadHolderWin.cpp:
3332 (WTF::ThreadHolder::currentDying):
3333 (WTF::ThreadHolder::initialize):
3334 (WTF::ThreadHolder::current): Deleted.
3335 * wtf/Threading.cpp:
3336 (WTF::Thread::initializeInThread):
3337 (WTF::Thread::entryPoint):
3338 (WTF::Thread::didExit):
3339 (WTF::initializeThreading):
3340 (WTF::Thread::currentMayBeNull): Deleted.
3342 (WTF::Thread::atomicStringTable):
3343 (WTF::Thread::setCurrentAtomicStringTable):
3344 (WTF::Thread::stackStats):
3345 (WTF::Thread::savedStackPointerAtVMEntry):
3346 (WTF::Thread::setSavedStackPointerAtVMEntry):
3347 (WTF::Thread::savedLastStackTop):
3348 (WTF::Thread::setSavedLastStackTop):
3349 (WTF::Thread::current):
3350 * wtf/ThreadingPrimitives.h:
3351 * wtf/ThreadingPthreads.cpp:
3352 (WTF::Thread::createCurrentThread):
3353 (WTF::Thread::current): Deleted.
3354 * wtf/ThreadingWin.cpp:
3355 (WTF::Thread::createCurrentThread):
3356 (WTF::Thread::current): Deleted.
3357 * wtf/WTFThreadData.cpp: Removed.
3358 * wtf/WTFThreadData.h: Removed.
3359 * wtf/text/AtomicString.cpp:
3360 * wtf/text/AtomicStringImpl.cpp:
3362 * wtf/text/AtomicStringTable.cpp:
3363 (WTF::AtomicStringTable::create):
3364 * wtf/text/AtomicStringTable.h:
3366 2017-07-31 Xabier Rodriguez Calvar <calvaris@igalia.com>
3368 Created a bool pretty printer at WTF for debugging purposes
3369 https://bugs.webkit.org/show_bug.cgi?id=174893
3371 Reviewed by Darin Adler.
3373 * wtf/PrintStream.cpp:
3374 (WTF::printInternal): The overload taking bool uses boolForPrinting
3375 * wtf/PrintStream.h:
3376 (WTF::boolForPrinting): Converts a bool in "true" or "false".
3378 2017-07-30 Yusuke Suzuki <utatane.tea@gmail.com>
3380 [WTF] Introduce Private Symbols
3381 https://bugs.webkit.org/show_bug.cgi?id=174935
3383 Reviewed by Darin Adler.
3385 Upcoming proposal of class fields[1] requires private fields.
3386 The simple way to implement it is adding a property with a private symbol.
3387 Currently, we have private symbols for internal properties. They are usual
3388 Symbols managed by the hash table. So basically private symbols are statically
3389 created in BuiltinNames. However this new proposal encourages users to create
3390 such private symbols more and more.
3392 So, this patch introduces notion of "Private" into WTF SymbolImpl. This patch
3393 adds PrivateSymbolImpl. This is SymbolImpl with "Private" flag. We do not need
3394 to look up the symbol from the hash table to check whether the given symbol
3397 [1]: https://github.com/tc39/proposal-class-fields
3399 * wtf/text/StringImpl.h:
3400 * wtf/text/SymbolImpl.cpp:
3401 (WTF::PrivateSymbolImpl::create):
3402 (WTF::PrivateSymbolImpl::createNullSymbol):
3403 * wtf/text/SymbolImpl.h:
3404 (WTF::SymbolImpl::isPrivate):
3405 (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
3406 (WTF::SymbolImpl::SymbolImpl):
3407 (WTF::PrivateSymbolImpl::PrivateSymbolImpl):
3409 2017-07-30 Brady Eidson <beidson@apple.com>
3411 Add URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks.
3412 https://bugs.webkit.org/show_bug.cgi?id=174958
3414 Reviewed by Darin Adler.
3416 This patch adds a new template class "InstanceCounted<T>".
3418 For each specialization, "InstanceCounted" will keep track of the total number of
3419 instances in existence.
3421 This makes explicate leak checking in API tests possible.
3423 Since this adds some runtime and storage overhead the code that actually does anything
3424 is only compiled in debug builds.
3426 * WTF.xcodeproj/project.pbxproj:
3427 * wtf/InstanceCounted.h: Added.
3428 (WTF::InstanceCounted::InstanceCounted):
3429 (WTF::InstanceCounted::instanceCount):
3430 (WTF::InstanceCounted::~InstanceCounted):
3432 2017-07-27 Yusuke Suzuki <utatane.tea@gmail.com>
3434 [WTF] Drop Thread initialization wait in some platforms by introducing StackBounds::newThreadStackBounds(PlatformThreadHandle&)
3435 https://bugs.webkit.org/show_bug.cgi?id=174303
3437 Reviewed by Mark Lam.
3439 Currently, the caller thread of Thread::create() need to wait for completion of the initialization of the target thread.
3440 This is because we need to initialize Thread::m_stack in the target thread. Before this patch, a target thread's
3441 StackBounds can only be retrieved by the target thread itself. However, this potentially causes context-switching between
3442 the caller and the target threads and hurts efficiency of creating threads.
3444 Fortunately, in some platforms (including major platforms except for Windows), we can get StackBounds of a target
3445 thread from a caller thread. This allows us to avoid waiting for completion of thread initialization.
3447 In this patch, we introduce HAVE_STACK_BOUNDS_FOR_NEW_THREAD and StackBounds::newThreadStackBounds. When creating
3448 a new thread, we will use StackBounds::newThreadStackBounds to get StackBounds if possible. As a result, we
3449 do not need to wait for completion of thread initialization to ensure m_stack field of Thread is initialized.
3451 While some documents claim that it is possible on Windows to get the StackBounds of another thread[1], the method relies on
3452 undocumented Windows NT APIs (NtQueryInformationThread, NtReadVirtualMemory etc.). So in this patch, we just
3453 use the conservative approach simply waiting for completion of thread initialization.
3455 [1]: https://stackoverflow.com/questions/3918375/how-to-get-thread-stack-information-on-windows
3458 * wtf/StackBounds.cpp:
3459 (WTF::StackBounds::newThreadStackBounds):
3460 (WTF::StackBounds::currentThreadStackBoundsInternal):
3461 (WTF::StackBounds::initialize): Deleted.
3462 * wtf/StackBounds.h:
3463 (WTF::StackBounds::currentThreadStackBounds):
3464 (WTF::StackBounds::StackBounds):
3465 * wtf/Threading.cpp:
3466 (WTF::Thread::NewThreadContext::NewThreadContext):
3467 (WTF::Thread::entryPoint):
3468 (WTF::Thread::create):
3469 (WTF::Thread::initialize): Deleted.
3471 * wtf/ThreadingPrimitives.h:
3472 * wtf/ThreadingPthreads.cpp:
3473 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3474 (WTF::wtfThreadEntryPoint):
3475 (WTF::Thread::establishHandle):
3476 (WTF::Thread::initializeCurrentThreadInternal):
3477 (WTF::Thread::current):
3478 * wtf/ThreadingWin.cpp:
3479 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3480 (WTF::Thread::initializeCurrentThreadInternal):
3481 (WTF::Thread::current):
3482 * wtf/win/MainThreadWin.cpp:
3483 (WTF::initializeMainThreadPlatform):
3485 2017-07-27 JF Bastien <jfbastien@apple.com>
3487 Update lock benchmarks
3488 https://bugs.webkit.org/show_bug.cgi?id=174907
3490 Reviewed by Filip Pizlo.
3492 * benchmarks/ConditionSpeedTest.cpp:
3494 * benchmarks/LockFairnessTest.cpp:
3495 * benchmarks/LockSpeedTest.cpp:
3496 * benchmarks/ToyLocks.h:
3498 2017-07-26 Brian Burg <bburg@apple.com>
3500 Remove WEB_TIMING feature flag
3501 https://bugs.webkit.org/show_bug.cgi?id=174795
3503 Reviewed by Alex Christensen.
3505 * wtf/FeatureDefines.h:
3507 2017-07-26 Claudio Saavedra <csaavedra@igalia.com>
3509 [WPE] Enable KeyboardEvent key and code attributes
3510 https://bugs.webkit.org/show_bug.cgi?id=174822
3512 Reviewed by Žan Doberšek.
3514 There is no reason for this to be disabled from what I see.
3516 * wtf/FeatureDefines.h: Enable KeyboardEvent key and code attributes.
3518 2017-07-23 Filip Pizlo <fpizlo@apple.com>
3521 https://bugs.webkit.org/show_bug.cgi?id=174750
3523 Reviewed by Keith Miller and Saam Barati.
3525 Moved DFG::NaturalLoops to WTF. The new templatized NaturalLoops<> uses the same Graph abstraction as
3526 Dominators<>. This allows us to add a B3::NaturalLoops for free.
3528 Also made small tweaks to RangeSet, which the LICM uses.
3530 * WTF.xcodeproj/project.pbxproj:
3531 * wtf/CMakeLists.txt:
3533 * wtf/NaturalLoops.h: Added.
3534 (WTF::NaturalLoop::NaturalLoop):
3535 (WTF::NaturalLoop::graph):
3536 (WTF::NaturalLoop::header):
3537 (WTF::NaturalLoop::size):
3538 (WTF::NaturalLoop::at):
3539 (WTF::NaturalLoop::operator[]):
3540 (WTF::NaturalLoop::contains):
3541 (WTF::NaturalLoop::index):
3542 (WTF::NaturalLoop::isOuterMostLoop):
3543 (WTF::NaturalLoop::dump):
3544 (WTF::NaturalLoop::addBlock):
3545 (WTF::NaturalLoops::NaturalLoops):
3546 (WTF::NaturalLoops::graph):
3547 (WTF::NaturalLoops::numLoops):
3548 (WTF::NaturalLoops::loop):
3549 (WTF::NaturalLoops::headerOf):
3550 (WTF::NaturalLoops::innerMostLoopOf):
3551 (WTF::NaturalLoops::innerMostOuterLoop):
3552 (WTF::NaturalLoops::belongsTo):
3553 (WTF::NaturalLoops::loopDepth):
3554 (WTF::NaturalLoops::loopsOf):
3555 (WTF::NaturalLoops::dump):
3557 (WTF::RangeSet::begin):
3558 (WTF::RangeSet::end):
3559 (WTF::RangeSet::addAll):
3561 2017-07-23 Michael Catanzaro <mcatanzaro@igalia.com>
3563 Implement FALLTHROUGH attribute for C with GCC
3564 https://bugs.webkit.org/show_bug.cgi?id=174555
3566 Reviewed by Darin Adler.
3568 My previous attempt to silence the JSC -Wimplicit-fallthrough warnings failed because they
3569 are coming from a C file, and our FALLTHROUGH macro is only implemented for C++. So
3570 implement it for C as well, using C attribute syntax.
3572 Note this is only possible to do for GCC, because Clang only supports this attribute using
3573 the [[C++ attribute syntax]].
3577 2017-07-14 Filip Pizlo <fpizlo@apple.com>
3579 It should be easy to decide how WebKit yields
3580 https://bugs.webkit.org/show_bug.cgi?id=174298
3582 Reviewed by Saam Barati.
3584 Created a Thread::yield() abstraction for sched_yield(), and made WTF use it everywhere that it
3585 had previously used std::this_thread::yield().
3587 To make it less annoying to experiment with changes to the lock algorithm in the future, this also
3588 moves the meat of the algorithm into LockAlgorithmInlines.h. Only two files include that header.
3589 Since LockAlgorithm.h no longer includes ParkingLot.h, a bunch of files in WK now need to include
3590 timing headers (Seconds, MonotonicTime, etc) manually.
3592 * WTF.xcodeproj/project.pbxproj:
3593 * benchmarks/ToyLocks.h:
3594 * wtf/CMakeLists.txt:
3596 * wtf/LockAlgorithm.h:
3597 (WTF::LockAlgorithm::lockSlow): Deleted.
3598 (WTF::LockAlgorithm::unlockSlow): Deleted.
3599 * wtf/LockAlgorithmInlines.h: Added.
3600 (WTF::hasParkedBit>::lockSlow):
3601 (WTF::hasParkedBit>::unlockSlow):
3602 * wtf/MainThread.cpp:
3603 * wtf/RunLoopTimer.h:
3604 * wtf/Threading.cpp:
3606 * wtf/ThreadingPthreads.cpp:
3607 (WTF::Thread::yield):
3608 * wtf/ThreadingWin.cpp:
3609 (WTF::Thread::yield):