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