1 2017-11-07 Maciej Stachowiak <mjs@apple.com>
3 Get rid of unsightly hex numbers from unified build object files
4 https://bugs.webkit.org/show_bug.cgi?id=179410
6 Reviewed by Saam Barati.
8 * Scripts/generate-unified-source-bundles.rb: For extensions other than "cpp", also include
9 the extension in the base name of the file, to avoid ugly Xcode-generated object file names.
11 2017-11-07 Filip Pizlo <fpizlo@apple.com>
13 Disable isoheaps on iOS
15 Reviewed by Ryosuke Niwa.
19 2017-11-07 Brady Eidson <beidson@apple.com>
21 Implement "UpdateWorkerState" and use it
22 https://bugs.webkit.org/show_bug.cgi?id=179318
24 Reviewed by Chris Dumez.
26 * wtf/ObjectIdentifier.h:
27 (WTF::ObjectIdentifier::loggingString const):
29 2017-11-07 Michael Saboff <msaboff@apple.com>
31 Add SPI function pointers qualifiers for CPU(ARM64E)
32 https://bugs.webkit.org/show_bug.cgi?id=179383
36 For ARM64E, use the appropriate SPI qualifiers for helper function pointers.
41 2017-10-31 Filip Pizlo <fpizlo@apple.com>
43 bmalloc should support strictly type-segregated isolated heaps
44 https://bugs.webkit.org/show_bug.cgi?id=178108
46 Reviewed by Saam Barati, Simon Fraser, and Ryosuke Niwa.
48 This just adds an easy way of using the bmalloc IsoHeap API in WebKit. If bmalloc is not
49 enabled, these macros will just make the object FastMalloced.
51 * WTF.xcodeproj/project.pbxproj:
53 * wtf/IsoMalloc.h: Added.
54 * wtf/IsoMallocInlines.h: Added.
56 2017-11-06 Christopher Reid <chris.reid@sony.com>
58 Use enum classes within FileSystem
59 https://bugs.webkit.org/show_bug.cgi?id=175172
61 Reviewed by Myles C. Maxfield.
63 Adding a helper function for converting enum classes to their underlying type when necessary.
67 2017-11-06 Michael Catanzaro <mcatanzaro@igalia.com>
69 [WPE][GTK] Always use SET_AND_EXPOSE_TO_BUILD to set build variables
70 https://bugs.webkit.org/show_bug.cgi?id=179038
72 Reviewed by Žan Doberšek.
76 2017-11-03 Chris Dumez <cdumez@apple.com>
78 Use a single identifier type to identify Service Workers
79 https://bugs.webkit.org/show_bug.cgi?id=179192
81 Reviewed by Brady Eidson.
83 Introduce class for strongly typed identifiers. This avoids mixing up
84 different types of identifiers.
86 * WTF.xcodeproj/project.pbxproj:
87 * wtf/ObjectIdentifier.h: Added.
88 (WTF::ObjectIdentifier::encode const):
89 (WTF::ObjectIdentifier::decode):
90 (WTF::ObjectIdentifier::operator== const):
91 (WTF::ObjectIdentifier::operator!= const):
92 (WTF::ObjectIdentifier::ObjectIdentifier):
93 (WTF::makeObjectIdentifier):
94 (WTF::ObjectIdentifierHash::hash):
95 (WTF::ObjectIdentifierHash::equal):
96 (WTF::HashTraits<ObjectIdentifier<T>>::emptyValue):
97 (WTF::HashTraits<ObjectIdentifier<T>>::constructDeletedValue):
98 (WTF::HashTraits<ObjectIdentifier<T>>::isDeletedValue):
100 2017-11-02 Ryan Haddad <ryanhaddad@apple.com>
102 Unreviewed, rolling out r224353.
104 Breaks internal builds.
108 "Ignore HSTS for partitioned, cross-origin subresource
110 https://bugs.webkit.org/show_bug.cgi?id=178993
111 https://trac.webkit.org/changeset/224353
113 2017-11-02 John Wilander <wilander@apple.com>
115 Ignore HSTS for partitioned, cross-origin subresource requests
116 https://bugs.webkit.org/show_bug.cgi?id=178993
117 <rdar://problem/34962462>
119 Reviewed by Brent Fulgham and Alex Christensen.
122 Added HAVE_CFNETWORK_IGNORE_HSTS.
124 2017-11-02 Frederic Wang <fwang@igalia.com>
126 Add references to bug 179167 in FIXME comments
127 https://bugs.webkit.org/show_bug.cgi?id=179168
129 Reviewed by Daniel Bates.
131 * wtf/FeatureDefines.h:
133 2017-11-01 Jiewen Tan <jiewen_tan@apple.com>
135 Let is<T>() accept RefPtrs
136 https://bugs.webkit.org/show_bug.cgi?id=178612
137 <rdar://problem/35102004>
139 Reviewed by Ryosuke Niwa.
141 Add support for is<T>() for RefPtrs.
146 2017-11-01 Simon Fraser <simon.fraser@apple.com>
148 Misc display list and other cleanup
149 https://bugs.webkit.org/show_bug.cgi?id=179150
151 Reviewed by Tim Horton.
153 Add system trace points for display list recording.
155 * wtf/SystemTracing.h:
157 2017-11-01 Fujii Hironori <Hironori.Fujii@sony.com>
159 Use LazyNeverDestroyed instead of DEFINE_GLOBAL
160 https://bugs.webkit.org/show_bug.cgi?id=174979
162 Reviewed by Yusuke Suzuki.
164 DEFINE_GLOBAL is not used anymore. Remove it.
166 * WTF.xcodeproj/project.pbxproj: Removed StaticConstructors.h
167 * config.h: Removed definitions of SKIP_STATIC_CONSTRUCTORS_ON_MSVC and SKIP_STATIC_CONSTRUCTORS_ON_GCC.
168 * wtf/CMakeLists.txt: Removed StaticConstructors.h
169 * wtf/StaticConstructors.h: Removed.
171 2017-10-30 Michael Catanzaro <mcatanzaro@igalia.com>
173 [WPE] Fix build warnings
174 https://bugs.webkit.org/show_bug.cgi?id=178899
176 Reviewed by Carlos Alberto Lopez Perez.
178 * wtf/PlatformWPE.cmake:
180 2017-10-27 Yousuke Kimoto <yousuke.kimoto@sony.com>
182 [WinCairo] Add WTF files for wincairo webkit
183 https://bugs.webkit.org/show_bug.cgi?id=176894
185 Reviewed by Alex Christensen.
187 * wtf/PlatformWin.cmake:
190 * wtf/win/Win32Handle.h:
191 * wtf/win/WorkItemContext.cpp: Added.
192 (WTF::WorkItemContext::WorkItemContext):
193 (WTF::WorkItemContext::create):
194 (WTF::WorkItemContext::~WorkItemContext):
195 * wtf/win/WorkItemContext.h: Added.
196 (WTF::WorkItemContext::handle):
197 (WTF::WorkItemContext::waitHandle):
198 (WTF::WorkItemContext::Function<void):
199 (WTF::WorkItemContext::queue const):
200 * wtf/win/WorkQueueWin.cpp:
201 (WTF::WorkQueue::handleCallback):
202 (WTF::WorkQueue::registerHandle):
203 (WTF::WorkQueue::unregisterAndCloseHandle):
204 (WTF::WorkQueue::unregisterWaitAndDestroyItemSoon):
205 (WTF::WorkQueue::unregisterWaitAndDestroyItemCallback):
207 2017-10-27 Keith Miller <keith_miller@apple.com>
209 Add unified source list files and build scripts to Xcode project navigator
210 https://bugs.webkit.org/show_bug.cgi?id=178959
212 Reviewed by Andy Estes.
214 * WTF.xcodeproj/project.pbxproj:
216 2017-10-26 Mark Lam <mark.lam@apple.com>
218 JSRopeString::RopeBuilder::append() should check for overflows.
219 https://bugs.webkit.org/show_bug.cgi?id=178385
220 <rdar://problem/35027468>
222 Reviewed by Saam Barati.
224 * wtf/CheckedArithmetic.h:
226 2017-10-25 Commit Queue <commit-queue@webkit.org>
228 Unreviewed, rolling out r222945.
229 https://bugs.webkit.org/show_bug.cgi?id=178818
231 "It made WasmBench crash" (Requested by saamyjoon on #webkit).
235 "bmalloc mutex should be adaptive"
236 https://bugs.webkit.org/show_bug.cgi?id=177839
237 https://trac.webkit.org/changeset/222945
239 2017-10-25 Zan Dobersek <zdobersek@igalia.com>
241 Make SERVICE_WORKER feature buildable on GTK, WPE
242 https://bugs.webkit.org/show_bug.cgi?id=178574
244 Reviewed by Carlos Garcia Campos.
246 * wtf/Identified.h: Explicitly include the <atomic> header since
247 std::atomic<> is used in the ThreadSafeIdentified definition.
249 2017-10-24 Michael Saboff <msaboff@apple.com>
251 WTF: Eliminated PLATFORM checks for HAVE_MACH_EXCEPTIONS
252 https://bugs.webkit.org/show_bug.cgi?id=178747
254 Reviewed by Saam Barati.
256 Removed unnecessary PLATFORM checks as they can cause build failures
257 when the include file is present.
261 2017-10-23 Yusuke Suzuki <utatane.tea@gmail.com>
263 [JSC] Use fastJoin in Array#toString
264 https://bugs.webkit.org/show_bug.cgi?id=178062
266 Reviewed by Darin Adler.
268 A bit cleaning up to use StringImpl::copyChars instead of
269 using for-loop directly.
271 * wtf/text/StringView.h:
272 (WTF::StringView::getCharactersWithUpconvert const):
274 2017-10-20 Antoine Quint <graouts@apple.com>
276 [Web Animations] Provide basic timeline and animation interfaces
277 https://bugs.webkit.org/show_bug.cgi?id=178526
279 Reviewed by Dean Jackson.
281 Remove the WEB_ANIMATIONS compile-time flag.
283 * wtf/FeatureDefines.h:
285 2017-10-19 Keith Miller <keith_miller@apple.com>
287 REGRESSION (r223476): WebCore exports symbols with names belonging to other frameworks
288 https://bugs.webkit.org/show_bug.cgi?id=178424
290 Reviewed by David Kilzer.
292 This patch moves the wrapper function sharing the name of the externed function
293 to the source file and marks it as always inline. Marking it as inline prevents
294 the framework from exporting it.
296 * wtf/cocoa/SoftLinking.h:
298 2017-10-18 Keith Miller <keith_miller@apple.com>
300 Setup WebCore build to start using unified sources.
301 https://bugs.webkit.org/show_bug.cgi?id=178362
303 Reviewed by Tim Horton.
305 There are a number of changes to the bundler script. First, it is
306 now possible to enable or disable building files based on if the
307 associated feature flag is enabled or not. The syntax for this is
308 similar to how we do #ifs in C++ code. e.g.
314 would enable myApplePayFile.cpp if and only if the APPLE_PAY
315 feature define is set.
317 I also changed comments from # to // to make it less likely they
318 would be confused with a #if.
320 Finally, this patch enables bundling files in the same relative
321 directory across source list files. Previously, if
322 SourcesCocoa.txt had platform/cf/foo.cpp and SourcesMac.txt had
323 platform/cf/bar.cpp those files would not be put in the same
324 unified source bundle. Now, those files will be put into the same
325 bundle but bar.cpp will always follow foo.cpp. The idea is that by
326 putting more specific files after more general files we can avoid
327 random build failures.
329 * Scripts/generate-unified-source-bundles.rb:
331 2017-10-18 Konstantin Tokarev <annulen@yandex.ru>
333 REGRESSION(r217771): nullTerminatedWCharToString loses last character of input string
334 https://bugs.webkit.org/show_bug.cgi?id=178444
336 Reviewed by Per Arne Vollan.
338 * wtf/text/win/WCharStringExtras.h:
339 (WTF::nullTerminatedWCharToString):
341 2017-10-17 Keith Miller <keith_miller@apple.com>
343 Change WebCore sources to work with unified source builds
344 https://bugs.webkit.org/show_bug.cgi?id=178229
346 Rubber stamped by Tim Horton.
349 * wtf/cocoa/SoftLinking.h:
351 2017-10-16 David Kilzer <ddkilzer@apple.com>
353 Add RELEASE_ASSERT_WITH_SECURITY_IMPLICATION() macro
354 <https://webkit.org/b/178269>
356 Reviewed by Alex Christensen.
359 (RELEASE_ASSERT_WITH_SECURITY_IMPLICATION): Add macro.
361 2017-10-14 Sam Weinig <sam@webkit.org>
363 Remove HashCountedSet's copyToVector functions
364 https://bugs.webkit.org/show_bug.cgi?id=178215
366 Reviewed by Daniel Bates.
368 * wtf/HashCountedSet.h:
369 (WTF::copyToVector): Deleted.
371 They are replaced by either copyToVector(hashCountedSet) or copyToVector(hashCountedSet.values())
373 2017-10-13 Sam Weinig <sam@webkit.org>
375 Adopt type trait template aliases everywhere in WTF
376 https://bugs.webkit.org/show_bug.cgi?id=178299
378 Reviewed by Yusuke Suzuki.
380 Adopt type trait template aliases (e.g. replace 'typename std::make_unsigned<Source>::type'
381 with 'std::make_unsigned_t<Source>'). Also adopt using over typedef consistently.
384 * wtf/CagedUniquePtr.h:
385 * wtf/CheckedArithmetic.h:
386 * wtf/CompletionHandler.h:
388 * wtf/HashCountedSet.h:
389 * wtf/HashFunctions.h:
394 * wtf/IndexedContainerIterator.h:
395 * wtf/IteratorAdaptors.h:
396 * wtf/KeyValuePair.h:
400 * wtf/NeverDestroyed.h:
403 * wtf/SizeLimits.cpp:
404 * wtf/StdLibExtras.h:
406 * wtf/ThreadSpecific.h:
409 * wtf/text/IntegerToStringConversion.h:
411 2017-10-13 Jer Noble <jer.noble@apple.com>
413 Performance: Skip texture upload if source image and destination texture haven't changed
414 https://bugs.webkit.org/show_bug.cgi?id=178254
415 <rdar://problem/34968181>
417 Reviewed by Dean Jackson.
419 Add a new class, UnsafePointer, for safely holding pointers to objects with uncontrolled lifetimes.
421 * WTF.xcodeproj/project.pbxproj:
422 * wtf/UnsafePointer.h: Added.
423 (WTF::UnsafePointer::UnsafePointer):
424 (WTF::UnsafePointer::operator== const):
425 (WTF::UnsafePointer::operator!= const):
426 (WTF::UnsafePointer::operator bool const):
430 2017-10-13 Per Arne Vollan <pvollan@apple.com>
432 [Win] When built with VS2017, MiniBrowser crashes on startup.
433 https://bugs.webkit.org/show_bug.cgi?id=175209
435 Reviewed by Daniel Bates.
437 Add AtomicString(const StaticStringImpl*) constructor. This is needed since
438 this patch adds constexpr to the static, global StaticStringImpl objects
439 generated in WebCore/bindings/scripts/StaticString.pm.
441 * wtf/text/AtomicString.h:
442 (WTF::AtomicString::AtomicString):
443 * wtf/text/AtomicStringImpl.cpp:
445 (WTF::AtomicStringImpl::add):
446 * wtf/text/AtomicStringImpl.h:
447 * wtf/text/StringImpl.h:
448 (WTF::StringImpl::assertHashIsCorrect const):
449 (WTF::StringImpl::assertHashIsCorrect): Deleted.
451 2017-10-12 Alex Christensen <achristensen@webkit.org>
453 Add Expected, HashMap, HashSet, and SHA1 to wtf/Forward.h
454 https://bugs.webkit.org/show_bug.cgi?id=178243
456 Reviewed by Tim Horton.
460 Move default parameters to Forward.h like we did with Vector.
462 Also fix indentation.
464 2017-10-12 Alex Christensen <achristensen@webkit.org>
466 Add CompletionHandler and HashCountedSet to wtf/Forward.h
467 https://bugs.webkit.org/show_bug.cgi?id=178231
469 Reviewed by Tim Horton.
472 * wtf/HashCountedSet.h:
474 2017-10-11 Sam Weinig <sam@webkit.org>
476 Remove out-parameter variants of copyToVector
477 https://bugs.webkit.org/show_bug.cgi?id=178155
479 Reviewed by Tim Horton.
482 (WTF::copyToVector): Deleted.
484 (WTF::copyToVector): Deleted.
489 (WTF::copyToVectorSpecialization):
491 Add another version of copyToVector, called copyToVectorSpecialization, that allows
492 you to specify the entire specialization for the Vector you want to copy to. This
493 can be useful if you want your resulting Vector to have an inline capacity.
495 2017-10-12 Sam Weinig <sam@webkit.org>
497 It should be possible to iterate just the values (and not the counts) of a HashCountedSet
498 https://bugs.webkit.org/show_bug.cgi?id=178169
500 Reviewed by Daniel Bates.
502 Cleanup (fix indentation, simplify type names, adopt using), and add a values() range to
503 HashCountedSet. This will allow getting a Vector of all the values (and not the counts)
504 using the new copyToVector.
506 * wtf/HashCountedSet.h:
508 2017-10-11 Michael Saboff <msaboff@apple.com>
510 [JSC] Add ability to build with ARMV8 ILP32 ABI
511 https://bugs.webkit.org/show_bug.cgi?id=178194
513 Reviewed by Saam Barati.
515 For ARMV8 32 bit ABI, use JSVALUE32_64 and the CLOOP.
519 2017-10-11 Youenn Fablet <youenn@apple.com>
521 Add API to clean CacheStorage data
522 https://bugs.webkit.org/show_bug.cgi?id=178034
524 Reviewed by Chris Dumez.
526 Moving CallbackAggregator pattern into its own class for easier reuse.
528 * WTF.xcodeproj/project.pbxproj:
529 * wtf/CallbackAggregator.h: Added.
530 (WTF::CallbackAggregator::create):
531 (WTF::CallbackAggregator::~CallbackAggregator):
532 (WTF::CallbackAggregator::CallbackAggregator):
534 2017-10-10 Sam Weinig <sam@webkit.org>
536 Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values())
537 https://bugs.webkit.org/show_bug.cgi?id=178102
539 Reviewed by Tim Horton.
542 (WTF::copyKeysToVector): Deleted.
543 (WTF::copyValuesToVector): Deleted.
545 Remove copyKeysToVector and copyValuesToVector which are no longer used.
547 2017-10-09 Youenn Fablet <youenn@apple.com>
549 Vector should be able to easily create from a list of movable only items
550 https://bugs.webkit.org/show_bug.cgi?id=176432
552 Reviewed by Darin Adler.
554 Adding static from method to construct a Vector from movable-only items.
555 This may also be used instead of initializer list constructor for types that would benefit of being moved.
558 (WTF::Vector::Vector):
560 (WTF::Vector::uncheckedInitialize): Introduced as an optimization to set the vector size once.
561 (WTF::Malloc>::reserveInitialCapacity):
563 2017-10-09 Tim Horton <timothy_horton@apple.com>
565 Disable INPUT_TYPE_COLOR in FeatureDefines.h
566 https://bugs.webkit.org/show_bug.cgi?id=178103
567 <rdar://problem/34872127>
569 Reviewed by Simon Fraser.
571 * wtf/FeatureDefines.h:
572 Because FeatureDefines.h overrides features that are not enabled in
573 FeatureDefines.xcconfig, you currently have to turn INPUT_TYPE_COLOR
574 off in two places. Since we only ever want it on for Mac, it's OK
575 to depend on the xcconfig defining it.
577 2017-10-09 Sam Weinig <sam@webkit.org>
579 Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
580 https://bugs.webkit.org/show_bug.cgi?id=178072
582 Reviewed by Darin Adler.
584 Introduce SizedIteratorRange, a variant of IteratorRange that includes
585 a reference to a backing container in order to get the size of container.
586 This is useful for algorithms like WTF::map and WTF::copyToVector, that
587 can use the size to efficiently allocate things of the correct size.
589 The main beneficiary are HashMap's keys() and values() functions which
590 used to return IteratorRanges and now return SizedIteratorRange. This
591 allows us to remove (in a future change) copyKeysToVector() and
592 copyValuesToVector() by replacing them with copyToVector(map.keys()) and
593 copyToVector(map.values()) respectively.
596 * wtf/IteratorRange.h:
597 (WTF::SizedIteratorRange::SizedIteratorRange):
598 (WTF::SizedIteratorRange::size const):
599 (WTF::SizedIteratorRange::begin const):
600 (WTF::SizedIteratorRange::end const):
601 (WTF::makeSizedIteratorRange):
603 2017-10-08 Sam Weinig <sam@webkit.org>
605 It should be possible to create a ListHashSet with a std::initializer_list.
606 https://bugs.webkit.org/show_bug.cgi?id=178070
608 Reviewed by Darin Adler.
611 (WTF::U>::ListHashSet):
612 Add a constructor that takes a std::initializer_list.
614 2017-10-08 Sam Weinig <sam@webkit.org>
616 Address additional feedback from Darin for r223039 and sort the using declarations.
620 2017-10-08 Sam Weinig <sam@webkit.org>
622 There should be a version of copyToVector that returns a Vector, rather than using an out parameter
623 https://bugs.webkit.org/show_bug.cgi?id=177732
625 Reviewed by Saam Barati.
627 Add two new helper functions, copyToVector and copyToVectorOf, which will be able to
628 replace the existing out parameter taking copyToVector. Like it's ancestral namesake,
629 copyToVector takes an object that is both iterable (supports begin() and end()) and
630 has a size, and returns a Vector with a copy of all the items iterated. The copyToVectorOf
631 variant allow the user to specify a type to convert to, so if you have a HashSet<int>
632 but want those as floats in a Vector, you can do:
634 auto floatVector = copyToVectorOf<float>(intSet);
638 (WTF::copyToVectorOf):
640 2017-10-08 Darin Adler <darin@apple.com>
642 Fix bugs related to setting reflected floating point DOM attributes
643 https://bugs.webkit.org/show_bug.cgi?id=178061
645 Reviewed by Sam Weinig.
648 (WTF::formatStringTruncatingTrailingZerosIfNeeded): Fix a bug where
649 this function would remove trailing zeroes from the exponent if
650 present instead of from the mantissa. This meant that it would
651 format 1e10 as "1.00000e+1" instead of "1e+10". Added regression
652 tests for this to TestWebKitAPI.
655 (WTF::double_conversion::StringBuilder::RemoveCharacters): Added.
656 Used by the fix above.
658 * wtf/text/AtomicString.cpp:
659 (WTF::AtomicString::number): Note: This function is used by code
660 that sets the values of reflected floating point DOM attributes.
661 Changed the function to use the rules from numberToString rather
662 ones from numberToFixedPrecisionString. This is analogous to
663 String::numberToStringECMAScript, and in the future we should change
664 String and StringBuilder so this "ECMAScript" semantic is the default
665 way to convert a floating point number to a string, and rename the fixed
666 precision version that is currently called String::number. I audited
667 the small number of sites calling AtomicString::number, by temporarily
668 renaming it, and discovered that this is the correct behavior for all;
669 none needed fixed precision. Also, fixed a mistake where this explicitly
670 converted to String. That was defeating the purpose of having these
671 functions in AtomicString: It would allocate a new String and then
672 destroy it in the case where an equal string was already in the
675 2017-10-06 Commit Queue <commit-queue@webkit.org>
677 Unreviewed, rolling out r222791 and r222873.
678 https://bugs.webkit.org/show_bug.cgi?id=178031
680 Caused crashes with workers/wasm LayoutTests (Requested by
681 ryanhaddad on #webkit).
685 "WebAssembly: no VM / JS version of everything but Instance"
686 https://bugs.webkit.org/show_bug.cgi?id=177473
687 http://trac.webkit.org/changeset/222791
689 "WebAssembly: address no VM / JS follow-ups"
690 https://bugs.webkit.org/show_bug.cgi?id=177887
691 http://trac.webkit.org/changeset/222873
693 2017-10-06 Antti Koivisto <antti@apple.com>
695 Minor WeakPtr improvements
696 https://bugs.webkit.org/show_bug.cgi?id=177958
698 Reviewed by Sam Weinig.
701 (WTF::WeakPtr::operator bool const):
705 (WTF::WeakPtrFactory::createWeakPtr const):
708 Remove templating from createWeakPtr, makeWeakPtr() is now the
709 canonical way to make derived-type WeakPtrs.
711 2017-10-04 Filip Pizlo <fpizlo@apple.com>
713 bmalloc mutex should be adaptive
714 https://bugs.webkit.org/show_bug.cgi?id=177839
716 Reviewed by Michael Saboff.
718 Add some comments that I thought of while copy-pasting this code.
720 Reland after fixing ancient WordLock bug: the notify_one has to happen with the lock held
721 to ensure it doesn't run after that thread has died.
723 * wtf/LockAlgorithmInlines.h:
726 2017-10-05 Carlos Alberto Lopez Perez <clopez@igalia.com>
728 Generate a compile error if release is built without compiler optimizations
729 https://bugs.webkit.org/show_bug.cgi?id=177665
731 Reviewed by Brian Burg.
733 For GCC and Clang, generate an error at build time that will alert
734 the developer that she is trying to build Release without any compiler
735 optimization. A build time error is much better than an unexpected
736 "oh, WebKit is really slow ..." situation later.
738 If this was intended, then we tell the developer that she can continue
739 by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
742 The intention of this patch is to ensure that nobody builds Release
743 without enabling compiler optimization by mistake.
747 2017-10-05 David Kilzer <ddkilzer@apple.com>
749 Bug 177893: Disable -Wcast-qual for new clang compiler in Apple ports
750 <https://webkit.org/b/177893>
751 <rdar://problem/33667497>
753 Reviewed by Tim Horton.
756 (WTF::RetainPtr::fromStorageType const): Disable warnings for
757 -Wcast-qual until we can provide a safe cast function that lets
758 us re-enable the warning.
760 2017-10-05 Matt Lewis <jlewis3@apple.com>
762 Unreviewed, rolling out r222893.
764 This caused multiple API failures.
768 "bmalloc mutex should be adaptive"
769 https://bugs.webkit.org/show_bug.cgi?id=177839
770 http://trac.webkit.org/changeset/222893
772 2017-10-04 Filip Pizlo <fpizlo@apple.com>
774 bmalloc mutex should be adaptive
775 https://bugs.webkit.org/show_bug.cgi?id=177839
777 Reviewed by Michael Saboff.
779 Add some comments that I thought of while copy-pasting this code.
781 * wtf/LockAlgorithmInlines.h:
784 2017-10-04 JF Bastien <jfbastien@apple.com>
786 WTF: Update std::expected to match current proposal
787 https://bugs.webkit.org/show_bug.cgi?id=177881
789 Reviewed by Mark Lam.
791 The proposal is likely to be in C++20 and I've been asked to help co-champion
792 it. I'm therefore updating our implementation to more closely match the current
793 proposal, and to make sure it'll work for us if standardized.
795 - Rename UnexpectedType to Unexpected to match the proposal.
796 - Remove relational operators, only equality / inequality remains.
797 - Fix minor type signatures.
798 - Add UnexpectedType typedef.
799 - Uncomment rebind implementation.
800 - Add in-place construction tag, as well as explicit error construction tag.
801 - Add template unexpected constructor.
802 - Note that make_unexpected isn't in the proposal anymore, but we keep it because we don't have C++17 deduction guides.
803 - Remove hashing, which isn't in the proposal anymore.
806 (WTF::Unexpected::Unexpected):
807 (WTF::Unexpected::value const):
810 (WTF::makeUnexpected):
811 (WTF::Expected::Expected):
812 (WTF::Expected::operator=):
813 (WTF::Expected::getUnexpected const):
815 2017-10-04 Ryan Haddad <ryanhaddad@apple.com>
817 Unreviewed, rolling out r222840.
819 This change breaks internal builds.
823 "Generate a compile error if release is built without compiler
825 https://bugs.webkit.org/show_bug.cgi?id=177665
826 http://trac.webkit.org/changeset/222840
828 2017-10-04 Carlos Alberto Lopez Perez <clopez@igalia.com>
830 Generate a compile error if release is built without compiler optimizations
831 https://bugs.webkit.org/show_bug.cgi?id=177665
833 Reviewed by Michael Catanzaro.
835 For GCC and Clang, generate an error at build time that will alert
836 the developer that she is trying to build Release without any compiler
837 optimization. A build time error is much better than an unexpected
838 "oh, WebKit is really slow ..." situation later.
840 If this was intended, then we tell the developer that she can continue
841 by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
844 The intention of this patch is to ensure that nobody builds Release
845 without enabling compiler optimization by mistake.
849 2017-10-04 Tomas Popela <tpopela@redhat.com>
851 Allow building without WOFF enabled
853 Reviewed by Michael Catanzaro.
855 Don't force the WOFF to be turned on, but follow what is set in cmake.
859 2017-10-03 Saam Barati <sbarati@apple.com>
861 Implement polymorphic prototypes
862 https://bugs.webkit.org/show_bug.cgi?id=176391
864 Reviewed by Filip Pizlo.
867 (WTF::Box::operator bool const):
868 (WTF::Box::operator bool): Deleted.
869 Make Box movable. Also ensure its operator bool doesn't do an atomic increment.
871 (WTF::RefPtr::operator bool const):
872 Add `explicit operator bool()` for RefPtr.
874 2017-10-03 Antti Koivisto <antti@apple.com>
876 Allow assigning WeakPtr<Derived> to WeakPtr<Base>
877 https://bugs.webkit.org/show_bug.cgi?id=177817
879 Reviewed by Geoff Garen.
881 Add templated copy/move constructors/assignment operators, similar to RefPtr.
884 (WTF::WeakPtrFactory::createWeakPtr const):
885 (WTF::weak_reference_upcast):
886 (WTF::weak_reference_downcast):
887 (WTF::WeakPtr<T>::WeakPtr):
891 2017-10-03 JF Bastien <jfbastien@apple.com>
893 WebAssembly: no VM / JS version of everything but Instance
894 https://bugs.webkit.org/show_bug.cgi?id=177473
896 Reviewed by Filip Pizlo.
898 * wtf/StdLibExtras.h:
899 (WTF::default_construct_at): this makes code in WasmTable much
900 more readable, and is generally useful for generic code
902 2017-10-02 Myles C. Maxfield <mmaxfield@apple.com>
904 Move LineEnding.{h,cpp} from WebCore/platform/text to wtf/text
905 https://bugs.webkit.org/show_bug.cgi?id=176575
907 Reviewed by Alex Christensen.
909 As part of the PAL effort, we're trying to move everything out of WebCore/platform, one-by-one.
910 These LineEnding files belong in WTF.
912 * WTF.xcodeproj/project.pbxproj:
913 * wtf/text/LineEnding.cpp: Renamed from Source/WebCore/platform/text/LineEnding.cpp.
914 (WTF::normalizeLineEndingsToCRLF):
915 * wtf/text/LineEnding.h: Renamed from Source/WebCore/platform/text/LineEnding.h.
917 2017-10-02 Geoffrey Garen <ggaren@apple.com>
919 WeakPtr should have a move constructor
920 https://bugs.webkit.org/show_bug.cgi?id=177789
922 Reviewed by Chris Dumez.
924 * wtf/WeakPtr.h: Now that we just have a RefPtr data member,
925 the default operators are sufficient.
927 2017-10-02 Geoffrey Garen <ggaren@apple.com>
929 NULL WeakPtr should not malloc!
930 https://bugs.webkit.org/show_bug.cgi?id=177773
932 Reviewed by Antti Koivisto.
934 Translating NULL into malloc is... inefficient.
937 (WTF::WeakPtr::WeakPtr):
938 (WTF::WeakPtr::operator=):
939 (WTF::WeakPtr::clear): Make m_ref lazy so that a NULL m_ref can represent
940 a NULL pointer. Normal dereference is no slower because we can rely on
941 the fact that dereference of NULL should crash. operator bool() and get()
942 incur an extra branch. That's probably worth it to avoid malloc
945 2017-10-02 Antti Koivisto <antti@apple.com>
947 Add makeWeakPtr variant that takes pointer
948 https://bugs.webkit.org/show_bug.cgi?id=177767
950 Reviewed by Zalan Bujtas.
955 This version deals with the nullptr.
957 2017-09-30 Antti Koivisto <antti@apple.com>
959 Add makeWeakPtr for easier WeakPtr construction
960 https://bugs.webkit.org/show_bug.cgi?id=177706
962 Reviewed by Sam Weinig.
964 Standalone makeWeakPtr() returns a WeakPtr of the same type as the argument.
966 For this to work the argument type needs to expose a (possibly base type) WeakPtrFactory
967 as a public weakPtrFactory() member function.
970 (WTF::WeakPtr::operator-> const):
971 (WTF::WeakPtr::operator* const): Also add operator*.
974 2017-09-28 Jiewen Tan <jiewen_tan@apple.com>
976 WeakPtrFactory should allow downcasting
977 https://bugs.webkit.org/show_bug.cgi?id=177389
978 <rdar://problem/34604174>
980 Reviewed by Geoffrey Garen.
982 In this patch, WeakPtrFactory is enhanced with the ability to create WeakPtrs
983 of its owner's sub classes and have them point to the same WeakReference.
986 (WTF::WeakPtr::WeakPtr):
987 We cannot determine the base class of type T, thus no friends. It is made public
988 such that WeakPtrFactory with a base class type U can create a derived type T
990 (WTF::WeakPtrFactory::createWeakPtr const):
992 2017-09-28 Don Olmstead <don.olmstead@sony.com>
994 Sync SYSTEM_MALLOC implementation of Gigacage
995 https://bugs.webkit.org/show_bug.cgi?id=177569
997 Reviewed by Mark Lam.
1000 (Gigacage::basePtr):
1001 (Gigacage::basePtrs):
1003 2017-09-27 Per Arne Vollan <pvollan@apple.com>
1005 [Win64] Compile error, 'BasePtrs' is undefined.
1006 https://bugs.webkit.org/show_bug.cgi?id=177565
1008 Reviewed by Mark Lam.
1010 Copy definition of 'BasePtrs' from bmalloc/GigaCage.h.
1014 2017-09-26 Said Abou-Hallawa <sabouhallawa@apple.com>
1016 Followup (r222427): SynchronizedFixedQueue should not have a public constructor
1017 https://bugs.webkit.org/show_bug.cgi?id=177458
1019 Reviewed by Tim Horton.
1021 Since SynchronizedFixedQueue is now derived from ThreadSafeRefCounted<SynchronizedFixedQueue>,
1022 the standard way to have an instance of it is to call SynchronizedFixedQueue::create()
1023 which returns a Ref<SynchronizedFixedQueue>. Now it does not make sense to still
1024 have the constructor public.
1026 * wtf/SynchronizedFixedQueue.h:
1027 (WTF::SynchronizedFixedQueue::SynchronizedFixedQueue):
1029 2017-09-24 Keith Miller <keith_miller@apple.com>
1031 JSC build should use unified sources for derived sources
1032 https://bugs.webkit.org/show_bug.cgi?id=177421
1034 Reviewed by JF Bastien.
1036 The script now needs to determine if a file is from a derived
1037 source. This is only relevant for the CMake build since the
1038 script needs to provide a list of the bundled source files. If the
1039 script does not provide the full path for derived sources then
1040 CMake will be unable to find them and the build will fail.
1042 Additionally, I move the error message for the Xcode build outside
1043 the main loop. This means that the error message will contain all
1044 the files you need to add to Xcode and all those files will now be
1045 written in DerivedSources so they should be easier to add.
1047 * Scripts/generate-unified-source-bundles.rb:
1049 2017-09-26 Zan Dobersek <zdobersek@igalia.com>
1051 Support building JavaScriptCore with the Bionic C library
1052 https://bugs.webkit.org/show_bug.cgi?id=177427
1054 Reviewed by Michael Catanzaro.
1056 * wtf/Platform.h: Define HAVE_MACHINE_CONTEXT when __BIONIC__
1057 is defined, i.e. when building with the Bionic C library.
1059 2017-09-23 Said Abou-Hallawa <sabouhallawa@apple.com>
1061 Images may render partial frames even after loading all the encoded data
1062 https://bugs.webkit.org/show_bug.cgi?id=177406
1064 Reviewed by Simon Fraser.
1066 Make it possible to create a RefPtr<SynchronizedFixedQueue>.
1068 * wtf/SynchronizedFixedQueue.h:
1069 (WTF::SynchronizedFixedQueue::create):
1070 (WTF::SynchronizedFixedQueue::enqueue):
1071 (WTF::SynchronizedFixedQueue::dequeue):
1073 2017-09-22 Zalan Bujtas <zalan@apple.com>
1075 WeakPtrFactory should populate m_ref lazily.
1076 https://bugs.webkit.org/show_bug.cgi?id=177375
1078 Reviewed by Geoffrey Garen.
1080 This helps us with the overhead of initializing WeakPtrFactory for
1081 objects that rarely end up creating the weak reference.
1082 -This is in preparation for introducing WeakPtr to RenderObject.
1084 All credit to Geoffrey Garen.
1087 (WTF::WeakReference::get const):
1088 (WTF::WeakReference::clear):
1089 (WTF::WeakReference::WeakReference):
1090 (WTF::WeakPtrFactory::~WeakPtrFactory):
1091 (WTF::WeakPtrFactory::createWeakPtr const):
1092 (WTF::WeakPtrFactory::revokeAll):
1093 (WTF::WeakPtrFactory::WeakPtrFactory): Deleted.
1095 2017-09-21 Alex Christensen <achristensen@webkit.org>
1097 Make StringBuilder movable
1098 https://bugs.webkit.org/show_bug.cgi?id=177311
1100 Reviewed by Chris Dumez.
1102 * wtf/text/StringBuilder.h:
1103 (WTF::StringBuilder::StringBuilder):
1105 2017-09-20 Keith Miller <keith_miller@apple.com>
1107 JSC should use unified sources for platform specific files.
1108 https://bugs.webkit.org/show_bug.cgi?id=177290
1110 Reviewed by Michael Saboff.
1112 The unified source bundler script can now handle more than one
1113 list of sources. Sources will not be bundled across source file
1114 lists. We want to ensure that changing one platform's sources
1115 doesn't break another platform's build, as much as
1116 possible. Additionally, it means that there won't be weird
1117 performance changes when files are added to an unrelated platform.
1119 Remove stale reference to generate-unified-source-bundles.rb script
1122 * Scripts/generate-unified-source-bundles.rb:
1123 * WTF.xcodeproj/project.pbxproj:
1125 2017-09-20 Stephan Szabo <stephan.szabo@sony.com>
1127 [Win] WTF: Add alias for process id to use in place of direct uses of pid_t
1128 https://bugs.webkit.org/show_bug.cgi?id=177017
1130 Reviewed by Alex Christensen.
1133 (WTF::getCurrentProcessID):
1135 2017-09-20 Keith Miller <keith_miller@apple.com>
1137 JSC Xcode build should use unified sources for platform independent files
1138 https://bugs.webkit.org/show_bug.cgi?id=177190
1140 Reviewed by Saam Barati.
1142 Add a new directory for build scripts that are forwarded to subsequent framework builds.
1144 * Scripts/generate-unified-source-bundles.rb: Renamed from Source/WTF/generate-unified-source-bundles.rb.
1145 * WTF.xcodeproj/project.pbxproj:
1146 * wtf/CMakeLists.txt:
1148 2017-09-20 Per Arne Vollan <pvollan@apple.com>
1150 [Win] Cannot find script to generate unified sources.
1151 https://bugs.webkit.org/show_bug.cgi?id=177014
1153 Reviewed by Keith Miller.
1155 Copy the ruby script to WTF/Scripts in the forwarding headers folder.
1157 * wtf/CMakeLists.txt:
1159 2017-09-20 Alberto Garcia <berto@igalia.com>
1161 Fix HPPA and Alpha builds
1162 https://bugs.webkit.org/show_bug.cgi?id=177224
1164 Reviewed by Alex Christensen.
1168 2017-09-19 Youenn Fablet <youenn@apple.com>
1170 Allow WTF::map to use any class that is iterable and has a size getter
1171 https://bugs.webkit.org/show_bug.cgi?id=177026
1173 Reviewed by Darin Adler.
1175 Computing the Item type given to the lambda using the iterator instead of ValueType which is specific to Vector.
1176 Adding the possibility to pass a non const container reference and a lambda taking non const references as well.
1179 (WTF::MapFunctionInspector::acceptsReference):
1183 2017-09-19 Jer Noble <jer.noble@apple.com>
1185 [Cocoa] Add an ImageDecoder subclass backed by AVFoundation
1186 https://bugs.webkit.org/show_bug.cgi?id=176825
1188 Reviewed by Eric Carlson.
1192 2017-09-18 Andy Estes <aestes@apple.com>
1194 [Cocoa] Upstream sandbox-related WebKitSystemInterface functions
1195 https://bugs.webkit.org/show_bug.cgi?id=177047
1197 Reviewed by Daniel Bates.
1199 * wtf/spi/darwin/SandboxSPI.h:
1201 2017-09-18 Ryan Haddad <ryanhaddad@apple.com>
1203 Unreviewed, rolling out r222170.
1205 The API test added with this change is failing.
1209 "Allow WTF::map to use any class that is iterable and has a
1211 https://bugs.webkit.org/show_bug.cgi?id=177026
1212 http://trac.webkit.org/changeset/222170
1214 2017-09-18 Youenn Fablet <youenn@apple.com>
1216 Allow WTF::map to use any class that is iterable and has a size getter
1217 https://bugs.webkit.org/show_bug.cgi?id=177026
1219 Reviewed by Darin Adler.
1221 Computing the Item type given to the lambda using the iterator instead of ValueType which is specific to Vector.
1222 Adding the possibility to pass a non const container reference and a lambda taking non const references as well.
1225 (WTF::MapFunctionInspector::acceptsReference):
1229 2017-09-15 JF Bastien <jfbastien@apple.com>
1231 WTF: use Forward.h when appropriate instead of Vector.h
1232 https://bugs.webkit.org/show_bug.cgi?id=176984
1234 Reviewed by Saam Barati.
1236 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.
1240 * wtf/text/StringVector.h:
1242 2017-09-15 Keith Miller <keith_miller@apple.com>
1244 generate-unified-source-bundles.rb shouldn't write a file that isn't going to change
1245 https://bugs.webkit.org/show_bug.cgi?id=177021
1247 Reviewed by Tim Horton.
1249 * generate-unified-source-bundles.rb:
1251 2017-09-14 Saam Barati <sbarati@apple.com>
1253 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
1254 https://bugs.webkit.org/show_bug.cgi?id=176863
1256 Reviewed by Keith Miller.
1258 This patch adds a way for a particular function to mark
1259 that none of its calls should be tail calls.
1261 It's useful in the following example if you don't want foo
1262 to do a tail call to bar or baz:
1272 Note that we're not saying that bar/baz should not be tail callable. bar/baz
1273 may have other callers that are allowed to tail call it. This macro just says
1274 that foo itself will not perform any tail calls.
1276 * WTF.xcodeproj/project.pbxproj:
1277 * wtf/NoTailCalls.h: Added.
1278 (WTF::NoTailCalls::~NoTailCalls):
1280 2017-09-14 Mark Lam <mark.lam@apple.com>
1282 AddressSanitizer: stack-buffer-underflow in JSC::Probe::Page::Page
1283 https://bugs.webkit.org/show_bug.cgi?id=176874
1284 <rdar://problem/34436415>
1286 Reviewed by Saam Barati.
1288 Added a convenience version of roundUpToMultipleOf() so that it can be applied to
1289 pointers without the client having to cast explicitly.
1291 * wtf/StdLibExtras.h:
1292 (WTF::roundUpToMultipleOf):
1294 2017-09-14 Youenn Fablet <youenn@apple.com>
1296 Allow WTF::map to take function as parameter
1297 https://bugs.webkit.org/show_bug.cgi?id=176909
1299 Reviewed by Jer Noble.
1304 2017-09-13 Youenn Fablet <youenn@apple.com>
1306 Add a lambda-based map for Vectors
1307 https://bugs.webkit.org/show_bug.cgi?id=176487
1309 Reviewed by Darin Adler.
1311 This helper routine allows refactoring the reserveInitialCapacity/uncheckedAppend pattern, the mapper between source and destination item being a lambda.
1314 (WTF::Mapper::transform):
1318 2017-09-12 Yusuke Suzuki <utatane.tea@gmail.com>
1320 [DFG] Optimize WeakMap::get by adding intrinsic and fixup
1321 https://bugs.webkit.org/show_bug.cgi?id=176010
1323 Reviewed by Filip Pizlo.
1325 Add inlineGet method with HashTranslator.
1328 (WTF::X>::inlineGet const):
1329 (WTF::MappedTraits>::inlineGet const):
1330 (WTF::MappedTraits>::fastGet const): Deleted.
1331 * wtf/LoggingHashMap.h:
1333 2017-09-12 Keith Miller <keith_miller@apple.com>
1335 Do unified source builds for JSC
1336 https://bugs.webkit.org/show_bug.cgi?id=176076
1338 Reviewed by Geoffrey Garen.
1340 This patch adds a script that will automatically bundle source
1341 files, which is currently only used by the CMake build. It's
1342 important that we use the same script to generate the bundles
1343 for the CMake build as the Xcode build. If we didn't do this then
1344 it's likely that there would be build errors that occur in only
1345 one build system. On the same note, we also need to be careful to
1346 not bundle platform specific source files with platform
1347 independent ones. There are a couple of things the script does not
1348 currently handle but are not essential for the CMake build. First,
1349 it does not handle the max bundle size restrictions that the Xcode
1350 build will require. It also does not handle C files.
1352 The unified source generator script works by collecting groups of
1353 up to 8 files from the same directory. We don't bundle files from
1354 across directories since I didn't see a speedup from doing
1355 so. Additionally, splitting at the directory boundary means that
1356 it is less likely that adding a new file will force a "clean"
1357 build. This would happen because the new file will shift every
1358 subsequent file into the next unified source bundle.
1360 Using unified sources appears to be a roughly 3.5x build time
1361 speed up for clean builds on my MBP and appears to have a
1362 negligible effect in incremental builds.
1364 * generate-unified-source-bundles.rb: Added.
1367 2017-09-12 Joseph Pecoraro <pecoraro@apple.com>
1369 QualifiedName::init should assume AtomicStrings::init was already called
1370 https://bugs.webkit.org/show_bug.cgi?id=176639
1372 Reviewed by Sam Weinig.
1374 * wtf/NeverDestroyed.h:
1375 (WTF::LazyNeverDestroyed::isConstructed const):
1377 2017-09-12 Brent Fulgham <bfulgham@apple.com>
1379 Show punycode to user if a URL mixes Armenian Seh or Vo with other scripts
1380 https://bugs.webkit.org/show_bug.cgi?id=176578
1381 <rdar://problem/33906231>
1383 Reviewed by Alex Christensen.
1386 (WTF::isASCIIDigitOrPunctuation): Added helper function to recognize ASCII digits
1387 and punctuation characters.
1389 2017-09-12 Sam Weinig <sam@webkit.org>
1391 [Cleanup] Follow up cleanup for DOMFormData implementation
1392 https://bugs.webkit.org/show_bug.cgi?id=176740
1394 Reviewed by Alex Christensen.
1396 * WTF.xcodeproj/project.pbxproj:
1398 (WTF::KeyValuePair::KeyValuePair): Deleted.
1399 * wtf/KeyValuePair.h: Added.
1400 (WTF::KeyValuePair::KeyValuePair):
1401 (WTF::makeKeyValuePair):
1403 Move KeyValuePair to its own header and add a makeKeyValuePair helper.
1405 2017-09-11 Ryan Haddad <ryanhaddad@apple.com>
1407 Unreviewed, rolling out r221854.
1409 The test added with this change fails on 32-bit JSC bots.
1413 "[DFG] Optimize WeakMap::get by adding intrinsic and fixup"
1414 https://bugs.webkit.org/show_bug.cgi?id=176010
1415 http://trac.webkit.org/changeset/221854
1417 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com>
1419 [DFG] Optimize WeakMap::get by adding intrinsic and fixup
1420 https://bugs.webkit.org/show_bug.cgi?id=176010
1422 Reviewed by Filip Pizlo.
1424 Add inlineGet method with HashTranslator.
1427 (WTF::X>::inlineGet const):
1428 (WTF::MappedTraits>::inlineGet const):
1429 (WTF::MappedTraits>::fastGet const): Deleted.
1430 * wtf/LoggingHashMap.h:
1432 2017-09-07 Myles C. Maxfield <mmaxfield@apple.com>
1434 [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
1435 https://bugs.webkit.org/show_bug.cgi?id=176561
1437 Reviewed by Brent Fulgham.
1439 WebCore/platform/Language was the only* user of PlatformUserPreferredLanguages (with 1 exception).
1440 That exception is that JavaScriptCore needed the functionality of WebCore/platform/Language, but it
1441 couldn't get it because of the layering violation, so instead it erroneously called into
1442 PlatformUserPreferredLanguages instead. This patch merges these two files into WTF so JSC gets the
1443 right function and the PAL effort has one less file to move from WebCore/platform into PAL.
1445 * WTF.xcodeproj/project.pbxproj:
1446 * wtf/CMakeLists.txt:
1447 * wtf/Language.cpp: Renamed from Source/WebCore/platform/Language.cpp.
1448 (WTF::addLanguageChangeObserver):
1449 (WTF::userPreferredLanguages):
1450 * wtf/Language.h: Renamed from Source/WebCore/platform/Language.h.
1451 * wtf/PlatformGTK.cmake:
1452 * wtf/PlatformJSCOnly.cmake:
1453 * wtf/PlatformMac.cmake:
1454 * wtf/PlatformUserPreferredLanguages.h: Removed.
1455 * wtf/PlatformWPE.cmake:
1456 * wtf/PlatformWin.cmake:
1457 * wtf/cf/LanguageCF.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm.
1458 (WTF::httpStyleLanguageCode):
1459 (WTF::languagePreferencesDidChange):
1460 (WTF::platformUserPreferredLanguages):
1461 * wtf/unix/LanguageUnix.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesUnix.cpp.
1462 * wtf/win/LanguageWin.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesWin.cpp.
1464 2017-09-06 Eric Carlson <eric.carlson@apple.com>
1466 Require LoggingHelper overrides to provide identifier
1467 https://bugs.webkit.org/show_bug.cgi?id=176477
1469 Reviewed by Jer Noble.
1471 * wtf/Assertions.cpp: No more WTFLogLevelNotice.
1472 * wtf/Assertions.h: Ditto.
1474 2017-09-06 Per Arne Vollan <pvollan@apple.com>
1476 [Win] WebCore failed to build, InbandTextTrackPrivateAVF: base class undefined.
1477 https://bugs.webkit.org/show_bug.cgi?id=176431
1479 Reviewed by Alex Christensen.
1481 AVFoundation header detection should be done in WebCore because of build dependencies.
1483 * AVFoundationSupport.py: Removed.
1485 * wtf/PlatformWin.cmake:
1487 2017-09-05 Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com>
1489 [Win] Fix the wincairo build after r221558 and r221583
1490 https://bugs.webkit.org/show_bug.cgi?id=176353
1492 Reviewed by Yusuke Suzuki.
1494 * wtf/Assertions.cpp:
1496 2017-09-04 Eric Carlson <eric.carlson@apple.com>
1498 Switch HTMLMediaElement to release logging
1499 https://bugs.webkit.org/show_bug.cgi?id=176065
1501 Reviewed by Jer Noble.
1503 * wtf/MediaTime.cpp:
1504 (WTF::MediaTime::dump const): Use toString.
1505 (WTF::MediaTime::toString const): New.
1507 2017-09-04 Yusuke Suzuki <utatane.tea@gmail.com>
1509 Remove OS(SOLARIS) support
1510 https://bugs.webkit.org/show_bug.cgi?id=176341
1512 Reviewed by Sam Weinig.
1514 WebKit project does not have stake holders supporting Solaris right now.
1515 And Solaris + SPARC in 64bit environment does not work well since its
1516 address space includes non-48bit area. It breaks our JSVALUE64 in JSC.
1517 In addition, Solaris a bit complicates our threading implementation
1518 because of its special threading stack.
1520 This patch removes OS(SOLARIS) and COMPILER(SUNCC) support from WebKit.
1525 (std::isfinite): Deleted.
1526 (std::signbit): Deleted.
1527 (std::isinf): Deleted.
1528 * wtf/NumberOfCores.cpp:
1529 (WTF::numberOfProcessorCores):
1531 * wtf/StackBounds.cpp:
1532 * wtf/ThreadingPthreads.cpp:
1534 2017-09-04 Commit Queue <commit-queue@webkit.org>
1536 Unreviewed, rolling out r221494 and r221500.
1537 https://bugs.webkit.org/show_bug.cgi?id=176258
1539 This caused the windows build to fail. (Requested by mlewis13
1542 Reverted changesets:
1544 "Switch HTMLMediaElement to release logging"
1545 https://bugs.webkit.org/show_bug.cgi?id=176065
1546 http://trac.webkit.org/changeset/221494
1548 "Switch HTMLMediaElement to release logging"
1549 https://bugs.webkit.org/show_bug.cgi?id=176065
1550 http://trac.webkit.org/changeset/221500
1552 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com>
1554 Remove "malloc" and "free" use
1555 https://bugs.webkit.org/show_bug.cgi?id=176310
1557 Reviewed by Darin Adler.
1561 * wtf/Assertions.cpp:
1563 2017-09-04 Yusuke Suzuki <utatane.tea@gmail.com>
1565 Unreviewed, support libstdc++ use with clang
1566 https://bugs.webkit.org/show_bug.cgi?id=176301
1570 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com>
1572 [WTF] Add C++03 allocator interface for GCC < 6
1573 https://bugs.webkit.org/show_bug.cgi?id=176301
1575 Reviewed by Darin Adler.
1577 Unfortunately, std::list in GCC < 6 does not support C++11 allocator interface.
1578 This patch adds C++03 allocator interface to FastAllocator to make it usable
1579 for std::list. It also allows us to use FastAllocator for data structures that
1580 only support C++03 interface.
1583 (WTF::FastAllocator::allocate):
1584 (WTF::FastAllocator::construct):
1585 (WTF::FastAllocator::destroy):
1586 (WTF::FastAllocator::max_size const):
1587 (WTF::FastAllocator::select_on_container_copy_construction const):
1589 2017-09-03 Chris Dumez <cdumez@apple.com>
1591 Unreviewed, rolling out r221552.
1597 "[WTF] Add C++03 allocator interface for GCC < 6"
1598 https://bugs.webkit.org/show_bug.cgi?id=176301
1599 http://trac.webkit.org/changeset/221552
1601 2017-09-03 Yusuke Suzuki <utatane.tea@gmail.com>
1603 [WTF] Add C++03 allocator interface for GCC < 6
1604 https://bugs.webkit.org/show_bug.cgi?id=176301
1606 Reviewed by Darin Adler.
1608 Unfortunately, std::list in GCC < 6 does not support C++11 allocator interface.
1609 This patch adds C++03 allocator interface to FastAllocator to make it usable
1610 for std::list. It also allows us to use FastAllocator for data structures that
1611 only support C++03 interface.
1614 (WTF::FastAllocator::allocate):
1615 (WTF::FastAllocator::construct):
1616 (WTF::FastAllocator::destroy):
1617 (WTF::FastAllocator::max_size const):
1618 (WTF::FastAllocator::select_on_container_copy_construction const):
1620 2017-09-03 Sam Weinig <sam@webkit.org>
1623 https://bugs.webkit.org/show_bug.cgi?id=176288
1625 Reviewed by Yusuke Suzuki.
1627 CanvasProxy does not appear to be in any current HTML spec
1628 and was disabled and unimplemented in our tree. Time to
1631 * wtf/FeatureDefines.h:
1633 2017-09-01 Eric Carlson <eric.carlson@apple.com>
1635 Switch HTMLMediaElement to release logging
1636 https://bugs.webkit.org/show_bug.cgi?id=176065
1638 Reviewed by Jer Noble.
1640 * wtf/MediaTime.cpp:
1641 (WTF::MediaTime::dump const): Use toString.
1642 (WTF::MediaTime::toString const): New.
1644 (PAL::LogArgument<WTF::MediaTime>::toString): Logger template.
1646 2017-08-31 Don Olmstead <don.olmstead@sony.com>
1648 [CMake] Make USE_CF conditional within Windows
1649 https://bugs.webkit.org/show_bug.cgi?id=176173
1651 Reviewed by Alex Christensen.
1654 * wtf/PlatformWin.cmake:
1656 2017-08-31 Ryan Haddad <ryanhaddad@apple.com>
1658 Unreviewed, rolling out r221445.
1660 This change broke Sierra Release builds.
1664 "Switch HTMLMediaElement to release logging"
1665 https://bugs.webkit.org/show_bug.cgi?id=176065
1666 http://trac.webkit.org/changeset/221445
1668 2017-08-31 Eric Carlson <eric.carlson@apple.com>
1670 Switch HTMLMediaElement to release logging
1671 https://bugs.webkit.org/show_bug.cgi?id=176065
1673 Reviewed by Jer Noble.
1675 * wtf/MediaTime.cpp:
1676 (WTF::MediaTime::dump const): Use toString.
1677 (WTF::MediaTime::toString const): New.
1679 (PAL::LogArgument<WTF::MediaTime>::toString): Logger template.
1681 2017-08-31 Filip Pizlo <fpizlo@apple.com>
1683 All of the different ArrayBuffer::data's should be CagedPtr<>
1684 https://bugs.webkit.org/show_bug.cgi?id=175515
1686 Reviewed by Michael Saboff.
1688 Added a specialization so that CagedPtr<void> is valid.
1692 2017-08-31 Per Arne Vollan <pvollan@apple.com>
1694 [Win] Crash under WorkQueue::performWorkOnRegisteredWorkThread in layout tests.
1695 https://bugs.webkit.org/show_bug.cgi?id=176163
1697 Reviewed by Alex Christensen.
1699 My previous attempt at fixing this crash in <http://trac.webkit.org/changeset/221323>
1700 was incorrect, since it is still crashing on the bot(s). The current theory of why this
1701 is failing is that the WorkQueue object deletes itself in the middle of the
1702 performWorkOnRegisteredWorkThread method when calling deref(). There is no need to
1703 increase the reference count of the work queue for each function we want to call on the
1704 work thread. It is sufficient to increase it for every work thread we start, and then
1705 dereference it when the thread ends. We should also not attempt to access members after
1706 the deref() call, which can potentially be unsafe.
1708 * wtf/win/WorkQueueWin.cpp:
1709 (WTF::WorkQueue::workThreadCallback):
1710 (WTF::WorkQueue::performWorkOnRegisteredWorkThread):
1711 (WTF::WorkQueue::dispatch):
1713 2017-08-22 Filip Pizlo <fpizlo@apple.com>
1715 Strings need to be in some kind of gigacage
1716 https://bugs.webkit.org/show_bug.cgi?id=174924
1718 Reviewed by Oliver Hunt.
1720 This makes all strings allocations come from the string gigacage. Because we expect string allocation
1721 to be a hot path, I created specialized allocation paths for the string gigacage. These paths are
1722 accessible via <wtf/text/StringMalloc.h>. However, those paths are equivalent to saying
1723 Gigacage::malloc and friends with the Gigacage::String kind.
1725 * WTF.xcodeproj/project.pbxproj:
1726 * wtf/CMakeLists.txt:
1728 * wtf/FastMalloc.cpp:
1731 (WTF::FastMalloc::malloc):
1732 (WTF::FastMalloc::tryMalloc):
1733 (WTF::FastMalloc::realloc):
1734 (WTF::FastMalloc::free):
1737 (Gigacage::tryMalloc):
1741 (WTF::VectorBufferBase::allocateBuffer):
1742 (WTF::VectorBufferBase::tryAllocateBuffer):
1743 (WTF::VectorBufferBase::reallocateBuffer):
1744 (WTF::VectorBufferBase::deallocateBuffer):
1745 (WTF::Malloc>::Vector):
1747 (WTF::Malloc>::contains const):
1748 (WTF::Malloc>::findMatching const):
1749 (WTF::Malloc>::find const):
1750 (WTF::Malloc>::reverseFind const):
1751 (WTF::Malloc>::appendIfNotContains):
1752 (WTF::Malloc>::fill):
1753 (WTF::Malloc>::appendRange):
1754 (WTF::Malloc>::expandCapacity):
1755 (WTF::Malloc>::tryExpandCapacity):
1756 (WTF::Malloc>::resize):
1757 (WTF::Malloc>::resizeToFit):
1758 (WTF::Malloc>::shrink):
1759 (WTF::Malloc>::grow):
1760 (WTF::Malloc>::asanSetInitialBufferSizeTo):
1761 (WTF::Malloc>::asanSetBufferSizeToFullCapacity):
1762 (WTF::Malloc>::asanBufferSizeWillChangeTo):
1763 (WTF::Malloc>::reserveCapacity):
1764 (WTF::Malloc>::tryReserveCapacity):
1765 (WTF::Malloc>::reserveInitialCapacity):
1766 (WTF::Malloc>::shrinkCapacity):
1767 (WTF::Malloc>::append):
1768 (WTF::Malloc>::tryAppend):
1769 (WTF::Malloc>::constructAndAppend):
1770 (WTF::Malloc>::tryConstructAndAppend):
1771 (WTF::Malloc>::appendSlowCase):
1772 (WTF::Malloc>::constructAndAppendSlowCase):
1773 (WTF::Malloc>::tryConstructAndAppendSlowCase):
1774 (WTF::Malloc>::uncheckedAppend):
1775 (WTF::Malloc>::appendVector):
1776 (WTF::Malloc>::insert):
1777 (WTF::Malloc>::insertVector):
1778 (WTF::Malloc>::remove):
1779 (WTF::Malloc>::removeFirst):
1780 (WTF::Malloc>::removeFirstMatching):
1781 (WTF::Malloc>::removeAll):
1782 (WTF::Malloc>::removeAllMatching):
1783 (WTF::Malloc>::reverse):
1784 (WTF::Malloc>::map const):
1785 (WTF::Malloc>::releaseBuffer):
1786 (WTF::Malloc>::checkConsistency):
1790 (WTF::removeRepeatedElements):
1791 (WTF::minCapacity>::Vector): Deleted.
1792 (WTF::minCapacity>::contains const): Deleted.
1793 (WTF::minCapacity>::findMatching const): Deleted.
1794 (WTF::minCapacity>::find const): Deleted.
1795 (WTF::minCapacity>::reverseFind const): Deleted.
1796 (WTF::minCapacity>::appendIfNotContains): Deleted.
1797 (WTF::minCapacity>::fill): Deleted.
1798 (WTF::minCapacity>::appendRange): Deleted.
1799 (WTF::minCapacity>::expandCapacity): Deleted.
1800 (WTF::minCapacity>::tryExpandCapacity): Deleted.
1801 (WTF::minCapacity>::resize): Deleted.
1802 (WTF::minCapacity>::resizeToFit): Deleted.
1803 (WTF::minCapacity>::shrink): Deleted.
1804 (WTF::minCapacity>::grow): Deleted.
1805 (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted.
1806 (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted.
1807 (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted.
1808 (WTF::minCapacity>::reserveCapacity): Deleted.
1809 (WTF::minCapacity>::tryReserveCapacity): Deleted.
1810 (WTF::minCapacity>::reserveInitialCapacity): Deleted.
1811 (WTF::minCapacity>::shrinkCapacity): Deleted.
1812 (WTF::minCapacity>::append): Deleted.
1813 (WTF::minCapacity>::tryAppend): Deleted.
1814 (WTF::minCapacity>::constructAndAppend): Deleted.
1815 (WTF::minCapacity>::tryConstructAndAppend): Deleted.
1816 (WTF::minCapacity>::appendSlowCase): Deleted.
1817 (WTF::minCapacity>::constructAndAppendSlowCase): Deleted.
1818 (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted.
1819 (WTF::minCapacity>::uncheckedAppend): Deleted.
1820 (WTF::minCapacity>::appendVector): Deleted.
1821 (WTF::minCapacity>::insert): Deleted.
1822 (WTF::minCapacity>::insertVector): Deleted.
1823 (WTF::minCapacity>::remove): Deleted.
1824 (WTF::minCapacity>::removeFirst): Deleted.
1825 (WTF::minCapacity>::removeFirstMatching): Deleted.
1826 (WTF::minCapacity>::removeAll): Deleted.
1827 (WTF::minCapacity>::removeAllMatching): Deleted.
1828 (WTF::minCapacity>::reverse): Deleted.
1829 (WTF::minCapacity>::map const): Deleted.
1830 (WTF::minCapacity>::releaseBuffer): Deleted.
1831 (WTF::minCapacity>::checkConsistency): Deleted.
1832 * wtf/text/AtomicStringImpl.h:
1833 * wtf/text/CString.cpp:
1834 (WTF::CStringBuffer::createUninitialized):
1835 * wtf/text/CString.h:
1836 * wtf/text/StringBuffer.h:
1837 (WTF::StringBuffer::StringBuffer):
1838 (WTF::StringBuffer::~StringBuffer):
1839 (WTF::StringBuffer::resize):
1840 * wtf/text/StringImpl.cpp:
1841 (WTF::StringImpl::~StringImpl):
1842 (WTF::StringImpl::destroy):
1843 (WTF::StringImpl::createUninitializedInternalNonEmpty):
1844 (WTF::StringImpl::reallocateInternal):
1845 (WTF::StringImpl::releaseAssertCaged const):
1846 * wtf/text/StringImpl.h:
1847 (WTF::StringImpl::createSubstringSharingImpl):
1848 (WTF::StringImpl::tryCreateUninitialized):
1849 (WTF::StringImpl::adopt):
1850 (WTF::StringImpl::bufferOwnership const):
1851 (WTF::StringImpl::assertCaged const):
1852 * wtf/text/StringMalloc.cpp: Added.
1853 (WTF::tryStringMalloc):
1854 (WTF::stringMalloc):
1855 (WTF::stringRealloc):
1857 * wtf/text/StringMalloc.h: Added.
1858 (WTF::StringMalloc::malloc):
1859 (WTF::StringMalloc::tryMalloc):
1860 (WTF::StringMalloc::realloc):
1861 (WTF::StringMalloc::free):
1862 * wtf/text/StringVector.h: Added.
1863 * wtf/text/SymbolImpl.h:
1864 * wtf/text/UniquedStringImpl.h:
1865 * wtf/text/WTFString.h:
1866 (WTF::String::adopt):
1867 (WTF::String::assertCaged const):
1868 (WTF::String::releaseAssertCaged const):
1870 2017-08-30 Chris Dumez <cdumez@apple.com>
1872 Implement FileSystemDirectoryReader.readEntries()
1873 https://bugs.webkit.org/show_bug.cgi?id=176091
1874 <rdar://problem/34168015>
1876 Reviewed by Andreas Kling.
1878 * wtf/CrossThreadCopier.h:
1879 (WTF::crossThreadCopy):
1880 * wtf/CrossThreadTask.h:
1881 Move crossThreadCopy() from CrossThreadTask.h to CrossThreadCopier.h and
1882 add "using WTF::crossThreadCopy" statement to make it more easily usable
1885 2017-08-30 Matt Lewis <jlewis3@apple.com>
1887 Unreviewed, rolling out r221384.
1889 This patch caused multiple 32-bit JSC test failures.
1893 "Strings need to be in some kind of gigacage"
1894 https://bugs.webkit.org/show_bug.cgi?id=174924
1895 http://trac.webkit.org/changeset/221384
1897 2017-08-30 Brady Eidson <beidson@apple.com>
1899 Add "Identified" base class to replace a whole bunch of custom identifier generators.
1900 https://bugs.webkit.org/show_bug.cgi?id=176120
1902 Reviewed by Alex Christensen.
1904 * WTF.xcodeproj/project.pbxproj:
1905 * wtf/Identified.h: Added.
1906 (WTF::IdentifiedBase::identifier const):
1907 (WTF::IdentifiedBase::IdentifiedBase):
1908 (WTF::Identified::Identified):
1909 (WTF::ThreadSafeIdentified::ThreadSafeIdentified):
1911 2017-08-22 Filip Pizlo <fpizlo@apple.com>
1913 Strings need to be in some kind of gigacage
1914 https://bugs.webkit.org/show_bug.cgi?id=174924
1916 Reviewed by Oliver Hunt.
1918 This makes all strings allocations come from the string gigacage. Because we expect string allocation
1919 to be a hot path, I created specialized allocation paths for the string gigacage. These paths are
1920 accessible via <wtf/text/StringMalloc.h>. However, those paths are equivalent to saying
1921 Gigacage::malloc and friends with the Gigacage::String kind.
1923 * WTF.xcodeproj/project.pbxproj:
1924 * wtf/CMakeLists.txt:
1926 * wtf/FastMalloc.cpp:
1929 (WTF::FastMalloc::malloc):
1930 (WTF::FastMalloc::tryMalloc):
1931 (WTF::FastMalloc::realloc):
1932 (WTF::FastMalloc::free):
1935 (Gigacage::tryMalloc):
1939 (WTF::VectorBufferBase::allocateBuffer):
1940 (WTF::VectorBufferBase::tryAllocateBuffer):
1941 (WTF::VectorBufferBase::reallocateBuffer):
1942 (WTF::VectorBufferBase::deallocateBuffer):
1943 (WTF::Malloc>::Vector):
1945 (WTF::Malloc>::contains const):
1946 (WTF::Malloc>::findMatching const):
1947 (WTF::Malloc>::find const):
1948 (WTF::Malloc>::reverseFind const):
1949 (WTF::Malloc>::appendIfNotContains):
1950 (WTF::Malloc>::fill):
1951 (WTF::Malloc>::appendRange):
1952 (WTF::Malloc>::expandCapacity):
1953 (WTF::Malloc>::tryExpandCapacity):
1954 (WTF::Malloc>::resize):
1955 (WTF::Malloc>::resizeToFit):
1956 (WTF::Malloc>::shrink):
1957 (WTF::Malloc>::grow):
1958 (WTF::Malloc>::asanSetInitialBufferSizeTo):
1959 (WTF::Malloc>::asanSetBufferSizeToFullCapacity):
1960 (WTF::Malloc>::asanBufferSizeWillChangeTo):
1961 (WTF::Malloc>::reserveCapacity):
1962 (WTF::Malloc>::tryReserveCapacity):
1963 (WTF::Malloc>::reserveInitialCapacity):
1964 (WTF::Malloc>::shrinkCapacity):
1965 (WTF::Malloc>::append):
1966 (WTF::Malloc>::tryAppend):
1967 (WTF::Malloc>::constructAndAppend):
1968 (WTF::Malloc>::tryConstructAndAppend):
1969 (WTF::Malloc>::appendSlowCase):
1970 (WTF::Malloc>::constructAndAppendSlowCase):
1971 (WTF::Malloc>::tryConstructAndAppendSlowCase):
1972 (WTF::Malloc>::uncheckedAppend):
1973 (WTF::Malloc>::appendVector):
1974 (WTF::Malloc>::insert):
1975 (WTF::Malloc>::insertVector):
1976 (WTF::Malloc>::remove):
1977 (WTF::Malloc>::removeFirst):
1978 (WTF::Malloc>::removeFirstMatching):
1979 (WTF::Malloc>::removeAll):
1980 (WTF::Malloc>::removeAllMatching):
1981 (WTF::Malloc>::reverse):
1982 (WTF::Malloc>::map const):
1983 (WTF::Malloc>::releaseBuffer):
1984 (WTF::Malloc>::checkConsistency):
1988 (WTF::removeRepeatedElements):
1989 (WTF::minCapacity>::Vector): Deleted.
1990 (WTF::minCapacity>::contains const): Deleted.
1991 (WTF::minCapacity>::findMatching const): Deleted.
1992 (WTF::minCapacity>::find const): Deleted.
1993 (WTF::minCapacity>::reverseFind const): Deleted.
1994 (WTF::minCapacity>::appendIfNotContains): Deleted.
1995 (WTF::minCapacity>::fill): Deleted.
1996 (WTF::minCapacity>::appendRange): Deleted.
1997 (WTF::minCapacity>::expandCapacity): Deleted.
1998 (WTF::minCapacity>::tryExpandCapacity): Deleted.
1999 (WTF::minCapacity>::resize): Deleted.
2000 (WTF::minCapacity>::resizeToFit): Deleted.
2001 (WTF::minCapacity>::shrink): Deleted.
2002 (WTF::minCapacity>::grow): Deleted.
2003 (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted.
2004 (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted.
2005 (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted.
2006 (WTF::minCapacity>::reserveCapacity): Deleted.
2007 (WTF::minCapacity>::tryReserveCapacity): Deleted.
2008 (WTF::minCapacity>::reserveInitialCapacity): Deleted.
2009 (WTF::minCapacity>::shrinkCapacity): Deleted.
2010 (WTF::minCapacity>::append): Deleted.
2011 (WTF::minCapacity>::tryAppend): Deleted.
2012 (WTF::minCapacity>::constructAndAppend): Deleted.
2013 (WTF::minCapacity>::tryConstructAndAppend): Deleted.
2014 (WTF::minCapacity>::appendSlowCase): Deleted.
2015 (WTF::minCapacity>::constructAndAppendSlowCase): Deleted.
2016 (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted.
2017 (WTF::minCapacity>::uncheckedAppend): Deleted.
2018 (WTF::minCapacity>::appendVector): Deleted.
2019 (WTF::minCapacity>::insert): Deleted.
2020 (WTF::minCapacity>::insertVector): Deleted.
2021 (WTF::minCapacity>::remove): Deleted.
2022 (WTF::minCapacity>::removeFirst): Deleted.
2023 (WTF::minCapacity>::removeFirstMatching): Deleted.
2024 (WTF::minCapacity>::removeAll): Deleted.
2025 (WTF::minCapacity>::removeAllMatching): Deleted.
2026 (WTF::minCapacity>::reverse): Deleted.
2027 (WTF::minCapacity>::map const): Deleted.
2028 (WTF::minCapacity>::releaseBuffer): Deleted.
2029 (WTF::minCapacity>::checkConsistency): Deleted.
2030 * wtf/text/AtomicStringImpl.h:
2031 * wtf/text/CString.cpp:
2032 (WTF::CStringBuffer::createUninitialized):
2033 * wtf/text/CString.h:
2034 * wtf/text/StringBuffer.h:
2035 (WTF::StringBuffer::StringBuffer):
2036 (WTF::StringBuffer::~StringBuffer):
2037 (WTF::StringBuffer::resize):
2038 * wtf/text/StringImpl.cpp:
2039 (WTF::StringImpl::~StringImpl):
2040 (WTF::StringImpl::destroy):
2041 (WTF::StringImpl::createUninitializedInternalNonEmpty):
2042 (WTF::StringImpl::reallocateInternal):
2043 (WTF::StringImpl::releaseAssertCaged const):
2044 * wtf/text/StringImpl.h:
2045 (WTF::StringImpl::createSubstringSharingImpl):
2046 (WTF::StringImpl::tryCreateUninitialized):
2047 (WTF::StringImpl::adopt):
2048 (WTF::StringImpl::bufferOwnership const):
2049 (WTF::StringImpl::assertCaged const):
2050 * wtf/text/StringMalloc.cpp: Added.
2051 (WTF::tryStringMalloc):
2052 (WTF::stringMalloc):
2053 (WTF::stringRealloc):
2055 * wtf/text/StringMalloc.h: Added.
2056 (WTF::StringMalloc::malloc):
2057 (WTF::StringMalloc::tryMalloc):
2058 (WTF::StringMalloc::realloc):
2059 (WTF::StringMalloc::free):
2060 * wtf/text/StringVector.h: Added.
2061 * wtf/text/SymbolImpl.h:
2062 * wtf/text/UniquedStringImpl.h:
2063 * wtf/text/WTFString.h:
2064 (WTF::String::adopt):
2065 (WTF::String::assertCaged const):
2066 (WTF::String::releaseAssertCaged const):
2068 2017-08-28 Yusuke Suzuki <utatane.tea@gmail.com>
2070 [JSC] Use table based approach for JSON.stringify's Quote
2071 https://bugs.webkit.org/show_bug.cgi?id=176044
2073 Reviewed by Darin Adler.
2075 We change escape operation of JSON Quote from branch-based to table-based.
2076 This patch partially adopts SpiderMonkey's change to StringBuilderJSON.cpp
2077 to optimize this escaping operation. We separate changes from StringBuilder.cpp
2078 to apply MPL to StringBuilderJSON.cpp file. Since WebKit already adopts MPL in
2079 some files (like, DateMath.h), it is acceptable.
2081 Kraken json-stringify-tinderbox shows 7.2% improvement.
2085 json-stringify-tinderbox 40.429+-0.771 ^ 37.693+-0.862 ^ definitely 1.0726x faster
2087 * WTF.xcodeproj/project.pbxproj:
2088 * wtf/CMakeLists.txt:
2089 * wtf/text/StringBuilder.cpp:
2090 (WTF::appendQuotedJSONStringInternalSlow): Deleted.
2091 (WTF::appendQuotedJSONStringInternal): Deleted.
2092 (WTF::StringBuilder::appendQuotedJSONString): Deleted.
2093 * wtf/text/StringBuilderJSON.cpp: Added.
2094 (WTF::appendQuotedJSONStringInternal):
2095 (WTF::StringBuilder::appendQuotedJSONString):
2097 2017-08-29 Per Arne Vollan <pvollan@apple.com>
2099 [Win] Crash under WorkQueue::performWorkOnRegisteredWorkThread in layout tests.
2100 https://bugs.webkit.org/show_bug.cgi?id=176064
2102 Reviewed by Saam Barati.
2104 The crash log indicates that the function pointer is null in this case.
2106 * wtf/win/WorkQueueWin.cpp:
2107 (WTF::WorkQueue::dispatch):
2109 2017-08-28 Andy Estes <aestes@apple.com>
2111 [Cocoa] Upstream WKGetWebDefaultCFStringEncoding()
2112 https://bugs.webkit.org/show_bug.cgi?id=176039
2114 Reviewed by Alex Christensen.
2116 * wtf/spi/cf/CFStringSPI.h:
2118 2017-08-26 Yusuke Suzuki <utatane.tea@gmail.com>
2120 Unreviewed, suppress warnings in GTK port
2122 Add printf format attribute.
2124 * wtf/text/WTFString.cpp:
2126 2017-08-25 Eric Carlson <eric.carlson@apple.com>
2128 Add Logger::logAlways
2129 https://bugs.webkit.org/show_bug.cgi?id=175996
2131 Reviewed by Jer Noble.
2133 * wtf/Assertions.cpp:
2136 2017-08-25 Daniel Bates <dabates@apple.com>
2138 Demarcate code added due to lack of NSDMI for aggregates
2139 https://bugs.webkit.org/show_bug.cgi?id=175990
2141 Reviewed by Andy Estes.
2145 2017-08-25 Don Olmstead <don.olmstead@sony.com>
2147 Define *_GIGACAGE_MASK when Gigacage is not supported
2148 https://bugs.webkit.org/show_bug.cgi?id=175994
2150 Reviewed by Mark Lam.
2154 2017-08-25 Eric Carlson <eric.carlson@apple.com>
2156 Add String::format variant that takes va_args
2157 https://bugs.webkit.org/show_bug.cgi?id=175988
2159 Reviewed by Jer Noble.
2161 * wtf/text/WTFString.cpp:
2162 (WTF::createWithFormatAndArguments): Created with the guts of String::format.
2163 (WTF::String::formatWithArguments): New, call createWithFormatAndArguments.
2164 (WTF::String::format): Move logic to createWithFormatAndArguments, use it.
2165 * wtf/text/WTFString.h:
2167 2017-08-25 Saam Barati <sbarati@apple.com>
2169 Support compiling catch in the DFG
2170 https://bugs.webkit.org/show_bug.cgi?id=174590
2171 <rdar://problem/34047845>
2173 Reviewed by Filip Pizlo.
2175 This patch generalizes the BackwardsGraph fake root into a more generalizable
2176 class called SingleRootGraph. SingleRootGraph exposes the general graph interface
2177 used in Dominators and NaturalLoops. SingleRootGraph takes as input a graph with
2178 the normal graph interface, but also allows the input graph to contain more than
2179 one root. SingleRootGraph then exposes a single root, which it creates, that has
2180 an outgoing edge to all the roots in the original graph.
2182 * WTF.xcodeproj/project.pbxproj:
2183 * wtf/BackwardsGraph.h:
2184 (WTF::BackwardsGraph::dump const):
2185 (WTF::BackwardsGraph::rootName): Deleted.
2186 (WTF::BackwardsGraph::Node::Node): Deleted.
2187 (WTF::BackwardsGraph::Node::root): Deleted.
2188 (WTF::BackwardsGraph::Node::operator== const): Deleted.
2189 (WTF::BackwardsGraph::Node::operator!= const): Deleted.
2190 (WTF::BackwardsGraph::Node::operator bool const): Deleted.
2191 (WTF::BackwardsGraph::Node::isRoot const): Deleted.
2192 (WTF::BackwardsGraph::Node::node const): Deleted.
2194 (WTF::BackwardsGraph::Set::Set): Deleted.
2195 (WTF::BackwardsGraph::Set::add): Deleted.
2196 (WTF::BackwardsGraph::Set::remove): Deleted.
2197 (WTF::BackwardsGraph::Set::contains): Deleted.
2198 (WTF::BackwardsGraph::Set::dump const): Deleted.
2199 (WTF::BackwardsGraph::Map::Map): Deleted.
2200 (WTF::BackwardsGraph::Map::clear): Deleted.
2201 (WTF::BackwardsGraph::Map::size const): Deleted.
2202 (WTF::BackwardsGraph::Map::operator[]): Deleted.
2203 (WTF::BackwardsGraph::Map::operator[] const): Deleted.
2205 (WTF::Dominators::Dominators):
2206 (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOf):
2207 (WTF::Dominators::forAllBlocksInPrunedIteratedDominanceFrontierOf):
2208 (WTF::Dominators::iteratedDominanceFrontierOf const):
2209 (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl const):
2210 * wtf/SingleRootGraph.h: Added.
2211 (WTF::SingleRootGraphNode::rootName):
2212 (WTF::SingleRootGraphNode::SingleRootGraphNode):
2213 (WTF::SingleRootGraphNode::root):
2214 (WTF::SingleRootGraphNode::operator== const):
2215 (WTF::SingleRootGraphNode::operator!= const):
2216 (WTF::SingleRootGraphNode::operator bool const):
2217 (WTF::SingleRootGraphNode::isRoot const):
2218 (WTF::SingleRootGraphNode::node const):
2219 (WTF::SingleRootGraphSet::add):
2220 (WTF::SingleRootGraphSet::remove):
2221 (WTF::SingleRootGraphSet::contains):
2222 (WTF::SingleRootGraphSet::dump const):
2223 (WTF::SingleRootMap::SingleRootMap):
2224 (WTF::SingleRootMap::clear):
2225 (WTF::SingleRootMap::size const):
2226 (WTF::SingleRootMap::operator[]):
2227 (WTF::SingleRootMap::operator[] const):
2228 (WTF::SingleRootGraph::SingleRootGraph):
2229 (WTF::SingleRootGraph::root const):
2230 (WTF::SingleRootGraph::newMap):
2231 (WTF::SingleRootGraph::successors const):
2232 (WTF::SingleRootGraph::predecessors const):
2233 (WTF::SingleRootGraph::index const):
2234 (WTF::SingleRootGraph::node const):
2235 (WTF::SingleRootGraph::numNodes const):
2236 (WTF::SingleRootGraph::dump const):
2237 (WTF::SingleRootGraph::assertIsConsistent const):
2239 2017-08-24 Commit Queue <commit-queue@webkit.org>
2241 Unreviewed, rolling out r221119, r221124, and r221143.
2242 https://bugs.webkit.org/show_bug.cgi?id=175973
2244 "I think it regressed JSBench by 20%" (Requested by saamyjoon
2247 Reverted changesets:
2249 "Support compiling catch in the DFG"
2250 https://bugs.webkit.org/show_bug.cgi?id=174590
2251 http://trac.webkit.org/changeset/221119
2253 "Unreviewed, build fix in GTK port"
2254 https://bugs.webkit.org/show_bug.cgi?id=174590
2255 http://trac.webkit.org/changeset/221124
2257 "DFG::JITCode::osrEntry should get sorted since we perform a
2258 binary search on it"
2259 https://bugs.webkit.org/show_bug.cgi?id=175893
2260 http://trac.webkit.org/changeset/221143
2262 2017-08-23 Filip Pizlo <fpizlo@apple.com>
2264 Reduce Gigacage sizes
2265 https://bugs.webkit.org/show_bug.cgi?id=175920
2267 Reviewed by Mark Lam.
2269 Provide filler API for the no-bmalloc/no-Gigacage case.
2274 2017-08-23 Yusuke Suzuki <utatane.tea@gmail.com>
2276 Unreviewed, build fix in GTK port
2277 https://bugs.webkit.org/show_bug.cgi?id=174590
2279 * wtf/SingleRootGraph.h:
2280 (WTF::SingleRootGraph::successors const):
2281 (WTF::SingleRootGraph::predecessors const):
2283 2017-08-23 Saam Barati <sbarati@apple.com>
2285 Support compiling catch in the DFG
2286 https://bugs.webkit.org/show_bug.cgi?id=174590
2288 Reviewed by Filip Pizlo.
2290 This patch generalizes the BackwardsGraph fake root into a more generalizable
2291 class called SingleRootGraph. SingleRootGraph exposes the general graph interface
2292 used in Dominators and NaturalLoops. SingleRootGraph takes as input a graph with
2293 the normal graph interface, but also allows the input graph to contain more than
2294 one root. SingleRootGraph then exposes a single root, which it creates, that has
2295 an outgoing edge to all the roots in the original graph.
2297 * WTF.xcodeproj/project.pbxproj:
2298 * wtf/BackwardsGraph.h:
2299 (WTF::BackwardsGraph::dump const):
2300 (WTF::BackwardsGraph::rootName): Deleted.
2301 (WTF::BackwardsGraph::Node::Node): Deleted.
2302 (WTF::BackwardsGraph::Node::root): Deleted.
2303 (WTF::BackwardsGraph::Node::operator== const): Deleted.
2304 (WTF::BackwardsGraph::Node::operator!= const): Deleted.
2305 (WTF::BackwardsGraph::Node::operator bool const): Deleted.
2306 (WTF::BackwardsGraph::Node::isRoot const): Deleted.
2307 (WTF::BackwardsGraph::Node::node const): Deleted.
2309 (WTF::BackwardsGraph::Set::Set): Deleted.
2310 (WTF::BackwardsGraph::Set::add): Deleted.
2311 (WTF::BackwardsGraph::Set::remove): Deleted.
2312 (WTF::BackwardsGraph::Set::contains): Deleted.
2313 (WTF::BackwardsGraph::Set::dump const): Deleted.
2314 (WTF::BackwardsGraph::Map::Map): Deleted.
2315 (WTF::BackwardsGraph::Map::clear): Deleted.
2316 (WTF::BackwardsGraph::Map::size const): Deleted.
2317 (WTF::BackwardsGraph::Map::operator[]): Deleted.
2318 (WTF::BackwardsGraph::Map::operator[] const): Deleted.
2320 (WTF::Dominators::Dominators):
2321 (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOf):
2322 (WTF::Dominators::forAllBlocksInPrunedIteratedDominanceFrontierOf):
2323 (WTF::Dominators::iteratedDominanceFrontierOf const):
2324 (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl const):
2325 * wtf/SingleRootGraph.h: Added.
2326 (WTF::SingleRootGraphNode::rootName):
2327 (WTF::SingleRootGraphNode::SingleRootGraphNode):
2328 (WTF::SingleRootGraphNode::root):
2329 (WTF::SingleRootGraphNode::operator== const):
2330 (WTF::SingleRootGraphNode::operator!= const):
2331 (WTF::SingleRootGraphNode::operator bool const):
2332 (WTF::SingleRootGraphNode::isRoot const):
2333 (WTF::SingleRootGraphNode::node const):
2334 (WTF::SingleRootGraphSet::add):
2335 (WTF::SingleRootGraphSet::remove):
2336 (WTF::SingleRootGraphSet::contains):
2337 (WTF::SingleRootGraphSet::dump const):
2338 (WTF::SingleRootMap::SingleRootMap):
2339 (WTF::SingleRootMap::clear):
2340 (WTF::SingleRootMap::size const):
2341 (WTF::SingleRootMap::operator[]):
2342 (WTF::SingleRootMap::operator[] const):
2343 (WTF::SingleRootGraph::SingleRootGraph):
2344 (WTF::SingleRootGraph::root const):
2345 (WTF::SingleRootGraph::newMap):
2346 (WTF::SingleRootGraph::successors const):
2347 (WTF::SingleRootGraph::predecessors const):
2348 (WTF::SingleRootGraph::index const):
2349 (WTF::SingleRootGraph::node const):
2350 (WTF::SingleRootGraph::numNodes const):
2351 (WTF::SingleRootGraph::dump const):
2352 (WTF::SingleRootGraph::assertIsConsistent const):
2354 2017-08-23 Youenn Fablet <youenn@apple.com>
2356 [Cache API] Enable persistent coder to encode FetchOptions
2357 https://bugs.webkit.org/show_bug.cgi?id=175883
2359 Reviewed by Alex Christensen.
2361 Enabling encoding/decoding of enums with EnumTraits.
2362 This code is similar to the one of IPC encoder/decoder.
2364 * wtf/persistence/PersistentDecoder.h:
2365 (WTF::Persistence::Decoder::decode):
2366 * wtf/persistence/PersistentEncoder.h:
2367 (WTF::Persistence::Encoder::encode):
2369 2017-08-23 Per Arne Vollan <pvollan@apple.com>
2371 [Win] Compile error, include file <wtf/AVFoundationHeaderDetection.h> is not found.
2372 https://bugs.webkit.org/show_bug.cgi?id=175853
2374 Reviewed by Brent Fulgham.
2376 Copy generated WTF header files to the same place as we copy forwarding headers.
2378 * WTF.vcxproj/WTF.proj:
2380 2017-08-22 Chris Dumez <cdumez@apple.com>
2382 Introduce a new CompletionHandler type and use it for NetworkDataTaskClient's completion handlers to help catch bugs
2383 https://bugs.webkit.org/show_bug.cgi?id=175832
2385 Reviewed by Alex Christensen.
2387 Introduce a new CompletionHandler type which wraps a WTF::Function and ensures via assertions
2388 that the function is always called once and only once.
2390 * WTF.xcodeproj/project.pbxproj:
2391 * wtf/CompletionHandler.h: Added.
2392 (WTF::CompletionHandler<Out):
2394 2017-08-22 Alex Christensen <achristensen@webkit.org>
2396 Fix Windows build after r221017.
2397 https://bugs.webkit.org/show_bug.cgi?id=157053
2399 * wtf/PlatformWin.cmake:
2401 2017-08-22 Per Arne Vollan <pvollan@apple.com>
2403 Implement 64-bit MacroAssembler::probe support for Windows.
2404 https://bugs.webkit.org/show_bug.cgi?id=175724
2406 Reviewed by Mark Lam.
2408 Enable masm probe and DFG.
2412 2017-08-21 Mark Lam <mark.lam@apple.com>
2414 [Follow up]: Add back the ability to disable MASM_PROBE from the build.
2415 https://bugs.webkit.org/show_bug.cgi?id=175656
2416 <rdar://problem/33933720>
2420 Fixed a typo: should be "OS(WINDOWS)", not "OS(WINDOW)".
2424 2017-08-21 Carlos Alberto Lopez Perez <clopez@igalia.com>
2426 [GTK] ARMv7 build fails to build MacroAssemblerARMv7.cpp.
2427 https://bugs.webkit.org/show_bug.cgi?id=175514
2429 Reviewed by Keith Miller.
2431 * wtf/Platform.h: Enable DFG and MASM_PROBE back for GTK ARM_THUMB2.
2433 2017-08-20 Sam Weinig <sam@webkit.org>
2435 StringView could use a function to strip leading/trailing characters without allocation
2436 https://bugs.webkit.org/show_bug.cgi?id=175757
2438 Reviewed by Darin Adler.
2440 There are many places in WebCore/WebKit that we call functions like,
2441 WebCore::stripLeadingAndTrailingHTMLSpaces, or String::stripWhiteSpace() only to use
2442 the allocated String as a temporary for either another transformation or a comparison.
2443 Now that we have StringView, we can avoid that extra allocation, by having returning a
2444 StringView substring in these scenarios.
2446 For instance, the check (from ScriptElement.cpp:287):
2448 if (!stripLeadingAndTrailingHTMLSpaces(sourceURL).isEmpty()) {
2452 currently allocates a string just to make this check. With a new
2453 stripLeadingAndTrailingHTMLSpaces such as:
2455 StringView stripLeadingAndTrailingHTMLSpaces(StringView stringView)
2457 return stringView.stripLeadingAndTrailingMatchedCharacters([] (auto c) {
2458 return isHTMLSpace(c);
2462 We could instead have exact same code from ScriptElement.cpp now avoid an allocation.
2464 * wtf/text/StringView.h:
2465 (WTF::StringView::stripLeadingAndTrailingMatchedCharacters):
2467 2017-08-21 Eric Carlson <eric.carlson@apple.com>
2469 Add WTFLogChannel level to allow runtime log filtering
2470 https://bugs.webkit.org/show_bug.cgi?id=175731
2471 <rdar://problem/33967234>
2473 Reviewed by Jer Noble.
2475 Add WTFLog*, LOG, and RELEASE_LOG variants that take a "log level" parameter so code
2476 can include logging statements that are only conditionally emitted.
2478 * wtf/Assertions.cpp:
2480 * wtf/MemoryPressureHandler.cpp:
2481 * wtf/RefCountedLeakCounter.cpp:
2483 2017-08-20 Mark Lam <mark.lam@apple.com>
2485 Gardening: fix CLoop build.
2486 https://bugs.webkit.org/show_bug.cgi?id=175688
2487 <rdar://problem/33436870>
2491 Disable MASM_PROBE if !ENABLE(JIT).
2495 2017-08-18 Ryan Haddad <ryanhaddad@apple.com>
2497 Unreviewed, rolling out r220938.
2499 The API tests added with this change are failing.
2503 "Add WTFLogChannel level to allow runtime log filtering"
2504 https://bugs.webkit.org/show_bug.cgi?id=175731
2505 http://trac.webkit.org/changeset/220938
2507 2017-08-18 Eric Carlson <eric.carlson@apple.com>
2509 Add WTFLogChannel level to allow runtime log filtering
2510 https://bugs.webkit.org/show_bug.cgi?id=175731
2511 <rdar://problem/33967234>
2513 Reviewed by Jer Noble.
2515 Add WTFLog*, LOG, and RELEASE_LOG variants that take a "log level" parameter so code
2516 can include logging statements that are only conditionally emitted.
2518 * wtf/Assertions.cpp:
2520 * wtf/MemoryPressureHandler.cpp:
2521 * wtf/RefCountedLeakCounter.cpp:
2523 2017-08-18 Per Arne Vollan <pvollan@apple.com>
2525 Implement 32-bit MacroAssembler::probe support for Windows.
2526 https://bugs.webkit.org/show_bug.cgi?id=175449
2528 Reviewed by Mark Lam.
2530 Enable the DFG on Win32.
2534 2017-08-17 Mark Lam <mark.lam@apple.com>
2536 Only use 16 VFP registers if !CPU(ARM_NEON).
2537 https://bugs.webkit.org/show_bug.cgi?id=175514
2539 Reviewed by JF Bastien.
2541 If CPU(ARM_NEON) is not enabled, we'll conservatively assume only VFP2 support is
2542 available. Hence, we'll only the first 16 FPDoubleRegisterIDs are available.
2545 NEON registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJACABEJ.html
2546 VFP2 and VFP3 registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CIHDIBDG.html
2547 NEON to VFP register mapping: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJAIJHFC.html
2549 This is mostly for GTK toolchains which may target older ARM CPUs which only have
2554 2017-08-16 Mark Lam <mark.lam@apple.com>
2556 Add back the ability to disable MASM_PROBE from the build.
2557 https://bugs.webkit.org/show_bug.cgi?id=175656
2558 <rdar://problem/33933720>
2560 Reviewed by Yusuke Suzuki.
2564 2017-08-16 Mark Lam <mark.lam@apple.com>
2566 Gardening: fix GTK ARM_THUMB2 build.
2567 https://bugs.webkit.org/show_bug.cgi?id=175446
2571 Disable the use of the DFG for GTK ARM_THUMB2 builds until
2572 https://bugs.webkit.org/show_bug.cgi?id=175514 is fixed.
2576 2017-08-16 Andy Estes <aestes@apple.com>
2578 [Payment Request] Add an ENABLE flag and an experimental feature preference
2579 https://bugs.webkit.org/show_bug.cgi?id=175622
2581 Reviewed by Tim Horton.
2583 * wtf/FeatureDefines.h:
2585 2017-08-14 Simon Fraser <simon.fraser@apple.com>
2587 Remove Proximity Events and related code
2588 https://bugs.webkit.org/show_bug.cgi?id=175545
2590 Reviewed by Daniel Bates.
2592 No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS)
2593 and other related code.
2595 * wtf/FeatureDefines.h:
2597 2017-08-14 Simon Fraser <simon.fraser@apple.com>
2599 Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
2600 https://bugs.webkit.org/show_bug.cgi?id=175504
2602 Reviewed by Sam Weinig.
2604 * wtf/FeatureDefines.h:
2606 2017-08-14 Simon Fraser <simon.fraser@apple.com>
2608 Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
2609 https://bugs.webkit.org/show_bug.cgi?id=175557
2611 Reviewed by Jon Lee.
2613 No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.
2615 * wtf/FeatureDefines.h:
2617 2017-08-12 Filip Pizlo <fpizlo@apple.com>
2619 Put the ScopedArgumentsTable's ScopeOffset array in some gigacage
2620 https://bugs.webkit.org/show_bug.cgi?id=174921
2622 Reviewed by Mark Lam.
2624 If you want to std::unique_ptr a class that knows that it should be in the Gigacage, then we
2625 would create the Gigacage equivalent of WTF_MAKE_FAST_ALLOCATED and it would just work.
2627 But this does not work if we want to std::unique_ptr a primitive type. So, this patch adds a
2628 solution for this problem: CagedUniquePtr<>. This will handle allocation
2629 (CagedUniquePtr<>::create()) and deallocation (in the style of std::unique_ptr). It has three
2633 - Arrays that don't have destructors.
2634 - Arrays that have destructors.
2636 Just like std::unique_ptr, the array case is triggered by saying "[]" at the end of the type.
2638 Unlike std::unique_ptr and most other smart pointers, the whole point of this smart pointer is
2639 to dictate where the thing you're pointing at is allocated. For this reason, it has to know how
2640 to do things like the array destructor protocol. So it creates its own: the CagedUniquePtr for
2641 arrays with destructors is a fat pointer that remembers the length of the array.
2643 CagedUniquePtr<> makes it impossible to leak/release the pointer. This is stricter than what
2644 std::unique_ptr does, and is probably appropriate for all of the places where we would use this
2647 So far, we only use it for ScopedArgumentsTable::m_arguments, but I suspect that it will be
2648 useful in other places.
2650 * WTF.xcodeproj/project.pbxproj:
2651 * wtf/CMakeLists.txt:
2652 * wtf/CagedUniquePtr.h: Added.
2653 (WTF::CagedUniquePtr::CagedUniquePtr):
2654 (WTF::CagedUniquePtr::create):
2655 (WTF::CagedUniquePtr::operator=):
2656 (WTF::CagedUniquePtr::~CagedUniquePtr):
2657 (WTF::CagedUniquePtr::get const):
2658 (WTF::CagedUniquePtr::getMayBeNull const):
2659 (WTF::CagedUniquePtr::operator== const):
2660 (WTF::CagedUniquePtr::operator!= const):
2661 (WTF::CagedUniquePtr::operator bool const):
2662 (WTF::CagedUniquePtr::operator* const):
2663 (WTF::CagedUniquePtr::operator-> const):
2664 (WTF::CagedUniquePtr::operator[] const):
2665 (WTF::CagedUniquePtr::destroy):
2667 (Gigacage::tryMallocArray):
2669 (Gigacage::mallocArray):
2672 2017-08-11 Ryosuke Niwa <rniwa@webkit.org>
2674 Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
2675 https://bugs.webkit.org/show_bug.cgi?id=175474
2677 Reviewed by Wenson Hsieh.
2679 * wtf/FeatureDefines.h:
2681 2017-08-11 Don Olmstead <don.olmstead@sony.com>
2683 [WTF] Move ValueToString into WTF
2684 https://bugs.webkit.org/show_bug.cgi?id=175469
2686 Reviewed by Sam Weinig.
2688 * WTF.xcodeproj/project.pbxproj:
2689 * wtf/CMakeLists.txt:
2690 * wtf/text/ValueToString.h: Renamed from Source/WebCore/platform/ValueToString.h.
2692 2017-08-11 Tim Horton <timothy_horton@apple.com>
2694 Fix the build with modern Clang's -Wexpansion-to-defined
2695 https://bugs.webkit.org/show_bug.cgi?id=175467
2696 <rdar://problem/33667497>
2698 Reviewed by Simon Fraser.
2700 * wtf/FeatureDefines.h:
2702 Avoid object-like macros that expand to include defined(), because this
2703 behaves inconsistently between different compilers (though in ways
2704 that don't matter for these particular defines, which aren't used on MSVC),
2705 and Clang has added a warning for it.
2707 Move ENABLE_WEBASSEMBLY to Platform.h since it depends on things that
2708 are defined there and can't be evaluated at time-of-use because of the
2709 aforementioned new rules. Previously, there was a cycle between
2710 ENABLE_WEBASSEMBLY and ENABLE_B3_JIT -- break that so that it just
2711 goes FTL_JIT->B3_JIT->WASM instead.
2713 2017-08-10 Sam Weinig <sam@webkit.org>
2715 WTF::Function does not allow for reference / non-default constructible return types
2716 https://bugs.webkit.org/show_bug.cgi?id=175244
2718 Reviewed by Chris Dumez.
2720 When Function, then NoncopyableFunction, was templatized to allow non-void return values
2721 in r201493, it maintained the behavior of being callable even if the Function was null.
2722 To accomplish this, when null, the default construction of the return parameter was used.
2723 This means Function can't be used with return types that are not default constructible,
2724 such as reference types and Ref.
2726 This behavior of returning something when null is surprising, as this is not how normal
2727 functions behave, and not very useful. Instead, we now assert that the function is not
2728 null when being called.
2731 (WTF::Function operator(...)):
2732 Instead of allowing a null callable wrapper by returning the default construction of
2733 the return type, assert that the wrapper is there when calling a Function.
2735 2017-08-10 Mark Lam <mark.lam@apple.com>
2737 Make the MASM_PROBE mechanism mandatory for DFG and FTL builds.
2738 https://bugs.webkit.org/show_bug.cgi?id=175446
2739 <rdar://problem/33836545>
2741 Reviewed by Saam Barati.
2743 This is needed in order to support https://bugs.webkit.org/show_bug.cgi?id=174645.
2744 One consequence of this is that the DFG will now be disabled for the MIPS and
2746 https://bugs.webkit.org/show_bug.cgi?id=175447
2747 https://bugs.webkit.org/show_bug.cgi?id=175449
2749 Also, we should only ENABLE_SIGNAL_BASED_VM_TRAPS if the DFG is enabled. It was
2750 never meaningful to use SIGNAL_BASED_VM_TRAPS with the baseline JIT anyway. This
2751 is a mis-configuration error that is now fixed.
2755 2017-08-10 Brady Eidson <beidson@apple.com>
2757 Rename the source files for the WTF persistent coders.
2758 https://bugs.webkit.org/show_bug.cgi?id=175441
2760 Reviewed by Tim Horton.
2762 * WTF.xcodeproj/project.pbxproj:
2763 * wtf/CMakeLists.txt:
2765 * wtf/persistence/PersistentCoder.h: Renamed from Source/WTF/wtf/persistence/Coder.h.
2766 * wtf/persistence/PersistentCoders.cpp: Renamed from Source/WTF/wtf/persistence/Coders.cpp.
2767 * wtf/persistence/PersistentCoders.h: Renamed from Source/WTF/wtf/persistence/Coders.h.
2768 * wtf/persistence/PersistentDecoder.cpp: Renamed from Source/WTF/wtf/persistence/Decoder.cpp.
2769 * wtf/persistence/PersistentDecoder.h: Renamed from Source/WTF/wtf/persistence/Decoder.h.
2770 * wtf/persistence/PersistentEncoder.cpp: Renamed from Source/WTF/wtf/persistence/Encoder.cpp.
2771 * wtf/persistence/PersistentEncoder.h: Renamed from Source/WTF/wtf/persistence/Encoder.h.
2773 2017-08-10 Yusuke Suzuki <utatane.tea@gmail.com>
2775 Unreviewed, attempt to fix build failure with VC2017
2777 * wtf/PriorityQueue.h:
2779 2017-08-10 Yusuke Suzuki <utatane.tea@gmail.com>
2782 https://bugs.webkit.org/show_bug.cgi?id=174970
2784 Reviewed by Michael Catanzaro.
2786 CHAR_BIT is not defined.
2790 2017-08-09 Yusuke Suzuki <utatane.tea@gmail.com>
2792 [WTF] ThreadSpecific should not introduce additional indirection
2793 https://bugs.webkit.org/show_bug.cgi?id=175187
2795 Reviewed by Mark Lam.
2797 ThreadSpecific sets Data* to the TLS. And Data holds T*, which
2798 is fast allocated actual data. But ideally, we should store T
2799 instance directly in Data instead of introducing an additional
2802 This patch adds storage in Data in order to embed the instance of T. The constructor
2803 for Data will invoke the constructor for T on the embedded storage. We also drop
2804 ThreadSpecific::replace which is only used by the web thread to set its thread specific
2805 ThreadGlobalData to the one shared from the main thread. The existing implementation
2806 relies on the main thread and the web thread never exiting in order for the shared
2807 ThreadGlobalData to stay alive. We can achieve the same semantics by using a
2808 ThreadSpecific<std::unique_ptr<T>> to hold the ThreadGlobalData instance instead.
2810 * wtf/ThreadSpecific.h:
2811 (WTF::ThreadSpecific::Data::construct):
2812 (WTF::ThreadSpecific::Data::Data):
2813 We make it fast allocated since we previously allocated ThreadSpecific T data by fastMalloc.
2815 (WTF::ThreadSpecific::Data::~Data):
2816 (WTF::ThreadSpecific::Data::storagePointer const):
2817 (WTF::canBeGCThread>::get):
2818 We also drop RELEASE_ASSERT from ::get(). We already inserted this assert to setAndConstruct(),
2819 so when creating the member to this TLS, we execute this release assert. So it is
2820 not necessary to execute this assertion every time we get data from this TLS.
2822 (WTF::canBeGCThread>::set):
2823 (WTF::canBeGCThread>::destroy):
2824 (WTF::canBeGCThread>::setAndConstruct):
2826 (WTF::canBeGCThread>::replace): Deleted.
2828 2017-08-10 Tim Horton <timothy_horton@apple.com>
2830 Fix a silly typo in Compiler.h
2835 2017-08-10 Michael Catanzaro <mcatanzaro@igalia.com>
2837 Remove ENABLE_GAMEPAD_DEPRECATED
2838 https://bugs.webkit.org/show_bug.cgi?id=175361
2840 Reviewed by Carlos Garcia Campos.
2842 * wtf/FeatureDefines.h:
2844 2017-08-09 Don Olmstead <don.olmstead@sony.com>
2846 [WTF] Move TextStream into WTF
2847 https://bugs.webkit.org/show_bug.cgi?id=175211
2849 Reviewed by Myles C. Maxfield.
2851 * WTF.xcodeproj/project.pbxproj:
2852 * wtf/CMakeLists.txt:
2853 * wtf/text/TextStream.cpp: Renamed from Source/WebCore/platform/text/TextStream.cpp.
2854 (WTF::TextStream::writeIndent):
2855 * wtf/text/TextStream.h: Renamed from Source/WebCore/platform/text/TextStream.h.
2856 (WTF::TextStream::FormatNumberRespectingIntegers::FormatNumberRespectingIntegers):
2858 2017-08-09 Commit Queue <commit-queue@webkit.org>
2860 Unreviewed, rolling out r220466, r220477, and r220487.
2861 https://bugs.webkit.org/show_bug.cgi?id=175411
2863 This change broke existing API tests and follow up fixes did
2864 not resolve all the issues. (Requested by ryanhaddad on
2867 Reverted changesets:
2869 https://bugs.webkit.org/show_bug.cgi?id=175244
2870 http://trac.webkit.org/changeset/220466
2872 "WTF::Function does not allow for reference / non-default
2873 constructible return types"
2874 https://bugs.webkit.org/show_bug.cgi?id=175244
2875 http://trac.webkit.org/changeset/220477
2877 https://bugs.webkit.org/show_bug.cgi?id=175244
2878 http://trac.webkit.org/changeset/220487
2880 2017-08-09 Sam Weinig <sam@webkit.org>
2882 WTF::Function does not allow for reference / non-default constructible return types
2883 https://bugs.webkit.org/show_bug.cgi?id=175244
2885 Reviewed by Chris Dumez.
2887 When Function, then NoncopyableFunction, was templatized to allow non-void return values
2888 in r201493, it maintained the behavior of being callable even if the Function was null.
2889 To accomplish this, when null, the default construction of the return parameter was used.
2890 This means Function can't be used with return types that are not default constructible,
2891 such as reference types and Ref.
2893 This behavior of returning something when null is surprising, as this is not how normal
2894 functions behave, and not very useful. Instead, we now assert that the function is not
2895 null when being called.
2898 (WTF::Function operator(...)):
2899 Instead of allowing a null callable wrapper by returning the default construction of
2900 the return type, assert that the wrapper is there when calling a Function.
2902 2017-08-09 Ryan Haddad <ryanhaddad@apple.com>
2904 Unreviewed, rolling out r220457.
2906 This change introduced API test failures.
2910 "WTF::Function does not allow for reference / non-default
2911 constructible return types"
2912 https://bugs.webkit.org/show_bug.cgi?id=175244
2913 http://trac.webkit.org/changeset/220457
2915 2017-08-09 Sam Weinig <sam@webkit.org>
2917 WTF::Function does not allow for reference / non-default constructible return types
2918 https://bugs.webkit.org/show_bug.cgi?id=175244
2920 Reviewed by Chris Dumez.
2922 When Function, then NoncopyableFunction, was templatized to allow non-void return values
2923 in r201493, it maintained the behavior of being callable even if the Function was null.
2924 To accomplish this, when null, the default construction of the return parameter was used.
2925 This means Function can't be used with return types that are not default constructible,
2926 such as reference types and Ref.
2928 This behavior of returning something when null is surprising, as this is not how normal
2929 functions behave, and not very useful. Instead, we now assert that the function is not
2930 null when being called.
2933 (WTF::Function operator(...)):
2934 Instead of allowing a null callable wrapper by returning the default construction of
2935 the return type, assert that the wrapper is there when calling a Function.
2937 2017-08-08 Filip Pizlo <fpizlo@apple.com>
2939 Baseline JIT should do caging
2940 https://bugs.webkit.org/show_bug.cgi?id=175037
2942 Reviewed by Mark Lam.
2945 (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
2946 (Gigacage::isDisablingPrimitiveGigacageDisabled):
2947 (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
2948 (Gigacage::canPrimitiveGigacageBeDisabled):
2949 (Gigacage::basePtr):
2951 2017-08-08 Ryan Haddad <ryanhaddad@apple.com>
2953 Unreviewed, rolling out r220368.
2955 This change caused WK1 tests to exit early with crashes.
2959 "Baseline JIT should do caging"
2960 https://bugs.webkit.org/show_bug.cgi?id=175037
2961 http://trac.webkit.org/changeset/220368
2963 2017-08-08 Michael Catanzaro <mcatanzaro@igalia.com>
2965 [CMake] Properly test if compiler supports compiler flags
2966 https://bugs.webkit.org/show_bug.cgi?id=174490
2968 Reviewed by Konstantin Tokarev.
2972 2017-08-07 Filip Pizlo <fpizlo@apple.com>
2974 Baseline JIT should do caging
2975 https://bugs.webkit.org/show_bug.cgi?id=175037
2977 Reviewed by Mark Lam.
2980 (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
2981 (Gigacage::isDisablingPrimitiveGigacageDisabled):
2982 (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
2983 (Gigacage::canPrimitiveGigacageBeDisabled):
2985 2017-08-07 Filip Pizlo <fpizlo@apple.com>
2987 Unreviewed, try to fix Windows build.
2992 2017-08-06 Filip Pizlo <fpizlo@apple.com>
2994 Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
2995 https://bugs.webkit.org/show_bug.cgi?id=174919
2997 Reviewed by Keith Miller.
2999 This mirrors the changes from bmalloc/Gigacage.h.
3001 Also it teaches CagedPtr how to reason about multiple gigacages.
3004 (WTF::CagedPtr::get const):
3005 (WTF::CagedPtr::operator[] const):
3007 (Gigacage::tryMalloc):
3008 (Gigacage::tryAllocateVirtualPages):
3009 (Gigacage::freeVirtualPages):
3010 (Gigacage::tryAlignedMalloc):
3011 (Gigacage::alignedFree):
3014 (Gigacage::disablePrimitiveGigacage):
3015 (Gigacage::addPrimitiveDisableCallback):
3016 (Gigacage::removePrimitiveDisableCallback):
3018 (Gigacage::basePtr):
3020 (Gigacage::isCaged):
3021 (Gigacage::tryAlignedMalloc):
3022 (Gigacage::alignedFree):
3024 (Gigacage::disableGigacage): Deleted.
3025 (Gigacage::addDisableCallback): Deleted.
3026 (Gigacage::removeDisableCallback): Deleted.
3028 2017-08-07 Brian Burg <bburg@apple.com>
3030 Remove CANVAS_PATH compilation guard
3031 https://bugs.webkit.org/show_bug.cgi?id=175207
3033 Reviewed by Sam Weinig.
3035 * wtf/FeatureDefines.h:
3037 2017-08-05 Filip Pizlo <fpizlo@apple.com>
3039 REGRESSION (r219895-219897): Number of leaks on Open Source went from 9240 to 235983 and is now at 302372
3040 https://bugs.webkit.org/show_bug.cgi?id=175083
3042 Reviewed by Oliver Hunt.
3044 Adds a classic ReadWriteLock class. I wrote my own because I can never remember if the pthread one is
3045 guaranted to bias in favor of writers or not.
3047 * WTF.xcodeproj/project.pbxproj:
3049 (WTF::ConditionBase::construct):
3050 (WTF::Condition::Condition):
3052 (WTF::LockBase::construct):
3054 * wtf/ReadWriteLock.cpp: Added.
3055 (WTF::ReadWriteLockBase::construct):
3056 (WTF::ReadWriteLockBase::readLock):
3057 (WTF::ReadWriteLockBase::readUnlock):
3058 (WTF::ReadWriteLockBase::writeLock):
3059 (WTF::ReadWriteLockBase::writeUnlock):
3060 * wtf/ReadWriteLock.h: Added.
3061 (WTF::ReadWriteLockBase::ReadLock::tryLock):
3062 (WTF::ReadWriteLockBase::ReadLock::lock):
3063 (WTF::ReadWriteLockBase::ReadLock::unlock):
3064 (WTF::ReadWriteLockBase::WriteLock::tryLock):
3065 (WTF::ReadWriteLockBase::WriteLock::lock):
3066 (WTF::ReadWriteLockBase::WriteLock::unlock):
3067 (WTF::ReadWriteLockBase::read):
3068 (WTF::ReadWriteLockBase::write):
3069 (WTF::ReadWriteLock::ReadWriteLock):
3071 2017-08-04 Matt Lewis <jlewis3@apple.com>
3073 Unreviewed, rolling out r220271.
3075 Rolling out due to Layout Test failing on iOS Simulator.
3079 "Remove STREAMS_API compilation guard"
3080 https://bugs.webkit.org/show_bug.cgi?id=175165
3081 http://trac.webkit.org/changeset/220271
3083 2017-08-04 Youenn Fablet <youenn@apple.com>
3085 Remove STREAMS_API compilation guard
3086 https://bugs.webkit.org/show_bug.cgi?id=175165
3088 Reviewed by Darin Adler.
3090 * wtf/FeatureDefines.h:
3092 2017-08-03 Brian Burg <bburg@apple.com>
3094 Remove ENABLE(WEB_SOCKET) guards
3095 https://bugs.webkit.org/show_bug.cgi?id=167044
3097 Reviewed by Joseph Pecoraro.
3099 * wtf/FeatureDefines.h:
3101 2017-08-03 Youenn Fablet <youenn@apple.com>
3103 Remove FETCH_API compilation guard
3104 https://bugs.webkit.org/show_bug.cgi?id=175154
3106 Reviewed by Chris Dumez.
3108 * wtf/FeatureDefines.h:
3110 2017-08-03 Brady Eidson <beidson@apple.com>
3112 Add SW IDLs and stub out basic functionality.
3113 https://bugs.webkit.org/show_bug.cgi?id=175115
3115 Reviewed by Chris Dumez.
3117 * wtf/FeatureDefines.h:
3119 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
3121 Unreviewed, build fix for Windows port
3122 https://bugs.webkit.org/show_bug.cgi?id=175013
3126 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
3128 Merge ThreadHolder to WTF::Thread itself
3129 https://bugs.webkit.org/show_bug.cgi?id=175013
3131 Reviewed by Mark Lam.
3133 Currently, we store ThreadHolder* to the TLS, and ThreadHolder* holds Ref<Thread>.
3134 When we get Thread& from the current thread TLS, we need to dereference the ThreadHolder*.
3135 However, ideally, we can store Thread* directly to the current thread TLS.
3136 While the ThreadHolder design is beautiful, it's worth optimizing by storing Thread* directly
3137 since Thread::current() is so frequently executed.
3139 This patch merges ThreadHolder to Thread. And we now store Thread* directly in the TLS.
3140 When storing it to TLS, we call leakRef() to keep Thread ref count incremented by the TLS.
3141 And when destroying the TLS, we call `deref()` to ensure that Thread* is dereferenced from
3144 * WTF.xcodeproj/project.pbxproj:
3145 * wtf/CMakeLists.txt:
3146 * wtf/ThreadHolder.cpp: Removed.
3147 * wtf/ThreadHolder.h: Removed.
3148 * wtf/ThreadHolderPthreads.cpp: Removed.
3149 * wtf/ThreadHolderWin.cpp: Removed.
3150 * wtf/Threading.cpp:
3151 (WTF::Thread::entryPoint):
3152 (WTF::initializeThreading):
3154 (WTF::Thread::currentMayBeNull):
3155 (WTF::Thread::current):
3156 * wtf/ThreadingPthreads.cpp:
3157 (WTF::Thread::waitForCompletion):
3158 (WTF::Thread::initializeCurrentTLS):
3159 (WTF::Thread::initializeTLSKey):
3160 (WTF::Thread::initializeTLS):
3161 (WTF::Thread::destructTLS):
3162 (WTF::Thread::createCurrentThread): Deleted.
3163 * wtf/ThreadingWin.cpp:
3164 (WTF::Thread::initializeCurrentTLS):
3165 (WTF::threadMapMutex):
3166 (WTF::Thread::initializeTLSKey):
3167 (WTF::Thread::currentDying):
3169 (WTF::Thread::initializeTLS):
3170 (WTF::Thread::destructTLS):
3171 (WTF::waitForThreadCompletion):
3172 (WTF::Thread::createCurrentThread): Deleted.
3174 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
3176 [Linux][WTF] Use one global semaphore to notify thread suspend and resume completion
3177 https://bugs.webkit.org/show_bug.cgi?id=175124
3179 Reviewed by Carlos Garcia Campos.
3181 POSIX sem_t is used to notify thread suspend and resume completion in Linux ports
3182 since sem_post is async-signal-safe function. Since we guard suspend() and resume()
3183 with one global lock, this semaphore is also guarded by this lock. So we do not need
3184 to have semaphore per WTF::Thread.
3186 This patch introduces one global Semaphore. And drop per thread semaphore.
3189 * wtf/ThreadingPthreads.cpp:
3190 (WTF::Thread::~Thread):
3191 (WTF::Semaphore::Semaphore):
3192 (WTF::Semaphore::~Semaphore):
3193 (WTF::Semaphore::wait):
3194 (WTF::Semaphore::post):
3195 (WTF::Thread::signalHandlerSuspendResume):
3196 (WTF::Thread::initializePlatformThreading):
3197 (WTF::Thread::suspend):
3198 (WTF::Thread::resume):
3199 (WTF::Thread::Thread): Deleted.
3200 * wtf/ThreadingWin.cpp:
3201 (WTF::Thread::Thread): Deleted.
3203 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
3205 [Linux][WTF] Reduce sizeof(WTF::Thread) by using a pointer to PlatformRegisters
3206 https://bugs.webkit.org/show_bug.cgi?id=175119
3208 Reviewed by Carlos Garcia Campos.
3210 sizeof(PlatformRegisters) is so large. In my Linux box, it is 256. It enlarges the sizeof(WTF::Thread).
3211 However, it is not necessary to hold it in WTF::Thread member. Thread's ucontext data and its stack is
3212 effective while suspending the thread. So, we can just use the pointer to the PlatformRegister instead
3213 of copying it to the member of the WTF::Thread.
3216 * wtf/ThreadingPthreads.cpp:
3217 (WTF::Thread::signalHandlerSuspendResume):
3218 (WTF::Thread::getRegisters):
3220 2017-08-02 Yusuke Suzuki <utatane.tea@gmail.com>
3222 Unreviewed, build fix for Windows port
3223 https://bugs.webkit.org/show_bug.cgi?id=174716
3225 This ugliness will be fixed in https://bugs.webkit.org/show_bug.cgi?id=175013.
3227 * wtf/ThreadHolder.h:
3230 2017-08-02 Yusuke Suzuki <utatane.tea@gmail.com>
3232 Merge WTFThreadData to Thread::current
3233 https://bugs.webkit.org/show_bug.cgi?id=174716
3235 Reviewed by Mark Lam.
3237 We placed thread specific data in WTFThreadData previously. But now, we have a new good place
3238 to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
3239 sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
3240 This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
3241 to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
3242 Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
3243 before calling WTF::initializeThreading.
3245 * WTF.xcodeproj/project.pbxproj:
3246 * wtf/CMakeLists.txt:
3247 * wtf/LockAlgorithm.h:
3248 * wtf/LockAlgorithmInlines.h:
3250 * wtf/ParkingLot.cpp:
3251 * wtf/StackStats.cpp:
3252 (WTF::StackStats::PerThreadStats::PerThreadStats):
3253 (WTF::StackStats::CheckPoint::CheckPoint):
3254 (WTF::StackStats::CheckPoint::~CheckPoint):
3255 (WTF::StackStats::probe):
3256 (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
3257 * wtf/ThreadHolder.cpp:
3258 (WTF::ThreadHolder::initializeCurrent):
3259 * wtf/ThreadHolder.h:
3260 (WTF::ThreadHolder::ThreadHolder):
3261 (WTF::ThreadHolder::currentMayBeNull):
3262 (WTF::ThreadHolder::current):
3263 * wtf/ThreadHolderPthreads.cpp:
3264 (WTF::ThreadHolder::initializeKey):
3265 (WTF::ThreadHolder::initialize):
3266 (WTF::ThreadHolder::destruct):
3267 (WTF::ThreadHolder::initializeOnce): Deleted.
3268 (WTF::ThreadHolder::current): Deleted.
3269 * wtf/ThreadHolderWin.cpp:
3270 (WTF::ThreadHolder::initializeKey):
3271 (WTF::ThreadHolder::currentDying):
3272 (WTF::ThreadHolder::initialize):
3273 (WTF::ThreadHolder::initializeOnce): Deleted.
3274 (WTF::ThreadHolder::current): Deleted.
3275 * wtf/Threading.cpp:
3276 (WTF::Thread::initializeInThread):
3277 (WTF::Thread::entryPoint):
3278 (WTF::Thread::create):
3279 (WTF::Thread::didExit):
3280 (WTF::initializeThreading):
3281 (WTF::Thread::currentMayBeNull): Deleted.
3283 (WTF::Thread::current):
3284 (WTF::Thread::atomicStringTable):
3285 (WTF::Thread::setCurrentAtomicStringTable):
3286 (WTF::Thread::stackStats):
3287 (WTF::Thread::savedStackPointerAtVMEntry):
3288 (WTF::Thread::setSavedStackPointerAtVMEntry):
3289 (WTF::Thread::savedLastStackTop):
3290 (WTF::Thread::setSavedLastStackTop):
3291 * wtf/ThreadingPrimitives.h:
3292 * wtf/ThreadingPthreads.cpp:
3293 (WTF::Thread::createCurrentThread):
3294 (WTF::Thread::current): Deleted.
3295 * wtf/ThreadingWin.cpp:
3296 (WTF::Thread::createCurrentThread):
3297 (WTF::Thread::current): Deleted.
3298 * wtf/WTFThreadData.cpp: Removed.
3299 * wtf/WTFThreadData.h: Removed.
3300 * wtf/text/AtomicString.cpp:
3301 * wtf/text/AtomicStringImpl.cpp:
3303 * wtf/text/AtomicStringTable.cpp:
3304 (WTF::AtomicStringTable::create):
3305 * wtf/text/AtomicStringTable.h:
3307 2017-08-02 Joseph Pecoraro <pecoraro@apple.com>
3309 NeverDestroyed related leaks seen on bots
3310 https://bugs.webkit.org/show_bug.cgi?id=175113
3312 Reviewed by Yusuke Suzuki.
3314 * wtf/NeverDestroyed.h:
3315 (WTF::NeverDestroyed::NeverDestroyed):
3316 Previously the result of makeNeverDestroyed was not always moving into
3317 the `static NeverDestroyed` static local variable. In some cases it would
3318 re-invoke the constructor, creating a new NeverDestroyed object. In the
3319 case of a Vector it was causing leaks.
3321 Adding a move constructor convinces the compiler to move the result
3322 of makeNeverDestroyed into the NeverDestroyed static. It doesn't actually
3323 invoke the move constructor here, which I believe means it is deciding
3324 to perform optional copy elision optimization.
3325 'http://en.cppreference.com/w/cpp/language/copy_elision
3327 2017-08-02 Filip Pizlo <fpizlo@apple.com>
3329 All C++ accesses to JSObject::m_butterfly should do caging
3330 https://bugs.webkit.org/show_bug.cgi?id=175039
3332 Reviewed by Keith Miller.
3334 Adds a smart pointer class that does various kinds of caging for you.
3336 * WTF.xcodeproj/project.pbxproj:
3337 * wtf/CMakeLists.txt:
3338 * wtf/CagedPtr.h: Added.
3339 (WTF::CagedPtr::CagedPtr):
3340 (WTF::CagedPtr::get const):
3341 (WTF::CagedPtr::getMayBeNull const):
3342 (WTF::CagedPtr::operator== const):
3343 (WTF::CagedPtr::operator!= const):
3344 (WTF::CagedPtr::operator bool const):
3345 (WTF::CagedPtr::operator* const):
3346 (WTF::CagedPtr::operator-> const):
3348 2017-08-02 Filip Pizlo <fpizlo@apple.com>
3350 We should be OK with the gigacage being disabled on gmalloc
3351 https://bugs.webkit.org/show_bug.cgi?id=175082
3353 Reviewed by Michael Saboff.
3356 (Gigacage::shouldBeEnabled):
3358 2017-08-01 Filip Pizlo <fpizlo@apple.com>
3360 Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
3361 https://bugs.webkit.org/show_bug.cgi?id=174727
3363 Reviewed by Mark Lam.
3365 For the Gigacage project to have minimal impact, we need to have some abstraction that allows code to
3366 avoid having to guard itself with #if's. This adds a Gigacage abstraction that overlays the Gigacage
3367 namespace from bmalloc, which always lets you call things like Gigacage::caged and Gigacage::tryMalloc.
3369 Because of how many places need to possibly allocate in a gigacage, or possibly perform caged accesses,
3370 it's better to hide the question of whether or not it's enabled inside this API.
3372 * WTF.xcodeproj/project.pbxproj:
3373 * wtf/CMakeLists.txt:
3374 * wtf/FastMalloc.cpp:
3375 * wtf/Gigacage.cpp: Added.
3376 (Gigacage::tryMalloc):
3377 (Gigacage::tryAllocateVirtualPages):
3378 (Gigacage::freeVirtualPages):
3379 (Gigacage::tryAlignedMalloc):
3380 (Gigacage::alignedFree):
3382 * wtf/Gigacage.h: Added.
3383 (Gigacage::ensureGigacage):
3384 (Gigacage::disableGigacage):
3385 (Gigacage::addDisableCallback):
3386 (Gigacage::removeDisableCallback):
3388 (Gigacage::isCaged):
3389 (Gigacage::tryAlignedMalloc):
3390 (Gigacage::alignedFree):
3393 2017-07-31 Matt Lewis <jlewis3@apple.com>
3395 Unreviewed, rolling out r220060.
3397 This broke our internal builds. Contact reviewer of patch for
3402 "Merge WTFThreadData to Thread::current"
3403 https://bugs.webkit.org/show_bug.cgi?id=174716
3404 http://trac.webkit.org/changeset/220060
3406 2017-07-31 Yusuke Suzuki <utatane.tea@gmail.com>
3408 Merge WTFThreadData to Thread::current
3409 https://bugs.webkit.org/show_bug.cgi?id=174716
3411 Reviewed by Sam Weinig.
3413 We placed thread specific data in WTFThreadData previously. But now, we have a new good place
3414 to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
3415 sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
3416 This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
3417 to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
3418 Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
3419 before calling WTF::initializeThreading.
3421 * WTF.xcodeproj/project.pbxproj:
3422 * wtf/CMakeLists.txt:
3423 * wtf/LockAlgorithm.h:
3424 * wtf/LockAlgorithmInlines.h:
3426 * wtf/ParkingLot.cpp:
3427 * wtf/StackStats.cpp:
3428 (WTF::StackStats::PerThreadStats::PerThreadStats):
3429 (WTF::StackStats::CheckPoint::CheckPoint):
3430 (WTF::StackStats::CheckPoint::~CheckPoint):
3431 (WTF::StackStats::probe):
3432 (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
3433 * wtf/ThreadHolder.cpp:
3434 (WTF::ThreadHolder::initializeCurrent):
3435 * wtf/ThreadHolder.h:
3436 (WTF::ThreadHolder::ThreadHolder):
3437 (WTF::ThreadHolder::currentMayBeNull):
3438 (WTF::ThreadHolder::current):
3439 * wtf/ThreadHolderPthreads.cpp:
3440 (WTF::ThreadHolder::initialize):
3441 (WTF::ThreadHolder::destruct):
3442 (WTF::ThreadHolder::current): Deleted.
3443 * wtf/ThreadHolderWin.cpp:
3444 (WTF::ThreadHolder::currentDying):
3445 (WTF::ThreadHolder::initialize):
3446 (WTF::ThreadHolder::current): Deleted.
3447 * wtf/Threading.cpp:
3448 (WTF::Thread::initializeInThread):
3449 (WTF::Thread::entryPoint):
3450 (WTF::Thread::didExit):
3451 (WTF::initializeThreading):
3452 (WTF::Thread::currentMayBeNull): Deleted.
3454 (WTF::Thread::atomicStringTable):
3455 (WTF::Thread::setCurrentAtomicStringTable):
3456 (WTF::Thread::stackStats):
3457 (WTF::Thread::savedStackPointerAtVMEntry):
3458 (WTF::Thread::setSavedStackPointerAtVMEntry):
3459 (WTF::Thread::savedLastStackTop):
3460 (WTF::Thread::setSavedLastStackTop):
3461 (WTF::Thread::current):
3462 * wtf/ThreadingPrimitives.h:
3463 * wtf/ThreadingPthreads.cpp:
3464 (WTF::Thread::createCurrentThread):
3465 (WTF::Thread::current): Deleted.
3466 * wtf/ThreadingWin.cpp:
3467 (WTF::Thread::createCurrentThread):
3468 (WTF::Thread::current): Deleted.
3469 * wtf/WTFThreadData.cpp: Removed.
3470 * wtf/WTFThreadData.h: Removed.
3471 * wtf/text/AtomicString.cpp:
3472 * wtf/text/AtomicStringImpl.cpp:
3474 * wtf/text/AtomicStringTable.cpp:
3475 (WTF::AtomicStringTable::create):
3476 * wtf/text/AtomicStringTable.h:
3478 2017-07-31 Xabier Rodriguez Calvar <calvaris@igalia.com>
3480 Created a bool pretty printer at WTF for debugging purposes
3481 https://bugs.webkit.org/show_bug.cgi?id=174893
3483 Reviewed by Darin Adler.
3485 * wtf/PrintStream.cpp:
3486 (WTF::printInternal): The overload taking bool uses boolForPrinting
3487 * wtf/PrintStream.h:
3488 (WTF::boolForPrinting): Converts a bool in "true" or "false".
3490 2017-07-30 Yusuke Suzuki <utatane.tea@gmail.com>
3492 [WTF] Introduce Private Symbols
3493 https://bugs.webkit.org/show_bug.cgi?id=174935
3495 Reviewed by Darin Adler.
3497 Upcoming proposal of class fields[1] requires private fields.
3498 The simple way to implement it is adding a property with a private symbol.
3499 Currently, we have private symbols for internal properties. They are usual
3500 Symbols managed by the hash table. So basically private symbols are statically
3501 created in BuiltinNames. However this new proposal encourages users to create
3502 such private symbols more and more.
3504 So, this patch introduces notion of "Private" into WTF SymbolImpl. This patch
3505 adds PrivateSymbolImpl. This is SymbolImpl with "Private" flag. We do not need
3506 to look up the symbol from the hash table to check whether the given symbol
3509 [1]: https://github.com/tc39/proposal-class-fields
3511 * wtf/text/StringImpl.h:
3512 * wtf/text/SymbolImpl.cpp:
3513 (WTF::PrivateSymbolImpl::create):
3514 (WTF::PrivateSymbolImpl::createNullSymbol):
3515 * wtf/text/SymbolImpl.h:
3516 (WTF::SymbolImpl::isPrivate):
3517 (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
3518 (WTF::SymbolImpl::SymbolImpl):
3519 (WTF::PrivateSymbolImpl::PrivateSymbolImpl):
3521 2017-07-30 Brady Eidson <beidson@apple.com>
3523 Add URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks.
3524 https://bugs.webkit.org/show_bug.cgi?id=174958
3526 Reviewed by Darin Adler.
3528 This patch adds a new template class "InstanceCounted<T>".
3530 For each specialization, "InstanceCounted" will keep track of the total number of
3531 instances in existence.
3533 This makes explicate leak checking in API tests possible.
3535 Since this adds some runtime and storage overhead the code that actually does anything
3536 is only compiled in debug builds.
3538 * WTF.xcodeproj/project.pbxproj:
3539 * wtf/InstanceCounted.h: Added.
3540 (WTF::InstanceCounted::InstanceCounted):
3541 (WTF::InstanceCounted::instanceCount):
3542 (WTF::InstanceCounted::~InstanceCounted):
3544 2017-07-27 Yusuke Suzuki <utatane.tea@gmail.com>
3546 [WTF] Drop Thread initialization wait in some platforms by introducing StackBounds::newThreadStackBounds(PlatformThreadHandle&)
3547 https://bugs.webkit.org/show_bug.cgi?id=174303
3549 Reviewed by Mark Lam.
3551 Currently, the caller thread of Thread::create() need to wait for completion of the initialization of the target thread.
3552 This is because we need to initialize Thread::m_stack in the target thread. Before this patch, a target thread's
3553 StackBounds can only be retrieved by the target thread itself. However, this potentially causes context-switching between
3554 the caller and the target threads and hurts efficiency of creating threads.
3556 Fortunately, in some platforms (including major platforms except for Windows), we can get StackBounds of a target
3557 thread from a caller thread. This allows us to avoid waiting for completion of thread initialization.
3559 In this patch, we introduce HAVE_STACK_BOUNDS_FOR_NEW_THREAD and StackBounds::newThreadStackBounds. When creating
3560 a new thread, we will use StackBounds::newThreadStackBounds to get StackBounds if possible. As a result, we
3561 do not need to wait for completion of thread initialization to ensure m_stack field of Thread is initialized.
3563 While some documents claim that it is possible on Windows to get the StackBounds of another thread[1], the method relies on
3564 undocumented Windows NT APIs (NtQueryInformationThread, NtReadVirtualMemory etc.). So in this patch, we just
3565 use the conservative approach simply waiting for completion of thread initialization.
3567 [1]: https://stackoverflow.com/questions/3918375/how-to-get-thread-stack-information-on-windows
3570 * wtf/StackBounds.cpp:
3571 (WTF::StackBounds::newThreadStackBounds):
3572 (WTF::StackBounds::currentThreadStackBoundsInternal):
3573 (WTF::StackBounds::initialize): Deleted.
3574 * wtf/StackBounds.h:
3575 (WTF::StackBounds::currentThreadStackBounds):
3576 (WTF::StackBounds::StackBounds):
3577 * wtf/Threading.cpp:
3578 (WTF::Thread::NewThreadContext::NewThreadContext):
3579 (WTF::Thread::entryPoint):
3580 (WTF::Thread::create):
3581 (WTF::Thread::initialize): Deleted.
3583 * wtf/ThreadingPrimitives.h:
3584 * wtf/ThreadingPthreads.cpp:
3585 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3586 (WTF::wtfThreadEntryPoint):
3587 (WTF::Thread::establishHandle):
3588 (WTF::Thread::initializeCurrentThreadInternal):
3589 (WTF::Thread::current):
3590 * wtf/ThreadingWin.cpp:
3591 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3592 (WTF::Thread::initializeCurrentThreadInternal):
3593 (WTF::Thread::current):
3594 * wtf/win/MainThreadWin.cpp:
3595 (WTF::initializeMainThreadPlatform):
3597 2017-07-27 JF Bastien <jfbastien@apple.com>
3599 Update lock benchmarks
3600 https://bugs.webkit.org/show_bug.cgi?id=174907
3602 Reviewed by Filip Pizlo.
3604 * benchmarks/ConditionSpeedTest.cpp:
3606 * benchmarks/LockFairnessTest.cpp:
3607 * benchmarks/LockSpeedTest.cpp:
3608 * benchmarks/ToyLocks.h:
3610 2017-07-26 Brian Burg <bburg@apple.com>
3612 Remove WEB_TIMING feature flag