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