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