1 2016-04-19 Filip Pizlo <fpizlo@apple.com>
3 Clean up the ParkingLot uparking API a bit
4 https://bugs.webkit.org/show_bug.cgi?id=156746
6 Reviewed by Saam Barati and Geoffrey Garen.
8 Previously, unparkOne() would either return a boolean to tell you if there are any more threads on
9 the queue or it would pass your callback a pair of booleans - one to tell if a thread was unparked
10 and another to tell if there are any more threads. This was an annoying inconsistency. What if you
11 wanted to know if unparkOne() unparked a thread but you don't care to use callbacks?
13 This fixes unparkOne() to use a struct called UnparkResult for both of its variants. This makes the
16 * wtf/Atomics.h: Add some more atomic ops.
17 (WTF::Atomic::exchangeAndAdd):
18 (WTF::Atomic::exchange):
19 * wtf/Condition.h: Change calls to unparkOne().
20 (WTF::ConditionBase::notifyOne):
21 * wtf/Lock.cpp: Change calls to unparkOne().
22 (WTF::LockBase::unlockSlow):
24 (WTF::ParkingLot::parkConditionally):
25 (WTF::ParkingLot::unparkOne):
26 * wtf/ParkingLot.h: Switch to using ScopedLambda and introduce UnparkResult.
28 2016-04-19 Commit Queue <commit-queue@webkit.org>
30 Unreviewed, rolling out r199726.
31 https://bugs.webkit.org/show_bug.cgi?id=156748
33 WebKit tests crash on Windows 32 (Requested by msaboff on
38 "iTunes crashing JavaScriptCore.dll"
39 https://bugs.webkit.org/show_bug.cgi?id=156647
40 http://trac.webkit.org/changeset/199726
42 2016-04-19 Michael Saboff <msaboff@apple.com>
44 iTunes crashing JavaScriptCore.dll
45 https://bugs.webkit.org/show_bug.cgi?id=156647
47 Reviewed by Saam Barati.
49 If a thread was created without using the WTF thread apis and that thread uses
50 a JavaScript VM and that thread exits with the VM still around, JSC won't know
51 that the thread has exited. Currently, we use ThreadSpecificThreadExit() to
52 clean up any thread specific keys. Cleaning up these keys is how JSC is
53 notified of a thread exit. We only call ThreadSpecificThreadExit() from
54 wtfThreadEntryPoint() when the thread entry point function returns.
55 This mechanism was put in place for Windows because we layer the WTF::ThreadSpecific
56 functionality on top of TLS (Thread Local Storage), but TLS doesn't have
57 a thread exiting callback the way that pthread_create_key.
59 The fix is to change from using TLS to using FLS (Fiber Local Storage). Although
60 Windows allows multiple fibers per thread, WebKit is not designed to work with a
61 multiple fibers per thread. When there is only one fiber per thread, FLS works just
62 like TLS, but it has the destroy callback.
64 I restructured the Windows version of WTF::ThreadSpecific to be almost the same
65 as the pthread version.
67 * wtf/ThreadSpecific.h:
68 (WTF::threadSpecificKeyCreate):
69 (WTF::threadSpecificKeyDelete):
70 (WTF::threadSpecificSet):
71 (WTF::threadSpecificGet):
72 (WTF::ThreadSpecific<T>::ThreadSpecific):
73 (WTF::ThreadSpecific<T>::~ThreadSpecific):
74 (WTF::ThreadSpecific<T>::get):
75 (WTF::ThreadSpecific<T>::set):
76 (WTF::ThreadSpecific<T>::destroy):
77 Restructured to use FLS. Renamed TLS* to FLS*.
79 * wtf/ThreadSpecificWin.cpp:
82 Renamed from tlsKey*() to flsKey*().
84 (WTF::destructorsList): Deleted.
85 (WTF::destructorsMutex): Deleted.
86 (WTF::PlatformThreadSpecificKey::PlatformThreadSpecificKey): Deleted.
87 (WTF::PlatformThreadSpecificKey::~PlatformThreadSpecificKey): Deleted.
88 (WTF::PlatformThreadSpecificKey::setValue): Deleted.
89 (WTF::PlatformThreadSpecificKey::value): Deleted.
90 (WTF::PlatformThreadSpecificKey::callDestructor): Deleted.
91 (WTF::tlsKeyCount): Deleted.
92 (WTF::tlsKeys): Deleted.
93 (WTF::threadSpecificKeyCreate): Deleted.
94 (WTF::threadSpecificKeyDelete): Deleted.
95 (WTF::threadSpecificSet): Deleted.
96 (WTF::threadSpecificGet): Deleted.
97 (WTF::ThreadSpecificThreadExit): Deleted.
99 * wtf/ThreadingWin.cpp:
100 (WTF::wtfThreadEntryPoint): Eliminated call to ThreadSpecificThreadExit.
102 2016-04-19 Yusuke Suzuki <utatane.tea@gmail.com>
104 [GTK] Use Generic WorkQueue instead of WorkQueueGLib
105 https://bugs.webkit.org/show_bug.cgi?id=156721
107 Reviewed by Benjamin Poulain.
109 WorkQueueGLib includes platform-dependent part only for WorkQueue::dispatchAfter.
110 However, its code is related to RunLoopGLib rather than WorkQueueGLib.
111 In this patch, we move the code from WorkQueueGLib to RunLoopGLib, drop WorkQueueGLib
112 and use WorkQueueGeneric.
114 * wtf/PlatformGTK.cmake:
117 * wtf/glib/RunLoopGLib.cpp:
118 (WTF::DispatchAfterContext::DispatchAfterContext):
119 (WTF::DispatchAfterContext::dispatch):
120 (WTF::RunLoop::dispatchAfter):
121 * wtf/glib/WorkQueueGLib.cpp: Removed.
122 (WTF::WorkQueue::platformInitialize): Deleted.
123 (WTF::WorkQueue::platformInvalidate): Deleted.
124 (WTF::WorkQueue::dispatch): Deleted.
125 (WTF::DispatchAfterContext::DispatchAfterContext): Deleted.
126 (WTF::DispatchAfterContext::~DispatchAfterContext): Deleted.
127 (WTF::DispatchAfterContext::dispatch): Deleted.
128 (WTF::WorkQueue::dispatchAfter): Deleted.
130 2016-04-18 Yusuke Suzuki <utatane.tea@gmail.com>
132 [JSCOnly] Implement RunLoop and remove glib dependency
133 https://bugs.webkit.org/show_bug.cgi?id=155706
135 Reviewed by Michael Catanzaro.
137 Add missing RunLoop and WorkQueue platform code for JSCOnly port.
138 The implementation does not use platform specific things. Instead, we
139 implement them on WTF framework; using condition variables to construct
140 the run loop and timers.
142 Since the fallback is implemented, it is not necessary for JSCOnly port
143 to depend on GLib's RunLoop abstraction. So this patch removes its
144 dependency. As a result, now, JSCOnly port removes dependencies except for the system ICU.
146 We clean up event loop ifdefs by introducing USE_XXX_EVENT_LOOP flags.
147 USE(XXX_EVENT_LOOP) is exclusive to each other. So from now, we do not need to take care
148 of the order of if-defs for the event loops. (For example, USE(GLIB) should have lead before
149 OS(DARWIN) in WorkQueue.h for WebKitGTK on Darwin.)
151 EVENT_LOOP determination is done in Platform.h. This follows the style of WTF PLATFORM.
154 * wtf/PlatformJSCOnly.cmake:
157 * wtf/generic/MainThreadGeneric.cpp: Renamed from Source/WTF/wtf/none/MainThreadNone.cpp.
158 (WTF::initializeMainThreadPlatform):
159 (WTF::scheduleDispatchFunctionsOnMainThread):
160 * wtf/generic/RunLoopGeneric.cpp: Added.
161 (WTF::RunLoop::TimerBase::ScheduledTask::create):
162 (WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask):
163 (WTF::RunLoop::TimerBase::ScheduledTask::fired):
164 (WTF::RunLoop::TimerBase::ScheduledTask::scheduledTimePoint):
165 (WTF::RunLoop::TimerBase::ScheduledTask::updateReadyTime):
166 (WTF::RunLoop::TimerBase::ScheduledTask::EarliestSchedule::operator()):
167 (WTF::RunLoop::TimerBase::ScheduledTask::isActive):
168 (WTF::RunLoop::TimerBase::ScheduledTask::deactivate):
169 (WTF::RunLoop::RunLoop):
170 (WTF::RunLoop::~RunLoop):
171 (WTF::RunLoop::populateTasks):
172 (WTF::RunLoop::runImpl):
174 (WTF::RunLoop::iterate):
175 (WTF::RunLoop::stop):
176 (WTF::RunLoop::wakeUp):
177 (WTF::RunLoop::schedule):
178 (WTF::RunLoop::scheduleAndWakeUp):
179 (WTF::RunLoop::dispatchAfter):
180 (WTF::RunLoop::TimerBase::TimerBase):
181 (WTF::RunLoop::TimerBase::~TimerBase):
182 (WTF::RunLoop::TimerBase::start):
183 (WTF::RunLoop::TimerBase::stop):
184 (WTF::RunLoop::TimerBase::isActive):
185 * wtf/generic/WorkQueueGeneric.cpp: Added.
186 (WorkQueue::platformInitialize):
187 (WorkQueue::platformInvalidate):
188 (WorkQueue::dispatch):
189 (WorkQueue::dispatchAfter):
190 * wtf/none/MainThreadNone.cpp:
191 (WTF::initializeMainThreadPlatform): Deleted.
192 (WTF::scheduleDispatchFunctionsOnMainThread): Deleted.
193 * wtf/none/RunLoopNone.cpp:
194 (WTF::RunLoop::RunLoop): Deleted.
195 (WTF::RunLoop::~RunLoop): Deleted.
196 (WTF::RunLoop::run): Deleted.
197 (WTF::RunLoop::stop): Deleted.
198 (WTF::RunLoop::wakeUp): Deleted.
199 (WTF::RunLoop::TimerBase::TimerBase): Deleted.
200 (WTF::RunLoop::TimerBase::~TimerBase): Deleted.
201 (WTF::RunLoop::TimerBase::start): Deleted.
202 (WTF::RunLoop::TimerBase::stop): Deleted.
203 (WTF::RunLoop::TimerBase::isActive): Deleted.
204 * wtf/none/WorkQueueNone.cpp:
205 (WorkQueue::platformInitialize): Deleted.
206 (WorkQueue::platformInvalidate): Deleted.
207 (WorkQueue::dispatch): Deleted.
208 (WorkQueue::dispatchAfter): Deleted.
210 2016-04-18 Commit Queue <commit-queue@webkit.org>
212 Unreviewed, rolling out r199621.
213 https://bugs.webkit.org/show_bug.cgi?id=156708
215 made windows tests crash (Requested by alexchristensen on
220 "iTunes crashing JavaScriptCore.dll"
221 https://bugs.webkit.org/show_bug.cgi?id=156647
222 http://trac.webkit.org/changeset/199621
224 2016-04-15 Michael Saboff <msaboff@apple.com>
226 iTunes crashing JavaScriptCore.dll
227 https://bugs.webkit.org/show_bug.cgi?id=156647
229 Reviewed by Geoffrey Garen.
231 If a thread was created without using the WTF thread apis and that thread uses
232 a JavaScript VM and that thread exits with the VM still around, JSC won't know
233 that the thread has exited. Currently, we use ThreadSpecificThreadExit() to
234 clean up any thread specific keys. Cleaning up these keys is how JSC is
235 notified of a thread exit. We only call ThreadSpecificThreadExit() from
236 wtfThreadEntryPoint() when the thread entry point function returns.
237 This mechanism was put in place for Windos because we layer the WTF::ThreadSpecific
238 functionality on top of TLS (Thread Local Storage), but TLS doesn't have
239 a thread exiting callback the way that pthread_create_key.
241 The fix is to change from using TLS to using FLS (Fiber Local Storage). Although
242 Windows allows multiple fibers per thread, WebKit is not designed to work with a
243 multiple fibers per thread. When ther is only one fiber per thread, FLS works just
244 like TLS, but it has the destroy callback.
246 I restructured the Windows version of WTF::ThreadSpecific to be almost the same
247 as the pthread version.
249 * wtf/ThreadSpecific.h:
250 (WTF::threadSpecificKeyCreate):
251 (WTF::threadSpecificKeyDelete):
252 (WTF::threadSpecificSet):
253 (WTF::threadSpecificGet):
254 (WTF::ThreadSpecific<T>::ThreadSpecific):
255 (WTF::ThreadSpecific<T>::~ThreadSpecific):
256 (WTF::ThreadSpecific<T>::get):
257 (WTF::ThreadSpecific<T>::set):
258 (WTF::ThreadSpecific<T>::destroy):
259 Restructured to use FLS. Renamed TLS* to FLS*.
261 * wtf/ThreadSpecificWin.cpp:
264 Renamed from tlsKey*() to flsKey*().
266 (WTF::destructorsList): Deleted.
267 (WTF::destructorsMutex): Deleted.
268 (WTF::PlatformThreadSpecificKey::PlatformThreadSpecificKey): Deleted.
269 (WTF::PlatformThreadSpecificKey::~PlatformThreadSpecificKey): Deleted.
270 (WTF::PlatformThreadSpecificKey::setValue): Deleted.
271 (WTF::PlatformThreadSpecificKey::value): Deleted.
272 (WTF::PlatformThreadSpecificKey::callDestructor): Deleted.
273 (WTF::tlsKeyCount): Deleted.
274 (WTF::tlsKeys): Deleted.
275 (WTF::threadSpecificKeyCreate): Deleted.
276 (WTF::threadSpecificKeyDelete): Deleted.
277 (WTF::threadSpecificSet): Deleted.
278 (WTF::threadSpecificGet): Deleted.
279 (WTF::ThreadSpecificThreadExit): Deleted.
281 * wtf/ThreadingWin.cpp:
282 (WTF::wtfThreadEntryPoint): Eliminated call to ThreadSpecificThreadExit.
284 2016-04-12 Filip Pizlo <fpizlo@apple.com>
286 PolymorphicAccess should buffer AccessCases before regenerating
287 https://bugs.webkit.org/show_bug.cgi?id=156457
289 Reviewed by Benjamin Poulain.
292 (WTF::TinyPtrSet::add): Add a helpful comment because I had forgotten what the bool return meant.
294 2016-04-12 Tomas Popela <tpopela@redhat.com>
296 S390X and PPC64 architectures detection is wrong
297 https://bugs.webkit.org/show_bug.cgi?id=156337
299 Reviewed by Carlos Garcia Campos.
301 After the http://trac.webkit.org/changeset/198919 was committed
302 it showed that the PPC64 detection is wrong as the CPU(PPC) path was
303 activated even for PPC64. The thing is that GCC defines __ppc__
304 even on PPC64 and not just on PPC(32). The same applies for S390X.
308 2016-04-05 Oliver Hunt <oliver@apple.com>
310 Remove compile time define for SEPARATED_HEAP
311 https://bugs.webkit.org/show_bug.cgi?id=155508
313 Reviewed by Mark Lam.
315 * wtf/FeatureDefines.h:
318 2016-04-11 Fujii Hironori <Hironori.Fujii@jp.sony.com>
320 [CMake] Make FOLDER property INHERITED
321 https://bugs.webkit.org/show_bug.cgi?id=156460
323 Reviewed by Brent Fulgham.
326 Set FOLDER directory property
328 2016-04-08 Alex Christensen <achristensen@webkit.org>
330 Progress towards running CMake WebKit2 on Mac
331 https://bugs.webkit.org/show_bug.cgi?id=156426
333 Reviewed by Tim Horton.
335 * wtf/PlatformMac.cmake:
337 2016-04-08 Yusuke Suzuki <utatane.tea@gmail.com>
339 [JSC] Enable Concurrent JIT by default
340 https://bugs.webkit.org/show_bug.cgi?id=156341
342 Reviewed by Filip Pizlo.
344 We enable Concurrent JIT by default when DFG JIT and JSVALUE64 are enabled.
345 This change offers Concurrent JIT to the JSCOnly port.
349 2016-04-07 Joseph Pecoraro <pecoraro@apple.com>
351 Remove ENABLE(ENABLE_ES6_CLASS_SYNTAX) guards
352 https://bugs.webkit.org/show_bug.cgi?id=156384
354 Reviewed by Ryosuke Niwa.
356 * wtf/FeatureDefines.h:
358 2016-04-06 Filip Pizlo <fpizlo@apple.com>
360 JSC should have a simple way of gathering IC statistics
361 https://bugs.webkit.org/show_bug.cgi?id=156317
363 Reviewed by Benjamin Poulain.
365 Make it easier to do relative sleeping on a condition. Previously you could do this using
366 std::chrono. I now believe that std::chrono is just a bad decision, and I always want to
367 use doubles instead. This makes it easier to do the right thing and use doubles.
370 (WTF::ConditionBase::waitUntilMonotonicClockSeconds):
371 (WTF::ConditionBase::waitForSeconds):
373 2016-04-06 Simon Fraser <simon.fraser@apple.com>
375 Fix Windows build by converting clampToInteger() into a template that only
376 takes integral types.
381 2016-04-06 Simon Fraser <simon.fraser@apple.com>
383 Page tiles are missing when graphics acceleration is unavailable
384 https://bugs.webkit.org/show_bug.cgi?id=156325
386 Reviewed by Tim Horton.
388 Add clampToInteger(size_t).
393 2016-04-05 Simon Fraser <simon.fraser@apple.com>
395 Implement operator== and operator!= for Optional<>
396 https://bugs.webkit.org/show_bug.cgi?id=156266
398 Reviewed by Anders Carlsson.
400 Implement non-member operator== and operator!= variants for Optional<>.
406 2016-03-19 Filip Pizlo <fpizlo@apple.com>
408 DFG and FTL should constant-fold RegExpExec
409 https://bugs.webkit.org/show_bug.cgi?id=155270
411 Reviewed by Saam Barati.
413 Make executeInsertions() return the amount by which the vector increased in size. This is a
414 convenient feature that I use in DFG::InsertionSet.
417 (WTF::executeInsertions):
419 2016-04-05 Antoine Quint <graouts@apple.com>
421 [WebGL2] Allow enabling WebGL2 with a runtime flag
422 https://bugs.webkit.org/show_bug.cgi?id=156166
423 <rdar://problem/25526929>
425 Removed the manual overrides of ENABLE_WEBGL2.
427 Reviewed by Dean Jackson.
429 * wtf/FeatureDefines.h:
431 2016-03-31 Konstantin Tokarev <annulen@yandex.ru>
433 Removed leftovers of ENABLE(INSPECTOR) and ENABLE(VIEWPORT).
434 https://bugs.webkit.org/show_bug.cgi?id=156064
436 Reviewed by Csaba Osztrogonác.
438 This ifdef guards were removed in r178820 and r147714, respectively.
440 * wtf/FeatureDefines.h:
442 2016-03-31 Brent Fulgham <bfulgham@apple.com>
444 [WK2] Support download attribute feature
445 https://bugs.webkit.org/show_bug.cgi?id=102914
446 <rdar://problem/13177492>
448 Reviewed by Darin Adler.
450 * wtf/FeatureDefines.h: Turn the ENABLE_DOWNLOAD_ATTRIBUTE flag
451 on to see what happens.
453 2016-03-30 Brian Burg <bburg@apple.com>
455 Web Automation: Add Automation.performKeyboardInteractions
456 https://bugs.webkit.org/show_bug.cgi?id=155990
457 <rdar://problem/25426408>
459 Reviewed by Timothy Hatcher.
461 Add a missing NSEventType declaration.
463 * wtf/mac/AppKitCompatibilityDeclarations.h:
465 2016-03-29 Benjamin Poulain <bpoulain@apple.com>
467 [WTF] Removing a smart pointer from HashTable issues two stores to the same location
468 https://bugs.webkit.org/show_bug.cgi?id=155676
470 Reviewed by Darin Adler.
472 While working on the hot loop of r198376, I noticed something
474 Every time we removed a smart pointer from the hash table,
475 the code generated was something like:
476 Load([bucket]) -> Tmp
478 JumpIfZero(Tmp, ->End)
480 Store(-1 -> [bucket])
483 The useless store before the branch is annoying, especially on ARM.
485 Here is what happens:
486 1) The destructor of the smart pointer swaps its internal value with nullptr.
487 2) Since the smart pointer is not a local in-register value, that nullptr
488 is stored in memory because it could be observable from fastFree().
489 3) The destructor destroy the value if not zero (or deref for RefPtr).
490 The "if-not-zero" may or may not be eliminated depending on what
491 is between getting the iterator and the call to remove().
492 4) fastFree() is called.
493 5) The deleted value is set in the bucket.
495 This patch adds custom deletion for those cases to avoid the useless
496 store. The useless null check is still eliminated when we are lucky.
498 I went this path instead of changing the destructor of RefPtr for two reasons:
499 -I need this to work in unique_ptr for JSC.
500 -Nulling the memory may have security advantages in the cases where we do not immediately
501 write over that memory again.
503 This patch removes 13kb out of x86_64 WebCore.
506 (WTF::HashTable::deleteBucket):
507 (WTF::KeyTraits>::removeIf):
509 (WTF::HashTraits<RefPtr<P>>::customDeleteBucket):
510 (WTF::hashTraitsDeleteBucket):
511 (WTF::KeyValuePairHashTraits::customDeleteBucket):
512 * wtf/text/AtomicStringHash.h:
513 (WTF::HashTraits<WTF::AtomicString>::isEmptyValue):
514 (WTF::HashTraits<WTF::AtomicString>::customDeleteBucket):
515 * wtf/text/StringHash.h:
516 (WTF::HashTraits<String>::customDeleteBucket):
518 2016-03-28 Brian Burg <bburg@apple.com>
520 Web Automation: implement Automation.performMouseInteraction
521 https://bugs.webkit.org/show_bug.cgi?id=155606
522 <rdar://problem/25227576>
524 Reviewed by Timothy Hatcher.
526 * wtf/mac/AppKitCompatibilityDeclarations.h: Add missing some NSEventTypes.
528 2016-03-29 Yusuke Suzuki <utatane.tea@gmail.com>
530 REGRESSION(r192914): 10% regression on Sunspider's date-format-tofte
531 https://bugs.webkit.org/show_bug.cgi?id=155559
533 Reviewed by Saam Barati.
535 Add HashTable::inlineLookup and HashMap::fastGet.
540 2016-03-25 Alex Christensen <achristensen@webkit.org>
542 Add a compile time flag for using QTKit
543 https://bugs.webkit.org/show_bug.cgi?id=155868
545 Reviewed by Dan Bates.
549 2016-03-24 Alex Christensen <achristensen@webkit.org>
551 Fix iOS9 performance regression after r197572
552 https://bugs.webkit.org/show_bug.cgi?id=155845
553 <rdar://problem/25144924>
555 Reviewed by Chris Dumez.
558 Use CFURLConnection instead of NSURLConnection on internal iOS9 builds.
560 2016-03-23 Saam Barati <sbarati@apple.com>
562 SmallPtrSet leaks memory in its move assignment operator when !this->isSmall()
563 https://bugs.webkit.org/show_bug.cgi?id=155701
565 Reviewed by Darin Adler.
568 (WTF::SmallPtrSet::SmallPtrSet):
569 (WTF::SmallPtrSet::operator=):
571 2016-03-22 Per Arne Vollan <peavo@outlook.com>
573 [Win] [64-bit] Remove MSVC 2013 FMA3 Bug Workaround
574 https://bugs.webkit.org/show_bug.cgi?id=141499
576 Reviewed by Brent Fulgham.
578 As we have moved on to VS2015, this workaround is no longer needed.
580 * wtf/PlatformWin.cmake:
581 * wtf/win/WTFDLL.cpp: Removed.
583 2016-03-20 Dan Bernstein <mitz@apple.com>
585 [Mac] Determine TARGET_MAC_OS_X_VERSION_MAJOR from MACOSX_DEPLOYMENT_TARGET rather than from MAC_OS_X_VERSION_MAJOR
586 https://bugs.webkit.org/show_bug.cgi?id=155707
587 <rdar://problem/24980691>
589 Reviewed by Darin Adler.
591 * Configurations/Base.xcconfig: Set TARGET_MAC_OS_X_VERSION_MAJOR based on the last
592 component of MACOSX_DEPLOYMENT_TARGET.
593 * Configurations/DebugRelease.xcconfig: For engineering builds, preserve the behavior of
594 TARGET_MAC_OS_X_VERSION_MAJOR being the host’s OS version.
596 2016-03-20 Dan Bernstein <mitz@apple.com>
598 Update build settings
600 Rubber-stamped by Andy Estes.
602 * Configurations/DebugRelease.xcconfig:
604 2016-03-17 Benjamin Poulain <bpoulain@apple.com>
606 [JSC] Make CSE's ImpureData faster when dealing with large blocks
607 https://bugs.webkit.org/show_bug.cgi?id=155594
609 Reviewed by Filip Pizlo.
614 2016-03-17 Saam barati <sbarati@apple.com>
616 Implement SmallPtrSet and integrate it into the Parser
617 https://bugs.webkit.org/show_bug.cgi?id=155552
619 Reviewed by Filip Pizlo.
621 This patch implements the SmallPtrSet data struture.
622 Inspired by the implementation in llvm:
623 http://llvm.org/docs/doxygen/html/SmallPtrSet_8h_source.html
625 The data structure uses an inline array for storage up until
626 a fixed limit (8 entries in our implementation). If that storage
627 fills up, we fall back to a simple hash table implementation.
628 Crucially, this implementation doesn't support the remove
629 operation. This is on purpose. The hash table will only ever
632 Also, the implementation allows for it to be memcopied around.
633 I.e, we can put SmallPtrSet inside a Vector and allow that
634 Vector to use memcpy as its move operation (of course this
635 is only valid if the SmallPtrSet in the old memory doesn't have
636 its destructor called unless it is set back to its initial state.)
638 For now, SmallPtrSet only supports pointer types that are trivially
639 destructible. It's probably not too difficult to extend this to
640 smart pointers, but it's not part of this original implementation.
642 I've also implemented a pure forwarding varargs constructAndAppend
643 method on Vector. This allows you to do:
645 v.constructAndAppend(a1, a2, ...)
646 as long as T has a constructor that accepts arguments (a1, a2, ...).
648 * WTF.xcodeproj/project.pbxproj:
649 * wtf/CMakeLists.txt:
650 * wtf/SmallPtrSet.h: Added.
651 (WTF::SmallPtrSet::SmallPtrSet):
652 (WTF::SmallPtrSet::operator=):
653 (WTF::SmallPtrSet::~SmallPtrSet):
654 (WTF::SmallPtrSet::add):
655 (WTF::SmallPtrSet::contains):
656 (WTF::SmallPtrSet::iterator::operator++):
657 (WTF::SmallPtrSet::iterator::operator*):
658 (WTF::SmallPtrSet::iterator::operator==):
659 (WTF::SmallPtrSet::iterator::operator!=):
660 (WTF::SmallPtrSet::begin):
661 (WTF::SmallPtrSet::end):
662 (WTF::SmallPtrSet::size):
663 (WTF::SmallPtrSet::emptyValue):
664 (WTF::SmallPtrSet::isValidEntry):
665 (WTF::SmallPtrSet::isSmall):
666 (WTF::SmallPtrSet::initialize):
667 (WTF::SmallPtrSet::grow):
668 (WTF::SmallPtrSet::bucket):
670 (WTF::Vector::append):
671 (WTF::Vector::uncheckedAppend):
672 (WTF::minCapacity>::append):
673 (WTF::minCapacity>::constructAndAppend):
674 (WTF::minCapacity>::appendSlowCase):
675 (WTF::minCapacity>::constructAndAppendSlowCase):
677 2016-03-16 Filip Pizlo <fpizlo@apple.com>
679 Replace all of the various non-working and non-compiling sampling profiler hacks with a single super hack
680 https://bugs.webkit.org/show_bug.cgi?id=155561
682 Reviewed by Saam Barati.
684 This patch replaces all of our various ad hoc profiling hacks with a single ad hoc profiling hack.
685 That needs to be able to sleep a thread, so I added a portable way to do it.
687 This also removes a bunch of ENABLE flags for all of the old non-working hacks.
689 * wtf/CurrentTime.cpp:
690 (WTF::currentCPUTime):
696 2016-03-17 Chris Dumez <cdumez@apple.com>
698 Set the WebContent process's main thread QoS to USER-INTERACTIVE
699 https://bugs.webkit.org/show_bug.cgi?id=155595
700 <rdar://problem/22534965>
702 Reviewed by Antti Koivisto.
704 Add a relativePriority parameter to setCurrentThreadIsUser*() so that
705 we can do more fine-grained prioritization of threads that have the
709 (WTF::setCurrentThreadIsUserInteractive):
710 (WTF::setCurrentThreadIsUserInitiated):
711 (WTF::createThread): Deleted.
714 2016-03-17 Filip Pizlo <fpizlo@apple.com>
716 Silence leaks in ParkingLot
717 https://bugs.webkit.org/show_bug.cgi?id=155510
719 Reviewed by Alexey Proskuryakov.
721 ParkingLot has a concurrent hashtable that it reallocates on demand. It will not reallocate
722 it in steady state. The hashtable is sized to accommodate the high watermark of the number
723 of active threads - so long as the program doesn't just keep starting an unbounded number
724 of threads that are all active, the hashtable will stop resizing. Each resize operation is
725 designed to stay out of the way of the data-access-parallel normal path, in which two
726 threads operating on different lock addresses don't have to synchronize. To do this, it
727 simply drops the old hashtable without deleting it, so that threads that were still using
728 it don't crash. They will realize that they have the wrong hashtable before doing anything
729 bad, but we don't have a way of proving when all of those threads are no longer going to
730 read from the old hashtables. So, we just leak them.
732 This is a bounded leak, since the hashtable resizes exponentially. Thus the total memory
733 utilization of all hashtables, including the leaked ones, converges to a linear function of
734 the current hashtable's size (it's 2 * size of current hashtable).
736 But this leak is a problem for leaks tools, which will always report this leak. This is not
737 useful. It's better to silence the leak. That's what this patch does by ensuring that all
738 hashtables, including leaked ones, end up in a global vector. This is perf-neutral.
740 This requires making a StaticWordLock variant of WordLock. That's probably the biggest part
743 * wtf/ParkingLot.cpp:
745 (WTF::WordLockBase::lockSlow):
746 (WTF::WordLockBase::unlockSlow):
747 (WTF::WordLock::lockSlow): Deleted.
748 (WTF::WordLock::unlockSlow): Deleted.
750 (WTF::WordLockBase::lock):
751 (WTF::WordLockBase::isLocked):
752 (WTF::WordLock::WordLock):
753 (WTF::WordLock::lock): Deleted.
754 (WTF::WordLock::isLocked): Deleted.
756 2016-03-16 Chris Dumez <cdumez@apple.com>
758 Unreviewed, rolling out r198235, r198240, r198241, and
761 Causing crashes on ARM
765 "Remove compile time define for SEPARATED_HEAP"
766 https://bugs.webkit.org/show_bug.cgi?id=155508
767 http://trac.webkit.org/changeset/198235
769 "Gardening: build fix after r198235."
770 http://trac.webkit.org/changeset/198240
773 http://trac.webkit.org/changeset/198241
775 "Rename performJITMemcpy to something more inline with our
776 normal webkit function names"
777 https://bugs.webkit.org/show_bug.cgi?id=155525
778 http://trac.webkit.org/changeset/198252
780 2016-03-15 Oliver Hunt <oliver@apple.com>
782 Remove compile time define for SEPARATED_HEAP
783 https://bugs.webkit.org/show_bug.cgi?id=155508
785 Reviewed by Mark Lam.
787 Remove the feature define.
789 * wtf/FeatureDefines.h:
792 2016-03-14 Mark Lam <mark.lam@apple.com>
794 Need to distinguish between Symbol() and Symbol("").
795 https://bugs.webkit.org/show_bug.cgi?id=155438
797 Reviewed by Saam Barati.
799 While toString of both Symbol() and Symbol("") yields "Symbol()", Function.name
800 should yield "" and "[]" respectively. Hence, we need to tell between the two.
801 This functionality will be needed later in https://bugs.webkit.org/show_bug.cgi?id=155437.
803 We achieve this by creating another singleton instance like the empty StringImpl
804 as the null StringImpl. isNullSymbol() tests if the Stringimpl instance is a
805 symbol, and its substring is the null() singleton.
807 * wtf/text/StringImpl.cpp:
808 (WTF::StringImpl::createSymbol):
809 (WTF::StringImpl::createNullSymbol):
810 (WTF::StringImpl::containsOnlyWhitespace):
811 (WTF::StringImpl::createSymbolEmpty): Deleted.
812 * wtf/text/StringImpl.h:
813 (WTF::StringImpl::tryCreateUninitialized):
814 (WTF::StringImpl::stringKind):
815 (WTF::StringImpl::isSymbol):
816 (WTF::StringImpl::isAtomic):
817 (WTF::StringImpl::isNullSymbol):
818 * wtf/text/StringStatics.cpp:
819 (WTF::StringImpl::null):
821 2016-03-13 Joseph Pecoraro <pecoraro@apple.com>
823 Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
824 https://bugs.webkit.org/show_bug.cgi?id=155417
826 Reviewed by Yusuke Suzuki.
828 * wtf/FeatureDefines.h:
830 2016-03-13 Konstantin Tokarev <annulen@yandex.ru>
832 Added new port JSCOnly.
833 https://bugs.webkit.org/show_bug.cgi?id=154512
835 Reviewed by Michael Catanzaro.
837 This port allows to build JavaScriptCore engine with minimal
840 * wtf/PlatformJSCOnly.cmake: Added.
841 * wtf/none/MainThreadNone.cpp: Added.
842 * wtf/none/RunLoopNone.cpp: Added.
843 * wtf/none/WorkQueueNone.cpp: Added.
845 2016-03-13 David Kilzer <ddkilzer@apple.com>
847 REGRESSION (r198079): Windows build broke because of "%PRId64" format specifier
849 This fixes the following build failure in WebCore for Windows:
850 C:\Source\WebCore\page\DOMTimer.cpp(396): error C2146: syntax error: missing ')' before identifier 'PRId64' [C:\WebKitBuild\Debug\Source\WebCore\WebCore.vcxproj]
851 C:\Source\WebCore\page\DOMTimer.cpp(399): error C2146: syntax error: missing ')' before identifier 'PRId64' [C:\WebKitBuild\Debug\Source\WebCore\WebCore.vcxproj]
853 * wtf/StdLibExtras.h: Define "PRId64" for Windows here so it may
854 be shared. This should fix DOMTimer.cpp after r198079 since it
855 already includes StdLibExtras.h.
857 2016-03-11 Youenn Fablet <youenn.fablet@crf.canon.fr>
859 WTF should have a similar function as equalLettersIgnoringASCIICase to match beginning of strings
860 https://bugs.webkit.org/show_bug.cgi?id=153419
862 Reviewed by Darin Adler.
864 Introducing startsWithLettersIgnoringASCIICase, to check the beginning of a string.
865 Moving some code from WTF::equalLettersIgnoringASCIICaseCommonWithoutLength in
866 WTF::hasPrefixWithLettersIgnoringASCIICaseCommon to enable reuse in
867 WTF::startsWithLettersIgnoringASCIICaseCommon.
869 * wtf/text/StringCommon.h:
870 (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon):
871 (WTF::equalLettersIgnoringASCIICaseCommonWithoutLength):
872 (WTF::startsWithLettersIgnoringASCIICaseCommonWithoutLength):
873 (WTF::startsWithLettersIgnoringASCIICaseCommon):
874 * wtf/text/StringImpl.h:
875 (WTF::startsWithLettersIgnoringASCIICase):
876 * wtf/text/WTFString.h:
877 (WTF::startsWithLettersIgnoringASCIICase):
879 2016-03-10 Frederic Wang <fwang@igalia.com>
881 [GTK] Add support for WOFF2
882 https://bugs.webkit.org/show_bug.cgi?id=152616
884 Reviewed by Carlos Garcia Campos.
886 * wtf/FeatureDefines.h: Enable USE_WOFF2 flag on GTK.
888 2016-03-09 Ryosuke Niwa <rniwa@webkit.org>
890 Add runtime flags for shadow DOM and custom elements
891 https://bugs.webkit.org/show_bug.cgi?id=155213
893 Reviewed by Dean Jackson.
895 Removed the manual overrides of ENABLE_SHADOW_DOM and ENABLE_CUSTOM_ELEMENTS as they were
896 making --no-shadow-dom and --no-custom-elements flags on build-webkit useless.
898 * wtf/FeatureDefines.h:
900 2016-03-09 Keith Rollin <krollin@apple.com>
902 Add state dumping facility
903 https://bugs.webkit.org/show_bug.cgi?id=154930
904 <rdar://problem/24939135>
906 Reviewed by Anders Carlsson.
908 Add an OS_STATE flag to control the inclusion of process state dumping
913 2016-03-09 Oliver Hunt <oliver@apple.com>
919 2016-03-08 Filip Pizlo <fpizlo@apple.com>
921 Remove failing assertion. There are strings that claim to be atomic but that the
922 compiler thread can totally deal with, like the empty string.
924 Rubber stamped by Mark Lam.
926 * wtf/text/StringImpl.h:
927 (WTF::StringImpl::ref):
928 (WTF::StringImpl::deref):
930 2016-03-08 Filip Pizlo <fpizlo@apple.com>
932 DFG should be able to constant-fold strings
933 https://bugs.webkit.org/show_bug.cgi?id=155200
935 Reviewed by Geoffrey Garen.
937 Also disable assertions about reference counting strings on the JIT thread. We will do
938 that now and it's OK.
940 * wtf/text/StringImpl.h:
941 (WTF::StringImpl::ref):
942 (WTF::StringImpl::deref):
944 2016-03-08 Anders Carlsson <andersca@apple.com>
946 Fix AppKitCompatibilityDeclarations build.
948 * wtf/mac/AppKitCompatibilityDeclarations.h:
949 Remove duplicate declarations, conditionally define NSTextAlignment and
950 add a NSWindowStyleMask typedef.
952 2016-03-08 Oliver Hunt <oliver@apple.com>
954 Start moving to separated writable and executable mappings in the JIT
955 https://bugs.webkit.org/show_bug.cgi?id=155178
957 Reviewed by Fil Pizlo.
959 Update feature defines.
961 * wtf/FeatureDefines.h:
962 * wtf/Platform.h: ARM64 for now.
964 2016-03-08 Anders Carlsson <andersca@apple.com>
966 Add AppKit compatibility header
967 https://bugs.webkit.org/show_bug.cgi?id=155202
969 Reviewed by Beth Dakin.
971 * WTF.xcodeproj/project.pbxproj:
972 * wtf/mac/AppKitCompatibilityDeclarations.h: Added.
974 2016-03-08 Commit Queue <commit-queue@webkit.org>
976 Unreviewed, rolling out r197793 and r197799.
977 https://bugs.webkit.org/show_bug.cgi?id=155195
979 something weird happened while landing this and everything
980 broke (Requested by olliej on #webkit).
984 "Start moving to separated writable and executable mappings in
986 https://bugs.webkit.org/show_bug.cgi?id=155178
987 http://trac.webkit.org/changeset/197793
989 "arm64 build fix after r197793."
990 http://trac.webkit.org/changeset/197799
992 2016-03-08 Oliver Hunt <oliver@apple.com>
994 Start moving to separated writable and executable mappings in the JIT
995 https://bugs.webkit.org/show_bug.cgi?id=155178
997 Reviewed by Filip Pizlo.
999 Update feature defines.
1001 * wtf/FeatureDefines.h:
1002 * wtf/Platform.h: ARM64 for now.
1004 2016-03-08 Daniel Bates <dabates@apple.com>
1006 Support iterating over an OptionSet and checking if it is empty
1007 https://bugs.webkit.org/show_bug.cgi?id=154941
1008 <rdar://problem/24964187>
1010 Reviewed by Darin Adler.
1012 Implements support for iterating over the enumerators in an OptionSet as well as
1013 determining if the set is empty.
1015 Iterating over an OptionSet is in Big Theta(N) where N is the number of items in
1016 the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented
1017 by the bitwise OR-ing of all enumerators in the set.
1019 * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant -
1020 the enumerators must be positive powers of two.
1021 (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator.
1022 (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set.
1023 (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator.
1024 (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator.
1025 (WTF::OptionSet::Iterator::Iterator): Added.
1026 (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow
1027 instantiation with a raw value of 0.
1028 (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value
1029 is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED).
1030 (WTF::OptionSet::isEmpty): Returns whether the set is empty.
1031 (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set.
1032 (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set.
1034 2016-03-07 Keith Rollin <krollin@apple.com>
1036 Enhance logging: Use "always on" macros
1037 https://bugs.webkit.org/show_bug.cgi?id=154499
1038 <rdar://problem/24757730>
1040 Reviewed by Chris Dumez.
1042 Update LOG_ALWAYS and LOG_ALWAYS_ERROR macros to take an expression to
1043 be evaluated. If the expression evaluates to True, the associated
1044 message is logged. This facility is used to prevent logging from being
1045 performed in private sessions, but it could be extended to prevent
1046 logging under other circumstances as well.
1050 2016-03-04 Alex Christensen <achristensen@webkit.org>
1052 Remove vcxproj build system
1053 https://bugs.webkit.org/show_bug.cgi?id=154388
1055 Rubber-stamped by Brent Fulgham.
1057 * WTF.vcxproj/WTF.submit.sln: Removed.
1058 * WTF.vcxproj/WTF.vcxproj: Removed.
1059 * WTF.vcxproj/WTF.vcxproj.filters: Removed.
1060 * WTF.vcxproj/WTFCFLite.props: Removed.
1061 * WTF.vcxproj/WTFCommon.props: Removed.
1062 * WTF.vcxproj/WTFCoreFoundation.props: Removed.
1063 * WTF.vcxproj/WTFDebug.props: Removed.
1064 * WTF.vcxproj/WTFDebugWinCairo.props: Removed.
1065 * WTF.vcxproj/WTFGenerated.make: Removed.
1066 * WTF.vcxproj/WTFGenerated.vcxproj: Removed.
1067 * WTF.vcxproj/WTFGenerated.vcxproj.filters: Removed.
1068 * WTF.vcxproj/WTFGeneratedCommon.props: Removed.
1069 * WTF.vcxproj/WTFGeneratedDebug.props: Removed.
1070 * WTF.vcxproj/WTFGeneratedProduction.props: Removed.
1071 * WTF.vcxproj/WTFGeneratedRelease.props: Removed.
1072 * WTF.vcxproj/WTFPostBuild.cmd: Removed.
1073 * WTF.vcxproj/WTFPreBuild.cmd: Removed.
1074 * WTF.vcxproj/WTFProduction.props: Removed.
1075 * WTF.vcxproj/WTFRelease.props: Removed.
1076 * WTF.vcxproj/WTFReleaseWinCairo.props: Removed.
1077 * WTF.vcxproj/build-generated-files.pl: Removed.
1078 * WTF.vcxproj/copy-files.cmd: Removed.
1079 * WTF.vcxproj/work-around-vs-dependency-tracking-bugs.py: Removed.
1081 2016-03-04 Alex Christensen <achristensen@webkit.org>
1083 Use NSURLSession for loading in WebKit2
1084 https://bugs.webkit.org/show_bug.cgi?id=154993
1086 Reviewed by Sam Weinig.
1090 2016-03-03 Daniel Bates <dabates@apple.com>
1092 Add unit tests for WTF::OptionSet
1093 https://bugs.webkit.org/show_bug.cgi?id=154925
1094 <rdar://problem/24964211>
1096 Reviewed by Darin Adler.
1098 * wtf/CMakeLists.txt: Add header OptionSet.h to the list of WTF headers.
1099 * wtf/OptionSet.h: Use in-class initialization to initialize m_storage and declare
1100 the trivial constexpr constructor as default.
1101 (WTF::OptionSet::OptionSet): For convenience add a constructor that takes a std::initializer_list.
1102 This code was written by Anders Carlsson.
1104 2016-03-03 Andy Estes <aestes@apple.com>
1106 Adopt CFNetwork storage partitioning SPI
1107 https://bugs.webkit.org/show_bug.cgi?id=154957
1108 rdar://problem/23614620
1110 Reviewed by Darin Adler.
1112 * wtf/Platform.h: Defined HAVE_CFNETWORK_STORAGE_PARTITIONING.
1114 2016-03-02 Konstantin Tokarev <annulen@yandex.ru>
1116 [cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK.
1117 https://bugs.webkit.org/show_bug.cgi?id=154651
1119 Reviewed by Alex Christensen.
1121 * CMakeLists.txt: Moved shared code to WEBKIT_FRAMEWORK macro.
1123 2016-03-01 Commit Queue <commit-queue@webkit.org>
1125 Unreviewed, rolling out r197226 and r197256.
1126 https://bugs.webkit.org/show_bug.cgi?id=154910
1128 Caused crashes on Mac 32-bit and on ARM (Requested by ap on
1131 Reverted changesets:
1133 "Remove the on demand executable allocator"
1134 https://bugs.webkit.org/show_bug.cgi?id=154749
1135 http://trac.webkit.org/changeset/197226
1138 http://trac.webkit.org/changeset/197256
1140 2016-03-01 Alex Christensen <achristensen@webkit.org>
1142 Reduce size of internal windows build output
1143 https://bugs.webkit.org/show_bug.cgi?id=154763
1145 Reviewed by Brent Fulgham.
1147 * WTF.vcxproj/WTF.proj:
1149 2016-03-01 Commit Queue <commit-queue@webkit.org>
1151 Unreviewed, rolling out r197056.
1152 https://bugs.webkit.org/show_bug.cgi?id=154870
1154 broke win ews (Requested by alexchristensen on #webkit).
1158 "[cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK."
1159 https://bugs.webkit.org/show_bug.cgi?id=154651
1160 http://trac.webkit.org/changeset/197056
1162 2016-02-29 Gavin Barraclough <barraclough@apple.com>
1164 RefCounter<T>::Event -> RefCounterEvent
1165 https://bugs.webkit.org/show_bug.cgi?id=154767
1167 Reviewed by Darin Adler.
1169 RefCounter<T>::Event is kinda verbose to use, and there is no need for this
1170 to be specific to a particular typeof RefCounter. Move the enum class up to
1171 the top level & rename to RefCounterEvent.
1174 (WTF::RefCounter<T>::Count::ref):
1175 (WTF::RefCounter<T>::Count::deref):
1177 2016-02-26 Oliver Hunt <oliver@apple.com>
1179 Remove the on demand executable allocator
1180 https://bugs.webkit.org/show_bug.cgi?id=154749
1182 Reviewed by Geoffrey Garen.
1184 Remove the DeamndExecutableAllocator compile flags.
1188 2016-02-26 Keith Rollin <krollin@apple.com>
1190 Enhance logging: Add "always on" macros
1191 https://bugs.webkit.org/show_bug.cgi?id=154498
1192 <rdar://problem/24757759>
1194 Reviewed by Chris Dumez.
1196 Add support for efficient always-on logging (logging that is available
1197 in both debug and release builds). This is implemented in the form of
1200 - LOG_ALWAYS: Always log information-level statements.
1201 - LOG_ALWAYS_ERROR: Always log error-level statements. These can be
1202 filtered out of the normal logging so that they can be found more
1205 In cases where there is no efficient underlying facility for it to
1206 utilize, LOG_ALWAYS_ERROR is redirected to WTFReportError as a backup
1207 mechanism. LOG_ALWAYS is not given a similar treatment so that we
1208 don't overwhelm other logging systems that aren't prepared for "always
1214 2016-02-26 Anders Carlsson <andersca@apple.com>
1216 Add WTF::OptionSet and use it for the website data types enum
1217 https://bugs.webkit.org/show_bug.cgi?id=154733
1219 Reviewed by Geoffrey Garen.
1221 Add WTF::OptionSet which makes it easier to use strong enums as flags.
1223 * WTF.xcodeproj/project.pbxproj:
1225 * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h.
1226 (WTF::OptionSet::fromRaw):
1227 (WTF::OptionSet::OptionSet):
1228 (WTF::OptionSet::toRaw):
1229 (WTF::OptionSet::contains):
1230 (WTF::OptionSet::operator|=):
1232 2016-02-26 Commit Queue <commit-queue@webkit.org>
1234 Unreviewed, rolling out r197168.
1235 https://bugs.webkit.org/show_bug.cgi?id=154728
1237 crashing on some devices (Requested by kling on #webkit).
1241 "[Darwin] Use vm_kernel_page_size for WTF::pageSize()."
1242 https://bugs.webkit.org/show_bug.cgi?id=154726
1243 http://trac.webkit.org/changeset/197168
1245 2016-02-26 Andreas Kling <akling@apple.com>
1247 [Darwin] Use vm_kernel_page_size for WTF::pageSize().
1248 <https://webkit.org/b/154726>
1250 Reviewed by Antti Koivisto.
1252 Make sure we use the right VM page size on Darwin systems.
1253 On devices where the native page size is 4 KB, it's both
1254 possible and profitable to madvise in smaller chunks.
1256 * wtf/PageBlock.cpp:
1257 (WTF::systemPageSize):
1259 2016-02-25 Gavin Barraclough <barraclough@apple.com>
1261 RefCounter value changed callback should be called on all changes (not just zero edge).
1262 https://bugs.webkit.org/show_bug.cgi?id=154699
1264 Reviewed by Anders Carlsson.
1266 RefCounter currently only triggers a callback when the count goes from zero
1267 to non-zero and vice-versa. Change that, to be useful to more clients.
1270 (WTF::RefCounter::Count::Count):
1271 (WTF::RefCounter::RefCounter):
1272 - Removed superfluous WTF_EXPORT_PRIVATE.
1273 (WTF::RefCounter::value):
1274 - Changed value() to a size_t.
1275 (WTF::RefCounter<T>::Count::ref):
1276 (WTF::RefCounter<T>::Count::deref):
1277 - Trigger the callback on all increments/decrements.
1278 (WTF::RefCounter<T>::RefCounter):
1279 - Changed siganture of callback.
1281 2016-02-25 Gavin Barraclough <barraclough@apple.com>
1283 Replace RefCounter::Token implementation with RefPtr
1284 https://bugs.webkit.org/show_bug.cgi?id=154698
1286 Reviewed by Anders Carlsson.
1289 (WTF::RefCounter::RefCounter):
1290 (WTF::RefCounter::count):
1291 (WTF::RefCounter::value):
1292 (WTF::RefCounter<T>::~RefCounter):
1293 (WTF::RefCounter::Token::Token): Deleted.
1294 (WTF::RefCounter::Token::operator bool): Deleted.
1295 (WTF::RefCounter<T>::Token::Token): Deleted.
1299 2016-02-25 Gavin Barraclough <barraclough@apple.com>
1301 Should template RefCounter instead of RefCounter::Token
1302 https://bugs.webkit.org/show_bug.cgi?id=154691
1304 Speculative windows build fix.
1307 (WTF::RefCounter::RefCounter):
1308 (WTF::RefCounter::count):
1310 2016-02-25 Commit Queue <commit-queue@webkit.org>
1312 Unreviewed, rolling out r197137.
1313 https://bugs.webkit.org/show_bug.cgi?id=154700
1315 broke windows build (Requested by alexchristensen on #webkit).
1319 "Replace RefCounter::Token implementation with RefPtr"
1320 https://bugs.webkit.org/show_bug.cgi?id=154698
1321 http://trac.webkit.org/changeset/197137
1323 2016-02-25 Gavin Barraclough <barraclough@apple.com>
1325 Replace RefCounter::Token implementation with RefPtr
1326 https://bugs.webkit.org/show_bug.cgi?id=154698
1328 Reviewed by Anders Carlsson.
1331 (WTF::RefCounter::RefCounter):
1332 (WTF::RefCounter::count):
1333 (WTF::RefCounter::value):
1334 (WTF::RefCounter<T>::~RefCounter):
1335 (WTF::RefCounter::Token::Token): Deleted.
1336 (WTF::RefCounter::Token::operator bool): Deleted.
1337 (WTF::RefCounter<T>::Token::Token): Deleted.
1341 2016-02-25 Gavin Barraclough <barraclough@apple.com>
1343 Should template RefCounter instead of RefCounter::Token
1344 https://bugs.webkit.org/show_bug.cgi?id=154691
1346 Reviewed by Anders Carlsson.
1348 My real goal here is to make the counter accurate. Currently returning a Token from token<>()
1349 results in ref-count churn. Fixing this either means changing the return value, or improving
1350 Token (which will probably mean replacing it with RefPtr). Either way would break the current
1351 type checking. Move type tag to RefCount so this can still be enforced.
1353 * WTF.vcxproj/WTF.vcxproj:
1354 * WTF.vcxproj/WTF.vcxproj.filters:
1355 * WTF.xcodeproj/project.pbxproj:
1356 * wtf/CMakeLists.txt:
1357 * wtf/RefCounter.cpp: Removed.
1358 - Removed RefCounter.cpp.
1360 (WTF::RefCounter::Token::Token):
1361 (WTF::RefCounter::Token::operator bool):
1362 (WTF::RefCounter::RefCounter):
1363 (WTF::RefCounter::count):
1364 (WTF::RefCounter::value):
1365 (WTF::RefCounter<T>::Count::ref):
1366 (WTF::RefCounter<T>::Count::deref):
1367 (WTF::RefCounter<T>::RefCounter):
1368 (WTF::RefCounter<T>::~RefCounter):
1369 (WTF::RefCounter<T>::Token::Token):
1371 (WTF::RefCounter::token): Deleted.
1372 (WTF::RefCounter::Token<T>::Token): Deleted.
1373 - RefCounter -> RefCounter<T>,
1374 - Token<T> -> Token,
1375 - renamed token<>() -> count().
1377 2016-02-25 Sam Weinig <sam@webkit.org>
1379 HashMap::ensure() should return an AddResult like all the other add-like functions.
1380 https://bugs.webkit.org/show_bug.cgi?id=154680
1382 Reviewed by Anders Carlsson.
1384 While adopting HashMap::ensure(), I found it was useful in some circumstances to know
1385 if the value was added or not. While I could discern this information by setting a bool
1386 in the passed in lambda, it seemed clearer and more idiomatic to just have ensure return
1387 an AddResult like all the other add-like functions do.
1390 Change return type of HashMap::ensure() to be an AddResult.
1392 2016-02-24 Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au>
1394 [web-animations] Add AnimationTimeline, DocumentTimeline and add extensions to Document interface
1395 https://bugs.webkit.org/show_bug.cgi?id=151688
1397 Reviewed by Dean Jackson.
1399 Enables the WEB_ANIMATIONS compiler switch.
1401 * wtf/FeatureDefines.h:
1403 2016-02-24 Konstantin Tokarev <annulen@yandex.ru>
1405 [cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK.
1406 https://bugs.webkit.org/show_bug.cgi?id=154651
1408 Reviewed by Alex Christensen.
1410 * CMakeLists.txt: Moved shared code to WEBKIT_FRAMEWORK macro.
1412 2016-02-23 Dan Bernstein <mitz@apple.com>
1414 [Xcode] Linker errors display mangled names, but no longer should
1415 https://bugs.webkit.org/show_bug.cgi?id=154632
1417 Reviewed by Sam Weinig.
1419 * Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.
1421 2016-02-23 Gavin Barraclough <barraclough@apple.com>
1423 Remove HIDDEN_PAGE_DOM_TIMER_THROTTLING feature define
1424 https://bugs.webkit.org/show_bug.cgi?id=112323
1426 Reviewed by Chris Dumez.
1428 This feature is controlled by a runtime switch, and defaults off.
1430 * wtf/FeatureDefines.h:
1432 2016-02-22 Konstantin Tokarev <annulen@yandex.ru>
1434 [cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
1435 https://bugs.webkit.org/show_bug.cgi?id=154450
1437 Reviewed by Alex Christensen.
1439 * wtf/CMakeLists.txt:
1441 2016-02-20 Mark Lam <mark.lam@apple.com>
1443 Use of inlined asm statements causes problems for -std=c99 builds.
1444 https://bugs.webkit.org/show_bug.cgi?id=154507
1446 Reviewed by Dan Bernstein.
1448 WTF's Assertions.h may inadvertantly get included by other projects that are built
1449 with -std=c99. The use of the inlined asm statements with the keyword "asm" is
1450 not recognized when the -std compiler flag is used.
1452 https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html says "When writing code that
1453 can be compiled with -ansi and the various -std options, use __asm__ instead of
1454 asm (see Alternate Keywords)."
1456 So, to be a good citizen, we can change the use of "asm" in CRASH() to "__asm__"
1457 so that we don't break the build of such other projects.
1461 2016-02-18 Brent Fulgham <bfulgham@apple.com>
1463 Extend HashCountedSet with a method to efficiently set the count of an entry
1464 https://bugs.webkit.org/show_bug.cgi?id=154352
1466 Reviewed by Geoffrey Garen.
1468 Tested by new TestWebKitAPI tests.
1470 Update the HashCountedSet class with a new 'add' method to support efficient initialization of
1471 the count of a given key. Also provide move and pointer template specializations to expand the
1472 types of data that can be used as 'keys' in the HashCountedSet to match the underlying HashMap
1475 * wtf/HashCountedSet.h:
1476 (WTF::Traits>::add): Added new overload supporting a supplied count.
1478 2016-02-18 Commit Queue <commit-queue@webkit.org>
1480 Unreviewed, rolling out r196791.
1481 https://bugs.webkit.org/show_bug.cgi?id=154438
1483 broke windows build (Requested by alexchristensen on #webkit).
1487 "Extend HashCountedSet with a method to efficiently set the
1489 https://bugs.webkit.org/show_bug.cgi?id=154352
1490 http://trac.webkit.org/changeset/196791
1492 2016-02-18 Brent Fulgham <bfulgham@apple.com>
1494 Extend HashCountedSet with a method to efficiently set the count of an entry
1495 https://bugs.webkit.org/show_bug.cgi?id=154352
1497 Reviewed by Geoffrey Garen.
1499 Tested by new TestWebKitAPI tests.
1501 Update the HashCountedSet class with a new 'add' method to support efficient initialization of
1502 the count of a given key. Also provide move and pointer template specializations to expand the
1503 types of data that can be used as 'keys' in the HashCountedSet to match the underlying HashMap
1506 * wtf/HashCountedSet.h:
1507 (WTF::Traits>::add): Added new overload supporting a supplied count.
1509 2016-02-17 Filip Pizlo <fpizlo@apple.com>
1511 Remove LLVM dependencies from WebKit
1512 https://bugs.webkit.org/show_bug.cgi?id=154323
1514 Reviewed by Antti Koivisto and Benjamin Poulain.
1518 2016-02-16 Sam Weinig <sam@webkit.org>
1520 Add an ensure function on HashMap that takes a key and a function to make the lazy value initialization idiom easier
1521 https://bugs.webkit.org/show_bug.cgi?id=134857
1523 Reviewed by Geoffrey Garen.
1525 The current idiom for adding a value to a HashMap if the key is not already present, to allow for not
1526 unnecessarily constructing the new value if it won't be used, is:
1529 auto result = map.add(key, Value());
1530 if (!result.isNewEntry)
1531 return result.iterator->value;
1533 result.iterator->value = createNewValue();
1534 return result.iterator->value;
1540 auto& value = map.add(key, Value()).iterator->value;
1542 value = createNewValue();
1546 With this patch, you can now use the new function HashMap::ensure(key, functor). This will allow us to
1547 change to using the following idiom:
1550 return map.ensure(key, [] { return createNewValue(); });
1553 The passed in functor will only be called if the key is not already present in the HashMap.
1556 (WTF::HashMapTranslator::translate):
1557 (WTF::HashMapEnsureTranslator::hash):
1558 (WTF::HashMapEnsureTranslator::equal):
1559 (WTF::HashMapEnsureTranslator::translate):
1560 (WTF::HashMapTranslatorAdapter::hash):
1562 2016-02-16 Filip Pizlo <fpizlo@apple.com>
1564 FTL_USES_B3 should be unconditionally true
1565 https://bugs.webkit.org/show_bug.cgi?id=154324
1567 Reviewed by Benjamin Poulain.
1571 2016-02-13 Mark Lam <mark.lam@apple.com>
1573 Eliminate the need for WTFCrashImpl().
1574 https://bugs.webkit.org/show_bug.cgi?id=154202
1576 Reviewed by Alexey Proskuryakov.
1578 * wtf/Assertions.cpp:
1581 2016-02-12 Sukolsak Sakshuwong <sukolsak@gmail.com>
1583 Update ICU header files to version 52
1584 https://bugs.webkit.org/show_bug.cgi?id=154160
1586 Reviewed by Alex Christensen.
1588 Update ICU header files to version 52 to allow the use of newer APIs.
1590 * icu/unicode/bytestream.h:
1591 * icu/unicode/localpointer.h:
1592 * icu/unicode/platform.h:
1593 * icu/unicode/ptypes.h:
1594 * icu/unicode/putil.h:
1595 * icu/unicode/rep.h:
1596 (Replaceable::Replaceable):
1597 * icu/unicode/std_string.h:
1598 * icu/unicode/strenum.h:
1599 * icu/unicode/stringpiece.h:
1600 * icu/unicode/uchar.h:
1601 * icu/unicode/ucnv.h:
1602 * icu/unicode/ucol.h:
1603 * icu/unicode/uconfig.h:
1604 * icu/unicode/uenum.h:
1605 * icu/unicode/uiter.h:
1606 * icu/unicode/uloc.h:
1607 * icu/unicode/umachine.h:
1608 * icu/unicode/unistr.h:
1609 (UnicodeString::UnicodeString):
1610 (UnicodeString::operator== ):
1611 (UnicodeString::startsWith):
1612 (UnicodeString::setTo):
1613 (UnicodeString::remove):
1614 (UnicodeString::replace): Deleted.
1615 (UnicodeString::extract): Deleted.
1616 (UnicodeString::char32At): Deleted.
1617 (UnicodeString::getChar32Start): Deleted.
1618 (UnicodeString::getChar32Limit): Deleted.
1619 (UnicodeString::getTerminatedBuffer): Deleted.
1620 (UnicodeString::append): Deleted.
1621 (UnicodeString::truncate): Deleted.
1622 * icu/unicode/unorm2.h:
1623 * icu/unicode/uobject.h:
1624 * icu/unicode/urename.h:
1625 * icu/unicode/uscript.h:
1626 * icu/unicode/uset.h:
1627 * icu/unicode/ustring.h:
1628 * icu/unicode/utf.h:
1629 * icu/unicode/utf16.h:
1630 * icu/unicode/utf8.h:
1631 * icu/unicode/utf_old.h:
1632 * icu/unicode/utypes.h:
1633 * icu/unicode/uvernum.h:
1634 * icu/unicode/uversion.h:
1636 2016-02-11 Mark Lam <mark.lam@apple.com>
1638 Need WTFCrash workaround for shipping SafariForWebKitDevelopment binaries.
1639 https://bugs.webkit.org/show_bug.cgi?id=154125
1641 Reviewed by Joseph Pecoraro.
1643 Presently shipping SafariForWebKitDevelopment binaries still expect to link to a
1644 WTFCrash function. We need to provide this function as a workaround until we can
1645 update SafariForWebKitDevelopment to use the new inlined version.
1647 We do this by doing:
1648 1. Make WTFCrashImpl() the sole function for implementing a crash.
1649 The CRASH() macro is now defined to be WTFCrashImpl() instead of WTFCrash().
1650 2. Renamed the legacy WTFCrash() to WTFCrashImpl() for debug or non-Darwin builds.
1651 For (non-debug && OS(DARWIN)) builds, WTFCrashImpl() will be an inlined
1652 function with an asm statement that issues a breakpoint trap.
1653 3. Implement WTFCrash() as a function that calls CRASH().
1654 This satisfies the need of shipping SafariForWebKitDevelopment binaries.
1655 4. Change WTFCrashWithSecurityImplication() to call CRASH().
1656 This ensures that we have a consistent implementation of how we crash.
1657 5. Changed WTFLogAlwaysAndCrash() to call CRASH() instead of WTFCrash().
1658 This is just to have consistency in that all code in the WebKit project
1659 now crashes by calling CRASH(), not WTFCrash().
1661 * wtf/Assertions.cpp:
1664 2016-02-09 Mark Lam <mark.lam@apple.com>
1666 Changed WTFCrash to not trash the crash site register state.
1667 https://bugs.webkit.org/show_bug.cgi?id=153996
1669 Reviewed by Geoffrey Garen.
1671 When doing post-mortem crash site analysis using data from crash reports, it is
1672 immensely valuable to be able to infer the crashing program's state from the
1673 register values at crash time. However, for RELEASE_ASSERT failures, we crash
1674 using WTFCrash(), and WTFCrash() is currently implemented as a function call
1675 that, in turn, calls a lot of other functions to do crash handling before
1676 actually crashing. As a result, the register values captured in the crash
1677 reports are not likely to still contain the values used by the caller function
1678 that failed the RELEASE_ASSERT.
1680 This patch aims to remedy this issue for non-debug builds on OS(DARWIN) ports.
1681 It does so by changing WTFCrash() into an inlined function that has an inlined
1682 asm statement to issues the CPU specific breakpoint trap instruction. As a
1683 result, for non-debug OS(DARWIN) builds, crashes due to failed RELEASE_ASSERTs
1684 will now show up in crash reports as crashing due to EXC_BREAKPOINT (SIGTRAP)
1685 instead of a EXC_BAD_ACCESS (SIGSEGV) on address 0xbbadbeef.
1687 For debug and non-DARWIN builds, WTFCrash() behavior currently remains unchanged.
1689 * wtf/Assertions.cpp:
1692 2016-02-09 Csaba Osztrogonác <ossy@webkit.org>
1694 [GTK][EFL] Fix several build configuration related to SamplingProfiler after r196245
1695 https://bugs.webkit.org/show_bug.cgi?id=154033
1697 Reviewed by Michael Catanzaro.
1701 2016-02-08 Filip Pizlo <fpizlo@apple.com>
1703 Make sure that locking code that relies on module boundaries for compiler fences uses NEVER_INLINE
1704 https://bugs.webkit.org/show_bug.cgi?id=153972
1706 Reviewed by Andreas Kling.
1708 When this code was written, we assumed that module boundaries were compiler fences. That might
1709 not be the case if we ever do LTO.
1712 (WTF::LockBase::lockSlow):
1713 (WTF::LockBase::unlockSlow):
1714 * wtf/ParkingLot.cpp:
1715 (WTF::ParkingLot::parkConditionally):
1716 (WTF::ParkingLot::unparkOne):
1717 (WTF::ParkingLot::unparkAll):
1718 (WTF::ParkingLot::forEach):
1720 (WTF::WordLock::lockSlow):
1721 (WTF::WordLock::unlockSlow):
1723 2016-02-07 Yusuke Suzuki <utatane.tea@gmail.com>
1725 [GTK][EFL] Enable SamplingProfiler
1726 https://bugs.webkit.org/show_bug.cgi?id=153638
1728 Reviewed by Michael Catanzaro.
1732 2016-02-07 Dan Bernstein <mitz@apple.com>
1734 [Cocoa] Replace __has_include guards around inclusion of Apple-internal-SDK headers with USE(APPLE_INTERNAL_SDK)
1735 https://bugs.webkit.org/show_bug.cgi?id=153963
1737 Reviewed by Sam Weinig.
1739 * wtf/SystemTracing.h:
1740 * wtf/WTFThreadData.h:
1741 * wtf/spi/darwin/CommonCryptoSPI.h:
1743 2016-02-06 Darin Adler <darin@apple.com>
1745 Finish auditing call sites of upper() and lower(), eliminate many, and rename the functions
1746 https://bugs.webkit.org/show_bug.cgi?id=153905
1748 Reviewed by Sam Weinig.
1750 * wtf/text/AtomicString.cpp:
1751 (WTF::AtomicString::lower): Deleted.
1752 * wtf/text/AtomicString.h: Deleted the lower function.
1754 * wtf/text/StringImpl.cpp:
1755 (WTF::StringImpl::convertToLowercaseWithoutLocale): Renamed from lower.
1756 (WTF::StringImpl::convertToUppercaseWithoutLocale): Renamed from upper.
1757 (WTF::StringImpl::convertToLowercaseWithLocale): Renamed from lower.
1758 (WTF::StringImpl::convertToUppercaseWithLocale): Renamed from upper.
1759 (WTF::StringImpl::foldCase): Added fast cases for ASCII since this is
1760 now used in some more-performance-critical code.
1761 * wtf/text/StringImpl.h: Renamed lower and upper.
1763 * wtf/text/WTFString.cpp:
1764 (WTF::String::convertToLowercaseWithoutLocale): Renamed from lower.
1765 (WTF::String::convertToUppercaseWithoutLocale): Renamed from upper.
1766 (WTF::String::convertToLowercaseWithLocale): Renamed from lower.
1767 (WTF::String::convertToUppercaseWithLocale): Renamed from upper.
1768 * wtf/text/WTFString.h: Renamed lower and upper. Removed unneeded comment.
1770 2016-02-03 Darin Adler <darin@apple.com>
1772 Convert another batch of String::lower callsites to something better, typically convertToASCIILowercase
1773 https://bugs.webkit.org/show_bug.cgi?id=153789
1775 Reviewed by Sam Weinig.
1777 * wtf/text/StringView.h:
1778 (WTF::StringView::toInt): Added an overload without the out parameter.
1780 2016-02-03 Michael Catanzaro <mcatanzaro@igalia.com>
1782 [GTK][EFL] Switch FTL to B3
1783 https://bugs.webkit.org/show_bug.cgi?id=153478
1785 Reviewed by Csaba Osztrogonác.
1787 Enable B3 by default on all x86.
1791 2016-02-03 Anders Carlsson <andersca@apple.com>
1793 Fix BlockPtr's call operator
1794 https://bugs.webkit.org/show_bug.cgi?id=153836
1796 Reviewed by Enrica Casucci.
1800 2016-02-01 Said Abou-Hallawa <sabouhallawa@apple.com>
1802 Cache the Path instead of creating it every time it is required
1803 https://bugs.webkit.org/show_bug.cgi?id=152939
1805 Reviewed by Darin Adler.
1807 If the key type of an LRU cache can't to be strongly tided to a specific
1808 data type; e.g. FloatRect -> Path, we need to be able to pass the policy
1809 type to the TinyLRUCache template instead of just specializing it. This
1810 will make the code more readable and will allow different caches for the
1813 * wtf/TinyLRUCache.h:
1814 (WebCore::TinyLRUCache::get):
1816 2016-02-01 Alex Christensen <achristensen@webkit.org>
1818 [Win] WTFHeaderDetection.h no longer needed
1819 https://bugs.webkit.org/show_bug.cgi?id=153753
1820 rdar://problem/24434627
1822 Reviewed by Darin Adler.
1825 * wtf/PlatformWin.cmake:
1827 2016-01-31 Darin Adler <darin@apple.com>
1829 Cut down on calls to String::lower; mostly replace with convertToASCIILowercase
1830 https://bugs.webkit.org/show_bug.cgi?id=153732
1832 Reviewed by Dean Jackson.
1834 * wtf/text/StringView.h: Added toIntStrict. Not thrilled about the name of this
1835 function, but generally it seems likely to be useful more often than toInt.
1836 And it's needed for one call site in WebCore that was using String::lower.
1838 2016-01-31 Darin Adler <darin@apple.com>
1840 Get rid of most calls to String::upper; mostly replace them with convertToASCIIUppercase
1841 https://bugs.webkit.org/show_bug.cgi?id=153715
1843 Reviewed by Gyuyoung Kim.
1845 * wtf/text/AtomicString.h:
1846 (WTF::AtomicString::upper): Deleted.
1848 2016-01-31 Dan Bernstein <mitz@apple.com>
1850 [Cocoa] Remove unused definition of HAVE_HEADER_DETECTION_H
1851 https://bugs.webkit.org/show_bug.cgi?id=153729
1853 Reviewed by Sam Weinig.
1855 After r141700, HAVE_HEADER_DETECTION_H is no longer used.
1857 * Configurations/Base.xcconfig:
1859 2016-01-31 Darin Adler <darin@apple.com>
1861 Replace CaseFoldingHash with ASCIICaseInsensitiveHash
1862 https://bugs.webkit.org/show_bug.cgi?id=153639
1864 Reviewed by Filip Pizlo.
1866 * wtf/text/StringHash.h: Renamed CaseFoldingHash to ASCIICaseInsensitiveHash.
1867 (WTF::ASCIICaseInsensitiveHash::foldCase): Use toASCIILower.
1868 (WTF::ASCIICaseInsensitiveHash::equal): Use equalIgnoringASCIICase.
1869 Also added some assertions.
1871 * wtf/text/StringImpl.cpp: Made the latin1CaseFoldTable private to this file,
1872 since it's no longer needed by CaseFoldingHash. Moved it up before its first use.
1873 (WTF::equalCompatibilityCaseless): Fixed typo in the name of this function.
1874 (WTF::equalCompatibiltyCaselessNonNull): Deleted.
1876 * wtf/text/StringImpl.h: Removed declarations of latin1CaseFoldTable and
1877 equalCompatibiltyCaselessNonNull
1879 2016-01-30 Commit Queue <commit-queue@webkit.org>
1881 Unreviewed, rolling out r195911.
1882 https://bugs.webkit.org/show_bug.cgi?id=153723
1884 Caused frequent assertion failures on bots (Requested by ap on
1889 "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
1890 https://bugs.webkit.org/show_bug.cgi?id=153639
1891 http://trac.webkit.org/changeset/195911
1893 2016-01-30 Darin Adler <darin@apple.com>
1895 Replace CaseFoldingHash with ASCIICaseInsensitiveHash
1896 https://bugs.webkit.org/show_bug.cgi?id=153639
1898 Reviewed by Filip Pizlo.
1900 * wtf/text/StringHash.h: Renamed CaseFoldingHash to ASCIICaseInsensitiveHash.
1901 (WTF::ASCIICaseInsensitiveHash::foldCase): Use toASCIILower.
1902 (WTF::ASCIICaseInsensitiveHash::equal): Use equalIgnoringASCIICase.
1903 Also added some assertions.
1905 * wtf/text/StringImpl.cpp: Made the latin1CaseFoldTable private to this file,
1906 since it's no longer needed by CaseFoldingHash. Moved it up before its first use.
1907 (WTF::equalCompatibilityCaseless): Fixed typo in the name of this function.
1908 (WTF::equalCompatibiltyCaselessNonNull): Deleted.
1910 * wtf/text/StringImpl.h: Removed declarations of latin1CaseFoldTable and
1911 equalCompatibiltyCaselessNonNull
1913 2016-01-29 Ada Chan <adachan@apple.com>
1915 Enable VIDEO_PRESENTATION_MODE only in Debug and Release builds on Mac
1916 https://bugs.webkit.org/show_bug.cgi?id=153665
1918 Reviewed by Dan Bernstein.
1921 Remove this as the flag is already defined in FeatureDefines.xcconfig files.
1923 2016-01-30 Yusuke Suzuki <utatane.tea@gmail.com>
1925 Enable SamplingProfiler on POSIX environment
1926 https://bugs.webkit.org/show_bug.cgi?id=153584
1928 Reviewed by Michael Saboff.
1930 Use __GLIBC__ since mcontext_t layout depends on it.
1934 2016-01-28 Darin Adler <darin@apple.com>
1936 Remove equalIgnoringCase since all callers really wanted equalIgnoringASCIICase
1937 https://bugs.webkit.org/show_bug.cgi?id=153411
1939 Reviewed by Ryosuke Niwa.
1941 * wtf/text/AtomicString.h: Removed equalIgnoringCase.
1942 Added some overloads for equalIgnoringASCIICase and moved the function bodies to
1943 bottom of the file to make the function declarations easier to read and scan through.
1944 I plan to do this for more of the functions in this class in the future.
1946 * wtf/text/StringCommon.h: Added overloads for equalIgnoringASCIICase,
1947 equalPossiblyIgnoringASCIICase, and a helper named equalIgnoringASCIICaseCommon.
1948 Added an overload for equalLettersIgnoringASCIICase.
1950 * wtf/text/StringImpl.cpp:
1951 (WTF::equalIgnoringCase): Made the few remaining versions of this function private
1952 to this file. Once we get done moving every client that should be using ASCII case
1953 instead to new functions, these will almost certainly be deleted.
1954 (WTF::equalIgnoringASCIICaseNonNull): Tweaked implementation a tiny bit.
1956 * wtf/text/StringImpl.h: Sorted forward declarations at the top of the file.
1957 Fixed some small formatting mistakes. Removed equalIgnoringCase, but left
1958 equalIgnoringCaseNonNull behind for use by CaseFoldingHash until it is replaced
1959 with ASCIICaseFoldingHash. Improved equalIgnoringASCIICase implementation.
1960 Removed unneeded using for equalIgnoringASCIICase now that StringCommon.h takes
1963 * wtf/text/StringView.cpp:
1964 (WTF::equalIgnoringASCIICase): Deleted. We no longer pass in the length for this,
1965 so the arguments have changed and the implementation is also now in ASCIICommon.h
1966 so it's an inline in the header file.
1968 * wtf/text/StringView.h: Added an overload of equalIgnoringASCIICase,while
1971 * wtf/text/WTFString.h: Removed some unneeded forward delcarations. Fixed formatting
1972 of the type name NSString *. Improved some comments. Removed equalIgnoringCase.
1973 Separated declaration from implementation in a few cases to start making the
1974 function declarations easier to read and scan through. I plan to do more in the future.
1976 2016-01-27 Chris Dumez <cdumez@apple.com>
1978 window.atob() should ignore spaces in input
1979 https://bugs.webkit.org/show_bug.cgi?id=153522
1980 <rdar://problem/24357822>
1982 Reviewed by Benjamin Poulain.
1984 Turn Base64DecodePolicy enum into flags so that the caller can indicate
1985 to both validate padding AND ignore spaces.
1987 Also make sure that the output Vector size is properly shrunk when
1990 * wtf/text/Base64.cpp:
1991 (WTF::base64DecodeInternal):
1992 (WTF::base64Decode):
1993 (WTF::base64URLDecode):
1994 * wtf/text/Base64.h:
1996 2016-01-27 Alexey Proskuryakov <ap@apple.com>
1998 Remove ENABLE_CURRENTSRC
1999 https://bugs.webkit.org/show_bug.cgi?id=153545
2001 Reviewed by Simon Fraser.
2003 * wtf/FeatureDefines.h:
2005 2016-01-26 I-Ting Liu <iting_liu@apple.com>
2007 Implement wildcard matching for plug-in policy host.
2008 https://bugs.webkit.org/show_bug.cgi?id=153090
2010 Reviewed by Darin Adler.
2012 * wtf/text/AtomicString.h:
2013 (WTF::AtomicString::AtomicString):
2014 Add __bridge to allow compilation.
2016 2016-01-26 Joseph Pecoraro <pecoraro@apple.com>
2018 Generalize ResourceUsageData gathering to be used outside of ResourceUsageOverlay
2019 https://bugs.webkit.org/show_bug.cgi?id=153509
2020 <rdar://problem/24354291>
2022 Reviewed by Andreas Kling.
2025 Rename the ENABLE flag.
2027 2016-01-26 Yusuke Suzuki <utatane.tea@gmail.com>
2029 Make HashTable iterators STL iterators compatible
2030 https://bugs.webkit.org/show_bug.cgi?id=153512
2032 Reviewed by Alex Christensen.
2034 While r178581 makes many hash table iterators STL compatible, still several iterators are not.
2035 This patch fixes that; inheriting std::iterator correctly to meet STL iterator requirements (like iterator_category etc.)
2036 It could recover Windows build failure.
2040 2016-01-26 Anders Carlsson <andersca@apple.com>
2042 BlockPtr needs boolean operators
2043 https://bugs.webkit.org/show_bug.cgi?id=153506
2045 Reviewed by Tim Horton.
2049 2016-01-25 Filip Pizlo <fpizlo@apple.com>
2051 FTLB3Output should maintain good block order like the LLVM one does
2052 https://bugs.webkit.org/show_bug.cgi?id=152222
2054 Reviewed by Geoffrey Garen.
2056 In the FTL we need to be able to construct a list by inserting elements before other
2057 specific elements. We didn't already have a scalable way to do this, so this adds such a
2058 data structure to WTF. This also has changes to SentinelLinkedList to make it support
2059 these kinds of insertions.
2061 * WTF.xcodeproj/project.pbxproj:
2062 * wtf/OrderMaker.h: Added.
2063 (WTF::OrderMaker::Node::Node):
2064 (WTF::OrderMaker::OrderMaker):
2065 (WTF::OrderMaker::prepend):
2066 (WTF::OrderMaker::append):
2067 (WTF::OrderMaker::insertBefore):
2068 (WTF::OrderMaker::insertAfter):
2069 (WTF::OrderMaker::iterator::iterator):
2070 (WTF::OrderMaker::iterator::operator*):
2071 (WTF::OrderMaker::iterator::operator++):
2072 (WTF::OrderMaker::iterator::operator==):
2073 (WTF::OrderMaker::iterator::operator!=):
2074 (WTF::OrderMaker::begin):
2075 (WTF::OrderMaker::end):
2076 (WTF::OrderMaker::newNode):
2077 * wtf/SentinelLinkedList.h:
2078 (WTF::BasicRawSentinelNode::isOnList):
2079 (WTF::BasicRawSentinelNode<T>::remove):
2080 (WTF::BasicRawSentinelNode<T>::prepend):
2081 (WTF::BasicRawSentinelNode<T>::append):
2082 (WTF::RawNode>::SentinelLinkedList):
2083 (WTF::RawNode>::push):
2084 (WTF::RawNode>::append):
2085 (WTF::RawNode>::remove):
2086 (WTF::RawNode>::prepend):
2087 (WTF::RawNode>::isOnList):
2089 2016-01-25 Alex Christensen <achristensen@webkit.org>
2091 [Win] Copy forwarding headers before building a project
2092 https://bugs.webkit.org/show_bug.cgi?id=153434
2094 Reviewed by Brent Fulgham.
2096 * wtf/CMakeLists.txt:
2097 * wtf/PlatformWin.cmake:
2099 2016-01-20 Ryosuke Niwa <rniwa@webkit.org>
2101 HTMLElement::nodeName should not upper case non-ASCII characters
2102 https://bugs.webkit.org/show_bug.cgi?id=153231
2104 Reviewed by Darin Adler.
2106 Added convertToASCIIUppercase to AtomicString, String, and StringImpl.
2108 * wtf/text/AtomicString.cpp:
2109 (WTF::AtomicString::convertASCIICase): Generalized from convertToASCIILowercase.
2110 (WTF::AtomicString::convertToASCIILowercase):
2111 (WTF::AtomicString::convertToASCIIUppercase):
2112 * wtf/text/AtomicString.h:
2113 * wtf/text/StringImpl.cpp:
2114 (WTF::StringImpl::convertASCIICase): Generalized from convertToASCIILowercase.
2115 (WTF::StringImpl::convertToASCIILowercase):
2116 (WTF::StringImpl::convertToASCIIUppercase):
2117 * wtf/text/StringImpl.h:
2118 * wtf/text/WTFString.cpp:
2119 (WTF::String::convertToASCIIUppercase): Added.
2120 * wtf/text/WTFString.h:
2122 2016-01-22 Chris Dumez <cdumez@apple.com>
2124 Unreviewed attempt to fix the Windows build after r195452.
2126 * wtf/text/WTFString.h:
2128 2016-01-22 Darin Adler <darin@apple.com>
2130 Reduce use of equalIgnoringCase to just ignore ASCII case
2131 https://bugs.webkit.org/show_bug.cgi?id=153266
2133 Reviewed by Ryosuke Niwa.
2136 (WTF::isASCIIAlphaCaselessEqual): Loosened the assertion in this function
2137 so it can work with ASCII spaces, numeric digits, and some punctuation.
2138 Commented that we might want to change its name later.
2140 * wtf/Assertions.cpp:
2141 (WTFInitializeLogChannelStatesFromString): Use equalLettersIgnoringASCIICase.
2143 * wtf/text/AtomicString.h:
2144 (WTF::equalLettersIgnoringASCIICase): Added. Calls the version that takes a String.
2146 * wtf/text/StringCommon.h:
2147 (WTF::equalLettersIgnoringASCIICase): Added. Takes a pointer to characters.
2148 (WTF::equalLettersIgnoringASCIICaseCommonWithoutLength): Added.
2149 (WTF::equalLettersIgnoringASCIICaseCommon): Added.
2151 * wtf/text/StringImpl.h:
2152 (WTF::equalLettersIgnoringASCIICase): Added. Calls equalLettersIgnoringASCIICaseCommon.
2154 * wtf/text/StringView.h:
2155 (WTF::equalLettersIgnoringASCIICase): Added. Calls equalLettersIgnoringASCIICaseCommon.
2157 * wtf/text/WTFString.h: Reordered/reformatted a little.
2158 (WTF::equalIgnoringASCIICase): Added. Calls the version that takes a StringImpl.
2160 2016-01-22 Csaba Osztrogonác <ossy@webkit.org>
2162 Buildfix for older GCCs after r195142
2163 https://bugs.webkit.org/show_bug.cgi?id=153351
2165 Unreviewed buildfix.
2167 * wtf/SystemTracing.h:
2169 2016-01-21 Filip Pizlo <fpizlo@apple.com>
2171 REGRESSION(r195417): many tests crash
2172 https://bugs.webkit.org/show_bug.cgi?id=153316
2174 Reviewed by Saam Barati.
2176 This rolls out the StdLibExtras.h change, and simplifies RangeSet to not use binary search.
2177 That's fine for now, since B3 doesn't stress RangeSet enough right now.
2180 (WTF::RangeSet::contains):
2181 (WTF::RangeSet::overlaps):
2182 (WTF::RangeSet::clear):
2183 (WTF::RangeSet::findRange):
2184 * wtf/StdLibExtras.h:
2185 (WTF::binarySearchImpl):
2186 (WTF::binarySearch):
2187 (WTF::tryBinarySearch):
2188 (WTF::approximateBinarySearch):
2190 2016-01-21 Filip Pizlo <fpizlo@apple.com>
2192 B3 should have load elimination
2193 https://bugs.webkit.org/show_bug.cgi?id=153288
2195 Reviewed by Geoffrey Garen.
2197 I needed a way to track sets of ranges, where there is a high likelihood that all of the
2198 ranges overlap. So I created RangeSet. It's a usually-sorted list of coalesced ranges.
2199 Practically this means that right now, FTL B3 will end up with two kinds of range sets: a set
2200 that just contains top and a set that contains nothing. In the future, most sets will either
2201 be top of empty but some of them will contain a handful of other things.
2203 * WTF.xcodeproj/project.pbxproj:
2204 * wtf/CMakeLists.txt:
2206 (WTF::leftShiftWithSaturation):
2207 (WTF::nonEmptyRangesOverlap):
2208 (WTF::rangesOverlap):
2209 * wtf/RangeSet.h: Added.
2210 (WTF::RangeSet::RangeSet):
2211 (WTF::RangeSet::~RangeSet):
2212 (WTF::RangeSet::add):
2213 (WTF::RangeSet::contains):
2214 (WTF::RangeSet::overlaps):
2215 (WTF::RangeSet::clear):
2216 (WTF::RangeSet::dump):
2217 (WTF::RangeSet::dumpRaw):
2218 (WTF::RangeSet::compact):
2219 (WTF::RangeSet::overlapsNonEmpty):
2220 (WTF::RangeSet::subsumesNonEmpty):
2221 (WTF::RangeSet::findRange):
2222 * wtf/StdLibExtras.h:
2223 (WTF::binarySearchImpl):
2224 (WTF::binarySearch):
2225 (WTF::tryBinarySearch):
2226 (WTF::approximateBinarySearch):
2228 2016-01-19 Ada Chan <adachan@apple.com>
2230 Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
2231 https://bugs.webkit.org/show_bug.cgi?id=153218
2233 Reviewed by Eric Carlson.
2237 2016-01-19 Filip Pizlo <fpizlo@apple.com>
2239 B3 should have basic path specialization
2240 https://bugs.webkit.org/show_bug.cgi?id=153200
2242 Reviewed by Benjamin Poulain.
2244 * wtf/GraphNodeWorklist.h:
2245 (WTF::GraphNodeWorklist::push):
2246 (WTF::GraphNodeWorklist::pushAll):
2247 (WTF::GraphNodeWorklist::isEmpty):
2248 (WTF::GraphNodeWorklist::notEmpty):
2250 2016-01-20 Said Abou-Hallawa <sabouhallawa@apple.com>
2252 Refactor AtomicStringKeyedMRUCache to be a generic LRU cache
2253 https://bugs.webkit.org/show_bug.cgi?id=153109
2255 Reviewed by Darin Adler.
2257 Refactor AtomicStringKeyedMRUCache, move it to WTF project and rename it
2258 to be TinyLRUCache. Define another template and call it TinyLRUCachePolicy.
2259 This one can be overridden for different keys and values. Its function is
2260 creating the cached values.
2262 * WTF.xcodeproj/project.pbxproj:
2263 * wtf/TinyLRUCache.h: Added.
2264 (WebCore::TinyLRUCachePolicy::isKeyNull):
2265 (WebCore::TinyLRUCachePolicy::createValueForNullKey):
2266 (WebCore::TinyLRUCachePolicy::createValueForKey):
2267 (WebCore::TinyLRUCache::get):
2269 2016-01-19 Saam barati <sbarati@apple.com>
2271 WTF::Bag should be non-copyable
2272 https://bugs.webkit.org/show_bug.cgi?id=153253
2274 Reviewed by Filip Pizlo.
2277 * wtf/SegmentedVector.h:
2278 (WTF::SegmentedVector::append):
2279 (WTF::SegmentedVector::alloc):
2281 2016-01-19 Enrica Casucci <enrica@apple.com>
2283 Add support for DataDetectors in WK (iOS).
2284 https://bugs.webkit.org/show_bug.cgi?id=152989
2285 rdar://problem/22855960
2287 Reviewed by Tim Horton.
2289 Adding feature definition for data detection.
2291 * wtf/FeatureDefines.h:
2293 2016-01-19 Commit Queue <commit-queue@webkit.org>
2295 Unreviewed, rolling out r195300.
2296 https://bugs.webkit.org/show_bug.cgi?id=153244
2298 enrica wants more time to fix Windows (Requested by thorton on
2303 "Add support for DataDetectors in WK (iOS)."
2304 https://bugs.webkit.org/show_bug.cgi?id=152989
2305 http://trac.webkit.org/changeset/195300
2307 2016-01-19 Chris Dumez <cdumez@apple.com>
2309 Unreviewed, rolling out r195141.
2311 Seems to cause crashes on iOS9 64bit
2315 "Fragmentation-free allocator for timeless and/or coupled
2317 https://bugs.webkit.org/show_bug.cgi?id=152696
2318 http://trac.webkit.org/changeset/195141
2320 2016-01-19 Enrica Casucci <enrica@apple.com>
2322 Add support for DataDetectors in WK (iOS).
2323 https://bugs.webkit.org/show_bug.cgi?id=152989
2324 rdar://problem/22855960
2326 Reviewed by Tim Horton.
2328 Adding feature definition for data detection.
2330 * wtf/FeatureDefines.h:
2332 2016-01-17 Filip Pizlo <fpizlo@apple.com>
2334 FTL B3 should be just as fast as FTL LLVM on Octane/crypto
2335 https://bugs.webkit.org/show_bug.cgi?id=153113
2337 Reviewed by Saam Barati.
2339 * wtf/IndexSparseSet.h:
2340 (WTF::IndexSparseSet<OverflowHandler>::IndexSparseSet):
2341 (WTF::IndexSparseSet<OverflowHandler>::add):
2342 (WTF::IndexSparseSet<OverflowHandler>::remove):
2343 * wtf/StringPrintStream.h:
2344 (WTF::StringPrintStream::length):
2346 2016-01-17 Michael Catanzaro <mcatanzaro@igalia.com>
2348 [CMake] Do not build bmalloc when USE_SYSTEM_MALLOC is ON
2349 https://bugs.webkit.org/show_bug.cgi?id=153190
2351 Reviewed by Csaba Osztrogonác.
2353 Build bmalloc when NOT USE_SYSTEM_MALLOC rather than when NOT WIN32.
2355 * wtf/CMakeLists.txt:
2357 2016-01-15 Simon Fraser <simon.fraser@apple.com>
2359 Add kdebug_trace signposts for a few WebCore operations
2360 https://bugs.webkit.org/show_bug.cgi?id=153136
2361 rdar://problem/24208487
2363 Reviewed by Sam Weinig.
2365 New header with the reserved WebKit component code, trace point codes, and
2366 a stack-based helper that traces scope entry and exit.
2368 The available range of trace point codes is arbitrarily segmented into WTF, JSC,
2369 WebCore, WebKit and WebKit2.
2371 * WTF.xcodeproj/project.pbxproj:
2372 * wtf/CMakeLists.txt:
2373 * wtf/SystemTracing.h: Added.
2374 (WTF::TraceScope::TraceScope):
2375 (WTF::TraceScope::~TraceScope):
2377 2016-01-15 Andreas Kling <akling@apple.com>
2379 Fragmentation-free allocator for timeless and/or coupled allocations.
2380 <https://webkit.org/b/152696>
2382 Reviewed by Antti Koivisto.
2384 Introduce BumpArena, a space-efficient memory allocator for situations where
2385 you feel pretty confident betting on allocation lifetimes.
2389 - Reserves 128MB range of memory at startup.
2390 - Allocates 4kB-aligned blocks of 4kB from VM at a time.
2391 - Bump-pointer allocates out of a block until it reaches end.
2392 - Each allocation increments the ref-count of its block.
2393 - Each deallocation decrements the ref-count of its block.
2394 - Transparently falls back to fastMalloc()/fastFree() when needed.
2398 - BumpArena::create()
2400 Create your very own BumpArena!
2402 - BumpArena::allocate(BumpArena* arena, size_t size)
2404 Allocates 'size' bytes of memory from 'arena'.
2405 If 'arena' is null, falls back to fastMalloc().
2407 - BumpArena::deallocate(void* ptr)
2409 If 'ptr' is BumpArena allocation, decrements block ref-count.
2410 If 'ptr' is FastMalloc allocation, calls fastFree() on it.
2412 - WTF_MAKE_BUMPARENA_ALLOCATED;
2414 Macro that gives a class or struct custom operators new and delete
2415 for allocation out of BumpArena. Just like WTF_MAKE_FAST_ALLOCATED;
2417 Note that while the name of this patch says "fragmentation-free allocator"
2418 it will only be fragmentation-free when used for appropriate things.
2419 This is not meant to be a general-purpose allocator. Only use it for sets of
2420 allocations that are known to die roughly at the same time.
2422 BumpArena will never resume allocating from a block that has been filled,
2423 so it's even more important than usual that everything gets deallocated.
2425 BumpArena redirects allocations to FastMalloc in three cases:
2427 - When invoked with a null BumpArena*
2428 - When allocation request is larger than BumpArena's block size (4kB)
2429 - When BumpArena has exhausted all of its pre-reserved VM. (128MB)
2431 The VM allocator will eagerly return blocks of VM to the kernel by calling
2432 madvise(). Average time spent in madvise is around 0.007ms on my box.
2434 * WTF.vcxproj/WTF.vcxproj:
2435 * WTF.vcxproj/WTF.vcxproj.filters:
2436 * WTF.xcodeproj/project.pbxproj:
2437 * wtf/BumpArena.cpp: Added.
2438 (WTF::BumpArena::Block::capacity):
2439 (WTF::BumpArena::Block::arena):
2440 (WTF::BumpArena::Block::payloadStart):
2442 (WTF::BumpArena::Block::Block):
2443 (WTF::BumpArena::Block::~Block):
2444 (WTF::BumpArena::Block::ref):
2445 (WTF::BlockAllocator::BlockAllocator):
2446 (WTF::BlockAllocator::isAllocation):
2447 (WTF::blockAllocator):
2448 (WTF::BlockAllocator::allocateBlock):
2449 (WTF::BlockAllocator::deallocateBlock):
2450 (WTF::BumpArena::Block::deref):
2451 (WTF::BumpArena::Block::create):
2452 (WTF::BumpArena::Block::dump):
2453 (WTF::BumpArena::dump):
2454 (WTF::BumpArena::create):
2455 (WTF::BumpArena::BumpArena):
2456 (WTF::BumpArena::~BumpArena):
2457 (WTF::BumpArena::allocateSlow):
2458 (WTF::BumpArena::allocate):
2459 (WTF::BumpArena::deallocate):
2460 (WTF::BumpArena::Block::blockFor):
2461 (WTF::BumpArena::arenaFor):
2462 * wtf/BumpArena.h: Added.
2463 * wtf/CMakeLists.txt:
2465 2016-01-15 Konstantin Tokarev <annulen@yandex.ru>
2467 [EFL] WorkQueue methods should be defined inside WTF namespace.
2468 https://bugs.webkit.org/show_bug.cgi?id=153097
2470 Reviewed by Gyuyoung Kim.
2472 * wtf/efl/WorkQueueEfl.cpp:
2474 2016-01-14 Chris Dumez <cdumez@apple.com>
2476 Unreviewed, rolling out r195035.
2478 Caused 1-3% PLT regression on iOS
2482 "Part 2/2: Stop using USE(CFNETWORK) path on iOS"
2483 https://bugs.webkit.org/show_bug.cgi?id=142540
2484 http://trac.webkit.org/changeset/195035
2486 2016-01-14 David Kilzer <ddkilzer@apple.com>
2488 Part 2/2: Stop using USE(CFNETWORK) path on iOS
2489 <https://webkit.org/b/142540>
2491 Original patch by Antti Koivisto <antti@apple.com> on 2015-03-10
2492 Reviewed by Chris Dumez.
2494 * wtf/Platform.h: Turn off USE(CFNETWORK) for PLATFORM(IOS).
2496 2016-01-14 Per Arne Vollan <peavo@outlook.com>
2498 [Win] Remove workarounds for fixed bugs in fmod and pow.
2499 https://bugs.webkit.org/show_bug.cgi?id=153071
2501 Reviewed by Brent Fulgham.
2503 The bugs have been fixed in the MSVC CRT, and we can remove the workarounds.
2506 (wtf_fmod): Deleted.
2509 2016-01-13 Commit Queue <commit-queue@webkit.org>
2511 Unreviewed, rolling out r194963.
2512 https://bugs.webkit.org/show_bug.cgi?id=153079
2514 This change causes ASan tests to crash and exit early
2515 (Requested by ryanhaddad on #webkit).
2519 "Fragmentation-free allocator for timeless and/or coupled
2521 https://bugs.webkit.org/show_bug.cgi?id=152696
2522 http://trac.webkit.org/changeset/194963
2524 2016-01-13 Andreas Kling <akling@apple.com>
2526 Fragmentation-free allocator for timeless and/or coupled allocations.
2527 <https://webkit.org/b/152696>
2529 Reviewed by Antti Koivisto.
2531 Introduce BumpArena, a space-efficient memory allocator for situations where
2532 you feel pretty confident betting on allocation lifetimes.
2536 - Allocates 4kB-aligned blocks of 4kB from bmalloc at a time.
2537 - Bump-pointer allocates out of a block until it reaches end.
2538 - Each allocation increments the ref-count of its block.
2539 - Each deallocation decrements the ref-count of its block.
2543 - BumpArena::create()
2545 Create your very own BumpArena!
2547 - BumpArena::allocate(BumpArena* arena, size_t size)
2549 Allocates 'size' bytes of memory from 'arena'.
2550 If 'arena' is null, allocation comes out of the shared global BumpArena.
2552 - BumpArena::deallocate(void* ptr)
2554 Deallocates 'ptr', decrementing the ref-count of its block.
2556 - WTF_MAKE_BUMPARENA_ALLOCATED;
2558 Macro that gives a class or struct custom operators new and delete
2559 for allocation out of BumpArena. Just like WTF_MAKE_FAST_ALLOCATED;
2561 Note that while the name of this patch says "fragmentation-free allocator"
2562 it will only be fragmentation-free when used for appropriate things.
2563 This is not meant to be a general-purpose allocator. Only use it for sets of
2564 allocations that are known to die roughly at the same time.
2566 BumpArena will never resume allocating from a block that has been filled,
2567 so it's even more important than usual that everything gets deallocated.
2569 As noted above, calling allocate() with a null BumpArena will allocate out
2570 of a global shared arena. Ideally you're always allocating out of a specific,
2571 controlled arena, but there are situations where you may not have one.
2573 * WTF.vcxproj/WTF.vcxproj:
2574 * WTF.vcxproj/WTF.vcxproj.filters:
2575 * WTF.xcodeproj/project.pbxproj:
2576 * wtf/BumpArena.cpp: Added.
2577 (WTF::BumpArena::Block::defaultCapacity):
2578 (WTF::BumpArena::Block::arena):
2579 (WTF::BumpArena::Block::payloadStart):
2582 (WTF::BumpArena::Block::Block):
2583 (WTF::BumpArena::Block::~Block):
2584 (WTF::BumpArena::Block::ref):
2585 (WTF::BumpArena::Block::deref):
2586 (WTF::BumpArena::Block::create):
2587 (WTF::BumpArena::Block::dump):
2588 (WTF::BumpArena::dump):
2589 (WTF::BumpArena::create):
2590 (WTF::BumpArena::BumpArena):
2591 (WTF::BumpArena::~BumpArena):
2592 (WTF::BumpArena::allocateSlow):
2593 (WTF::BumpArena::allocate):
2594 (WTF::BumpArena::deallocate):
2595 (WTF::BumpArena::Block::blockFor):
2596 (WTF::BumpArena::arenaFor):
2597 * wtf/BumpArena.h: Added.
2598 * wtf/CMakeLists.txt:
2600 2016-01-08 Andy Estes <aestes@apple.com>
2602 [Content Filtering] Lazily load platform frameworks
2603 https://bugs.webkit.org/show_bug.cgi?id=152881
2604 rdar://problem/23270886
2606 Reviewed by Brady Eidson.
2608 * wtf/Platform.h: Moved definition of HAVE_NETWORK_EXTENSION to here from WebCore/platform/cocoa/NetworkExtensionContentFilter.h.
2610 2016-01-12 Ryosuke Niwa <rniwa@webkit.org>
2612 Add a build flag for custom element
2613 https://bugs.webkit.org/show_bug.cgi?id=153005
2615 Reviewed by Alex Christensen.
2617 * wtf/FeatureDefines.h:
2619 2016-01-11 Andreas Kling <akling@apple.com>
2621 NeverDestroyed should relax adoption requirements on all RefCountedBase subclasses.
2622 <https://webkit.org/b/152960>
2624 Reviewed by Antti Koivisto.
2626 Instead of relaxing on subclasses of RefCounted<T>, relax on subclasses of RefCountedBase.
2627 This allows e.g NeverDestroyed<CSSPrimitiveValue> to relax its pointee despite the class
2628 hierarchy starting with RefCounted<CSSValue> (not RefCounted<CSSPrimitiveValue>.)
2630 * wtf/NeverDestroyed.h:
2632 2016-01-10 Saam barati <sbarati@apple.com>
2634 Implement a sampling profiler
2635 https://bugs.webkit.org/show_bug.cgi?id=151713
2637 Reviewed by Filip Pizlo.
2639 * wtf/MetaAllocator.cpp:
2640 (WTF::MetaAllocator::decrementPageOccupancy):
2641 (WTF::MetaAllocator::isInAllocatedMemory):
2642 (WTF::MetaAllocator::roundUp):
2643 * wtf/MetaAllocator.h:
2644 (WTF::MetaAllocator::getLock):
2647 2016-01-10 Filip Pizlo <fpizlo@apple.com>
2649 It should be possible to run liveness over registers without also tracking Tmps
2650 https://bugs.webkit.org/show_bug.cgi?id=152963
2652 Reviewed by Saam Barati.
2654 Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of
2655 places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of
2658 Also made the iterator methods of BitVector live on BitVector directly rather than behind the
2659 thing returned from setBits(). This makes sense since that makes BitVector even more of a
2660 drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a
2661 BitVector other than this, so it doesn't make sense to make it harder to access.
2664 (WTF::BitVector::get):
2665 (WTF::BitVector::contains):
2666 (WTF::BitVector::set):
2667 (WTF::BitVector::add):
2668 (WTF::BitVector::ensureSizeAndSet):
2669 (WTF::BitVector::clear):
2670 (WTF::BitVector::remove):
2671 (WTF::BitVector::hash):
2672 (WTF::BitVector::iterator::iterator):
2673 (WTF::BitVector::iterator::operator*):
2674 (WTF::BitVector::iterator::operator++):
2675 (WTF::BitVector::iterator::operator==):
2676 (WTF::BitVector::iterator::operator!=):
2677 (WTF::BitVector::begin):
2678 (WTF::BitVector::end):
2679 (WTF::BitVector::bitsInPointer):
2680 (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted.
2681 (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted.
2682 (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted.
2683 (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted.
2684 (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted.
2685 (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted.
2686 (WTF::BitVector::SetBitsIterable::begin): Deleted.
2687 (WTF::BitVector::SetBitsIterable::end): Deleted.
2688 (WTF::BitVector::setBits): Deleted.
2690 2016-01-09 Andreas Kling <akling@apple.com>
2692 Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
2693 <https://webkit.org/b/152902>
2695 Reviewed by Anders Carlsson.
2697 Mostly mechanical conversion to NeverDestroyed throughout WTF.
2700 (WTF::RunLoop::current):
2701 * wtf/ThreadingPthreads.cpp:
2702 (WTF::threadMapMutex):
2705 2016-01-08 Anders Carlsson <andersca@apple.com>
2707 Nullopt and InPlace should be structs, not enum values
2708 https://bugs.webkit.org/show_bug.cgi?id=152915
2710 Reviewed by Andreas Kling.
2714 Optional<int> o = flag ? 1 : Nullopt;
2716 would cause Nullopt to be treated as an integer, causing o to be initialized to 0,
2717 instead of Nullopt. With this change, the above code now causes a compile error.
2719 Also, get rid of the CONSTEXPR macro since all compilers support constexpr properly,
2720 and add a WTF::makeOptional to match the current iteration of std::experimental::optional.
2725 (WTF::NulloptTag::NulloptTag):
2726 (WTF::makeOptional):
2727 * wtf/StdLibExtras.h:
2728 (std::literals::chrono_literals::operator _s):
2729 (std::literals::chrono_literals::operator _ms):
2732 2016-01-06 Anders Carlsson <andersca@apple.com>
2734 Add a smart block pointer
2735 https://bugs.webkit.org/show_bug.cgi?id=152799
2737 Reviewed by Tim Horton.
2739 Introduce WTF::BlockPtr, a smart block pointer.
2741 * WTF.xcodeproj/project.pbxproj:
2742 * wtf/BlockPtr.h: Added.
2743 (WTF::makeBlockPtr):
2745 2016-01-04 Carlos Garcia Campos <cgarcia@igalia.com>
2747 [GTK] Allow to save and restore session
2748 https://bugs.webkit.org/show_bug.cgi?id=115600
2750 Reviewed by Michael Catanzaro.
2752 Add GVariantIter specialization of GUniquePtr.
2754 * wtf/glib/GTypedefs.h:
2755 * wtf/glib/GUniquePtr.h:
2757 2016-01-04 Tim Horton <timothy_horton@apple.com>
2759 Turn on gesture events when building for Yosemite
2760 https://bugs.webkit.org/show_bug.cgi?id=152704
2761 rdar://problem/24042472
2763 Reviewed by Anders Carlsson.
2765 * wtf/FeatureDefines.h:
2767 2016-01-04 Benjamin Poulain <bpoulain@apple.com>
2769 [JSC] Build B3 by default on iOS ARM64
2770 https://bugs.webkit.org/show_bug.cgi?id=152525
2772 Reviewed by Filip Pizlo.
2776 2016-01-03 Andreas Kling <akling@apple.com>
2778 Unreviewed, rolling out r194510.
2780 Broke 2 API tests, no time to investigate right now
2784 "StringBuilder often creates two StringImpls."
2785 https://bugs.webkit.org/show_bug.cgi?id=152662
2786 http://trac.webkit.org/changeset/194510
2788 2016-01-03 Khem Raj <raj.khem@gmail.com>
2790 WebKit fails to build with musl libc library
2791 https://bugs.webkit.org/show_bug.cgi?id=152625
2793 Reviewed by Daniel Bates.
2795 Disable ctype.h check for musl C library on Linux.
2796 Enable backtrace on Linux when using glibc.
2797 We don't have backtrace() implemented on non-glibc system
2798 C libraries on Linux e.g. musl.
2800 * wtf/DisallowCType.h: Check for __GLIBC__.
2801 * wtf/Assertions.cpp:
2802 (WTFGetBacktrace): Check if libc is glibc.
2804 2016-01-03 Andreas Kling <akling@apple.com>
2806 StringBuilder often creates two StringImpls.
2807 <https://webkit.org/b/152662>
2809 Reviewed by Anders Carlsson.
2811 If StringBuilder didn't manage to guess the exact final length of the
2812 string being built, it would still keep the buffer around, and the final
2813 build process would then return a substring into that buffer.
2815 This effectively yielded two StringImpls instead of one, with the substring
2816 retaining the longer buffer StringImpl.
2818 This patch improves the situation by having StringImpl crop the buffer's
2819 m_length field to the final built string length. That way we never have to
2822 * wtf/text/StringBuilder.cpp:
2823 (WTF::StringBuilder::reifyString):
2824 * wtf/text/StringImpl.h:
2826 2016-01-03 Andreas Kling <akling@apple.com>
2828 Remove redundant StringImpl substring creation function.
2829 <https://webkit.org/b/152652>
2831 Reviewed by Daniel Bates.
2833 Remove StringImpl::createSubstringSharingImpl8() and make the only
2834 caller use createSubstringSharingImpl() instead.
2836 They do the same thing anyway, the only difference is that the branch
2837 on is8Bit() now happens in the callee instead of at the call site.
2839 * wtf/text/StringImpl.h:
2840 (WTF::StringImpl::createSubstringSharingImpl8): Deleted.
2842 2015-12-31 Andy Estes <aestes@apple.com>
2844 Replace WTF::move with WTFMove
2845 https://bugs.webkit.org/show_bug.cgi?id=152601
2847 Reviewed by Brady Eidson.
2849 This also removes the definition of WTF::move.
2855 (WTF::HashTable::add):
2856 (WTF::KeyTraits>::HashTable):
2858 (WTF::executeInsertions):
2859 * wtf/IteratorAdaptors.h:
2860 (WTF::FilterIterator::FilterIterator):
2861 (WTF::TransformIterator::TransformIterator):
2862 (WTF::makeTransformIterator):
2863 * wtf/IteratorRange.h:
2864 (WTF::IteratorRange::IteratorRange):
2865 * wtf/ListHashSet.h:
2866 (WTF::U>::takeFirst):
2867 (WTF::U>::takeLast):
2868 * wtf/MainThread.cpp:
2869 (WTF::callOnMainThread):
2871 (WTF::MallocPtr::operator=):
2872 * wtf/MessageQueue.h:
2873 (WTF::MessageQueue<DataType>::append):
2874 (WTF::MessageQueue<DataType>::appendAndKill):
2875 (WTF::MessageQueue<DataType>::appendAndCheckEmpty):
2876 (WTF::MessageQueue<DataType>::prepend):
2879 * wtf/OSObjectPtr.h:
2880 (WTF::OSObjectPtr::operator=):
2882 (WTF::Optional::Optional):
2883 (WTF::Optional::operator=):
2889 (WTF::RunLoop::dispatch):
2891 (WTF::createSharedTask):
2892 * wtf/StdLibExtras.h:
2893 (WTF::move): Deleted.
2894 * wtf/Threading.cpp:
2895 (WTF::threadEntryPoint):
2896 (WTF::createThread):
2898 (WTF::Vector::takeLast):
2899 * wtf/efl/DispatchQueueEfl.cpp:
2900 (DispatchQueue::dispatch):
2901 (DispatchQueue::setSocketEventHandler):
2902 (DispatchQueue::performTimerWork):
2903 (DispatchQueue::insertTimerWorkItem):
2904 * wtf/efl/DispatchQueueWorkItemEfl.h:
2905 (WorkItem::WorkItem):
2906 (TimerWorkItem::create):
2907 (TimerWorkItem::TimerWorkItem):
2908 * wtf/efl/WorkQueueEfl.cpp:
2909 (WorkQueue::registerSocketEventHandler):
2910 (WorkQueue::dispatch):
2911 (WorkQueue::dispatchAfter):
2912 * wtf/glib/GRefPtr.h:
2914 * wtf/glib/WorkQueueGLib.cpp:
2915 (WTF::DispatchAfterContext::DispatchAfterContext):
2916 (WTF::WorkQueue::dispatchAfter):
2917 * wtf/text/AtomicString.h:
2918 (WTF::AtomicString::AtomicString):
2919 (WTF::AtomicString::operator=):
2920 * wtf/text/StringConcatenate.h:
2921 (WTF::tryMakeString):
2922 * wtf/text/WTFString.cpp:
2923 (WTF::String::isolatedCopy):
2924 * wtf/text/WTFString.h:
2925 (WTF::String::String):
2926 (WTF::StringCapture::releaseString):
2927 * wtf/win/GDIObject.h:
2930 2015-12-31 David Kilzer <ddkilzer@apple.com>
2932 Stop using USE(CFNETWORK) path on iOS
2933 <https://webkit.org/b/142540>
2935 Step 1/2: Do everything but turn off USE(CFNETWORK) internally.
2937 Original patch by Antti Koivisto <antti@apple.com> on 2015-03-10
2938 Reviewed by Daniel Bates.
2940 * wtf/SchedulePair.h: Update macros to match WebCore.
2942 2015-12-31 Andy Estes <aestes@apple.com>
2944 Rename WTF_MOVE to WTFMove
2945 https://bugs.webkit.org/show_bug.cgi?id=152601
2947 Reviewed by Daniel Bates.
2949 Our coding style guidelines say that macros that expand to function calls should be named like functions,
2950 so WTFMove() is a more appropriate name.
2952 * wtf/StdLibExtras.h:
2954 2015-12-30 Andy Estes <aestes@apple.com>
2956 Use of WTF::move prevents clang's move diagnostics from warning about several classes of mistakes
2957 https://bugs.webkit.org/show_bug.cgi?id=152601
2959 Reviewed by Brady Eidson.
2961 Clang has recently added warnings to catch certain classes of mistakes with the use of std::move():
2962 -Wpessimizing-move (warns if moving prevents copy elision), -Wredundant-move (warns if a move is redundant),
2963 and -Wself-move (warns if moving to self). Enabling these warnings manually (by renaming WTF::move to std::move)
2964 have caught numerous mistakes in our codebase (see http://trac.webkit.org/changeset/194428).
2966 It would be nice to be able to take advantage of these warnings, but doing so requires that we use std::move,
2967 not WTF::move. But since WTF::move does provide useful checks for which clang does not yet have warnings,
2968 we should write a best-of-both-worlds move function.
2970 This patch adds a function that satisfies clang's criteria for a move function (in namespace std, named "move",
2971 and takes a single argument) but also retains WTF::move's compile-time checks. It also adds a convenience macro
2972 called WTF_MOVE for use by callers.
2974 * wtf/StdLibExtras.h:
2977 2015-12-25 Andy Estes <aestes@apple.com>
2979 Stop moving local objects in return statements
2980 https://bugs.webkit.org/show_bug.cgi?id=152557
2982 Reviewed by Brady Eidson.
2984 * wtf/StdLibExtras.h: Added a FIXME about how using WTF::move() prevents several Clang diagnostics from emitting useful warnings.
2986 2015-12-22 Filip Pizlo <fpizlo@apple.com>
2988 FTL B3 should be able to run richards
2989 https://bugs.webkit.org/show_bug.cgi?id=152514
2991 Reviewed by Michael Saboff.
2993 Change the list dumping helpers to work with a broader set of list kinds.
2996 (WTF::ListDump::dump):
2997 (WTF::MapDump::dump):
2998 (WTF::sortedMapDump):
2999 (WTF::ListDumpInContext::dump):
3001 2015-12-22 Filip Pizlo <fpizlo@apple.com>
3003 FTL B3 does not logicalNot correctly
3004 https://bugs.webkit.org/show_bug.cgi?id=152512
3006 Reviewed by Saam Barati.
3008 This change introduces yet another use of SharedTask in JSC. While doing this, I noticed that
3009 SharedTask::run() always demands that whatever arguments the callback takes, they must be
3010 passed as rvalue references. This was a clear misuse of perfect forwarding. This change makes
3011 SharedTask's approach to forwarding match what we were already doing in ScopedLambda.
3015 2015-12-20 Michael Catanzaro <mcatanzaro@igalia.com>
3017 [SOUP] Performs DNS prefetch when a proxy is configured (information leak)
3018 https://bugs.webkit.org/show_bug.cgi?id=145542
3020 Reviewed by Darin Adler.
3022 Specialize GUniquePtr<char*>, using g_strfreev.
3024 * wtf/glib/GUniquePtr.h:
3026 2015-12-19 Dan Bernstein <mitz@apple.com>
3028 [Mac] WebKit contains dead source code for OS X Mavericks and earlier
3029 https://bugs.webkit.org/show_bug.cgi?id=152462
3031 Reviewed by Alexey Proskuryakov.
3033 * Configurations/DebugRelease.xcconfig: Removed definition of MACOSX_DEPLOYMENT_TARGET for
3036 - Simplified expressions involving __MAC_OS_X_VERSION_MIN_REQUIRED and removed code that was
3037 never getting compiled:
3039 * wtf/FeatureDefines.h:
3041 * wtf/OSObjectPtr.h:
3043 * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
3044 * wtf/spi/darwin/XPCSPI.h:
3046 2015-12-17 Sukolsak Sakshuwong <sukolsak@gmail.com>
3048 [INTL] Implement Collator Compare Functions
3049 https://bugs.webkit.org/show_bug.cgi?id=147604
3051 Reviewed by Darin Adler.
3053 * wtf/unicode/Collator.h:
3055 2015-12-16 Andreas Kling <akling@apple.com>
3057 Give kernel VM some hints about non-live memory-cached resources.
3058 <https://webkit.org/b/152362>
3060 Reviewed by Geoffrey Garen.
3062 Add an API to OSAllocator for hinting to the OS that a range of memory
3063 is not expected to be used anytime soon.
3065 * wtf/OSAllocator.h:
3066 * wtf/OSAllocatorPosix.cpp:
3067 (WTF::OSAllocator::hintMemoryNotNeededSoon):
3068 * wtf/OSAllocatorWin.cpp:
3069 (WTF::OSAllocator::hintMemoryNotNeededSoon):
3072 2015-12-16 Alex Christensen <achristensen@webkit.org>
3074 Fix internal Windows build
3075 https://bugs.webkit.org/show_bug.cgi?id=152364
3076 rdar://problem/23928759
3078 Reviewed by Tim Horton.
3080 * WTF.vcxproj/WTF.proj:
3082 2015-12-16 Youenn Fablet <youenn.fablet@crf.canon.fr>
3084 [Fetch API] Add fetch API compile time flag
3085 https://bugs.webkit.org/show_bug.cgi?id=152254
3087 Reviewed by Darin Adler.
3089 * wtf/FeatureDefines.h:
3091 2015-12-14 Yusuke Suzuki <utatane.tea@gmail.com>
3093 Math.random should have an intrinsic thunk and it should be later handled as a DFG Node
3094 https://bugs.webkit.org/show_bug.cgi?id=152133
3096 Reviewed by Geoffrey Garen.
3098 Change 64bit random to double logic to convert efficiently.
3101 (WTF::WeakRandom::get):
3102 (WTF::WeakRandom::lowOffset):
3103 (WTF::WeakRandom::highOffset):
3105 2015-12-14 Sukolsak Sakshuwong <sukolsak@gmail.com>
3107 Make UCharIterator createIterator(StringView) visible to other classes
3108 https://bugs.webkit.org/show_bug.cgi?id=151917
3110 Reviewed by Darin Adler.
3112 Make UCharIterator createIterator(StringView) in CollatorICU.cpp visible
3113 to other classes so that future patches that will ucol_strcollIter
3114 (including Bug 147604) can use it.
3116 * wtf/unicode/Collator.h:
3117 * wtf/unicode/icu/CollatorICU.cpp:
3118 (WTF::createIterator):
3120 2015-12-14 David Kilzer <ddkilzer@apple.com>
3122 REGRESSION (r162777): Remove Boost Software License from WTF
3123 <http://webkit.org/b/152243>
3125 Reviewed by Darin Adler.
3127 The source code that the Boost Software License was referring to
3128 was removed in r162777 by switching to std::atomic.
3132 * wtf/ThreadSafeRefCounted.h:
3133 - Remove Boost Software License.
3134 - Update Apple Inc. copyright as needed.
3135 - Refresh Apple Inc. license text.
3137 2015-12-10 Joseph Pecoraro <pecoraro@apple.com>
3139 Remote Inspector: Verify the identity of the other side of XPC connections
3140 https://bugs.webkit.org/show_bug.cgi?id=152153
3142 Reviewed by Brian Burg.
3144 * WTF.xcodeproj/project.pbxproj:
3145 * wtf/spi/cocoa/SecuritySPI.h: Renamed from Source/WebCore/platform/spi/cocoa/SecuritySPI.h.
3146 Push this down into WTF from WebCore and add a new method.
3148 2015-12-08 Filip Pizlo <fpizlo@apple.com>
3150 FTL B3 should have basic GetById support
3151 https://bugs.webkit.org/show_bug.cgi?id=152035
3153 Reviewed by Saam Barati.
3155 When dealing with shared task lambdas, you often want to force a value to be allocated so that it
3156 has reference semantics, but you still want the lambda to execute OK when we pop stack. In PL we
3157 usually call this a "box". This is easy to do if the value that happened to be stack-allocated
3158 is also RefCounted, but that's rare, since stack-allocated values often have copy semantics. So,
3159 I've added a Box type to WTF. Behind the scenes, it allocates your object with fast malloc inside
3160 a ThreadSAfeRefCounted. When you pass Box<T>, you're passing the reference. This makes it a lot
3161 easier to work with by-reference capture.
3163 * WTF.xcodeproj/project.pbxproj:
3168 (WTF::Box::operator*):
3169 (WTF::Box::operator->):
3170 (WTF::Box::operator bool):
3171 (WTF::Box::Data::Data):
3173 2015-12-09 Andreas Kling <akling@apple.com>
3175 [iOS] ResourceUsageOverlay should work on iOS.
3176 <https://webkit.org/b/152021>
3178 Reviewed by Antti Koivisto.
3180 * wtf/Platform.h: Enable RESOURCE_USAGE_OVERLAY for all COCOA platforms.
3182 2015-12-08 Joseph Pecoraro <pecoraro@apple.com>
3184 Create a Sandbox SPI header
3185 https://bugs.webkit.org/show_bug.cgi?id=151981
3187 Reviewed by Andy Estes.
3189 * WTF.xcodeproj/project.pbxproj:
3190 * wtf/spi/darwin/SandboxSPI.h: Added.
3192 2015-12-07 Filip Pizlo <fpizlo@apple.com>
3194 FTL B3 should be able to flag the tag constants as being super important so that B3 can hoist them and Air can force them into registers
3195 https://bugs.webkit.org/show_bug.cgi?id=151955
3197 Reviewed by Geoffrey Garen.
3199 Remove some remaining DFG-specific snippets from Dominators. This used to be a non-template
3200 DFG class, and some time ago I hoisted it into WTF and made it generic. But since the only
3201 user of the class was the DFG, this class still had a handful of DFG-specific snippets that
3202 didn't compile when I started using it from B3.
3204 Also renamed immediateDominatorOf() to idom(). This is the sort of abbreviation that we
3205 wouldn't ordinarily want to have in WebKit. But WebKit does allow for abbreviations that are
3206 "more canonical". The term "idom" is definitely more canonical than "immediateDominatorOf".
3209 (WTF::Dominators::dominates):
3210 (WTF::Dominators::idom):
3211 (WTF::Dominators::forAllStrictDominatorsOf):
3212 (WTF::Dominators::NaiveDominators::dominates):
3213 (WTF::Dominators::NaiveDominators::dump):
3214 (WTF::Dominators::ValidationContext::handleErrors):
3216 2015-12-03 Anders Carlsson <andersca@apple.com>
3218 Remove Objective-C GC support
3219 https://bugs.webkit.org/show_bug.cgi?id=151819
3220 rdar://problem/23746991
3222 Reviewed by Dan Bernstein.
3224 * Configurations/Base.xcconfig:
3225 * wtf/ThreadingPthreads.cpp:
3226 (WTF::initializeCurrentThreadInternal): Deleted.
3227 * wtf/text/cf/StringImplCF.cpp:
3228 (WTF::StringImpl::createCFString):
3229 (garbageCollectionEnabled): Deleted.
3230 (WTF::StringWrapperCFAllocator::create): Deleted.
3232 2015-12-02 Filip Pizlo <fpizlo@apple.com>
3234 FTL B3 should support OSR exit
3235 https://bugs.webkit.org/show_bug.cgi?id=151710
3237 Reviewed by Saam Barati.
3239 Make sure that this has perfect forwarding.
3241 * wtf/SegmentedVector.h:
3242 (WTF::SegmentedVector::append):
3243 (WTF::SegmentedVector::alloc):
3245 2015-12-01 Yusuke Suzuki <utatane.tea@gmail.com>
3247 [ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
3248 https://bugs.webkit.org/show_bug.cgi?id=150792
3250 Reviewed by Saam Barati.
3252 * wtf/FastBitVector.h:
3253 (WTF::FastBitVector::forEachSetBit):
3254 * wtf/FeatureDefines.h:
3256 2015-12-01 Commit Queue <commit-queue@webkit.org>
3258 Unreviewed, rolling out r192914.
3259 https://bugs.webkit.org/show_bug.cgi?id=151734
3261 JSC tests for this change are failing on 32 and 64-bit bots
3262 (Requested by ryanhaddad on #webkit).
3266 "[ES6] Implement LLInt/Baseline Support for ES6 Generators and
3267 enable this feature"
3268 https://bugs.webkit.org/show_bug.cgi?id=150792
3269 http://trac.webkit.org/changeset/192914
3271 2015-12-01 Myles C. Maxfield <mmaxfield@apple.com>
3273 Give String and AtomicString an existingHash() function
3274 https://bugs.webkit.org/show_bug.cgi?id=151717
3276 Reviewed by Andreas Kling.
3278 Test: WTF.AtomicStringExistingHash
3279 WTF.StringExistingHash
3281 * wtf/text/AtomicString.h:
3282 (WTF::AtomicString::existingHash):
3283 * wtf/text/WTFString.h:
3284 (WTF::String::existingHash):
3286 2015-12-01 Yusuke Suzuki <utatane.tea@gmail.com>
3288 [ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
3289 https://bugs.webkit.org/show_bug.cgi?id=150792
3291 Reviewed by Saam Barati.
3293 * wtf/FastBitVector.h:
3294 (WTF::FastBitVector::forEachSetBit):
3295 * wtf/FeatureDefines.h:
3297 2015-11-30 Geoffrey Garen <ggaren@apple.com>
3299 Use a better RNG for Math.random()
3300 https://bugs.webkit.org/show_bug.cgi?id=151641
3302 Reviewed by Anders Carlsson.
3304 Use 64 bits in the random number generator instead of 32 bit. (In
3305 the end, JavaScript, which uses doubles, will only see 52 bits.) This
3306 prevents programs that multiply a random number by a large constant from
3307 seeing non-random "banding" caused by zeroes in the low 20 bits.
3309 I also took the opportunity to upgrade from GameRandom to Xorshift+,
3310 since Xorshift+ passes more benchmarks for randomness, and is not any
3311 slower or more complicated.
3313 Now let us all remember the fateful words of Steve Weibe, who would be
3314 King of Kong: "The randomness went the opposite way that it usually goes."
3317 (WTF::WeakRandom::WeakRandom):
3318 (WTF::WeakRandom::setSeed): Use standard naming.
3320 (WTF::WeakRandom::seed): This function is safe now. "Unsafe" in function
3321 names makes me itch.
3323 (WTF::WeakRandom::get):
3324 (WTF::WeakRandom::getUint32): Update to 64bit.
3326 (WTF::WeakRandom::advance): The Xorshift+ algorithm.
3328 (WTF::WeakRandom::initializeSeed): Deleted.
3329 (WTF::WeakRandom::seedUnsafe): Deleted.
3331 2015-11-30 Benjamin Poulain <bpoulain@apple.com>
3333 [JSC] Speed up Air Liveness Analysis on Tmps
3334 https://bugs.webkit.org/show_bug.cgi?id=151556
3336 Reviewed by Filip Pizlo.
3338 * WTF.xcodeproj/project.pbxproj:
3339 * wtf/IndexSparseSet.h: Added.
3340 (WTF::IndexSparseSet<OverflowHandler>::IndexSparseSet):
3341 (WTF::IndexSparseSet<OverflowHandler>::add):
3342 (WTF::IndexSparseSet<OverflowHandler>::remove):
3343 (WTF::IndexSparseSet<OverflowHandler>::clear):
3344 (WTF::IndexSparseSet<OverflowHandler>::size):
3345 (WTF::IndexSparseSet<OverflowHandler>::isEmpty):
3346 (WTF::IndexSparseSet<OverflowHandler>::contains):
3348 2015-11-30 Tim Horton <timothy_horton@apple.com>
3350 Get rid of the !USE(ASYNC_NSTEXTINPUTCLIENT) codepath
3351 https://bugs.webkit.org/show_bug.cgi?id=151673
3353 Reviewed by Anders Carlsson.
3357 2015-11-30 Carlos Garcia Campos <cgarcia@igalia.com>
3359 [GLIB] Remove GMainLoopSource and GThreadSafeMainLoopSource
3360 https://bugs.webkit.org/show_bug.cgi?id=151633
3362 Reviewed by Csaba Osztrogonác.
3364 * WTF.vcxproj/WTF.vcxproj:
3365 * WTF.vcxproj/WTF.vcxproj.filters:
3366 * wtf/PlatformEfl.cmake:
3367 * wtf/PlatformGTK.cmake:
3368 * wtf/glib/GMainLoopSource.cpp: Removed.
3369 * wtf/glib/GMainLoopSource.h: Removed.
3370 * wtf/glib/GThreadSafeMainLoopSource.cpp: Removed.
3371 * wtf/glib/GThreadSafeMainLoopSource.h: Removed.
3373 2015-11-27 Csaba Osztrogonác <ossy@webkit.org>
3375 Fix build warning in bignum.cc
3376 https://bugs.webkit.org/show_bug.cgi?id=150797
3378 Reviewed by Geoffrey Garen.
3380 * wtf/dtoa/bignum.cc:
3382 2015-11-18 Daniel Bates <dabates@apple.com>
3384 [iOS] ASSERTION FAILED: temporaryFilePath.last() == '/' in WebCore::openTemporaryFile()
3385 https://bugs.webkit.org/show_bug.cgi?id=151392
3386 <rdar://problem/23595341>
3388 Reviewed by Alexey Proskuryakov.
3390 Workaround <rdar://problem/23579077> where confstr(_CS_DARWIN_USER_TEMP_DIR, ..., ...) retrieves
3391 the path to the user temporary directory without a trailing slash in the iOS simulator.
3394 (WTF::initializeLogFileOnce):
3396 2015-11-17 Filip Pizlo <fpizlo@apple.com>
3398 CheckAdd/Mul should have commutativity optimizations in B3->Air lowering
3399 https://bugs.webkit.org/show_bug.cgi?id=151214
3401 Reviewed by Geoffrey Garen.
3403 Disable my failed attempts at perfect forwarding, since they were incorrect, and caused compile
3404 errors if you tried to pass an argument that bound to lvalue. This shouldn't affect performance of
3405 anything we care about, and performance tests seem to confirm that it's all good.
3407 * wtf/ScopedLambda.h:
3409 2015-11-17 Filip Pizlo <fpizlo@apple.com>
3411 Air should lay out code optimally
3412 https://bugs.webkit.org/show_bug.cgi?id=150478
3414 Reviewed by Geoffrey Garen.
3416 * wtf/GraphNodeWorklist.h:
3417 (WTF::GraphNodeWorklist::push):
3418 (WTF::GraphNodeWorklist::isEmpty):
3419 (WTF::GraphNodeWorklist::notEmpty):
3420 (WTF::GraphNodeWorklist::pop):
3422 2015-11-11 Anders Carlsson <andersca@apple.com>
3424 Enable cross-platform context menus by default
3425 https://bugs.webkit.org/show_bug.cgi?id=151173
3427 Reviewed by Tim Horton.
3431 2015-11-12 Csaba Osztrogonác <ossy@webkit.org>
3433 Remove ENABLE(SATURATED_LAYOUT_ARITHMETIC) guards
3434 https://bugs.webkit.org/show_bug.cgi?id=150972
3436 Reviewed by Darin Adler.
3438 * wtf/FeatureDefines.h:
3440 2015-11-11 Filip Pizlo <fpizlo@apple.com>
3442 B3 should be able to compile and canonicalize Mul
3443 https://bugs.webkit.org/show_bug.cgi?id=151124
3445 Reviewed by Geoffrey Garen.
3450 2015-11-10 Filip Pizlo <fpizlo@apple.com>
3452 B3 should be able to compile a program with ChillDiv
3453 https://bugs.webkit.org/show_bug.cgi?id=151114
3455 Reviewed by Benjamin Poulain.
3457 Needed to beef up some compiler algorithms. All of the hardening was about making them
3458 work with objects that have move semantics but not copy semantics. This arises in B3
3459 basic block insertion sets.
3464 (WTF::Insertion::Insertion):
3465 (WTF::Insertion::index):
3466 (WTF::Insertion::element):
3467 (WTF::Insertion::operator<):
3468 (WTF::executeInsertions):
3470 2015-11-10 Carlos Garcia Campos <cgarcia@igalia.com>
3472 [GTK] Use CROSS_PLATFORM_CONTEXT_MENUS
3473 https://bugs.webkit.org/show_bug.cgi?id=150642
3475 Reviewed by Martin Robinson.
3477 Enable CROSS_PLATFORM_CONTEXT_MENUS for GTK+ port.
3481 2015-11-09 Anders Carlsson <andersca@apple.com>
3483 Introspect reply block types as well
3484 https://bugs.webkit.org/show_bug.cgi?id=151048
3486 Reviewed by Tim Horton.
3488 Fix operator-> implementation.
3491 (WTF::Optional::operator->):
3493 2015-11-05 Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au>
3495 Add runtime and compile time flags for enabling Web Animations API and model.
3496 https://bugs.webkit.org/show_bug.cgi?id=150914
3498 Reviewed by Benjamin Poulain.
3500 Add ENABLE_WEB_ANIMATIONS compile time flag, runtime flag webAnimationsEnabled and Expose WK2 preference for runtime flag.
3502 * wtf/FeatureDefines.h:
3504 2015-11-05 Zan Dobersek <zdobersek@igalia.com>
3506 [GLib] Avoid gint64, std::chrono::microseconds overflows in RunLoop::TimerBase
3507 https://bugs.webkit.org/show_bug.cgi?id=150930
3509 Reviewed by Carlos Garcia Campos.
3511 In RunLoop::TimerBase::start(), avoid overflowing the std::chrono::microseconds
3512 value in case the passed-in fire interval (in seconds) is too large (e.g. when
3513 std::chrono::microseconds::max() is used as the desired interval). This is
3514 achieved by using the passed-in fire interval, converted in microseconds, only
3515 if the value of this interval is smaller than std::chrono::microseconds::max().
3517 In RunLoop::TimerBase::updateReadyTime(), the zero-delay is still considered a
3518 short cut, but we use G_MAXINT64 in case the sum of the current time and the
3519 desired fire interval (now in microseconds) would overflow.
3521 * wtf/glib/RunLoopGLib.cpp:
3522 (WTF::RunLoop::TimerBase::updateReadyTime):
3523 (WTF::RunLoop::TimerBase::start):
3525 2015-11-02 Filip Pizlo <fpizlo@apple.com>
3527 B3/Air should use bubble sort for their insertion sets, because it's faster than std::stable_sort
3528 https://bugs.webkit.org/show_bug.cgi?id=150828
3530 Reviewed by Geoffrey Garen.
3532 Add a pretty good bubble sort implementation to WTF. This implementation has three
3535 - Forward and backward scans. This reduces the severity of certain kinds of bubble sort
3538 - Return if a scan finds the list to be sorted. This gives the algorithm one of its most
3539 attractive properties: it's super fast when the list is already sorted.
3541 - Each scan eliminates one element from future scans. This makes the algorithm no worse
3542 than insertion sort.
3544 Why do we want this? Because bubble sort is a really great stable sort for small lists,
3545 or large lists in which only a handful of elements are out of order. Compiler insertion
3546 sets tend to be one of those or somewhere in between: usually they are very small, and
3547 usually they are sorted. It's rare that an element will be out of order, and when it is,
3548 it's usually very close to where it's supposed to be.
3550 This is a significant speed-up for B3 compile times.
3552 * WTF.xcodeproj/project.pbxproj:
3553 * wtf/BubbleSort.h: Added.
3555 * wtf/CMakeLists.txt:
3557 2015-11-02 Andy Estes <aestes@apple.com>
3559 [Cocoa] Add tvOS and watchOS to SUPPORTED_PLATFORMS
3560 https://bugs.webkit.org/show_bug.cgi?id=150819
3562 Reviewed by Dan Bernstein.
3564 This tells Xcode to include these platforms in its Devices dropdown, making it possible to build in the IDE.
3566 * Configurations/Base.xcconfig:
3568 2015-11-02 Carlos Garcia Campos <cgarcia@igalia.com>
3570 [GLIB] Remove support for GSocket main loop sources from GMainLoopSource
3571 https://bugs.webkit.org/show_bug.cgi?id=150772
3573 Reviewed by Žan Doberšek.
3575 It complicated the code just to make generic what is only used in
3578 * wtf/glib/GMainLoopSource.cpp:
3579 (WTF::GMainLoopSource::cancel): Deleted.
3580 (WTF::GMainLoopSource::schedule): Deleted.
3581 (WTF::GMainLoopSource::scheduleTimeoutSource): Deleted.
3582 (WTF::GMainLoopSource::scheduleAfterDelay): Deleted.
3583 (WTF::GMainLoopSource::finishVoidCallback): Deleted.
3584 (WTF::GMainLoopSource::voidCallback): Deleted.
3585 (WTF::GMainLoopSource::prepareBoolCallback): Deleted.
3586 * wtf/glib/GMainLoopSource.h:
3587 (WTF::GMainLoopSource::Context::operator=): Deleted.
3589 2015-11-02 Carlos Garcia Campos <cgarcia@igalia.com>
3591 [GLIB] Remove delete on destroy GMainLoopSources
3592 https://bugs.webkit.org/show_bug.cgi?id=150771
3594 Reviewed by Žan Doberšek.
3596 Delete on destroy sources made the GMainLoopSource implementation
3597 more complex and they are currently unused.
3599 * wtf/glib/GMainLoopSource.cpp:
3600 (WTF::GMainLoopSource::boolCallback):
3601 (WTF::GMainLoopSource::create): Deleted.
3602 (WTF::GMainLoopSource::GMainLoopSource): Deleted.
3603 (WTF::GMainLoopSource::cancel): Deleted.
3604 (WTF::GMainLoopSource::scheduleAndDeleteOnDestroy): Deleted.
3605 (WTF::GMainLoopSource::scheduleAfterDelayAndDeleteOnDestroy): Deleted.
3606 (WTF::GMainLoopSource::voidCallback): Deleted.
3607 * wtf/glib/GMainLoopSource.h:
3609 2015-11-01 Carlos Garcia Campos <cgarcia@igalia.com>
3611 [GTK] Use RunLoop in WorkQueue implementation
3612 https://bugs.webkit.org/show_bug.cgi?id=150770
3614 Reviewed by Darin Adler.
3616 Instead of using GMainLoop directly. RunLoop already abstracts the
3617 GMainLoop details and uses persistent sources making it more efficient.
3618 For the dispatchAfter implementation we use a helper context class
3619 and a GSource directly, since we are going to get rid of delete on
3620 destroy GMainLoop soon and this is the only place where we still