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