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