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