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