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