87d94ecc6536d33edb2a864d48c68850b0d0f68c
[WebKit-https.git] / Source / WTF / ChangeLog
1 2017-11-07  Filip Pizlo  <fpizlo@apple.com>
2
3         Disable isoheaps on iOS
4
5         Reviewed by Ryosuke Niwa.
6
7         * wtf/IsoMalloc.h:
8
9 2017-11-07  Brady Eidson  <beidson@apple.com>
10
11         Implement "UpdateWorkerState" and use it
12         https://bugs.webkit.org/show_bug.cgi?id=179318
13
14         Reviewed by Chris Dumez.
15
16         * wtf/ObjectIdentifier.h:
17         (WTF::ObjectIdentifier::loggingString const):
18
19 2017-11-07  Michael Saboff  <msaboff@apple.com>
20
21         Add SPI function pointers qualifiers for CPU(ARM64E)
22         https://bugs.webkit.org/show_bug.cgi?id=179383
23
24         Reviewed by Mark Lam.
25
26         For ARM64E, use the appropriate SPI qualifiers for helper function pointers.
27
28         * wtf/BlockPtr.h:
29         (WTF::BlockPtr<R):
30
31 2017-10-31  Filip Pizlo  <fpizlo@apple.com>
32
33         bmalloc should support strictly type-segregated isolated heaps
34         https://bugs.webkit.org/show_bug.cgi?id=178108
35
36         Reviewed by Saam Barati, Simon Fraser, and Ryosuke Niwa.
37         
38         This just adds an easy way of using the bmalloc IsoHeap API in WebKit. If bmalloc is not
39         enabled, these macros will just make the object FastMalloced.
40
41         * WTF.xcodeproj/project.pbxproj:
42         * wtf/FastTLS.h:
43         * wtf/IsoMalloc.h: Added.
44         * wtf/IsoMallocInlines.h: Added.
45
46 2017-11-06  Christopher Reid  <chris.reid@sony.com>
47
48         Use enum classes within FileSystem
49         https://bugs.webkit.org/show_bug.cgi?id=175172
50
51         Reviewed by Myles C. Maxfield.
52
53         Adding a helper function for converting enum classes to their underlying type when necessary.
54
55         * wtf/EnumTraits.h:
56
57 2017-11-06  Michael Catanzaro  <mcatanzaro@igalia.com>
58
59         [WPE][GTK] Always use SET_AND_EXPOSE_TO_BUILD to set build variables
60         https://bugs.webkit.org/show_bug.cgi?id=179038
61
62         Reviewed by Žan Doberšek.
63
64         * wtf/Platform.h:
65
66 2017-11-03  Chris Dumez  <cdumez@apple.com>
67
68         Use a single identifier type to identify Service Workers
69         https://bugs.webkit.org/show_bug.cgi?id=179192
70
71         Reviewed by Brady Eidson.
72
73         Introduce class for strongly typed identifiers. This avoids mixing up
74         different types of identifiers.
75
76         * WTF.xcodeproj/project.pbxproj:
77         * wtf/ObjectIdentifier.h: Added.
78         (WTF::ObjectIdentifier::encode const):
79         (WTF::ObjectIdentifier::decode):
80         (WTF::ObjectIdentifier::operator== const):
81         (WTF::ObjectIdentifier::operator!= const):
82         (WTF::ObjectIdentifier::ObjectIdentifier):
83         (WTF::makeObjectIdentifier):
84         (WTF::ObjectIdentifierHash::hash):
85         (WTF::ObjectIdentifierHash::equal):
86         (WTF::HashTraits<ObjectIdentifier<T>>::emptyValue):
87         (WTF::HashTraits<ObjectIdentifier<T>>::constructDeletedValue):
88         (WTF::HashTraits<ObjectIdentifier<T>>::isDeletedValue):
89
90 2017-11-02  Ryan Haddad  <ryanhaddad@apple.com>
91
92         Unreviewed, rolling out r224353.
93
94         Breaks internal builds.
95
96         Reverted changeset:
97
98         "Ignore HSTS for partitioned, cross-origin subresource
99         requests"
100         https://bugs.webkit.org/show_bug.cgi?id=178993
101         https://trac.webkit.org/changeset/224353
102
103 2017-11-02  John Wilander  <wilander@apple.com>
104
105         Ignore HSTS for partitioned, cross-origin subresource requests
106         https://bugs.webkit.org/show_bug.cgi?id=178993
107         <rdar://problem/34962462>
108
109         Reviewed by Brent Fulgham and Alex Christensen.
110
111         * wtf/Platform.h:
112             Added HAVE_CFNETWORK_IGNORE_HSTS.
113
114 2017-11-02  Frederic Wang  <fwang@igalia.com>
115
116         Add references to bug 179167 in FIXME comments
117         https://bugs.webkit.org/show_bug.cgi?id=179168
118
119         Reviewed by Daniel Bates.
120
121         * wtf/FeatureDefines.h:
122
123 2017-11-01  Jiewen Tan  <jiewen_tan@apple.com>
124
125         Let is<T>() accept RefPtrs
126         https://bugs.webkit.org/show_bug.cgi?id=178612
127         <rdar://problem/35102004>
128
129         Reviewed by Ryosuke Niwa.
130
131         Add support for is<T>() for RefPtrs.
132
133         * wtf/RefPtr.h:
134         (WTF::is):
135
136 2017-11-01  Simon Fraser  <simon.fraser@apple.com>
137
138         Misc display list and other cleanup
139         https://bugs.webkit.org/show_bug.cgi?id=179150
140
141         Reviewed by Tim Horton.
142
143         Add system trace points for display list recording.
144
145         * wtf/SystemTracing.h:
146
147 2017-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
148
149         Use LazyNeverDestroyed instead of DEFINE_GLOBAL
150         https://bugs.webkit.org/show_bug.cgi?id=174979
151
152         Reviewed by Yusuke Suzuki.
153
154         DEFINE_GLOBAL is not used anymore. Remove it.
155
156         * WTF.xcodeproj/project.pbxproj: Removed StaticConstructors.h
157         * config.h: Removed definitions of SKIP_STATIC_CONSTRUCTORS_ON_MSVC and SKIP_STATIC_CONSTRUCTORS_ON_GCC.
158         * wtf/CMakeLists.txt: Removed StaticConstructors.h
159         * wtf/StaticConstructors.h: Removed.
160
161 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
162
163         [WPE] Fix build warnings
164         https://bugs.webkit.org/show_bug.cgi?id=178899
165
166         Reviewed by Carlos Alberto Lopez Perez.
167
168         * wtf/PlatformWPE.cmake:
169
170 2017-10-27  Yousuke Kimoto  <yousuke.kimoto@sony.com>
171
172         [WinCairo] Add WTF files for wincairo webkit
173         https://bugs.webkit.org/show_bug.cgi?id=176894
174
175         Reviewed by Alex Christensen.
176
177         * wtf/PlatformWin.cmake:
178         * wtf/WorkQueue.cpp:
179         * wtf/WorkQueue.h:
180         * wtf/win/Win32Handle.h:
181         * wtf/win/WorkItemContext.cpp: Added.
182         (WTF::WorkItemContext::WorkItemContext):
183         (WTF::WorkItemContext::create):
184         (WTF::WorkItemContext::~WorkItemContext):
185         * wtf/win/WorkItemContext.h: Added.
186         (WTF::WorkItemContext::handle):
187         (WTF::WorkItemContext::waitHandle):
188         (WTF::WorkItemContext::Function<void):
189         (WTF::WorkItemContext::queue const):
190         * wtf/win/WorkQueueWin.cpp:
191         (WTF::WorkQueue::handleCallback):
192         (WTF::WorkQueue::registerHandle):
193         (WTF::WorkQueue::unregisterAndCloseHandle):
194         (WTF::WorkQueue::unregisterWaitAndDestroyItemSoon):
195         (WTF::WorkQueue::unregisterWaitAndDestroyItemCallback):
196
197 2017-10-27  Keith Miller  <keith_miller@apple.com>
198
199         Add unified source list files and build scripts to Xcode project navigator
200         https://bugs.webkit.org/show_bug.cgi?id=178959
201
202         Reviewed by Andy Estes.
203
204         * WTF.xcodeproj/project.pbxproj:
205
206 2017-10-26  Mark Lam  <mark.lam@apple.com>
207
208         JSRopeString::RopeBuilder::append() should check for overflows.
209         https://bugs.webkit.org/show_bug.cgi?id=178385
210         <rdar://problem/35027468>
211
212         Reviewed by Saam Barati.
213
214         * wtf/CheckedArithmetic.h:
215
216 2017-10-25  Commit Queue  <commit-queue@webkit.org>
217
218         Unreviewed, rolling out r222945.
219         https://bugs.webkit.org/show_bug.cgi?id=178818
220
221         "It made WasmBench crash" (Requested by saamyjoon on #webkit).
222
223         Reverted changeset:
224
225         "bmalloc mutex should be adaptive"
226         https://bugs.webkit.org/show_bug.cgi?id=177839
227         https://trac.webkit.org/changeset/222945
228
229 2017-10-25  Zan Dobersek  <zdobersek@igalia.com>
230
231         Make SERVICE_WORKER feature buildable on GTK, WPE
232         https://bugs.webkit.org/show_bug.cgi?id=178574
233
234         Reviewed by Carlos Garcia Campos.
235
236         * wtf/Identified.h: Explicitly include the <atomic> header since
237         std::atomic<> is used in the ThreadSafeIdentified definition.
238
239 2017-10-24  Michael Saboff  <msaboff@apple.com>
240
241         WTF: Eliminated PLATFORM checks for HAVE_MACH_EXCEPTIONS
242         https://bugs.webkit.org/show_bug.cgi?id=178747
243
244         Reviewed by Saam Barati.
245
246         Removed unnecessary PLATFORM checks as they can cause build failures
247         when the include file is present.
248
249         * wtf/Platform.h:
250
251 2017-10-23  Yusuke Suzuki  <utatane.tea@gmail.com>
252
253         [JSC] Use fastJoin in Array#toString
254         https://bugs.webkit.org/show_bug.cgi?id=178062
255
256         Reviewed by Darin Adler.
257
258         A bit cleaning up to use StringImpl::copyChars instead of
259         using for-loop directly.
260
261         * wtf/text/StringView.h:
262         (WTF::StringView::getCharactersWithUpconvert const):
263
264 2017-10-20  Antoine Quint  <graouts@apple.com>
265
266         [Web Animations] Provide basic timeline and animation interfaces
267         https://bugs.webkit.org/show_bug.cgi?id=178526
268
269         Reviewed by Dean Jackson.
270
271         Remove the WEB_ANIMATIONS compile-time flag.
272
273         * wtf/FeatureDefines.h:
274
275 2017-10-19  Keith Miller  <keith_miller@apple.com>
276
277         REGRESSION (r223476): WebCore exports symbols with names belonging to other frameworks
278         https://bugs.webkit.org/show_bug.cgi?id=178424
279
280         Reviewed by David Kilzer.
281
282         This patch moves the wrapper function sharing the name of the externed function
283         to the source file and marks it as always inline. Marking it as inline prevents
284         the framework from exporting it.
285
286         * wtf/cocoa/SoftLinking.h:
287
288 2017-10-18  Keith Miller  <keith_miller@apple.com>
289
290         Setup WebCore build to start using unified sources.
291         https://bugs.webkit.org/show_bug.cgi?id=178362
292
293         Reviewed by Tim Horton.
294
295         There are a number of changes to the bundler script. First, it is
296         now possible to enable or disable building files based on if the
297         associated feature flag is enabled or not. The syntax for this is
298         similar to how we do #ifs in C++ code. e.g.
299
300         #if ENABLE_APPLE_PAY
301             myApplePayFile.cpp
302         #endif
303
304         would enable myApplePayFile.cpp if and only if the APPLE_PAY
305         feature define is set.
306
307         I also changed comments from # to // to make it less likely they
308         would be confused with a #if.
309
310         Finally, this patch enables bundling files in the same relative
311         directory across source list files. Previously, if
312         SourcesCocoa.txt had platform/cf/foo.cpp and SourcesMac.txt had
313         platform/cf/bar.cpp those files would not be put in the same
314         unified source bundle. Now, those files will be put into the same
315         bundle but bar.cpp will always follow foo.cpp. The idea is that by
316         putting more specific files after more general files we can avoid
317         random build failures.
318
319         * Scripts/generate-unified-source-bundles.rb:
320
321 2017-10-18  Konstantin Tokarev  <annulen@yandex.ru>
322
323         REGRESSION(r217771): nullTerminatedWCharToString loses last character of input string
324         https://bugs.webkit.org/show_bug.cgi?id=178444
325
326         Reviewed by Per Arne Vollan.
327
328         * wtf/text/win/WCharStringExtras.h:
329         (WTF::nullTerminatedWCharToString):
330
331 2017-10-17  Keith Miller  <keith_miller@apple.com>
332
333         Change WebCore sources to work with unified source builds
334         https://bugs.webkit.org/show_bug.cgi?id=178229
335
336         Rubber stamped by Tim Horton.
337
338         * wtf/Platform.h:
339         * wtf/cocoa/SoftLinking.h:
340
341 2017-10-16  David Kilzer  <ddkilzer@apple.com>
342
343         Add RELEASE_ASSERT_WITH_SECURITY_IMPLICATION() macro
344         <https://webkit.org/b/178269>
345
346         Reviewed by Alex Christensen.
347
348         * wtf/Assertions.h:
349         (RELEASE_ASSERT_WITH_SECURITY_IMPLICATION): Add macro.
350
351 2017-10-14  Sam Weinig  <sam@webkit.org>
352
353         Remove HashCountedSet's copyToVector functions
354         https://bugs.webkit.org/show_bug.cgi?id=178215
355
356         Reviewed by Daniel Bates.
357
358         * wtf/HashCountedSet.h:
359         (WTF::copyToVector): Deleted.
360         
361             They are replaced by either copyToVector(hashCountedSet) or copyToVector(hashCountedSet.values())
362
363 2017-10-13  Sam Weinig  <sam@webkit.org>
364
365         Adopt type trait template aliases everywhere in WTF
366         https://bugs.webkit.org/show_bug.cgi?id=178299
367
368         Reviewed by Yusuke Suzuki.
369
370         Adopt type trait template aliases (e.g. replace 'typename std::make_unsigned<Source>::type'
371         with 'std::make_unsigned_t<Source>'). Also adopt using over typedef consistently.
372
373         * wtf/Atomics.h:
374         * wtf/CagedUniquePtr.h:
375         * wtf/CheckedArithmetic.h:
376         * wtf/CompletionHandler.h:
377         * wtf/Function.h:
378         * wtf/HashCountedSet.h:
379         * wtf/HashFunctions.h:
380         * wtf/HashMap.h:
381         * wtf/HashSet.h:
382         * wtf/HashTable.h:
383         * wtf/HashTraits.h:
384         * wtf/IndexedContainerIterator.h:
385         * wtf/IteratorAdaptors.h:
386         * wtf/KeyValuePair.h:
387         * wtf/LEBDecoder.h:
388         * wtf/ListHashSet.h:
389         * wtf/MathExtras.h:
390         * wtf/NeverDestroyed.h:
391         * wtf/OptionSet.h:
392         * wtf/RetainPtr.h:
393         * wtf/SizeLimits.cpp:
394         * wtf/StdLibExtras.h:
395         * wtf/SystemFree.h:
396         * wtf/ThreadSpecific.h:
397         * wtf/TypeCasts.h:
398         * wtf/Vector.h:
399         * wtf/text/IntegerToStringConversion.h:
400
401 2017-10-13  Jer Noble  <jer.noble@apple.com>
402
403         Performance: Skip texture upload if source image and destination texture haven't changed
404         https://bugs.webkit.org/show_bug.cgi?id=178254
405         <rdar://problem/34968181>
406
407         Reviewed by Dean Jackson.
408
409         Add a new class, UnsafePointer, for safely holding pointers to objects with uncontrolled lifetimes.
410
411         * WTF.xcodeproj/project.pbxproj:
412         * wtf/UnsafePointer.h: Added.
413         (WTF::UnsafePointer::UnsafePointer):
414         (WTF::UnsafePointer::operator== const):
415         (WTF::UnsafePointer::operator!= const):
416         (WTF::UnsafePointer::operator bool const):
417         (WTF::operator==):
418         (WTF::operator!=):
419
420 2017-10-13  Per Arne Vollan  <pvollan@apple.com>
421
422         [Win] When built with VS2017, MiniBrowser crashes on startup.
423         https://bugs.webkit.org/show_bug.cgi?id=175209
424
425         Reviewed by Daniel Bates.
426
427         Add AtomicString(const StaticStringImpl*) constructor. This is needed since
428         this patch adds constexpr to the static, global StaticStringImpl objects
429         generated in WebCore/bindings/scripts/StaticString.pm.
430
431         * wtf/text/AtomicString.h:
432         (WTF::AtomicString::AtomicString):
433         * wtf/text/AtomicStringImpl.cpp:
434         (WTF::addStatic):
435         (WTF::AtomicStringImpl::add):
436         * wtf/text/AtomicStringImpl.h:
437         * wtf/text/StringImpl.h:
438         (WTF::StringImpl::assertHashIsCorrect const):
439         (WTF::StringImpl::assertHashIsCorrect): Deleted.
440
441 2017-10-12  Alex Christensen  <achristensen@webkit.org>
442
443         Add Expected, HashMap, HashSet, and SHA1 to wtf/Forward.h
444         https://bugs.webkit.org/show_bug.cgi?id=178243
445
446         Reviewed by Tim Horton.
447
448         * wtf/Forward.h:
449         * wtf/HashMap.h:
450         Move default parameters to Forward.h like we did with Vector.
451         * wtf/HashSet.h:
452         Also fix indentation.
453
454 2017-10-12  Alex Christensen  <achristensen@webkit.org>
455
456         Add CompletionHandler and HashCountedSet to wtf/Forward.h
457         https://bugs.webkit.org/show_bug.cgi?id=178231
458
459         Reviewed by Tim Horton.
460
461         * wtf/Forward.h:
462         * wtf/HashCountedSet.h:
463
464 2017-10-11  Sam Weinig  <sam@webkit.org>
465
466         Remove out-parameter variants of copyToVector
467         https://bugs.webkit.org/show_bug.cgi?id=178155
468
469         Reviewed by Tim Horton.
470
471         * wtf/HashMap.h:
472         (WTF::copyToVector): Deleted.
473         * wtf/HashSet.h:
474         (WTF::copyToVector): Deleted.
475         
476             Remove copyToVector.
477         
478         * wtf/Vector.h:
479         (WTF::copyToVectorSpecialization):
480         
481             Add another version of copyToVector, called copyToVectorSpecialization, that allows
482             you to specify the entire specialization for the Vector you want to copy to. This
483             can be useful if you want your resulting Vector to have an inline capacity. 
484
485 2017-10-12  Sam Weinig  <sam@webkit.org>
486
487         It should be possible to iterate just the values (and not the counts) of a HashCountedSet
488         https://bugs.webkit.org/show_bug.cgi?id=178169
489
490         Reviewed by Daniel Bates.
491
492         Cleanup (fix indentation, simplify type names, adopt using), and add a values() range to
493         HashCountedSet. This will allow getting a Vector of all the values (and not the counts)
494         using the new copyToVector. 
495
496         * wtf/HashCountedSet.h:
497
498 2017-10-11  Michael Saboff  <msaboff@apple.com>
499
500         [JSC] Add ability to build with ARMV8 ILP32 ABI
501         https://bugs.webkit.org/show_bug.cgi?id=178194
502
503         Reviewed by Saam Barati.
504
505         For ARMV8 32 bit ABI, use JSVALUE32_64 and the CLOOP.
506
507         * wtf/Platform.h:
508
509 2017-10-11  Youenn Fablet  <youenn@apple.com>
510
511         Add API to clean CacheStorage data
512         https://bugs.webkit.org/show_bug.cgi?id=178034
513
514         Reviewed by Chris Dumez.
515
516         Moving CallbackAggregator pattern into its own class for easier reuse.
517
518         * WTF.xcodeproj/project.pbxproj:
519         * wtf/CallbackAggregator.h: Added.
520         (WTF::CallbackAggregator::create):
521         (WTF::CallbackAggregator::~CallbackAggregator):
522         (WTF::CallbackAggregator::CallbackAggregator):
523
524 2017-10-10  Sam Weinig  <sam@webkit.org>
525
526         Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values())
527         https://bugs.webkit.org/show_bug.cgi?id=178102
528
529         Reviewed by Tim Horton.
530
531         * wtf/HashMap.h:
532         (WTF::copyKeysToVector): Deleted.
533         (WTF::copyValuesToVector): Deleted.
534         
535             Remove copyKeysToVector and copyValuesToVector which are no longer used.
536
537 2017-10-09  Youenn Fablet  <youenn@apple.com>
538
539         Vector should be able to easily create from a list of movable only items
540         https://bugs.webkit.org/show_bug.cgi?id=176432
541
542         Reviewed by Darin Adler.
543
544         Adding static from method to construct a Vector from movable-only items.
545         This may also be used instead of initializer list constructor for types that would benefit of being moved.
546
547         * wtf/Vector.h:
548         (WTF::Vector::Vector):
549         (WTF::Vector::from):
550         (WTF::Vector::uncheckedInitialize): Introduced as an optimization to set the vector size once.
551         (WTF::Malloc>::reserveInitialCapacity):
552
553 2017-10-09  Tim Horton  <timothy_horton@apple.com>
554
555         Disable INPUT_TYPE_COLOR in FeatureDefines.h
556         https://bugs.webkit.org/show_bug.cgi?id=178103
557         <rdar://problem/34872127>
558
559         Reviewed by Simon Fraser.
560
561         * wtf/FeatureDefines.h:
562         Because FeatureDefines.h overrides features that are not enabled in
563         FeatureDefines.xcconfig, you currently have to turn INPUT_TYPE_COLOR
564         off in two places. Since we only ever want it on for Mac, it's OK
565         to depend on the xcconfig defining it.
566
567 2017-10-09  Sam Weinig  <sam@webkit.org>
568
569         Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
570         https://bugs.webkit.org/show_bug.cgi?id=178072
571
572         Reviewed by Darin Adler.
573
574         Introduce SizedIteratorRange, a variant of IteratorRange that includes
575         a reference to a backing container in order to get the size of container.
576         This is useful for algorithms like WTF::map and WTF::copyToVector, that
577         can use the size to efficiently allocate things of the correct size.
578
579         The main beneficiary are HashMap's keys() and values() functions which
580         used to return IteratorRanges and now return SizedIteratorRange. This
581         allows us to remove (in a future change) copyKeysToVector() and
582         copyValuesToVector() by replacing them with copyToVector(map.keys()) and
583         copyToVector(map.values()) respectively.
584
585         * wtf/HashMap.h:
586         * wtf/IteratorRange.h:
587         (WTF::SizedIteratorRange::SizedIteratorRange):
588         (WTF::SizedIteratorRange::size const):
589         (WTF::SizedIteratorRange::begin const):
590         (WTF::SizedIteratorRange::end const):
591         (WTF::makeSizedIteratorRange):
592
593 2017-10-08  Sam Weinig  <sam@webkit.org>
594
595         It should be possible to create a ListHashSet with a std::initializer_list.
596         https://bugs.webkit.org/show_bug.cgi?id=178070
597
598         Reviewed by Darin Adler.
599
600         * wtf/ListHashSet.h:
601         (WTF::U>::ListHashSet):
602         Add a constructor that takes a std::initializer_list.
603
604 2017-10-08  Sam Weinig  <sam@webkit.org>
605
606         Address additional feedback from Darin for r223039 and sort the using declarations.
607
608         * wtf/Vector.h:
609
610 2017-10-08  Sam Weinig  <sam@webkit.org>
611
612         There should be a version of copyToVector that returns a Vector, rather than using an out parameter
613         https://bugs.webkit.org/show_bug.cgi?id=177732
614
615         Reviewed by Saam Barati.
616
617         Add two new helper functions, copyToVector and copyToVectorOf, which will be able to
618         replace the existing out parameter taking copyToVector. Like it's ancestral namesake,
619         copyToVector takes an object that is both iterable (supports begin() and end()) and
620         has a size, and returns a Vector with a copy of all the items iterated. The copyToVectorOf
621         variant allow the user to specify a type to convert to, so if you have a HashSet<int>
622         but want those as floats in a Vector, you can do:
623         
624             auto floatVector = copyToVectorOf<float>(intSet);
625
626         * wtf/Vector.h:
627         (WTF::copyToVector):
628         (WTF::copyToVectorOf):
629
630 2017-10-08  Darin Adler  <darin@apple.com>
631
632         Fix bugs related to setting reflected floating point DOM attributes
633         https://bugs.webkit.org/show_bug.cgi?id=178061
634
635         Reviewed by Sam Weinig.
636
637         * wtf/dtoa.cpp:
638         (WTF::formatStringTruncatingTrailingZerosIfNeeded): Fix a bug where
639         this function would remove trailing zeroes from the exponent if
640         present instead of from the mantissa. This meant that it would
641         format 1e10 as "1.00000e+1" instead of "1e+10". Added regression
642         tests for this to TestWebKitAPI.
643
644         * wtf/dtoa/utils.h:
645         (WTF::double_conversion::StringBuilder::RemoveCharacters): Added.
646         Used by the fix above.
647
648         * wtf/text/AtomicString.cpp:
649         (WTF::AtomicString::number): Note: This function is used by code
650         that sets the values of reflected floating point DOM attributes.
651         Changed the function to use the rules from numberToString rather
652         ones from numberToFixedPrecisionString. This is analogous to
653         String::numberToStringECMAScript, and in the future we should change
654         String and StringBuilder so this "ECMAScript" semantic is the default
655         way to convert a floating point number to a string, and rename the fixed
656         precision version that is currently called String::number. I audited
657         the small number of sites calling AtomicString::number, by temporarily
658         renaming it, and discovered that this is the correct behavior for all;
659         none needed fixed precision. Also, fixed a mistake where this explicitly
660         converted to String. That was defeating the purpose of having these
661         functions in AtomicString: It would allocate a new String and then
662         destroy it in the case where an equal string was already in the
663         AtomicString table.
664
665 2017-10-06  Commit Queue  <commit-queue@webkit.org>
666
667         Unreviewed, rolling out r222791 and r222873.
668         https://bugs.webkit.org/show_bug.cgi?id=178031
669
670         Caused crashes with workers/wasm LayoutTests (Requested by
671         ryanhaddad on #webkit).
672
673         Reverted changesets:
674
675         "WebAssembly: no VM / JS version of everything but Instance"
676         https://bugs.webkit.org/show_bug.cgi?id=177473
677         http://trac.webkit.org/changeset/222791
678
679         "WebAssembly: address no VM / JS follow-ups"
680         https://bugs.webkit.org/show_bug.cgi?id=177887
681         http://trac.webkit.org/changeset/222873
682
683 2017-10-06  Antti Koivisto  <antti@apple.com>
684
685         Minor WeakPtr improvements
686         https://bugs.webkit.org/show_bug.cgi?id=177958
687
688         Reviewed by Sam Weinig.
689
690         * wtf/WeakPtr.h:
691         (WTF::WeakPtr::operator bool const):
692
693             Make explicit.
694
695         (WTF::WeakPtrFactory::createWeakPtr const):
696         (WTF::makeWeakPtr):
697
698             Remove templating from createWeakPtr, makeWeakPtr() is now the
699             canonical way to make derived-type WeakPtrs.
700
701 2017-10-04  Filip Pizlo  <fpizlo@apple.com>
702
703         bmalloc mutex should be adaptive
704         https://bugs.webkit.org/show_bug.cgi?id=177839
705
706         Reviewed by Michael Saboff.
707         
708         Add some comments that I thought of while copy-pasting this code.
709
710         Reland after fixing ancient WordLock bug: the notify_one has to happen with the lock held
711         to ensure it doesn't run after that thread has died.
712
713         * wtf/LockAlgorithmInlines.h:
714         * wtf/WordLock.cpp:
715
716 2017-10-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
717
718         Generate a compile error if release is built without compiler optimizations
719         https://bugs.webkit.org/show_bug.cgi?id=177665
720
721         Reviewed by Brian Burg.
722
723         For GCC and Clang, generate an error at build time that will alert
724         the developer that she is trying to build Release without any compiler
725         optimization. A build time error is much better than an unexpected
726         "oh, WebKit is really slow ..."  situation later.
727
728         If this was intended, then we tell the developer that she can continue
729         by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
730         flags.
731
732         The intention of this patch is to ensure that nobody builds Release
733         without enabling compiler optimization by mistake.
734
735         * wtf/Compiler.h:
736
737 2017-10-05  David Kilzer  <ddkilzer@apple.com>
738
739         Bug 177893: Disable -Wcast-qual for new clang compiler in Apple ports
740         <https://webkit.org/b/177893>
741         <rdar://problem/33667497>
742
743         Reviewed by Tim Horton.
744
745         * wtf/RetainPtr.h:
746         (WTF::RetainPtr::fromStorageType const): Disable warnings for
747         -Wcast-qual until we can provide a safe cast function that lets
748         us re-enable the warning.
749
750 2017-10-05  Matt Lewis  <jlewis3@apple.com>
751
752         Unreviewed, rolling out r222893.
753
754         This caused multiple API failures.
755
756         Reverted changeset:
757
758         "bmalloc mutex should be adaptive"
759         https://bugs.webkit.org/show_bug.cgi?id=177839
760         http://trac.webkit.org/changeset/222893
761
762 2017-10-04  Filip Pizlo  <fpizlo@apple.com>
763
764         bmalloc mutex should be adaptive
765         https://bugs.webkit.org/show_bug.cgi?id=177839
766
767         Reviewed by Michael Saboff.
768         
769         Add some comments that I thought of while copy-pasting this code.
770
771         * wtf/LockAlgorithmInlines.h:
772         * wtf/WordLock.cpp:
773
774 2017-10-04  JF Bastien  <jfbastien@apple.com>
775
776         WTF: Update std::expected to match current proposal
777         https://bugs.webkit.org/show_bug.cgi?id=177881
778
779         Reviewed by Mark Lam.
780
781         The proposal is likely to be in C++20 and I've been asked to help co-champion
782         it. I'm therefore updating our implementation to more closely match the current
783         proposal, and to make sure it'll work for us if standardized.
784
785          - Rename UnexpectedType to Unexpected to match the proposal.
786          - Remove relational operators, only equality / inequality remains.
787          - Fix minor type signatures.
788          - Add UnexpectedType typedef.
789          - Uncomment rebind implementation.
790          - Add in-place construction tag, as well as explicit error construction tag.
791          - Add template unexpected constructor.
792          - Note that make_unexpected isn't in the proposal anymore, but we keep it because we don't have C++17 deduction guides.
793          - Remove hashing, which isn't in the proposal anymore.
794
795         * wtf/Expected.h:
796         (WTF::Unexpected::Unexpected):
797         (WTF::Unexpected::value const):
798         (WTF::operator==):
799         (WTF::operator!=):
800         (WTF::makeUnexpected):
801         (WTF::Expected::Expected):
802         (WTF::Expected::operator=):
803         (WTF::Expected::getUnexpected const):
804
805 2017-10-04  Ryan Haddad  <ryanhaddad@apple.com>
806
807         Unreviewed, rolling out r222840.
808
809         This change breaks internal builds.
810
811         Reverted changeset:
812
813         "Generate a compile error if release is built without compiler
814         optimizations"
815         https://bugs.webkit.org/show_bug.cgi?id=177665
816         http://trac.webkit.org/changeset/222840
817
818 2017-10-04  Carlos Alberto Lopez Perez  <clopez@igalia.com>
819
820         Generate a compile error if release is built without compiler optimizations
821         https://bugs.webkit.org/show_bug.cgi?id=177665
822
823         Reviewed by Michael Catanzaro.
824
825         For GCC and Clang, generate an error at build time that will alert
826         the developer that she is trying to build Release without any compiler
827         optimization. A build time error is much better than an unexpected
828         "oh, WebKit is really slow ..."  situation later.
829
830         If this was intended, then we tell the developer that she can continue
831         by just setting -DRELEASE_WITHOUT_OPTIMIZATIONS in the list of build
832         flags.
833
834         The intention of this patch is to ensure that nobody builds Release
835         without enabling compiler optimization by mistake.
836
837         * wtf/Compiler.h:
838
839 2017-10-04  Tomas Popela  <tpopela@redhat.com>
840
841         Allow building without WOFF enabled
842
843         Reviewed by Michael Catanzaro.
844
845         Don't force the WOFF to be turned on, but follow what is set in cmake.
846
847         * wtf/Platform.h:
848
849 2017-10-03  Saam Barati  <sbarati@apple.com>
850
851         Implement polymorphic prototypes
852         https://bugs.webkit.org/show_bug.cgi?id=176391
853
854         Reviewed by Filip Pizlo.
855
856         * wtf/Box.h:
857         (WTF::Box::operator bool const):
858         (WTF::Box::operator bool): Deleted.
859         Make Box movable. Also ensure its operator bool doesn't do an atomic increment.
860         * wtf/RefPtr.h:
861         (WTF::RefPtr::operator bool const):
862         Add `explicit operator bool()` for RefPtr.
863
864 2017-10-03  Antti Koivisto  <antti@apple.com>
865
866         Allow assigning WeakPtr<Derived> to WeakPtr<Base>
867         https://bugs.webkit.org/show_bug.cgi?id=177817
868
869         Reviewed by Geoff Garen.
870
871         Add templated copy/move constructors/assignment operators, similar to RefPtr.
872
873         * wtf/WeakPtr.h:
874         (WTF::WeakPtrFactory::createWeakPtr const):
875         (WTF::weak_reference_upcast):
876         (WTF::weak_reference_downcast):
877         (WTF::WeakPtr<T>::WeakPtr):
878         (WTF::=):
879         (WTF::makeWeakPtr):
880
881 2017-10-03  JF Bastien  <jfbastien@apple.com>
882
883         WebAssembly: no VM / JS version of everything but Instance
884         https://bugs.webkit.org/show_bug.cgi?id=177473
885
886         Reviewed by Filip Pizlo.
887
888         * wtf/StdLibExtras.h:
889         (WTF::default_construct_at): this makes code in WasmTable much
890         more readable, and is generally useful for generic code
891
892 2017-10-02  Myles C. Maxfield  <mmaxfield@apple.com>
893
894         Move LineEnding.{h,cpp} from WebCore/platform/text to wtf/text
895         https://bugs.webkit.org/show_bug.cgi?id=176575
896
897         Reviewed by Alex Christensen.
898
899         As part of the PAL effort, we're trying to move everything out of WebCore/platform, one-by-one.
900         These LineEnding files belong in WTF.
901
902         * WTF.xcodeproj/project.pbxproj:
903         * wtf/text/LineEnding.cpp: Renamed from Source/WebCore/platform/text/LineEnding.cpp.
904         (WTF::normalizeLineEndingsToCRLF):
905         * wtf/text/LineEnding.h: Renamed from Source/WebCore/platform/text/LineEnding.h.
906
907 2017-10-02  Geoffrey Garen  <ggaren@apple.com>
908
909         WeakPtr should have a move constructor
910         https://bugs.webkit.org/show_bug.cgi?id=177789
911
912         Reviewed by Chris Dumez.
913
914         * wtf/WeakPtr.h: Now that we just have a RefPtr data member,
915         the default operators are sufficient.
916
917 2017-10-02  Geoffrey Garen  <ggaren@apple.com>
918
919         NULL WeakPtr should not malloc!
920         https://bugs.webkit.org/show_bug.cgi?id=177773
921
922         Reviewed by Antti Koivisto.
923
924         Translating NULL into malloc is... inefficient.
925
926         * wtf/WeakPtr.h:
927         (WTF::WeakPtr::WeakPtr):
928         (WTF::WeakPtr::operator=):
929         (WTF::WeakPtr::clear): Make m_ref lazy so that a NULL m_ref can represent
930         a NULL pointer. Normal dereference is no slower because we can rely on
931         the fact that dereference of NULL should crash. operator bool() and get()
932         incur an extra branch. That's probably worth it to avoid malloc
933         for NULL.
934
935 2017-10-02  Antti Koivisto  <antti@apple.com>
936
937         Add makeWeakPtr variant that takes pointer
938         https://bugs.webkit.org/show_bug.cgi?id=177767
939
940         Reviewed by Zalan Bujtas.
941
942         * wtf/WeakPtr.h:
943         (WTF::makeWeakPtr):
944
945         This version deals with the nullptr.
946
947 2017-09-30  Antti Koivisto  <antti@apple.com>
948
949         Add makeWeakPtr for easier WeakPtr construction
950         https://bugs.webkit.org/show_bug.cgi?id=177706
951
952         Reviewed by Sam Weinig.
953
954         Standalone makeWeakPtr() returns a WeakPtr of the same type as the argument.
955
956         For this to work the argument type needs to expose a (possibly base type) WeakPtrFactory
957         as a public weakPtrFactory() member function.
958
959         * wtf/WeakPtr.h:
960         (WTF::WeakPtr::operator-> const):
961         (WTF::WeakPtr::operator* const): Also add operator*.
962         (WTF::makeWeakPtr):
963
964 2017-09-28  Jiewen Tan  <jiewen_tan@apple.com>
965
966         WeakPtrFactory should allow downcasting
967         https://bugs.webkit.org/show_bug.cgi?id=177389
968         <rdar://problem/34604174>
969
970         Reviewed by Geoffrey Garen.
971
972         In this patch, WeakPtrFactory is enhanced with the ability to create WeakPtrs
973         of its owner's sub classes and have them point to the same WeakReference.
974
975         * wtf/WeakPtr.h:
976         (WTF::WeakPtr::WeakPtr):
977         We cannot determine the base class of type T, thus no friends. It is made public
978         such that WeakPtrFactory with a base class type U can create a derived type T
979         WeakPtr.
980         (WTF::WeakPtrFactory::createWeakPtr const):
981
982 2017-09-28  Don Olmstead  <don.olmstead@sony.com>
983
984         Sync SYSTEM_MALLOC implementation of Gigacage
985         https://bugs.webkit.org/show_bug.cgi?id=177569
986
987         Reviewed by Mark Lam.
988
989         * wtf/Gigacage.h:
990         (Gigacage::basePtr):
991         (Gigacage::basePtrs):
992
993 2017-09-27  Per Arne Vollan  <pvollan@apple.com>
994
995         [Win64] Compile error, 'BasePtrs' is undefined.
996         https://bugs.webkit.org/show_bug.cgi?id=177565
997
998         Reviewed by Mark Lam.
999
1000         Copy definition of 'BasePtrs' from bmalloc/GigaCage.h.
1001
1002         * wtf/Gigacage.h:
1003
1004 2017-09-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
1005
1006         Followup (r222427): SynchronizedFixedQueue should not have a public constructor
1007         https://bugs.webkit.org/show_bug.cgi?id=177458
1008
1009         Reviewed by Tim Horton.
1010
1011         Since SynchronizedFixedQueue is now derived from ThreadSafeRefCounted<SynchronizedFixedQueue>,
1012         the standard way to have an instance of it is to call SynchronizedFixedQueue::create()
1013         which returns a Ref<SynchronizedFixedQueue>. Now it does not make sense to still
1014         have the constructor public.
1015
1016         * wtf/SynchronizedFixedQueue.h:
1017         (WTF::SynchronizedFixedQueue::SynchronizedFixedQueue):
1018
1019 2017-09-24  Keith Miller  <keith_miller@apple.com>
1020
1021         JSC build should use unified sources for derived sources
1022         https://bugs.webkit.org/show_bug.cgi?id=177421
1023
1024         Reviewed by JF Bastien.
1025
1026         The script now needs to determine if a file is from a derived
1027         source. This is only relevant for the CMake build since the
1028         script needs to provide a list of the bundled source files. If the
1029         script does not provide the full path for derived sources then
1030         CMake will be unable to find them and the build will fail.
1031
1032         Additionally, I move the error message for the Xcode build outside
1033         the main loop. This means that the error message will contain all
1034         the files you need to add to Xcode and all those files will now be
1035         written in DerivedSources so they should be easier to add.
1036
1037         * Scripts/generate-unified-source-bundles.rb:
1038
1039 2017-09-26  Zan Dobersek  <zdobersek@igalia.com>
1040
1041         Support building JavaScriptCore with the Bionic C library
1042         https://bugs.webkit.org/show_bug.cgi?id=177427
1043
1044         Reviewed by Michael Catanzaro.
1045
1046         * wtf/Platform.h: Define HAVE_MACHINE_CONTEXT when __BIONIC__
1047         is defined, i.e. when building with the Bionic C library.
1048
1049 2017-09-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
1050
1051         Images may render partial frames even after loading all the encoded data
1052         https://bugs.webkit.org/show_bug.cgi?id=177406
1053
1054         Reviewed by Simon Fraser.
1055
1056         Make it possible to create a RefPtr<SynchronizedFixedQueue>.
1057
1058         * wtf/SynchronizedFixedQueue.h:
1059         (WTF::SynchronizedFixedQueue::create):
1060         (WTF::SynchronizedFixedQueue::enqueue):
1061         (WTF::SynchronizedFixedQueue::dequeue):
1062
1063 2017-09-22  Zalan Bujtas  <zalan@apple.com>
1064
1065         WeakPtrFactory should populate m_ref lazily.
1066         https://bugs.webkit.org/show_bug.cgi?id=177375
1067
1068         Reviewed by Geoffrey Garen.
1069
1070         This helps us with the overhead of initializing WeakPtrFactory for
1071         objects that rarely end up creating the weak reference.
1072         -This is in preparation for introducing WeakPtr to RenderObject.
1073
1074         All credit to Geoffrey Garen.
1075
1076         * wtf/WeakPtr.h:
1077         (WTF::WeakReference::get const):
1078         (WTF::WeakReference::clear):
1079         (WTF::WeakReference::WeakReference):
1080         (WTF::WeakPtrFactory::~WeakPtrFactory):
1081         (WTF::WeakPtrFactory::createWeakPtr const):
1082         (WTF::WeakPtrFactory::revokeAll):
1083         (WTF::WeakPtrFactory::WeakPtrFactory): Deleted.
1084
1085 2017-09-21  Alex Christensen  <achristensen@webkit.org>
1086
1087         Make StringBuilder movable
1088         https://bugs.webkit.org/show_bug.cgi?id=177311
1089
1090         Reviewed by Chris Dumez.
1091
1092         * wtf/text/StringBuilder.h:
1093         (WTF::StringBuilder::StringBuilder):
1094
1095 2017-09-20  Keith Miller  <keith_miller@apple.com>
1096
1097         JSC should use unified sources for platform specific files.
1098         https://bugs.webkit.org/show_bug.cgi?id=177290
1099
1100         Reviewed by Michael Saboff.
1101
1102         The unified source bundler script can now handle more than one
1103         list of sources. Sources will not be bundled across source file
1104         lists. We want to ensure that changing one platform's sources
1105         doesn't break another platform's build, as much as
1106         possible. Additionally, it means that there won't be weird
1107         performance changes when files are added to an unrelated platform.
1108
1109         Remove stale reference to generate-unified-source-bundles.rb script
1110         from Xcode.
1111
1112         * Scripts/generate-unified-source-bundles.rb:
1113         * WTF.xcodeproj/project.pbxproj:
1114
1115 2017-09-20  Stephan Szabo  <stephan.szabo@sony.com>
1116
1117         [Win] WTF: Add alias for process id to use in place of direct uses of pid_t
1118         https://bugs.webkit.org/show_bug.cgi?id=177017
1119
1120         Reviewed by Alex Christensen.
1121
1122         * wtf/ProcessID.h:
1123         (WTF::getCurrentProcessID):
1124
1125 2017-09-20  Keith Miller  <keith_miller@apple.com>
1126
1127         JSC Xcode build should use unified sources for platform independent files
1128         https://bugs.webkit.org/show_bug.cgi?id=177190
1129
1130         Reviewed by Saam Barati.
1131
1132         Add a new directory for build scripts that are forwarded to subsequent framework builds.
1133
1134         * Scripts/generate-unified-source-bundles.rb: Renamed from Source/WTF/generate-unified-source-bundles.rb.
1135         * WTF.xcodeproj/project.pbxproj:
1136         * wtf/CMakeLists.txt:
1137
1138 2017-09-20  Per Arne Vollan  <pvollan@apple.com>
1139
1140         [Win] Cannot find script to generate unified sources.
1141         https://bugs.webkit.org/show_bug.cgi?id=177014
1142
1143         Reviewed by Keith Miller.
1144
1145         Copy the ruby script to WTF/Scripts in the forwarding headers folder.
1146
1147         * wtf/CMakeLists.txt:
1148
1149 2017-09-20  Alberto Garcia  <berto@igalia.com>
1150
1151         Fix HPPA and Alpha builds
1152         https://bugs.webkit.org/show_bug.cgi?id=177224
1153
1154         Reviewed by Alex Christensen.
1155
1156         * wtf/Platform.h:
1157
1158 2017-09-19  Youenn Fablet  <youenn@apple.com>
1159
1160         Allow WTF::map to use any class that is iterable and has a size getter
1161         https://bugs.webkit.org/show_bug.cgi?id=177026
1162
1163         Reviewed by Darin Adler.
1164
1165         Computing the Item type given to the lambda using the iterator instead of ValueType which is specific to Vector.
1166         Adding the possibility to pass a non const container reference and a lambda taking non const references as well. 
1167
1168         * wtf/Vector.h:
1169         (WTF::MapFunctionInspector::acceptsReference):
1170         (WTF::Mapper::map):
1171         (WTF::map):
1172
1173 2017-09-19  Jer Noble  <jer.noble@apple.com>
1174
1175         [Cocoa] Add an ImageDecoder subclass backed by AVFoundation
1176         https://bugs.webkit.org/show_bug.cgi?id=176825
1177
1178         Reviewed by Eric Carlson.
1179
1180         * wtf/Platform.h:
1181
1182 2017-09-18  Andy Estes  <aestes@apple.com>
1183
1184         [Cocoa] Upstream sandbox-related WebKitSystemInterface functions
1185         https://bugs.webkit.org/show_bug.cgi?id=177047
1186
1187         Reviewed by Daniel Bates.
1188
1189         * wtf/spi/darwin/SandboxSPI.h:
1190
1191 2017-09-18  Ryan Haddad  <ryanhaddad@apple.com>
1192
1193         Unreviewed, rolling out r222170.
1194
1195         The API test added with this change is failing.
1196
1197         Reverted changeset:
1198
1199         "Allow WTF::map to use any class that is iterable and has a
1200         size getter"
1201         https://bugs.webkit.org/show_bug.cgi?id=177026
1202         http://trac.webkit.org/changeset/222170
1203
1204 2017-09-18  Youenn Fablet  <youenn@apple.com>
1205
1206         Allow WTF::map to use any class that is iterable and has a size getter
1207         https://bugs.webkit.org/show_bug.cgi?id=177026
1208
1209         Reviewed by Darin Adler.
1210
1211         Computing the Item type given to the lambda using the iterator instead of ValueType which is specific to Vector.
1212         Adding the possibility to pass a non const container reference and a lambda taking non const references as well. 
1213
1214         * wtf/Vector.h:
1215         (WTF::MapFunctionInspector::acceptsReference):
1216         (WTF::Mapper::map):
1217         (WTF::map):
1218
1219 2017-09-15  JF Bastien  <jfbastien@apple.com>
1220
1221         WTF: use Forward.h when appropriate instead of Vector.h
1222         https://bugs.webkit.org/show_bug.cgi?id=176984
1223
1224         Reviewed by Saam Barati.
1225
1226         There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.
1227
1228         * wtf/Forward.h:
1229         * wtf/Vector.h:
1230         * wtf/text/StringVector.h:
1231
1232 2017-09-15  Keith Miller  <keith_miller@apple.com>
1233
1234         generate-unified-source-bundles.rb shouldn't write a file that isn't going to change
1235         https://bugs.webkit.org/show_bug.cgi?id=177021
1236
1237         Reviewed by Tim Horton.
1238
1239         * generate-unified-source-bundles.rb:
1240
1241 2017-09-14  Saam Barati  <sbarati@apple.com>
1242
1243         We should have a way of preventing a caller from making a tail call and we should use it for ProxyObject instead of using build flags
1244         https://bugs.webkit.org/show_bug.cgi?id=176863
1245
1246         Reviewed by Keith Miller.
1247
1248         This patch adds a way for a particular function to mark
1249         that none of its calls should be tail calls.
1250         
1251         It's useful in the following example if you don't want foo
1252         to do a tail call to bar or baz:
1253         
1254         int foo(bool b)
1255         {
1256             NO_TAIL_CALLS();
1257             if (b)
1258                 return baz();
1259             return bar();
1260         }
1261         
1262         Note that we're not saying that bar/baz should not be tail callable. bar/baz
1263         may have other callers that are allowed to tail call it. This macro just says
1264         that foo itself will not perform any tail calls.
1265
1266         * WTF.xcodeproj/project.pbxproj:
1267         * wtf/NoTailCalls.h: Added.
1268         (WTF::NoTailCalls::~NoTailCalls):
1269
1270 2017-09-14  Mark Lam  <mark.lam@apple.com>
1271
1272         AddressSanitizer: stack-buffer-underflow in JSC::Probe::Page::Page
1273         https://bugs.webkit.org/show_bug.cgi?id=176874
1274         <rdar://problem/34436415>
1275
1276         Reviewed by Saam Barati.
1277
1278         Added a convenience version of roundUpToMultipleOf() so that it can be applied to
1279         pointers without the client having to cast explicitly.
1280
1281         * wtf/StdLibExtras.h:
1282         (WTF::roundUpToMultipleOf):
1283
1284 2017-09-14  Youenn Fablet  <youenn@apple.com>
1285
1286         Allow WTF::map to take function as parameter
1287         https://bugs.webkit.org/show_bug.cgi?id=176909
1288
1289         Reviewed by Jer Noble.
1290
1291         * wtf/Vector.h:
1292         (WTF::map):
1293
1294 2017-09-13  Youenn Fablet  <youenn@apple.com>
1295
1296         Add a lambda-based map for Vectors
1297         https://bugs.webkit.org/show_bug.cgi?id=176487
1298
1299         Reviewed by Darin Adler.
1300
1301         This helper routine allows refactoring the reserveInitialCapacity/uncheckedAppend pattern, the mapper between source and destination item being a lambda.
1302
1303         * wtf/Vector.h:
1304         (WTF::Mapper::transform):
1305         (WTF::Mapper::map):
1306         (WTF::map):
1307
1308 2017-09-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1309
1310         [DFG] Optimize WeakMap::get by adding intrinsic and fixup
1311         https://bugs.webkit.org/show_bug.cgi?id=176010
1312
1313         Reviewed by Filip Pizlo.
1314
1315         Add inlineGet method with HashTranslator.
1316
1317         * wtf/HashMap.h:
1318         (WTF::X>::inlineGet const):
1319         (WTF::MappedTraits>::inlineGet const):
1320         (WTF::MappedTraits>::fastGet const): Deleted.
1321         * wtf/LoggingHashMap.h:
1322
1323 2017-09-12  Keith Miller  <keith_miller@apple.com>
1324
1325         Do unified source builds for JSC
1326         https://bugs.webkit.org/show_bug.cgi?id=176076
1327
1328         Reviewed by Geoffrey Garen.
1329
1330         This patch adds a script that will automatically bundle source
1331         files, which is currently only used by the CMake build. It's
1332         important that we use the same script to generate the bundles
1333         for the CMake build as the Xcode build. If we didn't do this then
1334         it's likely that there would be build errors that occur in only
1335         one build system. On the same note, we also need to be careful to
1336         not bundle platform specific source files with platform
1337         independent ones. There are a couple of things the script does not
1338         currently handle but are not essential for the CMake build. First,
1339         it does not handle the max bundle size restrictions that the Xcode
1340         build will require. It also does not handle C files.
1341
1342         The unified source generator script works by collecting groups of
1343         up to 8 files from the same directory. We don't bundle files from
1344         across directories since I didn't see a speedup from doing
1345         so. Additionally, splitting at the directory boundary means that
1346         it is less likely that adding a new file will force a "clean"
1347         build. This would happen because the new file will shift every
1348         subsequent file into the next unified source bundle.
1349
1350         Using unified sources appears to be a roughly 3.5x build time
1351         speed up for clean builds on my MBP and appears to have a
1352         negligible effect in incremental builds.
1353
1354         * generate-unified-source-bundles.rb: Added.
1355         * wtf/Assertions.h:
1356
1357 2017-09-12  Joseph Pecoraro  <pecoraro@apple.com>
1358
1359         QualifiedName::init should assume AtomicStrings::init was already called
1360         https://bugs.webkit.org/show_bug.cgi?id=176639
1361
1362         Reviewed by Sam Weinig.
1363
1364         * wtf/NeverDestroyed.h:
1365         (WTF::LazyNeverDestroyed::isConstructed const):
1366
1367 2017-09-12  Brent Fulgham  <bfulgham@apple.com>
1368
1369         Show punycode to user if a URL mixes Armenian Seh or Vo with other scripts
1370         https://bugs.webkit.org/show_bug.cgi?id=176578
1371         <rdar://problem/33906231>
1372
1373         Reviewed by Alex Christensen.
1374
1375         * wtf/ASCIICType.h:
1376         (WTF::isASCIIDigitOrPunctuation): Added helper function to recognize ASCII digits
1377         and punctuation characters.
1378
1379 2017-09-12  Sam Weinig  <sam@webkit.org>
1380
1381         [Cleanup] Follow up cleanup for DOMFormData implementation
1382         https://bugs.webkit.org/show_bug.cgi?id=176740
1383
1384         Reviewed by Alex Christensen.
1385
1386         * WTF.xcodeproj/project.pbxproj:
1387         * wtf/HashTraits.h:
1388         (WTF::KeyValuePair::KeyValuePair): Deleted.
1389         * wtf/KeyValuePair.h: Added.
1390         (WTF::KeyValuePair::KeyValuePair):
1391         (WTF::makeKeyValuePair):
1392
1393             Move KeyValuePair to its own header and add a makeKeyValuePair helper.
1394
1395 2017-09-11  Ryan Haddad  <ryanhaddad@apple.com>
1396
1397         Unreviewed, rolling out r221854.
1398
1399         The test added with this change fails on 32-bit JSC bots.
1400
1401         Reverted changeset:
1402
1403         "[DFG] Optimize WeakMap::get by adding intrinsic and fixup"
1404         https://bugs.webkit.org/show_bug.cgi?id=176010
1405         http://trac.webkit.org/changeset/221854
1406
1407 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1408
1409         [DFG] Optimize WeakMap::get by adding intrinsic and fixup
1410         https://bugs.webkit.org/show_bug.cgi?id=176010
1411
1412         Reviewed by Filip Pizlo.
1413
1414         Add inlineGet method with HashTranslator.
1415
1416         * wtf/HashMap.h:
1417         (WTF::X>::inlineGet const):
1418         (WTF::MappedTraits>::inlineGet const):
1419         (WTF::MappedTraits>::fastGet const): Deleted.
1420         * wtf/LoggingHashMap.h:
1421
1422 2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
1423
1424         [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
1425         https://bugs.webkit.org/show_bug.cgi?id=176561
1426
1427         Reviewed by Brent Fulgham.
1428
1429         WebCore/platform/Language was the only* user of PlatformUserPreferredLanguages (with 1 exception).
1430         That exception is that JavaScriptCore needed the functionality of WebCore/platform/Language, but it
1431         couldn't get it because of the layering violation, so instead it erroneously called into
1432         PlatformUserPreferredLanguages instead. This patch merges these two files into WTF so JSC gets the
1433         right function and the PAL effort has one less file to move from WebCore/platform into PAL.
1434
1435         * WTF.xcodeproj/project.pbxproj:
1436         * wtf/CMakeLists.txt:
1437         * wtf/Language.cpp: Renamed from Source/WebCore/platform/Language.cpp.
1438         (WTF::addLanguageChangeObserver):
1439         (WTF::userPreferredLanguages):
1440         * wtf/Language.h: Renamed from Source/WebCore/platform/Language.h.
1441         * wtf/PlatformGTK.cmake:
1442         * wtf/PlatformJSCOnly.cmake:
1443         * wtf/PlatformMac.cmake:
1444         * wtf/PlatformUserPreferredLanguages.h: Removed.
1445         * wtf/PlatformWPE.cmake:
1446         * wtf/PlatformWin.cmake:
1447         * wtf/cf/LanguageCF.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesMac.mm.
1448         (WTF::httpStyleLanguageCode):
1449         (WTF::languagePreferencesDidChange):
1450         (WTF::platformUserPreferredLanguages):
1451         * wtf/unix/LanguageUnix.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesUnix.cpp.
1452         * wtf/win/LanguageWin.cpp: Renamed from Source/WTF/wtf/PlatformUserPreferredLanguagesWin.cpp.
1453
1454 2017-09-06  Eric Carlson  <eric.carlson@apple.com>
1455
1456         Require LoggingHelper overrides to provide identifier
1457         https://bugs.webkit.org/show_bug.cgi?id=176477
1458
1459         Reviewed by Jer Noble.
1460
1461         * wtf/Assertions.cpp: No more WTFLogLevelNotice.
1462         * wtf/Assertions.h: Ditto.
1463
1464 2017-09-06  Per Arne Vollan  <pvollan@apple.com>
1465
1466         [Win] WebCore failed to build, InbandTextTrackPrivateAVF: base class undefined.
1467         https://bugs.webkit.org/show_bug.cgi?id=176431
1468
1469         Reviewed by Alex Christensen.
1470
1471         AVFoundation header detection should be done in WebCore because of build dependencies. 
1472
1473         * AVFoundationSupport.py: Removed.
1474         * wtf/Platform.h:
1475         * wtf/PlatformWin.cmake:
1476
1477 2017-09-05  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1478
1479         [Win] Fix the wincairo build after r221558 and r221583
1480         https://bugs.webkit.org/show_bug.cgi?id=176353
1481
1482         Reviewed by Yusuke Suzuki.
1483
1484         * wtf/Assertions.cpp:
1485
1486 2017-09-04  Eric Carlson  <eric.carlson@apple.com>
1487
1488         Switch HTMLMediaElement to release logging
1489         https://bugs.webkit.org/show_bug.cgi?id=176065
1490
1491         Reviewed by Jer Noble.
1492
1493         * wtf/MediaTime.cpp:
1494         (WTF::MediaTime::dump const): Use toString.
1495         (WTF::MediaTime::toString const): New.
1496
1497 2017-09-04  Yusuke Suzuki  <utatane.tea@gmail.com>
1498
1499         Remove OS(SOLARIS) support
1500         https://bugs.webkit.org/show_bug.cgi?id=176341
1501
1502         Reviewed by Sam Weinig.
1503
1504         WebKit project does not have stake holders supporting Solaris right now.
1505         And Solaris + SPARC in 64bit environment does not work well since its
1506         address space includes non-48bit area. It breaks our JSVALUE64 in JSC.
1507         In addition, Solaris a bit complicates our threading implementation
1508         because of its special threading stack.
1509
1510         This patch removes OS(SOLARIS) and COMPILER(SUNCC) support from WebKit.
1511
1512         * wtf/Compiler.h:
1513         * wtf/InlineASM.h:
1514         * wtf/MathExtras.h:
1515         (std::isfinite): Deleted.
1516         (std::signbit): Deleted.
1517         (std::isinf): Deleted.
1518         * wtf/NumberOfCores.cpp:
1519         (WTF::numberOfProcessorCores):
1520         * wtf/Platform.h:
1521         * wtf/StackBounds.cpp:
1522         * wtf/ThreadingPthreads.cpp:
1523
1524 2017-09-04  Commit Queue  <commit-queue@webkit.org>
1525
1526         Unreviewed, rolling out r221494 and r221500.
1527         https://bugs.webkit.org/show_bug.cgi?id=176258
1528
1529         This caused the windows build to fail. (Requested by mlewis13
1530         on #webkit).
1531
1532         Reverted changesets:
1533
1534         "Switch HTMLMediaElement to release logging"
1535         https://bugs.webkit.org/show_bug.cgi?id=176065
1536         http://trac.webkit.org/changeset/221494
1537
1538         "Switch HTMLMediaElement to release logging"
1539         https://bugs.webkit.org/show_bug.cgi?id=176065
1540         http://trac.webkit.org/changeset/221500
1541
1542 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1543
1544         Remove "malloc" and "free" use
1545         https://bugs.webkit.org/show_bug.cgi?id=176310
1546
1547         Reviewed by Darin Adler.
1548
1549         Use Vector instead.
1550
1551         * wtf/Assertions.cpp:
1552
1553 2017-09-04  Yusuke Suzuki  <utatane.tea@gmail.com>
1554
1555         Unreviewed, support libstdc++ use with clang
1556         https://bugs.webkit.org/show_bug.cgi?id=176301
1557
1558         * wtf/FastMalloc.h:
1559
1560 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1561
1562         [WTF] Add C++03 allocator interface for GCC < 6
1563         https://bugs.webkit.org/show_bug.cgi?id=176301
1564
1565         Reviewed by Darin Adler.
1566
1567         Unfortunately, std::list in GCC < 6 does not support C++11 allocator interface.
1568         This patch adds C++03 allocator interface to FastAllocator to make it usable
1569         for std::list. It also allows us to use FastAllocator for data structures that
1570         only support C++03 interface.
1571
1572         * wtf/FastMalloc.h:
1573         (WTF::FastAllocator::allocate):
1574         (WTF::FastAllocator::construct):
1575         (WTF::FastAllocator::destroy):
1576         (WTF::FastAllocator::max_size const):
1577         (WTF::FastAllocator::select_on_container_copy_construction const):
1578
1579 2017-09-03  Chris Dumez  <cdumez@apple.com>
1580
1581         Unreviewed, rolling out r221552.
1582
1583         Broke the build
1584
1585         Reverted changeset:
1586
1587         "[WTF] Add C++03 allocator interface for GCC < 6"
1588         https://bugs.webkit.org/show_bug.cgi?id=176301
1589         http://trac.webkit.org/changeset/221552
1590
1591 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1592
1593         [WTF] Add C++03 allocator interface for GCC < 6
1594         https://bugs.webkit.org/show_bug.cgi?id=176301
1595
1596         Reviewed by Darin Adler.
1597
1598         Unfortunately, std::list in GCC < 6 does not support C++11 allocator interface.
1599         This patch adds C++03 allocator interface to FastAllocator to make it usable
1600         for std::list. It also allows us to use FastAllocator for data structures that
1601         only support C++03 interface.
1602
1603         * wtf/FastMalloc.h:
1604         (WTF::FastAllocator::allocate):
1605         (WTF::FastAllocator::construct):
1606         (WTF::FastAllocator::destroy):
1607         (WTF::FastAllocator::max_size const):
1608         (WTF::FastAllocator::select_on_container_copy_construction const):
1609
1610 2017-09-03  Sam Weinig  <sam@webkit.org>
1611
1612         Remove CanvasProxy
1613         https://bugs.webkit.org/show_bug.cgi?id=176288
1614
1615         Reviewed by Yusuke Suzuki.
1616
1617         CanvasProxy does not appear to be in any current HTML spec
1618         and was disabled and unimplemented in our tree. Time to 
1619         get rid of it.
1620
1621         * wtf/FeatureDefines.h:
1622
1623 2017-09-01  Eric Carlson  <eric.carlson@apple.com>
1624
1625         Switch HTMLMediaElement to release logging
1626         https://bugs.webkit.org/show_bug.cgi?id=176065
1627
1628         Reviewed by Jer Noble.
1629
1630         * wtf/MediaTime.cpp:
1631         (WTF::MediaTime::dump const): Use toString.
1632         (WTF::MediaTime::toString const): New.
1633         * wtf/MediaTime.h:
1634         (PAL::LogArgument<WTF::MediaTime>::toString): Logger template.
1635
1636 2017-08-31  Don Olmstead  <don.olmstead@sony.com>
1637
1638         [CMake] Make USE_CF conditional within Windows
1639         https://bugs.webkit.org/show_bug.cgi?id=176173
1640
1641         Reviewed by Alex Christensen.
1642
1643         * wtf/Platform.h:
1644         * wtf/PlatformWin.cmake:
1645
1646 2017-08-31  Ryan Haddad  <ryanhaddad@apple.com>
1647
1648         Unreviewed, rolling out r221445.
1649
1650         This change broke Sierra Release builds.
1651
1652         Reverted changeset:
1653
1654         "Switch HTMLMediaElement to release logging"
1655         https://bugs.webkit.org/show_bug.cgi?id=176065
1656         http://trac.webkit.org/changeset/221445
1657
1658 2017-08-31  Eric Carlson  <eric.carlson@apple.com>
1659
1660         Switch HTMLMediaElement to release logging
1661         https://bugs.webkit.org/show_bug.cgi?id=176065
1662
1663         Reviewed by Jer Noble.
1664
1665         * wtf/MediaTime.cpp:
1666         (WTF::MediaTime::dump const): Use toString.
1667         (WTF::MediaTime::toString const): New.
1668         * wtf/MediaTime.h:
1669         (PAL::LogArgument<WTF::MediaTime>::toString): Logger template.
1670
1671 2017-08-31  Filip Pizlo  <fpizlo@apple.com>
1672
1673         All of the different ArrayBuffer::data's should be CagedPtr<>
1674         https://bugs.webkit.org/show_bug.cgi?id=175515
1675
1676         Reviewed by Michael Saboff.
1677         
1678         Added a specialization so that CagedPtr<void> is valid.
1679
1680         * wtf/CagedPtr.h:
1681
1682 2017-08-31  Per Arne Vollan  <pvollan@apple.com>
1683
1684         [Win] Crash under WorkQueue::performWorkOnRegisteredWorkThread in layout tests.
1685         https://bugs.webkit.org/show_bug.cgi?id=176163
1686
1687         Reviewed by Alex Christensen.
1688
1689         My previous attempt at fixing this crash in <http://trac.webkit.org/changeset/221323>
1690         was incorrect, since it is still crashing on the bot(s). The current theory of why this
1691         is failing is that the WorkQueue object deletes itself in the middle of the
1692         performWorkOnRegisteredWorkThread method when calling deref(). There is no need to
1693         increase the reference count of the work queue for each function we want to call on the
1694         work thread. It is sufficient to increase it for every work thread we start, and then
1695         dereference it when the thread ends. We should also not attempt to access members after
1696         the deref() call, which can potentially be unsafe.
1697  
1698         * wtf/win/WorkQueueWin.cpp:
1699         (WTF::WorkQueue::workThreadCallback):
1700         (WTF::WorkQueue::performWorkOnRegisteredWorkThread):
1701         (WTF::WorkQueue::dispatch):
1702
1703 2017-08-22  Filip Pizlo  <fpizlo@apple.com>
1704
1705         Strings need to be in some kind of gigacage
1706         https://bugs.webkit.org/show_bug.cgi?id=174924
1707
1708         Reviewed by Oliver Hunt.
1709         
1710         This makes all strings allocations come from the string gigacage. Because we expect string allocation
1711         to be a hot path, I created specialized allocation paths for the string gigacage. These paths are
1712         accessible via <wtf/text/StringMalloc.h>. However, those paths are equivalent to saying
1713         Gigacage::malloc and friends with the Gigacage::String kind.
1714
1715         * WTF.xcodeproj/project.pbxproj:
1716         * wtf/CMakeLists.txt:
1717         * wtf/Deque.h:
1718         * wtf/FastMalloc.cpp:
1719         (WTF::fastFree):
1720         * wtf/FastMalloc.h:
1721         (WTF::FastMalloc::malloc):
1722         (WTF::FastMalloc::tryMalloc):
1723         (WTF::FastMalloc::realloc):
1724         (WTF::FastMalloc::free):
1725         * wtf/Forward.h:
1726         * wtf/Gigacage.cpp:
1727         (Gigacage::tryMalloc):
1728         * wtf/Gigacage.h:
1729         (Gigacage::name):
1730         * wtf/Vector.h:
1731         (WTF::VectorBufferBase::allocateBuffer):
1732         (WTF::VectorBufferBase::tryAllocateBuffer):
1733         (WTF::VectorBufferBase::reallocateBuffer):
1734         (WTF::VectorBufferBase::deallocateBuffer):
1735         (WTF::Malloc>::Vector):
1736         (WTF::=):
1737         (WTF::Malloc>::contains const):
1738         (WTF::Malloc>::findMatching const):
1739         (WTF::Malloc>::find const):
1740         (WTF::Malloc>::reverseFind const):
1741         (WTF::Malloc>::appendIfNotContains):
1742         (WTF::Malloc>::fill):
1743         (WTF::Malloc>::appendRange):
1744         (WTF::Malloc>::expandCapacity):
1745         (WTF::Malloc>::tryExpandCapacity):
1746         (WTF::Malloc>::resize):
1747         (WTF::Malloc>::resizeToFit):
1748         (WTF::Malloc>::shrink):
1749         (WTF::Malloc>::grow):
1750         (WTF::Malloc>::asanSetInitialBufferSizeTo):
1751         (WTF::Malloc>::asanSetBufferSizeToFullCapacity):
1752         (WTF::Malloc>::asanBufferSizeWillChangeTo):
1753         (WTF::Malloc>::reserveCapacity):
1754         (WTF::Malloc>::tryReserveCapacity):
1755         (WTF::Malloc>::reserveInitialCapacity):
1756         (WTF::Malloc>::shrinkCapacity):
1757         (WTF::Malloc>::append):
1758         (WTF::Malloc>::tryAppend):
1759         (WTF::Malloc>::constructAndAppend):
1760         (WTF::Malloc>::tryConstructAndAppend):
1761         (WTF::Malloc>::appendSlowCase):
1762         (WTF::Malloc>::constructAndAppendSlowCase):
1763         (WTF::Malloc>::tryConstructAndAppendSlowCase):
1764         (WTF::Malloc>::uncheckedAppend):
1765         (WTF::Malloc>::appendVector):
1766         (WTF::Malloc>::insert):
1767         (WTF::Malloc>::insertVector):
1768         (WTF::Malloc>::remove):
1769         (WTF::Malloc>::removeFirst):
1770         (WTF::Malloc>::removeFirstMatching):
1771         (WTF::Malloc>::removeAll):
1772         (WTF::Malloc>::removeAllMatching):
1773         (WTF::Malloc>::reverse):
1774         (WTF::Malloc>::map const):
1775         (WTF::Malloc>::releaseBuffer):
1776         (WTF::Malloc>::checkConsistency):
1777         (WTF::swap):
1778         (WTF::operator==):
1779         (WTF::operator!=):
1780         (WTF::removeRepeatedElements):
1781         (WTF::minCapacity>::Vector): Deleted.
1782         (WTF::minCapacity>::contains const): Deleted.
1783         (WTF::minCapacity>::findMatching const): Deleted.
1784         (WTF::minCapacity>::find const): Deleted.
1785         (WTF::minCapacity>::reverseFind const): Deleted.
1786         (WTF::minCapacity>::appendIfNotContains): Deleted.
1787         (WTF::minCapacity>::fill): Deleted.
1788         (WTF::minCapacity>::appendRange): Deleted.
1789         (WTF::minCapacity>::expandCapacity): Deleted.
1790         (WTF::minCapacity>::tryExpandCapacity): Deleted.
1791         (WTF::minCapacity>::resize): Deleted.
1792         (WTF::minCapacity>::resizeToFit): Deleted.
1793         (WTF::minCapacity>::shrink): Deleted.
1794         (WTF::minCapacity>::grow): Deleted.
1795         (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted.
1796         (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted.
1797         (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted.
1798         (WTF::minCapacity>::reserveCapacity): Deleted.
1799         (WTF::minCapacity>::tryReserveCapacity): Deleted.
1800         (WTF::minCapacity>::reserveInitialCapacity): Deleted.
1801         (WTF::minCapacity>::shrinkCapacity): Deleted.
1802         (WTF::minCapacity>::append): Deleted.
1803         (WTF::minCapacity>::tryAppend): Deleted.
1804         (WTF::minCapacity>::constructAndAppend): Deleted.
1805         (WTF::minCapacity>::tryConstructAndAppend): Deleted.
1806         (WTF::minCapacity>::appendSlowCase): Deleted.
1807         (WTF::minCapacity>::constructAndAppendSlowCase): Deleted.
1808         (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted.
1809         (WTF::minCapacity>::uncheckedAppend): Deleted.
1810         (WTF::minCapacity>::appendVector): Deleted.
1811         (WTF::minCapacity>::insert): Deleted.
1812         (WTF::minCapacity>::insertVector): Deleted.
1813         (WTF::minCapacity>::remove): Deleted.
1814         (WTF::minCapacity>::removeFirst): Deleted.
1815         (WTF::minCapacity>::removeFirstMatching): Deleted.
1816         (WTF::minCapacity>::removeAll): Deleted.
1817         (WTF::minCapacity>::removeAllMatching): Deleted.
1818         (WTF::minCapacity>::reverse): Deleted.
1819         (WTF::minCapacity>::map const): Deleted.
1820         (WTF::minCapacity>::releaseBuffer): Deleted.
1821         (WTF::minCapacity>::checkConsistency): Deleted.
1822         * wtf/text/AtomicStringImpl.h:
1823         * wtf/text/CString.cpp:
1824         (WTF::CStringBuffer::createUninitialized):
1825         * wtf/text/CString.h:
1826         * wtf/text/StringBuffer.h:
1827         (WTF::StringBuffer::StringBuffer):
1828         (WTF::StringBuffer::~StringBuffer):
1829         (WTF::StringBuffer::resize):
1830         * wtf/text/StringImpl.cpp:
1831         (WTF::StringImpl::~StringImpl):
1832         (WTF::StringImpl::destroy):
1833         (WTF::StringImpl::createUninitializedInternalNonEmpty):
1834         (WTF::StringImpl::reallocateInternal):
1835         (WTF::StringImpl::releaseAssertCaged const):
1836         * wtf/text/StringImpl.h:
1837         (WTF::StringImpl::createSubstringSharingImpl):
1838         (WTF::StringImpl::tryCreateUninitialized):
1839         (WTF::StringImpl::adopt):
1840         (WTF::StringImpl::bufferOwnership const):
1841         (WTF::StringImpl::assertCaged const):
1842         * wtf/text/StringMalloc.cpp: Added.
1843         (WTF::tryStringMalloc):
1844         (WTF::stringMalloc):
1845         (WTF::stringRealloc):
1846         (WTF::stringFree):
1847         * wtf/text/StringMalloc.h: Added.
1848         (WTF::StringMalloc::malloc):
1849         (WTF::StringMalloc::tryMalloc):
1850         (WTF::StringMalloc::realloc):
1851         (WTF::StringMalloc::free):
1852         * wtf/text/StringVector.h: Added.
1853         * wtf/text/SymbolImpl.h:
1854         * wtf/text/UniquedStringImpl.h:
1855         * wtf/text/WTFString.h:
1856         (WTF::String::adopt):
1857         (WTF::String::assertCaged const):
1858         (WTF::String::releaseAssertCaged const):
1859
1860 2017-08-30  Chris Dumez  <cdumez@apple.com>
1861
1862         Implement FileSystemDirectoryReader.readEntries()
1863         https://bugs.webkit.org/show_bug.cgi?id=176091
1864         <rdar://problem/34168015>
1865
1866         Reviewed by Andreas Kling.
1867
1868         * wtf/CrossThreadCopier.h:
1869         (WTF::crossThreadCopy):
1870         * wtf/CrossThreadTask.h:
1871         Move crossThreadCopy() from CrossThreadTask.h to CrossThreadCopier.h and
1872         add "using WTF::crossThreadCopy" statement to make it more easily usable
1873         from WebCore.
1874
1875 2017-08-30  Matt Lewis  <jlewis3@apple.com>
1876
1877         Unreviewed, rolling out r221384.
1878
1879         This patch caused multiple 32-bit JSC test failures.
1880
1881         Reverted changeset:
1882
1883         "Strings need to be in some kind of gigacage"
1884         https://bugs.webkit.org/show_bug.cgi?id=174924
1885         http://trac.webkit.org/changeset/221384
1886
1887 2017-08-30  Brady Eidson  <beidson@apple.com>
1888
1889         Add "Identified" base class to replace a whole bunch of custom identifier generators.
1890         https://bugs.webkit.org/show_bug.cgi?id=176120
1891
1892         Reviewed by Alex Christensen.
1893
1894         * WTF.xcodeproj/project.pbxproj:
1895         * wtf/Identified.h: Added.
1896         (WTF::IdentifiedBase::identifier const):
1897         (WTF::IdentifiedBase::IdentifiedBase):
1898         (WTF::Identified::Identified):
1899         (WTF::ThreadSafeIdentified::ThreadSafeIdentified):
1900
1901 2017-08-22  Filip Pizlo  <fpizlo@apple.com>
1902
1903         Strings need to be in some kind of gigacage
1904         https://bugs.webkit.org/show_bug.cgi?id=174924
1905
1906         Reviewed by Oliver Hunt.
1907         
1908         This makes all strings allocations come from the string gigacage. Because we expect string allocation
1909         to be a hot path, I created specialized allocation paths for the string gigacage. These paths are
1910         accessible via <wtf/text/StringMalloc.h>. However, those paths are equivalent to saying
1911         Gigacage::malloc and friends with the Gigacage::String kind.
1912
1913         * WTF.xcodeproj/project.pbxproj:
1914         * wtf/CMakeLists.txt:
1915         * wtf/Deque.h:
1916         * wtf/FastMalloc.cpp:
1917         (WTF::fastFree):
1918         * wtf/FastMalloc.h:
1919         (WTF::FastMalloc::malloc):
1920         (WTF::FastMalloc::tryMalloc):
1921         (WTF::FastMalloc::realloc):
1922         (WTF::FastMalloc::free):
1923         * wtf/Forward.h:
1924         * wtf/Gigacage.cpp:
1925         (Gigacage::tryMalloc):
1926         * wtf/Gigacage.h:
1927         (Gigacage::name):
1928         * wtf/Vector.h:
1929         (WTF::VectorBufferBase::allocateBuffer):
1930         (WTF::VectorBufferBase::tryAllocateBuffer):
1931         (WTF::VectorBufferBase::reallocateBuffer):
1932         (WTF::VectorBufferBase::deallocateBuffer):
1933         (WTF::Malloc>::Vector):
1934         (WTF::=):
1935         (WTF::Malloc>::contains const):
1936         (WTF::Malloc>::findMatching const):
1937         (WTF::Malloc>::find const):
1938         (WTF::Malloc>::reverseFind const):
1939         (WTF::Malloc>::appendIfNotContains):
1940         (WTF::Malloc>::fill):
1941         (WTF::Malloc>::appendRange):
1942         (WTF::Malloc>::expandCapacity):
1943         (WTF::Malloc>::tryExpandCapacity):
1944         (WTF::Malloc>::resize):
1945         (WTF::Malloc>::resizeToFit):
1946         (WTF::Malloc>::shrink):
1947         (WTF::Malloc>::grow):
1948         (WTF::Malloc>::asanSetInitialBufferSizeTo):
1949         (WTF::Malloc>::asanSetBufferSizeToFullCapacity):
1950         (WTF::Malloc>::asanBufferSizeWillChangeTo):
1951         (WTF::Malloc>::reserveCapacity):
1952         (WTF::Malloc>::tryReserveCapacity):
1953         (WTF::Malloc>::reserveInitialCapacity):
1954         (WTF::Malloc>::shrinkCapacity):
1955         (WTF::Malloc>::append):
1956         (WTF::Malloc>::tryAppend):
1957         (WTF::Malloc>::constructAndAppend):
1958         (WTF::Malloc>::tryConstructAndAppend):
1959         (WTF::Malloc>::appendSlowCase):
1960         (WTF::Malloc>::constructAndAppendSlowCase):
1961         (WTF::Malloc>::tryConstructAndAppendSlowCase):
1962         (WTF::Malloc>::uncheckedAppend):
1963         (WTF::Malloc>::appendVector):
1964         (WTF::Malloc>::insert):
1965         (WTF::Malloc>::insertVector):
1966         (WTF::Malloc>::remove):
1967         (WTF::Malloc>::removeFirst):
1968         (WTF::Malloc>::removeFirstMatching):
1969         (WTF::Malloc>::removeAll):
1970         (WTF::Malloc>::removeAllMatching):
1971         (WTF::Malloc>::reverse):
1972         (WTF::Malloc>::map const):
1973         (WTF::Malloc>::releaseBuffer):
1974         (WTF::Malloc>::checkConsistency):
1975         (WTF::swap):
1976         (WTF::operator==):
1977         (WTF::operator!=):
1978         (WTF::removeRepeatedElements):
1979         (WTF::minCapacity>::Vector): Deleted.
1980         (WTF::minCapacity>::contains const): Deleted.
1981         (WTF::minCapacity>::findMatching const): Deleted.
1982         (WTF::minCapacity>::find const): Deleted.
1983         (WTF::minCapacity>::reverseFind const): Deleted.
1984         (WTF::minCapacity>::appendIfNotContains): Deleted.
1985         (WTF::minCapacity>::fill): Deleted.
1986         (WTF::minCapacity>::appendRange): Deleted.
1987         (WTF::minCapacity>::expandCapacity): Deleted.
1988         (WTF::minCapacity>::tryExpandCapacity): Deleted.
1989         (WTF::minCapacity>::resize): Deleted.
1990         (WTF::minCapacity>::resizeToFit): Deleted.
1991         (WTF::minCapacity>::shrink): Deleted.
1992         (WTF::minCapacity>::grow): Deleted.
1993         (WTF::minCapacity>::asanSetInitialBufferSizeTo): Deleted.
1994         (WTF::minCapacity>::asanSetBufferSizeToFullCapacity): Deleted.
1995         (WTF::minCapacity>::asanBufferSizeWillChangeTo): Deleted.
1996         (WTF::minCapacity>::reserveCapacity): Deleted.
1997         (WTF::minCapacity>::tryReserveCapacity): Deleted.
1998         (WTF::minCapacity>::reserveInitialCapacity): Deleted.
1999         (WTF::minCapacity>::shrinkCapacity): Deleted.
2000         (WTF::minCapacity>::append): Deleted.
2001         (WTF::minCapacity>::tryAppend): Deleted.
2002         (WTF::minCapacity>::constructAndAppend): Deleted.
2003         (WTF::minCapacity>::tryConstructAndAppend): Deleted.
2004         (WTF::minCapacity>::appendSlowCase): Deleted.
2005         (WTF::minCapacity>::constructAndAppendSlowCase): Deleted.
2006         (WTF::minCapacity>::tryConstructAndAppendSlowCase): Deleted.
2007         (WTF::minCapacity>::uncheckedAppend): Deleted.
2008         (WTF::minCapacity>::appendVector): Deleted.
2009         (WTF::minCapacity>::insert): Deleted.
2010         (WTF::minCapacity>::insertVector): Deleted.
2011         (WTF::minCapacity>::remove): Deleted.
2012         (WTF::minCapacity>::removeFirst): Deleted.
2013         (WTF::minCapacity>::removeFirstMatching): Deleted.
2014         (WTF::minCapacity>::removeAll): Deleted.
2015         (WTF::minCapacity>::removeAllMatching): Deleted.
2016         (WTF::minCapacity>::reverse): Deleted.
2017         (WTF::minCapacity>::map const): Deleted.
2018         (WTF::minCapacity>::releaseBuffer): Deleted.
2019         (WTF::minCapacity>::checkConsistency): Deleted.
2020         * wtf/text/AtomicStringImpl.h:
2021         * wtf/text/CString.cpp:
2022         (WTF::CStringBuffer::createUninitialized):
2023         * wtf/text/CString.h:
2024         * wtf/text/StringBuffer.h:
2025         (WTF::StringBuffer::StringBuffer):
2026         (WTF::StringBuffer::~StringBuffer):
2027         (WTF::StringBuffer::resize):
2028         * wtf/text/StringImpl.cpp:
2029         (WTF::StringImpl::~StringImpl):
2030         (WTF::StringImpl::destroy):
2031         (WTF::StringImpl::createUninitializedInternalNonEmpty):
2032         (WTF::StringImpl::reallocateInternal):
2033         (WTF::StringImpl::releaseAssertCaged const):
2034         * wtf/text/StringImpl.h:
2035         (WTF::StringImpl::createSubstringSharingImpl):
2036         (WTF::StringImpl::tryCreateUninitialized):
2037         (WTF::StringImpl::adopt):
2038         (WTF::StringImpl::bufferOwnership const):
2039         (WTF::StringImpl::assertCaged const):
2040         * wtf/text/StringMalloc.cpp: Added.
2041         (WTF::tryStringMalloc):
2042         (WTF::stringMalloc):
2043         (WTF::stringRealloc):
2044         (WTF::stringFree):
2045         * wtf/text/StringMalloc.h: Added.
2046         (WTF::StringMalloc::malloc):
2047         (WTF::StringMalloc::tryMalloc):
2048         (WTF::StringMalloc::realloc):
2049         (WTF::StringMalloc::free):
2050         * wtf/text/StringVector.h: Added.
2051         * wtf/text/SymbolImpl.h:
2052         * wtf/text/UniquedStringImpl.h:
2053         * wtf/text/WTFString.h:
2054         (WTF::String::adopt):
2055         (WTF::String::assertCaged const):
2056         (WTF::String::releaseAssertCaged const):
2057
2058 2017-08-28  Yusuke Suzuki  <utatane.tea@gmail.com>
2059
2060         [JSC] Use table based approach for JSON.stringify's Quote
2061         https://bugs.webkit.org/show_bug.cgi?id=176044
2062
2063         Reviewed by Darin Adler.
2064
2065         We change escape operation of JSON Quote from branch-based to table-based.
2066         This patch partially adopts SpiderMonkey's change to StringBuilderJSON.cpp
2067         to optimize this escaping operation. We separate changes from StringBuilder.cpp
2068         to apply MPL to StringBuilderJSON.cpp file. Since WebKit already adopts MPL in
2069         some files (like, DateMath.h), it is acceptable.
2070
2071         Kraken json-stringify-tinderbox shows 7.2% improvement.
2072
2073                                            baseline                  patched
2074
2075         json-stringify-tinderbox        40.429+-0.771      ^      37.693+-0.862         ^ definitely 1.0726x faster
2076
2077         * WTF.xcodeproj/project.pbxproj:
2078         * wtf/CMakeLists.txt:
2079         * wtf/text/StringBuilder.cpp:
2080         (WTF::appendQuotedJSONStringInternalSlow): Deleted.
2081         (WTF::appendQuotedJSONStringInternal): Deleted.
2082         (WTF::StringBuilder::appendQuotedJSONString): Deleted.
2083         * wtf/text/StringBuilderJSON.cpp: Added.
2084         (WTF::appendQuotedJSONStringInternal):
2085         (WTF::StringBuilder::appendQuotedJSONString):
2086
2087 2017-08-29  Per Arne Vollan  <pvollan@apple.com>
2088
2089         [Win] Crash under WorkQueue::performWorkOnRegisteredWorkThread in layout tests.
2090         https://bugs.webkit.org/show_bug.cgi?id=176064
2091
2092         Reviewed by Saam Barati.
2093
2094         The crash log indicates that the function pointer is null in this case.
2095
2096         * wtf/win/WorkQueueWin.cpp:
2097         (WTF::WorkQueue::dispatch):
2098
2099 2017-08-28  Andy Estes  <aestes@apple.com>
2100
2101         [Cocoa] Upstream WKGetWebDefaultCFStringEncoding()
2102         https://bugs.webkit.org/show_bug.cgi?id=176039
2103
2104         Reviewed by Alex Christensen.
2105
2106         * wtf/spi/cf/CFStringSPI.h:
2107
2108 2017-08-26  Yusuke Suzuki  <utatane.tea@gmail.com>
2109
2110         Unreviewed, suppress warnings in GTK port
2111
2112         Add printf format attribute.
2113
2114         * wtf/text/WTFString.cpp:
2115
2116 2017-08-25  Eric Carlson  <eric.carlson@apple.com>
2117
2118         Add Logger::logAlways
2119         https://bugs.webkit.org/show_bug.cgi?id=175996
2120
2121         Reviewed by Jer Noble.
2122
2123         * wtf/Assertions.cpp:
2124         * wtf/Assertions.h:
2125
2126 2017-08-25  Daniel Bates  <dabates@apple.com>
2127
2128         Demarcate code added due to lack of NSDMI for aggregates
2129         https://bugs.webkit.org/show_bug.cgi?id=175990
2130
2131         Reviewed by Andy Estes.
2132
2133         * wtf/Compiler.h:
2134
2135 2017-08-25  Don Olmstead  <don.olmstead@sony.com>
2136
2137         Define *_GIGACAGE_MASK when Gigacage is not supported
2138         https://bugs.webkit.org/show_bug.cgi?id=175994
2139
2140         Reviewed by Mark Lam.
2141
2142         * wtf/Gigacage.h:
2143
2144 2017-08-25  Eric Carlson  <eric.carlson@apple.com>
2145
2146         Add String::format variant that takes va_args
2147         https://bugs.webkit.org/show_bug.cgi?id=175988
2148
2149         Reviewed by Jer Noble.
2150
2151         * wtf/text/WTFString.cpp:
2152         (WTF::createWithFormatAndArguments): Created with the guts of String::format.
2153         (WTF::String::formatWithArguments): New, call createWithFormatAndArguments.
2154         (WTF::String::format): Move logic to createWithFormatAndArguments, use it.
2155         * wtf/text/WTFString.h:
2156
2157 2017-08-25  Saam Barati  <sbarati@apple.com>
2158
2159         Support compiling catch in the DFG
2160         https://bugs.webkit.org/show_bug.cgi?id=174590
2161         <rdar://problem/34047845>
2162
2163         Reviewed by Filip Pizlo.
2164
2165         This patch generalizes the BackwardsGraph fake root into a more generalizable
2166         class called SingleRootGraph. SingleRootGraph exposes the general graph interface
2167         used in Dominators and NaturalLoops. SingleRootGraph takes as input a graph with
2168         the normal graph interface, but also allows the input graph to contain more than
2169         one root. SingleRootGraph then exposes a single root, which it creates, that has
2170         an outgoing edge to all the roots in the original graph.
2171
2172         * WTF.xcodeproj/project.pbxproj:
2173         * wtf/BackwardsGraph.h:
2174         (WTF::BackwardsGraph::dump const):
2175         (WTF::BackwardsGraph::rootName): Deleted.
2176         (WTF::BackwardsGraph::Node::Node): Deleted.
2177         (WTF::BackwardsGraph::Node::root): Deleted.
2178         (WTF::BackwardsGraph::Node::operator== const): Deleted.
2179         (WTF::BackwardsGraph::Node::operator!= const): Deleted.
2180         (WTF::BackwardsGraph::Node::operator bool const): Deleted.
2181         (WTF::BackwardsGraph::Node::isRoot const): Deleted.
2182         (WTF::BackwardsGraph::Node::node const): Deleted.
2183         (): Deleted.
2184         (WTF::BackwardsGraph::Set::Set): Deleted.
2185         (WTF::BackwardsGraph::Set::add): Deleted.
2186         (WTF::BackwardsGraph::Set::remove): Deleted.
2187         (WTF::BackwardsGraph::Set::contains): Deleted.
2188         (WTF::BackwardsGraph::Set::dump const): Deleted.
2189         (WTF::BackwardsGraph::Map::Map): Deleted.
2190         (WTF::BackwardsGraph::Map::clear): Deleted.
2191         (WTF::BackwardsGraph::Map::size const): Deleted.
2192         (WTF::BackwardsGraph::Map::operator[]): Deleted.
2193         (WTF::BackwardsGraph::Map::operator[] const): Deleted.
2194         * wtf/Dominators.h:
2195         (WTF::Dominators::Dominators):
2196         (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOf):
2197         (WTF::Dominators::forAllBlocksInPrunedIteratedDominanceFrontierOf):
2198         (WTF::Dominators::iteratedDominanceFrontierOf const):
2199         (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl const):
2200         * wtf/SingleRootGraph.h: Added.
2201         (WTF::SingleRootGraphNode::rootName):
2202         (WTF::SingleRootGraphNode::SingleRootGraphNode):
2203         (WTF::SingleRootGraphNode::root):
2204         (WTF::SingleRootGraphNode::operator== const):
2205         (WTF::SingleRootGraphNode::operator!= const):
2206         (WTF::SingleRootGraphNode::operator bool const):
2207         (WTF::SingleRootGraphNode::isRoot const):
2208         (WTF::SingleRootGraphNode::node const):
2209         (WTF::SingleRootGraphSet::add):
2210         (WTF::SingleRootGraphSet::remove):
2211         (WTF::SingleRootGraphSet::contains):
2212         (WTF::SingleRootGraphSet::dump const):
2213         (WTF::SingleRootMap::SingleRootMap):
2214         (WTF::SingleRootMap::clear):
2215         (WTF::SingleRootMap::size const):
2216         (WTF::SingleRootMap::operator[]):
2217         (WTF::SingleRootMap::operator[] const):
2218         (WTF::SingleRootGraph::SingleRootGraph):
2219         (WTF::SingleRootGraph::root const):
2220         (WTF::SingleRootGraph::newMap):
2221         (WTF::SingleRootGraph::successors const):
2222         (WTF::SingleRootGraph::predecessors const):
2223         (WTF::SingleRootGraph::index const):
2224         (WTF::SingleRootGraph::node const):
2225         (WTF::SingleRootGraph::numNodes const):
2226         (WTF::SingleRootGraph::dump const):
2227         (WTF::SingleRootGraph::assertIsConsistent const):
2228
2229 2017-08-24  Commit Queue  <commit-queue@webkit.org>
2230
2231         Unreviewed, rolling out r221119, r221124, and r221143.
2232         https://bugs.webkit.org/show_bug.cgi?id=175973
2233
2234         "I think it regressed JSBench by 20%" (Requested by saamyjoon
2235         on #webkit).
2236
2237         Reverted changesets:
2238
2239         "Support compiling catch in the DFG"
2240         https://bugs.webkit.org/show_bug.cgi?id=174590
2241         http://trac.webkit.org/changeset/221119
2242
2243         "Unreviewed, build fix in GTK port"
2244         https://bugs.webkit.org/show_bug.cgi?id=174590
2245         http://trac.webkit.org/changeset/221124
2246
2247         "DFG::JITCode::osrEntry should get sorted since we perform a
2248         binary search on it"
2249         https://bugs.webkit.org/show_bug.cgi?id=175893
2250         http://trac.webkit.org/changeset/221143
2251
2252 2017-08-23  Filip Pizlo  <fpizlo@apple.com>
2253
2254         Reduce Gigacage sizes
2255         https://bugs.webkit.org/show_bug.cgi?id=175920
2256
2257         Reviewed by Mark Lam.
2258
2259         Provide filler API for the no-bmalloc/no-Gigacage case.
2260
2261         * wtf/Gigacage.h:
2262         (Gigacage::mask):
2263
2264 2017-08-23  Yusuke Suzuki  <utatane.tea@gmail.com>
2265
2266         Unreviewed, build fix in GTK port
2267         https://bugs.webkit.org/show_bug.cgi?id=174590
2268
2269         * wtf/SingleRootGraph.h:
2270         (WTF::SingleRootGraph::successors const):
2271         (WTF::SingleRootGraph::predecessors const):
2272
2273 2017-08-23  Saam Barati  <sbarati@apple.com>
2274
2275         Support compiling catch in the DFG
2276         https://bugs.webkit.org/show_bug.cgi?id=174590
2277
2278         Reviewed by Filip Pizlo.
2279
2280         This patch generalizes the BackwardsGraph fake root into a more generalizable
2281         class called SingleRootGraph. SingleRootGraph exposes the general graph interface
2282         used in Dominators and NaturalLoops. SingleRootGraph takes as input a graph with
2283         the normal graph interface, but also allows the input graph to contain more than
2284         one root. SingleRootGraph then exposes a single root, which it creates, that has
2285         an outgoing edge to all the roots in the original graph.
2286
2287         * WTF.xcodeproj/project.pbxproj:
2288         * wtf/BackwardsGraph.h:
2289         (WTF::BackwardsGraph::dump const):
2290         (WTF::BackwardsGraph::rootName): Deleted.
2291         (WTF::BackwardsGraph::Node::Node): Deleted.
2292         (WTF::BackwardsGraph::Node::root): Deleted.
2293         (WTF::BackwardsGraph::Node::operator== const): Deleted.
2294         (WTF::BackwardsGraph::Node::operator!= const): Deleted.
2295         (WTF::BackwardsGraph::Node::operator bool const): Deleted.
2296         (WTF::BackwardsGraph::Node::isRoot const): Deleted.
2297         (WTF::BackwardsGraph::Node::node const): Deleted.
2298         (): Deleted.
2299         (WTF::BackwardsGraph::Set::Set): Deleted.
2300         (WTF::BackwardsGraph::Set::add): Deleted.
2301         (WTF::BackwardsGraph::Set::remove): Deleted.
2302         (WTF::BackwardsGraph::Set::contains): Deleted.
2303         (WTF::BackwardsGraph::Set::dump const): Deleted.
2304         (WTF::BackwardsGraph::Map::Map): Deleted.
2305         (WTF::BackwardsGraph::Map::clear): Deleted.
2306         (WTF::BackwardsGraph::Map::size const): Deleted.
2307         (WTF::BackwardsGraph::Map::operator[]): Deleted.
2308         (WTF::BackwardsGraph::Map::operator[] const): Deleted.
2309         * wtf/Dominators.h:
2310         (WTF::Dominators::Dominators):
2311         (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOf):
2312         (WTF::Dominators::forAllBlocksInPrunedIteratedDominanceFrontierOf):
2313         (WTF::Dominators::iteratedDominanceFrontierOf const):
2314         (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl const):
2315         * wtf/SingleRootGraph.h: Added.
2316         (WTF::SingleRootGraphNode::rootName):
2317         (WTF::SingleRootGraphNode::SingleRootGraphNode):
2318         (WTF::SingleRootGraphNode::root):
2319         (WTF::SingleRootGraphNode::operator== const):
2320         (WTF::SingleRootGraphNode::operator!= const):
2321         (WTF::SingleRootGraphNode::operator bool const):
2322         (WTF::SingleRootGraphNode::isRoot const):
2323         (WTF::SingleRootGraphNode::node const):
2324         (WTF::SingleRootGraphSet::add):
2325         (WTF::SingleRootGraphSet::remove):
2326         (WTF::SingleRootGraphSet::contains):
2327         (WTF::SingleRootGraphSet::dump const):
2328         (WTF::SingleRootMap::SingleRootMap):
2329         (WTF::SingleRootMap::clear):
2330         (WTF::SingleRootMap::size const):
2331         (WTF::SingleRootMap::operator[]):
2332         (WTF::SingleRootMap::operator[] const):
2333         (WTF::SingleRootGraph::SingleRootGraph):
2334         (WTF::SingleRootGraph::root const):
2335         (WTF::SingleRootGraph::newMap):
2336         (WTF::SingleRootGraph::successors const):
2337         (WTF::SingleRootGraph::predecessors const):
2338         (WTF::SingleRootGraph::index const):
2339         (WTF::SingleRootGraph::node const):
2340         (WTF::SingleRootGraph::numNodes const):
2341         (WTF::SingleRootGraph::dump const):
2342         (WTF::SingleRootGraph::assertIsConsistent const):
2343
2344 2017-08-23  Youenn Fablet  <youenn@apple.com>
2345
2346         [Cache API] Enable persistent coder to encode FetchOptions
2347         https://bugs.webkit.org/show_bug.cgi?id=175883
2348
2349         Reviewed by Alex Christensen.
2350
2351         Enabling encoding/decoding of enums with EnumTraits.
2352         This code is similar to the one of IPC encoder/decoder.
2353
2354         * wtf/persistence/PersistentDecoder.h:
2355         (WTF::Persistence::Decoder::decode):
2356         * wtf/persistence/PersistentEncoder.h:
2357         (WTF::Persistence::Encoder::encode):
2358
2359 2017-08-23  Per Arne Vollan  <pvollan@apple.com>
2360
2361         [Win] Compile error, include file <wtf/AVFoundationHeaderDetection.h> is not found.
2362         https://bugs.webkit.org/show_bug.cgi?id=175853
2363
2364         Reviewed by Brent Fulgham.
2365
2366         Copy generated WTF header files to the same place as we copy forwarding headers.
2367  
2368         * WTF.vcxproj/WTF.proj:
2369
2370 2017-08-22  Chris Dumez  <cdumez@apple.com>
2371
2372         Introduce a new CompletionHandler type and use it for NetworkDataTaskClient's completion handlers to help catch bugs
2373         https://bugs.webkit.org/show_bug.cgi?id=175832
2374
2375         Reviewed by Alex Christensen.
2376
2377         Introduce a new CompletionHandler type which wraps a WTF::Function and ensures via assertions
2378         that the function is always called once and only once.
2379
2380         * WTF.xcodeproj/project.pbxproj:
2381         * wtf/CompletionHandler.h: Added.
2382         (WTF::CompletionHandler<Out):
2383
2384 2017-08-22  Alex Christensen  <achristensen@webkit.org>
2385
2386         Fix Windows build after r221017.
2387         https://bugs.webkit.org/show_bug.cgi?id=157053
2388
2389         * wtf/PlatformWin.cmake:
2390
2391 2017-08-22  Per Arne Vollan  <pvollan@apple.com>
2392
2393         Implement 64-bit MacroAssembler::probe support for Windows.
2394         https://bugs.webkit.org/show_bug.cgi?id=175724
2395
2396         Reviewed by Mark Lam.
2397
2398         Enable masm probe and DFG.
2399
2400         * wtf/Platform.h:
2401
2402 2017-08-21  Mark Lam  <mark.lam@apple.com>
2403
2404         [Follow up]: Add back the ability to disable MASM_PROBE from the build.
2405         https://bugs.webkit.org/show_bug.cgi?id=175656
2406         <rdar://problem/33933720>
2407
2408         Not reviewed.
2409
2410         Fixed a typo: should be "OS(WINDOWS)", not "OS(WINDOW)".
2411
2412         * wtf/Platform.h:
2413
2414 2017-08-21  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2415
2416         [GTK] ARMv7 build fails to build MacroAssemblerARMv7.cpp.
2417         https://bugs.webkit.org/show_bug.cgi?id=175514
2418
2419         Reviewed by Keith Miller.
2420
2421         * wtf/Platform.h: Enable DFG and MASM_PROBE back for GTK ARM_THUMB2.
2422
2423 2017-08-20  Sam Weinig  <sam@webkit.org>
2424
2425         StringView could use a function to strip leading/trailing characters without allocation
2426         https://bugs.webkit.org/show_bug.cgi?id=175757
2427
2428         Reviewed by Darin Adler.
2429
2430         There are many places in WebCore/WebKit that we call functions like, 
2431         WebCore::stripLeadingAndTrailingHTMLSpaces,  or String::stripWhiteSpace() only to use 
2432         the allocated String as a temporary for either another transformation or a comparison.
2433         Now that we have StringView, we can avoid that extra allocation, by having returning a
2434         StringView  substring in these scenarios.
2435
2436         For instance, the check (from ScriptElement.cpp:287):
2437
2438         if (!stripLeadingAndTrailingHTMLSpaces(sourceURL).isEmpty()) {
2439             ...
2440         }
2441
2442         currently allocates a string just to make this check. With a new 
2443         stripLeadingAndTrailingHTMLSpaces such as:
2444
2445         StringView stripLeadingAndTrailingHTMLSpaces(StringView stringView)
2446         {
2447             return stringView.stripLeadingAndTrailingMatchedCharacters([] (auto c) {
2448                 return isHTMLSpace(c);
2449             });
2450         }
2451
2452         We could instead have exact same code from ScriptElement.cpp now avoid an allocation.
2453
2454         * wtf/text/StringView.h:
2455         (WTF::StringView::stripLeadingAndTrailingMatchedCharacters):
2456
2457 2017-08-21  Eric Carlson  <eric.carlson@apple.com>
2458
2459         Add WTFLogChannel level to allow runtime log filtering
2460         https://bugs.webkit.org/show_bug.cgi?id=175731
2461         <rdar://problem/33967234>
2462
2463         Reviewed by Jer Noble.
2464         
2465         Add WTFLog*, LOG, and RELEASE_LOG variants that take a "log level" parameter so code
2466         can include logging statements that are only conditionally emitted.
2467
2468         * wtf/Assertions.cpp:
2469         * wtf/Assertions.h:
2470         * wtf/MemoryPressureHandler.cpp:
2471         * wtf/RefCountedLeakCounter.cpp:
2472
2473 2017-08-20  Mark Lam  <mark.lam@apple.com>
2474
2475         Gardening: fix CLoop build.
2476         https://bugs.webkit.org/show_bug.cgi?id=175688
2477         <rdar://problem/33436870>
2478
2479         Not reviewed.
2480
2481         Disable MASM_PROBE if !ENABLE(JIT).
2482
2483         * wtf/Platform.h:
2484
2485 2017-08-18  Ryan Haddad  <ryanhaddad@apple.com>
2486
2487         Unreviewed, rolling out r220938.
2488
2489         The API tests added with this change are failing.
2490
2491         Reverted changeset:
2492
2493         "Add WTFLogChannel level to allow runtime log filtering"
2494         https://bugs.webkit.org/show_bug.cgi?id=175731
2495         http://trac.webkit.org/changeset/220938
2496
2497 2017-08-18  Eric Carlson  <eric.carlson@apple.com>
2498
2499         Add WTFLogChannel level to allow runtime log filtering
2500         https://bugs.webkit.org/show_bug.cgi?id=175731
2501         <rdar://problem/33967234>
2502
2503         Reviewed by Jer Noble.
2504         
2505         Add WTFLog*, LOG, and RELEASE_LOG variants that take a "log level" parameter so code
2506         can include logging statements that are only conditionally emitted.
2507
2508         * wtf/Assertions.cpp:
2509         * wtf/Assertions.h:
2510         * wtf/MemoryPressureHandler.cpp:
2511         * wtf/RefCountedLeakCounter.cpp:
2512
2513 2017-08-18  Per Arne Vollan  <pvollan@apple.com>
2514
2515         Implement 32-bit MacroAssembler::probe support for Windows.
2516         https://bugs.webkit.org/show_bug.cgi?id=175449
2517
2518         Reviewed by Mark Lam.
2519
2520         Enable the DFG on Win32. 
2521
2522         * wtf/Platform.h:
2523
2524 2017-08-17  Mark Lam  <mark.lam@apple.com>
2525
2526         Only use 16 VFP registers if !CPU(ARM_NEON).
2527         https://bugs.webkit.org/show_bug.cgi?id=175514
2528
2529         Reviewed by JF Bastien.
2530
2531         If CPU(ARM_NEON) is not enabled, we'll conservatively assume only VFP2 support is
2532         available. Hence, we'll only the first 16 FPDoubleRegisterIDs are available.
2533
2534         For reference, see:
2535         NEON registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJACABEJ.html
2536         VFP2 and VFP3 registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CIHDIBDG.html
2537         NEON to VFP register mapping: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJAIJHFC.html
2538
2539         This is mostly for GTK toolchains which may target older ARM CPUs which only have
2540         VFP2 support.
2541
2542         * wtf/Platform.h:
2543
2544 2017-08-16  Mark Lam  <mark.lam@apple.com>
2545
2546         Add back the ability to disable MASM_PROBE from the build.
2547         https://bugs.webkit.org/show_bug.cgi?id=175656
2548         <rdar://problem/33933720>
2549
2550         Reviewed by Yusuke Suzuki.
2551
2552         * wtf/Platform.h:
2553
2554 2017-08-16  Mark Lam  <mark.lam@apple.com>
2555
2556         Gardening: fix GTK ARM_THUMB2 build.
2557         https://bugs.webkit.org/show_bug.cgi?id=175446
2558
2559         Not reviewed.
2560
2561         Disable the use of the DFG for GTK ARM_THUMB2 builds until
2562         https://bugs.webkit.org/show_bug.cgi?id=175514 is fixed.
2563
2564         * wtf/Platform.h:
2565
2566 2017-08-16  Andy Estes  <aestes@apple.com>
2567
2568         [Payment Request] Add an ENABLE flag and an experimental feature preference
2569         https://bugs.webkit.org/show_bug.cgi?id=175622
2570
2571         Reviewed by Tim Horton.
2572
2573         * wtf/FeatureDefines.h:
2574
2575 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
2576
2577         Remove Proximity Events and related code
2578         https://bugs.webkit.org/show_bug.cgi?id=175545
2579
2580         Reviewed by Daniel Bates.
2581
2582         No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS)
2583         and other related code.
2584
2585         * wtf/FeatureDefines.h:
2586
2587 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
2588
2589         Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
2590         https://bugs.webkit.org/show_bug.cgi?id=175504
2591
2592         Reviewed by Sam Weinig.
2593
2594         * wtf/FeatureDefines.h:
2595
2596 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
2597
2598         Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
2599         https://bugs.webkit.org/show_bug.cgi?id=175557
2600
2601         Reviewed by Jon Lee.
2602
2603         No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.
2604
2605         * wtf/FeatureDefines.h:
2606
2607 2017-08-12  Filip Pizlo  <fpizlo@apple.com>
2608
2609         Put the ScopedArgumentsTable's ScopeOffset array in some gigacage
2610         https://bugs.webkit.org/show_bug.cgi?id=174921
2611
2612         Reviewed by Mark Lam.
2613         
2614         If you want to std::unique_ptr a class that knows that it should be in the Gigacage, then we
2615         would create the Gigacage equivalent of WTF_MAKE_FAST_ALLOCATED and it would just work.
2616         
2617         But this does not work if we want to std::unique_ptr a primitive type. So, this patch adds a
2618         solution for this problem: CagedUniquePtr<>. This will handle allocation
2619         (CagedUniquePtr<>::create()) and deallocation (in the style of std::unique_ptr). It has three
2620         variants:
2621         
2622         - Non-array types.
2623         - Arrays that don't have destructors.
2624         - Arrays that have destructors.
2625         
2626         Just like std::unique_ptr, the array case is triggered by saying "[]" at the end of the type.
2627         
2628         Unlike std::unique_ptr and most other smart pointers, the whole point of this smart pointer is
2629         to dictate where the thing you're pointing at is allocated. For this reason, it has to know how
2630         to do things like the array destructor protocol. So it creates its own: the CagedUniquePtr for
2631         arrays with destructors is a fat pointer that remembers the length of the array.
2632         
2633         CagedUniquePtr<> makes it impossible to leak/release the pointer. This is stricter than what
2634         std::unique_ptr does, and is probably appropriate for all of the places where we would use this
2635         type.
2636         
2637         So far, we only use it for ScopedArgumentsTable::m_arguments, but I suspect that it will be
2638         useful in other places.
2639
2640         * WTF.xcodeproj/project.pbxproj:
2641         * wtf/CMakeLists.txt:
2642         * wtf/CagedUniquePtr.h: Added.
2643         (WTF::CagedUniquePtr::CagedUniquePtr):
2644         (WTF::CagedUniquePtr::create):
2645         (WTF::CagedUniquePtr::operator=):
2646         (WTF::CagedUniquePtr::~CagedUniquePtr):
2647         (WTF::CagedUniquePtr::get const):
2648         (WTF::CagedUniquePtr::getMayBeNull const):
2649         (WTF::CagedUniquePtr::operator== const):
2650         (WTF::CagedUniquePtr::operator!= const):
2651         (WTF::CagedUniquePtr::operator bool const):
2652         (WTF::CagedUniquePtr::operator* const):
2653         (WTF::CagedUniquePtr::operator-> const):
2654         (WTF::CagedUniquePtr::operator[] const):
2655         (WTF::CagedUniquePtr::destroy):
2656         * wtf/Gigacage.cpp:
2657         (Gigacage::tryMallocArray):
2658         (Gigacage::malloc):
2659         (Gigacage::mallocArray):
2660         * wtf/Gigacage.h:
2661
2662 2017-08-11  Ryosuke Niwa  <rniwa@webkit.org>
2663
2664         Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
2665         https://bugs.webkit.org/show_bug.cgi?id=175474
2666
2667         Reviewed by Wenson Hsieh.
2668
2669         * wtf/FeatureDefines.h:
2670
2671 2017-08-11  Don Olmstead  <don.olmstead@sony.com>
2672
2673         [WTF] Move ValueToString into WTF
2674         https://bugs.webkit.org/show_bug.cgi?id=175469
2675
2676         Reviewed by Sam Weinig.
2677
2678         * WTF.xcodeproj/project.pbxproj:
2679         * wtf/CMakeLists.txt:
2680         * wtf/text/ValueToString.h: Renamed from Source/WebCore/platform/ValueToString.h.
2681
2682 2017-08-11  Tim Horton  <timothy_horton@apple.com>
2683
2684         Fix the build with modern Clang's -Wexpansion-to-defined
2685         https://bugs.webkit.org/show_bug.cgi?id=175467
2686         <rdar://problem/33667497>
2687
2688         Reviewed by Simon Fraser.
2689
2690         * wtf/FeatureDefines.h:
2691         * wtf/Platform.h:
2692         Avoid object-like macros that expand to include defined(), because this
2693         behaves inconsistently between different compilers (though in ways
2694         that don't matter for these particular defines, which aren't used on MSVC),
2695         and Clang has added a warning for it.
2696
2697         Move ENABLE_WEBASSEMBLY to Platform.h since it depends on things that
2698         are defined there and can't be evaluated at time-of-use because of the
2699         aforementioned new rules. Previously, there was a cycle between
2700         ENABLE_WEBASSEMBLY and ENABLE_B3_JIT -- break that so that it just
2701         goes FTL_JIT->B3_JIT->WASM instead.
2702
2703 2017-08-10  Sam Weinig  <sam@webkit.org>
2704
2705         WTF::Function does not allow for reference / non-default constructible return types
2706         https://bugs.webkit.org/show_bug.cgi?id=175244
2707
2708         Reviewed by Chris Dumez.
2709
2710         When Function, then NoncopyableFunction, was templatized to allow non-void return values
2711         in r201493, it maintained the behavior of being callable even if the Function was null.
2712         To accomplish this, when null, the default construction of the return parameter was used.
2713         This means Function can't be used with return types that are not default constructible,
2714         such as reference types and Ref.
2715
2716         This behavior of returning something when null is surprising, as this is not how normal
2717         functions behave, and not very useful. Instead, we now assert that the function is not
2718         null when being called.
2719
2720         * wtf/Function.h:
2721         (WTF::Function operator(...)):
2722         Instead of allowing a null callable wrapper by returning the default construction of
2723         the return type, assert that the wrapper is there when calling a Function.
2724
2725 2017-08-10  Mark Lam  <mark.lam@apple.com>
2726
2727         Make the MASM_PROBE mechanism mandatory for DFG and FTL builds.
2728         https://bugs.webkit.org/show_bug.cgi?id=175446
2729         <rdar://problem/33836545>
2730
2731         Reviewed by Saam Barati.
2732
2733         This is needed in order to support https://bugs.webkit.org/show_bug.cgi?id=174645.
2734         One consequence of this is that the DFG will now be disabled for the MIPS and
2735         Windows ports. See:
2736             https://bugs.webkit.org/show_bug.cgi?id=175447
2737             https://bugs.webkit.org/show_bug.cgi?id=175449
2738
2739         Also, we should only ENABLE_SIGNAL_BASED_VM_TRAPS if the DFG is enabled.  It was
2740         never meaningful to use SIGNAL_BASED_VM_TRAPS with the baseline JIT anyway.  This
2741         is a mis-configuration error that is now fixed.
2742
2743         * wtf/Platform.h:
2744
2745 2017-08-10  Brady Eidson  <beidson@apple.com>
2746
2747         Rename the source files for the WTF persistent coders.
2748         https://bugs.webkit.org/show_bug.cgi?id=175441
2749
2750         Reviewed by Tim Horton.
2751
2752         * WTF.xcodeproj/project.pbxproj:
2753         * wtf/CMakeLists.txt:
2754
2755         * wtf/persistence/PersistentCoder.h: Renamed from Source/WTF/wtf/persistence/Coder.h.
2756         * wtf/persistence/PersistentCoders.cpp: Renamed from Source/WTF/wtf/persistence/Coders.cpp.
2757         * wtf/persistence/PersistentCoders.h: Renamed from Source/WTF/wtf/persistence/Coders.h.
2758         * wtf/persistence/PersistentDecoder.cpp: Renamed from Source/WTF/wtf/persistence/Decoder.cpp.
2759         * wtf/persistence/PersistentDecoder.h: Renamed from Source/WTF/wtf/persistence/Decoder.h.
2760         * wtf/persistence/PersistentEncoder.cpp: Renamed from Source/WTF/wtf/persistence/Encoder.cpp.
2761         * wtf/persistence/PersistentEncoder.h: Renamed from Source/WTF/wtf/persistence/Encoder.h.
2762
2763 2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
2764
2765         Unreviewed, attempt to fix build failure with VC2017
2766
2767         * wtf/PriorityQueue.h:
2768
2769 2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
2770
2771         Run more WTF tests
2772         https://bugs.webkit.org/show_bug.cgi?id=174970
2773
2774         Reviewed by Michael Catanzaro.
2775
2776         CHAR_BIT is not defined.
2777
2778         * wtf/LEBDecoder.h:
2779
2780 2017-08-09  Yusuke Suzuki  <utatane.tea@gmail.com>
2781
2782         [WTF] ThreadSpecific should not introduce additional indirection
2783         https://bugs.webkit.org/show_bug.cgi?id=175187
2784
2785         Reviewed by Mark Lam.
2786
2787         ThreadSpecific sets Data* to the TLS. And Data holds T*, which
2788         is fast allocated actual data. But ideally, we should store T
2789         instance directly in Data instead of introducing an additional
2790         indirection.
2791
2792         This patch adds storage in Data in order to embed the instance of T. The constructor
2793         for Data will invoke the constructor for T on the embedded storage. We also drop
2794         ThreadSpecific::replace which is only used by the web thread to set its thread specific
2795         ThreadGlobalData to the one shared from the main thread. The existing implementation
2796         relies on the main thread and the web thread never exiting in order for the shared
2797         ThreadGlobalData to stay alive. We can achieve the same semantics by using a
2798         ThreadSpecific<std::unique_ptr<T>> to hold the ThreadGlobalData instance instead.
2799
2800         * wtf/ThreadSpecific.h:
2801         (WTF::ThreadSpecific::Data::construct):
2802         (WTF::ThreadSpecific::Data::Data):
2803         We make it fast allocated since we previously allocated ThreadSpecific T data by fastMalloc.
2804
2805         (WTF::ThreadSpecific::Data::~Data):
2806         (WTF::ThreadSpecific::Data::storagePointer const):
2807         (WTF::canBeGCThread>::get):
2808         We also drop RELEASE_ASSERT from ::get(). We already inserted this assert to setAndConstruct(),
2809         so when creating the member to this TLS, we execute this release assert. So it is
2810         not necessary to execute this assertion every time we get data from this TLS.
2811
2812         (WTF::canBeGCThread>::set):
2813         (WTF::canBeGCThread>::destroy):
2814         (WTF::canBeGCThread>::setAndConstruct):
2815         (WTF::T):
2816         (WTF::canBeGCThread>::replace): Deleted.
2817
2818 2017-08-10  Tim Horton  <timothy_horton@apple.com>
2819
2820         Fix a silly typo in Compiler.h
2821
2822         * wtf/Compiler.h:
2823         Heature, indeed.
2824
2825 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2826
2827         Remove ENABLE_GAMEPAD_DEPRECATED
2828         https://bugs.webkit.org/show_bug.cgi?id=175361
2829
2830         Reviewed by Carlos Garcia Campos.
2831
2832         * wtf/FeatureDefines.h:
2833
2834 2017-08-09  Don Olmstead  <don.olmstead@sony.com>
2835
2836         [WTF] Move TextStream into WTF
2837         https://bugs.webkit.org/show_bug.cgi?id=175211
2838
2839         Reviewed by Myles C. Maxfield.
2840
2841         * WTF.xcodeproj/project.pbxproj:
2842         * wtf/CMakeLists.txt:
2843         * wtf/text/TextStream.cpp: Renamed from Source/WebCore/platform/text/TextStream.cpp.
2844         (WTF::TextStream::writeIndent):
2845         * wtf/text/TextStream.h: Renamed from Source/WebCore/platform/text/TextStream.h.
2846         (WTF::TextStream::FormatNumberRespectingIntegers::FormatNumberRespectingIntegers):
2847
2848 2017-08-09  Commit Queue  <commit-queue@webkit.org>
2849
2850         Unreviewed, rolling out r220466, r220477, and r220487.
2851         https://bugs.webkit.org/show_bug.cgi?id=175411
2852
2853         This change broke existing API tests and follow up fixes did
2854         not resolve all the issues. (Requested by ryanhaddad on
2855         #webkit).
2856
2857         Reverted changesets:
2858
2859         https://bugs.webkit.org/show_bug.cgi?id=175244
2860         http://trac.webkit.org/changeset/220466
2861
2862         "WTF::Function does not allow for reference / non-default
2863         constructible return types"
2864         https://bugs.webkit.org/show_bug.cgi?id=175244
2865         http://trac.webkit.org/changeset/220477
2866
2867         https://bugs.webkit.org/show_bug.cgi?id=175244
2868         http://trac.webkit.org/changeset/220487
2869
2870 2017-08-09  Sam Weinig  <sam@webkit.org>
2871
2872         WTF::Function does not allow for reference / non-default constructible return types
2873         https://bugs.webkit.org/show_bug.cgi?id=175244
2874
2875         Reviewed by Chris Dumez.
2876
2877         When Function, then NoncopyableFunction, was templatized to allow non-void return values
2878         in r201493, it maintained the behavior of being callable even if the Function was null.
2879         To accomplish this, when null, the default construction of the return parameter was used.
2880         This means Function can't be used with return types that are not default constructible,
2881         such as reference types and Ref.
2882
2883         This behavior of returning something when null is surprising, as this is not how normal
2884         functions behave, and not very useful. Instead, we now assert that the function is not
2885         null when being called.
2886
2887         * wtf/Function.h:
2888         (WTF::Function operator(...)):
2889         Instead of allowing a null callable wrapper by returning the default construction of
2890         the return type, assert that the wrapper is there when calling a Function.
2891
2892 2017-08-09  Ryan Haddad  <ryanhaddad@apple.com>
2893
2894         Unreviewed, rolling out r220457.
2895
2896         This change introduced API test failures.
2897
2898         Reverted changeset:
2899
2900         "WTF::Function does not allow for reference / non-default
2901         constructible return types"
2902         https://bugs.webkit.org/show_bug.cgi?id=175244
2903         http://trac.webkit.org/changeset/220457
2904
2905 2017-08-09  Sam Weinig  <sam@webkit.org>
2906
2907         WTF::Function does not allow for reference / non-default constructible return types
2908         https://bugs.webkit.org/show_bug.cgi?id=175244
2909
2910         Reviewed by Chris Dumez.
2911
2912         When Function, then NoncopyableFunction, was templatized to allow non-void return values
2913         in r201493, it maintained the behavior of being callable even if the Function was null.
2914         To accomplish this, when null, the default construction of the return parameter was used.
2915         This means Function can't be used with return types that are not default constructible,
2916         such as reference types and Ref.
2917
2918         This behavior of returning something when null is surprising, as this is not how normal
2919         functions behave, and not very useful. Instead, we now assert that the function is not
2920         null when being called.
2921
2922         * wtf/Function.h:
2923         (WTF::Function operator(...)):
2924         Instead of allowing a null callable wrapper by returning the default construction of
2925         the return type, assert that the wrapper is there when calling a Function.
2926
2927 2017-08-08  Filip Pizlo  <fpizlo@apple.com>
2928
2929         Baseline JIT should do caging
2930         https://bugs.webkit.org/show_bug.cgi?id=175037
2931
2932         Reviewed by Mark Lam.
2933
2934         * wtf/Gigacage.h:
2935         (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
2936         (Gigacage::isDisablingPrimitiveGigacageDisabled):
2937         (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
2938         (Gigacage::canPrimitiveGigacageBeDisabled):
2939         (Gigacage::basePtr):
2940
2941 2017-08-08  Ryan Haddad  <ryanhaddad@apple.com>
2942
2943         Unreviewed, rolling out r220368.
2944
2945         This change caused WK1 tests to exit early with crashes.
2946
2947         Reverted changeset:
2948
2949         "Baseline JIT should do caging"
2950         https://bugs.webkit.org/show_bug.cgi?id=175037
2951         http://trac.webkit.org/changeset/220368
2952
2953 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2954
2955         [CMake] Properly test if compiler supports compiler flags
2956         https://bugs.webkit.org/show_bug.cgi?id=174490
2957
2958         Reviewed by Konstantin Tokarev.
2959
2960         * wtf/Compiler.h:
2961
2962 2017-08-07  Filip Pizlo  <fpizlo@apple.com>
2963
2964         Baseline JIT should do caging
2965         https://bugs.webkit.org/show_bug.cgi?id=175037
2966
2967         Reviewed by Mark Lam.
2968
2969         * wtf/Gigacage.h:
2970         (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
2971         (Gigacage::isDisablingPrimitiveGigacageDisabled):
2972         (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
2973         (Gigacage::canPrimitiveGigacageBeDisabled):
2974
2975 2017-08-07  Filip Pizlo  <fpizlo@apple.com>
2976
2977         Unreviewed, try to fix Windows build.
2978
2979         * wtf/Gigacage.cpp:
2980         * wtf/Gigacage.h:
2981
2982 2017-08-06  Filip Pizlo  <fpizlo@apple.com>
2983
2984         Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
2985         https://bugs.webkit.org/show_bug.cgi?id=174919
2986
2987         Reviewed by Keith Miller.
2988         
2989         This mirrors the changes from bmalloc/Gigacage.h.
2990         
2991         Also it teaches CagedPtr how to reason about multiple gigacages.
2992
2993         * wtf/CagedPtr.h:
2994         (WTF::CagedPtr::get const):
2995         (WTF::CagedPtr::operator[] const):
2996         * wtf/Gigacage.cpp:
2997         (Gigacage::tryMalloc):
2998         (Gigacage::tryAllocateVirtualPages):
2999         (Gigacage::freeVirtualPages):
3000         (Gigacage::tryAlignedMalloc):
3001         (Gigacage::alignedFree):
3002         (Gigacage::free):
3003         * wtf/Gigacage.h:
3004         (Gigacage::disablePrimitiveGigacage):
3005         (Gigacage::addPrimitiveDisableCallback):
3006         (Gigacage::removePrimitiveDisableCallback):
3007         (Gigacage::name):
3008         (Gigacage::basePtr):
3009         (Gigacage::caged):
3010         (Gigacage::isCaged):
3011         (Gigacage::tryAlignedMalloc):
3012         (Gigacage::alignedFree):
3013         (Gigacage::free):
3014         (Gigacage::disableGigacage): Deleted.
3015         (Gigacage::addDisableCallback): Deleted.
3016         (Gigacage::removeDisableCallback): Deleted.
3017
3018 2017-08-07  Brian Burg  <bburg@apple.com>
3019
3020         Remove CANVAS_PATH compilation guard
3021         https://bugs.webkit.org/show_bug.cgi?id=175207
3022
3023         Reviewed by Sam Weinig.
3024
3025         * wtf/FeatureDefines.h:
3026
3027 2017-08-05  Filip Pizlo  <fpizlo@apple.com>
3028
3029         REGRESSION (r219895-219897): Number of leaks on Open Source went from 9240 to 235983 and is now at 302372
3030         https://bugs.webkit.org/show_bug.cgi?id=175083
3031
3032         Reviewed by Oliver Hunt.
3033         
3034         Adds a classic ReadWriteLock class. I wrote my own because I can never remember if the pthread one is
3035         guaranted to bias in favor of writers or not.
3036
3037         * WTF.xcodeproj/project.pbxproj:
3038         * wtf/Condition.h:
3039         (WTF::ConditionBase::construct):
3040         (WTF::Condition::Condition):
3041         * wtf/Lock.h:
3042         (WTF::LockBase::construct):
3043         (WTF::Lock::Lock):
3044         * wtf/ReadWriteLock.cpp: Added.
3045         (WTF::ReadWriteLockBase::construct):
3046         (WTF::ReadWriteLockBase::readLock):
3047         (WTF::ReadWriteLockBase::readUnlock):
3048         (WTF::ReadWriteLockBase::writeLock):
3049         (WTF::ReadWriteLockBase::writeUnlock):
3050         * wtf/ReadWriteLock.h: Added.
3051         (WTF::ReadWriteLockBase::ReadLock::tryLock):
3052         (WTF::ReadWriteLockBase::ReadLock::lock):
3053         (WTF::ReadWriteLockBase::ReadLock::unlock):
3054         (WTF::ReadWriteLockBase::WriteLock::tryLock):
3055         (WTF::ReadWriteLockBase::WriteLock::lock):
3056         (WTF::ReadWriteLockBase::WriteLock::unlock):
3057         (WTF::ReadWriteLockBase::read):
3058         (WTF::ReadWriteLockBase::write):
3059         (WTF::ReadWriteLock::ReadWriteLock):
3060
3061 2017-08-04  Matt Lewis  <jlewis3@apple.com>
3062
3063         Unreviewed, rolling out r220271.
3064
3065         Rolling out due to Layout Test failing on iOS Simulator.
3066
3067         Reverted changeset:
3068
3069         "Remove STREAMS_API compilation guard"
3070         https://bugs.webkit.org/show_bug.cgi?id=175165
3071         http://trac.webkit.org/changeset/220271
3072
3073 2017-08-04  Youenn Fablet  <youenn@apple.com>
3074
3075         Remove STREAMS_API compilation guard
3076         https://bugs.webkit.org/show_bug.cgi?id=175165
3077
3078         Reviewed by Darin Adler.
3079
3080         * wtf/FeatureDefines.h:
3081
3082 2017-08-03  Brian Burg  <bburg@apple.com>
3083
3084         Remove ENABLE(WEB_SOCKET) guards
3085         https://bugs.webkit.org/show_bug.cgi?id=167044
3086
3087         Reviewed by Joseph Pecoraro.
3088
3089         * wtf/FeatureDefines.h:
3090
3091 2017-08-03  Youenn Fablet  <youenn@apple.com>
3092
3093         Remove FETCH_API compilation guard
3094         https://bugs.webkit.org/show_bug.cgi?id=175154
3095
3096         Reviewed by Chris Dumez.
3097
3098         * wtf/FeatureDefines.h:
3099
3100 2017-08-03  Brady Eidson  <beidson@apple.com>
3101
3102         Add SW IDLs and stub out basic functionality.
3103         https://bugs.webkit.org/show_bug.cgi?id=175115
3104
3105         Reviewed by Chris Dumez.
3106
3107         * wtf/FeatureDefines.h:
3108
3109 2017-08-03  Yusuke Suzuki  <utatane.tea@gmail.com>
3110
3111         Unreviewed, build fix for Windows port
3112         https://bugs.webkit.org/show_bug.cgi?id=175013
3113
3114         * wtf/Threading.h:
3115
3116 2017-08-03  Yusuke Suzuki  <utatane.tea@gmail.com>
3117
3118         Merge ThreadHolder to WTF::Thread itself
3119         https://bugs.webkit.org/show_bug.cgi?id=175013
3120
3121         Reviewed by Mark Lam.
3122
3123         Currently, we store ThreadHolder* to the TLS, and ThreadHolder* holds Ref<Thread>.
3124         When we get Thread& from the current thread TLS, we need to dereference the ThreadHolder*.
3125         However, ideally, we can store Thread* directly to the current thread TLS.
3126         While the ThreadHolder design is beautiful, it's worth optimizing by storing Thread* directly
3127         since Thread::current() is so frequently executed.
3128
3129         This patch merges ThreadHolder to Thread. And we now store Thread* directly in the TLS.
3130         When storing it to TLS, we call leakRef() to keep Thread ref count incremented by the TLS.
3131         And when destroying the TLS, we call `deref()` to ensure that Thread* is dereferenced from
3132         the TLS.
3133
3134         * WTF.xcodeproj/project.pbxproj:
3135         * wtf/CMakeLists.txt:
3136         * wtf/ThreadHolder.cpp: Removed.
3137         * wtf/ThreadHolder.h: Removed.
3138         * wtf/ThreadHolderPthreads.cpp: Removed.
3139         * wtf/ThreadHolderWin.cpp: Removed.
3140         * wtf/Threading.cpp:
3141         (WTF::Thread::entryPoint):
3142         (WTF::initializeThreading):
3143         * wtf/Threading.h:
3144         (WTF::Thread::currentMayBeNull):
3145         (WTF::Thread::current):
3146         * wtf/ThreadingPthreads.cpp:
3147         (WTF::Thread::waitForCompletion):
3148         (WTF::Thread::initializeCurrentTLS):
3149         (WTF::Thread::initializeTLSKey):
3150         (WTF::Thread::initializeTLS):
3151         (WTF::Thread::destructTLS):
3152         (WTF::Thread::createCurrentThread): Deleted.
3153         * wtf/ThreadingWin.cpp:
3154         (WTF::Thread::initializeCurrentTLS):
3155         (WTF::threadMapMutex):
3156         (WTF::Thread::initializeTLSKey):
3157         (WTF::Thread::currentDying):
3158         (WTF::Thread::get):
3159         (WTF::Thread::initializeTLS):
3160         (WTF::Thread::destructTLS):
3161         (WTF::waitForThreadCompletion):
3162         (WTF::Thread::createCurrentThread): Deleted.
3163
3164 2017-08-03  Yusuke Suzuki  <utatane.tea@gmail.com>
3165
3166         [Linux][WTF] Use one global semaphore to notify thread suspend and resume completion
3167         https://bugs.webkit.org/show_bug.cgi?id=175124
3168
3169         Reviewed by Carlos Garcia Campos.
3170
3171         POSIX sem_t is used to notify thread suspend and resume completion in Linux ports
3172         since sem_post is async-signal-safe function. Since we guard suspend() and resume()
3173         with one global lock, this semaphore is also guarded by this lock. So we do not need
3174         to have semaphore per WTF::Thread.
3175
3176         This patch introduces one global Semaphore. And drop per thread semaphore.
3177
3178         * wtf/Threading.h:
3179         * wtf/ThreadingPthreads.cpp:
3180         (WTF::Thread::~Thread):
3181         (WTF::Semaphore::Semaphore):
3182         (WTF::Semaphore::~Semaphore):
3183         (WTF::Semaphore::wait):
3184         (WTF::Semaphore::post):
3185         (WTF::Thread::signalHandlerSuspendResume):
3186         (WTF::Thread::initializePlatformThreading):
3187         (WTF::Thread::suspend):
3188         (WTF::Thread::resume):
3189         (WTF::Thread::Thread): Deleted.
3190         * wtf/ThreadingWin.cpp:
3191         (WTF::Thread::Thread): Deleted.
3192
3193 2017-08-03  Yusuke Suzuki  <utatane.tea@gmail.com>
3194
3195         [Linux][WTF] Reduce sizeof(WTF::Thread) by using a pointer to PlatformRegisters
3196         https://bugs.webkit.org/show_bug.cgi?id=175119
3197
3198         Reviewed by Carlos Garcia Campos.
3199
3200         sizeof(PlatformRegisters) is so large. In my Linux box, it is 256. It enlarges the sizeof(WTF::Thread).
3201         However, it is not necessary to hold it in WTF::Thread member. Thread's ucontext data and its stack is
3202         effective while suspending the thread. So, we can just use the pointer to the PlatformRegister instead
3203         of copying it to the member of the WTF::Thread.
3204
3205         * wtf/Threading.h:
3206         * wtf/ThreadingPthreads.cpp:
3207         (WTF::Thread::signalHandlerSuspendResume):
3208         (WTF::Thread::getRegisters):
3209
3210 2017-08-02  Yusuke Suzuki  <utatane.tea@gmail.com>
3211
3212         Unreviewed, build fix for Windows port
3213         https://bugs.webkit.org/show_bug.cgi?id=174716
3214
3215         This ugliness will be fixed in https://bugs.webkit.org/show_bug.cgi?id=175013.
3216
3217         * wtf/ThreadHolder.h:
3218         * wtf/Threading.h:
3219
3220 2017-08-02  Yusuke Suzuki  <utatane.tea@gmail.com>
3221
3222         Merge WTFThreadData to Thread::current
3223         https://bugs.webkit.org/show_bug.cgi?id=174716
3224
3225         Reviewed by Mark Lam.
3226
3227         We placed thread specific data in WTFThreadData previously. But now, we have a new good place
3228         to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
3229         sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
3230         This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
3231         to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
3232         Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
3233         before calling WTF::initializeThreading.
3234
3235         * WTF.xcodeproj/project.pbxproj:
3236         * wtf/CMakeLists.txt:
3237         * wtf/LockAlgorithm.h:
3238         * wtf/LockAlgorithmInlines.h:
3239         * wtf/MainThread.h:
3240         * wtf/ParkingLot.cpp:
3241         * wtf/StackStats.cpp:
3242         (WTF::StackStats::PerThreadStats::PerThreadStats):
3243         (WTF::StackStats::CheckPoint::CheckPoint):
3244         (WTF::StackStats::CheckPoint::~CheckPoint):
3245         (WTF::StackStats::probe):
3246         (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
3247         * wtf/ThreadHolder.cpp:
3248         (WTF::ThreadHolder::initializeCurrent):
3249         * wtf/ThreadHolder.h:
3250         (WTF::ThreadHolder::ThreadHolder):
3251         (WTF::ThreadHolder::currentMayBeNull):
3252         (WTF::ThreadHolder::current):
3253         * wtf/ThreadHolderPthreads.cpp:
3254         (WTF::ThreadHolder::initializeKey):
3255         (WTF::ThreadHolder::initialize):
3256         (WTF::ThreadHolder::destruct):
3257         (WTF::ThreadHolder::initializeOnce): Deleted.
3258         (WTF::ThreadHolder::current): Deleted.
3259         * wtf/ThreadHolderWin.cpp:
3260         (WTF::ThreadHolder::initializeKey):
3261         (WTF::ThreadHolder::currentDying):
3262         (WTF::ThreadHolder::initialize):
3263         (WTF::ThreadHolder::initializeOnce): Deleted.
3264         (WTF::ThreadHolder::current): Deleted.
3265         * wtf/Threading.cpp:
3266         (WTF::Thread::initializeInThread):
3267         (WTF::Thread::entryPoint):
3268         (WTF::Thread::create):
3269         (WTF::Thread::didExit):
3270         (WTF::initializeThreading):
3271         (WTF::Thread::currentMayBeNull): Deleted.
3272         * wtf/Threading.h:
3273         (WTF::Thread::current):
3274         (WTF::Thread::atomicStringTable):
3275         (WTF::Thread::setCurrentAtomicStringTable):
3276         (WTF::Thread::stackStats):
3277         (WTF::Thread::savedStackPointerAtVMEntry):
3278         (WTF::Thread::setSavedStackPointerAtVMEntry):
3279         (WTF::Thread::savedLastStackTop):
3280         (WTF::Thread::setSavedLastStackTop):
3281         * wtf/ThreadingPrimitives.h:
3282         * wtf/ThreadingPthreads.cpp:
3283         (WTF::Thread::createCurrentThread):
3284         (WTF::Thread::current): Deleted.
3285         * wtf/ThreadingWin.cpp:
3286         (WTF::Thread::createCurrentThread):
3287         (WTF::Thread::current): Deleted.
3288         * wtf/WTFThreadData.cpp: Removed.
3289         * wtf/WTFThreadData.h: Removed.
3290         * wtf/text/AtomicString.cpp:
3291         * wtf/text/AtomicStringImpl.cpp:
3292         (WTF::stringTable):
3293         * wtf/text/AtomicStringTable.cpp:
3294         (WTF::AtomicStringTable::create):
3295         * wtf/text/AtomicStringTable.h:
3296
3297 2017-08-02  Joseph Pecoraro  <pecoraro@apple.com>
3298
3299         NeverDestroyed related leaks seen on bots
3300         https://bugs.webkit.org/show_bug.cgi?id=175113
3301
3302         Reviewed by Yusuke Suzuki.
3303
3304         * wtf/NeverDestroyed.h:
3305         (WTF::NeverDestroyed::NeverDestroyed):
3306         Previously the result of makeNeverDestroyed was not always moving into
3307         the `static NeverDestroyed` static local variable. In some cases it would
3308         re-invoke the constructor, creating a new NeverDestroyed object. In the
3309         case of a Vector it was causing leaks.
3310
3311         Adding a move constructor convinces the compiler to move the result
3312         of makeNeverDestroyed into the NeverDestroyed static. It doesn't actually
3313         invoke the move constructor here, which I believe means it is deciding
3314         to perform optional copy elision optimization.
3315         'http://en.cppreference.com/w/cpp/language/copy_elision
3316
3317 2017-08-02  Filip Pizlo  <fpizlo@apple.com>
3318
3319         All C++ accesses to JSObject::m_butterfly should do caging
3320         https://bugs.webkit.org/show_bug.cgi?id=175039
3321
3322         Reviewed by Keith Miller.
3323         
3324         Adds a smart pointer class that does various kinds of caging for you.
3325
3326         * WTF.xcodeproj/project.pbxproj:
3327         * wtf/CMakeLists.txt:
3328         * wtf/CagedPtr.h: Added.
3329         (WTF::CagedPtr::CagedPtr):
3330         (WTF::CagedPtr::get const):
3331         (WTF::CagedPtr::getMayBeNull const):
3332         (WTF::CagedPtr::operator== const):
3333         (WTF::CagedPtr::operator!= const):
3334         (WTF::CagedPtr::operator bool const):
3335         (WTF::CagedPtr::operator* const):
3336         (WTF::CagedPtr::operator-> const):
3337
3338 2017-08-02  Filip Pizlo  <fpizlo@apple.com>
3339
3340         We should be OK with the gigacage being disabled on gmalloc
3341         https://bugs.webkit.org/show_bug.cgi?id=175082
3342
3343         Reviewed by Michael Saboff.
3344
3345         * wtf/Gigacage.h:
3346         (Gigacage::shouldBeEnabled):
3347
3348 2017-08-01  Filip Pizlo  <fpizlo@apple.com>
3349
3350         Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
3351         https://bugs.webkit.org/show_bug.cgi?id=174727
3352
3353         Reviewed by Mark Lam.
3354         
3355         For the Gigacage project to have minimal impact, we need to have some abstraction that allows code to
3356         avoid having to guard itself with #if's. This adds a Gigacage abstraction that overlays the Gigacage
3357         namespace from bmalloc, which always lets you call things like Gigacage::caged and Gigacage::tryMalloc.
3358         
3359         Because of how many places need to possibly allocate in a gigacage, or possibly perform caged accesses,
3360         it's better to hide the question of whether or not it's enabled inside this API.
3361
3362         * WTF.xcodeproj/project.pbxproj:
3363         * wtf/CMakeLists.txt:
3364         * wtf/FastMalloc.cpp:
3365         * wtf/Gigacage.cpp: Added.
3366         (Gigacage::tryMalloc):
3367         (Gigacage::tryAllocateVirtualPages):
3368         (Gigacage::freeVirtualPages):
3369         (Gigacage::tryAlignedMalloc):
3370         (Gigacage::alignedFree):
3371         (Gigacage::free):
3372         * wtf/Gigacage.h: Added.
3373         (Gigacage::ensureGigacage):
3374         (Gigacage::disableGigacage):
3375         (Gigacage::addDisableCallback):
3376         (Gigacage::removeDisableCallback):
3377         (Gigacage::caged):
3378         (Gigacage::isCaged):
3379         (Gigacage::tryAlignedMalloc):
3380         (Gigacage::alignedFree):
3381         (Gigacage::free):
3382
3383 2017-07-31  Matt Lewis  <jlewis3@apple.com>
3384
3385         Unreviewed, rolling out r220060.
3386
3387         This broke our internal builds. Contact reviewer of patch for
3388         more information.
3389
3390         Reverted changeset:
3391
3392         "Merge WTFThreadData to Thread::current"
3393         https://bugs.webkit.org/show_bug.cgi?id=174716
3394         http://trac.webkit.org/changeset/220060
3395
3396 2017-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
3397
3398         Merge WTFThreadData to Thread::current
3399         https://bugs.webkit.org/show_bug.cgi?id=174716
3400
3401         Reviewed by Sam Weinig.
3402
3403         We placed thread specific data in WTFThreadData previously. But now, we have a new good place
3404         to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
3405         sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
3406         This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
3407         to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
3408         Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
3409         before calling WTF::initializeThreading.
3410
3411         * WTF.xcodeproj/project.pbxproj:
3412         * wtf/CMakeLists.txt:
3413         * wtf/LockAlgorithm.h:
3414         * wtf/LockAlgorithmInlines.h:
3415         * wtf/MainThread.h:
3416         * wtf/ParkingLot.cpp:
3417         * wtf/StackStats.cpp:
3418         (WTF::StackStats::PerThreadStats::PerThreadStats):
3419         (WTF::StackStats::CheckPoint::CheckPoint):
3420         (WTF::StackStats::CheckPoint::~CheckPoint):
3421         (WTF::StackStats::probe):
3422         (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
3423         * wtf/ThreadHolder.cpp:
3424         (WTF::ThreadHolder::initializeCurrent):
3425         * wtf/ThreadHolder.h:
3426         (WTF::ThreadHolder::ThreadHolder):
3427         (WTF::ThreadHolder::currentMayBeNull):
3428         (WTF::ThreadHolder::current):
3429         * wtf/ThreadHolderPthreads.cpp:
3430         (WTF::ThreadHolder::initialize):
3431         (WTF::ThreadHolder::destruct):
3432         (WTF::ThreadHolder::current): Deleted.
3433         * wtf/ThreadHolderWin.cpp:
3434         (WTF::ThreadHolder::currentDying):
3435         (WTF::ThreadHolder::initialize):
3436         (WTF::ThreadHolder::current): Deleted.
3437         * wtf/Threading.cpp:
3438         (WTF::Thread::initializeInThread):
3439         (WTF::Thread::entryPoint):
3440         (WTF::Thread::didExit):
3441         (WTF::initializeThreading):
3442         (WTF::Thread::currentMayBeNull): Deleted.
3443         * wtf/Threading.h:
3444         (WTF::Thread::atomicStringTable):
3445         (WTF::Thread::setCurrentAtomicStringTable):
3446         (WTF::Thread::stackStats):
3447         (WTF::Thread::savedStackPointerAtVMEntry):
3448         (WTF::Thread::setSavedStackPointerAtVMEntry):
3449         (WTF::Thread::savedLastStackTop):
3450         (WTF::Thread::setSavedLastStackTop):
3451         (WTF::Thread::current):
3452         * wtf/ThreadingPrimitives.h:
3453         * wtf/ThreadingPthreads.cpp:
3454         (WTF::Thread::createCurrentThread):
3455         (WTF::Thread::current): Deleted.
3456         * wtf/ThreadingWin.cpp:
3457         (WTF::Thread::createCurrentThread):
3458         (WTF::Thread::current): Deleted.
3459         * wtf/WTFThreadData.cpp: Removed.
3460         * wtf/WTFThreadData.h: Removed.
3461         * wtf/text/AtomicString.cpp:
3462         * wtf/text/AtomicStringImpl.cpp:
3463         (WTF::stringTable):
3464         * wtf/text/AtomicStringTable.cpp:
3465         (WTF::AtomicStringTable::create):
3466         * wtf/text/AtomicStringTable.h:
3467
3468 2017-07-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3469
3470         Created a bool pretty printer at WTF for debugging purposes
3471         https://bugs.webkit.org/show_bug.cgi?id=174893
3472
3473         Reviewed by Darin Adler.
3474
3475         * wtf/PrintStream.cpp:
3476         (WTF::printInternal): The overload taking bool uses boolForPrinting
3477         * wtf/PrintStream.h:
3478         (WTF::boolForPrinting): Converts a bool in "true" or "false".
3479
3480 2017-07-30  Yusuke Suzuki  <utatane.tea@gmail.com>
3481
3482         [WTF] Introduce Private Symbols
3483         https://bugs.webkit.org/show_bug.cgi?id=174935
3484
3485         Reviewed by Darin Adler.
3486
3487         Upcoming proposal of class fields[1] requires private fields.
3488         The simple way to implement it is adding a property with a private symbol.
3489         Currently, we have private symbols for internal properties. They are usual
3490         Symbols managed by the hash table. So basically private symbols are statically
3491         created in BuiltinNames. However this new proposal encourages users to create
3492         such private symbols more and more.
3493
3494         So, this patch introduces notion of "Private" into WTF SymbolImpl. This patch
3495         adds PrivateSymbolImpl. This is SymbolImpl with "Private" flag. We do not need
3496         to look up the symbol from the hash table to check whether the given symbol
3497         is a private one.
3498
3499         [1]: https://github.com/tc39/proposal-class-fields
3500
3501         * wtf/text/StringImpl.h:
3502         * wtf/text/SymbolImpl.cpp:
3503         (WTF::PrivateSymbolImpl::create):
3504         (WTF::PrivateSymbolImpl::createNullSymbol):
3505         * wtf/text/SymbolImpl.h:
3506         (WTF::SymbolImpl::isPrivate):
3507         (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
3508         (WTF::SymbolImpl::SymbolImpl):
3509         (WTF::PrivateSymbolImpl::PrivateSymbolImpl):
3510
3511 2017-07-30  Brady Eidson  <beidson@apple.com>
3512
3513         Add URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks.
3514         https://bugs.webkit.org/show_bug.cgi?id=174958
3515
3516         Reviewed by Darin Adler.
3517
3518         This patch adds a new template class "InstanceCounted<T>".
3519         
3520         For each specialization, "InstanceCounted" will keep track of the total number of
3521         instances in existence.
3522         
3523         This makes explicate leak checking in API tests possible.
3524         
3525         Since this adds some runtime and storage overhead the code that actually does anything
3526         is only compiled in debug builds.
3527         
3528         * WTF.xcodeproj/project.pbxproj:
3529         * wtf/InstanceCounted.h: Added.
3530         (WTF::InstanceCounted::InstanceCounted):
3531         (WTF::InstanceCounted::instanceCount):
3532         (WTF::InstanceCounted::~InstanceCounted):
3533
3534 2017-07-27  Yusuke Suzuki  <utatane.tea@gmail.com>
3535
3536         [WTF] Drop Thread initialization wait in some platforms by introducing StackBounds::newThreadStackBounds(PlatformThreadHandle&)
3537         https://bugs.webkit.org/show_bug.cgi?id=174303
3538
3539         Reviewed by Mark Lam.
3540
3541         Currently, the caller thread of Thread::create() need to wait for completion of the initialization of the target thread.
3542         This is because we need to initialize Thread::m_stack in the target thread. Before this patch, a target thread's
3543         StackBounds can only be retrieved by the target thread itself. However, this potentially causes context-switching between
3544         the caller and the target threads and hurts efficiency of creating threads.
3545
3546         Fortunately, in some platforms (including major platforms except for Windows), we can get StackBounds of a target
3547         thread from a caller thread. This allows us to avoid waiting for completion of thread initialization.
3548
3549         In this patch, we introduce HAVE_STACK_BOUNDS_FOR_NEW_THREAD and StackBounds::newThreadStackBounds. When creating
3550         a new thread, we will use StackBounds::newThreadStackBounds to get StackBounds if possible. As a result, we
3551         do not need to wait for completion of thread initialization to ensure m_stack field of Thread is initialized.
3552
3553         While some documents claim that it is possible on Windows to get the StackBounds of another thread[1], the method relies on
3554         undocumented Windows NT APIs (NtQueryInformationThread, NtReadVirtualMemory etc.). So in this patch, we just
3555         use the conservative approach simply waiting for completion of thread initialization.
3556
3557         [1]: https://stackoverflow.com/questions/3918375/how-to-get-thread-stack-information-on-windows
3558
3559         * wtf/Platform.h:
3560         * wtf/StackBounds.cpp:
3561         (WTF::StackBounds::newThreadStackBounds):
3562         (WTF::StackBounds::currentThreadStackBoundsInternal):
3563         (WTF::StackBounds::initialize): Deleted.
3564         * wtf/StackBounds.h:
3565         (WTF::StackBounds::currentThreadStackBounds):
3566         (WTF::StackBounds::StackBounds):
3567         * wtf/Threading.cpp:
3568         (WTF::Thread::NewThreadContext::NewThreadContext):
3569         (WTF::Thread::entryPoint):
3570         (WTF::Thread::create):
3571         (WTF::Thread::initialize): Deleted.
3572         * wtf/Threading.h:
3573         * wtf/ThreadingPrimitives.h:
3574         * wtf/ThreadingPthreads.cpp:
3575         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3576         (WTF::wtfThreadEntryPoint):
3577         (WTF::Thread::establishHandle):
3578         (WTF::Thread::initializeCurrentThreadInternal):
3579         (WTF::Thread::current):
3580         * wtf/ThreadingWin.cpp:
3581         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3582         (WTF::Thread::initializeCurrentThreadInternal):
3583         (WTF::Thread::current):
3584         * wtf/win/MainThreadWin.cpp:
3585         (WTF::initializeMainThreadPlatform):
3586
3587 2017-07-27  JF Bastien  <jfbastien@apple.com>
3588
3589         Update lock benchmarks
3590         https://bugs.webkit.org/show_bug.cgi?id=174907
3591
3592         Reviewed by Filip Pizlo.
3593
3594         * benchmarks/ConditionSpeedTest.cpp:
3595         (main):
3596         * benchmarks/LockFairnessTest.cpp:
3597         * benchmarks/LockSpeedTest.cpp:
3598         * benchmarks/ToyLocks.h:
3599
3600 2017-07-26  Brian Burg  <bburg@apple.com>
3601
3602         Remove WEB_TIMING feature flag
3603         https://bugs.webkit.org/show_bug.cgi?id=174795
3604
3605         Reviewed by Alex Christensen.
3606
3607         * wtf/FeatureDefines.h:
3608
3609 2017-07-26  Claudio Saavedra  <csaavedra@igalia.com>
3610
3611         [WPE] Enable KeyboardEvent key and code attributes
3612         https://bugs.webkit.org/show_bug.cgi?id=174822
3613
3614         Reviewed by Žan Doberšek.
3615
3616         There is no reason for this to be disabled from what I see.
3617