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