Update supported platforms in xcconfig files to match the sdk names.
[WebKit-https.git] / Source / WTF / ChangeLog
1 2016-07-13  Enrica Casucci  <enrica@apple.com>
2
3         Update supported platforms in xcconfig files to match the sdk names.
4         https://bugs.webkit.org/show_bug.cgi?id=159728
5
6         Reviewed by Tim Horton.
7
8         * Configurations/Base.xcconfig:
9
10 2016-07-13  Carlos Garcia Campos  <cgarcia@igalia.com>
11
12         [GTK] WebKitGtk+ uses too many file descriptors
13         https://bugs.webkit.org/show_bug.cgi?id=152316
14
15         Reviewed by Michael Catanzaro.
16
17         Add helper functions to duplicate a file descriptor setting close on exec flag, and also to set close on exec
18         flag to an existing file descriptor.
19
20         * wtf/UniStdExtras.h:
21         * wtf/UniStdExtras.cpp
22         (WTF::setCloseOnExec):
23         (WTF::dupCloseOnExec):
24
25 2016-07-12  Benjamin Poulain  <bpoulain@apple.com>
26
27         [JSC] Array.prototype.join() fails some conformance tests
28         https://bugs.webkit.org/show_bug.cgi?id=159657
29
30         Reviewed by Saam Barati.
31
32         * wtf/text/AtomicString.cpp:
33         (WTF::AtomicString::number):
34         * wtf/text/AtomicString.h:
35
36 2016-07-12  Commit Queue  <commit-queue@webkit.org>
37
38         Unreviewed, rolling out r203131.
39         https://bugs.webkit.org/show_bug.cgi?id=159698
40
41         This change caused an existing LayoutTest to time out on debug
42         testers (Requested by ryanhaddad on #webkit).
43
44         Reverted changeset:
45
46         "[JSC] Array.prototype.join() fails some conformance tests"
47         https://bugs.webkit.org/show_bug.cgi?id=159657
48         http://trac.webkit.org/changeset/203131
49
50 2016-07-12  Filip Pizlo  <fpizlo@apple.com>
51
52         platformUserPreferredLanguages on Mac should not try to put the region into the language
53         https://bugs.webkit.org/show_bug.cgi?id=159693
54
55         Rubber stamped by Alexey Proskuryakov.
56         
57         Currently, navigator.language is the thing that we use as the BCP-47 tag in our Intl code
58         when certain APIs are called without a locale argument.  That mostly makes sense, and is
59         deeply wired into our engine.
60
61         In r200105, we made Intl aware of the region as a separate thing from the language by having
62         platformUserPreferredLanguages() return something like a BCP-47 tag that was
63         <language>-<region>.  For example, if I told System Preferences that I want to speak English
64         but live in Poland then we'd get "en-pl".  This had the effect of making Intl APIs format
65         dates using Polish formatting, for example.
66
67         But this is an odd change, since that same function also feeds into navigator.language.
68         "en-pl" isn't what we want there, since my System Preferences settings aren't supposed to
69         mean that I want to speak Polish-style English.  There's no such thing.
70
71         It may be worthwhile to wire the region settings more elegantly into Intl, but if we do that,
72         it should be via a mechanism that is separate from navigator.language. So, this change simply
73         reverts r200105.
74
75         * wtf/PlatformUserPreferredLanguagesMac.mm:
76         (WTF::httpStyleLanguageCode):
77         (WTF::platformUserPreferredLanguages):
78         (WTF::isValidICUCountryCode): Deleted.
79
80 2016-07-12  Per Arne Vollan  <pvollan@apple.com>
81
82         [Win] Fix for build error when trying to version stamp dll.
83         https://bugs.webkit.org/show_bug.cgi?id=159692
84
85         Reviewed by Brent Fulgham.
86
87         Use correct path to version stamp script.
88
89         * wtf/CMakeLists.txt:
90
91 2016-07-12  Benjamin Poulain  <bpoulain@apple.com>
92
93         [JSC] Array.prototype.join() fails some conformance tests
94         https://bugs.webkit.org/show_bug.cgi?id=159657
95
96         Reviewed by Saam Barati.
97
98         * wtf/text/AtomicString.cpp:
99         (WTF::AtomicString::number):
100         * wtf/text/AtomicString.h:
101
102 2016-07-12  Myles C. Maxfield  <mmaxfield@apple.com>
103
104         Relax ordering requirements on StringView::CodePoints iterator
105         https://bugs.webkit.org/show_bug.cgi?id=159609
106
107         Reviewed by Darin Adler.
108
109         Previously, there was a requirement where if you use a CodePoints
110         iterator, you couldn't dereference twice in a row or increment
111         twice in a row. This restriction is unnecessary.
112
113         * wtf/text/StringView.h:
114         (WTF::StringView::CodePoints::Iterator::Iterator):
115         (WTF::StringView::CodePoints::Iterator::advanceCurrentCodePoint):
116         (WTF::StringView::CodePoints::Iterator::operator*):
117         (WTF::StringView::CodePoints::Iterator::operator==):
118
119 2016-07-12  Csaba Osztrogonác  <ossy@webkit.org>
120
121         JSCOnly bulidfix after r203078
122         https://bugs.webkit.org/show_bug.cgi?id=159669
123
124         Reviewed by Yusuke Suzuki.
125
126         * wtf/PlatformJSCOnly.cmake:
127         * wtf/text/jsconly/TextBreakIteratorInternalICUJSCOnly.cpp: Added.
128         (WTF::currentSearchLocaleID):
129         (WTF::currentTextBreakLocaleID):
130
131 2016-07-12  Per Arne Vollan  <pvollan@apple.com>
132
133         [Win] DLLs are missing version information.
134         https://bugs.webkit.org/show_bug.cgi?id=159349
135
136         Reviewed by Brent Fulgham.
137
138         Generate autoversion.h and run perl version stamp utility.
139
140         * wtf/CMakeLists.txt:
141
142 2016-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
143
144         Implement grapheme cluster iterator on StringView
145         https://bugs.webkit.org/show_bug.cgi?id=159598
146
147         Reviewed by Anders Carlsson.
148
149         This is in preparation for honoring the second argument to FontFaceSet.load().
150
151         * wtf/text/StringView.cpp:
152         (WTF::StringView::GraphemeClusters::Iterator::Impl::Impl):
153         (WTF::StringView::GraphemeClusters::Iterator::Impl::operator++):
154         (WTF::StringView::GraphemeClusters::Iterator::Impl::operator*):
155         (WTF::StringView::GraphemeClusters::Iterator::Impl::operator==):
156         (WTF::StringView::GraphemeClusters::Iterator::Impl::computeIndexEnd):
157         (WTF::StringView::GraphemeClusters::Iterator::Iterator):
158         (WTF::StringView::GraphemeClusters::Iterator::~Iterator):
159         (WTF::StringView::GraphemeClusters::Iterator::operator*):
160         (WTF::StringView::GraphemeClusters::Iterator::operator==):
161         (WTF::StringView::GraphemeClusters::Iterator::operator!=):
162         * wtf/text/StringView.h:
163         (WTF::StringView::GraphemeClusters::GraphemeClusters):
164         * text/TextBreakIterator.cpp:
165         (WebCore::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator):
166         * text/TextBreakIterator.h:
167
168 2016-07-10  Myles C. Maxfield  <mmaxfield@apple.com>
169
170         Move breaking iterator code to WTF
171         https://bugs.webkit.org/show_bug.cgi?id=159594
172
173         Reviewed by Alex Christensen.
174
175         This is in preparation for giving StringView a GraphemeClusters iterator.
176         Such an interator needs to be implemented on top of our breaking iterator
177         code.
178
179         * WTF.xcodeproj/project.pbxproj:
180         * icu/unicode/ubrk.h: Added.
181         * icu/unicode/utext.h: Renamed from Source/WebCore/icu/unicode/utext.h.
182         * wtf/CMakeLists.txt:
183         * wtf/PlatformEfl.cmake:
184         * wtf/PlatformGTK.cmake:
185         * wtf/PlatformMac.cmake:
186         * wtf/PlatformWin.cmake:
187         * wtf/TinyLRUCache.h:
188         * wtf/text/LineBreakIteratorPoolICU.h: Renamed from Source/WebCore/platform/text/LineBreakIteratorPoolICU.h.
189         (WTF::LineBreakIteratorPool::LineBreakIteratorPool):
190         (WTF::LineBreakIteratorPool::sharedPool):
191         (WTF::LineBreakIteratorPool::makeLocaleWithBreakKeyword):
192         (WTF::LineBreakIteratorPool::take):
193         (WTF::LineBreakIteratorPool::put):
194         * wtf/text/TextBreakIterator.cpp: Renamed from Source/WebCore/platform/text/TextBreakIterator.cpp.
195         (WTF::initializeIterator):
196         (WTF::initializeIteratorWithRules):
197         (WTF::setTextForIterator):
198         (WTF::setContextAwareTextForIterator):
199         (WTF::wordBreakIterator):
200         (WTF::sentenceBreakIterator):
201         (WTF::cursorMovementIterator):
202         (WTF::acquireLineBreakIterator):
203         (WTF::releaseLineBreakIterator):
204         (WTF::mapLineIteratorModeToRules):
205         (WTF::isCJKLocale):
206         (WTF::openLineBreakIterator):
207         (WTF::closeLineBreakIterator):
208         (WTF::compareAndSwapNonSharedCharacterBreakIterator):
209         (WTF::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator):
210         (WTF::NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator):
211         (WTF::textBreakFirst):
212         (WTF::textBreakLast):
213         (WTF::textBreakNext):
214         (WTF::textBreakPrevious):
215         (WTF::textBreakPreceding):
216         (WTF::textBreakFollowing):
217         (WTF::textBreakCurrent):
218         (WTF::isTextBreak):
219         (WTF::isWordTextBreak):
220         (WTF::numGraphemeClusters):
221         (WTF::numCharactersInGraphemeClusters):
222         * wtf/text/TextBreakIterator.h: Renamed from Source/WebCore/platform/text/TextBreakIterator.h.
223         (WTF::LazyLineBreakIterator::LazyLineBreakIterator):
224         (WTF::LazyLineBreakIterator::~LazyLineBreakIterator):
225         (WTF::LazyLineBreakIterator::string):
226         (WTF::LazyLineBreakIterator::isLooseCJKMode):
227         (WTF::LazyLineBreakIterator::lastCharacter):
228         (WTF::LazyLineBreakIterator::secondToLastCharacter):
229         (WTF::LazyLineBreakIterator::setPriorContext):
230         (WTF::LazyLineBreakIterator::updatePriorContext):
231         (WTF::LazyLineBreakIterator::resetPriorContext):
232         (WTF::LazyLineBreakIterator::priorContextLength):
233         (WTF::LazyLineBreakIterator::get):
234         (WTF::LazyLineBreakIterator::resetStringAndReleaseIterator):
235         (WTF::NonSharedCharacterBreakIterator::operator TextBreakIterator*):
236         * wtf/text/TextBreakIteratorInternalICU.h: Renamed from Source/WebCore/platform/text/TextBreakIteratorInternalICU.h.
237         * wtf/text/efl/TextBreakIteratorInternalICUEfl.cpp: Renamed from Source/WebCore/platform/text/efl/TextBreakIteratorInternalICUEfl.cpp.
238         (WebCore::currentSearchLocaleID):
239         (WebCore::currentTextBreakLocaleID):
240         * wtf/text/gtk/TextBreakIteratorInternalICUGtk.cpp: Renamed from Source/WebCore/platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp.
241         (WebCore::currentSearchLocaleID):
242         (WebCore::currentTextBreakLocaleID):
243         * wtf/text/icu/UTextProvider.cpp: Renamed from Source/WebCore/platform/text/icu/UTextProvider.cpp.
244         (WTF::fixPointer):
245         (WTF::uTextCloneImpl):
246         * wtf/text/icu/UTextProvider.h: Renamed from Source/WebCore/platform/text/icu/UTextProvider.h.
247         (WTF::uTextProviderContext):
248         (WTF::initializeContextAwareUTextProvider):
249         (WTF::uTextAccessPinIndex):
250         (WTF::uTextAccessInChunkOrOutOfRange):
251         * wtf/text/icu/UTextProviderLatin1.cpp: Renamed from Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp.
252         (WTF::uTextLatin1Clone):
253         (WTF::uTextLatin1NativeLength):
254         (WTF::uTextLatin1Access):
255         (WTF::uTextLatin1Extract):
256         (WTF::uTextLatin1MapOffsetToNative):
257         (WTF::uTextLatin1MapNativeIndexToUTF16):
258         (WTF::uTextLatin1Close):
259         (WTF::openLatin1UTextProvider):
260         (WTF::textLatin1ContextAwareGetCurrentContext):
261         (WTF::textLatin1ContextAwareMoveInPrimaryContext):
262         (WTF::textLatin1ContextAwareSwitchToPrimaryContext):
263         (WTF::textLatin1ContextAwareMoveInPriorContext):
264         (WTF::textLatin1ContextAwareSwitchToPriorContext):
265         (WTF::uTextLatin1ContextAwareClone):
266         (WTF::uTextLatin1ContextAwareNativeLength):
267         (WTF::uTextLatin1ContextAwareAccess):
268         (WTF::uTextLatin1ContextAwareExtract):
269         (WTF::uTextLatin1ContextAwareClose):
270         (WTF::openLatin1ContextAwareUTextProvider):
271         * wtf/text/icu/UTextProviderLatin1.h: Renamed from Source/WebCore/platform/text/icu/UTextProviderLatin1.h.
272         * wtf/text/icu/UTextProviderUTF16.cpp: Renamed from Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp.
273         (WTF::textUTF16ContextAwareGetCurrentContext):
274         (WTF::textUTF16ContextAwareMoveInPrimaryContext):
275         (WTF::textUTF16ContextAwareSwitchToPrimaryContext):
276         (WTF::textUTF16ContextAwareMoveInPriorContext):
277         (WTF::textUTF16ContextAwareSwitchToPriorContext):
278         (WTF::uTextUTF16ContextAwareClone):
279         (WTF::uTextUTF16ContextAwareNativeLength):
280         (WTF::uTextUTF16ContextAwareAccess):
281         (WTF::uTextUTF16ContextAwareExtract):
282         (WTF::uTextUTF16ContextAwareClose):
283         (WTF::openUTF16ContextAwareUTextProvider):
284         * wtf/text/icu/UTextProviderUTF16.h: Renamed from Source/WebCore/platform/text/icu/UTextProviderUTF16.h.
285         * wtf/text/mac/TextBreakIteratorInternalICUMac.mm: Renamed from Source/WebCore/platform/text/mac/TextBreakIteratorInternalICUMac.mm.
286         (WTF::textBreakLocalePreference):
287         (WTF::topLanguagePreference):
288         (WTF::getLocale):
289         (WTF::getSearchLocale):
290         (WTF::currentSearchLocaleID):
291         (WTF::getTextBreakLocale):
292         (WTF::currentTextBreakLocaleID):
293         * wtf/text/win/TextBreakIteratorInternalICUWin.cpp: Renamed from Source/WebCore/platform/text/win/TextBreakIteratorInternalICUWin.cpp.
294         (WebCore::currentSearchLocaleID):
295         (WebCore::currentTextBreakLocaleID):
296
297 2016-07-08  Commit Queue  <commit-queue@webkit.org>
298
299         Unreviewed, rolling out r202799.
300         https://bugs.webkit.org/show_bug.cgi?id=159568
301
302         Caused build failure (Requested by perarne on #webkit).
303
304         Reverted changeset:
305
306         "[Win] DLLs are missing version information."
307         https://bugs.webkit.org/show_bug.cgi?id=159349
308         http://trac.webkit.org/changeset/202799
309
310 2016-07-08  Jiewen Tan  <jiewen_tan@apple.com>
311
312         Define DYLD_MACOSX_VERSION_10_12
313         https://bugs.webkit.org/show_bug.cgi?id=159525
314         <rdar://problem/26250296>
315
316         Reviewed by Brent Fulgham.
317
318         * wtf/spi/darwin/dyldSPI.h:
319
320 2016-07-01  Jer Noble  <jer.noble@apple.com>
321
322         REGRESSION (r202641): Netflix playback stalls after a few seconds
323         https://bugs.webkit.org/show_bug.cgi?id=159365
324
325         Reviewed by Eric Carlson.
326
327         Add a isBetween() convenience method.
328
329         * wtf/MediaTime.cpp:
330         (WTF::MediaTime::isBetween):
331         * wtf/MediaTime.h:
332
333 2016-07-03  Per Arne Vollan  <pvollan@apple.com>
334
335         [Win] DLLs are missing version information.
336         https://bugs.webkit.org/show_bug.cgi?id=159349
337
338         Reviewed by Brent Fulgham.
339
340         Generate autoversion.h in the prebuild step.
341         Run the perl version stamp utility.
342
343         * wtf/CMakeLists.txt:
344
345 2016-07-03  Saam Barati  <sbarati@apple.com>
346
347         BytecodeGenerator::getVariablesUnderTDZ is too conservative
348         https://bugs.webkit.org/show_bug.cgi?id=159387
349
350         Reviewed by Filip Pizlo.
351
352         I've templatized SmallPtrSet on its SmallArraySize instead
353         of it always being 8.  
354
355         * wtf/SmallPtrSet.h:
356         (WTF::SmallPtrSet::SmallPtrSet):
357         (WTF::SmallPtrSet::add):
358         (WTF::SmallPtrSet::iterator::operator!=):
359         (WTF::SmallPtrSet::bucket):
360
361 2016-07-03  Filip Pizlo  <fpizlo@apple.com>
362
363         Ugh. Once again, unreviewed, roll out unintentional commit in r202790.
364
365         * benchmarks/LockFairnessTest.cpp:
366         (main):
367
368 2016-07-02  Dan Bernstein  <mitz@apple.com>
369
370         Build fix.
371
372         * wtf/Assertions.cpp:
373
374 2016-07-02  Filip Pizlo  <fpizlo@apple.com>
375
376         Unreviewed, roll back unintentional commit in r202778.
377
378         * benchmarks/LockFairnessTest.cpp:
379         (main):
380
381 2016-07-01  Jer Noble  <jer.noble@apple.com>
382
383         Deadlock inside -[WebCoreNSURLSession dealloc]
384         https://bugs.webkit.org/show_bug.cgi?id=159331
385         <rdar://problem/27122716>
386
387         Reviewed by Alex Christensen.
388
389         A Function<> object can wrap any callable type, including a C++ lambda.
390
391         dispatchFunctionsFromMainThread() holds a lock while iterating over the functions in
392         functionQueue(), and during ths iteration, the previous callable object is destroyed by
393         assigning the result of functionQueue().takeFirst(). Because lambdas (and other callables,
394         like functors) can own objects, destroying this callable can have side effects, and if one
395         of those side effects is to call callOnMainThread(), this can deadlock.
396
397         Move this side-effect-having call outside the locked block by clearing the function object
398         immediately after calling it.
399
400         * wtf/MainThread.cpp:
401         (WTF::dispatchFunctionsFromMainThread):
402
403 2016-06-29  Jer Noble  <jer.noble@apple.com>
404
405         Adopt MediaRemote.
406         https://bugs.webkit.org/show_bug.cgi?id=159250
407
408         Reviewed by Eric Carlson.
409
410         Add USE_MEDIAREMOTE.
411
412         * wtf/Platform.h:
413
414 2016-06-28  Commit Queue  <commit-queue@webkit.org>
415
416         Unreviewed, rolling out r202580.
417         https://bugs.webkit.org/show_bug.cgi?id=159245
418
419         Caused all WKTR tests to fail on GuardMalloc and Production
420         only for unknown reasons, investigating offline. (Requested by
421         brrian on #webkit).
422
423         Reverted changeset:
424
425         "RunLoop::Timer should use constructor templates instead of
426         class templates"
427         https://bugs.webkit.org/show_bug.cgi?id=159153
428         http://trac.webkit.org/changeset/202580
429
430 2016-06-28  Brian Burg  <bburg@apple.com>
431
432         RunLoop::Timer should use constructor templates instead of class templates
433         https://bugs.webkit.org/show_bug.cgi?id=159153
434
435         Reviewed by Alex Christensen.
436
437         Refactor RunLoop::Timer to align with WebCore::Timer. Use a constructor
438         template instead of a class template. Store a bound std::function rather than
439         a templated member and function. Add a constructor that takes a std::function.
440
441         * wtf/RunLoop.h:
442         (WTF::RunLoop::Timer::Timer):
443         (WTF::RunLoop::Timer::fired):
444
445 2016-06-28  Tomas Popela  <tpopela@redhat.com>
446
447         THUMB2 support not correctly detected on Fedora with GCC 6.1.
448         https://bugs.webkit.org/show_bug.cgi?id=159083
449
450         Reviewed by Carlos Garcia Campos.
451
452         On Fedora 24 with GCC 6.1. the __thumb2__ and __thumb__ are not
453         defined so the detection of THUMB2 support will fail. Look also
454         whether the __ARM_ARCH_ISA_THUMB is defined to fix the THUMB2
455         detection.
456
457         * wtf/Platform.h:
458
459 2016-06-27  Joseph Pecoraro  <pecoraro@apple.com>
460
461         Remove now unused WTF::findNextLineStart
462         https://bugs.webkit.org/show_bug.cgi?id=159157
463
464         Reviewed by Mark Lam.
465
466         Unused after r202498.
467
468         * wtf/text/StringImpl.cpp:
469         (WTF::StringImpl::findNextLineStart): Deleted.
470         * wtf/text/StringImpl.h:
471         (WTF::findNextLineStart): Deleted.
472         * wtf/text/WTFString.h:
473         (WTF::String::findNextLineStart): Deleted.
474
475 2016-06-21  Anders Carlsson  <andersca@apple.com>
476
477         Rename NoncopyableFunction to Function
478         https://bugs.webkit.org/show_bug.cgi?id=158354
479
480         Reviewed by Chris Dumez.
481
482         * WTF.xcodeproj/project.pbxproj:
483         * wtf/CrossThreadTask.h:
484         (WTF::CrossThreadTask::CrossThreadTask):
485         * wtf/Function.h: Renamed from Source/WTF/wtf/NoncopyableFunction.h.
486         * wtf/FunctionDispatcher.h:
487         * wtf/MainThread.cpp:
488         (WTF::functionQueue):
489         (WTF::dispatchFunctionsFromMainThread):
490         (WTF::callOnMainThread):
491         * wtf/MainThread.h:
492         * wtf/RunLoop.cpp:
493         (WTF::RunLoop::performWork):
494         (WTF::RunLoop::dispatch):
495         * wtf/RunLoop.h:
496         * wtf/WorkQueue.h:
497         * wtf/cocoa/WorkQueueCocoa.cpp:
498         (WTF::WorkQueue::dispatch):
499         (WTF::WorkQueue::dispatchAfter):
500         * wtf/efl/DispatchQueueWorkItemEfl.h:
501         (WorkItem::WorkItem):
502         (TimerWorkItem::create):
503         (TimerWorkItem::TimerWorkItem):
504         * wtf/efl/WorkQueueEfl.cpp:
505         (WTF::WorkQueue::dispatch):
506         (WTF::WorkQueue::dispatchAfter):
507         * wtf/generic/RunLoopGeneric.cpp:
508         (WTF::RunLoop::TimerBase::ScheduledTask::create):
509         (WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask):
510         (WTF::RunLoop::dispatchAfter):
511         * wtf/generic/WorkQueueGeneric.cpp:
512         (WorkQueue::dispatch):
513         (WorkQueue::dispatchAfter):
514         * wtf/glib/RunLoopGLib.cpp:
515         (WTF::DispatchAfterContext::DispatchAfterContext):
516         (WTF::RunLoop::dispatchAfter):
517         * wtf/win/WorkItemWin.cpp:
518         (WTF::WorkItemWin::WorkItemWin):
519         (WTF::WorkItemWin::create):
520         (WTF::HandleWorkItem::HandleWorkItem):
521         (WTF::HandleWorkItem::createByAdoptingHandle):
522         * wtf/win/WorkItemWin.h:
523         (WTF::WorkItemWin::function):
524         * wtf/win/WorkQueueWin.cpp:
525         (WTF::WorkQueue::dispatch):
526         (WTF::WorkQueue::dispatchAfter):
527
528 2016-06-23  David Kilzer  <ddkilzer@apple.com>
529
530         REGRESSION (r202380): iOS 9.x internal builds are broken
531
532         Follow-up fix for: Enable window.open() for existing versions of Secret Society
533         <https://webkit.org/b/159049>
534         <rdar://problem/26528349>
535
536         * wtf/spi/darwin/dyldSPI.h: Define DYLD_IOS_VERSION_10_0 when
537         building on internal SDKs older than iOS 10.
538
539 2016-06-23  John Wilander  <wilander@apple.com>
540
541         Enable window.open() for existing versions of Secret Society
542         https://bugs.webkit.org/show_bug.cgi?id=159049
543         <rdar://problem/26528349>
544         
545         Reviewed by Andy Estes.
546
547         The Secret Society Hidden Mystery app has a broken version check treating iOS 10
548         as iOS 1 on iPads. Therefore it believes it can use window.open() in a tap
549         handler. We should allow the existing versions of the app to do this to not break
550         them.
551
552         * wtf/spi/darwin/dyldSPI.h:
553             Added DYLD_IOS_VERSION_10_0.
554
555 2016-06-21  Said Abou-Hallawa  <sabouhallawa@apple,com>
556
557         Add system tracing points for requestAnimationFrame() workflow
558         https://bugs.webkit.org/show_bug.cgi?id=158723
559
560         Reviewed by Simon Fraser.
561
562         Define new trace score codes for requestAnimationFrame().
563
564         * wtf/SystemTracing.h:
565         (WTF::TracePoint):
566         (WTF::TraceScope::TraceScope):
567         (WTF::TraceScope::~TraceScope):
568
569 2016-06-20  Commit Queue  <commit-queue@webkit.org>
570
571         Unreviewed, rolling out r202136.
572         https://bugs.webkit.org/show_bug.cgi?id=158932
573
574         JSBench wasn't regressed by r202002 and r202111 on iOS after
575         all (Requested by rniwa_ on #webkit).
576
577         Reverted changeset:
578
579         "Unreviewed, rolling out r202002 and r202111."
580         https://bugs.webkit.org/show_bug.cgi?id=158638
581         http://trac.webkit.org/changeset/202136
582
583 2016-06-17  Chris Dumez  <cdumez@apple.com>
584
585         Optimize parseCacheHeader() by using StringView
586         https://bugs.webkit.org/show_bug.cgi?id=158891
587
588         Reviewed by Darin Adler.
589
590         Add a StringView::find() overload which takes a CharacterMatchFunction
591         to match the one on String.
592
593         * wtf/text/StringView.h:
594         (WTF::StringView::find):
595
596 2016-06-17  Mark Lam  <mark.lam@apple.com>
597
598         OOM Assertion failure in JSON.stringify.
599         https://bugs.webkit.org/show_bug.cgi?id=158794
600         <rdar://problem/26826254>
601
602         Reviewed by Saam Barati.
603
604         The bug was actually in StringBuilder::appendQuotedJSONString() where it failed
605         to detect an imminent unsigned int overflow.  The fix is to use Checked<unsigned>
606         for the needed math, and RELEASE_ASSERT afterwards that we did not overflow.
607
608         I also added more assertions to detect sooner if any there are any problems with
609         StringBuilder's m_buffer or m_length being incorrectly sized.  These assertions
610         have been run on the JSC and layout tests without any issue.
611
612         * wtf/text/StringBuilder.cpp:
613         (WTF::StringBuilder::resize):
614         (WTF::StringBuilder::allocateBuffer):
615         (WTF::StringBuilder::allocateBufferUpConvert):
616         (WTF::StringBuilder::reallocateBuffer<LChar>):
617         (WTF::StringBuilder::reallocateBuffer<UChar>):
618         (WTF::StringBuilder::reserveCapacity):
619         (WTF::StringBuilder::appendUninitializedSlow):
620         (WTF::StringBuilder::append):
621         (WTF::StringBuilder::appendQuotedJSONString):
622         * wtf/text/StringBuilder.h:
623         (WTF::StringBuilder::swap):
624
625 2016-06-14  Filip Pizlo  <fpizlo@apple.com>
626
627         Baseline JIT should be concurrent
628         https://bugs.webkit.org/show_bug.cgi?id=158755
629
630         Reviewed by Geoffrey Garen.
631         
632         The concurrent baseline JIT needs to be able to clone bytecode to get a consistent snapshot.
633         So, this adds such a method.
634
635         * wtf/RefCountedArray.h:
636         (WTF::RefCountedArray::RefCountedArray):
637         (WTF::RefCountedArray::clone):
638
639 2016-06-16  Chris Dumez  <cdumez@apple.com>
640
641         No need to ref connection in lambda inside NetworkResourceLoader::tryStoreAsCacheEntry()
642         https://bugs.webkit.org/show_bug.cgi?id=158862
643
644         Reviewed by Darin Adler.
645
646         Add NoncopyableFunction constructor that takes a nullptr_t in, in order
647         to match the std::function API and make porting from one to the other
648         easier.
649
650         * wtf/NoncopyableFunction.h:
651
652 2016-06-16  Chris Dumez  <cdumez@apple.com>
653
654         Unreviewed, rolling out r202002 and r202111.
655
656         Ryosuke says this was a JSBench regression on iOS
657
658         Reverted changesets:
659
660         "Make HashMap and HashSet work with Refs"
661         https://bugs.webkit.org/show_bug.cgi?id=158638
662         http://trac.webkit.org/changeset/202002
663
664         "Improve HashMap and HashSet support for Ref"
665         https://bugs.webkit.org/show_bug.cgi?id=158789
666         http://trac.webkit.org/changeset/202111
667
668 2016-06-15  Chris Dumez  <cdumez@apple.com>
669
670         [Cocoa] Clean up / optimize ResourceResponse::platformLazyInit(InitLevel)
671         https://bugs.webkit.org/show_bug.cgi?id=158809
672
673         Reviewed by Darin Adler.
674
675         Add toAtomicString() method to StringView to avoid having to call toString()
676         and then atomizing the String at call sites.
677
678         * wtf/text/StringView.h:
679         (WTF::StringView::toAtomicString):
680
681 2016-06-15  Sam Weinig  <sam@webkit.org>
682
683         Improve HashMap and HashSet support for Ref
684         https://bugs.webkit.org/show_bug.cgi?id=158789
685
686         Reviewed by Chris Dumez.
687
688         Tests: Add more cases to WTF_HashMap.Ref_Key, WTF_HashMap.Ref_Value and WTF_HashSet.Ref
689
690         * wtf/HashMap.h:
691         * wtf/HashSet.h:
692         Add a MappedTakeType typedef and rework the take functions to use it and HashTraits::take(...).
693
694         * wtf/HashTraits.h:
695         (WTF::GenericHashTraits::assignToEmpty):
696         Move to GenericHashTraits rather than GenericHashTraitsBase, since it is not different
697         between integral and non-integral HashTraits.
698
699         (WTF::GenericHashTraits::take):
700         Add a trait function for take that defaults as a forward. This allows us to override take
701         just like we do with get/peek.
702
703         (WTF::HashTraits<Ref<P>>::emptyValue):
704         Remove unnecessary explicit construction.
705
706         (WTF::HashTraits<Ref<P>>::peek):
707         Fix assertion that could happen if you did a HashMap.get() on an empty Ref value.
708
709         (WTF::HashTraits<Ref<P>>::take):
710         Make the TakeType of a Ref<P> be Optional<Ref<P>>, to avoid having empty
711         Refs returned from HashMap and HashSet. Implement an explicit take() function to
712         construct one.
713
714         (WTF::HashTraits<Ref<P>>::customDeleteBucket): Deleted.
715         Remove unnecessary customDeleteBucket implementation. Ref does not assign nullptr to
716         it's m_ptr in destruction, so there is no dead store to avoid here.
717
718         * wtf/Ref.h:
719         (WTF::Ref::ptrAllowingHashTableEmptyValue):
720         Add HashTrait helper to allow getting the value of m_ptr even when it is null. This
721         allows us to avoid a branch in HashTraits<Ref<P>>::peek().
722
723 2016-06-15  Konstantin Tokarev  <annulen@yandex.ru>
724
725         Only Mac port needs ObjC API for JSC
726         https://bugs.webkit.org/show_bug.cgi?id=158780
727
728         Reviewed by Philippe Normand.
729
730         * wtf/FeatureDefines.h:
731
732 2016-06-15  Yusuke Suzuki  <utatane.tea@gmail.com>
733
734         Unreviewed, follow up patch for r202092
735         https://bugs.webkit.org/show_bug.cgi?id=158661
736
737         During checking Windows port on EWS, accidentally introduce the regression.
738
739         * wtf/Platform.h:
740
741 2016-06-15  Yusuke Suzuki  <utatane.tea@gmail.com>
742
743         [JSC] Move calling convention flags to WTF
744         https://bugs.webkit.org/show_bug.cgi?id=158661
745
746         Reviewed by Keith Miller.
747
748         * wtf/Platform.h:
749
750 2016-06-14  Myles C. Maxfield  <mmaxfield@apple.com>
751
752         Honor bidi unicode codepoints
753         https://bugs.webkit.org/show_bug.cgi?id=149170
754         <rdar://problem/26527378>
755
756         Reviewed by Simon Fraser.
757
758         * wtf/unicode/CharacterNames.h:
759
760 2016-06-14  Commit Queue  <commit-queue@webkit.org>
761
762         Unreviewed, rolling out r202057.
763         https://bugs.webkit.org/show_bug.cgi?id=158749
764
765         This change broke the Windows build. (Requested by ryanhaddad
766         on #webkit).
767
768         Reverted changeset:
769
770         "Honor bidi unicode codepoints"
771         https://bugs.webkit.org/show_bug.cgi?id=149170
772         http://trac.webkit.org/changeset/202057
773
774 2016-06-14  Myles C. Maxfield  <mmaxfield@apple.com>
775
776         Honor bidi unicode codepoints
777         https://bugs.webkit.org/show_bug.cgi?id=149170
778         <rdar://problem/26527378>
779
780         Reviewed by Simon Fraser.
781
782         * wtf/unicode/CharacterNames.h:
783
784 2016-06-13  Alex Christensen  <achristensen@webkit.org>
785
786         Add WebSocketProvider stub
787         https://bugs.webkit.org/show_bug.cgi?id=158702
788
789         Reviewed by Brady Eidson.
790
791         * wtf/UniqueRef.h:
792         (WTF::UniqueRef::operator->):
793         (WTF::UniqueRef::operator T&):
794         (WTF::UniqueRef::operator const T&):
795         Added operator T& to avoid unneeded .get() calls.
796
797 2016-06-13  Sam Weinig  <sam@webkit.org>
798
799         Make HashMap and HashSet work with Refs
800         https://bugs.webkit.org/show_bug.cgi?id=158638
801
802         Reviewed by Darin Adler.
803
804         * wtf/GetPtr.h:
805         Move HashTableDeletedValueType and HashTableEmptyValueType here, as they are now shared
806         by more than one smart pointer. This file should probably be renamed to something else
807         at some point to indicate that it contains helpers for pointer and ref related functionality.
808
809         * wtf/HashFunctions.h:
810         Add a DefaultHash for Refs. Customize the PtrHash to indicate that it is not safe to compare
811         to empty or deleted Refs.
812
813         * wtf/HashMap.h:
814         (WTF::HashMapTranslator::equal):
815         (WTF::HashMapTranslator::translate):
816         (WTF::HashMapEnsureTranslator::equal):
817         (WTF::HashMapEnsureTranslator::translate):
818         * wtf/HashSet.h:
819         (WTF::IdentityExtractor::extract):
820         (WTF::HashSetTranslator::hash):
821         (WTF::HashSetTranslator::equal):
822         (WTF::HashSetTranslator::translate):
823         * wtf/HashTable.h:
824         (WTF::IdentityHashTranslator::hash):
825         (WTF::IdentityHashTranslator::equal):
826         (WTF::IdentityHashTranslator::translate):
827         Use the new assignToEmpty trait function to allow uninitialized Ref's to be safely assigned to.
828
829         * wtf/HashTraits.h:
830         (WTF::HashTraits<Ref<P>>::emptyValue):
831         (WTF::HashTraits<Ref<P>>::isEmptyValue):
832         (WTF::HashTraits<Ref<P>>::assignToEmpty):
833         (WTF::HashTraits<Ref<P>>::peek):
834         (WTF::HashTraits<Ref<P>>::customDeleteBucket):
835         Add custom HashTraits for Ref. Also, introduce a new trait function, assignToEmpty, for use
836         in translation assignments. This is necessary since the default assignment operator for Ref
837         will not allow assignment to the empty Ref, which we need to do here.
838
839         * wtf/Ref.h:
840         (WTF::Ref::operator=):
841         (WTF::Ref::Ref):
842         (WTF::Ref::isHashTableDeletedValue):
843         (WTF::Ref::hashTableDeletedValue):
844         (WTF::Ref::isHashTableEmptyValue):
845         (WTF::Ref::hashTableEmptyValue):
846         Add explicit constructors/predicates for making deleted/empty Refs.
847
848         (WTF::Ref::assignToHashTableEmptyValue):
849         Add a special function that allows assignment to an empty Ref, which the
850         assignment operator does not.
851         
852         (WTF::IsSmartPtr):
853         Add an IsSmartPtr override to indicate that Ref is a smart pointer.
854
855         * wtf/RefPtr.h:
856         Move HashTableDeletedValueType to GetPtr.h.
857
858 2016-06-13  Fujii Hironori  <Hironori.Fujii@sony.com>
859
860         Stack overflow at RefPtr::release on Windows port since r201782
861         https://bugs.webkit.org/show_bug.cgi?id=158687
862
863         Reviewed by Chris Dumez.
864
865         RefPtr::release calls RefPtr::RefPtr, and RefPtr::RefPtr calls
866         RefPtr::release.
867
868         RefPtr::RefPtr does not need to call RefPtr::release.
869
870         * wtf/RefPtr.h:
871         (WTF::RefPtr::RefPtr): Do not call RefPtr::release.
872
873 2016-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
874
875         Addressing post-review comments after r201978.
876         https://bugs.webkit.org/show_bug.cgi?id=158649
877         <rdar://problem/13258122>
878
879         Unreviewed.
880
881         * wtf/text/StringCommon.h:
882         (WTF::equal):
883         (WTF::naiveEqualWithoutPerformingUnicodeNormalization): Deleted.
884
885 2016-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
886
887         [Cocoa] Map commonly used Chinese Windows font names to names present on Cocoa operating systems
888         https://bugs.webkit.org/show_bug.cgi?id=158649
889         <rdar://problem/13258122>
890
891         Reviewed by Darin Adler.
892
893         * wtf/text/StringCommon.h:
894         (WTF::naiveEqualWithoutPerformingUnicodeNormalization): Added.
895
896 2016-06-11  Chris Dumez  <cdumez@apple.com>
897
898         WorkerNavigator is missing some attributes
899         https://bugs.webkit.org/show_bug.cgi?id=158593
900         <rdar://problem/26731334>
901
902         Reviewed by Darin Adler.
903
904         * wtf/PlatformUserPreferredLanguages.h:
905         * wtf/PlatformUserPreferredLanguagesWin.cpp:
906         (WTF::platformLanguage):
907         (WTF::platformUserPreferredLanguages):
908
909         Make platformUserPreferredLanguages() thread safe on Windows. The
910         Mac and Unix implementations are already thread-safe.
911
912         HAS_FASTCALL_CALLING_CONVENTION is changed to COMPILER_SUPPORTS(FASTCALL_CALLING_CONVENTION).
913
914 2016-06-10  Alex Christensen  <achristensen@webkit.org>
915
916         Introduce WTF::UniqueRef
917         https://bugs.webkit.org/show_bug.cgi?id=158596
918
919         Reviewed by Brady Eidson.
920
921         WTF::UniqueRef is like a std::unique_ptr that is guaranteed to be non-null.
922         std::make_unique returns a non-null value that is put into a std::unique_ptr, a type
923         that could contain null values.  To be able to pass such values around and store them
924         without wondering if they are null, we now have WTF::UniqueRef which cannot be null.
925
926         * WTF.xcodeproj/project.pbxproj:
927         * wtf/CMakeLists.txt:
928         * wtf/UniqueRef.h: Added.
929         (WTF::makeUniqueRef):
930         (WTF::UniqueRef::UniqueRef):
931         (WTF::UniqueRef::get):
932         (WTF::UniqueRef::operator&):
933         (WTF::UniqueRef::operator->):
934
935 2016-06-09  Brady Eidson  <beidson@apple.com>
936
937         Unaddressed review feedback from r201872
938
939         * wtf/CrossThreadTask.h:
940         (WTF::callFunctionForCrossThreadTask): Fix typo.
941
942 2016-06-09  Brady Eidson  <beidson@apple.com>
943
944         Greatly simplify CrossThreadTask.h.
945         https://bugs.webkit.org/show_bug.cgi?id=158542
946
947         Reviewed by Darin Adler.
948
949         * wtf/CrossThreadTask.h:
950         (WTF::crossThreadCopy):
951         (WTF::callFunctionForCrossThreadTaskImpl):
952         (WTF::callFunctionForCrossThreadTask):
953         (WTF::createCrossThreadTask):
954         (WTF::callMemberFunctionForCrossThreadTaskImpl):
955         (WTF::callMemberFunctionForCrossThreadTask):
956
957 2016-06-08  Brady Eidson  <beidson@apple.com>
958
959         Make CrossThreadCopier more efficient (fewer copies!).
960         https://bugs.webkit.org/show_bug.cgi?id=158456
961
962         Reviewed by Alex Christensen.
963
964         Previously, we'd run all arguments through CrossThreadCopier, then immediately make
965         an unnecessary copy of the result during lambda capture.
966
967         Instead, we should just put the CrossThreadCopier generated objects directly in lambdas,
968         which are then captured by NoncopyableFunctions.
969
970         This reduces the number of constructor calls per argument from 2 copies to 1 move.
971
972         * wtf/CrossThreadTask.h:
973         (WTF::CrossThreadTask::CrossThreadTask):
974         (WTF::createCrossThreadTask):
975
976 2016-06-07  Filip Pizlo  <fpizlo@apple.com>
977
978         Implement Air::allocateStack() in ES6 to see how much of a bad idea that is
979         https://bugs.webkit.org/show_bug.cgi?id=158318
980
981         Reviewed by Saam Barati.
982
983         * wtf/Insertion.h:
984         (WTF::executeInsertions): I found a bug while rewriting this code in JS.
985         * wtf/PrintStream.h:
986         (WTF::PrintStream::print):
987         (WTF::PrintStream::println): This is useful to have.
988
989 2016-06-07  Keith Rollin  <krollin@apple.com>
990
991         Remove all uses of PassRefPtr in WTF
992         https://bugs.webkit.org/show_bug.cgi?id=157596
993         <rdar://problem/26234391>
994
995         Reviewed by Chris Dumez.
996
997         Remove/update most interfaces that take or return PassRefPtrs.
998         Remaining references include those in non-Cocoa implementations and
999         those required for continued compatibility with modules that still use
1000         PassRefPtrs (specifically: Forward.h, RefPtr interoperability,
1001         SizeLimits.h, WorkQueue (Windows) DispatchQueueEfl,
1002         DispatchWorkItemEfl, and PassRefPtr itself).
1003
1004         Update calls to interfaces that no longer take or return PassRefPtrs.
1005
1006         Update adoptRef(T*) to return a RefPtr instead of a PassRefPtr and
1007         move it to RefPtr.h from PassRefPtr.h.
1008
1009         * wtf/MetaAllocator.cpp:
1010         (WTF::MetaAllocator::allocate):
1011         * wtf/MetaAllocator.h:
1012         * wtf/ParallelJobsGeneric.h:
1013         (WTF::ParallelEnvironment::ThreadPrivate::create):
1014         * wtf/text/AtomicStringImpl.cpp:
1015         (WTF::HashAndUTF8CharactersTranslator::translate):
1016         (WTF::SubstringTranslator::translate):
1017         * wtf/text/CString.cpp:
1018         (WTF::CStringBuffer::createUninitialized):
1019         * wtf/text/CString.h:
1020         * wtf/text/StringBuilder.cpp:
1021         (WTF::StringBuilder::reifyString):
1022         (WTF::StringBuilder::resize):
1023         (WTF::StringBuilder::reallocateBuffer<LChar>):
1024         (WTF::StringBuilder::reallocateBuffer<UChar>):
1025         * wtf/text/StringImpl.cpp:
1026         (WTF::StringImpl::reallocateInternal):
1027         (WTF::StringImpl::reallocate):
1028         (WTF::StringImpl::create8BitIfPossible):
1029         (WTF::StringImpl::createSymbol):
1030         (WTF::StringImpl::createNullSymbol):
1031         (WTF::StringImpl::convertToLowercaseWithoutLocale):
1032         (WTF::StringImpl::convertToUppercaseWithoutLocale):
1033         (WTF::StringImpl::convertToLowercaseWithLocale):
1034         (WTF::StringImpl::convertToUppercaseWithLocale):
1035         (WTF::StringImpl::convertASCIICase):
1036         * wtf/text/StringImpl.h:
1037         (WTF::StringImpl::StringImpl):
1038         (WTF::StringImpl::createSubstringSharingImpl):
1039         (WTF::StringImpl::tryCreateUninitialized):
1040         (WTF::StringImpl::extractFoldedStringInSymbol):
1041         * wtf/text/SymbolRegistry.cpp:
1042         (WTF::SymbolRegistry::symbolForKey):
1043         * wtf/text/WTFString.cpp:
1044         (WTF::String::substringSharingImpl):
1045         * wtf/text/WTFString.h:
1046         (WTF::String::String): Deleted.
1047         * wtf/text/cf/StringImplCF.cpp:
1048
1049 2016-06-07  Yusuke Suzuki  <utatane.tea@gmail.com>
1050
1051         [JSC] Do not allocate unnecessary UTF-8 string for encodeXXX functions
1052         https://bugs.webkit.org/show_bug.cgi?id=158416
1053
1054         Reviewed by Darin Adler and Geoffrey Garen.
1055
1056         * wtf/Bitmap.h:
1057         (WTF::Bitmap::size):
1058         (WTF::WordType>::Bitmap):
1059         (WTF::WordType>::get):
1060         (WTF::WordType>::set):
1061         (WTF::WordType>::testAndSet):
1062         (WTF::WordType>::testAndClear):
1063         (WTF::WordType>::concurrentTestAndSet):
1064         (WTF::WordType>::concurrentTestAndClear):
1065         (WTF::WordType>::clear):
1066         (WTF::WordType>::clearAll):
1067         (WTF::WordType>::nextPossiblyUnset):
1068         (WTF::WordType>::findRunOfZeros):
1069         (WTF::WordType>::count):
1070         (WTF::WordType>::isEmpty):
1071         (WTF::WordType>::isFull):
1072
1073 2016-06-06  Saam Barati  <sbarati@apple.com>
1074
1075         equal(StringView, StringView) for strings should have a fast path for pointer equality
1076         https://bugs.webkit.org/show_bug.cgi?id=158452
1077
1078         Reviewed by Andreas Kling.
1079
1080         JSBench does a lot of StringView::operator== on StringViews that have
1081         the same underlying characters pointer. This becomes hot inside JSBench
1082         because JSBench heavily stresses JSC's UnlinkedCodeCache with a high
1083         hit rate. This means that when we get a hit in the cache, we used to
1084         do the long form of string compare. However, we were often comparing
1085         two StringViews that had the same underlying buffer and length.
1086         This patch speeds this case up to run in constant time instead of
1087         linear time.
1088
1089         * wtf/text/StringCommon.h:
1090         (WTF::equalCommon):
1091         * wtf/text/StringImpl.h:
1092         (WTF::StringImpl::StringImpl):
1093         (WTF::StringImpl::data):
1094         * wtf/text/StringView.h:
1095         (WTF::StringView::data):
1096
1097 2016-06-04  Anders Carlsson  <andersca@apple.com>
1098
1099         Get rid of WorkItemWin
1100         https://bugs.webkit.org/show_bug.cgi?id=158381
1101
1102         Reviewed by Sam Weinig.
1103
1104         * wtf/PlatformWin.cmake:
1105         * wtf/WorkQueue.h:
1106         * wtf/win/WorkItemWin.cpp: Removed.
1107         (WTF::WorkItemWin::WorkItemWin): Deleted.
1108         (WTF::WorkItemWin::create): Deleted.
1109         (WTF::WorkItemWin::~WorkItemWin): Deleted.
1110         * wtf/win/WorkItemWin.h: Removed.
1111         (WTF::WorkItemWin::function): Deleted.
1112         (WTF::WorkItemWin::queue): Deleted.
1113         * wtf/win/WorkQueueWin.cpp:
1114         (WTF::WorkQueue::performWorkOnRegisteredWorkThread):
1115         (WTF::WorkQueue::dispatch):
1116
1117 2016-06-03  Anders Carlsson  <andersca@apple.com>
1118
1119         Get rid of HANDLE registration code in WorkQueueWin
1120         https://bugs.webkit.org/show_bug.cgi?id=158375
1121
1122         Reviewed by Darin Adler.
1123
1124         * wtf/WorkQueue.h:
1125         * wtf/win/WorkItemWin.cpp:
1126         (WTF::HandleWorkItem::HandleWorkItem): Deleted.
1127         (WTF::HandleWorkItem::createByAdoptingHandle): Deleted.
1128         (WTF::HandleWorkItem::~HandleWorkItem): Deleted.
1129         * wtf/win/WorkItemWin.h:
1130         (WTF::HandleWorkItem::setWaitHandle): Deleted.
1131         (WTF::HandleWorkItem::waitHandle): Deleted.
1132         * wtf/win/WorkQueueWin.cpp:
1133         (WTF::WorkQueue::handleCallback): Deleted.
1134         (WTF::WorkQueue::platformInvalidate): Deleted.
1135         (WTF::WorkQueue::unregisterWaitAndDestroyItemSoon): Deleted.
1136         (WTF::WorkQueue::unregisterWaitAndDestroyItemCallback): Deleted.
1137
1138 2016-06-03  Commit Queue  <commit-queue@webkit.org>
1139
1140         Unreviewed, rolling out r201663.
1141         https://bugs.webkit.org/show_bug.cgi?id=158374
1142
1143         Broke the Windows build (Requested by andersca on #webkit).
1144
1145         Reverted changeset:
1146
1147         "Rename NoncopyableFunction to Function"
1148         https://bugs.webkit.org/show_bug.cgi?id=158354
1149         http://trac.webkit.org/changeset/201663
1150
1151 2016-06-03  Anders Carlsson  <andersca@apple.com>
1152
1153         Rename NoncopyableFunction to Function
1154         https://bugs.webkit.org/show_bug.cgi?id=158354
1155
1156         Reviewed by Chris Dumez.
1157
1158         * WTF.xcodeproj/project.pbxproj:
1159         * wtf/CrossThreadTask.h:
1160         (WTF::CrossThreadTask::CrossThreadTask):
1161         * wtf/Function.h: Renamed from Source/WTF/wtf/NoncopyableFunction.h.
1162         * wtf/FunctionDispatcher.h:
1163         * wtf/MainThread.cpp:
1164         (WTF::functionQueue):
1165         (WTF::dispatchFunctionsFromMainThread):
1166         (WTF::callOnMainThread):
1167         * wtf/MainThread.h:
1168         * wtf/RunLoop.cpp:
1169         (WTF::RunLoop::performWork):
1170         (WTF::RunLoop::dispatch):
1171         * wtf/RunLoop.h:
1172         * wtf/WorkQueue.h:
1173         * wtf/cocoa/WorkQueueCocoa.cpp:
1174         (WTF::WorkQueue::dispatch):
1175         (WTF::WorkQueue::dispatchAfter):
1176         * wtf/efl/DispatchQueueWorkItemEfl.h:
1177         (WorkItem::WorkItem):
1178         (TimerWorkItem::create):
1179         (TimerWorkItem::TimerWorkItem):
1180         * wtf/efl/WorkQueueEfl.cpp:
1181         (WTF::WorkQueue::dispatch):
1182         (WTF::WorkQueue::dispatchAfter):
1183         * wtf/generic/RunLoopGeneric.cpp:
1184         (WTF::RunLoop::TimerBase::ScheduledTask::create):
1185         (WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask):
1186         (WTF::RunLoop::dispatchAfter):
1187         * wtf/generic/WorkQueueGeneric.cpp:
1188         (WorkQueue::dispatch):
1189         (WorkQueue::dispatchAfter):
1190         * wtf/glib/RunLoopGLib.cpp:
1191         (WTF::DispatchAfterContext::DispatchAfterContext):
1192         (WTF::RunLoop::dispatchAfter):
1193         * wtf/win/WorkItemWin.cpp:
1194         (WTF::WorkItemWin::WorkItemWin):
1195         (WTF::WorkItemWin::create):
1196         (WTF::HandleWorkItem::HandleWorkItem):
1197         (WTF::HandleWorkItem::createByAdoptingHandle):
1198         * wtf/win/WorkItemWin.h:
1199         (WTF::WorkItemWin::function):
1200         * wtf/win/WorkQueueWin.cpp:
1201         (WTF::WorkQueue::dispatch):
1202         (WTF::WorkQueue::dispatchAfter):
1203
1204 2016-06-03  Mark Lam  <mark.lam@apple.com>
1205
1206         Clean up how StackVisitor dumps its frames.
1207         https://bugs.webkit.org/show_bug.cgi?id=158316
1208
1209         Reviewed by Keith Miller.
1210
1211         Added an Indenter class what works with dataLog.
1212
1213         * WTF.xcodeproj/project.pbxproj:
1214         * wtf/Indenter.h: Added.
1215         (WTF::Indenter::Indenter):
1216         (WTF::Indenter::dump):
1217         (WTF::Indenter::operator++):
1218         (WTF::Indenter::operator--):
1219
1220 2016-06-02  Said Abou-Hallawa  <sabouhallawa@apple,com>
1221
1222         [iOS] PDFDocumentImage should not create a cached image larger than 4M pixels
1223         https://bugs.webkit.org/show_bug.cgi?id=157857
1224
1225         Reviewed by Darin Adler.
1226
1227         * wtf/StdLibExtras.h: Add a constant value for GB (2^30).
1228
1229 2016-06-02  Oliver Hunt  <oliver@apple.com>
1230
1231         JS parser incorrectly handles invalid utf8 in error messages.
1232         https://bugs.webkit.org/show_bug.cgi?id=158128
1233
1234         Reviewed by Saam Barati.
1235
1236         Add a new toStringWithLatin1Fallback that simply uses
1237         String::fromUTF8WithLatin1Fallback, so we can avoid the
1238         standard String::fromUTF8 null return.
1239
1240         * wtf/StringPrintStream.cpp:
1241         (WTF::StringPrintStream::toStringWithLatin1Fallback):
1242         * wtf/StringPrintStream.h:
1243
1244 2016-06-02  Keith Miller  <keith_miller@apple.com>
1245
1246         Unreviewed, reland r201532. The associated regressions have been fixed
1247         by r201584.
1248
1249 2016-06-02  Filip Pizlo  <fpizlo@apple.com>
1250
1251         Use "= delete" for Locker(int) 
1252
1253         Rubber stamped by Saam Barati.
1254         
1255         See discussion: https://bugs.webkit.org/show_bug.cgi?id=158306#c8
1256
1257         * wtf/Locker.h:
1258         (WTF::Locker::Locker):
1259         (WTF::Locker::~Locker):
1260
1261 2016-06-02  Filip Pizlo  <fpizlo@apple.com>
1262
1263         Make it harder to accidentally pass an integer to a locker.
1264
1265         Rubber stamped by Keith Miller.
1266         
1267         See here for the discussion: https://bugs.webkit.org/show_bug.cgi?id=158306#c3
1268
1269         * wtf/Locker.h:
1270         (WTF::Locker::Locker):
1271         (WTF::Locker::~Locker):
1272
1273 2016-06-02  Filip Pizlo  <fpizlo@apple.com>
1274
1275         Make it easier to use NoLockingNecessary
1276         https://bugs.webkit.org/show_bug.cgi?id=158306
1277
1278         Reviewed by Keith Miller.
1279         
1280         An idiom that we borrowed from LLVM is that if a function requires a lock to be held, we
1281         have it take a const Locker& as its first argument. This may not communicate which lock is
1282         to be held, but it does help us to remember that some lock must be held. So far, it's been
1283         relatively easy to then figure out which lock. We've had bugs where we forgot to hold a
1284         lock but I don't remember the last time we had a bug where we grabbed the wrong lock.
1285         
1286         But sometimes, we know at the point where we call such a method that we actually don't
1287         need to hold any lock. This usually happens during object construction. If we're
1288         constructing some object then we usually know that we have not escaped it yet, so we don't
1289         need to waste time acquiring its lock. We could solve this by having a separate set of
1290         methods that don't do or require locking. This would be cumbersome, since usually for
1291         every variant that takes const Locker&, there is already one that doesn't, and that one
1292         will grab the lock for you. So this means having a third variant, that also doesn't take a
1293         const Locker&, but does no locking. That's pretty weird.
1294         
1295         So, we introduced NoLockingNecessary for situations like this. The idiom went like so:
1296         
1297             Locker<Whatever> locker(Locker<Whatever>::NoLockingNecessary)
1298             stuff->foo(locker);
1299         
1300         Usually though, there would be some distance between where the locker is defined and where
1301         it's used, so when you just look at stuff->foo(locker) in isolation you don't know if this
1302         is a real locker or a NoLockingNecessary cast. Also, requiring two lines for this just
1303         adds code.
1304         
1305         This change makes this easier. Now you can just do:
1306         
1307             stuff->foo(NoLockingNecessary).
1308         
1309         This is because NoLockingNecessary has been pulled out into the WTF namespace (and is
1310         usinged from the global namespace) and the Locker<> constructor that takes
1311         NoLockingNecessaryTag is now implicit.
1312         
1313         The only possible downside of this change is that people might use this idiom more
1314         frequently now that it's easier to use. I don't think that's a bad thing. I'm now
1315         convinced that this is not a bad idiom. When I was fixing an unrelated bug, I almost went
1316         the way of adding more locking to some core JSC data structures, and in the process, I
1317         needed to use NoLockingNecessary. It's clear that this is a general-purpose idiom and we
1318         should not impose artificial constraints on its use.
1319
1320         * wtf/Locker.h:
1321         (WTF::Locker::Locker):
1322         (WTF::Locker::~Locker):
1323
1324 2016-06-01  Brady Eidson  <beidson@apple.com>
1325
1326         Get rid of StringCapture.
1327         https://bugs.webkit.org/show_bug.cgi?id=158285
1328
1329         Reviewed by Chris Dumez.
1330
1331         * wtf/text/WTFString.h:
1332         (WTF::StringCapture::StringCapture): Deleted.
1333         (WTF::StringCapture::string): Deleted.
1334         (WTF::StringCapture::releaseString): Deleted.
1335         (WTF::StringCapture::operator=): Deleted.
1336
1337 2016-06-01  Benjamin Poulain  <bpoulain@apple.com>
1338
1339         [JSC] Some setters for components of Date do not timeClip() their result
1340         https://bugs.webkit.org/show_bug.cgi?id=158278
1341
1342         Unreviewed.
1343
1344         * wtf/DateMath.cpp:
1345         (WTF::equivalentYearForDST): Deleted.
1346         The assertion is bogus.
1347         As the comments above explains, the function is completely wrong for years
1348         outside [1900-2100].
1349         The tests passing large values for years are failing (year <= maxYear).
1350         The weird NaN test is a mystery. The old changelog does not explain it.
1351
1352 2016-05-31  Commit Queue  <commit-queue@webkit.org>
1353
1354         Unreviewed, rolling out r201363 and r201456.
1355         https://bugs.webkit.org/show_bug.cgi?id=158240
1356
1357         "40% regression on date-format-xparb" (Requested by
1358         keith_miller on #webkit).
1359
1360         Reverted changesets:
1361
1362         "LLInt should be able to cache prototype loads for values in
1363         GetById"
1364         https://bugs.webkit.org/show_bug.cgi?id=158032
1365         http://trac.webkit.org/changeset/201363
1366
1367         "get_by_id should support caching unset properties in the
1368         LLInt"
1369         https://bugs.webkit.org/show_bug.cgi?id=158136
1370         http://trac.webkit.org/changeset/201456
1371
1372 2016-05-31  Brady Eidson  <beidson@apple.com>
1373
1374         Make createCrossThreadTask() functions return on the stack instead of the heap.
1375         https://bugs.webkit.org/show_bug.cgi?id=158215
1376
1377         Reviewed by Darin Adler.
1378
1379         * WTF.xcodeproj/project.pbxproj:
1380
1381         * wtf/CrossThreadCopier.cpp:
1382
1383         * wtf/CrossThreadQueue.h: Added. A lightweight of MessageQueue that deals directly
1384           in objects instead of in std::unique_ptrs.
1385         (WTF::CrossThreadQueue::isKilled):
1386         (WTF::CrossThreadQueue<DataType>::append):
1387         (WTF::CrossThreadQueue<DataType>::waitForMessage):
1388         (WTF::CrossThreadQueue<DataType>::tryGetMessage):
1389
1390         * wtf/CrossThreadTask.h:
1391         (WTF::createCrossThreadTask):
1392         (WTF::CrossThreadTask::CrossThreadTask): Deleted.
1393
1394 2016-05-30  Brady Eidson  <beidson@apple.com>
1395
1396         Move CrossThreadCopier/CrossThreadTask to WTF.
1397         https://bugs.webkit.org/show_bug.cgi?id=158207
1398
1399         Reviewed by Alex Christensen.
1400
1401         * WTF.xcodeproj/project.pbxproj:
1402         * wtf/CMakeLists.txt:
1403
1404         * wtf/CrossThreadCopier.cpp: Renamed from Source/WebCore/platform/CrossThreadCopier.cpp.
1405         * wtf/CrossThreadCopier.h: Renamed from Source/WebCore/platform/CrossThreadCopier.h.
1406         (WTF::CrossThreadCopierPassThrough::copy):
1407         
1408         * wtf/CrossThreadTask.h: Renamed from Source/WebCore/platform/CrossThreadTask.h.
1409         (WTF::CrossThreadTask::CrossThreadTask):
1410         (WTF::CrossThreadTask::performTask):
1411         (WTF::createCrossThreadTask):
1412
1413 2016-05-28  Chris Dumez  <cdumez@apple.com>
1414
1415         Templatize NoncopyableFunction class similarly to std::function
1416         https://bugs.webkit.org/show_bug.cgi?id=158185
1417
1418         Reviewed by Darin Adler.
1419
1420         Templatize NoncopyableFunction class similarly to std::function, so
1421         that it can be used as a std::function replacement in more places.
1422
1423         Previously, NoncopyableFunction could only support "void()" lambdas.
1424
1425         * wtf/FunctionDispatcher.h:
1426         * wtf/MainThread.cpp:
1427         (WTF::functionQueue):
1428         (WTF::dispatchFunctionsFromMainThread):
1429         (WTF::callOnMainThread):
1430         * wtf/MainThread.h:
1431         * wtf/NoncopyableFunction.h:
1432         * wtf/RunLoop.cpp:
1433         (WTF::RunLoop::performWork):
1434         (WTF::RunLoop::dispatch):
1435         * wtf/RunLoop.h:
1436         * wtf/WorkQueue.h:
1437         * wtf/cocoa/WorkQueueCocoa.cpp:
1438         (WTF::WorkQueue::dispatch):
1439         (WTF::WorkQueue::dispatchAfter):
1440         * wtf/efl/DispatchQueueWorkItemEfl.h:
1441         (WorkItem::WorkItem):
1442         (TimerWorkItem::create):
1443         (TimerWorkItem::TimerWorkItem):
1444         * wtf/efl/WorkQueueEfl.cpp:
1445         (WTF::WorkQueue::dispatch):
1446         (WTF::WorkQueue::dispatchAfter):
1447         * wtf/generic/RunLoopGeneric.cpp:
1448         (WTF::RunLoop::TimerBase::ScheduledTask::create):
1449         (WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask):
1450         (WTF::RunLoop::dispatchAfter):
1451         * wtf/generic/WorkQueueGeneric.cpp:
1452         (WorkQueue::dispatch):
1453         (WorkQueue::dispatchAfter):
1454         * wtf/glib/RunLoopGLib.cpp:
1455         (WTF::DispatchAfterContext::DispatchAfterContext):
1456         (WTF::RunLoop::dispatchAfter):
1457         * wtf/win/WorkItemWin.cpp:
1458         (WTF::WorkItemWin::WorkItemWin):
1459         (WTF::WorkItemWin::create):
1460         (WTF::HandleWorkItem::HandleWorkItem):
1461         (WTF::HandleWorkItem::createByAdoptingHandle):
1462         * wtf/win/WorkItemWin.h:
1463         (WTF::WorkItemWin::function):
1464         * wtf/win/WorkQueueWin.cpp:
1465         (WTF::WorkQueue::dispatch):
1466         (WTF::WorkQueue::dispatchAfter):
1467
1468 2016-05-28  Dan Bernstein  <mitz@apple.com>
1469
1470         Build fix for projects that include MainThread.h without including FastMalloc.h.
1471
1472         * wtf/NoncopyableFunction.h: Include FastMalloc.h from here.
1473
1474 2016-05-27  Chris Dumez  <cdumez@apple.com>
1475
1476         callOnMainThread() should not copy captured lambda variables
1477         https://bugs.webkit.org/show_bug.cgi?id=158166
1478
1479         Reviewed by Brady Eidson.
1480
1481         callOnMainThread() should not copy captured lambda variables. This
1482         function is usually called cross-thread with a lambda and copying
1483         the lambda (and its captured variables) can lead to thread-safety
1484         issues.
1485
1486         This patch updates callOnMainThread() to take a NoncopyableFunction&&
1487         in parameter instead of a std::function. The call sites of
1488         callOnMainThread() have also been updated to use C++14's lambda
1489         capture with initializer.
1490
1491         * WTF.xcodeproj/project.pbxproj:
1492
1493         * wtf/FunctionDispatcher.h:
1494         * wtf/NoncopyableFunction.h:
1495         - Moved NoncopyableFunction from FunctionDispatcher.h to
1496           NoncopyableFunction.h.
1497         - Add a new operator=(nullptr_t) operator to NoncopyableFunction to
1498           match std::function, as one of the call sites needed it.
1499
1500         * wtf/MainThread.cpp:
1501         (WTF::functionQueue):
1502         (WTF::dispatchFunctionsFromMainThread):
1503         (WTF::callOnMainThread):
1504         * wtf/MainThread.h:
1505
1506 2016-05-27  Yusuke Suzuki  <utatane.tea@gmail.com>
1507
1508         Unreviewed, build fix for JSCOnly port.
1509         https://bugs.webkit.org/show_bug.cgi?id=158111
1510
1511         Use NoncopyableFunction instead of std::function<>.
1512
1513         * wtf/generic/RunLoopGeneric.cpp:
1514         (WTF::RunLoop::TimerBase::ScheduledTask::create):
1515         (WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask):
1516
1517 2016-05-27  Chris Dumez  <cdumez@apple.com>
1518
1519         WorkQueue::dispatch() / RunLoop::dispatch() should not copy captured lambda variables
1520         https://bugs.webkit.org/show_bug.cgi?id=158111
1521
1522         Reviewed by Darin Adler.
1523
1524         WorkQueue::dispatch() / RunLoop::dispatch() should not copy captured lambda variables.
1525         These are often used cross-thread and copying the captured lambda variables can be
1526         dangerous (e.g. we do not want to copy a String after calling isolatedCopy() upon
1527         capture).
1528
1529         This patch introduces a new NoncopyableFunction type that behaves similarly to
1530         std::function but guarantees that the passed-in lambda (and its captured variables)
1531         cannot be copied. This new NoncopyableFunction type is now used for
1532         WorkQueue / RunLoop's dispatch() / dispatchAfter() which are commonly used
1533         cross-thread. This should now allow us to call WorkQueue::dispatch() with a lambda
1534         that captures a String like so:
1535         [str = str.isolatedCopy()]() { }
1536
1537         Also note that even though this is not leveraged in this patch, NoncopyableFunction
1538         would allow us to capture move-only types such as std::unique_ptr as so:
1539         [p = WTFMove(p)]() { }
1540         This does not work if we convert the lambda into an std::function because
1541         std::function requires the lambda to be copyable, NoncopyableFunction does not.
1542
1543         * wtf/FunctionDispatcher.h:
1544         (WTF::CallableWrapperBase::~CallableWrapperBase):
1545         (WTF::NoncopyableFunction::NoncopyableFunction):
1546         (WTF::NoncopyableFunction::operator()):
1547         (WTF::NoncopyableFunction::operator bool):
1548         (WTF::NoncopyableFunction::operator=):
1549         * wtf/RunLoop.cpp:
1550         (WTF::RunLoop::performWork):
1551         (WTF::RunLoop::dispatch):
1552         * wtf/RunLoop.h:
1553         * wtf/WorkQueue.h:
1554         * wtf/cocoa/WorkQueueCocoa.cpp:
1555         (WTF::WorkQueue::dispatch):
1556         (WTF::WorkQueue::dispatchAfter):
1557         * wtf/efl/DispatchQueueWorkItemEfl.h:
1558         (WorkItem::WorkItem):
1559         (TimerWorkItem::create):
1560         (TimerWorkItem::TimerWorkItem):
1561         * wtf/efl/WorkQueueEfl.cpp:
1562         (WTF::WorkQueue::dispatch):
1563         (WTF::WorkQueue::dispatchAfter):
1564         * wtf/generic/RunLoopGeneric.cpp:
1565         (WTF::RunLoop::dispatchAfter):
1566         * wtf/generic/WorkQueueGeneric.cpp:
1567         (WorkQueue::dispatch):
1568         (WorkQueue::dispatchAfter):
1569         * wtf/glib/RunLoopGLib.cpp:
1570         (WTF::DispatchAfterContext::DispatchAfterContext):
1571         (WTF::RunLoop::dispatchAfter):
1572         * wtf/win/WorkItemWin.cpp:
1573         (WTF::WorkItemWin::WorkItemWin):
1574         (WTF::WorkItemWin::create):
1575         (WTF::HandleWorkItem::HandleWorkItem):
1576         (WTF::HandleWorkItem::createByAdoptingHandle):
1577         * wtf/win/WorkItemWin.h:
1578         (WTF::WorkItemWin::function):
1579         * wtf/win/WorkQueueWin.cpp:
1580         (WTF::WorkQueue::dispatch):
1581         (WTF::WorkQueue::timerCallback):
1582         (WTF::WorkQueue::dispatchAfter):
1583
1584 2016-05-26  Filip Pizlo  <fpizlo@apple.com>
1585
1586         ScopedLambda should have a lifetime story that makes sense to the compiler
1587         https://bugs.webkit.org/show_bug.cgi?id=158118
1588
1589         Reviewed by Mark Lam.
1590
1591         Prior to this change, there were two lifetime bugs in ScopedLambda:
1592         
1593         - scopedLambda(Functor&&) would bind Functor to const lambda&, so the resulting ScopedLambdaFunctor
1594           would hold a reference to the original lambda. This would have surprising behavior; for example
1595           it meant that this code was wrong:
1596           
1597           auto l = scopedLambda<things>([&] ...);
1598           
1599           The solution is to have explicit copy/move versions of scopedLambda() rather than rely on perfect
1600           forwarding.
1601         
1602         - ScopedLambdaFunctor did not override its copy or move operations, so if the compiler did not RVO
1603           scopedLambda(), it would return a ScopedLambdaFunctor whose m_arg points to a dead temporary
1604           ScopedLambdaFunctor instance. The solution is to have explicit copy/move constructors and
1605           operators, which preserve the invariant that ScopedLambda::m_arg points to this.
1606         
1607         One nice side-effect of all of these constructors and operators being explicit is that we can rely
1608         on WTFMove's excellent assertions, which helped catch the first issue.
1609         
1610         This reverts ParkingLot to use ScopedLambda again.
1611
1612         * wtf/ParkingLot.cpp:
1613         (WTF::ParkingLot::parkConditionallyImpl):
1614         (WTF::ParkingLot::unparkOne):
1615         (WTF::ParkingLot::unparkOneImpl):
1616         * wtf/ParkingLot.h:
1617         (WTF::ParkingLot::parkConditionally):
1618         (WTF::ParkingLot::unparkOne):
1619         * wtf/ScopedLambda.h:
1620         (WTF::scopedLambda):
1621
1622 2016-05-25  Anders Carlsson  <andersca@apple.com>
1623
1624         Get rid of WTF/Functional.h
1625         https://bugs.webkit.org/show_bug.cgi?id=158081
1626
1627         Reviewed by Chris Dumez.
1628
1629         This is no longer used, and removing it will free up the name for a new Functional.h implementation.
1630
1631         * WTF.xcodeproj/project.pbxproj:
1632         * wtf/Functional.h: Removed.
1633         (WTF::RefAndDeref::ref): Deleted.
1634         (WTF::RefAndDeref::deref): Deleted.
1635         (WTF::ParamStorageTraits::wrap): Deleted.
1636         (WTF::ParamStorageTraits::unwrap): Deleted.
1637         (WTF::ParamStorageTraits<PassRefPtr<T>>::wrap): Deleted.
1638         (WTF::ParamStorageTraits<PassRefPtr<T>>::unwrap): Deleted.
1639         (WTF::ParamStorageTraits<RefPtr<T>>::wrap): Deleted.
1640         (WTF::ParamStorageTraits<RefPtr<T>>::unwrap): Deleted.
1641         (WTF::ParamStorageTraits<RetainPtr<T>>::wrap): Deleted.
1642         (WTF::ParamStorageTraits<RetainPtr<T>>::unwrap): Deleted.
1643         (WTF::FunctionImplBase::~FunctionImplBase): Deleted.
1644         (WTF::FunctionBase::isNull): Deleted.
1645         (WTF::FunctionBase::FunctionBase): Deleted.
1646         (WTF::FunctionBase::impl): Deleted.
1647         (WTF::bind): Deleted.
1648         * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
1649
1650 2016-05-24  Keith Miller  <keith_miller@apple.com>
1651
1652         LLInt should be able to cache prototype loads for values in GetById
1653         https://bugs.webkit.org/show_bug.cgi?id=158032
1654
1655         Reviewed by Filip Pizlo.
1656
1657         Add move constructors/initializers to Bags.
1658
1659         * wtf/Bag.h:
1660         (WTF::Bag::Bag):
1661         (WTF::Bag::operator=):
1662
1663 2016-05-24  Chris Dumez  <cdumez@apple.com>
1664
1665         Use auto for some of our lambda function parameters
1666         https://bugs.webkit.org/show_bug.cgi?id=158001
1667
1668         Reviewed by Darin Adler.
1669
1670         Use auto for some of our lambda function parameters now that we build with c++14.
1671
1672         * wtf/BubbleSort.h:
1673         (WTF::bubbleSort):
1674
1675 2016-05-23  Chris Dumez  <cdumez@apple.com>
1676
1677         Speed up move of vectors of POD types that have an inline buffer
1678         https://bugs.webkit.org/show_bug.cgi?id=158003
1679
1680         Reviewed by Benjamin Poulain.
1681
1682         When moving a vector of POD types that have an inline buffer, we would
1683         call std::swap() on the inline buffers. This unnecessarily slow because:
1684         1. It does not consider the vector size, and therefore may end up doing
1685            more work than necessary when the inline buffer is not full.
1686         2. In the "move" case, the destination buffer is completely empty so
1687            we don't really want a swap. We merely want the move the content of
1688            the source's inline buffer into the destination's one.
1689
1690         Instead of calling std::swap(), we now call swapInlineBuffers() which
1691         was already used for non-POD types. swapInlineBuffers() will do just
1692         what we want in the "move" case because swapBound is going to be 0.
1693         As a result, we will only move the content of the source buffer into
1694         the destination one. Also swapInlineBuffers() is aware of the source
1695         vector's size so it will only move what's strictly needed.
1696
1697         This seems to be a 2% progression on Dromaeo DOM attributes test.
1698
1699         * wtf/Vector.h:
1700         (WTF::VectorBuffer::swapInlineBuffer):
1701
1702 2016-05-22  Dan Bernstein  <mitz@apple.com>
1703
1704         Added NSEventMaskMouseMoved to AppKitCompatibilityDeclarations.h.
1705
1706         Rubber-stamped by Anders Carlsson.
1707
1708         * wtf/mac/AppKitCompatibilityDeclarations.h:
1709
1710 2016-05-22  Dan Bernstein  <mitz@apple.com>
1711
1712         Another attempt to fix the GTK build after my previous changes.
1713
1714         * wtf/StdLibExtras.h:
1715
1716 2016-05-22  Dan Bernstein  <mitz@apple.com>
1717
1718         Tried to fix the GTK build after r201257.
1719
1720         * wtf/StdLibExtras.h:
1721
1722 2016-05-22  Dan Bernstein  <mitz@apple.com>
1723
1724         Additional fixes for non-C++14 Apple projects that use WTF.
1725
1726         * wtf/StdLibExtras.h:
1727         (std::exchange):
1728
1729 2016-05-22  Dan Bernstein  <mitz@apple.com>
1730
1731         Additional fixes for non-C++14 Apple projects that use WTF.
1732
1733         * wtf/StdLibExtras.h:
1734         (std::make_unique):
1735         (std::move):
1736
1737 2016-05-22  Dan Bernstein  <mitz@apple.com>
1738
1739         Correct the previous build fix attempt.
1740
1741         * wtf/StdLibExtras.h:
1742
1743 2016-05-22  Dan Bernstein  <mitz@apple.com>
1744
1745         Build fix for non-C++14 Apple projects that use WTF.
1746
1747         Rubber-stamped by Anders.
1748
1749         * wtf/StdLibExtras.h:
1750
1751 2016-05-22  Brady Eidson  <beidson@apple.com>
1752
1753         Move to C++14.
1754         https://bugs.webkit.org/show_bug.cgi?id=157948
1755
1756         Reviewed by Michael Catanzaro.
1757
1758         * Configurations/Base.xcconfig:
1759         
1760         Delete a lot of "stl additions until we can adopt C++14" code:
1761         * wtf/StdLibExtras.h:
1762         (std::make_unique): Deleted.
1763         (std::index_sequence::size): Deleted.
1764         (std::exchange): Deleted.
1765         (std::literals::chrono_literals::operator _s): Deleted.
1766         (std::literals::chrono_literals::operator _ms): Deleted.
1767
1768 2016-05-20  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
1769
1770         Implement operator== for WeakPtr
1771         https://bugs.webkit.org/show_bug.cgi?id=157883
1772
1773         Reviewed by Chris Dumez.
1774
1775         Implement operator== and operator!= for WeakPtr and update code to use the operators.
1776
1777         * wtf/WeakPtr.h:
1778         (WTF::operator==):
1779         (WTF::operator!=):
1780
1781 2016-05-19  Chris Dumez  <cdumez@apple.com>
1782
1783         Improve compile-time assertions in is<>() / downcast<>()
1784         https://bugs.webkit.org/show_bug.cgi?id=157817
1785
1786         Reviewed by Darin Adler.
1787
1788         * wtf/Ref.h:
1789         (WTF::is):
1790         Add is<>() overloads taking a Ref<>() so that is<>() keeps working when
1791         passing a Ref<>(), despite the new static assertions on the input type.
1792         Some call sites were already leveraging this as it was working by
1793         implicitly converting the Ref<T> into a T&.
1794
1795         * wtf/TypeCasts.h:
1796         (WTF::is):
1797         (WTF::downcast):
1798         Make static assertions stricter in is<>() / downcast<>() to catch more
1799         cases where those are either unnecessary or incorrect.
1800
1801 2016-05-19  Filip Pizlo  <fpizlo@apple.com>
1802
1803         Unreviewed, fix all of the builds. I failed a second time.
1804
1805         * wtf/BackwardsGraph.h:
1806         (WTF::BackwardsGraph::rootName):
1807
1808 2016-05-19  Filip Pizlo  <fpizlo@apple.com>
1809
1810         Unreviewed, fix all of the builds. I had made an additional change that I did not mean to
1811         commit. This fixes it.
1812
1813         * wtf/BackwardsGraph.h:
1814         (WTF::BackwardsGraph::rootName):
1815         (WTF::BackwardsGraph::Set::dump):
1816         (WTF::BackwardsGraph::dump):
1817
1818 2016-05-18  Filip Pizlo  <fpizlo@apple.com>
1819
1820         DFG::LICMPhase shouldn't hoist type checks unless it knows that the check will succeed at the loop pre-header
1821         https://bugs.webkit.org/show_bug.cgi?id=144527
1822
1823         Reviewed by Saam Barati.
1824         
1825         This adds an adaptor for graphs called BackwardsGraph. The WTF graph framework is based on
1826         passing around a Graph template argument that follows the protocol shared by DFG::CFG,
1827         B3::CFG, and Air::CFG. These graphs always have a single root node but may have many leaf
1828         nodes. This new BackwardsGraph adaptor reverses the graph by creating a synthetic return
1829         node that it uses as the root in the inverted graph. This currently may resort to some
1830         heuristics in programs that have an infinite loop, but other than that, it'll work well in
1831         the general case.
1832         
1833         This allows us to say Dominators<BackwardsGraph<some graph type>> as a way of computing
1834         backwards dominators, which then allows us to easily answer control flow equivalence
1835         queries.
1836
1837         * CMakeLists.txt:
1838         * WTF.xcodeproj/project.pbxproj:
1839         * wtf/BackwardsGraph.h: Added.
1840         (WTF::BackwardsGraph::Node::Node):
1841         (WTF::BackwardsGraph::Node::root):
1842         (WTF::BackwardsGraph::Node::operator==):
1843         (WTF::BackwardsGraph::Node::operator!=):
1844         (WTF::BackwardsGraph::Node::operator bool):
1845         (WTF::BackwardsGraph::Node::isRoot):
1846         (WTF::BackwardsGraph::Node::node):
1847         (WTF::BackwardsGraph::Set::Set):
1848         (WTF::BackwardsGraph::Set::add):
1849         (WTF::BackwardsGraph::Set::remove):
1850         (WTF::BackwardsGraph::Set::contains):
1851         (WTF::BackwardsGraph::Set::dump):
1852         (WTF::BackwardsGraph::Map::Map):
1853         (WTF::BackwardsGraph::Map::clear):
1854         (WTF::BackwardsGraph::Map::size):
1855         (WTF::BackwardsGraph::Map::operator[]):
1856         (WTF::BackwardsGraph::BackwardsGraph):
1857         (WTF::BackwardsGraph::root):
1858         (WTF::BackwardsGraph::newMap):
1859         (WTF::BackwardsGraph::successors):
1860         (WTF::BackwardsGraph::predecessors):
1861         (WTF::BackwardsGraph::index):
1862         (WTF::BackwardsGraph::node):
1863         (WTF::BackwardsGraph::numNodes):
1864         (WTF::BackwardsGraph::dump):
1865         * wtf/Dominators.h:
1866         (WTF::Dominators::Dominators):
1867         (WTF::Dominators::dump):
1868         (WTF::Dominators::LengauerTarjan::computeDepthFirstPreNumbering):
1869         * wtf/GraphNodeWorklist.h:
1870         (WTF::GraphNodeWith::GraphNodeWith):
1871         (WTF::GraphNodeWith::operator bool):
1872         * wtf/StdLibExtras.h:
1873         (WTF::callStatelessLambda):
1874         (WTF::checkAndSet):
1875
1876 2016-05-18  Saam barati  <sbarati@apple.com>
1877
1878         StringBuilder::appendQuotedJSONString doesn't properly protect against the math it's doing. Make the math fit the assertion.
1879         https://bugs.webkit.org/show_bug.cgi?id=157868
1880
1881         Reviewed by Benjamin Poulain.
1882
1883         appendQuotedJSONString was rounding up to the next power of two when resizing
1884         its buffer. Lets call the allocation size X. If X > 2^31, then
1885         roundUpToPowerOfTwo(X) == 0. This patch fixes this by making the
1886         assertion reflect what the code is doing. We now allocate to a size
1887         of X = std::max(maximumCapacityRequired , roundUpToPowerOfTwo(maximumCapacityRequired))
1888
1889         * wtf/text/StringBuilder.cpp:
1890         (WTF::StringBuilder::appendQuotedJSONString):
1891
1892 2016-05-17  Joseph Pecoraro  <pecoraro@apple.com>
1893
1894         REGRESSION(r192855): Math.random() always produces the same first 7 decimal points the first two invocations
1895         https://bugs.webkit.org/show_bug.cgi?id=157805
1896         <rdar://problem/26327851>
1897
1898         Reviewed by Geoffrey Garen.
1899
1900         * wtf/WeakRandom.h:
1901         (WTF::WeakRandom::setSeed):
1902         Advance once to randomize the 32bit seed across the 128bit state
1903         and avoid re-using 64bits of state in the second advance.
1904
1905 2016-05-17  Dean Jackson  <dino@apple.com>
1906
1907         Remove ES6_GENERATORS flag
1908         https://bugs.webkit.org/show_bug.cgi?id=157815
1909         <rdar://problem/26332894>
1910
1911         Reviewed by Geoffrey Garen.
1912
1913         This flag isn't needed. Generators are enabled everywhere and
1914         part of a stable specification.
1915
1916         * wtf/FeatureDefines.h:
1917
1918 2016-05-17  Filip Pizlo  <fpizlo@apple.com>
1919
1920         WTF should know about Language
1921         https://bugs.webkit.org/show_bug.cgi?id=157756
1922
1923         Reviewed by Geoffrey Garen.
1924
1925         This contains two changes:
1926
1927         - Move everything that WebCore's logic for getting the platform user preferred language
1928           depended on into WTF. This means CFBundleSPI.h and BlockObjCExceptions.h|cpp.
1929
1930         - Move WebCore::platformUserPreferredLanguages() to WTF::platformUserPreferredLanguages().
1931           This is needed by https://bugs.webkit.org/show_bug.cgi?id=157755, which will make JSC
1932           use this to detect the platform user preferred language when running standalone.
1933
1934         Moving the dependencies accounts for a huge chunk of this change, since we have to rewire
1935         all of the references to those headers in all of WebKit.
1936
1937         Moving platformUserPreferredLanguages() is mostly easy except for the weird callback.
1938         That function would call languageDidChange(), which needs to stay in WebCore. So, this
1939         gives WebCore the ability to register a languageDidChange callback. Other than this new
1940         logic, the code being added to WTF is just being lifted out of WebCore.
1941
1942         * WTF.xcodeproj/project.pbxproj:
1943         * wtf/BlockObjCExceptions.h: Added.
1944         * wtf/BlockObjCExceptions.mm: Added.
1945         (ReportBlockedObjCException):
1946         * wtf/PlatformEfl.cmake:
1947         * wtf/PlatformGTK.cmake:
1948         * wtf/PlatformJSCOnly.cmake:
1949         * wtf/PlatformMac.cmake:
1950         * wtf/PlatformUserPreferredLanguages.h: Added.
1951         * wtf/PlatformUserPreferredLanguagesMac.mm: Added.
1952         (WTF::setPlatformUserPreferredLanguagesChangedCallback):
1953         (WTF::preferredLanguages):
1954         (+[WTFLanguageChangeObserver languagePreferencesDidChange:]):
1955         (WTF::httpStyleLanguageCode):
1956         (WTF::isValidICUCountryCode):
1957         (WTF::platformUserPreferredLanguages):
1958         * wtf/PlatformUserPreferredLanguagesUnix.cpp: Added.
1959         (WTF::setPlatformUserPreferredLanguagesChangedCallback):
1960         (WTF::platformLanguage):
1961         (WTF::platformUserPreferredLanguages):
1962         * wtf/PlatformUserPreferredLanguagesWin.cpp: Added.
1963         (WTF::setPlatformUserPreferredLanguagesChangedCallback):
1964         (WTF::localeInfo):
1965         (WTF::platformLanguage):
1966         (WTF::platformUserPreferredLanguages):
1967         * wtf/PlatformWin.cmake:
1968         * wtf/spi/cf: Added.
1969         * wtf/spi/cf/CFBundleSPI.h: Added.
1970
1971 2016-05-17  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1972
1973         DOMPromise should only restrict the resolution type
1974         https://bugs.webkit.org/show_bug.cgi?id=157307
1975
1976         Reviewed by Darin Adler.
1977
1978         * wtf/Ref.h: Adding static constexpr to ease detection of Ref for templates.
1979         * wtf/RefPtr.h: Ditto.
1980
1981 2016-05-16  Michael Saboff  <msaboff@apple.com>
1982
1983         ARMV7K: Crash at JavaScriptCore: WTF::ScopedLambdaFunctor<bool
1984         https://bugs.webkit.org/show_bug.cgi?id=157781
1985
1986         Reviewed by Filip Pizlo.
1987
1988         Replaced use of ScopedLambda in locking code with std::function much as it was
1989         before change set 199760 to work around what appears to be a clang compiler issue.
1990
1991         * wtf/ParkingLot.cpp:
1992         (WTF::ParkingLot::parkConditionallyImpl):
1993         (WTF::ParkingLot::unparkOne):
1994         (WTF::ParkingLot::unparkAll):
1995         (WTF::ParkingLot::forEach):
1996         (WTF::ParkingLot::unparkOneImpl): Deleted.
1997         (WTF::ParkingLot::forEachImpl): Deleted.
1998         * wtf/ParkingLot.h:
1999         (WTF::ParkingLot::parkConditionally):
2000         (WTF::ParkingLot::unparkOne): Deleted.
2001         (WTF::ParkingLot::forEach): Deleted.
2002
2003 2016-05-15  Chris Dumez  <cdumez@apple.com>
2004
2005         Use more references in JS wrappers related code
2006         https://bugs.webkit.org/show_bug.cgi?id=157721
2007
2008         Reviewed by Darin Adler.
2009
2010         Add new static_reference_cast() overload that takes a Ref<U>&& in
2011         in order to downcast Ref<> types without causing ref-counting
2012         churn.
2013
2014         * wtf/Ref.h:
2015         (WTF::static_reference_cast):
2016
2017 2016-05-13  Chris Dumez  <cdumez@apple.com>
2018
2019         Unreviewed, rolling out r200837.
2020
2021         Seems to have regressed Speedometer and JetStream on iOS
2022
2023         Reverted changeset:
2024
2025         "DOMPromise should only restrict the resolution type"
2026         https://bugs.webkit.org/show_bug.cgi?id=157307
2027         http://trac.webkit.org/changeset/200837
2028
2029 2016-05-13  Beth Dakin  <bdakin@apple.com>
2030
2031         Add dyldSPI.h
2032         https://bugs.webkit.org/show_bug.cgi?id=157401
2033         -and corresponding-
2034         rdar://problem/26253396
2035
2036         Reviewed by Darin Adler.
2037
2038         New header for dyld spi.
2039         * WTF.xcodeproj/project.pbxproj:
2040         * wtf/spi/darwin/dyldSPI.h: Added.
2041
2042 2016-05-13  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2043
2044         DOMPromise should only restrict the resolution type
2045         https://bugs.webkit.org/show_bug.cgi?id=157307
2046
2047         Reviewed by Darin Adler.
2048
2049         * wtf/Ref.h: Adding static constexpr to ease detection of Ref for templates.
2050         * wtf/RefPtr.h: Ditto.
2051
2052 2016-05-12  Daniel Bates  <dabates@apple.com>
2053
2054         Use SecTask SPI to retrieve code signing identifier for user directory suffix
2055         https://bugs.webkit.org/show_bug.cgi?id=157570
2056
2057         Reviewed by Darin Adler.
2058         <rdar://problem/25706517>
2059
2060         Forward declare SPI SecTaskCopySigningIdentifier().
2061
2062         * wtf/spi/cocoa/SecuritySPI.h:
2063
2064 2016-05-12  Csaba Osztrogonác  <ossy@webkit.org>
2065
2066         Remove ENABLE(ES6_ARROWFUNCTION_SYNTAX) guards
2067         https://bugs.webkit.org/show_bug.cgi?id=157564
2068
2069         Reviewed by Darin Adler.
2070
2071         * wtf/FeatureDefines.h:
2072
2073 2016-05-10  Filip Pizlo  <fpizlo@apple.com>
2074
2075         Internal JSC profiler should have a timestamped log of events for each code block
2076         https://bugs.webkit.org/show_bug.cgi?id=157538
2077
2078         Reviewed by Benjamin Poulain.
2079
2080         * wtf/PrintStream.h:
2081         (WTF::PrintStream::print):
2082
2083 2016-05-10  Chris Dumez  <cdumez@apple.com>
2084
2085         Get rid of a lot of calls to RefPtr::release()
2086         https://bugs.webkit.org/show_bug.cgi?id=157505
2087
2088         Reviewed by Alex Christensen.
2089
2090         Get rid of a lot of calls to RefPtr::release() and use WTFMove() instead.
2091
2092         * wtf/text/AtomicStringImpl.cpp:
2093         (WTF::HashAndUTF8CharactersTranslator::translate):
2094         * wtf/text/CString.cpp:
2095         (WTF::CString::copyBufferIfNeeded):
2096         * wtf/text/StringBuilder.cpp:
2097         (WTF::StringBuilder::allocateBuffer):
2098         (WTF::StringBuilder::allocateBufferUpConvert):
2099         (WTF::StringBuilder::shrinkToFit):
2100         * wtf/text/WTFString.cpp:
2101         (WTF::String::append):
2102         (WTF::String::insert):
2103         (WTF::String::removeInternal):
2104         * wtf/text/WTFString.h:
2105         (WTF::String::String):
2106         (WTF::String::operator=):
2107         (WTF::String::releaseImpl):
2108         (WTF::String::isNull): Deleted.
2109
2110 2016-05-08  Chris Dumez  <cdumez@apple.com>
2111
2112         [COCOA] Disable HAVE_DTRACE at build time
2113         https://bugs.webkit.org/show_bug.cgi?id=157433
2114         <rdar://problem/26148841>
2115
2116         Reviewed by Mark Lam.
2117
2118         Disable HAVE_DTRACE on COCOA since it is mostly unused and has a performance
2119         impact, at least on iOS.
2120
2121         * wtf/Platform.h:
2122
2123 2016-05-08  Chris Dumez  <cdumez@apple.com>
2124
2125         [Bindings] Simplify [RequiresExistingAtomicString] IDL extended attribute handling
2126         https://bugs.webkit.org/show_bug.cgi?id=157465
2127
2128         Reviewed by Darin Adler.
2129
2130         Add an AtomicString(RefPtr<AtomicStringImpl>&&) constructor that is now
2131         used by the bindings when [RequiresExistingAtomicString] is used. This
2132         is more efficient than using AtomicString(AtomicStringImpl*) as the
2133         caller has a RefPtr<AtomicStringImpl> and is consistent with the
2134         pre-existing String(RefPtr<AtomicStringImpl>&&) constructor.
2135
2136         * wtf/text/AtomicString.h:
2137         (WTF::AtomicString::AtomicString):
2138
2139 2016-05-08  Darin Adler  <darin@apple.com>
2140
2141         * wtf/text/WTFString.h: Remove pragma once. Not working for some reason.
2142
2143 2016-05-08  Darin Adler  <darin@apple.com>
2144
2145         Follow-up to that last patch (missed review comments).
2146
2147         * wtf/text/WTFString.h: Use nullptr instead of 0 as needed. Also use pragma once.
2148
2149 2016-05-08  Darin Adler  <darin@apple.com>
2150
2151         Change EventSource constructor to take an IDL dictionary instead of a WebCore::Dictionary
2152         https://bugs.webkit.org/show_bug.cgi?id=157459
2153
2154         Reviewed by Chris Dumez.
2155
2156         * wtf/text/WTFString.h: Export a symbol now used in WebCore.
2157
2158 2016-05-02  Sam Weinig  <sam@webkit.org>
2159
2160         On platforms that support it, use a SecTrustRef as the basis of CertificateInfo instead of a chain of SecCertificateRefs.
2161         https://bugs.webkit.org/show_bug.cgi?id=157220
2162
2163         Reviewed by Darin Adler.
2164
2165         * wtf/Platform.h:
2166         Add support for HAVE(SEC_TRUST_SERIALIZATION).
2167
2168         * wtf/spi/cocoa/SecuritySPI.h:
2169         Add SPI access to SecTrustSerialize and SecTrustDeserialize.
2170
2171 2016-05-04  Filip Pizlo  <fpizlo@apple.com>
2172
2173         Add HLE locks and synchronic TTAS locks to the ToyLocks benchmark suite
2174         https://bugs.webkit.org/show_bug.cgi?id=157367
2175
2176         Rubber stamped by Benjamin Poulain.
2177         
2178         Turns out they are both a lot slower than WTF::Lock. The HLE lock is written according to Intel's
2179         documentation. The synchronic lock follows the algorithm of the "ttas_lock" in the synchronic
2180         test.hpp.
2181
2182         * benchmarks/ToyLocks.h:
2183
2184 2016-05-04  Filip Pizlo  <fpizlo@apple.com>
2185
2186         Add a few more WTF locking benchmarks
2187         https://bugs.webkit.org/show_bug.cgi?id=157365
2188
2189         Rubber stamped by Benjamin Poulain.
2190         
2191         Factors out our toy locks into ToyLocks.h and adds a new test (LockFairnessTest) that measures
2192         the fairness of locks.
2193         
2194         The result: WTF::Lock is pretty fair enough.
2195
2196         * benchmarks/LockFairnessTest.cpp: Added.
2197         (main):
2198         * benchmarks/LockSpeedTest.cpp:
2199         (main):
2200         * benchmarks/ToyLocks.h: Added.
2201
2202 2016-05-04  Filip Pizlo  <fpizlo@apple.com>
2203
2204         Speed up JSGlobalObject initialization by making some properties lazy
2205         https://bugs.webkit.org/show_bug.cgi?id=157045
2206
2207         Reviewed by Keith Miller.
2208         
2209         This WTF change is at the heart of a large JSC change. In JSC I found myself wanting to
2210         do this a lot:
2211         
2212             static void callback(Foo& foo) { ... }
2213         
2214             foo.setCallback(callback);
2215         
2216         But that's not very nice to write if many different setCallback() calls are inside of the
2217         same very large function: you'll have to have a lot of static function definitions in
2218         one part of the file, and then a bunch of setCallback() calls in another part. It's hard
2219         to reason about what's going on with such code.
2220         
2221         So what if you wrote this instead:
2222         
2223             foo.setCallback([] (Foo& foo) { ... });
2224         
2225         Much nicer! There is a standard way to do this: lambdas that are stateless are
2226         convertible to function pointers. This change also offers another approach that is a bit
2227         more general.
2228         
2229         These additions to WTF help you do it:
2230         
2231         isStatelessLambda<Func>(): tells you if Func is a stateless lambda. This uses is_empty to
2232         test if the lambda is stateless. This turns out to be a stronger property than
2233         convertibility to function pointers. For example, a function pointer is convertible to a
2234         function pointer, but it is definitely stateful: you cannot successfully call it if you
2235         only has its type. On the other hand, a stateless lambda is really stateless in the sense
2236         that you only need its type to call it.
2237         
2238         callStatelessLambda<ResultType, Func>(Arguments&&...): calls the given stateless lambda.
2239         
2240         JSC uses these to build up some sophisticated lazy-initialization APIs. The use of
2241         statelessness allows JSC to combine a lambda with other logic into a single function
2242         pointer.
2243
2244         * wtf/StdLibExtras.h:
2245         (WTF::isStatelessLambda):
2246         (WTF::callStatelessLambda):
2247
2248 2016-05-04  Per Arne Vollan  <peavo@outlook.com>
2249
2250         [Win] Use NeverDestroyed template.
2251         https://bugs.webkit.org/show_bug.cgi?id=157345
2252
2253         Reviewed by Darin Adler.
2254
2255         * wtf/ThreadingWin.cpp:
2256         (WTF::threadMapMutex):
2257         (WTF::threadMap):
2258
2259 2016-05-04  Chris Dumez  <cdumez@apple.com>
2260
2261         Unreviewed, rolling out r200383 and r200406.
2262
2263         Seems to have caused crashes on iOS / ARMv7s
2264
2265         Reverted changesets:
2266
2267         "Speed up JSGlobalObject initialization by making some
2268         properties lazy"
2269         https://bugs.webkit.org/show_bug.cgi?id=157045
2270         http://trac.webkit.org/changeset/200383
2271
2272         "REGRESSION(r200383): Setting lazily initialized properties
2273         across frame boundaries crashes"
2274         https://bugs.webkit.org/show_bug.cgi?id=157333
2275         http://trac.webkit.org/changeset/200406
2276
2277 2016-05-03  Filip Pizlo  <fpizlo@apple.com>
2278
2279         Speed up JSGlobalObject initialization by making some properties lazy
2280         https://bugs.webkit.org/show_bug.cgi?id=157045
2281
2282         Reviewed by Keith Miller.
2283         
2284         This WTF change is at the heart of a large JSC change. In JSC I found myself wanting to
2285         do this a lot:
2286         
2287             static void callback(Foo& foo) { ... }
2288         
2289             foo.setCallback(callback);
2290         
2291         But that's not very nice to write if many different setCallback() calls are inside of the
2292         same very large function: you'll have to have a lot of static function definitions in
2293         one part of the file, and then a bunch of setCallback() calls in another part. It's hard
2294         to reason about what's going on with such code.
2295         
2296         So what if you wrote this instead:
2297         
2298             foo.setCallback([] (Foo& foo) { ... });
2299         
2300         Much nicer! There is a standard way to do this: lambdas that are stateless are
2301         convertible to function pointers. This change also offers another approach that is a bit
2302         more general.
2303         
2304         These additions to WTF help you do it:
2305         
2306         isStatelessLambda<Func>(): tells you if Func is a stateless lambda. This uses is_empty to
2307         test if the lambda is stateless. This turns out to be a stronger property than
2308         convertibility to function pointers. For example, a function pointer is convertible to a
2309         function pointer, but it is definitely stateful: you cannot successfully call it if you
2310         only has its type. On the other hand, a stateless lambda is really stateless in the sense
2311         that you only need its type to call it.
2312         
2313         callStatelessLambda<ResultType, Func>(Arguments&&...): calls the given stateless lambda.
2314         
2315         JSC uses these to build up some sophisticated lazy-initialization APIs. The use of
2316         statelessness allows JSC to combine a lambda with other logic into a single function
2317         pointer.
2318
2319         * wtf/StdLibExtras.h:
2320         (WTF::isStatelessLambda):
2321         (WTF::callStatelessLambda):
2322
2323 2016-05-03  Per Arne Vollan  <peavo@outlook.com>
2324
2325         [Win] Remove Windows XP Compatibility Requirements
2326         https://bugs.webkit.org/show_bug.cgi?id=152899
2327
2328         Reviewed by Brent Fulgham.
2329
2330         Windows XP is not supported anymore, we can remove workarounds.
2331
2332         * wtf/Assertions.cpp:
2333
2334 2016-05-03  Per Arne Vollan  <peavo@outlook.com>
2335
2336         [Win] Warning fix.
2337         https://bugs.webkit.org/show_bug.cgi?id=157309
2338
2339         Reviewed by Darin Adler.
2340
2341         MSVC gives a warning when converting from signed to unsigned.
2342
2343         * wtf/SmallPtrSet.h:
2344         (WTF::SmallPtrSet::begin):
2345
2346 2016-05-02  Brady Eidson  <beidson@apple.com>
2347
2348         Add the ability to accumulate logs for specific logging channels to help diagnose test timeouts.
2349         https://bugs.webkit.org/show_bug.cgi?id=157274
2350
2351         Reviewed by Alex Christensen.
2352
2353         This patch changes WTFLog to add the logging string to the logging accumulator if the logging channel says so.
2354         It also adds support for using this new accumulation mechanism.
2355
2356         * WTF.xcodeproj/project.pbxproj:
2357
2358         * wtf/Assertions.cpp:
2359         (WTF::resetAccumulatedLogs):
2360         (WTF::getAndResetAccumulatedLogs):
2361         * wtf/Assertions.h:
2362
2363         * wtf/LoggingAccumulator.h: Added. Expose functions to get accumulated logs and to reset the accumulation.
2364
2365         * wtf/text/WTFString.cpp:
2366         (WTF::String::format): Update to handle %@ on CF (Well, really ObjC) platforms.
2367
2368 2016-05-02  Per Arne Vollan  <peavo@outlook.com>
2369
2370         [Win] Enable IndexedDB.
2371         https://bugs.webkit.org/show_bug.cgi?id=157192
2372
2373         Reviewed by Brent Fulgham.
2374
2375         Fix compile errors when format specifiers like PRIu64 is used, by defining
2376         __STDC_FORMAT_MACROS before inttypes.h is included.
2377
2378         * wtf/Platform.h: 
2379
2380 2016-04-27  Brady Eidson  <beidson@apple.com>
2381
2382         Modern IDB: Implement native IDBFactory.getAllDatabaseNames for WebInspector.
2383         https://bugs.webkit.org/show_bug.cgi?id=157072
2384
2385         Reviewed by Alex Christensen.
2386
2387         Moved these Hex Digit utilities from WebCore URL code (???), 
2388         and add a checked version of getting the hex digit value.
2389         
2390         * wtf/HexNumber.h:
2391         (WTF::isHexDigit):
2392         (WTF::uncheckedHexDigit):
2393         (WTF::hexDigitValue):
2394         (WTF::uncheckedHexDigitValue):
2395
2396 2016-04-25  Ryosuke Niwa  <rniwa@webkit.org>
2397
2398         Remove the build flag for template elements
2399         https://bugs.webkit.org/show_bug.cgi?id=157022
2400
2401         Reviewed by Daniel Bates.
2402
2403         * wtf/FeatureDefines.h:
2404
2405 2016-04-25  Fujii Hironori  <Hironori.Fujii@sony.com>
2406
2407         Heap corruption is detected when destructing JSGlobalObject
2408         https://bugs.webkit.org/show_bug.cgi?id=156831
2409
2410         Reviewed by Mark Lam.
2411
2412         WebKit uses CRT static library on Windows.  Each copy of the CRT
2413         library has its own heap manager, allocating memory in one CRT
2414         library and passing the pointer across a DLL boundary to be freed
2415         by a different copy of the CRT library is a potential cause for
2416         heap corruption.
2417
2418           Potential Errors Passing CRT Objects Across DLL Boundaries
2419           <https://msdn.microsoft.com/en-us/library/ms235460(v=vs.140).aspx>
2420
2421         JSGlobalObject::createRareDataIfNeeded is inlined but
2422         JSGlobalObject::~JSGlobalObject is not.  Then, the heap of
2423         allocating JSGlobalObjectRareData is WebKit.dll, but deallocating
2424         JavaScriptCore.dll.  Adding WTF_MAKE_FAST_ALLOCATED to
2425         JSGlobalObjectRareData ensures heap consistency of it.  WTF::Lock
2426         also needs WTF_MAKE_FAST_ALLOCATED because it is allocated from
2427         the inlined constructor of JSGlobalObjectRareData.
2428
2429         * wtf/Lock.h: Add WTF_MAKE_FAST_ALLOCATED.
2430
2431 2016-04-21  Saam barati  <sbarati@apple.com>
2432
2433         Lets do less locking of symbol tables in the BytecodeGenerator where we don't have race conditions
2434         https://bugs.webkit.org/show_bug.cgi?id=156821
2435
2436         Reviewed by Filip Pizlo.
2437
2438         This patch introduces a new constructor for Locker which implies no
2439         locking is necessary. You instantiate such a locker like so:
2440         `Locker<Lock> locker(Locker<Lock>::NoLockingNecessary);`
2441
2442         This is useful to for very specific places when it is not yet
2443         required to engage in a specified locking protocol. As an example,
2444         we use this in JSC when we allocate a particular object that
2445         engages in a locking protocol with the concurrent compiler thread,
2446         but before a concurrent compiler thread that could have access
2447         to the object exists.
2448
2449         * wtf/Locker.h:
2450         (WTF::Locker::Locker):
2451         (WTF::Locker::~Locker):
2452
2453 2016-04-19  Michael Saboff  <msaboff@apple.com>
2454
2455         iTunes crashing JavaScriptCore.dll
2456         https://bugs.webkit.org/show_bug.cgi?id=156647
2457
2458         Reviewed by Filip Pizlo.
2459
2460         If a thread was created without using the WTF thread apis and that thread uses
2461         a JavaScript VM and that thread exits with the VM still around, JSC won't know
2462         that the thread has exited.  Currently, we use ThreadSpecificThreadExit() to
2463         clean up any thread specific keys.  Cleaning up these keys is how JSC is
2464         notified of a thread exit.  We only call ThreadSpecificThreadExit() from
2465         wtfThreadEntryPoint() when the thread entry point function returns.
2466         This mechanism was put in place for Windows because we layer the WTF::ThreadSpecific
2467         functionality on top of TLS (Thread Local Storage), but TLS doesn't have
2468         a thread exiting callback the way that pthread_create_key does.
2469
2470         The fix is to change from using TLS to using FLS (Fiber Local Storage).  Although
2471         Windows allows multiple fibers per thread, WebKit is not designed to work with a
2472         multiple fibers per thread.  When there is only one fiber per thread, FLS works just
2473         like TLS, but it has the destroy callback.
2474
2475         I restructured the Windows version of WTF::ThreadSpecific to be almost the same
2476         as the pthread version.  Added THREAD_SPECIFIC_CALL to set the correct
2477         calling convenction for Windows 32 bit.
2478
2479         * wtf/ThreadSpecific.h:
2480         (WTF::threadSpecificKeyCreate):
2481         (WTF::threadSpecificKeyDelete):
2482         (WTF::threadSpecificSet):
2483         (WTF::threadSpecificGet):
2484         (WTF::ThreadSpecific<T>::ThreadSpecific):
2485         (WTF::ThreadSpecific<T>::~ThreadSpecific):
2486         (WTF::ThreadSpecific<T>::get):
2487         (WTF::ThreadSpecific<T>::set):
2488         (WTF::ThreadSpecific<T>::destroy):
2489         Restructured to use FLS.  Renamed TLS* to FLS*.
2490
2491         * wtf/ThreadSpecificWin.cpp:
2492         (WTF::flsKeyCount):
2493         (WTF::flsKeys):
2494         Renamed from tlsKey*() to flsKey*().
2495
2496         (WTF::destructorsList): Deleted.
2497         (WTF::destructorsMutex): Deleted.
2498         (WTF::PlatformThreadSpecificKey::PlatformThreadSpecificKey): Deleted.
2499         (WTF::PlatformThreadSpecificKey::~PlatformThreadSpecificKey): Deleted.
2500         (WTF::PlatformThreadSpecificKey::setValue): Deleted.
2501         (WTF::PlatformThreadSpecificKey::value): Deleted.
2502         (WTF::PlatformThreadSpecificKey::callDestructor): Deleted.
2503         (WTF::tlsKeyCount): Deleted.
2504         (WTF::tlsKeys): Deleted.
2505         (WTF::threadSpecificKeyCreate): Deleted.
2506         (WTF::threadSpecificKeyDelete): Deleted.
2507         (WTF::threadSpecificSet): Deleted.
2508         (WTF::threadSpecificGet): Deleted.
2509         (WTF::ThreadSpecificThreadExit): Deleted.
2510
2511         * wtf/ThreadingWin.cpp:
2512         (WTF::wtfThreadEntryPoint): Eliminated call to ThreadSpecificThreadExit.
2513
2514 2016-04-19  Filip Pizlo  <fpizlo@apple.com>
2515
2516         Add more locking algorithms to the LockSpeedTest.
2517
2518         Rubber stamped by Saam Barati.
2519
2520         * benchmarks/LockSpeedTest.cpp:
2521         (main):
2522
2523 2016-04-19  Filip Pizlo  <fpizlo@apple.com>
2524
2525         Clean up the ParkingLot uparking API a bit
2526         https://bugs.webkit.org/show_bug.cgi?id=156746
2527
2528         Reviewed by Saam Barati and Geoffrey Garen.
2529         
2530         Previously, unparkOne() would either return a boolean to tell you if there are any more threads on
2531         the queue or it would pass your callback a pair of booleans - one to tell if a thread was unparked
2532         and another to tell if there are any more threads. This was an annoying inconsistency. What if you
2533         wanted to know if unparkOne() unparked a thread but you don't care to use callbacks?
2534
2535         This fixes unparkOne() to use a struct called UnparkResult for both of its variants. This makes the
2536         code a bit cleaner.
2537
2538         * wtf/Atomics.h: Add some more atomic ops.
2539         (WTF::Atomic::exchangeAndAdd):
2540         (WTF::Atomic::exchange):
2541         * wtf/Condition.h: Change calls to unparkOne().
2542         (WTF::ConditionBase::notifyOne):
2543         * wtf/Lock.cpp: Change calls to unparkOne().
2544         (WTF::LockBase::unlockSlow):
2545         * wtf/ParkingLot.cpp:
2546         (WTF::ParkingLot::parkConditionally):
2547         (WTF::ParkingLot::unparkOne):
2548         * wtf/ParkingLot.h: Switch to using ScopedLambda and introduce UnparkResult.
2549
2550 2016-04-19  Commit Queue  <commit-queue@webkit.org>
2551
2552         Unreviewed, rolling out r199726.
2553         https://bugs.webkit.org/show_bug.cgi?id=156748
2554
2555         WebKit tests crash on Windows 32 (Requested by msaboff on
2556         #webkit).
2557
2558         Reverted changeset:
2559
2560         "iTunes crashing JavaScriptCore.dll"
2561         https://bugs.webkit.org/show_bug.cgi?id=156647
2562         http://trac.webkit.org/changeset/199726
2563
2564 2016-04-19  Michael Saboff  <msaboff@apple.com>
2565
2566         iTunes crashing JavaScriptCore.dll
2567         https://bugs.webkit.org/show_bug.cgi?id=156647
2568
2569         Reviewed by Saam Barati.
2570
2571         If a thread was created without using the WTF thread apis and that thread uses
2572         a JavaScript VM and that thread exits with the VM still around, JSC won't know
2573         that the thread has exited.  Currently, we use ThreadSpecificThreadExit() to
2574         clean up any thread specific keys.  Cleaning up these keys is how JSC is
2575         notified of a thread exit.  We only call ThreadSpecificThreadExit() from
2576         wtfThreadEntryPoint() when the thread entry point function returns.
2577         This mechanism was put in place for Windows because we layer the WTF::ThreadSpecific
2578         functionality on top of TLS (Thread Local Storage), but TLS doesn't have
2579         a thread exiting callback the way that pthread_create_key.
2580
2581         The fix is to change from using TLS to using FLS (Fiber Local Storage).  Although
2582         Windows allows multiple fibers per thread, WebKit is not designed to work with a
2583         multiple fibers per thread.  When there is only one fiber per thread, FLS works just
2584         like TLS, but it has the destroy callback.
2585
2586         I restructured the Windows version of WTF::ThreadSpecific to be almost the same
2587         as the pthread version.
2588
2589         * wtf/ThreadSpecific.h:
2590         (WTF::threadSpecificKeyCreate):
2591         (WTF::threadSpecificKeyDelete):
2592         (WTF::threadSpecificSet):
2593         (WTF::threadSpecificGet):
2594         (WTF::ThreadSpecific<T>::ThreadSpecific):
2595         (WTF::ThreadSpecific<T>::~ThreadSpecific):
2596         (WTF::ThreadSpecific<T>::get):
2597         (WTF::ThreadSpecific<T>::set):
2598         (WTF::ThreadSpecific<T>::destroy):
2599         Restructured to use FLS.  Renamed TLS* to FLS*.
2600
2601         * wtf/ThreadSpecificWin.cpp:
2602         (WTF::flsKeyCount):
2603         (WTF::flsKeys):
2604         Renamed from tlsKey*() to flsKey*().
2605
2606         (WTF::destructorsList): Deleted.
2607         (WTF::destructorsMutex): Deleted.
2608         (WTF::PlatformThreadSpecificKey::PlatformThreadSpecificKey): Deleted.
2609         (WTF::PlatformThreadSpecificKey::~PlatformThreadSpecificKey): Deleted.
2610         (WTF::PlatformThreadSpecificKey::setValue): Deleted.
2611         (WTF::PlatformThreadSpecificKey::value): Deleted.
2612         (WTF::PlatformThreadSpecificKey::callDestructor): Deleted.
2613         (WTF::tlsKeyCount): Deleted.
2614         (WTF::tlsKeys): Deleted.
2615         (WTF::threadSpecificKeyCreate): Deleted.
2616         (WTF::threadSpecificKeyDelete): Deleted.
2617         (WTF::threadSpecificSet): Deleted.
2618         (WTF::threadSpecificGet): Deleted.
2619         (WTF::ThreadSpecificThreadExit): Deleted.
2620
2621         * wtf/ThreadingWin.cpp:
2622         (WTF::wtfThreadEntryPoint): Eliminated call to ThreadSpecificThreadExit.
2623
2624 2016-04-19  Yusuke Suzuki  <utatane.tea@gmail.com>
2625
2626         [GTK] Use Generic WorkQueue instead of WorkQueueGLib
2627         https://bugs.webkit.org/show_bug.cgi?id=156721
2628
2629         Reviewed by Benjamin Poulain.
2630
2631         WorkQueueGLib includes platform-dependent part only for WorkQueue::dispatchAfter.
2632         However, its code is related to RunLoopGLib rather than WorkQueueGLib.
2633         In this patch, we move the code from WorkQueueGLib to RunLoopGLib, drop WorkQueueGLib
2634         and use WorkQueueGeneric.
2635
2636         * wtf/PlatformGTK.cmake:
2637         * wtf/RunLoop.h:
2638         * wtf/WorkQueue.h:
2639         * wtf/glib/RunLoopGLib.cpp:
2640         (WTF::DispatchAfterContext::DispatchAfterContext):
2641         (WTF::DispatchAfterContext::dispatch):
2642         (WTF::RunLoop::dispatchAfter):
2643         * wtf/glib/WorkQueueGLib.cpp: Removed.
2644         (WTF::WorkQueue::platformInitialize): Deleted.
2645         (WTF::WorkQueue::platformInvalidate): Deleted.
2646         (WTF::WorkQueue::dispatch): Deleted.
2647         (WTF::DispatchAfterContext::DispatchAfterContext): Deleted.
2648         (WTF::DispatchAfterContext::~DispatchAfterContext): Deleted.
2649         (WTF::DispatchAfterContext::dispatch): Deleted.
2650         (WTF::WorkQueue::dispatchAfter): Deleted.
2651
2652 2016-04-18  Yusuke Suzuki  <utatane.tea@gmail.com>
2653
2654         [JSCOnly] Implement RunLoop and remove glib dependency
2655         https://bugs.webkit.org/show_bug.cgi?id=155706
2656
2657         Reviewed by Michael Catanzaro.
2658
2659         Add missing RunLoop and WorkQueue platform code for JSCOnly port.
2660         The implementation does not use platform specific things. Instead, we
2661         implement them on WTF framework; using condition variables to construct
2662         the run loop and timers.
2663
2664         Since the fallback is implemented, it is not necessary for JSCOnly port
2665         to depend on GLib's RunLoop abstraction. So this patch removes its
2666         dependency. As a result, now, JSCOnly port removes dependencies except for the system ICU.
2667
2668         We clean up event loop ifdefs by introducing USE_XXX_EVENT_LOOP flags.
2669         USE(XXX_EVENT_LOOP) is exclusive to each other. So from now, we do not need to take care
2670         of the order of if-defs for the event loops. (For example, USE(GLIB) should have lead before
2671         OS(DARWIN) in WorkQueue.h for WebKitGTK on Darwin.)
2672
2673         EVENT_LOOP determination is done in Platform.h. This follows the style of WTF PLATFORM.
2674
2675         * wtf/Platform.h:
2676         * wtf/PlatformJSCOnly.cmake:
2677         * wtf/RunLoop.h:
2678         * wtf/WorkQueue.h:
2679         * wtf/generic/MainThreadGeneric.cpp: Renamed from Source/WTF/wtf/none/MainThreadNone.cpp.
2680         (WTF::initializeMainThreadPlatform):
2681         (WTF::scheduleDispatchFunctionsOnMainThread):
2682         * wtf/generic/RunLoopGeneric.cpp: Added.
2683         (WTF::RunLoop::TimerBase::ScheduledTask::create):
2684         (WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask):
2685         (WTF::RunLoop::TimerBase::ScheduledTask::fired):
2686         (WTF::RunLoop::TimerBase::ScheduledTask::scheduledTimePoint):
2687         (WTF::RunLoop::TimerBase::ScheduledTask::updateReadyTime):
2688         (WTF::RunLoop::TimerBase::ScheduledTask::EarliestSchedule::operator()):
2689         (WTF::RunLoop::TimerBase::ScheduledTask::isActive):
2690         (WTF::RunLoop::TimerBase::ScheduledTask::deactivate):
2691         (WTF::RunLoop::RunLoop):
2692         (WTF::RunLoop::~RunLoop):
2693         (WTF::RunLoop::populateTasks):
2694         (WTF::RunLoop::runImpl):
2695         (WTF::RunLoop::run):
2696         (WTF::RunLoop::iterate):
2697         (WTF::RunLoop::stop):
2698         (WTF::RunLoop::wakeUp):
2699         (WTF::RunLoop::schedule):
2700         (WTF::RunLoop::scheduleAndWakeUp):
2701         (WTF::RunLoop::dispatchAfter):
2702         (WTF::RunLoop::TimerBase::TimerBase):
2703         (WTF::RunLoop::TimerBase::~TimerBase):
2704         (WTF::RunLoop::TimerBase::start):
2705         (WTF::RunLoop::TimerBase::stop):
2706         (WTF::RunLoop::TimerBase::isActive):
2707         * wtf/generic/WorkQueueGeneric.cpp: Added.
2708         (WorkQueue::platformInitialize):
2709         (WorkQueue::platformInvalidate):
2710         (WorkQueue::dispatch):
2711         (WorkQueue::dispatchAfter):
2712         * wtf/none/MainThreadNone.cpp:
2713         (WTF::initializeMainThreadPlatform): Deleted.
2714         (WTF::scheduleDispatchFunctionsOnMainThread): Deleted.
2715         * wtf/none/RunLoopNone.cpp:
2716         (WTF::RunLoop::RunLoop): Deleted.
2717         (WTF::RunLoop::~RunLoop): Deleted.
2718         (WTF::RunLoop::run): Deleted.
2719         (WTF::RunLoop::stop): Deleted.
2720         (WTF::RunLoop::wakeUp): Deleted.
2721         (WTF::RunLoop::TimerBase::TimerBase): Deleted.
2722         (WTF::RunLoop::TimerBase::~TimerBase): Deleted.
2723         (WTF::RunLoop::TimerBase::start): Deleted.
2724         (WTF::RunLoop::TimerBase::stop): Deleted.
2725         (WTF::RunLoop::TimerBase::isActive): Deleted.
2726         * wtf/none/WorkQueueNone.cpp:
2727         (WorkQueue::platformInitialize): Deleted.
2728         (WorkQueue::platformInvalidate): Deleted.
2729         (WorkQueue::dispatch): Deleted.
2730         (WorkQueue::dispatchAfter): Deleted.
2731
2732 2016-04-18  Commit Queue  <commit-queue@webkit.org>
2733
2734         Unreviewed, rolling out r199621.
2735         https://bugs.webkit.org/show_bug.cgi?id=156708
2736
2737         made windows tests crash (Requested by alexchristensen on
2738         #webkit).
2739
2740         Reverted changeset:
2741
2742         "iTunes crashing JavaScriptCore.dll"
2743         https://bugs.webkit.org/show_bug.cgi?id=156647
2744         http://trac.webkit.org/changeset/199621
2745
2746 2016-04-15  Michael Saboff  <msaboff@apple.com>
2747
2748         iTunes crashing JavaScriptCore.dll
2749         https://bugs.webkit.org/show_bug.cgi?id=156647
2750
2751         Reviewed by Geoffrey Garen.
2752
2753         If a thread was created without using the WTF thread apis and that thread uses
2754         a JavaScript VM and that thread exits with the VM still around, JSC won't know
2755         that the thread has exited.  Currently, we use ThreadSpecificThreadExit() to
2756         clean up any thread specific keys.  Cleaning up these keys is how JSC is
2757         notified of a thread exit.  We only call ThreadSpecificThreadExit() from
2758         wtfThreadEntryPoint() when the thread entry point function returns.
2759         This mechanism was put in place for Windos because we layer the WTF::ThreadSpecific
2760         functionality on top of TLS (Thread Local Storage), but TLS doesn't have
2761         a thread exiting callback the way that pthread_create_key.
2762
2763         The fix is to change from using TLS to using FLS (Fiber Local Storage).  Although
2764         Windows allows multiple fibers per thread, WebKit is not designed to work with a
2765         multiple fibers per thread.  When ther is only one fiber per thread, FLS works just
2766         like TLS, but it has the destroy callback.
2767
2768         I restructured the Windows version of WTF::ThreadSpecific to be almost the same
2769         as the pthread version.
2770         
2771         * wtf/ThreadSpecific.h:
2772         (WTF::threadSpecificKeyCreate):
2773         (WTF::threadSpecificKeyDelete):
2774         (WTF::threadSpecificSet):
2775         (WTF::threadSpecificGet):
2776         (WTF::ThreadSpecific<T>::ThreadSpecific):
2777         (WTF::ThreadSpecific<T>::~ThreadSpecific):
2778         (WTF::ThreadSpecific<T>::get):
2779         (WTF::ThreadSpecific<T>::set):
2780         (WTF::ThreadSpecific<T>::destroy):
2781         Restructured to use FLS.  Renamed TLS* to FLS*.
2782
2783         * wtf/ThreadSpecificWin.cpp:
2784         (WTF::flsKeyCount):
2785         (WTF::flsKeys):
2786         Renamed from tlsKey*() to flsKey*().
2787
2788         (WTF::destructorsList): Deleted.
2789         (WTF::destructorsMutex): Deleted.
2790         (WTF::PlatformThreadSpecificKey::PlatformThreadSpecificKey): Deleted.
2791         (WTF::PlatformThreadSpecificKey::~PlatformThreadSpecificKey): Deleted.
2792         (WTF::PlatformThreadSpecificKey::setValue): Deleted.
2793         (WTF::PlatformThreadSpecificKey::value): Deleted.
2794         (WTF::PlatformThreadSpecificKey::callDestructor): Deleted.
2795         (WTF::tlsKeyCount): Deleted.
2796         (WTF::tlsKeys): Deleted.
2797         (WTF::threadSpecificKeyCreate): Deleted.
2798         (WTF::threadSpecificKeyDelete): Deleted.
2799         (WTF::threadSpecificSet): Deleted.
2800         (WTF::threadSpecificGet): Deleted.
2801         (WTF::ThreadSpecificThreadExit): Deleted.
2802
2803         * wtf/ThreadingWin.cpp:
2804         (WTF::wtfThreadEntryPoint): Eliminated call to ThreadSpecificThreadExit.
2805
2806 2016-04-12  Filip Pizlo  <fpizlo@apple.com>
2807
2808         PolymorphicAccess should buffer AccessCases before regenerating
2809         https://bugs.webkit.org/show_bug.cgi?id=156457
2810
2811         Reviewed by Benjamin Poulain.
2812
2813         * wtf/TinyPtrSet.h:
2814         (WTF::TinyPtrSet::add): Add a helpful comment because I had forgotten what the bool return meant.
2815
2816 2016-04-12  Tomas Popela  <tpopela@redhat.com>
2817
2818         S390X and PPC64 architectures detection is wrong
2819         https://bugs.webkit.org/show_bug.cgi?id=156337
2820
2821         Reviewed by Carlos Garcia Campos.
2822
2823         After the http://trac.webkit.org/changeset/198919 was committed
2824         it showed that the PPC64 detection is wrong as the CPU(PPC) path was
2825         activated even for PPC64. The thing is that GCC defines __ppc__
2826         even on PPC64 and not just on PPC(32). The same applies for S390X.
2827
2828         * wtf/Platform.h:
2829
2830 2016-04-05  Oliver Hunt  <oliver@apple.com>
2831
2832         Remove compile time define for SEPARATED_HEAP
2833         https://bugs.webkit.org/show_bug.cgi?id=155508
2834
2835         Reviewed by Mark Lam.
2836
2837         * wtf/FeatureDefines.h:
2838         * wtf/Platform.h:
2839
2840 2016-04-11  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
2841
2842         [CMake] Make FOLDER property INHERITED
2843         https://bugs.webkit.org/show_bug.cgi?id=156460
2844
2845         Reviewed by Brent Fulgham.
2846
2847         * CMakeLists.txt:
2848         Set FOLDER directory property
2849
2850 2016-04-08  Alex Christensen  <achristensen@webkit.org>
2851
2852         Progress towards running CMake WebKit2 on Mac
2853         https://bugs.webkit.org/show_bug.cgi?id=156426
2854
2855         Reviewed by Tim Horton.
2856
2857         * wtf/PlatformMac.cmake:
2858
2859 2016-04-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2860
2861         [JSC] Enable Concurrent JIT by default
2862         https://bugs.webkit.org/show_bug.cgi?id=156341
2863
2864         Reviewed by Filip Pizlo.
2865
2866         We enable Concurrent JIT by default when DFG JIT and JSVALUE64 are enabled.
2867         This change offers Concurrent JIT to the JSCOnly port.
2868
2869         * wtf/Platform.h:
2870
2871 2016-04-07  Joseph Pecoraro  <pecoraro@apple.com>
2872
2873         Remove ENABLE(ENABLE_ES6_CLASS_SYNTAX) guards
2874         https://bugs.webkit.org/show_bug.cgi?id=156384
2875
2876         Reviewed by Ryosuke Niwa.
2877
2878         * wtf/FeatureDefines.h:
2879
2880 2016-04-06  Filip Pizlo  <fpizlo@apple.com>
2881
2882         JSC should have a simple way of gathering IC statistics
2883         https://bugs.webkit.org/show_bug.cgi?id=156317
2884
2885         Reviewed by Benjamin Poulain.
2886         
2887         Make it easier to do relative sleeping on a condition. Previously you could do this using
2888         std::chrono. I now believe that std::chrono is just a bad decision, and I always want to
2889         use doubles instead. This makes it easier to do the right thing and use doubles.
2890
2891         * wtf/Condition.h:
2892         (WTF::ConditionBase::waitUntilMonotonicClockSeconds):
2893         (WTF::ConditionBase::waitForSeconds):
2894
2895 2016-04-06  Simon Fraser  <simon.fraser@apple.com>
2896
2897         Fix Windows build by converting clampToInteger() into a template that only
2898         takes integral types.
2899
2900         * wtf/MathExtras.h:
2901         (clampToInteger):
2902
2903 2016-04-06  Simon Fraser  <simon.fraser@apple.com>
2904
2905         Page tiles are missing when graphics acceleration is unavailable
2906         https://bugs.webkit.org/show_bug.cgi?id=156325
2907
2908         Reviewed by Tim Horton.
2909
2910         Add clampToInteger(size_t).
2911
2912         * wtf/MathExtras.h:
2913         (clampToInteger):
2914
2915 2016-04-05  Simon Fraser  <simon.fraser@apple.com>
2916
2917         Implement operator== and operator!= for Optional<>
2918         https://bugs.webkit.org/show_bug.cgi?id=156266
2919
2920         Reviewed by Anders Carlsson.
2921         
2922         Implement non-member operator== and operator!= variants for Optional<>.
2923
2924         * wtf/Optional.h:
2925         (WTF::operator==):
2926         (WTF::operator!=):
2927
2928 2016-03-19  Filip Pizlo  <fpizlo@apple.com>
2929
2930         DFG and FTL should constant-fold RegExpExec
2931         https://bugs.webkit.org/show_bug.cgi?id=155270
2932
2933         Reviewed by Saam Barati.
2934
2935         Make executeInsertions() return the amount by which the vector increased in size. This is a
2936         convenient feature that I use in DFG::InsertionSet.
2937
2938         * wtf/Insertion.h:
2939         (WTF::executeInsertions):
2940
2941 2016-04-05  Antoine Quint  <graouts@apple.com>
2942
2943         [WebGL2] Allow enabling WebGL2 with a runtime flag
2944         https://bugs.webkit.org/show_bug.cgi?id=156166
2945         <rdar://problem/25526929>
2946
2947         Removed the manual overrides of ENABLE_WEBGL2.
2948
2949         Reviewed by Dean Jackson.
2950
2951         * wtf/FeatureDefines.h:
2952
2953 2016-03-31  Konstantin Tokarev  <annulen@yandex.ru>
2954
2955         Removed leftovers of ENABLE(INSPECTOR) and ENABLE(VIEWPORT).
2956         https://bugs.webkit.org/show_bug.cgi?id=156064
2957
2958         Reviewed by Csaba Osztrogonác.
2959
2960         This ifdef guards were removed in r178820 and r147714, respectively.
2961
2962         * wtf/FeatureDefines.h:
2963
2964 2016-03-31  Brent Fulgham  <bfulgham@apple.com>
2965
2966         [WK2] Support download attribute feature
2967         https://bugs.webkit.org/show_bug.cgi?id=102914
2968         <rdar://problem/13177492>
2969
2970         Reviewed by Darin Adler.
2971
2972         * wtf/FeatureDefines.h: Turn the ENABLE_DOWNLOAD_ATTRIBUTE flag
2973         on to see what happens.
2974
2975 2016-03-30  Brian Burg  <bburg@apple.com>
2976
2977         Web Automation: Add Automation.performKeyboardInteractions
2978         https://bugs.webkit.org/show_bug.cgi?id=155990
2979         <rdar://problem/25426408>
2980
2981         Reviewed by Timothy Hatcher.
2982
2983         Add a missing NSEventType declaration.
2984
2985         * wtf/mac/AppKitCompatibilityDeclarations.h:
2986
2987 2016-03-29  Benjamin Poulain  <bpoulain@apple.com>
2988
2989         [WTF] Removing a smart pointer from HashTable issues two stores to the same location
2990         https://bugs.webkit.org/show_bug.cgi?id=155676
2991
2992         Reviewed by Darin Adler.
2993
2994         While working on the hot loop of r198376, I noticed something
2995         weird...
2996         Every time we removed a smart pointer from the hash table,
2997         the code generated was something like:
2998             Load([bucket]) -> Tmp
2999             Store(0 -> [bucket])
3000             JumpIfZero(Tmp, ->End)
3001             Call fastFree()
3002             Store(-1 -> [bucket])
3003             -> End:
3004
3005         The useless store before the branch is annoying, especially on ARM.
3006
3007         Here is what happens:
3008             1) The destructor of the smart pointer swaps its internal value with nullptr.
3009             2) Since the smart pointer is not a local in-register value, that nullptr
3010                is stored in memory because it could be observable from fastFree().
3011             3) The destructor destroy the value if not zero (or deref for RefPtr).
3012                The "if-not-zero" may or may not be eliminated depending on what
3013                is between getting the iterator and the call to remove().
3014             4) fastFree() is called.
3015             5) The deleted value is set in the bucket.
3016
3017         This patch adds custom deletion for those cases to avoid the useless
3018         store. The useless null check is still eliminated when we are lucky.
3019
3020         I went this path instead of changing the destructor of RefPtr for two reasons:
3021         -I need this to work in unique_ptr for JSC.
3022         -Nulling the memory may have security advantages in the cases where we do not immediately
3023          write over that memory again.
3024
3025         This patch removes 13kb out of x86_64 WebCore.
3026
3027         * wtf/HashTable.h:
3028         (WTF::HashTable::deleteBucket):
3029         (WTF::KeyTraits>::removeIf):
3030         * wtf/HashTraits.h:
3031         (WTF::HashTraits<RefPtr<P>>::customDeleteBucket):
3032         (WTF::hashTraitsDeleteBucket):
3033         (WTF::KeyValuePairHashTraits::customDeleteBucket):
3034         * wtf/text/AtomicStringHash.h:
3035         (WTF::HashTraits<WTF::AtomicString>::isEmptyValue):
3036         (WTF::HashTraits<WTF::AtomicString>::customDeleteBucket):
3037         * wtf/text/StringHash.h:
3038         (WTF::HashTraits<String>::customDeleteBucket):
3039
3040 2016-03-28  Brian Burg  <bburg@apple.com>
3041
3042         Web Automation: implement Automation.performMouseInteraction
3043         https://bugs.webkit.org/show_bug.cgi?id=155606
3044         <rdar://problem/25227576>
3045
3046         Reviewed by Timothy Hatcher.
3047
3048         * wtf/mac/AppKitCompatibilityDeclarations.h: Add missing some NSEventTypes.
3049
3050 2016-03-29  Yusuke Suzuki  <utatane.tea@gmail.com>
3051
3052         REGRESSION(r192914): 10% regression on Sunspider's date-format-tofte
3053         https://bugs.webkit.org/show_bug.cgi?id=155559
3054
3055         Reviewed by Saam Barati.
3056
3057         Add HashTable::inlineLookup and HashMap::fastGet.
3058
3059         * wtf/HashMap.h:
3060         * wtf/HashTable.h:
3061
3062 2016-03-25  Alex Christensen  <achristensen@webkit.org>
3063
3064         Add a compile time flag for using QTKit
3065         https://bugs.webkit.org/show_bug.cgi?id=155868
3066
3067         Reviewed by Dan Bates.
3068
3069         * wtf/Platform.h:
3070
3071 2016-03-24  Alex Christensen  <achristensen@webkit.org>
3072
3073         Fix iOS9 performance regression after r197572
3074         https://bugs.webkit.org/show_bug.cgi?id=155845
3075         <rdar://problem/25144924>
3076
3077         Reviewed by Chris Dumez.
3078
3079         * wtf/Platform.h:
3080         Use CFURLConnection instead of NSURLConnection on internal iOS9 builds.
3081
3082 2016-03-23  Saam Barati  <sbarati@apple.com>
3083
3084         SmallPtrSet leaks memory in its move assignment operator when !this->isSmall()
3085         https://bugs.webkit.org/show_bug.cgi?id=155701
3086
3087         Reviewed by Darin Adler.
3088
3089         * wtf/SmallPtrSet.h:
3090         (WTF::SmallPtrSet::SmallPtrSet):
3091         (WTF::SmallPtrSet::operator=):
3092
3093 2016-03-22  Per Arne Vollan  <peavo@outlook.com>
3094
3095         [Win] [64-bit] Remove MSVC 2013 FMA3 Bug Workaround
3096         https://bugs.webkit.org/show_bug.cgi?id=141499
3097
3098         Reviewed by Brent Fulgham.
3099
3100         As we have moved on to VS2015, this workaround is no longer needed.
3101
3102         * wtf/PlatformWin.cmake:
3103         * wtf/win/WTFDLL.cpp: Removed.
3104
3105 2016-03-20  Dan Bernstein  <mitz@apple.com>
3106
3107         [Mac] Determine TARGET_MAC_OS_X_VERSION_MAJOR from MACOSX_DEPLOYMENT_TARGET rather than from MAC_OS_X_VERSION_MAJOR
3108         https://bugs.webkit.org/show_bug.cgi?id=155707
3109         <rdar://problem/24980691>
3110
3111         Reviewed by Darin Adler.
3112
3113         * Configurations/Base.xcconfig: Set TARGET_MAC_OS_X_VERSION_MAJOR based on the last
3114           component of MACOSX_DEPLOYMENT_TARGET.
3115         * Configurations/DebugRelease.xcconfig: For engineering builds, preserve the behavior of
3116           TARGET_MAC_OS_X_VERSION_MAJOR being the host’s OS version.
3117
3118 2016-03-20  Dan Bernstein  <mitz@apple.com>
3119
3120         Update build settings
3121
3122         Rubber-stamped by Andy Estes.
3123
3124         * Configurations/DebugRelease.xcconfig:
3125
3126 2016-03-17  Benjamin Poulain  <bpoulain@apple.com>
3127
3128         [JSC] Make CSE's ImpureData faster when dealing with large blocks
3129         https://bugs.webkit.org/show_bug.cgi?id=155594
3130
3131         Reviewed by Filip Pizlo.
3132
3133         * wtf/HashSet.h:
3134         (WTF::V>::removeIf):
3135
3136 2016-03-17  Saam barati  <sbarati@apple.com>
3137
3138         Implement SmallPtrSet and integrate it into the Parser
3139         https://bugs.webkit.org/show_bug.cgi?id=155552
3140
3141         Reviewed by Filip Pizlo.
3142
3143         This patch implements the SmallPtrSet data struture.
3144         Inspired by the implementation in llvm:
3145         http://llvm.org/docs/doxygen/html/SmallPtrSet_8h_source.html
3146
3147         The data structure uses an inline array for storage up until
3148         a fixed limit (8 entries in our implementation). If that storage
3149         fills up, we fall back to a simple hash table implementation.
3150         Crucially, this implementation doesn't support the remove
3151         operation. This is on purpose. The hash table will only ever
3152         grow.
3153
3154         Also, the implementation allows for it to be memcopied around.
3155         I.e, we can put SmallPtrSet inside a Vector and allow that
3156         Vector to use memcpy as its move operation (of course this
3157         is only valid if the SmallPtrSet in the old memory doesn't have 
3158         its destructor called unless it is set back to its initial state.)
3159
3160         For now, SmallPtrSet only supports pointer types that are trivially
3161         destructible. It's probably not too difficult to extend this to
3162         smart pointers, but it's not part of this original implementation.
3163
3164         I've also implemented a pure forwarding varargs constructAndAppend
3165         method on Vector. This allows you to do:
3166         Vector<T> v;
3167         v.constructAndAppend(a1, a2, ...)
3168         as long as T has a constructor that accepts arguments (a1, a2, ...).
3169
3170         * WTF.xcodeproj/project.pbxproj:
3171         * wtf/CMakeLists.txt:
3172         * wtf/SmallPtrSet.h: Added.
3173         (WTF::SmallPtrSet::SmallPtrSet):
3174         (WTF::SmallPtrSet::operator=):
3175         (WTF::SmallPtrSet::~SmallPtrSet):
3176         (WTF::SmallPtrSet::add):
3177         (WTF::SmallPtrSet::contains):
3178         (WTF::SmallPtrSet::iterator::operator++):
3179         (WTF::SmallPtrSet::iterator::operator*):
3180         (WTF::SmallPtrSet::iterator::operator==):
3181         (WTF::SmallPtrSet::iterator::operator!=):
3182         (WTF::SmallPtrSet::begin):
3183         (WTF::SmallPtrSet::end):
3184         (WTF::SmallPtrSet::size):
3185         (WTF::SmallPtrSet::emptyValue):
3186         (WTF::SmallPtrSet::isValidEntry):
3187         (WTF::SmallPtrSet::isSmall):
3188         (WTF::SmallPtrSet::initialize):
3189         (WTF::SmallPtrSet::grow):
3190         (WTF::SmallPtrSet::bucket):
3191         * wtf/Vector.h:
3192         (WTF::Vector::append):
3193         (WTF::Vector::uncheckedAppend):
3194         (WTF::minCapacity>::append):
3195         (WTF::minCapacity>::constructAndAppend):
3196         (WTF::minCapacity>::appendSlowCase):
3197         (WTF::minCapacity>::constructAndAppendSlowCase):
3198
3199 2016-03-16  Filip Pizlo  <fpizlo@apple.com>
3200
3201         Replace all of the various non-working and non-compiling sampling profiler hacks with a single super hack
3202         https://bugs.webkit.org/show_bug.cgi?id=155561
3203
3204         Reviewed by Saam Barati.
3205
3206         This patch replaces all of our various ad hoc profiling hacks with a single ad hoc profiling hack.
3207         That needs to be able to sleep a thread, so I added a portable way to do it.
3208
3209         This also removes a bunch of ENABLE flags for all of the old non-working hacks.
3210
3211         * wtf/CurrentTime.cpp:
3212         (WTF::currentCPUTime):
3213         (WTF::sleep):
3214         * wtf/CurrentTime.h:
3215         (WTF::sleepMS):
3216         * wtf/Platform.h:
3217
3218 2016-03-17  Chris Dumez  <cdumez@apple.com>
3219
3220         Set the WebContent process's main thread QoS to USER-INTERACTIVE
3221         https://bugs.webkit.org/show_bug.cgi?id=155595
3222         <rdar://problem/22534965>
3223
3224         Reviewed by Antti Koivisto.
3225
3226         Add a relativePriority parameter to setCurrentThreadIsUser*() so that
3227         we can do more fine-grained prioritization of threads that have the
3228         same QoS.
3229
3230         * wtf/Threading.cpp:
3231         (WTF::setCurrentThreadIsUserInteractive):
3232         (WTF::setCurrentThreadIsUserInitiated):
3233         (WTF::createThread): Deleted.
3234         * wtf/Threading.h:
3235
3236 2016-03-17  Filip Pizlo  <fpizlo@apple.com>
3237
3238         Silence leaks in ParkingLot
3239         https://bugs.webkit.org/show_bug.cgi?id=155510
3240
3241         Reviewed by Alexey Proskuryakov.
3242
3243         ParkingLot has a concurrent hashtable that it reallocates on demand. It will not reallocate
3244         it in steady state. The hashtable is sized to accommodate the high watermark of the number
3245         of active threads - so long as the program doesn't just keep starting an unbounded number
3246         of threads that are all active, the hashtable will stop resizing. Each resize operation is
3247         designed to stay out of the way of the data-access-parallel normal path, in which two
3248         threads operating on different lock addresses don't have to synchronize. To do this, it
3249         simply drops the old hashtable without deleting it, so that threads that were still using
3250         it don't crash. They will realize that they have the wrong hashtable before doing anything
3251         bad, but we don't have a way of proving when all of those threads are no longer going to
3252         read from the old hashtables. So, we just leak them.
3253
3254         This is a bounded leak, since the hashtable resizes exponentially. Thus the total memory
3255         utilization of all hashtables, including the leaked ones, converges to a linear function of
3256         the current hashtable's size (it's 2 * size of current hashtable).
3257
3258         But this leak is a problem for leaks tools, which will always report this leak. This is not
3259         useful. It's better to silence the leak. That's what this patch does by ensuring that all
3260         hashtables, including leaked ones, end up in a global vector. This is perf-neutral.
3261
3262         This requires making a StaticWordLock variant of WordLock. That's probably the biggest part
3263         of this change.
3264
3265         * wtf/ParkingLot.cpp:
3266         * wtf/WordLock.cpp:
3267         (WTF::WordLockBase::lockSlow):
3268         (WTF::WordLockBase::unlockSlow):
3269         (WTF::WordLock::lockSlow): Deleted.
3270         (WTF::WordLock::unlockSlow): Deleted.
3271         * wtf/WordLock.h:
3272         (WTF::WordLockBase::lock):
3273         (WTF::WordLockBase::isLocked):
3274         (WTF::WordLock::WordLock):
3275         (WTF::WordLock::lock): Deleted.
3276         (WTF::WordLock::isLocked): Deleted.
3277
3278 2016-03-16  Chris Dumez  <cdumez@apple.com>
3279
3280         Unreviewed, rolling out r198235, r198240, r198241, and
3281         r198252.
3282
3283         Causing crashes on ARM
3284
3285         Reverted changesets:
3286
3287         "Remove compile time define for SEPARATED_HEAP"
3288         https://bugs.webkit.org/show_bug.cgi?id=155508
3289         http://trac.webkit.org/changeset/198235
3290
3291         "Gardening: build fix after r198235."
3292         http://trac.webkit.org/changeset/198240
3293
3294         "Build fix."
3295         http://trac.webkit.org/changeset/198241
3296
3297         "Rename performJITMemcpy to something more inline with our
3298         normal webkit function names"
3299         https://bugs.webkit.org/show_bug.cgi?id=155525
3300         http://trac.webkit.org/changeset/198252
3301
3302 2016-03-15  Oliver Hunt  <oliver@apple.com>
3303
3304         Remove compile time define for SEPARATED_HEAP
3305         https://bugs.webkit.org/show_bug.cgi?id=155508
3306
3307         Reviewed by Mark Lam.
3308
3309         Remove the feature define.
3310
3311         * wtf/FeatureDefines.h:
3312         * wtf/Platform.h:
3313
3314 2016-03-14  Mark Lam  <mark.lam@apple.com>
3315
3316         Need to distinguish between Symbol() and Symbol("").
3317         https://bugs.webkit.org/show_bug.cgi?id=155438
3318
3319         Reviewed by Saam Barati.
3320
3321         While toString of both Symbol() and Symbol("") yields "Symbol()", Function.name
3322         should yield "" and "[]" respectively.  Hence, we need to tell between the two.
3323         This functionality will be needed later in https://bugs.webkit.org/show_bug.cgi?id=155437.
3324
3325         We achieve this by creating another singleton instance like the empty StringImpl
3326         as the null StringImpl.  isNullSymbol() tests if the Stringimpl instance is a
3327         symbol, and its substring is the null() singleton.
3328
3329         * wtf/text/StringImpl.cpp:
3330         (WTF::StringImpl::createSymbol):
3331         (WTF::StringImpl::createNullSymbol):
3332         (WTF::StringImpl::containsOnlyWhitespace):
3333         (WTF::StringImpl::createSymbolEmpty): Deleted.
3334         * wtf/text/StringImpl.h:
3335         (WTF::StringImpl::tryCreateUninitialized):
3336         (WTF::StringImpl::stringKind):
3337         (WTF::StringImpl::isSymbol):
3338         (WTF::StringImpl::isAtomic):
3339         (WTF::StringImpl::isNullSymbol):
3340         * wtf/text/StringStatics.cpp:
3341         (WTF::StringImpl::null):
3342
3343 2016-03-13  Joseph Pecoraro  <pecoraro@apple.com>
3344
3345         Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
3346         https://bugs.webkit.org/show_bug.cgi?id=155417
3347
3348         Reviewed by Yusuke Suzuki.
3349
3350         * wtf/FeatureDefines.h:
3351
3352 2016-03-13  Konstantin Tokarev  <annulen@yandex.ru>
3353
3354         Added new port JSCOnly.
3355         https://bugs.webkit.org/show_bug.cgi?id=154512
3356
3357         Reviewed by Michael Catanzaro.
3358
3359         This port allows to build JavaScriptCore engine with minimal
3360         dependencies.
3361
3362         * wtf/PlatformJSCOnly.cmake: Added.
3363         * wtf/none/MainThreadNone.cpp: Added.
3364         * wtf/none/RunLoopNone.cpp: Added.
3365         * wtf/none/WorkQueueNone.cpp: Added.
3366
3367 2016-03-13  David Kilzer  <ddkilzer@apple.com>
3368
3369         REGRESSION (r198079): Windows build broke because of "%PRId64" format specifier
3370
3371         This fixes the following build failure in WebCore for Windows:
3372             C:\Source\WebCore\page\DOMTimer.cpp(396): error C2146: syntax error: missing ')' before identifier 'PRId64' [C:\WebKitBuild\Debug\Source\WebCore\WebCore.vcxproj]
3373             C:\Source\WebCore\page\DOMTimer.cpp(399): error C2146: syntax error: missing ')' before identifier 'PRId64' [C:\WebKitBuild\Debug\Source\WebCore\WebCore.vcxproj]
3374
3375         * wtf/StdLibExtras.h: Define "PRId64" for Windows here so it may
3376         be shared.  This should fix DOMTimer.cpp after r198079 since it
3377         already includes StdLibExtras.h.
3378
3379 2016-03-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3380
3381         WTF should have a similar function as equalLettersIgnoringASCIICase to match beginning of strings
3382         https://bugs.webkit.org/show_bug.cgi?id=153419
3383
3384         Reviewed by Darin Adler.
3385
3386         Introducing startsWithLettersIgnoringASCIICase, to check the beginning of a string.
3387         Moving some code from WTF::equalLettersIgnoringASCIICaseCommonWithoutLength in
3388         WTF::hasPrefixWithLettersIgnoringASCIICaseCommon to enable reuse in
3389         WTF::startsWithLettersIgnoringASCIICaseCommon.
3390
3391         * wtf/text/StringCommon.h:
3392         (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon):
3393         (WTF::equalLettersIgnoringASCIICaseCommonWithoutLength):
3394         (WTF::startsWithLettersIgnoringASCIICaseCommonWithoutLength):
3395         (WTF::startsWithLettersIgnoringASCIICaseCommon):
3396         * wtf/text/StringImpl.h:
3397         (WTF::startsWithLettersIgnoringASCIICase):
3398         * wtf/text/WTFString.h:
3399         (WTF::startsWithLettersIgnoringASCIICase):
3400
3401 2016-03-10  Frederic Wang  <fwang@igalia.com>
3402
3403         [GTK] Add support for WOFF2
3404         https://bugs.webkit.org/show_bug.cgi?id=152616
3405
3406         Reviewed by Carlos Garcia Campos.
3407
3408         * wtf/FeatureDefines.h: Enable USE_WOFF2 flag on GTK.
3409
3410 2016-03-09  Ryosuke Niwa  <rniwa@webkit.org>
3411
3412         Add runtime flags for shadow DOM and custom elements
3413         https://bugs.webkit.org/show_bug.cgi?id=155213
3414
3415         Reviewed by Dean Jackson.
3416
3417         Removed the manual overrides of ENABLE_SHADOW_DOM and ENABLE_CUSTOM_ELEMENTS as they were
3418         making --no-shadow-dom and --no-custom-elements flags on build-webkit useless.
3419
3420         * wtf/FeatureDefines.h:
3421
3422 2016-03-09  Keith Rollin  <krollin@apple.com>
3423
3424         Add state dumping facility
3425         https://bugs.webkit.org/show_bug.cgi?id=154930
3426         <rdar://problem/24939135>
3427
3428         Reviewed by Anders Carlsson.
3429
3430         Add an OS_STATE flag to control the inclusion of process state dumping
3431         functionality.
3432
3433         * wtf/Platform.h:
3434
3435 2016-03-09  Oliver Hunt  <oliver@apple.com>
3436
3437         Fix old iOS
3438
3439         * wtf/Platform.h:
3440
3441 2016-03-08  Filip Pizlo  <fpizlo@apple.com>
3442
3443         Remove failing assertion. There are strings that claim to be atomic but that the
3444         compiler thread can totally deal with, like the empty string.
3445
3446         Rubber stamped by Mark Lam.
3447
3448         * wtf/text/StringImpl.h:
3449         (WTF::StringImpl::ref):
3450         (WTF::StringImpl::deref):
3451
3452 2016-03-08  Filip Pizlo  <fpizlo@apple.com>
3453
3454         DFG should be able to constant-fold strings
3455         https://bugs.webkit.org/show_bug.cgi?id=155200
3456
3457         Reviewed by Geoffrey Garen.
3458
3459         Also disable assertions about reference counting strings on the JIT thread. We will do
3460         that now and it's OK.
3461
3462         * wtf/text/StringImpl.h:
3463         (WTF::StringImpl::ref):
3464         (WTF::StringImpl::deref):
3465
3466 2016-03-08  Anders Carlsson  <andersca@apple.com>
3467
3468         Fix AppKitCompatibilityDeclarations build.
3469
3470         * wtf/mac/AppKitCompatibilityDeclarations.h:
3471         Remove duplicate declarations, conditionally define NSTextAlignment and
3472         add a NSWindowStyleMask typedef.
3473
3474 2016-03-08  Oliver Hunt  <oliver@apple.com>
3475
3476         Start moving to separated writable and executable mappings in the JIT
3477         https://bugs.webkit.org/show_bug.cgi?id=155178
3478
3479         Reviewed by Fil Pizlo.
3480
3481         Update feature defines.
3482
3483         * wtf/FeatureDefines.h:
3484         * wtf/Platform.h: ARM64 for now.
3485
3486 2016-03-08  Anders Carlsson  <andersca@apple.com>
3487
3488         Add AppKit compatibility header
3489         https://bugs.webkit.org/show_bug.cgi?id=155202
3490
3491         Reviewed by Beth Dakin.
3492
3493         * WTF.xcodeproj/project.pbxproj:
3494         * wtf/mac/AppKitCompatibilityDeclarations.h: Added.
3495
3496 2016-03-08  Commit Queue  <commit-queue@webkit.org>
3497
3498         Unreviewed, rolling out r197793 and r197799.
3499         https://bugs.webkit.org/show_bug.cgi?id=155195
3500
3501         something weird happened while landing this and everything
3502         broke (Requested by olliej on #webkit).
3503
3504         Reverted changesets:
3505
3506         "Start moving to separated writable and executable mappings in
3507         the JIT"
3508         https://bugs.webkit.org/show_bug.cgi?id=155178
3509         http://trac.webkit.org/changeset/197793
3510
3511         "arm64 build fix after r197793."
3512         http://trac.webkit.org/changeset/197799
3513
3514 2016-03-08  Oliver Hunt  <oliver@apple.com>
3515
3516         Start moving to separated writable and executable mappings in the JIT
3517         https://bugs.webkit.org/show_bug.cgi?id=155178
3518
3519         Reviewed by Filip Pizlo.
3520
3521         Update feature defines.
3522
3523         * wtf/FeatureDefines.h:
3524         * wtf/Platform.h: ARM64 for now.
3525
3526 2016-03-08  Daniel Bates  <dabates@apple.com>
3527
3528         Support iterating over an OptionSet and checking if it is empty
3529         https://bugs.webkit.org/show_bug.cgi?id=154941
3530         <rdar://problem/24964187>
3531
3532         Reviewed by Darin Adler.
3533
3534         Implements support for iterating over the enumerators in an OptionSet as well as
3535         determining if the set is empty.
3536
3537         Iterating over an OptionSet is in Big Theta(N) where N is the number of items in
3538         the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented
3539         by the bitwise OR-ing of all enumerators in the set.
3540
3541         * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant -
3542         the enumerators must be positive powers of two.
3543         (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator.
3544         (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set.
3545         (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator.
3546         (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator.
3547         (WTF::OptionSet::Iterator::Iterator): Added.
3548         (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow
3549         instantiation with a raw value of 0.
3550         (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value
3551         is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED).
3552         (WTF::OptionSet::isEmpty): Returns whether the set is empty.
3553         (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set.
3554         (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set.
3555
3556 2016-03-07  Keith Rollin  <krollin@apple.com>
3557
3558         Enhance logging: Use "always on" macros
3559         https://bugs.webkit.org/show_bug.cgi?id=154499
3560         <rdar://problem/24757730>
3561
3562         Reviewed by Chris Dumez.
3563
3564         Update LOG_ALWAYS and LOG_ALWAYS_ERROR macros to take an expression to
3565         be evaluated. If the expression evaluates to True, the associated
3566         message is logged. This facility is used to prevent logging from being
3567         performed in private sessions, but it could be extended to prevent
3568         logging under other circumstances as well.
3569
3570         * wtf/Assertions.h:
3571
3572 2016-03-04  Alex Christensen  <achristensen@webkit.org>
3573
3574         Remove vcxproj build system
3575         https://bugs.webkit.org/show_bug.cgi?id=154388
3576
3577         Rubber-stamped by Brent Fulgham.
3578
3579         * WTF.vcxproj/WTF.submit.sln: Removed.
3580         * WTF.vcxproj/WTF.vcxproj: Removed.
3581         * WTF.vcxproj/WTF.vcxproj.filters: Removed.
3582         * WTF.vcxproj/WTFCFLite.props: Removed.
3583         * WTF.vcxproj/WTFCommon.props: Removed.
3584         * WTF.vcxproj/WTFCoreFoundation.props: Removed.
3585         * WTF.vcxproj/WTFDebug.props: Removed.
3586         * WTF.vcxproj/WTFDebugWinCairo.props: Removed.
3587         * WTF.vcxproj/WTFGenerated.make: Removed.
3588         * WTF.vcxproj/WTFGenerated.vcxproj: Removed.
3589         * WTF.vcxpr