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