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