Unreviewed, build fix in GTK port
[WebKit.git] / Source / WTF / ChangeLog
1 2017-08-23  Yusuke Suzuki  <utatane.tea@gmail.com>
2
3         Unreviewed, build fix in GTK port
4         https://bugs.webkit.org/show_bug.cgi?id=174590
5
6         * wtf/SingleRootGraph.h:
7         (WTF::SingleRootGraph::successors const):
8         (WTF::SingleRootGraph::predecessors const):
9
10 2017-08-23  Saam Barati  <sbarati@apple.com>
11
12         Support compiling catch in the DFG
13         https://bugs.webkit.org/show_bug.cgi?id=174590
14
15         Reviewed by Filip Pizlo.
16
17         This patch generalizes the BackwardsGraph fake root into a more generalizable
18         class called SingleRootGraph. SingleRootGraph exposes the general graph interface
19         used in Dominators and NaturalLoops. SingleRootGraph takes as input a graph with
20         the normal graph interface, but also allows the input graph to contain more than
21         one root. SingleRootGraph then exposes a single root, which it creates, that has
22         an outgoing edge to all the roots in the original graph.
23
24         * WTF.xcodeproj/project.pbxproj:
25         * wtf/BackwardsGraph.h:
26         (WTF::BackwardsGraph::dump const):
27         (WTF::BackwardsGraph::rootName): Deleted.
28         (WTF::BackwardsGraph::Node::Node): Deleted.
29         (WTF::BackwardsGraph::Node::root): Deleted.
30         (WTF::BackwardsGraph::Node::operator== const): Deleted.
31         (WTF::BackwardsGraph::Node::operator!= const): Deleted.
32         (WTF::BackwardsGraph::Node::operator bool const): Deleted.
33         (WTF::BackwardsGraph::Node::isRoot const): Deleted.
34         (WTF::BackwardsGraph::Node::node const): Deleted.
35         (): Deleted.
36         (WTF::BackwardsGraph::Set::Set): Deleted.
37         (WTF::BackwardsGraph::Set::add): Deleted.
38         (WTF::BackwardsGraph::Set::remove): Deleted.
39         (WTF::BackwardsGraph::Set::contains): Deleted.
40         (WTF::BackwardsGraph::Set::dump const): Deleted.
41         (WTF::BackwardsGraph::Map::Map): Deleted.
42         (WTF::BackwardsGraph::Map::clear): Deleted.
43         (WTF::BackwardsGraph::Map::size const): Deleted.
44         (WTF::BackwardsGraph::Map::operator[]): Deleted.
45         (WTF::BackwardsGraph::Map::operator[] const): Deleted.
46         * wtf/Dominators.h:
47         (WTF::Dominators::Dominators):
48         (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOf):
49         (WTF::Dominators::forAllBlocksInPrunedIteratedDominanceFrontierOf):
50         (WTF::Dominators::iteratedDominanceFrontierOf const):
51         (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl const):
52         * wtf/SingleRootGraph.h: Added.
53         (WTF::SingleRootGraphNode::rootName):
54         (WTF::SingleRootGraphNode::SingleRootGraphNode):
55         (WTF::SingleRootGraphNode::root):
56         (WTF::SingleRootGraphNode::operator== const):
57         (WTF::SingleRootGraphNode::operator!= const):
58         (WTF::SingleRootGraphNode::operator bool const):
59         (WTF::SingleRootGraphNode::isRoot const):
60         (WTF::SingleRootGraphNode::node const):
61         (WTF::SingleRootGraphSet::add):
62         (WTF::SingleRootGraphSet::remove):
63         (WTF::SingleRootGraphSet::contains):
64         (WTF::SingleRootGraphSet::dump const):
65         (WTF::SingleRootMap::SingleRootMap):
66         (WTF::SingleRootMap::clear):
67         (WTF::SingleRootMap::size const):
68         (WTF::SingleRootMap::operator[]):
69         (WTF::SingleRootMap::operator[] const):
70         (WTF::SingleRootGraph::SingleRootGraph):
71         (WTF::SingleRootGraph::root const):
72         (WTF::SingleRootGraph::newMap):
73         (WTF::SingleRootGraph::successors const):
74         (WTF::SingleRootGraph::predecessors const):
75         (WTF::SingleRootGraph::index const):
76         (WTF::SingleRootGraph::node const):
77         (WTF::SingleRootGraph::numNodes const):
78         (WTF::SingleRootGraph::dump const):
79         (WTF::SingleRootGraph::assertIsConsistent const):
80
81 2017-08-23  Youenn Fablet  <youenn@apple.com>
82
83         [Cache API] Enable persistent coder to encode FetchOptions
84         https://bugs.webkit.org/show_bug.cgi?id=175883
85
86         Reviewed by Alex Christensen.
87
88         Enabling encoding/decoding of enums with EnumTraits.
89         This code is similar to the one of IPC encoder/decoder.
90
91         * wtf/persistence/PersistentDecoder.h:
92         (WTF::Persistence::Decoder::decode):
93         * wtf/persistence/PersistentEncoder.h:
94         (WTF::Persistence::Encoder::encode):
95
96 2017-08-23  Per Arne Vollan  <pvollan@apple.com>
97
98         [Win] Compile error, include file <wtf/AVFoundationHeaderDetection.h> is not found.
99         https://bugs.webkit.org/show_bug.cgi?id=175853
100
101         Reviewed by Brent Fulgham.
102
103         Copy generated WTF header files to the same place as we copy forwarding headers.
104  
105         * WTF.vcxproj/WTF.proj:
106
107 2017-08-22  Chris Dumez  <cdumez@apple.com>
108
109         Introduce a new CompletionHandler type and use it for NetworkDataTaskClient's completion handlers to help catch bugs
110         https://bugs.webkit.org/show_bug.cgi?id=175832
111
112         Reviewed by Alex Christensen.
113
114         Introduce a new CompletionHandler type which wraps a WTF::Function and ensures via assertions
115         that the function is always called once and only once.
116
117         * WTF.xcodeproj/project.pbxproj:
118         * wtf/CompletionHandler.h: Added.
119         (WTF::CompletionHandler<Out):
120
121 2017-08-22  Alex Christensen  <achristensen@webkit.org>
122
123         Fix Windows build after r221017.
124         https://bugs.webkit.org/show_bug.cgi?id=157053
125
126         * wtf/PlatformWin.cmake:
127
128 2017-08-22  Per Arne Vollan  <pvollan@apple.com>
129
130         Implement 64-bit MacroAssembler::probe support for Windows.
131         https://bugs.webkit.org/show_bug.cgi?id=175724
132
133         Reviewed by Mark Lam.
134
135         Enable masm probe and DFG.
136
137         * wtf/Platform.h:
138
139 2017-08-21  Mark Lam  <mark.lam@apple.com>
140
141         [Follow up]: Add back the ability to disable MASM_PROBE from the build.
142         https://bugs.webkit.org/show_bug.cgi?id=175656
143         <rdar://problem/33933720>
144
145         Not reviewed.
146
147         Fixed a typo: should be "OS(WINDOWS)", not "OS(WINDOW)".
148
149         * wtf/Platform.h:
150
151 2017-08-21  Carlos Alberto Lopez Perez  <clopez@igalia.com>
152
153         [GTK] ARMv7 build fails to build MacroAssemblerARMv7.cpp.
154         https://bugs.webkit.org/show_bug.cgi?id=175514
155
156         Reviewed by Keith Miller.
157
158         * wtf/Platform.h: Enable DFG and MASM_PROBE back for GTK ARM_THUMB2.
159
160 2017-08-20  Sam Weinig  <sam@webkit.org>
161
162         StringView could use a function to strip leading/trailing characters without allocation
163         https://bugs.webkit.org/show_bug.cgi?id=175757
164
165         Reviewed by Darin Adler.
166
167         There are many places in WebCore/WebKit that we call functions like, 
168         WebCore::stripLeadingAndTrailingHTMLSpaces,  or String::stripWhiteSpace() only to use 
169         the allocated String as a temporary for either another transformation or a comparison.
170         Now that we have StringView, we can avoid that extra allocation, by having returning a
171         StringView  substring in these scenarios.
172
173         For instance, the check (from ScriptElement.cpp:287):
174
175         if (!stripLeadingAndTrailingHTMLSpaces(sourceURL).isEmpty()) {
176             ...
177         }
178
179         currently allocates a string just to make this check. With a new 
180         stripLeadingAndTrailingHTMLSpaces such as:
181
182         StringView stripLeadingAndTrailingHTMLSpaces(StringView stringView)
183         {
184             return stringView.stripLeadingAndTrailingMatchedCharacters([] (auto c) {
185                 return isHTMLSpace(c);
186             });
187         }
188
189         We could instead have exact same code from ScriptElement.cpp now avoid an allocation.
190
191         * wtf/text/StringView.h:
192         (WTF::StringView::stripLeadingAndTrailingMatchedCharacters):
193
194 2017-08-21  Eric Carlson  <eric.carlson@apple.com>
195
196         Add WTFLogChannel level to allow runtime log filtering
197         https://bugs.webkit.org/show_bug.cgi?id=175731
198         <rdar://problem/33967234>
199
200         Reviewed by Jer Noble.
201         
202         Add WTFLog*, LOG, and RELEASE_LOG variants that take a "log level" parameter so code
203         can include logging statements that are only conditionally emitted.
204
205         * wtf/Assertions.cpp:
206         * wtf/Assertions.h:
207         * wtf/MemoryPressureHandler.cpp:
208         * wtf/RefCountedLeakCounter.cpp:
209
210 2017-08-20  Mark Lam  <mark.lam@apple.com>
211
212         Gardening: fix CLoop build.
213         https://bugs.webkit.org/show_bug.cgi?id=175688
214         <rdar://problem/33436870>
215
216         Not reviewed.
217
218         Disable MASM_PROBE if !ENABLE(JIT).
219
220         * wtf/Platform.h:
221
222 2017-08-18  Ryan Haddad  <ryanhaddad@apple.com>
223
224         Unreviewed, rolling out r220938.
225
226         The API tests added with this change are failing.
227
228         Reverted changeset:
229
230         "Add WTFLogChannel level to allow runtime log filtering"
231         https://bugs.webkit.org/show_bug.cgi?id=175731
232         http://trac.webkit.org/changeset/220938
233
234 2017-08-18  Eric Carlson  <eric.carlson@apple.com>
235
236         Add WTFLogChannel level to allow runtime log filtering
237         https://bugs.webkit.org/show_bug.cgi?id=175731
238         <rdar://problem/33967234>
239
240         Reviewed by Jer Noble.
241         
242         Add WTFLog*, LOG, and RELEASE_LOG variants that take a "log level" parameter so code
243         can include logging statements that are only conditionally emitted.
244
245         * wtf/Assertions.cpp:
246         * wtf/Assertions.h:
247         * wtf/MemoryPressureHandler.cpp:
248         * wtf/RefCountedLeakCounter.cpp:
249
250 2017-08-18  Per Arne Vollan  <pvollan@apple.com>
251
252         Implement 32-bit MacroAssembler::probe support for Windows.
253         https://bugs.webkit.org/show_bug.cgi?id=175449
254
255         Reviewed by Mark Lam.
256
257         Enable the DFG on Win32. 
258
259         * wtf/Platform.h:
260
261 2017-08-17  Mark Lam  <mark.lam@apple.com>
262
263         Only use 16 VFP registers if !CPU(ARM_NEON).
264         https://bugs.webkit.org/show_bug.cgi?id=175514
265
266         Reviewed by JF Bastien.
267
268         If CPU(ARM_NEON) is not enabled, we'll conservatively assume only VFP2 support is
269         available. Hence, we'll only the first 16 FPDoubleRegisterIDs are available.
270
271         For reference, see:
272         NEON registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJACABEJ.html
273         VFP2 and VFP3 registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CIHDIBDG.html
274         NEON to VFP register mapping: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJAIJHFC.html
275
276         This is mostly for GTK toolchains which may target older ARM CPUs which only have
277         VFP2 support.
278
279         * wtf/Platform.h:
280
281 2017-08-16  Mark Lam  <mark.lam@apple.com>
282
283         Add back the ability to disable MASM_PROBE from the build.
284         https://bugs.webkit.org/show_bug.cgi?id=175656
285         <rdar://problem/33933720>
286
287         Reviewed by Yusuke Suzuki.
288
289         * wtf/Platform.h:
290
291 2017-08-16  Mark Lam  <mark.lam@apple.com>
292
293         Gardening: fix GTK ARM_THUMB2 build.
294         https://bugs.webkit.org/show_bug.cgi?id=175446
295
296         Not reviewed.
297
298         Disable the use of the DFG for GTK ARM_THUMB2 builds until
299         https://bugs.webkit.org/show_bug.cgi?id=175514 is fixed.
300
301         * wtf/Platform.h:
302
303 2017-08-16  Andy Estes  <aestes@apple.com>
304
305         [Payment Request] Add an ENABLE flag and an experimental feature preference
306         https://bugs.webkit.org/show_bug.cgi?id=175622
307
308         Reviewed by Tim Horton.
309
310         * wtf/FeatureDefines.h:
311
312 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
313
314         Remove Proximity Events and related code
315         https://bugs.webkit.org/show_bug.cgi?id=175545
316
317         Reviewed by Daniel Bates.
318
319         No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS)
320         and other related code.
321
322         * wtf/FeatureDefines.h:
323
324 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
325
326         Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
327         https://bugs.webkit.org/show_bug.cgi?id=175504
328
329         Reviewed by Sam Weinig.
330
331         * wtf/FeatureDefines.h:
332
333 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
334
335         Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
336         https://bugs.webkit.org/show_bug.cgi?id=175557
337
338         Reviewed by Jon Lee.
339
340         No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.
341
342         * wtf/FeatureDefines.h:
343
344 2017-08-12  Filip Pizlo  <fpizlo@apple.com>
345
346         Put the ScopedArgumentsTable's ScopeOffset array in some gigacage
347         https://bugs.webkit.org/show_bug.cgi?id=174921
348
349         Reviewed by Mark Lam.
350         
351         If you want to std::unique_ptr a class that knows that it should be in the Gigacage, then we
352         would create the Gigacage equivalent of WTF_MAKE_FAST_ALLOCATED and it would just work.
353         
354         But this does not work if we want to std::unique_ptr a primitive type. So, this patch adds a
355         solution for this problem: CagedUniquePtr<>. This will handle allocation
356         (CagedUniquePtr<>::create()) and deallocation (in the style of std::unique_ptr). It has three
357         variants:
358         
359         - Non-array types.
360         - Arrays that don't have destructors.
361         - Arrays that have destructors.
362         
363         Just like std::unique_ptr, the array case is triggered by saying "[]" at the end of the type.
364         
365         Unlike std::unique_ptr and most other smart pointers, the whole point of this smart pointer is
366         to dictate where the thing you're pointing at is allocated. For this reason, it has to know how
367         to do things like the array destructor protocol. So it creates its own: the CagedUniquePtr for
368         arrays with destructors is a fat pointer that remembers the length of the array.
369         
370         CagedUniquePtr<> makes it impossible to leak/release the pointer. This is stricter than what
371         std::unique_ptr does, and is probably appropriate for all of the places where we would use this
372         type.
373         
374         So far, we only use it for ScopedArgumentsTable::m_arguments, but I suspect that it will be
375         useful in other places.
376
377         * WTF.xcodeproj/project.pbxproj:
378         * wtf/CMakeLists.txt:
379         * wtf/CagedUniquePtr.h: Added.
380         (WTF::CagedUniquePtr::CagedUniquePtr):
381         (WTF::CagedUniquePtr::create):
382         (WTF::CagedUniquePtr::operator=):
383         (WTF::CagedUniquePtr::~CagedUniquePtr):
384         (WTF::CagedUniquePtr::get const):
385         (WTF::CagedUniquePtr::getMayBeNull const):
386         (WTF::CagedUniquePtr::operator== const):
387         (WTF::CagedUniquePtr::operator!= const):
388         (WTF::CagedUniquePtr::operator bool const):
389         (WTF::CagedUniquePtr::operator* const):
390         (WTF::CagedUniquePtr::operator-> const):
391         (WTF::CagedUniquePtr::operator[] const):
392         (WTF::CagedUniquePtr::destroy):
393         * wtf/Gigacage.cpp:
394         (Gigacage::tryMallocArray):
395         (Gigacage::malloc):
396         (Gigacage::mallocArray):
397         * wtf/Gigacage.h:
398
399 2017-08-11  Ryosuke Niwa  <rniwa@webkit.org>
400
401         Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
402         https://bugs.webkit.org/show_bug.cgi?id=175474
403
404         Reviewed by Wenson Hsieh.
405
406         * wtf/FeatureDefines.h:
407
408 2017-08-11  Don Olmstead  <don.olmstead@sony.com>
409
410         [WTF] Move ValueToString into WTF
411         https://bugs.webkit.org/show_bug.cgi?id=175469
412
413         Reviewed by Sam Weinig.
414
415         * WTF.xcodeproj/project.pbxproj:
416         * wtf/CMakeLists.txt:
417         * wtf/text/ValueToString.h: Renamed from Source/WebCore/platform/ValueToString.h.
418
419 2017-08-11  Tim Horton  <timothy_horton@apple.com>
420
421         Fix the build with modern Clang's -Wexpansion-to-defined
422         https://bugs.webkit.org/show_bug.cgi?id=175467
423         <rdar://problem/33667497>
424
425         Reviewed by Simon Fraser.
426
427         * wtf/FeatureDefines.h:
428         * wtf/Platform.h:
429         Avoid object-like macros that expand to include defined(), because this
430         behaves inconsistently between different compilers (though in ways
431         that don't matter for these particular defines, which aren't used on MSVC),
432         and Clang has added a warning for it.
433
434         Move ENABLE_WEBASSEMBLY to Platform.h since it depends on things that
435         are defined there and can't be evaluated at time-of-use because of the
436         aforementioned new rules. Previously, there was a cycle between
437         ENABLE_WEBASSEMBLY and ENABLE_B3_JIT -- break that so that it just
438         goes FTL_JIT->B3_JIT->WASM instead.
439
440 2017-08-10  Sam Weinig  <sam@webkit.org>
441
442         WTF::Function does not allow for reference / non-default constructible return types
443         https://bugs.webkit.org/show_bug.cgi?id=175244
444
445         Reviewed by Chris Dumez.
446
447         When Function, then NoncopyableFunction, was templatized to allow non-void return values
448         in r201493, it maintained the behavior of being callable even if the Function was null.
449         To accomplish this, when null, the default construction of the return parameter was used.
450         This means Function can't be used with return types that are not default constructible,
451         such as reference types and Ref.
452
453         This behavior of returning something when null is surprising, as this is not how normal
454         functions behave, and not very useful. Instead, we now assert that the function is not
455         null when being called.
456
457         * wtf/Function.h:
458         (WTF::Function operator(...)):
459         Instead of allowing a null callable wrapper by returning the default construction of
460         the return type, assert that the wrapper is there when calling a Function.
461
462 2017-08-10  Mark Lam  <mark.lam@apple.com>
463
464         Make the MASM_PROBE mechanism mandatory for DFG and FTL builds.
465         https://bugs.webkit.org/show_bug.cgi?id=175446
466         <rdar://problem/33836545>
467
468         Reviewed by Saam Barati.
469
470         This is needed in order to support https://bugs.webkit.org/show_bug.cgi?id=174645.
471         One consequence of this is that the DFG will now be disabled for the MIPS and
472         Windows ports. See:
473             https://bugs.webkit.org/show_bug.cgi?id=175447
474             https://bugs.webkit.org/show_bug.cgi?id=175449
475
476         Also, we should only ENABLE_SIGNAL_BASED_VM_TRAPS if the DFG is enabled.  It was
477         never meaningful to use SIGNAL_BASED_VM_TRAPS with the baseline JIT anyway.  This
478         is a mis-configuration error that is now fixed.
479
480         * wtf/Platform.h:
481
482 2017-08-10  Brady Eidson  <beidson@apple.com>
483
484         Rename the source files for the WTF persistent coders.
485         https://bugs.webkit.org/show_bug.cgi?id=175441
486
487         Reviewed by Tim Horton.
488
489         * WTF.xcodeproj/project.pbxproj:
490         * wtf/CMakeLists.txt:
491
492         * wtf/persistence/PersistentCoder.h: Renamed from Source/WTF/wtf/persistence/Coder.h.
493         * wtf/persistence/PersistentCoders.cpp: Renamed from Source/WTF/wtf/persistence/Coders.cpp.
494         * wtf/persistence/PersistentCoders.h: Renamed from Source/WTF/wtf/persistence/Coders.h.
495         * wtf/persistence/PersistentDecoder.cpp: Renamed from Source/WTF/wtf/persistence/Decoder.cpp.
496         * wtf/persistence/PersistentDecoder.h: Renamed from Source/WTF/wtf/persistence/Decoder.h.
497         * wtf/persistence/PersistentEncoder.cpp: Renamed from Source/WTF/wtf/persistence/Encoder.cpp.
498         * wtf/persistence/PersistentEncoder.h: Renamed from Source/WTF/wtf/persistence/Encoder.h.
499
500 2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
501
502         Unreviewed, attempt to fix build failure with VC2017
503
504         * wtf/PriorityQueue.h:
505
506 2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>
507
508         Run more WTF tests
509         https://bugs.webkit.org/show_bug.cgi?id=174970
510
511         Reviewed by Michael Catanzaro.
512
513         CHAR_BIT is not defined.
514
515         * wtf/LEBDecoder.h:
516
517 2017-08-09  Yusuke Suzuki  <utatane.tea@gmail.com>
518
519         [WTF] ThreadSpecific should not introduce additional indirection
520         https://bugs.webkit.org/show_bug.cgi?id=175187
521
522         Reviewed by Mark Lam.
523
524         ThreadSpecific sets Data* to the TLS. And Data holds T*, which
525         is fast allocated actual data. But ideally, we should store T
526         instance directly in Data instead of introducing an additional
527         indirection.
528
529         This patch adds storage in Data in order to embed the instance of T. The constructor
530         for Data will invoke the constructor for T on the embedded storage. We also drop
531         ThreadSpecific::replace which is only used by the web thread to set its thread specific
532         ThreadGlobalData to the one shared from the main thread. The existing implementation
533         relies on the main thread and the web thread never exiting in order for the shared
534         ThreadGlobalData to stay alive. We can achieve the same semantics by using a
535         ThreadSpecific<std::unique_ptr<T>> to hold the ThreadGlobalData instance instead.
536
537         * wtf/ThreadSpecific.h:
538         (WTF::ThreadSpecific::Data::construct):
539         (WTF::ThreadSpecific::Data::Data):
540         We make it fast allocated since we previously allocated ThreadSpecific T data by fastMalloc.
541
542         (WTF::ThreadSpecific::Data::~Data):
543         (WTF::ThreadSpecific::Data::storagePointer const):
544         (WTF::canBeGCThread>::get):
545         We also drop RELEASE_ASSERT from ::get(). We already inserted this assert to setAndConstruct(),
546         so when creating the member to this TLS, we execute this release assert. So it is
547         not necessary to execute this assertion every time we get data from this TLS.
548
549         (WTF::canBeGCThread>::set):
550         (WTF::canBeGCThread>::destroy):
551         (WTF::canBeGCThread>::setAndConstruct):
552         (WTF::T):
553         (WTF::canBeGCThread>::replace): Deleted.
554
555 2017-08-10  Tim Horton  <timothy_horton@apple.com>
556
557         Fix a silly typo in Compiler.h
558
559         * wtf/Compiler.h:
560         Heature, indeed.
561
562 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
563
564         Remove ENABLE_GAMEPAD_DEPRECATED
565         https://bugs.webkit.org/show_bug.cgi?id=175361
566
567         Reviewed by Carlos Garcia Campos.
568
569         * wtf/FeatureDefines.h:
570
571 2017-08-09  Don Olmstead  <don.olmstead@sony.com>
572
573         [WTF] Move TextStream into WTF
574         https://bugs.webkit.org/show_bug.cgi?id=175211
575
576         Reviewed by Myles C. Maxfield.
577
578         * WTF.xcodeproj/project.pbxproj:
579         * wtf/CMakeLists.txt:
580         * wtf/text/TextStream.cpp: Renamed from Source/WebCore/platform/text/TextStream.cpp.
581         (WTF::TextStream::writeIndent):
582         * wtf/text/TextStream.h: Renamed from Source/WebCore/platform/text/TextStream.h.
583         (WTF::TextStream::FormatNumberRespectingIntegers::FormatNumberRespectingIntegers):
584
585 2017-08-09  Commit Queue  <commit-queue@webkit.org>
586
587         Unreviewed, rolling out r220466, r220477, and r220487.
588         https://bugs.webkit.org/show_bug.cgi?id=175411
589
590         This change broke existing API tests and follow up fixes did
591         not resolve all the issues. (Requested by ryanhaddad on
592         #webkit).
593
594         Reverted changesets:
595
596         https://bugs.webkit.org/show_bug.cgi?id=175244
597         http://trac.webkit.org/changeset/220466
598
599         "WTF::Function does not allow for reference / non-default
600         constructible return types"
601         https://bugs.webkit.org/show_bug.cgi?id=175244
602         http://trac.webkit.org/changeset/220477
603
604         https://bugs.webkit.org/show_bug.cgi?id=175244
605         http://trac.webkit.org/changeset/220487
606
607 2017-08-09  Sam Weinig  <sam@webkit.org>
608
609         WTF::Function does not allow for reference / non-default constructible return types
610         https://bugs.webkit.org/show_bug.cgi?id=175244
611
612         Reviewed by Chris Dumez.
613
614         When Function, then NoncopyableFunction, was templatized to allow non-void return values
615         in r201493, it maintained the behavior of being callable even if the Function was null.
616         To accomplish this, when null, the default construction of the return parameter was used.
617         This means Function can't be used with return types that are not default constructible,
618         such as reference types and Ref.
619
620         This behavior of returning something when null is surprising, as this is not how normal
621         functions behave, and not very useful. Instead, we now assert that the function is not
622         null when being called.
623
624         * wtf/Function.h:
625         (WTF::Function operator(...)):
626         Instead of allowing a null callable wrapper by returning the default construction of
627         the return type, assert that the wrapper is there when calling a Function.
628
629 2017-08-09  Ryan Haddad  <ryanhaddad@apple.com>
630
631         Unreviewed, rolling out r220457.
632
633         This change introduced API test failures.
634
635         Reverted changeset:
636
637         "WTF::Function does not allow for reference / non-default
638         constructible return types"
639         https://bugs.webkit.org/show_bug.cgi?id=175244
640         http://trac.webkit.org/changeset/220457
641
642 2017-08-09  Sam Weinig  <sam@webkit.org>
643
644         WTF::Function does not allow for reference / non-default constructible return types
645         https://bugs.webkit.org/show_bug.cgi?id=175244
646
647         Reviewed by Chris Dumez.
648
649         When Function, then NoncopyableFunction, was templatized to allow non-void return values
650         in r201493, it maintained the behavior of being callable even if the Function was null.
651         To accomplish this, when null, the default construction of the return parameter was used.
652         This means Function can't be used with return types that are not default constructible,
653         such as reference types and Ref.
654
655         This behavior of returning something when null is surprising, as this is not how normal
656         functions behave, and not very useful. Instead, we now assert that the function is not
657         null when being called.
658
659         * wtf/Function.h:
660         (WTF::Function operator(...)):
661         Instead of allowing a null callable wrapper by returning the default construction of
662         the return type, assert that the wrapper is there when calling a Function.
663
664 2017-08-08  Filip Pizlo  <fpizlo@apple.com>
665
666         Baseline JIT should do caging
667         https://bugs.webkit.org/show_bug.cgi?id=175037
668
669         Reviewed by Mark Lam.
670
671         * wtf/Gigacage.h:
672         (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
673         (Gigacage::isDisablingPrimitiveGigacageDisabled):
674         (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
675         (Gigacage::canPrimitiveGigacageBeDisabled):
676         (Gigacage::basePtr):
677
678 2017-08-08  Ryan Haddad  <ryanhaddad@apple.com>
679
680         Unreviewed, rolling out r220368.
681
682         This change caused WK1 tests to exit early with crashes.
683
684         Reverted changeset:
685
686         "Baseline JIT should do caging"
687         https://bugs.webkit.org/show_bug.cgi?id=175037
688         http://trac.webkit.org/changeset/220368
689
690 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
691
692         [CMake] Properly test if compiler supports compiler flags
693         https://bugs.webkit.org/show_bug.cgi?id=174490
694
695         Reviewed by Konstantin Tokarev.
696
697         * wtf/Compiler.h:
698
699 2017-08-07  Filip Pizlo  <fpizlo@apple.com>
700
701         Baseline JIT should do caging
702         https://bugs.webkit.org/show_bug.cgi?id=175037
703
704         Reviewed by Mark Lam.
705
706         * wtf/Gigacage.h:
707         (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
708         (Gigacage::isDisablingPrimitiveGigacageDisabled):
709         (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
710         (Gigacage::canPrimitiveGigacageBeDisabled):
711
712 2017-08-07  Filip Pizlo  <fpizlo@apple.com>
713
714         Unreviewed, try to fix Windows build.
715
716         * wtf/Gigacage.cpp:
717         * wtf/Gigacage.h:
718
719 2017-08-06  Filip Pizlo  <fpizlo@apple.com>
720
721         Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
722         https://bugs.webkit.org/show_bug.cgi?id=174919
723
724         Reviewed by Keith Miller.
725         
726         This mirrors the changes from bmalloc/Gigacage.h.
727         
728         Also it teaches CagedPtr how to reason about multiple gigacages.
729
730         * wtf/CagedPtr.h:
731         (WTF::CagedPtr::get const):
732         (WTF::CagedPtr::operator[] const):
733         * wtf/Gigacage.cpp:
734         (Gigacage::tryMalloc):
735         (Gigacage::tryAllocateVirtualPages):
736         (Gigacage::freeVirtualPages):
737         (Gigacage::tryAlignedMalloc):
738         (Gigacage::alignedFree):
739         (Gigacage::free):
740         * wtf/Gigacage.h:
741         (Gigacage::disablePrimitiveGigacage):
742         (Gigacage::addPrimitiveDisableCallback):
743         (Gigacage::removePrimitiveDisableCallback):
744         (Gigacage::name):
745         (Gigacage::basePtr):
746         (Gigacage::caged):
747         (Gigacage::isCaged):
748         (Gigacage::tryAlignedMalloc):
749         (Gigacage::alignedFree):
750         (Gigacage::free):
751         (Gigacage::disableGigacage): Deleted.
752         (Gigacage::addDisableCallback): Deleted.
753         (Gigacage::removeDisableCallback): Deleted.
754
755 2017-08-07  Brian Burg  <bburg@apple.com>
756
757         Remove CANVAS_PATH compilation guard
758         https://bugs.webkit.org/show_bug.cgi?id=175207
759
760         Reviewed by Sam Weinig.
761
762         * wtf/FeatureDefines.h:
763
764 2017-08-05  Filip Pizlo  <fpizlo@apple.com>
765
766         REGRESSION (r219895-219897): Number of leaks on Open Source went from 9240 to 235983 and is now at 302372
767         https://bugs.webkit.org/show_bug.cgi?id=175083
768
769         Reviewed by Oliver Hunt.
770         
771         Adds a classic ReadWriteLock class. I wrote my own because I can never remember if the pthread one is
772         guaranted to bias in favor of writers or not.
773
774         * WTF.xcodeproj/project.pbxproj:
775         * wtf/Condition.h:
776         (WTF::ConditionBase::construct):
777         (WTF::Condition::Condition):
778         * wtf/Lock.h:
779         (WTF::LockBase::construct):
780         (WTF::Lock::Lock):
781         * wtf/ReadWriteLock.cpp: Added.
782         (WTF::ReadWriteLockBase::construct):
783         (WTF::ReadWriteLockBase::readLock):
784         (WTF::ReadWriteLockBase::readUnlock):
785         (WTF::ReadWriteLockBase::writeLock):
786         (WTF::ReadWriteLockBase::writeUnlock):
787         * wtf/ReadWriteLock.h: Added.
788         (WTF::ReadWriteLockBase::ReadLock::tryLock):
789         (WTF::ReadWriteLockBase::ReadLock::lock):
790         (WTF::ReadWriteLockBase::ReadLock::unlock):
791         (WTF::ReadWriteLockBase::WriteLock::tryLock):
792         (WTF::ReadWriteLockBase::WriteLock::lock):
793         (WTF::ReadWriteLockBase::WriteLock::unlock):
794         (WTF::ReadWriteLockBase::read):
795         (WTF::ReadWriteLockBase::write):
796         (WTF::ReadWriteLock::ReadWriteLock):
797
798 2017-08-04  Matt Lewis  <jlewis3@apple.com>
799
800         Unreviewed, rolling out r220271.
801
802         Rolling out due to Layout Test failing on iOS Simulator.
803
804         Reverted changeset:
805
806         "Remove STREAMS_API compilation guard"
807         https://bugs.webkit.org/show_bug.cgi?id=175165
808         http://trac.webkit.org/changeset/220271
809
810 2017-08-04  Youenn Fablet  <youenn@apple.com>
811
812         Remove STREAMS_API compilation guard
813         https://bugs.webkit.org/show_bug.cgi?id=175165
814
815         Reviewed by Darin Adler.
816
817         * wtf/FeatureDefines.h:
818
819 2017-08-03  Brian Burg  <bburg@apple.com>
820
821         Remove ENABLE(WEB_SOCKET) guards
822         https://bugs.webkit.org/show_bug.cgi?id=167044
823
824         Reviewed by Joseph Pecoraro.
825
826         * wtf/FeatureDefines.h:
827
828 2017-08-03  Youenn Fablet  <youenn@apple.com>
829
830         Remove FETCH_API compilation guard
831         https://bugs.webkit.org/show_bug.cgi?id=175154
832
833         Reviewed by Chris Dumez.
834
835         * wtf/FeatureDefines.h:
836
837 2017-08-03  Brady Eidson  <beidson@apple.com>
838
839         Add SW IDLs and stub out basic functionality.
840         https://bugs.webkit.org/show_bug.cgi?id=175115
841
842         Reviewed by Chris Dumez.
843
844         * wtf/FeatureDefines.h:
845
846 2017-08-03  Yusuke Suzuki  <utatane.tea@gmail.com>
847
848         Unreviewed, build fix for Windows port
849         https://bugs.webkit.org/show_bug.cgi?id=175013
850
851         * wtf/Threading.h:
852
853 2017-08-03  Yusuke Suzuki  <utatane.tea@gmail.com>
854
855         Merge ThreadHolder to WTF::Thread itself
856         https://bugs.webkit.org/show_bug.cgi?id=175013
857
858         Reviewed by Mark Lam.
859
860         Currently, we store ThreadHolder* to the TLS, and ThreadHolder* holds Ref<Thread>.
861         When we get Thread& from the current thread TLS, we need to dereference the ThreadHolder*.
862         However, ideally, we can store Thread* directly to the current thread TLS.
863         While the ThreadHolder design is beautiful, it's worth optimizing by storing Thread* directly
864         since Thread::current() is so frequently executed.
865
866         This patch merges ThreadHolder to Thread. And we now store Thread* directly in the TLS.
867         When storing it to TLS, we call leakRef() to keep Thread ref count incremented by the TLS.
868         And when destroying the TLS, we call `deref()` to ensure that Thread* is dereferenced from
869         the TLS.
870
871         * WTF.xcodeproj/project.pbxproj:
872         * wtf/CMakeLists.txt:
873         * wtf/ThreadHolder.cpp: Removed.
874         * wtf/ThreadHolder.h: Removed.
875         * wtf/ThreadHolderPthreads.cpp: Removed.
876         * wtf/ThreadHolderWin.cpp: Removed.
877         * wtf/Threading.cpp:
878         (WTF::Thread::entryPoint):
879         (WTF::initializeThreading):
880         * wtf/Threading.h:
881         (WTF::Thread::currentMayBeNull):
882         (WTF::Thread::current):
883         * wtf/ThreadingPthreads.cpp:
884         (WTF::Thread::waitForCompletion):
885         (WTF::Thread::initializeCurrentTLS):
886         (WTF::Thread::initializeTLSKey):
887         (WTF::Thread::initializeTLS):
888         (WTF::Thread::destructTLS):
889         (WTF::Thread::createCurrentThread): Deleted.
890         * wtf/ThreadingWin.cpp:
891         (WTF::Thread::initializeCurrentTLS):
892         (WTF::threadMapMutex):
893         (WTF::Thread::initializeTLSKey):
894         (WTF::Thread::currentDying):
895         (WTF::Thread::get):
896         (WTF::Thread::initializeTLS):
897         (WTF::Thread::destructTLS):
898         (WTF::waitForThreadCompletion):
899         (WTF::Thread::createCurrentThread): Deleted.
900
901 2017-08-03  Yusuke Suzuki  <utatane.tea@gmail.com>
902
903         [Linux][WTF] Use one global semaphore to notify thread suspend and resume completion
904         https://bugs.webkit.org/show_bug.cgi?id=175124
905
906         Reviewed by Carlos Garcia Campos.
907
908         POSIX sem_t is used to notify thread suspend and resume completion in Linux ports
909         since sem_post is async-signal-safe function. Since we guard suspend() and resume()
910         with one global lock, this semaphore is also guarded by this lock. So we do not need
911         to have semaphore per WTF::Thread.
912
913         This patch introduces one global Semaphore. And drop per thread semaphore.
914
915         * wtf/Threading.h:
916         * wtf/ThreadingPthreads.cpp:
917         (WTF::Thread::~Thread):
918         (WTF::Semaphore::Semaphore):
919         (WTF::Semaphore::~Semaphore):
920         (WTF::Semaphore::wait):
921         (WTF::Semaphore::post):
922         (WTF::Thread::signalHandlerSuspendResume):
923         (WTF::Thread::initializePlatformThreading):
924         (WTF::Thread::suspend):
925         (WTF::Thread::resume):
926         (WTF::Thread::Thread): Deleted.
927         * wtf/ThreadingWin.cpp:
928         (WTF::Thread::Thread): Deleted.
929
930 2017-08-03  Yusuke Suzuki  <utatane.tea@gmail.com>
931
932         [Linux][WTF] Reduce sizeof(WTF::Thread) by using a pointer to PlatformRegisters
933         https://bugs.webkit.org/show_bug.cgi?id=175119
934
935         Reviewed by Carlos Garcia Campos.
936
937         sizeof(PlatformRegisters) is so large. In my Linux box, it is 256. It enlarges the sizeof(WTF::Thread).
938         However, it is not necessary to hold it in WTF::Thread member. Thread's ucontext data and its stack is
939         effective while suspending the thread. So, we can just use the pointer to the PlatformRegister instead
940         of copying it to the member of the WTF::Thread.
941
942         * wtf/Threading.h:
943         * wtf/ThreadingPthreads.cpp:
944         (WTF::Thread::signalHandlerSuspendResume):
945         (WTF::Thread::getRegisters):
946
947 2017-08-02  Yusuke Suzuki  <utatane.tea@gmail.com>
948
949         Unreviewed, build fix for Windows port
950         https://bugs.webkit.org/show_bug.cgi?id=174716
951
952         This ugliness will be fixed in https://bugs.webkit.org/show_bug.cgi?id=175013.
953
954         * wtf/ThreadHolder.h:
955         * wtf/Threading.h:
956
957 2017-08-02  Yusuke Suzuki  <utatane.tea@gmail.com>
958
959         Merge WTFThreadData to Thread::current
960         https://bugs.webkit.org/show_bug.cgi?id=174716
961
962         Reviewed by Mark Lam.
963
964         We placed thread specific data in WTFThreadData previously. But now, we have a new good place
965         to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
966         sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
967         This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
968         to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
969         Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
970         before calling WTF::initializeThreading.
971
972         * WTF.xcodeproj/project.pbxproj:
973         * wtf/CMakeLists.txt:
974         * wtf/LockAlgorithm.h:
975         * wtf/LockAlgorithmInlines.h:
976         * wtf/MainThread.h:
977         * wtf/ParkingLot.cpp:
978         * wtf/StackStats.cpp:
979         (WTF::StackStats::PerThreadStats::PerThreadStats):
980         (WTF::StackStats::CheckPoint::CheckPoint):
981         (WTF::StackStats::CheckPoint::~CheckPoint):
982         (WTF::StackStats::probe):
983         (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
984         * wtf/ThreadHolder.cpp:
985         (WTF::ThreadHolder::initializeCurrent):
986         * wtf/ThreadHolder.h:
987         (WTF::ThreadHolder::ThreadHolder):
988         (WTF::ThreadHolder::currentMayBeNull):
989         (WTF::ThreadHolder::current):
990         * wtf/ThreadHolderPthreads.cpp:
991         (WTF::ThreadHolder::initializeKey):
992         (WTF::ThreadHolder::initialize):
993         (WTF::ThreadHolder::destruct):
994         (WTF::ThreadHolder::initializeOnce): Deleted.
995         (WTF::ThreadHolder::current): Deleted.
996         * wtf/ThreadHolderWin.cpp:
997         (WTF::ThreadHolder::initializeKey):
998         (WTF::ThreadHolder::currentDying):
999         (WTF::ThreadHolder::initialize):
1000         (WTF::ThreadHolder::initializeOnce): Deleted.
1001         (WTF::ThreadHolder::current): Deleted.
1002         * wtf/Threading.cpp:
1003         (WTF::Thread::initializeInThread):
1004         (WTF::Thread::entryPoint):
1005         (WTF::Thread::create):
1006         (WTF::Thread::didExit):
1007         (WTF::initializeThreading):
1008         (WTF::Thread::currentMayBeNull): Deleted.
1009         * wtf/Threading.h:
1010         (WTF::Thread::current):
1011         (WTF::Thread::atomicStringTable):
1012         (WTF::Thread::setCurrentAtomicStringTable):
1013         (WTF::Thread::stackStats):
1014         (WTF::Thread::savedStackPointerAtVMEntry):
1015         (WTF::Thread::setSavedStackPointerAtVMEntry):
1016         (WTF::Thread::savedLastStackTop):
1017         (WTF::Thread::setSavedLastStackTop):
1018         * wtf/ThreadingPrimitives.h:
1019         * wtf/ThreadingPthreads.cpp:
1020         (WTF::Thread::createCurrentThread):
1021         (WTF::Thread::current): Deleted.
1022         * wtf/ThreadingWin.cpp:
1023         (WTF::Thread::createCurrentThread):
1024         (WTF::Thread::current): Deleted.
1025         * wtf/WTFThreadData.cpp: Removed.
1026         * wtf/WTFThreadData.h: Removed.
1027         * wtf/text/AtomicString.cpp:
1028         * wtf/text/AtomicStringImpl.cpp:
1029         (WTF::stringTable):
1030         * wtf/text/AtomicStringTable.cpp:
1031         (WTF::AtomicStringTable::create):
1032         * wtf/text/AtomicStringTable.h:
1033
1034 2017-08-02  Joseph Pecoraro  <pecoraro@apple.com>
1035
1036         NeverDestroyed related leaks seen on bots
1037         https://bugs.webkit.org/show_bug.cgi?id=175113
1038
1039         Reviewed by Yusuke Suzuki.
1040
1041         * wtf/NeverDestroyed.h:
1042         (WTF::NeverDestroyed::NeverDestroyed):
1043         Previously the result of makeNeverDestroyed was not always moving into
1044         the `static NeverDestroyed` static local variable. In some cases it would
1045         re-invoke the constructor, creating a new NeverDestroyed object. In the
1046         case of a Vector it was causing leaks.
1047
1048         Adding a move constructor convinces the compiler to move the result
1049         of makeNeverDestroyed into the NeverDestroyed static. It doesn't actually
1050         invoke the move constructor here, which I believe means it is deciding
1051         to perform optional copy elision optimization.
1052         'http://en.cppreference.com/w/cpp/language/copy_elision
1053
1054 2017-08-02  Filip Pizlo  <fpizlo@apple.com>
1055
1056         All C++ accesses to JSObject::m_butterfly should do caging
1057         https://bugs.webkit.org/show_bug.cgi?id=175039
1058
1059         Reviewed by Keith Miller.
1060         
1061         Adds a smart pointer class that does various kinds of caging for you.
1062
1063         * WTF.xcodeproj/project.pbxproj:
1064         * wtf/CMakeLists.txt:
1065         * wtf/CagedPtr.h: Added.
1066         (WTF::CagedPtr::CagedPtr):
1067         (WTF::CagedPtr::get const):
1068         (WTF::CagedPtr::getMayBeNull const):
1069         (WTF::CagedPtr::operator== const):
1070         (WTF::CagedPtr::operator!= const):
1071         (WTF::CagedPtr::operator bool const):
1072         (WTF::CagedPtr::operator* const):
1073         (WTF::CagedPtr::operator-> const):
1074
1075 2017-08-02  Filip Pizlo  <fpizlo@apple.com>
1076
1077         We should be OK with the gigacage being disabled on gmalloc
1078         https://bugs.webkit.org/show_bug.cgi?id=175082
1079
1080         Reviewed by Michael Saboff.
1081
1082         * wtf/Gigacage.h:
1083         (Gigacage::shouldBeEnabled):
1084
1085 2017-08-01  Filip Pizlo  <fpizlo@apple.com>
1086
1087         Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
1088         https://bugs.webkit.org/show_bug.cgi?id=174727
1089
1090         Reviewed by Mark Lam.
1091         
1092         For the Gigacage project to have minimal impact, we need to have some abstraction that allows code to
1093         avoid having to guard itself with #if's. This adds a Gigacage abstraction that overlays the Gigacage
1094         namespace from bmalloc, which always lets you call things like Gigacage::caged and Gigacage::tryMalloc.
1095         
1096         Because of how many places need to possibly allocate in a gigacage, or possibly perform caged accesses,
1097         it's better to hide the question of whether or not it's enabled inside this API.
1098
1099         * WTF.xcodeproj/project.pbxproj:
1100         * wtf/CMakeLists.txt:
1101         * wtf/FastMalloc.cpp:
1102         * wtf/Gigacage.cpp: Added.
1103         (Gigacage::tryMalloc):
1104         (Gigacage::tryAllocateVirtualPages):
1105         (Gigacage::freeVirtualPages):
1106         (Gigacage::tryAlignedMalloc):
1107         (Gigacage::alignedFree):
1108         (Gigacage::free):
1109         * wtf/Gigacage.h: Added.
1110         (Gigacage::ensureGigacage):
1111         (Gigacage::disableGigacage):
1112         (Gigacage::addDisableCallback):
1113         (Gigacage::removeDisableCallback):
1114         (Gigacage::caged):
1115         (Gigacage::isCaged):
1116         (Gigacage::tryAlignedMalloc):
1117         (Gigacage::alignedFree):
1118         (Gigacage::free):
1119
1120 2017-07-31  Matt Lewis  <jlewis3@apple.com>
1121
1122         Unreviewed, rolling out r220060.
1123
1124         This broke our internal builds. Contact reviewer of patch for
1125         more information.
1126
1127         Reverted changeset:
1128
1129         "Merge WTFThreadData to Thread::current"
1130         https://bugs.webkit.org/show_bug.cgi?id=174716
1131         http://trac.webkit.org/changeset/220060
1132
1133 2017-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1134
1135         Merge WTFThreadData to Thread::current
1136         https://bugs.webkit.org/show_bug.cgi?id=174716
1137
1138         Reviewed by Sam Weinig.
1139
1140         We placed thread specific data in WTFThreadData previously. But now, we have a new good place
1141         to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
1142         sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
1143         This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
1144         to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
1145         Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
1146         before calling WTF::initializeThreading.
1147
1148         * WTF.xcodeproj/project.pbxproj:
1149         * wtf/CMakeLists.txt:
1150         * wtf/LockAlgorithm.h:
1151         * wtf/LockAlgorithmInlines.h:
1152         * wtf/MainThread.h:
1153         * wtf/ParkingLot.cpp:
1154         * wtf/StackStats.cpp:
1155         (WTF::StackStats::PerThreadStats::PerThreadStats):
1156         (WTF::StackStats::CheckPoint::CheckPoint):
1157         (WTF::StackStats::CheckPoint::~CheckPoint):
1158         (WTF::StackStats::probe):
1159         (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
1160         * wtf/ThreadHolder.cpp:
1161         (WTF::ThreadHolder::initializeCurrent):
1162         * wtf/ThreadHolder.h:
1163         (WTF::ThreadHolder::ThreadHolder):
1164         (WTF::ThreadHolder::currentMayBeNull):
1165         (WTF::ThreadHolder::current):
1166         * wtf/ThreadHolderPthreads.cpp:
1167         (WTF::ThreadHolder::initialize):
1168         (WTF::ThreadHolder::destruct):
1169         (WTF::ThreadHolder::current): Deleted.
1170         * wtf/ThreadHolderWin.cpp:
1171         (WTF::ThreadHolder::currentDying):
1172         (WTF::ThreadHolder::initialize):
1173         (WTF::ThreadHolder::current): Deleted.
1174         * wtf/Threading.cpp:
1175         (WTF::Thread::initializeInThread):
1176         (WTF::Thread::entryPoint):
1177         (WTF::Thread::didExit):
1178         (WTF::initializeThreading):
1179         (WTF::Thread::currentMayBeNull): Deleted.
1180         * wtf/Threading.h:
1181         (WTF::Thread::atomicStringTable):
1182         (WTF::Thread::setCurrentAtomicStringTable):
1183         (WTF::Thread::stackStats):
1184         (WTF::Thread::savedStackPointerAtVMEntry):
1185         (WTF::Thread::setSavedStackPointerAtVMEntry):
1186         (WTF::Thread::savedLastStackTop):
1187         (WTF::Thread::setSavedLastStackTop):
1188         (WTF::Thread::current):
1189         * wtf/ThreadingPrimitives.h:
1190         * wtf/ThreadingPthreads.cpp:
1191         (WTF::Thread::createCurrentThread):
1192         (WTF::Thread::current): Deleted.
1193         * wtf/ThreadingWin.cpp:
1194         (WTF::Thread::createCurrentThread):
1195         (WTF::Thread::current): Deleted.
1196         * wtf/WTFThreadData.cpp: Removed.
1197         * wtf/WTFThreadData.h: Removed.
1198         * wtf/text/AtomicString.cpp:
1199         * wtf/text/AtomicStringImpl.cpp:
1200         (WTF::stringTable):
1201         * wtf/text/AtomicStringTable.cpp:
1202         (WTF::AtomicStringTable::create):
1203         * wtf/text/AtomicStringTable.h:
1204
1205 2017-07-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1206
1207         Created a bool pretty printer at WTF for debugging purposes
1208         https://bugs.webkit.org/show_bug.cgi?id=174893
1209
1210         Reviewed by Darin Adler.
1211
1212         * wtf/PrintStream.cpp:
1213         (WTF::printInternal): The overload taking bool uses boolForPrinting
1214         * wtf/PrintStream.h:
1215         (WTF::boolForPrinting): Converts a bool in "true" or "false".
1216
1217 2017-07-30  Yusuke Suzuki  <utatane.tea@gmail.com>
1218
1219         [WTF] Introduce Private Symbols
1220         https://bugs.webkit.org/show_bug.cgi?id=174935
1221
1222         Reviewed by Darin Adler.
1223
1224         Upcoming proposal of class fields[1] requires private fields.
1225         The simple way to implement it is adding a property with a private symbol.
1226         Currently, we have private symbols for internal properties. They are usual
1227         Symbols managed by the hash table. So basically private symbols are statically
1228         created in BuiltinNames. However this new proposal encourages users to create
1229         such private symbols more and more.
1230
1231         So, this patch introduces notion of "Private" into WTF SymbolImpl. This patch
1232         adds PrivateSymbolImpl. This is SymbolImpl with "Private" flag. We do not need
1233         to look up the symbol from the hash table to check whether the given symbol
1234         is a private one.
1235
1236         [1]: https://github.com/tc39/proposal-class-fields
1237
1238         * wtf/text/StringImpl.h:
1239         * wtf/text/SymbolImpl.cpp:
1240         (WTF::PrivateSymbolImpl::create):
1241         (WTF::PrivateSymbolImpl::createNullSymbol):
1242         * wtf/text/SymbolImpl.h:
1243         (WTF::SymbolImpl::isPrivate):
1244         (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
1245         (WTF::SymbolImpl::SymbolImpl):
1246         (WTF::PrivateSymbolImpl::PrivateSymbolImpl):
1247
1248 2017-07-30  Brady Eidson  <beidson@apple.com>
1249
1250         Add URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks.
1251         https://bugs.webkit.org/show_bug.cgi?id=174958
1252
1253         Reviewed by Darin Adler.
1254
1255         This patch adds a new template class "InstanceCounted<T>".
1256         
1257         For each specialization, "InstanceCounted" will keep track of the total number of
1258         instances in existence.
1259         
1260         This makes explicate leak checking in API tests possible.
1261         
1262         Since this adds some runtime and storage overhead the code that actually does anything
1263         is only compiled in debug builds.
1264         
1265         * WTF.xcodeproj/project.pbxproj:
1266         * wtf/InstanceCounted.h: Added.
1267         (WTF::InstanceCounted::InstanceCounted):
1268         (WTF::InstanceCounted::instanceCount):
1269         (WTF::InstanceCounted::~InstanceCounted):
1270
1271 2017-07-27  Yusuke Suzuki  <utatane.tea@gmail.com>
1272
1273         [WTF] Drop Thread initialization wait in some platforms by introducing StackBounds::newThreadStackBounds(PlatformThreadHandle&)
1274         https://bugs.webkit.org/show_bug.cgi?id=174303
1275
1276         Reviewed by Mark Lam.
1277
1278         Currently, the caller thread of Thread::create() need to wait for completion of the initialization of the target thread.
1279         This is because we need to initialize Thread::m_stack in the target thread. Before this patch, a target thread's
1280         StackBounds can only be retrieved by the target thread itself. However, this potentially causes context-switching between
1281         the caller and the target threads and hurts efficiency of creating threads.
1282
1283         Fortunately, in some platforms (including major platforms except for Windows), we can get StackBounds of a target
1284         thread from a caller thread. This allows us to avoid waiting for completion of thread initialization.
1285
1286         In this patch, we introduce HAVE_STACK_BOUNDS_FOR_NEW_THREAD and StackBounds::newThreadStackBounds. When creating
1287         a new thread, we will use StackBounds::newThreadStackBounds to get StackBounds if possible. As a result, we
1288         do not need to wait for completion of thread initialization to ensure m_stack field of Thread is initialized.
1289
1290         While some documents claim that it is possible on Windows to get the StackBounds of another thread[1], the method relies on
1291         undocumented Windows NT APIs (NtQueryInformationThread, NtReadVirtualMemory etc.). So in this patch, we just
1292         use the conservative approach simply waiting for completion of thread initialization.
1293
1294         [1]: https://stackoverflow.com/questions/3918375/how-to-get-thread-stack-information-on-windows
1295
1296         * wtf/Platform.h:
1297         * wtf/StackBounds.cpp:
1298         (WTF::StackBounds::newThreadStackBounds):
1299         (WTF::StackBounds::currentThreadStackBoundsInternal):
1300         (WTF::StackBounds::initialize): Deleted.
1301         * wtf/StackBounds.h:
1302         (WTF::StackBounds::currentThreadStackBounds):
1303         (WTF::StackBounds::StackBounds):
1304         * wtf/Threading.cpp:
1305         (WTF::Thread::NewThreadContext::NewThreadContext):
1306         (WTF::Thread::entryPoint):
1307         (WTF::Thread::create):
1308         (WTF::Thread::initialize): Deleted.
1309         * wtf/Threading.h:
1310         * wtf/ThreadingPrimitives.h:
1311         * wtf/ThreadingPthreads.cpp:
1312         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1313         (WTF::wtfThreadEntryPoint):
1314         (WTF::Thread::establishHandle):
1315         (WTF::Thread::initializeCurrentThreadInternal):
1316         (WTF::Thread::current):
1317         * wtf/ThreadingWin.cpp:
1318         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1319         (WTF::Thread::initializeCurrentThreadInternal):
1320         (WTF::Thread::current):
1321         * wtf/win/MainThreadWin.cpp:
1322         (WTF::initializeMainThreadPlatform):
1323
1324 2017-07-27  JF Bastien  <jfbastien@apple.com>
1325
1326         Update lock benchmarks
1327         https://bugs.webkit.org/show_bug.cgi?id=174907
1328
1329         Reviewed by Filip Pizlo.
1330
1331         * benchmarks/ConditionSpeedTest.cpp:
1332         (main):
1333         * benchmarks/LockFairnessTest.cpp:
1334         * benchmarks/LockSpeedTest.cpp:
1335         * benchmarks/ToyLocks.h:
1336
1337 2017-07-26  Brian Burg  <bburg@apple.com>
1338
1339         Remove WEB_TIMING feature flag
1340         https://bugs.webkit.org/show_bug.cgi?id=174795
1341
1342         Reviewed by Alex Christensen.
1343
1344         * wtf/FeatureDefines.h:
1345
1346 2017-07-26  Claudio Saavedra  <csaavedra@igalia.com>
1347
1348         [WPE] Enable KeyboardEvent key and code attributes
1349         https://bugs.webkit.org/show_bug.cgi?id=174822
1350
1351         Reviewed by Žan Doberšek.
1352
1353         There is no reason for this to be disabled from what I see.
1354
1355         * wtf/FeatureDefines.h: Enable KeyboardEvent key and code attributes.
1356
1357 2017-07-23  Filip Pizlo  <fpizlo@apple.com>
1358
1359         B3 should do LICM
1360         https://bugs.webkit.org/show_bug.cgi?id=174750
1361
1362         Reviewed by Keith Miller and Saam Barati.
1363         
1364         Moved DFG::NaturalLoops to WTF. The new templatized NaturalLoops<> uses the same Graph abstraction as
1365         Dominators<>. This allows us to add a B3::NaturalLoops for free.
1366         
1367         Also made small tweaks to RangeSet, which the LICM uses.
1368
1369         * WTF.xcodeproj/project.pbxproj:
1370         * wtf/CMakeLists.txt:
1371         * wtf/Dominators.h:
1372         * wtf/NaturalLoops.h: Added.
1373         (WTF::NaturalLoop::NaturalLoop):
1374         (WTF::NaturalLoop::graph):
1375         (WTF::NaturalLoop::header):
1376         (WTF::NaturalLoop::size):
1377         (WTF::NaturalLoop::at):
1378         (WTF::NaturalLoop::operator[]):
1379         (WTF::NaturalLoop::contains):
1380         (WTF::NaturalLoop::index):
1381         (WTF::NaturalLoop::isOuterMostLoop):
1382         (WTF::NaturalLoop::dump):
1383         (WTF::NaturalLoop::addBlock):
1384         (WTF::NaturalLoops::NaturalLoops):
1385         (WTF::NaturalLoops::graph):
1386         (WTF::NaturalLoops::numLoops):
1387         (WTF::NaturalLoops::loop):
1388         (WTF::NaturalLoops::headerOf):
1389         (WTF::NaturalLoops::innerMostLoopOf):
1390         (WTF::NaturalLoops::innerMostOuterLoop):
1391         (WTF::NaturalLoops::belongsTo):
1392         (WTF::NaturalLoops::loopDepth):
1393         (WTF::NaturalLoops::loopsOf):
1394         (WTF::NaturalLoops::dump):
1395         * wtf/RangeSet.h:
1396         (WTF::RangeSet::begin):
1397         (WTF::RangeSet::end):
1398         (WTF::RangeSet::addAll):
1399
1400 2017-07-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1401
1402         Implement FALLTHROUGH attribute for C with GCC
1403         https://bugs.webkit.org/show_bug.cgi?id=174555
1404
1405         Reviewed by Darin Adler.
1406
1407         My previous attempt to silence the JSC -Wimplicit-fallthrough warnings failed because they
1408         are coming from a C file, and our FALLTHROUGH macro is only implemented for C++. So
1409         implement it for C as well, using C attribute syntax.
1410  
1411         Note this is only possible to do for GCC, because Clang only supports this attribute using
1412         the [[C++ attribute syntax]].
1413
1414         * wtf/Compiler.h:
1415
1416 2017-07-14  Filip Pizlo  <fpizlo@apple.com>
1417
1418         It should be easy to decide how WebKit yields
1419         https://bugs.webkit.org/show_bug.cgi?id=174298
1420
1421         Reviewed by Saam Barati.
1422         
1423         Created a Thread::yield() abstraction for sched_yield(), and made WTF use it everywhere that it
1424         had previously used std::this_thread::yield().
1425         
1426         To make it less annoying to experiment with changes to the lock algorithm in the future, this also
1427         moves the meat of the algorithm into LockAlgorithmInlines.h. Only two files include that header.
1428         Since LockAlgorithm.h no longer includes ParkingLot.h, a bunch of files in WK now need to include
1429         timing headers (Seconds, MonotonicTime, etc) manually.
1430
1431         * WTF.xcodeproj/project.pbxproj:
1432         * benchmarks/ToyLocks.h:
1433         * wtf/CMakeLists.txt:
1434         * wtf/Lock.cpp:
1435         * wtf/LockAlgorithm.h:
1436         (WTF::LockAlgorithm::lockSlow): Deleted.
1437         (WTF::LockAlgorithm::unlockSlow): Deleted.
1438         * wtf/LockAlgorithmInlines.h: Added.
1439         (WTF::hasParkedBit>::lockSlow):
1440         (WTF::hasParkedBit>::unlockSlow):
1441         * wtf/MainThread.cpp:
1442         * wtf/RunLoopTimer.h:
1443         * wtf/Threading.cpp:
1444         * wtf/Threading.h:
1445         * wtf/ThreadingPthreads.cpp:
1446         (WTF::Thread::yield):
1447         * wtf/ThreadingWin.cpp:
1448         (WTF::Thread::yield):
1449         * wtf/WordLock.cpp:
1450         (WTF::WordLockBase::lockSlow):
1451         (WTF::WordLockBase::unlockSlow):
1452
1453 2017-07-22  Yusuke Suzuki  <utatane.tea@gmail.com>
1454
1455         [WTF] Extend ThreadGroup::add results from bool to ThreadGroupAddResult
1456         https://bugs.webkit.org/show_bug.cgi?id=174705
1457
1458         Reviewed by Mark Lam.
1459
1460         After starting using ThreadGroup to bookkeep active threads for Signals,
1461         we would like to know tristate of ThreadGroup::add result, NewlyAdded, AlreadyAdded, NotAdded.
1462         This patch extends the result of ThreadGroup::add from bool to ThreadGroupAddResult tristate.
1463         Note that NotAdded is returned if the target thread is dying.
1464
1465         * wtf/ThreadGroup.cpp:
1466         (WTF::ThreadGroup::add):
1467         (WTF::ThreadGroup::addCurrentThread):
1468         * wtf/ThreadGroup.h:
1469         * wtf/Threading.cpp:
1470         (WTF::Thread::addToThreadGroup):
1471         * wtf/Threading.h:
1472         * wtf/threads/Signals.cpp:
1473         (WTF::registerThreadForMachExceptionHandling):
1474
1475 2017-07-21  Commit Queue  <commit-queue@webkit.org>
1476
1477         Unreviewed, rolling out r219732.
1478         https://bugs.webkit.org/show_bug.cgi?id=174748
1479
1480         static is not threadsafe in WebKit tree (Requested by
1481         yusukesuzuki on #webkit).
1482
1483         Reverted changeset:
1484
1485         "[WTF] Drop initializeDate"
1486         https://bugs.webkit.org/show_bug.cgi?id=174714
1487         http://trac.webkit.org/changeset/219732
1488
1489 2017-07-21  Yusuke Suzuki  <utatane.tea@gmail.com>
1490
1491         [WTF] Drop initializeDate
1492         https://bugs.webkit.org/show_bug.cgi?id=174714
1493
1494         Reviewed by Darin Adler.
1495
1496         minYear static variable will be initialized in an exclusive manner, which is ensured by C++ "static" semantics.
1497         Thus, we do not need to call initializeDate() explicitly.
1498
1499         * wtf/DateMath.cpp:
1500         (WTF::equivalentYearForDST):
1501         (WTF::initializeDates): Deleted.
1502         * wtf/Threading.cpp:
1503         (WTF::initializeThreading):
1504
1505 2017-07-21  Yusuke Suzuki  <utatane.tea@gmail.com>
1506
1507         [JSC] Introduce static symbols
1508         https://bugs.webkit.org/show_bug.cgi?id=158863
1509
1510         Reviewed by Darin Adler.
1511
1512         We add a new class StaticSymbolImpl. StaticSymbolImpl can offer
1513         the way to create static SymbolImpl. It can be shared between
1514         multiple VMs and multiple threads.
1515
1516         * wtf/text/SymbolImpl.h:
1517         (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
1518         (WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&):
1519         For StaticSymbolImpl's hashForSymbol, we use usual string hash value.
1520         Since all the SymbolImpls are unique, basically, any value is OK here.
1521         Non-confilicting to the other SymbolImpls is ideal.
1522
1523 2017-07-21  Yusuke Suzuki  <utatane.tea@gmail.com>
1524
1525         [WTF] Newly added AtomicStringImpl should use BufferInternal static string if StringImpl is static
1526         https://bugs.webkit.org/show_bug.cgi?id=174501
1527
1528         Reviewed by Darin Adler.
1529
1530         When creating AtomicStringImpl from static StringImpl, we can just use createWithoutCopying
1531         to create a BufferInternal AtomicStringImpl which m_data{8,16} is static string's one.
1532
1533         * wtf/text/AtomicStringImpl.cpp:
1534         (WTF::CStringTranslator::hash):
1535         (WTF::CStringTranslator::equal):
1536         (WTF::CStringTranslator::translate):
1537         (WTF::AtomicStringImpl::add):
1538         (WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer):
1539         (WTF::UCharBufferTranslator::hash):
1540         (WTF::UCharBufferTranslator::equal):
1541         (WTF::UCharBufferTranslator::translate):
1542         (WTF::LCharBufferTranslator::hash):
1543         (WTF::LCharBufferTranslator::equal):
1544         (WTF::LCharBufferTranslator::translate):
1545         (WTF::BufferFromStaticDataTranslator::hash):
1546         (WTF::BufferFromStaticDataTranslator::equal):
1547         (WTF::BufferFromStaticDataTranslator::translate):
1548         (WTF::AtomicStringImpl::addLiteral):
1549         (WTF::addSymbol):
1550         (WTF::addStatic):
1551         (WTF::AtomicStringImpl::addSlowCase):
1552         (WTF::AtomicStringImpl::lookUp):
1553         (WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
1554         (WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
1555         (WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
1556         (WTF::addSubstring): Deleted.
1557         * wtf/text/StringImpl.h:
1558
1559 2017-07-21  Konstantin Tokarev  <annulen@yandex.ru>
1560
1561        [cmake] Unreviewed, add definitions necessary to use ICU shipped with macOS
1562
1563        macOS system ICU libraries are built with U_DISABLE_RENAMING=1 and
1564        U_SHOW_CPLUSPLUS_API=0. After r219155 we have to pass this definitons
1565        explicitly, because ICU headers in the tree are not modified anymore.
1566
1567         * wtf/PlatformMac.cmake: Rely on ICU_LIBRARIES instead of passing ICU
1568         library name explicitly in WTF_LIBRARIES.
1569
1570 2017-07-20  Chris Dumez  <cdumez@apple.com>
1571
1572         Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
1573         https://bugs.webkit.org/show_bug.cgi?id=174660
1574
1575         Reviewed by Geoffrey Garen.
1576
1577         Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
1578         This essentially replaces a branch to figure out if the new size is less or greater than the
1579         current size by an assertion.
1580
1581         * wtf/IndexSparseSet.h:
1582         (WTF::OverflowHandler>::IndexSparseSet):
1583         (WTF::OverflowHandler>::clear):
1584         * wtf/Insertion.h:
1585         (WTF::executeInsertions):
1586         * wtf/RangeSet.h:
1587         (WTF::RangeSet::compact):
1588         * wtf/Vector.h:
1589         (WTF::removeRepeatedElements):
1590         * wtf/persistence/Coders.h:
1591
1592 2017-07-20  Yusuke Suzuki  <utatane.tea@gmail.com>
1593
1594         [WTF] Use ThreadGroup to bookkeep active threads for Mach exception
1595         https://bugs.webkit.org/show_bug.cgi?id=174678
1596
1597         Reviewed by Mark Lam.
1598
1599         We can use ThreadGroup to bookkeep active threads for Mach exceptions.
1600         When the thread dies, it is automatically removed from the thread groups.
1601         So we do not need to call unregisterThreadForMachExceptionHandling.
1602
1603         * wtf/ThreadGroup.cpp:
1604         (WTF::ThreadGroup::~ThreadGroup):
1605         (WTF::ThreadGroup::add):
1606         * wtf/ThreadGroup.h:
1607         * wtf/ThreadHolder.cpp:
1608         (WTF::ThreadHolder::~ThreadHolder):
1609         * wtf/Threading.cpp:
1610         (WTF::Thread::addToThreadGroup):
1611         (WTF::Thread::removeFromThreadGroup):
1612         * wtf/Threading.h:
1613         * wtf/threads/Signals.cpp:
1614         (WTF::setExceptionPorts):
1615         (WTF::activeThreads):
1616         (WTF::registerThreadForMachExceptionHandling):
1617         (WTF::installSignalHandler):
1618         (WTF::unregisterThreadForMachExceptionHandling): Deleted.
1619         * wtf/threads/Signals.h:
1620
1621 2017-07-19  Yusuke Suzuki  <utatane.tea@gmail.com>
1622
1623         [WTF] Remove unnecessary indirection of WTF::Thread entry point
1624         https://bugs.webkit.org/show_bug.cgi?id=174291
1625
1626         Reviewed by Mark Lam.
1627
1628         Now wtfThreadEntryPoint is almost the same. Only the difference is function signature due to platform APIs.
1629         We remove ThreadFunctionInvocation indirection in ThreadingPthread.cpp and ThreadingWin.cpp.
1630
1631         Also, ThreadFunctionInvocation keeps a RefPtr to the Thread object. This was previously needed to keep the
1632         Thread object alive until the thread itself could install the ThreadHolder into its thread local storage.
1633         The ThreadHolder has a Ref that keeps the Thread object alive for the lifetime of the thread. Since
1634         Thread::create() now waits for the thread to be initialized before returning and Thread::create() hold a Ref
1635         to the Thread object, we are guaranteed that the Thread object will be alive long enough for it to be installed
1636         in the thread's ThreadHolder, and we no longer need ThreadFunctionInvocation.
1637
1638         And we also simplify ThreadHolder::initialize a bit. Now Thread::create waits for the completion of Thread
1639         initialization. So, after establishing thread handle, we can call ThreadHolder::initialize before completing
1640         Thread initialization.
1641
1642         Also we drop errno.h ifdefs in ThreadingWin.cpp. This is introduced to support WinCE. But now WinCE port is removed.
1643
1644         * WTF.xcodeproj/project.pbxproj:
1645         * wtf/ThreadFunctionInvocation.h: Removed.
1646         * wtf/ThreadHolder.h:
1647         * wtf/ThreadHolderWin.cpp:
1648         (WTF::ThreadHolder::initialize):
1649         * wtf/Threading.cpp:
1650         (WTF::Thread::entryPoint):
1651         (WTF::Thread::create):
1652         (WTF::threadEntryPoint): Deleted.
1653         * wtf/Threading.h:
1654         * wtf/ThreadingPthreads.cpp:
1655         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1656         (WTF::wtfThreadEntryPoint):
1657         (WTF::Thread::establishHandle):
1658         (WTF::Thread::initializeCurrentThreadInternal):
1659         (WTF::Thread::current):
1660         (WTF::Thread::establishPlatformSpecificHandle):
1661         (WTF::Thread::createInternal): Deleted.
1662         (WTF::Thread::establish): Deleted.
1663         * wtf/ThreadingWin.cpp:
1664         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1665         (WTF::Thread::initializeCurrentThreadInternal):
1666         (WTF::wtfThreadEntryPoint):
1667         (WTF::Thread::establishHandle):
1668         (WTF::Thread::current):
1669         (WTF::Thread::establishPlatformSpecificHandle):
1670         (WTF::Thread::createInternal): Deleted.
1671         (WTF::Thread::establish): Deleted.
1672         * wtf/win/MainThreadWin.cpp:
1673         (WTF::initializeMainThreadPlatform):
1674
1675 2017-07-19  Yusuke Suzuki  <utatane.tea@gmail.com>
1676
1677         [WTF] Implement WTF::ThreadGroup
1678         https://bugs.webkit.org/show_bug.cgi?id=174081
1679
1680         Reviewed by Mark Lam.
1681
1682         This patch implements WTF::ThreadGroup. It implements core of JSC::MachineThreads with more reliable way.
1683         JSC::MachineThreads was complicated because of managing dead threads. Each JSC::MachineThreads has its
1684         own TLS with a registered destructor. And everytime a thread dies, the registered TLS destructor is called.
1685         And this destructor will remove the current dying thread from JSC::MachineThreads.
1686
1687         However the above implementation is tricky. And each JSC::MachineThreads requires own TLS space, which is
1688         not considered in WTF's Windows ThreadSpecific implementation. Current design works well since we only
1689         have small number of MachineThreads right now.
1690
1691         Instead, we use more reliable way. After introducing WTF::Thread, WTF::Thread has WTF::Thread::didExit,
1692         which is called when associated TLS (with WTF::Thread) is destroyed. We leverage this mechanism to remove
1693         WTF::Thread from MachineThreads.
1694
1695         This patch introduces WTF::ThreadGroup. It is tightly integrated with WTF::Thread: WTF::Thread knows
1696         ThreadGroups which includes this thread. And WTF::ThreadGroup of course knows WTF::Threads added to it.
1697         WTF::Thread::didExit carefully remove itself from WTF::ThreadGroups.
1698
1699         The most important part of this patch is locking. WTF::Thread can die. And WTF::ThreadGroup can die.
1700         If we take a design using two fine grain locks in WTF::Thread and WTF::ThreadGroup, we easily encounter
1701         dead lock. Consider the following case.
1702
1703         1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold a lock of THG, and hold a lock of TH (locking order is THG -> TH).
1704         2. When TH dies, TH need to hold a lock of TH to iterate THGs. And we hold a lock of THG to unregister TH from it (locking order is TH -> THG).
1705         3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (locking order is THG -> TH).
1706         4. When destroying THG, we need to hold a lock of TH to unregister THG from TH. We can hold a lock of THG before that (locking order is THG -> TH).
1707
1708         Then, it easily causes dead lock. We cannot swap the locking order of (2) since iterating THG requires a lock of TH.
1709         To solve this problem, we use std::shared_ptr and std::weak_ptr.
1710
1711         1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold THG, and hold a lock of TH. (THG -> TH)
1712         2. When TH dies, TH first hold lock of TH. And we use std::weak_ptr<>::lock() to retain non-destructed ThreadGroups.
1713         If some of ThreadGroups are dying, we just ignore them. It is ok because such a ThreadGroup will be destructed. So we do not need to unregister this thread from
1714         such a ThreadGroup. Then, we have Vector<std::shared_ptr<ThreadGroup>>. So we unlock a lock of TH. To unregister a thread from thread group, we first hold a
1715         lock of THG and then hold a lock of TH. Both lifetime is ensured: THG is retained by std::shared_ptr. And TH is itself. (TH), (THG -> TH).
1716         3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (THG -> TH).
1717         4. When destroying THG, we hold a lock of THG. And hold a lock of TH. During holding THG's lock, registered thread never dies because (2) holds THG lock. (THG -> TH).
1718
1719         We also fix suspend and resume locking mechanism to avoid dead lock. We should hold the global lock when suspending and resuming.
1720         If we use per-thread lock, the suspended thread can hold the lock of the other threads. It causes dead lock.
1721
1722         * WTF.xcodeproj/project.pbxproj:
1723         * wtf/AutomaticThread.cpp:
1724         * wtf/CMakeLists.txt:
1725         * wtf/CrossThreadCopier.h:
1726         * wtf/ParkingLot.h:
1727         * wtf/ThreadGroup.cpp: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
1728         (WTF::ThreadGroup::~ThreadGroup):
1729         (WTF::ThreadGroup::add):
1730         (WTF::ThreadGroup::addCurrentThread):
1731         * wtf/ThreadGroup.h: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
1732         (WTF::ThreadGroup::create):
1733         (WTF::ThreadGroup::threads):
1734         (WTF::ThreadGroup::getLock):
1735         (WTF::ThreadGroup::weakFromThis):
1736         * wtf/Threading.cpp:
1737         (WTF::shouldRemoveThreadFromThreadGroup):
1738         (WTF::Thread::didExit):
1739         (WTF::Thread::addToThreadGroup):
1740         (WTF::Thread::removeFromThreadGroup):
1741         * wtf/Threading.h:
1742         * wtf/ThreadingPthreads.cpp:
1743         (WTF::Thread::resume):
1744         (WTF::Thread::getRegisters):
1745         * wtf/ThreadingWin.cpp:
1746         (WTF::Thread::resume):
1747         (WTF::Thread::getRegisters):
1748
1749 2017-07-18  Andy Estes  <aestes@apple.com>
1750
1751         [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS
1752         https://bugs.webkit.org/show_bug.cgi?id=174631
1753
1754         Reviewed by Tim Horton.
1755
1756         * Configurations/Base.xcconfig:
1757
1758 2017-07-18  Yusuke Suzuki  <utatane.tea@gmail.com>
1759
1760         WTF::Thread should have the threads stack bounds.
1761         https://bugs.webkit.org/show_bug.cgi?id=173975
1762
1763         Reviewed by Mark Lam.
1764
1765         We move StackBounds from WTFThreadData to WTF::Thread.
1766         One important thing is that we should make valid StackBounds
1767         visible to Thread::create() caller. When the caller get
1768         WTF::Thread from Thread::create(), this WTF::Thread should
1769         have a valid StackBounds. But StackBounds information can be
1770         retrived only in the WTF::Thread's thread itself.
1771
1772         We also clean up WTF::initializeThreading. StringImpl::empty()
1773         is now statically initialized by using constexpr constructor.
1774         Thus we do not need to call StringImpl::empty() explicitly here.
1775         And WTF::initializeThreading() does not have any main thread
1776         affinity right now in all the platforms. So we fix the comment
1777         in Threading.h. Then, now, WTF::initializeThreading() is called
1778         in UI thread when using Web thread in iOS.
1779
1780         * wtf/StackBounds.h:
1781         (WTF::StackBounds::emptyBounds):
1782         (WTF::StackBounds::StackBounds):
1783         * wtf/Threading.cpp:
1784         (WTF::threadEntryPoint):
1785         (WTF::Thread::create):
1786         (WTF::Thread::currentMayBeNull):
1787         (WTF::Thread::initialize):
1788         (WTF::initializeThreading):
1789         * wtf/Threading.h:
1790         (WTF::Thread::stack):
1791         * wtf/ThreadingPthreads.cpp:
1792         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1793         (WTF::Thread::current):
1794         (WTF::initializeCurrentThreadEvenIfNonWTFCreated): Deleted.
1795         (WTF::Thread::currentMayBeNull): Deleted.
1796         * wtf/ThreadingWin.cpp:
1797         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1798         (WTF::Thread::initializeCurrentThreadInternal):
1799         (WTF::Thread::current):
1800         * wtf/WTFThreadData.cpp:
1801         (WTF::WTFThreadData::WTFThreadData):
1802         * wtf/WTFThreadData.h:
1803         (WTF::WTFThreadData::stack):
1804
1805 2017-07-18  Andy Estes  <aestes@apple.com>
1806
1807         [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION
1808         https://bugs.webkit.org/show_bug.cgi?id=174631
1809
1810         Reviewed by Sam Weinig.
1811
1812         * Configurations/Base.xcconfig:
1813
1814 2017-07-18  Andy Estes  <aestes@apple.com>
1815
1816         [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION
1817         https://bugs.webkit.org/show_bug.cgi?id=174631
1818
1819         Reviewed by Dan Bernstein.
1820
1821         * Configurations/Base.xcconfig:
1822
1823 2017-07-18  Andy Estes  <aestes@apple.com>
1824
1825         [Xcode] Enable CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING
1826         https://bugs.webkit.org/show_bug.cgi?id=174631
1827
1828         Reviewed by Darin Adler.
1829
1830         * Configurations/Base.xcconfig:
1831
1832 2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>
1833
1834         [cmake] Set library types before their targets are created
1835         https://bugs.webkit.org/show_bug.cgi?id=174600
1836
1837         Reviewed by Michael Catanzaro.
1838
1839         Since r219560 library targets are created before PlatformXXX.cmake
1840         files are processed, however library type must be passed in
1841         add_library() call and cannot be changed afterwards. Set these
1842         variables in OptionsXXX.cmake.
1843
1844         * wtf/PlatformGTK.cmake:
1845         * wtf/PlatformMac.cmake:
1846
1847 2017-07-17  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1848
1849         Move USE_AVFOUNDATION definition on Windows to wtf/Platform.h
1850         https://bugs.webkit.org/show_bug.cgi?id=174356
1851
1852         Reviewed by Brent Fulgham.
1853
1854         Move the definition of USE_AVFOUNDATION on Windows to wtf/platform.h
1855
1856         Add a custom command to generate AVFoundationHeaderDetection.h, which
1857         is renamed from WebCoreHeaderDetection.h
1858
1859         * AVFoundationSupport.py: Moved from Source/WebCore/AVFoundationSupport.py.
1860         * wtf/Platform.h:
1861         * wtf/PlatformWin.cmake:
1862
1863 2017-07-17  Darin Adler  <darin@apple.com>
1864
1865         Improve use of NeverDestroyed
1866         https://bugs.webkit.org/show_bug.cgi?id=174348
1867
1868         Reviewed by Sam Weinig.
1869
1870         * wtf/HashSet.h: Added an overload of HashSet::add that takes an initializer list of
1871         const references. This is handy to add a bunch of values all at once. Later we can
1872         consider optimizing to grow the hash table only once instead of deciding whether to
1873         grow repeatedly as we add each value.
1874         (WTF::copyToVector): Changed to use std::copy, removing 4 of the 6 lines of code here.
1875
1876         * wtf/MemoryPressureHandler.cpp: Include NeverDestroyed.h here ...
1877         * wtf/MemoryPressureHandler.h: ... not here.
1878
1879         * wtf/NeverDestroyed.h: Added the ability to have a const NeverDestroyed.
1880         Added a makeNeverDestroyed function that deduces the type from the argument.
1881         With auto, this can be used to avoid writing out a long type twice.
1882
1883         * wtf/ThreadingPthreads.cpp: Removed unneeded include of NeverDestroyed.h.
1884         * wtf/text/AtomicString.cpp: Ditto.
1885
1886 2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>
1887
1888         [CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called
1889         https://bugs.webkit.org/show_bug.cgi?id=174557
1890
1891         Reviewed by Michael Catanzaro.
1892
1893         * wtf/CMakeLists.txt:
1894
1895 2017-07-14  Jonathan Bedard  <jbedard@apple.com>
1896
1897         Add iOS 11 SPI
1898         https://bugs.webkit.org/show_bug.cgi?id=174430
1899         <rdar://problem/33269288>
1900
1901         Reviewed by Tim Horton.
1902
1903         * Configurations/WTF.xcconfig: Exclude MachExceptions.def when building iOS 11 for
1904         the iOS simulator.
1905
1906 2017-07-14  Commit Queue  <commit-queue@webkit.org>
1907
1908         Unreviewed, rolling out r219510.
1909         https://bugs.webkit.org/show_bug.cgi?id=174525
1910
1911         Need to revert length() == 0 check for null string (Requested
1912         by yusukesuzuki on #webkit).
1913
1914         Reverted changeset:
1915
1916         "[WTF] Newly added AtomicStringImpl should use BufferInternal
1917         static string if StringImpl is static"
1918         https://bugs.webkit.org/show_bug.cgi?id=174501
1919         http://trac.webkit.org/changeset/219510
1920
1921 2017-07-14  Yusuke Suzuki  <utatane.tea@gmail.com>
1922
1923         [WTF] Newly added AtomicStringImpl should use BufferInternal static string if StringImpl is static
1924         https://bugs.webkit.org/show_bug.cgi?id=174501
1925
1926         Reviewed by Darin Adler.
1927
1928         When creating AtomicStringImpl from static StringImpl, we can just use createWithoutCopying
1929         to create a BufferInternal AtomicStringImpl which m_data{8,16} is static string's one.
1930
1931         * wtf/text/AtomicStringImpl.cpp:
1932         (WTF::CStringTranslator::hash):
1933         (WTF::CStringTranslator::equal):
1934         (WTF::CStringTranslator::translate):
1935         (WTF::AtomicStringImpl::add):
1936         (WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer):
1937         (WTF::UCharBufferTranslator::hash):
1938         (WTF::UCharBufferTranslator::equal):
1939         (WTF::UCharBufferTranslator::translate):
1940         (WTF::LCharBufferTranslator::hash):
1941         (WTF::LCharBufferTranslator::equal):
1942         (WTF::LCharBufferTranslator::translate):
1943         (WTF::BufferFromStaticDataTranslator::hash):
1944         (WTF::BufferFromStaticDataTranslator::equal):
1945         (WTF::BufferFromStaticDataTranslator::translate):
1946         (WTF::AtomicStringImpl::addLiteral):
1947         (WTF::addSymbol):
1948         (WTF::addStatic):
1949         (WTF::AtomicStringImpl::addSlowCase):
1950         (WTF::AtomicStringImpl::lookUp):
1951         (WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
1952         (WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
1953         (WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
1954         (WTF::addSubstring): Deleted.
1955         * wtf/text/StringImpl.h:
1956
1957 2017-07-14  Yusuke Suzuki  <utatane.tea@gmail.com>
1958
1959         [WTF] Use std::unique_ptr for StackTrace
1960         https://bugs.webkit.org/show_bug.cgi?id=174495
1961
1962         Reviewed by Alex Christensen.
1963
1964         Instead of returning pointer to heap allocated StackTrace,
1965         we should return std::unique_ptr<StackTrace>.
1966         And we also move WTFGetBackTrace from Assertions.cpp to
1967         StackTrace.cpp to consolidate stack trace related operations
1968         into StackTrace.cpp.
1969
1970         * wtf/Assertions.cpp:
1971         * wtf/StackTrace.cpp:
1972         (WTFGetBacktrace):
1973         (WTF::StackTrace::captureStackTrace):
1974         * wtf/StackTrace.h:
1975
1976 2017-07-13  Yusuke Suzuki  <utatane.tea@gmail.com>
1977
1978         Unreviewed, annotate inline for operator==/!= for FastAllocator
1979         https://bugs.webkit.org/show_bug.cgi?id=174366
1980
1981         * wtf/FastMalloc.h:
1982         (WTF::operator==):
1983         (WTF::operator!=):
1984
1985 2017-07-12  Commit Queue  <commit-queue@webkit.org>
1986
1987         Unreviewed, rolling out r219176.
1988         https://bugs.webkit.org/show_bug.cgi?id=174436
1989
1990         "Can cause infinite recursion on iOS" (Requested by mlam on
1991         #webkit).
1992
1993         Reverted changeset:
1994
1995         "WTF::Thread should have the threads stack bounds."
1996         https://bugs.webkit.org/show_bug.cgi?id=173975
1997         http://trac.webkit.org/changeset/219176
1998
1999 2017-07-12  Adrian Perez de Castro  <aperez@igalia.com>
2000
2001         [WTF] Failure to build when the compiler specifically targets ARMv8-A / defines __ARM_ARCH_8A__
2002         https://bugs.webkit.org/show_bug.cgi?id=174425
2003
2004         Reviewed by Michael Catanzaro.
2005
2006         * wtf/Platform.h: Also check for __ARCH_ARM_8A__ to detect ARMv8.
2007
2008 2017-07-12  Michael Saboff  <msaboff@apple.com>
2009
2010         Unreviewed build fix when both DATA_LOG_TO_FILE and DATA_LOG_FILENAME are defined.
2011
2012         * wtf/DataLog.cpp:
2013         (WTF::initializeLogFileOnce): Changed declaration of logBasename from
2014         char* logBasename to const char* logBasename.
2015
2016 2017-07-12  Matt Lewis  <jlewis3@apple.com>
2017
2018         Unreviewed, rolling out r219401.
2019
2020         This revision rolled out the previous patch, but after talking
2021         with reviewer, a rebaseline is what was needed.Rolling back in
2022         before rebaseline.
2023
2024         Reverted changeset:
2025
2026         "Unreviewed, rolling out r219379."
2027         https://bugs.webkit.org/show_bug.cgi?id=174400
2028         http://trac.webkit.org/changeset/219401
2029
2030 2017-07-12  Matt Lewis  <jlewis3@apple.com>
2031
2032         Unreviewed, rolling out r219379.
2033
2034         This revision caused a consistent failure in the test
2035         fast/dom/Window/property-access-on-cached-window-after-frame-
2036         removed.html.
2037
2038         Reverted changeset:
2039
2040         "Remove NAVIGATOR_HWCONCURRENCY"
2041         https://bugs.webkit.org/show_bug.cgi?id=174400
2042         http://trac.webkit.org/changeset/219379
2043
2044 2017-07-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2045
2046         Unreviewed, attempt to fix Windows build
2047         https://bugs.webkit.org/show_bug.cgi?id=174366
2048
2049         * wtf/FastMalloc.h:
2050         (WTF::operator==):
2051         (WTF::operator!=):
2052         (WTF::FastAllocator::operator==): Deleted.
2053         (WTF::FastAllocator::operator!=): Deleted.
2054
2055 2017-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2056
2057         [GTK][WPE] Enable FILE_LOCK and implement lockFile and unlockFile
2058         https://bugs.webkit.org/show_bug.cgi?id=174357
2059
2060         Reviewed by Michael Catanzaro.
2061
2062         * wtf/Platform.h: Enable FILE_LOCK in GTK and WPE ports.
2063
2064 2017-07-11  Dean Jackson  <dino@apple.com>
2065
2066         Remove NAVIGATOR_HWCONCURRENCY
2067         https://bugs.webkit.org/show_bug.cgi?id=174400
2068
2069         Reviewed by Sam Weinig.
2070
2071         * wtf/FeatureDefines.h:
2072
2073 2017-07-11  Dean Jackson  <dino@apple.com>
2074
2075         Rolling out r219372.
2076
2077         * wtf/FeatureDefines.h:
2078
2079 2017-07-11  Dean Jackson  <dino@apple.com>
2080
2081         Remove NAVIGATOR_HWCONCURRENCY
2082         https://bugs.webkit.org/show_bug.cgi?id=174400
2083
2084         Reviewed by Sam Weinig.
2085
2086         * wtf/FeatureDefines.h:
2087
2088 2017-07-11  Yusuke Suzuki  <utatane.tea@gmail.com>
2089
2090         [WTF] Drop unnecessary AtomicString constructor since we have constexpr hash function
2091         https://bugs.webkit.org/show_bug.cgi?id=174347
2092
2093         Reviewed by Alex Christensen.
2094
2095         Previously, we calculate hash value in perl script and generate source code with that value.
2096         This AtomicString constructor takes this pre-calculated hash value to efficiently construct
2097         itself. But now, we have constexpr hash function, then we do not need to specify hash value
2098         directly in this way. Thus we drop this functionality.
2099
2100         * wtf/text/AtomicString.h:
2101         * wtf/text/AtomicStringImpl.cpp:
2102         (WTF::HashAndCharactersTranslator::hash): Deleted.
2103         (WTF::HashAndCharactersTranslator::equal): Deleted.
2104         (WTF::HashAndCharactersTranslator::translate): Deleted.
2105         * wtf/text/AtomicStringImpl.h:
2106         (WTF::AtomicStringImpl::add):
2107
2108 2017-07-10  Per Arne Vollan  <pvollan@apple.com>
2109
2110         [Win] Link error when building WTF from WTF.proj project file.
2111         https://bugs.webkit.org/show_bug.cgi?id=174316
2112         <rdar://problem/33178200>
2113
2114         Reviewed by Brent Fulgham.
2115
2116         WTF_CPU_X86 cmake variable needs to be set for link libraries directories to be correct.
2117
2118         * WTF.vcxproj/WTF.proj:
2119
2120 2017-07-03  Brian Burg  <bburg@apple.com>
2121
2122         Web Replay: remove some unused code
2123         https://bugs.webkit.org/show_bug.cgi?id=173903
2124
2125         Rubber-stamped by Joseph Pecoraro.
2126
2127         * wtf/FeatureDefines.h:
2128
2129 2017-07-10  Brady Eidson  <beidson@apple.com>
2130
2131         Cleanup lifetime issues of UniqueIDBDatabase and IDBBackingStore.
2132         <rdar://problem/32908525> and https://bugs.webkit.org/show_bug.cgi?id=174244
2133
2134         Reviewed by David Kilzer and Alex Christensen. 
2135
2136         Add proper "kill" support to CrossThreadQueue, as well as isEmpty() support.
2137
2138         * wtf/CrossThreadQueue.h:
2139         (WTF::CrossThreadQueue<DataType>::append):
2140         (WTF::CrossThreadQueue<DataType>::kill):
2141         (WTF::CrossThreadQueue<DataType>::isKilled):
2142         (WTF::CrossThreadQueue<DataType>::isEmpty):
2143         (WTF::CrossThreadQueue::isKilled): Deleted.
2144
2145 2017-07-09  Yusuke Suzuki  <utatane.tea@gmail.com>
2146
2147         [JSC] Use fastMalloc / fastFree for STL containers
2148         https://bugs.webkit.org/show_bug.cgi?id=174297
2149
2150         Reviewed by Sam Weinig.
2151
2152         * wtf/FastMalloc.h:
2153         (WTF::FastAllocator::FastAllocator):
2154         (WTF::FastAllocator::allocate):
2155         (WTF::FastAllocator::deallocate):
2156         (WTF::FastAllocator::operator==):
2157         (WTF::FastAllocator::operator!=):
2158
2159 2017-07-07  Brent Fulgham  <bfulgham@apple.com>
2160
2161         [WK2] Use a rolling 30-day uptime for processing statistics
2162         https://bugs.webkit.org/show_bug.cgi?id=174235
2163         <rdar://problem/33164381>
2164
2165         Reviewed by Chris Dumez.
2166
2167         Modify Deque to allow it to be used in a template specialization in KeyedDecoder.
2168
2169         * wtf/Deque.h:
2170
2171 2017-07-07  Commit Queue  <commit-queue@webkit.org>
2172
2173         Unreviewed, rolling out r219238, r219239, and r219241.
2174         https://bugs.webkit.org/show_bug.cgi?id=174265
2175
2176         "fast/workers/dedicated-worker-lifecycle.html is flaky"
2177         (Requested by yusukesuzuki on #webkit).
2178
2179         Reverted changesets:
2180
2181         "[WTF] Implement WTF::ThreadGroup"
2182         https://bugs.webkit.org/show_bug.cgi?id=174081
2183         http://trac.webkit.org/changeset/219238
2184
2185         "Unreviewed, build fix after r219238"
2186         https://bugs.webkit.org/show_bug.cgi?id=174081
2187         http://trac.webkit.org/changeset/219239
2188
2189         "Unreviewed, CLoop build fix after r219238"
2190         https://bugs.webkit.org/show_bug.cgi?id=174081
2191         http://trac.webkit.org/changeset/219241
2192
2193 2017-07-07  Yusuke Suzuki  <utatane.tea@gmail.com>
2194
2195         Unreviewed, Windows build fix after r219233 part 4
2196         https://bugs.webkit.org/show_bug.cgi?id=174231
2197
2198         * wtf/Assertions.h:
2199
2200 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
2201
2202         Unreviewed, Windows build fix after r219233 part 3
2203         https://bugs.webkit.org/show_bug.cgi?id=174231
2204
2205         * wtf/Assertions.h:
2206         (compilerFenceForCrash):
2207
2208 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
2209
2210         Unreviewed, Windows build fix after r219233 part 2
2211         https://bugs.webkit.org/show_bug.cgi?id=174231
2212
2213         * wtf/Assertions.h:
2214
2215 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
2216
2217         Unreviewed, Windows build fix after r219233
2218         https://bugs.webkit.org/show_bug.cgi?id=174231
2219
2220         * wtf/Compiler.h:
2221
2222 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
2223
2224         Unreviewed, build fix after r219238
2225         https://bugs.webkit.org/show_bug.cgi?id=174081
2226
2227         * wtf/Threading.cpp:
2228         (WTF::Thread::addToThreadGroup):
2229
2230 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2231
2232         [WTF] Implement WTF::ThreadGroup
2233         https://bugs.webkit.org/show_bug.cgi?id=174081
2234
2235         Reviewed by Mark Lam.
2236
2237         This patch implements WTF::ThreadGroup. It implements core of JSC::MachineThreads with more reliable way.
2238         JSC::MachineThreads was complicated because of managing dead threads. Each JSC::MachineThreads has its
2239         own TLS with a registered destructor. And everytime a thread dies, the registered TLS destructor is called.
2240         And this destructor will remove the current dying thread from JSC::MachineThreads.
2241
2242         However the above implementation is tricky. And each JSC::MachineThreads requires own TLS space, which is
2243         not considered in WTF's Windows ThreadSpecific implementation. Current design works well since we only
2244         have small number of MachineThreads right now.
2245
2246         Instead, we use more reliable way. After introducing WTF::Thread, WTF::Thread has WTF::Thread::didExit,
2247         which is called when associated TLS (with WTF::Thread) is destroyed. We leverage this mechanism to remove
2248         WTF::Thread from MachineThreads.
2249
2250         This patch introduces WTF::ThreadGroup. It is tightly integrated with WTF::Thread: WTF::Thread knows
2251         ThreadGroups which includes this thread. And WTF::ThreadGroup of course knows WTF::Threads added to it.
2252         WTF::Thread::didExit carefully remove itself from WTF::ThreadGroups.
2253
2254         The most important part of this patch is locking. WTF::Thread can die. And WTF::ThreadGroup can die.
2255         If we take a design using two fine grain locks in WTF::Thread and WTF::ThreadGroup, we easily encounter
2256         dead lock. Consider the following case.
2257
2258         1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold a lock of THG, and hold a lock of TH (locking order is THG -> TH).
2259         2. When TH dies, TH need to hold a lock of TH to iterate THGs. And we hold a lock of THG to unregister TH from it (locking order is TH -> THG).
2260         3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (locking order is THG -> TH).
2261         4. When destroying THG, we need to hold a lock of TH to unregister THG from TH. We can hold a lock of THG before that (locking order is THG -> TH).
2262
2263         Then, it easily causes dead lock. We cannot swap the locking order of (2) since iterating THG requires a lock of TH.
2264         To solve this problem, we introduce one global lock ThreadGroup::destructionMutex (GL).
2265
2266         1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold GL, and hold a lock of THG. Do not hold a
2267         lock of TH. TH's thread groups information is guarded by GL instead of a lock of TH (locking order is GL -> THG).
2268         2. When TH dies, TH need to hold GL to iterate THGs. And we hold a lock of THG to unregister TH from it (locking order is GL -> THG).
2269         3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (locking order is THG -> TH).
2270         4. When destroying THG, we need to hold GL to unregister THG from TH. We can hold a lock of THG after that (locking order is GL -> THG).
2271
2272         We still have a lock of THG. By separating GL and THG's lock, we can hold a lock of THG while completely unrelated TH is destructed which takes a lock of GL and unrelated THG.
2273
2274         * WTF.xcodeproj/project.pbxproj:
2275         * wtf/AutomaticThread.cpp:
2276         * wtf/CMakeLists.txt:
2277         * wtf/CrossThreadCopier.h:
2278         * wtf/ParkingLot.h:
2279         * wtf/ThreadGroup.cpp: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
2280         (WTF::ThreadGroup::destructionMutex):
2281         (WTF::ThreadGroup::~ThreadGroup):
2282         (WTF::ThreadGroup::add):
2283         (WTF::ThreadGroup::addCurrentThread):
2284         (WTF::ThreadGroup::removeCurrentThread):
2285         * wtf/ThreadGroup.h: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
2286         (WTF::ThreadGroup::create):
2287         (WTF::ThreadGroup::threads):
2288         (WTF::ThreadGroup::getLock):
2289         * wtf/Threading.cpp:
2290         (WTF::Thread::didExit):
2291         (WTF::Thread::addToThreadGroup):
2292         (WTF::Thread::removeFromThreadGroup):
2293         * wtf/Threading.h:
2294         (WTF::Thread::canAddToThreadGroup):
2295
2296 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
2297
2298         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
2299         https://bugs.webkit.org/show_bug.cgi?id=174150
2300
2301         Reviewed by Mark Lam.
2302
2303         This patch cleans up StringStatics.cpp and remove it from the tree.
2304
2305         1. Move StringImpl methods to appropriate place, "StringImpl.cpp".
2306
2307         StringImpl::hashSlowCase() and StringImpl::concurrentHash() are defined in
2308         StringStatics.cpp. But they should be defined in StringImpl.cpp.
2309         This patch just moves them to StringImpl.cpp.
2310
2311         2. Use LazyNeverDestroyed to initialize AtomicString atoms like emptyAtom.
2312
2313         Previously, we initialized AtomicString atoms like emptyAtom in a hacky way.
2314         We first define them as extern global variables. However, AtomicString has
2315         a non-trivial constructor. Thus, we cannot do this because it requires global
2316         constructor calls. This is why we have StringStatics.cpp. In this file, we
2317         include "StaticConstructors.h". After including this file, all the global
2318         constructor call disabled in Windows. And in GCC environment, we allocate
2319         void* storage for that variable. And we use placement new in AtomicString::init()
2320         to initialize these storage.
2321         However, we already have better way for that: LazyNeverDestroyed. It just allocates
2322         storage like the above. And it does not have any global constructors. Thus
2323         we can just declare it as a global variable. And we initialize them lazily in
2324         AtomicString::init(). This way effectively avoids "StaticConstructors.h" hacky way.
2325         And it makes "StringStatics.cpp" unnecessary.
2326         Then, we just move these variables and AtomicString::init() to AtomicString.cpp.
2327
2328         And we also change emptyAtom to emptyAtom() to get the value from LazyNeverDestroyed<>.
2329
2330         * WTF.xcodeproj/project.pbxproj:
2331         * wtf/CMakeLists.txt:
2332         * wtf/text/AtomicString.cpp:
2333         (WTF::AtomicString::convertASCIICase):
2334         (WTF::AtomicString::fromUTF8Internal):
2335         (WTF::AtomicString::init):
2336         * wtf/text/AtomicString.h:
2337         (WTF::nullAtom):
2338         (WTF::emptyAtom):
2339         (WTF::starAtom):
2340         (WTF::xmlAtom):
2341         (WTF::xmlnsAtom):
2342         (WTF::AtomicString::fromUTF8):
2343         * wtf/text/StringBuilder.h:
2344         (WTF::StringBuilder::toAtomicString):
2345         * wtf/text/StringImpl.cpp:
2346         (WTF::StringImpl::hashSlowCase):
2347         (WTF::StringImpl::concurrentHash):
2348         * wtf/text/StringStatics.cpp: Removed.
2349
2350 2017-07-06  Keith Miller  <keith_miller@apple.com>
2351
2352         Add extra insurance to prevent clang from making crash traces sad
2353         https://bugs.webkit.org/show_bug.cgi?id=174231
2354
2355         Reviewed by Saam Barati.
2356
2357         This patch makes it slightly harder for Clang to coalesce our crash calls.
2358         Additionally, it also makes Clang never tail call the WTFCrashWithInfo so
2359         our stack trace should always be "reasonable".
2360
2361         * wtf/Assertions.h:
2362         * wtf/Compiler.h:
2363
2364 2017-07-06  Matt Lewis  <jlewis3@apple.com>
2365
2366         Unreviewed, rolling out r219178.
2367
2368         This caused a consistent failure with the API test
2369         StringBuilderTest.ToAtomicStringOnEmpty on all Debug testers.
2370
2371         Reverted changeset:
2372
2373         "[WTF] Clean up StringStatics.cpp by using
2374         LazyNeverDestroyed<> for Atoms"
2375         https://bugs.webkit.org/show_bug.cgi?id=174150
2376         http://trac.webkit.org/changeset/219178
2377
2378 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
2379
2380         [WTF] Move SoftLinking.h into WTF
2381         https://bugs.webkit.org/show_bug.cgi?id=174000
2382
2383         Reviewed by Alex Christensen.
2384
2385         * WTF.xcodeproj/project.pbxproj:
2386         * wtf/SoftLinking.h: Copied from Source/WebCore/platform/ios/QuickLookSoftLink.mm.
2387         * wtf/cocoa/SoftLinking.h: Renamed from Source/WebCore/platform/cocoa/SoftLinking.h.
2388         * wtf/win/SoftLinking.h: Renamed from Source/WebCore/platform/win/SoftLinking.h.
2389
2390 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2391
2392         Upgrade GCC baseline
2393         https://bugs.webkit.org/show_bug.cgi?id=174155
2394
2395         Reviewed by Michael Catanzaro.
2396
2397         * wtf/Compiler.h:
2398
2399 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2400
2401         WTF::StringImpl::copyChars segfaults when built with GCC 7
2402         https://bugs.webkit.org/show_bug.cgi?id=173407
2403
2404         Reviewed by Andreas Kling.
2405
2406         With GCC 7, StringImpl::copyChars() behaves as unexpected.
2407         This function violates strict aliasing rule.
2408
2409         This optimization is originally introduced to improve performance
2410         in SunSpider's string tests in 2008. When running it in my Linux
2411         box, it no longer causes any observable difference. So, we just
2412         remove this optimization.
2413
2414                                         baseline                  patched
2415
2416         string-base64                7.7544+-0.1761            7.6138+-0.2071          might be 1.0185x faster
2417         string-fasta                10.5429+-0.2746     ?     10.7500+-0.2669        ? might be 1.0196x slower
2418         string-tagcloud             14.8588+-0.2828           14.8039+-0.3039
2419         string-unpack-code          36.1769+-0.4251           35.3397+-0.5398          might be 1.0237x faster
2420         string-validate-input        8.5182+-0.2206            8.3514+-0.2179          might be 1.0200x faster
2421
2422         * wtf/text/StringImpl.h:
2423         (WTF::StringImpl::copyChars):
2424
2425 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2426
2427         Use std::lock_guard instead of std::unique_lock if move semantics and try_lock is not necessary
2428         https://bugs.webkit.org/show_bug.cgi?id=174148
2429
2430         Reviewed by Mark Lam.
2431
2432         It is not necessary to use std::unique_lock if we do not use additional features compared to std::lock_guard.
2433
2434         (WTF::ThreadHolder::get):
2435         (WTF::ThreadHolder::initialize):
2436         (WTF::ThreadHolder::destruct):
2437         * wtf/Threading.cpp:
2438         (WTF::Thread::didExit):
2439         * wtf/ThreadingPthreads.cpp:
2440         (WTF::Thread::changePriority):
2441         (WTF::Thread::waitForCompletion):
2442         (WTF::Thread::detach):
2443         (WTF::Thread::signal):
2444         (WTF::Thread::resume):
2445         (WTF::Thread::getRegisters):
2446         (WTF::Thread::establish):
2447         * wtf/ThreadingWin.cpp:
2448         (WTF::Thread::changePriority):
2449         (WTF::Thread::waitForCompletion):
2450         (WTF::Thread::detach):
2451         (WTF::Thread::resume):
2452         (WTF::Thread::getRegisters):
2453         (WTF::Thread::establish):
2454         * wtf/WordLock.cpp:
2455         (WTF::WordLockBase::unlockSlow):
2456
2457 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2458
2459         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
2460         https://bugs.webkit.org/show_bug.cgi?id=174150
2461
2462         Reviewed by Mark Lam.
2463
2464         This patch cleans up StringStatics.cpp and remove it from the tree.
2465
2466         1. Move StringImpl methods to appropriate place, "StringImpl.cpp".
2467
2468         StringImpl::hashSlowCase() and StringImpl::concurrentHash() are defined in
2469         StringStatics.cpp. But they should be defined in StringImpl.cpp.
2470         This patch just moves them to StringImpl.cpp.
2471
2472         2. Use LazyNeverDestroyed to initialize AtomicString atoms like emptyAtom.
2473
2474         Previously, we initialized AtomicString atoms like emptyAtom in a hacky way.
2475         We first define them as extern global variables. However, AtomicString has
2476         a non-trivial constructor. Thus, we cannot do this because it requires global
2477         constructor calls. This is why we have StringStatics.cpp. In this file, we
2478         include "StaticConstructors.h". After including this file, all the global
2479         constructor call disabled in Windows. And in GCC environment, we allocate
2480         void* storage for that variable. And we use placement new in AtomicString::init()
2481         to initialize these storage.
2482         However, we already have better way for that: LazyNeverDestroyed. It just allocates
2483         storage like the above. And it does not have any global constructors. Thus
2484         we can just declare it as a global variable. And we initialize them lazily in
2485         AtomicString::init(). This way effectively avoids "StaticConstructors.h" hacky way.
2486         And it makes "StringStatics.cpp" unnecessary.
2487         Then, we just move these variables and AtomicString::init() to AtomicString.cpp.
2488
2489         And we also change emptyAtom to emptyAtom() to get the value from LazyNeverDestroyed<>.
2490
2491         * WTF.xcodeproj/project.pbxproj:
2492         * wtf/CMakeLists.txt:
2493         * wtf/text/AtomicString.cpp:
2494         (WTF::AtomicString::convertASCIICase):
2495         (WTF::AtomicString::fromUTF8Internal):
2496         (WTF::AtomicString::init):
2497         * wtf/text/AtomicString.h:
2498         (WTF::nullAtom):
2499         (WTF::emptyAtom):
2500         (WTF::starAtom):
2501         (WTF::xmlAtom):
2502         (WTF::xmlnsAtom):
2503         (WTF::AtomicString::fromUTF8):
2504         * wtf/text/StringBuilder.h:
2505         (WTF::StringBuilder::toAtomicString):
2506         * wtf/text/StringImpl.cpp:
2507         (WTF::StringImpl::hashSlowCase):
2508         (WTF::StringImpl::concurrentHash):
2509         * wtf/text/StringStatics.cpp: Removed.
2510
2511 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2512
2513         WTF::Thread should have the threads stack bounds.
2514         https://bugs.webkit.org/show_bug.cgi?id=173975
2515
2516         Reviewed by Keith Miller.
2517
2518         We move StackBounds from WTFThreadData to WTF::Thread.
2519         One important thing is that we should make valid StackBounds
2520         visible to Thread::create() caller. When the caller get
2521         WTF::Thread from Thread::create(), this WTF::Thread should
2522         have a valid StackBounds. But StackBounds information can be
2523         retrived only in the WTF::Thread's thread itself.
2524
2525         We also clean up WTF::initializeThreading. StringImpl::empty()
2526         is now statically initialized by using constexpr constructor.
2527         Thus we do not need to call StringImpl::empty() explicitly here.
2528         And WTF::initializeThreading() does not have any main thread
2529         affinity right now in all the platforms. So we fix the comment
2530         in Threading.h. Then, now, WTF::initializeThreading() is called
2531         in UI thread when using Web thread in iOS.
2532
2533         * wtf/StackBounds.h:
2534         (WTF::StackBounds::emptyBounds):
2535         (WTF::StackBounds::StackBounds):
2536         * wtf/StackStats.cpp:
2537         (WTF::StackStats::PerThreadStats::PerThreadStats):
2538         * wtf/Threading.cpp:
2539         (WTF::threadEntryPoint):
2540         (WTF::Thread::create):
2541         (WTF::Thread::currentMayBeNull):
2542         (WTF::Thread::initialize):
2543         (WTF::initializeThreading):
2544         * wtf/Threading.h:
2545         (WTF::Thread::stack):
2546         * wtf/ThreadingPthreads.cpp:
2547         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
2548         (WTF::Thread::current):
2549         (WTF::initializeCurrentThreadEvenIfNonWTFCreated): Deleted.
2550         (WTF::Thread::currentMayBeNull): Deleted.
2551         * wtf/ThreadingWin.cpp:
2552         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
2553         (WTF::Thread::initializeCurrentThreadInternal):
2554         (WTF::Thread::current):
2555         * wtf/WTFThreadData.cpp:
2556         (WTF::WTFThreadData::WTFThreadData):
2557         * wtf/WTFThreadData.h:
2558         (WTF::WTFThreadData::stack): Deleted.
2559
2560 2017-07-05  Keith Miller  <keith_miller@apple.com>
2561
2562         Crashing with information should have an abort reason
2563         https://bugs.webkit.org/show_bug.cgi?id=174185
2564
2565         Reviewed by Saam Barati.
2566
2567         Fix an ifdef to actually work with X86_64. It turns out X64_64 is
2568         not an architecture... Whoops.
2569
2570         * wtf/Assertions.cpp:
2571
2572 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
2573
2574         Remove copy of ICU headers from WebKit
2575         https://bugs.webkit.org/show_bug.cgi?id=116407
2576
2577         Reviewed by Alex Christensen.
2578
2579         Add an extra rsync command to CopyWTFHeaders which copies the ICU headers
2580         to DSTROOT/usr/local/include/. These headers already live inside a
2581         "unicode" folder, so an example path of a header is
2582         DSTROOT/usr/local/include/unicode/uchar.h. This is already in the search
2583         path of the other WebKit projects, so those other projects can remove
2584         their explicit listing of the old place these headers lived.
2585
2586         Also add the remaining ICU 55.1 headers which the other projects (like
2587         WebCore) need. Revert any local changes to these headers in favor of
2588         using the GCC_PREPROCESSOR_DEFINITIONS build setting. This is so we can
2589         compile the same way against unmodified headers.
2590
2591         * Configurations/Base.xcconfig:
2592         * Configurations/CopyWTFHeaders.xcconfig:
2593         * WTF.xcodeproj/project.pbxproj:
2594         * icu/unicode/alphaindex.h: Added.
2595         * icu/unicode/appendable.h: Added.
2596         * icu/unicode/basictz.h: Added.
2597         * icu/unicode/brkiter.h: Added.
2598         (BreakIterator::isBufferClone):
2599         * icu/unicode/bytestrie.h: Added.
2600         * icu/unicode/bytestriebuilder.h: Added.
2601         * icu/unicode/calendar.h: Added.
2602         (Calendar::createInstance):
2603         (Calendar::roll):
2604         (Calendar::internalSet):
2605         (Calendar::weekNumber):
2606         * icu/unicode/caniter.h: Added.
2607         * icu/unicode/chariter.h: Renamed from Source/WebCore/icu/unicode/chariter.h.
2608         * icu/unicode/choicfmt.h: Added.
2609         * icu/unicode/coleitr.h: Added.
2610         (CollationElementIterator::primaryOrder):
2611         (CollationElementIterator::secondaryOrder):
2612         (CollationElementIterator::tertiaryOrder):
2613         (CollationElementIterator::isIgnorable):
2614         * icu/unicode/coll.h: Added.
2615         * icu/unicode/compactdecimalformat.h: Added.
2616         * icu/unicode/curramt.h: Added.
2617         (CurrencyAmount::getCurrency):
2618         (CurrencyAmount::getISOCurrency):
2619         * icu/unicode/currpinf.h: Added.
2620         (CurrencyPluralInfo::operator!=):
2621         * icu/unicode/currunit.h: Added.
2622         (CurrencyUnit::getISOCurrency):
2623         * icu/unicode/datefmt.h: Added.
2624         * icu/unicode/dbbi.h: Added.
2625         * icu/unicode/dcfmtsym.h: Added.
2626         (DecimalFormatSymbols::getSymbol):
2627         (DecimalFormatSymbols::getConstSymbol):
2628         (DecimalFormatSymbols::setSymbol):
2629         (DecimalFormatSymbols::getLocale):
2630         (DecimalFormatSymbols::getCurrencyPattern):
2631         * icu/unicode/decimfmt.h: Added.
2632         (DecimalFormat::getConstSymbol):
2633         * icu/unicode/docmain.h: Added.
2634         * icu/unicode/dtfmtsym.h: Added.
2635         * icu/unicode/dtintrv.h: Added.
2636         (DateInterval::getFromDate):
2637         (DateInterval::getToDate):
2638         (DateInterval::operator!=):
2639         * icu/unicode/dtitvfmt.h: Added.
2640         (DateIntervalFormat::operator!=):
2641         * icu/unicode/dtitvinf.h: Added.
2642         (DateIntervalInfo::operator!=):
2643         * icu/unicode/dtptngen.h: Added.
2644         * icu/unicode/dtrule.h: Added.
2645         * icu/unicode/enumset.h: Added.
2646         (EnumSet::EnumSet):
2647         (EnumSet::~EnumSet):
2648         (EnumSet::clear):
2649         (EnumSet::add):
2650         (EnumSet::remove):
2651         (EnumSet::contains):
2652         (EnumSet::set):
2653         (EnumSet::get):
2654         (EnumSet::isValidEnum):
2655         (EnumSet::isValidValue):
2656         (EnumSet::operator=):
2657         (EnumSet::getAll):
2658         (EnumSet::flag):
2659         * icu/unicode/errorcode.h: Added.
2660         * icu/unicode/fieldpos.h: Added.
2661         (FieldPosition::operator=):
2662         (FieldPosition::operator==):
2663         (FieldPosition::operator!=):
2664         * icu/unicode/filteredbrk.h: Added.
2665         * icu/unicode/fmtable.h: Added.
2666         (Formattable::getDate):
2667         (Formattable::getString):
2668         (Formattable::getLong):
2669         (Formattable::toUFormattable):
2670         (Formattable::fromUFormattable):
2671         * icu/unicode/format.h: Added.
2672         * icu/unicode/fpositer.h: Added.
2673         * icu/unicode/gender.h: Added.
2674         * icu/unicode/gregocal.h: Added.
2675         * icu/unicode/icudataver.h: Added.
2676         * icu/unicode/icuplug.h: Added.
2677         * icu/unicode/idna.h: Added.
2678         * icu/unicode/listformatter.h: Added.
2679         (ListFormatData::ListFormatData):
2680         * icu/unicode/locdspnm.h: Added.
2681         (LocaleDisplayNames::createInstance):
2682         * icu/unicode/locid.h: Added.
2683         (Locale::operator!=):
2684         (Locale::getCountry):
2685         (Locale::getLanguage):
2686         (Locale::getScript):
2687         (Locale::getVariant):
2688         (Locale::getName):
2689         (Locale::isBogus):
2690         * icu/unicode/measfmt.h: Added.
2691         * icu/unicode/measunit.h: Added.
2692         * icu/unicode/measure.h: Added.
2693         (Measure::getNumber):
2694         (Measure::getUnit):
2695         * icu/unicode/messagepattern.h: Added.
2696         * icu/unicode/msgfmt.h: Added.
2697         * icu/unicode/normalizer2.h: Added.
2698         * icu/unicode/normlzr.h: Added.
2699         (Normalizer::operator!= ):
2700         (Normalizer::quickCheck):
2701         (Normalizer::isNormalized):
2702         (Normalizer::compare):
2703         * icu/unicode/numfmt.h: Added.
2704         (NumberFormat::isParseIntegerOnly):
2705         (NumberFormat::isLenient):
2706         * icu/unicode/numsys.h: Added.
2707         * icu/unicode/parsepos.h: Added.
2708         (ParsePosition::operator=):
2709         (ParsePosition::operator==):
2710         (ParsePosition::operator!=):
2711         (ParsePosition::getIndex):
2712         (ParsePosition::setIndex):
2713         (ParsePosition::getErrorIndex):
2714         (ParsePosition::setErrorIndex):
2715         * icu/unicode/plurfmt.h: Added.
2716         * icu/unicode/plurrule.h: Added.
2717         * icu/unicode/rbbi.h: Added.
2718         (RuleBasedBreakIterator::operator!=):
2719         * icu/unicode/rbnf.h: Added.
2720         (RuleBasedNumberFormat::isLenient):
2721         (RuleBasedNumberFormat::getDefaultRuleSet):
2722         * icu/unicode/rbtz.h: Added.
2723         * icu/unicode/regex.h: Added.
2724         * icu/unicode/region.h: Added.
2725         * icu/unicode/reldatefmt.h: Added.
2726         * icu/unicode/resbund.h: Added.
2727         * icu/unicode/schriter.h: Added.
2728         * icu/unicode/scientificnumberformatter.h: Added.
2729         * icu/unicode/search.h: Added.
2730         (SearchIterator::operator!=):
2731         * icu/unicode/selfmt.h: Added.
2732         * icu/unicode/simpletz.h: Added.
2733         (SimpleTimeZone::setStartRule):
2734         (SimpleTimeZone::setEndRule):
2735         (SimpleTimeZone::getOffset):
2736         * icu/unicode/smpdtfmt.h: Added.
2737         (SimpleDateFormat::get2DigitYearStart):
2738         * icu/unicode/sortkey.h: Added.
2739         (CollationKey::operator!=):
2740         (CollationKey::isBogus):
2741         (CollationKey::getByteArray):
2742         * icu/unicode/stringtriebuilder.h: Added.
2743         * icu/unicode/stsearch.h: Added.
2744         * icu/unicode/symtable.h: Added.
2745         * icu/unicode/tblcoll.h: Added.
2746         * icu/unicode/timezone.h: Added.
2747         (TimeZone::getID):
2748         (TimeZone::setID):
2749         * icu/unicode/tmunit.h: Added.
2750         * icu/unicode/tmutamt.h: Added.
2751         (TimeUnitAmount::operator!=):
2752         * icu/unicode/tmutfmt.h: Added.
2753         (TimeUnitFormat::operator!=):
2754         * icu/unicode/translit.h: Added.
2755         (Transliterator::getMaximumContextLength):
2756         (Transliterator::setID):
2757         (Transliterator::integerToken):
2758         (Transliterator::pointerToken):
2759         * icu/unicode/tzfmt.h: Added.
2760         * icu/unicode/tznames.h: Added.
2761         * icu/unicode/tzrule.h: Added.
2762         * icu/unicode/tztrans.h: Added.
2763         * icu/unicode/ubidi.h: Added.
2764         * icu/unicode/ucal.h: Renamed from Source/JavaScriptCore/icu/unicode/ucal.h.
2765         * icu/unicode/ucasemap.h: Added.
2766         * icu/unicode/ucat.h: Added.
2767         * icu/unicode/ucharstrie.h: Added.
2768         * icu/unicode/ucharstriebuilder.h: Added.
2769         * icu/unicode/uchriter.h: Added.
2770         * icu/unicode/uclean.h: Added.
2771         * icu/unicode/ucnv_cb.h: Renamed from Source/WebCore/icu/unicode/ucnv_cb.h.
2772         * icu/unicode/ucnvsel.h: Added.
2773         * icu/unicode/ucoleitr.h: Renamed from Source/WebCore/icu/unicode/ucoleitr.h.
2774         * icu/unicode/uconfig.h:
2775         * icu/unicode/ucsdet.h: Renamed from Source/WebCore/icu/unicode/ucsdet.h.
2776         * icu/unicode/udat.h: Renamed from Source/JavaScriptCore/icu/unicode/udat.h.
2777         * icu/unicode/udata.h: Added.
2778         * icu/unicode/udateintervalformat.h: Added.
2779         * icu/unicode/udatpg.h: Renamed from Source/JavaScriptCore/icu/unicode/udatpg.h.
2780         * icu/unicode/udisplaycontext.h: Renamed from Source/JavaScriptCore/icu/unicode/udisplaycontext.h.
2781         * icu/unicode/ufieldpositer.h: Renamed from Source/JavaScriptCore/icu/unicode/ufieldpositer.h.
2782         * icu/unicode/uformattable.h: Renamed from Source/JavaScriptCore/icu/unicode/uformattable.h.
2783         * icu/unicode/ugender.h: Added.
2784         * icu/unicode/uidna.h: Renamed from Source/WebCore/icu/unicode/uidna.h.
2785         * icu/unicode/uldnames.h: Added.
2786         * icu/unicode/ulistformatter.h: Added.
2787         * icu/unicode/ulocdata.h: Added.
2788         * icu/unicode/umisc.h: Renamed from Source/JavaScriptCore/icu/unicode/umisc.h.
2789         * icu/unicode/umsg.h: Added.
2790         * icu/unicode/unifilt.h: Added.
2791         * icu/unicode/unifunct.h: Added.
2792         * icu/unicode/unimatch.h: Added.
2793         * icu/unicode/unirepl.h: Added.
2794         * icu/unicode/uniset.h: Added.
2795         (UnicodeSet::operator!=):
2796         (UnicodeSet::isFrozen):
2797         (UnicodeSet::containsSome):
2798         (UnicodeSet::isBogus):
2799         (UnicodeSet::fromUSet):
2800         (UnicodeSet::toUSet):
2801         (UnicodeSet::span):
2802         (UnicodeSet::spanBack):
2803         * icu/unicode/unum.h: Renamed from Source/JavaScriptCore/icu/unicode/unum.h.
2804         * icu/unicode/unumsys.h: Renamed from Source/JavaScriptCore/icu/unicode/unumsys.h.
2805         * icu/unicode/upluralrules.h: Added.
2806         * icu/unicode/uregex.h: Added.
2807         * icu/unicode/uregion.h: Added.
2808         * icu/unicode/urep.h: Added.
2809         * icu/unicode/ures.h: Added.
2810         (ures_getUnicodeString):
2811         (ures_getNextUnicodeString):
2812         (ures_getUnicodeStringByIndex):
2813         (ures_getUnicodeStringByKey):
2814         * icu/unicode/usearch.h: Renamed from Source/WebCore/icu/unicode/usearch.h.
2815         * icu/unicode/usetiter.h: Added.
2816         (UnicodeSetIterator::isString):
2817         (UnicodeSetIterator::getCodepoint):
2818         (UnicodeSetIterator::getCodepointEnd):
2819         * icu/unicode/ushape.h: Renamed from Source/WebCore/icu/unicode/ushape.h.
2820         * icu/unicode/uspoof.h: Added.
2821         * icu/unicode/usprep.h: Added.
2822         * icu/unicode/ustdio.h: Added.
2823         * icu/unicode/ustream.h: Added.
2824         * icu/unicode/ustringtrie.h: Added.
2825         * icu/unicode/utf32.h: Added.
2826         * icu/unicode/utmscale.h: Added.
2827         * icu/unicode/utrace.h: Added.
2828         * icu/unicode/utrans.h: Added.
2829         * icu/unicode/utypes.h:
2830         * icu/unicode/vtzone.h: Added.
2831
2832 2017-07-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2833
2834         [WTF] Make double-conversion's cache data constant and drop double_conversion::initialize()
2835         https://bugs.webkit.org/show_bug.cgi?id=174124
2836
2837         Reviewed by Saam Barati.
2838
2839         We annotate double-conversion's cache data as const and constexpr. And move it out of function.
2840         Since they are not involving global constructors, they are compiled as rodata and initialized
2841         without calling double_conversion::initialize().
2842
2843         And we drop double_conversion::initialize() function since it is no longer necessary.
2844
2845         * wtf/Threading.cpp:
2846         (WTF::initializeThreading):
2847         * wtf/dtoa/cached-powers.cc:
2848         * wtf/dtoa/cached-powers.h:
2849
2850 2017-07-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2851
2852         [WTF] Initialize srandom and srand with cryptographically random number
2853         https://bugs.webkit.org/show_bug.cgi?id=174123
2854
2855         Reviewed by Mark Lam.
2856
2857         Use cryptographically random number instead of current time as a seed.
2858
2859         * wtf/RandomNumberSeed.h:
2860         (WTF::initializeRandomNumberGenerator):
2861
2862 2017-07-04  Joseph Pecoraro  <pecoraro@apple.com>
2863
2864         Xcode duplicate UUID for DisallowCType.h and DispatchPtr.h
2865         https://bugs.webkit.org/show_bug.cgi?id=174117
2866
2867         Reviewed by Alexey Proskuryakov.
2868
2869         * WTF.xcodeproj/project.pbxproj:
2870         Give DisallowCType.h and DispatchPtr.h different UUIDs.
2871
2872 2017-07-03  Saam Barati  <sbarati@apple.com>
2873
2874         LayoutTest workers/bomb.html is a Crash
2875         https://bugs.webkit.org/show_bug.cgi?id=167757
2876         <rdar://problem/33086462>
2877
2878         Reviewed by Keith Miller.
2879
2880         * wtf/AutomaticThread.cpp:
2881         (WTF::AutomaticThreadCondition::waitFor):
2882         * wtf/AutomaticThread.h:
2883
2884 2017-07-03  Commit Queue  <commit-queue@webkit.org>
2885
2886         Unreviewed, rolling out r219060.
2887         https://bugs.webkit.org/show_bug.cgi?id=174108
2888
2889         crashing constantly when initializing UIWebView (Requested by
2890         thorton on #webkit).
2891
2892         Reverted changeset:
2893
2894         "WTF::Thread should have the threads stack bounds."
2895         https://bugs.webkit.org/show_bug.cgi?id=173975
2896         http://trac.webkit.org/changeset/219060
2897
2898 2017-07-03  Matt Lewis  <jlewis3@apple.com>
2899
2900         Unreviewed, rolling out r219103.
2901
2902         Caused multiple build failures.
2903
2904         Reverted changeset:
2905
2906         "Remove copy of ICU headers from WebKit"
2907         https://bugs.webkit.org/show_bug.cgi?id=116407
2908         http://trac.webkit.org/changeset/219103
2909
2910 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
2911
2912         Remove copy of ICU headers from WebKit
2913         https://bugs.webkit.org/show_bug.cgi?id=116407
2914
2915         Reviewed by Alex Christensen.
2916
2917         Add an extra rsync command to CopyWTFHeaders which copies the ICU headers
2918         to DSTROOT/usr/local/include/. These headers already live inside a
2919         "unicode" folder, so an example path of a header is
2920         DSTROOT/usr/local/include/unicode/uchar.h. This is already in the search
2921         path of the other WebKit projects, so those other projects can remove
2922         their explicit listing of the old place these headers lived.
2923
2924         Also add the remaining ICU 55.1 headers which the other projects (like
2925         WebCore) need. Revert any local changes to these headers in favor of
2926         using the GCC_PREPROCESSOR_DEFINITIONS build setting. This is so we can
2927         compile the same way against unmodified headers.
2928
2929         * Configurations/Base.xcconfig:
2930         * Configurations/CopyWTFHeaders.xcconfig:
2931         * WTF.xcodeproj/project.pbxproj:
2932         * icu/unicode/alphaindex.h: Added.
2933         * icu/unicode/appendable.h: Added.
2934         * icu/unicode/basictz.h: Added.
2935         * icu/unicode/brkiter.h: Added.
2936         (BreakIterator::isBufferClone):
2937         * icu/unicode/bytestrie.h: Added.
2938         * icu/unicode/bytestriebuilder.h: Added.
2939         * icu/unicode/calendar.h: Added.
2940         (Calendar::createInstance):
2941         (Calendar::roll):
2942         (Calendar::internalSet):
2943         (Calendar::weekNumber):
2944         * icu/unicode/caniter.h: Added.
2945         * icu/unicode/chariter.h: Renamed from Source/WebCore/icu/unicode/chariter.h.
2946         * icu/unicode/choicfmt.h: Added.
2947         * icu/unicode/coleitr.h: Added.
2948         (CollationElementIterator::primaryOrder):
2949         (CollationElementIterator::secondaryOrder):
2950         (CollationElementIterator::tertiaryOrder):
2951         (CollationElementIterator::isIgnorable):
2952         * icu/unicode/coll.h: Added.
2953         * icu/unicode/compactdecimalformat.h: Added.
2954         * icu/unicode/curramt.h: Added.
2955         (CurrencyAmount::getCurrency):
2956         (CurrencyAmount::getISOCurrency):
2957         * icu/unicode/currpinf.h: Added.
2958         (CurrencyPluralInfo::operator!=):
2959         * icu/unicode/currunit.h: Added.
2960         (CurrencyUnit::getISOCurrency):
2961         * icu/unicode/datefmt.h: Added.
2962         * icu/unicode/dbbi.h: Added.
2963         * icu/unicode/dcfmtsym.h: Added.
2964         (DecimalFormatSymbols::getSymbol):
2965         (DecimalFormatSymbols::getConstSymbol):
2966         (DecimalFormatSymbols::setSymbol):
2967         (DecimalFormatSymbols::getLocale):
2968         (DecimalFormatSymbols::getCurrencyPattern):
2969         * icu/unicode/decimfmt.h: Added.
2970         (DecimalFormat::getConstSymbol):
2971         * icu/unicode/docmain.h: Added.
2972         * icu/unicode/dtfmtsym.h: Added.
2973         * icu/unicode/dtintrv.h: Added.
2974         (DateInterval::getFromDate):
2975         (DateInterval::getToDate):
2976         (DateInterval::operator!=):
2977         * icu/unicode/dtitvfmt.h: Added.
2978         (DateIntervalFormat::operator!=):
2979         * icu/unicode/dtitvinf.h: Added.
2980         (DateIntervalInfo::operator!=):
2981         * icu/unicode/dtptngen.h: Added.
2982         * icu/unicode/dtrule.h: Added.
2983         * icu/unicode/enumset.h: Added.
2984         (EnumSet::EnumSet):
2985         (EnumSet::~EnumSet):
2986         (EnumSet::clear):
2987         (EnumSet::add):
2988         (EnumSet::remove):
2989         (EnumSet::contains):
2990         (EnumSet::set):
2991         (EnumSet::get):
2992         (EnumSet::isValidEnum):
2993         (EnumSet::isValidValue):
2994         (EnumSet::operator=):
2995         (EnumSet::getAll):
2996         (EnumSet::flag):
2997         * icu/unicode/errorcode.h: Added.
2998         * icu/unicode/fieldpos.h: Added.
2999         (FieldPosition::operator=):
3000         (FieldPosition::operator==):
3001         (FieldPosition::operator!=):
3002         * icu/unicode/filteredbrk.h: Added.
3003         * icu/unicode/fmtable.h: Added.
3004         (Formattable::getDate):
3005         (Formattable::getString):
3006         (Formattable::getLong):
3007         (Formattable::toUFormattable):
3008         (Formattable::fromUFormattable):
3009         * icu/unicode/format.h: Added.
3010         * icu/unicode/fpositer.h: Added.
3011         * icu/unicode/gender.h: Added.
3012         * icu/unicode/gregocal.h: Added.
3013         * icu/unicode/icudataver.h: Added.
3014         * icu/unicode/icuplug.h: Added.
3015         * icu/unicode/idna.h: Added.
3016         * icu/unicode/listformatter.h: Added.
3017         (ListFormatData::ListFormatData):
3018         * icu/unicode/locdspnm.h: Added.
3019         (LocaleDisplayNames::createInstance):
3020         * icu/unicode/locid.h: Added.
3021         (Locale::operator!=):
3022         (Locale::getCountry):
3023         (Locale::getLanguage):
3024         (Locale::getScript):
3025         (Locale::getVariant):
3026         (Locale::getName):
3027         (Locale::isBogus):
3028         * icu/unicode/measfmt.h: Added.
3029         * icu/unicode/measunit.h: Added.
3030         * icu/unicode/measure.h: Added.
3031         (Measure::getNumber):
3032         (Measure::getUnit):
3033         * icu/unicode/messagepattern.h: Added.
3034         * icu/unicode/msgfmt.h: Added.
3035         * icu/unicode/normalizer2.h: Added.
3036         * icu/unicode/normlzr.h: Added.
3037         (Normalizer::operator!= ):
3038         (Normalizer::quickCheck):
3039         (Normalizer::isNormalized):
3040         (Normalizer::compare):
3041         * icu/unicode/numfmt.h: Added.
3042         (NumberFormat::isParseIntegerOnly):
3043         (NumberFormat::isLenient):
3044         * icu/unicode/numsys.h: Added.
3045         * icu/unicode/parsepos.h: Added.
3046         (ParsePosition::operator=):
3047         (ParsePosition::operator==):
3048         (ParsePosition::operator!=):
3049         (ParsePosition::getIndex):
3050         (ParsePosition::setIndex):
3051         (ParsePosition::getErrorIndex):
3052         (ParsePosition::setErrorIndex):
3053         * icu/unicode/plurfmt.h: Added.
3054         * icu/unicode/plurrule.h: Added.
3055         * icu/unicode/rbbi.h: Added.
3056         (RuleBasedBreakIterator::operator!=):
3057         * icu/unicode/rbnf.h: Added.
3058         (RuleBasedNumberFormat::isLenient):
3059         (RuleBasedNumberFormat::getDefaultRuleSet):
3060         * icu/unicode/rbtz.h: Added.
3061         * icu/unicode/regex.h: Added.
3062         * icu/unicode/region.h: Added.
3063         * icu/unicode/reldatefmt.h: Added.
3064         * icu/unicode/resbund.h: Added.
3065         * icu/unicode/schriter.h: Added.
3066         * icu/unicode/scientificnumberformatter.h: Added.
3067         * icu/unicode/search.h: Added.
3068         (SearchIterator::operator!=):
3069         * icu/unicode/selfmt.h: Added.
3070         * icu/unicode/simpletz.h: Added.
3071         (SimpleTimeZone::setStartRule):
3072         (SimpleTimeZone::setEndRule):
3073         (SimpleTimeZone::getOffset):
3074         * icu/unicode/smpdtfmt.h: Added.
3075         (SimpleDateFormat::get2DigitYearStart):
3076         * icu/unicode/sortkey.h: Added.
3077         (CollationKey::operator!=):
3078         (CollationKey::isBogus):
3079         (CollationKey::getByteArray):
3080         * icu/unicode/stringtriebuilder.h: Added.
3081         * icu/unicode/stsearch.h: Added.
3082         * icu/unicode/symtable.h: Added.
3083         * icu/unicode/tblcoll.h: Added.
3084         * icu/unicode/timezone.h: Added.
3085         (TimeZone::getID):
3086         (TimeZone::setID):
3087         * icu/unicode/tmunit.h: Added.
3088         * icu/unicode/tmutamt.h: Added.
3089         (TimeUnitAmount::operator!=):
3090         * icu/unicode/tmutfmt.h: Added.
3091         (TimeUnitFormat::operator!=):
3092         * icu/unicode/translit.h: Added.
3093         (Transliterator::getMaximumContextLength):
3094         (Transliterator::setID):
3095         (Transliterator::integerToken):
3096         (Transliterator::pointerToken):
3097         * icu/unicode/tzfmt.h: Added.
3098         * icu/unicode/tznames.h: Added.
3099         * icu/unicode/tzrule.h: Added.
3100         * icu/unicode/tztrans.h: Added.
3101         * icu/unicode/ubidi.h: Added.
3102         * icu/unicode/ucal.h: Renamed from Source/JavaScriptCore/icu/unicode/ucal.h.
3103         * icu/unicode/ucasemap.h: Added.
3104         * icu/unicode/ucat.h: Added.
3105         * icu/unicode/ucharstrie.h: Added.
3106         * icu/unicode/ucharstriebuilder.h: Added.
3107         * icu/unicode/uchriter.h: Added.
3108         * icu/unicode/uclean.h: Added.
3109         * icu/unicode/ucnv_cb.h: Renamed from Source/WebCore/icu/unicode/ucnv_cb.h.
3110         * icu/unicode/ucnvsel.h: Added.
3111         * icu/unicode/ucoleitr.h: Renamed from Source/WebCore/icu/unicode/ucoleitr.h.
3112         * icu/unicode/uconfig.h:
3113         * icu/unicode/ucsdet.h: Renamed from Source/WebCore/icu/unicode/ucsdet.h.
3114         * icu/unicode/udat.h: Renamed from Source/JavaScriptCore/icu/unicode/udat.h.
3115         * icu/unicode/udata.h: Added.
3116         * icu/unicode/udateintervalformat.h: Added.
3117         * icu/unicode/udatpg.h: Renamed from Source/JavaScriptCore/icu/unicode/udatpg.h.
3118         * icu/unicode/udisplaycontext.h: Renamed from Source/JavaScriptCore/icu/unicode/udisplaycontext.h.
3119         * icu/unicode/ufieldpositer.h: Renamed from Source/JavaScriptCore/icu/unicode/ufieldpositer.h.
3120         * icu/unicode/uformattable.h: Renamed from Source/JavaScriptCore/icu/unicode/uformattable.h.
3121         * icu/unicode/ugender.h: Added.
3122         * icu/unicode/uidna.h: Renamed from Source/WebCore/icu/unicode/uidna.h.
3123         * icu/unicode/uldnames.h: Added.
3124         * icu/unicode/ulistformatter.h: Added.
3125         * icu/unicode/ulocdata.h: Added.
3126         * icu/unicode/umisc.h: Renamed from Source/JavaScriptCore/icu/unicode/umisc.h.
3127         * icu/unicode/umsg.h: Added.
3128         * icu/unicode/unifilt.h: Added.
3129         * icu/unicode/unifunct.h: Added.
3130         * icu/unicode/unimatch.h: Added.
3131         * icu/unicode/unirepl.h: Added.
3132         * icu/unicode/uniset.h: Added.
3133         (UnicodeSet::operator!=):
3134         (UnicodeSet::isFrozen):
3135         (UnicodeSet::containsSome):
3136         (UnicodeSet::isBogus):
3137         (UnicodeSet::fromUSet):
3138         (UnicodeSet::toUSet):
3139         (UnicodeSet::span):
3140         (UnicodeSet::spanBack):
3141         * icu/unicode/unum.h: Renamed from Source/JavaScriptCore/icu/unicode/unum.h.
3142         * icu/unicode/unumsys.h: Renamed from Source/JavaScriptCore/icu/unicode/unumsys.h.
3143         * icu/unicode/upluralrules.h: Added.
3144         * icu/unicode/uregex.h: Added.
3145         * icu/unicode/uregion.h: Added.
3146         * icu/unicode/urep.h: Added.
3147         * icu/unicode/ures.h: Added.
3148         (ures_getUnicodeString):
3149         (ures_getNextUnicodeString):
3150         (ures_getUnicodeStringByIndex):
3151         (ures_getUnicodeStringByKey):
3152         * icu/unicode/usearch.h: Renamed from Source/WebCore/icu/unicode/usearch.h.
3153         * icu/unicode/usetiter.h: Added.
3154         (UnicodeSetIterator::isString):
3155         (UnicodeSetIterator::getCodepoint):
3156         (UnicodeSetIterator::getCodepointEnd):
3157         * icu/unicode/ushape.h: Renamed from Source/WebCore/icu/unicode/ushape.h.
3158         * icu/unicode/usprep.h: Added.
3159         * icu/unicode/ustdio.h: Added.
3160         * icu/unicode/ustream.h: Added.
3161         * icu/unicode/ustringtrie.h: Added.
3162         * icu/unicode/utf32.h: Added.
3163         * icu/unicode/utmscale.h: Added.
3164         * icu/unicode/utrace.h: Added.
3165         * icu/unicode/utrans.h: Added.
3166         * icu/unicode/utypes.h:
3167         * icu/unicode/vtzone.h: Added.
3168
3169 2017-07-03  Keith Miller  <keith_miller@apple.com>
3170
3171         Fix ifndef in Assertions.h
3172         https://bugs.webkit.org/show_bug.cgi?id=174104
3173
3174         Reviewed by Saam Barati.
3175
3176         The ifndef should have been checking for
3177         CRASH_WITH_SECURITY_IMPLICATION_AND_INFO since that is what the
3178         ifndef defines.
3179
3180         * wtf/Assertions.h:
3181
3182 2017-07-03  Andy Estes  <aestes@apple.com>
3183
3184         [Xcode] Add an experimental setting to build with ccache
3185         https://bugs.webkit.org/show_bug.cgi?id=173875
3186
3187         Reviewed by Tim Horton.
3188
3189         * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.
3190
3191 2017-07-03  Daewoong Jang  <daewoong.jang@navercorp.com>
3192
3193         Remove an unused function export
3194         https://bugs.webkit.org/show_bug.cgi?id=174084
3195
3196         Reviewed by Yusuke Suzuki.
3197
3198         * wtf/Threading.h:
3199
3200 2017-07-02  Yusuke Suzuki  <utatane.tea@gmail.com>
3201
3202         WTF::Thread should have the threads stack bounds.
3203         https://bugs.webkit.org/show_bug.cgi?id=173975
3204
3205         Reviewed by Mark Lam.
3206
3207         We move StackBounds from WTFThreadData to WTF::Thread.
3208         One important thing is that we should make valid StackBounds
3209         visible to Thread::create() caller. When the caller get
3210         WTF::Thread from Thread::create(), this WTF::Thread should
3211         have a valid StackBounds. But StackBounds information can be
3212         retrived only in the WTF::Thread's thread itself.
3213
3214         * wtf/StackBounds.h:
3215         (WTF::StackBounds::emptyBounds):
3216         (WTF::StackBounds::StackBounds):
3217         * wtf/StackStats.cpp:
3218         (WTF::StackStats::PerThreadStats::PerThreadStats):
3219         * wtf/Threading.cpp:
3220         (WTF::threadEntryPoint):
3221         (WTF::Thread::create):
3222         (WTF::Thread::currentMayBeNull):
3223         (WTF::Thread::initialize):
3224         * wtf/Threading.h:
3225         (WTF::Thread::stack):
3226         * wtf/ThreadingPthreads.cpp:
3227         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3228         (WTF::Thread::current):
3229         (WTF::initializeCurrentThreadEvenIfNonWTFCreated): Deleted.
3230         (WTF::Thread::currentMayBeNull): Deleted.
3231         * wtf/ThreadingWin.cpp:
3232         (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3233         (WTF::Thread::initializeCurrentThreadInternal):
3234         (WTF::Thread::current):
3235         * wtf/WTFThreadData.cpp:
3236         (WTF::WTFThreadData::WTFThreadData):
3237         * wtf/WTFThreadData.h:
3238         (WTF::WTFThreadData::stack): Deleted.
3239
3240 2017-07-01  Dan Bernstein  <mitz@apple.com>
3241
3242         [iOS] Remove code only needed when building for iOS 9.x
3243         https://bugs.webkit.org/show_bug.cgi?id=174068
3244
3245         Reviewed by Tim Horton.
3246
3247         * wtf/Platform.h:
3248         * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
3249         * wtf/spi/darwin/dyldSPI.h:
3250
3251 2017-07-01  Caio Lima  <ticaiolima@gmail.com>
3252
3253         [JSC] WTFGetBacktrace can return numberOfFrames == 0 in some architectures
3254         https://bugs.webkit.org/show_bug.cgi?id=172768
3255
3256         Reviewed by Mark Lam.
3257
3258         In some architectures, like ARMv6 running on a Raspberry pi, the
3259         backtrace function from "execinfo.h" is returning 0. In
3260         that case, the RELEASE_ASSERT in StackTrace::captureStackTrace
3261         fails causing a runtime crash.
3262         This patch is adding a guard for the case described above to
3263         avoid a runtime crash in such case.
3264
3265         * wtf/StackTrace.cpp:
3266         (WTF::StackTrace::captureStackTrace):
3267
3268 2017-07-01  Dan Bernstein  <mitz@apple.com>
3269
3270         [macOS] Remove code only needed when building for OS X Yosemite
3271         https://bugs.webkit.org/show_bug.cgi?id=174067
3272
3273         Reviewed by Tim Horton.
3274
3275         * Configurations/Base.xcconfig:
3276         * Configurations/DebugRelease.xcconfig:
3277         * wtf/Platform.h:
3278         * wtf/mac/AppKitCompatibilityDeclarations.h:
3279         * wtf/spi/cocoa/SecuritySPI.h:
3280         * wtf/text/TextBreakIterator.cpp:
3281
3282 2017-07-01  Joseph Pecoraro  <pecoraro@apple.com>
3283
3284         Add a warning if WEBGL2 is enabled without WEBGL
3285         https://bugs.webkit.org/show_bug.cgi?id=174054
3286
3287         Reviewed by Sam Weinig.
3288
3289         * wtf/FeatureDefines.h:
3290
3291 2017-06-30  Keith Miller  <keith_miller@apple.com>
3292
3293         Force crashWithInfo to be out of line.
3294         https://bugs.webkit.org/show_bug.cgi?id=174028
3295
3296         Reviewed by Filip Pizlo.
3297
3298         The first pass at making crashes hold information about why they
3299         were crashing had the problem that it would inline the assertion.
3300         This meant that clang could coalesce DFG_ASSERTS with other
3301         assertion failures in the same function. This patch moves it out
3302         of line to help fix that issue.
3303
3304         * wtf/Assertions.cpp:
3305         (WTFCrashWithInfo):
3306         * wtf/Assertions.h:
3307         (WTF::isIntegralType):
3308
3309 2017-06-30  Yusuke Suzuki  <utatane.tea@gmail.com>
3310
3311         [WTF] Drop SymbolRegistry::keyForSymbol
3312         https://bugs.webkit.org/show_bug.cgi?id=174052
3313
3314         Reviewed by Sam Weinig.
3315
3316         Since we can know whether a given symbol is registered by checking RegisteredSymbolImpl,
3317         we do not need to query key string for a given symbol by using SymbolRegistry::keyForSymbol.
3318
3319         * wtf/text/SymbolImpl.h:
3320         (WTF::SymbolImpl::extractFoldedString): Deleted.
3321         * wtf/text/SymbolRegistry.cpp:
3322         (WTF::SymbolRegistry::keyForSymbol): Deleted.
3323         * wtf/text/SymbolRegistry.h:
3324
3325 2017-06-29  Jer Noble  <jer.noble@apple.com>
3326
3327         Make Legacy EME API controlled by RuntimeEnabled setting.
3328         https://bugs.webkit.org/show_bug.cgi?id=173994
3329
3330         Reviewed by Sam Weinig.
3331
3332         * wtf/FeatureDefines.h:
3333
3334 2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>
3335
3336         Ran sort-Xcode-project-file.
3337
3338         * WTF.xcodeproj/project.pbxproj:
3339
3340 2017-06-30  Matt Lewis  <jlewis3@apple.com>
3341
3342         Unreviewed, rolling out r218992.
3343
3344         The patch broke the iOS device builds.
3345
3346         Reverted changeset:
3347
3348         "DFG_ASSERT should allow stuffing registers before trapping."
3349         https://bugs.webkit.org/show_bug.cgi?id=174005
3350         http://trac.webkit.org/changeset/218992
3351
3352 2017-06-30  Keith Miller  <keith_miller@apple.com>
3353
3354         DFG_ASSERT should allow stuffing registers before trapping.
3355         https://bugs.webkit.org/show_bug.cgi?id=174005
3356
3357         Reviewed by Mark Lam.
3358
3359         Add new template functions that enable stuffing up to five values
3360         into registers before crashing.
3361
3362         * wtf/Assertions.h:
3363         (CRASH_WITH_INFO):
3364
3365 2017-06-28  Brent Fulgham  <bfulgham@apple.com>
3366
3367         Teach ResourceLoadStatistics to recognize changes in the file system
3368         https://bugs.webkit.org/show_bug.cgi?id=173800
3369         <rdar://problem/32937842>
3370
3371         Reviewed by Chris Dumez.
3372
3373         * wtf/DispatchPtr.h: Added (moved from WebKit2)
3374         * wtf/Platform.h: Make sure USE_FILE_LOCK is enabled.
3375
3376 2017-06-28  David Kilzer  <ddkilzer@apple.com>
3377
3378         Fix typo in comment: WordResult => WorkResult
3379
3380         * wtf/AutomaticThread.h:
3381
3382 2017-06-27  Caio Lima  <ticaiolima@gmail.com>
3383
3384         [ESnext] Implement Object Rest - Implementing Object Rest Destructuring
3385         https://bugs.webkit.org/show_bug.cgi?id=167962
3386
3387         Reviewed by Saam Barati.
3388
3389         * wtf/HashSet.h:
3390         (WTF::=):
3391
3392 2017-06-26  Yusuke Suzuki  <utatane.tea@gmail.com>
3393
3394         [WTF] Drop Thread::create(obsolete things) API since we can use lambda
3395         https://bugs.webkit.org/show_bug.cgi?id=173825
3396
3397         Reviewed by Saam Barati.
3398
3399         Thread::create(ThreadFunction, void* data, const char* name) is a bit old API.
3400         Since we have C++ lambda, the above API is simply unnecessary. And C++ lambda
3401         based one is better since the above API needs casting data to and from void*.
3402
3403         * wtf/Function.h:
3404         Avoid ambiguity.
3405         * wtf/ParallelJobsGeneric.cpp:
3406         (WTF::ParallelEnvironment::ThreadPrivate::tryLockFor):
3407         (WTF::ParallelEnvironment::ThreadPrivate::workerThread): Deleted.
3408         * wtf/ParallelJobsGeneric.h:
3409         * wtf/Threading.cpp:
3410         * wtf/ThreadingWin.cpp:
3411         (WTF::createThread):
3412
3413 2017-06-25  Yusuke Suzuki  <utatane.tea@gmail.com>
3414
3415         initializeThreading() [first] causes WTFCrash due to maxSingleAllocationSize not being initialized
3416         https://bugs.webkit.org/show_bug.cgi?id=173720
3417
3418         Reviewed by Mark Lam.
3419
3420         When using std::numeric_limits<size_t>::max() for global variable's initialization,
3421         it seems that it invokes static constructor to initialize this in VC++.
3422         We avoid this edge case by introducing a workaround using SIZE_MAX here.
3423
3424         When I perform git-grep, there is only one site (this) using std::numeric_limits<>::xxx()
3425         to initialize global variable.
3426
3427         * wtf/FastMalloc.cpp:
3428
3429 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
3430
3431         Remove excessive headers from JavaScriptCore
3432         https://bugs.webkit.org/show_bug.cgi?id=173812
3433
3434         Reviewed by Darin Adler.
3435
3436         * wtf/Bag.h:
3437
3438 2017-06-23  Keith Miller  <keith_miller@apple.com>
3439
3440         Switch VMTraps to use halt instructions rather than breakpoint instructions
3441         https://bugs.webkit.org/show_bug.cgi?id=173677
3442         <rdar://problem/32178892>
3443
3444         Reviewed by JF Bastien.
3445
3446         Remove the Trap signal handler code since it plays badly with lldb and combine
3447         SIGBUS with SIGSEGV since distiguishing them is generally non-portable.
3448
3449         Also, update the platform code to only use signaling VMTraps
3450         on where we have an appropriate instruction (x86 and ARM64).
3451
3452         * wtf/Platform.h:
3453         * wtf/threads/Signals.cpp:
3454         (WTF::fromMachException):
3455         (WTF::toMachMask):
3456         (WTF::installSignalHandler):
3457         (WTF::jscSignalHandler):
3458         * wtf/threads/Signals.h:
3459         (WTF::toSystemSignal):
3460         (WTF::fromSystemSignal):
3461
3462 2017-06-23  Antti Koivisto  <antti@apple.com>
3463
3464         Add notifyutil registrations for going in and out of simulated low memory state
3465         https://bugs.webkit.org/show_bug.cgi?id=173797
3466
3467         Reviewed by Andreas Kling.
3468
3469         Add
3470
3471         notifyutil -p org.WebKit.lowMemory.begin
3472         notifyutil -p org.WebKit.lowMemory.end
3473
3474         for debugging.
3475
3476         * wtf/cocoa/MemoryPressureHandlerCocoa.mm:
3477         (WTF::MemoryPressureHandler::install):
3478
3479 2017-06-23  Konstantin Tokarev  <annulen@yandex.ru>
3480
3481         Remove more unused headers from WTF
3482         https://bugs.webkit.org/show_bug.cgi?id=173761
3483
3484         Reviewed by Yusuke Suzuki.
3485
3486         * wtf/Liveness.h:
3487         * wtf/PageAllocation.h:
3488         * wtf/ParallelJobs.h:
3489
3490 2017-06-22  Andreas Kling  <akling@apple.com>
3491
3492         Rename MemoryPressureHandler::setTabCount to setPageCount
3493         https://bugs.webkit.org/show_bug.cgi?id=173750
3494
3495         Reviewed by Daniel Bates.
3496
3497         This function is counting WebCore::Page objects (excluding utility Pages used
3498         by SVG-as-image and the web inspector) so let's name it appropriately.
3499         Not all WebKit clients have tabs.
3500
3501         * wtf/MemoryPressureHandler.cpp:
3502         (WTF::MemoryPressureHandler::setPageCount):
3503         (WTF::MemoryPressureHandler::thresholdForMemoryKill):
3504         (WTF::MemoryPressureHandler::measurementTimerFired):
3505         (WTF::MemoryPressureHandler::setTabCount): Deleted.
3506         * wtf/MemoryPressureHandler.h:
3507
3508 2017-06-21  Andreas Kling  <akling@apple.com>
3509
3510         Increase memory kill limits for WebContent processes that manage multiple tabs.
3511         https://bugs.webkit.org/show_bug.cgi?id=173674
3512
3513         Reviewed by Geoffrey Garen.
3514
3515         When opening <a target=_blank> links, we currently have to use the same WebContent
3516         process for the new tab, to support scripting the window.opener object.
3517         This means that some WebContent processes end up hosting multiple tabs, making it
3518         more likely that those processes will hit the memory limits.
3519
3520         Address this by adding some additional allowance for multi-tab processes:
3521
3522             For each additional tab, up to 4 tabs, add 1GB to the memory kill limit.
3523
3524         * wtf/MemoryPressureHandler.cpp:
3525         (WTF::thresholdForMemoryKillWithProcessState):
3526         (WTF::MemoryPressureHandler::setTabCount):
3527         (WTF::MemoryPressureHandler::thresholdForMemoryKill):
3528         (WTF::MemoryPressureHandler::measurementTimerFired):
3529         * wtf/MemoryPressureHandler.h:
3530
3531 2017-06-21  Chris Dumez  <cdumez@apple.com>
3532
3533         Allow constructing a WTF:Function from a function pointer
3534         https://bugs.webkit.org/show_bug.cgi?id=173660
3535
3536         Reviewed by Alex Christensen.
3537
3538         Allow constructing a WTF:Function from a function pointer and
3539         assigning a function pointer to a WTF:Function.
3540
3541         * wtf/Function.h:
3542
3543 2017-06-20  Simon Fraser  <simon.fraser@apple.com>
3544
3545         Remove WILL_REVEAL_EDGE_EVENTS code
3546         https://bugs.webkit.org/show_bug.cgi?id=173632
3547
3548         Reviewed by Sam Weinig, Beth Dakin.
3549
3550         Remove will-reveal-edge events, which never took off.
3551
3552         * wtf/FeatureDefines.h:
3553
3554 2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>
3555
3556         Remove excessive include directives from WTF
3557         https://bugs.webkit.org/show_bug.cgi?id=173553
3558
3559         Reviewed by Saam Barati.
3560
3561         * wtf/AutomaticThread.h:
3562         * wtf/BagToHashMap.h:
3563         * wtf/CrossThreadCopier.h:
3564         * wtf/CrossThreadQueue.h:
3565         * wtf/DateMath.h:
3566         * wtf/Expected.h:
3567         * wtf/HashMap.h:
3568         * wtf/Indenter.h:
3569         * wtf/MessageQueue.h:
3570         * wtf/MetaAllocator.h:
3571         * wtf/MetaAllocatorHandle.h:
3572         * wtf/RandomNumberSeed.h:
3573         * wtf/Ref.h:
3574         * wtf/RefPtr.h:
3575         * wtf/RunLoop.h:
3576         * wtf/SchedulePair.h:
3577         * wtf/StackStats.h:
3578         * wtf/SynchronizedFixedQueue.h:
3579         * wtf/ThreadMessage.h:
3580         * wtf/Threading.cpp:
3581         * wtf/Threading.h:
3582         * wtf/ThreadingPthreads.cpp:
3583         * wtf/ThreadingWin.cpp:
3584         * wtf/WTFThreadData.h:
3585         * wtf/WorkQueue.h:
3586         * wtf/glib/GRefPtr.h:
3587         * wtf/text/AtomicStringTable.h:
3588         * wtf/text/LineBreakIteratorPoolICU.h:
3589
3590 2017-06-20  Yusuke Suzuki  <utatane.tea@gmail.com>
3591
3592         [WTF] Enable WTF::Signals only when HAVE(MACHINE_CONTEXT) is true
3593         https://bugs.webkit.org/show_bug.cgi?id=173590
3594
3595         Reviewed by Carlos Garcia Campos.
3596
3597         WTF::Signals require a feature rewriting a value of a machine context.
3598         This is only available under HAVE(MACHINE_CONTEXT).
3599         This patch disables WTF::Signals on !HAVE(MACHINE_CONTEXT) environments.
3600
3601         * wtf/threads/Signals.cpp:
3602         * wtf/threads/Signals.h:
3603
3604 2017-06-20  Yusuke Suzuki  <utatane.tea@gmail.com>
3605
3606         [WTF] Rebaseline std::optional
3607         https://bugs.webkit.org/show_bug.cgi?id=173582
3608
3609         Reviewed by JF Bastien.
3610
3611         Update the copy of our std::optional to the latest version.
3612         It adds std::optional::has_value() and std::optional::reset().
3613
3614         * wtf/Optional.h:
3615
3616 2017-06-18  Yusuke Suzuki  <utatane.tea@gmail.com>
3617
3618         [WTF] Include execinfo.h and dlfcn.h based on platform defines
3619         https://bugs.webkit.org/show_bug.cgi?id=173531
3620
3621         Reviewed by Alex Christensen.
3622
3623         execinfo.h and dlfcn.h can be missing in some libc libraries.
3624         When including it, we should honor platform defines like HAVE(DLADDR).
3625
3626         * wtf/StackTrace.cpp:
3627
3628 2017-06-18  Darin Adler  <darin@apple.com>
3629
3630         Fix Ref to deref before assignment, add tests for this to RefPtr, Ref, Function
3631         https://bugs.webkit.org/show_bug.cgi?id=173526
3632
3633         Reviewed by Sam Weinig.
3634
3635         * wtf/Ref.h: Changed operator= to not be defined inside the class definition.
3636         Added swap functions. Changed operator= implementations to use swap in the
3637         conventional manner, the same way that RefPtr does.
3638
3639 2017-06-18  Chris Dumez  <cdumez@apple.com>
3640
3641         Use WTF::Function instead of std::function in WTF/
3642         https://bugs.webkit.org/show_bug.cgi?id=173519
3643
3644         Reviewed by Sam Weinig.
3645
3646         Use WTF::Function instead of std::function in WTF/ to avoid
3647         copying.
3648
3649         * wtf/Brigand.h:
3650         * wtf/Condition.h:
3651         * wtf/Expected.h:
3652         * wtf/FunctionDispatcher.h:
3653         * wtf/MainThread.h:
3654         * wtf/MemoryPressureHandler.h:
3655         (WTF::MemoryPressureHandler::setMemoryKillCallback):
3656         (WTF::MemoryPressureHandler::setMemoryPressureStatusChangedCallback):
3657         (WTF::MemoryPressureHandler::setDidExceedInactiveLimitWhileActiveCallback):
3658         * wtf/Optional.h:
3659         * wtf/ParkingLot.h:
3660         * wtf/RefCounter.h:
3661         (WTF::RefCounter<T>::RefCounter):
3662         * wtf/WorkQueue.h:
3663         * wtf/linux/MemoryPressureHandlerLinux.cpp:
3664         (WTF::MemoryPressureHandler::EventFDPoller::EventFDPoller):
3665         * wtf/text/WTFString.cpp:
3666         (WTF::String::split):
3667         * wtf/text/WTFString.h:
3668
3669 2017-06-16  Alex Christensen  <achristensen@webkit.org>
3670
3671         Fix Mac CMake build.
3672
3673         * wtf/PlatformMac.cmake:
3674         Generate MachExceptionsServer.h
3675
3676 2017-06-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3677
3678         [iOS DnD] Upstream iOS drag and drop implementation into OpenSource WebKit
3679         https://bugs.webkit.org/show_bug.cgi?id=173366
3680         <rdar://problem/32767014>
3681
3682         Reviewed by Tim Horton.
3683
3684         Define ENABLE_DRAG_SUPPORT as 1 by default and 0 for iOS, and define ENABLE_DATA_INTERACTION as 0 by default.
3685         These are overridden to both be 1 for iOS 11+ in the FeatureDefines.xcconfig within each individual project.
3686
3687         * wtf/Platform.h:
3688
3689 2017-06-15  Chris Dumez  <cdumez@apple.com>
3690
3691         Fix typo in XPCSPI.h
3692         https://bugs.webkit.org/show_bug.cgi?id=173426
3693
3694         Reviewed by Alex Christensen.
3695
3696         We should check if xpc_release is defined before defining it,
3697         not xpc_retain.
3698
3699         * wtf/spi/darwin/XPCSPI.h:
3700
3701 2017-06-15  Konstantin Tokarev  <annulen@yandex.ru>
3702
3703         Implement FALLTHROUGH macro for compilers other than Clang
3704         https://bugs.webkit.org/show_bug.cgi?id=173385
3705
3706         Reviewed by Alex Christensen.
3707
3708         FALLTHROUGH should be able to use [[gnu::fallthrough]] attribute of
3709         GCC, and [[fallthrough]] from C++17, whichever is available.
3710
3711         * wtf/Compiler.h:
3712
3713 2017-06-14  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
3714
3715         MediaSource duration attribute should not be equal to Infinity when set to a value greater than 2^64
3716         https://bugs.webkit.org/show_bug.cgi?id=171668
3717
3718         Reviewed by Jer Noble.
3719
3720         MediaSource duration attribute is a double represented in MediaSource by a MediaTime instance created with
3721         MediaTime::CreateWithDouble(). This method implements an overflow control mechanism which sets MediaTime to
3722         Infinity when the double value passed as argument is greater than 2^64.
3723
3724         This patch removes the overflow control mechanism when time value is represented as a double. This patch also
3725         modifies the behavior of mathematical operations between a double MediaTime and rational MediaTime: the rational
3726         MediaTime is converted to a double before applying the operation. Double MediaTime precision is the same as for
3727         double. Overflow mechanisms still apply to the conversion of a double MediaTime to rational with setTimescale()
3728         method. No behavior change for rational MediaTime.
3729
3730         * wtf/MediaTime.cpp:
3731         (WTF::MediaTime::createWithFloat):
3732         (WTF::MediaTime::createWithDouble):
3733         (WTF::MediaTime::operator+):
3734         (WTF::MediaTime::operator-):
3735
3736 2017-06-13  Zan Dobersek  <zdobersek@igalia.com>
3737
3738         [GTK][WPE] Use CMAKE_THREAD_LIBS_INIT in WTF platform CMake files
3739         https://bugs.webkit.org/show_bug.cgi?id=173310
3740
3741         Reviewed by Xabier Rodriguez-Calvar.
3742
3743         In the WTF platform CMake files for the GTK+ and WPE ports, use the
3744         CMAKE_THREAD_LIBS_INIT variable to specify the threading library we
3745         should be linking against. On some platforms this variable will be
3746         empty because the given compiler will automatically handle the -pthread
3747         compiler flag and sort out linking on its own.
3748
3749         The same approach is already used for the JSCOnly configuration.
3750
3751         * wtf/PlatformGTK.cmake:
3752         * wtf/PlatformWPE.cmake:
3753
3754 2017-06-13  Youenn Fablet  <youenn@apple.com>
3755
3756         Filter SDP from ICE candidates in case of local ICE candidate filtering
3757         https://bugs.webkit.org/show_bug.cgi?id=173120
3758
3759         Reviewed by Eric Carlson.
3760
3761         Adding split helper routine with functor parameter.
3762
3763         * wtf/text/WTFString.cpp:
3764         (WTF::String::split):
3765         * wtf/text/WTFString.h:
3766         (WTF::String::contains):
3767
3768 2017-06-13  Don Olmstead  <don.olmstead@sony.com>
3769
3770         [WTF] Remove redundant includes in config.h
3771         https://bugs.webkit.org/show_bug.cgi?id=173292
3772
3773         Reviewed by Alex Christensen.
3774
3775         * config.h:
3776         * wtf/ExportMacros.h:
3777
3778 2017-06-12  Jer Noble  <jer.noble@apple.com>
3779
3780         Screen sleeps while doing WebRTC video
3781         https://bugs.webkit.org/show_bug.cgi?id=173278
3782
3783         Reviewed by Eric Carlson.
3784
3785         Drive-by fix: add some generic methods for iterating over collections.
3786
3787         * WTF.xcodeproj/project.pbxproj:
3788         * wtf/Algorithms.h: Added.
3789         (WTF::forEach):
3790         (WTF::anyOf):
3791         (WTF::allOf):
3792
3793 2017-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3794
3795         [GTK] Move WebKit GType macros to WTF
3796         https://bugs.webkit.org/show_bug.cgi?id=173249
3797
3798         Reviewed by Žan Doberšek.
3799
3800         They can be used by glib-based ports and eventually by JavaScriptCore glib bindings too.
3801
3802         * wtf/glib/WTFGType.h: Copied from Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h.
3803
3804 2017-06-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3805
3806         [WTF] Make ThreadMessage portable
3807         https://bugs.webkit.org/show_bug.cgi?id=172073
3808
3809         Reviewed by Keith Miller.
3810
3811         Recently, we change ThreadMessage semantics: message handler
3812         can be executed in the sender thread.
3813         This allows ThreadMessage to be implemented in a portable way.
3814
3815         This patch implements ThreadMessage for all the platforms.
3816         We use platform-independent Thread APIs, suspend(), resume(),
3817         and getRegisters().
3818
3819         * wtf/PlatformRegisters.h:
3820         (WTF::registersFromUContext):
3821         * wtf/ThreadMessage.cpp:
3822         (WTF::sendMessageScoped):
3823         (WTF::ThreadMessageData::ThreadMessageData): Deleted.
3824         (): Deleted.
3825         (WTF::initializeThreadMessages): Deleted.
3826         (WTF::sendMessageUsingSignal): Deleted.
3827         (WTF::sendMessageUsingMach): Deleted.
3828         (WTF::deliverMessagesUsingMach): Deleted.
3829         * wtf/ThreadMessage.h:
3830         * wtf/Threading.cpp:
3831         (WTF::initializeThreading):
3832         * wtf/Threading.h:
3833         (WTF::Thread::threadMessages): Deleted.
3834         * wtf/ThreadingPthreads.cpp:
3835         (WTF::Thread::signalHandlerSuspendResume):
3836         (WTF::threadStateMetadata):
3837         (WTF::Thread::getRegisters):
3838         * wtf/threads/Signals.cpp:
3839         (WTF::handleSignalsWithMach):
3840
3841 2017-06-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3842
3843         [WTF] Drop unnecessary includes in Threading.h
3844         https://bugs.webkit.org/show_bug.cgi?id=173167
3845
3846         Reviewed by Darin Adler.
3847
3848         Threading.h includes bunch of headers. But some of them are not necessary.
3849         This patch cleans up it a bit.
3850
3851         * wtf/Assertions.cpp:
3852         * wtf/LocklessBag.h:
3853         * wtf/Threading.h:
3854         * wtf/ThreadingPrimitives.h:
3855
3856 2017-06-10  Yusuke Suzuki  <utatane.tea@gmail.com>
3857
3858         [WTF] Add RegisteredSymbolImpl
3859         https://bugs.webkit.org/show_bug.cgi?id=173230
3860
3861         Reviewed by Mark Lam.
3862
3863         Most symbols are not registered in SymbolRegistry. However, we currently always
3864         allocate a pointer member to point to a SymbolRegistry, and this pointer is always null.
3865         SymbolImpl is immutable, and it will never be registered with a SymbolRegistry
3866         after it is created. Hence, this member is wasteful.
3867
3868         Instead, we add a new derived class RegisteredSymbolImpl, which will set a flag in
3869         SymbolImpl to indicate that it is registered with a SymbolRegistry. The only way to
3870         create a RegisteredSymbolImpl is via a factory method provided by the SymbolRegistry.
3871         The factory method will pass the SymbolRegistry this pointer to the RegisteredSymbolImpl's
3872         constructor for initializing the RegisteredSymbolImpl's m_symbolRegistry field.
3873         By doing so,
3874
3875         1. We do not need to set m_symbolRegistry after creating a Symbol. It is clean.
3876         2. We reduce the size of SymbolImpls that do not need to be registered.
3877
3878         * wtf/text/StringImpl.cpp:
3879         (WTF::StringImpl::~StringImpl):
3880         * wtf/text/StringImpl.h:
3881         * wtf/text/SymbolImpl.cpp:
3882         (WTF::SymbolImpl::create):
3883         (WTF::RegisteredSymbolImpl::create):
3884         * wtf/text/SymbolImpl.h:
3885         (WTF::SymbolImpl::hashForSymbol):
3886         (WTF::SymbolImpl::isRegistered):
3887         (WTF::SymbolImpl::SymbolImpl):
3888         (WTF::RegisteredSymbolImpl::symbolRegistry):
3889         (WTF::RegisteredSymbolImpl::clearSymbolRegistry):
3890         (WTF::RegisteredSymbolImpl::RegisteredSymbolImpl):
3891         (WTF::SymbolImpl::symbolRegistry):
3892         * wtf/text/SymbolRegistry.cpp:
3893         (WTF::SymbolRegistry::~SymbolRegistry):
3894         (WTF::SymbolRegistry::symbolForKey):
3895         (WTF::SymbolRegistry::keyForSymbol):
3896         (WTF::SymbolRegistry::remove):
3897         * wtf/text/SymbolRegistry.h:
3898
3899 2017-06-10  Dan Bernstein  <mitz@apple.com>
3900
3901         Reverted r218056 because it made the IDE reindex constantly.
3902
3903         * Configurations/DebugRelease.xcconfig:
3904
3905 2017-06-10  Dan Bernstein  <mitz@apple.com>
3906
3907         [Xcode] With Xcode 9 developer beta, everything rebuilds when switching between command-line and IDE
3908         https://bugs.webkit.org/show_bug.cgi?id=173223
3909
3910         Reviewed by Sam Weinig.
3911
3912         The rebuilds were happening due to a difference in the compiler options that the IDE and
3913         xcodebuild were specifying. Only the IDE was passing the -index-store-path option. To make
3914         xcodebuild pass that option, too, set CLANG_INDEX_STORE_ENABLE to YES if it is unset, and
3915         specify an appropriate path in CLANG_INDEX_STORE_PATH.
3916
3917         * Configurations/DebugRelease.xcconfig:
3918
3919 2017-06-09  Chris Dumez  <cdumez@apple.com>
3920
3921         Update Thread::create() to take in a WTF::Function instead of a std::function
3922         https://bugs.webkit.org/show_bug.cgi?id=173175
3923
3924         Reviewed by Mark Lam.
3925
3926         Update Thread::create() to take in a WTF::Function instead of a std::function. Unlike
3927         std::function, WTF:Function is not copyable and does not make implicit copies of captured
3928         variables. Doing captures such as [string = string.isolatedCopy()] when passing an
3929         std::function to another thread has lead to bugs in the past due to implicit copying of
3930         the captured string.
3931
3932         * wtf/Threading.cpp:
3933         (WTF::Thread::create):
3934         * wtf/Threading.h:
3935
3936 2017-06-09  Chris Dumez  <cdumez@apple.com>
3937
3938         Update WorkQueue::concurrentApply() to take a WTF::Function instead of an std::function
3939         https://bugs.webkit.org/show_bug.cgi?id=173165
3940
3941         Reviewed by Saam Barati.
3942
3943         Update WorkQueue::concurrentApply() to take a WTF::Function instead of an std::function
3944         as std::function has issues with regards to thread safety.
3945
3946         * wtf/WorkQueue.h:
3947         * wtf/cocoa/WorkQueueCocoa.cpp:
3948         (WTF::WorkQueue::concurrentApply):
3949
3950 2017-06-08  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3951
3952         MediaTime class has rounding issues in different platforms
3953         https://bugs.webkit.org/show_bug.cgi?id=172640
3954
3955         Reviewed by Jer Noble.
3956
3957         The way a timescale is set when creating a MediaTime from a double
3958         can create rounding issues in different platforms because in some
3959         rounding is made and in others, it truncates. This way we ensure a
3960         common behavior.
3961
3962         Dumping MediaTimes is also confusing and by the output you don't
3963         know if it's containing a double or a fraction. Now, if it
3964         contains a double, it only prints the double because printing the
3965         fraction is misleading (it currently prints the double read as an
3966         integer) and if it contains a fraction it shows the fraction and
3967         its double representation separated by an = instead of a ,.
3968
3969         * wtf/MediaTime.cpp:
3970         (WTF::MediaTime::createWithDouble): When creating MediaTime from
3971         double, we round instead of leaving it to the cast operation.
3972         (WTF::MediaTime::dump):
3973
3974 2017-06-07  Jer Noble  <jer.noble@apple.com>
3975
3976         Refactoring: MediaEngineSupportParameters should take a ContentType rather than separate type & codecs strings
3977         https://bugs.webkit.org/show_bug.cgi?id=173038
3978
3979         Reviewed by Eric Carlson.
3980
3981         Drive by fix: add a version of split that takes a UChar and returns a Vector<String>.
3982
3983         * wtf/text/WTFString.h:
3984         (WTF::String::split):
3985
3986 2017-06-07  Zan Dobersek  <zdobersek@igalia.com>
3987
3988         [GCrypt] RSA-PSS support
3989         https://bugs.webkit.org/show_bug.cgi?id=172856
3990
3991         Reviewed by Jiewen Tan.
3992
3993         * wtf/Platform.h: Define HAVE_RSA_PSS to 1 for USE(GCRYPT). Support for RSA-PSS
3994         is provided by default through the libgcrypt library.
3995
3996 2017-06-06  Chris Dumez  <cdumez@apple.com>
3997
3998         Unreviewed, rolling out r214974.
3999
4000         Causes some tabs to start using a huge amount of CPU after 8
4001         minutes in the background
4002
4003         Reverted changeset:
4004
4005         "Make inactive web processes behave as though under memory
4006         pressure."
4007         https://bugs.webkit.org/show_bug.cgi?id=170042
4008         http://trac.webkit.org/changeset/214974
4009
4010 2017-06-06  Don Olmstead  <don.olmstead@am.sony.com>
4011
4012         [WebCore] Enable REQUEST_ANIMATION_FRAME_TIMER for all ports
4013         https://bugs.webkit.org/show_bug.cgi?id=172780
4014
4015         Reviewed by Alex Christensen.
4016
4017         * wtf/Platform.h:
4018
4019 2017-06-06  Darin Adler  <darin@apple.com>
4020
4021         Cut down use of WTF_ARRAY_LENGTH
4022         https://bugs.webkit.org/show_bug.cgi?id=172997
4023
4024         Reviewed by Chris Dumez.
4025
4026         * wtf/DateMath.cpp:
4027         (WTF::equalLettersIgnoringASCIICase): Added helper function template.
4028         (WTF::parseDateFromNullTerminatedCharacters): Use a modern for loop instead of
4029         WTF_ARRAY_LENGTH. Use startsWithLettersIgnoringASCIICase and
4030         equalLettersIgnoringASCIICase instead of strncasecmp.
4031
4032         * wtf/text/IntegerToStringConversion.h:
4033         (WTF::numberToStringImpl): Use std::end instead of WTF_ARRAY_LENGTH.
4034         (WTF::writeNumberToBufferImpl): Ditto.
4035
4036 2017-06-06  Filip Pizlo  <fpizlo@apple.com>
4037
4038         index out of bound in bytecodebasicblock
4039         https://bugs.webkit.org/show_bug.cgi?id=172963
4040
4041         Reviewed by Saam Barati and Mark Lam.
4042
4043         * wtf/Assertions.h:
4044         (UNREACHABLE_FOR_PLATFORM):
4045
4046 2017-06-05  Jer Noble  <jer.noble@apple.com>
4047
4048         Allow clients to specify a list of codecs which should require hardware decode support.
4049         https://bugs.webkit.org/show_bug.cgi?id=172787
4050
4051         Reviewed by Alex Christensen.
4052
4053         Add a couple of convenience methods:
4054         - a String::split() that returns a vector (rather than taking an out-reference to a vector).
4055         - A Vector::map() template which takes a Callable and returns a Vector of a different type.
4056
4057         * wtf/Vector.h:
4058         (WTF::Vector::map):
4059         * wtf/text/WTFString.h:
4060         (WTF::String::split):
4061
4062 2017-06-04  Konstantin Tokarev  <annulen@yandex.ru>
4063
4064         Fix build of Windows-specific code with ICU 59.1
4065         https://bugs.webkit.org/show_bug.cgi?id=172729
4066
4067         Reviewed by Darin Adler.
4068
4069         * wtf/text/win/WCharStringExtras.h: Added new header file wuth helper
4070         functions for conversion between WTF::String and wchart_t*.
4071         (WTF::stringToNullTerminatedWChar):
4072         (WTF::wcharToString):
4073         (WTF::nullTerminatedWCharToString):
4074
4075 2017-06-02  Stephan Szabo  <stephan.szabo@am.sony.com>
4076
4077         [JSCOnly] Build static jsc.exe on Windows
4078         https://bugs.webkit.org/show_bug.cgi?id=172833
4079
4080         Reviewed by Konstantin Tokarev.
4081
4082         * wtf/PlatformJSCOnly.cmake:
4083
4084 2017-06-02  Simon Fraser  <simon.fraser@apple.com>
4085
4086         Get <chrono> out of StdLibExtras.h
4087         https://bugs.webkit.org/show_bug.cgi?id=172744
4088
4089         Reviewed by Zalan Bujtas.
4090
4091         We hates std::chrono. Don't include it everywhere to discourage use.
4092
4093         * wtf/StdLibExtras.h:
4094
4095 2017-06-02  Filip Pizlo  <fpizlo@apple.com>
4096
4097         Atomics.load and Atomics.store need to be fully fenced
4098         https://bugs.webkit.org/show_bug.cgi?id=172844
4099
4100         Reviewed by Keith Miller.
4101         
4102         Add loadFullyFenced and storeFullyFenced to Atomic<>.
4103
4104         * wtf/Atomics.h:
4105         (WTF::Atomic::loadFullyFenced):
4106         (WTF::Atomic::storeRelaxed):
4107         (WTF::Atomic::storeFullyFenced):
4108         (WTF::atomicLoadFullyFenced):
4109         (WTF::atomicStoreFullyFenced):
4110
4111 2017-06-01  Keith Miller  <keith_miller@apple.com>
4112
4113         Undo rollout in r217638 with bug fix
4114         https://bugs.webkit.org/show_bug.cgi?id=172824
4115
4116         Unreviewed, reland patch with unused set_state code removed.
4117
4118         * Configurations/WTF.xcconfig:
4119         * WTF.xcodeproj/project.pbxproj:
4120         * wtf/Platform.h:
4121         * wtf/PlatformRegisters.h:
4122         (WTF::registersFromUContext):
4123         * wtf/StackBounds.h:
4124         (WTF::StackBounds::StackBounds):
4125         * wtf/ThreadHolder.cpp:
4126         (WTF::ThreadHolder::~ThreadHolder):
4127         * wtf/ThreadMessage.cpp:
4128         (WTF::sendMessageUsingSignal):
4129         (WTF::sendMessageUsingMach):
4130         (WTF::deliverMessagesUsingMach):
4131         (WTF::sendMessageScoped):
4132         * wtf/ThreadMessage.h:
4133         (WTF::sendMessage):
4134         * wtf/Threading.h:
4135         (WTF::Thread::machThread):
4136         * wtf/mac/MachExceptions.defs: Copied from Source/WTF/wtf/ThreadMessage.h.
4137         * wtf/threads/Signals.cpp:
4138         (WTF::startMachExceptionHandlerThread):
4139         (WTF::fromMachException):
4140         (WTF::toMachMask):
4141         (WTF::handleSignalsWithMach):
4142         (WTF::setExceptionPorts):
4143         (WTF::activeThreads):
4144         (WTF::registerThreadForMachExceptionHandling):
4145         (WTF::unregisterThreadForMachExceptionHandling):
4146         (WTF::installSignalHandler):
4147         (WTF::jscSignalHandler):
4148         * wtf/threads/Signals.h:
4149
4150 2017-05-31  Commit Queue  <commit-queue@webkit.org>
4151
4152         Unreviewed, rolling out r217611 and r217631.
4153         https://bugs.webkit.org/show_bug.cgi?id=172785
4154
4155         "caused wasm-hashset-many.html to become flaky." (Requested by
4156         keith_miller on #webkit).
4157
4158         Reverted changesets:
4159
4160         "Reland r216808, underlying lldb bug has been fixed."
4161         https://bugs.webkit.org/show_bug.cgi?id=172759
4162         http://trac.webkit.org/changeset/217611
4163
4164         "Use dispatch queues for mach exceptions"
4165         https://bugs.webkit.org/show_bug.cgi?id=172775
4166         http://trac.webkit.org/changeset/217631
4167
4168 2017-05-31  Keith Miller  <keith_miller@apple.com>
4169
4170         Use dispatch queues for mach exceptions
4171         https://bugs.webkit.org/show_bug.cgi?id=172775
4172
4173         Reviewed by Geoffrey Garen.
4174
4175         This patch adds support for using a dispatch queue to handle our
4176         mach exceptions. We use a high priority concurrent dispatch queue
4177         to handle our mach exceptions. We don't know the priority of the
4178         thread whose exception we are handling so the most conservative
4179         answer is to respond with a high priority. These events are both
4180         rare and usually quite fast so it is likely not a significant cost
4181         when the thread with an exception has a low priority.
4182
4183         * wtf/threads/Signals.cpp:
4184         (WTF::startMachExceptionHandlerThread):
4185
4186 2017-05-31  Keith Miller  <keith_miller@apple.com>
4187
4188         Reland r216808, underlying lldb bug has been fixed.
4189         https://bugs.webkit.org/show_bug.cgi?id=172759
4190
4191         Unreviewed, relanding old patch. See: rdar://problem/31183352
4192
4193         * Configurations/WTF.xcconfig:
4194         * WTF.xcodeproj/project.pbxproj:
4195         * wtf/Platform.h:
4196         * wtf/PlatformRegisters.h:
4197         (WTF::registersFromUContext):
4198         * wtf/StackBounds.h:
4199         (WTF::StackBounds::StackBounds):
4200         * wtf/ThreadHolder.cpp:
4201         (WTF::ThreadHolder::~ThreadHolder):
4202         * wtf/ThreadMessage.cpp:
4203         (WTF::sendMessageUsingSignal):
4204         (WTF::sendMessageUsingMach):
4205         (WTF::deliverMessagesUsingMach):
4206         (WTF::sendMessageScoped):
4207         * wtf/ThreadMessage.h:
4208         (WTF::sendMessage):
4209         * wtf/Threading.h:
4210         (WTF::Thread::machThread):
4211         * wtf/mac/MachExceptions.defs: Copied from Source/WTF/wtf/ThreadMessage.h.
4212         * wtf/threads/Signals.cpp:
4213         (WTF::startMachExceptionHandlerThread):
4214         (WTF::fromMachException):
4215         (WTF::toMachMask):
4216         (WTF::handleSignalsWithMach):
4217         (WTF::setExceptionPorts):
4218         (WTF::activeThreads):
4219         (WTF::registerThreadForMachExceptionHandling):
4220         (WTF::unregisterThreadForMachExceptionHandling):
4221         (WTF::installSignalHandler):
4222         (WTF::jscSignalHandler):
4223         * wtf/threads/Signals.h:
4224
4225 2017-05-31  Matt Lewis  <jlewis3@apple.com>
4226
4227         Unreviewed, rolling out r217603.
4228
4229         This patch broke the internal builds.
4230
4231         Reverted changeset:
4232
4233         "Get <chrono> out of StdLibExtras.h"
4234         https://bugs.webkit.org/show_bug.cgi?id=172744
4235         http://trac.webkit.org/changeset/217603
4236
4237 2017-05-31  Simon Fraser  <simon.fraser@apple.com>
4238
4239         Get <chrono> out of StdLibExtras.h
4240         https://bugs.webkit.org/show_bug.cgi?id=172744
4241
4242         Reviewed by Saam Barati.
4243
4244         We hates std::chrono. Don't include it everywhere to discourage use.
4245
4246         * wtf/StdLibExtras.h:
4247
4248 2017-05-30  Ryosuke Niwa  <rniwa@webkit.org>
4249
4250         Only include DataDetectorsUI headers in iOS
4251         https://bugs.webkit.org/show_bug.cgi?id=172633
4252
4253         Reviewed by David Kilzer.
4254
4255         Enable data detectors only on iOS and not other variants of iOS.
4256
4257         * wtf/FeatureDefines.h:
4258         * wtf/Platform.h:
4259
4260 2017-05-29  Yusuke Suzuki  <utatane.tea@gmail.com>
4261
4262         Unreviewed, disable faster Interpreter::getOpcodeID for ARM_THUMB2 with non-Darwin OSes
4263         https://bugs.webkit.org/show_bug.cgi?id=172686
4264
4265         Because of test failures.
4266
4267         * wtf/Platform.h:
4268
4269 2017-05-28  Dan Bernstein  <mitz@apple.com>
4270
4271         [Xcode] ALWAYS_SEARCH_USER_PATHS is set to YES
4272         https://bugs.webkit.org/show_bug.cgi?id=172691
4273
4274         Reviewed by Tim Horton.
4275
4276         * Configurations/Base.xcconfig: Set ALWAYS_SEARCH_USER_PATHS to NO.
4277
4278 2017-05-28  Yusuke Suzuki  <utatane.tea@gmail.com>
4279
4280         [JSC][Linux][FreeBSD] Use faster Interpreter::getOpcodeID()
4281         https://bugs.webkit.org/show_bug.cgi?id=172686
4282
4283         Reviewed by Mark Lam.
4284
4285         As of r217526, JSC gets faster Interpreter::getOpcodeID() by
4286         embedding OpcodeID value just before the LLInt machine code
4287         handler pointer. By doing so, we can retrieve OpcodeID from
4288         the LLInt machine code handler by dereferencing the code
4289         pointer. `*((int*)ptr - 1)`.
4290
4291         This patch allows Linux and FreeBSD environments to use this
4292         optimization.