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