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