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