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