1 2017-11-07 Filip Pizlo <fpizlo@apple.com>
3 Disable isoheaps on iOS
5 Reviewed by Ryosuke Niwa.
9 2017-11-07 Brady Eidson <beidson@apple.com>
11 Implement "UpdateWorkerState" and use it
12 https://bugs.webkit.org/show_bug.cgi?id=179318
14 Reviewed by Chris Dumez.
16 * wtf/ObjectIdentifier.h:
17 (WTF::ObjectIdentifier::loggingString const):
19 2017-11-07 Michael Saboff <msaboff@apple.com>
21 Add SPI function pointers qualifiers for CPU(ARM64E)
22 https://bugs.webkit.org/show_bug.cgi?id=179383
26 For ARM64E, use the appropriate SPI qualifiers for helper function pointers.
31 2017-10-31 Filip Pizlo <fpizlo@apple.com>
33 bmalloc should support strictly type-segregated isolated heaps
34 https://bugs.webkit.org/show_bug.cgi?id=178108
36 Reviewed by Saam Barati, Simon Fraser, and Ryosuke Niwa.
38 This just adds an easy way of using the bmalloc IsoHeap API in WebKit. If bmalloc is not
39 enabled, these macros will just make the object FastMalloced.
41 * WTF.xcodeproj/project.pbxproj:
43 * wtf/IsoMalloc.h: Added.
44 * wtf/IsoMallocInlines.h: Added.
46 2017-11-06 Christopher Reid <chris.reid@sony.com>
48 Use enum classes within FileSystem
49 https://bugs.webkit.org/show_bug.cgi?id=175172
51 Reviewed by Myles C. Maxfield.
53 Adding a helper function for converting enum classes to their underlying type when necessary.
57 2017-11-06 Michael Catanzaro <mcatanzaro@igalia.com>
59 [WPE][GTK] Always use SET_AND_EXPOSE_TO_BUILD to set build variables
60 https://bugs.webkit.org/show_bug.cgi?id=179038
62 Reviewed by Žan Doberšek.
66 2017-11-03 Chris Dumez <cdumez@apple.com>
68 Use a single identifier type to identify Service Workers
69 https://bugs.webkit.org/show_bug.cgi?id=179192
71 Reviewed by Brady Eidson.
73 Introduce class for strongly typed identifiers. This avoids mixing up
74 different types of identifiers.
76 * WTF.xcodeproj/project.pbxproj:
77 * wtf/ObjectIdentifier.h: Added.
78 (WTF::ObjectIdentifier::encode const):
79 (WTF::ObjectIdentifier::decode):
80 (WTF::ObjectIdentifier::operator== const):
81 (WTF::ObjectIdentifier::operator!= const):
82 (WTF::ObjectIdentifier::ObjectIdentifier):
83 (WTF::makeObjectIdentifier):
84 (WTF::ObjectIdentifierHash::hash):
85 (WTF::ObjectIdentifierHash::equal):
86 (WTF::HashTraits<ObjectIdentifier<T>>::emptyValue):
87 (WTF::HashTraits<ObjectIdentifier<T>>::constructDeletedValue):
88 (WTF::HashTraits<ObjectIdentifier<T>>::isDeletedValue):
90 2017-11-02 Ryan Haddad <ryanhaddad@apple.com>
92 Unreviewed, rolling out r224353.
94 Breaks internal builds.
98 "Ignore HSTS for partitioned, cross-origin subresource
100 https://bugs.webkit.org/show_bug.cgi?id=178993
101 https://trac.webkit.org/changeset/224353
103 2017-11-02 John Wilander <wilander@apple.com>
105 Ignore HSTS for partitioned, cross-origin subresource requests
106 https://bugs.webkit.org/show_bug.cgi?id=178993
107 <rdar://problem/34962462>
109 Reviewed by Brent Fulgham and Alex Christensen.
112 Added HAVE_CFNETWORK_IGNORE_HSTS.
114 2017-11-02 Frederic Wang <fwang@igalia.com>
116 Add references to bug 179167 in FIXME comments
117 https://bugs.webkit.org/show_bug.cgi?id=179168
119 Reviewed by Daniel Bates.
121 * wtf/FeatureDefines.h:
123 2017-11-01 Jiewen Tan <jiewen_tan@apple.com>
125 Let is<T>() accept RefPtrs
126 https://bugs.webkit.org/show_bug.cgi?id=178612
127 <rdar://problem/35102004>
129 Reviewed by Ryosuke Niwa.
131 Add support for is<T>() for RefPtrs.
136 2017-11-01 Simon Fraser <simon.fraser@apple.com>
138 Misc display list and other cleanup
139 https://bugs.webkit.org/show_bug.cgi?id=179150
141 Reviewed by Tim Horton.
143 Add system trace points for display list recording.
145 * wtf/SystemTracing.h:
147 2017-11-01 Fujii Hironori <Hironori.Fujii@sony.com>
149 Use LazyNeverDestroyed instead of DEFINE_GLOBAL
150 https://bugs.webkit.org/show_bug.cgi?id=174979
152 Reviewed by Yusuke Suzuki.
154 DEFINE_GLOBAL is not used anymore. Remove it.
156 * WTF.xcodeproj/project.pbxproj: Removed StaticConstructors.h
157 * config.h: Removed definitions of SKIP_STATIC_CONSTRUCTORS_ON_MSVC and SKIP_STATIC_CONSTRUCTORS_ON_GCC.
158 * wtf/CMakeLists.txt: Removed StaticConstructors.h
159 * wtf/StaticConstructors.h: Removed.
161 2017-10-30 Michael Catanzaro <mcatanzaro@igalia.com>
163 [WPE] Fix build warnings
164 https://bugs.webkit.org/show_bug.cgi?id=178899
166 Reviewed by Carlos Alberto Lopez Perez.
168 * wtf/PlatformWPE.cmake:
170 2017-10-27 Yousuke Kimoto <yousuke.kimoto@sony.com>
172 [WinCairo] Add WTF files for wincairo webkit
173 https://bugs.webkit.org/show_bug.cgi?id=176894
175 Reviewed by Alex Christensen.
177 * wtf/PlatformWin.cmake:
180 * wtf/win/Win32Handle.h:
181 * wtf/win/WorkItemContext.cpp: Added.
182 (WTF::WorkItemContext::WorkItemContext):
183 (WTF::WorkItemContext::create):
184 (WTF::WorkItemContext::~WorkItemContext):
185 * wtf/win/WorkItemContext.h: Added.
186 (WTF::WorkItemContext::handle):
187 (WTF::WorkItemContext::waitHandle):
188 (WTF::WorkItemContext::Function<void):
189 (WTF::WorkItemContext::queue const):
190 * wtf/win/WorkQueueWin.cpp:
191 (WTF::WorkQueue::handleCallback):
192 (WTF::WorkQueue::registerHandle):
193 (WTF::WorkQueue::unregisterAndCloseHandle):
194 (WTF::WorkQueue::unregisterWaitAndDestroyItemSoon):
195 (WTF::WorkQueue::unregisterWaitAndDestroyItemCallback):
197 2017-10-27 Keith Miller <keith_miller@apple.com>
199 Add unified source list files and build scripts to Xcode project navigator
200 https://bugs.webkit.org/show_bug.cgi?id=178959
202 Reviewed by Andy Estes.
204 * WTF.xcodeproj/project.pbxproj:
206 2017-10-26 Mark Lam <mark.lam@apple.com>
208 JSRopeString::RopeBuilder::append() should check for overflows.
209 https://bugs.webkit.org/show_bug.cgi?id=178385
210 <rdar://problem/35027468>
212 Reviewed by Saam Barati.
214 * wtf/CheckedArithmetic.h:
216 2017-10-25 Commit Queue <commit-queue@webkit.org>
218 Unreviewed, rolling out r222945.
219 https://bugs.webkit.org/show_bug.cgi?id=178818
221 "It made WasmBench crash" (Requested by saamyjoon on #webkit).
225 "bmalloc mutex should be adaptive"
226 https://bugs.webkit.org/show_bug.cgi?id=177839
227 https://trac.webkit.org/changeset/222945
229 2017-10-25 Zan Dobersek <zdobersek@igalia.com>
231 Make SERVICE_WORKER feature buildable on GTK, WPE
232 https://bugs.webkit.org/show_bug.cgi?id=178574
234 Reviewed by Carlos Garcia Campos.
236 * wtf/Identified.h: Explicitly include the <atomic> header since
237 std::atomic<> is used in the ThreadSafeIdentified definition.
239 2017-10-24 Michael Saboff <msaboff@apple.com>
241 WTF: Eliminated PLATFORM checks for HAVE_MACH_EXCEPTIONS
242 https://bugs.webkit.org/show_bug.cgi?id=178747
244 Reviewed by Saam Barati.
246 Removed unnecessary PLATFORM checks as they can cause build failures
247 when the include file is present.
251 2017-10-23 Yusuke Suzuki <utatane.tea@gmail.com>
253 [JSC] Use fastJoin in Array#toString
254 https://bugs.webkit.org/show_bug.cgi?id=178062
256 Reviewed by Darin Adler.
258 A bit cleaning up to use StringImpl::copyChars instead of
259 using for-loop directly.
261 * wtf/text/StringView.h:
262 (WTF::StringView::getCharactersWithUpconvert const):
264 2017-10-20 Antoine Quint <graouts@apple.com>
266 [Web Animations] Provide basic timeline and animation interfaces
267 https://bugs.webkit.org/show_bug.cgi?id=178526
269 Reviewed by Dean Jackson.
271 Remove the WEB_ANIMATIONS compile-time flag.
273 * wtf/FeatureDefines.h:
275 2017-10-19 Keith Miller <keith_miller@apple.com>
277 REGRESSION (r223476): WebCore exports symbols with names belonging to other frameworks
278 https://bugs.webkit.org/show_bug.cgi?id=178424
280 Reviewed by David Kilzer.
282 This patch moves the wrapper function sharing the name of the externed function
283 to the source file and marks it as always inline. Marking it as inline prevents
284 the framework from exporting it.
286 * wtf/cocoa/SoftLinking.h:
288 2017-10-18 Keith Miller <keith_miller@apple.com>
290 Setup WebCore build to start using unified sources.
291 https://bugs.webkit.org/show_bug.cgi?id=178362
293 Reviewed by Tim Horton.
295 There are a number of changes to the bundler script. First, it is
296 now possible to enable or disable building files based on if the
297 associated feature flag is enabled or not. The syntax for this is
298 similar to how we do #ifs in C++ code. e.g.
304 would enable myApplePayFile.cpp if and only if the APPLE_PAY
305 feature define is set.
307 I also changed comments from # to // to make it less likely they
308 would be confused with a #if.
310 Finally, this patch enables bundling files in the same relative
311 directory across source list files. Previously, if
312 SourcesCocoa.txt had platform/cf/foo.cpp and SourcesMac.txt had
313 platform/cf/bar.cpp those files would not be put in the same
314 unified source bundle. Now, those files will be put into the same
315 bundle but bar.cpp will always follow foo.cpp. The idea is that by
316 putting more specific files after more general files we can avoid
317 random build failures.
319 * Scripts/generate-unified-source-bundles.rb:
321 2017-10-18 Konstantin Tokarev <annulen@yandex.ru>
323 REGRESSION(r217771): nullTerminatedWCharToString loses last character of input string
324 https://bugs.webkit.org/show_bug.cgi?id=178444
326 Reviewed by Per Arne Vollan.
328 * wtf/text/win/WCharStringExtras.h:
329 (WTF::nullTerminatedWCharToString):
331 2017-10-17 Keith Miller <keith_miller@apple.com>
333 Change WebCore sources to work with unified source builds
334 https://bugs.webkit.org/show_bug.cgi?id=178229
336 Rubber stamped by Tim Horton.
339 * wtf/cocoa/SoftLinking.h:
341 2017-10-16 David Kilzer <ddkilzer@apple.com>
343 Add RELEASE_ASSERT_WITH_SECURITY_IMPLICATION() macro
344 <https://webkit.org/b/178269>
346 Reviewed by Alex Christensen.
349 (RELEASE_ASSERT_WITH_SECURITY_IMPLICATION): Add macro.
351 2017-10-14 Sam Weinig <sam@webkit.org>
353 Remove HashCountedSet's copyToVector functions
354 https://bugs.webkit.org/show_bug.cgi?id=178215
356 Reviewed by Daniel Bates.
358 * wtf/HashCountedSet.h:
359 (WTF::copyToVector): Deleted.
361 They are replaced by either copyToVector(hashCountedSet) or copyToVector(hashCountedSet.values())
363 2017-10-13 Sam Weinig <sam@webkit.org>
365 Adopt type trait template aliases everywhere in WTF
366 https://bugs.webkit.org/show_bug.cgi?id=178299
368 Reviewed by Yusuke Suzuki.
370 Adopt type trait template aliases (e.g. replace 'typename std::make_unsigned<Source>::type'
371 with 'std::make_unsigned_t<Source>'). Also adopt using over typedef consistently.
374 * wtf/CagedUniquePtr.h:
375 * wtf/CheckedArithmetic.h:
376 * wtf/CompletionHandler.h:
378 * wtf/HashCountedSet.h:
379 * wtf/HashFunctions.h:
384 * wtf/IndexedContainerIterator.h:
385 * wtf/IteratorAdaptors.h:
386 * wtf/KeyValuePair.h:
390 * wtf/NeverDestroyed.h:
393 * wtf/SizeLimits.cpp:
394 * wtf/StdLibExtras.h:
396 * wtf/ThreadSpecific.h:
399 * wtf/text/IntegerToStringConversion.h:
401 2017-10-13 Jer Noble <jer.noble@apple.com>
403 Performance: Skip texture upload if source image and destination texture haven't changed
404 https://bugs.webkit.org/show_bug.cgi?id=178254
405 <rdar://problem/34968181>
407 Reviewed by Dean Jackson.
409 Add a new class, UnsafePointer, for safely holding pointers to objects with uncontrolled lifetimes.
411 * WTF.xcodeproj/project.pbxproj:
412 * wtf/UnsafePointer.h: Added.
413 (WTF::UnsafePointer::UnsafePointer):
414 (WTF::UnsafePointer::operator== const):
415 (WTF::UnsafePointer::operator!= const):
416 (WTF::UnsafePointer::operator bool const):
420 2017-10-13 Per Arne Vollan <pvollan@apple.com>
422 [Win] When built with VS2017, MiniBrowser crashes on startup.
423 https://bugs.webkit.org/show_bug.cgi?id=175209
425 Reviewed by Daniel Bates.
427 Add AtomicString(const StaticStringImpl*) constructor. This is needed since
428 this patch adds constexpr to the static, global StaticStringImpl objects
429 generated in WebCore/bindings/scripts/StaticString.pm.
431 * wtf/text/AtomicString.h:
432 (WTF::AtomicString::AtomicString):
433 * wtf/text/AtomicStringImpl.cpp:
435 (WTF::AtomicStringImpl::add):
436 * wtf/text/AtomicStringImpl.h:
437 * wtf/text/StringImpl.h:
438 (WTF::StringImpl::assertHashIsCorrect const):
439 (WTF::StringImpl::assertHashIsCorrect): Deleted.
441 2017-10-12 Alex Christensen <achristensen@webkit.org>
443 Add Expected, HashMap, HashSet, and SHA1 to wtf/Forward.h
444 https://bugs.webkit.org/show_bug.cgi?id=178243
446 Reviewed by Tim Horton.
450 Move default parameters to Forward.h like we did with Vector.
452 Also fix indentation.
454 2017-10-12 Alex Christensen <achristensen@webkit.org>
456 Add CompletionHandler and HashCountedSet to wtf/Forward.h
457 https://bugs.webkit.org/show_bug.cgi?id=178231
459 Reviewed by Tim Horton.
462 * wtf/HashCountedSet.h:
464 2017-10-11 Sam Weinig <sam@webkit.org>
466 Remove out-parameter variants of copyToVector
467 https://bugs.webkit.org/show_bug.cgi?id=178155
469 Reviewed by Tim Horton.
472 (WTF::copyToVector): Deleted.
474 (WTF::copyToVector): Deleted.
479 (WTF::copyToVectorSpecialization):
481 Add another version of copyToVector, called copyToVectorSpecialization, that allows
482 you to specify the entire specialization for the Vector you want to copy to. This
483 can be useful if you want your resulting Vector to have an inline capacity.
485 2017-10-12 Sam Weinig <sam@webkit.org>
487 It should be possible to iterate just the values (and not the counts) of a HashCountedSet
488 https://bugs.webkit.org/show_bug.cgi?id=178169
490 Reviewed by Daniel Bates.
492 Cleanup (fix indentation, simplify type names, adopt using), and add a values() range to
493 HashCountedSet. This will allow getting a Vector of all the values (and not the counts)
494 using the new copyToVector.
496 * wtf/HashCountedSet.h:
498 2017-10-11 Michael Saboff <msaboff@apple.com>
500 [JSC] Add ability to build with ARMV8 ILP32 ABI
501 https://bugs.webkit.org/show_bug.cgi?id=178194
503 Reviewed by Saam Barati.
505 For ARMV8 32 bit ABI, use JSVALUE32_64 and the CLOOP.
509 2017-10-11 Youenn Fablet <youenn@apple.com>
511 Add API to clean CacheStorage data
512 https://bugs.webkit.org/show_bug.cgi?id=178034
514 Reviewed by Chris Dumez.
516 Moving CallbackAggregator pattern into its own class for easier reuse.
518 * WTF.xcodeproj/project.pbxproj:
519 * wtf/CallbackAggregator.h: Added.
520 (WTF::CallbackAggregator::create):
521 (WTF::CallbackAggregator::~CallbackAggregator):
522 (WTF::CallbackAggregator::CallbackAggregator):
524 2017-10-10 Sam Weinig <sam@webkit.org>
526 Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values())
527 https://bugs.webkit.org/show_bug.cgi?id=178102
529 Reviewed by Tim Horton.
532 (WTF::copyKeysToVector): Deleted.
533 (WTF::copyValuesToVector): Deleted.
535 Remove copyKeysToVector and copyValuesToVector which are no longer used.
537 2017-10-09 Youenn Fablet <youenn@apple.com>
539 Vector should be able to easily create from a list of movable only items
540 https://bugs.webkit.org/show_bug.cgi?id=176432
542 Reviewed by Darin Adler.
544 Adding static from method to construct a Vector from movable-only items.
545 This may also be used instead of initializer list constructor for types that would benefit of being moved.
548 (WTF::Vector::Vector):
550 (WTF::Vector::uncheckedInitialize): Introduced as an optimization to set the vector size once.
551 (WTF::Malloc>::reserveInitialCapacity):
553 2017-10-09 Tim Horton <timothy_horton@apple.com>
555 Disable INPUT_TYPE_COLOR in FeatureDefines.h
556 https://bugs.webkit.org/show_bug.cgi?id=178103
557 <rdar://problem/34872127>
559 Reviewed by Simon Fraser.
561 * wtf/FeatureDefines.h:
562 Because FeatureDefines.h overrides features that are not enabled in
563 FeatureDefines.xcconfig, you currently have to turn INPUT_TYPE_COLOR
564 off in two places. Since we only ever want it on for Mac, it's OK
565 to depend on the xcconfig defining it.
567 2017-10-09 Sam Weinig <sam@webkit.org>
569 Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
570 https://bugs.webkit.org/show_bug.cgi?id=178072
572 Reviewed by Darin Adler.
574 Introduce SizedIteratorRange, a variant of IteratorRange that includes
575 a reference to a backing container in order to get the size of container.
576 This is useful for algorithms like WTF::map and WTF::copyToVector, that
577 can use the size to efficiently allocate things of the correct size.
579 The main beneficiary are HashMap's keys() and values() functions which
580 used to return IteratorRanges and now return SizedIteratorRange. This
581 allows us to remove (in a future change) copyKeysToVector() and
582 copyValuesToVector() by replacing them with copyToVector(map.keys()) and
583 copyToVector(map.values()) respectively.
586 * wtf/IteratorRange.h:
587 (WTF::SizedIteratorRange::SizedIteratorRange):
588 (WTF::SizedIteratorRange::size const):
589 (WTF::SizedIteratorRange::begin const):
590 (WTF::SizedIteratorRange::end const):
591 (WTF::makeSizedIteratorRange):
593 2017-10-08 Sam Weinig <sam@webkit.org>
595 It should be possible to create a ListHashSet with a std::initializer_list.
596 https://bugs.webkit.org/show_bug.cgi?id=178070
598 Reviewed by Darin Adler.
601 (WTF::U>::ListHashSet):
602 Add a constructor that takes a std::initializer_list.
604 2017-10-08 Sam Weinig <sam@webkit.org>
606 Address additional feedback from Darin for r223039 and sort the using declarations.
610 2017-10-08 Sam Weinig <sam@webkit.org>
612 There should be a version of copyToVector that returns a Vector, rather than using an out parameter
613 https://bugs.webkit.org/show_bug.cgi?id=177732
615 Reviewed by Saam Barati.
617 Add two new helper functions, copyToVector and copyToVectorOf, which will be able to
618 replace the existing out parameter taking copyToVector. Like it's ancestral namesake,
619 copyToVector takes an object that is both iterable (supports begin() and end()) and
620 has a size, and returns a Vector with a copy of all the items iterated. The copyToVectorOf
621 variant allow the user to specify a type to convert to, so if you have a HashSet<int>
622 but want those as floats in a Vector, you can do:
624 auto floatVector = copyToVectorOf<float>(intSet);
628 (WTF::copyToVectorOf):
630 2017-10-08 Darin Adler <darin@apple.com>
632 Fix bugs related to setting reflected floating point DOM attributes
633 https://bugs.webkit.org/show_bug.cgi?id=178061
635 Reviewed by Sam Weinig.
638 (WTF::formatStringTruncatingTrailingZerosIfNeeded): Fix a bug where
639 this function would remove trailing zeroes from the exponent if
640 present instead of from the mantissa. This meant that it would
641 format 1e10 as "1.00000e+1" instead of "1e+10". Added regression
642 tests for this to TestWebKitAPI.
645 (WTF::double_conversion::StringBuilder::RemoveCharacters): Added.
646 Used by the fix above.
648 * wtf/text/AtomicString.cpp:
649 (WTF::AtomicString::number): Note: This function is used by code
650 that sets the values of reflected floating point DOM attributes.
651 Changed the function to use the rules from numberToString rather
652 ones from numberToFixedPrecisionString. This is analogous to
653 String::numberToStringECMAScript, and in the future we should change
654 String and StringBuilder so this "ECMAScript" semantic is the default
655 way to convert a floating point number to a string, and rename the fixed
656 precision version that is currently called String::number. I audited
657 the small number of sites calling AtomicString::number, by temporarily
658 renaming it, and discovered that this is the correct behavior for all;
659 none needed fixed precision. Also, fixed a mistake where this explicitly
660 converted to String. That was defeating the purpose of having these
661 functions in AtomicString: It would allocate a new String and then
662 destroy it in the case where an equal string was already in the
665 2017-10-06 Commit Queue <commit-queue@webkit.org>
667 Unreviewed, rolling out r222791 and r222873.
668 https://bugs.webkit.org/show_bug.cgi?id=178031
670 Caused crashes with workers/wasm LayoutTests (Requested by
671 ryanhaddad on #webkit).
675 "WebAssembly: no VM / JS version of everything but Instance"
676 https://bugs.webkit.org/show_bug.cgi?id=177473
677 http://trac.webkit.org/changeset/222791
679 "WebAssembly: address no VM / JS follow-ups"
680 https://bugs.webkit.org/show_bug.cgi?id=177887
681 http://trac.webkit.org/changeset/222873
683 2017-10-06 Antti Koivisto <antti@apple.com>
685 Minor WeakPtr improvements
686 https://bugs.webkit.org/show_bug.cgi?id=177958
688 Reviewed by Sam Weinig.
691 (WTF::WeakPtr::operator bool const):
695 (WTF::WeakPtrFactory::createWeakPtr const):
698 Remove templating from createWeakPtr, makeWeakPtr() is now the
699 canonical way to make derived-type WeakPtrs.
701 2017-10-04 Filip Pizlo <fpizlo@apple.com>
703 bmalloc mutex should be adaptive
704 https://bugs.webkit.org/show_bug.cgi?id=177839
706 Reviewed by Michael Saboff.
708 Add some comments that I thought of while copy-pasting this code.
710 Reland after fixing ancient WordLock bug: the notify_one has to happen with the lock held
711 to ensure it doesn't run after that thread has died.
713 * wtf/LockAlgorithmInlines.h:
716 2017-10-05 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 Brian Burg.
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-05 David Kilzer <ddkilzer@apple.com>
739 Bug 177893: Disable -Wcast-qual for new clang compiler in Apple ports
740 <https://webkit.org/b/177893>
741 <rdar://problem/33667497>
743 Reviewed by Tim Horton.
746 (WTF::RetainPtr::fromStorageType const): Disable warnings for
747 -Wcast-qual until we can provide a safe cast function that lets
748 us re-enable the warning.
750 2017-10-05 Matt Lewis <jlewis3@apple.com>
752 Unreviewed, rolling out r222893.
754 This caused multiple API failures.
758 "bmalloc mutex should be adaptive"
759 https://bugs.webkit.org/show_bug.cgi?id=177839
760 http://trac.webkit.org/changeset/222893
762 2017-10-04 Filip Pizlo <fpizlo@apple.com>
764 bmalloc mutex should be adaptive
765 https://bugs.webkit.org/show_bug.cgi?id=177839
767 Reviewed by Michael Saboff.
769 Add some comments that I thought of while copy-pasting this code.
771 * wtf/LockAlgorithmInlines.h:
774 2017-10-04 JF Bastien <jfbastien@apple.com>
776 WTF: Update std::expected to match current proposal
777 https://bugs.webkit.org/show_bug.cgi?id=177881
779 Reviewed by Mark Lam.
781 The proposal is likely to be in C++20 and I've been asked to help co-champion
782 it. I'm therefore updating our implementation to more closely match the current
783 proposal, and to make sure it'll work for us if standardized.
785 - Rename UnexpectedType to Unexpected to match the proposal.
786 - Remove relational operators, only equality / inequality remains.
787 - Fix minor type signatures.
788 - Add UnexpectedType typedef.
789 - Uncomment rebind implementation.
790 - Add in-place construction tag, as well as explicit error construction tag.
791 - Add template unexpected constructor.
792 - Note that make_unexpected isn't in the proposal anymore, but we keep it because we don't have C++17 deduction guides.
793 - Remove hashing, which isn't in the proposal anymore.
796 (WTF::Unexpected::Unexpected):
797 (WTF::Unexpected::value const):
800 (WTF::makeUnexpected):
801 (WTF::Expected::Expected):
802 (WTF::Expected::operator=):
803 (WTF::Expected::getUnexpected const):
805 2017-10-04 Ryan Haddad <ryanhaddad@apple.com>
807 Unreviewed, rolling out r222840.
809 This change breaks internal builds.
813 "Generate a compile error if release is built without compiler
815 https://bugs.webkit.org/show_bug.cgi?id=177665
816 http://trac.webkit.org/changeset/222840
818 2017-10-04 Carlos Alberto Lopez Perez <clopez@igalia.com>
820 Generate a compile error if release is built without compiler optimizations
821 https://bugs.webkit.org/show_bug.cgi?id=177665
823 Reviewed by Michael Catanzaro.
825 For GCC and Clang, generate an error at build time that will alert
826 the developer that she is trying to build Release without any compiler
827 optimization. A build time error is much better than an unexpected
828 "oh, WebKit is really slow ..." situation later.
830 If this was intended, then we tell the developer that she can continue
831 by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
834 The intention of this patch is to ensure that nobody builds Release
835 without enabling compiler optimization by mistake.
839 2017-10-04 Tomas Popela <tpopela@redhat.com>
841 Allow building without WOFF enabled
843 Reviewed by Michael Catanzaro.
845 Don't force the WOFF to be turned on, but follow what is set in cmake.
849 2017-10-03 Saam Barati <sbarati@apple.com>
851 Implement polymorphic prototypes
852 https://bugs.webkit.org/show_bug.cgi?id=176391
854 Reviewed by Filip Pizlo.
857 (WTF::Box::operator bool const):
858 (WTF::Box::operator bool): Deleted.
859 Make Box movable. Also ensure its operator bool doesn't do an atomic increment.
861 (WTF::RefPtr::operator bool const):
862 Add `explicit operator bool()` for RefPtr.
864 2017-10-03 Antti Koivisto <antti@apple.com>
866 Allow assigning WeakPtr<Derived> to WeakPtr<Base>
867 https://bugs.webkit.org/show_bug.cgi?id=177817
869 Reviewed by Geoff Garen.
871 Add templated copy/move constructors/assignment operators, similar to RefPtr.
874 (WTF::WeakPtrFactory::createWeakPtr const):
875 (WTF::weak_reference_upcast):
876 (WTF::weak_reference_downcast):
877 (WTF::WeakPtr<T>::WeakPtr):
881 2017-10-03 JF Bastien <jfbastien@apple.com>
883 WebAssembly: no VM / JS version of everything but Instance
884 https://bugs.webkit.org/show_bug.cgi?id=177473
886 Reviewed by Filip Pizlo.
888 * wtf/StdLibExtras.h:
889 (WTF::default_construct_at): this makes code in WasmTable much
890 more readable, and is generally useful for generic code
892 2017-10-02 Myles C. Maxfield <mmaxfield@apple.com>
894 Move LineEnding.{h,cpp} from WebCore/platform/text to wtf/text
895 https://bugs.webkit.org/show_bug.cgi?id=176575
897 Reviewed by Alex Christensen.
899 As part of the PAL effort, we're trying to move everything out of WebCore/platform, one-by-one.
900 These LineEnding files belong in WTF.
902 * WTF.xcodeproj/project.pbxproj:
903 * wtf/text/LineEnding.cpp: Renamed from Source/WebCore/platform/text/LineEnding.cpp.
904 (WTF::normalizeLineEndingsToCRLF):
905 * wtf/text/LineEnding.h: Renamed from Source/WebCore/platform/text/LineEnding.h.
907 2017-10-02 Geoffrey Garen <ggaren@apple.com>
909 WeakPtr should have a move constructor
910 https://bugs.webkit.org/show_bug.cgi?id=177789
912 Reviewed by Chris Dumez.
914 * wtf/WeakPtr.h: Now that we just have a RefPtr data member,
915 the default operators are sufficient.
917 2017-10-02 Geoffrey Garen <ggaren@apple.com>
919 NULL WeakPtr should not malloc!
920 https://bugs.webkit.org/show_bug.cgi?id=177773
922 Reviewed by Antti Koivisto.
924 Translating NULL into malloc is... inefficient.
927 (WTF::WeakPtr::WeakPtr):
928 (WTF::WeakPtr::operator=):
929 (WTF::WeakPtr::clear): Make m_ref lazy so that a NULL m_ref can represent
930 a NULL pointer. Normal dereference is no slower because we can rely on
931 the fact that dereference of NULL should crash. operator bool() and get()
932 incur an extra branch. That's probably worth it to avoid malloc
935 2017-10-02 Antti Koivisto <antti@apple.com>
937 Add makeWeakPtr variant that takes pointer
938 https://bugs.webkit.org/show_bug.cgi?id=177767
940 Reviewed by Zalan Bujtas.
945 This version deals with the nullptr.
947 2017-09-30 Antti Koivisto <antti@apple.com>
949 Add makeWeakPtr for easier WeakPtr construction
950 https://bugs.webkit.org/show_bug.cgi?id=177706
952 Reviewed by Sam Weinig.
954 Standalone makeWeakPtr() returns a WeakPtr of the same type as the argument.
956 For this to work the argument type needs to expose a (possibly base type) WeakPtrFactory
957 as a public weakPtrFactory() member function.
960 (WTF::WeakPtr::operator-> const):
961 (WTF::WeakPtr::operator* const): Also add operator*.
964 2017-09-28 Jiewen Tan <jiewen_tan@apple.com>
966 WeakPtrFactory should allow downcasting
967 https://bugs.webkit.org/show_bug.cgi?id=177389
968 <rdar://problem/34604174>
970 Reviewed by Geoffrey Garen.
972 In this patch, WeakPtrFactory is enhanced with the ability to create WeakPtrs
973 of its owner's sub classes and have them point to the same WeakReference.
976 (WTF::WeakPtr::WeakPtr):
977 We cannot determine the base class of type T, thus no friends. It is made public
978 such that WeakPtrFactory with a base class type U can create a derived type T
980 (WTF::WeakPtrFactory::createWeakPtr const):
982 2017-09-28 Don Olmstead <don.olmstead@sony.com>
984 Sync SYSTEM_MALLOC implementation of Gigacage
985 https://bugs.webkit.org/show_bug.cgi?id=177569
987 Reviewed by Mark Lam.
991 (Gigacage::basePtrs):
993 2017-09-27 Per Arne Vollan <pvollan@apple.com>
995 [Win64] Compile error, 'BasePtrs' is undefined.
996 https://bugs.webkit.org/show_bug.cgi?id=177565
998 Reviewed by Mark Lam.
1000 Copy definition of 'BasePtrs' from bmalloc/GigaCage.h.
1004 2017-09-26 Said Abou-Hallawa <sabouhallawa@apple.com>
1006 Followup (r222427): SynchronizedFixedQueue should not have a public constructor
1007 https://bugs.webkit.org/show_bug.cgi?id=177458
1009 Reviewed by Tim Horton.
1011 Since SynchronizedFixedQueue is now derived from ThreadSafeRefCounted<SynchronizedFixedQueue>,
1012 the standard way to have an instance of it is to call SynchronizedFixedQueue::create()
1013 which returns a Ref<SynchronizedFixedQueue>. Now it does not make sense to still
1014 have the constructor public.
1016 * wtf/SynchronizedFixedQueue.h:
1017 (WTF::SynchronizedFixedQueue::SynchronizedFixedQueue):
1019 2017-09-24 Keith Miller <keith_miller@apple.com>
1021 JSC build should use unified sources for derived sources
1022 https://bugs.webkit.org/show_bug.cgi?id=177421
1024 Reviewed by JF Bastien.
1026 The script now needs to determine if a file is from a derived
1027 source. This is only relevant for the CMake build since the
1028 script needs to provide a list of the bundled source files. If the
1029 script does not provide the full path for derived sources then
1030 CMake will be unable to find them and the build will fail.
1032 Additionally, I move the error message for the Xcode build outside
1033 the main loop. This means that the error message will contain all
1034 the files you need to add to Xcode and all those files will now be
1035 written in DerivedSources so they should be easier to add.
1037 * Scripts/generate-unified-source-bundles.rb:
1039 2017-09-26 Zan Dobersek <zdobersek@igalia.com>
1041 Support building JavaScriptCore with the Bionic C library
1042 https://bugs.webkit.org/show_bug.cgi?id=177427
1044 Reviewed by Michael Catanzaro.
1046 * wtf/Platform.h: Define HAVE_MACHINE_CONTEXT when __BIONIC__
1047 is defined, i.e. when building with the Bionic C library.
1049 2017-09-23 Said Abou-Hallawa <sabouhallawa@apple.com>
1051 Images may render partial frames even after loading all the encoded data
1052 https://bugs.webkit.org/show_bug.cgi?id=177406
1054 Reviewed by Simon Fraser.
1056 Make it possible to create a RefPtr<SynchronizedFixedQueue>.
1058 * wtf/SynchronizedFixedQueue.h:
1059 (WTF::SynchronizedFixedQueue::create):
1060 (WTF::SynchronizedFixedQueue::enqueue):
1061 (WTF::SynchronizedFixedQueue::dequeue):
1063 2017-09-22 Zalan Bujtas <zalan@apple.com>
1065 WeakPtrFactory should populate m_ref lazily.
1066 https://bugs.webkit.org/show_bug.cgi?id=177375
1068 Reviewed by Geoffrey Garen.
1070 This helps us with the overhead of initializing WeakPtrFactory for
1071 objects that rarely end up creating the weak reference.
1072 -This is in preparation for introducing WeakPtr to RenderObject.
1074 All credit to Geoffrey Garen.
1077 (WTF::WeakReference::get const):
1078 (WTF::WeakReference::clear):
1079 (WTF::WeakReference::WeakReference):
1080 (WTF::WeakPtrFactory::~WeakPtrFactory):
1081 (WTF::WeakPtrFactory::createWeakPtr const):
1082 (WTF::WeakPtrFactory::revokeAll):
1083 (WTF::WeakPtrFactory::WeakPtrFactory): Deleted.
1085 2017-09-21 Alex Christensen <achristensen@webkit.org>
1087 Make StringBuilder movable
1088 https://bugs.webkit.org/show_bug.cgi?id=177311
1090 Reviewed by Chris Dumez.
1092 * wtf/text/StringBuilder.h:
1093 (WTF::StringBuilder::StringBuilder):
1095 2017-09-20 Keith Miller <keith_miller@apple.com>
1097 JSC should use unified sources for platform specific files.
1098 https://bugs.webkit.org/show_bug.cgi?id=177290
1100 Reviewed by Michael Saboff.
1102 The unified source bundler script can now handle more than one
1103 list of sources. Sources will not be bundled across source file
1104 lists. We want to ensure that changing one platform's sources
1105 doesn't break another platform's build, as much as
1106 possible. Additionally, it means that there won't be weird
1107 performance changes when files are added to an unrelated platform.
1109 Remove stale reference to generate-unified-source-bundles.rb script
1112 * Scripts/generate-unified-source-bundles.rb:
1113 * WTF.xcodeproj/project.pbxproj:
1115 2017-09-20 Stephan Szabo <stephan.szabo@sony.com>
1117 [Win] WTF: Add alias for process id to use in place of direct uses of pid_t
1118 https://bugs.webkit.org/show_bug.cgi?id=177017
1120 Reviewed by Alex Christensen.
1123 (WTF::getCurrentProcessID):
1125 2017-09-20 Keith Miller <keith_miller@apple.com>
1127 JSC Xcode build should use unified sources for platform independent files
1128 https://bugs.webkit.org/show_bug.cgi?id=177190
1130 Reviewed by Saam Barati.
1132 Add a new directory for build scripts that are forwarded to subsequent framework builds.
1134 * Scripts/generate-unified-source-bundles.rb: Renamed from Source/WTF/generate-unified-source-bundles.rb.
1135 * WTF.xcodeproj/project.pbxproj:
1136 * wtf/CMakeLists.txt:
1138 2017-09-20 Per Arne Vollan <pvollan@apple.com>
1140 [Win] Cannot find script to generate unified sources.
1141 https://bugs.webkit.org/show_bug.cgi?id=177014
1143 Reviewed by Keith Miller.
1145 Copy the ruby script to WTF/Scripts in the forwarding headers folder.
1147 * wtf/CMakeLists.txt:
1149 2017-09-20 Alberto Garcia <berto@igalia.com>
1151 Fix HPPA and Alpha builds
1152 https://bugs.webkit.org/show_bug.cgi?id=177224
1154 Reviewed by Alex Christensen.
1158 2017-09-19 Youenn Fablet <youenn@apple.com>
1160 Allow WTF::map to use any class that is iterable and has a size getter
1161 https://bugs.webkit.org/show_bug.cgi?id=177026
1163 Reviewed by Darin Adler.
1165 Computing the Item type given to the lambda using the iterator instead of ValueType which is specific to Vector.
1166 Adding the possibility to pass a non const container reference and a lambda taking non const references as well.
1169 (WTF::MapFunctionInspector::acceptsReference):
1173 2017-09-19 Jer Noble <jer.noble@apple.com>
1175 [Cocoa] Add an ImageDecoder subclass backed by AVFoundation
1176 https://bugs.webkit.org/show_bug.cgi?id=176825
1178 Reviewed by Eric Carlson.
1182 2017-09-18 Andy Estes <aestes@apple.com>
1184 [Cocoa] Upstream sandbox-related WebKitSystemInterface functions
1185 https://bugs.webkit.org/show_bug.cgi?id=177047
1187 Reviewed by Daniel Bates.
1189 * wtf/spi/darwin/SandboxSPI.h:
1191 2017-09-18 Ryan Haddad <ryanhaddad@apple.com>
1193 Unreviewed, rolling out r222170.
1195 The API test added with this change is failing.
1199 "Allow WTF::map to use any class that is iterable and has a
1201 https://bugs.webkit.org/show_bug.cgi?id=177026
1202 http://trac.webkit.org/changeset/222170
1204 2017-09-18 Youenn Fablet <youenn@apple.com>
1206 Allow WTF::map to use any class that is iterable and has a size getter
1207 https://bugs.webkit.org/show_bug.cgi?id=177026
1209 Reviewed by Darin Adler.
1211 Computing the Item type given to the lambda using the iterator instead of ValueType which is specific to Vector.
1212 Adding the possibility to pass a non const container reference and a lambda taking non const references as well.
1215 (WTF::MapFunctionInspector::acceptsReference):
1219 2017-09-15 JF Bastien <jfbastien@apple.com>
1221 WTF: use Forward.h when appropriate instead of Vector.h
1222 https://bugs.webkit.org/show_bug.cgi?id=176984
1224 Reviewed by Saam Barati.
1226 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.
1230 * wtf/text/StringVector.h:
1232 2017-09-15 Keith Miller <keith_miller@apple.com>
1234 generate-unified-source-bundles.rb shouldn't write a file that isn't going to change
1235 https://bugs.webkit.org/show_bug.cgi?id=177021
1237 Reviewed by Tim Horton.
1239 * generate-unified-source-bundles.rb:
1241 2017-09-14 Saam Barati <sbarati@apple.com>
1243 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
1244 https://bugs.webkit.org/show_bug.cgi?id=176863
1246 Reviewed by Keith Miller.
1248 This patch adds a way for a particular function to mark
1249 that none of its calls should be tail calls.
1251 It's useful in the following example if you don't want foo
1252 to do a tail call to bar or baz:
1262 Note that we're not saying that bar/baz should not be tail callable. bar/baz
1263 may have other callers that are allowed to tail call it. This macro just says
1264 that foo itself will not perform any tail calls.
1266 * WTF.xcodeproj/project.pbxproj:
1267 * wtf/NoTailCalls.h: Added.
1268 (WTF::NoTailCalls::~NoTailCalls):
1270 2017-09-14 Mark Lam <mark.lam@apple.com>
1272 AddressSanitizer: stack-buffer-underflow in JSC::Probe::Page::Page
1273 https://bugs.webkit.org/show_bug.cgi?id=176874
1274 <rdar://problem/34436415>
1276 Reviewed by Saam Barati.
1278 Added a convenience version of roundUpToMultipleOf() so that it can be applied to
1279 pointers without the client having to cast explicitly.
1281 * wtf/StdLibExtras.h:
1282 (WTF::roundUpToMultipleOf):
1284 2017-09-14 Youenn Fablet <youenn@apple.com>
1286 Allow WTF::map to take function as parameter
1287 https://bugs.webkit.org/show_bug.cgi?id=176909
1289 Reviewed by Jer Noble.
1294 2017-09-13 Youenn Fablet <youenn@apple.com>
1296 Add a lambda-based map for Vectors
1297 https://bugs.webkit.org/show_bug.cgi?id=176487
1299 Reviewed by Darin Adler.
1301 This helper routine allows refactoring the reserveInitialCapacity/uncheckedAppend pattern, the mapper between source and destination item being a lambda.
1304 (WTF::Mapper::transform):
1308 2017-09-12 Yusuke Suzuki <utatane.tea@gmail.com>
1310 [DFG] Optimize WeakMap::get by adding intrinsic and fixup
1311 https://bugs.webkit.org/show_bug.cgi?id=176010
1313 Reviewed by Filip Pizlo.
1315 Add inlineGet method with HashTranslator.
1318 (WTF::X>::inlineGet const):
1319 (WTF::MappedTraits>::inlineGet const):
1320 (WTF::MappedTraits>::fastGet const): Deleted.
1321 * wtf/LoggingHashMap.h:
1323 2017-09-12 Keith Miller <keith_miller@apple.com>
1325 Do unified source builds for JSC
1326 https://bugs.webkit.org/show_bug.cgi?id=176076
1328 Reviewed by Geoffrey Garen.
1330 This patch adds a script that will automatically bundle source
1331 files, which is currently only used by the CMake build. It's
1332 important that we use the same script to generate the bundles
1333 for the CMake build as the Xcode build. If we didn't do this then
1334 it's likely that there would be build errors that occur in only
1335 one build system. On the same note, we also need to be careful to
1336 not bundle platform specific source files with platform
1337 independent ones. There are a couple of things the script does not
1338 currently handle but are not essential for the CMake build. First,
1339 it does not handle the max bundle size restrictions that the Xcode
1340 build will require. It also does not handle C files.
1342 The unified source generator script works by collecting groups of
1343 up to 8 files from the same directory. We don't bundle files from
1344 across directories since I didn't see a speedup from doing
1345 so. Additionally, splitting at the directory boundary means that
1346 it is less likely that adding a new file will force a "clean"
1347 build. This would happen because the new file will shift every
1348 subsequent file into the next unified source bundle.
1350 Using unified sources appears to be a roughly 3.5x build time
1351 speed up for clean builds on my MBP and appears to have a
1352 negligible effect in incremental builds.
1354 * generate-unified-source-bundles.rb: Added.
1357 2017-09-12 Joseph Pecoraro <pecoraro@apple.com>
1359 QualifiedName::init should assume AtomicStrings::init was already called
1360 https://bugs.webkit.org/show_bug.cgi?id=176639
1362 Reviewed by Sam Weinig.
1364 * wtf/NeverDestroyed.h:
1365 (WTF::LazyNeverDestroyed::isConstructed const):
1367 2017-09-12 Brent Fulgham <bfulgham@apple.com>
1369 Show punycode to user if a URL mixes Armenian Seh or Vo with other scripts
1370 https://bugs.webkit.org/show_bug.cgi?id=176578
1371 <rdar://problem/33906231>
1373 Reviewed by Alex Christensen.
1376 (WTF::isASCIIDigitOrPunctuation): Added helper function to recognize ASCII digits
1377 and punctuation characters.
1379 2017-09-12 Sam Weinig <sam@webkit.org>
1381 [Cleanup] Follow up cleanup for DOMFormData implementation
1382 https://bugs.webkit.org/show_bug.cgi?id=176740
1384 Reviewed by Alex Christensen.
1386 * WTF.xcodeproj/project.pbxproj:
1388 (WTF::KeyValuePair::KeyValuePair): Deleted.
1389 * wtf/KeyValuePair.h: Added.
1390 (WTF::KeyValuePair::KeyValuePair):
1391 (WTF::makeKeyValuePair):
1393 Move KeyValuePair to its own header and add a makeKeyValuePair helper.
1395 2017-09-11 Ryan Haddad <ryanhaddad@apple.com>
1397 Unreviewed, rolling out r221854.
1399 The test added with this change fails on 32-bit JSC bots.
1403 "[DFG] Optimize WeakMap::get by adding intrinsic and fixup"
1404 https://bugs.webkit.org/show_bug.cgi?id=176010
1405 http://trac.webkit.org/changeset/221854
1407 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com>
1409 [DFG] Optimize WeakMap::get by adding intrinsic and fixup
1410 https://bugs.webkit.org/show_bug.cgi?id=176010
1412 Reviewed by Filip Pizlo.
1414 Add inlineGet method with HashTranslator.
1417 (WTF::X>::inlineGet const):
1418 (WTF::MappedTraits>::inlineGet const):
1419 (WTF::MappedTraits>::fastGet const): Deleted.
1420 * wtf/LoggingHashMap.h:
1422 2017-09-07 Myles C. Maxfield <mmaxfield@apple.com>
1424 [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
1425 https://bugs.webkit.org/show_bug.cgi?id=176561
1427 Reviewed by Brent Fulgham.
1429 WebCore/platform/Language was the only* user of PlatformUserPreferredLanguages (with 1 exception).
1430 That exception is that JavaScriptCore needed the functionality of WebCore/platform/Language, but it
1431 couldn't get it because of the layering violation, so instead it erroneously called into
1432 PlatformUserPreferredLanguages instead. This patch merges these two files into WTF so JSC gets the
1433 right function and the PAL effort has one less file to move from WebCore/platform into PAL.
1435 * WTF.xcodeproj/project.pbxproj:
1436 * wtf/CMakeLists.txt:
1437 * wtf/Language.cpp: Renamed from Source/WebCore/platform/Language.cpp.
1438 (WTF::addLanguageChangeObserver):
1439 (WTF::userPreferredLanguages):
1440 * wtf/Language.h: Renamed from Source/WebCore/platform/Language.h.
1441 * wtf/PlatformGTK.cmake:
1442 * wtf/PlatformJSCOnly.cmake:
1443 * wtf/PlatformMac.cmake:
1444 * wtf/PlatformUserPreferredLanguages.h: Removed.
1445 * wtf/PlatformWPE.cmake:
1446 * wtf/PlatformWin.cmake:
1447 * wtf/cf/LanguageCF.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm.
1448 (WTF::httpStyleLanguageCode):
1449 (WTF::languagePreferencesDidChange):
1450 (WTF::platformUserPreferredLanguages):
1451 * wtf/unix/LanguageUnix.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesUnix.cpp.
1452 * wtf/win/LanguageWin.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesWin.cpp.
1454 2017-09-06 Eric Carlson <eric.carlson@apple.com>
1456 Require LoggingHelper overrides to provide identifier
1457 https://bugs.webkit.org/show_bug.cgi?id=176477
1459 Reviewed by Jer Noble.
1461 * wtf/Assertions.cpp: No more WTFLogLevelNotice.
1462 * wtf/Assertions.h: Ditto.
1464 2017-09-06 Per Arne Vollan <pvollan@apple.com>
1466 [Win] WebCore failed to build, InbandTextTrackPrivateAVF: base class undefined.
1467 https://bugs.webkit.org/show_bug.cgi?id=176431
1469 Reviewed by Alex Christensen.
1471 AVFoundation header detection should be done in WebCore because of build dependencies.
1473 * AVFoundationSupport.py: Removed.
1475 * wtf/PlatformWin.cmake:
1477 2017-09-05 Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com>
1479 [Win] Fix the wincairo build after r221558 and r221583
1480 https://bugs.webkit.org/show_bug.cgi?id=176353
1482 Reviewed by Yusuke Suzuki.
1484 * wtf/Assertions.cpp:
1486 2017-09-04 Eric Carlson <eric.carlson@apple.com>
1488 Switch HTMLMediaElement to release logging
1489 https://bugs.webkit.org/show_bug.cgi?id=176065
1491 Reviewed by Jer Noble.
1493 * wtf/MediaTime.cpp:
1494 (WTF::MediaTime::dump const): Use toString.
1495 (WTF::MediaTime::toString const): New.
1497 2017-09-04 Yusuke Suzuki <utatane.tea@gmail.com>
1499 Remove OS(SOLARIS) support
1500 https://bugs.webkit.org/show_bug.cgi?id=176341
1502 Reviewed by Sam Weinig.
1504 WebKit project does not have stake holders supporting Solaris right now.
1505 And Solaris + SPARC in 64bit environment does not work well since its
1506 address space includes non-48bit area. It breaks our JSVALUE64 in JSC.
1507 In addition, Solaris a bit complicates our threading implementation
1508 because of its special threading stack.
1510 This patch removes OS(SOLARIS) and COMPILER(SUNCC) support from WebKit.
1515 (std::isfinite): Deleted.
1516 (std::signbit): Deleted.
1517 (std::isinf): Deleted.
1518 * wtf/NumberOfCores.cpp:
1519 (WTF::numberOfProcessorCores):
1521 * wtf/StackBounds.cpp:
1522 * wtf/ThreadingPthreads.cpp:
1524 2017-09-04 Commit Queue <commit-queue@webkit.org>
1526 Unreviewed, rolling out r221494 and r221500.
1527 https://bugs.webkit.org/show_bug.cgi?id=176258
1529 This caused the windows build to fail. (Requested by mlewis13
1532 Reverted changesets:
1534 "Switch HTMLMediaElement to release logging"
1535 https://bugs.webkit.org/show_bug.cgi?id=176065
1536 http://trac.webkit.org/changeset/221494
1538 "Switch HTMLMediaElement to release logging"
1539 https://bugs.webkit.org/show_bug.cgi?id=176065
1540 http://trac.webkit.org/changeset/221500
1542 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com>
1544 Remove "malloc" and "free" use
1545 https://bugs.webkit.org/show_bug.cgi?id=176310
1547 Reviewed by Darin Adler.
1551 * wtf/Assertions.cpp:
1553 2017-09-04 Yusuke Suzuki <utatane.tea@gmail.com>
1555 Unreviewed, support libstdc++ use with clang
1556 https://bugs.webkit.org/show_bug.cgi?id=176301
1560 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com>
1562 [WTF] Add C++03 allocator interface for GCC < 6
1563 https://bugs.webkit.org/show_bug.cgi?id=176301
1565 Reviewed by Darin Adler.
1567 Unfortunately, std::list in GCC < 6 does not support C++11 allocator interface.
1568 This patch adds C++03 allocator interface to FastAllocator to make it usable
1569 for std::list. It also allows us to use FastAllocator for data structures that
1570 only support C++03 interface.
1573 (WTF::FastAllocator::allocate):
1574 (WTF::FastAllocator::construct):
1575 (WTF::FastAllocator::destroy):
1576 (WTF::FastAllocator::max_size const):
1577 (WTF::FastAllocator::select_on_container_copy_construction const):
1579 2017-09-03 Chris Dumez <cdumez@apple.com>
1581 Unreviewed, rolling out r221552.
1587 "[WTF] Add C++03 allocator interface for GCC < 6"
1588 https://bugs.webkit.org/show_bug.cgi?id=176301
1589 http://trac.webkit.org/changeset/221552
1591 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com>
1593 [WTF] Add C++03 allocator interface for GCC < 6
1594 https://bugs.webkit.org/show_bug.cgi?id=176301
1596 Reviewed by Darin Adler.
1598 Unfortunately, std::list in GCC < 6 does not support C++11 allocator interface.
1599 This patch adds C++03 allocator interface to FastAllocator to make it usable
1600 for std::list. It also allows us to use FastAllocator for data structures that
1601 only support C++03 interface.
1604 (WTF::FastAllocator::allocate):
1605 (WTF::FastAllocator::construct):
1606 (WTF::FastAllocator::destroy):
1607 (WTF::FastAllocator::max_size const):
1608 (WTF::FastAllocator::select_on_container_copy_construction const):
1610 2017-09-03 Sam Weinig <sam@webkit.org>
1613 https://bugs.webkit.org/show_bug.cgi?id=176288
1615 Reviewed by Yusuke Suzuki.
1617 CanvasProxy does not appear to be in any current HTML spec
1618 and was disabled and unimplemented in our tree. Time to
1621 * wtf/FeatureDefines.h:
1623 2017-09-01 Eric Carlson <eric.carlson@apple.com>
1625 Switch HTMLMediaElement to release logging
1626 https://bugs.webkit.org/show_bug.cgi?id=176065
1628 Reviewed by Jer Noble.
1630 * wtf/MediaTime.cpp:
1631 (WTF::MediaTime::dump const): Use toString.
1632 (WTF::MediaTime::toString const): New.
1634 (PAL::LogArgument<WTF::MediaTime>::toString): Logger template.
1636 2017-08-31 Don Olmstead <don.olmstead@sony.com>
1638 [CMake] Make USE_CF conditional within Windows
1639 https://bugs.webkit.org/show_bug.cgi?id=176173
1641 Reviewed by Alex Christensen.
1644 * wtf/PlatformWin.cmake:
1646 2017-08-31 Ryan Haddad <ryanhaddad@apple.com>
1648 Unreviewed, rolling out r221445.
1650 This change broke Sierra Release builds.
1654 "Switch HTMLMediaElement to release logging"
1655 https://bugs.webkit.org/show_bug.cgi?id=176065
1656 http://trac.webkit.org/changeset/221445
1658 2017-08-31 Eric Carlson <eric.carlson@apple.com>
1660 Switch HTMLMediaElement to release logging
1661 https://bugs.webkit.org/show_bug.cgi?id=176065
1663 Reviewed by Jer Noble.
1665 * wtf/MediaTime.cpp:
1666 (WTF::MediaTime::dump const): Use toString.
1667 (WTF::MediaTime::toString const): New.
1669 (PAL::LogArgument<WTF::MediaTime>::toString): Logger template.
1671 2017-08-31 Filip Pizlo <fpizlo@apple.com>
1673 All of the different ArrayBuffer::data's should be CagedPtr<>
1674 https://bugs.webkit.org/show_bug.cgi?id=175515
1676 Reviewed by Michael Saboff.
1678 Added a specialization so that CagedPtr<void> is valid.
1682 2017-08-31 Per Arne Vollan <pvollan@apple.com>
1684 [Win] Crash under WorkQueue::performWorkOnRegisteredWorkThread in layout tests.
1685 https://bugs.webkit.org/show_bug.cgi?id=176163
1687 Reviewed by Alex Christensen.
1689 My previous attempt at fixing this crash in <http://trac.webkit.org/changeset/221323>
1690 was incorrect, since it is still crashing on the bot(s). The current theory of why this
1691 is failing is that the WorkQueue object deletes itself in the middle of the
1692 performWorkOnRegisteredWorkThread method when calling deref(). There is no need to
1693 increase the reference count of the work queue for each function we want to call on the
1694 work thread. It is sufficient to increase it for every work thread we start, and then
1695 dereference it when the thread ends. We should also not attempt to access members after
1696 the deref() call, which can potentially be unsafe.
1698 * wtf/win/WorkQueueWin.cpp:
1699 (WTF::WorkQueue::workThreadCallback):
1700 (WTF::WorkQueue::performWorkOnRegisteredWorkThread):
1701 (WTF::WorkQueue::dispatch):
1703 2017-08-22 Filip Pizlo <fpizlo@apple.com>
1705 Strings need to be in some kind of gigacage
1706 https://bugs.webkit.org/show_bug.cgi?id=174924
1708 Reviewed by Oliver Hunt.
1710 This makes all strings allocations come from the string gigacage. Because we expect string allocation
1711 to be a hot path, I created specialized allocation paths for the string gigacage. These paths are
1712 accessible via <wtf/text/StringMalloc.h>. However, those paths are equivalent to saying
1713 Gigacage::malloc and friends with the Gigacage::String kind.
1715 * WTF.xcodeproj/project.pbxproj:
1716 * wtf/CMakeLists.txt:
1718 * wtf/FastMalloc.cpp:
1721 (WTF::FastMalloc::malloc):
1722 (WTF::FastMalloc::tryMalloc):
1723 (WTF::FastMalloc::realloc):
1724 (WTF::FastMalloc::free):
1727 (Gigacage::tryMalloc):
1731 (WTF::VectorBufferBase::allocateBuffer):
1732 (WTF::VectorBufferBase::tryAllocateBuffer):
1733 (WTF::VectorBufferBase::reallocateBuffer):
1734 (WTF::VectorBufferBase::deallocateBuffer):
1735 (WTF::Malloc>::Vector):
1737 (WTF::Malloc>::contains const):
1738 (WTF::Malloc>::findMatching const):
1739 (WTF::Malloc>::find const):
1740 (WTF::Malloc>::reverseFind const):
1741 (WTF::Malloc>::appendIfNotContains):
1742 (WTF::Malloc>::fill):
1743 (WTF::Malloc>::appendRange):
1744 (WTF::Malloc>::expandCapacity):
1745 (WTF::Malloc>::tryExpandCapacity):
1746 (WTF::Malloc>::resize):
1747 (WTF::Malloc>::resizeToFit):
1748 (WTF::Malloc>::shrink):
1749 (WTF::Malloc>::grow):
1750 (WTF::Malloc>::asanSetInitialBufferSizeTo):
1751 (WTF::Malloc>::asanSetBufferSizeToFullCapacity):
1752 (WTF::Malloc>::asanBufferSizeWillChangeTo):
1753 (WTF::Malloc>::reserveCapacity):
1754 (WTF::Malloc>::tryReserveCapacity):
1755 (WTF::Malloc>::reserveInitialCapacity):
1756 (WTF::Malloc>::shrinkCapacity):
1757 (WTF::Malloc>::append):
1758 (WTF::Malloc>::tryAppend):
1759 (WTF::Malloc>::constructAndAppend):
1760 (WTF::Malloc>::tryConstructAndAppend):
1761 (WTF::Malloc>::appendSlowCase):
1762 (WTF::Malloc>::constructAndAppendSlowCase):
1763 (WTF::Malloc>::tryConstructAndAppendSlowCase):
1764 (WTF::Malloc>::uncheckedAppend):
1765 (WTF::Malloc>::appendVector):
1766 (WTF::Malloc>::insert):
1767 (WTF::Malloc>::insertVector):
1768 (WTF::Malloc>::remove):
1769 (WTF::Malloc>::removeFirst):
1770 (WTF::Malloc>::removeFirstMatching):
1771 (WTF::Malloc>::removeAll):
1772 (WTF::Malloc>::removeAllMatching):
1773 (WTF::Malloc>::reverse):
1774 (WTF::Malloc>::map const):
1775 (WTF::Malloc>::releaseBuffer):
1776 (WTF::Malloc>::checkConsistency):
1780 (WTF::removeRepeatedElements):
1781 (WTF::minCapacity>::Vector): Deleted.
1782 (WTF::minCapacity>::contains const): Deleted.
1783 (WTF::minCapacity>::findMatching const): Deleted.
1784 (WTF::minCapacity>::find const): Deleted.
1785 (WTF::minCapacity>::reverseFind const): Deleted.
1786 (WTF::minCapacity>::appendIfNotContains): Deleted.
1787 (WTF::minCapacity>::fill): Deleted.
1788 (WTF::minCapacity>::appendRange): Deleted.
1789 (WTF::minCapacity>::expandCapacity): Deleted.
1790 (WTF::minCapacity>::tryExpandCapacity): Deleted.
1791 (WTF::minCapacity>::resize): Deleted.
1792 (WTF::minCapacity>::resizeToFit): Deleted.
1793 (WTF::minCapacity>::shrink): Deleted.
1794 (WTF::minCapacity>::grow): Deleted.
1795 (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted.
1796 (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted.
1797 (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted.
1798 (WTF::minCapacity>::reserveCapacity): Deleted.
1799 (WTF::minCapacity>::tryReserveCapacity): Deleted.
1800 (WTF::minCapacity>::reserveInitialCapacity): Deleted.
1801 (WTF::minCapacity>::shrinkCapacity): Deleted.
1802 (WTF::minCapacity>::append): Deleted.
1803 (WTF::minCapacity>::tryAppend): Deleted.
1804 (WTF::minCapacity>::constructAndAppend): Deleted.
1805 (WTF::minCapacity>::tryConstructAndAppend): Deleted.
1806 (WTF::minCapacity>::appendSlowCase): Deleted.
1807 (WTF::minCapacity>::constructAndAppendSlowCase): Deleted.
1808 (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted.
1809 (WTF::minCapacity>::uncheckedAppend): Deleted.
1810 (WTF::minCapacity>::appendVector): Deleted.
1811 (WTF::minCapacity>::insert): Deleted.
1812 (WTF::minCapacity>::insertVector): Deleted.
1813 (WTF::minCapacity>::remove): Deleted.
1814 (WTF::minCapacity>::removeFirst): Deleted.
1815 (WTF::minCapacity>::removeFirstMatching): Deleted.
1816 (WTF::minCapacity>::removeAll): Deleted.
1817 (WTF::minCapacity>::removeAllMatching): Deleted.
1818 (WTF::minCapacity>::reverse): Deleted.
1819 (WTF::minCapacity>::map const): Deleted.
1820 (WTF::minCapacity>::releaseBuffer): Deleted.
1821 (WTF::minCapacity>::checkConsistency): Deleted.
1822 * wtf/text/AtomicStringImpl.h:
1823 * wtf/text/CString.cpp:
1824 (WTF::CStringBuffer::createUninitialized):
1825 * wtf/text/CString.h:
1826 * wtf/text/StringBuffer.h:
1827 (WTF::StringBuffer::StringBuffer):
1828 (WTF::StringBuffer::~StringBuffer):
1829 (WTF::StringBuffer::resize):
1830 * wtf/text/StringImpl.cpp:
1831 (WTF::StringImpl::~StringImpl):
1832 (WTF::StringImpl::destroy):
1833 (WTF::StringImpl::createUninitializedInternalNonEmpty):
1834 (WTF::StringImpl::reallocateInternal):
1835 (WTF::StringImpl::releaseAssertCaged const):
1836 * wtf/text/StringImpl.h:
1837 (WTF::StringImpl::createSubstringSharingImpl):
1838 (WTF::StringImpl::tryCreateUninitialized):
1839 (WTF::StringImpl::adopt):
1840 (WTF::StringImpl::bufferOwnership const):
1841 (WTF::StringImpl::assertCaged const):
1842 * wtf/text/StringMalloc.cpp: Added.
1843 (WTF::tryStringMalloc):
1844 (WTF::stringMalloc):
1845 (WTF::stringRealloc):
1847 * wtf/text/StringMalloc.h: Added.
1848 (WTF::StringMalloc::malloc):
1849 (WTF::StringMalloc::tryMalloc):
1850 (WTF::StringMalloc::realloc):
1851 (WTF::StringMalloc::free):
1852 * wtf/text/StringVector.h: Added.
1853 * wtf/text/SymbolImpl.h:
1854 * wtf/text/UniquedStringImpl.h:
1855 * wtf/text/WTFString.h:
1856 (WTF::String::adopt):
1857 (WTF::String::assertCaged const):
1858 (WTF::String::releaseAssertCaged const):
1860 2017-08-30 Chris Dumez <cdumez@apple.com>
1862 Implement FileSystemDirectoryReader.readEntries()
1863 https://bugs.webkit.org/show_bug.cgi?id=176091
1864 <rdar://problem/34168015>
1866 Reviewed by Andreas Kling.
1868 * wtf/CrossThreadCopier.h:
1869 (WTF::crossThreadCopy):
1870 * wtf/CrossThreadTask.h:
1871 Move crossThreadCopy() from CrossThreadTask.h to CrossThreadCopier.h and
1872 add "using WTF::crossThreadCopy" statement to make it more easily usable
1875 2017-08-30 Matt Lewis <jlewis3@apple.com>
1877 Unreviewed, rolling out r221384.
1879 This patch caused multiple 32-bit JSC test failures.
1883 "Strings need to be in some kind of gigacage"
1884 https://bugs.webkit.org/show_bug.cgi?id=174924
1885 http://trac.webkit.org/changeset/221384
1887 2017-08-30 Brady Eidson <beidson@apple.com>
1889 Add "Identified" base class to replace a whole bunch of custom identifier generators.
1890 https://bugs.webkit.org/show_bug.cgi?id=176120
1892 Reviewed by Alex Christensen.
1894 * WTF.xcodeproj/project.pbxproj:
1895 * wtf/Identified.h: Added.
1896 (WTF::IdentifiedBase::identifier const):
1897 (WTF::IdentifiedBase::IdentifiedBase):
1898 (WTF::Identified::Identified):
1899 (WTF::ThreadSafeIdentified::ThreadSafeIdentified):
1901 2017-08-22 Filip Pizlo <fpizlo@apple.com>
1903 Strings need to be in some kind of gigacage
1904 https://bugs.webkit.org/show_bug.cgi?id=174924
1906 Reviewed by Oliver Hunt.
1908 This makes all strings allocations come from the string gigacage. Because we expect string allocation
1909 to be a hot path, I created specialized allocation paths for the string gigacage. These paths are
1910 accessible via <wtf/text/StringMalloc.h>. However, those paths are equivalent to saying
1911 Gigacage::malloc and friends with the Gigacage::String kind.
1913 * WTF.xcodeproj/project.pbxproj:
1914 * wtf/CMakeLists.txt:
1916 * wtf/FastMalloc.cpp:
1919 (WTF::FastMalloc::malloc):
1920 (WTF::FastMalloc::tryMalloc):
1921 (WTF::FastMalloc::realloc):
1922 (WTF::FastMalloc::free):
1925 (Gigacage::tryMalloc):
1929 (WTF::VectorBufferBase::allocateBuffer):
1930 (WTF::VectorBufferBase::tryAllocateBuffer):
1931 (WTF::VectorBufferBase::reallocateBuffer):
1932 (WTF::VectorBufferBase::deallocateBuffer):
1933 (WTF::Malloc>::Vector):
1935 (WTF::Malloc>::contains const):
1936 (WTF::Malloc>::findMatching const):
1937 (WTF::Malloc>::find const):
1938 (WTF::Malloc>::reverseFind const):
1939 (WTF::Malloc>::appendIfNotContains):
1940 (WTF::Malloc>::fill):
1941 (WTF::Malloc>::appendRange):
1942 (WTF::Malloc>::expandCapacity):
1943 (WTF::Malloc>::tryExpandCapacity):
1944 (WTF::Malloc>::resize):
1945 (WTF::Malloc>::resizeToFit):
1946 (WTF::Malloc>::shrink):
1947 (WTF::Malloc>::grow):
1948 (WTF::Malloc>::asanSetInitialBufferSizeTo):
1949 (WTF::Malloc>::asanSetBufferSizeToFullCapacity):
1950 (WTF::Malloc>::asanBufferSizeWillChangeTo):
1951 (WTF::Malloc>::reserveCapacity):
1952 (WTF::Malloc>::tryReserveCapacity):
1953 (WTF::Malloc>::reserveInitialCapacity):
1954 (WTF::Malloc>::shrinkCapacity):
1955 (WTF::Malloc>::append):
1956 (WTF::Malloc>::tryAppend):
1957 (WTF::Malloc>::constructAndAppend):
1958 (WTF::Malloc>::tryConstructAndAppend):
1959 (WTF::Malloc>::appendSlowCase):
1960 (WTF::Malloc>::constructAndAppendSlowCase):
1961 (WTF::Malloc>::tryConstructAndAppendSlowCase):
1962 (WTF::Malloc>::uncheckedAppend):
1963 (WTF::Malloc>::appendVector):
1964 (WTF::Malloc>::insert):
1965 (WTF::Malloc>::insertVector):
1966 (WTF::Malloc>::remove):
1967 (WTF::Malloc>::removeFirst):
1968 (WTF::Malloc>::removeFirstMatching):
1969 (WTF::Malloc>::removeAll):
1970 (WTF::Malloc>::removeAllMatching):
1971 (WTF::Malloc>::reverse):
1972 (WTF::Malloc>::map const):
1973 (WTF::Malloc>::releaseBuffer):
1974 (WTF::Malloc>::checkConsistency):
1978 (WTF::removeRepeatedElements):
1979 (WTF::minCapacity>::Vector): Deleted.
1980 (WTF::minCapacity>::contains const): Deleted.
1981 (WTF::minCapacity>::findMatching const): Deleted.
1982 (WTF::minCapacity>::find const): Deleted.
1983 (WTF::minCapacity>::reverseFind const): Deleted.
1984 (WTF::minCapacity>::appendIfNotContains): Deleted.
1985 (WTF::minCapacity>::fill): Deleted.
1986 (WTF::minCapacity>::appendRange): Deleted.
1987 (WTF::minCapacity>::expandCapacity): Deleted.
1988 (WTF::minCapacity>::tryExpandCapacity): Deleted.
1989 (WTF::minCapacity>::resize): Deleted.
1990 (WTF::minCapacity>::resizeToFit): Deleted.
1991 (WTF::minCapacity>::shrink): Deleted.
1992 (WTF::minCapacity>::grow): Deleted.
1993 (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted.
1994 (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted.
1995 (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted.
1996 (WTF::minCapacity>::reserveCapacity): Deleted.
1997 (WTF::minCapacity>::tryReserveCapacity): Deleted.
1998 (WTF::minCapacity>::reserveInitialCapacity): Deleted.
1999 (WTF::minCapacity>::shrinkCapacity): Deleted.
2000 (WTF::minCapacity>::append): Deleted.
2001 (WTF::minCapacity>::tryAppend): Deleted.
2002 (WTF::minCapacity>::constructAndAppend): Deleted.
2003 (WTF::minCapacity>::tryConstructAndAppend): Deleted.
2004 (WTF::minCapacity>::appendSlowCase): Deleted.
2005 (WTF::minCapacity>::constructAndAppendSlowCase): Deleted.
2006 (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted.
2007 (WTF::minCapacity>::uncheckedAppend): Deleted.
2008 (WTF::minCapacity>::appendVector): Deleted.
2009 (WTF::minCapacity>::insert): Deleted.
2010 (WTF::minCapacity>::insertVector): Deleted.
2011 (WTF::minCapacity>::remove): Deleted.
2012 (WTF::minCapacity>::removeFirst): Deleted.
2013 (WTF::minCapacity>::removeFirstMatching): Deleted.
2014 (WTF::minCapacity>::removeAll): Deleted.
2015 (WTF::minCapacity>::removeAllMatching): Deleted.
2016 (WTF::minCapacity>::reverse): Deleted.
2017 (WTF::minCapacity>::map const): Deleted.
2018 (WTF::minCapacity>::releaseBuffer): Deleted.
2019 (WTF::minCapacity>::checkConsistency): Deleted.
2020 * wtf/text/AtomicStringImpl.h:
2021 * wtf/text/CString.cpp:
2022 (WTF::CStringBuffer::createUninitialized):
2023 * wtf/text/CString.h:
2024 * wtf/text/StringBuffer.h:
2025 (WTF::StringBuffer::StringBuffer):
2026 (WTF::StringBuffer::~StringBuffer):
2027 (WTF::StringBuffer::resize):
2028 * wtf/text/StringImpl.cpp:
2029 (WTF::StringImpl::~StringImpl):
2030 (WTF::StringImpl::destroy):
2031 (WTF::StringImpl::createUninitializedInternalNonEmpty):
2032 (WTF::StringImpl::reallocateInternal):
2033 (WTF::StringImpl::releaseAssertCaged const):
2034 * wtf/text/StringImpl.h:
2035 (WTF::StringImpl::createSubstringSharingImpl):
2036 (WTF::StringImpl::tryCreateUninitialized):
2037 (WTF::StringImpl::adopt):
2038 (WTF::StringImpl::bufferOwnership const):
2039 (WTF::StringImpl::assertCaged const):
2040 * wtf/text/StringMalloc.cpp: Added.
2041 (WTF::tryStringMalloc):
2042 (WTF::stringMalloc):
2043 (WTF::stringRealloc):
2045 * wtf/text/StringMalloc.h: Added.
2046 (WTF::StringMalloc::malloc):
2047 (WTF::StringMalloc::tryMalloc):
2048 (WTF::StringMalloc::realloc):
2049 (WTF::StringMalloc::free):
2050 * wtf/text/StringVector.h: Added.
2051 * wtf/text/SymbolImpl.h:
2052 * wtf/text/UniquedStringImpl.h:
2053 * wtf/text/WTFString.h:
2054 (WTF::String::adopt):
2055 (WTF::String::assertCaged const):
2056 (WTF::String::releaseAssertCaged const):
2058 2017-08-28 Yusuke Suzuki <utatane.tea@gmail.com>
2060 [JSC] Use table based approach for JSON.stringify's Quote
2061 https://bugs.webkit.org/show_bug.cgi?id=176044
2063 Reviewed by Darin Adler.
2065 We change escape operation of JSON Quote from branch-based to table-based.
2066 This patch partially adopts SpiderMonkey's change to StringBuilderJSON.cpp
2067 to optimize this escaping operation. We separate changes from StringBuilder.cpp
2068 to apply MPL to StringBuilderJSON.cpp file. Since WebKit already adopts MPL in
2069 some files (like, DateMath.h), it is acceptable.
2071 Kraken json-stringify-tinderbox shows 7.2% improvement.
2075 json-stringify-tinderbox 40.429+-0.771 ^ 37.693+-0.862 ^ definitely 1.0726x faster
2077 * WTF.xcodeproj/project.pbxproj:
2078 * wtf/CMakeLists.txt:
2079 * wtf/text/StringBuilder.cpp:
2080 (WTF::appendQuotedJSONStringInternalSlow): Deleted.
2081 (WTF::appendQuotedJSONStringInternal): Deleted.
2082 (WTF::StringBuilder::appendQuotedJSONString): Deleted.
2083 * wtf/text/StringBuilderJSON.cpp: Added.
2084 (WTF::appendQuotedJSONStringInternal):
2085 (WTF::StringBuilder::appendQuotedJSONString):
2087 2017-08-29 Per Arne Vollan <pvollan@apple.com>
2089 [Win] Crash under WorkQueue::performWorkOnRegisteredWorkThread in layout tests.
2090 https://bugs.webkit.org/show_bug.cgi?id=176064
2092 Reviewed by Saam Barati.
2094 The crash log indicates that the function pointer is null in this case.
2096 * wtf/win/WorkQueueWin.cpp:
2097 (WTF::WorkQueue::dispatch):
2099 2017-08-28 Andy Estes <aestes@apple.com>
2101 [Cocoa] Upstream WKGetWebDefaultCFStringEncoding()
2102 https://bugs.webkit.org/show_bug.cgi?id=176039
2104 Reviewed by Alex Christensen.
2106 * wtf/spi/cf/CFStringSPI.h:
2108 2017-08-26 Yusuke Suzuki <utatane.tea@gmail.com>
2110 Unreviewed, suppress warnings in GTK port
2112 Add printf format attribute.
2114 * wtf/text/WTFString.cpp:
2116 2017-08-25 Eric Carlson <eric.carlson@apple.com>
2118 Add Logger::logAlways
2119 https://bugs.webkit.org/show_bug.cgi?id=175996
2121 Reviewed by Jer Noble.
2123 * wtf/Assertions.cpp:
2126 2017-08-25 Daniel Bates <dabates@apple.com>
2128 Demarcate code added due to lack of NSDMI for aggregates
2129 https://bugs.webkit.org/show_bug.cgi?id=175990
2131 Reviewed by Andy Estes.
2135 2017-08-25 Don Olmstead <don.olmstead@sony.com>
2137 Define *_GIGACAGE_MASK when Gigacage is not supported
2138 https://bugs.webkit.org/show_bug.cgi?id=175994
2140 Reviewed by Mark Lam.
2144 2017-08-25 Eric Carlson <eric.carlson@apple.com>
2146 Add String::format variant that takes va_args
2147 https://bugs.webkit.org/show_bug.cgi?id=175988
2149 Reviewed by Jer Noble.
2151 * wtf/text/WTFString.cpp:
2152 (WTF::createWithFormatAndArguments): Created with the guts of String::format.
2153 (WTF::String::formatWithArguments): New, call createWithFormatAndArguments.
2154 (WTF::String::format): Move logic to createWithFormatAndArguments, use it.
2155 * wtf/text/WTFString.h:
2157 2017-08-25 Saam Barati <sbarati@apple.com>
2159 Support compiling catch in the DFG
2160 https://bugs.webkit.org/show_bug.cgi?id=174590
2161 <rdar://problem/34047845>
2163 Reviewed by Filip Pizlo.
2165 This patch generalizes the BackwardsGraph fake root into a more generalizable
2166 class called SingleRootGraph. SingleRootGraph exposes the general graph interface
2167 used in Dominators and NaturalLoops. SingleRootGraph takes as input a graph with
2168 the normal graph interface, but also allows the input graph to contain more than
2169 one root. SingleRootGraph then exposes a single root, which it creates, that has
2170 an outgoing edge to all the roots in the original graph.
2172 * WTF.xcodeproj/project.pbxproj:
2173 * wtf/BackwardsGraph.h:
2174 (WTF::BackwardsGraph::dump const):
2175 (WTF::BackwardsGraph::rootName): Deleted.
2176 (WTF::BackwardsGraph::Node::Node): Deleted.
2177 (WTF::BackwardsGraph::Node::root): Deleted.
2178 (WTF::BackwardsGraph::Node::operator== const): Deleted.
2179 (WTF::BackwardsGraph::Node::operator!= const): Deleted.
2180 (WTF::BackwardsGraph::Node::operator bool const): Deleted.
2181 (WTF::BackwardsGraph::Node::isRoot const): Deleted.
2182 (WTF::BackwardsGraph::Node::node const): Deleted.
2184 (WTF::BackwardsGraph::Set::Set): Deleted.
2185 (WTF::BackwardsGraph::Set::add): Deleted.
2186 (WTF::BackwardsGraph::Set::remove): Deleted.
2187 (WTF::BackwardsGraph::Set::contains): Deleted.
2188 (WTF::BackwardsGraph::Set::dump const): Deleted.
2189 (WTF::BackwardsGraph::Map::Map): Deleted.
2190 (WTF::BackwardsGraph::Map::clear): Deleted.
2191 (WTF::BackwardsGraph::Map::size const): Deleted.
2192 (WTF::BackwardsGraph::Map::operator[]): Deleted.
2193 (WTF::BackwardsGraph::Map::operator[] const): Deleted.
2195 (WTF::Dominators::Dominators):
2196 (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOf):
2197 (WTF::Dominators::forAllBlocksInPrunedIteratedDominanceFrontierOf):
2198 (WTF::Dominators::iteratedDominanceFrontierOf const):
2199 (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl const):
2200 * wtf/SingleRootGraph.h: Added.
2201 (WTF::SingleRootGraphNode::rootName):
2202 (WTF::SingleRootGraphNode::SingleRootGraphNode):
2203 (WTF::SingleRootGraphNode::root):
2204 (WTF::SingleRootGraphNode::operator== const):
2205 (WTF::SingleRootGraphNode::operator!= const):
2206 (WTF::SingleRootGraphNode::operator bool const):
2207 (WTF::SingleRootGraphNode::isRoot const):
2208 (WTF::SingleRootGraphNode::node const):
2209 (WTF::SingleRootGraphSet::add):
2210 (WTF::SingleRootGraphSet::remove):
2211 (WTF::SingleRootGraphSet::contains):
2212 (WTF::SingleRootGraphSet::dump const):
2213 (WTF::SingleRootMap::SingleRootMap):
2214 (WTF::SingleRootMap::clear):
2215 (WTF::SingleRootMap::size const):
2216 (WTF::SingleRootMap::operator[]):
2217 (WTF::SingleRootMap::operator[] const):
2218 (WTF::SingleRootGraph::SingleRootGraph):
2219 (WTF::SingleRootGraph::root const):
2220 (WTF::SingleRootGraph::newMap):
2221 (WTF::SingleRootGraph::successors const):
2222 (WTF::SingleRootGraph::predecessors const):
2223 (WTF::SingleRootGraph::index const):
2224 (WTF::SingleRootGraph::node const):
2225 (WTF::SingleRootGraph::numNodes const):
2226 (WTF::SingleRootGraph::dump const):
2227 (WTF::SingleRootGraph::assertIsConsistent const):
2229 2017-08-24 Commit Queue <commit-queue@webkit.org>
2231 Unreviewed, rolling out r221119, r221124, and r221143.
2232 https://bugs.webkit.org/show_bug.cgi?id=175973
2234 "I think it regressed JSBench by 20%" (Requested by saamyjoon
2237 Reverted changesets:
2239 "Support compiling catch in the DFG"
2240 https://bugs.webkit.org/show_bug.cgi?id=174590
2241 http://trac.webkit.org/changeset/221119
2243 "Unreviewed, build fix in GTK port"
2244 https://bugs.webkit.org/show_bug.cgi?id=174590
2245 http://trac.webkit.org/changeset/221124
2247 "DFG::JITCode::osrEntry should get sorted since we perform a
2248 binary search on it"
2249 https://bugs.webkit.org/show_bug.cgi?id=175893
2250 http://trac.webkit.org/changeset/221143
2252 2017-08-23 Filip Pizlo <fpizlo@apple.com>
2254 Reduce Gigacage sizes
2255 https://bugs.webkit.org/show_bug.cgi?id=175920
2257 Reviewed by Mark Lam.
2259 Provide filler API for the no-bmalloc/no-Gigacage case.
2264 2017-08-23 Yusuke Suzuki <utatane.tea@gmail.com>
2266 Unreviewed, build fix in GTK port
2267 https://bugs.webkit.org/show_bug.cgi?id=174590
2269 * wtf/SingleRootGraph.h:
2270 (WTF::SingleRootGraph::successors const):
2271 (WTF::SingleRootGraph::predecessors const):
2273 2017-08-23 Saam Barati <sbarati@apple.com>
2275 Support compiling catch in the DFG
2276 https://bugs.webkit.org/show_bug.cgi?id=174590
2278 Reviewed by Filip Pizlo.
2280 This patch generalizes the BackwardsGraph fake root into a more generalizable
2281 class called SingleRootGraph. SingleRootGraph exposes the general graph interface
2282 used in Dominators and NaturalLoops. SingleRootGraph takes as input a graph with
2283 the normal graph interface, but also allows the input graph to contain more than
2284 one root. SingleRootGraph then exposes a single root, which it creates, that has
2285 an outgoing edge to all the roots in the original graph.
2287 * WTF.xcodeproj/project.pbxproj:
2288 * wtf/BackwardsGraph.h:
2289 (WTF::BackwardsGraph::dump const):
2290 (WTF::BackwardsGraph::rootName): Deleted.
2291 (WTF::BackwardsGraph::Node::Node): Deleted.
2292 (WTF::BackwardsGraph::Node::root): Deleted.
2293 (WTF::BackwardsGraph::Node::operator== const): Deleted.
2294 (WTF::BackwardsGraph::Node::operator!= const): Deleted.
2295 (WTF::BackwardsGraph::Node::operator bool const): Deleted.
2296 (WTF::BackwardsGraph::Node::isRoot const): Deleted.
2297 (WTF::BackwardsGraph::Node::node const): Deleted.
2299 (WTF::BackwardsGraph::Set::Set): Deleted.
2300 (WTF::BackwardsGraph::Set::add): Deleted.
2301 (WTF::BackwardsGraph::Set::remove): Deleted.
2302 (WTF::BackwardsGraph::Set::contains): Deleted.
2303 (WTF::BackwardsGraph::Set::dump const): Deleted.
2304 (WTF::BackwardsGraph::Map::Map): Deleted.
2305 (WTF::BackwardsGraph::Map::clear): Deleted.
2306 (WTF::BackwardsGraph::Map::size const): Deleted.
2307 (WTF::BackwardsGraph::Map::operator[]): Deleted.
2308 (WTF::BackwardsGraph::Map::operator[] const): Deleted.
2310 (WTF::Dominators::Dominators):
2311 (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOf):
2312 (WTF::Dominators::forAllBlocksInPrunedIteratedDominanceFrontierOf):
2313 (WTF::Dominators::iteratedDominanceFrontierOf const):
2314 (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl const):
2315 * wtf/SingleRootGraph.h: Added.
2316 (WTF::SingleRootGraphNode::rootName):
2317 (WTF::SingleRootGraphNode::SingleRootGraphNode):
2318 (WTF::SingleRootGraphNode::root):
2319 (WTF::SingleRootGraphNode::operator== const):
2320 (WTF::SingleRootGraphNode::operator!= const):
2321 (WTF::SingleRootGraphNode::operator bool const):
2322 (WTF::SingleRootGraphNode::isRoot const):
2323 (WTF::SingleRootGraphNode::node const):
2324 (WTF::SingleRootGraphSet::add):
2325 (WTF::SingleRootGraphSet::remove):
2326 (WTF::SingleRootGraphSet::contains):
2327 (WTF::SingleRootGraphSet::dump const):
2328 (WTF::SingleRootMap::SingleRootMap):
2329 (WTF::SingleRootMap::clear):
2330 (WTF::SingleRootMap::size const):
2331 (WTF::SingleRootMap::operator[]):
2332 (WTF::SingleRootMap::operator[] const):
2333 (WTF::SingleRootGraph::SingleRootGraph):
2334 (WTF::SingleRootGraph::root const):
2335 (WTF::SingleRootGraph::newMap):
2336 (WTF::SingleRootGraph::successors const):
2337 (WTF::SingleRootGraph::predecessors const):
2338 (WTF::SingleRootGraph::index const):
2339 (WTF::SingleRootGraph::node const):
2340 (WTF::SingleRootGraph::numNodes const):
2341 (WTF::SingleRootGraph::dump const):
2342 (WTF::SingleRootGraph::assertIsConsistent const):
2344 2017-08-23 Youenn Fablet <youenn@apple.com>
2346 [Cache API] Enable persistent coder to encode FetchOptions
2347 https://bugs.webkit.org/show_bug.cgi?id=175883
2349 Reviewed by Alex Christensen.
2351 Enabling encoding/decoding of enums with EnumTraits.
2352 This code is similar to the one of IPC encoder/decoder.
2354 * wtf/persistence/PersistentDecoder.h:
2355 (WTF::Persistence::Decoder::decode):
2356 * wtf/persistence/PersistentEncoder.h:
2357 (WTF::Persistence::Encoder::encode):
2359 2017-08-23 Per Arne Vollan <pvollan@apple.com>
2361 [Win] Compile error, include file <wtf/AVFoundationHeaderDetection.h> is not found.
2362 https://bugs.webkit.org/show_bug.cgi?id=175853
2364 Reviewed by Brent Fulgham.
2366 Copy generated WTF header files to the same place as we copy forwarding headers.
2368 * WTF.vcxproj/WTF.proj:
2370 2017-08-22 Chris Dumez <cdumez@apple.com>
2372 Introduce a new CompletionHandler type and use it for NetworkDataTaskClient's completion handlers to help catch bugs
2373 https://bugs.webkit.org/show_bug.cgi?id=175832
2375 Reviewed by Alex Christensen.
2377 Introduce a new CompletionHandler type which wraps a WTF::Function and ensures via assertions
2378 that the function is always called once and only once.
2380 * WTF.xcodeproj/project.pbxproj:
2381 * wtf/CompletionHandler.h: Added.
2382 (WTF::CompletionHandler<Out):
2384 2017-08-22 Alex Christensen <achristensen@webkit.org>
2386 Fix Windows build after r221017.
2387 https://bugs.webkit.org/show_bug.cgi?id=157053
2389 * wtf/PlatformWin.cmake:
2391 2017-08-22 Per Arne Vollan <pvollan@apple.com>
2393 Implement 64-bit MacroAssembler::probe support for Windows.
2394 https://bugs.webkit.org/show_bug.cgi?id=175724
2396 Reviewed by Mark Lam.
2398 Enable masm probe and DFG.
2402 2017-08-21 Mark Lam <mark.lam@apple.com>
2404 [Follow up]: Add back the ability to disable MASM_PROBE from the build.
2405 https://bugs.webkit.org/show_bug.cgi?id=175656
2406 <rdar://problem/33933720>
2410 Fixed a typo: should be "OS(WINDOWS)", not "OS(WINDOW)".
2414 2017-08-21 Carlos Alberto Lopez Perez <clopez@igalia.com>
2416 [GTK] ARMv7 build fails to build MacroAssemblerARMv7.cpp.
2417 https://bugs.webkit.org/show_bug.cgi?id=175514
2419 Reviewed by Keith Miller.
2421 * wtf/Platform.h: Enable DFG and MASM_PROBE back for GTK ARM_THUMB2.
2423 2017-08-20 Sam Weinig <sam@webkit.org>
2425 StringView could use a function to strip leading/trailing characters without allocation
2426 https://bugs.webkit.org/show_bug.cgi?id=175757
2428 Reviewed by Darin Adler.
2430 There are many places in WebCore/WebKit that we call functions like,
2431 WebCore::stripLeadingAndTrailingHTMLSpaces, or String::stripWhiteSpace() only to use
2432 the allocated String as a temporary for either another transformation or a comparison.
2433 Now that we have StringView, we can avoid that extra allocation, by having returning a
2434 StringView substring in these scenarios.
2436 For instance, the check (from ScriptElement.cpp:287):
2438 if (!stripLeadingAndTrailingHTMLSpaces(sourceURL).isEmpty()) {
2442 currently allocates a string just to make this check. With a new
2443 stripLeadingAndTrailingHTMLSpaces such as:
2445 StringView stripLeadingAndTrailingHTMLSpaces(StringView stringView)
2447 return stringView.stripLeadingAndTrailingMatchedCharacters([] (auto c) {
2448 return isHTMLSpace(c);
2452 We could instead have exact same code from ScriptElement.cpp now avoid an allocation.
2454 * wtf/text/StringView.h:
2455 (WTF::StringView::stripLeadingAndTrailingMatchedCharacters):
2457 2017-08-21 Eric Carlson <eric.carlson@apple.com>
2459 Add WTFLogChannel level to allow runtime log filtering
2460 https://bugs.webkit.org/show_bug.cgi?id=175731
2461 <rdar://problem/33967234>
2463 Reviewed by Jer Noble.
2465 Add WTFLog*, LOG, and RELEASE_LOG variants that take a "log level" parameter so code
2466 can include logging statements that are only conditionally emitted.
2468 * wtf/Assertions.cpp:
2470 * wtf/MemoryPressureHandler.cpp:
2471 * wtf/RefCountedLeakCounter.cpp:
2473 2017-08-20 Mark Lam <mark.lam@apple.com>
2475 Gardening: fix CLoop build.
2476 https://bugs.webkit.org/show_bug.cgi?id=175688
2477 <rdar://problem/33436870>
2481 Disable MASM_PROBE if !ENABLE(JIT).
2485 2017-08-18 Ryan Haddad <ryanhaddad@apple.com>
2487 Unreviewed, rolling out r220938.
2489 The API tests added with this change are failing.
2493 "Add WTFLogChannel level to allow runtime log filtering"
2494 https://bugs.webkit.org/show_bug.cgi?id=175731
2495 http://trac.webkit.org/changeset/220938
2497 2017-08-18 Eric Carlson <eric.carlson@apple.com>
2499 Add WTFLogChannel level to allow runtime log filtering
2500 https://bugs.webkit.org/show_bug.cgi?id=175731
2501 <rdar://problem/33967234>
2503 Reviewed by Jer Noble.
2505 Add WTFLog*, LOG, and RELEASE_LOG variants that take a "log level" parameter so code
2506 can include logging statements that are only conditionally emitted.
2508 * wtf/Assertions.cpp:
2510 * wtf/MemoryPressureHandler.cpp:
2511 * wtf/RefCountedLeakCounter.cpp:
2513 2017-08-18 Per Arne Vollan <pvollan@apple.com>
2515 Implement 32-bit MacroAssembler::probe support for Windows.
2516 https://bugs.webkit.org/show_bug.cgi?id=175449
2518 Reviewed by Mark Lam.
2520 Enable the DFG on Win32.
2524 2017-08-17 Mark Lam <mark.lam@apple.com>
2526 Only use 16 VFP registers if !CPU(ARM_NEON).
2527 https://bugs.webkit.org/show_bug.cgi?id=175514
2529 Reviewed by JF Bastien.
2531 If CPU(ARM_NEON) is not enabled, we'll conservatively assume only VFP2 support is
2532 available. Hence, we'll only the first 16 FPDoubleRegisterIDs are available.
2535 NEON registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJACABEJ.html
2536 VFP2 and VFP3 registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CIHDIBDG.html
2537 NEON to VFP register mapping: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJAIJHFC.html
2539 This is mostly for GTK toolchains which may target older ARM CPUs which only have
2544 2017-08-16 Mark Lam <mark.lam@apple.com>
2546 Add back the ability to disable MASM_PROBE from the build.
2547 https://bugs.webkit.org/show_bug.cgi?id=175656
2548 <rdar://problem/33933720>
2550 Reviewed by Yusuke Suzuki.
2554 2017-08-16 Mark Lam <mark.lam@apple.com>
2556 Gardening: fix GTK ARM_THUMB2 build.
2557 https://bugs.webkit.org/show_bug.cgi?id=175446
2561 Disable the use of the DFG for GTK ARM_THUMB2 builds until
2562 https://bugs.webkit.org/show_bug.cgi?id=175514 is fixed.
2566 2017-08-16 Andy Estes <aestes@apple.com>
2568 [Payment Request] Add an ENABLE flag and an experimental feature preference
2569 https://bugs.webkit.org/show_bug.cgi?id=175622
2571 Reviewed by Tim Horton.
2573 * wtf/FeatureDefines.h:
2575 2017-08-14 Simon Fraser <simon.fraser@apple.com>
2577 Remove Proximity Events and related code
2578 https://bugs.webkit.org/show_bug.cgi?id=175545
2580 Reviewed by Daniel Bates.
2582 No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS)
2583 and other related code.
2585 * wtf/FeatureDefines.h:
2587 2017-08-14 Simon Fraser <simon.fraser@apple.com>
2589 Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
2590 https://bugs.webkit.org/show_bug.cgi?id=175504
2592 Reviewed by Sam Weinig.
2594 * wtf/FeatureDefines.h:
2596 2017-08-14 Simon Fraser <simon.fraser@apple.com>
2598 Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
2599 https://bugs.webkit.org/show_bug.cgi?id=175557
2601 Reviewed by Jon Lee.
2603 No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.
2605 * wtf/FeatureDefines.h:
2607 2017-08-12 Filip Pizlo <fpizlo@apple.com>
2609 Put the ScopedArgumentsTable's ScopeOffset array in some gigacage
2610 https://bugs.webkit.org/show_bug.cgi?id=174921
2612 Reviewed by Mark Lam.
2614 If you want to std::unique_ptr a class that knows that it should be in the Gigacage, then we
2615 would create the Gigacage equivalent of WTF_MAKE_FAST_ALLOCATED and it would just work.
2617 But this does not work if we want to std::unique_ptr a primitive type. So, this patch adds a
2618 solution for this problem: CagedUniquePtr<>. This will handle allocation
2619 (CagedUniquePtr<>::create()) and deallocation (in the style of std::unique_ptr). It has three
2623 - Arrays that don't have destructors.
2624 - Arrays that have destructors.
2626 Just like std::unique_ptr, the array case is triggered by saying "[]" at the end of the type.
2628 Unlike std::unique_ptr and most other smart pointers, the whole point of this smart pointer is
2629 to dictate where the thing you're pointing at is allocated. For this reason, it has to know how
2630 to do things like the array destructor protocol. So it creates its own: the CagedUniquePtr for
2631 arrays with destructors is a fat pointer that remembers the length of the array.
2633 CagedUniquePtr<> makes it impossible to leak/release the pointer. This is stricter than what
2634 std::unique_ptr does, and is probably appropriate for all of the places where we would use this
2637 So far, we only use it for ScopedArgumentsTable::m_arguments, but I suspect that it will be
2638 useful in other places.
2640 * WTF.xcodeproj/project.pbxproj:
2641 * wtf/CMakeLists.txt:
2642 * wtf/CagedUniquePtr.h: Added.
2643 (WTF::CagedUniquePtr::CagedUniquePtr):
2644 (WTF::CagedUniquePtr::create):
2645 (WTF::CagedUniquePtr::operator=):
2646 (WTF::CagedUniquePtr::~CagedUniquePtr):
2647 (WTF::CagedUniquePtr::get const):
2648 (WTF::CagedUniquePtr::getMayBeNull const):
2649 (WTF::CagedUniquePtr::operator== const):
2650 (WTF::CagedUniquePtr::operator!= const):
2651 (WTF::CagedUniquePtr::operator bool const):
2652 (WTF::CagedUniquePtr::operator* const):
2653 (WTF::CagedUniquePtr::operator-> const):
2654 (WTF::CagedUniquePtr::operator[] const):
2655 (WTF::CagedUniquePtr::destroy):
2657 (Gigacage::tryMallocArray):
2659 (Gigacage::mallocArray):
2662 2017-08-11 Ryosuke Niwa <rniwa@webkit.org>
2664 Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
2665 https://bugs.webkit.org/show_bug.cgi?id=175474
2667 Reviewed by Wenson Hsieh.
2669 * wtf/FeatureDefines.h:
2671 2017-08-11 Don Olmstead <don.olmstead@sony.com>
2673 [WTF] Move ValueToString into WTF
2674 https://bugs.webkit.org/show_bug.cgi?id=175469
2676 Reviewed by Sam Weinig.
2678 * WTF.xcodeproj/project.pbxproj:
2679 * wtf/CMakeLists.txt:
2680 * wtf/text/ValueToString.h: Renamed from Source/WebCore/platform/ValueToString.h.
2682 2017-08-11 Tim Horton <timothy_horton@apple.com>
2684 Fix the build with modern Clang's -Wexpansion-to-defined
2685 https://bugs.webkit.org/show_bug.cgi?id=175467
2686 <rdar://problem/33667497>
2688 Reviewed by Simon Fraser.
2690 * wtf/FeatureDefines.h:
2692 Avoid object-like macros that expand to include defined(), because this
2693 behaves inconsistently between different compilers (though in ways
2694 that don't matter for these particular defines, which aren't used on MSVC),
2695 and Clang has added a warning for it.
2697 Move ENABLE_WEBASSEMBLY to Platform.h since it depends on things that
2698 are defined there and can't be evaluated at time-of-use because of the
2699 aforementioned new rules. Previously, there was a cycle between
2700 ENABLE_WEBASSEMBLY and ENABLE_B3_JIT -- break that so that it just
2701 goes FTL_JIT->B3_JIT->WASM instead.
2703 2017-08-10 Sam Weinig <sam@webkit.org>
2705 WTF::Function does not allow for reference / non-default constructible return types
2706 https://bugs.webkit.org/show_bug.cgi?id=175244
2708 Reviewed by Chris Dumez.
2710 When Function, then NoncopyableFunction, was templatized to allow non-void return values
2711 in r201493, it maintained the behavior of being callable even if the Function was null.
2712 To accomplish this, when null, the default construction of the return parameter was used.
2713 This means Function can't be used with return types that are not default constructible,
2714 such as reference types and Ref.
2716 This behavior of returning something when null is surprising, as this is not how normal
2717 functions behave, and not very useful. Instead, we now assert that the function is not
2718 null when being called.
2721 (WTF::Function operator(...)):
2722 Instead of allowing a null callable wrapper by returning the default construction of
2723 the return type, assert that the wrapper is there when calling a Function.
2725 2017-08-10 Mark Lam <mark.lam@apple.com>
2727 Make the MASM_PROBE mechanism mandatory for DFG and FTL builds.
2728 https://bugs.webkit.org/show_bug.cgi?id=175446
2729 <rdar://problem/33836545>
2731 Reviewed by Saam Barati.
2733 This is needed in order to support https://bugs.webkit.org/show_bug.cgi?id=174645.
2734 One consequence of this is that the DFG will now be disabled for the MIPS and
2736 https://bugs.webkit.org/show_bug.cgi?id=175447
2737 https://bugs.webkit.org/show_bug.cgi?id=175449
2739 Also, we should only ENABLE_SIGNAL_BASED_VM_TRAPS if the DFG is enabled. It was
2740 never meaningful to use SIGNAL_BASED_VM_TRAPS with the baseline JIT anyway. This
2741 is a mis-configuration error that is now fixed.
2745 2017-08-10 Brady Eidson <beidson@apple.com>
2747 Rename the source files for the WTF persistent coders.
2748 https://bugs.webkit.org/show_bug.cgi?id=175441
2750 Reviewed by Tim Horton.
2752 * WTF.xcodeproj/project.pbxproj:
2753 * wtf/CMakeLists.txt:
2755 * wtf/persistence/PersistentCoder.h: Renamed from Source/WTF/wtf/persistence/Coder.h.
2756 * wtf/persistence/PersistentCoders.cpp: Renamed from Source/WTF/wtf/persistence/Coders.cpp.
2757 * wtf/persistence/PersistentCoders.h: Renamed from Source/WTF/wtf/persistence/Coders.h.
2758 * wtf/persistence/PersistentDecoder.cpp: Renamed from Source/WTF/wtf/persistence/Decoder.cpp.
2759 * wtf/persistence/PersistentDecoder.h: Renamed from Source/WTF/wtf/persistence/Decoder.h.
2760 * wtf/persistence/PersistentEncoder.cpp: Renamed from Source/WTF/wtf/persistence/Encoder.cpp.
2761 * wtf/persistence/PersistentEncoder.h: Renamed from Source/WTF/wtf/persistence/Encoder.h.
2763 2017-08-10 Yusuke Suzuki <utatane.tea@gmail.com>
2765 Unreviewed, attempt to fix build failure with VC2017
2767 * wtf/PriorityQueue.h:
2769 2017-08-10 Yusuke Suzuki <utatane.tea@gmail.com>
2772 https://bugs.webkit.org/show_bug.cgi?id=174970
2774 Reviewed by Michael Catanzaro.
2776 CHAR_BIT is not defined.
2780 2017-08-09 Yusuke Suzuki <utatane.tea@gmail.com>
2782 [WTF] ThreadSpecific should not introduce additional indirection
2783 https://bugs.webkit.org/show_bug.cgi?id=175187
2785 Reviewed by Mark Lam.
2787 ThreadSpecific sets Data* to the TLS. And Data holds T*, which
2788 is fast allocated actual data. But ideally, we should store T
2789 instance directly in Data instead of introducing an additional
2792 This patch adds storage in Data in order to embed the instance of T. The constructor
2793 for Data will invoke the constructor for T on the embedded storage. We also drop
2794 ThreadSpecific::replace which is only used by the web thread to set its thread specific
2795 ThreadGlobalData to the one shared from the main thread. The existing implementation
2796 relies on the main thread and the web thread never exiting in order for the shared
2797 ThreadGlobalData to stay alive. We can achieve the same semantics by using a
2798 ThreadSpecific<std::unique_ptr<T>> to hold the ThreadGlobalData instance instead.
2800 * wtf/ThreadSpecific.h:
2801 (WTF::ThreadSpecific::Data::construct):
2802 (WTF::ThreadSpecific::Data::Data):
2803 We make it fast allocated since we previously allocated ThreadSpecific T data by fastMalloc.
2805 (WTF::ThreadSpecific::Data::~Data):
2806 (WTF::ThreadSpecific::Data::storagePointer const):
2807 (WTF::canBeGCThread>::get):
2808 We also drop RELEASE_ASSERT from ::get(). We already inserted this assert to setAndConstruct(),
2809 so when creating the member to this TLS, we execute this release assert. So it is
2810 not necessary to execute this assertion every time we get data from this TLS.
2812 (WTF::canBeGCThread>::set):
2813 (WTF::canBeGCThread>::destroy):
2814 (WTF::canBeGCThread>::setAndConstruct):
2816 (WTF::canBeGCThread>::replace): Deleted.
2818 2017-08-10 Tim Horton <timothy_horton@apple.com>
2820 Fix a silly typo in Compiler.h
2825 2017-08-10 Michael Catanzaro <mcatanzaro@igalia.com>
2827 Remove ENABLE_GAMEPAD_DEPRECATED
2828 https://bugs.webkit.org/show_bug.cgi?id=175361
2830 Reviewed by Carlos Garcia Campos.
2832 * wtf/FeatureDefines.h:
2834 2017-08-09 Don Olmstead <don.olmstead@sony.com>
2836 [WTF] Move TextStream into WTF
2837 https://bugs.webkit.org/show_bug.cgi?id=175211
2839 Reviewed by Myles C. Maxfield.
2841 * WTF.xcodeproj/project.pbxproj:
2842 * wtf/CMakeLists.txt:
2843 * wtf/text/TextStream.cpp: Renamed from Source/WebCore/platform/text/TextStream.cpp.
2844 (WTF::TextStream::writeIndent):
2845 * wtf/text/TextStream.h: Renamed from Source/WebCore/platform/text/TextStream.h.
2846 (WTF::TextStream::FormatNumberRespectingIntegers::FormatNumberRespectingIntegers):
2848 2017-08-09 Commit Queue <commit-queue@webkit.org>
2850 Unreviewed, rolling out r220466, r220477, and r220487.
2851 https://bugs.webkit.org/show_bug.cgi?id=175411
2853 This change broke existing API tests and follow up fixes did
2854 not resolve all the issues. (Requested by ryanhaddad on
2857 Reverted changesets:
2859 https://bugs.webkit.org/show_bug.cgi?id=175244
2860 http://trac.webkit.org/changeset/220466
2862 "WTF::Function does not allow for reference / non-default
2863 constructible return types"
2864 https://bugs.webkit.org/show_bug.cgi?id=175244
2865 http://trac.webkit.org/changeset/220477
2867 https://bugs.webkit.org/show_bug.cgi?id=175244
2868 http://trac.webkit.org/changeset/220487
2870 2017-08-09 Sam Weinig <sam@webkit.org>
2872 WTF::Function does not allow for reference / non-default constructible return types
2873 https://bugs.webkit.org/show_bug.cgi?id=175244
2875 Reviewed by Chris Dumez.
2877 When Function, then NoncopyableFunction, was templatized to allow non-void return values
2878 in r201493, it maintained the behavior of being callable even if the Function was null.
2879 To accomplish this, when null, the default construction of the return parameter was used.
2880 This means Function can't be used with return types that are not default constructible,
2881 such as reference types and Ref.
2883 This behavior of returning something when null is surprising, as this is not how normal
2884 functions behave, and not very useful. Instead, we now assert that the function is not
2885 null when being called.
2888 (WTF::Function operator(...)):
2889 Instead of allowing a null callable wrapper by returning the default construction of
2890 the return type, assert that the wrapper is there when calling a Function.
2892 2017-08-09 Ryan Haddad <ryanhaddad@apple.com>
2894 Unreviewed, rolling out r220457.
2896 This change introduced API test failures.
2900 "WTF::Function does not allow for reference / non-default
2901 constructible return types"
2902 https://bugs.webkit.org/show_bug.cgi?id=175244
2903 http://trac.webkit.org/changeset/220457
2905 2017-08-09 Sam Weinig <sam@webkit.org>
2907 WTF::Function does not allow for reference / non-default constructible return types
2908 https://bugs.webkit.org/show_bug.cgi?id=175244
2910 Reviewed by Chris Dumez.
2912 When Function, then NoncopyableFunction, was templatized to allow non-void return values
2913 in r201493, it maintained the behavior of being callable even if the Function was null.
2914 To accomplish this, when null, the default construction of the return parameter was used.
2915 This means Function can't be used with return types that are not default constructible,
2916 such as reference types and Ref.
2918 This behavior of returning something when null is surprising, as this is not how normal
2919 functions behave, and not very useful. Instead, we now assert that the function is not
2920 null when being called.
2923 (WTF::Function operator(...)):
2924 Instead of allowing a null callable wrapper by returning the default construction of
2925 the return type, assert that the wrapper is there when calling a Function.
2927 2017-08-08 Filip Pizlo <fpizlo@apple.com>
2929 Baseline JIT should do caging
2930 https://bugs.webkit.org/show_bug.cgi?id=175037
2932 Reviewed by Mark Lam.
2935 (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
2936 (Gigacage::isDisablingPrimitiveGigacageDisabled):
2937 (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
2938 (Gigacage::canPrimitiveGigacageBeDisabled):
2939 (Gigacage::basePtr):
2941 2017-08-08 Ryan Haddad <ryanhaddad@apple.com>
2943 Unreviewed, rolling out r220368.
2945 This change caused WK1 tests to exit early with crashes.
2949 "Baseline JIT should do caging"
2950 https://bugs.webkit.org/show_bug.cgi?id=175037
2951 http://trac.webkit.org/changeset/220368
2953 2017-08-08 Michael Catanzaro <mcatanzaro@igalia.com>
2955 [CMake] Properly test if compiler supports compiler flags
2956 https://bugs.webkit.org/show_bug.cgi?id=174490
2958 Reviewed by Konstantin Tokarev.
2962 2017-08-07 Filip Pizlo <fpizlo@apple.com>
2964 Baseline JIT should do caging
2965 https://bugs.webkit.org/show_bug.cgi?id=175037
2967 Reviewed by Mark Lam.
2970 (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
2971 (Gigacage::isDisablingPrimitiveGigacageDisabled):
2972 (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
2973 (Gigacage::canPrimitiveGigacageBeDisabled):
2975 2017-08-07 Filip Pizlo <fpizlo@apple.com>
2977 Unreviewed, try to fix Windows build.
2982 2017-08-06 Filip Pizlo <fpizlo@apple.com>
2984 Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
2985 https://bugs.webkit.org/show_bug.cgi?id=174919
2987 Reviewed by Keith Miller.
2989 This mirrors the changes from bmalloc/Gigacage.h.
2991 Also it teaches CagedPtr how to reason about multiple gigacages.
2994 (WTF::CagedPtr::get const):
2995 (WTF::CagedPtr::operator[] const):
2997 (Gigacage::tryMalloc):
2998 (Gigacage::tryAllocateVirtualPages):
2999 (Gigacage::freeVirtualPages):
3000 (Gigacage::tryAlignedMalloc):
3001 (Gigacage::alignedFree):
3004 (Gigacage::disablePrimitiveGigacage):
3005 (Gigacage::addPrimitiveDisableCallback):
3006 (Gigacage::removePrimitiveDisableCallback):
3008 (Gigacage::basePtr):
3010 (Gigacage::isCaged):
3011 (Gigacage::tryAlignedMalloc):
3012 (Gigacage::alignedFree):
3014 (Gigacage::disableGigacage): Deleted.
3015 (Gigacage::addDisableCallback): Deleted.
3016 (Gigacage::removeDisableCallback): Deleted.
3018 2017-08-07 Brian Burg <bburg@apple.com>
3020 Remove CANVAS_PATH compilation guard
3021 https://bugs.webkit.org/show_bug.cgi?id=175207
3023 Reviewed by Sam Weinig.
3025 * wtf/FeatureDefines.h:
3027 2017-08-05 Filip Pizlo <fpizlo@apple.com>
3029 REGRESSION (r219895-219897): Number of leaks on Open Source went from 9240 to 235983 and is now at 302372
3030 https://bugs.webkit.org/show_bug.cgi?id=175083
3032 Reviewed by Oliver Hunt.
3034 Adds a classic ReadWriteLock class. I wrote my own because I can never remember if the pthread one is
3035 guaranted to bias in favor of writers or not.
3037 * WTF.xcodeproj/project.pbxproj:
3039 (WTF::ConditionBase::construct):
3040 (WTF::Condition::Condition):
3042 (WTF::LockBase::construct):
3044 * wtf/ReadWriteLock.cpp: Added.
3045 (WTF::ReadWriteLockBase::construct):
3046 (WTF::ReadWriteLockBase::readLock):
3047 (WTF::ReadWriteLockBase::readUnlock):
3048 (WTF::ReadWriteLockBase::writeLock):
3049 (WTF::ReadWriteLockBase::writeUnlock):
3050 * wtf/ReadWriteLock.h: Added.
3051 (WTF::ReadWriteLockBase::ReadLock::tryLock):
3052 (WTF::ReadWriteLockBase::ReadLock::lock):
3053 (WTF::ReadWriteLockBase::ReadLock::unlock):
3054 (WTF::ReadWriteLockBase::WriteLock::tryLock):
3055 (WTF::ReadWriteLockBase::WriteLock::lock):
3056 (WTF::ReadWriteLockBase::WriteLock::unlock):
3057 (WTF::ReadWriteLockBase::read):
3058 (WTF::ReadWriteLockBase::write):
3059 (WTF::ReadWriteLock::ReadWriteLock):
3061 2017-08-04 Matt Lewis <jlewis3@apple.com>
3063 Unreviewed, rolling out r220271.
3065 Rolling out due to Layout Test failing on iOS Simulator.
3069 "Remove STREAMS_API compilation guard"
3070 https://bugs.webkit.org/show_bug.cgi?id=175165
3071 http://trac.webkit.org/changeset/220271
3073 2017-08-04 Youenn Fablet <youenn@apple.com>
3075 Remove STREAMS_API compilation guard
3076 https://bugs.webkit.org/show_bug.cgi?id=175165
3078 Reviewed by Darin Adler.
3080 * wtf/FeatureDefines.h:
3082 2017-08-03 Brian Burg <bburg@apple.com>
3084 Remove ENABLE(WEB_SOCKET) guards
3085 https://bugs.webkit.org/show_bug.cgi?id=167044
3087 Reviewed by Joseph Pecoraro.
3089 * wtf/FeatureDefines.h:
3091 2017-08-03 Youenn Fablet <youenn@apple.com>
3093 Remove FETCH_API compilation guard
3094 https://bugs.webkit.org/show_bug.cgi?id=175154
3096 Reviewed by Chris Dumez.
3098 * wtf/FeatureDefines.h:
3100 2017-08-03 Brady Eidson <beidson@apple.com>
3102 Add SW IDLs and stub out basic functionality.
3103 https://bugs.webkit.org/show_bug.cgi?id=175115
3105 Reviewed by Chris Dumez.
3107 * wtf/FeatureDefines.h:
3109 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
3111 Unreviewed, build fix for Windows port
3112 https://bugs.webkit.org/show_bug.cgi?id=175013
3116 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
3118 Merge ThreadHolder to WTF::Thread itself
3119 https://bugs.webkit.org/show_bug.cgi?id=175013
3121 Reviewed by Mark Lam.
3123 Currently, we store ThreadHolder* to the TLS, and ThreadHolder* holds Ref<Thread>.
3124 When we get Thread& from the current thread TLS, we need to dereference the ThreadHolder*.
3125 However, ideally, we can store Thread* directly to the current thread TLS.
3126 While the ThreadHolder design is beautiful, it's worth optimizing by storing Thread* directly
3127 since Thread::current() is so frequently executed.
3129 This patch merges ThreadHolder to Thread. And we now store Thread* directly in the TLS.
3130 When storing it to TLS, we call leakRef() to keep Thread ref count incremented by the TLS.
3131 And when destroying the TLS, we call `deref()` to ensure that Thread* is dereferenced from
3134 * WTF.xcodeproj/project.pbxproj:
3135 * wtf/CMakeLists.txt:
3136 * wtf/ThreadHolder.cpp: Removed.
3137 * wtf/ThreadHolder.h: Removed.
3138 * wtf/ThreadHolderPthreads.cpp: Removed.
3139 * wtf/ThreadHolderWin.cpp: Removed.
3140 * wtf/Threading.cpp:
3141 (WTF::Thread::entryPoint):
3142 (WTF::initializeThreading):
3144 (WTF::Thread::currentMayBeNull):
3145 (WTF::Thread::current):
3146 * wtf/ThreadingPthreads.cpp:
3147 (WTF::Thread::waitForCompletion):
3148 (WTF::Thread::initializeCurrentTLS):
3149 (WTF::Thread::initializeTLSKey):
3150 (WTF::Thread::initializeTLS):
3151 (WTF::Thread::destructTLS):
3152 (WTF::Thread::createCurrentThread): Deleted.
3153 * wtf/ThreadingWin.cpp:
3154 (WTF::Thread::initializeCurrentTLS):
3155 (WTF::threadMapMutex):
3156 (WTF::Thread::initializeTLSKey):
3157 (WTF::Thread::currentDying):
3159 (WTF::Thread::initializeTLS):
3160 (WTF::Thread::destructTLS):
3161 (WTF::waitForThreadCompletion):
3162 (WTF::Thread::createCurrentThread): Deleted.
3164 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
3166 [Linux][WTF] Use one global semaphore to notify thread suspend and resume completion
3167 https://bugs.webkit.org/show_bug.cgi?id=175124
3169 Reviewed by Carlos Garcia Campos.
3171 POSIX sem_t is used to notify thread suspend and resume completion in Linux ports
3172 since sem_post is async-signal-safe function. Since we guard suspend() and resume()
3173 with one global lock, this semaphore is also guarded by this lock. So we do not need
3174 to have semaphore per WTF::Thread.
3176 This patch introduces one global Semaphore. And drop per thread semaphore.
3179 * wtf/ThreadingPthreads.cpp:
3180 (WTF::Thread::~Thread):
3181 (WTF::Semaphore::Semaphore):
3182 (WTF::Semaphore::~Semaphore):
3183 (WTF::Semaphore::wait):
3184 (WTF::Semaphore::post):
3185 (WTF::Thread::signalHandlerSuspendResume):
3186 (WTF::Thread::initializePlatformThreading):
3187 (WTF::Thread::suspend):
3188 (WTF::Thread::resume):
3189 (WTF::Thread::Thread): Deleted.
3190 * wtf/ThreadingWin.cpp:
3191 (WTF::Thread::Thread): Deleted.
3193 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
3195 [Linux][WTF] Reduce sizeof(WTF::Thread) by using a pointer to PlatformRegisters
3196 https://bugs.webkit.org/show_bug.cgi?id=175119
3198 Reviewed by Carlos Garcia Campos.
3200 sizeof(PlatformRegisters) is so large. In my Linux box, it is 256. It enlarges the sizeof(WTF::Thread).
3201 However, it is not necessary to hold it in WTF::Thread member. Thread's ucontext data and its stack is
3202 effective while suspending the thread. So, we can just use the pointer to the PlatformRegister instead
3203 of copying it to the member of the WTF::Thread.
3206 * wtf/ThreadingPthreads.cpp:
3207 (WTF::Thread::signalHandlerSuspendResume):
3208 (WTF::Thread::getRegisters):
3210 2017-08-02 Yusuke Suzuki <utatane.tea@gmail.com>
3212 Unreviewed, build fix for Windows port
3213 https://bugs.webkit.org/show_bug.cgi?id=174716
3215 This ugliness will be fixed in https://bugs.webkit.org/show_bug.cgi?id=175013.
3217 * wtf/ThreadHolder.h:
3220 2017-08-02 Yusuke Suzuki <utatane.tea@gmail.com>
3222 Merge WTFThreadData to Thread::current
3223 https://bugs.webkit.org/show_bug.cgi?id=174716
3225 Reviewed by Mark Lam.
3227 We placed thread specific data in WTFThreadData previously. But now, we have a new good place
3228 to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
3229 sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
3230 This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
3231 to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
3232 Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
3233 before calling WTF::initializeThreading.
3235 * WTF.xcodeproj/project.pbxproj:
3236 * wtf/CMakeLists.txt:
3237 * wtf/LockAlgorithm.h:
3238 * wtf/LockAlgorithmInlines.h:
3240 * wtf/ParkingLot.cpp:
3241 * wtf/StackStats.cpp:
3242 (WTF::StackStats::PerThreadStats::PerThreadStats):
3243 (WTF::StackStats::CheckPoint::CheckPoint):
3244 (WTF::StackStats::CheckPoint::~CheckPoint):
3245 (WTF::StackStats::probe):
3246 (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
3247 * wtf/ThreadHolder.cpp:
3248 (WTF::ThreadHolder::initializeCurrent):
3249 * wtf/ThreadHolder.h:
3250 (WTF::ThreadHolder::ThreadHolder):
3251 (WTF::ThreadHolder::currentMayBeNull):
3252 (WTF::ThreadHolder::current):
3253 * wtf/ThreadHolderPthreads.cpp:
3254 (WTF::ThreadHolder::initializeKey):
3255 (WTF::ThreadHolder::initialize):
3256 (WTF::ThreadHolder::destruct):
3257 (WTF::ThreadHolder::initializeOnce): Deleted.
3258 (WTF::ThreadHolder::current): Deleted.
3259 * wtf/ThreadHolderWin.cpp:
3260 (WTF::ThreadHolder::initializeKey):
3261 (WTF::ThreadHolder::currentDying):
3262 (WTF::ThreadHolder::initialize):
3263 (WTF::ThreadHolder::initializeOnce): Deleted.
3264 (WTF::ThreadHolder::current): Deleted.
3265 * wtf/Threading.cpp:
3266 (WTF::Thread::initializeInThread):
3267 (WTF::Thread::entryPoint):
3268 (WTF::Thread::create):
3269 (WTF::Thread::didExit):
3270 (WTF::initializeThreading):
3271 (WTF::Thread::currentMayBeNull): Deleted.
3273 (WTF::Thread::current):
3274 (WTF::Thread::atomicStringTable):
3275 (WTF::Thread::setCurrentAtomicStringTable):
3276 (WTF::Thread::stackStats):
3277 (WTF::Thread::savedStackPointerAtVMEntry):
3278 (WTF::Thread::setSavedStackPointerAtVMEntry):
3279 (WTF::Thread::savedLastStackTop):
3280 (WTF::Thread::setSavedLastStackTop):
3281 * wtf/ThreadingPrimitives.h:
3282 * wtf/ThreadingPthreads.cpp:
3283 (WTF::Thread::createCurrentThread):
3284 (WTF::Thread::current): Deleted.
3285 * wtf/ThreadingWin.cpp:
3286 (WTF::Thread::createCurrentThread):
3287 (WTF::Thread::current): Deleted.
3288 * wtf/WTFThreadData.cpp: Removed.
3289 * wtf/WTFThreadData.h: Removed.
3290 * wtf/text/AtomicString.cpp:
3291 * wtf/text/AtomicStringImpl.cpp:
3293 * wtf/text/AtomicStringTable.cpp:
3294 (WTF::AtomicStringTable::create):
3295 * wtf/text/AtomicStringTable.h:
3297 2017-08-02 Joseph Pecoraro <pecoraro@apple.com>
3299 NeverDestroyed related leaks seen on bots
3300 https://bugs.webkit.org/show_bug.cgi?id=175113
3302 Reviewed by Yusuke Suzuki.
3304 * wtf/NeverDestroyed.h:
3305 (WTF::NeverDestroyed::NeverDestroyed):
3306 Previously the result of makeNeverDestroyed was not always moving into
3307 the `static NeverDestroyed` static local variable. In some cases it would
3308 re-invoke the constructor, creating a new NeverDestroyed object. In the
3309 case of a Vector it was causing leaks.
3311 Adding a move constructor convinces the compiler to move the result
3312 of makeNeverDestroyed into the NeverDestroyed static. It doesn't actually
3313 invoke the move constructor here, which I believe means it is deciding
3314 to perform optional copy elision optimization.
3315 'http://en.cppreference.com/w/cpp/language/copy_elision
3317 2017-08-02 Filip Pizlo <fpizlo@apple.com>
3319 All C++ accesses to JSObject::m_butterfly should do caging
3320 https://bugs.webkit.org/show_bug.cgi?id=175039
3322 Reviewed by Keith Miller.
3324 Adds a smart pointer class that does various kinds of caging for you.
3326 * WTF.xcodeproj/project.pbxproj:
3327 * wtf/CMakeLists.txt:
3328 * wtf/CagedPtr.h: Added.
3329 (WTF::CagedPtr::CagedPtr):
3330 (WTF::CagedPtr::get const):
3331 (WTF::CagedPtr::getMayBeNull const):
3332 (WTF::CagedPtr::operator== const):
3333 (WTF::CagedPtr::operator!= const):
3334 (WTF::CagedPtr::operator bool const):
3335 (WTF::CagedPtr::operator* const):
3336 (WTF::CagedPtr::operator-> const):
3338 2017-08-02 Filip Pizlo <fpizlo@apple.com>
3340 We should be OK with the gigacage being disabled on gmalloc
3341 https://bugs.webkit.org/show_bug.cgi?id=175082
3343 Reviewed by Michael Saboff.
3346 (Gigacage::shouldBeEnabled):
3348 2017-08-01 Filip Pizlo <fpizlo@apple.com>
3350 Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
3351 https://bugs.webkit.org/show_bug.cgi?id=174727
3353 Reviewed by Mark Lam.
3355 For the Gigacage project to have minimal impact, we need to have some abstraction that allows code to
3356 avoid having to guard itself with #if's. This adds a Gigacage abstraction that overlays the Gigacage
3357 namespace from bmalloc, which always lets you call things like Gigacage::caged and Gigacage::tryMalloc.
3359 Because of how many places need to possibly allocate in a gigacage, or possibly perform caged accesses,
3360 it's better to hide the question of whether or not it's enabled inside this API.
3362 * WTF.xcodeproj/project.pbxproj:
3363 * wtf/CMakeLists.txt:
3364 * wtf/FastMalloc.cpp:
3365 * wtf/Gigacage.cpp: Added.
3366 (Gigacage::tryMalloc):
3367 (Gigacage::tryAllocateVirtualPages):
3368 (Gigacage::freeVirtualPages):
3369 (Gigacage::tryAlignedMalloc):
3370 (Gigacage::alignedFree):
3372 * wtf/Gigacage.h: Added.
3373 (Gigacage::ensureGigacage):
3374 (Gigacage::disableGigacage):
3375 (Gigacage::addDisableCallback):
3376 (Gigacage::removeDisableCallback):
3378 (Gigacage::isCaged):
3379 (Gigacage::tryAlignedMalloc):
3380 (Gigacage::alignedFree):
3383 2017-07-31 Matt Lewis <jlewis3@apple.com>
3385 Unreviewed, rolling out r220060.
3387 This broke our internal builds. Contact reviewer of patch for
3392 "Merge WTFThreadData to Thread::current"
3393 https://bugs.webkit.org/show_bug.cgi?id=174716
3394 http://trac.webkit.org/changeset/220060
3396 2017-07-31 Yusuke Suzuki <utatane.tea@gmail.com>
3398 Merge WTFThreadData to Thread::current
3399 https://bugs.webkit.org/show_bug.cgi?id=174716
3401 Reviewed by Sam Weinig.
3403 We placed thread specific data in WTFThreadData previously. But now, we have a new good place
3404 to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
3405 sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
3406 This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
3407 to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
3408 Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
3409 before calling WTF::initializeThreading.
3411 * WTF.xcodeproj/project.pbxproj:
3412 * wtf/CMakeLists.txt:
3413 * wtf/LockAlgorithm.h:
3414 * wtf/LockAlgorithmInlines.h:
3416 * wtf/ParkingLot.cpp:
3417 * wtf/StackStats.cpp:
3418 (WTF::StackStats::PerThreadStats::PerThreadStats):
3419 (WTF::StackStats::CheckPoint::CheckPoint):
3420 (WTF::StackStats::CheckPoint::~CheckPoint):
3421 (WTF::StackStats::probe):
3422 (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
3423 * wtf/ThreadHolder.cpp:
3424 (WTF::ThreadHolder::initializeCurrent):
3425 * wtf/ThreadHolder.h:
3426 (WTF::ThreadHolder::ThreadHolder):
3427 (WTF::ThreadHolder::currentMayBeNull):
3428 (WTF::ThreadHolder::current):
3429 * wtf/ThreadHolderPthreads.cpp:
3430 (WTF::ThreadHolder::initialize):
3431 (WTF::ThreadHolder::destruct):
3432 (WTF::ThreadHolder::current): Deleted.
3433 * wtf/ThreadHolderWin.cpp:
3434 (WTF::ThreadHolder::currentDying):
3435 (WTF::ThreadHolder::initialize):
3436 (WTF::ThreadHolder::current): Deleted.
3437 * wtf/Threading.cpp:
3438 (WTF::Thread::initializeInThread):
3439 (WTF::Thread::entryPoint):
3440 (WTF::Thread::didExit):
3441 (WTF::initializeThreading):
3442 (WTF::Thread::currentMayBeNull): Deleted.
3444 (WTF::Thread::atomicStringTable):
3445 (WTF::Thread::setCurrentAtomicStringTable):
3446 (WTF::Thread::stackStats):
3447 (WTF::Thread::savedStackPointerAtVMEntry):
3448 (WTF::Thread::setSavedStackPointerAtVMEntry):
3449 (WTF::Thread::savedLastStackTop):
3450 (WTF::Thread::setSavedLastStackTop):
3451 (WTF::Thread::current):
3452 * wtf/ThreadingPrimitives.h:
3453 * wtf/ThreadingPthreads.cpp:
3454 (WTF::Thread::createCurrentThread):
3455 (WTF::Thread::current): Deleted.
3456 * wtf/ThreadingWin.cpp:
3457 (WTF::Thread::createCurrentThread):
3458 (WTF::Thread::current): Deleted.
3459 * wtf/WTFThreadData.cpp: Removed.
3460 * wtf/WTFThreadData.h: Removed.
3461 * wtf/text/AtomicString.cpp:
3462 * wtf/text/AtomicStringImpl.cpp:
3464 * wtf/text/AtomicStringTable.cpp:
3465 (WTF::AtomicStringTable::create):
3466 * wtf/text/AtomicStringTable.h:
3468 2017-07-31 Xabier Rodriguez Calvar <calvaris@igalia.com>
3470 Created a bool pretty printer at WTF for debugging purposes
3471 https://bugs.webkit.org/show_bug.cgi?id=174893
3473 Reviewed by Darin Adler.
3475 * wtf/PrintStream.cpp:
3476 (WTF::printInternal): The overload taking bool uses boolForPrinting
3477 * wtf/PrintStream.h:
3478 (WTF::boolForPrinting): Converts a bool in "true" or "false".
3480 2017-07-30 Yusuke Suzuki <utatane.tea@gmail.com>
3482 [WTF] Introduce Private Symbols
3483 https://bugs.webkit.org/show_bug.cgi?id=174935
3485 Reviewed by Darin Adler.
3487 Upcoming proposal of class fields[1] requires private fields.
3488 The simple way to implement it is adding a property with a private symbol.
3489 Currently, we have private symbols for internal properties. They are usual
3490 Symbols managed by the hash table. So basically private symbols are statically
3491 created in BuiltinNames. However this new proposal encourages users to create
3492 such private symbols more and more.
3494 So, this patch introduces notion of "Private" into WTF SymbolImpl. This patch
3495 adds PrivateSymbolImpl. This is SymbolImpl with "Private" flag. We do not need
3496 to look up the symbol from the hash table to check whether the given symbol
3499 [1]: https://github.com/tc39/proposal-class-fields
3501 * wtf/text/StringImpl.h:
3502 * wtf/text/SymbolImpl.cpp:
3503 (WTF::PrivateSymbolImpl::create):
3504 (WTF::PrivateSymbolImpl::createNullSymbol):
3505 * wtf/text/SymbolImpl.h:
3506 (WTF::SymbolImpl::isPrivate):
3507 (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
3508 (WTF::SymbolImpl::SymbolImpl):
3509 (WTF::PrivateSymbolImpl::PrivateSymbolImpl):
3511 2017-07-30 Brady Eidson <beidson@apple.com>
3513 Add URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks.
3514 https://bugs.webkit.org/show_bug.cgi?id=174958
3516 Reviewed by Darin Adler.
3518 This patch adds a new template class "InstanceCounted<T>".
3520 For each specialization, "InstanceCounted" will keep track of the total number of
3521 instances in existence.
3523 This makes explicate leak checking in API tests possible.
3525 Since this adds some runtime and storage overhead the code that actually does anything
3526 is only compiled in debug builds.
3528 * WTF.xcodeproj/project.pbxproj:
3529 * wtf/InstanceCounted.h: Added.
3530 (WTF::InstanceCounted::InstanceCounted):
3531 (WTF::InstanceCounted::instanceCount):
3532 (WTF::InstanceCounted::~InstanceCounted):
3534 2017-07-27 Yusuke Suzuki <utatane.tea@gmail.com>
3536 [WTF] Drop Thread initialization wait in some platforms by introducing StackBounds::newThreadStackBounds(PlatformThreadHandle&)
3537 https://bugs.webkit.org/show_bug.cgi?id=174303
3539 Reviewed by Mark Lam.
3541 Currently, the caller thread of Thread::create() need to wait for completion of the initialization of the target thread.
3542 This is because we need to initialize Thread::m_stack in the target thread. Before this patch, a target thread's
3543 StackBounds can only be retrieved by the target thread itself. However, this potentially causes context-switching between
3544 the caller and the target threads and hurts efficiency of creating threads.
3546 Fortunately, in some platforms (including major platforms except for Windows), we can get StackBounds of a target
3547 thread from a caller thread. This allows us to avoid waiting for completion of thread initialization.
3549 In this patch, we introduce HAVE_STACK_BOUNDS_FOR_NEW_THREAD and StackBounds::newThreadStackBounds. When creating
3550 a new thread, we will use StackBounds::newThreadStackBounds to get StackBounds if possible. As a result, we
3551 do not need to wait for completion of thread initialization to ensure m_stack field of Thread is initialized.
3553 While some documents claim that it is possible on Windows to get the StackBounds of another thread[1], the method relies on
3554 undocumented Windows NT APIs (NtQueryInformationThread, NtReadVirtualMemory etc.). So in this patch, we just
3555 use the conservative approach simply waiting for completion of thread initialization.
3557 [1]: https://stackoverflow.com/questions/3918375/how-to-get-thread-stack-information-on-windows
3560 * wtf/StackBounds.cpp:
3561 (WTF::StackBounds::newThreadStackBounds):
3562 (WTF::StackBounds::currentThreadStackBoundsInternal):
3563 (WTF::StackBounds::initialize): Deleted.
3564 * wtf/StackBounds.h:
3565 (WTF::StackBounds::currentThreadStackBounds):
3566 (WTF::StackBounds::StackBounds):
3567 * wtf/Threading.cpp:
3568 (WTF::Thread::NewThreadContext::NewThreadContext):
3569 (WTF::Thread::entryPoint):
3570 (WTF::Thread::create):
3571 (WTF::Thread::initialize): Deleted.
3573 * wtf/ThreadingPrimitives.h:
3574 * wtf/ThreadingPthreads.cpp:
3575 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3576 (WTF::wtfThreadEntryPoint):
3577 (WTF::Thread::establishHandle):
3578 (WTF::Thread::initializeCurrentThreadInternal):
3579 (WTF::Thread::current):
3580 * wtf/ThreadingWin.cpp:
3581 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3582 (WTF::Thread::initializeCurrentThreadInternal):
3583 (WTF::Thread::current):
3584 * wtf/win/MainThreadWin.cpp:
3585 (WTF::initializeMainThreadPlatform):
3587 2017-07-27 JF Bastien <jfbastien@apple.com>
3589 Update lock benchmarks
3590 https://bugs.webkit.org/show_bug.cgi?id=174907
3592 Reviewed by Filip Pizlo.
3594 * benchmarks/ConditionSpeedTest.cpp:
3596 * benchmarks/LockFairnessTest.cpp:
3597 * benchmarks/LockSpeedTest.cpp:
3598 * benchmarks/ToyLocks.h:
3600 2017-07-26 Brian Burg <bburg@apple.com>
3602 Remove WEB_TIMING feature flag
3603 https://bugs.webkit.org/show_bug.cgi?id=174795
3605 Reviewed by Alex Christensen.
3607 * wtf/FeatureDefines.h:
3609 2017-07-26 Claudio Saavedra <csaavedra@igalia.com>
3611 [WPE] Enable KeyboardEvent key and code attributes
3612 https://bugs.webkit.org/show_bug.cgi?id=174822
3614 Reviewed by Žan Doberšek.
3616 There is no reason for this to be disabled from what I see.
3618 * wtf/FeatureDefines.h: Enable KeyboardEvent key and code attributes.
3620 2017-07-23 Filip Pizlo <fpizlo@apple.com>
3623 https://bugs.webkit.org/show_bug.cgi?id=174750
3625 Reviewed by Keith Miller and Saam Barati.
3627 Moved DFG::NaturalLoops to WTF. The new templatized NaturalLoops<> uses the same Graph abstraction as
3628 Dominators<>. This allows us to add a B3::NaturalLoops for free.
3630 Also made small tweaks to RangeSet, which the LICM uses.
3632 * WTF.xcodeproj/project.pbxproj:
3633 * wtf/CMakeLists.txt:
3635 * wtf/NaturalLoops.h: Added.
3636 (WTF::NaturalLoop::NaturalLoop):
3637 (WTF::NaturalLoop::graph):
3638 (WTF::NaturalLoop::header):
3639 (WTF::NaturalLoop::size):
3640 (WTF::NaturalLoop::at):
3641 (WTF::NaturalLoop::operator[]):
3642 (WTF::NaturalLoop::contains):
3643 (WTF::NaturalLoop::index):
3644 (WTF::NaturalLoop::isOuterMostLoop):
3645 (WTF::NaturalLoop::dump):
3646 (WTF::NaturalLoop::addBlock):
3647 (WTF::NaturalLoops::NaturalLoops):
3648 (WTF::NaturalLoops::graph):
3649 (WTF::NaturalLoops::numLoops):
3650 (WTF::NaturalLoops::loop):
3651 (WTF::NaturalLoops::headerOf):
3652 (WTF::NaturalLoops::innerMostLoopOf):
3653 (WTF::NaturalLoops::innerMostOuterLoop):
3654 (WTF::NaturalLoops::belongsTo):
3655 (WTF::NaturalLoops::loopDepth):
3656 (WTF::NaturalLoops::loopsOf):
3657 (WTF::NaturalLoops::dump):
3659 (WTF::RangeSet::begin):
3660 (WTF::RangeSet::end):
3661 (WTF::RangeSet::addAll):
3663 2017-07-23 Michael Catanzaro <mcatanzaro@igalia.com>
3665 Implement FALLTHROUGH attribute for C with GCC
3666 https://bugs.webkit.org/show_bug.cgi?id=174555
3668 Reviewed by Darin Adler.
3670 My previous attempt to silence the JSC -Wimplicit-fallthrough warnings failed because they
3671 are coming from a C file, and our FALLTHROUGH macro is only implemented for C++. So
3672 implement it for C as well, using C attribute syntax.
3674 Note this is only possible to do for GCC, because Clang only supports this attribute using
3675 the [[C++ attribute syntax]].
3679 2017-07-14 Filip Pizlo <fpizlo@apple.com>
3681 It should be easy to decide how WebKit yields
3682 https://bugs.webkit.org/show_bug.cgi?id=174298
3684 Reviewed by Saam Barati.
3686 Created a Thread::yield() abstraction for sched_yield(), and made WTF use it everywhere that it
3687 had previously used std::this_thread::yield().
3689 To make it less annoying to experiment with changes to the lock algorithm in the future, this also
3690 moves the meat of the algorithm into LockAlgorithmInlines.h. Only two files include that header.
3691 Since LockAlgorithm.h no longer includes ParkingLot.h, a bunch of files in WK now need to include
3692 timing headers (Seconds, MonotonicTime, etc) manually.
3694 * WTF.xcodeproj/project.pbxproj:
3695 * benchmarks/ToyLocks.h:
3696 * wtf/CMakeLists.txt:
3698 * wtf/LockAlgorithm.h:
3699 (WTF::LockAlgorithm::lockSlow): Deleted.
3700 (WTF::LockAlgorithm::unlockSlow): Deleted.
3701 * wtf/LockAlgorithmInlines.h: Added.
3702 (WTF::hasParkedBit>::lockSlow):
3703 (WTF::hasParkedBit>::unlockSlow):
3704 * wtf/MainThread.cpp:
3705 * wtf/RunLoopTimer.h:
3706 * wtf/Threading.cpp:
3708 * wtf/ThreadingPthreads.cpp:
3709 (WTF::Thread::yield):
3710 * wtf/ThreadingWin.cpp:
3711 (WTF::Thread::yield):
3713 (WTF::WordLockBase::lockSlow):
3714 (WTF::WordLockBase::unlockSlow):
3716 2017-07-22 Yusuke Suzuki <utatane.tea@gmail.com>
3718 [WTF] Extend ThreadGroup::add results from bool to ThreadGroupAddResult
3719 https://bugs.webkit.org/show_bug.cgi?id=174705
3721 Reviewed by Mark Lam.
3723 After starting using ThreadGroup to bookkeep active threads for Signals,
3724 we would like to know tristate of ThreadGroup::add result, NewlyAdded, AlreadyAdded, NotAdded.
3725 This patch extends the result of ThreadGroup::add from bool to ThreadGroupAddResult tristate.
3726 Note that NotAdded is returned if the target thread is dying.
3728 * wtf/ThreadGroup.cpp:
3729 (WTF::ThreadGroup::add):
3730 (WTF::ThreadGroup::addCurrentThread):
3731 * wtf/ThreadGroup.h:
3732 * wtf/Threading.cpp:
3733 (WTF::Thread::addToThreadGroup):
3735 * wtf/threads/Signals.cpp:
3736 (WTF::registerThreadForMachExceptionHandling):
3738 2017-07-21 Commit Queue <commit-queue@webkit.org>
3740 Unreviewed, rolling out r219732.
3741 https://bugs.webkit.org/show_bug.cgi?id=174748
3743 static is not threadsafe in WebKit tree (Requested by
3744 yusukesuzuki on #webkit).
3748 "[WTF] Drop initializeDate"
3749 https://bugs.webkit.org/show_bug.cgi?id=174714
3750 http://trac.webkit.org/changeset/219732
3752 2017-07-21 Yusuke Suzuki <utatane.tea@gmail.com>
3754 [WTF] Drop initializeDate
3755 https://bugs.webkit.org/show_bug.cgi?id=174714
3757 Reviewed by Darin Adler.
3759 minYear static variable will be initialized in an exclusive manner, which is ensured by C++ "static" semantics.
3760 Thus, we do not need to call initializeDate() explicitly.
3763 (WTF::equivalentYearForDST):
3764 (WTF::initializeDates): Deleted.
3765 * wtf/Threading.cpp:
3766 (WTF::initializeThreading):
3768 2017-07-21 Yusuke Suzuki <utatane.tea@gmail.com>
3770 [JSC] Introduce static symbols
3771 https://bugs.webkit.org/show_bug.cgi?id=158863
3773 Reviewed by Darin Adler.
3775 We add a new class StaticSymbolImpl. StaticSymbolImpl can offer
3776 the way to create static SymbolImpl. It can be shared between
3777 multiple VMs and multiple threads.
3779 * wtf/text/SymbolImpl.h:
3780 (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
3781 (WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&):
3782 For StaticSymbolImpl's hashForSymbol, we use usual string hash value.
3783 Since all the SymbolImpls are unique, basically, any value is OK here.
3784 Non-confilicting to the other SymbolImpls is ideal.
3786 2017-07-21 Yusuke Suzuki <utatane.tea@gmail.com>
3788 [WTF] Newly added AtomicStringImpl should use BufferInternal static string if StringImpl is static
3789 https://bugs.webkit.org/show_bug.cgi?id=174501
3791 Reviewed by Darin Adler.
3793 When creating AtomicStringImpl from static StringImpl, we can just use createWithoutCopying
3794 to create a BufferInternal AtomicStringImpl which m_data{8,16} is static string's one.
3796 * wtf/text/AtomicStringImpl.cpp:
3797 (WTF::CStringTranslator::hash):
3798 (WTF::CStringTranslator::equal):
3799 (WTF::CStringTranslator::translate):
3800 (WTF::AtomicStringImpl::add):
3801 (WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer):
3802 (WTF::UCharBufferTranslator::hash):
3803 (WTF::UCharBufferTranslator::equal):
3804 (WTF::UCharBufferTranslator::translate):
3805 (WTF::LCharBufferTranslator::hash):
3806 (WTF::LCharBufferTranslator::equal):
3807 (WTF::LCharBufferTranslator::translate):
3808 (WTF::BufferFromStaticDataTranslator::hash):
3809 (WTF::BufferFromStaticDataTranslator::equal):
3810 (WTF::BufferFromStaticDataTranslator::translate):
3811 (WTF::AtomicStringImpl::addLiteral):
3814 (WTF::AtomicStringImpl::addSlowCase):
3815 (WTF::AtomicStringImpl::lookUp):
3816 (WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
3817 (WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
3818 (WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
3819 (WTF::addSubstring): Deleted.
3820 * wtf/text/StringImpl.h:
3822 2017-07-21 Konstantin Tokarev <annulen@yandex.ru>
3824 [cmake] Unreviewed, add definitions necessary to use ICU shipped with macOS
3826 macOS system ICU libraries are built with U_DISABLE_RENAMING=1 and
3827 U_SHOW_CPLUSPLUS_API=0. After r219155 we have to pass this definitons
3828 explicitly, because ICU headers in the tree are not modified anymore.
3830 * wtf/PlatformMac.cmake: Rely on ICU_LIBRARIES instead of passing ICU
3831 library name explicitly in WTF_LIBRARIES.
3833 2017-07-20 Chris Dumez <cdumez@apple.com>
3835 Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
3836 https://bugs.webkit.org/show_bug.cgi?id=174660
3838 Reviewed by Geoffrey Garen.
3840 Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
3841 This essentially replaces a branch to figure out if the new size is less or greater than the
3842 current size by an assertion.
3844 * wtf/IndexSparseSet.h:
3845 (WTF::OverflowHandler>::IndexSparseSet):
3846 (WTF::OverflowHandler>::clear):
3848 (WTF::executeInsertions):
3850 (WTF::RangeSet::compact):
3852 (WTF::removeRepeatedElements):
3853 * wtf/persistence/Coders.h:
3855 2017-07-20 Yusuke Suzuki <utatane.tea@gmail.com>
3857 [WTF] Use ThreadGroup to bookkeep active threads for Mach exception
3858 https://bugs.webkit.org/show_bug.cgi?id=174678
3860 Reviewed by Mark Lam.
3862 We can use ThreadGroup to bookkeep active threads for Mach exceptions.
3863 When the thread dies, it is automatically removed from the thread groups.
3864 So we do not need to call unregisterThreadForMachExceptionHandling.
3866 * wtf/ThreadGroup.cpp:
3867 (WTF::ThreadGroup::~ThreadGroup):
3868 (WTF::ThreadGroup::add):
3869 * wtf/ThreadGroup.h:
3870 * wtf/ThreadHolder.cpp:
3871 (WTF::ThreadHolder::~ThreadHolder):
3872 * wtf/Threading.cpp:
3873 (WTF::Thread::addToThreadGroup):
3874 (WTF::Thread::removeFromThreadGroup):
3876 * wtf/threads/Signals.cpp:
3877 (WTF::setExceptionPorts):
3878 (WTF::activeThreads):
3879 (WTF::registerThreadForMachExceptionHandling):
3880 (WTF::installSignalHandler):
3881 (WTF::unregisterThreadForMachExceptionHandling): Deleted.
3882 * wtf/threads/Signals.h:
3884 2017-07-19 Yusuke Suzuki <utatane.tea@gmail.com>
3886 [WTF] Remove unnecessary indirection of WTF::Thread entry point
3887 https://bugs.webkit.org/show_bug.cgi?id=174291
3889 Reviewed by Mark Lam.
3891 Now wtfThreadEntryPoint is almost the same. Only the difference is function signature due to platform APIs.
3892 We remove ThreadFunctionInvocation indirection in ThreadingPthread.cpp and ThreadingWin.cpp.
3894 Also, ThreadFunctionInvocation keeps a RefPtr to the Thread object. This was previously needed to keep the
3895 Thread object alive until the thread itself could install the ThreadHolder into its thread local storage.
3896 The ThreadHolder has a Ref that keeps the Thread object alive for the lifetime of the thread. Since
3897 Thread::create() now waits for the thread to be initialized before returning and Thread::create() hold a Ref
3898 to the Thread object, we are guaranteed that the Thread object will be alive long enough for it to be installed
3899 in the thread's ThreadHolder, and we no longer need ThreadFunctionInvocation.
3901 And we also simplify ThreadHolder::initialize a bit. Now Thread::create waits for the completion of Thread
3902 initialization. So, after establishing thread handle, we can call ThreadHolder::initialize before completing
3903 Thread initialization.
3905 Also we drop errno.h ifdefs in ThreadingWin.cpp. This is introduced to support WinCE. But now WinCE port is removed.
3907 * WTF.xcodeproj/project.pbxproj:
3908 * wtf/ThreadFunctionInvocation.h: Removed.
3909 * wtf/ThreadHolder.h:
3910 * wtf/ThreadHolderWin.cpp:
3911 (WTF::ThreadHolder::initialize):
3912 * wtf/Threading.cpp:
3913 (WTF::Thread::entryPoint):
3914 (WTF::Thread::create):
3915 (WTF::threadEntryPoint): Deleted.
3917 * wtf/ThreadingPthreads.cpp:
3918 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3919 (WTF::wtfThreadEntryPoint):
3920 (WTF::Thread::establishHandle):
3921 (WTF::Thread::initializeCurrentThreadInternal):
3922 (WTF::Thread::current):
3923 (WTF::Thread::establishPlatformSpecificHandle):
3924 (WTF::Thread::createInternal): Deleted.
3925 (WTF::Thread::establish): Deleted.
3926 * wtf/ThreadingWin.cpp:
3927 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3928 (WTF::Thread::initializeCurrentThreadInternal):
3929 (WTF::wtfThreadEntryPoint):
3930 (WTF::Thread::establishHandle):
3931 (WTF::Thread::current):
3932 (WTF::Thread::establishPlatformSpecificHandle):
3933 (WTF::Thread::createInternal): Deleted.
3934 (WTF::Thread::establish): Deleted.
3935 * wtf/win/MainThreadWin.cpp:
3936 (WTF::initializeMainThreadPlatform):
3938 2017-07-19 Yusuke Suzuki <utatane.tea@gmail.com>
3940 [WTF] Implement WTF::ThreadGroup
3941 https://bugs.webkit.org/show_bug.cgi?id=174081
3943 Reviewed by Mark Lam.
3945 This patch implements WTF::ThreadGroup. It implements core of JSC::MachineThreads with more reliable way.
3946 JSC::MachineThreads was complicated because of managing dead threads. Each JSC::MachineThreads has its
3947 own TLS with a registered destructor. And everytime a thread dies, the registered TLS destructor is called.
3948 And this destructor will remove the current dying thread from JSC::MachineThreads.
3950 However the above implementation is tricky. And each JSC::MachineThreads requires own TLS space, which is
3951 not considered in WTF's Windows ThreadSpecific implementation. Current design works well since we only
3952 have small number of MachineThreads right now.
3954 Instead, we use more reliable way. After introducing WTF::Thread, WTF::Thread has WTF::Thread::didExit,
3955 which is called when associated TLS (with WTF::Thread) is destroyed. We leverage this mechanism to remove
3956 WTF::Thread from MachineThreads.
3958 This patch introduces WTF::ThreadGroup. It is tightly integrated with WTF::Thread: WTF::Thread knows
3959 ThreadGroups which includes this thread. And WTF::ThreadGroup of course knows WTF::Threads added to it.
3960 WTF::Thread::didExit carefully remove itself from WTF::ThreadGroups.
3962 The most important part of this patch is locking. WTF::Thread can die. And WTF::ThreadGroup can die.
3963 If we take a design using two fine grain locks in WTF::Thread and WTF::ThreadGroup, we easily encounter
3964 dead lock. Consider the following case.
3966 1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold a lock of THG, and hold a lock of TH (locking order is THG -> TH).
3967 2. When TH dies, TH need to hold a lock of TH to iterate THGs. And we hold a lock of THG to unregister TH from it (locking order is TH -> THG).
3968 3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (locking order is THG -> TH).
3969 4. When destroying THG, we need to hold a lock of TH to unregister THG from TH. We can hold a lock of THG before that (locking order is THG -> TH).
3971 Then, it easily causes dead lock. We cannot swap the locking order of (2) since iterating THG requires a lock of TH.
3972 To solve this problem, we use std::shared_ptr and std::weak_ptr.
3974 1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold THG, and hold a lock of TH. (THG -> TH)
3975 2. When TH dies, TH first hold lock of TH. And we use std::weak_ptr<>::lock() to retain non-destructed ThreadGroups.
3976 If some of ThreadGroups are dying, we just ignore them. It is ok because such a ThreadGroup will be destructed. So we do not need to unregister this thread from
3977 such a ThreadGroup. Then, we have Vector<std::shared_ptr<ThreadGroup>>. So we unlock a lock of TH. To unregister a thread from thread group, we first hold a
3978 lock of THG and then hold a lock of TH. Both lifetime is ensured: THG is retained by std::shared_ptr. And TH is itself. (TH), (THG -> TH).
3979 3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (THG -> TH).
3980 4. When destroying THG, we hold a lock of THG. And hold a lock of TH. During holding THG's lock, registered thread never dies because (2) holds THG lock. (THG -> TH).
3982 We also fix suspend and resume locking mechanism to avoid dead lock. We should hold the global lock when suspending and resuming.
3983 If we use per-thread lock, the suspended thread can hold the lock of the other threads. It causes dead lock.
3985 * WTF.xcodeproj/project.pbxproj:
3986 * wtf/AutomaticThread.cpp:
3987 * wtf/CMakeLists.txt:
3988 * wtf/CrossThreadCopier.h:
3990 * wtf/ThreadGroup.cpp: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
3991 (WTF::ThreadGroup::~ThreadGroup):
3992 (WTF::ThreadGroup::add):
3993 (WTF::ThreadGroup::addCurrentThread):
3994 * wtf/ThreadGroup.h: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
3995 (WTF::ThreadGroup::create):
3996 (WTF::ThreadGroup::threads):
3997 (WTF::ThreadGroup::getLock):
3998 (WTF::ThreadGroup::weakFromThis):
3999 * wtf/Threading.cpp:
4000 (WTF::shouldRemoveThreadFromThreadGroup):
4001 (WTF::Thread::didExit):
4002 (WTF::Thread::addToThreadGroup):
4003 (WTF::Thread::removeFromThreadGroup):
4005 * wtf/ThreadingPthreads.cpp:
4006 (WTF::Thread::resume):
4007 (WTF::Thread::getRegisters):
4008 * wtf/ThreadingWin.cpp:
4009 (WTF::Thread::resume):
4010 (WTF::Thread::getRegisters):
4012 2017-07-18 Andy Estes <aestes@apple.com>
4014 [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS
4015 https://bugs.webkit.org/show_bug.cgi?id=174631
4017 Reviewed by Tim Horton.
4019 * Configurations/Base.xcconfig:
4021 2017-07-18 Yusuke Suzuki <utatane.tea@gmail.com>
4023 WTF::Thread should have the threads stack bounds.
4024 https://bugs.webkit.org/show_bug.cgi?id=173975
4026 Reviewed by Mark Lam.
4028 We move StackBounds from WTFThreadData to WTF::Thread.
4029 One important thing is that we should make valid StackBounds
4030 visible to Thread::create() caller. When the caller get
4031 WTF::Thread from Thread::create(), this WTF::Thread should
4032 have a valid StackBounds. But StackBounds information can be
4033 retrived only in the WTF::Thread's thread itself.
4035 We also clean up WTF::initializeThreading. StringImpl::empty()
4036 is now statically initialized by using constexpr constructor.
4037 Thus we do not need to call StringImpl::empty() explicitly here.
4038 And WTF::initializeThreading() does not have any main thread
4039 affinity right now in all the platforms. So we fix the comment
4040 in Threading.h. Then, now, WTF::initializeThreading() is called
4041 in UI thread when using Web thread in iOS.
4043 * wtf/StackBounds.h:
4044 (WTF::StackBounds::emptyBounds):
4045 (WTF::StackBounds::StackBounds):
4046 * wtf/Threading.cpp:
4047 (WTF::threadEntryPoint):
4048 (WTF::Thread::create):
4049 (WTF::Thread::currentMayBeNull):
4050 (WTF::Thread::initialize):
4051 (WTF::initializeThreading):
4053 (WTF::Thread::stack):
4054 * wtf/ThreadingPthreads.cpp:
4055 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
4056 (WTF::Thread::current):
4057 (WTF::initializeCurrentThreadEvenIfNonWTFCreated): Deleted.
4058 (WTF::Thread::currentMayBeNull): Deleted.
4059 * wtf/ThreadingWin.cpp:
4060 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
4061 (WTF::Thread::initializeCurrentThreadInternal):
4062 (WTF::Thread::current):
4063 * wtf/WTFThreadData.cpp:
4064 (WTF::WTFThreadData::WTFThreadData):
4065 * wtf/WTFThreadData.h:
4066 (WTF::WTFThreadData::stack):
4068 2017-07-18 Andy Estes <aestes@apple.com>
4070 [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION
4071 https://bugs.webkit.org/show_bug.cgi?id=174631
4073 Reviewed by Sam Weinig.
4075 * Configurations/Base.xcconfig:
4077 2017-07-18 Andy Estes <aestes@apple.com>
4079 [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION
4080 https://bugs.webkit.org/show_bug.cgi?id=174631
4082 Reviewed by Dan Bernstein.
4084 * Configurations/Base.xcconfig:
4086 2017-07-18 Andy Estes <aestes@apple.com>
4088 [Xcode] Enable CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING
4089 https://bugs.webkit.org/show_bug.cgi?id=174631
4091 Reviewed by Darin Adler.
4093 * Configurations/Base.xcconfig:
4095 2017-07-17 Konstantin Tokarev <annulen@yandex.ru>
4097 [cmake] Set library types before their targets are created
4098 https://bugs.webkit.org/show_bug.cgi?id=174600
4100 Reviewed by Michael Catanzaro.
4102 Since r219560 library targets are created before PlatformXXX.cmake
4103 files are processed, however library type must be passed in
4104 add_library() call and cannot be changed afterwards. Set these
4105 variables in OptionsXXX.cmake.
4107 * wtf/PlatformGTK.cmake:
4108 * wtf/PlatformMac.cmake:
4110 2017-07-17 Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com>
4112 Move USE_AVFOUNDATION definition on Windows to wtf/Platform.h
4113 https://bugs.webkit.org/show_bug.cgi?id=174356
4115 Reviewed by Brent Fulgham.
4117 Move the definition of USE_AVFOUNDATION on Windows to wtf/platform.h
4119 Add a custom command to generate AVFoundationHeaderDetection.h, which
4120 is renamed from WebCoreHeaderDetection.h
4122 * AVFoundationSupport.py: Moved from Source/WebCore/AVFoundationSupport.py.
4124 * wtf/PlatformWin.cmake:
4126 2017-07-17 Darin Adler <darin@apple.com>
4128 Improve use of NeverDestroyed
4129 https://bugs.webkit.org/show_bug.cgi?id=174348
4131 Reviewed by Sam Weinig.
4133 * wtf/HashSet.h: Added an overload of HashSet::add that takes an initializer list of
4134 const references. This is handy to add a bunch of values all at once. Later we can
4135 consider optimizing to grow the hash table only once instead of deciding whether to
4136 grow repeatedly as we add each value.
4137 (WTF::copyToVector): Changed to use std::copy, removing 4 of the 6 lines of code here.
4139 * wtf/MemoryPressureHandler.cpp: Include NeverDestroyed.h here ...
4140 * wtf/MemoryPressureHandler.h: ... not here.
4142 * wtf/NeverDestroyed.h: Added the ability to have a const NeverDestroyed.
4143 Added a makeNeverDestroyed function that deduces the type from the argument.
4144 With auto, this can be used to avoid writing out a long type twice.
4146 * wtf/ThreadingPthreads.cpp: Removed unneeded include of NeverDestroyed.h.
4147 * wtf/text/AtomicString.cpp: Ditto.
4149 2017-07-17 Konstantin Tokarev <annulen@yandex.ru>
4151 [CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called
4152 https://bugs.webkit.org/show_bug.cgi?id=174557
4154 Reviewed by Michael Catanzaro.
4156 * wtf/CMakeLists.txt:
4158 2017-07-14 Jonathan Bedard <jbedard@apple.com>
4161 https://bugs.webkit.org/show_bug.cgi?id=174430
4162 <rdar://problem/33269288>
4164 Reviewed by Tim Horton.
4166 * Configurations/WTF.xcconfig: Exclude MachExceptions.def when building iOS 11 for
4169 2017-07-14 Commit Queue <commit-queue@webkit.org>
4171 Unreviewed, rolling out r219510.
4172 https://bugs.webkit.org/show_bug.cgi?id=174525
4174 Need to revert length() == 0 check for null string (Requested
4175 by yusukesuzuki on #webkit).
4179 "[WTF] Newly added AtomicStringImpl should use BufferInternal
4180 static string if StringImpl is static"
4181 https://bugs.webkit.org/show_bug.cgi?id=174501
4182 http://trac.webkit.org/changeset/219510
4184 2017-07-14 Yusuke Suzuki <utatane.tea@gmail.com>
4186 [WTF] Newly added AtomicStringImpl should use BufferInternal static string if StringImpl is static
4187 https://bugs.webkit.org/show_bug.cgi?id=174501
4189 Reviewed by Darin Adler.
4191 When creating AtomicStringImpl from static StringImpl, we can just use createWithoutCopying
4192 to create a BufferInternal AtomicStringImpl which m_data{8,16} is static string's one.
4194 * wtf/text/AtomicStringImpl.cpp:
4195 (WTF::CStringTranslator::hash):
4196 (WTF::CStringTranslator::equal):
4197 (WTF::CStringTranslator::translate):
4198 (WTF::AtomicStringImpl::add):
4199 (WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer):
4200 (WTF::UCharBufferTranslator::hash):
4201 (WTF::UCharBufferTranslator::equal):
4202 (WTF::UCharBufferTranslator::translate):
4203 (WTF::LCharBufferTranslator::hash):
4204 (WTF::LCharBufferTranslator::equal):
4205 (WTF::LCharBufferTranslator::translate):
4206 (WTF::BufferFromStaticDataTranslator::hash):
4207 (WTF::BufferFromStaticDataTranslator::equal):
4208 (WTF::BufferFromStaticDataTranslator::translate):
4209 (WTF::AtomicStringImpl::addLiteral):
4212 (WTF::AtomicStringImpl::addSlowCase):
4213 (WTF::AtomicStringImpl::lookUp):
4214 (WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
4215 (WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
4216 (WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
4217 (WTF::addSubstring): Deleted.
4218 * wtf/text/StringImpl.h:
4220 2017-07-14 Yusuke Suzuki <utatane.tea@gmail.com>
4222 [WTF] Use std::unique_ptr for StackTrace
4223 https://bugs.webkit.org/show_bug.cgi?id=174495
4225 Reviewed by Alex Christensen.
4227 Instead of returning pointer to heap allocated StackTrace,
4228 we should return std::unique_ptr<StackTrace>.
4229 And we also move WTFGetBackTrace from Assertions.cpp to
4230 StackTrace.cpp to consolidate stack trace related operations
4231 into StackTrace.cpp.
4233 * wtf/Assertions.cpp:
4234 * wtf/StackTrace.cpp:
4236 (WTF::StackTrace::captureStackTrace):
4239 2017-07-13 Yusuke Suzuki <utatane.tea@gmail.com>