a4137e7554c31bce1010174f3bcd9b25edc7b291
[WebKit-https.git] / Source / WTF / ChangeLog
1 2015-05-18  Skachkov Alexandr  <gskachkov@gmail.com>
2
3         [ES6] Arrow function syntax. Feature flag for arrow function
4         https://bugs.webkit.org/show_bug.cgi?id=145108
5
6         Reviewed by Ryosuke Niwa.
7
8         Added feature flag ENABLE_ES6_ARROWFUNCTION_SYNTAX for arrow function
9
10         * wtf/FeatureDefines.h:
11
12 2015-05-17  Benjamin Poulain  <benjamin@webkit.org>
13
14         Do not use fastMallocGoodSize anywhere
15         https://bugs.webkit.org/show_bug.cgi?id=145103
16
17         Reviewed by Michael Saboff.
18
19         It is silly we see fastMallocGoodSize in profiles, it does absolutely nothing.
20
21         This patch keeps fastMallocGoodSize() around for older code linking
22         with newer WebKit, but remove any use of it inside WebKit.
23
24         * wtf/FastMalloc.cpp:
25         (WTF::fastMallocGoodSize):
26         * wtf/FastMalloc.h:
27         * wtf/Vector.h:
28         (WTF::VectorBufferBase::allocateBuffer):
29         (WTF::VectorBufferBase::tryAllocateBuffer):
30         (WTF::VectorBufferBase::reallocateBuffer):
31
32 2015-05-15  Dan Bernstein  <mitz@apple.com>
33
34         Build fix for some versions of clang.
35
36         * wtf/SaturatedArithmetic.h:
37         (signedAddOverflows):
38         (signedSubtractOverflows):
39
40 2015-05-14  Dan Bernstein  <mitz@apple.com>
41
42         Reverted r177753, now that <rdar://problem/19347133> is fixed.
43
44         Rubber-stamped by Benjamin Poulain.
45
46         * wtf/SaturatedArithmetic.h:
47         (signedAddOverflows):
48         (signedSubtractOverflows):
49
50 2015-05-14  Myles C. Maxfield  <mmaxfield@apple.com>
51
52         Add String literal overloads to equalIgnoringASCIICase()
53         https://bugs.webkit.org/show_bug.cgi?id=145008
54
55         Reviewed by Benjamin Poulain.
56
57         Create an overload for equalIgnoringASCIICase for string literals.
58
59         * wtf/text/StringImpl.h:
60         (WTF::equalIgnoringASCIICase): Use a non-templated helper function.
61         * wtf/text/StringImpl.cpp:
62         (WTF::equalIgnoringASCIICase): Implement it.
63         * wtf/text/StringView.h:
64         (WTF::equalIgnoringASCIICase): Use a non-templated helper function.
65         * wtf/text/StringView.cpp:
66         (WTF::equalIgnoringASCIICase): Implement it.
67         * wtf/text/WTFString.h:
68         (WTF::equalIgnoringASCIICase): Delegate to StringImpl's implementation.
69
70 2015-05-14  Žan Doberšek  <zdobersek@igalia.com>
71
72         [GTK] RunLoop constructor should properly retrieve or establish the thread-default GMainContext
73         https://bugs.webkit.org/show_bug.cgi?id=144732
74
75         Reviewed by Carlos Garcia Campos.
76
77         RunLoop constructor in the GTK implementation should use the
78         existing thread-default context, create a new one if not on
79         the main thread, or use the global-default one if on the main
80         thread.
81
82         In RunLoop::run(), the GMainContext should then be pushed as
83         the thread-default before calling g_main_loop_run(), and popped
84         off when the main loop stops.
85
86         * wtf/gtk/RunLoopGtk.cpp:
87         (WTF::RunLoop::RunLoop):
88         (WTF::RunLoop::run):
89
90 2015-05-13  Oliver Hunt  <oliver@apple.com>
91        Ensure that all the smart pointer types in WTF clear their pointer before deref
92        https://bugs.webkit.org/show_bug.cgi?id=143789
93
94        Reviewed by Ryosuke Niwa.
95
96        In order to prevent use after free bugs caused by destructors
97        that end up trying to access the smart pointer itself, we should
98        make sure we always clear the m_ptr field before calling deref.
99
100        Essentially the UaF path is:
101        struct Foo : RefCounted<Foo> {
102          Wibble* m_wibble;
103          void doSomething();
104          ~Foo() { m_wibble->doSomethingLikeCleanup(); }
105        };
106
107        struct Wibble {
108          void doSomethingLikeCleanup()
109          {
110            if (m_foo) {
111                /* if this branch is not here we get a null deref */
112                m_foo->doSomething();
113            }
114          }
115          void replaceFoo(Foo* foo) { m_foo = foo; }
116          RefPtr<Foo> m_foo;
117        };
118
119        Wibble* someWibble = /* a Wibble with m_foo->m_refCount == 1 */;
120                             /* and m_foo points to someWibble       */;
121
122        someWibble->replaceFoo(someOtherFoo);
123        + someWibble->m_foo->m_ptr->deref();
124          + someWibble->m_foo->m_ptr->~Foo()
125            + someWibble->m_foo->m_ptr->m_wibble->doSomethingLikeCleanup()
126              + someWibble->m_foo->m_ptr->m_wibble /* someWibble */ ->m_foo->m_ptr /*logically dead*/ ->doSomething()
127
128        By clearing m_ptr first we either force a null pointer deref or
129        we force our code down a path that does not use the dead smart
130        pointer.
131
132        * wtf/PassRefPtr.h:
133        (WTF::PassRefPtr::~PassRefPtr):
134        * wtf/Ref.h:
135        (WTF::Ref::~Ref):
136        (WTF::Ref::operator=):
137        * wtf/RefPtr.h:
138        (WTF::RefPtr::~RefPtr):
139        * wtf/RetainPtr.h:
140        (WTF::RetainPtr::~RetainPtr):
141        (WTF::RetainPtr<T>::clear):
142
143 2015-05-12  Michael Saboff  <msaboff@apple.com>
144
145         If JSC cannot get executable memory, it shouldn't call madvise
146         https://bugs.webkit.org/show_bug.cgi?id=144931
147
148         Reviewed by Mark Lam.
149
150         Made calling madvise conditional on really getting mmapped memory.
151
152         * wtf/OSAllocatorPosix.cpp:
153         (WTF::OSAllocator::reserveUncommitted):
154
155 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
156
157         [Win] Move Windows build target to Windows 7 (or newer)
158         https://bugs.webkit.org/show_bug.cgi?id=144890
159         <rdar://problem/20707307>
160
161         Reviewed by Anders Carlsson.
162
163         Update linked SDK and minimal Windows level to be compatible with
164         Windows 7 or newer.
165
166         * WTF.vcxproj/WTF.vcxproj:
167         * WTF.vcxproj/WTFGenerated.vcxproj:
168         * config.h:
169
170 2015-05-11  Carlos Garcia Campos  <cgarcia@igalia.com>
171
172         [GTK] WorkQueue objects are not released
173         https://bugs.webkit.org/show_bug.cgi?id=144824
174
175         Reviewed by Žan Doberšek.
176
177         Do not keep a reference of the WorkQueue for the entire life of
178         its worker thread, since every task scheduled on the WorkQueue
179         already takes a reference. Instead, take a reference of the main
180         loop to make sure that when the worker thread starts, the main
181         loop hasn't been released to avoid runtime warnings (see
182         webkit.org/b/140998). Also removed the g_main_context_pop_thread_default()
183         from the thread body, since the thread-specific context queue will
184         be freed anyway when the thread exits.
185         If the WorkQueue is released early, before the thread has started,
186         schedule a main loop quit in the context, to make sure it will
187         be the first thing run by the main loop and the thread will exit.
188
189         * wtf/WorkQueue.h: Remove unused event loop mutex.
190         * wtf/gtk/WorkQueueGtk.cpp:
191         (WTF::WorkQueue::platformInitialize):
192         (WTF::WorkQueue::platformInvalidate):
193
194 2015-05-09  Yoav Weiss  <yoav@yoav.ws>
195
196         Remove the PICTURE_SIZES build flag
197         https://bugs.webkit.org/show_bug.cgi?id=144679
198
199         Reviewed by Benjamin Poulain.
200
201         Removed the PICTURE_SIZES build time flag.
202
203         * wtf/FeatureDefines.h:
204
205 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
206
207         Remove convenience constructors for TextRun
208         https://bugs.webkit.org/show_bug.cgi?id=144752
209
210         Reviewed by Anders Carlsson.
211
212         No reason why StringView shouldn't have a StringImpl* constructor.
213
214         Test: StringView8Bit in TestWebKitAPI
215
216         * wtf/text/StringView.h: Add the constructor.
217
218 2015-05-08  Commit Queue  <commit-queue@webkit.org>
219
220         Unreviewed, rolling out r183996.
221         https://bugs.webkit.org/show_bug.cgi?id=144806
222
223         ASan detected use-after free (Requested by ap on #webkit).
224
225         Reverted changeset:
226
227         "Remove convenience constructors for TextRun"
228         https://bugs.webkit.org/show_bug.cgi?id=144752
229         http://trac.webkit.org/changeset/183996
230
231 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
232
233         Remove convenience constructors for TextRun
234         https://bugs.webkit.org/show_bug.cgi?id=144752
235
236         Reviewed by Anders Carlsson.
237
238         No reason why StringView shouldn't have a StringImpl* constructor.
239
240         Test: StringView8Bit in TestWebKitAPI
241
242         * wtf/text/StringView.h: Add the constructor.
243
244 2015-05-08  Andreas Kling  <akling@apple.com>
245
246         Optimize serialization of quoted JSON strings.
247         <https://webkit.org/b/144754>
248
249         Reviewed by Darin Adler.
250
251         Add a StringBuilder API for appending a quoted JSON string. This is used by
252         JSON.stringify() to implement efficient appending of strings while escaping
253         quotes, control characters and \uNNNN-style characters.
254
255         The main benefit comes from only doing a single buffer expansion up front,
256         instead of doing it every time we append something. The fudge factor is pretty
257         large, since the maximum number of output characters per input character is 6.
258
259         The first landing of this patch had two bugs in it:
260
261         - Made \uNNNN escapes uppercase hexadecimal instead of lowercase.
262         - Didn't preallocate enough space for 8-bit input strings.
263
264         Both were caught by existing tests on our bots, and both were due to last-minute
265         changes before landing. :/
266
267         * wtf/text/StringBuilder.cpp:
268         (WTF::appendQuotedJSONStringInternal):
269         (WTF::StringBuilder::appendQuotedJSONString):
270         * wtf/text/StringBuilder.h:
271
272 2015-05-07  Commit Queue  <commit-queue@webkit.org>
273
274         Unreviewed, rolling out r183961.
275         https://bugs.webkit.org/show_bug.cgi?id=144784
276
277         Broke js/dom/JSON-stringify.html (Requested by kling on
278         #webkit).
279
280         Reverted changeset:
281
282         "Optimize serialization of quoted JSON strings."
283         https://bugs.webkit.org/show_bug.cgi?id=144754
284         http://trac.webkit.org/changeset/183961
285
286 2015-05-07  Andreas Kling  <akling@apple.com>
287
288         Optimize serialization of quoted JSON strings.
289         <https://webkit.org/b/144754>
290
291         Reviewed by Darin Adler.
292
293         Add a StringBuilder API for appending a quoted JSON string. This is used by
294         JSON.stringify() to implement efficient appending of strings while escaping
295         quotes, control characters and \uNNNN-style characters.
296
297         The main benefit comes from only doing a single buffer expansion up front,
298         instead of doing it every time we append something. The fudge factor is pretty
299         large for 16-bit strings, since the maximum number of output characters per
300         input character is 6.
301
302         * wtf/text/StringBuilder.cpp:
303         (WTF::appendQuotedJSONStringInternal):
304         (WTF::StringBuilder::appendQuotedJSONString):
305         * wtf/text/StringBuilder.h:
306
307 2015-05-07  Martin Robinson  <mrobinson@igalia.com>
308
309         [GTK] All spell checking layout tests fail
310         https://bugs.webkit.org/show_bug.cgi?id=144648
311
312         Reviewed by Carlos Garcia Campos.
313
314         * wtf/Platform.h: Activate UNIFIED_TEXT_CHECKING for GTK+.
315
316 2015-05-07  Dan Bernstein  <mitz@apple.com>
317
318         <rdar://problem/19317140> [Xcode] Remove usage of AspenFamily.xcconfig in Source/
319         https://bugs.webkit.org/show_bug.cgi?id=144727
320
321         Reviewed by Darin Adler.
322
323         * Configurations/Base.xcconfig: Don’t include AspenFamily.xcconfig, and define
324         INSTALL_PATH_PREFIX and LD_DYLIB_INSTALL_NAME for the iOS 8.x Simulator.
325
326 2015-05-07  Žan Doberšek  <zdobersek@igalia.com>
327
328         [GTK] Clean up RunLoop implementation
329         https://bugs.webkit.org/show_bug.cgi?id=144729
330
331         Reviewed by Carlos Garcia Campos.
332
333         Clean up the RunLoop implementation for the GTK port,
334         removing unnecessary methods and using simpler variable names.
335
336         Nested GMainLoops in RunLoop::run() are now created for the
337         RunLoop's GMainContext, and not for the default context (enforced
338         through the null argument to g_main_loop_new()).
339
340         * wtf/RunLoop.h:
341         * wtf/gtk/RunLoopGtk.cpp:
342         (WTF::RunLoop::RunLoop):
343         (WTF::RunLoop::~RunLoop):
344         (WTF::RunLoop::run):
345         (WTF::RunLoop::stop):
346         (WTF::RunLoop::wakeUp):
347         (WTF::RunLoop::TimerBase::start):
348         (WTF::RunLoop::innermostLoop): Deleted.
349         (WTF::RunLoop::pushNestedMainLoop): Deleted.
350         (WTF::RunLoop::popNestedMainLoop): Deleted.
351
352 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
353
354         [GTK] Async operations running in the WorkQueue thread should schedule their sources to the WorkQueue main lopp
355         https://bugs.webkit.org/show_bug.cgi?id=144541
356
357         Reviewed by Žan Doberšek.
358
359         They are currently sent to the main thread run loop, because we
360         are not setting the WorkQueue main context as the default one in
361         the worker thread.
362
363         * wtf/gtk/WorkQueueGtk.cpp:
364         (WTF::WorkQueue::platformInitialize): Call
365         g_main_context_push_thread_default() to set the WorkQueue main
366         context as the default of the thread before running the main loop,
367         and g_main_context_pop_thread_default() when the main loop quits.
368
369 2015-05-04  Commit Queue  <commit-queue@webkit.org>
370
371         Unreviewed, rolling out r183661.
372         https://bugs.webkit.org/show_bug.cgi?id=144594
373
374         Caused ~3.5MB regression on membuster(!) (Requested by kling_
375         on #webkit).
376
377         Reverted changeset:
378
379         "Decrease minimum Vector size."
380         https://bugs.webkit.org/show_bug.cgi?id=144453
381         http://trac.webkit.org/changeset/183661
382
383 2015-05-04  Zan Dobersek  <zdobersek@igalia.com>
384
385         [WTF] Remove Functional.h inclusions
386         https://bugs.webkit.org/show_bug.cgi?id=144400
387
388         Reviewed by Darin Adler.
389
390         Remove most of the Functional.h header inclusions. The header is preserved
391         since it's still used by older versions of Safari, and for the callOnMainThread()
392         stub in DeprecatedSymbolsUsedBySafari.mm.
393
394         * wtf/MainThread.cpp:
395         * wtf/RunLoop.h:
396         * wtf/WorkQueue.cpp:
397         * wtf/WorkQueue.h:
398         * wtf/efl/DispatchQueueEfl.h:
399         * wtf/efl/DispatchQueueWorkItemEfl.h:
400
401 2015-05-02  Commit Queue  <commit-queue@webkit.org>
402
403         Unreviewed, rolling out r183722.
404         https://bugs.webkit.org/show_bug.cgi?id=144534
405
406         Made all the tests assert (Requested by ap on #webkit).
407
408         Reverted changeset:
409
410         "Generated static StringImpls should have static flag set."
411         https://bugs.webkit.org/show_bug.cgi?id=144516
412         http://trac.webkit.org/changeset/183722
413
414 2015-05-02  Andreas Kling  <akling@apple.com>
415
416         Generated static StringImpls should have static flag set.
417         <https://webkit.org/b/144516>
418
419         Reviewed by Darin Adler.
420
421         Discovered this while tracking down a string ref leak. Turns out that the strings
422         generated by StaticString.pm were not getting the static flag set on them.
423
424         The only practical difference from this AFAICT is that now the garbage collector
425         will correctly see that these strings have no extra memory cost to worry about.
426
427         * wtf/text/StringImpl.h:
428
429 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
430
431         USE(...) macro should expect unprefixed variables
432         https://bugs.webkit.org/show_bug.cgi?id=144454
433
434         Reviewed by Daniel Bates.
435
436         * wtf/Assertions.cpp: Replace all occurrences WTF_USE with USE.
437         * wtf/Platform.h: Replace all occurrences WTF_USE with USE. Modify the USE
438         macro to look for unprefixed variables.
439         * wtf/WTFThreadData.h: Replace all occurrences WTF_USE with USE.
440
441 2015-05-01  Joseph Pecoraro  <pecoraro@apple.com>
442
443         Enable ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX by default on all ports (Windows was missed)
444         https://bugs.webkit.org/show_bug.cgi?id=144495
445
446         Reviewed by Csaba Osztrogonác.
447
448         * wtf/FeatureDefines.h:
449         This covers all ports that haven't defined the flag otherwise.
450
451 2015-04-30  Alex Christensen  <achristensen@webkit.org>
452
453         Decrease minimum Vector size.
454         https://bugs.webkit.org/show_bug.cgi?id=144453
455
456         Reviewed by Andreas Kling.
457
458         * wtf/Vector.h:
459         Make the default min size 4 to save memory on small Vectors.
460
461 2015-04-30  Yusuke Suzuki  <utatane.tea@gmail.com>
462
463         Use the default hash value for Symbolized StringImpl
464         https://bugs.webkit.org/show_bug.cgi?id=144347
465
466         Reviewed by Darin Adler.
467
468         Use a default hash value calculation for symbolized StringImpl.
469
470         * wtf/text/StringImpl.cpp:
471         (WTF::StringImpl::createSymbol):
472         * wtf/text/StringImpl.h:
473         (WTF::StringImpl::StringImpl):
474         (WTF::StringImpl::symbolAwareHash):
475         (WTF::StringImpl::existingSymbolAwareHash):
476         (WTF::StringImpl::hashForSymbol):
477         * wtf/text/StringStatics.cpp:
478         (WTF::StringImpl::nextHashForSymbol):
479         (WTF::StringImpl::hashAndFlagsForSymbol): Deleted.
480
481 2015-04-29  Alexey Proskuryakov  <ap@apple.com>
482
483         LazyNeverDestroyed is not thread safe in debug builds, causing assertions
484         https://bugs.webkit.org/show_bug.cgi?id=144378
485
486         Reviewed by Darin Adler.
487
488         * wtf/NeverDestroyed.h:
489
490 2015-04-28  Geoffrey Garen  <ggaren@apple.com>
491
492         It shouldn't take 1846 lines of code and 5 FIXMEs to sort an array.
493         https://bugs.webkit.org/show_bug.cgi?id=144013
494
495         Reviewed by Mark Lam.
496
497         Remove this custom tree implementation because it is unused. (It was
498         previously used to achieve a stable array sort in certain cases.)
499
500         * WTF.vcxproj/WTF.vcxproj:
501         * WTF.vcxproj/WTF.vcxproj.filters:
502         * WTF.xcodeproj/project.pbxproj:
503         * wtf/AVLTree.h: Removed.
504         * wtf/CMakeLists.txt:
505
506 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
507
508         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
509         https://bugs.webkit.org/show_bug.cgi?id=132159
510
511         Reviewed by Darin Adler.
512
513         * wtf/Platform.h:
514
515         Opt-in using ENABLE(PLATFORM_FONT_LOOKUP)
516
517 2015-04-29  Yusuke Suzuki  <utatane.tea@gmail.com>
518
519         REGRESSION (r183373): ASSERT failed in wtf/SHA1.h
520         https://bugs.webkit.org/show_bug.cgi?id=144257
521
522         Reviewed by Darin Adler.
523
524         * wtf/SHA1.h:
525         (WTF::SHA1::addBytes):
526
527 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
528
529         [CMake] [GTK] Organize and clean up unused CMake variables
530         https://bugs.webkit.org/show_bug.cgi?id=144364
531
532         Reviewed by Gyuyoung Kim.
533
534         * wtf/PlatformGTK.cmake: Add variables specific to this project.
535
536 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
537
538         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
539         https://bugs.webkit.org/show_bug.cgi?id=144304
540
541         Reviewed by Geoffrey Garen.
542
543         No longer check ENABLE_LLINT_C_LOOP to determine the value of ENABLE_JIT.
544
545         * wtf/Platform.h:
546
547 2015-04-28  Commit Queue  <commit-queue@webkit.org>
548
549         Unreviewed, rolling out r183514.
550         https://bugs.webkit.org/show_bug.cgi?id=144359
551
552         It broke cloop test bots (Requested by mcatanzaro on #webkit).
553
554         Reverted changeset:
555
556         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
557         https://bugs.webkit.org/show_bug.cgi?id=144304
558         http://trac.webkit.org/changeset/183514
559
560 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
561
562         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
563         https://bugs.webkit.org/show_bug.cgi?id=144304
564
565         Reviewed by Geoffrey Garen.
566
567         No longer check ENABLE_LLINT_C_LOOP to determine the value of ENABLE_JIT.
568
569         * wtf/Platform.h:
570
571 2015-04-28  Alex Christensen  <achristensen@webkit.org>
572
573         Properly reset deleted count when clearing HashTables.
574         https://bugs.webkit.org/show_bug.cgi?id=144343
575
576         Reviewed by Andreas Kling.
577
578         * wtf/HashTable.h:
579         (WTF::KeyTraits>::clear):
580         Reset m_deletedCount, which appears to have been forgotten.
581
582 2015-04-28  Alex Christensen  <achristensen@webkit.org>
583
584         [Content Extensions] Use less memory for CombinedURLFilters.
585         https://bugs.webkit.org/show_bug.cgi?id=144290
586
587         Reviewed by Andreas Kling.
588
589         * wtf/Forward.h:
590         * wtf/Vector.h:
591         Added a minCapacity template parameter to allow changing the minimum size of an 
592         allocated buffer. The default minCapacity is kept at 16 unless otherwise specified 
593         to have no change on existing code, but this could be changed later. A smaller 
594         default minCapacity would use less memory with small Vectors but spend more time 
595         copying when expanding to large Vectors.
596
597 2015-04-27  Brent Fulgham  <bfulgham@apple.com>
598
599         [Win] Deactivate WebGL until Windows tests work properly
600         https://bugs.webkit.org/show_bug.cgi?id=144291
601         <rdar://problem/20707307>
602
603         Reviewed by Zalan Bujtas.
604
605         * wtf/FeatureDefines.h: Force WebGL off for Windows builds.
606
607 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
608
609         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
610         https://bugs.webkit.org/show_bug.cgi?id=144193
611
612         Reviewed by Darin Adler.
613
614         * wtf/FeatureDefines.h:
615         * wtf/Platform.h:
616
617 2015-04-22  Martin Robinson  <mrobinson@igalia.com>
618
619         [CMake] Autogenerate cmakeconfig.h.cmake
620         https://bugs.webkit.org/show_bug.cgi?id=143997
621
622         Reviewed by Csaba Osztrogonác.
623
624         * wtf/Platform.h: Move a GTK-specific setting from cmakeconfig.h to here.
625
626 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
627
628         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
629         https://bugs.webkit.org/show_bug.cgi?id=144182
630
631         Reviewed by Simon Fraser.
632
633         * wtf/FeatureDefines.h: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
634
635 2015-04-24  Commit Queue  <commit-queue@webkit.org>
636
637         Unreviewed, rolling out r183288.
638         https://bugs.webkit.org/show_bug.cgi?id=144189
639
640         Made js/sort-with-side-effecting-comparisons.html time out in
641         debug builds (Requested by ap on #webkit).
642
643         Reverted changeset:
644
645         "It shouldn't take 1846 lines of code and 5 FIXMEs to sort an
646         array."
647         https://bugs.webkit.org/show_bug.cgi?id=144013
648         http://trac.webkit.org/changeset/183288
649
650 2015-04-21  Geoffrey Garen  <ggaren@apple.com>
651
652         It shouldn't take 1846 lines of code and 5 FIXMEs to sort an array.
653         https://bugs.webkit.org/show_bug.cgi?id=144013
654
655         Reviewed by Mark Lam.
656
657         Remove this custom tree implementation because it is unused. (It was
658         previously used to achieve a stable array sort in certain cases.)
659
660         * WTF.vcxproj/WTF.vcxproj:
661         * WTF.vcxproj/WTF.vcxproj.filters:
662         * WTF.xcodeproj/project.pbxproj:
663         * wtf/AVLTree.h: Removed.
664         * wtf/CMakeLists.txt:
665
666 2015-04-24  Darin Adler  <darin@apple.com>
667
668         Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
669         https://bugs.webkit.org/show_bug.cgi?id=128007
670
671         Reviewed by Anders Carlsson.
672
673         * WTF.vcxproj/WTF.vcxproj: Removed OwnPtr source files.
674         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
675         * WTF.xcodeproj/project.pbxproj: Ditto.
676         * wtf/CMakeLists.txt: Ditto.
677
678         * wtf/Forward.h: Removed OwnPtr and PassOwnPtr.
679         * wtf/HashTraits.h: Ditto.
680
681         * wtf/OwnPtr.h: Removed.
682         * wtf/OwnPtrCommon.h: Removed.
683         * wtf/PassOwnPtr.h: Removed.
684
685         * wtf/SizeLimits.cpp: Removed OwnPtr.
686         * wtf/VectorTraits.h: Removed OwnPtr specialization.
687
688 2015-04-23  Jer Noble  <jer.noble@apple.com>
689
690         Disable HAVE_AVKIT on AppleTV
691         https://bugs.webkit.org/show_bug.cgi?id=144142
692
693         Reviewed by Dan Bernstein.
694
695         * wtf/Platform.h:
696
697 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
698
699         [iOS] WebKit services should inherit environment variables for home
700         https://bugs.webkit.org/show_bug.cgi?id=144078
701         rdar://problem/20571678
702
703         Reviewed by Dan Bernstein.
704
705         * wtf/spi/darwin/XPCSPI.h: Added xpc_copy_bootstrap and xpc_dictionary_apply.
706
707 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
708
709         Undo the WTF part of the previous build fix, we don't use private headers in WTF.
710
711         * WTF.xcodeproj/project.pbxproj:
712
713 2015-04-23  Alexey Proskuryakov  <ap@apple.com>
714
715         Build fix.
716
717         * WTF.xcodeproj/project.pbxproj: Make RAMSize.h a private header, now that it's used
718         from outside WTF.
719
720 2015-04-23  Andreas Kling  <akling@apple.com>
721
722         There should only be one way to get the system memory size.
723         <https://webkit.org/b/144081>
724
725         Reviewed by Antti Koivisto.
726
727         Merge all the logic from other RAM size fetcher helpers into WTF's.
728
729         Darwin ports now use host_info() instead of sysctl(), since that was the more common way
730         of doing this.
731
732         Also bumped the fallback answer from 128 MB to 512 MB to bring it closer to today's hardware.
733
734         Finally, the number is rounded up to the next multiple of 128 MB, to avoid misunderstandings
735         on some systems where the number returned by the kernel is slightly lower than the marketing
736         number. Removed the "fudging" that was used in some places, since this fixes that cleanly.
737
738         * wtf/RAMSize.cpp:
739         (WTF::computeRAMSize):
740
741 2015-04-22  Darin Adler  <darin@apple.com>
742
743         Eliminate remaining uses of OwnPtr and PassOwnPtr in WebCore outside the editing and platform directories
744         https://bugs.webkit.org/show_bug.cgi?id=143949
745
746         Reviewed by Andreas Kling.
747
748         * wtf/MathExtras.h:
749         (wtf_ceil): Deleted. This was a workaround for a bug that was introduced in Leopard and
750         fixed in Snow Leopard <rdar://problem/6286405>, so we don't need the workaround any more.
751
752 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
753
754         [Mac] In nightlies and local builds, WebKit services can get terminated under memory pressure
755         https://bugs.webkit.org/show_bug.cgi?id=144052
756         rdar://problem/19754404
757
758         Build fix. Landing a forward declaration that should have been part of the original patch.
759
760         * wtf/spi/darwin/XPCSPI.h:
761
762 2015-04-21  Chris Dumez  <cdumez@apple.com>
763
764         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
765         https://bugs.webkit.org/show_bug.cgi?id=143970
766
767         Reviewed by Darin Adler.
768
769         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
770         constructor explicit as it copies the vector and it is easy to call it
771         by mistake.
772
773         * wtf/RefCountedArray.h:
774         (WTF::RefCountedArray::RefCountedArray):
775         * wtf/Vector.h:
776
777 2015-04-21  Darin Adler  <darin@apple.com>
778
779         Remove some stray uses of OwnPtr and PassOwnPtr in WTF (outside of the template definitions and traits)
780         https://bugs.webkit.org/show_bug.cgi?id=143944
781
782         Reviewed by Andreas Kling.
783
784         * wtf/FilePrintStream.h: Removed unneeded include.
785         * wtf/HashTable.h: Fixed class template name in comment.
786         * wtf/HashTraits.h: Removed unneeded forward declaration.
787         * wtf/ListHashSet.h: Removed unneeded includes.
788         * wtf/ThreadingWin.cpp: Removed unneeded includes.
789         (WTF::wtfThreadEntryPoint): Changed code to use unique_ptr.
790         (WTF::createThreadInternal): Changed code to use make_unique and release.
791         * wtf/efl/RunLoopEfl.cpp: Removed unneeded includes.
792
793 2015-04-19  Darin Adler  <darin@apple.com>
794
795         Update RefPtr documentation and deprecation
796         https://bugs.webkit.org/show_bug.cgi?id=143936
797
798         Reviewed by Andreas Kling.
799
800         * WTF.vcxproj/WTF.vcxproj: Removed PassRef.h
801         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
802         * WTF.xcodeproj/project.pbxproj: Ditto.
803         * wtf/CMakeLists.txt: Ditto.
804
805 2015-04-17  Alexey Proskuryakov  <ap@apple.com>
806
807         Use ASan poisoning to taint moved-out-of Refs
808         https://bugs.webkit.org/show_bug.cgi?id=143894
809         rdar://problem/19443723
810
811         Reviewed by Darin Adler.
812
813         * wtf/Ref.h: (WTF::Ref::~Ref):
814
815 2015-04-17  Alexey Proskuryakov  <ap@apple.com>
816
817         Remove unused BoundsCheckedPointer
818         https://bugs.webkit.org/show_bug.cgi?id=143896
819
820         Reviewed by Geoffrey Garen.
821
822         * WTF.vcxproj/WTF.vcxproj:
823         * WTF.vcxproj/WTF.vcxproj.filters:
824         * WTF.xcodeproj/project.pbxproj:
825         * wtf/BoundsCheckedPointer.h: Removed.
826         * wtf/CMakeLists.txt:
827
828 2015-04-16  Yusuke Suzuki  <utatane.tea@gmail.com>
829
830         [ES6] Implement Symbol.for and Symbol.keyFor
831         https://bugs.webkit.org/show_bug.cgi?id=143404
832
833         Reviewed by Geoffrey Garen.
834
835         When we register symbolized StringImpl* into SymbolRegistry, symbolized StringImpl* is aware of that.
836         And when destructing it, it removes its reference from SymbolRegistry as if atomic StringImpl do so with AtomicStringTable.
837         While AtomicStringTable (in WebCore case) exists in thread local storage,
838         SymbolRegistry exists per VM and StringImpl* has a reference to the registered SymbolRegistry.
839
840         Since StringImpl has isSymbol etc. members, it's class is aware of Symbol use cases.
841         So introduce SymbolRegistry in WTF layers as if AtomicStringTable.
842
843         * WTF.vcxproj/WTF.vcxproj:
844         * WTF.vcxproj/WTF.vcxproj.filters:
845         * WTF.xcodeproj/project.pbxproj:
846         * wtf/CMakeLists.txt:
847         * wtf/text/AtomicString.cpp:
848         (WTF::AtomicString::addSlowCase):
849         (WTF::AtomicString::findSlowCase):
850         (WTF::AtomicString::findInternal):
851         (WTF::AtomicString::find): Deleted.
852         * wtf/text/AtomicString.h:
853         (WTF::AtomicString::find):
854         * wtf/text/StringImpl.cpp:
855         (WTF::StringImpl::~StringImpl):
856         (WTF::StringImpl::createSymbol):
857         (WTF::StringImpl::createSymbolEmpty):
858         * wtf/text/StringImpl.h:
859         (WTF::StringImpl::StringImpl):
860         (WTF::StringImpl::extractFoldedStringInSymbol):
861         (WTF::StringImpl::symbolRegistry):
862         (WTF::StringImpl::createSymbolEmpty): Deleted.
863         * wtf/text/SymbolRegistry.cpp: Copied from Source/JavaScriptCore/runtime/SymbolConstructor.h.
864         (WTF::SymbolRegistry::~SymbolRegistry):
865         (WTF::SymbolRegistry::symbolForKey):
866         (WTF::SymbolRegistry::keyForSymbol):
867         (WTF::SymbolRegistry::remove):
868         * wtf/text/SymbolRegistry.h: Added.
869         (WTF::SymbolRegistryKey::hash):
870         (WTF::SymbolRegistryKey::impl):
871         (WTF::SymbolRegistryKey::isHashTableDeletedValue):
872         (WTF::SymbolRegistryKey::hashTableDeletedValue):
873         (WTF::DefaultHash<SymbolRegistryKey>::Hash::hash):
874         (WTF::DefaultHash<SymbolRegistryKey>::Hash::equal):
875         (WTF::HashTraits<SymbolRegistryKey>::isEmptyValue):
876         (WTF::SymbolRegistryKey::SymbolRegistryKey):
877
878 2015-04-16  Antti Koivisto  <antti@apple.com>
879
880         Use CommonCrypto for SHA1 and MD5
881         https://bugs.webkit.org/show_bug.cgi?id=143826
882
883         Reviewed by Anders Carlsson.
884
885         CommonCrypto SHA1 implementation is ~4x faster than the naive WTF one. Use it when available.
886
887         These are covered by existing API tests.
888
889         * wtf/MD5.cpp:
890         (WTF::MD5::MD5):
891         (WTF::MD5::addBytes):
892         (WTF::MD5::checksum):
893         * wtf/MD5.h:
894         * wtf/SHA1.cpp:
895         (WTF::SHA1::SHA1):
896         (WTF::SHA1::addBytes):
897         (WTF::SHA1::computeHash):
898
899             Remove the side effect where computeHash resets the state. No one relies on it.
900
901         (WTF::SHA1::hexDigest):
902         (WTF::SHA1::computeHexDigest):
903         * wtf/SHA1.h:
904
905 2015-04-16  Csaba Osztrogonác  <ossy@webkit.org>
906
907         Remove the unnecessary WTF_CHANGES define
908         https://bugs.webkit.org/show_bug.cgi?id=143825
909
910         Reviewed by Andreas Kling.
911
912         * config.h:
913
914 2015-04-15  Руслан Ижбулатов  <lrn1986@gmail.com>
915
916         Harmonize binary semaphore ifdefs
917
918         They should be either OS(WINDOWS) (in which case we'd need
919         BinarySemaphoreWin.cpp, which is not shipped by WebKitGTK)
920         or PLATFORM(WIN) (in which case Mutex/ThreadCondition-based
921         implementation is used).
922
923         This fixes errors like:
924           CXX      Source/WTF/wtf/threads/libWTF_la-BinarySemaphore.lo
925         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In constructor 'WTF::BinarySemaphore::BinarySemaphore()':
926         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:34:7: error: class 'WTF::BinarySemaphore' does not have any field named 'm_isSet'
927              : m_isSet(false)
928                ^
929         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In member function 'void WTF::BinarySemaphore::signal()':
930         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:44:24: error: 'm_mutex' was not declared in this scope
931              MutexLocker locker(m_mutex);
932                                 ^
933         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:46:5: error: 'm_isSet' was not declared in this scope
934              m_isSet = true;
935              ^
936         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:47:5: error: 'm_condition' was not declared in this scope
937              m_condition.signal();
938              ^
939         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In member function 'bool WTF::BinarySemaphore::wait(double)':
940         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:52:24: error: 'm_mutex' was not declared in this scope
941              MutexLocker locker(m_mutex);
942                                 ^
943         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:55:13: error: 'm_isSet' was not declared in this scope
944              while (!m_isSet) {
945                      ^
946         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:56:21: error: 'm_condition' was not declared in this scope
947                  timedOut = !m_condition.timedWait(m_mutex, absoluteTime);
948                              ^
949         ../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:62:5: error: 'm_isSet' was not declared in this scope
950              m_isSet = false;
951              ^
952         GNUmakefile:52762: recipe for target 'Source/WTF/wtf/threads/libWTF_la-BinarySemaphore.lo' failed
953
954         [W32] Inconsistent ifdefs in BinarySemaphore.h and BinarySemaphore.cpp
955         https://bugs.webkit.org/show_bug.cgi?id=143756
956
957         Reviewed by Darin Adler.
958
959         * wtf/threads/BinarySemaphore.h:
960
961 2015-04-12  Michael Catanzaro  <mcatanzaro@igalia.com>
962
963         Fix -Wparentheses warning with GCC 5 in SaturatedArithmetic.h
964         https://bugs.webkit.org/show_bug.cgi?id=143457
965
966         Reviewed by Benjamin Poulain.
967
968         Tested by WTF.SaturatedArithmeticAddition and WTF.SaturatedArithmeticSubtraction.
969
970         * wtf/SaturatedArithmetic.h:
971         (signedAddOverflows): Use && instead of & to avoid triggering -Wparentheses in newer
972         versions of GCC and Clang, and to improve the clarity of the function.
973         (signedSubtractOverflows): Changed correspondingly, although there was no warning here.
974
975 2015-04-08  Sam Weinig  <sam@webkit.org>
976
977         Allow LaunchServices to handle URLs on link navigations
978         <rdar://problem/19446826>
979         https://bugs.webkit.org/show_bug.cgi?id=143544
980
981         Reviewed by Anders Carlsson.
982
983         * wtf/Platform.h:
984         Add HAVE macro for this functionality.
985
986 2015-04-09  Andy Estes  <aestes@apple.com>
987
988         [Cocoa] Add a HAVE(AVKIT) and use it
989         https://bugs.webkit.org/show_bug.cgi?id=143593
990
991         Reviewed by David Kilzer.
992
993         * wtf/Platform.h: Defined HAVE(AVKIT) to be true on all Cocoa platforms except Watch OS.
994
995 2015-04-09  Andy Estes  <aestes@apple.com>
996
997         [Content Filtering] Add a HAVE(PARENTAL_CONTROLS) and use it
998         https://bugs.webkit.org/show_bug.cgi?id=143559
999
1000         Reviewed by David Kilzer.
1001
1002         Added PLATFORM(WATCHOS). Used PLATFORM() since Watch OS is just a variant of OS(IOS).
1003         Defined HAVE(PARENTAL_CONTROLS) to be true on all Cocoa platforms except Watch OS.
1004
1005         * wtf/Platform.h:
1006
1007 2015-04-08  Alex Christensen  <achristensen@webkit.org> and Patrick Gansterer  <paroga@webkit.org>
1008
1009         Add CMake build system for WinCairo port.
1010         https://bugs.webkit.org/show_bug.cgi?id=115944
1011
1012         Reviewed by Chris Dumez.
1013
1014         * wtf/FeatureDefines.h:
1015         * wtf/PlatformWin.cmake:
1016
1017 2015-04-05  Antti Koivisto  <antti@apple.com>
1018
1019         Bloom filter should support longer hashes
1020         https://bugs.webkit.org/show_bug.cgi?id=143419
1021
1022         Reviewed by Dan Bernstein.
1023
1024         It currently supports 'unsigned' hash only which is inconvenient and doesn't have enough independent bits for larger filters.
1025
1026         Support arbitrarily sized hashes of type std::array<uint8_t, hashSize> (like SHA1::Digest and MD5::Digest).
1027
1028         * wtf/BloomFilter.h:
1029         (WTF::BloomFilter<keyBits>::keysFromHash):
1030         (WTF::BloomFilter<keyBits>::mayContain):
1031         (WTF::BloomFilter<keyBits>::add):
1032
1033 2015-04-03  Antti Koivisto  <antti@apple.com>
1034
1035         Add non-counting Bloom filter implementation
1036         https://bugs.webkit.org/show_bug.cgi?id=143366
1037
1038         Reviewed by Sam Weinig.
1039
1040         Add a traditional single-bit-per-bucket Bloom filter in addition to the existing counting implementation.
1041
1042         - rename BloomFilter -> CountingBloomFilter.
1043         - add a new basic BloomFilter type.
1044         - update some terminology to match http://en.wikipedia.org/wiki/Bloom_filter and modernize the code a bit.
1045         - add API tests.
1046
1047         * wtf/BloomFilter.h:
1048         (WTF::BloomFilter::BloomFilter):
1049         (WTF::BloomFilter::add):
1050
1051             Also support merging.
1052
1053         (WTF::BloomFilter::mayContain):
1054         (WTF::BloomFilter::arrayIndex):
1055         (WTF::BloomFilter::bitMask):
1056         (WTF::BloomFilter<keyBits>::mayContain):
1057         (WTF::BloomFilter<keyBits>::add):
1058         (WTF::BloomFilter<keyBits>::isBitSet):
1059         (WTF::BloomFilter<keyBits>::setBit):
1060         (WTF::BloomFilter<keyBits>::clear):
1061         (WTF::CountingBloomFilter::CountingBloomFilter):
1062         (WTF::CountingBloomFilter::mayContain):
1063         (WTF::CountingBloomFilter::firstBucket):
1064         (WTF::CountingBloomFilter::secondBucket):
1065         (WTF::CountingBloomFilter<keyBits>::add):
1066         (WTF::CountingBloomFilter<keyBits>::remove):
1067         (WTF::CountingBloomFilter<keyBits>::clear):
1068         (WTF::CountingBloomFilter<keyBits>::likelyEmpty):
1069         (WTF::CountingBloomFilter<keyBits>::isClear):
1070         (WTF::BloomFilter::maximumCount): Deleted.
1071         (WTF::BloomFilter::firstSlot): Deleted.
1072         (WTF::BloomFilter::secondSlot): Deleted.
1073         (WTF::BloomFilter<keyBits>::remove): Deleted.
1074         (WTF::BloomFilter<keyBits>::likelyEmpty): Deleted.
1075         (WTF::BloomFilter<keyBits>::isClear): Deleted.
1076
1077 015-04-01  Antti Koivisto  <antti@apple.com>
1078
1079         Value assignment operator of Optional should be stricter
1080         https://bugs.webkit.org/show_bug.cgi?id=143303
1081
1082         Reviewed by Andreas Kling.
1083
1084         struct Foo { mutable Optional<std::chrono::seconds> s; };
1085         Foo foo, foo2;
1086         foo = foo2;
1087
1088         doesn't build because it tries to use wrong operator=.
1089
1090         * wtf/Optional.h:
1091
1092             Add enable_if test similar to std::experimental::optional.
1093
1094 2015-04-01  Alex Christensen  <achristensen@webkit.org>
1095
1096         Progress towards CMake on Windows and Mac.
1097         https://bugs.webkit.org/show_bug.cgi?id=143293
1098
1099         Reviewed by Filip Pizlo.
1100
1101         * wtf/CMakeLists.txt:
1102         Don't use bmalloc on Windows yet.
1103         * wtf/FeatureDefines.h:
1104         Temporarily disabled WebGL on Windows CMake builds.
1105         * wtf/PlatformMac.cmake:
1106         Tell open source builders where to find unicode headers.
1107
1108 2015-03-31  Alexey Proskuryakov  <ap@apple.com>
1109
1110         Fix the build after <http://trac.webkit.org/changeset/182205>.
1111
1112         * wtf/text/StringImpl.h: (WTF::StringImpl::extractFoldedStringInSymbol):
1113         A function cannot be both exported and inline.
1114
1115 2015-03-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1116
1117         Clean up Identifier factories to clarify the meaning of StringImpl*
1118         https://bugs.webkit.org/show_bug.cgi?id=143146
1119
1120         Reviewed by Filip Pizlo.
1121
1122         Introduce StringKind into `StringImpl`. There's 3 kinds
1123         1. StringNormal (non-atomic, non-symbol)
1124         2. StringAtomic (atomic, non-symbol)
1125         3. StringSymbol (non-atomic, symbol)
1126         They are mutually exclusive.
1127
1128         * wtf/text/AtomicString.cpp:
1129         (WTF::AtomicString::addSlowCase):
1130         (WTF::AtomicString::findSlowCase):
1131         When registering a string into AtomicStringTable,
1132         it should not be a symbol string
1133         because symbol and atomic types are mutually exclusive.
1134         When a symbol string comes, we extract an owner string
1135         from a symbol string by using `StringImpl::extractFoldedStringInSymbol()`.
1136         It always succeeds because a symbol (non empty) string
1137         is always BufferSubstring and has an owner string.
1138         Empty symbol string doesn't have an owner string.
1139         This case is filtered by `!string.length()` guard.
1140         * wtf/text/AtomicString.h:
1141         (WTF::AtomicString::add):
1142         (WTF::AtomicString::addWithStringTableProvider):
1143         * wtf/text/StringImpl.cpp:
1144         (WTF::StringImpl::~StringImpl):
1145         (WTF::StringImpl::createSymbol):
1146         (WTF::StringImpl::createUnique): Deleted.
1147         * wtf/text/StringImpl.h:
1148         (WTF::StringImpl::StringImpl):
1149         (WTF::StringImpl::createSymbolEmpty):
1150         (WTF::StringImpl::flagIsAtomic):
1151         (WTF::StringImpl::flagIsSymbol):
1152         (WTF::StringImpl::maskStringKind):
1153         (WTF::StringImpl::stringKind):
1154         (WTF::StringImpl::isSymbol):
1155         (WTF::StringImpl::isAtomic):
1156         (WTF::StringImpl::setIsAtomic):
1157         (WTF::StringImpl::extractFoldedStringInSymbol):
1158         (WTF::StringImpl::createUniqueEmpty): Deleted.
1159         (WTF::StringImpl::flagIsUnique): Deleted.
1160         (WTF::StringImpl::isUnique): Deleted.
1161         * wtf/text/StringStatics.cpp:
1162         (WTF::StringImpl::hashAndFlagsForSymbol):
1163         (WTF::StringImpl::hashAndFlagsForUnique): Deleted.
1164
1165 2015-03-30  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1166
1167         [CMake][EFL] Remove redundant library link and include path
1168         https://bugs.webkit.org/show_bug.cgi?id=143221
1169
1170         Reviewed by Csaba Osztrogonác.
1171
1172         * wtf/PlatformEfl.cmake: Remove unnecessary library link and include path.
1173
1174 2015-03-27  Myles C. Maxfield  <mmaxfield@apple.com>
1175
1176         Support building WTF on Windows without Cygwin
1177         https://bugs.webkit.org/show_bug.cgi?id=143084
1178
1179         Reviewed by Brent Fulgham.
1180
1181         Windows doesn't have "touch".
1182
1183         * WTF.vcxproj/WTFGenerated.make:
1184
1185 2015-03-26  Alex Christensen  <achristensen@webkit.org>
1186
1187         Progress towards CMake on Mac.
1188         https://bugs.webkit.org/show_bug.cgi?id=143112
1189
1190         Reviewed by Chris Dumez.
1191
1192         * wtf/PlatformMac.cmake:
1193
1194 2015-03-25  Filip Pizlo  <fpizlo@apple.com>
1195
1196         Unreviewed, we have edited this file in 2015.
1197
1198         * wtf/Platform.h:
1199
1200 2015-03-25  Filip Pizlo  <fpizlo@apple.com>
1201
1202         Heap variables shouldn't end up in the stack frame
1203         https://bugs.webkit.org/show_bug.cgi?id=141174
1204
1205         Reviewed by Geoffrey Garen.
1206
1207         * wtf/FastBitVector.h:
1208         (WTF::FastBitVector::resize): Small change: don't resize if you don't have to resize.
1209
1210 2015-03-25  Filip Pizlo  <fpizlo@apple.com>
1211
1212         Change Atomic methods from using the_wrong_naming_conventions to using theRightNamingConventions. Also make seq_cst the default.
1213
1214         Rubber stamped by Geoffrey Garen.
1215
1216         * wtf/Atomics.h:
1217         (WTF::Atomic::load):
1218         (WTF::Atomic::store):
1219         (WTF::Atomic::compareExchangeWeak):
1220         (WTF::Atomic::compareExchangeStrong):
1221         (WTF::Atomic::compare_exchange_weak): Deleted.
1222         (WTF::Atomic::compare_exchange_strong): Deleted.
1223         * wtf/ByteSpinLock.h:
1224         (WTF::ByteSpinLock::lock):
1225         * wtf/SpinLock.h:
1226         (WTF::SpinLockBase::lock):
1227
1228 2015-03-24  Beth Dakin  <bdakin@apple.com>
1229
1230         Add events related to force click gesture
1231         https://bugs.webkit.org/show_bug.cgi?id=142836
1232         -and corresponding-
1233         rdar://problem/20210239
1234
1235         Reviewed by Dean Jackson.
1236
1237         New enable flag for the events.
1238         * wtf/FeatureDefines.h:
1239
1240 2015-03-23  Filip Pizlo  <fpizlo@apple.com>
1241
1242         JSC should have a low-cost asynchronous disassembler
1243         https://bugs.webkit.org/show_bug.cgi?id=142997
1244
1245         Reviewed by Mark Lam.
1246
1247         * wtf/StringPrintStream.h:
1248
1249 2015-03-22  Benjamin Poulain  <benjamin@webkit.org>
1250
1251         CSS Selectors: fix attribute case-insensitive matching of Contain and List
1252         https://bugs.webkit.org/show_bug.cgi?id=142932
1253
1254         Reviewed by Darin Adler.
1255
1256         Add some utility functions to the string classes to find substrings
1257         using ASCII case-insensitive comparisons.
1258
1259         * wtf/text/AtomicString.h:
1260         (WTF::AtomicString::contains):
1261         Add the light version that only lock one register.
1262
1263         (WTF::AtomicString::containsIgnoringASCIICase):
1264         (WTF::AtomicString::findIgnoringASCIICase):
1265
1266         * wtf/text/StringCommon.h:
1267         (WTF::findIgnoringASCIICase):
1268         This is the common implementation used by StringView and StringImpl.
1269
1270         * wtf/text/StringImpl.cpp:
1271         (WTF::StringImpl::findIgnoringASCIICase):
1272         * wtf/text/StringImpl.h:
1273         * wtf/text/StringView.cpp:
1274         (WTF::StringView::containsIgnoringASCIICase):
1275         (WTF::StringView::findIgnoringASCIICase):
1276         * wtf/text/StringView.h:
1277         * wtf/text/WTFString.h:
1278         (WTF::String::findIgnoringASCIICase):
1279         (WTF::String::contains):
1280         (WTF::String::containsIgnoringASCIICase):
1281
1282 2015-03-19  Andreas Kling  <akling@apple.com>
1283
1284         DFGAllocator should use bmalloc's aligned allocator.
1285         <https://webkit.org/b/142871>
1286
1287         Reviewed by Geoffrey Garen.
1288
1289         Remove PageAllocationAligned since it has no more clients.
1290
1291         * WTF.vcxproj/WTF.vcxproj:
1292         * WTF.vcxproj/WTF.vcxproj.filters:
1293         * WTF.xcodeproj/project.pbxproj:
1294         * wtf/CMakeLists.txt:
1295         * wtf/PageAllocationAligned.cpp: Removed.
1296         * wtf/PageAllocationAligned.h: Removed.
1297
1298 2015-03-18  Dhi Aurrahman  <diorahman@rockybars.com>
1299
1300         Fix StringView misplaced implementations after r181525 and r181558
1301         https://bugs.webkit.org/show_bug.cgi?id=142772
1302
1303         Reviewed by Darin Adler.
1304
1305         Fix misplaced implementations in StringView::startsWithIgnoringASCIICase and 
1306         StringView::endsWith. 
1307
1308         Add some tests in [1] to cover the StringView::startsWith, 
1309         StringView::startsWithIgnoringASCIICase, StringView::endsWith and 
1310         StringView::endsWithIgnoringASCIICase implementations.
1311
1312         [1] Tools/TestWebKitAPI/Tests/WTF/StringView.cpp.
1313
1314         * wtf/text/StringView.cpp:
1315         (WTF::StringView::startsWithIgnoringASCIICase):
1316         (WTF::StringView::endsWith):
1317         (WTF::StringView::endsWithIgnoringASCIICase):
1318
1319 2015-03-17  Michael Saboff  <msaboff@apple.com>
1320
1321         Windows X86-64 should use the fixed executable allocator
1322         https://bugs.webkit.org/show_bug.cgi?id=142749
1323
1324         Reviewed by Filip Pizlo.
1325
1326         Set ENABLE_EXECUTABLE_ALLOCATOR_FIXED for Windows.
1327         Needed to export MetaAllocator::currentStatistics() for use in JavaScriptCore.
1328
1329         * wtf/MetaAllocator.h:
1330         * wtf/Platform.h:
1331
1332 2015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
1333
1334         Enable ES6 classes by default
1335         https://bugs.webkit.org/show_bug.cgi?id=142774
1336
1337         Reviewed by Gavin Barraclough.
1338
1339         * wtf/FeatureDefines.h:
1340
1341 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
1342
1343         [ARM] Enable generating idiv instructions if it is supported
1344         https://bugs.webkit.org/show_bug.cgi?id=142725
1345
1346         Reviewed by Michael Saboff.
1347
1348         * wtf/Platform.h: Set HAVE_ARM_IDIV_INSTRUCTIONS based on GCC macro too.
1349
1350 2015-03-16  Benjamin Poulain  <benjamin@webkit.org>
1351
1352         Fix StringView after r181525
1353         Unreviewed.
1354
1355         Fix 2 silly mistakes I made in r181525.
1356
1357         * wtf/text/StringView.cpp:
1358         (WTF::StringView::startsWith):
1359         (WTF::StringView::startsWithIgnoringASCIICase):
1360         (WTF::StringView::endsWith):
1361         (WTF::StringView::endsWithIgnoringASCIICase):
1362         The implementation was inside the #ifdef.
1363
1364         * wtf/text/StringView.h:
1365         The symbols were not exported.
1366
1367 2015-03-16  Max Stepin  <maxstepin@gmail.com>
1368
1369         Add APNG support
1370         https://bugs.webkit.org/show_bug.cgi?id=17022
1371
1372         Reviewed by Carlos Garcia Campos.
1373
1374         * wtf/FeatureDefines.h:
1375
1376 2015-03-15  Benjamin Poulain  <benjamin@webkit.org>
1377
1378         CSS: fix the case-insensitive matching of the attribute selectors Begin, End and Hyphen
1379         https://bugs.webkit.org/show_bug.cgi?id=142715
1380
1381         Reviewed by Brent Fulgham.
1382
1383         Add the necessary infrastructure to test startsWith() and endsWith() with
1384         ASCII case-insentive comparisons.
1385
1386         * wtf/text/AtomicString.h:
1387         (WTF::AtomicString::startsWith):
1388         (WTF::AtomicString::startsWithIgnoringASCIICase):
1389         (WTF::AtomicString::endsWith):
1390         (WTF::AtomicString::endsWithIgnoringASCIICase):
1391
1392         * wtf/text/StringCommon.h:
1393         (WTF::loadUnaligned):
1394         (WTF::equal):
1395         I moved the low level equal() code from StringImpl to StringCommon
1396         since it is used by both StringImpl and StringView.
1397
1398         (WTF::equalCommon):
1399         (WTF::equalIgnoringASCIICaseCommon):
1400         Ideally we should drop the "Common" part of the name but StringView
1401         wants this inline for some reason. I prefered keeping the current behavior
1402         since I don't know how StringView's matching performance was evaluated.
1403
1404         (WTF::startsWith):
1405         (WTF::startsWithIgnoringASCIICase):
1406         (WTF::endsWith):
1407         (WTF::endsWithIgnoringASCIICase):
1408         Make all that code shared between StringView and Stringimpl.
1409
1410         * wtf/text/StringImpl.cpp:
1411         (WTF::StringImpl::startsWith):
1412         (WTF::StringImpl::startsWithIgnoringASCIICase):
1413         (WTF::StringImpl::endsWith):
1414         (WTF::StringImpl::endsWithIgnoringASCIICase):
1415         (WTF::equal):
1416         (WTF::stringImplContentEqual): Deleted.
1417         * wtf/text/StringImpl.h:
1418         (WTF::loadUnaligned): Deleted.
1419         (WTF::equal): Deleted.
1420
1421         * wtf/text/StringView.cpp:
1422         (WTF::StringView::startsWith):
1423         (WTF::StringView::startsWithIgnoringASCIICase):
1424         (WTF::StringView::endsWith):
1425         (WTF::StringView::endsWithIgnoringASCIICase):
1426         * wtf/text/StringView.h:
1427         Since those are new, we can safely make them out-of-line and
1428         evaluate the inlining impact as needed.
1429
1430         * wtf/text/WTFString.h:
1431         (WTF::String::startsWithIgnoringASCIICase):
1432         (WTF::String::endsWith):
1433         (WTF::String::endsWithIgnoringASCIICase):
1434
1435 2015-03-15  Benjamin Poulain  <bpoulain@apple.com>
1436
1437         Change the exact attribute matching to be ASCII case-insensitive
1438         https://bugs.webkit.org/show_bug.cgi?id=142609
1439
1440         Reviewed by Darin Adler.
1441
1442         Add support for ASCII case insensitive comparisons to all the string
1443         classes.
1444
1445         The new file StringCommon.h has the common algorithm to avoid repeating
1446         the same code with different types.
1447
1448         * WTF.vcxproj/WTF.vcxproj:
1449         * WTF.vcxproj/WTF.vcxproj.filters:
1450         * wtf/ASCIICType.h:
1451         (WTF::toASCIILower):
1452         * wtf/CMakeLists.txt:
1453         * wtf/text/AtomicString.h:
1454         (WTF::equalIgnoringASCIICase):
1455         * wtf/text/StringCommon.h: Added.
1456         (WTF::equalIgnoringASCIICase):
1457         (WTF::equalIgnoringASCIICaseCommon):
1458         * wtf/text/StringImpl.cpp:
1459         (WTF::equalIgnoringASCIICase):
1460         (WTF::equalIgnoringASCIICaseNonNull):
1461         (WTF::StringImpl::utf8Impl):
1462         (WTF::StringImpl::defaultWritingDirection): Deleted.
1463         (WTF::StringImpl::adopt): Deleted.
1464         (WTF::StringImpl::sizeInBytes): Deleted.
1465         (WTF::putUTF8Triple): Deleted.
1466         (WTF::StringImpl::utf8): Deleted.
1467         * wtf/text/StringImpl.h:
1468         (WTF::StringImpl::isSubString): Deleted.
1469         (WTF::find): Deleted.
1470
1471 2015-03-14  Michael Saboff  <msaboff@apple.com>
1472
1473         Disable Yarr JIT for ARMv7k
1474         https://bugs.webkit.org/show_bug.cgi?id=142645
1475
1476         Rubber stamped by Geoffrey Garen.
1477
1478         Changed the setting of ENABLE_YARR_JIT to be predicated on ENABLED_JIT.
1479
1480         * wtf/Platform.h:
1481
1482 2015-03-14  Michael Saboff  <msaboff@apple.com>
1483
1484         ES6: Add binary and octal literal support
1485         https://bugs.webkit.org/show_bug.cgi?id=142681
1486
1487         Reviewed by Ryosuke Niwa.
1488
1489         * wtf/ASCIICType.h:
1490         (WTF::isASCIIBinaryDigit): New support function.
1491         (WTF::isASCIIOctalDigit): Updated to use logical and (&&) instead of binary and (&).
1492
1493 2015-03-13  Mark Lam  <mark.lam@apple.com>
1494
1495         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
1496         <https://webkit.org/b/142674>
1497
1498         Reviewed by Filip Pizlo.
1499
1500         We no longer use TCMalloc in our code, and we now have C++11.  This replaces the
1501         TCMalloc_SpinLock with a new WTF::SpinLock based on WTF::Atomic (which is a
1502         wrapper around std::atomic).
1503
1504         Note that there is a StaticSpinLock and a SpinLock:
1505
1506         1. StaticSpinLock is an alias for SpinLockBase, and its initialization relies on
1507            static / global std:atomic being automatically initialized to 0 at compile time.
1508            Hence, StaticSpinLock should only be used for statics / globals (including
1509            static members of classes / structs).
1510
1511         2. SpinLock is derived from SpinLockBase, and adds a default constructor to
1512            initialize its internal atomic value to 0.  Because SpinLock has a constructor,
1513            it cannot be used for statics / globals.  Objects that want to embed a spin
1514            lock as an instance field should use SpinLock so that it is initialized properly.
1515            std::atomic will not automatically initialize instance fields to 0.  Hence,
1516            StaticSpinLock will not work correctly as instance fields of a class / struct.
1517
1518         * WTF.vcxproj/WTF.vcxproj:
1519         * WTF.vcxproj/WTF.vcxproj.filters:
1520         * WTF.xcodeproj/project.pbxproj:
1521         * wtf/CMakeLists.txt:
1522         * wtf/MetaAllocator.cpp:
1523         (WTF::MetaAllocator::~MetaAllocator):
1524         (WTF::MetaAllocator::MetaAllocator):
1525         * wtf/MetaAllocator.h:
1526         * wtf/SpinLock.h: Added.
1527         (WTF::SpinLockBase::lock):
1528         (WTF::SpinLockBase::unlock):
1529         (WTF::SpinLockBase::isLocked):
1530         (WTF::SpinLockBase::slowLock):
1531         (WTF::SpinLock::SpinLock):
1532         * wtf/TCSpinLock.h: Removed.
1533         * wtf/text/AtomicString.cpp:
1534
1535 2015-03-13  Mark Lam  <mark.lam@apple.com>
1536
1537         Introduce WTF::Atomic to wrap std::atomic for a friendlier CAS.
1538         <https://webkit.org/b/142661>
1539
1540         Reviewed by Filip Pizlo.
1541
1542         The CAS functions provided by std::atomic takes a reference to the expected
1543         value and modifies it if the CAS fails.  However, in a lot of our CAS usage,
1544         we don't want the expected value to change.  The solution to this is to
1545         provide a WTF::Atomic struct that wraps std::atomic, and provide CAS
1546         methods that won't alter the expected value if the CAS fails.
1547
1548         The method names in WTF::Atomic are chosen to be identical to those
1549         in std::atomic so that WTF::Atomic can be a simple drop in replacement
1550         for std::atomic.
1551
1552         Also changed ByteSpinLock to use WTF::Atomic instead of std::atomic.
1553
1554         * wtf/Atomics.h:
1555         (WTF::Atomic::load):
1556         (WTF::Atomic::store):
1557         (WTF::Atomic::compare_exchange_weak):
1558         (WTF::Atomic::compare_exchange_strong):
1559         * wtf/ByteSpinLock.h:
1560         (WTF::ByteSpinLock::ByteSpinLock):
1561         (WTF::ByteSpinLock::lock):
1562
1563 2015-03-12  Filip Pizlo  <fpizlo@apple.com>
1564
1565         Bytecode liveness analysis should have more lambdas and fewer sets
1566         https://bugs.webkit.org/show_bug.cgi?id=142647
1567
1568         Reviewed by Mark Lam.
1569         
1570         Add a method for iterating each set bit in a FastBitVector. Uses a functor as a callback since
1571         this allows for a more efficient algorithm.
1572
1573         * wtf/FastBitVector.h:
1574         (WTF::FastBitVector::forEachSetBit):
1575
1576 2015-03-12  Michael Saboff  <msaboff@apple.com>
1577
1578         Disable Yarr JIT for ARMv7k
1579         https://bugs.webkit.org/show_bug.cgi?id=142645
1580
1581         Reviewed by Oliver Hunt.
1582
1583         Make the setting of ENABLE_YARR_JIT match ENABLE_JIT for ARMv7k.
1584
1585         * wtf/Platform.h:
1586
1587 2015-03-12  Mark Lam  <mark.lam@apple.com>
1588
1589         Change WTF::ByteSpinLock to use std::atomic.
1590         <https://webkit.org/b/142644>
1591
1592         Reviewed by Filip Pizlo.
1593
1594         * wtf/ByteSpinLock.h:
1595         (WTF::ByteSpinLock::ByteSpinLock):
1596         (WTF::ByteSpinLock::lock):
1597         (WTF::ByteSpinLock::unlock):
1598         (WTF::ByteSpinLock::isHeld):
1599
1600 2015-03-12  Csaba Osztrogonác  <ossy@webkit.org>
1601
1602         [ARM][Linux] GC sometimes stuck in an infinite loop if parallel GC is enabled
1603         https://bugs.webkit.org/show_bug.cgi?id=141290
1604
1605         Reviewed by Carlos Garcia Campos.
1606
1607         * wtf/Platform.h: Enable parallel GC after r181319.
1608
1609 2015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
1610
1611         Use out-of-band messaging for RenderBox::firstLineBaseline() and RenderBox::inlineBlockBaseline()
1612         https://bugs.webkit.org/show_bug.cgi?id=142569
1613
1614         Reviewed by David Hyatt.
1615
1616         Provide a callback to Optional::valueOrCompute() which is evaluated only if necessary.
1617
1618         * wtf/Optional.h:
1619         (WTF::Optional::valueOrCompute):
1620
1621 2015-03-10  Brent Fulgham  <bfulgham@apple.com>
1622
1623         [Win] 17 different JSC tests started to fail in DST
1624         https://bugs.webkit.org/show_bug.cgi?id=142531
1625
1626         Reviewed by Chris Dumez.
1627
1628         The stock 'GetTimeZoneInformation' call does not always match the actual Daylight
1629         Savings calendar. This results in a period of time when these tests fail.
1630
1631         If available, we should take advantage of the new 'GetTimeZoneInformationForYear',
1632         which accesses a dynamic calendar of DST dates, which is presumbably updated by
1633         Microsoft from year-to-year.
1634
1635         * wtf/DateMath.cpp:
1636         (WTF::timeZoneInformationForYearFunction): New function to conditionally access
1637         some Vista (and newer) functionality.
1638         (WTF::calculateUTCOffset): Call new function (if available) to calculate proper UTC
1639         time offset.
1640
1641 2015-03-10  Alex Christensen  <achristensen@webkit.org>
1642
1643         Use unsigned for HashSet size.
1644         https://bugs.webkit.org/show_bug.cgi?id=142518
1645
1646         Reviewed by Benjamin Poulain.
1647
1648         * wtf/HashCountedSet.h:
1649         (WTF::Traits>::size):
1650         (WTF::Traits>::capacity):
1651         * wtf/HashMap.h:
1652         (WTF::X>::size):
1653         (WTF::X>::capacity):
1654         * wtf/HashSet.h:
1655         (WTF::V>::size):
1656         (WTF::V>::capacity):
1657         * wtf/HashTable.h:
1658         (WTF::HashTable::Stats::recordCollisionAtCount):
1659         (WTF::HashTable::Stats::dumpStats):
1660         (WTF::HashTable::size):
1661         (WTF::HashTable::capacity):
1662         (WTF::KeyTraits>::deallocateTable):
1663         (WTF::KeyTraits>::checkTableConsistencyExceptSize):
1664         * wtf/HashTraits.h:
1665         * wtf/ListHashSet.h:
1666         (WTF::U>::size):
1667         (WTF::U>::capacity):
1668
1669 2015-03-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
1670
1671         Remove PassRefPtr from svg/properties classes.
1672         https://bugs.webkit.org/show_bug.cgi?id=142063.
1673
1674         Reviewed by Darin Adler.
1675
1676         * wtf/Ref.h:
1677         (WTF::static_reference_cast): Add a stat_cast function to Ref<>.
1678
1679 2015-03-10  Mark Lam  <mark.lam@apple.com>
1680
1681         [Win] JSC Build Warnings Need to be Resolved.
1682         <https://webkit.org/b/142366>
1683
1684         Reviewed by Brent Fulgham.
1685
1686         * wtf/Compiler.h:
1687         - MSVC also does not have the CONSIDERS_UNREACHABLE_CODE quirk.
1688
1689 2015-03-10  Geoffrey Garen  <ggaren@apple.com>
1690
1691         bmalloc: tryFastMalloc shouldn't crash
1692         https://bugs.webkit.org/show_bug.cgi?id=142443
1693
1694         Reviewed by Sam Weinig.
1695
1696         Rolling back in r181307 with a check for whether bmalloc is enabled, to
1697         avoid crashes when running with ASan and GuardMalloc.
1698
1699         * wtf/FastMalloc.cpp:
1700         (WTF::fastMalloc):
1701         (WTF::fastRealloc):
1702         (WTF::fastAlignedMalloc):
1703         (WTF::tryFastMalloc):
1704         (WTF::tryFastRealloc): Deleted.
1705         * wtf/FastMalloc.h:
1706
1707 2015-03-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1708
1709         GCC: CRASH() should be annotated with NORETURN
1710         https://bugs.webkit.org/show_bug.cgi?id=142524
1711
1712         Reviewed by Anders Carlsson.
1713
1714         Add COMPILER(GCC) to #ifdefs that already exist for Clang.
1715
1716         * wtf/Assertions.cpp:
1717         * wtf/Assertions.h:
1718
1719 2015-03-09  Commit Queue  <commit-queue@webkit.org>
1720
1721         Unreviewed, rolling out r181307.
1722         https://bugs.webkit.org/show_bug.cgi?id=142525
1723
1724         Broke ASan tests (Requested by ap on #webkit).
1725
1726         Reverted changeset:
1727
1728         "bmalloc: tryFastMalloc shouldn't crash"
1729         https://bugs.webkit.org/show_bug.cgi?id=142443
1730         http://trac.webkit.org/changeset/181307
1731
1732 2015-03-09  Geoffrey Garen  <ggaren@apple.com>
1733
1734         bmalloc: tryFastMalloc shouldn't crash
1735         https://bugs.webkit.org/show_bug.cgi?id=142443
1736
1737         Reviewed by Darin Adler.
1738
1739         * wtf/FastMalloc.cpp:
1740         (WTF::fastMalloc):
1741         (WTF::fastRealloc):
1742         (WTF::fastAlignedMalloc): Don't check for null. bmalloc automatically
1743         crashes on allocation failure, and we'd rather not pay for an extra check.
1744
1745         (WTF::tryFastMalloc): Added an opt-out API to return null rather than
1746         crashing, since some clients need this.
1747
1748         (WTF::tryFastRealloc): Deleted. Unused.
1749
1750         * wtf/FastMalloc.h:
1751
1752 2015-03-09  Mark Lam  <mark.lam@apple.com>
1753
1754         8-bit version of weakCompareAndSwap() can cause an infinite loop.
1755         https://webkit.org/b/142513>
1756
1757         Reviewed by Filip Pizlo.
1758
1759         Presently, Bitmap::concurrentTestAndSet() uses the 8-bit version of
1760         weakCompareAndSwap() (which compares and swaps an uint8_t value).
1761         Bitmap::concurrentTestAndSet() has a loop that checks if a bit in the
1762         byte of interest has been set.  If not, it will call the 8-bit CAS
1763         function to set the bit.
1764
1765         Under the covers, for ARM, the 8-bit CAS function actually works with a
1766         32-bit CAS.  The 8-bit CAS will first fetch the 32-bit value in memory
1767         that should contain the 8-bit value, and check if it contains the
1768         expected byte.  If the value in memory doesn't have the expected byte,
1769         it will return early to its caller.  The expectation is that the caller
1770         will reload the byte from memory and call the 8-bit CAS again.
1771
1772         Unfortunately, this code path that returns early does not have a
1773         compiler fence.  Without a compiler fence, the C++ compiler can
1774         optimize away the reloading of the expected byte value, leaving it
1775         unchanged.  As a result, we'll have a infinite loop here that checks a
1776         value that will never change, and the loop will not terminate until the
1777         value changes.
1778
1779         The fix is to eliminate the early return check in the 8-bit CAS, and
1780         have it always call down to the 32-bit CAS.  The 32-bit CAS has a
1781         compiler fence which will prevent this issue.
1782
1783         * wtf/Atomics.h:
1784         (WTF::weakCompareAndSwap):
1785
1786 2015-03-09  Martin Robinson  <mrobinson@igalia.com>
1787
1788         [EFL] Move DispatchQueue to WTF
1789         https://bugs.webkit.org/show_bug.cgi?id=142493
1790
1791         Reviewed by Csaba Osztrogonác.
1792
1793         * wtf/PlatformEfl.cmake: Add DispatchQueue to the source list.
1794         * wtf/efl/DispatchQueueEfl.cpp: Renamed from Source/WebKit2/Platform/efl/DispatchQueueEfl.cpp.
1795         * wtf/efl/DispatchQueueEfl.h: Renamed from Source/WebKit2/Platform/efl/DispatchQueueEfl.h.
1796         * wtf/efl/DispatchQueueWorkItemEfl.h: Renamed from Source/WebKit2/Platform/efl/DispatchQueueWorkItemEfl.h.
1797
1798 2015-03-08  Brent Fulgham  <bfulgham@apple.com>
1799
1800         [Win] WTF::WorkQueue does not balance ref/deref properly
1801         https://bugs.webkit.org/show_bug.cgi?id=142471
1802
1803         Reviewed by Antti Koivisto.
1804
1805         Make sure we deref the count when we execute a function in the
1806         WorkQueue.
1807
1808         * wtf/win/WorkQueueWin.cpp:
1809         (WTF::WorkQueue::performWorkOnRegisteredWorkThread):
1810
1811 2015-03-07  Brent Fulgham  <bfulgham@apple.com>
1812
1813         [Win] Revive WTF::WorkQueue on Windows
1814         https://bugs.webkit.org/show_bug.cgi?id=142432
1815
1816         Reviewed by Darin Adler.
1817
1818         Revive the Windows implementation of WTF::WorkQueue.
1819
1820         * WTF.vcxproj/WTF.vcxproj:
1821         * WTF.vcxproj/WTF.vcxproj.filters:
1822         * wtf/WorkQueue.h:
1823         * wtf/win/WorkItemWin.cpp: Added.
1824         * wtf/win/WorkItemWin.h: Added.
1825         * wtf/win/WorkQueueWin.cpp: Added.
1826
1827 2015-03-06  Geoffrey Garen  <ggaren@apple.com>
1828
1829         Fix crashes seen on the the Windows buildbots after my last patch.
1830
1831         Unreviewed.
1832
1833         * wtf/FastMalloc.cpp:
1834         (WTF::fastAlignedMalloc): Let's pass these arguments in the right order.
1835
1836 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
1837
1838         Crash in -[WebCascadeList objectAtIndex:] + 195
1839         https://bugs.webkit.org/show_bug.cgi?id=141274
1840
1841         Reviewed by David Kilzer.
1842
1843         * wtf/WeakPtr.h:
1844         (WTF::WeakPtrFactory::createWeakPtr): WebCascadeList uses a const FontCascade,
1845         and it calls createWeakPtr() on it. Therefore, createWeakPtr has to be marked
1846         const.
1847         (WTF::WeakPtrFactory::operator=): Removed because it was broken and had no
1848         callers
1849
1850 2015-03-06  Simon Fraser  <simon.fraser@apple.com>
1851
1852         Allow tree dumping functions to be used in release builds by switching a flag
1853         https://bugs.webkit.org/show_bug.cgi?id=142379
1854
1855         Reviewed by Zalan Bujtas.
1856
1857         There are various tree dumping functions that are useful for debugging, and sometimes
1858         you want to be able to use them in release builds. Currently they are surrounded by
1859         #ifndef NDEBUG. Change this to #if ENABLE(TREE_DEBUGGING), which is defined to 0 or 1
1860         in wtf/Platform.h
1861
1862         * wtf/Platform.h:
1863
1864 2015-03-05  Chris Dumez  <cdumez@apple.com>
1865
1866         Regression(r173761): ASSERTION FAILED: !is8Bit() in StringImpl::characters16()
1867         https://bugs.webkit.org/show_bug.cgi?id=142350
1868
1869         Reviewed by Michael Saboff and Benjamin Poulain.
1870
1871         Fix ASSERTION FAILED: !is8Bit() in StringImpl::characters16() from
1872         WTF::equalInner() after r173761. The code was incorrectly assuming that
1873         if stringImpl is 16-bit, then matchString is 16-bit too, which is not
1874         correct.
1875
1876         Also rename WTFString::startsWith() / endsWith() taking an offset to
1877         hasInfixStartingAt() / hasInfixEndingAt() for clarity. It seems odd
1878         to call it startsWith even though it won't technically *start* with
1879         the pattern if the input offset is greater than zero.
1880
1881         Also drop the caseSensitive argument as it is never used (always true
1882         at call sites.
1883
1884         * wtf/text/StringImpl.cpp:
1885         (WTF::equalInner):
1886         (WTF::StringImpl::hasInfixStartingAt):
1887         (WTF::StringImpl::hasInfixEndingAt):
1888         (WTF::StringImpl::startsWith): Deleted.
1889         (WTF::StringImpl::endsWith): Deleted.
1890         * wtf/text/StringImpl.h:
1891         * wtf/text/WTFString.h:
1892         (WTF::String::hasInfixStartingAt):
1893         (WTF::String::hasInfixEndingAt):
1894         (WTF::String::startsWith): Deleted.
1895         (WTF::String::endsWith): Deleted.
1896
1897 2015-03-05  Chris Dumez  <cdumez@apple.com>
1898
1899         NetworkCache efficacy logging is using too much CPU
1900         https://bugs.webkit.org/show_bug.cgi?id=142186
1901         <rdar://problem/19632080>
1902
1903         Reviewed by Antti Koivisto.
1904
1905         * wtf/HashMap.h:
1906         (WTF::copyToVector):
1907         Add copyToVector() utility function for HashMap that uses an std::pair<key, value>
1908         as element type.
1909
1910         * wtf/text/WTFString.h:
1911         (WTF::StringCapture::StringCapture):
1912         (WTF::StringCapture::operator=):
1913         Add default constructor and assignment operator to StringCapture so that
1914         it can be used in a Vector.
1915
1916 2015-03-05  Antti Koivisto  <antti@apple.com>
1917
1918         Support WorkQueue QOS classes on Mavericks
1919         https://bugs.webkit.org/show_bug.cgi?id=142328
1920
1921         Reviewed by Anders Carlsson.
1922
1923         "The priority of a dispatch queue is inherited from its target queue.  In order to
1924         change the priority of a queue created with dispatch_queue_create(), use the
1925         dispatch_get_global_queue() function to obtain a target queue of the desired prior-
1926         ity."
1927
1928         * wtf/cocoa/WorkQueueCocoa.cpp:
1929         (WTF::targetQueueForQOSClass):
1930         (WTF::WorkQueue::platformInitialize):
1931
1932 2015-03-03  Anders Carlsson  <andersca@apple.com>
1933
1934         Remove unused compression code
1935         https://bugs.webkit.org/show_bug.cgi?id=142237
1936
1937         Reviewed by Geoffrey Garen.
1938
1939         * WTF.vcxproj/WTF.vcxproj:
1940         * WTF.vcxproj/WTF.vcxproj.filters:
1941         * WTF.xcodeproj/project.pbxproj:
1942         * wtf/CMakeLists.txt:
1943         * wtf/Compression.cpp: Removed.
1944         * wtf/Compression.h: Removed.
1945
1946 2015-03-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1947
1948         [WK2] Remove unnecessary create() factory functions.
1949         https://bugs.webkit.org/show_bug.cgi?id=142161
1950
1951         Reviewed by Chris Dumez.
1952
1953         We can replace some create() factory functions with std::make_unique(). Because
1954         it just returns new instance. Even some of those functions have used std::unique_ptr<>
1955         instead of std::make_unique<>. Fixed all.
1956
1957         * wtf/efl/WorkQueueEfl.cpp:
1958         (WorkQueue::dispatch):
1959
1960 2015-03-02  Filip Pizlo  <fpizlo@apple.com>
1961
1962         DFG compile time measurements should really report milliseconds
1963         https://bugs.webkit.org/show_bug.cgi?id=142209
1964
1965         Reviewed by Benjamin Poulain.
1966         
1967         This bug was introduced because currentTimeMS() calls were converted to
1968         monotonicallyIncreasingTime() calls. Perhaps this bug would be less likely if there was a
1969         monotonicallyIncreasingTimeMS() function available, so this patch adds it.
1970
1971         * wtf/CurrentTime.h:
1972         (WTF::monotonicallyIncreasingTimeMS):
1973
1974 2015-02-27  Darin Adler  <darin@apple.com>
1975
1976         Remove unused PossiblyNull
1977         https://bugs.webkit.org/show_bug.cgi?id=142124
1978
1979         Reviewed by Andreas Kling.
1980
1981         * WTF.vcxproj/WTF.vcxproj: Removed the file.
1982         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
1983         * WTF.xcodeproj/project.pbxproj: Ditto.
1984         * wtf/CMakeLists.txt: Ditto.
1985         * wtf/PossiblyNull.h: Removed.
1986
1987         * wtf/FastMalloc.h: Moved everything to the left.
1988         Moved member functions out of the TryMallocReturnValue class definition.
1989         (WTF::TryMallocReturnValue::operator PossiblyNull<T>): Deleted.
1990         (WTF::TryMallocReturnValue::getValue): Marked inline, changed to work
1991         only with pointer types, not arbitrary non-pointer types.
1992
1993 2015-02-26  Brent Fulgham  <bfulgham@apple.com>
1994
1995         [Win] Make build logs more legible by reducing noise
1996         https://bugs.webkit.org/show_bug.cgi?id=142034
1997
1998         Reviewed by Alexey Proskuryakov.
1999
2000         Modify batch files, makefiles, and DOS commands to remove
2001         uninteresting/unhelpful output.
2002
2003         * WTF.vcxproj/WTFGenerated.make:
2004         * WTF.vcxproj/WTFPreBuild.cmd:
2005         * WTF.vcxproj/copy-files.cmd:
2006
2007 2015-02-26  Landry Breuil  <landry@openbsd.org>
2008
2009         Revert bug 19975, now that gcc 4.7 is required.
2010         https://bugs.webkit.org/show_bug.cgi?id=129927
2011
2012         Reviewed by Andreas Kling.
2013
2014         isfinite() and signbit() are provided by gcc's cmath header.
2015
2016         * wtf/MathExtras.h:
2017
2018 2015-02-26  Csaba Osztrogonác  <ossy@webkit.org>
2019
2020         UNREACHABLE_FOR_PLATFORM() should be release assert
2021         https://bugs.webkit.org/show_bug.cgi?id=141904
2022
2023         Reviewed by Darin Adler.
2024
2025         * wtf/Assertions.h:
2026         (UNREACHABLE_FOR_PLATFORM):
2027
2028 2015-02-25  Filip Pizlo  <fpizlo@apple.com>
2029
2030         Enable concurrent JIT on GTK
2031         https://bugs.webkit.org/show_bug.cgi?id=142007
2032
2033         Reviewed by Benjamin Poulain.
2034
2035         Seems weird that GTK keeps it off. No good reason for that as far as I can tell.
2036
2037         * wtf/Platform.h:
2038
2039 2015-02-23  Brent Fulgham  <bfulgham@apple.com>
2040
2041         WTF::WeakPtr should rename 'forgot' to 'clear' and support nullptr assignment
2042         https://bugs.webkit.org/show_bug.cgi?id=141935
2043
2044         Reviewed by Myles C. Maxfield.
2045
2046         * wtf/WeakPtr.h:
2047         (WTF::WeakPtr::operator=): Added 'nullptr_t' overload.
2048         (WTF::WeakPtr::clear): Renamed from 'forget'
2049         (WTF::WeakPtr::forget): Deleted.
2050
2051 2015-02-23  Brent Fulgham  <bfulgham@apple.com>
2052
2053         WTF::WeakPtr should have a 'forget' method
2054         https://bugs.webkit.org/show_bug.cgi?id=141923
2055
2056         Reviewed by Myles C. Maxfield.
2057
2058         * wtf/WeakPtr.h:
2059         (WTF::WeakPtr::forget): Added.
2060
2061 2015-02-20  Geoffrey Garen  <ggaren@apple.com>
2062
2063         Remove TCMalloc
2064         https://bugs.webkit.org/show_bug.cgi?id=141844
2065
2066         Reviewed by Andreas Kling.
2067
2068         It's unused.
2069
2070         * WTF.vcxproj/WTF.vcxproj:
2071         * WTF.vcxproj/WTF.vcxproj.filters:
2072         * WTF.xcodeproj/project.pbxproj:
2073         * wtf/CMakeLists.txt:
2074         * wtf/FastMalloc.cpp:
2075         (WTF::EntropySource<4>::value): Deleted.
2076         (WTF::EntropySource<8>::value): Deleted.
2077         (WTF::internalEntropyValue): Deleted.
2078         (WTF::freedObjectStartPoison): Deleted.
2079         (WTF::freedObjectEndPoison): Deleted.
2080         (WTF::ClassIndex): Deleted.
2081         (WTF::HardenedSLL::create): Deleted.
2082         (WTF::HardenedSLL::null): Deleted.
2083         (WTF::HardenedSLL::setValue): Deleted.
2084         (WTF::HardenedSLL::value): Deleted.
2085         (WTF::HardenedSLL::operator!): Deleted.
2086         (WTF::HardenedSLL::operator UnspecifiedBoolType): Deleted.
2087         (WTF::HardenedSLL::operator!=): Deleted.
2088         (WTF::HardenedSLL::operator==): Deleted.
2089         (WTF::LgFloor): Deleted.
2090         (WTF::SLL_Next): Deleted.
2091         (WTF::SLL_SetNext): Deleted.
2092         (WTF::SLL_Push): Deleted.
2093         (WTF::SLL_Pop): Deleted.
2094         (WTF::SLL_PopRange): Deleted.
2095         (WTF::SLL_PushRange): Deleted.
2096         (WTF::SizeClass): Deleted.
2097         (WTF::ByteSizeForClass): Deleted.
2098         (WTF::NumMoveSize): Deleted.
2099         (WTF::InitSizeClasses): Deleted.
2100         (WTF::MetaDataAlloc): Deleted.
2101         (WTF::PageHeapAllocator::Init): Deleted.
2102         (WTF::PageHeapAllocator::New): Deleted.
2103         (WTF::PageHeapAllocator::Delete): Deleted.
2104         (WTF::PageHeapAllocator::inuse): Deleted.
2105         (WTF::pages): Deleted.
2106         (WTF::AllocationSize): Deleted.
2107         (WTF::spanInitializerCookie): Deleted.
2108         (WTF::Span::next): Deleted.
2109         (WTF::Span::remoteNext): Deleted.
2110         (WTF::Span::prev): Deleted.
2111         (WTF::Span::setNext): Deleted.
2112         (WTF::Span::setPrev): Deleted.
2113         (WTF::Span::initCookie): Deleted.
2114         (WTF::Span::clearCookie): Deleted.
2115         (WTF::Span::isValid): Deleted.
2116         (WTF::Event): Deleted.
2117         (WTF::NewSpan): Deleted.
2118         (WTF::DeleteSpan): Deleted.
2119         (WTF::DLL_Init): Deleted.
2120         (WTF::DLL_Remove): Deleted.
2121         (WTF::DLL_IsEmpty): Deleted.
2122         (WTF::DLL_Length): Deleted.
2123         (WTF::DLL_Print): Deleted.
2124         (WTF::DLL_Prepend): Deleted.
2125         (WTF::TCMalloc_Central_FreeList::length): Deleted.
2126         (WTF::TCMalloc_Central_FreeList::tc_length): Deleted.
2127         (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Deleted.
2128         (WTF::TCMalloc_Central_FreeList::entropy): Deleted.
2129         (WTF::FastMallocZone::goodSize): Deleted.
2130         (WTF::FastMallocZone::check): Deleted.
2131         (WTF::FastMallocZone::print): Deleted.
2132         (WTF::FastMallocZone::log): Deleted.
2133         (WTF::FastMallocZone::forceLock): Deleted.
2134         (WTF::FastMallocZone::forceUnlock): Deleted.
2135         (WTF::FastMallocZone::statistics): Deleted.
2136         (WTF::FastMallocZone::zoneValloc): Deleted.
2137         (WTF::FastMallocZone::zoneDestroy): Deleted.
2138         (WTF::MallocHook::record): Deleted.
2139         (WTF::MallocHook::recordAllocation): Deleted.
2140         (WTF::MallocHook::recordDeallocation): Deleted.
2141         (WTF::MallocHook::init): Deleted.
2142         (WTF::MallocHook::InvokeNewHook): Deleted.
2143         (WTF::MallocHook::InvokeDeleteHook): Deleted.
2144         (WTF::KernelSupportsTLS): Deleted.
2145         (WTF::CheckIfKernelSupportsTLS): Deleted.
2146         (WTF::TCMalloc_PageHeap::GetDescriptor): Deleted.
2147         (WTF::TCMalloc_PageHeap::GetDescriptorEnsureSafe): Deleted.
2148         (WTF::TCMalloc_PageHeap::SystemBytes): Deleted.
2149         (WTF::TCMalloc_PageHeap::FreeBytes): Deleted.
2150         (WTF::TCMalloc_PageHeap::GetSizeClassIfCached): Deleted.
2151         (WTF::TCMalloc_PageHeap::CacheSizeClass): Deleted.
2152         (WTF::TCMalloc_PageHeap::RecordSpan): Deleted.
2153         (WTF::TCMalloc_PageHeap::init): Deleted.
2154         (WTF::TCMalloc_PageHeap::initializeScavenger): Deleted.
2155         (WTF::TCMalloc_PageHeap::isScavengerSuspended): Deleted.
2156         (WTF::TCMalloc_PageHeap::scheduleScavenger): Deleted.
2157         (WTF::TCMalloc_PageHeap::rescheduleScavenger): Deleted.
2158         (WTF::TCMalloc_PageHeap::suspendScavenger): Deleted.
2159         (WTF::TCMalloc_PageHeap::scavengerTimerFired): Deleted.
2160         (WTF::TCMalloc_PageHeap::runScavengerThread): Deleted.
2161         (WTF::TCMalloc_PageHeap::signalScavenger): Deleted.
2162         (WTF::TCMalloc_PageHeap::scavenge): Deleted.
2163         (WTF::TCMalloc_PageHeap::shouldScavenge): Deleted.
2164         (WTF::TCMalloc_PageHeap::New): Deleted.
2165         (WTF::TCMalloc_PageHeap::AllocLarge): Deleted.
2166         (WTF::TCMalloc_PageHeap::Split): Deleted.
2167         (WTF::TCMalloc_PageHeap::Carve): Deleted.
2168         (WTF::mergeDecommittedStates): Deleted.
2169         (WTF::TCMalloc_PageHeap::Delete): Deleted.
2170         (WTF::TCMalloc_PageHeap::IncrementalScavenge): Deleted.
2171         (WTF::TCMalloc_PageHeap::RegisterSizeClass): Deleted.
2172         (WTF::TCMalloc_PageHeap::ReturnedBytes): Deleted.
2173         (WTF::PagesToMB): Deleted.
2174         (WTF::TCMalloc_PageHeap::Dump): Deleted.
2175         (WTF::TCMalloc_PageHeap::GrowHeap): Deleted.
2176         (WTF::TCMalloc_PageHeap::Check): Deleted.
2177         (WTF::TCMalloc_PageHeap::CheckList): Deleted.
2178         (WTF::TCMalloc_PageHeap::ReleaseFreeList): Deleted.
2179         (WTF::TCMalloc_PageHeap::ReleaseFreePages): Deleted.
2180         (WTF::TCMalloc_ThreadCache_FreeList::Init): Deleted.
2181         (WTF::TCMalloc_ThreadCache_FreeList::length): Deleted.
2182         (WTF::TCMalloc_ThreadCache_FreeList::empty): Deleted.
2183         (WTF::TCMalloc_ThreadCache_FreeList::lowwatermark): Deleted.
2184         (WTF::TCMalloc_ThreadCache_FreeList::clear_lowwatermark): Deleted.
2185         (WTF::TCMalloc_ThreadCache_FreeList::Push): Deleted.
2186         (WTF::TCMalloc_ThreadCache_FreeList::PushRange): Deleted.
2187         (WTF::TCMalloc_ThreadCache_FreeList::PopRange): Deleted.
2188         (WTF::TCMalloc_ThreadCache_FreeList::Pop): Deleted.
2189         (WTF::TCMalloc_ThreadCache_FreeList::Validate): Deleted.
2190         (WTF::TCMalloc_ThreadCache_FreeList::enumerateFreeObjects): Deleted.
2191         (WTF::TCMalloc_ThreadCache::freelist_length): Deleted.
2192         (WTF::TCMalloc_ThreadCache::Size): Deleted.
2193         (WTF::TCMalloc_ThreadCache::enumerateFreeObjects): Deleted.
2194         (WTF::getPageHeap): Deleted.
2195         (WTF::fastMallocGoodSize): Deleted.
2196         (WTF::TCMalloc_PageHeap::periodicScavenge): Deleted.
2197         (WTF::TCMalloc_PageHeap::scavengerThread): Deleted.
2198         (WTF::setThreadHeap): Deleted.
2199         (WTF::TCMalloc_Central_FreeList::Init): Deleted.
2200         (WTF::TCMalloc_Central_FreeList::ReleaseListToSpans): Deleted.
2201         (WTF::TCMalloc_Central_FreeList::ReleaseToSpans): Deleted.
2202         (WTF::TCMalloc_Central_FreeList::EvictRandomSizeClass): Deleted.
2203         (WTF::TCMalloc_Central_FreeList::MakeCacheSpace): Deleted.
2204         (WTF::TCMalloc_Central_FreeList::ShrinkCache): Deleted.
2205         (WTF::TCMalloc_Central_FreeList::InsertRange): Deleted.
2206         (WTF::TCMalloc_Central_FreeList::RemoveRange): Deleted.
2207         (WTF::TCMalloc_Central_FreeList::FetchFromSpansSafe): Deleted.
2208         (WTF::TCMalloc_Central_FreeList::FetchFromSpans): Deleted.
2209         (WTF::TCMalloc_Central_FreeList::Populate): Deleted.
2210         (WTF::TCMalloc_ThreadCache::SampleAllocation): Deleted.
2211         (WTF::TCMalloc_ThreadCache::Init): Deleted.
2212         (WTF::TCMalloc_ThreadCache::Cleanup): Deleted.
2213         (WTF::TCMalloc_ThreadCache::Allocate): Deleted.
2214         (WTF::TCMalloc_ThreadCache::Deallocate): Deleted.
2215         (WTF::TCMalloc_ThreadCache::FetchFromCentralCache): Deleted.
2216         (WTF::TCMalloc_ThreadCache::ReleaseToCentralCache): Deleted.
2217         (WTF::TCMalloc_ThreadCache::Scavenge): Deleted.
2218         (WTF::TCMalloc_ThreadCache::PickNextSample): Deleted.
2219         (WTF::TCMalloc_ThreadCache::InitModule): Deleted.
2220         (WTF::TCMalloc_ThreadCache::NewHeap): Deleted.
2221         (WTF::TCMalloc_ThreadCache::GetThreadHeap): Deleted.
2222         (WTF::TCMalloc_ThreadCache::GetCache): Deleted.
2223         (WTF::TCMalloc_ThreadCache::GetCacheIfPresent): Deleted.
2224         (WTF::TCMalloc_ThreadCache::InitTSD): Deleted.
2225         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary): Deleted.
2226         * wtf/TCPackedCache.h: Removed.
2227         * wtf/TCPageMap.h: Removed.
2228         * wtf/TCSystemAlloc.cpp: Removed.
2229         * wtf/TCSystemAlloc.h: Removed.
2230
2231 2015-02-20  Alexey Proskuryakov  <ap@apple.com>
2232
2233         Remove svn:keywords property.
2234
2235         As far as I can tell, the property had no effect on any of these files, but also,
2236         when it has effect it's likely harmful.
2237
2238         * wtf/DecimalNumber.cpp: Removed property svn:keywords.
2239         * wtf/spi/darwin/XPCSPI.h: Removed property svn:keywords.
2240
2241 2015-02-20  Csaba Osztrogonác  <ossy@webkit.org>
2242
2243         EFL URTBF
2244
2245         * wtf/PlatformEfl.cmake:
2246
2247 2015-02-20  Simon Fraser  <simon.fraser@apple.com>
2248
2249         RunLoop::dispatch() should drop the mutex before calling wakeUp().
2250         https://bugs.webkit.org/show_bug.cgi?id=141820
2251
2252         Reviewed by Alexey Proskuryakov.
2253         
2254         RunLoop::wakeUp() calls into CoreFoundation which could take time,
2255         so scope the mutex just to protect m_functionQueue.
2256
2257         * wtf/RunLoop.cpp:
2258         (WTF::RunLoop::dispatch):
2259
2260 2015-02-20  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2261
2262         Unreviewed, EFL build fix since r180410.
2263
2264         * wtf/PlatformEfl.cmake: Add WEBKIT2/Platform/efl path in order to include DispatchQueueEfl.h.
2265
2266 2015-02-20  Antti Koivisto  <antti@apple.com>
2267
2268         Move WorkQueue from WK2 to WTF
2269         https://bugs.webkit.org/show_bug.cgi?id=141797
2270
2271         Reviewed by Anders Carlsson.
2272
2273         It may be useful in WebCore.
2274
2275         Windows implementation is still missing.
2276
2277         * WTF.xcodeproj/project.pbxproj:
2278         * wtf/CMakeLists.txt:
2279         * wtf/PlatformGTK.cmake:
2280         * wtf/WorkQueue.cpp: Copied from Source/WebKit2/Platform/WorkQueue.cpp.
2281         * wtf/WorkQueue.h: Copied from Source/WebKit2/Platform/WorkQueue.h.
2282         * wtf/cocoa: Added.
2283         * wtf/cocoa/WorkQueueCocoa.cpp: Copied from Source/WebKit2/Platform/mac/WorkQueueMac.cpp.
2284         * wtf/efl/WorkQueueEfl.cpp: Copied from Source/WebKit2/Platform/efl/WorkQueueEfl.cpp.
2285         * wtf/gtk/WorkQueueGtk.cpp: Copied from Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp.
2286
2287 2015-02-13  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2288
2289         [EFL] Enable bmalloc for EFL port 
2290         https://bugs.webkit.org/show_bug.cgi?id=141459
2291
2292         Reviewed by Csaba Osztrogonác.
2293
2294         * wtf/CMakeLists.txt: Remove TCSystemAlloc.cpp/h.
2295         * wtf/FastMalloc.cpp: Enable BMALLOC for EFL port.
2296
2297 2015-02-13  Anders Carlsson  <andersca@apple.com>
2298
2299         Add a move constructor and move assignment operator to Deque
2300         https://bugs.webkit.org/show_bug.cgi?id=141571
2301
2302         Reviewed by Andreas Kling.
2303
2304         * wtf/Deque.h:
2305         (WTF::inlineCapacity>::Deque):
2306         (WTF::=): Deleted.
2307
2308 2015-02-13  Anders Carlsson  <andersca@apple.com>
2309
2310         Add an initializer list constructor to Deque
2311         https://bugs.webkit.org/show_bug.cgi?id=141565
2312
2313         Reviewed by Andreas Kling.
2314
2315         * wtf/Deque.h:
2316         (WTF::inlineCapacity>::Deque):
2317
2318 2015-02-13  Anders Carlsson  <andersca@apple.com>
2319
2320         Re-indent Deque.h
2321
2322         Rubber-stamped by Antti Koivisto.
2323
2324         * wtf/Deque.h:
2325
2326 2015-02-11  Brent Fulgham  <bfulgham@apple.com>
2327
2328         [Win] [64-bit] Work around MSVC2013 Runtime Bug
2329         https://bugs.webkit.org/show_bug.cgi?id=141498
2330         <rdar://problem/19803642>
2331
2332         Reviewed by Anders Carlsson.
2333
2334         Disable FMA3 instruction use in the MSVC math library to
2335         work around a VS2013 runtime crash. We can remove this
2336         workaround when we switch to VS2015.
2337
2338         * WTF.vcxproj/WTF.vcxproj: Add new files.
2339         * WTF.vcxproj/WTF.vcxproj.filters: Ditto.
2340         * wtf/win/WTFDLL.cpp: Added.
2341
2342 2015-02-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2343
2344         [EFL][GTK] Use bmalloc instead of tcmalloc
2345         https://bugs.webkit.org/show_bug.cgi?id=140162
2346
2347         Reviewed by Carlos Garcia Campos.
2348
2349         * wtf/CMakeLists.txt:
2350         * wtf/FastMalloc.cpp:
2351             Enable bmalloc on GTK ports, but EFL port will enable it when bmalloc supports
2352             memory statistics.
2353
2354 2015-02-10  Darin Adler  <darin@apple.com>
2355
2356         Add the crash-on-failure behavior to bmalloc-based fastMalloc
2357         https://bugs.webkit.org/show_bug.cgi?id=141434
2358
2359         Reviewed by Alexey Proskuryakov.
2360
2361         * wtf/FastMalloc.cpp: Removed unneeded includes.
2362         (WTF::fastMalloc): Added null check and CRASH.
2363         (WTF::fastCalloc): Added overflow checking, null check, and CRASH.
2364         (WTF::fastRealloc): Added null check and CRASH.
2365         (WTF::fastMallocSize): Added FIXME comment.
2366         (WTF::fastMallocGoodSize): Added FIXME comment.
2367         (WTF::fastAlignedMalloc): Added null check and CRASH.
2368         (WTF::tryFastMalloc): Changed to call bmalloc directly instead of
2369         calling fastMalloc, since fastMalloc will now crash on failure.
2370         (WTF::tryFastRealloc): Changed to call bmalloc directly instead of
2371         calling fastRealloc, since fastRealloc will now crash on failure.
2372         (WTF::tryFastCalloc): Added overflow checking.
2373         (WTF::fastMallocStatistics): Added FIXME comment.
2374
2375 2015-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2376
2377         [GTK] GMutexLocker build issue
2378         https://bugs.webkit.org/show_bug.cgi?id=141381
2379
2380         Reviewed by Žan Doberšek.
2381
2382         Remove using WTF::GMutexLocker from the header, since newer glib
2383         versions have a GMutexLocker in the public API.
2384
2385         * wtf/gobject/GMutexLocker.h:
2386
2387 2015-02-09  Alexey Proskuryakov  <ap@apple.com>
2388
2389         REGRESSION: tryFastCalloc is no longer "try"
2390         https://bugs.webkit.org/show_bug.cgi?id=141406
2391
2392         Reviewed by Darin Adler.
2393
2394         This causes crashes on some WebKit regression test bots.
2395
2396         * wtf/FastMalloc.cpp: (WTF::tryFastCalloc): Fix what looks like a copy/paste mistake.
2397
2398 2015-02-07  Csaba Osztrogonác  <ossy@webkit.org>
2399
2400         [ARM] GC sometimes stuck in an infinite loop if parallel GC is enabled
2401         https://bugs.webkit.org/show_bug.cgi?id=141290
2402
2403         Reviewed by Anders Carlsson.
2404
2405         * wtf/Platform.h:
2406
2407 2015-02-07  Chris Dumez  <cdumez@apple.com>
2408
2409         Add Vector::removeFirstMatching() / removeAllMatching() methods taking lambda functions
2410         https://bugs.webkit.org/show_bug.cgi?id=141321
2411
2412         Reviewed by Darin Adler.
2413
2414         Add Vector::removeFirstMatching() / removeAllMatching() methods taking
2415         lambda functions to match the element(s) to remove. This simplifies the
2416         code a bit. Vector::removeAllMatching() is also more efficient than the
2417         manual removal alternative.
2418
2419         * wtf/Vector.h:
2420
2421 2015-02-06  Commit Queue  <commit-queue@webkit.org>
2422
2423         Unreviewed, rolling out r179743.
2424         https://bugs.webkit.org/show_bug.cgi?id=141335
2425
2426         caused missing symbols in non-WebKit clients of WTF::Vector
2427         (Requested by kling on #webkit).
2428
2429         Reverted changeset:
2430
2431         "Remove WTF::fastMallocGoodSize()."
2432         https://bugs.webkit.org/show_bug.cgi?id=141020
2433         http://trac.webkit.org/changeset/179743
2434
2435 2015-02-06  Andreas Kling  <akling@apple.com>
2436
2437         Remove WTF::fastMallocGoodSize().
2438         <https://webkit.org/b/141020>
2439
2440         Reviewed by Anders Carlsson.
2441
2442         bmalloc's good-size API just returns exactly whatever you pass it,
2443         so it's of no utility to us anymore.
2444
2445         This gets rid of a bunch of pointless out-of-line calls in Vector
2446         construction and growth.
2447
2448         * wtf/Compression.cpp:
2449         (WTF::GenericCompressedData::create):
2450         * wtf/FastMalloc.cpp:
2451         (WTF::fastMallocGoodSize): Deleted.
2452         * wtf/FastMalloc.h:
2453         * wtf/Vector.h:
2454         (WTF::VectorBufferBase::allocateBuffer):
2455         (WTF::VectorBufferBase::tryAllocateBuffer):
2456         (WTF::VectorBufferBase::reallocateBuffer):
2457
2458 2015-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
2459
2460         [Streams API] Implement a barebone ReadableStream interface
2461         https://bugs.webkit.org/show_bug.cgi?id=141045
2462
2463         Reviewed by Benjamin Poulain.
2464
2465         * wtf/FeatureDefines.h:
2466
2467 2015-02-04  Alexey Proskuryakov  <ap@apple.com>
2468
2469         Optimized equal() functions in StringImpl.h are not ASan compatible
2470         https://bugs.webkit.org/show_bug.cgi?id=141258
2471
2472         Reviewed by Daniel Bates.
2473
2474         * wtf/text/StringImpl.h: (WTF::equal): Add custom implementations for ASan.
2475
2476 2015-02-04  Chris Dumez  <cdumez@apple.com>
2477
2478         Add removeFirst(value) / removeAll(value) methods to WTF::Vector
2479         https://bugs.webkit.org/show_bug.cgi?id=141192
2480
2481         Reviewed by Benjamin Poulain.
2482
2483         Add removeFirst(value) / removeAll(value) convenience methods to
2484         WTF::Vector to reduce complexity a bit at call sites.
2485
2486         I am planning to add overloads for these taking a lambda function for
2487         matching in a follow-up patch as well. I have seen quite a few
2488         Vector::remove(index) call sites that would benefit from it.
2489
2490         * wtf/Vector.h:
2491         (WTF::OverflowHandler>::removeFirst):
2492         (WTF::OverflowHandler>::removeAll):
2493
2494 2015-02-02  Dhi Aurrahman  <diorahman@rockybars.com>
2495
2496         Optimize matchesLangPseudoClass() of :lang()
2497         https://bugs.webkit.org/show_bug.cgi?id=140873
2498
2499         Reviewed by Darin Adler.
2500
2501         Add some basic equality comparison operators.
2502
2503         * wtf/text/StringView.h:
2504         (WTF::operator==):
2505         (WTF::operator!=):
2506         (WTF::equal):
2507         (WTF::equalIgnoringASCIICase):
2508
2509 2015-02-02  Geoffrey Garen  <ggaren@apple.com>
2510
2511         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
2512         https://bugs.webkit.org/show_bug.cgi?id=140900
2513
2514         Reviewed by Mark Hahnenberg.
2515
2516         Re-landing just the HandleBlock piece of this patch.
2517
2518         * wtf/FastMalloc.cpp:
2519         (WTF::fastAlignedMalloc):
2520         (WTF::fastAlignedFree):
2521         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
2522         * wtf/FastMalloc.h:
2523
2524 2015-02-02  Daniel Bates  <dabates@apple.com>
2525
2526         [iOS] ASSERTION FAILED: m_scriptExecutionContext->isContextThread() in ContextDestructionObserver::observeContext
2527         https://bugs.webkit.org/show_bug.cgi?id=141057
2528         <rdar://problem/19068790>
2529
2530         Reviewed by Alexey Proskuryakov.
2531
2532         * wtf/MainThread.h:
2533         * wtf/mac/MainThreadMac.mm:
2534         (WTF::callOnWebThreadOrDispatchAsyncOnMainThread): Added.
2535
2536 2015-01-31  Sam Weinig  <sam@webkit.org>
2537
2538         Remove even more Mountain Lion support
2539         https://bugs.webkit.org/show_bug.cgi?id=141124
2540
2541         Reviewed by Alexey Proskuryakov.
2542
2543         * Configurations/Base.xcconfig:
2544         * Configurations/DebugRelease.xcconfig:
2545         * wtf/Assertions.cpp:
2546         * wtf/FeatureDefines.h:
2547         * wtf/Platform.h:
2548
2549 2015-01-31  Commit Queue  <commit-queue@webkit.org>
2550
2551         Unreviewed, rolling out r179426.
2552         https://bugs.webkit.org/show_bug.cgi?id=141119
2553
2554         "caused a memory use regression" (Requested by Guest45 on
2555         #webkit).
2556
2557         Reverted changeset:
2558
2559         "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
2560         pages"
2561         https://bugs.webkit.org/show_bug.cgi?id=140900
2562         http://trac.webkit.org/changeset/179426
2563
2564 2015-01-31  Commit Queue  <commit-queue@webkit.org>
2565
2566         Unreviewed, rolling out r179408.
2567         https://bugs.webkit.org/show_bug.cgi?id=141117
2568
2569         This didn't fully fix the issue (Requested by anttik on
2570         #webkit).
2571
2572         Reverted changeset:
2573
2574         "OSObjectPtr does not work with dispatch_data_t on Maverics"
2575         https://bugs.webkit.org/show_bug.cgi?id=141081
2576         http://trac.webkit.org/changeset/179408
2577
2578 2015-01-30  Yusuke Suzuki  <utatane.tea@gmail.com>
2579
2580         Implement ES6 Symbol
2581         https://bugs.webkit.org/show_bug.cgi?id=140435
2582
2583         Reviewed by Geoffrey Garen.
2584
2585         Introduce new unique string mechanizm into StringImpl.
2586         It is used for implementing Symbol which holds a [[Description]] value.
2587
2588         * wtf/text/AtomicString.h:
2589         (WTF::AtomicString::add):
2590         (WTF::AtomicString::addWithStringTableProvider):
2591
2592         Previously, we checked `isAtomic()` or `!length()`. This guard can filter out EmptyUnique.
2593         But now, we introduced new unique StringImpl. Since it has an actual string value, we need to check `isUnique()`.
2594
2595         * wtf/text/StringImpl.cpp:
2596         (WTF::StringImpl::~StringImpl):
2597         (WTF::StringImpl::createUnique):
2598
2599         In createUnique, we leverage Substring mechanizm to produce a new unique
2600         string from an existing string.
2601
2602         * wtf/text/StringImpl.h:
2603         (WTF::StringImpl::StringImpl):
2604         (WTF::StringImpl::createUniqueEmpty):
2605         (WTF::StringImpl::flagIsUnique):
2606         (WTF::StringImpl::isUnique):
2607         (WTF::StringImpl::setIsAtomic):
2608         (WTF::StringImpl::createEmptyUnique): Deleted.
2609         (WTF::StringImpl::isEmptyUnique): Deleted.
2610
2611         Instead of EmptyUnique, we introduced new flag to StringImpl, `isUnique`.
2612         While EmptyUnique cannot hold any string values except for empty string,
2613         the unique StringImpl can hold any String values.
2614         We fold the Symbol's descriptiveString value here.
2615
2616         * wtf/text/StringStatics.cpp:
2617         (WTF::StringImpl::hashAndFlagsForUnique):
2618         (WTF::StringImpl::hashAndFlagsForEmptyUnique): Deleted.
2619
2620 2015-01-30  Geoffrey Garen  <ggaren@apple.com>
2621
2622         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
2623         https://bugs.webkit.org/show_bug.cgi?id=140900
2624
2625         Reviewed by Mark Hahnenberg.
2626
2627         Re-landing just the HandleBlock piece of this patch.
2628
2629         * wtf/FastMalloc.cpp:
2630         (WTF::fastAlignedMalloc):
2631         (WTF::fastAlignedFree):
2632         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
2633         * wtf/FastMalloc.h:
2634
2635 2015-01-30  Namhoon Kim  <yanhkim@gmail.com>
2636
2637         Call vsnprintf instead of _vsnprintf in vprintf_stderr_common
2638         https://bugs.webkit.org/show_bug.cgi?id=141078
2639
2640         In windows _vsnprintf api does not place null character
2641         automatically. Simply replace it with vsnprintf. Which is
2642         polyfill to call wtf_vsnprintf in windows.
2643
2644         Reviewed by Brent Fulgham.
2645
2646         * wtf/Assertions.cpp:
2647
2648 2015-01-30  Brian J. Burg  <burg@cs.washington.edu>
2649
2650         Web Inspector: ASSERT in InspectorTimelineAgent::internalStop
2651         https://bugs.webkit.org/show_bug.cgi?id=141039
2652
2653         Reviewed by Timothy Hatcher.
2654
2655         Add messages to Stopwatch assertions, and clean up constructor.
2656
2657         * wtf/Stopwatch.h:
2658         (WTF::Stopwatch::Stopwatch):
2659         (WTF::Stopwatch::start):
2660         (WTF::Stopwatch::stop):
2661
2662 2015-01-30  Chris Dumez  <cdumez@apple.com>
2663
2664         Add match_constness<Reference, T> helper struct
2665         https://bugs.webkit.org/show_bug.cgi?id=140905
2666
2667         Reviewed by Benjamin Poulain.
2668
2669         Add match_constness<Reference, T> helper struct to simplify downcast<>()
2670         a bit. The purpose of this helper is to update T's constness to match
2671         Reference's.
2672
2673         * wtf/TypeCasts.h:
2674         (WTF::downcast):
2675
2676 2015-01-30  Chris Dumez  <cdumez@apple.com>
2677
2678         Add assertion in RefPtr's operator*() to make sure we don't dereference nullptr
2679         https://bugs.webkit.org/show_bug.cgi?id=141092
2680
2681         Reviewed by Anders Carlsson.
2682
2683         Add assertion in RefPtr's operator*() to make sure we don't dereference
2684         nullptr.
2685
2686         * wtf/RefPtr.h:
2687         (WTF::RefPtr::operator*):
2688
2689 2015-01-30  Geoffrey Garen  <ggaren@apple.com>
2690
2691         GC marking threads should clear malloc caches
2692         https://bugs.webkit.org/show_bug.cgi?id=141097
2693
2694         Reviewed by Andreas Kling.
2695
2696         Split the scavenging API into per-thread vs global, so that you can
2697         request to scavenge your own thread without scavenging the whole heap.
2698
2699         * wtf/FastMalloc.cpp:
2700         (WTF::releaseFastMallocFreeMemoryForThisThread):
2701         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
2702         * wtf/FastMalloc.h:
2703
2704 2015-01-30  Antti Koivisto  <antti@apple.com>
2705
2706         OSObjectPtr does not work with dispatch_data_t on Maverics
2707         https://bugs.webkit.org/show_bug.cgi?id=141081
2708
2709         Reviewed by Pratik Solanki.
2710         
2711         Trying to use OSObjectPtr<dispatch_data_t> throws 
2712         
2713         -[OS_dispatch_data _xref_dispose]: unrecognized selector sent to instance 0
2714
2715         * wtf/OSObjectPtr.h:
2716         (WTF::retainOSObject<dispatch_data_t>):
2717         (WTF::releaseOSObject<dispatch_data_t>):
2718         
2719             Add specialization for dispatch_data_t on Maverics.
2720
2721 2015-01-29  Santosh Mahto  <santoshbit2007@gmail.com>
2722
2723         Refactor String::format to handle unreached va_end.
2724         https://bugs.webkit.org/show_bug.cgi?id=140938
2725
2726         Reviewed by Alexey Proskuryakov.
2727
2728         Now va_end is called for all platform after getting length
2729         of formatted string and again va_start/va_end is called to write
2730         formatted string in buffer. This way it ensure va_end is always
2731         reached for each va_start.
2732
2733         * wtf/text/WTFString.cpp:
2734
2735 2015-01-29  Csaba Osztrogonác  <ossy@webkit.org>
2736
2737         Move HAVE_DTRACE definition back to Platform.h
2738         https://bugs.webkit.org/show_bug.cgi?id=141033
2739
2740         Reviewed by Dan Bernstein.
2741
2742         * wtf/Platform.h:
2743
2744 2015-01-28  Namhoon Kim  <namkim@ea.com>
2745
2746         Windows return -1 when calling vsnprintf with arguments that exceed target buffer size
2747         https://bugs.webkit.org/show_bug.cgi?id=140917
2748
2749         Reviewed by Brent Fulgham.
2750
2751         Fix return value of vsnprintf when windows API return -1 to denote
2752         requested buffer exceeded. Replace return value by calling vscprintf.
2753
2754         * wtf/StringExtras.h:
2755         (snprintf): Fix return value by calling vscprintf when buffer exceeded.
2756         (wtf_vsnprintf): Ditto.
2757
2758 2015-01-28  Geoffrey Garen  <ggaren@apple.com>
2759
2760         Removed fastMallocForbid / fastMallocAllow
2761         https://bugs.webkit.org/show_bug.cgi?id=141012
2762
2763         Reviewed by Mark Hahnenberg.
2764
2765         Removed the forbid / allow API because it is no longer used.
2766
2767         * wtf/FastMalloc.cpp:
2768         (WTF::tryFastMalloc):
2769         (WTF::fastMalloc):
2770         (WTF::tryFastCalloc):
2771         (WTF::fastCalloc):
2772         (WTF::fastFree):
2773         (WTF::tryFastRealloc):
2774         (WTF::fastRealloc):
2775         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
2776         (WTF::isForbidden): Deleted.
2777         (WTF::fastMallocForbid): Deleted.
2778         (WTF::fastMallocAllow): Deleted.
2779         (WTF::initializeIsForbiddenKey): Deleted.
2780         * wtf/FastMalloc.h:
2781
2782 2015-01-28  Dana Burkart  <dburkart@apple.com>
2783
2784         Move ASan flag settings from DebugRelease.xcconfig to Base.xcconfig
2785         https://bugs.webkit.org/show_bug.cgi?id=136765
2786
2787         Reviewed by Alexey Proskuryakov.
2788
2789         * Configurations/Base.xcconfig:
2790         * Configurations/DebugRelease.xcconfig:
2791
2792 2015-01-28  Darin Adler  <darin@apple.com>
2793
2794         Fix small leak in Collator
2795         https://bugs.webkit.org/show_bug.cgi?id=140990
2796
2797         Reviewed by Andreas Kling.
2798
2799         * wtf/unicode/icu/CollatorICU.cpp:
2800         (WTF::Collator::Collator): Use fastStrDup instead of strdup.
2801         (WTF::Collator::~Collator): Use fastFree on the collator locale that we
2802         are abandoning. The old code instead just called free on a null pointer.
2803
2804 2015-01-27  Geoffrey Garen  <ggaren@apple.com>
2805
2806         Removed WTF_MALLOC_VALIDATION
2807         https://bugs.webkit.org/show_bug.cgi?id=140958
2808
2809         Reviewed by Anders Carlsson.
2810
2811         I don't think anyone has been using this, and the #ifdefs were driving
2812         me crazy.
2813
2814         We have other options for validation -- like MallocGuardEdges,
2815         MallocCheckHeapEach, MallocScribble, and GuardMalloc.
2816
2817         * wtf/FastMalloc.cpp:
2818         (WTF::tryFastMalloc):
2819         (WTF::fastMalloc):
2820         (WTF::tryFastCalloc):
2821         (WTF::fastCalloc):
2822         (WTF::fastFree):
2823         (WTF::tryFastRealloc):
2824         (WTF::fastRealloc):
2825         (WTF::fastMallocSize):
2826         (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
2827         (WTF::Internal::fastMallocMatchFailed): Deleted.
2828         * wtf/FastMalloc.h:
2829         (WTF::Internal::fastMallocValidationHeader): Deleted.
2830         (WTF::Internal::fastMallocValidationSuffix): Deleted.
2831         (WTF::Internal::fastMallocMatchValidationType): Deleted.
2832         (WTF::Internal::setFastMallocMatchValidationType): Deleted.
2833         (WTF::fastMallocMatchValidateMalloc): Deleted.
2834         (WTF::fastMallocMatchValidateFree): Deleted.
2835         (WTF::fastMallocValidate): Deleted.
2836
2837 2015-01-27  Commit Queue  <commit-queue@webkit.org>
2838
2839         Unreviewed, rolling out r179192.
2840         https://bugs.webkit.org/show_bug.cgi?id=140953
2841
2842         Caused numerous layout test failures (Requested by mattbaker_
2843         on #webkit).
2844
2845         Reverted changeset:
2846
2847         "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
2848         pages"
2849         https://bugs.webkit.org/show_bug.cgi?id=140900
2850         http://trac.webkit.org/changeset/179192
2851
2852 2015-01-26  Geoffrey Garen  <ggaren@apple.com>
2853
2854         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
2855         https://bugs.webkit.org/show_bug.cgi?id=140900
2856
2857         Reviewed by Mark Hahnenberg.
2858
2859         New interface for aligned allocation: fastAlignedMalloc / fastAlignedFree.
2860         We require a special function call on free because Windows.
2861
2862         * wtf/FastMalloc.cpp:
2863         (WTF::fastAlignedMalloc):
2864         (WTF::fastAlignedFree): Do it.
2865
2866         (WTF::do_memalign): Un-ifdef this, since we use it now.
2867
2868         * wtf/FastMalloc.h: Make our new function names visible like the rest
2869         of fastMalloc.
2870
2871 2015-01-26  Brent Fulgham  <bfulgham@apple.com>
2872
2873         [Win] ASSERTION FAILED !m_ptr under AccessibilityController::winAddNotificationListener
2874         https://bugs.webkit.org/show_bug.cgi?id=87426
2875         <rdar://problem/11527899>
2876
2877         Reviewed by Darin Adler.
2878
2879         Revise internal containers to use std::addressof in preference to
2880         to using the '&' operator.
2881
2882         * wtf/Deque.h:
2883         (WTF::inlineCapacity>::append):
2884         (WTF::inlineCapacity>::prepend):
2885         (WTF::inlineCapacity>::removeFirst):
2886         (WTF::inlineCapacity>::removeLast):
2887         (WTF::inlineCapacity>::remove):
2888         (WTF::inlineCapacity>::after):
2889         (WTF::inlineCapacity>::before):
2890         * wtf/GetPtr.h:
2891         * wtf/HashTable.h:
2892         (WTF::HashTableBucketInitializer<false>::initialize):
2893         * wtf/HashTraits.h:
2894         (WTF::SimpleClassHashTraits::constructDeletedValue):
2895         (WTF::CustomHashTraits::constructDeletedValue):
2896         * wtf/ListHashSet.h:
2897         (WTF::ListHashSetConstIterator::get):
2898         * wtf/Vector.h:
2899         (WTF::Vector::swap):
2900         (WTF::OverflowHandler>::append):
2901         (WTF::OverflowHandler>::tryAppend):
2902         (WTF::OverflowHandler>::insert):
2903
2904 2015-01-24  Chris Dumez  <cdumez@apple.com>
2905
2906         Provide implementation for WTF::DefaultHash<bool>
2907         https://bugs.webkit.org/show_bug.cgi?id=140848
2908
2909         Reviewed by Anders Carlsson.
2910
2911         Provide implementation for WTF::DefaultHash<bool> so that we can use
2912         HashMap<std::pair<XXX, bool>> in the code base. Right now, we need to
2913         use some integer type to work around the issue.
2914
2915         * wtf/HashFunctions.h:
2916
2917 2015-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2918
2919         [GTK] Add missing null check in some derefGPtr implementations
2920         https://bugs.webkit.org/show_bug.cgi?id=140822
2921
2922         Reviewed by Sergio Villar Senin.
2923
2924         It's missing in GHashTable and GVariant implementations.
2925
2926         * wtf/gobject/GRefPtr.cpp:
2927         (WTF::derefGPtr):
2928
2929 2015-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2930
2931         [GTK] Add initial database process support
2932         https://bugs.webkit.org/show_bug.cgi?id=139491
2933
2934         Reviewed by Sergio Villar Senin.
2935
2936         Add support for using GRefPtr with GVariantBuilder.
2937
2938         * wtf/gobject/GRefPtr.cpp:
2939         (WTF::refGPtr):
2940         (WTF::derefGPtr):
2941         * wtf/gobject/GRefPtr.h:
2942         * wtf/gobject/GTypedefs.h:
2943
2944 2015-01-22  Ryosuke Niwa  <rniwa@webkit.org>
2945
2946         Add a build flag for ES6 class syntax
2947         https://bugs.webkit.org/show_bug.cgi?id=140760
2948
2949         Reviewed by Michael Saboff.
2950
2951         * wtf/FeatureDefines.h:
2952
2953 2015-01-21  Csaba Osztrogonác  <ossy@webkit.org>
2954
2955         Remove ENABLE(INSPECTOR) ifdef guards
2956         https://bugs.webkit.org/show_bug.cgi?id=140668
2957
2958         Reviewed by Darin Adler.
2959
2960         * wtf/FeatureDefines.h:
2961
2962 2015-01-20  YunQiang Su  <wzssyqa@gmail.com>
2963
2964         Fix failed to build for Linux/MIPS64EL
2965         https://bugs.webkit.org/show_bug.cgi?id=124370
2966
2967         Reviewed by Darin Adler.
2968
2969         Add MIPS64EL support.
2970
2971         * wtf/Platform.h:
2972         * wtf/dtoa/utils.h:
2973
2974 2015-01-19  Alexey Proskuryakov  <ap@apple.com>
2975
2976         Make ASan do bounds checks for WTF::Vector
2977         https://bugs.webkit.org/show_bug.cgi?id=140631
2978         rdar://problem/19437718
2979
2980         Reviewed by Darin Adler.
2981
2982         * wtf/SizeLimits.cpp: Disable Vector object size checks for ASan enabled builds.
2983
2984         * wtf/Vector.h:
2985         (WTF::VectorBuffer::endOfBuffer):
2986         (WTF::Vector::Vector):
2987         (WTF::Vector::~Vector):
2988         (WTF::Vector::swap):
2989         (WTF::OverflowHandler>::Vector):
2990         (WTF::=):
2991         (WTF::OverflowHandler>::fill):
2992         (WTF::OverflowHandler>::resize):
2993         (WTF::OverflowHandler>::shrink):
2994         (WTF::OverflowHandler>::grow):
2995         (WTF::OverflowHandler>::asanSetInitialBufferSizeTo):
2996         (WTF::OverflowHandler>::asanSetBufferSizeToFullCapacity):
2997         (WTF::OverflowHandler>::asanBufferSizeWillChangeTo):
2998         (WTF::OverflowHandler>::reserveCapacity):
2999         (WTF::OverflowHandler>::tryReserveCapacity):
3000         (WTF::OverflowHandler>::shrinkCapacity):
3001         (WTF::OverflowHandler>::append):
3002         (WTF::OverflowHandler>::tryAppend):
3003         (WTF::OverflowHandler>::appendSlowCase):
3004         (WTF::OverflowHandler>::uncheckedAppend):
3005         (WTF::OverflowHandler>::insert):
3006         (WTF::OverflowHandler>::remove):
3007         (WTF::OverflowHandler>::releaseBuffer):
3008
3009         * wtf/Compiler.h: Changed ASAN_ENABLED macro fallback value from false to 0,
3010         MSVC was not happy with false.
3011
3012 2015-01-20  Csaba Osztrogonác  <ossy@webkit.org>
3013
3014         Remove non-Windows cruft from WebKit/win/Plugins
3015         https://bugs.webkit.org/show_bug.cgi?id=140675
3016
3017         Reviewed by Anders Carlsson.
3018
3019         * wtf/FeatureDefines.h:
3020
3021 2015-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
3022
3023         WeakPtr functions crash when created with default constructor
3024         https://bugs.webkit.org/show_bug.cgi?id=140479
3025
3026         Reviewed by Andreas Kling.
3027
3028         This patch rearranges how WeakPtr works, and has the following ideas behind it:
3029
3030         1. WeakPtr should use Ref internally. This solves the crash by always having a
3031         valid WeakReference.
3032         2. Clients should not be able to construct WeakReferences directly. Instead,
3033         only WeakPtrFactory (and WeakPtr's default constructor) should be able to
3034         construct them. They are considered an implementation detail of WeakPtr.
3035         3. Except for the default constructor, clients should not be able to construct
3036         WeakPtrs directly. Instead, the WeakPtrFactory must construct them. This
3037         guarantees that the WeakPtrs all reference the same WeakReference.
3038         4. Clients can construct a WeakPtr using its default constructor, and then
3039         use the assignment operator to make it non-null. (Or they could use
3040         WeakPtrFactory to make it non-null at creation-time.)
3041         5. No one was using WeakReference::bindTo(), and it doesn't seem useful, so I
3042         removed it.
3043
3044         Tests: WTF_WeakPtr API tests
3045
3046         * wtf/Ref.h:
3047         (WTF::Ref::Ref): Added extra ASSERT()s, and explicitly deleted copy
3048         constructors with a comment.
3049         (WTF::Ref::operator=): Added extra ASSERT()s, and explicitly deleted copy
3050         assignment operators with a comment.
3051         * wtf/WeakPtr.h:
3052         (WTF::WeakReference::clear): Used nullptr.
3053         (WTF::WeakReference::create): Moved to private:
3054         (WTF::WeakPtr::WeakPtr): For the default constructor, initialized the Ref with
3055         a new WeakReference. For the other constructor, moved it to private:. Also added
3056         copy constructors and copy assignment operators (since Ref doesn't have them but
3057         RefPtr does). These constructors/operators are relied upon in various places
3058         throughout WebCore.
3059         (WTF::WeakPtr::operator bool): Made non-explicit.
3060         (WTF::WeakReference::createUnbound): Deleted.
3061         (WTF::WeakReference::bindTo): Deleted.
3062         (WTF::WeakReference::WeakReference): Deleted.
3063         (WTF::WeakPtrFactory::WeakPtrFactory): Deleted.
3064
3065 2015-01-16  Yusuke Suzuki  <utatane.tea@gmail.com>
3066
3067         std::all_of requires complete C++ iterators in GCC 4.8
3068         https://bugs.webkit.org/show_bug.cgi?id=140530
3069
3070         Reviewed by Darin Adler.
3071
3072         In the WebKit2/UIProcess/WebProcessLifetimeObserver.cpp, std::all_of
3073         is used for HashIterators. However, std::all_of requires the complete
3074         C++ iterator interface including iterator_category typedef member and
3075         it raises compile error in GCC 4.8 (and libstdc++) environment.
3076
3077         This patch inherits std::iterator with appropriate type parameters.
3078         It automatically defines required typedefs including iterator_category.
3079
3080         * wtf/HashIterators.h:
3081
3082 2015-01-15  Csaba Osztrogonác  <ossy@webkit.org>
3083
3084         Remove ENABLE(SQL_DATABASE) guards
3085         https://bugs.webkit.org/show_bug.cgi?id=140434
3086
3087         Reviewed by Darin Adler.
3088
3089         * wtf/FeatureDefines.h:
3090
3091 2015-01-14  Csaba Osztrogonác  <ossy@webkit.org>
3092
3093         Unreviewed fix after r163330.
3094
3095         * wtf/Platform.h: Use C style comment.
3096
3097 2015-01-14  Marc Juul  <juul@sudomesh.org>
3098
3099         C++ style comment was preventing compile if CPU(ARM_NEON)
3100         https://bugs.webkit.org/show_bug.cgi?id=133827
3101
3102         Reviewed by Csaba Osztrogonác.
3103
3104         * wtf/Platform.h:
3105
3106 2015-01-13  Chris Dumez  <cdumez@apple.com>
3107
3108         Make WTF::Optional work with msvc 2013
3109         https://bugs.webkit.org/show_bug.cgi?id=140401
3110
3111         Reviewed by Anders Carlsson.
3112
3113         Update the WTF::Optional implementation to use std::aligned_memory and
3114         placement new instead of an unrestricted union because msvc 2013 still
3115         doesn't support unrestricted unions.
3116
3117         This change is a pre-requirement to fix Bug 140347 as this change uses
3118         WTF::Optional with types that have non-trivial copy constructors.
3119
3120         This change is covered by the existing Optional WTF test.
3121
3122         * wtf/Optional.h:
3123
3124 2015-01-11  Sam Weinig  <sam@webkit.org>
3125
3126         Remove support for SharedWorkers
3127         https://bugs.webkit.org/show_bug.cgi?id=140344
3128
3129         Reviewed by Anders Carlsson.
3130
3131         * wtf/FeatureDefines.h:
3132
3133 2015-01-12  Darin Adler  <darin@apple.com>
3134
3135         Modernize and streamline HTMLTokenizer
3136         https://bugs.webkit.org/show_bug.cgi?id=140166
3137
3138         Reviewed by Sam Weinig.
3139
3140         * wtf/Forward.h: Removed PassRef, added OrdinalNumber and TextPosition.
3141
3142 2015-01-09  Commit Queue  <commit-queue@webkit.org>
3143
3144         Unreviewed, rolling out r178154, r178163, and r178164.
3145         https://bugs.webkit.org/show_bug.cgi?id=140292
3146
3147         Still multiple assertion failures on tests (Requested by ap on
3148         #webkit).
3149
3150         Reverted changesets:
3151
3152         "Modernize and streamline HTMLTokenizer"
3153         https://bugs.webkit.org/show_bug.cgi?id=140166
3154         http://trac.webkit.org/changeset/178154
3155
3156         "Unreviewed speculative buildfix after r178154."
3157         http://trac.webkit.org/changeset/178163
3158
3159         "One more unreviewed speculative buildfix after r178154."
3160         http://trac.webkit.org/changeset/178164
3161
3162 2015-01-08  Darin Adler  <darin@apple.com>
3163
3164         Modernize and streamline HTMLTokenizer
3165         https://bugs.webkit.org/show_bug.cgi?id=140166
3166
3167         Reviewed by Sam Weinig.
3168
3169         * wtf/Forward.h: Removed PassRef, added OrdinalNumber and TextPosition.
3170
3171 2015-01-08  Benjamin Poulain  <benjamin@webkit.org>
3172
3173         [WK2] Start a prototype for declarative site specific extensions
3174         https://bugs.webkit.org/show_bug.cgi?id=140160
3175
3176         Reviewed by Andreas Kling.
3177
3178         * wtf/FeatureDefines.h:
3179
3180 2015-01-07  Daniel Bates  <dabates@apple.com>
3181
3182         [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT
3183         https://bugs.webkit.org/show_bug.cgi?id=137371
3184
3185         As pointed out by Tim Horton, use C-style comment instead of C++-style comment as
3186         wtf/Compiler.h is included in the sandbox profile and the sandbox profile compiler
3187         doesn't understand C++-style comments.
3188
3189         * wtf/Compiler.h:
3190
3191 2015-01-07  Daniel Bates  <dabates@apple.com>
3192
3193         [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT
3194         https://bugs.webkit.org/show_bug.cgi?id=137371
3195
3196         Reviewed by David Kilzer.
3197
3198         Move EXTERN_C_BEGIN and EXTERN_C_END macros from file WebKit2/config.h to here and
3199         rename them to WTF_EXTERN_C_BEGIN and WTF_EXTERN_C_END, respectively, so that we
3200         can make use of these macros in SPI wrapper headers (e.g. UIKitSPI.h).
3201
3202         I'll look to transition existing code to WTF_EXTERN_C_BEGIN/WTF_EXTERN_C_END and
3203         remove EXTERN_C in a subsequent commit(s).
3204
3205         * wtf/Compiler.h:
3206
3207 2015-01-07  Commit Queue  <commit-queue@webkit.org>
3208
3209         Unreviewed, rolling out r178068.
3210         https://bugs.webkit.org/show_bug.cgi?id=140235
3211
3212         Breaks the iOS build (Requested by enrica on #webkit).
3213
3214         Reverted changeset:
3215
3216         "[iOS] Make WebKit2 build with public iOS SDK and more build
3217         fixes for DRT"
3218         https://bugs.webkit.org/show_bug.cgi?id=137371
3219         http://trac.webkit.org/changeset/178068
3220
3221 2015-01-07  Daniel Bates  <dabates@apple.com>
3222
3223         [iOS] Make WebKit2 build with public iOS SDK and more build fixes for DRT
3224         https://bugs.webkit.org/show_bug.cgi?id=137371
3225
3226         Reviewed by David Kilzer.
3227
3228         Move EXTERN_C_BEGIN and EXTERN_C_END macros from file WebKit2/config.h to here and
3229         rename them to WTF_EXTERN_C_BEGIN and WTF_EXTERN_C_END, respectively, so that we
3230         can make use of these macros in SPI wrapper headers (e.g. UIKitSPI.h).
3231
3232         I'll look to transition existing code to WTF_EXTERN_C_BEGIN/WTF_EXTERN_C_END and
3233         remove EXTERN_C in a subsequent commit(s).
3234
3235         * wtf/Compiler.h:
3236
3237 2015-01-07  Brian J. Burg  <burg@cs.washington.edu>
3238
3239         Web Inspector: purge PassRefPtr from Inspector code and use Ref for typed and untyped protocol objects
3240         https://bugs.webkit.org/show_bug.cgi?id=140053
3241
3242         Reviewed by Andreas Kling.
3243
3244         * wtf/Stopwatch.h:
3245         (WTF::Stopwatch::create): Return a Ref.
3246
3247 2015-01-07  Commit Queue  <commit-queue@webkit.org>
3248
3249         Unreviewed, rolling out r178039.
3250         https://bugs.webkit.org/show_bug.cgi?id=140187
3251
3252         Breaks ObjC Inspector Protocol (Requested by JoePeck on
3253         #webkit).
3254
3255         Reverted changeset:
3256
3257         "Web Inspector: purge PassRefPtr from Inspector code and use
3258         Ref for typed and untyped protocol objects"
3259         https://bugs.webkit.org/show_bug.cgi?id=140053
3260         http://trac.webkit.org/changeset/178039
3261
3262 2015-01-06  Brian J. Burg  <burg@cs.washington.edu>
3263
3264         Web Inspector: purge PassRefPtr from Inspector code and use Ref for typed and untyped protocol objects
3265         https://bugs.webkit.org/show_bug.cgi?id=140053
3266
3267         Reviewed by Andreas Kling.
3268
3269         * wtf/Stopwatch.h:
3270         (WTF::Stopwatch::create): Return a Ref.
3271
3272 2015-01-06  Alexey Proskuryakov  <ap@apple.com>
3273
3274         ADDRESS_SANITIZER macro is overloaded
3275         https://bugs.webkit.org/show_bug.cgi?id=140130
3276
3277         Reviewed by Anders Carlsson.
3278
3279         * wtf/Compiler.h: Added an ASAN_ENABLED macro. The abbreviation should become well
3280         known - we already use it in tools.
3281
3282         * wtf/Assertions.h:
3283         * wtf/RefCounted.h:
3284         * wtf/SizeLimits.cpp:
3285         Change the conditional to ENABLE(SECURITY_ASSERTIONS). These checks will be used
3286         in debug builds, and also when one explicitly passes -DENABLE_SECURITY_ASSERTIONS.
3287
3288 2015-01-05  Andreas Kling  <akling@apple.com>
3289
3290         Purge PassRefPtr from Page.
3291         <https://webkit.org/b/140089>
3292
3293         Reviewed by Anders Carlsson.
3294
3295         Make SchedulePair::create() return Ref since it never fails.
3296
3297         * wtf/SchedulePair.h:
3298         (WTF::SchedulePair::create):
3299
3300 2015-01-01  Darin Adler  <darin@apple.com>
3301
3302         Rework code that hides characters in password fields to streamline a little
3303         https://bugs.webkit.org/show_bug.cgi?id=140035
3304
3305         Reviewed by Sam Weinig.
3306
3307         * wtf/text/StringImpl.cpp:
3308         (WTF::StringImpl::fill): Deleted.
3309         * wtf/text/StringImpl.h: Deleted StringImpl::fill.
3310         * wtf/text/WTFString.h:
3311         (WTF::String::fill): Deleted.
3312
3313 2014-12-26  Dan Bernstein  <mitz@apple.com>
3314
3315         Build fix.
3316
3317         Removed use of __builtin_s{add,sub}_overflow introduced in r177729 that was causing a compiler used at Apple to crash because of <rdar://problem/19347133>.
3318
3319         * wtf/SaturatedArithmetic.h:
3320         (signedAddOverflows):
3321         (signedSubtractOverflows):
3322
3323 2014-12-26  Dan Bernstein  <mitz@apple.com>
3324
3325         <rdar://problem/19348208> REGRESSION (r177027): iOS builds use the wrong toolchain
3326         https://bugs.webkit.org/show_bug.cgi?id=139950
3327
3328         Reviewed by David Kilzer.
3329
3330         * Configurations/Base.xcconfig: Only define TOOLCHAINS when building for OS X, doing so
3331         in a manner that works with Xcode 5.1.1.
3332
3333 2014-12-25  Dan Bernstein  <mitz@apple.com>
3334
3335         Try to fix the Windows build after r177733.
3336
3337         * wtf/Ref.h:
3338
3339 2014-12-25  Alexey Proskuryakov  <ap@apple.com>
3340
3341         Simplify saturated integer add/sub
3342         https://bugs.webkit.org/show_bug.cgi?id=139854
3343
3344         Address Darin's post-commit feedback to fix API tests.
3345
3346         * wtf/SaturatedArithmetic.h: (saturatedSubtraction):
3347
3348 2014-12-24  Benjamin Poulain  <benjamin@webkit.org>
3349
3350         Simplify saturated integer add/sub
3351         https://bugs.webkit.org/show_bug.cgi?id=139854
3352
3353         Reviewed by Darin Adler.
3354
3355         * wtf/Compiler.h:
3356         Make a wrapper for __has_builtin for compilers that do not support it.
3357
3358         * wtf/SaturatedArithmetic.h:
3359         (saturatedAddition):
3360         (saturatedSubtraction):
3361         Use the builtins when possible instead of reinventing the wheel.
3362         On ARMv7, use the saturated math instructions.
3363
3364 2014-12-23  Anders Carlsson  <andersca@apple.com>
3365
3366         Move dynamic_objc_cast to RetainPtr.h
3367         https://bugs.webkit.org/show_bug.cgi?id=139915
3368
3369         Reviewed by Sam Weinig.
3370
3371         * wtf/RetainPtr.h:
3372         (WTF::dynamic_objc_cast):
3373
3374 2014-12-23  Anders Carlsson  <andersca@apple.com>
3375
3376         Re-indent RefPtr.h and RetainPtr.h.
3377
3378         Rubber-stamped by Sam Weinig.
3379
3380         * wtf/RefPtr.h:
3381         * wtf/RetainPtr.h:
3382
3383 2014-12-20  Eric Carlson  <eric.carlson@apple.com>
3384
3385         [iOS] add optimized fullscreen API
3386         https://bugs.webkit.org/show_bug.cgi?id=139833
3387         <rdar://problem/18844486>
3388
3389         Reviewed by Simon Fraser.
3390
3391         * wtf/Platform.h: Define ENABLE_VIDEO_PRESENTATION_MODE.
3392
3393 2014-12-18  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3394
3395         Fix build break on EFL and GTK since r177523
3396         https://bugs.webkit.org/show_bug.cgi?id=139805
3397
3398         Reviewed by Csaba Osztrogonác.
3399
3400         * wtf/Ref.h: Include <wtf/StdLibExtras.h> to use std::exchange().
3401
3402 2014-12-18  Gavin Barraclough  <barraclough@apple.com>
3403
3404         Add strong typing to RefCounter interface, return value as a bool.
3405         https://bugs.webkit.org/show_bug.cgi?id=139776
3406
3407         Unreviewed style fixes.
3408
3409         * wtf/RefCounter.h:
3410         (WTF::=):
3411
3412 2014-12-18  Brent Fulgham  <bfulgham@apple.com>
3413
3414         [Win] Build correction after r177541.
3415
3416         * wtf/RefCounter.h:
3417         (WTF::RefCounter::Token<T>::Token): Revise constructor inlines to correct
3418         syntax error.
3419
3420 2014-12-18  Gavin Barraclough  <barraclough@apple.com>
3421
3422         Add strong typing to RefCounter interface, return value as a bool.
3423         https://bugs.webkit.org/show_bug.cgi?id=139776
3424
3425         Reviewed by Geoff Garen.
3426
3427         Currently all token vended by a RefCounter have the same type - Ref<RefCounter::Count>.
3428         This means there is no compile time type checking to prevent mistakes. Update the count()
3429         method to token<>(), templated on type used to identify the token being returned.
3430         Calls to token<T>() will return a result of type RefCounter::Token<T>.
3431
3432         There are a few problems with the fact the counter will return you an exact count of the
3433         number of outstanding tokens:
3434           - It is desirable to only fire the callback on zero-edge changes; it is more consistent
3435             to do so if the value is only readable as a boolean.
3436           - It is desirable to provide the value as an argument to the callback, however to make
3437             this useful for integer values it is also necessary to indicate the direction of change
3438             (0->1 is often interesting where 2->1 is not).
3439           - There is a mismatch between the precision of returning a count, and the inherent
3440             imprecision of a token based mechanism, where it may be difficult to guarantee
3441             absolutely no unnecessary refcount churn, and thus unintentional counter values.
3442
3443         * wtf/RefCounter.cpp:
3444         (WTF::RefCounter::Count::ref):
3445         (WTF::RefCounter::Count::deref):
3446             - only call the callback on zero-edge changes; provide the value.
3447         (WTF::RefCounter::RefCounter):
3448             - callback now takes a bool argument.
3449         * wtf/RefCounter.h:
3450         (WTF::RefCounter::Token::Token):
3451             - New opaque type to reference the RefCounter::Count.
3452         (WTF::RefCounter::Token::operator!):
3453             - ! operator checks for null / anasigned Tokens.
3454         (WTF::RefCounter::RefCounter):
3455             - callback now takes a bool argument.
3456         (WTF::RefCounter::token):
3457             - renamed from count(), templated on type of token returned.
3458         (WTF::RefCounter::value):
3459             - now returns a bool.
3460         (WTF::RefCounter::Token<T>::Token):
3461         (WTF::=):
3462             - Tokens can be copied & assigned.
3463         (WTF::RefCounter::count): Deleted.
3464             - renamed to token<>().
3465
3466 2014-12-18  Anders Carlsson  <andersca@apple.com>
3467
3468         Simplify smart pointer classes by using std::exchange
3469         https://bugs.webkit.org/show_bug.cgi?id=139790
3470
3471         Reviewed by Andreas Kling.
3472
3473         * wtf/MallocPtr.h:
3474         * wtf/OSObjectPtr.h:
3475         * wtf/OwnPtr.h:
3476         (WTF::OwnPtr<T>::clear):
3477         (WTF::OwnPtr<T>::release):
3478         (WTF::OwnPtr<T>::leakPtr):
3479         (WTF::=):
3480         * wtf/PassOwnPtr.h:
3481         (WTF::PassOwnPtr<T>::leakPtr):
3482         * wtf/PassRefPtr.h:
3483         (WTF::PassRefPtr<T>::leakRef):
3484         * wtf/Ref.h:
3485         * wtf/RefPtr.h:
3486         (WTF::RefPtr<T>::clear):
3487         (WTF::RefPtr<T>::leakRef):
3488         * wtf/RetainPtr.h:
3489         (WTF::RetainPtr<T>::leakRef):
3490
3491 2014-12-18  Anders Carlsson  <andersca@apple.com>
3492
3493         Clean up MachSendRight and add a copySendRight member function
3494         https://bugs.webkit.org/show_bug.cgi?id=139788
3495
3496         Reviewed by Tim Horton.
3497
3498         * wtf/StdLibExtras.h:
3499         (std::exchange):
3500         Add an implementation of std::exchange.
3501
3502 2014-12-17  Chris Dumez  <cdumez@apple.com>
3503
3504         [iOS] Make it possible to toggle FeatureCounter support at runtime
3505         https://bugs.webkit.org/show_bug.cgi?id=139688
3506         <rdar://problem/19266254>
3507
3508         Reviewed by Andreas Kling.
3509
3510         Remove FeatureCounter API from WTF and move it to WebCore/platform
3511         instead so that it can log conditionally based on a WebCore setting.
3512
3513         * WTF.vcxproj/WTF.vcxproj:
3514         * WTF.xcodeproj/project.pbxproj:
3515         * wtf/CMakeLists.txt:
3516
3517 2014-12-17  Brent Fulgham  <bfulgham@apple.com>
3518
3519         [Win] Correct DebugSuffix builds under MSBuild
3520         https://bugs.webkit.org/show_bug.cgi?id=139733
3521         <rdar://problem/19276880>
3522
3523         Reviewed by Simon Fraser.
3524
3525         * WTF.vcxproj/WTF.proj: Make sure to use the '_debug' suffix
3526         when building the DebugSuffix target.
3527
3528 2014-12-17  Anders Carlsson  <andersca@apple.com>
3529
3530         Make Ref::copyRef const and ref-qualified
3531         https://bugs.webkit.org/show_bug.cgi?id=139730
3532
3533         Reviewed by Andreas Kling.
3534
3535         * wtf/Ref.h:
3536
3537 2014-12-16  Daniel Bates  <dabates@apple.com>
3538
3539         [iOS] WTF fails to build with public SDK due to missing header CPAggregateDictionary.h
3540         https://bugs.webkit.org/show_bug.cgi?id=139695
3541
3542         Reviewed by Chris Dumez.
3543
3544         Add USE(APPLE_INTERNAL_SDK)-guard around iOS-specific feature counter implementation
3545         as we are only interested in counting features in builds of iOS WebKit that were built
3546         with the Apple Internal SDK.
3547
3548         * wtf/FeatureCounter.cpp:
3549         * wtf/ios/FeatureCounter.mm:
3550
3551 2014-12-16  Geoffrey Garen  <ggaren@apple.com>
3552
3553         Enable FastMalloc in debug builds
3554         https://bugs.webkit.org/show_bug.cgi?id=139692
3555
3556         Reviewed by Alexey Proskuryakov.
3557
3558         This will give debug builds greater fidelity to the real thing.
3559
3560         FastMalloc now transparently supports all the malloc debugging APIs I
3561         know of by disabling itself at runtime -- and it should be easy to add
3562         support for any APIs I missed -- so there's no need to turn it off in
3563         debug builds.
3564
3565         * wtf/FastMalloc.cpp:
3566
3567 2014-12-16  Anders Carlsson  <andersca@apple.com>
3568
3569         RefPtr::copyRef should be const
3570         https://bugs.webkit.org/show_bug.cgi?id=139689
3571
3572         Reviewed by Andreas Kling.
3573
3574         copyRef() doesn't modify the original object so it should be const.
3575         Also, add a && qualified overload and mark it deleted so that calls to copyRef() where
3576         the object is an rvalue will fail to compile.
3577
3578         * wtf/RefPtr.h:
3579
3580 2014-12-15  Chris Dumez  <cdumez@apple.com>
3581
3582         [iOS] Add feature counting support
3583         https://bugs.webkit.org/show_bug.cgi?id=139652
3584         <rdar://problem/19255690>
3585
3586         Reviewed by Gavin Barraclough.
3587
3588         Add a FeatureCounter API for to log / count when a feature
3589         is used. For now, this is only implementated on iOS.
3590
3591         * WTF.vcxproj/WTF.vcxproj:
3592         * WTF.xcodeproj/project.pbxproj:
3593         * wtf/CMakeLists.txt:
3594         * wtf/FeatureCounter.cpp: Added.
3595         (WTF::incrementFeatureCounterKey):
3596         (WTF::setFeatureCounterKey):
3597         * wtf/FeatureCounter.h: Added.
3598         * wtf/ios/FeatureCounter.mm: Added.
3599         (WTF::incrementFeatureCounterKey):
3600         (WTF::setFeatureCounterKey):
3601
3602 2014-12-12  Anders Carlsson  <andersca@apple.com>
3603
3604         Get rid of the DONT_FINALIZE_ON_MAIN_THREAD #define
3605         https://bugs.webkit.org/show_bug.cgi?id=139613
3606
3607         Reviewed by Sam Weinig.
3608
3609         * wtf/Platform.h:
3610         Remove the #define.
3611
3612 2014-12-15  Commit Queue  <commit-queue@webkit.org>
3613
3614         Unreviewed, rolling out r177284.
3615         https://bugs.webkit.org/show_bug.cgi?id=139658
3616
3617         "Breaks API tests and LayoutTests on Yosemite Debug"
3618         (Requested by msaboff on #webkit).
3619
3620         Reverted changeset:
3621
3622         "Make sure range based iteration of Vector<> still receives
3623         bounds checking"
3624         https://bugs.webkit.org/show_bug.cgi?id=138821
3625         http://trac.webkit.org/changeset/177284
3626
3627 2014-12-15  Andreas Kling  <akling@apple.com>
3628
3629         Purge PassRefPtr from FocusEvent code.
3630         <https://webkit.org/b/139647>
3631
3632         Reviewed by Anders Carlsson.
3633
3634         Add a RefPtr::copyRef() to use when passing a RefPtr to a RefPtr&& without
3635         transferring the ownership.
3636
3637         * wtf/RefPtr.h:
3638
3639 2014-12-15  Oliver Hunt  <oliver@apple.com>
3640
3641         Make sure range based iteration of Vector<> still receives bounds checking
3642         https://bugs.webkit.org/show_bug.cgi?id=138821
3643
3644         Reviewed by Mark Lam.
3645
3646         Add a new IndexedIterator struct to WTF that wraps a
3647         Vector type and index to provide pointer like semantics
3648         while still performing runtime bounds checking, even in
3649         release builds. We store a simple index into the vector
3650         which means that this iterator allows vector resizing
3651         during iteration. If the vector is resized such that the
3652         iterator is out of bounds, then any attempt to dereference
3653         the iterator will crash safely.
3654
3655         For the purpose of retaining semantically equivalent
3656         behaviour, the iterator can be moved to m_index == size()
3657         as that is the standard "end" terminator for these types.
3658         Attempting to dereference at that point will still crash
3659         rather than perform an unsafe memory operation.
3660
3661         By necessity there are many overrides for operator + and - as
3662         we otherwise hit many different type promotion ambiguities when
3663         performing arithmetic with iterators. These ambiguities are also
3664         different for 32- vs. 64-bit, so duplicating the functions
3665         and then forwarding to the core implementations that performed
3666         the bounds checking and mutation seemed like the right call.
3667
3668         * WTF.vcxproj/WTF.vcxproj:
3669         * WTF.vcxproj/WTF.vcxproj.filters:
3670         * WTF.xcodeproj/project.pbxproj:
3671         * wtf/IndexedIterator.h: Added.
3672         (WTF::IndexedIterator::IndexedIterator):
3673         (WTF::IndexedIterator::operator->):
3674         (WTF::IndexedIterator::operator*):
3675         (WTF::IndexedIterator::get):
3676         (WTF::IndexedIterator::operator++):
3677         (WTF::IndexedIterator::operator--):
3678         (WTF::IndexedIterator::operator UnspecifiedBoolType):
3679         (WTF::IndexedIterator::operator-):
3680         (WTF::IndexedIterator::operator=):
3681         (WTF::IndexedIterator::operator==):
3682         (WTF::IndexedIterator::operator!=):
3683         (WTF::IndexedIterator::operator<):
3684         (WTF::IndexedIterator::operator<=):
3685         (WTF::IndexedIterator::operator>):
3686         (WTF::IndexedIterator::operator>=):
3687         (WTF::IndexedIterator::operator const_iterator):
3688         (WTF::IndexedIterator::unsafeGet):
3689         (WTF::getPtr):
3690         (WTF::operator-):
3691         (WTF::operator==):
3692         (WTF::operator!=):
3693         (WTF::operator<=):
3694         (WTF::operator>=):
3695         (WTF::operator<):
3696         (WTF::operator>):
3697         (WTF::IndexedIteratorSelector::makeIterator):
3698         (WTF::IndexedIteratorSelector::makeConstIterator):
3699         * wtf/RefCountedArray.h:
3700         (WTF::RefCountedArray::RefCountedArray):
3701         * wtf/Vector.h:
3702         (WTF::Vector::Vector):
3703         (WTF::Vector::begin):
3704         (WTF::Vector::end):
3705         (WTF::OverflowHandler>::Vector):
3706         (WTF::=):
3707         (WTF::OverflowHandler>::fill):
3708         (WTF::OverflowHandler>::expandCapacity):
3709         (WTF::OverflowHandler>::tryExpandCapacity):
3710         (WTF::OverflowHandler>::resize):
3711         (WTF::OverflowHandler>::shrink):
3712         (WTF::OverflowHandler>::grow):
3713         (WTF::OverflowHandler>::reserveCapacity):
3714         (WTF::OverflowHandler>::tryReserveCapacity):
3715         (WTF::OverflowHandler>::shrinkCapacity):
3716         (WTF::OverflowHandler>::append):
3717         (WTF::OverflowHandler>::tryAppend):
3718         (WTF::OverflowHandler>::appendSlowCase):
3719         (WTF::OverflowHandler>::uncheckedAppend):
3720         (WTF::OverflowHandler>::appendVector):
3721         (WTF::OverflowHandler>::insert):
3722         (WTF::OverflowHandler>::insertVector):
3723         (WTF::OverflowHandler>::remove):
3724
3725 2014-12-14  Andreas Kling  <akling@apple.com>
3726
3727         Minor follow-up tweaks suggested by Darin on bug 139587.
3728
3729         * wtf/text/WTFString.h:
3730         (WTF::String::String):
3731
3732 2014-12-14  Andreas Kling  <akling@apple.com>
3733
3734         Replace PassRef with Ref/Ref&& across the board.
3735         <https://webkit.org/b/139587>
3736
3737         Reviewed by Darin Adler.
3738
3739         Kill the PassRef class and replace it by Ref/Ref&&.
3740         Usage is simple:
3741
3742             - For locals and members, keep using Ref<T>.
3743             - For return types, use Ref<T>.
3744             - For (ownership-transferring) arguments, use Ref<T>&&.
3745
3746         When passing to a Ref&&, use WTF::move() to mobilize the value
3747         at the call site, e.g:
3748
3749             void myFunction(Ref<Foo>&&);
3750
3751             Ref<Foo> myFoo(Foo::create());
3752             myFunction(WTF::move(myFoo));
3753             // 'myFoo' is invalid from this point forward.
3754
3755         As you can see, it works a lot like PassRefPtr, but unlike PassRefPtr
3756         it won't surprise you by becoming null *unless* you WTF::move it.
3757
3758         I've also added a Ref::copyRef() for instances where you want to
3759         return a Ref *without* transferring ownership, e.g code like:
3760
3761             Ref<Foo> foo() { return m_foo; }
3762
3763         ... now becomes ...
3764
3765             Ref<Foo> foo() { return m_foo.copyRef(); }
3766
3767         This makes it explicit that a refcount bump will occur.
3768
3769         Finally, do note that unlike last year's PassRef, Ref&& does not
3770         require you to move it to avoid leaking; it will clean itself up.
3771
3772         * wtf/PassRef.h:
3773         (WTF::adopted): Deleted.
3774         (WTF::PassRef<T>::PassRef): Deleted.
3775         (WTF::PassRef<T>::~PassRef): Deleted.
3776         (WTF::PassRef<T>::get): Deleted.
3777         (WTF::PassRef<T>::ptr): Deleted.
3778         (WTF::PassRef<T>::leakRef): Deleted.
3779         (WTF::adoptRef): Deleted.
3780         (WTF::createRefCounted): Deleted.
3781         * wtf/PassRefPtr.h:
3782         (WTF::PassRefPtr::PassRefPtr):
3783         * wtf/Ref.h:
3784         (WTF::adopted):
3785         (WTF::Ref::~Ref):
3786         (WTF::Ref::Ref):
3787         (WTF::Ref::operator=):
3788         (WTF::Ref::operator->):
3789         (WTF::Ref::ptr):
3790         (WTF::Ref::get):
3791         (WTF::Ref::operator T&):
3792         (WTF::Ref::operator const T&):
3793         (WTF::Ref<T>::replace):
3794         (WTF::adoptRef):
3795         * wtf/RefCounter.h:
3796         (WTF::RefCounter::count):
3797         * wtf/RefPtr.h:
3798         (WTF::RefPtr::releaseNonNull):
3799         (WTF::RefPtr<T>::RefPtr):
3800         (WTF::=):
3801         * wtf/text/AtomicString.cpp:
3802         (WTF::addToStringTable):
3803         (WTF::AtomicString::add):
3804         (WTF::AtomicString::addFromLiteralData):
3805         (WTF::AtomicString::addSlowCase):
3806         * wtf/text/AtomicString.h:
3807         * wtf/text/StringImpl.cpp:
3808         (WTF::StringImpl::createFromLiteral):
3809         (WTF::StringImpl::createWithoutCopying):
3810         (WTF::StringImpl::createUninitializedInternal):
3811         (WTF::StringImpl::createUninitializedInternalNonEmpty):
3812         (WTF::StringImpl::createUninitialized):
3813         (WTF::StringImpl::reallocateInternal):
3814         (WTF::StringImpl::reallocate):
3815         (WTF::StringImpl::createInternal):
3816         (WTF::StringImpl::create):
3817         (WTF::StringImpl::create8BitIfPossible):
3818         (WTF::StringImpl::substring):
3819         (WTF::StringImpl::lower):
3820         (WTF::StringImpl::upper):
3821         (WTF::StringImpl::fill):
3822         (WTF::StringImpl::foldCase):
3823         (WTF::StringImpl::convertToASCIILowercase):
3824         (WTF::StringImpl::stripMatchedCharacters):
3825         (WTF::StringImpl::stripWhiteSpace):
3826         (WTF::StringImpl::removeCharacters):
3827         (WTF::StringImpl::simplifyMatchedCharactersToSpace):
3828         (WTF::StringImpl::simplifyWhiteSpace):
3829         (WTF::StringImpl::replace):
3830         (WTF::StringImpl::adopt):
3831         * wtf/text/StringImpl.h:
3832         (WTF::StringImpl::create8BitIfPossible):
3833         (WTF::StringImpl::create):
3834         (WTF::StringImpl::createSubstringSharingImpl8):
3835         (WTF::StringImpl::createSubstringSharingImpl):
3836         (WTF::StringImpl::createFromLiteral):
3837         (WTF::StringImpl::createEmptyUnique):
3838         (WTF::StringImpl::adopt):
3839         (WTF::StringImpl::replace):
3840         (WTF::StringImpl::constructInternal<LChar>):
3841         (WTF::StringImpl::constructInternal<UChar>):
3842         (WTF::StringImpl::isolatedCopy):
3843         * wtf/text/WTFString.h:
3844         (WTF::String::String):
3845
3846 2014-12-10  Geoffrey Garen  <ggaren@apple.com>
3847
3848         Please disable the webkitFirstVersionWithInitConstructorSupport check on Apple TV
3849         https://bugs.webkit.org/show_bug.cgi?id=139501
3850
3851         Reviewed by Gavin Barraclough.
3852
3853         Added a platform definition for APPLETV.
3854
3855         (It's not an OS because it's not mutually exclusive with other OS definitions.)
3856
3857         * wtf/Platform.h:
3858
3859 2014-12-10  Martin Robinson  <mrobinson@igalia.com>
3860
3861         [GTK] Add support for text-decoration-skip
3862         https://bugs.webkit.org/show_bug.cgi?id=131540
3863
3864         Reviewed by Gustavo Noronha Silva.
3865
3866         * wtf/Platform.h: Enable text decoration skip by default.
3867
3868 2014-12-09  David Kilzer  <ddkilzer@apple.com>
3869
3870         Switch from using PLATFORM_NAME to SDK selectors in ANGLE, bmalloc, gtest, JavaScriptCore, WTF
3871         <http://webkit.org/b/139212>
3872
3873         Reviewed by Joseph Pecoraro.
3874
3875         * Configurations/Base.xcconfig:
3876         - Only set GCC_ENABLE_OBJC_GC, GCC_MODEL_TUNING and TOOLCHAINS
3877           on OS X.
3878         * Configurations/DebugRelease.xcconfig:
3879         - Only set MACOSX_DEPLOYMENT_TARGET and SDKROOT on OS X.
3880
3881 2014-12-09  Dean Jackson  <dino@apple.com>
3882
3883         [Apple] Use Accelerate framework to speed-up FEGaussianBlur
3884         https://bugs.webkit.org/show_bug.cgi?id=139310
3885
3886         Unreviewed followup, after comments by Andreas Kling.
3887
3888         It was pointed out that we already have a USE(ACCELERATE), so
3889         we don't need a HAVE(ACCELERATE) :)
3890
3891         * wtf/Platform.h:
3892
3893 2014-12-09  Alberto Garcia  <berto@igalia.com>
3894
3895         Undefined Symbol build error "_objc_registerThreadWithCollector" when building WebKit GTK Mac OS X on Snow Leopard
3896         https://bugs.webkit.org/show_bug.cgi?id=58737
3897
3898         Reviewed by Darin Adler.
3899
3900         Replace OS(MAC_OS_X) with PLATFORM(MAC) to prevent using
3901         osx-specific code in WebKitGTK+ builds.
3902
3903         * wtf/ThreadingPthreads.cpp:
3904         (WTF::initializeCurrentThreadInternal):
3905
3906 2014-12-08  Dean Jackson  <dino@apple.com>
3907
3908         [Apple] Use Accelerate framework to speed-up FEGaussianBlur
3909         https://bugs.webkit.org/show_bug.cgi?id=139310
3910         <rdar://problem/18434594>
3911
3912         Reviewed by Simon Fraser.
3913
3914         Add a HAVE_ACCELERATE flag, true on Apple platforms.
3915
3916         * wtf/Platform.h:
3917
3918 2014-12-08  Myles C. Maxfield  <mmaxfield@apple.com>
3919
3920         Fix iOS build after r176971.
3921
3922         I had previously modified the WTF forwarding header instead of modifying the real source.
3923
3924         * wtf/unicode/CharacterNames.h:
3925
3926 2014-12-08  Anders Carlsson  <andersca@apple.com>
3927
3928         Change WTF::currentCPUTime to return std::chrono::microseconds and get rid of currentCPUTimeMS
3929         https://bugs.webkit.org/show_bug.cgi?id=139410
3930
3931         Reviewed by Andreas Kling.
3932
3933         * wtf/CurrentTime.cpp:
3934         (WTF::currentCPUTime):
3935         (WTF::currentCPUTimeMS): Deleted.
3936         * wtf/CurrentTime.h:
3937
3938 2014-12-08  Chris Dumez  <cdumez@apple.com>
3939
3940         Revert r176293 & r176275
3941
3942         Unreviewed, revert r176293 & r176275 changing the Vector API to use unsigned type
3943         instead of size_t. There is some disagreement regarding the long-term direction
3944         of the API and we shouldn’t leave the API partly transitioned to unsigned type
3945         while making a decision.
3946
3947         * wtf/Forward.h:
3948         * wtf/Vector.h:
3949         (WTF::VectorTypeOperations::compare):
3950         (WTF::VectorBufferBase::allocateBuffer):
3951         (WTF::VectorBufferBase::tryAllocateBuffer):
3952         (WTF::VectorBufferBase::shouldReallocateBuffer):
3953         (WTF::VectorBufferBase::reallocateBuffer):
3954         (WTF::VectorBufferBase::capacity):
3955         (WTF::VectorBufferBase::VectorBufferBase):
3956         (WTF::VectorBuffer::VectorBuffer):
3957         (WTF::VectorBuffer::allocateBuffer):
3958         (WTF::VectorBuffer::tryAllocateBuffer):
3959         (WTF::VectorBuffer::shouldReallocateBuffer):
3960         (WTF::VectorBuffer::reallocateBuffer):
3961         (WTF::VectorBuffer::swap):
3962         (WTF::VectorBuffer::swapInlineBuffer):
3963         (WTF::VectorBuffer::swapInlineBuffers):
3964         (WTF::Vector::Vector):
3965         (WTF::Vector::capacity):
3966         (WTF::Vector::at):
3967         (WTF::Vector::operator[]):
3968         (WTF::OverflowHandler>::find):
3969         (WTF::OverflowHandler>::reverseFind):
3970         (WTF::OverflowHandler>::fill):
3971         (WTF::OverflowHandler>::expandCapacity):
3972         (WTF::OverflowHandler>::tryExpandCapacity):
3973         (WTF::OverflowHandler>::resize):
3974         (WTF::OverflowHandler>::resizeToFit):
3975         (WTF::OverflowHandler>::shrink):
3976         (WTF::OverflowHandler>::grow):
3977         (WTF::OverflowHandler>::reserveCapacity):
3978         (WTF::OverflowHandler>::tryReserveCapacity):
3979         (WTF::OverflowHandler>::reserveInitialCapacity):
3980         (WTF::OverflowHandler>::shrinkCapacity):
3981         (WTF::OverflowHandler>::append):
3982         (WTF::OverflowHandler>::tryAppend):
3983         (WTF::OverflowHandler>::insert):
3984         (WTF::OverflowHandler>::insertVector):
3985         (WTF::OverflowHandler>::remove):
3986         (WTF::OverflowHandler>::reverse):
3987         (WTF::OverflowHandler>::checkConsistency):
3988         * wtf/text/AtomicString.h:
3989         * wtf/text/StringImpl.h:
3990         (WTF::StringImpl::adopt):
3991         (WTF::equalIgnoringNullity):
3992         * wtf/text/StringView.h:
3993         (WTF::append):
3994         * wtf/text/WTFString.h:
3995
3996 2014-12-07  Andreas Kling  <akling@apple.com>
3997
3998         Use more PassRef in AtomicString.
3999         <https://webkit.org/b/139319>
4000
4001         Reviewed by Antti Koivisto.
4002
4003         Make a pass over AtomicString and convert functions that return PassRefPtr
4004         into returning RefPtr (where it may be null) and PassRef otherwise.
4005         This allows the compiler to skip null checks in many places.
4006
4007         * wtf/text/AtomicString.cpp:
4008         (WTF::addToStringTable):
4009         (WTF::AtomicString::add):
4010         (WTF::AtomicString::addFromLiteralData):
4011         (WTF::AtomicString::addSlowCase):
4012         * wtf/text/AtomicString.h:
4013         (WTF::AtomicString::add):
4014         (WTF::AtomicString::addWithStringTableProvider):
4015         * wtf/text/cf/AtomicStringCF.cpp:
4016         (WTF::AtomicString::add):
4017
4018 2014-12-05  Roger Fong  <roger_fong@apple.com>
4019
4020         [Win] proj files copying over too many resources..
4021         https://bugs.webkit.org/show_bug.cgi?id=139315.
4022         <rdar://problem/19148278>
4023
4024         Reviewed by Brent Fulgham.
4025
4026         * WTF.vcxproj/WTF.proj: Only copy WTF.dll.
4027
4028 2014-12-05  Andreas Kling  <akling@apple.com>
4029
4030         PassRef should deref on destruction if pointee was not moved.
4031         <https://webkit.org/b/139309>
4032
4033         Reviewed by Antti Koivisto.
4034
4035         Let PassRef become nullptr internally after having WTF::move()'d the pointee.
4036         This means that PassRef is now essentially a PassRefPtr that can only be
4037         constructed with a non-null pointee.
4038
4039         This should make it possible for all ::create()-style construction helpers to
4040         return PassRef, removing a branch in each case.
4041
4042         * wtf/PassRef.h:
4043         (WTF::PassRef<T>::PassRef):
4044         (WTF::PassRef<T>::~PassRef):
4045         (WTF::PassRef<T>::get):
4046         (WTF::PassRef<T>::ptr):
4047         (WTF::PassRef<T>::leakRef):
4048         (WTF::PassRef<T>::dropRef): Deleted.
4049
4050 2014-12-05  Jer Noble  <jer.noble@apple.com>
4051
4052         [WTF] MediaTime should support round-tripping from and to doubles.
4053         https://bugs.webkit.org/show_bug.cgi?id=139248
4054
4055         Reviewed by Eric Carlson.
4056
4057         MediaTimes should be able to return precisely the same double value as was used
4058         when the MediaTime was created, so long as that MediaTime was not modified in a
4059         non-destructive way. This will allow API which accepts floating-point values to
4060         return the exact same value when asked, but still be able to store that value
4061         as a MediaTime.
4062
4063         * wtf/MediaTime.cpp:
4064         (WTF::MediaTime::createWithFloat): Added; store the floating-point value in a union.
4065         (WTF::MediaTime::createWithDouble): Ditto.
4066         (WTF::MediaTime::toFloat): If the value is a double, just return it.
4067         (WTF::MediaTime::toDouble): Ditto.
4068         (WTF::MediaTime::operator+): Special case when one or both sides are doubles.
4069         (WTF::MediaTime::operator-): Ditto.
4070         (WTF::MediaTime::operator*): Ditto.
4071         (WTF::MediaTime::compare): Ditto.
4072         (WTF::abs): Ditto.
4073         (WTF::MediaTime::setTimeScale): Convert the MediaTime from a double.
4074
4075 2014-12-05  peavo@outlook.com  <peavo@outlook.com>
4076
4077         [WinCairo] WTF project is missing a GStreamer source file.
4078         https://bugs.webkit.org/show_bug.cgi?id=139296
4079
4080         Reviewed by Philippe Normand.
4081
4082         The WTF project file is missing a GStreamer source file,
4083         causing a link error when compiling with GStreamer enabled.
4084
4085         * WTF.vcxproj/WTF.vcxproj:
4086         * WTF.vcxproj/WTF.vcxproj.filters:
4087
4088 2014-12-04  David Kilzer  <ddkilzer@apple.com>
4089
4090         REGRESSION (r176683): RefCounter.h is installed outside SDKROOT
4091
4092         * WTF.xcodeproj/project.pbxproj: Don't mark RefCounter.h as a
4093         private header.  WTF headers use a special build phase script to
4094         be installed.
4095
4096 2014-12-04  Anders Carlsson  <andersca@apple.com>
4097
4098         Make API::String copy the underlying strings if needed, for thread safety
4099         https://bugs.webkit.org/show_bug.cgi?id=139261
4100
4101         Reviewed by Sam Weinig.
4102
4103         * wtf/RefPtr.h:
4104         (WTF::RefPtr<T>::leakRef):
4105         Add a leakRef() to RefPtr so we don't have to go through PassRefPtr.
4106
4107         * wtf/text/WTFString.cpp:
4108         (WTF::String::isSafeToSendToAnotherThread):
4109         Check if the string is empty before checking whether it's in an atomic string table.
4110         It's safe to send empty strings to other threads even if they're in the atomic string table
4111         since they will never be deallocated.
4112
4113 2014-12-04  Csaba Osztrogonác  <ossy@webkit.org>
4114
4115         Fix cast-align warning in StringImpl.h
4116         https://bugs.webkit.org/show_bug.cgi?id=139222
4117
4118         Reviewed by Anders Carlsson.
4119
4120         * wtf/text/StringImpl.h:
4121         (WTF::StringImpl::tailPointer):
4122
4123 2014-12-02  Mark Lam  <mark.lam@apple.com>
4124
4125         Rolling out r176592, r176603, r176616, and r176705 until build and perf issues are resolved.
4126         https://bugs.webkit.org/show_bug.cgi?id=138821
4127
4128         Not reviewed.
4129
4130         * WTF.vcxproj/WTF.vcxproj:
4131         * WTF.vcxproj/WTF.vcxproj.filters:
4132         * WTF.xcodeproj/project.pbxproj:
4133         * wtf/IndexedIterator.h: Removed.
4134         * wtf/RefCountedArray.h:
4135         (WTF::RefCountedArray::RefCountedArray):
4136         * wtf/Vector.h:
4137         (WTF::Vector::Vector):
4138         (WTF::Vector::begin):
4139         (WTF::Vector::end):
4140         (WTF::OverflowHandler>::Vector):
4141         (WTF::=):
4142         (WTF::OverflowHandler>::fill):
4143         (WTF::OverflowHandler>::expandCapacity):
4144         (WTF::OverflowHandler>::tryExpandCapacity):
4145         (WTF::OverflowHandler>::resize):
4146         (WTF::OverflowHandler>::shrink):
4147         (WTF::OverflowHandler>::grow):
4148         (WTF::OverflowHandler>::reserveCapacity):
4149         (WTF::OverflowHandler>::tryReserveCapacity):
4150         (WTF::OverflowHandler>::shrinkCapacity):
4151         (WTF::OverflowHandler>::append):
4152         (WTF::OverflowHandler>::tryAppend):
4153         (WTF::OverflowHandler>::appendSlowCase):
4154         (WTF::OverflowHandler>::uncheckedAppend):
4155         (WTF::OverflowHandler>::appendVector):
4156         (WTF::OverflowHandler>::insert):
4157         (WTF::OverflowHandler>::insertVector):
4158         (WTF::OverflowHandler>::remove):
4159
4160 2014-12-02  Oliver Hunt  <oliver@apple.com>
4161
4162         Fix IOS builds.
4163
4164         * wtf/IndexedIterator.h:
4165
4166 2014-12-02  Gavin Barraclough  <barraclough@apple.com>
4167
4168         Generalize PageActivityAssertionToken
4169         https://bugs.webkit.org/show_bug.cgi?id=139106
4170
4171         Reviewed by Sam Weinig.
4172
4173         PageActivityAssertionToken is a RAII mechanism implementing a counter, used by PageThrottler
4174         to count user visible activity in progress on the page (currently page load and media playback).
4175         Use of an RAII type is prevents a number of possible errors, including double counting a single
4176         media element, or failing to decrement the count after a media element has been deallocated.
4177
4178         The current implementation has a number of drawbacks that have been addressed by this refactoring:
4179          - specific to single use in PageThrottler class - not reusable.
4180          - incomplete encapsulation - the counter and WeakPtrFactory that comprise the current implementation
4181            are not encapsulated (are in the client type, PageThrottler).
4182          - tokens are not shared - PageActivityAssertionToken instances are managed by std::unique, every
4183            increment requires an object allocation.
4184          - redundancy - the current implementation uses a WeakPtr to safely reference the PageThrottler, this
4185            is internally implemented using a reference counted type, resulting in two counters being
4186            incremented (one in the PageActivityAssertionToken, one in the PageThrottler).
4187
4188         In the reimplementation:
4189          - a callback is provided via a lambda function, which allows for easy reuse without a lot of
4190            boilerplate code.
4191          - the counter, callback and ownership of the otherwise weakly-owned token is encapsulated within the
4192            RefCounter type.
4193          - a single count within RefCounter::Count stores the counter value, and also manage the lifetime
4194            of this object.
4195          - standard RefPtrs are used to manage references to the RefCounter::Count.
4196
4197         * WTF.xcodeproj/project.pbxproj:
4198             - added RefCounter.cpp/.h
4199         * wtf/RefCounter.cpp: Added.
4200         (WTF::RefCounter::Count::ref):
4201             - increment the counter.
4202         (WTF::RefCounter::Count::deref):
4203             - decrement the counter, and delete as necessary.
4204         (WTF::RefCounter::RefCounter):
4205             - create a RefCounter::Count.
4206         (WTF::RefCounter::~RefCounter):
4207             - eagerly delete the Counter if it has no references, otherwise let it be deleted on last deref.
4208         * wtf/RefCounter.h: Added.
4209         (WTF::RefCounter::Count::Count):
4210             - initialize count to 0.
4211         (WTF::RefCounter::RefCounter):
4212             - takes a lambda to be called when the value changes.
4213         (WTF::RefCounter::count):
4214             - reference the counter (and in doing so increment the count).
4215         (WTF::RefCounter::value):
4216             - access the current value of the counter.
4217
4218 2014-12-01  Andreas Kling  <akling@apple.com>
4219
4220         Optimize constructing JSC::Identifier from AtomicString.
4221         <https://webkit.org/b/139157>
4222
4223         Reviewed by Michael Saboff.
4224
4225         Make AtomicString::isInAtomicStringTable() public so it can be used
4226         in some Identifier assertions.
4227
4228         * wtf/text/AtomicString.h:
4229
4230 2014-12-01  Oliver Hunt  <oliver@apple.com>
4231
4232         Fix non-mac builds.
4233
4234         * wtf/IndexedIterator.h:
4235
4236 2014-12-01  Oliver Hunt  <oliver@apple.com>
4237
4238         Fix 32-bit build.
4239
4240         * wtf/IndexedIterator.h:
4241
4242 2014-11-17  Oliver Hunt  <oliver@apple.com>
4243
4244         Make sure range based iteration of Vector<> still receives bounds checking
4245         https://bugs.webkit.org/show_bug.cgi?id=138821
4246
4247         Reviewed by Mark Lam.
4248
4249         Add a new IndexedIterator struct to WTF that wraps a
4250         Vector type and index to provide pointer like semantics
4251         while still performing runtime bounds checking, even in
4252         release builds. We store a simple index into the vector
4253         which means that this iterator allows vector resizing
4254         during iteration. If the vector is resized such that the
4255         iterator is out of bounds, then any attempt to dereference
4256         the iterator will crash safely. Any other errors, including
4257         overflows, and over extending the iterator will likewise
4258         crash.
4259
4260         For the purpose of retaining semantically equivalent
4261         behaviour, the iterator can be moved to m_index == size()
4262         as that is the standard "end" terminator for these types.
4263         Attempting to dereference at that point will still crash
4264         rather than perform an unsafe memory operation.
4265
4266         In order to maintain the validity of all the bounds checking,
4267         we perform full integer range checking prior to any mutation
4268         of the iterator location. If we detect an arithmetic overflow
4269         we will crash rather than attempting to carry on.
4270
4271         By necessity there are many overrides for operator + and - as
4272         we otherwise hit many different type promotion ambiguities when
4273         performing arithmetic with iterators. These ambiguities are also
4274         different for 32- vs. 64-bit, so duplicating the functions
4275         and then forwarding to the core implementations that performed
4276         the bounds checking and mutation seemed like the right call.
4277
4278         * WTF.xcodeproj/project.pbxproj:
4279         * wtf/IndexedIterator.h: Added.
4280         (WTF::IndexedIterator::IndexedIterator):
4281         (WTF::IndexedIterator::operator->):
4282         (WTF::IndexedIterator::operator*):
4283         (WTF::IndexedIterator::get):
4284         (WTF::IndexedIterator::operator++):
4285         (WTF::IndexedIterator::operator--):
4286         (WTF::IndexedIterator::operator UnspecifiedBoolType):
4287         (WTF::IndexedIterator::operator+=):
4288         (WTF::IndexedIterator::operator-=):
4289         (WTF::IndexedIterator::operator+):
4290         (WTF::IndexedIterator::operator-):
4291         (WTF::IndexedIterator::operator=):
4292         (WTF::IndexedIterator::operator==):
4293         (WTF::IndexedIterator::operator!=):
4294         (WTF::IndexedIterator::operator<):
4295         (WTF::IndexedIterator::operator<=):
4296         (WTF::IndexedIterator::operator>):
4297         (WTF::IndexedIterator::operator>=):
4298         (WTF::IndexedIterator::operator const_iterator):
4299         (WTF::IndexedIterator::isSafeToCompare):
4300         (WTF::IndexedIterator::unsafeGet):
4301         (WTF::getPtr):
4302         (WTF::operator-):
4303         (WTF::operator==):
4304         (WTF::operator!=):
4305         (WTF::operator<=):