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