B3/Air should use bubble sort for their insertion sets, because it's faster than...
[WebKit-https.git] / Source / WTF / ChangeLog
1 2015-11-02  Filip Pizlo  <fpizlo@apple.com>
2
3         B3/Air should use bubble sort for their insertion sets, because it's faster than std::stable_sort
4         https://bugs.webkit.org/show_bug.cgi?id=150828
5
6         Reviewed by Geoffrey Garen.
7
8         Add a pretty good bubble sort implementation to WTF. This implementation has three
9         common tricks:
10
11         - Forward and backward scans. This reduces the severity of certain kinds of bubble sort
12           pathologies.
13
14         - Return if a scan finds the list to be sorted. This gives the algorithm one of its most
15           attractive properties: it's super fast when the list is already sorted.
16
17         - Each scan eliminates one element from future scans. This makes the algorithm no worse
18           than insertion sort.
19
20         Why do we want this? Because bubble sort is a really great stable sort for small lists,
21         or large lists in which only a handful of elements are out of order. Compiler insertion
22         sets tend to be one of those or somewhere in between: usually they are very small, and
23         usually they are sorted. It's rare that an element will be out of order, and when it is,
24         it's usually very close to where it's supposed to be.
25
26         This is a significant speed-up for B3 compile times.
27
28         * WTF.xcodeproj/project.pbxproj:
29         * wtf/BubbleSort.h: Added.
30         (WTF::bubbleSort):
31         * wtf/CMakeLists.txt:
32
33 2015-11-02  Andy Estes  <aestes@apple.com>
34
35         [Cocoa] Add tvOS and watchOS to SUPPORTED_PLATFORMS
36         https://bugs.webkit.org/show_bug.cgi?id=150819
37
38         Reviewed by Dan Bernstein.
39
40         This tells Xcode to include these platforms in its Devices dropdown, making it possible to build in the IDE.
41
42         * Configurations/Base.xcconfig:
43
44 2015-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
45
46         [GLIB] Remove support for GSocket main loop sources from GMainLoopSource
47         https://bugs.webkit.org/show_bug.cgi?id=150772
48
49         Reviewed by Žan Doberšek.
50
51         It complicated the code just to make generic what is only used in
52         one place.
53
54         * wtf/glib/GMainLoopSource.cpp:
55         (WTF::GMainLoopSource::cancel): Deleted.
56         (WTF::GMainLoopSource::schedule): Deleted.
57         (WTF::GMainLoopSource::scheduleTimeoutSource): Deleted.
58         (WTF::GMainLoopSource::scheduleAfterDelay): Deleted.
59         (WTF::GMainLoopSource::finishVoidCallback): Deleted.
60         (WTF::GMainLoopSource::voidCallback): Deleted.
61         (WTF::GMainLoopSource::prepareBoolCallback): Deleted.
62         * wtf/glib/GMainLoopSource.h:
63         (WTF::GMainLoopSource::Context::operator=): Deleted.
64
65 2015-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
66
67         [GLIB] Remove delete on destroy GMainLoopSources
68         https://bugs.webkit.org/show_bug.cgi?id=150771
69
70         Reviewed by Žan Doberšek.
71
72         Delete on destroy sources made the GMainLoopSource implementation
73         more complex and they are currently unused.
74
75         * wtf/glib/GMainLoopSource.cpp:
76         (WTF::GMainLoopSource::boolCallback):
77         (WTF::GMainLoopSource::create): Deleted.
78         (WTF::GMainLoopSource::GMainLoopSource): Deleted.
79         (WTF::GMainLoopSource::cancel): Deleted.
80         (WTF::GMainLoopSource::scheduleAndDeleteOnDestroy): Deleted.
81         (WTF::GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy): Deleted.
82         (WTF::GMainLoopSource::voidCallback): Deleted.
83         * wtf/glib/GMainLoopSource.h:
84
85 2015-11-01  Carlos Garcia Campos  <cgarcia@igalia.com>
86
87         [GTK] Use RunLoop in WorkQueue implementation
88         https://bugs.webkit.org/show_bug.cgi?id=150770
89
90         Reviewed by Darin Adler.
91
92         Instead of using GMainLoop directly. RunLoop already abstracts the
93         GMainLoop details and uses persistent sources making it more efficient.
94         For the dispatchAfter implementation we use a helper context class
95         and a GSource directly, since we are going to get rid of delete on
96         destroy GMainLoop soon and this is the only place where we still
97         use them.
98
99         * wtf/RunLoop.h:
100         (WTF::RunLoop::mainContext): Return the GMainContext.
101         * wtf/WorkQueue.h:
102         * wtf/glib/WorkQueueGLib.cpp:
103         (WTF::WorkQueue::platformInitialize): The RunLoop needs to be
104         created in the worker thread now, so we now use a mutex to wait
105         until the thread has started and the RunLoop has been created.
106         (WTF::WorkQueue::platformInvalidate): Stop the RunLoop and wait
107         until the thread finishes.
108         (WTF::WorkQueue::dispatch): Use RunLoop::dispatch().
109         (WTF::DispatchAfterContext::DispatchAfterContext):
110         (WTF::DispatchAfterContext::~DispatchAfterContext):
111         (WTF::DispatchAfterContext::dispatch):
112         (WTF::WorkQueue::dispatchAfter):
113
114 2015-11-01  Yusuke Suzuki  <utatane.tea@gmail.com>
115
116         [ES6] Support Generator Syntax
117         https://bugs.webkit.org/show_bug.cgi?id=150769
118
119         Reviewed by Geoffrey Garen.
120
121         Added ENABLE_ES6_GENERATORS flag.
122
123         * wtf/FeatureDefines.h:
124
125 2015-11-01  Darin Adler  <darin@apple.com>
126
127         ASCIICType refinements
128         https://bugs.webkit.org/show_bug.cgi?id=150787
129
130         Reviewed by Geoffrey Garen.
131
132         Refined ASCIICType.h by using narrower types. The most valuable part of this
133         is the part where the result of toASCIIHexValue is uint8_t instead of int;
134         that's slightly better for RGB values that the compiler needs to know fit
135         into a byte (coming in some Color work I plan to do soon).
136
137         * wtf/ASCIICType.h: Used CharacterType instead of CharType throughout, and
138         also sorted the using declarations at the bottom of the header.
139         (WTF::isASCII): Use the name "character" instead of "c".
140         (WTF::isASCIIAlpha): Ditto. Also use isASCIILower and toASCIILowerUnchecked
141         instead of writing it out.
142         (WTF::isASCIIDigit): Ditto.
143         (WTF::isASCIIAlphanumeric): Ditto.
144         (WTF::isASCIIHexDigit): Ditto. Also use toASCIILowerUnchecked instead of
145         writing it out.
146         (WTF::isASCIILower): Ditto.
147         (WTF::isASCIIBinaryDigit): Ditto. Also removed unneeded parentheses to match
148         the style of the rest of the file.
149         (WTF::isASCIIOctalDigit): Ditto.
150         (WTF::isASCIIPrintable): Ditto.
151         (WTF::isASCIISpace): Ditto.
152         (WTF::isASCIIUpper): Ditto.
153         (WTF::toASCIILower): Ditto. Also use isASCIIUpper instead of writing it out.
154         (WTF::toASCIILowerUnchecked): Tweaked comment.
155         (WTF::toASCIIUpper): Ditto. Also use isASCIILower instead of writing it out.
156         (WTF::toASCIIHexValue): Ditto. Also change return type from int to uint8_t.
157         Also broke a single assertion with && into two separate assertions and got
158         rid of unnnecessary masking with 0xF0 after shifting left. Also renamed
159         arguments for the two argument value so they are more sensible.
160         (WTF::lowerNibbleToASCIIHexDigit): Changed argument type to uint8_t, since
161         this function does not take a character. Also called it "value" instead of "c".
162         Also slightly tweaked how the expression is written.
163         (WTF::upperNibbleToASCIIHexDigit): Ditto. Using the more specific type also
164         got rid of the need to explicitly mask in this function.
165         (WTF::isASCIIAlphaCaselessEqual): Renamed the arguments for greater clarity.
166         With the new clearer argument names, the comment was superfluous.
167
168 2015-11-01  Filip Pizlo  <fpizlo@apple.com>
169
170         Dominators should be factored out of the DFG
171         https://bugs.webkit.org/show_bug.cgi?id=150764
172
173         Reviewed by Geoffrey Garen.
174
175         This takes what used to be DFGDominators.h/DFGDominators.cpp and turns it into a generic
176         algorithm that can take any abstract graph. The idea is that you create Dominators<CFG> and
177         pass it a CFG object, which defines the types of graph nodes and methods for getting
178         successors, predecessors, etc. The DFG now defines a class called CFG, which is a wrapper for
179         DFG::Graph that conforms to the thing that wtf/Dominators.h expects.
180
181         When doing things to graphs, it's common to refer to the things in the graph as "nodes".
182         Because I intend to reuse the CFG abstraction with many graph algorithms, that abstraction uses
183         the term "node" to refer to a DFG basic block. But in Dominators, the method and variable names
184         still use "block". This is because although Dominators are applicable to any kind of directed
185         graph, it's super unlikely that we will ever use them for anything but compilers. Indeed, the
186         only reason why I'm factoring them out of the DFG is so that I can use them with B3 and Air.
187
188         This has the nice side effect that a user of WTF::Dominators<JSC::DFG::CFG> will see familiar
189         terminology like "blocksStrictlyDominatedBy(...)" instead of "nodesStrictlyDominatedBy(...)",
190         which would be super confusing.
191
192         Overall, wtf/Dominators.h is a combination of what used to be in DFGDominators.h,
193         DFGDominators.cpp, DFGNaiveDominators.h, and DFGNaiveDominators.cpp. I only changed code when I
194         had to in order to make it generic.
195
196         * WTF.xcodeproj/project.pbxproj:
197         * wtf/CMakeLists.txt:
198         * wtf/Dominators.h: Added.
199         (WTF::Dominators::Dominators):
200         (WTF::Dominators::compute):
201         (WTF::Dominators::strictlyDominates):
202         (WTF::Dominators::dominates):
203         (WTF::Dominators::immediateDominatorOf):
204         (WTF::Dominators::forAllStrictDominatorsOf):
205         (WTF::Dominators::forAllDominatorsOf):
206         (WTF::Dominators::forAllBlocksStrictlyDominatedBy):
207         (WTF::Dominators::forAllBlocksDominatedBy):
208         (WTF::Dominators::strictDominatorsOf):
209         (WTF::Dominators::dominatorsOf):
210         (WTF::Dominators::blocksStrictlyDominatedBy):
211         (WTF::Dominators::blocksDominatedBy):
212         (WTF::Dominators::forAllBlocksInDominanceFrontierOf):
213         (WTF::Dominators::dominanceFrontierOf):
214         (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOf):
215         (WTF::Dominators::forAllBlocksInPrunedIteratedDominanceFrontierOf):
216         (WTF::Dominators::iteratedDominanceFrontierOf):
217         (WTF::Dominators::dump):
218         (WTF::Dominators::LengauerTarjan::LengauerTarjan):
219         (WTF::Dominators::LengauerTarjan::compute):
220         (WTF::Dominators::LengauerTarjan::immediateDominator):
221         (WTF::Dominators::LengauerTarjan::computeDepthFirstPreNumbering):
222         (WTF::Dominators::LengauerTarjan::computeSemiDominatorsAndImplicitImmediateDominators):
223         (WTF::Dominators::LengauerTarjan::computeExplicitImmediateDominators):
224         (WTF::Dominators::LengauerTarjan::link):
225         (WTF::Dominators::LengauerTarjan::eval):
226         (WTF::Dominators::LengauerTarjan::compress):
227         (WTF::Dominators::LengauerTarjan::BlockData::BlockData):
228         (WTF::Dominators::NaiveDominators::NaiveDominators):
229         (WTF::Dominators::NaiveDominators::dominates):
230         (WTF::Dominators::NaiveDominators::dump):
231         (WTF::Dominators::NaiveDominators::pruneDominators):
232         (WTF::Dominators::ValidationContext::ValidationContext):
233         (WTF::Dominators::ValidationContext::reportError):
234         (WTF::Dominators::ValidationContext::handleErrors):
235         (WTF::Dominators::naiveDominates):
236         (WTF::Dominators::forAllBlocksInDominanceFrontierOfImpl):
237         (WTF::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl):
238         (WTF::Dominators::BlockData::BlockData):
239
240 2015-11-01  Darin Adler  <darin@apple.com>
241
242         Remove some dead and unneeded code (ScrollbarThemeSafari, RenderThemeSafari, OPENCL, a little color space logic)
243         https://bugs.webkit.org/show_bug.cgi?id=150783
244
245         Reviewed by Tim Horton.
246
247         * wtf/FeatureDefines.h: Removed the OPENCL feature, no longer supported.
248
249 2015-10-31  Filip Pizlo  <fpizlo@apple.com>
250
251         B3::reduceStrength's DCE should be more agro and less wrong
252         https://bugs.webkit.org/show_bug.cgi?id=150748
253
254         Reviewed by Geoffrey Garen.
255
256         * wtf/GraphNodeWorklist.h:
257         (WTF::GraphNodeWorklist::saw): This method is super useful.
258
259 2015-11-01  Philip Chimento  <philip.chimento@gmail.com>
260
261         [GTK] Fix combinations of PLATFORM(GTK) and OS(DARWIN)
262         https://bugs.webkit.org/show_bug.cgi?id=144560
263
264         Reviewed by Darin Adler.
265
266         * wtf/Platform.h: Don't USE(ACCELERATE) on PLATFORM(GTK).
267         * wtf/WorkQueue.h: Change order of OS(DARWIN) and PLATFORM(GTK)
268         checks so that GTK facilities are used even when building the
269         GTK platform on Darwin.
270
271 2015-11-01  Carlos Garcia Campos  <cgarcia@igalia.com>
272
273         [GTK] Use RunLoop::Timer in main thread shared timer GTK+ implementation
274         https://bugs.webkit.org/show_bug.cgi?id=150754
275
276         Reviewed by Darin Adler.
277
278         Add API to set the priority of a RunLoop::Timer for GLib.
279
280         * wtf/RunLoop.h:
281         * wtf/glib/RunLoopGLib.cpp:
282         (WTF::RunLoop::TimerBase::setPriority):
283
284 2015-10-31  Andreas Kling  <akling@apple.com>
285
286         Add a debug overlay with information about web process resource usage.
287         <https://webkit.org/b/150599>
288
289         Reviewed by Darin Adler.
290
291         Add ENABLE(RESOURCE_USAGE_OVERLAY) flag, enabled on Mac by default.
292
293         * wtf/Platform.h:
294
295 2015-10-30  Chris Dumez  <cdumez@apple.com>
296
297         Regression(r191673): Crash in RunLoopTimer::schedule()
298         https://bugs.webkit.org/show_bug.cgi?id=150723
299
300         Reviewed by Anders Carlsson.
301
302         We were crashing in RunLoopTimer::schedule() when iterating over the
303         SchedulePairHashSet. The reason is that we were passing this
304         SchedulePairHashSet from the main thread to a background thread, which
305         was not safe because the SchedulePair objects inside the HashSet were
306         not ThreadSafeRefCounted. This patch makes them ThreadSafeRefCounted.
307
308         * wtf/SchedulePair.h:
309
310 2015-10-30  Carlos Garcia Campos  <cgarcia@igalia.com>
311
312         [GTK] Move the socket polling off the WorkQueue
313         https://bugs.webkit.org/show_bug.cgi?id=150593
314
315         Reviewed by Anders Carlsson.
316
317         It doesn't really belong to the WorkQueue, it's only used by the
318         WebKit2 connection, so it can be moved there.
319
320         * wtf/WorkQueue.h:
321         * wtf/glib/WorkQueueGLib.cpp:
322         (WTF::WorkQueue::registerSocketEventHandler): Deleted.
323         (WTF::WorkQueue::unregisterSocketEventHandler): Deleted.
324
325 2015-10-29  Carlos Garcia Campos  <cgarcia@igalia.com>
326
327         [GTK] Use a persistent main loop source in RunLoop glib implementation
328         https://bugs.webkit.org/show_bug.cgi?id=150590
329
330         Reviewed by Žan Doberšek.
331
332         It's more efficient than creating and destroying a new source for
333         every dispatch and it simplifies the code.
334
335         * wtf/RunLoop.h:
336         * wtf/glib/MainThreadGLib.cpp:
337         (WTF::scheduleDispatchFunctionsOnMainThread): Use
338         RunLoop::dispatch() instead of GMainLoopSource::scheduleAndDeleteOnDestroy().
339         * wtf/glib/RunLoopGLib.cpp:
340         (WTF::RunLoop::RunLoop): Create and setup the persistent source.
341         (WTF::RunLoop::~RunLoop): Destroy the persistent source.
342         (WTF::RunLoop::stop): Stop the persistent source before stopping
343         the main loop.
344         (WTF::RunLoop::wakeUp): Make the persistent source active. We
345         no longer need to explicitly wakeup the context.
346         (WTF::RunLoop::TimerBase::TimerBase): Create and setup the
347         persistent source.
348         (WTF::RunLoop::TimerBase::~TimerBase): Destroy the persistent source.
349         (WTF::RunLoop::TimerBase::updateReadyTime): Set the ready time
350         according to the fire interval.
351         (WTF::RunLoop::TimerBase::start): Make the persistent source active.
352         (WTF::RunLoop::TimerBase::stop): Stop the persistent source.
353         (WTF::RunLoop::TimerBase::isActive): Return whether the
354         persistent source is active.
355
356 2015-10-30  Philippe Normand  <pnormand@igalia.com>
357
358         [GTK][Mac] fix WTF build
359         https://bugs.webkit.org/show_bug.cgi?id=150502
360
361         Reviewed by Alex Christensen.
362
363         * wtf/CMakeLists.txt: Add CommonCryptoSPI.h in the headers.
364
365 2015-10-29  Alex Christensen  <achristensen@webkit.org>
366
367         Fix Mac CMake build
368         https://bugs.webkit.org/show_bug.cgi?id=150686
369
370         Reviewed by Filip Pizlo.
371
372         * wtf/CMakeLists.txt:
373         * wtf/Platform.h:
374         * wtf/PlatformMac.cmake:
375
376 2015-10-29  Commit Queue  <commit-queue@webkit.org>
377
378         Unreviewed, rolling out r191728.
379         https://bugs.webkit.org/show_bug.cgi?id=150668
380
381         Caused a lot of timeouts in layout tests (Requested by KaL on
382         #webkit).
383
384         Reverted changeset:
385
386         "[GTK] Use a persistent main loop source in RunLoop glib
387         implementation"
388         https://bugs.webkit.org/show_bug.cgi?id=150590
389         http://trac.webkit.org/changeset/191728
390
391 2015-10-29  Carlos Garcia Campos  <cgarcia@igalia.com>
392
393         [GTK] Use a persistent main loop source in RunLoop glib implementation
394         https://bugs.webkit.org/show_bug.cgi?id=150590
395
396         Reviewed by Žan Doberšek.
397
398         It's more efficient than creating and destroying a new source for
399         every dispatch and it simplifies the code.
400
401         * wtf/RunLoop.h:
402         * wtf/glib/MainThreadGLib.cpp:
403         (WTF::scheduleDispatchFunctionsOnMainThread): Use
404         RunLoop::dispatch() instead of GMainLoopSource::scheduleAndDeleteOnDestroy().
405         * wtf/glib/RunLoopGLib.cpp:
406         (WTF::RunLoop::RunLoop): Create and setup the persistent source.
407         (WTF::RunLoop::~RunLoop): Destroy the persistent source.
408         (WTF::RunLoop::stop): Stop the persistent source before stopping
409         the main loop.
410         (WTF::RunLoop::wakeUp): Make the persistent source active. We
411         no longer need to explicitly wakeup the context.
412         (WTF::RunLoop::TimerBase::TimerBase): Create and setup the
413         persistent source.
414         (WTF::RunLoop::TimerBase::~TimerBase): Destroy the persistent source.
415         (WTF::RunLoop::TimerBase::updateReadyTime): Set the ready time
416         according to the fire interval.
417         (WTF::RunLoop::TimerBase::start): Make the persistent source active.
418         (WTF::RunLoop::TimerBase::stop): Stop the persistent source.
419         (WTF::RunLoop::TimerBase::isActive): Return whether the
420         persistent source is active.
421
422 2015-10-28  Filip Pizlo  <fpizlo@apple.com>
423
424         Unreviewed, make sure B3 is disabled on iOS for now.
425
426         * wtf/Platform.h:
427
428 2015-10-28  Filip Pizlo  <fpizlo@apple.com>
429
430         Create a super rough prototype of B3
431         https://bugs.webkit.org/show_bug.cgi?id=150280
432
433         Reviewed by Benjamin Poulain.
434
435         * WTF.xcodeproj/project.pbxproj:
436         * wtf/CMakeLists.txt:
437         * wtf/HashSet.h:
438         (WTF::copyToVector):
439         (WTF::=):
440         * wtf/ListDump.h:
441         (WTF::PointerListDump::PointerListDump):
442         (WTF::PointerListDump::dump):
443         (WTF::MapDump::MapDump):
444         (WTF::listDump):
445         (WTF::pointerListDump):
446         (WTF::sortedListDump):
447         * wtf/MathExtras.h:
448         (WTF::leftShiftWithSaturation):
449         (WTF::rangesOverlap):
450         * wtf/Platform.h:
451         * wtf/ScopedLambda.h: Added.
452         (WTF::scopedLambda):
453         * wtf/SharedTask.h:
454         (WTF::createSharedTask):
455
456 2015-10-28  Alberto Garcia  <berto@igalia.com>
457
458         [SOUP] Cannot build the network process in glibc-based BSD systems
459         https://bugs.webkit.org/show_bug.cgi?id=150618
460
461         Reviewed by Carlos Garcia Campos.
462
463         * wtf/Platform.h: Don't enable HAVE_STAT_BIRTHTIME if the system
464         is using glibc.
465
466 2015-10-21  Filip Pizlo  <fpizlo@apple.com>
467
468         Factor out the graph node worklists from DFG into WTF
469         https://bugs.webkit.org/show_bug.cgi?id=150411
470
471         Reviewed by Geoffrey Garen.
472
473         The new GraphNodeWorklist.h file is basically just the functionality from the old
474         DFGBlockWorklist.h, but templatized to work for any graph node type and any kind of graph
475         node set.
476
477         * WTF.xcodeproj/project.pbxproj:
478         * wtf/CMakeLists.txt:
479         * wtf/GraphNodeWorklist.h: Added.
480         (WTF::GraphNodeWorklist::push):
481         (WTF::GraphNodeWorklist::notEmpty):
482         (WTF::GraphNodeWorklist::pop):
483         (WTF::GraphNodeWith::GraphNodeWith):
484         (WTF::GraphNodeWith::operator bool):
485         (WTF::ExtendedGraphNodeWorklist::ExtendedGraphNodeWorklist):
486         (WTF::ExtendedGraphNodeWorklist::forcePush):
487         (WTF::ExtendedGraphNodeWorklist::push):
488         (WTF::ExtendedGraphNodeWorklist::notEmpty):
489         (WTF::ExtendedGraphNodeWorklist::pop):
490         (WTF::GraphNodeWithOrder::GraphNodeWithOrder):
491         (WTF::GraphNodeWithOrder::operator bool):
492         (WTF::PostOrderGraphNodeWorklist::PostOrderGraphNodeWorklist):
493         (WTF::PostOrderGraphNodeWorklist::~PostOrderGraphNodeWorklist):
494         (WTF::PostOrderGraphNodeWorklist::pushPre):
495         (WTF::PostOrderGraphNodeWorklist::pushPost):
496         (WTF::PostOrderGraphNodeWorklist::push):
497         (WTF::PostOrderGraphNodeWorklist::notEmpty):
498         (WTF::PostOrderGraphNodeWorklist::pop):
499         * wtf/HashTable.h:
500         (WTF::HashTableAddResult::HashTableAddResult):
501         (WTF::HashTableAddResult::operator bool):
502
503 2015-10-20  Tim Horton  <timothy_horton@apple.com>
504
505         Try to fix the build by disabling MAC_GESTURE_EVENTS on 10.9 and 10.10
506
507         * wtf/FeatureDefines.h:
508
509 2015-10-20  Yoav Weiss  <yoav@yoav.ws>
510
511         Rename the PICTURE_SIZES flag to CURRENTSRC
512         https://bugs.webkit.org/show_bug.cgi?id=150275
513
514         Reviewed by Dean Jackson.
515
516         * wtf/FeatureDefines.h:
517
518 2015-10-19  Beth Dakin  <bdakin@apple.com>
519
520         Build fix.
521
522         * wtf/FeatureDefines.h:
523
524 2015-10-19  Tim Horton  <timothy_horton@apple.com>
525
526         Add magnify and rotate gesture event support for Mac
527         https://bugs.webkit.org/show_bug.cgi?id=150179
528         <rdar://problem/8036240>
529
530         Reviewed by Darin Adler.
531
532         * wtf/FeatureDefines.h:
533         New feature flag.
534
535 2015-10-17  Mark Lam  <mark.lam@apple.com>
536
537         Add CPU(X86) to the supported MASM_PROBE CPUs. This was accidentally left out in r191197.
538
539         Not reviewed.
540
541         * wtf/Platform.h:
542
543 2015-10-16  Mark Lam  <mark.lam@apple.com>
544
545         Always enable MASM_PROBE for debug builds.
546         https://bugs.webkit.org/show_bug.cgi?id=150190
547
548         Reviewed by Geoffrey Garen.
549
550         * wtf/Platform.h:
551
552 2015-10-14  Andreas Kling  <akling@apple.com>
553
554         REGRESSION(r190882): Concatenating a character array and an empty string is broken.
555         <https://webkit.org/b/150135>
556
557         Reviewed by Geoffrey Garen.
558
559         StringAdapter templates for raw character arrays were always using 1 as the array length
560         in toString().
561
562         * wtf/text/StringConcatenate.h:
563
564 2015-10-14  Per Arne Vollan  <peavo@outlook.com>
565
566         [Win64] Enable concurrent JIT.
567         https://bugs.webkit.org/show_bug.cgi?id=150098
568
569         Reviewed by Csaba Osztrogonác.
570
571         * wtf/Platform.h:
572
573 2015-10-13  Simon Fraser  <simon.fraser@apple.com>
574
575         Add helper funtion for checking pointer equivalency and use it
576         https://bugs.webkit.org/show_bug.cgi?id=150022
577
578         Reviewed by Darin Adler.
579         
580         Add PointerComparison.h which contains the templated pointer comparison
581         function.
582
583         * WTF.xcodeproj/project.pbxproj:
584         * wtf/PointerComparison.h: Added.
585         (WTF::arePointingToEqualData):
586
587 2015-10-12  Andreas Kling  <akling@apple.com>
588
589         "A + B" with strings shouldn't copy if A or B is empty.
590         <https://webkit.org/b/150034>
591
592         Reviewed by Anders Carlsson.
593
594         Add a fast path to WTF's operator+ magic for concatenation of two strings where
595         one of them is empty. In that case, try to avoid allocation altogether by returning
596         the non-empty string.
597
598         Spotted this while analyzing memory peaks during page load; it turns out we were
599         duplicating whole text resources (JS, CSS) at the end of decoding, below
600         TextResourceDecoder::decodeAndFlush(). That function effectively does:
601
602             return decode() + flush();
603
604         Very often, flush() returns an empty string, so due to the naive operator+,
605         we'd allocate a new StringImpl of length (decode().length() + flush().length())
606         and copy the return value from decode() into it. So silly!
607
608         Had to make the tryMakeString() machinery use String as a return type instead of
609         RefPtr<StringImpl> to make all the right overloads gel. StringTypeAdapter templates
610         are now required to provide a toString() function.
611
612         * wtf/text/StringConcatenate.h:
613         (WTF::StringTypeAdapter<char>::toString):
614         (WTF::StringTypeAdapter<UChar>::toString):
615         (WTF::StringTypeAdapter<Vector<char>>::toString):
616         (WTF::StringTypeAdapter<String>::toString):
617         (WTF::tryMakeString):
618         (WTF::makeString):
619         * wtf/text/StringOperators.h:
620         (WTF::StringAppend::operator String):
621         * wtf/text/StringView.h:
622         (WTF::StringTypeAdapter<StringView>::toString):
623
624 2015-10-12  Filip Pizlo  <fpizlo@apple.com>
625
626         Unreviewed, fix style in the hopes that it fixes Windows.
627
628         * wtf/ParallelHelperPool.cpp:
629         (WTF::ParallelHelperClient::~ParallelHelperClient):
630         (WTF::ParallelHelperClient::setTask):
631         (WTF::ParallelHelperClient::doSomeHelping):
632         (WTF::ParallelHelperClient::runTaskInParallel):
633         (WTF::ParallelHelperClient::finish):
634         (WTF::ParallelHelperClient::claimTask):
635         (WTF::ParallelHelperClient::runTask):
636         (WTF::ParallelHelperPool::doSomeHelping):
637         (WTF::ParallelHelperPool::helperThreadBody):
638         * wtf/ParallelHelperPool.h:
639         (WTF::ParallelHelperClient::setFunction):
640         (WTF::ParallelHelperClient::runFunctionInParallel):
641         (WTF::ParallelHelperClient::pool):
642
643 2015-10-10  Filip Pizlo  <fpizlo@apple.com>
644
645         FTL should generate code to call slow paths lazily
646         https://bugs.webkit.org/show_bug.cgi?id=149936
647
648         Reviewed by Saam Barati.
649
650         Enables SharedTask to handle any function type, not just void().
651
652         It's probably better to use SharedTask instead of std::function in performance-sensitive
653         code. std::function uses the system malloc and has copy semantics. SharedTask uses FastMalloc
654         and has aliasing semantics. So, you can just trust that it will have sensible performance
655         characteristics.
656
657         * wtf/ParallelHelperPool.cpp:
658         (WTF::ParallelHelperClient::~ParallelHelperClient):
659         (WTF::ParallelHelperClient::setTask):
660         (WTF::ParallelHelperClient::doSomeHelping):
661         (WTF::ParallelHelperClient::runTaskInParallel):
662         (WTF::ParallelHelperClient::finish):
663         (WTF::ParallelHelperClient::claimTask):
664         (WTF::ParallelHelperClient::runTask):
665         (WTF::ParallelHelperPool::doSomeHelping):
666         (WTF::ParallelHelperPool::helperThreadBody):
667         * wtf/ParallelHelperPool.h:
668         (WTF::ParallelHelperClient::setFunction):
669         (WTF::ParallelHelperClient::runFunctionInParallel):
670         (WTF::ParallelHelperClient::pool):
671         * wtf/SharedTask.h:
672         (WTF::createSharedTask):
673         (WTF::SharedTask::SharedTask): Deleted.
674         (WTF::SharedTask::~SharedTask): Deleted.
675         (WTF::SharedTaskFunctor::SharedTaskFunctor): Deleted.
676
677 2015-10-10  Dan Bernstein  <mitz@apple.com>
678
679         [iOS] Remove unnecessary iOS version checks
680         https://bugs.webkit.org/show_bug.cgi?id=150002
681
682         Reviewed by Alexey Proskuryakov.
683
684         * wtf/Platform.h:
685
686 2015-10-10  Dan Bernstein  <mitz@apple.com>
687
688         [iOS] Remove project support for iOS 8
689         https://bugs.webkit.org/show_bug.cgi?id=149993
690
691         Reviewed by Alexey Proskuryakov.
692
693         * Configurations/Base.xcconfig:
694         * Configurations/WTF.xcconfig:
695         * Configurations/mbmalloc.xcconfig:
696
697 2015-10-08  Joseph Pecoraro  <pecoraro@apple.com>
698
699         Clean up Marked classes
700         https://bugs.webkit.org/show_bug.cgi?id=149853
701
702         Reviewed by Darin Adler.
703
704         * wtf/PageBlock.h:
705         Remove duplicate using statement.
706
707 2015-10-08  Joseph Pecoraro  <pecoraro@apple.com>
708
709         Remove PageReservation.h clang fixme that has been fixed for a while
710         https://bugs.webkit.org/show_bug.cgi?id=149908
711
712         Reviewed by Csaba Osztrogonác.
713
714         * wtf/PageReservation.h:
715         (WTF::PageReservation::operator bool): Deleted.
716
717 2015-10-06  Daniel Bates  <dbates@webkit.org>
718
719         Enable XSLT when building WebKit for iOS using the public iOS SDK
720         https://bugs.webkit.org/show_bug.cgi?id=149827
721
722         Reviewed by Alexey Proskuryakov.
723
724         * wtf/FeatureDefines.h:
725
726 2015-10-04  Filip Pizlo  <fpizlo@apple.com>
727
728         Inline cache repatching should be throttled if it happens a lot
729         https://bugs.webkit.org/show_bug.cgi?id=149796
730         rdar://problem/22674436
731
732         Reviewed by Saam Barati.
733
734         Add some helpers for saturated math.
735
736         * wtf/MathExtras.h:
737         (WTF::incrementWithSaturation):
738         (WTF::leftShiftWithSaturation):
739
740 2015-10-01  Brent Fulgham  <bfulgham@apple.com>
741
742         [Win] Unreviewed CMake build fixes.
743
744         * wtf/CMakeLists.txt: Correct build flags to match
745         the original project files.
746
747 2015-09-30  Commit Queue  <commit-queue@webkit.org>
748
749         Unreviewed, rolling out r190324.
750         https://bugs.webkit.org/show_bug.cgi?id=149671
751
752         Caused flaky crashes, rdar://problem/22916304 (Requested by ap
753         on #webkit).
754
755         Reverted changeset:
756
757         "ParallelHelperPool::runFunctionInParallel() shouldn't
758         allocate, and ParallelHelperPool.h shouldn't be included
759         everywhere"
760         https://bugs.webkit.org/show_bug.cgi?id=149635
761         http://trac.webkit.org/changeset/190324
762
763 2015-09-29  Filip Pizlo  <fpizlo@apple.com>
764
765         ParallelHelperPool::runFunctionInParallel() shouldn't allocate, and ParallelHelperPool.h shouldn't be included everywhere
766         https://bugs.webkit.org/show_bug.cgi?id=149635
767
768         Reviewed by Saam Barati.
769
770         * wtf/ParallelHelperPool.h:
771         (WTF::ParallelHelperClient::runFunctionInParallel): Stack-allocate the task instead of heap-allocating it.
772
773 2015-09-29  Filip Pizlo  <fpizlo@apple.com>
774
775         GC copy phase spans too many files
776         https://bugs.webkit.org/show_bug.cgi?id=149586
777
778         Reviewed by Andreas Kling.
779
780         Extract the load balancing algorithm used by the GC's copy phase into a reusable template.
781         The GC copy phase now uses this.
782
783         * WTF.vcxproj/WTF.vcxproj:
784         * WTF.vcxproj/WTF.vcxproj.filters:
785         * WTF.xcodeproj/project.pbxproj:
786         * wtf/CMakeLists.txt:
787         * wtf/ParallelVectorIterator.h: Added.
788         (WTF::ParallelVectorIterator::ParallelVectorIterator):
789         (WTF::ParallelVectorIterator::iterate):
790
791 2015-09-26  Filip Pizlo  <fpizlo@apple.com>
792
793         Unreviewed, fix Windows build by adding WTF_EXPORT_PRIVATE in various places.
794
795         * wtf/ParallelHelperPool.h:
796         (WTF::ParallelHelperClient::setFunction):
797         (WTF::ParallelHelperPool::numberOfThreads):
798
799 2015-09-24  Filip Pizlo  <fpizlo@apple.com>
800
801         VMs should share GC threads
802         https://bugs.webkit.org/show_bug.cgi?id=149433
803         rdar://problem/12859344
804
805         Reviewed by Geoffrey Garen.
806
807         This adds two major things to WTF: WeakRandom and ParallelHelperPool. WeakRandom was
808         already in JSC; we're just hoisting it into WTF. It's just a weak random number generator
809         that's suitable for places where you need just a tiny bit of randomness.
810
811         ParallelHelperPool is a new API that simplifies data-parallel algorithms like the JSC GC.
812         In a data-parallel algorithm, we want to run one task on as many cores as possible and let
813         the task worry about which subset of the input data to work on. In some cases, the
814         algorithm will not need to do any load balancing - and if load balancing is required, it's
815         up to the user. This is appropriate in contexts where the load balancing needs to be
816         custom-tuned for performance, like the GC's marking phase.
817
818         This new API has three concepts: task, client, and pool. A task is a reference counted
819         object with a run() method, which may be run in parallel. It is usually used to wrap a
820         functor. A pool is a pool of threads that can run things. A client is a placeholder for a
821         task. A client can have zero or one tasks. A client must be registered with a pool. When a
822         client has a task, the pool's threads may choose to run it. If a thread starts running a
823         task, it will run it to completion. When the task returns on any thread, the client takes
824         it to mean that the task should be removed. That means that any currently running instances
825         of the task will finish but no new threads will attempt to run the task. You can easily ask
826         a client to wait until a task finishes. You can also easily ask a client to run a task on
827         the current thread in addition to possibly some helper threads from the pool.
828
829         For some data-parallel algorithms, programming with ParallelHelperPool is as easy as:
830
831         client.runFunctionInParallel(
832             [=] () {
833                 do things;
834             });
835
836         Note that you cannot tell ahead of time how many threads will join to help the task.
837         Threads may become available after the task has already started running. Those threads may
838         join after the other threads have already started. It's not advisable to make algorithmic
839         decisions based on client.numberOfActiveThreads(), since that number may change. Usually
840         the best way to use ParallelHelperPool is with an algorithm that has its own custom
841         worklist. An example of a very simple custom worklist is the one in the JSC GC's copying
842         phase - it's just a Vector and an index that indicates the next set of elements to process.
843
844         This new API was initially designed to simplify how GCThread works, by replacing Phase with
845         a callback that contains the phase's workload. I then realized that with a few tweaks, I
846         could make this somewhat general enough that it might become interesting outside GC. I also
847         realized that I could use this to enable thread sharing. So, although the API is kinda
848         quirky, it's grounded in the reality of how the JSC GC does parallelism.
849
850         * WTF.vcxproj/WTF.vcxproj:
851         * WTF.vcxproj/WTF.vcxproj.filters:
852         * WTF.xcodeproj/project.pbxproj:
853         * wtf/CMakeLists.txt:
854         * wtf/ParallelHelperPool.cpp: Added.
855         (WTF::ParallelHelperClient::ParallelHelperClient):
856         (WTF::ParallelHelperClient::~ParallelHelperClient):
857         (WTF::ParallelHelperClient::setTask):
858         (WTF::ParallelHelperClient::finish):
859         (WTF::ParallelHelperClient::doSomeHelping):
860         (WTF::ParallelHelperClient::runTaskInParallel):
861         (WTF::ParallelHelperClient::claimTask):
862         (WTF::ParallelHelperClient::runTask):
863         (WTF::ParallelHelperPool::ParallelHelperPool):
864         (WTF::ParallelHelperPool::~ParallelHelperPool):
865         (WTF::ParallelHelperPool::addThreads):
866         (WTF::ParallelHelperPool::ensureThreads):
867         (WTF::ParallelHelperPool::doSomeHelping):
868         (WTF::ParallelHelperPool::didMakeWorkAvailable):
869         (WTF::ParallelHelperPool::helperThreadBody):
870         (WTF::ParallelHelperPool::hasClientWithTask):
871         (WTF::ParallelHelperPool::getClientWithTask):
872         (WTF::ParallelHelperPool::waitForClientWithTask):
873         * wtf/ParallelHelperPool.h: Added.
874         (WTF::ParallelHelperClient::setFunction):
875         (WTF::ParallelHelperClient::runFunctionInParallel):
876         (WTF::ParallelHelperClient::pool):
877         (WTF::ParallelHelperClient::numberOfActiveThreads):
878         (WTF::ParallelHelperPool::numberOfThreads):
879         * wtf/SharedTask.h: Added.
880         (WTF::SharedTask::SharedTask):
881         (WTF::SharedTask::~SharedTask):
882         (WTF::SharedTaskFunctor::SharedTaskFunctor):
883         (WTF::createSharedTask):
884         * wtf/WeakRandom.h: Copied from Source/JavaScriptCore/runtime/WeakRandom.h.
885         (WTF::WeakRandom::WeakRandom):
886         (WTF::WeakRandom::initializeSeed):
887         (WTF::WeakRandom::seedUnsafe):
888         (WTF::WeakRandom::getUint32):
889         (WTF::WeakRandom::advance):
890         (JSC::WeakRandom::WeakRandom): Deleted.
891         (JSC::WeakRandom::seedUnsafe): Deleted.
892         (JSC::WeakRandom::getUint32): Deleted.
893         (JSC::WeakRandom::advance): Deleted.
894         (JSC::WeakRandom::initializeSeed): Deleted.
895
896 2015-09-25  Alex Christensen  <achristensen@webkit.org>
897
898         Clean up CMake build on Mac
899         https://bugs.webkit.org/show_bug.cgi?id=149573
900
901         Reviewed by Chris Dumez.
902
903         * wtf/PlatformMac.cmake:
904
905 2015-09-25  Alex Christensen  <achristensen@webkit.org>
906
907         [Win] Switch to CMake
908         https://bugs.webkit.org/show_bug.cgi?id=148111
909
910         Reviewed by Brent Fulgham.
911
912         * WTF.vcxproj/WTF.proj:
913
914 2015-09-25  Joseph Pecoraro  <pecoraro@apple.com>
915
916         Simplify Stopwatch::elapsedTime
917         https://bugs.webkit.org/show_bug.cgi?id=149538
918
919         Reviewed by Darin Adler.
920
921         * wtf/Stopwatch.h:
922         (WTF::Stopwatch::elapsedTime):
923         Simplify by not starting/stopping but just computing without updating members.
924
925 2015-09-25  Brent Fulgham  <bfulgham@apple.com>
926
927         [Win] Unreviewed build fix.
928
929         * wtf/FeatureDefines.h: Don't turn STREAMS_API on by default
930         on Windows.
931
932 2015-09-24  Ryosuke Niwa  <rniwa@webkit.org>
933
934         Ran sort-Xcode-project-file.
935
936         * WTF.xcodeproj/project.pbxproj:
937
938 2015-09-23  Andy Estes  <aestes@apple.com>
939
940         Disable QuickLook on watchOS
941         https://bugs.webkit.org/show_bug.cgi?id=149508
942         <rdar://problem/22517968>
943
944         Reviewed by Dan Bernstein.
945
946         * wtf/Platform.h:
947
948 2015-09-22  Andy Estes  <aestes@apple.com>
949
950         Disable QuickLook on tvOS
951         https://bugs.webkit.org/show_bug.cgi?id=149492
952         <rdar://problem/22741586>
953
954         Reviewed by Dan Bernstein.
955
956         * wtf/Platform.h: Stopped enabling QuickLook on tvOS.
957
958 2015-09-22  Filip Pizlo  <fpizlo@apple.com>
959
960         Get rid of ENABLE(PARALLEL_GC)
961         https://bugs.webkit.org/show_bug.cgi?id=149436
962
963         Reviewed by Mark Lam.
964
965         We always enable parallel GC everywhere but Windows, and it doesn't look like it was disabled
966         there for any good reason. So, get rid of the flag.
967
968         * wtf/MainThread.cpp:
969         (WTF::canAccessThreadLocalDataForThread):
970         (WTF::initializeGCThreads):
971         (WTF::registerGCThread):
972         (WTF::isMainThreadOrGCThread):
973         * wtf/Platform.h:
974
975 2015-09-22  Filip Pizlo  <fpizlo@apple.com>
976
977         Get rid of ENABLE(GGC)
978         https://bugs.webkit.org/show_bug.cgi?id=149472
979
980         Reviewed by Mark Hahnenberg and Mark Lam.
981
982         * wtf/Platform.h:
983
984 2015-09-21  Filip Pizlo  <fpizlo@apple.com>
985
986         Always use the compiler's CAS implementation and get rid of ENABLE(COMPARE_AND_SWAP)
987         https://bugs.webkit.org/show_bug.cgi?id=149438
988
989         Reviewed by Mark Lam.
990
991         * wtf/Atomics.h: Make weakCompareAndSwap() just forward to the system CAS via WTF::Atomic.
992         (WTF::weakCompareAndSwap):
993         (WTF::weakCompareAndSwapUIntPtr): Deleted.
994         (WTF::weakCompareAndSwapSize): Deleted.
995         * wtf/Bitmap.h: Small changes to use the new API.
996         (WTF::WordType>::concurrentTestAndSet):
997         * wtf/Platform.h: Remove ENABLE(COMPARE_AND_SWAP)
998
999 2015-09-21  Csaba Osztrogonác  <ossy@webkit.org>
1000
1001         Remove old GCC cruft from wtf/StdLibExtras.h
1002         https://bugs.webkit.org/show_bug.cgi?id=149401
1003
1004         Reviewed by Alex Christensen.
1005
1006         * wtf/StdLibExtras.h:
1007
1008 2015-09-21  Andy Estes  <aestes@apple.com>
1009
1010         Disable Parental Controls on the Apple TV platform
1011         https://bugs.webkit.org/show_bug.cgi?id=149421
1012
1013         Reviewed by Darin Adler.
1014
1015         * wtf/Platform.h:
1016
1017 2015-09-21  Filip Pizlo  <fpizlo@apple.com>
1018
1019         JSC should infer property types
1020         https://bugs.webkit.org/show_bug.cgi?id=148610
1021
1022         Reviewed by Geoffrey Garen.
1023
1024         * wtf/HashTable.h:
1025         (WTF::HashTableAddResult::HashTableAddResult): Make it possible to say "HashMap::AddResult result" without assigning anything to it yet.
1026         * wtf/PrintStream.h:
1027         (WTF::printInternal): Beef up printing of some common WTF types, in particular RefPtr<UniquedStringImpl>.
1028
1029 2015-09-20  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1030
1031         Remove XHR_TIMEOUT compilation guard
1032         https://bugs.webkit.org/show_bug.cgi?id=149260
1033
1034         Reviewed by Benjamin Poulain.
1035
1036         * wtf/FeatureDefines.h:
1037
1038 2015-09-17  Filip Pizlo  <fpizlo@apple.com>
1039
1040         Unreviewed, revert unintended change.
1041
1042         * benchmarks/LockSpeedTest.cpp:
1043         (main):
1044
1045 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
1046
1047         Add ShadowRoot interface and Element.prototype.attachShadow
1048         https://bugs.webkit.org/show_bug.cgi?id=149187
1049
1050         Reviewed by Antti Koivisto.
1051
1052         * wtf/FeatureDefines.h:
1053
1054
1055 2015-09-11  Keith Miller  <keith_miller@apple.com>
1056
1057         cryptographicallyRandomValuesFromOS should use CCRandomCopyBytes when available.
1058         https://bugs.webkit.org/show_bug.cgi?id=148439
1059
1060         Reviewed by Alexey Proskuryakov.
1061
1062         Recently, we switched to using arc4random_buf on Darwin but further research indicates that
1063         arc4random_buf has the same behavior we had before and thus we were just pushing the problem
1064         further down the stack. CCRandomCopyBytes, however, appears to be more advanced and has much
1065         better error handling than we had before.
1066
1067         * WTF.xcodeproj/project.pbxproj:
1068         * wtf/OSRandomSource.cpp:
1069         (WTF::cryptographicallyRandomValuesFromOS):
1070         * wtf/spi/darwin/CommonCryptoSPI.h: Added.
1071
1072 2015-09-08  Filip Pizlo  <fpizlo@apple.com>
1073
1074         There should be one stub hanging off an inline cache that contains code for all of the cases, rather than forming a linked list consisting of one stub per case
1075         https://bugs.webkit.org/show_bug.cgi?id=148717
1076
1077         Reviewed by Michael Saboff.
1078
1079         Beef up dumping a bit.
1080
1081         * wtf/PrintStream.h:
1082         (WTF::pointerDump):
1083         (WTF::printInternal):
1084
1085 2015-09-08  Mark Lam  <mark.lam@apple.com>
1086
1087         GC stack scan should include ABI red zone.
1088         https://bugs.webkit.org/show_bug.cgi?id=148976
1089
1090         Reviewed by Geoffrey Garen and Benjamin Poulain.
1091
1092         * wtf/StackBounds.h:
1093         (WTF::StackBounds::origin):
1094         (WTF::StackBounds::end):
1095         (WTF::StackBounds::size):
1096
1097 2015-09-04  Csaba Osztrogonác  <ossy@webkit.org>
1098
1099         Enable reference qualified functions for GCC
1100         https://bugs.webkit.org/show_bug.cgi?id=148526
1101
1102         Reviewed by Darin Adler.
1103
1104         * wtf/Compiler.h:
1105
1106 2015-09-04  Csaba Osztrogonác  <ossy@webkit.org>
1107
1108         webkit-unassigned@lists.webkit.org
1109         https://bugs.webkit.org/show_bug.cgi?id=148525
1110
1111         Reviewed by Darin Adler.
1112
1113         * wtf/Compiler.h:
1114
1115 2015-08-29  Zan Dobersek  <zdobersek@igalia.com>
1116
1117         [WTF] Improve a ParkingLot::parkConditionally() comment for a libstdc++ workaround
1118         https://bugs.webkit.org/show_bug.cgi?id=148571
1119
1120         Reviewed by Filip Pizlo.
1121
1122         * wtf/ParkingLot.cpp:
1123         (WTF::ParkingLot::parkConditionally): Adjust the comment about the workaround for
1124         the libstdc++ std::condition_variable implementation, linking to the WebKit bug
1125         that dissected the problem and the GCC bug that originally reported the problem.
1126
1127 2015-08-28  Anders Carlsson  <andersca@apple.com>
1128
1129         Remove the #if PLATFORM(MAC) in DeprecatedSymbolsUsedBySafari.mm so we'll actually build it on iOS.
1130
1131         Reviewed by Dan Bernstein.
1132
1133         * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
1134
1135 2015-08-27  Anders Carlsson  <andersca@apple.com>
1136
1137         Define legacy main thread calling functions for iOS as well
1138         https://bugs.webkit.org/show_bug.cgi?id=148530
1139
1140         Reviewed by Tim Horton.
1141
1142         * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
1143
1144 2015-08-26  Anders Carlsson  <andersca@apple.com>
1145
1146         Fix build.
1147
1148         * wtf/WorkQueue.cpp:
1149
1150 2015-08-26  Anders Carlsson  <andersca@apple.com>
1151
1152         Add and implement WorkQueue::concurrentApply
1153         https://bugs.webkit.org/show_bug.cgi?id=148488
1154
1155         Reviewed by Geoffrey Garen.
1156
1157         WorkQueue::concurrentApply is modeled after dispatch_apply, and on Cocoa it uses dispatch_apply directly.
1158         For other ports there's a generic concurrentApply implemented using our threading primitives.
1159         
1160         * wtf/NeverDestroyed.h:
1161         (WTF::LazyNeverDestroyed::operator->):
1162         * wtf/WorkQueue.cpp:
1163         (WTF::WorkQueue::concurrentApply):
1164         * wtf/WorkQueue.h:
1165         * wtf/cocoa/WorkQueueCocoa.cpp:
1166         (WTF::WorkQueue::concurrentApply):
1167
1168 2015-08-25  Filip Pizlo  <fpizlo@apple.com>
1169
1170         Node::origin should be able to tell you if it's OK to exit
1171         https://bugs.webkit.org/show_bug.cgi?id=145204
1172
1173         Reviewed by Geoffrey Garen.
1174
1175         * wtf/Insertion.h:
1176         (WTF::executeInsertions): Add a useful assertion. This come into play because JSC will use UINT_MAX as "invalid index", and that ought to trigger this assertion.
1177
1178 2015-08-25  Csaba Osztrogonác  <ossy@webkit.org>
1179
1180         Require GCC version at least 4.9
1181         https://bugs.webkit.org/show_bug.cgi?id=148430
1182
1183         Reviewed by Darin Adler.
1184
1185         * wtf/Compiler.h:
1186
1187 2015-08-22  Anders Carlsson  <andersca@apple.com>
1188
1189         std::once_flag needs to be static.
1190
1191         * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
1192         (WTF::MainThreadFunctionTracker::singleton):
1193
1194 2015-08-21  Anders Carlsson  <andersca@apple.com>
1195
1196         Build fix.
1197
1198         * wtf/MainThread.h:
1199
1200 2015-08-21  Anders Carlsson  <andersca@apple.com>
1201
1202         Address review feedback from Darin.
1203
1204         * wtf/MainThread.h:
1205         * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
1206         (WTF::callOnMainThread):
1207         (WTF::cancelCallOnMainThread):
1208
1209 2015-08-21  Anders Carlsson  <andersca@apple.com>
1210
1211         Deprecate the old school callOnMainThread/cancelCallOnMainThread functions
1212         https://bugs.webkit.org/show_bug.cgi?id=148327
1213
1214         Reviewed by Sam Weinig.
1215
1216         * wtf/MainThread.cpp:
1217         (WTF::functionQueue):
1218         (WTF::dispatchFunctionsFromMainThread):
1219         (WTF::callOnMainThread):
1220         Change the function queue to be a queue of std::function<void ()> and get rid of dead code.
1221
1222         * wtf/MainThread.h:
1223         Conditionalize callOnMainThread and cancelCallOnMainThread because Safari on Mavericks still expects to them to be
1224         declared in MainThread.h under 10.9.
1225
1226         * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
1227         Add a MainThreadFunctionTracker singleton that keeps track of scheduled functions so we can ensure that they're not
1228         called if they're cancelled.
1229
1230         (WTF::MainThreadFunctionTracker::singleton):
1231         Return the singleton.
1232
1233         (WTF::MainThreadFunctionTracker::callOnMainThread):
1234         Add the function/context pair to our map and schedule the function to be run on the main thread.
1235         If the function has been removed, don't call it.
1236
1237         (WTF::MainThreadFunctionTracker::cancelCallOnMainThread):
1238         Remove all entries with the given function/context pair.
1239
1240         (WTF::MainThreadFunctionTracker::addFunction):
1241         Add the function/context pair to the map and return the unique identifier.
1242
1243         (WTF::MainThreadFunctionTracker::removeIdentifier):
1244         Look up the identifier and remove it if it still exists. If it exists we know that it hasn't been canceled and that we can call it.
1245
1246         (WTF::MainThreadFunctionTracker::removeFunctions):
1247         Remove all function identifiers matched by the function/context pair.
1248
1249         (WTF::callOnMainThread):
1250         Implement using MainThreadFunctionTracker.
1251
1252         (WTF::cancelCallOnMainThread):
1253         Implement using MainThreadFunctionTracker.
1254
1255 2015-08-21  Anders Carlsson  <andersca@apple.com>
1256
1257         Get rid of uses of the old callOnMainThread function that takes a function ptr + context
1258         https://bugs.webkit.org/show_bug.cgi?id=148324
1259
1260         Reviewed by Tim Horton.
1261
1262         * wtf/text/cf/StringImplCF.cpp:
1263         (WTF::StringWrapperCFAllocator::deallocate):
1264         (WTF::StringWrapperCFAllocator::deallocateOnMainThread): Deleted.
1265
1266 2015-08-20  Commit Queue  <commit-queue@webkit.org>
1267
1268         Unreviewed, rolling out r188717 and r188719.
1269         https://bugs.webkit.org/show_bug.cgi?id=148272
1270
1271         Broke the Mavericks build (Requested by andersca on #webkit).
1272
1273         Reverted changesets:
1274
1275         "Merge Lock and LockBase"
1276         https://bugs.webkit.org/show_bug.cgi?id=148266
1277         http://trac.webkit.org/changeset/188717
1278
1279         "Merge ConditionBase and Condition"
1280         https://bugs.webkit.org/show_bug.cgi?id=148270
1281         http://trac.webkit.org/changeset/188719
1282
1283 2015-08-20  Anders Carlsson  <andersca@apple.com>
1284
1285         Merge ConditionBase and Condition
1286         https://bugs.webkit.org/show_bug.cgi?id=148270
1287
1288         Reviewed by Filip Pizlo.
1289
1290         * wtf/Condition.h:
1291         Direct initialize m_hasWaiters so Condition gets a constexpr constructor.
1292
1293         * wtf/Lock.h:
1294         Remove a now outdated comment.
1295
1296 2015-08-20  Anders Carlsson  <andersca@apple.com>
1297
1298         Merge Lock and LockBase
1299         https://bugs.webkit.org/show_bug.cgi?id=148266
1300
1301         Reviewed by Filip Pizlo.
1302
1303         * wtf/Atomics.h:
1304         (WTF::Atomic::Atomic):
1305         Add a default constructor as well as a constexpr constructor that takes a value.
1306
1307         * wtf/Lock.cpp:
1308         (WTF::Lock::lockSlow):
1309         (WTF::Lock::unlockSlow):
1310         Rename LockBase to Lock.
1311
1312         * wtf/Lock.h:
1313         Rename LockBase to Lock and direct-initialize Atomic to 0. Since the Atomic constructor is constexpr,
1314         Lock also gets a constexpr constructor. Change the LockBase -> StaticLock typedef and add a fixme.
1315
1316         * wtf/WordLock.h:
1317         Direct initialize m_word to 0.
1318
1319 2015-08-19  Filip Pizlo  <fpizlo@apple.com>
1320
1321         Remove WTF::SpinLock
1322         https://bugs.webkit.org/show_bug.cgi?id=148208
1323
1324         Reviewed by Geoffrey Garen.
1325
1326         Remove the SpinLock.h file and remove references to the SpinLock class. Put the old SpinLock
1327         algorithm in LockSpeedTest.cpp - which isn't compiled as part of a WTF or WebKit build - just
1328         so we can still benchmark our locking algorithms against a spinlock baseline.
1329
1330         * WTF.vcxproj/WTF.vcxproj:
1331         * WTF.xcodeproj/project.pbxproj:
1332         * benchmarks/LockSpeedTest.cpp:
1333         * wtf/CMakeLists.txt:
1334         * wtf/Lock.h:
1335         * wtf/SpinLock.h: Removed.
1336         * wtf/WordLock.h:
1337
1338 2015-08-19  Alex Christensen  <achristensen@webkit.org>
1339
1340         CMake Windows build should not include files directly from other Source directories
1341         https://bugs.webkit.org/show_bug.cgi?id=148198
1342
1343         Reviewed by Brent Fulgham.
1344
1345         * wtf/CMakeLists.txt:
1346         * wtf/PlatformWin.cmake:
1347
1348 2015-08-18  Filip Pizlo  <fpizlo@apple.com>
1349
1350         Replace all uses of std::mutex/std::condition_variable with WTF::Lock/WTF::Condition
1351         https://bugs.webkit.org/show_bug.cgi?id=148140
1352
1353         Reviewed by Geoffrey Garen.
1354
1355         Also beef up Condition by giving it a StaticCondition variant.
1356
1357         * wtf/Condition.h:
1358         (WTF::ConditionBase::notifyAll):
1359         (WTF::ConditionBase::waitForSecondsImpl):
1360         (WTF::ConditionBase::absoluteFromRelative):
1361         (WTF::Condition::Condition):
1362         (WTF::Condition::notifyAll): Deleted.
1363         (WTF::Condition::waitForSecondsImpl): Deleted.
1364         (WTF::Condition::absoluteFromRelative): Deleted.
1365         * wtf/CryptographicallyRandomNumber.cpp:
1366         * wtf/HashTable.cpp:
1367         (WTF::HashTableStats::recordCollisionAtCount):
1368         (WTF::HashTableStats::dumpStats):
1369         (WTF::hashTableStatsMutex): Deleted.
1370         * wtf/HashTable.h:
1371         (WTF::KeyTraits>::HashTable):
1372         (WTF::KeyTraits>::invalidateIterators):
1373         (WTF::addIterator):
1374         (WTF::removeIterator):
1375         * wtf/Lock.h:
1376         * wtf/MainThread.cpp:
1377         (WTF::functionQueue):
1378         (WTF::dispatchFunctionsFromMainThread):
1379         (WTF::callOnMainThread):
1380         (WTF::cancelCallOnMainThread):
1381         (WTF::mainThreadFunctionQueueMutex): Deleted.
1382         * wtf/StackStats.cpp:
1383         (WTF::StackStats::PerThreadStats::PerThreadStats):
1384         (WTF::StackStats::CheckPoint::CheckPoint):
1385         (WTF::StackStats::CheckPoint::~CheckPoint):
1386         (WTF::StackStats::probe):
1387         (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
1388         (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint):
1389         (WTF::StackStats::initialize): Deleted.
1390         * wtf/StackStats.h:
1391         (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
1392         (WTF::StackStats::probe):
1393         (WTF::StackStats::initialize): Deleted.
1394         * wtf/ThreadingPthreads.cpp:
1395         (WTF::initializeThreading):
1396         * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
1397         (WTF::callOnMainThread):
1398         (WTF::lockAtomicallyInitializedStaticMutex):
1399         (WTF::unlockAtomicallyInitializedStaticMutex):
1400         (WTF::atomicallyInitializedStaticMutex): Deleted.
1401         * wtf/text/StringView.cpp:
1402         (WTF::StringView::UnderlyingString::UnderlyingString):
1403         (WTF::underlyingStrings):
1404         (WTF::StringView::invalidate):
1405         (WTF::StringView::adoptUnderlyingString):
1406         (WTF::StringView::setUnderlyingString):
1407         (WTF::underlyingStringsMutex): Deleted.
1408         * wtf/unicode/icu/CollatorICU.cpp:
1409         (WTF::Collator::Collator):
1410         (WTF::Collator::~Collator):
1411         (WTF::cachedCollatorMutex): Deleted.
1412
1413 2015-08-18  Zan Dobersek  <zdobersek@igalia.com>
1414
1415         [GLib] GMainLoopSource should receive the std::function<> objects through rvalue references
1416         https://bugs.webkit.org/show_bug.cgi?id=147981
1417
1418         Reviewed by Carlos Garcia Campos.
1419
1420         Scheduling methods on GMainLoopSource and GThreadSafeMainLoopSource should
1421         have the std::function<> objects passed through rvalue references, and should
1422         move the passed-in objects forward when required.
1423
1424         * wtf/glib/GMainLoopSource.cpp:
1425         (WTF::GMainLoopSource::schedule):
1426         (WTF::GMainLoopSource::scheduleAfterDelay):
1427         (WTF::GMainLoopSource::scheduleAndDeleteOnDestroy):
1428         (WTF::GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy):
1429         * wtf/glib/GMainLoopSource.h:
1430         * wtf/glib/GThreadSafeMainLoopSource.cpp:
1431         (WTF::GThreadSafeMainLoopSource::schedule):
1432         (WTF::GThreadSafeMainLoopSource::scheduleAfterDelay):
1433         * wtf/glib/GThreadSafeMainLoopSource.h:
1434
1435 2015-08-18  Eric Carlson  <eric.carlson@apple.com>
1436
1437         Remove "platform text track menu"
1438         https://bugs.webkit.org/show_bug.cgi?id=148139
1439
1440         Reviewed by Jer Noble.
1441
1442         * wtf/Platform.h: Remove PLATFORM_TEXT_TRACK_MENU.
1443
1444 2015-08-18  Filip Pizlo  <fpizlo@apple.com>
1445
1446         WTF::Condition should have a fast path for notifyOne/notifyAll that avoids calling unparkOne/unparkAll
1447         https://bugs.webkit.org/show_bug.cgi?id=148090
1448
1449         Reviewed by Geoffrey Garen.
1450
1451         This change makes notifyOne()/notifyAll() blazing fast when nobody is waiting, by using the
1452         various hooks that ParkingLot gives us to maintain a m_hasWaiters variable. When it's false, it
1453         means that any unpark operation would simply return immediately.
1454
1455         This is a 45% speed-up for the 1-producer/1-consumer scenario with a 100-element queue when you
1456         use the notifyOne()-per-enqueue style. What's cool about this change is that you can now safely
1457         call notifyOne() (or notifyAll()) out of paranoia, just in case someone might be waiting. It's
1458         free to do so if nobody is waiting!
1459
1460         * wtf/Condition.h:
1461         (WTF::Condition::Condition):
1462         (WTF::Condition::waitUntil):
1463         (WTF::Condition::notifyOne):
1464         (WTF::Condition::notifyAll):
1465
1466 2015-08-17  Filip Pizlo  <fpizlo@apple.com>
1467
1468         Replace all remaining uses of WTF::Mutex with WTF::Lock
1469         https://bugs.webkit.org/show_bug.cgi?id=148089
1470
1471         Reviewed by Geoffrey Garen.
1472
1473         This also beefs up and rationalizes the Condition API, so that it can deal with units of time
1474         other than just steady_clock. This makes it easier to port ThreadCondition and
1475         std::condition_variable code over to Condition. This patch does not take a position on what
1476         kind of time is best; from reading a lot of the uses in WebCore, it seems like our use of
1477         double to measure seconds is often nicer than the many different classes in std::chrono.
1478
1479         Also added a Condition speed test, to make sure that all of this is a good idea. And indeed it
1480         is. The 1-producer/1-consumer scenario with a 100-element queue runs 36x faster using
1481         Lock/Condition than Mutex/ThreadCondition when you use the notifyOne()-per-enqueue style. It
1482         runs 58x faster with Lock/Condition when you use the notifyAll()-at-boundary style. Note that
1483         I have a bug open for making the notifyOne()-per-enqueue style even faster:
1484         https://bugs.webkit.org/show_bug.cgi?id=148090. Also, the 10-consumer/10-producer scenario with
1485         a 100-element queue runs 20x faster with Lock/Condition for notifyOne()-per-enqueue and 30x
1486         faster with notifyAll()-at-boundary. The only way to tweak the test to get
1487         Mutex/ThreadCondition to win is to have one producer, one consumer, a 1-element queue, and use
1488         the notifyOne()-per-enqueue style. In that case, one of the two threads is going to be waiting
1489         most of the time and the test basically measures wake-up latency and nothing else. Because
1490         Condition::wait() does a little bit more work than ThreadCondition::wait(),
1491         Mutex/ThreadCondition end up running 3% faster in this test case. But if you vary any of the
1492         parameters of the test, Mutex/ThreadCondition ends up losing - all it takes is more threads or
1493         a queue size of 5 or more. To my knowledge, we never do producer/consumer with a queue bounded
1494         to one element precisely because that approach is the least efficient regardless of locking
1495         algorithm. For example, neither WTF::MessageQueue nor DFG::Worklist have any bounds on their
1496         queue size. So, it seems that replacing all uses of system mutexes and condition variables with
1497         our own thing is a great idea.
1498
1499         * benchmarks/LockSpeedTest.cpp:
1500         * benchmarks/ConditionSpeedTest.cpp: Added.
1501         * wtf/Condition.h:
1502         (WTF::Condition::Condition):
1503         (WTF::Condition::waitUntil):
1504         (WTF::Condition::waitFor):
1505         (WTF::Condition::wait):
1506         (WTF::Condition::waitUntilWallClockSeconds):
1507         (WTF::Condition::waitUntilMonotonicClockSeconds):
1508         (WTF::Condition::notifyOne):
1509         (WTF::Condition::notifyAll):
1510         (WTF::Condition::waitForSecondsImpl):
1511         (WTF::Condition::waitForImpl):
1512         (WTF::Condition::absoluteFromRelative):
1513         * wtf/MessageQueue.h:
1514         (WTF::MessageQueue::infiniteTime):
1515         (WTF::MessageQueue<DataType>::append):
1516         (WTF::MessageQueue<DataType>::appendAndKill):
1517         (WTF::MessageQueue<DataType>::appendAndCheckEmpty):
1518         (WTF::MessageQueue<DataType>::prepend):
1519         (WTF::MessageQueue<DataType>::removeIf):
1520         (WTF::MessageQueue<DataType>::isEmpty):
1521         (WTF::MessageQueue<DataType>::kill):
1522         (WTF::MessageQueue<DataType>::killed):
1523         * wtf/ParallelJobsGeneric.cpp:
1524         (WTF::ParallelEnvironment::ThreadPrivate::execute):
1525         (WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
1526         (WTF::ParallelEnvironment::ThreadPrivate::workerThread):
1527         * wtf/ParallelJobsGeneric.h:
1528         * wtf/ParkingLot.cpp:
1529         (WTF::ParkingLot::parkConditionally):
1530         * wtf/ParkingLot.h:
1531         (WTF::ParkingLot::compareAndPark):
1532         * wtf/ThreadingPthreads.cpp:
1533         (WTF::initializeThreading):
1534         * wtf/ThreadingWin.cpp:
1535         (WTF::initializeThreading):
1536         * wtf/dtoa.cpp:
1537         (WTF::pow5mult):
1538         * wtf/dtoa.h:
1539
1540 2015-08-17  Alex Christensen  <achristensen@webkit.org>
1541
1542         Build Debug Suffix on Windows with CMake
1543         https://bugs.webkit.org/show_bug.cgi?id=148083
1544
1545         Reviewed by Brent Fulgham.
1546
1547         * wtf/PlatformWin.cmake:
1548         Add DEBUG_SUFFIX
1549
1550 2015-08-17  Myles C. Maxfield  <mmaxfield@apple.com>
1551
1552         Implement IntegerHasher
1553         https://bugs.webkit.org/show_bug.cgi?id=147866
1554
1555         Reviewed by Darin Adler and Anders Carlsson.
1556
1557         Rename StringHasher.h to Hasher.h, and include an IntegerHasher class.
1558
1559         * WTF.vcxproj/WTF.vcxproj: Update to target new file.
1560         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
1561         * WTF.xcodeproj/project.pbxproj: Ditto.
1562         * wtf/CMakeLists.txt: Ditto.
1563         * wtf/Hasher.h: Renamed from Source/WTF/wtf/StringHasher.h.
1564         * wtf/text/CString.cpp: Use new #include
1565         * wtf/text/StringHash.h: Ditto.
1566         * wtf/text/StringImpl.h: Ditto.
1567         * wtf/unicode/UTF8.cpp: Ditto.
1568
1569 2015-08-17  Alex Christensen  <achristensen@webkit.org>
1570
1571         Move some commands from ./CMakeLists.txt to Source/cmake
1572         https://bugs.webkit.org/show_bug.cgi?id=148003
1573
1574         Reviewed by Brent Fulgham.
1575
1576         * CMakeLists.txt:
1577         Added commands needed to build WTF by itself.
1578
1579 2015-08-14  Filip Pizlo  <fpizlo@apple.com>
1580
1581         Use WTF::Lock and WTF::Condition instead of WTF::Mutex, WTF::ThreadCondition, std::mutex, and std::condition_variable
1582         https://bugs.webkit.org/show_bug.cgi?id=147999
1583
1584         Reviewed by Geoffrey Garen.
1585
1586         Relanding after fixing a deadlock on Linux.
1587
1588         * wtf/Condition.h: "using WTF::Condition".
1589         * wtf/Lock.h:
1590         (WTF::LockBase::lock):
1591         (WTF::LockBase::tryLock): Add tryLock() because it turns out that we use it sometimes.
1592         (WTF::LockBase::try_lock): unique_lock needs this.
1593         (WTF::LockBase::unlock):
1594         * wtf/ParkingLot.cpp:
1595         (WTF::ParkingLot::parkConditionally): Work around a Linux C++ bug where wait_until with time_point::max() immediately returns and doesn't flash the lock.
1596
1597 2015-08-14  Keith Miller  <keith_miller@apple.com>
1598
1599         cryptographicallyRandomValuesFromOS should use arc4random_buf on Darwin.
1600         https://bugs.webkit.org/show_bug.cgi?id=148038
1601
1602         Reviewed by Geoffrey Garen.
1603
1604         Currently, we open a file descriptor to /dev/urandom, which can sometimes
1605         fail to open. Using arc4random_buf instead should get around this issue.
1606
1607         * wtf/OSRandomSource.cpp:
1608         (WTF::cryptographicallyRandomValuesFromOS):
1609
1610 2015-08-14  Commit Queue  <commit-queue@webkit.org>
1611
1612         Unreviewed, rolling out r188444.
1613         https://bugs.webkit.org/show_bug.cgi?id=148029
1614
1615         Broke GTK and EFL (see bug #148027) (Requested by philn on
1616         #webkit).
1617
1618         Reverted changeset:
1619
1620         "Use WTF::Lock and WTF::Condition instead of WTF::Mutex,
1621         WTF::ThreadCondition, std::mutex, and std::condition_variable"
1622         https://bugs.webkit.org/show_bug.cgi?id=147999
1623         http://trac.webkit.org/changeset/188444
1624
1625 2015-08-13  Filip Pizlo  <fpizlo@apple.com>
1626
1627         Use WTF::Lock and WTF::Condition instead of WTF::Mutex, WTF::ThreadCondition, std::mutex, and std::condition_variable
1628         https://bugs.webkit.org/show_bug.cgi?id=147999
1629
1630         Reviewed by Geoffrey Garen.
1631
1632         * wtf/Condition.h: "using WTF::Condition".
1633         * wtf/Lock.h:
1634         (WTF::LockBase::lock):
1635         (WTF::LockBase::tryLock): Add tryLock() because it turns out that we use it sometimes.
1636         (WTF::LockBase::try_lock): unique_lock needs this.
1637         (WTF::LockBase::unlock):
1638
1639 2015-08-13  Commit Queue  <commit-queue@webkit.org>
1640
1641         Unreviewed, rolling out r188428.
1642         https://bugs.webkit.org/show_bug.cgi?id=148015
1643
1644         broke cmake build (Requested by alexchristensen on #webkit).
1645
1646         Reverted changeset:
1647
1648         "Move some commands from ./CMakeLists.txt to Source/cmake"
1649         https://bugs.webkit.org/show_bug.cgi?id=148003
1650         http://trac.webkit.org/changeset/188428
1651
1652 2015-08-13  Alex Christensen  <achristensen@webkit.org>
1653
1654         Move some commands from ./CMakeLists.txt to Source/cmake
1655         https://bugs.webkit.org/show_bug.cgi?id=148003
1656
1657         Reviewed by Brent Fulgham.
1658
1659         * CMakeLists.txt:
1660         Added commands needed to build WTF by itself.
1661
1662 2015-08-13  Mark Lam  <mark.lam@apple.com>
1663
1664         WorkQueue::dispatchAfter() on Windows fires early.
1665         https://bugs.webkit.org/show_bug.cgi?id=147992
1666
1667         Reviewed by Brent Fulgham.
1668
1669         The Windows implementation of WorkQueue::dispatchAfter() uses CreateTimerQueueTimer().
1670         Unfortunately, CreateTimerQueueTimer() is sloppy and can fire early.  We need to compensate
1671         for this slop to ensure that the specified duration does expire before the callback function
1672         is called.  Otherwise, the JSC watchdog (which depends on this) can fail randomly.
1673
1674         * wtf/win/WorkQueueWin.cpp:
1675         (WTF::WorkQueue::dispatchAfter):
1676
1677 2015-08-13  Filip Pizlo  <fpizlo@apple.com>
1678
1679         WTF should have a compact Condition object to use with Lock
1680         https://bugs.webkit.org/show_bug.cgi?id=147986
1681
1682         Reviewed by Geoffrey Garen.
1683
1684         Adds a condition variable implementation based on ParkingLot, called simply WTF::Condition.
1685         It can be used with WTF::Lock or actually any lock implementation. It should even work with
1686         WTF::SpinLock, WTF::Mutex, or std::mutex. Best of all, Condition only requires one byte.
1687
1688         ParkingLot almost contained all of the functionality needed to implemenet wait/notify. We
1689         could have implemented Condition using a 32-bit (or even 64-bit) version that protects
1690         against a notify that happens just before we park. But, this changes the ParkingLot API to
1691         give us the ability to run some code between when ParkingLot enqueues the current thread
1692         and when it actually sleeps. This callback is called with no locks held, so it can call
1693         unlock() on any kind of lock, so long as that lock's unlock() method doesn't recurse into
1694         ParkingLot::parkConditionally(). That seems unlikely; unlock() is more likely to call
1695         ParkingLot::unparkOne() or unparkAll(). WTF::Lock will never call parkConditionally()
1696         inside unlock(), so WTF::Lock is definitely appropriate for use with Condition.
1697
1698         Condition supports most of the API that std::condition_variable supports. It does some
1699         things to try to reduce footgun potential. The preferred timeout form is waitUntil() which
1700         takes an absolute time from the steady_clock. The only relative timeout form also takes a
1701         predicate callback, so it's impossible to write the subtly incorrect
1702         "while (...) wait_for(...)" idiom.
1703
1704         This patch doesn't actually introduce any uses of WTF::Condition other than the unit tests.
1705         I'll start switching code over to using WTF::Condition in another patch.
1706
1707         * WTF.vcxproj/WTF.vcxproj:
1708         * WTF.xcodeproj/project.pbxproj:
1709         * wtf/CMakeLists.txt:
1710         * wtf/Condition.h: Added.
1711         (WTF::Condition::Condition):
1712         (WTF::Condition::waitUntil):
1713         (WTF::Condition::waitFor):
1714         (WTF::Condition::wait):
1715         (WTF::Condition::notifyOne):
1716         (WTF::Condition::notifyAll):
1717         * wtf/Lock.cpp:
1718         (WTF::LockBase::unlockSlow): Make this useful assertion be a release assertion. It catches cases where you unlock the lock even though you don't hold it.
1719         * wtf/ParkingLot.cpp:
1720         (WTF::ParkingLot::parkConditionally): Add the beforeSleep() callback.
1721         (WTF::ParkingLot::unparkOne):
1722         * wtf/ParkingLot.h:
1723         (WTF::ParkingLot::compareAndPark):
1724
1725 2015-08-12  Anders Carlsson  <andersca@apple.com>
1726
1727         Use WTF::Optional in WindowFeatures
1728         https://bugs.webkit.org/show_bug.cgi?id=147956
1729
1730         Reviewed by Sam Weinig.
1731
1732         Add new operators to WTF::Optional to make it more like std::optional.
1733
1734         * wtf/Optional.h:
1735         (WTF::Optional::operator->):
1736         (WTF::Optional::operator*):
1737
1738 2015-08-12  Filip Pizlo  <fpizlo@apple.com>
1739
1740         WTF::Lock should not suffer from the thundering herd
1741         https://bugs.webkit.org/show_bug.cgi?id=147947
1742
1743         Reviewed by Geoffrey Garen.
1744
1745         This changes Lock::unlockSlow() to use unparkOne() instead of unparkAll(). The problem with
1746         doing this is that it's not obvious after calling unparkOne() if there are any other threads
1747         that are still parked on the lock's queue. If we assume that there are and leave the
1748         hasParkedBit set, then future calls to unlock() will take the slow path. We don't want that
1749         if there aren't actually any threads parked. On the other hand, if we assume that there
1750         aren't any threads parked and clear the hasParkedBit, then if there actually were some
1751         threads parked, then they may never be awoken since future calls to unlock() won't take slow
1752         path and so won't call unparkOne(). In other words, we need a way to be very precise about
1753         when we clear the hasParkedBit and we need to do it in a race-free way: it can't be the case
1754         that we clear the bit just as some thread gets parked on the queue.
1755
1756         A similar problem arises in futexes, and one of the solutions is to have a thread that
1757         acquires a lock after parking sets the hasParkedBit. This is what Rusty Russel's usersem
1758         does. It's a subtle algorithm. Also, it means that if a thread barges in before the unparked
1759         thread runs, then that barging thread will not know that there are threads parked. This
1760         could increase the severity of barging.
1761
1762         Since ParkingLot is a user-level API, we don't have to worry about the kernel-user security
1763         issues and so we can expose callbacks while ParkingLot is holding its internal locks. This
1764         change does exactly that for unparkOne(). The new variant of unparkOne() will call a user
1765         function while the queue from which we are unparking is locked. The callback is told basic
1766         stats about the queue: did we unpark a thread this time, and could there be more threads to
1767         unpark in the future. The callback runs while it's impossible for the queue state to change,
1768         since the ParkingLot's internal locks for the queue is held. This means that
1769         Lock::unlockSlow() can either clear, or leave, the hasParkedBit while releasing the lock
1770         inside the callback from unparkOne(). This takes care of the thundering herd problem while
1771         also reducing the greed that arises from barging threads.
1772
1773         This required some careful reworking of the ParkingLot algorithm. The first thing I noticed
1774         was that the ThreadData::shouldPark flag was useless, since it's set exactly when
1775         ThreadData::address is non-null. Then I had to make sure that dequeue() could lazily create
1776         both hashtables and buckets, since the "callback is called while queue is locked" invariant
1777         requires that we didn't exit early due to the hashtable or bucket not being present. Note
1778         that all of this is done in such a way that the old unparkOne() and unparkAll() don't have
1779         to create any buckets, though they now may create the hashtable. We don't care as much about
1780         the hashtable being created by unpark since it's just such an unlikely scenario and it would
1781         only happen once.
1782
1783         This change reduces the kernel CPU usage of WTF::Lock for the long critical section test by
1784         about 8x and makes it always perform as well as WTF::WordLock and WTF::Mutex for that
1785         benchmark.
1786
1787         * benchmarks/LockSpeedTest.cpp:
1788         * wtf/Lock.cpp:
1789         (WTF::LockBase::unlockSlow):
1790         * wtf/Lock.h:
1791         (WTF::LockBase::isLocked):
1792         (WTF::LockBase::isFullyReset):
1793         * wtf/ParkingLot.cpp:
1794         (WTF::ParkingLot::parkConditionally):
1795         (WTF::ParkingLot::unparkOne):
1796         (WTF::ParkingLot::unparkAll):
1797         * wtf/ParkingLot.h:
1798         * wtf/WordLock.h:
1799         (WTF::WordLock::isLocked):
1800         (WTF::WordLock::isFullyReset):
1801
1802 2015-08-11  Filip Pizlo  <fpizlo@apple.com>
1803
1804         Always use a byte-sized lock implementation
1805         https://bugs.webkit.org/show_bug.cgi?id=147908
1806
1807         Reviewed by Geoffrey Garen.
1808
1809         At the start of my locking algorithm crusade, I implemented Lock, which is a sizeof(void*)
1810         lock implementation with some nice theoretical properties and good performance. Then I added
1811         the ParkingLot abstraction and ByteLock. ParkingLot uses Lock in its implementation.
1812         ByteLock uses ParkingLot to create a sizeof(char) lock implementation that performs like
1813         Lock.
1814
1815         It turns out that ByteLock is always at least as good as Lock, and sometimes a lot better:
1816         it requires 8x less memory on 64-bit systems. It's hard to construct a benchmark where
1817         ByteLock is significantly slower than Lock, and when you do construct such a benchmark,
1818         tweaking it a bit can also create a scenario where ByteLock is significantly faster than
1819         Lock.
1820
1821         So, the thing that we call "Lock" should really use ByteLock's algorithm, since it is more
1822         compact and just as fast. That's what this patch does.
1823
1824         But we still need to keep the old Lock algorithm, because it's used to implement ParkingLot,
1825         which in turn is used to implement ByteLock. So this patch does this transformation:
1826
1827         - Move the algorithm in Lock into files called WordLock.h|cpp. Make ParkingLot use
1828           WordLock.
1829
1830         - Move the algorithm in ByteLock into Lock.h|cpp. Make everyone who used ByteLock use Lock
1831           instead. All other users of Lock now get the byte-sized lock implementation.
1832
1833         - Remove the old ByteLock files.
1834
1835         * WTF.vcxproj/WTF.vcxproj:
1836         * WTF.xcodeproj/project.pbxproj:
1837         * benchmarks/LockSpeedTest.cpp:
1838         (main):
1839         * wtf/WordLock.cpp: Added.
1840         (WTF::WordLock::lockSlow):
1841         (WTF::WordLock::unlockSlow):
1842         * wtf/WordLock.h: Added.
1843         (WTF::WordLock::WordLock):
1844         (WTF::WordLock::lock):
1845         (WTF::WordLock::unlock):
1846         (WTF::WordLock::isHeld):
1847         (WTF::WordLock::isLocked):
1848         * wtf/ByteLock.cpp: Removed.
1849         * wtf/ByteLock.h: Removed.
1850         * wtf/CMakeLists.txt:
1851         * wtf/Lock.cpp:
1852         (WTF::LockBase::lockSlow):
1853         (WTF::LockBase::unlockSlow):
1854         * wtf/Lock.h:
1855         (WTF::LockBase::lock):
1856         (WTF::LockBase::unlock):
1857         (WTF::LockBase::isHeld):
1858         (WTF::LockBase::isLocked):
1859         (WTF::Lock::Lock):
1860         * wtf/ParkingLot.cpp:
1861
1862 2015-08-11  Filip Pizlo  <fpizlo@apple.com>
1863
1864         Remove ByteSpinLock
1865         https://bugs.webkit.org/show_bug.cgi?id=147900
1866
1867         Rubber stamped by Mark Lam.
1868
1869         * WTF.xcodeproj/project.pbxproj:
1870         * wtf/ByteSpinLock.h: Removed.
1871
1872 2015-08-11  Brent Fulgham  <bfulgham@apple.com>
1873
1874         [Win] Switch Windows build to Visual Studio 2015
1875         https://bugs.webkit.org/show_bug.cgi?id=147887
1876         <rdar://problem/22235098>
1877
1878         Reviewed by Alex Christensen.
1879
1880         Update Visual Studio project file settings to use the current Visual
1881         Studio and compiler. Continue targeting binaries to run on our minimum
1882         supported configuration of Windows 7.
1883
1884         * WTF.vcxproj/WTF.vcxproj:
1885         * WTF.vcxproj/WTFGenerated.vcxproj:
1886
1887 2015-08-10  Filip Pizlo  <fpizlo@apple.com>
1888
1889         WTF should have a ParkingLot for parking sleeping threads, so that locks can fit in 1.6 bits
1890         https://bugs.webkit.org/show_bug.cgi?id=147665
1891
1892         Reviewed by Mark Lam.
1893
1894         This change adds a major new abstraction for concurrency algorithms in WebKit. It's called a
1895         ParkingLot, and it makes available a thread parking queue for each virtual address in memory.
1896         The queues are maintained by a data-access-parallel concurrent hashtable implementation. The
1897         memory usage is bounded at around half a KB per thread.
1898
1899         The ParkingLot makes it easy to turn any spinlock-based concurrency protocol into one that
1900         parks threads after a while. Because queue state management is up to the ParkingLot and not
1901         the user's data structure, this patch uses it to implement a full adaptive mutex in one byte.
1902         In fact, only three states of that byte are used (0 = available, 1 = locked, 2 = locked and
1903         there are parked threads). Hence the joke that ParkingLot allows locks that fit in 1.6 bits.
1904
1905         ByteLock is used as a replacement for ByteSpinLock in JavaScriptCore.
1906
1907         The API tests for this also demo how to create a completely fair (FIFO) binary semamphore. The
1908         comment in Lock.h shows how we could accelerate Lock performance using ParkingLot. After we
1909         are sure that this code works, we can expand the use of ParkingLot. That's covered by
1910         https://bugs.webkit.org/show_bug.cgi?id=147841.
1911
1912         * WTF.vcxproj/WTF.vcxproj:
1913         * WTF.xcodeproj/project.pbxproj:
1914         * benchmarks/LockSpeedTest.cpp:
1915         (main):
1916         * wtf/Atomics.h:
1917         (WTF::Atomic::compareExchangeWeak):
1918         (WTF::Atomic::compareExchangeStrong):
1919         * wtf/ByteLock.cpp: Added.
1920         (WTF::ByteLock::lockSlow):
1921         (WTF::ByteLock::unlockSlow):
1922         * wtf/ByteLock.h: Added.
1923         (WTF::ByteLock::ByteLock):
1924         (WTF::ByteLock::lock):
1925         (WTF::ByteLock::unlock):
1926         (WTF::ByteLock::isHeld):
1927         (WTF::ByteLock::isLocked):
1928         * wtf/CMakeLists.txt:
1929         * wtf/Lock.h:
1930         * wtf/ParkingLot.cpp: Added.
1931         (WTF::ParkingLot::parkConditionally):
1932         (WTF::ParkingLot::unparkOne):
1933         (WTF::ParkingLot::unparkAll):
1934         (WTF::ParkingLot::forEach):
1935         * wtf/ParkingLot.h: Added.
1936         (WTF::ParkingLot::compareAndPark):
1937
1938 2015-08-11  Brent Fulgham  <bfulgham@apple.com>
1939
1940         [Win] Unreviewed gardening.
1941
1942         * WTF.vcxproj/WTF.vcxproj.filters: Place file references so that files appear in correct
1943         folders in IDE.
1944
1945 2015-08-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1946
1947         Compile warning (-Wsign-compare) on 32-bits at WebCore/platform/FileSystem.cpp
1948         https://bugs.webkit.org/show_bug.cgi?id=146414
1949
1950         Reviewed by Darin Adler.
1951
1952         Added convertSafely routine based on isInBounds routine.
1953         Updated BoundChecker by adding a third boolean parameter to this template giving whether Target has greater or equal precision than Source.
1954         Removed BoundCheckElider, which is no longer necessary and had some issues.
1955
1956         * wtf/CheckedArithmetic.h:
1957         (WTF::isInBounds):
1958         (WTF::convertSafely):
1959
1960 2015-08-07  Filip Pizlo  <fpizlo@apple.com>
1961
1962         Lightweight locks should be adaptive
1963         https://bugs.webkit.org/show_bug.cgi?id=147545
1964
1965         Reviewed by Geoffrey Garen.
1966
1967         A common idiom in WebKit is to use spinlocks. We use them because the lock acquisition
1968         overhead is lower than system locks and because they take dramatically less space than system
1969         locks. The speed and space advantages of spinlocks can be astonishing: an uncontended spinlock
1970         acquire is up to 10x faster and under microcontention - short critical section with two or
1971         more threads taking turns - spinlocks are up to 100x faster. Spinlocks take only 1 byte or 4
1972         bytes depending on the flavor, while system locks take 64 bytes or more. Clearly, WebKit
1973         should continue to avoid system locks - they are just far too slow and far too big.
1974
1975         But there is a problem with this idiom. System lock implementations will sleep a thread when
1976         it attempts to acquire a lock that is held, while spinlocks will cause the thread to burn CPU.
1977         In WebKit spinlocks, the thread will repeatedly call sched_yield(). This is awesome for
1978         microcontention, but awful when the lock will not be released for a while. In fact, when
1979         critical sections take tens of microseconds or more, the CPU time cost of our spinlocks is
1980         almost 100x more than the CPU time cost of a system lock. This case doesn't arise too
1981         frequently in our current uses of spinlocks, but that's probably because right now there are
1982         places where we make a conscious decision to use system locks - even though they use more
1983         memory and are slower - because we don't want to waste CPU cycles when a thread has to wait a
1984         while to acquire the lock.
1985
1986         The solution is to just implement a modern adaptive mutex in WTF. Luckily, this isn't a new
1987         concept. This patch implements a mutex that is reminiscent of the kinds of low-overhead locks
1988         that JVMs use. The actual implementation here is inspired by some of the ideas from [1]. The
1989         idea is simple: the fast path is an inlined CAS to immediately acquire a lock that isn't held,
1990         the slow path tries some number of spins to acquire the lock, and if that fails, the thread is
1991         put on a queue and put to sleep. The queue is made up of statically allocated thread nodes and
1992         the lock itself is a tagged pointer: either it is just bits telling us the complete lock state
1993         (not held or held) or it is a pointer to the head of a queue of threads waiting to acquire the
1994         lock. This approach gives WTF::Lock three different levels of adaptation: an inlined fast path
1995         if the lock is not contended, a short burst of spinning for microcontention, and a full-blown
1996         queue for critical sections that are held for a long time.
1997
1998         On a locking microbenchmark, this new Lock exhibits the following performance
1999         characteristics:
2000
2001         - Lock+unlock on an uncontended no-op critical section: 2x slower than SpinLock and 3x faster
2002           than a system mutex.
2003
2004         - Lock+unlock on a contended no-op critical section: 2x slower than SpinLock and 100x faster
2005           than a system mutex.
2006
2007         - CPU time spent in lock() on a lock held for a while: same as system mutex, 90x less than a
2008           SpinLock.
2009
2010         - Memory usage: sizeof(void*), so on 64-bit it's 8x less than a system mutex but 2x worse than
2011           a SpinLock.
2012
2013         This patch replaces all uses of SpinLock with Lock, since our critical sections are not
2014         no-ops so if you do basically anything in your critical section, the Lock overhead will be
2015         invisible. Also, in all places where we used SpinLock, we could tolerate 8 bytes of overhead
2016         instead of 4. Performance benchmarking using JSC macrobenchmarks shows no difference, which is
2017         as it should be: the purpose of this change is to reduce CPU time wasted, not wallclock time.
2018         This patch doesn't replace any uses of ByteSpinLock, since we expect that the space benefits
2019         of having a lock that just uses a byte are still better than the CPU wastage benefits of
2020         Lock. But, this work will enable some future work to create locks that will fit in just 1.6
2021         bits: https://bugs.webkit.org/show_bug.cgi?id=147665.
2022         
2023         Rolling this back in after fixing Lock::unlockSlow() for architectures that have a truly weak
2024         CAS. Since the Lock::unlock() fast path can go to slow path spuriously, it may go there even if
2025         there aren't any threads on the Lock's queue. So, unlockSlow() must be able to deal with the
2026         possibility of a null queue head.
2027
2028         [1] http://www.filpizlo.com/papers/pizlo-pppj2011-fable.pdf
2029
2030         * WTF.vcxproj/WTF.vcxproj:
2031         * WTF.xcodeproj/project.pbxproj:
2032         * benchmarks: Added.
2033         * benchmarks/LockSpeedTest.cpp: Added.
2034         (main):
2035         * wtf/Atomics.h:
2036         (WTF::Atomic::compareExchangeWeak):
2037         (WTF::Atomic::compareExchangeStrong):
2038         * wtf/CMakeLists.txt:
2039         * wtf/Lock.cpp: Added.
2040         (WTF::LockBase::lockSlow):
2041         (WTF::LockBase::unlockSlow):
2042         * wtf/Lock.h: Added.
2043         (WTF::LockBase::lock):
2044         (WTF::LockBase::unlock):
2045         (WTF::LockBase::isHeld):
2046         (WTF::LockBase::isLocked):
2047         (WTF::Lock::Lock):
2048         * wtf/MetaAllocator.cpp:
2049         (WTF::MetaAllocator::release):
2050         (WTF::MetaAllocatorHandle::shrink):
2051         (WTF::MetaAllocator::allocate):
2052         (WTF::MetaAllocator::currentStatistics):
2053         (WTF::MetaAllocator::addFreshFreeSpace):
2054         (WTF::MetaAllocator::debugFreeSpaceSize):
2055         * wtf/MetaAllocator.h:
2056         * wtf/SpinLock.h:
2057         * wtf/ThreadingPthreads.cpp:
2058         * wtf/ThreadingWin.cpp:
2059         * wtf/text/AtomicString.cpp:
2060         * wtf/text/AtomicStringImpl.cpp:
2061         (WTF::AtomicStringTableLocker::AtomicStringTableLocker):
2062
2063 2015-08-05  Filip Pizlo  <fpizlo@apple.com>
2064
2065         Unreviewed, roll out http://trac.webkit.org/changeset/187972.
2066
2067         * wtf/Atomics.cpp:
2068         (WTF::getSwapLock):
2069         (WTF::atomicStep):
2070         * wtf/MessageQueue.h:
2071         (WTF::MessageQueue::infiniteTime):
2072         (WTF::MessageQueue<DataType>::append):
2073         (WTF::MessageQueue<DataType>::appendAndKill):
2074         (WTF::MessageQueue<DataType>::appendAndCheckEmpty):
2075         (WTF::MessageQueue<DataType>::prepend):
2076         (WTF::MessageQueue<DataType>::removeIf):
2077         (WTF::MessageQueue<DataType>::isEmpty):
2078         (WTF::MessageQueue<DataType>::kill):
2079         (WTF::MessageQueue<DataType>::killed):
2080         * wtf/ParallelJobsGeneric.cpp:
2081         (WTF::ParallelEnvironment::ThreadPrivate::execute):
2082         (WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
2083         (WTF::ParallelEnvironment::ThreadPrivate::workerThread):
2084         * wtf/ParallelJobsGeneric.h:
2085         * wtf/RunLoop.cpp:
2086         (WTF::RunLoop::performWork):
2087         (WTF::RunLoop::dispatch):
2088         * wtf/RunLoop.h:
2089         * wtf/ThreadSpecificWin.cpp:
2090         (WTF::destructorsList):
2091         (WTF::destructorsMutex):
2092         (WTF::threadSpecificKeyCreate):
2093         (WTF::threadSpecificKeyDelete):
2094         (WTF::ThreadSpecificThreadExit):
2095         * wtf/Threading.cpp:
2096         (WTF::threadEntryPoint):
2097         (WTF::createThread):
2098         * wtf/ThreadingPrimitives.h:
2099         * wtf/ThreadingPthreads.cpp:
2100         (WTF::threadMapMutex):
2101         (WTF::initializeThreading):
2102         (WTF::identifierByPthreadHandle):
2103         (WTF::establishIdentifierForPthreadHandle):
2104         (WTF::changeThreadPriority):
2105         (WTF::waitForThreadCompletion):
2106         (WTF::detachThread):
2107         (WTF::threadDidExit):
2108         (WTF::currentThread):
2109         (WTF::Mutex::Mutex):
2110         (WTF::Mutex::~Mutex):
2111         (WTF::Mutex::lock):
2112         (WTF::Mutex::tryLock):
2113         (WTF::Mutex::unlock):
2114         (WTF::ThreadCondition::~ThreadCondition):
2115         (WTF::ThreadCondition::wait):
2116         (WTF::ThreadCondition::timedWait):
2117         (WTF::DeprecatedMutex::DeprecatedMutex): Deleted.
2118         (WTF::DeprecatedMutex::~DeprecatedMutex): Deleted.
2119         (WTF::DeprecatedMutex::lock): Deleted.
2120         (WTF::DeprecatedMutex::tryLock): Deleted.
2121         (WTF::DeprecatedMutex::unlock): Deleted.
2122         * wtf/ThreadingWin.cpp:
2123         (WTF::initializeCurrentThreadInternal):
2124         (WTF::threadMapMutex):
2125         (WTF::initializeThreading):
2126         (WTF::storeThreadHandleByIdentifier):
2127         (WTF::threadHandleForIdentifier):
2128         (WTF::clearThreadHandleForIdentifier):
2129         (WTF::currentThread):
2130         (WTF::Mutex::Mutex):
2131         (WTF::Mutex::~Mutex):
2132         (WTF::Mutex::lock):
2133         (WTF::Mutex::tryLock):
2134         (WTF::Mutex::unlock):
2135         (WTF::ThreadCondition::~ThreadCondition):
2136         (WTF::ThreadCondition::wait):
2137         (WTF::ThreadCondition::timedWait):
2138         (WTF::DeprecatedMutex::DeprecatedMutex): Deleted.
2139         (WTF::DeprecatedMutex::~DeprecatedMutex): Deleted.
2140         (WTF::DeprecatedMutex::lock): Deleted.
2141         (WTF::DeprecatedMutex::tryLock): Deleted.
2142         (WTF::DeprecatedMutex::unlock): Deleted.
2143         * wtf/WorkQueue.h:
2144         * wtf/dtoa.cpp:
2145         * wtf/dtoa.h:
2146         * wtf/efl/DispatchQueueEfl.cpp:
2147         (DispatchQueue::dispatch):
2148         (DispatchQueue::performWork):
2149         (DispatchQueue::performTimerWork):
2150         (DispatchQueue::insertTimerWorkItem):
2151         (DispatchQueue::wakeUpThread):
2152         (DispatchQueue::getNextTimeOut):
2153         * wtf/efl/DispatchQueueEfl.h:
2154         * wtf/efl/RunLoopEfl.cpp:
2155         (WTF::RunLoop::wakeUpEvent):
2156         (WTF::RunLoop::wakeUp):
2157         * wtf/threads/BinarySemaphore.cpp:
2158         (WTF::BinarySemaphore::signal):
2159         (WTF::BinarySemaphore::wait):
2160         * wtf/threads/BinarySemaphore.h:
2161         * wtf/win/WorkQueueWin.cpp:
2162         (WTF::WorkQueue::handleCallback):
2163         (WTF::WorkQueue::platformInvalidate):
2164         (WTF::WorkQueue::dispatch):
2165         (WTF::WorkQueue::timerCallback):
2166         (WTF::WorkQueue::dispatchAfter):
2167
2168 2015-08-05  Filip Pizlo  <fpizlo@apple.com>
2169
2170         Unreviewed, fix Windows.
2171
2172         * wtf/ThreadSpecificWin.cpp:
2173         (WTF::destructorsList):
2174         (WTF::destructorsMutex):
2175         (WTF::threadSpecificKeyCreate):
2176         (WTF::threadSpecificKeyDelete):
2177         (WTF::ThreadSpecificThreadExit):
2178
2179 2015-08-04  Filip Pizlo  <fpizlo@apple.com>
2180
2181         Rename Mutex to DeprecatedMutex
2182         https://bugs.webkit.org/show_bug.cgi?id=147675
2183
2184         Reviewed by Geoffrey Garen.
2185
2186         * wtf/Atomics.cpp:
2187         (WTF::getSwapLock):
2188         (WTF::atomicStep):
2189         * wtf/MessageQueue.h:
2190         (WTF::MessageQueue::infiniteTime):
2191         (WTF::MessageQueue<DataType>::append):
2192         (WTF::MessageQueue<DataType>::appendAndKill):
2193         (WTF::MessageQueue<DataType>::appendAndCheckEmpty):
2194         (WTF::MessageQueue<DataType>::prepend):
2195         (WTF::MessageQueue<DataType>::removeIf):
2196         (WTF::MessageQueue<DataType>::isEmpty):
2197         (WTF::MessageQueue<DataType>::kill):
2198         (WTF::MessageQueue<DataType>::killed):
2199         * wtf/ParallelJobsGeneric.cpp:
2200         (WTF::ParallelEnvironment::ThreadPrivate::execute):
2201         (WTF::ParallelEnvironment::ThreadPrivate::waitForFinish):
2202         (WTF::ParallelEnvironment::ThreadPrivate::workerThread):
2203         * wtf/ParallelJobsGeneric.h:
2204         * wtf/RunLoop.cpp:
2205         (WTF::RunLoop::performWork):
2206         (WTF::RunLoop::dispatch):
2207         * wtf/RunLoop.h:
2208         * wtf/Threading.cpp:
2209         (WTF::threadEntryPoint):
2210         (WTF::createThread):
2211         * wtf/ThreadingPrimitives.h:
2212         * wtf/ThreadingPthreads.cpp:
2213         (WTF::threadMapMutex):
2214         (WTF::initializeThreading):
2215         (WTF::identifierByPthreadHandle):
2216         (WTF::establishIdentifierForPthreadHandle):
2217         (WTF::changeThreadPriority):
2218         (WTF::waitForThreadCompletion):
2219         (WTF::detachThread):
2220         (WTF::threadDidExit):
2221         (WTF::currentThread):
2222         (WTF::DeprecatedMutex::DeprecatedMutex):
2223         (WTF::DeprecatedMutex::~DeprecatedMutex):
2224         (WTF::DeprecatedMutex::lock):
2225         (WTF::DeprecatedMutex::tryLock):
2226         (WTF::DeprecatedMutex::unlock):
2227         (WTF::ThreadCondition::~ThreadCondition):
2228         (WTF::ThreadCondition::wait):
2229         (WTF::ThreadCondition::timedWait):
2230         (WTF::Mutex::Mutex): Deleted.
2231         (WTF::Mutex::~Mutex): Deleted.
2232         (WTF::Mutex::lock): Deleted.
2233         (WTF::Mutex::tryLock): Deleted.
2234         (WTF::Mutex::unlock): Deleted.
2235         * wtf/ThreadingWin.cpp:
2236         (WTF::initializeCurrentThreadInternal):
2237         (WTF::threadMapMutex):
2238         (WTF::initializeThreading):
2239         (WTF::storeThreadHandleByIdentifier):
2240         (WTF::threadHandleForIdentifier):
2241         (WTF::clearThreadHandleForIdentifier):
2242         (WTF::currentThread):
2243         (WTF::DeprecatedMutex::DeprecatedMutex):
2244         (WTF::DeprecatedMutex::~DeprecatedMutex):
2245         (WTF::DeprecatedMutex::lock):
2246         (WTF::DeprecatedMutex::tryLock):
2247         (WTF::DeprecatedMutex::unlock):
2248         (WTF::ThreadCondition::~ThreadCondition):
2249         (WTF::ThreadCondition::wait):
2250         (WTF::ThreadCondition::timedWait):
2251         (WTF::Mutex::Mutex): Deleted.
2252         (WTF::Mutex::~Mutex): Deleted.
2253         (WTF::Mutex::lock): Deleted.
2254         (WTF::Mutex::tryLock): Deleted.
2255         (WTF::Mutex::unlock): Deleted.
2256         * wtf/WorkQueue.h:
2257         * wtf/dtoa.cpp:
2258         * wtf/dtoa.h:
2259         * wtf/efl/DispatchQueueEfl.cpp:
2260         (DispatchQueue::dispatch):
2261         (DispatchQueue::performWork):
2262         (DispatchQueue::performTimerWork):
2263         (DispatchQueue::insertTimerWorkItem):
2264         (DispatchQueue::wakeUpThread):
2265         (DispatchQueue::getNextTimeOut):
2266         * wtf/efl/DispatchQueueEfl.h:
2267         * wtf/efl/RunLoopEfl.cpp:
2268         (WTF::RunLoop::wakeUpEvent):
2269         (WTF::RunLoop::wakeUp):
2270         * wtf/threads/BinarySemaphore.cpp:
2271         (WTF::BinarySemaphore::signal):
2272         (WTF::BinarySemaphore::wait):
2273         * wtf/threads/BinarySemaphore.h:
2274         * wtf/win/WorkQueueWin.cpp:
2275         (WTF::WorkQueue::handleCallback):
2276         (WTF::WorkQueue::platformInvalidate):
2277         (WTF::WorkQueue::dispatch):
2278         (WTF::WorkQueue::timerCallback):
2279         (WTF::WorkQueue::dispatchAfter):
2280
2281 2015-08-04  Alex Christensen  <achristensen@webkit.org>
2282
2283         Fix quirks with CMake and VS2015
2284         https://bugs.webkit.org/show_bug.cgi?id=147663
2285
2286         Reviewed by Brent Fulgham.
2287
2288         * wtf/Platform.h:
2289         Build fix after r187908
2290
2291 2015-08-04  Brent Fulgham  <bfulgham@apple.com>
2292
2293         [Win] Update Apple Windows build for VS2015
2294         https://bugs.webkit.org/show_bug.cgi?id=147653
2295
2296         Reviewed by Dean Jackson.
2297
2298         * WTF.vcxproj/WTF.vcxproj.filters: Drive-by-fix to place files in
2299         proper project locations in the IDE.
2300         * wtf/Platform.h: Don't define the _HAS_EXCEPTIONS macro when building with
2301         Visual Studio 2015.
2302
2303 2015-08-04  Commit Queue  <commit-queue@webkit.org>
2304
2305         Unreviewed, rolling out r187815 and r187817.
2306         https://bugs.webkit.org/show_bug.cgi?id=147644
2307
2308         Caused lots of Windows crashes (Requested by smfr on #webkit).
2309
2310         Reverted changesets:
2311
2312         "[WTF] Turn tryMakeString(), makeString() into variadic
2313         templates"
2314         https://bugs.webkit.org/show_bug.cgi?id=147142
2315         http://trac.webkit.org/changeset/187815
2316
2317         "Unreviewed build fix."
2318         http://trac.webkit.org/changeset/187817
2319
2320 2015-08-04  Alex Christensen  <achristensen@webkit.org>
2321
2322         Enable WebGL on Windows CMake build.
2323         https://bugs.webkit.org/show_bug.cgi?id=143311
2324
2325         Reviewed by Csaba Osztrogonác.
2326
2327         * wtf/FeatureDefines.h:
2328         Made the CMake feature defines the same as the non-CMake feature defines.
2329
2330 2015-08-03  Csaba Osztrogonác  <ossy@webkit.org>
2331
2332         Introduce COMPILER(GCC_OR_CLANG) guard and make COMPILER(GCC) true only for GCC
2333         https://bugs.webkit.org/show_bug.cgi?id=146833
2334
2335         Reviewed by Alexey Proskuryakov.
2336
2337         * wtf/Assertions.cpp:
2338         * wtf/Assertions.h: Removed redundant COMPILER(CLANG) guard.
2339         * wtf/Atomics.cpp:
2340         * wtf/Atomics.h:
2341         (WTF::weakCompareAndSwap):
2342         (WTF::compilerFence):
2343         * wtf/Compiler.h:
2344          - Renamed COMPILER(GCC) to COMPILER(GCC_OR_CLANG), because it is true for both compiler.
2345          - Added COMPILER(GCC) which is true only for GCC.
2346          - Moved all GCC related stuff to one block and removed redundant guards accordingly.
2347          - Removed the unused default false definition of GCC_VERSION_AT_LEAST for non GCC compilers.
2348         * wtf/ExportMacros.h:
2349         * wtf/FastMalloc.h:
2350         * wtf/Platform.h:
2351         * wtf/StdLibExtras.h:
2352         * wtf/Vector.h:
2353         * wtf/text/ASCIIFastPath.h:
2354         (WTF::copyLCharsFromUCharSource):
2355
2356 2015-08-03  Zan Dobersek  <zdobersek@igalia.com>
2357
2358         Unreviewed build fix.
2359
2360         * wtf/text/StringConcatenate.h: Include <tuple> to avoid missing
2361         std::tuple<> class definitions.
2362
2363 2015-08-03  Zan Dobersek  <zdobersek@igalia.com>
2364
2365         [WTF] Turn tryMakeString(), makeString() into variadic templates
2366         https://bugs.webkit.org/show_bug.cgi?id=147142
2367
2368         Reviewed by Sam Weinig.
2369
2370         Built upon the original work by Anders Carlsson, Mark Rowe and Sam Weinig.
2371
2372         Implement tryMakeString() and makeString() as variadic templates, replacing
2373         the argument count-based overloads.
2374
2375         tryMakeString() now constructs a stack-based tuple of necessary StringTypeAdapter
2376         objects and utilizes the StringAdapterTuple struct template to operate on that
2377         tuple, recursively calling the necessary operations on each element in the tuple.
2378         This effectively mimics the process of previous tryMakeString() implementation,
2379         but makes it scalable to a tuple of elements that are to be concatenated.
2380
2381         StringAppend class template now stores two StringTypeAdapter objects for the
2382         two passed-in string objects, packed in a tuple, calling
2383         StringAdapterTuple<>::createString() directly when concatenating the two objects
2384         into one String.
2385
2386         * wtf/text/StringConcatenate.h:
2387         (WTF::StringTypeAdapter<char>::length):
2388         (WTF::StringTypeAdapter<char>::is8Bit):
2389         (WTF::StringAdapterTuple::sumWithOverflow):
2390         (WTF::StringAdapterTuple::is8Bit):
2391         (WTF::StringAdapterTuple::writeTo):
2392         (WTF::StringAdapterTuple::createString):
2393         (WTF::tryMakeString):
2394         (WTF::makeString):
2395         (WTF::sumWithOverflow): Deleted.
2396         * wtf/text/StringOperators.h:
2397         (WTF::StringAppend::StringAppend):
2398         (WTF::StringAppend::operator String):
2399         (WTF::StringAppend::is8Bit):
2400         (WTF::StringAppend::writeTo):
2401         (WTF::StringAppend::length):
2402         (WTF::StringAppend::string1):
2403         (WTF::StringAppend::string2):
2404
2405 2015-08-03  Anders Carlsson  <andersca@apple.com>
2406
2407         Make it possible to use String::utf8() in the debugger
2408         https://bugs.webkit.org/show_bug.cgi?id=147566
2409
2410         Reviewed by Tim Horton.
2411
2412         Add a new utf8() overload that doesn't take any parameters and just calls utf8(LenientConversion), since lldb doesn't support evaluating
2413         function calls with default parameters at the moment.
2414
2415         * wtf/text/WTFString.cpp:
2416         (WTF::String::utf8):
2417         * wtf/text/WTFString.h:
2418
2419 2015-08-02  Benjamin Poulain  <bpoulain@apple.com>
2420
2421         Investigate HashTable::HashTable(const HashTable&) and HashTable::operator=(const HashTable&) performance for hash-based static analyses
2422         https://bugs.webkit.org/show_bug.cgi?id=118455
2423
2424         Reviewed by Filip Pizlo.
2425
2426         Previously, when copying a HashTable, we would start from scratch
2427         with an empty table and insert elements one by one, growing-rehashing
2428         the table as needed.
2429
2430         With this patch, we have 2 improvements to remove most of the cost.
2431
2432         First, we compute a good size from the start. This removes all the
2433         reallocations and rehashs.
2434         This is where the biggest gain comes from.
2435
2436         The second part is a simpler version of add() when we know that
2437         we cannot find a bucket with the same key and there cannot
2438         be any deleted bucket.
2439         This removes most branches from the hot loop, cutting another 25%
2440         of the time.
2441
2442         * wtf/HashTable.h:
2443         (WTF::KeyTraits>::addUniqueForInitialization):
2444         (WTF::KeyTraits>::HashTable):
2445
2446 2015-08-01  Myles C. Maxfield  <mmaxfield@apple.com>
2447
2448         HashTraits<AtomicString> can use SimpleClassHashTraits
2449         https://bugs.webkit.org/show_bug.cgi?id=147528
2450
2451         Reviewed by Andreas Kling.
2452
2453         No point in duplicating the code inside SimpleClassHashTraits.
2454
2455         * wtf/text/AtomicStringHash.h:
2456         (WTF::HashTraits<WTF::AtomicString>::constructDeletedValue): Deleted.
2457         (WTF::HashTraits<WTF::AtomicString>::isDeletedValue): Deleted.
2458
2459 2015-08-01  Alex Christensen  <achristensen@webkit.org>
2460
2461         Fix compile errors with VS2015
2462         https://bugs.webkit.org/show_bug.cgi?id=147526
2463
2464         Reviewed by Myles Maxfield.
2465
2466         * wtf/StringExtras.h:
2467         (snprintf):
2468         (wtf_vsnprintf):
2469         VS2015 has an implementation of snprintf.
2470
2471 2015-07-31  Alex Christensen  <achristensen@webkit.org>
2472
2473         Prepare for VS2015
2474         https://bugs.webkit.org/show_bug.cgi?id=146579
2475
2476         Reviewed by Jon Honeycutt.
2477
2478         * wtf/StdLibExtras.h:
2479         (std::exchange):
2480         Added preprocessor macros around functions implemented in VS2015's standard library.
2481
2482 2015-07-30  Chris Dumez  <cdumez@apple.com>
2483
2484         Mark more classes as fast allocated
2485         https://bugs.webkit.org/show_bug.cgi?id=147440
2486
2487         Reviewed by Sam Weinig.
2488
2489         Mark more classes as fast allocated for performance. We heap-allocate
2490         objects of those types throughout the code base.
2491
2492         * wtf/Bag.h:
2493         * wtf/SegmentedVector.h:
2494         * wtf/SentinelLinkedList.h:
2495
2496 2015-07-29  Basile Clement  <basile_clement@apple.com>
2497
2498         Remove native call inlining
2499         https://bugs.webkit.org/show_bug.cgi?id=147417
2500
2501         Rubber-stamped by Filip Pizlo.
2502
2503         * wtf/Platform.h:
2504
2505 2015-07-28  Yusuke Suzuki  <utatane.tea@gmail.com>
2506
2507         [ES6] Add ENABLE_ES6_MODULES compile time flag with the default value "false"
2508         https://bugs.webkit.org/show_bug.cgi?id=147350
2509
2510         Reviewed by Sam Weinig.
2511
2512         * wtf/FeatureDefines.h:
2513
2514 2015-07-28  Filip Pizlo  <fpizlo@apple.com>
2515
2516         Unreviewed, fix Windows build.
2517
2518         * wtf/MetaAllocatorHandle.h:
2519         (WTF::MetaAllocatorHandle::key):
2520
2521 2015-07-27  Filip Pizlo  <fpizlo@apple.com>
2522
2523         Add logging when executable code gets deallocated
2524         https://bugs.webkit.org/show_bug.cgi?id=147355
2525
2526         Reviewed by Mark Lam.
2527
2528         * wtf/MetaAllocator.cpp:
2529         (WTF::MetaAllocatorHandle::dump): It's useful to be able to dump these.
2530         * wtf/MetaAllocatorHandle.h:
2531
2532 2015-07-28  Benjamin Poulain  <bpoulain@apple.com>
2533
2534         Speed up StringBuilder::appendQuotedJSONString()
2535         https://bugs.webkit.org/show_bug.cgi?id=147352
2536
2537         Reviewed by Andreas Kling.
2538
2539         * wtf/text/StringBuilder.cpp:
2540         (WTF::appendQuotedJSONStringInternal):
2541         The cases '"' and '\\' are not that uncommon, and they can easily
2542         be handled in the original branch testing for them.
2543
2544         This is about 2.5% better on the JSON.stringify test.
2545
2546 2015-07-27  Alex Christensen  <achristensen@webkit.org>
2547
2548         Progress towards building AppleWin with CMake
2549         https://bugs.webkit.org/show_bug.cgi?id=147325
2550
2551         Reviewed by Martin Robinson.
2552
2553         * wtf/PlatformWin.cmake:
2554         Link with CoreFoundation.lib.
2555
2556 2015-07-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2557
2558         REGRESSION (bmalloc): WebKit performance tests don't report memory stats.
2559         https://bugs.webkit.org/show_bug.cgi?id=141247
2560
2561         Reviewed by Geoffrey Garen.
2562
2563         Meanwhile a better way of getting memory stats with bmalloc is not found
2564         (see bug 136592), we can report as memory stats the resident set size
2565         information that the operating system provides to us.
2566
2567         This at least should be good enough to get back the memory stats on the
2568         performance tests and being able to track down memory usage regressions
2569         at https://perf.webkit.org
2570
2571         * wtf/FastMalloc.cpp:
2572         (WTF::fastMallocStatistics): Report maxrss data as committedVMBytes.
2573
2574 2015-07-24  Csaba Osztrogonác  <ossy@webkit.org>
2575
2576         Remove the unused GCC workaround - std::is_trivially_destructible
2577         https://bugs.webkit.org/show_bug.cgi?id=147226
2578
2579         Reviewed by Darin Adler.
2580
2581         * wtf/StdLibExtras.h:
2582
2583 2015-07-23  Alex Christensen  <achristensen@webkit.org>
2584
2585         Remove compile and runtime flags for promises.
2586         https://bugs.webkit.org/show_bug.cgi?id=147244
2587
2588         Reviewed by Yusuke Suzuki.
2589
2590         * wtf/FeatureDefines.h:
2591
2592 2015-07-22  Sukolsak Sakshuwong  <sukolsak@gmail.com>
2593
2594         Add ENABLE_WEBASSEMBLY feature flag for WebAssembly
2595         https://bugs.webkit.org/show_bug.cgi?id=147212
2596
2597         Reviewed by Filip Pizlo.
2598
2599         * wtf/FeatureDefines.h:
2600
2601 2015-07-22  Filip Pizlo  <fpizlo@apple.com>
2602
2603         Introduce release assert for using threads before threading is initialized
2604         https://bugs.webkit.org/show_bug.cgi?id=147200
2605
2606         Reviewed by Michael Saboff.
2607         
2608         This will help bugs where you use createThread() before calling initializeThreading().
2609
2610         * wtf/ThreadIdentifierDataPthreads.cpp:
2611         (WTF::ThreadIdentifierData::initialize):
2612
2613 2015-07-21  Daniel Bates  <dabates@apple.com>
2614
2615         WTFCrash() in WebKit::WebProcess::networkConnection()
2616         https://bugs.webkit.org/show_bug.cgi?id=147112
2617         <rdar://problem/18477459>
2618
2619         Reviewed by Gavin Barraclough.
2620
2621         Add explicit boolean conversion function and remove overload of operator! to support
2622         checking whether an activity token is valid more directly than using the overloaded operator!.
2623
2624         * wtf/RefCounter.h:
2625         (WTF::RefCounter::Token::operator bool): Added.
2626         (WTF::RefCounter::Token::operator!): Deleted.
2627
2628 2015-07-20  Mark Lam  <mark.lam@apple.com>
2629
2630         Rollout r187020 and r187021: breaks JSC API tests on debug builds.
2631         https://bugs.webkit.org/show_bug.cgi?id=147110
2632
2633         * wtf/WTFThreadData.cpp:
2634         (WTF::WTFThreadData::WTFThreadData):
2635         * wtf/WTFThreadData.h:
2636         (WTF::WTFThreadData::stack):
2637
2638 2015-07-20  Alex Christensen  <achristensen@webkit.org>
2639
2640         Resurrect CMake build on Windows.
2641         https://bugs.webkit.org/show_bug.cgi?id=147083
2642
2643         Reviewed by Gyuyoung Kim.
2644
2645         * wtf/PlatformWin.cmake:
2646
2647 2015-07-20  Per Arne Vollan  <peavo@outlook.com>
2648
2649         JavaScriptCore performance is very bad on Windows
2650         https://bugs.webkit.org/show_bug.cgi?id=146448
2651
2652         Reviewed by Mark Lam.
2653
2654         Updating the stack bounds is time consuming.
2655         Only update the stack bounds when a new fiber is running.
2656
2657         * wtf/WTFThreadData.cpp:
2658         (WTF::WTFThreadData::WTFThreadData):
2659         * wtf/WTFThreadData.h:
2660         (WTF::WTFThreadData::stack):
2661
2662 2015-07-20  Julien Brianceau  <julien.brianceau@gmail.com>
2663
2664         Use isnan from std namespace in Stopwatch.h.
2665         https://bugs.webkit.org/show_bug.cgi?id=146911
2666
2667         Reviewed by Žan Doberšek.
2668
2669         * wtf/Stopwatch.h:
2670         (WTF::Stopwatch::isActive):
2671         (WTF::Stopwatch::start):
2672         (WTF::Stopwatch::stop):
2673         (WTF::Stopwatch::elapsedTime):
2674
2675 2015-07-16  Benjamin Poulain  <bpoulain@apple.com>
2676
2677         [Content extensions] Combine suffixes when generating NFAs
2678         https://bugs.webkit.org/show_bug.cgi?id=146961
2679
2680         Reviewed by Alex Christensen.
2681
2682         * wtf/Vector.h:
2683         (WTF::minCapacity>::Vector):
2684         (WTF::=):
2685         Copying a vector with a different inline capacity was broken due to
2686         the addition of MinimumCapacity.
2687
2688         This feature was needed by this patch so I fixed WTF.
2689
2690 2015-07-15  Anders Carlsson  <andersca@apple.com>
2691
2692         Make JavaScriptCore SPI headers used by WebCore SPI headers self-contained
2693         https://bugs.webkit.org/show_bug.cgi?id=146978
2694
2695         Reviewed by Dan Bernstein.
2696
2697         * wtf/ExportMacros.h:
2698
2699 2015-07-14  Anders Carlsson  <andersca@apple.com>
2700
2701         Assertions.h should include ExportMacros.h
2702         https://bugs.webkit.org/show_bug.cgi?id=146948
2703
2704         Reviewed by Tim Horton.
2705
2706         * wtf/Assertions.h:
2707
2708 2015-07-11  Joseph Pecoraro  <pecoraro@apple.com>
2709
2710         Unreviewed build fix, restrict APP_LINKS to just iOS.
2711
2712         * wtf/Platform.h:
2713
2714 2015-07-09  Tim Horton  <timothy_horton@apple.com>
2715
2716         Use CoreAnimation fences instead of synchronous IPC to synchronize resize
2717         https://bugs.webkit.org/show_bug.cgi?id=146294
2718         <rdar://problem/21090193>
2719
2720         Reviewed by Anders Carlsson.
2721
2722         * wtf/Platform.h:
2723         Add HAVE(COREANIMATION_FENCES)
2724
2725 2015-07-04  Chris Dumez  <cdumez@apple.com>
2726
2727         Drop RefPtr::clear() method
2728         https://bugs.webkit.org/show_bug.cgi?id=146556
2729
2730         Reviewed by Brady Eidson.
2731
2732         Drop RefPtr::clear() method in favor of "= nullptr;" pattern.
2733         Also made the "= nullptr;" pattern as efficient as clear()
2734         by providing a operator=(nullptr_t) overload. Local micro-
2735         benchmarking showed that "= nullptr;" used to be ~1.7% slower
2736         than clear().
2737
2738 2015-07-03  Dan Bernstein  <mitz@apple.com>
2739
2740         [Xcode] Update some build settings as recommended by Xcode 7
2741         https://bugs.webkit.org/show_bug.cgi?id=146597
2742
2743         Reviewed by Sam Weinig.
2744
2745         * Configurations/Base.xcconfig: Enabled CLANG_WARN_UNREACHABLE_CODE and
2746         GCC_NO_COMMON_BLOCKS. Removed GCC_MODEL_TUNING.
2747
2748         * WTF.xcodeproj/project.pbxproj: Updated LastUpgradeCheck.
2749
2750 2015-07-01  Alex Christensen  <achristensen@webkit.org>
2751
2752         Re-enable WebGL on WinCairo
2753         https://bugs.webkit.org/show_bug.cgi?id=146537
2754
2755         Reviewed by Csaba Osztrogonác.
2756
2757         * wtf/FeatureDefines.h:
2758         Enable WebGL on WinCairo again.
2759
2760 2015-07-01  Alex Christensen  <achristensen@webkit.org>
2761
2762         Ignore Visual Studio warning in SegmentedVector
2763         https://bugs.webkit.org/show_bug.cgi?id=146514
2764
2765         Reviewed by Andreas Kling.
2766
2767         * wtf/SegmentedVector.h:
2768         (WTF::SegmentedVector::deleteAllSegments):
2769         Use pragmas to ignore the 0 element array warning.
2770
2771 2015-07-01  Dean Jackson  <dino@apple.com>
2772
2773         Disable the experimental WebGL2 implementation
2774         https://bugs.webkit.org/show_bug.cgi?id=146526
2775         <rdar://problem/21641235>
2776
2777         Reviewed by Myles Maxfield.
2778
2779         Add (and disable) an ENABLE_WEBGL2 flag.
2780
2781         * wtf/FeatureDefines.h:
2782
2783 2015-06-30  Alex Christensen  <achristensen@webkit.org>
2784
2785         [Win] Unreviewed build fix after r186169.
2786
2787         * wtf/FeatureDefines.h:
2788         Temporarily disable WebGL on WinCairo. It was already temporarily disabled on AppleWin.
2789
2790 2015-06-30  Andy VanWagoner  <thetalecrafter@gmail.com>
2791
2792         Implement ECMAScript Internationalization API
2793         https://bugs.webkit.org/show_bug.cgi?id=90906
2794
2795         Reviewed by Benjamin Poulain.
2796
2797         * wtf/FeatureDefines.h: add ENABLE_INTL flag
2798
2799 2015-06-30  Keith Miller  <keith_miller@apple.com>
2800
2801         Errors in read() are not handled in WTF::cryptographicallyRandomValuesFromOS.
2802         https://bugs.webkit.org/show_bug.cgi?id=146473
2803
2804         Reviewed by Filip Pizlo.
2805
2806         We were not checking if errors occurred in WTF::cryptographicallyRandomValuesFromOS.
2807         We now buffer the data until enough bits of entropy exist to fill the buffer
2808         rather than crash. Additionally, added two crash functions so we can distinguish
2809         between the two reasons why we crashed in traces.
2810
2811         * wtf/OSRandomSource.cpp:
2812         (WTF::crashUnableToOpenFD):
2813         (WTF::crashUnableToReadFromFD):
2814         (WTF::cryptographicallyRandomValuesFromOS):
2815
2816 2015-06-29  Dean Jackson  <dino@apple.com>
2817
2818         Temporarily disable PICTURE_SIZES
2819         https://bugs.webkit.org/show_bug.cgi?id=146435
2820         <rdar://problem/21087013>
2821
2822         Reviewed by Tim Horton.
2823
2824         Temporarily disable PICTURE_SIZES because it causes problems with out
2825         of date <picture> polyfills.
2826
2827         * wtf/FeatureDefines.h:
2828
2829 2015-06-26  Antti Koivisto  <antti@apple.com>
2830
2831         Network process hangs fetching disk cache entries
2832         https://bugs.webkit.org/show_bug.cgi?id=146348
2833         <rdar://problem/21528072>
2834
2835         Reviewed by Anders Carlsson.
2836
2837         RunLoop::dispatch may deadlock if invoked with std::function that captures an object that calls RunLoop::dispatch in destructor.
2838
2839         * wtf/RunLoop.cpp:
2840         (WTF::RunLoop::performWork):
2841
2842             Don't reuse std::function variable in loop. We may end up destroying previously held std::function in assignment
2843             while holding the runloop mutex. With this change std::function is always destroyed with mutex unlocked.
2844
2845 2015-06-24  Commit Queue  <commit-queue@webkit.org>
2846
2847         Unreviewed, rolling out r185906.
2848         https://bugs.webkit.org/show_bug.cgi?id=146276
2849
2850         MSVC doesn't yet provide a const-qualified std::array<T,
2851         N>::size(), failing to compile the static_assert (Requested by
2852         zdobersek on #webkit).
2853
2854         Reverted changeset:
2855
2856         "Improve the source code generated by make_names.pl"
2857         https://bugs.webkit.org/show_bug.cgi?id=146208
2858         http://trac.webkit.org/changeset/185906
2859
2860 2015-06-24  Zan Dobersek  <zdobersek@igalia.com>
2861
2862         Improve the source code generated by make_names.pl
2863         https://bugs.webkit.org/show_bug.cgi?id=146208
2864
2865         Reviewed by Darin Adler.
2866
2867         * wtf/text/StringImpl.h:
2868         (WTF::StringImpl::assertHashIsCorrect): Make this method const-qualified.
2869
2870 2015-06-22  Darin Adler  <darin@apple.com>
2871
2872         Make Array.join work directly on substrings without reifying them
2873         https://bugs.webkit.org/show_bug.cgi?id=146191
2874
2875         Reviewed by Andreas Kling.
2876
2877         * wtf/Vector.h: Added an overload of uncheckedAppend like the one we added
2878         a while back, a non-template function that forwards through to the function
2879         template. This lets us call uncheckedAppend on an argument list and have it
2880         properly convert it to the Vector's element type.
2881
2882         * wtf/text/StringView.h:
2883         (WTF::StringView::getCharactersWithUpconvert): Changed to not use memcpy;
2884         saw some indication the hand-written loop was faster when profiling. Also
2885         use m_length directly when we know we are dealing with an 8-bit string,
2886         since the masking that the index function does is not needed in that case.
2887         (WTF::StringView::UpconvertedCharacters::UpconvertedCharacters): Ditto.
2888         (WTF::StringView::toString): Ditto.
2889         (WTF::StringView::toFloat): Ditto.
2890         (WTF::StringView::toInt): Ditto.
2891         (WTF::StringView::toStringWithoutCopying): Ditto.
2892         (WTF::StringView::find): Ditto.
2893
2894 2015-06-22  YunQiang Su  <wzssyqa@gmail.com>
2895
2896         [WTF] Platform.h: use _ABI64 instead of _MIPS_SIM_ABI64 to determine MIPS N64
2897         https://bugs.webkit.org/show_bug.cgi?id=145113
2898
2899         Reviewed by Csaba Osztrogonác.
2900
2901         * wtf/Platform.h:
2902
2903 2015-06-22  Anders Carlsson  <andersca@apple.com>
2904
2905         Fix build.
2906
2907         * wtf/threads/BinarySemaphore.cpp:
2908
2909 2015-06-22  Anders Carlsson  <andersca@apple.com>
2910
2911         Get rid of the Windows specific BinarySemaphore implementation
2912         https://bugs.webkit.org/show_bug.cgi?id=146216
2913
2914         Reviewed by Andreas Kling.
2915
2916         The fact that the Windows implementation uses a HEVENT internally was only useful
2917         to the Windows port of WebKit2; we can get rid of it now.
2918
2919         * WTF.vcxproj/WTF.vcxproj:
2920         * WTF.vcxproj/WTF.vcxproj.filters:
2921         * wtf/threads/BinarySemaphore.h:
2922         (WTF::BinarySemaphore::event): Deleted.
2923         * wtf/threads/win/BinarySemaphoreWin.cpp: Removed.
2924         (WTF::BinarySemaphore::BinarySemaphore): Deleted.
2925         (WTF::BinarySemaphore::~BinarySemaphore): Deleted.
2926         (WTF::BinarySemaphore::signal): Deleted.
2927         (WTF::BinarySemaphore::wait): Deleted.
2928
2929 2015-06-21  Gavin Barraclough  <barraclough@apple.com>
2930
2931         Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
2932         https://bugs.webkit.org/show_bug.cgi?id=146198
2933
2934         Unreviewed rollout.
2935
2936         * wtf/glib/GUniquePtr.h:
2937
2938 2015-06-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2939
2940         [EFL][GTK] Define GLIB_VERSION_MIN_REQUIRED and require glib 2.36 for GTK
2941         https://bugs.webkit.org/show_bug.cgi?id=146181
2942
2943         Reviewed by Martin Robinson.
2944
2945         Define GLIB_VERSION_MIN_REQUIRED to avoid deprecation warnings.
2946
2947         * wtf/Platform.h:
2948
2949 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
2950
2951         [SOUP] Define SOUP_VERSION_MIN_REQUIRED
2952         https://bugs.webkit.org/show_bug.cgi?id=146165
2953
2954         Reviewed by Martin Robinson.
2955
2956         Define SOUP_VERSION_MIN_REQUIRED to avoid deprecation warnings.
2957
2958         * wtf/Platform.h:
2959
2960 2015-06-19  Mark Lam  <mark.lam@apple.com>
2961
2962         Gardening: build fixes for GTK and EFL for CheckedArithmetic change.
2963
2964         Not reviewed.
2965
2966         * wtf/CheckedArithmetic.h:
2967         (WTF::Checked::operator<):
2968         (WTF::Checked::operator<=):
2969         (WTF::Checked::operator>):
2970         (WTF::Checked::operator>=):
2971
2972 2015-06-19  Mark Lam  <mark.lam@apple.com>
2973
2974         CheckedArithmetic's operator bool() and operator==() is broken.
2975         https://bugs.webkit.org/show_bug.cgi?id=146129
2976
2977         Reviewed by Geoffrey Garen and Oliver Hunt.
2978
2979         The existing operator UnspecifiedBoolType*() in CheckedArithmetic is erroneously
2980         allowing the Checked value to be implicitly casted into pointer types.  This is
2981         because it is doing a reinterpret_cast<UnspecifiedBoolType*>(1) whereas the idiom
2982         relies on the address of a member e.g. &Checked::m_value.  As a result,
2983         ImageBufferData::putData() was getting an implicit cast of a Checked value to
2984         (void*)1 and doing incorrect pointer comparisons on it.
2985
2986         Also, 2 of CheckedArithmetic's operator==() will crash if used on an overflowed
2987         value, while a 3rd one does not.  The 3rd one should be consistent and also crash
2988         if used on an overflowed Checked value.
2989
2990         In this fix, we replace operator UnspecifiedBoolType*() with an explicit operator
2991         bool().  We also add the missing operators <, <=, >, and >=.  That takes care of
2992         the comparisons in ImageBufferData::putData().
2993
2994         * wtf/CheckedArithmetic.h:
2995         (WTF::CrashOnOverflow::overflowed):
2996         (WTF::CrashOnOverflow::crash):
2997         (WTF::RecordOverflow::crash):
2998
2999         (WTF::Checked::operator!):
3000         (WTF::Checked::operator bool):
3001         (WTF::Checked::unsafeGet):
3002         - Don't call CRASH() directly.  Delegate to the handler.
3003
3004         (WTF::Checked::operator==):
3005         - Should call the handler's crash() to be consistent with the other 2 versions of
3006           operator== which will crash in unsafeGet() if used on an overflowed Checked
3007           value.
3008
3009         (WTF::Checked::operator<):
3010         (WTF::Checked::operator<=):
3011         (WTF::Checked::operator>):
3012         (WTF::Checked::operator>=):
3013         - Add missing operators.
3014
3015         (WTF::Checked::operator UnspecifiedBoolType*): Deleted.
3016
3017 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
3018
3019         [WK2] Fix unused-private-field warning in WebProcess/Plugins/PluginView.<h|cpp>
3020         https://bugs.webkit.org/show_bug.cgi?id=145252
3021
3022         Reviewed by Tim Horton.
3023
3024         * wtf/FeatureDefines.h: Moved the definition of ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC
3025         here from Source/WebKit2/WebProcess/WebPage/WebPage.h
3026
3027 2015-06-17  Andreas Kling  <akling@apple.com>
3028
3029         SegmentedVector should waste less memory.
3030         <https://webkit.org/b/146069>
3031
3032         Reviewed by Anders Carlsson.
3033
3034         We were wasting sizeof(Vector) on every segment in SegmentVector.
3035         The segments were using inline capacity, and would never go beyond it,
3036         so all the size/capacity/out-of-line-buffer metadata was useless.
3037
3038         Change the internal representation to Vector<T[SegmentSize]> instead.
3039         This saves 16 bytes per segment, so lower SegmentSize -> bigger savings!
3040
3041         * wtf/SegmentedVector.h:
3042         (WTF::SegmentedVectorIterator::operator*):
3043         (WTF::SegmentedVectorIterator::operator->):
3044         (WTF::SegmentedVectorIterator::operator++):
3045         (WTF::SegmentedVectorIterator::operator==):
3046         (WTF::SegmentedVectorIterator::operator!=):
3047         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
3048         (WTF::SegmentedVector::at):
3049         (WTF::SegmentedVector::append):
3050         (WTF::SegmentedVector::removeLast):
3051         (WTF::SegmentedVector::grow):
3052         (WTF::SegmentedVector::begin):
3053         (WTF::SegmentedVector::end):
3054         (WTF::SegmentedVector::deleteAllSegments):
3055         (WTF::SegmentedVector::ensureSegmentsFor):
3056         (WTF::SegmentedVector::ensureSegment):
3057         (WTF::SegmentedVector::allocateSegment):
3058         (WTF::SegmentedVectorIterator::operator=): Deleted.
3059         (WTF::SegmentedVector::SegmentedVector): Deleted.
3060
3061 2015-06-16  Andreas Kling  <akling@apple.com>
3062
3063         Remove unused template parameter InlineCapacity from SegmentedVector.
3064         <https://webkit.org/b/146044>
3065
3066         Reviewed by Anders Carlsson.
3067
3068         * wtf/SegmentedVector.h:
3069         (WTF::SegmentedVectorIterator::operator=):
3070         (WTF::SegmentedVectorIterator::SegmentedVectorIterator):
3071         (WTF::SegmentedVector::at):
3072
3073 2015-06-16  Mark Lam  <mark.lam@apple.com>
3074
3075         Use NakedPtr<Exception>& to return exception results.
3076         https://bugs.webkit.org/show_bug.cgi?id=145870
3077
3078         Reviewed by Anders Carlsson and Filip Pizlo.
3079
3080         Introducing the NakedPtr class.
3081
3082         * WTF.xcodeproj/project.pbxproj:
3083         * wtf/NakedPtr.h: Added.
3084         (WTF::NakedPtr::NakedPtr):
3085         (WTF::NakedPtr::get):
3086         (WTF::NakedPtr::clear):
3087         (WTF::NakedPtr::operator*):
3088         (WTF::NakedPtr::operator->):
3089         (WTF::NakedPtr::operator T*):
3090         (WTF::NakedPtr::operator!):
3091         (WTF::NakedPtr::operator bool):
3092         (WTF::=):
3093         (WTF::NakedPtr<T>::swap):
3094         (WTF::swap):
3095
3096 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
3097
3098         [GLib] Move files under Source/WTF/wtf/gobject to Source/WTF/wtf/glib
3099         https://bugs.webkit.org/show_bug.cgi?id=145799
3100
3101         Reviewed by Carlos Garcia Campos.
3102
3103         Move the GLib-specific files to the Source/WTF/wtf/glib/ directory.
3104         'gobject' wasn't the most appropriate name for the directory since
3105         GObject is a submodule of GLib, but a lot of the code there didn't
3106         have much to do with GObject specifically.
3107
3108         Build rules for the moved files are also updated.
3109
3110         * WTF.vcxproj/WTF.vcxproj:
3111         * WTF.vcxproj/WTF.vcxproj.filters:
3112         * wtf/Platform.h:
3113         * wtf/PlatformEfl.cmake:
3114         * wtf/PlatformGTK.cmake:
3115         * wtf/RunLoop.h:
3116         * wtf/WorkQueue.h:
3117         * wtf/glib/GLibUtilities.cpp: Renamed from Source/WTF/wtf/gobject/GlibUtilities.cpp.
3118         (getCurrentExecutablePath):
3119         * wtf/glib/GLibUtilities.h: Renamed from Source/WTF/wtf/gobject/GlibUtilities.h.
3120         * wtf/glib/GMainLoopSource.cpp: Renamed from Source/WTF/wtf/gobject/GMainLoopSource.cpp.
3121         (WTF::GMainLoopSource::create):
3122         (WTF::GMainLoopSource::GMainLoopSource):
3123         (WTF::GMainLoopSource::~GMainLoopSource):
3124         (WTF::GMainLoopSource::isScheduled):
3125         (WTF::GMainLoopSource::isActive):
3126         (WTF::GMainLoopSource::cancel):
3127         (WTF::GMainLoopSource::scheduleIdleSource):
3128         (WTF::GMainLoopSource::schedule):
3129         (WTF::GMainLoopSource::scheduleTimeoutSource):
3130         (WTF::GMainLoopSource::scheduleAfterDelay):
3131         (WTF::createMicrosecondsTimeoutSource):
3132         (WTF::GMainLoopSource::scheduleAndDeleteOnDestroy):
3133         (WTF::GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy):
3134         (WTF::GMainLoopSource::prepareVoidCallback):
3135         (WTF::GMainLoopSource::finishVoidCallback):
3136         (WTF::GMainLoopSource::voidCallback):
3137         (WTF::GMainLoopSource::prepareBoolCallback):
3138         (WTF::GMainLoopSource::finishBoolCallback):
3139         (WTF::GMainLoopSource::boolCallback):
3140         (WTF::GMainLoopSource::socketCallback):
3141         (WTF::GMainLoopSource::voidSourceCallback):
3142         (WTF::GMainLoopSource::boolSourceCallback):
3143         (WTF::GMainLoopSource::socketSourceCallback):
3144         (WTF::GMainLoopSource::Context::destroySource):
3145         * wtf/glib/GMainLoopSource.h: Renamed from Source/WTF/wtf/gobject/GMainLoopSource.h.
3146         (WTF::GMainLoopSource::Context::operator=):
3147         * wtf/glib/GMutexLocker.h: Renamed from Source/WTF/wtf/gobject/GMutexLocker.h.
3148         (WTF::MutexWrapper<GMutex>::lock):
3149         (WTF::MutexWrapper<GMutex>::unlock):
3150         (WTF::MutexWrapper<GRecMutex>::lock):
3151         (WTF::MutexWrapper<GRecMutex>::unlock):
3152         (WTF::GMutexLocker::GMutexLocker):
3153         (WTF::GMutexLocker::~GMutexLocker):
3154         (WTF::GMutexLocker::lock):
3155         (WTF::GMutexLocker::unlock):
3156         * wtf/glib/GRefPtr.cpp: Renamed from Source/WTF/wtf/gobject/GRefPtr.cpp.
3157         (WTF::refGPtr):
3158         (WTF::derefGPtr):
3159         * wtf/glib/GRefPtr.h: Renamed from Source/WTF/wtf/gobject/GRefPtr.h.
3160         (WTF::GRefPtr::GRefPtr):
3161         (WTF::GRefPtr::~GRefPtr):
3162         (WTF::GRefPtr::clear):
3163         (WTF::GRefPtr::outPtr):
3164         (WTF::GRefPtr::isHashTableDeletedValue):
3165         (WTF::GRefPtr::get):
3166         (WTF::GRefPtr::operator*):
3167         (WTF::GRefPtr::operator->):
3168         (WTF::GRefPtr::operator!):
3169         (WTF::GRefPtr::operator UnspecifiedBoolType):
3170         (WTF::GRefPtr::hashTableDeletedValue):
3171         (WTF::=):
3172         (WTF::GRefPtr<T>::swap):
3173         (WTF::swap):
3174         (WTF::operator==):
3175         (WTF::operator!=):
3176         (WTF::static_pointer_cast):
3177         (WTF::const_pointer_cast):
3178         (WTF::adoptGRef):
3179         (WTF::refGPtr):
3180         (WTF::derefGPtr):
3181         * wtf/glib/GThreadSafeMainLoopSource.cpp: Renamed from Source/WTF/wtf/gobject/GThreadSafeMainLoopSource.cpp.
3182         (WTF::GThreadSafeMainLoopSource::GThreadSafeMainLoopSource):
3183         (WTF::GThreadSafeMainLoopSource::~GThreadSafeMainLoopSource):
3184         (WTF::GThreadSafeMainLoopSource::cancel):
3185         (WTF::GThreadSafeMainLoopSource::schedule):
3186         (WTF::GThreadSafeMainLoopSource::scheduleAfterDelay):
3187         (WTF::GThreadSafeMainLoopSource::prepareVoidCallback):
3188         (WTF::GThreadSafeMainLoopSource::finishVoidCallback):
3189         (WTF::GThreadSafeMainLoopSource::voidCallback):
3190         (WTF::GThreadSafeMainLoopSource::prepareBoolCallback):
3191         (WTF::GThreadSafeMainLoopSource::finishBoolCallback):
3192         (WTF::GThreadSafeMainLoopSource::boolCallback):
3193         * wtf/glib/GThreadSafeMainLoopSource.h: Renamed from Source/WTF/wtf/gobject/GThreadSafeMainLoopSource.h.
3194         * wtf/glib/GTypedefs.h: Renamed from Source/WTF/wtf/gobject/GTypedefs.h.
3195         * wtf/glib/GUniquePtr.h: Renamed from Source/WTF/wtf/gobject/GUniquePtr.h.
3196         (WTF::GPtrDeleter::operator()):
3197         (WTF::GUniqueOutPtr::GUniqueOutPtr):
3198         (WTF::GUniqueOutPtr::~GUniqueOutPtr):
3199         (WTF::GUniqueOutPtr::outPtr):
3200         (WTF::GUniqueOutPtr::release):
3201         (WTF::GUniqueOutPtr::operator*):
3202         (WTF::GUniqueOutPtr::operator->):
3203         (WTF::GUniqueOutPtr::get):
3204         (WTF::GUniqueOutPtr::operator!):
3205         (WTF::GUniqueOutPtr::operator UnspecifiedBoolType):
3206         (WTF::GUniqueOutPtr::reset):
3207         * wtf/glib/MainThreadGLib.cpp:
3208         * wtf/gobject/GMainLoopSource.cpp:
3209         (WTF::GMainLoopSource::create): Deleted.
3210         (WTF::GMainLoopSource::GMainLoopSource): Deleted.
3211         (WTF::GMainLoopSource::~GMainLoopSource): Deleted.
3212         (WTF::GMainLoopSource::isScheduled): Deleted.
3213         (WTF::GMainLoopSource::isActive): Deleted.
3214         (WTF::GMainLoopSource::cancel): Deleted.
3215         (WTF::GMainLoopSource::scheduleIdleSource): Deleted.
3216         (WTF::GMainLoopSource::schedule): Deleted.
3217         (WTF::GMainLoopSource::scheduleTimeoutSource): Deleted.
3218         (WTF::GMainLoopSource::scheduleAfterDelay): Deleted.
3219         (WTF::createMicrosecondsTimeoutSource): Deleted.
3220         (WTF::GMainLoopSource::scheduleAndDeleteOnDestroy): Deleted.
3221         (WTF::GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy): Deleted.
3222         (WTF::GMainLoopSource::prepareVoidCallback): Deleted.
3223         (WTF::GMainLoopSource::finishVoidCallback): Deleted.
3224         (WTF::GMainLoopSource::voidCallback): Deleted.
3225         (WTF::GMainLoopSource::prepareBoolCallback): Deleted.
3226         (WTF::GMainLoopSource::finishBoolCallback): Deleted.
3227         (WTF::GMainLoopSource::boolCallback): Deleted.
3228         (WTF::GMainLoopSource::socketCallback): Deleted.
3229         (WTF::GMainLoopSource::voidSourceCallback): Deleted.
3230         (WTF::GMainLoopSource::boolSourceCallback): Deleted.
3231         (WTF::GMainLoopSource::socketSourceCallback): Deleted.
3232         (WTF::GMainLoopSource::Context::destroySource): Deleted.
3233         * wtf/gobject/GMainLoopSource.h:
3234         (WTF::GMainLoopSource::Context::operator=): Deleted.
3235         * wtf/gobject/GMutexLocker.h:
3236         (WTF::MutexWrapper<GMutex>::lock): Deleted.
3237         (WTF::MutexWrapper<GMutex>::unlock): Deleted.
3238         (WTF::MutexWrapper<GRecMutex>::lock): Deleted.
3239         (WTF::MutexWrapper<GRecMutex>::unlock): Deleted.
3240         (WTF::GMutexLocker::GMutexLocker): Deleted.
3241         (WTF::GMutexLocker::~GMutexLocker): Deleted.
3242         (WTF::GMutexLocker::lock): Deleted.
3243         (WTF::GMutexLocker::unlock): Deleted.
3244         * wtf/gobject/GRefPtr.cpp:
3245         (WTF::refGPtr): Deleted.
3246         (WTF::derefGPtr): Deleted.
3247         * wtf/gobject/GRefPtr.h:
3248         (WTF::GRefPtr::GRefPtr): Deleted.
3249         (WTF::GRefPtr::~GRefPtr): Deleted.
3250         (WTF::GRefPtr::clear): Deleted.
3251         (WTF::GRefPtr::outPtr): Deleted.
3252         (WTF::GRefPtr::isHashTableDeletedValue): Deleted.
3253         (WTF::GRefPtr::get): Deleted.
3254         (WTF::GRefPtr::operator*): Deleted.
3255         (WTF::GRefPtr::operator->): Deleted.
3256         (WTF::GRefPtr::operator!): Deleted.
3257         (WTF::GRefPtr::operator UnspecifiedBoolType): Deleted.
3258         (WTF::GRefPtr::hashTableDeletedValue): Deleted.
3259         (WTF::=): Deleted.
3260         (WTF::GRefPtr<T>::swap): Deleted.
3261         (WTF::swap): Deleted.
3262         (WTF::operator==): Deleted.
3263         (WTF::operator!=): Deleted.
3264         (WTF::static_pointer_cast): Deleted.
3265         (WTF::const_pointer_cast): Deleted.
3266         (WTF::adoptGRef): Deleted.
3267         (WTF::refGPtr): Deleted.
3268         (WTF::derefGPtr): Deleted.
3269         * wtf/gobject/GThreadSafeMainLoopSource.cpp:
3270         (WTF::GThreadSafeMainLoopSource::GThreadSafeMainLoopSource): Deleted.
3271         (WTF::GThreadSafeMainLoopSource::~GThreadSafeMainLoopSource): Deleted.
3272         (WTF::GThreadSafeMainLoopSource::cancel): Deleted.
3273         (WTF::GThreadSafeMainLoopSource::schedule): Deleted.
3274         (WTF::GThreadSafeMainLoopSource::scheduleAfterDelay): Deleted.
3275         (WTF::GThreadSafeMainLoopSource::prepareVoidCallback): Deleted.
3276         (WTF::GThreadSafeMainLoopSource::finishVoidCallback): Deleted.
3277         (WTF::GThreadSafeMainLoopSource::voidCallback): Deleted.
3278         (WTF::GThreadSafeMainLoopSource::prepareBoolCallback): Deleted.
3279         (WTF::GThreadSafeMainLoopSource::finishBoolCallback): Deleted.
3280         (WTF::GThreadSafeMainLoopSource::boolCallback): Deleted.
3281         * wtf/gobject/GUniquePtr.h:
3282         (WTF::GPtrDeleter::operator()): Deleted.
3283         (WTF::GUniqueOutPtr::GUniqueOutPtr): Deleted.
3284         (WTF::GUniqueOutPtr::~GUniqueOutPtr): Deleted.
3285         (WTF::GUniqueOutPtr::outPtr): Deleted.
3286         (WTF::GUniqueOutPtr::release): Deleted.
3287         (WTF::GUniqueOutPtr::operator*): Deleted.
3288         (WTF::GUniqueOutPtr::operator->): Deleted.
3289         (WTF::GUniqueOutPtr::get): Deleted.
3290         (WTF::GUniqueOutPtr::operator!): Deleted.
3291         (WTF::GUniqueOutPtr::operator UnspecifiedBoolType): Deleted.
3292         (WTF::GUniqueOutPtr::reset): Deleted.
3293         * wtf/gobject/GlibUtilities.cpp:
3294         (getCurrentExecutablePath): Deleted.
3295
3296 2015-06-10  Basile Clement  <basile_clement@apple.com>
3297
3298         Unreviewed, fix an typo in unused template code.
3299
3300         * wtf/TinyPtrSet.h:
3301         (WTF::TinyPtrSet::iterator::operator*): s/at(index)/at(m_index)/
3302
3303 2015-06-09  Csaba Osztrogonác  <ossy@webkit.org>
3304
3305         [cmake] Fix the style issues in cmake project files
3306         https://bugs.webkit.org/show_bug.cgi?id=145755
3307
3308         Reviewed by Darin Adler.
3309
3310         * wtf/CMakeLists.txt:
3311
3312 2015-06-08  Alexey Proskuryakov  <ap@apple.com>
3313
3314         Build fix.
3315
3316         * wtf/TinyPtrSet.h: (WTF::TinyPtrSet::isEmpty): s/poointer/pointer/
3317
3318 2015-06-07  Filip Pizlo  <fpizlo@apple.com>
3319
3320         The tiny set magic in StructureSet should be available in WTF
3321         https://bugs.webkit.org/show_bug.cgi?id=145722
3322
3323         Reviewed by Geoffrey Garen.
3324         
3325         As the management of structure sets evolved in JSC, the StructureSet data structure grew
3326         increasingly smart. It's got some smart stuff for managing small sets of pointers. I
3327         wanted to take the generic logic out of JSC and put it into a reusable templatized class
3328         in WTF.
3329         
3330         * WTF.vcxproj/WTF.vcxproj:
3331         * WTF.xcodeproj/project.pbxproj:
3332         * wtf/CMakeLists.txt:
3333         * wtf/TinyPtrSet.h: Added.
3334         (WTF::TinyPtrSet::TinyPtrSet):
3335         (WTF::TinyPtrSet::operator=):
3336         (WTF::TinyPtrSet::~TinyPtrSet):
3337         (WTF::TinyPtrSet::clear):
3338         (WTF::TinyPtrSet::onlyEntry):
3339         (WTF::TinyPtrSet::isEmpty):
3340         (WTF::TinyPtrSet::add):
3341         (WTF::TinyPtrSet::remove):
3342         (WTF::TinyPtrSet::contains):
3343         (WTF::TinyPtrSet::merge):
3344         (WTF::TinyPtrSet::forEach):
3345         (WTF::TinyPtrSet::genericFilter):
3346         (WTF::TinyPtrSet::filter):
3347         (WTF::TinyPtrSet::exclude):
3348         (WTF::TinyPtrSet::isSubsetOf):
3349         (WTF::TinyPtrSet::isSupersetOf):
3350         (WTF::TinyPtrSet::overlaps):
3351         (WTF::TinyPtrSet::size):
3352         (WTF::TinyPtrSet::at):
3353         (WTF::TinyPtrSet::operator[]):
3354         (WTF::TinyPtrSet::last):
3355         (WTF::TinyPtrSet::iterator::iterator):
3356         (WTF::TinyPtrSet::iterator::operator*):
3357         (WTF::TinyPtrSet::iterator::operator++):
3358         (WTF::TinyPtrSet::iterator::operator==):
3359         (WTF::TinyPtrSet::iterator::operator!=):
3360         (WTF::TinyPtrSet::begin):
3361         (WTF::TinyPtrSet::end):
3362         (WTF::TinyPtrSet::operator==):
3363         (WTF::TinyPtrSet::addOutOfLine):
3364         (WTF::TinyPtrSet::containsOutOfLine):
3365         (WTF::TinyPtrSet::copyFrom):
3366         (WTF::TinyPtrSet::copyFromOutOfLine):
3367         (WTF::TinyPtrSet::OutOfLineList::create):
3368         (WTF::TinyPtrSet::OutOfLineList::destroy):
3369         (WTF::TinyPtrSet::OutOfLineList::list):
3370         (WTF::TinyPtrSet::OutOfLineList::OutOfLineList):
3371         (WTF::TinyPtrSet::deleteListIfNecessary):
3372         (WTF::TinyPtrSet::isThin):
3373         (WTF::TinyPtrSet::pointer):
3374         (WTF::TinyPtrSet::singleEntry):
3375         (WTF::TinyPtrSet::list):
3376         (WTF::TinyPtrSet::set):
3377         (WTF::TinyPtrSet::setEmpty):
3378         (WTF::TinyPtrSet::getReservedFlag):
3379         (WTF::TinyPtrSet::setReservedFlag):
3380
3381 2015-06-05  Chris Dumez  <cdumez@apple.com>
3382
3383         [WK2][iOS] Limit the number of vnodes used by the WebContent processes
3384         https://bugs.webkit.org/show_bug.cgi?id=145672
3385         <rdar://problem/21126637>
3386
3387         Reviewed by Antti Koivisto.
3388
3389         * wtf/RefCounter.h:
3390         (WTF::RefCounter::value):
3391
3392         Expose the actual refcount instead of a boolean value.
3393
3394 2015-06-05  Alex Christensen  <achristensen@webkit.org>
3395
3396         [Web Timing] Use new SPI to enable data collection.
3397         https://bugs.webkit.org/show_bug.cgi?id=145650
3398         rdar://problem/21203358
3399
3400         Reviewed by Chris Dumez.
3401
3402         * wtf/Platform.h:
3403         Added HAVE_TIMINGDATAOPTIONS for platform and version dependent feature.
3404
3405 2015-06-05  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3406
3407         [Streams API] ReadableStream should store callbacks as a Deque
3408         https://bugs.webkit.org/show_bug.cgi?id=145641
3409
3410         Reviewed by Darin Adler.
3411
3412         * wtf/Deque.h:
3413         (WTF::Deque::append): Adding not templated append method, forwarding to templated append method.
3414
3415 2015-06-02  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3416
3417         [Streams API] Delegate ReadableStreamReader reference counting to ReadableStream
3418         https://bugs.webkit.org/show_bug.cgi?id=144907
3419
3420         Reviewed by Darin Adler.
3421
3422         * wtf/Vector.h:
3423         (WTF::Vector::append): Adding not templated append method, forwarding to ValueType templated append method.
3424
3425 2015-06-02  Yusuke Suzuki  <utatane.tea@gmail.com>
3426
3427         Heap-use-after-free read of size 4 in JavaScriptCore: WTF::StringImpl::isSymbol() (StringImpl.h:496)
3428         https://bugs.webkit.org/show_bug.cgi?id=145532
3429
3430         Reviewed by Geoffrey Garen.
3431
3432         Return `RefPtr<AtomicStringImpl>` instead of `AtomicStringImpl*`.
3433
3434         * wtf/text/AtomicStringImpl.cpp:
3435         (WTF::AtomicStringImpl::lookUpSlowCase):
3436         (WTF::AtomicStringImpl::lookUpInternal):
3437         * wtf/text/AtomicStringImpl.h:
3438         (WTF::AtomicStringImpl::lookUp):
3439
3440 2015-06-01  Anders Carlsson  <andersca@apple.com>
3441
3442         Use xpc_connection_set_oneshot_instance where possible
3443         https://bugs.webkit.org/show_bug.cgi?id=145535
3444         rdar://problem/21109994
3445
3446         Reviewed by Sam Weinig.
3447
3448         Add SPI declaration.
3449
3450         * wtf/spi/darwin/XPCSPI.h:
3451
3452 2015-05-29  Anders Carlsson  <andersca@apple.com>
3453
3454         Missing #import of Platform.h in several WTF headers
3455         https://bugs.webkit.org/show_bug.cgi?id=145475
3456         rdar://problem/21161818
3457
3458         Reviewed by Darin Adler.
3459
3460         Add Platform.h #includes.
3461
3462         * wtf/Assertions.h:
3463         * wtf/RetainPtr.h:
3464
3465 2015-05-29  Commit Queue  <commit-queue@webkit.org>
3466
3467         Unreviewed, rolling out r184949.
3468         https://bugs.webkit.org/show_bug.cgi?id=145458
3469
3470         Ends up generating worse code for HashTable move constructors
3471         (Requested by zdobersek on #webkit).
3472
3473         Reverted changeset:
3474
3475         "Clean up HashTable constructors"
3476         https://bugs.webkit.org/show_bug.cgi?id=145369
3477         http://trac.webkit.org/changeset/184949
3478
3479 2015-05-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3480
3481         Purge PassRefPtr in StringConcatenate.h
3482         https://bugs.webkit.org/show_bug.cgi?id=145376
3483
3484         Reviewed by Darin Adler.
3485
3486         Replace PassRefPtr with RefPtr. Additionally use nullptr instead of 0.
3487
3488         * wtf/text/StringConcatenate.h:
3489         (WTF::tryMakeString):
3490         (WTF::makeString):
3491
3492 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
3493
3494         Clean up HashTable constructors
3495         https://bugs.webkit.org/show_bug.cgi?id=145369
3496
3497         Reviewed by Andreas Kling.
3498
3499         Use nullptr to initialize pointer member variables in the HashTable
3500         default constructor. Copy and move constructors can use constructor
3501         delegation instead of replicating all member initializations. Move
3502         constructor should simply call HashTable::swap() instead of replicating
3503         all the swap operations.
3504
3505         * wtf/HashTable.h:
3506         (WTF::KeyTraits>::HashTable):
3507
3508 2015-05-27  Alexey Proskuryakov  <ap@apple.com>
3509
3510         [Mac] Fix clang static analyzer build
3511         https://bugs.webkit.org/show_bug.cgi?id=145426
3512         rdar://problem/20947408
3513
3514         Reviewed by Dan Bernstein.
3515
3516         * wtf/spi/darwin/XPCSPI.h: Correct declarations of xpc_retain and xpc_release.
3517
3518 2015-05-27  Dean Jackson  <dino@apple.com>
3519
3520         img.currentSrc problem in strict mode with old picturefill
3521         https://bugs.webkit.org/show_bug.cgi?id=144095
3522         <rdar://problem/21087013>
3523
3524         Reviewed by Simon Fraser.
3525
3526         Add a PICTURE_SIZES flag.
3527
3528         * wtf/FeatureDefines.h:
3529
3530 2015-05-26  Andreas Kling  <akling@apple.com>
3531
3532         StringView should have find(StringView, start).
3533         <https://webkit.org/b/145351>
3534
3535         Reviewed by Darin Adler.
3536
3537         Move the class agnostic guts of StringImpl's find() implementation from StringImpl
3538         to StringCommon.h and templatize the code into a findCommon() helper.
3539
3540         StringImpl::find() and StringView::find() now both call findCommon().
3541
3542         * wtf/text/StringCommon.h:
3543         (WTF::findInner):
3544         (WTF::find):
3545         (WTF::findCommon):
3546         * wtf/text/StringImpl.cpp:
3547         (WTF::StringImpl::find):
3548         (WTF::findInner): Deleted.
3549         * wtf/text/StringImpl.h:
3550         (WTF::find): Deleted.
3551         * wtf/text/StringView.cpp:
3552         (WTF::StringView::find):
3553         * wtf/text/StringView.h:
3554
3555
3556 2015-05-26  Dan Bernstein  <mitz@apple.com>
3557
3558         <rdar://problem/21104551> Update build settings
3559
3560         Reviewed by Anders Carlsson.
3561
3562         * Configurations/DebugRelease.xcconfig:
3563
3564 2015-05-23  Dan Bernstein  <mitz@apple.com>
3565
3566         Remove unused definitions of WEBKIT_VERSION_MIN_REQUIRED
3567         https://bugs.webkit.org/show_bug.cgi?id=145345
3568
3569         Reviewed by Sam Weinig.
3570
3571         * Configurations/Base.xcconfig: Also changed to use $(inherited).
3572
3573 2015-05-23  Yusuke Suzuki  <utatane.tea@gmail.com>
3574
3575         Introduce UniquedStringImpl and SymbolImpl to separate symbolic strings from Atom