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