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