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