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