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