1 2017-08-21 Mark Lam <mark.lam@apple.com>
3 [Follow up]: Add back the ability to disable MASM_PROBE from the build.
4 https://bugs.webkit.org/show_bug.cgi?id=175656
5 <rdar://problem/33933720>
9 Fixed a typo: should be "OS(WINDOWS)", not "OS(WINDOW)".
13 2017-08-21 Carlos Alberto Lopez Perez <clopez@igalia.com>
15 [GTK] ARMv7 build fails to build MacroAssemblerARMv7.cpp.
16 https://bugs.webkit.org/show_bug.cgi?id=175514
18 Reviewed by Keith Miller.
20 * wtf/Platform.h: Enable DFG and MASM_PROBE back for GTK ARM_THUMB2.
22 2017-08-20 Sam Weinig <sam@webkit.org>
24 StringView could use a function to strip leading/trailing characters without allocation
25 https://bugs.webkit.org/show_bug.cgi?id=175757
27 Reviewed by Darin Adler.
29 There are many places in WebCore/WebKit that we call functions like,
30 WebCore::stripLeadingAndTrailingHTMLSpaces, or String::stripWhiteSpace() only to use
31 the allocated String as a temporary for either another transformation or a comparison.
32 Now that we have StringView, we can avoid that extra allocation, by having returning a
33 StringView substring in these scenarios.
35 For instance, the check (from ScriptElement.cpp:287):
37 if (!stripLeadingAndTrailingHTMLSpaces(sourceURL).isEmpty()) {
41 currently allocates a string just to make this check. With a new
42 stripLeadingAndTrailingHTMLSpaces such as:
44 StringView stripLeadingAndTrailingHTMLSpaces(StringView stringView)
46 return stringView.stripLeadingAndTrailingMatchedCharacters([] (auto c) {
47 return isHTMLSpace(c);
51 We could instead have exact same code from ScriptElement.cpp now avoid an allocation.
53 * wtf/text/StringView.h:
54 (WTF::StringView::stripLeadingAndTrailingMatchedCharacters):
56 2017-08-21 Eric Carlson <eric.carlson@apple.com>
58 Add WTFLogChannel level to allow runtime log filtering
59 https://bugs.webkit.org/show_bug.cgi?id=175731
60 <rdar://problem/33967234>
62 Reviewed by Jer Noble.
64 Add WTFLog*, LOG, and RELEASE_LOG variants that take a "log level" parameter so code
65 can include logging statements that are only conditionally emitted.
69 * wtf/MemoryPressureHandler.cpp:
70 * wtf/RefCountedLeakCounter.cpp:
72 2017-08-20 Mark Lam <mark.lam@apple.com>
74 Gardening: fix CLoop build.
75 https://bugs.webkit.org/show_bug.cgi?id=175688
76 <rdar://problem/33436870>
80 Disable MASM_PROBE if !ENABLE(JIT).
84 2017-08-18 Ryan Haddad <ryanhaddad@apple.com>
86 Unreviewed, rolling out r220938.
88 The API tests added with this change are failing.
92 "Add WTFLogChannel level to allow runtime log filtering"
93 https://bugs.webkit.org/show_bug.cgi?id=175731
94 http://trac.webkit.org/changeset/220938
96 2017-08-18 Eric Carlson <eric.carlson@apple.com>
98 Add WTFLogChannel level to allow runtime log filtering
99 https://bugs.webkit.org/show_bug.cgi?id=175731
100 <rdar://problem/33967234>
102 Reviewed by Jer Noble.
104 Add WTFLog*, LOG, and RELEASE_LOG variants that take a "log level" parameter so code
105 can include logging statements that are only conditionally emitted.
107 * wtf/Assertions.cpp:
109 * wtf/MemoryPressureHandler.cpp:
110 * wtf/RefCountedLeakCounter.cpp:
112 2017-08-18 Per Arne Vollan <pvollan@apple.com>
114 Implement 32-bit MacroAssembler::probe support for Windows.
115 https://bugs.webkit.org/show_bug.cgi?id=175449
117 Reviewed by Mark Lam.
119 Enable the DFG on Win32.
123 2017-08-17 Mark Lam <mark.lam@apple.com>
125 Only use 16 VFP registers if !CPU(ARM_NEON).
126 https://bugs.webkit.org/show_bug.cgi?id=175514
128 Reviewed by JF Bastien.
130 If CPU(ARM_NEON) is not enabled, we'll conservatively assume only VFP2 support is
131 available. Hence, we'll only the first 16 FPDoubleRegisterIDs are available.
134 NEON registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJACABEJ.html
135 VFP2 and VFP3 registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CIHDIBDG.html
136 NEON to VFP register mapping: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJAIJHFC.html
138 This is mostly for GTK toolchains which may target older ARM CPUs which only have
143 2017-08-16 Mark Lam <mark.lam@apple.com>
145 Add back the ability to disable MASM_PROBE from the build.
146 https://bugs.webkit.org/show_bug.cgi?id=175656
147 <rdar://problem/33933720>
149 Reviewed by Yusuke Suzuki.
153 2017-08-16 Mark Lam <mark.lam@apple.com>
155 Gardening: fix GTK ARM_THUMB2 build.
156 https://bugs.webkit.org/show_bug.cgi?id=175446
160 Disable the use of the DFG for GTK ARM_THUMB2 builds until
161 https://bugs.webkit.org/show_bug.cgi?id=175514 is fixed.
165 2017-08-16 Andy Estes <aestes@apple.com>
167 [Payment Request] Add an ENABLE flag and an experimental feature preference
168 https://bugs.webkit.org/show_bug.cgi?id=175622
170 Reviewed by Tim Horton.
172 * wtf/FeatureDefines.h:
174 2017-08-14 Simon Fraser <simon.fraser@apple.com>
176 Remove Proximity Events and related code
177 https://bugs.webkit.org/show_bug.cgi?id=175545
179 Reviewed by Daniel Bates.
181 No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS)
182 and other related code.
184 * wtf/FeatureDefines.h:
186 2017-08-14 Simon Fraser <simon.fraser@apple.com>
188 Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
189 https://bugs.webkit.org/show_bug.cgi?id=175504
191 Reviewed by Sam Weinig.
193 * wtf/FeatureDefines.h:
195 2017-08-14 Simon Fraser <simon.fraser@apple.com>
197 Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
198 https://bugs.webkit.org/show_bug.cgi?id=175557
202 No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.
204 * wtf/FeatureDefines.h:
206 2017-08-12 Filip Pizlo <fpizlo@apple.com>
208 Put the ScopedArgumentsTable's ScopeOffset array in some gigacage
209 https://bugs.webkit.org/show_bug.cgi?id=174921
211 Reviewed by Mark Lam.
213 If you want to std::unique_ptr a class that knows that it should be in the Gigacage, then we
214 would create the Gigacage equivalent of WTF_MAKE_FAST_ALLOCATED and it would just work.
216 But this does not work if we want to std::unique_ptr a primitive type. So, this patch adds a
217 solution for this problem: CagedUniquePtr<>. This will handle allocation
218 (CagedUniquePtr<>::create()) and deallocation (in the style of std::unique_ptr). It has three
222 - Arrays that don't have destructors.
223 - Arrays that have destructors.
225 Just like std::unique_ptr, the array case is triggered by saying "[]" at the end of the type.
227 Unlike std::unique_ptr and most other smart pointers, the whole point of this smart pointer is
228 to dictate where the thing you're pointing at is allocated. For this reason, it has to know how
229 to do things like the array destructor protocol. So it creates its own: the CagedUniquePtr for
230 arrays with destructors is a fat pointer that remembers the length of the array.
232 CagedUniquePtr<> makes it impossible to leak/release the pointer. This is stricter than what
233 std::unique_ptr does, and is probably appropriate for all of the places where we would use this
236 So far, we only use it for ScopedArgumentsTable::m_arguments, but I suspect that it will be
237 useful in other places.
239 * WTF.xcodeproj/project.pbxproj:
240 * wtf/CMakeLists.txt:
241 * wtf/CagedUniquePtr.h: Added.
242 (WTF::CagedUniquePtr::CagedUniquePtr):
243 (WTF::CagedUniquePtr::create):
244 (WTF::CagedUniquePtr::operator=):
245 (WTF::CagedUniquePtr::~CagedUniquePtr):
246 (WTF::CagedUniquePtr::get const):
247 (WTF::CagedUniquePtr::getMayBeNull const):
248 (WTF::CagedUniquePtr::operator== const):
249 (WTF::CagedUniquePtr::operator!= const):
250 (WTF::CagedUniquePtr::operator bool const):
251 (WTF::CagedUniquePtr::operator* const):
252 (WTF::CagedUniquePtr::operator-> const):
253 (WTF::CagedUniquePtr::operator[] const):
254 (WTF::CagedUniquePtr::destroy):
256 (Gigacage::tryMallocArray):
258 (Gigacage::mallocArray):
261 2017-08-11 Ryosuke Niwa <rniwa@webkit.org>
263 Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
264 https://bugs.webkit.org/show_bug.cgi?id=175474
266 Reviewed by Wenson Hsieh.
268 * wtf/FeatureDefines.h:
270 2017-08-11 Don Olmstead <don.olmstead@sony.com>
272 [WTF] Move ValueToString into WTF
273 https://bugs.webkit.org/show_bug.cgi?id=175469
275 Reviewed by Sam Weinig.
277 * WTF.xcodeproj/project.pbxproj:
278 * wtf/CMakeLists.txt:
279 * wtf/text/ValueToString.h: Renamed from Source/WebCore/platform/ValueToString.h.
281 2017-08-11 Tim Horton <timothy_horton@apple.com>
283 Fix the build with modern Clang's -Wexpansion-to-defined
284 https://bugs.webkit.org/show_bug.cgi?id=175467
285 <rdar://problem/33667497>
287 Reviewed by Simon Fraser.
289 * wtf/FeatureDefines.h:
291 Avoid object-like macros that expand to include defined(), because this
292 behaves inconsistently between different compilers (though in ways
293 that don't matter for these particular defines, which aren't used on MSVC),
294 and Clang has added a warning for it.
296 Move ENABLE_WEBASSEMBLY to Platform.h since it depends on things that
297 are defined there and can't be evaluated at time-of-use because of the
298 aforementioned new rules. Previously, there was a cycle between
299 ENABLE_WEBASSEMBLY and ENABLE_B3_JIT -- break that so that it just
300 goes FTL_JIT->B3_JIT->WASM instead.
302 2017-08-10 Sam Weinig <sam@webkit.org>
304 WTF::Function does not allow for reference / non-default constructible return types
305 https://bugs.webkit.org/show_bug.cgi?id=175244
307 Reviewed by Chris Dumez.
309 When Function, then NoncopyableFunction, was templatized to allow non-void return values
310 in r201493, it maintained the behavior of being callable even if the Function was null.
311 To accomplish this, when null, the default construction of the return parameter was used.
312 This means Function can't be used with return types that are not default constructible,
313 such as reference types and Ref.
315 This behavior of returning something when null is surprising, as this is not how normal
316 functions behave, and not very useful. Instead, we now assert that the function is not
317 null when being called.
320 (WTF::Function operator(...)):
321 Instead of allowing a null callable wrapper by returning the default construction of
322 the return type, assert that the wrapper is there when calling a Function.
324 2017-08-10 Mark Lam <mark.lam@apple.com>
326 Make the MASM_PROBE mechanism mandatory for DFG and FTL builds.
327 https://bugs.webkit.org/show_bug.cgi?id=175446
328 <rdar://problem/33836545>
330 Reviewed by Saam Barati.
332 This is needed in order to support https://bugs.webkit.org/show_bug.cgi?id=174645.
333 One consequence of this is that the DFG will now be disabled for the MIPS and
335 https://bugs.webkit.org/show_bug.cgi?id=175447
336 https://bugs.webkit.org/show_bug.cgi?id=175449
338 Also, we should only ENABLE_SIGNAL_BASED_VM_TRAPS if the DFG is enabled. It was
339 never meaningful to use SIGNAL_BASED_VM_TRAPS with the baseline JIT anyway. This
340 is a mis-configuration error that is now fixed.
344 2017-08-10 Brady Eidson <beidson@apple.com>
346 Rename the source files for the WTF persistent coders.
347 https://bugs.webkit.org/show_bug.cgi?id=175441
349 Reviewed by Tim Horton.
351 * WTF.xcodeproj/project.pbxproj:
352 * wtf/CMakeLists.txt:
354 * wtf/persistence/PersistentCoder.h: Renamed from Source/WTF/wtf/persistence/Coder.h.
355 * wtf/persistence/PersistentCoders.cpp: Renamed from Source/WTF/wtf/persistence/Coders.cpp.
356 * wtf/persistence/PersistentCoders.h: Renamed from Source/WTF/wtf/persistence/Coders.h.
357 * wtf/persistence/PersistentDecoder.cpp: Renamed from Source/WTF/wtf/persistence/Decoder.cpp.
358 * wtf/persistence/PersistentDecoder.h: Renamed from Source/WTF/wtf/persistence/Decoder.h.
359 * wtf/persistence/PersistentEncoder.cpp: Renamed from Source/WTF/wtf/persistence/Encoder.cpp.
360 * wtf/persistence/PersistentEncoder.h: Renamed from Source/WTF/wtf/persistence/Encoder.h.
362 2017-08-10 Yusuke Suzuki <utatane.tea@gmail.com>
364 Unreviewed, attempt to fix build failure with VC2017
366 * wtf/PriorityQueue.h:
368 2017-08-10 Yusuke Suzuki <utatane.tea@gmail.com>
371 https://bugs.webkit.org/show_bug.cgi?id=174970
373 Reviewed by Michael Catanzaro.
375 CHAR_BIT is not defined.
379 2017-08-09 Yusuke Suzuki <utatane.tea@gmail.com>
381 [WTF] ThreadSpecific should not introduce additional indirection
382 https://bugs.webkit.org/show_bug.cgi?id=175187
384 Reviewed by Mark Lam.
386 ThreadSpecific sets Data* to the TLS. And Data holds T*, which
387 is fast allocated actual data. But ideally, we should store T
388 instance directly in Data instead of introducing an additional
391 This patch adds storage in Data in order to embed the instance of T. The constructor
392 for Data will invoke the constructor for T on the embedded storage. We also drop
393 ThreadSpecific::replace which is only used by the web thread to set its thread specific
394 ThreadGlobalData to the one shared from the main thread. The existing implementation
395 relies on the main thread and the web thread never exiting in order for the shared
396 ThreadGlobalData to stay alive. We can achieve the same semantics by using a
397 ThreadSpecific<std::unique_ptr<T>> to hold the ThreadGlobalData instance instead.
399 * wtf/ThreadSpecific.h:
400 (WTF::ThreadSpecific::Data::construct):
401 (WTF::ThreadSpecific::Data::Data):
402 We make it fast allocated since we previously allocated ThreadSpecific T data by fastMalloc.
404 (WTF::ThreadSpecific::Data::~Data):
405 (WTF::ThreadSpecific::Data::storagePointer const):
406 (WTF::canBeGCThread>::get):
407 We also drop RELEASE_ASSERT from ::get(). We already inserted this assert to setAndConstruct(),
408 so when creating the member to this TLS, we execute this release assert. So it is
409 not necessary to execute this assertion every time we get data from this TLS.
411 (WTF::canBeGCThread>::set):
412 (WTF::canBeGCThread>::destroy):
413 (WTF::canBeGCThread>::setAndConstruct):
415 (WTF::canBeGCThread>::replace): Deleted.
417 2017-08-10 Tim Horton <timothy_horton@apple.com>
419 Fix a silly typo in Compiler.h
424 2017-08-10 Michael Catanzaro <mcatanzaro@igalia.com>
426 Remove ENABLE_GAMEPAD_DEPRECATED
427 https://bugs.webkit.org/show_bug.cgi?id=175361
429 Reviewed by Carlos Garcia Campos.
431 * wtf/FeatureDefines.h:
433 2017-08-09 Don Olmstead <don.olmstead@sony.com>
435 [WTF] Move TextStream into WTF
436 https://bugs.webkit.org/show_bug.cgi?id=175211
438 Reviewed by Myles C. Maxfield.
440 * WTF.xcodeproj/project.pbxproj:
441 * wtf/CMakeLists.txt:
442 * wtf/text/TextStream.cpp: Renamed from Source/WebCore/platform/text/TextStream.cpp.
443 (WTF::TextStream::writeIndent):
444 * wtf/text/TextStream.h: Renamed from Source/WebCore/platform/text/TextStream.h.
445 (WTF::TextStream::FormatNumberRespectingIntegers::FormatNumberRespectingIntegers):
447 2017-08-09 Commit Queue <commit-queue@webkit.org>
449 Unreviewed, rolling out r220466, r220477, and r220487.
450 https://bugs.webkit.org/show_bug.cgi?id=175411
452 This change broke existing API tests and follow up fixes did
453 not resolve all the issues. (Requested by ryanhaddad on
458 https://bugs.webkit.org/show_bug.cgi?id=175244
459 http://trac.webkit.org/changeset/220466
461 "WTF::Function does not allow for reference / non-default
462 constructible return types"
463 https://bugs.webkit.org/show_bug.cgi?id=175244
464 http://trac.webkit.org/changeset/220477
466 https://bugs.webkit.org/show_bug.cgi?id=175244
467 http://trac.webkit.org/changeset/220487
469 2017-08-09 Sam Weinig <sam@webkit.org>
471 WTF::Function does not allow for reference / non-default constructible return types
472 https://bugs.webkit.org/show_bug.cgi?id=175244
474 Reviewed by Chris Dumez.
476 When Function, then NoncopyableFunction, was templatized to allow non-void return values
477 in r201493, it maintained the behavior of being callable even if the Function was null.
478 To accomplish this, when null, the default construction of the return parameter was used.
479 This means Function can't be used with return types that are not default constructible,
480 such as reference types and Ref.
482 This behavior of returning something when null is surprising, as this is not how normal
483 functions behave, and not very useful. Instead, we now assert that the function is not
484 null when being called.
487 (WTF::Function operator(...)):
488 Instead of allowing a null callable wrapper by returning the default construction of
489 the return type, assert that the wrapper is there when calling a Function.
491 2017-08-09 Ryan Haddad <ryanhaddad@apple.com>
493 Unreviewed, rolling out r220457.
495 This change introduced API test failures.
499 "WTF::Function does not allow for reference / non-default
500 constructible return types"
501 https://bugs.webkit.org/show_bug.cgi?id=175244
502 http://trac.webkit.org/changeset/220457
504 2017-08-09 Sam Weinig <sam@webkit.org>
506 WTF::Function does not allow for reference / non-default constructible return types
507 https://bugs.webkit.org/show_bug.cgi?id=175244
509 Reviewed by Chris Dumez.
511 When Function, then NoncopyableFunction, was templatized to allow non-void return values
512 in r201493, it maintained the behavior of being callable even if the Function was null.
513 To accomplish this, when null, the default construction of the return parameter was used.
514 This means Function can't be used with return types that are not default constructible,
515 such as reference types and Ref.
517 This behavior of returning something when null is surprising, as this is not how normal
518 functions behave, and not very useful. Instead, we now assert that the function is not
519 null when being called.
522 (WTF::Function operator(...)):
523 Instead of allowing a null callable wrapper by returning the default construction of
524 the return type, assert that the wrapper is there when calling a Function.
526 2017-08-08 Filip Pizlo <fpizlo@apple.com>
528 Baseline JIT should do caging
529 https://bugs.webkit.org/show_bug.cgi?id=175037
531 Reviewed by Mark Lam.
534 (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
535 (Gigacage::isDisablingPrimitiveGigacageDisabled):
536 (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
537 (Gigacage::canPrimitiveGigacageBeDisabled):
540 2017-08-08 Ryan Haddad <ryanhaddad@apple.com>
542 Unreviewed, rolling out r220368.
544 This change caused WK1 tests to exit early with crashes.
548 "Baseline JIT should do caging"
549 https://bugs.webkit.org/show_bug.cgi?id=175037
550 http://trac.webkit.org/changeset/220368
552 2017-08-08 Michael Catanzaro <mcatanzaro@igalia.com>
554 [CMake] Properly test if compiler supports compiler flags
555 https://bugs.webkit.org/show_bug.cgi?id=174490
557 Reviewed by Konstantin Tokarev.
561 2017-08-07 Filip Pizlo <fpizlo@apple.com>
563 Baseline JIT should do caging
564 https://bugs.webkit.org/show_bug.cgi?id=175037
566 Reviewed by Mark Lam.
569 (Gigacage::disableDisablingPrimitiveGigacageIfShouldBeEnabled):
570 (Gigacage::isDisablingPrimitiveGigacageDisabled):
571 (Gigacage::isPrimitiveGigacagePermanentlyEnabled):
572 (Gigacage::canPrimitiveGigacageBeDisabled):
574 2017-08-07 Filip Pizlo <fpizlo@apple.com>
576 Unreviewed, try to fix Windows build.
581 2017-08-06 Filip Pizlo <fpizlo@apple.com>
583 Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
584 https://bugs.webkit.org/show_bug.cgi?id=174919
586 Reviewed by Keith Miller.
588 This mirrors the changes from bmalloc/Gigacage.h.
590 Also it teaches CagedPtr how to reason about multiple gigacages.
593 (WTF::CagedPtr::get const):
594 (WTF::CagedPtr::operator[] const):
596 (Gigacage::tryMalloc):
597 (Gigacage::tryAllocateVirtualPages):
598 (Gigacage::freeVirtualPages):
599 (Gigacage::tryAlignedMalloc):
600 (Gigacage::alignedFree):
603 (Gigacage::disablePrimitiveGigacage):
604 (Gigacage::addPrimitiveDisableCallback):
605 (Gigacage::removePrimitiveDisableCallback):
610 (Gigacage::tryAlignedMalloc):
611 (Gigacage::alignedFree):
613 (Gigacage::disableGigacage): Deleted.
614 (Gigacage::addDisableCallback): Deleted.
615 (Gigacage::removeDisableCallback): Deleted.
617 2017-08-07 Brian Burg <bburg@apple.com>
619 Remove CANVAS_PATH compilation guard
620 https://bugs.webkit.org/show_bug.cgi?id=175207
622 Reviewed by Sam Weinig.
624 * wtf/FeatureDefines.h:
626 2017-08-05 Filip Pizlo <fpizlo@apple.com>
628 REGRESSION (r219895-219897): Number of leaks on Open Source went from 9240 to 235983 and is now at 302372
629 https://bugs.webkit.org/show_bug.cgi?id=175083
631 Reviewed by Oliver Hunt.
633 Adds a classic ReadWriteLock class. I wrote my own because I can never remember if the pthread one is
634 guaranted to bias in favor of writers or not.
636 * WTF.xcodeproj/project.pbxproj:
638 (WTF::ConditionBase::construct):
639 (WTF::Condition::Condition):
641 (WTF::LockBase::construct):
643 * wtf/ReadWriteLock.cpp: Added.
644 (WTF::ReadWriteLockBase::construct):
645 (WTF::ReadWriteLockBase::readLock):
646 (WTF::ReadWriteLockBase::readUnlock):
647 (WTF::ReadWriteLockBase::writeLock):
648 (WTF::ReadWriteLockBase::writeUnlock):
649 * wtf/ReadWriteLock.h: Added.
650 (WTF::ReadWriteLockBase::ReadLock::tryLock):
651 (WTF::ReadWriteLockBase::ReadLock::lock):
652 (WTF::ReadWriteLockBase::ReadLock::unlock):
653 (WTF::ReadWriteLockBase::WriteLock::tryLock):
654 (WTF::ReadWriteLockBase::WriteLock::lock):
655 (WTF::ReadWriteLockBase::WriteLock::unlock):
656 (WTF::ReadWriteLockBase::read):
657 (WTF::ReadWriteLockBase::write):
658 (WTF::ReadWriteLock::ReadWriteLock):
660 2017-08-04 Matt Lewis <jlewis3@apple.com>
662 Unreviewed, rolling out r220271.
664 Rolling out due to Layout Test failing on iOS Simulator.
668 "Remove STREAMS_API compilation guard"
669 https://bugs.webkit.org/show_bug.cgi?id=175165
670 http://trac.webkit.org/changeset/220271
672 2017-08-04 Youenn Fablet <youenn@apple.com>
674 Remove STREAMS_API compilation guard
675 https://bugs.webkit.org/show_bug.cgi?id=175165
677 Reviewed by Darin Adler.
679 * wtf/FeatureDefines.h:
681 2017-08-03 Brian Burg <bburg@apple.com>
683 Remove ENABLE(WEB_SOCKET) guards
684 https://bugs.webkit.org/show_bug.cgi?id=167044
686 Reviewed by Joseph Pecoraro.
688 * wtf/FeatureDefines.h:
690 2017-08-03 Youenn Fablet <youenn@apple.com>
692 Remove FETCH_API compilation guard
693 https://bugs.webkit.org/show_bug.cgi?id=175154
695 Reviewed by Chris Dumez.
697 * wtf/FeatureDefines.h:
699 2017-08-03 Brady Eidson <beidson@apple.com>
701 Add SW IDLs and stub out basic functionality.
702 https://bugs.webkit.org/show_bug.cgi?id=175115
704 Reviewed by Chris Dumez.
706 * wtf/FeatureDefines.h:
708 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
710 Unreviewed, build fix for Windows port
711 https://bugs.webkit.org/show_bug.cgi?id=175013
715 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
717 Merge ThreadHolder to WTF::Thread itself
718 https://bugs.webkit.org/show_bug.cgi?id=175013
720 Reviewed by Mark Lam.
722 Currently, we store ThreadHolder* to the TLS, and ThreadHolder* holds Ref<Thread>.
723 When we get Thread& from the current thread TLS, we need to dereference the ThreadHolder*.
724 However, ideally, we can store Thread* directly to the current thread TLS.
725 While the ThreadHolder design is beautiful, it's worth optimizing by storing Thread* directly
726 since Thread::current() is so frequently executed.
728 This patch merges ThreadHolder to Thread. And we now store Thread* directly in the TLS.
729 When storing it to TLS, we call leakRef() to keep Thread ref count incremented by the TLS.
730 And when destroying the TLS, we call `deref()` to ensure that Thread* is dereferenced from
733 * WTF.xcodeproj/project.pbxproj:
734 * wtf/CMakeLists.txt:
735 * wtf/ThreadHolder.cpp: Removed.
736 * wtf/ThreadHolder.h: Removed.
737 * wtf/ThreadHolderPthreads.cpp: Removed.
738 * wtf/ThreadHolderWin.cpp: Removed.
740 (WTF::Thread::entryPoint):
741 (WTF::initializeThreading):
743 (WTF::Thread::currentMayBeNull):
744 (WTF::Thread::current):
745 * wtf/ThreadingPthreads.cpp:
746 (WTF::Thread::waitForCompletion):
747 (WTF::Thread::initializeCurrentTLS):
748 (WTF::Thread::initializeTLSKey):
749 (WTF::Thread::initializeTLS):
750 (WTF::Thread::destructTLS):
751 (WTF::Thread::createCurrentThread): Deleted.
752 * wtf/ThreadingWin.cpp:
753 (WTF::Thread::initializeCurrentTLS):
754 (WTF::threadMapMutex):
755 (WTF::Thread::initializeTLSKey):
756 (WTF::Thread::currentDying):
758 (WTF::Thread::initializeTLS):
759 (WTF::Thread::destructTLS):
760 (WTF::waitForThreadCompletion):
761 (WTF::Thread::createCurrentThread): Deleted.
763 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
765 [Linux][WTF] Use one global semaphore to notify thread suspend and resume completion
766 https://bugs.webkit.org/show_bug.cgi?id=175124
768 Reviewed by Carlos Garcia Campos.
770 POSIX sem_t is used to notify thread suspend and resume completion in Linux ports
771 since sem_post is async-signal-safe function. Since we guard suspend() and resume()
772 with one global lock, this semaphore is also guarded by this lock. So we do not need
773 to have semaphore per WTF::Thread.
775 This patch introduces one global Semaphore. And drop per thread semaphore.
778 * wtf/ThreadingPthreads.cpp:
779 (WTF::Thread::~Thread):
780 (WTF::Semaphore::Semaphore):
781 (WTF::Semaphore::~Semaphore):
782 (WTF::Semaphore::wait):
783 (WTF::Semaphore::post):
784 (WTF::Thread::signalHandlerSuspendResume):
785 (WTF::Thread::initializePlatformThreading):
786 (WTF::Thread::suspend):
787 (WTF::Thread::resume):
788 (WTF::Thread::Thread): Deleted.
789 * wtf/ThreadingWin.cpp:
790 (WTF::Thread::Thread): Deleted.
792 2017-08-03 Yusuke Suzuki <utatane.tea@gmail.com>
794 [Linux][WTF] Reduce sizeof(WTF::Thread) by using a pointer to PlatformRegisters
795 https://bugs.webkit.org/show_bug.cgi?id=175119
797 Reviewed by Carlos Garcia Campos.
799 sizeof(PlatformRegisters) is so large. In my Linux box, it is 256. It enlarges the sizeof(WTF::Thread).
800 However, it is not necessary to hold it in WTF::Thread member. Thread's ucontext data and its stack is
801 effective while suspending the thread. So, we can just use the pointer to the PlatformRegister instead
802 of copying it to the member of the WTF::Thread.
805 * wtf/ThreadingPthreads.cpp:
806 (WTF::Thread::signalHandlerSuspendResume):
807 (WTF::Thread::getRegisters):
809 2017-08-02 Yusuke Suzuki <utatane.tea@gmail.com>
811 Unreviewed, build fix for Windows port
812 https://bugs.webkit.org/show_bug.cgi?id=174716
814 This ugliness will be fixed in https://bugs.webkit.org/show_bug.cgi?id=175013.
816 * wtf/ThreadHolder.h:
819 2017-08-02 Yusuke Suzuki <utatane.tea@gmail.com>
821 Merge WTFThreadData to Thread::current
822 https://bugs.webkit.org/show_bug.cgi?id=174716
824 Reviewed by Mark Lam.
826 We placed thread specific data in WTFThreadData previously. But now, we have a new good place
827 to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
828 sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
829 This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
830 to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
831 Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
832 before calling WTF::initializeThreading.
834 * WTF.xcodeproj/project.pbxproj:
835 * wtf/CMakeLists.txt:
836 * wtf/LockAlgorithm.h:
837 * wtf/LockAlgorithmInlines.h:
839 * wtf/ParkingLot.cpp:
840 * wtf/StackStats.cpp:
841 (WTF::StackStats::PerThreadStats::PerThreadStats):
842 (WTF::StackStats::CheckPoint::CheckPoint):
843 (WTF::StackStats::CheckPoint::~CheckPoint):
844 (WTF::StackStats::probe):
845 (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
846 * wtf/ThreadHolder.cpp:
847 (WTF::ThreadHolder::initializeCurrent):
848 * wtf/ThreadHolder.h:
849 (WTF::ThreadHolder::ThreadHolder):
850 (WTF::ThreadHolder::currentMayBeNull):
851 (WTF::ThreadHolder::current):
852 * wtf/ThreadHolderPthreads.cpp:
853 (WTF::ThreadHolder::initializeKey):
854 (WTF::ThreadHolder::initialize):
855 (WTF::ThreadHolder::destruct):
856 (WTF::ThreadHolder::initializeOnce): Deleted.
857 (WTF::ThreadHolder::current): Deleted.
858 * wtf/ThreadHolderWin.cpp:
859 (WTF::ThreadHolder::initializeKey):
860 (WTF::ThreadHolder::currentDying):
861 (WTF::ThreadHolder::initialize):
862 (WTF::ThreadHolder::initializeOnce): Deleted.
863 (WTF::ThreadHolder::current): Deleted.
865 (WTF::Thread::initializeInThread):
866 (WTF::Thread::entryPoint):
867 (WTF::Thread::create):
868 (WTF::Thread::didExit):
869 (WTF::initializeThreading):
870 (WTF::Thread::currentMayBeNull): Deleted.
872 (WTF::Thread::current):
873 (WTF::Thread::atomicStringTable):
874 (WTF::Thread::setCurrentAtomicStringTable):
875 (WTF::Thread::stackStats):
876 (WTF::Thread::savedStackPointerAtVMEntry):
877 (WTF::Thread::setSavedStackPointerAtVMEntry):
878 (WTF::Thread::savedLastStackTop):
879 (WTF::Thread::setSavedLastStackTop):
880 * wtf/ThreadingPrimitives.h:
881 * wtf/ThreadingPthreads.cpp:
882 (WTF::Thread::createCurrentThread):
883 (WTF::Thread::current): Deleted.
884 * wtf/ThreadingWin.cpp:
885 (WTF::Thread::createCurrentThread):
886 (WTF::Thread::current): Deleted.
887 * wtf/WTFThreadData.cpp: Removed.
888 * wtf/WTFThreadData.h: Removed.
889 * wtf/text/AtomicString.cpp:
890 * wtf/text/AtomicStringImpl.cpp:
892 * wtf/text/AtomicStringTable.cpp:
893 (WTF::AtomicStringTable::create):
894 * wtf/text/AtomicStringTable.h:
896 2017-08-02 Joseph Pecoraro <pecoraro@apple.com>
898 NeverDestroyed related leaks seen on bots
899 https://bugs.webkit.org/show_bug.cgi?id=175113
901 Reviewed by Yusuke Suzuki.
903 * wtf/NeverDestroyed.h:
904 (WTF::NeverDestroyed::NeverDestroyed):
905 Previously the result of makeNeverDestroyed was not always moving into
906 the `static NeverDestroyed` static local variable. In some cases it would
907 re-invoke the constructor, creating a new NeverDestroyed object. In the
908 case of a Vector it was causing leaks.
910 Adding a move constructor convinces the compiler to move the result
911 of makeNeverDestroyed into the NeverDestroyed static. It doesn't actually
912 invoke the move constructor here, which I believe means it is deciding
913 to perform optional copy elision optimization.
914 'http://en.cppreference.com/w/cpp/language/copy_elision
916 2017-08-02 Filip Pizlo <fpizlo@apple.com>
918 All C++ accesses to JSObject::m_butterfly should do caging
919 https://bugs.webkit.org/show_bug.cgi?id=175039
921 Reviewed by Keith Miller.
923 Adds a smart pointer class that does various kinds of caging for you.
925 * WTF.xcodeproj/project.pbxproj:
926 * wtf/CMakeLists.txt:
927 * wtf/CagedPtr.h: Added.
928 (WTF::CagedPtr::CagedPtr):
929 (WTF::CagedPtr::get const):
930 (WTF::CagedPtr::getMayBeNull const):
931 (WTF::CagedPtr::operator== const):
932 (WTF::CagedPtr::operator!= const):
933 (WTF::CagedPtr::operator bool const):
934 (WTF::CagedPtr::operator* const):
935 (WTF::CagedPtr::operator-> const):
937 2017-08-02 Filip Pizlo <fpizlo@apple.com>
939 We should be OK with the gigacage being disabled on gmalloc
940 https://bugs.webkit.org/show_bug.cgi?id=175082
942 Reviewed by Michael Saboff.
945 (Gigacage::shouldBeEnabled):
947 2017-08-01 Filip Pizlo <fpizlo@apple.com>
949 Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
950 https://bugs.webkit.org/show_bug.cgi?id=174727
952 Reviewed by Mark Lam.
954 For the Gigacage project to have minimal impact, we need to have some abstraction that allows code to
955 avoid having to guard itself with #if's. This adds a Gigacage abstraction that overlays the Gigacage
956 namespace from bmalloc, which always lets you call things like Gigacage::caged and Gigacage::tryMalloc.
958 Because of how many places need to possibly allocate in a gigacage, or possibly perform caged accesses,
959 it's better to hide the question of whether or not it's enabled inside this API.
961 * WTF.xcodeproj/project.pbxproj:
962 * wtf/CMakeLists.txt:
963 * wtf/FastMalloc.cpp:
964 * wtf/Gigacage.cpp: Added.
965 (Gigacage::tryMalloc):
966 (Gigacage::tryAllocateVirtualPages):
967 (Gigacage::freeVirtualPages):
968 (Gigacage::tryAlignedMalloc):
969 (Gigacage::alignedFree):
971 * wtf/Gigacage.h: Added.
972 (Gigacage::ensureGigacage):
973 (Gigacage::disableGigacage):
974 (Gigacage::addDisableCallback):
975 (Gigacage::removeDisableCallback):
978 (Gigacage::tryAlignedMalloc):
979 (Gigacage::alignedFree):
982 2017-07-31 Matt Lewis <jlewis3@apple.com>
984 Unreviewed, rolling out r220060.
986 This broke our internal builds. Contact reviewer of patch for
991 "Merge WTFThreadData to Thread::current"
992 https://bugs.webkit.org/show_bug.cgi?id=174716
993 http://trac.webkit.org/changeset/220060
995 2017-07-31 Yusuke Suzuki <utatane.tea@gmail.com>
997 Merge WTFThreadData to Thread::current
998 https://bugs.webkit.org/show_bug.cgi?id=174716
1000 Reviewed by Sam Weinig.
1002 We placed thread specific data in WTFThreadData previously. But now, we have a new good place
1003 to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread
1004 sometimes have the completely same fields (m_stack etc.) due to initialization order limitations.
1005 This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style
1006 to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus,
1007 Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even
1008 before calling WTF::initializeThreading.
1010 * WTF.xcodeproj/project.pbxproj:
1011 * wtf/CMakeLists.txt:
1012 * wtf/LockAlgorithm.h:
1013 * wtf/LockAlgorithmInlines.h:
1015 * wtf/ParkingLot.cpp:
1016 * wtf/StackStats.cpp:
1017 (WTF::StackStats::PerThreadStats::PerThreadStats):
1018 (WTF::StackStats::CheckPoint::CheckPoint):
1019 (WTF::StackStats::CheckPoint::~CheckPoint):
1020 (WTF::StackStats::probe):
1021 (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
1022 * wtf/ThreadHolder.cpp:
1023 (WTF::ThreadHolder::initializeCurrent):
1024 * wtf/ThreadHolder.h:
1025 (WTF::ThreadHolder::ThreadHolder):
1026 (WTF::ThreadHolder::currentMayBeNull):
1027 (WTF::ThreadHolder::current):
1028 * wtf/ThreadHolderPthreads.cpp:
1029 (WTF::ThreadHolder::initialize):
1030 (WTF::ThreadHolder::destruct):
1031 (WTF::ThreadHolder::current): Deleted.
1032 * wtf/ThreadHolderWin.cpp:
1033 (WTF::ThreadHolder::currentDying):
1034 (WTF::ThreadHolder::initialize):
1035 (WTF::ThreadHolder::current): Deleted.
1036 * wtf/Threading.cpp:
1037 (WTF::Thread::initializeInThread):
1038 (WTF::Thread::entryPoint):
1039 (WTF::Thread::didExit):
1040 (WTF::initializeThreading):
1041 (WTF::Thread::currentMayBeNull): Deleted.
1043 (WTF::Thread::atomicStringTable):
1044 (WTF::Thread::setCurrentAtomicStringTable):
1045 (WTF::Thread::stackStats):
1046 (WTF::Thread::savedStackPointerAtVMEntry):
1047 (WTF::Thread::setSavedStackPointerAtVMEntry):
1048 (WTF::Thread::savedLastStackTop):
1049 (WTF::Thread::setSavedLastStackTop):
1050 (WTF::Thread::current):
1051 * wtf/ThreadingPrimitives.h:
1052 * wtf/ThreadingPthreads.cpp:
1053 (WTF::Thread::createCurrentThread):
1054 (WTF::Thread::current): Deleted.
1055 * wtf/ThreadingWin.cpp:
1056 (WTF::Thread::createCurrentThread):
1057 (WTF::Thread::current): Deleted.
1058 * wtf/WTFThreadData.cpp: Removed.
1059 * wtf/WTFThreadData.h: Removed.
1060 * wtf/text/AtomicString.cpp:
1061 * wtf/text/AtomicStringImpl.cpp:
1063 * wtf/text/AtomicStringTable.cpp:
1064 (WTF::AtomicStringTable::create):
1065 * wtf/text/AtomicStringTable.h:
1067 2017-07-31 Xabier Rodriguez Calvar <calvaris@igalia.com>
1069 Created a bool pretty printer at WTF for debugging purposes
1070 https://bugs.webkit.org/show_bug.cgi?id=174893
1072 Reviewed by Darin Adler.
1074 * wtf/PrintStream.cpp:
1075 (WTF::printInternal): The overload taking bool uses boolForPrinting
1076 * wtf/PrintStream.h:
1077 (WTF::boolForPrinting): Converts a bool in "true" or "false".
1079 2017-07-30 Yusuke Suzuki <utatane.tea@gmail.com>
1081 [WTF] Introduce Private Symbols
1082 https://bugs.webkit.org/show_bug.cgi?id=174935
1084 Reviewed by Darin Adler.
1086 Upcoming proposal of class fields[1] requires private fields.
1087 The simple way to implement it is adding a property with a private symbol.
1088 Currently, we have private symbols for internal properties. They are usual
1089 Symbols managed by the hash table. So basically private symbols are statically
1090 created in BuiltinNames. However this new proposal encourages users to create
1091 such private symbols more and more.
1093 So, this patch introduces notion of "Private" into WTF SymbolImpl. This patch
1094 adds PrivateSymbolImpl. This is SymbolImpl with "Private" flag. We do not need
1095 to look up the symbol from the hash table to check whether the given symbol
1098 [1]: https://github.com/tc39/proposal-class-fields
1100 * wtf/text/StringImpl.h:
1101 * wtf/text/SymbolImpl.cpp:
1102 (WTF::PrivateSymbolImpl::create):
1103 (WTF::PrivateSymbolImpl::createNullSymbol):
1104 * wtf/text/SymbolImpl.h:
1105 (WTF::SymbolImpl::isPrivate):
1106 (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
1107 (WTF::SymbolImpl::SymbolImpl):
1108 (WTF::PrivateSymbolImpl::PrivateSymbolImpl):
1110 2017-07-30 Brady Eidson <beidson@apple.com>
1112 Add URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks.
1113 https://bugs.webkit.org/show_bug.cgi?id=174958
1115 Reviewed by Darin Adler.
1117 This patch adds a new template class "InstanceCounted<T>".
1119 For each specialization, "InstanceCounted" will keep track of the total number of
1120 instances in existence.
1122 This makes explicate leak checking in API tests possible.
1124 Since this adds some runtime and storage overhead the code that actually does anything
1125 is only compiled in debug builds.
1127 * WTF.xcodeproj/project.pbxproj:
1128 * wtf/InstanceCounted.h: Added.
1129 (WTF::InstanceCounted::InstanceCounted):
1130 (WTF::InstanceCounted::instanceCount):
1131 (WTF::InstanceCounted::~InstanceCounted):
1133 2017-07-27 Yusuke Suzuki <utatane.tea@gmail.com>
1135 [WTF] Drop Thread initialization wait in some platforms by introducing StackBounds::newThreadStackBounds(PlatformThreadHandle&)
1136 https://bugs.webkit.org/show_bug.cgi?id=174303
1138 Reviewed by Mark Lam.
1140 Currently, the caller thread of Thread::create() need to wait for completion of the initialization of the target thread.
1141 This is because we need to initialize Thread::m_stack in the target thread. Before this patch, a target thread's
1142 StackBounds can only be retrieved by the target thread itself. However, this potentially causes context-switching between
1143 the caller and the target threads and hurts efficiency of creating threads.
1145 Fortunately, in some platforms (including major platforms except for Windows), we can get StackBounds of a target
1146 thread from a caller thread. This allows us to avoid waiting for completion of thread initialization.
1148 In this patch, we introduce HAVE_STACK_BOUNDS_FOR_NEW_THREAD and StackBounds::newThreadStackBounds. When creating
1149 a new thread, we will use StackBounds::newThreadStackBounds to get StackBounds if possible. As a result, we
1150 do not need to wait for completion of thread initialization to ensure m_stack field of Thread is initialized.
1152 While some documents claim that it is possible on Windows to get the StackBounds of another thread[1], the method relies on
1153 undocumented Windows NT APIs (NtQueryInformationThread, NtReadVirtualMemory etc.). So in this patch, we just
1154 use the conservative approach simply waiting for completion of thread initialization.
1156 [1]: https://stackoverflow.com/questions/3918375/how-to-get-thread-stack-information-on-windows
1159 * wtf/StackBounds.cpp:
1160 (WTF::StackBounds::newThreadStackBounds):
1161 (WTF::StackBounds::currentThreadStackBoundsInternal):
1162 (WTF::StackBounds::initialize): Deleted.
1163 * wtf/StackBounds.h:
1164 (WTF::StackBounds::currentThreadStackBounds):
1165 (WTF::StackBounds::StackBounds):
1166 * wtf/Threading.cpp:
1167 (WTF::Thread::NewThreadContext::NewThreadContext):
1168 (WTF::Thread::entryPoint):
1169 (WTF::Thread::create):
1170 (WTF::Thread::initialize): Deleted.
1172 * wtf/ThreadingPrimitives.h:
1173 * wtf/ThreadingPthreads.cpp:
1174 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1175 (WTF::wtfThreadEntryPoint):
1176 (WTF::Thread::establishHandle):
1177 (WTF::Thread::initializeCurrentThreadInternal):
1178 (WTF::Thread::current):
1179 * wtf/ThreadingWin.cpp:
1180 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1181 (WTF::Thread::initializeCurrentThreadInternal):
1182 (WTF::Thread::current):
1183 * wtf/win/MainThreadWin.cpp:
1184 (WTF::initializeMainThreadPlatform):
1186 2017-07-27 JF Bastien <jfbastien@apple.com>
1188 Update lock benchmarks
1189 https://bugs.webkit.org/show_bug.cgi?id=174907
1191 Reviewed by Filip Pizlo.
1193 * benchmarks/ConditionSpeedTest.cpp:
1195 * benchmarks/LockFairnessTest.cpp:
1196 * benchmarks/LockSpeedTest.cpp:
1197 * benchmarks/ToyLocks.h:
1199 2017-07-26 Brian Burg <bburg@apple.com>
1201 Remove WEB_TIMING feature flag
1202 https://bugs.webkit.org/show_bug.cgi?id=174795
1204 Reviewed by Alex Christensen.
1206 * wtf/FeatureDefines.h:
1208 2017-07-26 Claudio Saavedra <csaavedra@igalia.com>
1210 [WPE] Enable KeyboardEvent key and code attributes
1211 https://bugs.webkit.org/show_bug.cgi?id=174822
1213 Reviewed by Žan Doberšek.
1215 There is no reason for this to be disabled from what I see.
1217 * wtf/FeatureDefines.h: Enable KeyboardEvent key and code attributes.
1219 2017-07-23 Filip Pizlo <fpizlo@apple.com>
1222 https://bugs.webkit.org/show_bug.cgi?id=174750
1224 Reviewed by Keith Miller and Saam Barati.
1226 Moved DFG::NaturalLoops to WTF. The new templatized NaturalLoops<> uses the same Graph abstraction as
1227 Dominators<>. This allows us to add a B3::NaturalLoops for free.
1229 Also made small tweaks to RangeSet, which the LICM uses.
1231 * WTF.xcodeproj/project.pbxproj:
1232 * wtf/CMakeLists.txt:
1234 * wtf/NaturalLoops.h: Added.
1235 (WTF::NaturalLoop::NaturalLoop):
1236 (WTF::NaturalLoop::graph):
1237 (WTF::NaturalLoop::header):
1238 (WTF::NaturalLoop::size):
1239 (WTF::NaturalLoop::at):
1240 (WTF::NaturalLoop::operator[]):
1241 (WTF::NaturalLoop::contains):
1242 (WTF::NaturalLoop::index):
1243 (WTF::NaturalLoop::isOuterMostLoop):
1244 (WTF::NaturalLoop::dump):
1245 (WTF::NaturalLoop::addBlock):
1246 (WTF::NaturalLoops::NaturalLoops):
1247 (WTF::NaturalLoops::graph):
1248 (WTF::NaturalLoops::numLoops):
1249 (WTF::NaturalLoops::loop):
1250 (WTF::NaturalLoops::headerOf):
1251 (WTF::NaturalLoops::innerMostLoopOf):
1252 (WTF::NaturalLoops::innerMostOuterLoop):
1253 (WTF::NaturalLoops::belongsTo):
1254 (WTF::NaturalLoops::loopDepth):
1255 (WTF::NaturalLoops::loopsOf):
1256 (WTF::NaturalLoops::dump):
1258 (WTF::RangeSet::begin):
1259 (WTF::RangeSet::end):
1260 (WTF::RangeSet::addAll):
1262 2017-07-23 Michael Catanzaro <mcatanzaro@igalia.com>
1264 Implement FALLTHROUGH attribute for C with GCC
1265 https://bugs.webkit.org/show_bug.cgi?id=174555
1267 Reviewed by Darin Adler.
1269 My previous attempt to silence the JSC -Wimplicit-fallthrough warnings failed because they
1270 are coming from a C file, and our FALLTHROUGH macro is only implemented for C++. So
1271 implement it for C as well, using C attribute syntax.
1273 Note this is only possible to do for GCC, because Clang only supports this attribute using
1274 the [[C++ attribute syntax]].
1278 2017-07-14 Filip Pizlo <fpizlo@apple.com>
1280 It should be easy to decide how WebKit yields
1281 https://bugs.webkit.org/show_bug.cgi?id=174298
1283 Reviewed by Saam Barati.
1285 Created a Thread::yield() abstraction for sched_yield(), and made WTF use it everywhere that it
1286 had previously used std::this_thread::yield().
1288 To make it less annoying to experiment with changes to the lock algorithm in the future, this also
1289 moves the meat of the algorithm into LockAlgorithmInlines.h. Only two files include that header.
1290 Since LockAlgorithm.h no longer includes ParkingLot.h, a bunch of files in WK now need to include
1291 timing headers (Seconds, MonotonicTime, etc) manually.
1293 * WTF.xcodeproj/project.pbxproj:
1294 * benchmarks/ToyLocks.h:
1295 * wtf/CMakeLists.txt:
1297 * wtf/LockAlgorithm.h:
1298 (WTF::LockAlgorithm::lockSlow): Deleted.
1299 (WTF::LockAlgorithm::unlockSlow): Deleted.
1300 * wtf/LockAlgorithmInlines.h: Added.
1301 (WTF::hasParkedBit>::lockSlow):
1302 (WTF::hasParkedBit>::unlockSlow):
1303 * wtf/MainThread.cpp:
1304 * wtf/RunLoopTimer.h:
1305 * wtf/Threading.cpp:
1307 * wtf/ThreadingPthreads.cpp:
1308 (WTF::Thread::yield):
1309 * wtf/ThreadingWin.cpp:
1310 (WTF::Thread::yield):
1312 (WTF::WordLockBase::lockSlow):
1313 (WTF::WordLockBase::unlockSlow):
1315 2017-07-22 Yusuke Suzuki <utatane.tea@gmail.com>
1317 [WTF] Extend ThreadGroup::add results from bool to ThreadGroupAddResult
1318 https://bugs.webkit.org/show_bug.cgi?id=174705
1320 Reviewed by Mark Lam.
1322 After starting using ThreadGroup to bookkeep active threads for Signals,
1323 we would like to know tristate of ThreadGroup::add result, NewlyAdded, AlreadyAdded, NotAdded.
1324 This patch extends the result of ThreadGroup::add from bool to ThreadGroupAddResult tristate.
1325 Note that NotAdded is returned if the target thread is dying.
1327 * wtf/ThreadGroup.cpp:
1328 (WTF::ThreadGroup::add):
1329 (WTF::ThreadGroup::addCurrentThread):
1330 * wtf/ThreadGroup.h:
1331 * wtf/Threading.cpp:
1332 (WTF::Thread::addToThreadGroup):
1334 * wtf/threads/Signals.cpp:
1335 (WTF::registerThreadForMachExceptionHandling):
1337 2017-07-21 Commit Queue <commit-queue@webkit.org>
1339 Unreviewed, rolling out r219732.
1340 https://bugs.webkit.org/show_bug.cgi?id=174748
1342 static is not threadsafe in WebKit tree (Requested by
1343 yusukesuzuki on #webkit).
1347 "[WTF] Drop initializeDate"
1348 https://bugs.webkit.org/show_bug.cgi?id=174714
1349 http://trac.webkit.org/changeset/219732
1351 2017-07-21 Yusuke Suzuki <utatane.tea@gmail.com>
1353 [WTF] Drop initializeDate
1354 https://bugs.webkit.org/show_bug.cgi?id=174714
1356 Reviewed by Darin Adler.
1358 minYear static variable will be initialized in an exclusive manner, which is ensured by C++ "static" semantics.
1359 Thus, we do not need to call initializeDate() explicitly.
1362 (WTF::equivalentYearForDST):
1363 (WTF::initializeDates): Deleted.
1364 * wtf/Threading.cpp:
1365 (WTF::initializeThreading):
1367 2017-07-21 Yusuke Suzuki <utatane.tea@gmail.com>
1369 [JSC] Introduce static symbols
1370 https://bugs.webkit.org/show_bug.cgi?id=158863
1372 Reviewed by Darin Adler.
1374 We add a new class StaticSymbolImpl. StaticSymbolImpl can offer
1375 the way to create static SymbolImpl. It can be shared between
1376 multiple VMs and multiple threads.
1378 * wtf/text/SymbolImpl.h:
1379 (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
1380 (WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&):
1381 For StaticSymbolImpl's hashForSymbol, we use usual string hash value.
1382 Since all the SymbolImpls are unique, basically, any value is OK here.
1383 Non-confilicting to the other SymbolImpls is ideal.
1385 2017-07-21 Yusuke Suzuki <utatane.tea@gmail.com>
1387 [WTF] Newly added AtomicStringImpl should use BufferInternal static string if StringImpl is static
1388 https://bugs.webkit.org/show_bug.cgi?id=174501
1390 Reviewed by Darin Adler.
1392 When creating AtomicStringImpl from static StringImpl, we can just use createWithoutCopying
1393 to create a BufferInternal AtomicStringImpl which m_data{8,16} is static string's one.
1395 * wtf/text/AtomicStringImpl.cpp:
1396 (WTF::CStringTranslator::hash):
1397 (WTF::CStringTranslator::equal):
1398 (WTF::CStringTranslator::translate):
1399 (WTF::AtomicStringImpl::add):
1400 (WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer):
1401 (WTF::UCharBufferTranslator::hash):
1402 (WTF::UCharBufferTranslator::equal):
1403 (WTF::UCharBufferTranslator::translate):
1404 (WTF::LCharBufferTranslator::hash):
1405 (WTF::LCharBufferTranslator::equal):
1406 (WTF::LCharBufferTranslator::translate):
1407 (WTF::BufferFromStaticDataTranslator::hash):
1408 (WTF::BufferFromStaticDataTranslator::equal):
1409 (WTF::BufferFromStaticDataTranslator::translate):
1410 (WTF::AtomicStringImpl::addLiteral):
1413 (WTF::AtomicStringImpl::addSlowCase):
1414 (WTF::AtomicStringImpl::lookUp):
1415 (WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
1416 (WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
1417 (WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
1418 (WTF::addSubstring): Deleted.
1419 * wtf/text/StringImpl.h:
1421 2017-07-21 Konstantin Tokarev <annulen@yandex.ru>
1423 [cmake] Unreviewed, add definitions necessary to use ICU shipped with macOS
1425 macOS system ICU libraries are built with U_DISABLE_RENAMING=1 and
1426 U_SHOW_CPLUSPLUS_API=0. After r219155 we have to pass this definitons
1427 explicitly, because ICU headers in the tree are not modified anymore.
1429 * wtf/PlatformMac.cmake: Rely on ICU_LIBRARIES instead of passing ICU
1430 library name explicitly in WTF_LIBRARIES.
1432 2017-07-20 Chris Dumez <cdumez@apple.com>
1434 Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
1435 https://bugs.webkit.org/show_bug.cgi?id=174660
1437 Reviewed by Geoffrey Garen.
1439 Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
1440 This essentially replaces a branch to figure out if the new size is less or greater than the
1441 current size by an assertion.
1443 * wtf/IndexSparseSet.h:
1444 (WTF::OverflowHandler>::IndexSparseSet):
1445 (WTF::OverflowHandler>::clear):
1447 (WTF::executeInsertions):
1449 (WTF::RangeSet::compact):
1451 (WTF::removeRepeatedElements):
1452 * wtf/persistence/Coders.h:
1454 2017-07-20 Yusuke Suzuki <utatane.tea@gmail.com>
1456 [WTF] Use ThreadGroup to bookkeep active threads for Mach exception
1457 https://bugs.webkit.org/show_bug.cgi?id=174678
1459 Reviewed by Mark Lam.
1461 We can use ThreadGroup to bookkeep active threads for Mach exceptions.
1462 When the thread dies, it is automatically removed from the thread groups.
1463 So we do not need to call unregisterThreadForMachExceptionHandling.
1465 * wtf/ThreadGroup.cpp:
1466 (WTF::ThreadGroup::~ThreadGroup):
1467 (WTF::ThreadGroup::add):
1468 * wtf/ThreadGroup.h:
1469 * wtf/ThreadHolder.cpp:
1470 (WTF::ThreadHolder::~ThreadHolder):
1471 * wtf/Threading.cpp:
1472 (WTF::Thread::addToThreadGroup):
1473 (WTF::Thread::removeFromThreadGroup):
1475 * wtf/threads/Signals.cpp:
1476 (WTF::setExceptionPorts):
1477 (WTF::activeThreads):
1478 (WTF::registerThreadForMachExceptionHandling):
1479 (WTF::installSignalHandler):
1480 (WTF::unregisterThreadForMachExceptionHandling): Deleted.
1481 * wtf/threads/Signals.h:
1483 2017-07-19 Yusuke Suzuki <utatane.tea@gmail.com>
1485 [WTF] Remove unnecessary indirection of WTF::Thread entry point
1486 https://bugs.webkit.org/show_bug.cgi?id=174291
1488 Reviewed by Mark Lam.
1490 Now wtfThreadEntryPoint is almost the same. Only the difference is function signature due to platform APIs.
1491 We remove ThreadFunctionInvocation indirection in ThreadingPthread.cpp and ThreadingWin.cpp.
1493 Also, ThreadFunctionInvocation keeps a RefPtr to the Thread object. This was previously needed to keep the
1494 Thread object alive until the thread itself could install the ThreadHolder into its thread local storage.
1495 The ThreadHolder has a Ref that keeps the Thread object alive for the lifetime of the thread. Since
1496 Thread::create() now waits for the thread to be initialized before returning and Thread::create() hold a Ref
1497 to the Thread object, we are guaranteed that the Thread object will be alive long enough for it to be installed
1498 in the thread's ThreadHolder, and we no longer need ThreadFunctionInvocation.
1500 And we also simplify ThreadHolder::initialize a bit. Now Thread::create waits for the completion of Thread
1501 initialization. So, after establishing thread handle, we can call ThreadHolder::initialize before completing
1502 Thread initialization.
1504 Also we drop errno.h ifdefs in ThreadingWin.cpp. This is introduced to support WinCE. But now WinCE port is removed.
1506 * WTF.xcodeproj/project.pbxproj:
1507 * wtf/ThreadFunctionInvocation.h: Removed.
1508 * wtf/ThreadHolder.h:
1509 * wtf/ThreadHolderWin.cpp:
1510 (WTF::ThreadHolder::initialize):
1511 * wtf/Threading.cpp:
1512 (WTF::Thread::entryPoint):
1513 (WTF::Thread::create):
1514 (WTF::threadEntryPoint): Deleted.
1516 * wtf/ThreadingPthreads.cpp:
1517 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1518 (WTF::wtfThreadEntryPoint):
1519 (WTF::Thread::establishHandle):
1520 (WTF::Thread::initializeCurrentThreadInternal):
1521 (WTF::Thread::current):
1522 (WTF::Thread::establishPlatformSpecificHandle):
1523 (WTF::Thread::createInternal): Deleted.
1524 (WTF::Thread::establish): Deleted.
1525 * wtf/ThreadingWin.cpp:
1526 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1527 (WTF::Thread::initializeCurrentThreadInternal):
1528 (WTF::wtfThreadEntryPoint):
1529 (WTF::Thread::establishHandle):
1530 (WTF::Thread::current):
1531 (WTF::Thread::establishPlatformSpecificHandle):
1532 (WTF::Thread::createInternal): Deleted.
1533 (WTF::Thread::establish): Deleted.
1534 * wtf/win/MainThreadWin.cpp:
1535 (WTF::initializeMainThreadPlatform):
1537 2017-07-19 Yusuke Suzuki <utatane.tea@gmail.com>
1539 [WTF] Implement WTF::ThreadGroup
1540 https://bugs.webkit.org/show_bug.cgi?id=174081
1542 Reviewed by Mark Lam.
1544 This patch implements WTF::ThreadGroup. It implements core of JSC::MachineThreads with more reliable way.
1545 JSC::MachineThreads was complicated because of managing dead threads. Each JSC::MachineThreads has its
1546 own TLS with a registered destructor. And everytime a thread dies, the registered TLS destructor is called.
1547 And this destructor will remove the current dying thread from JSC::MachineThreads.
1549 However the above implementation is tricky. And each JSC::MachineThreads requires own TLS space, which is
1550 not considered in WTF's Windows ThreadSpecific implementation. Current design works well since we only
1551 have small number of MachineThreads right now.
1553 Instead, we use more reliable way. After introducing WTF::Thread, WTF::Thread has WTF::Thread::didExit,
1554 which is called when associated TLS (with WTF::Thread) is destroyed. We leverage this mechanism to remove
1555 WTF::Thread from MachineThreads.
1557 This patch introduces WTF::ThreadGroup. It is tightly integrated with WTF::Thread: WTF::Thread knows
1558 ThreadGroups which includes this thread. And WTF::ThreadGroup of course knows WTF::Threads added to it.
1559 WTF::Thread::didExit carefully remove itself from WTF::ThreadGroups.
1561 The most important part of this patch is locking. WTF::Thread can die. And WTF::ThreadGroup can die.
1562 If we take a design using two fine grain locks in WTF::Thread and WTF::ThreadGroup, we easily encounter
1563 dead lock. Consider the following case.
1565 1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold a lock of THG, and hold a lock of TH (locking order is THG -> TH).
1566 2. When TH dies, TH need to hold a lock of TH to iterate THGs. And we hold a lock of THG to unregister TH from it (locking order is TH -> THG).
1567 3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (locking order is THG -> TH).
1568 4. When destroying THG, we need to hold a lock of TH to unregister THG from TH. We can hold a lock of THG before that (locking order is THG -> TH).
1570 Then, it easily causes dead lock. We cannot swap the locking order of (2) since iterating THG requires a lock of TH.
1571 To solve this problem, we use std::shared_ptr and std::weak_ptr.
1573 1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold THG, and hold a lock of TH. (THG -> TH)
1574 2. When TH dies, TH first hold lock of TH. And we use std::weak_ptr<>::lock() to retain non-destructed ThreadGroups.
1575 If some of ThreadGroups are dying, we just ignore them. It is ok because such a ThreadGroup will be destructed. So we do not need to unregister this thread from
1576 such a ThreadGroup. Then, we have Vector<std::shared_ptr<ThreadGroup>>. So we unlock a lock of TH. To unregister a thread from thread group, we first hold a
1577 lock of THG and then hold a lock of TH. Both lifetime is ensured: THG is retained by std::shared_ptr. And TH is itself. (TH), (THG -> TH).
1578 3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (THG -> TH).
1579 4. When destroying THG, we hold a lock of THG. And hold a lock of TH. During holding THG's lock, registered thread never dies because (2) holds THG lock. (THG -> TH).
1581 We also fix suspend and resume locking mechanism to avoid dead lock. We should hold the global lock when suspending and resuming.
1582 If we use per-thread lock, the suspended thread can hold the lock of the other threads. It causes dead lock.
1584 * WTF.xcodeproj/project.pbxproj:
1585 * wtf/AutomaticThread.cpp:
1586 * wtf/CMakeLists.txt:
1587 * wtf/CrossThreadCopier.h:
1589 * wtf/ThreadGroup.cpp: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
1590 (WTF::ThreadGroup::~ThreadGroup):
1591 (WTF::ThreadGroup::add):
1592 (WTF::ThreadGroup::addCurrentThread):
1593 * wtf/ThreadGroup.h: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
1594 (WTF::ThreadGroup::create):
1595 (WTF::ThreadGroup::threads):
1596 (WTF::ThreadGroup::getLock):
1597 (WTF::ThreadGroup::weakFromThis):
1598 * wtf/Threading.cpp:
1599 (WTF::shouldRemoveThreadFromThreadGroup):
1600 (WTF::Thread::didExit):
1601 (WTF::Thread::addToThreadGroup):
1602 (WTF::Thread::removeFromThreadGroup):
1604 * wtf/ThreadingPthreads.cpp:
1605 (WTF::Thread::resume):
1606 (WTF::Thread::getRegisters):
1607 * wtf/ThreadingWin.cpp:
1608 (WTF::Thread::resume):
1609 (WTF::Thread::getRegisters):
1611 2017-07-18 Andy Estes <aestes@apple.com>
1613 [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS
1614 https://bugs.webkit.org/show_bug.cgi?id=174631
1616 Reviewed by Tim Horton.
1618 * Configurations/Base.xcconfig:
1620 2017-07-18 Yusuke Suzuki <utatane.tea@gmail.com>
1622 WTF::Thread should have the threads stack bounds.
1623 https://bugs.webkit.org/show_bug.cgi?id=173975
1625 Reviewed by Mark Lam.
1627 We move StackBounds from WTFThreadData to WTF::Thread.
1628 One important thing is that we should make valid StackBounds
1629 visible to Thread::create() caller. When the caller get
1630 WTF::Thread from Thread::create(), this WTF::Thread should
1631 have a valid StackBounds. But StackBounds information can be
1632 retrived only in the WTF::Thread's thread itself.
1634 We also clean up WTF::initializeThreading. StringImpl::empty()
1635 is now statically initialized by using constexpr constructor.
1636 Thus we do not need to call StringImpl::empty() explicitly here.
1637 And WTF::initializeThreading() does not have any main thread
1638 affinity right now in all the platforms. So we fix the comment
1639 in Threading.h. Then, now, WTF::initializeThreading() is called
1640 in UI thread when using Web thread in iOS.
1642 * wtf/StackBounds.h:
1643 (WTF::StackBounds::emptyBounds):
1644 (WTF::StackBounds::StackBounds):
1645 * wtf/Threading.cpp:
1646 (WTF::threadEntryPoint):
1647 (WTF::Thread::create):
1648 (WTF::Thread::currentMayBeNull):
1649 (WTF::Thread::initialize):
1650 (WTF::initializeThreading):
1652 (WTF::Thread::stack):
1653 * wtf/ThreadingPthreads.cpp:
1654 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1655 (WTF::Thread::current):
1656 (WTF::initializeCurrentThreadEvenIfNonWTFCreated): Deleted.
1657 (WTF::Thread::currentMayBeNull): Deleted.
1658 * wtf/ThreadingWin.cpp:
1659 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
1660 (WTF::Thread::initializeCurrentThreadInternal):
1661 (WTF::Thread::current):
1662 * wtf/WTFThreadData.cpp:
1663 (WTF::WTFThreadData::WTFThreadData):
1664 * wtf/WTFThreadData.h:
1665 (WTF::WTFThreadData::stack):
1667 2017-07-18 Andy Estes <aestes@apple.com>
1669 [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION
1670 https://bugs.webkit.org/show_bug.cgi?id=174631
1672 Reviewed by Sam Weinig.
1674 * Configurations/Base.xcconfig:
1676 2017-07-18 Andy Estes <aestes@apple.com>
1678 [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION
1679 https://bugs.webkit.org/show_bug.cgi?id=174631
1681 Reviewed by Dan Bernstein.
1683 * Configurations/Base.xcconfig:
1685 2017-07-18 Andy Estes <aestes@apple.com>
1687 [Xcode] Enable CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING
1688 https://bugs.webkit.org/show_bug.cgi?id=174631
1690 Reviewed by Darin Adler.
1692 * Configurations/Base.xcconfig:
1694 2017-07-17 Konstantin Tokarev <annulen@yandex.ru>
1696 [cmake] Set library types before their targets are created
1697 https://bugs.webkit.org/show_bug.cgi?id=174600
1699 Reviewed by Michael Catanzaro.
1701 Since r219560 library targets are created before PlatformXXX.cmake
1702 files are processed, however library type must be passed in
1703 add_library() call and cannot be changed afterwards. Set these
1704 variables in OptionsXXX.cmake.
1706 * wtf/PlatformGTK.cmake:
1707 * wtf/PlatformMac.cmake:
1709 2017-07-17 Yoshiaki Jitsukawa <Yoshiaki.Jitsukawa@sony.com>
1711 Move USE_AVFOUNDATION definition on Windows to wtf/Platform.h
1712 https://bugs.webkit.org/show_bug.cgi?id=174356
1714 Reviewed by Brent Fulgham.
1716 Move the definition of USE_AVFOUNDATION on Windows to wtf/platform.h
1718 Add a custom command to generate AVFoundationHeaderDetection.h, which
1719 is renamed from WebCoreHeaderDetection.h
1721 * AVFoundationSupport.py: Moved from Source/WebCore/AVFoundationSupport.py.
1723 * wtf/PlatformWin.cmake:
1725 2017-07-17 Darin Adler <darin@apple.com>
1727 Improve use of NeverDestroyed
1728 https://bugs.webkit.org/show_bug.cgi?id=174348
1730 Reviewed by Sam Weinig.
1732 * wtf/HashSet.h: Added an overload of HashSet::add that takes an initializer list of
1733 const references. This is handy to add a bunch of values all at once. Later we can
1734 consider optimizing to grow the hash table only once instead of deciding whether to
1735 grow repeatedly as we add each value.
1736 (WTF::copyToVector): Changed to use std::copy, removing 4 of the 6 lines of code here.
1738 * wtf/MemoryPressureHandler.cpp: Include NeverDestroyed.h here ...
1739 * wtf/MemoryPressureHandler.h: ... not here.
1741 * wtf/NeverDestroyed.h: Added the ability to have a const NeverDestroyed.
1742 Added a makeNeverDestroyed function that deduces the type from the argument.
1743 With auto, this can be used to avoid writing out a long type twice.
1745 * wtf/ThreadingPthreads.cpp: Removed unneeded include of NeverDestroyed.h.
1746 * wtf/text/AtomicString.cpp: Ditto.
1748 2017-07-17 Konstantin Tokarev <annulen@yandex.ru>
1750 [CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called
1751 https://bugs.webkit.org/show_bug.cgi?id=174557
1753 Reviewed by Michael Catanzaro.
1755 * wtf/CMakeLists.txt:
1757 2017-07-14 Jonathan Bedard <jbedard@apple.com>
1760 https://bugs.webkit.org/show_bug.cgi?id=174430
1761 <rdar://problem/33269288>
1763 Reviewed by Tim Horton.
1765 * Configurations/WTF.xcconfig: Exclude MachExceptions.def when building iOS 11 for
1768 2017-07-14 Commit Queue <commit-queue@webkit.org>
1770 Unreviewed, rolling out r219510.
1771 https://bugs.webkit.org/show_bug.cgi?id=174525
1773 Need to revert length() == 0 check for null string (Requested
1774 by yusukesuzuki on #webkit).
1778 "[WTF] Newly added AtomicStringImpl should use BufferInternal
1779 static string if StringImpl is static"
1780 https://bugs.webkit.org/show_bug.cgi?id=174501
1781 http://trac.webkit.org/changeset/219510
1783 2017-07-14 Yusuke Suzuki <utatane.tea@gmail.com>
1785 [WTF] Newly added AtomicStringImpl should use BufferInternal static string if StringImpl is static
1786 https://bugs.webkit.org/show_bug.cgi?id=174501
1788 Reviewed by Darin Adler.
1790 When creating AtomicStringImpl from static StringImpl, we can just use createWithoutCopying
1791 to create a BufferInternal AtomicStringImpl which m_data{8,16} is static string's one.
1793 * wtf/text/AtomicStringImpl.cpp:
1794 (WTF::CStringTranslator::hash):
1795 (WTF::CStringTranslator::equal):
1796 (WTF::CStringTranslator::translate):
1797 (WTF::AtomicStringImpl::add):
1798 (WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer):
1799 (WTF::UCharBufferTranslator::hash):
1800 (WTF::UCharBufferTranslator::equal):
1801 (WTF::UCharBufferTranslator::translate):
1802 (WTF::LCharBufferTranslator::hash):
1803 (WTF::LCharBufferTranslator::equal):
1804 (WTF::LCharBufferTranslator::translate):
1805 (WTF::BufferFromStaticDataTranslator::hash):
1806 (WTF::BufferFromStaticDataTranslator::equal):
1807 (WTF::BufferFromStaticDataTranslator::translate):
1808 (WTF::AtomicStringImpl::addLiteral):
1811 (WTF::AtomicStringImpl::addSlowCase):
1812 (WTF::AtomicStringImpl::lookUp):
1813 (WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
1814 (WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
1815 (WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
1816 (WTF::addSubstring): Deleted.
1817 * wtf/text/StringImpl.h:
1819 2017-07-14 Yusuke Suzuki <utatane.tea@gmail.com>
1821 [WTF] Use std::unique_ptr for StackTrace
1822 https://bugs.webkit.org/show_bug.cgi?id=174495
1824 Reviewed by Alex Christensen.
1826 Instead of returning pointer to heap allocated StackTrace,
1827 we should return std::unique_ptr<StackTrace>.
1828 And we also move WTFGetBackTrace from Assertions.cpp to
1829 StackTrace.cpp to consolidate stack trace related operations
1830 into StackTrace.cpp.
1832 * wtf/Assertions.cpp:
1833 * wtf/StackTrace.cpp:
1835 (WTF::StackTrace::captureStackTrace):
1838 2017-07-13 Yusuke Suzuki <utatane.tea@gmail.com>
1840 Unreviewed, annotate inline for operator==/!= for FastAllocator
1841 https://bugs.webkit.org/show_bug.cgi?id=174366
1847 2017-07-12 Commit Queue <commit-queue@webkit.org>
1849 Unreviewed, rolling out r219176.
1850 https://bugs.webkit.org/show_bug.cgi?id=174436
1852 "Can cause infinite recursion on iOS" (Requested by mlam on
1857 "WTF::Thread should have the threads stack bounds."
1858 https://bugs.webkit.org/show_bug.cgi?id=173975
1859 http://trac.webkit.org/changeset/219176
1861 2017-07-12 Adrian Perez de Castro <aperez@igalia.com>
1863 [WTF] Failure to build when the compiler specifically targets ARMv8-A / defines __ARM_ARCH_8A__
1864 https://bugs.webkit.org/show_bug.cgi?id=174425
1866 Reviewed by Michael Catanzaro.
1868 * wtf/Platform.h: Also check for __ARCH_ARM_8A__ to detect ARMv8.
1870 2017-07-12 Michael Saboff <msaboff@apple.com>
1872 Unreviewed build fix when both DATA_LOG_TO_FILE and DATA_LOG_FILENAME are defined.
1875 (WTF::initializeLogFileOnce): Changed declaration of logBasename from
1876 char* logBasename to const char* logBasename.
1878 2017-07-12 Matt Lewis <jlewis3@apple.com>
1880 Unreviewed, rolling out r219401.
1882 This revision rolled out the previous patch, but after talking
1883 with reviewer, a rebaseline is what was needed.Rolling back in
1888 "Unreviewed, rolling out r219379."
1889 https://bugs.webkit.org/show_bug.cgi?id=174400
1890 http://trac.webkit.org/changeset/219401
1892 2017-07-12 Matt Lewis <jlewis3@apple.com>
1894 Unreviewed, rolling out r219379.
1896 This revision caused a consistent failure in the test
1897 fast/dom/Window/property-access-on-cached-window-after-frame-
1902 "Remove NAVIGATOR_HWCONCURRENCY"
1903 https://bugs.webkit.org/show_bug.cgi?id=174400
1904 http://trac.webkit.org/changeset/219379
1906 2017-07-12 Yusuke Suzuki <utatane.tea@gmail.com>
1908 Unreviewed, attempt to fix Windows build
1909 https://bugs.webkit.org/show_bug.cgi?id=174366
1914 (WTF::FastAllocator::operator==): Deleted.
1915 (WTF::FastAllocator::operator!=): Deleted.
1917 2017-07-11 Carlos Garcia Campos <cgarcia@igalia.com>
1919 [GTK][WPE] Enable FILE_LOCK and implement lockFile and unlockFile
1920 https://bugs.webkit.org/show_bug.cgi?id=174357
1922 Reviewed by Michael Catanzaro.
1924 * wtf/Platform.h: Enable FILE_LOCK in GTK and WPE ports.
1926 2017-07-11 Dean Jackson <dino@apple.com>
1928 Remove NAVIGATOR_HWCONCURRENCY
1929 https://bugs.webkit.org/show_bug.cgi?id=174400
1931 Reviewed by Sam Weinig.
1933 * wtf/FeatureDefines.h:
1935 2017-07-11 Dean Jackson <dino@apple.com>
1937 Rolling out r219372.
1939 * wtf/FeatureDefines.h:
1941 2017-07-11 Dean Jackson <dino@apple.com>
1943 Remove NAVIGATOR_HWCONCURRENCY
1944 https://bugs.webkit.org/show_bug.cgi?id=174400
1946 Reviewed by Sam Weinig.
1948 * wtf/FeatureDefines.h:
1950 2017-07-11 Yusuke Suzuki <utatane.tea@gmail.com>
1952 [WTF] Drop unnecessary AtomicString constructor since we have constexpr hash function
1953 https://bugs.webkit.org/show_bug.cgi?id=174347
1955 Reviewed by Alex Christensen.
1957 Previously, we calculate hash value in perl script and generate source code with that value.
1958 This AtomicString constructor takes this pre-calculated hash value to efficiently construct
1959 itself. But now, we have constexpr hash function, then we do not need to specify hash value
1960 directly in this way. Thus we drop this functionality.
1962 * wtf/text/AtomicString.h:
1963 * wtf/text/AtomicStringImpl.cpp:
1964 (WTF::HashAndCharactersTranslator::hash): Deleted.
1965 (WTF::HashAndCharactersTranslator::equal): Deleted.
1966 (WTF::HashAndCharactersTranslator::translate): Deleted.
1967 * wtf/text/AtomicStringImpl.h:
1968 (WTF::AtomicStringImpl::add):
1970 2017-07-10 Per Arne Vollan <pvollan@apple.com>
1972 [Win] Link error when building WTF from WTF.proj project file.
1973 https://bugs.webkit.org/show_bug.cgi?id=174316
1974 <rdar://problem/33178200>
1976 Reviewed by Brent Fulgham.
1978 WTF_CPU_X86 cmake variable needs to be set for link libraries directories to be correct.
1980 * WTF.vcxproj/WTF.proj:
1982 2017-07-03 Brian Burg <bburg@apple.com>
1984 Web Replay: remove some unused code
1985 https://bugs.webkit.org/show_bug.cgi?id=173903
1987 Rubber-stamped by Joseph Pecoraro.
1989 * wtf/FeatureDefines.h:
1991 2017-07-10 Brady Eidson <beidson@apple.com>
1993 Cleanup lifetime issues of UniqueIDBDatabase and IDBBackingStore.
1994 <rdar://problem/32908525> and https://bugs.webkit.org/show_bug.cgi?id=174244
1996 Reviewed by David Kilzer and Alex Christensen.
1998 Add proper "kill" support to CrossThreadQueue, as well as isEmpty() support.
2000 * wtf/CrossThreadQueue.h:
2001 (WTF::CrossThreadQueue<DataType>::append):
2002 (WTF::CrossThreadQueue<DataType>::kill):
2003 (WTF::CrossThreadQueue<DataType>::isKilled):
2004 (WTF::CrossThreadQueue<DataType>::isEmpty):
2005 (WTF::CrossThreadQueue::isKilled): Deleted.
2007 2017-07-09 Yusuke Suzuki <utatane.tea@gmail.com>
2009 [JSC] Use fastMalloc / fastFree for STL containers
2010 https://bugs.webkit.org/show_bug.cgi?id=174297
2012 Reviewed by Sam Weinig.
2015 (WTF::FastAllocator::FastAllocator):
2016 (WTF::FastAllocator::allocate):
2017 (WTF::FastAllocator::deallocate):
2018 (WTF::FastAllocator::operator==):
2019 (WTF::FastAllocator::operator!=):
2021 2017-07-07 Brent Fulgham <bfulgham@apple.com>
2023 [WK2] Use a rolling 30-day uptime for processing statistics
2024 https://bugs.webkit.org/show_bug.cgi?id=174235
2025 <rdar://problem/33164381>
2027 Reviewed by Chris Dumez.
2029 Modify Deque to allow it to be used in a template specialization in KeyedDecoder.
2033 2017-07-07 Commit Queue <commit-queue@webkit.org>
2035 Unreviewed, rolling out r219238, r219239, and r219241.
2036 https://bugs.webkit.org/show_bug.cgi?id=174265
2038 "fast/workers/dedicated-worker-lifecycle.html is flaky"
2039 (Requested by yusukesuzuki on #webkit).
2041 Reverted changesets:
2043 "[WTF] Implement WTF::ThreadGroup"
2044 https://bugs.webkit.org/show_bug.cgi?id=174081
2045 http://trac.webkit.org/changeset/219238
2047 "Unreviewed, build fix after r219238"
2048 https://bugs.webkit.org/show_bug.cgi?id=174081
2049 http://trac.webkit.org/changeset/219239
2051 "Unreviewed, CLoop build fix after r219238"
2052 https://bugs.webkit.org/show_bug.cgi?id=174081
2053 http://trac.webkit.org/changeset/219241
2055 2017-07-07 Yusuke Suzuki <utatane.tea@gmail.com>
2057 Unreviewed, Windows build fix after r219233 part 4
2058 https://bugs.webkit.org/show_bug.cgi?id=174231
2062 2017-07-06 Yusuke Suzuki <utatane.tea@gmail.com>
2064 Unreviewed, Windows build fix after r219233 part 3
2065 https://bugs.webkit.org/show_bug.cgi?id=174231
2068 (compilerFenceForCrash):
2070 2017-07-06 Yusuke Suzuki <utatane.tea@gmail.com>
2072 Unreviewed, Windows build fix after r219233 part 2
2073 https://bugs.webkit.org/show_bug.cgi?id=174231
2077 2017-07-06 Yusuke Suzuki <utatane.tea@gmail.com>
2079 Unreviewed, Windows build fix after r219233
2080 https://bugs.webkit.org/show_bug.cgi?id=174231
2084 2017-07-06 Yusuke Suzuki <utatane.tea@gmail.com>
2086 Unreviewed, build fix after r219238
2087 https://bugs.webkit.org/show_bug.cgi?id=174081
2089 * wtf/Threading.cpp:
2090 (WTF::Thread::addToThreadGroup):
2092 2017-07-05 Yusuke Suzuki <utatane.tea@gmail.com>
2094 [WTF] Implement WTF::ThreadGroup
2095 https://bugs.webkit.org/show_bug.cgi?id=174081
2097 Reviewed by Mark Lam.
2099 This patch implements WTF::ThreadGroup. It implements core of JSC::MachineThreads with more reliable way.
2100 JSC::MachineThreads was complicated because of managing dead threads. Each JSC::MachineThreads has its
2101 own TLS with a registered destructor. And everytime a thread dies, the registered TLS destructor is called.
2102 And this destructor will remove the current dying thread from JSC::MachineThreads.
2104 However the above implementation is tricky. And each JSC::MachineThreads requires own TLS space, which is
2105 not considered in WTF's Windows ThreadSpecific implementation. Current design works well since we only
2106 have small number of MachineThreads right now.
2108 Instead, we use more reliable way. After introducing WTF::Thread, WTF::Thread has WTF::Thread::didExit,
2109 which is called when associated TLS (with WTF::Thread) is destroyed. We leverage this mechanism to remove
2110 WTF::Thread from MachineThreads.
2112 This patch introduces WTF::ThreadGroup. It is tightly integrated with WTF::Thread: WTF::Thread knows
2113 ThreadGroups which includes this thread. And WTF::ThreadGroup of course knows WTF::Threads added to it.
2114 WTF::Thread::didExit carefully remove itself from WTF::ThreadGroups.
2116 The most important part of this patch is locking. WTF::Thread can die. And WTF::ThreadGroup can die.
2117 If we take a design using two fine grain locks in WTF::Thread and WTF::ThreadGroup, we easily encounter
2118 dead lock. Consider the following case.
2120 1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold a lock of THG, and hold a lock of TH (locking order is THG -> TH).
2121 2. When TH dies, TH need to hold a lock of TH to iterate THGs. And we hold a lock of THG to unregister TH from it (locking order is TH -> THG).
2122 3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (locking order is THG -> TH).
2123 4. When destroying THG, we need to hold a lock of TH to unregister THG from TH. We can hold a lock of THG before that (locking order is THG -> TH).
2125 Then, it easily causes dead lock. We cannot swap the locking order of (2) since iterating THG requires a lock of TH.
2126 To solve this problem, we introduce one global lock ThreadGroup::destructionMutex (GL).
2128 1. When adding WTF::Thread (TH) to WTF::ThreadGroup (THG), we first hold GL, and hold a lock of THG. Do not hold a
2129 lock of TH. TH's thread groups information is guarded by GL instead of a lock of TH (locking order is GL -> THG).
2130 2. When TH dies, TH need to hold GL to iterate THGs. And we hold a lock of THG to unregister TH from it (locking order is GL -> THG).
2131 3. When suspending and resuming THs in THG, we first hold a lock of THG. And then, we hold a lock of TH to suspend and resume it (locking order is THG -> TH).
2132 4. When destroying THG, we need to hold GL to unregister THG from TH. We can hold a lock of THG after that (locking order is GL -> THG).
2134 We still have a lock of THG. By separating GL and THG's lock, we can hold a lock of THG while completely unrelated TH is destructed which takes a lock of GL and unrelated THG.
2136 * WTF.xcodeproj/project.pbxproj:
2137 * wtf/AutomaticThread.cpp:
2138 * wtf/CMakeLists.txt:
2139 * wtf/CrossThreadCopier.h:
2141 * wtf/ThreadGroup.cpp: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
2142 (WTF::ThreadGroup::destructionMutex):
2143 (WTF::ThreadGroup::~ThreadGroup):
2144 (WTF::ThreadGroup::add):
2145 (WTF::ThreadGroup::addCurrentThread):
2146 (WTF::ThreadGroup::removeCurrentThread):
2147 * wtf/ThreadGroup.h: Copied from Source/JavaScriptCore/wasm/WasmMachineThreads.cpp.
2148 (WTF::ThreadGroup::create):
2149 (WTF::ThreadGroup::threads):
2150 (WTF::ThreadGroup::getLock):
2151 * wtf/Threading.cpp:
2152 (WTF::Thread::didExit):
2153 (WTF::Thread::addToThreadGroup):
2154 (WTF::Thread::removeFromThreadGroup):
2156 (WTF::Thread::canAddToThreadGroup):
2158 2017-07-06 Yusuke Suzuki <utatane.tea@gmail.com>
2160 [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
2161 https://bugs.webkit.org/show_bug.cgi?id=174150
2163 Reviewed by Mark Lam.
2165 This patch cleans up StringStatics.cpp and remove it from the tree.
2167 1. Move StringImpl methods to appropriate place, "StringImpl.cpp".
2169 StringImpl::hashSlowCase() and StringImpl::concurrentHash() are defined in
2170 StringStatics.cpp. But they should be defined in StringImpl.cpp.
2171 This patch just moves them to StringImpl.cpp.
2173 2. Use LazyNeverDestroyed to initialize AtomicString atoms like emptyAtom.
2175 Previously, we initialized AtomicString atoms like emptyAtom in a hacky way.
2176 We first define them as extern global variables. However, AtomicString has
2177 a non-trivial constructor. Thus, we cannot do this because it requires global
2178 constructor calls. This is why we have StringStatics.cpp. In this file, we
2179 include "StaticConstructors.h". After including this file, all the global
2180 constructor call disabled in Windows. And in GCC environment, we allocate
2181 void* storage for that variable. And we use placement new in AtomicString::init()
2182 to initialize these storage.
2183 However, we already have better way for that: LazyNeverDestroyed. It just allocates
2184 storage like the above. And it does not have any global constructors. Thus
2185 we can just declare it as a global variable. And we initialize them lazily in
2186 AtomicString::init(). This way effectively avoids "StaticConstructors.h" hacky way.
2187 And it makes "StringStatics.cpp" unnecessary.
2188 Then, we just move these variables and AtomicString::init() to AtomicString.cpp.
2190 And we also change emptyAtom to emptyAtom() to get the value from LazyNeverDestroyed<>.
2192 * WTF.xcodeproj/project.pbxproj:
2193 * wtf/CMakeLists.txt:
2194 * wtf/text/AtomicString.cpp:
2195 (WTF::AtomicString::convertASCIICase):
2196 (WTF::AtomicString::fromUTF8Internal):
2197 (WTF::AtomicString::init):
2198 * wtf/text/AtomicString.h:
2204 (WTF::AtomicString::fromUTF8):
2205 * wtf/text/StringBuilder.h:
2206 (WTF::StringBuilder::toAtomicString):
2207 * wtf/text/StringImpl.cpp:
2208 (WTF::StringImpl::hashSlowCase):
2209 (WTF::StringImpl::concurrentHash):
2210 * wtf/text/StringStatics.cpp: Removed.
2212 2017-07-06 Keith Miller <keith_miller@apple.com>
2214 Add extra insurance to prevent clang from making crash traces sad
2215 https://bugs.webkit.org/show_bug.cgi?id=174231
2217 Reviewed by Saam Barati.
2219 This patch makes it slightly harder for Clang to coalesce our crash calls.
2220 Additionally, it also makes Clang never tail call the WTFCrashWithInfo so
2221 our stack trace should always be "reasonable".
2226 2017-07-06 Matt Lewis <jlewis3@apple.com>
2228 Unreviewed, rolling out r219178.
2230 This caused a consistent failure with the API test
2231 StringBuilderTest.ToAtomicStringOnEmpty on all Debug testers.
2235 "[WTF] Clean up StringStatics.cpp by using
2236 LazyNeverDestroyed<> for Atoms"
2237 https://bugs.webkit.org/show_bug.cgi?id=174150
2238 http://trac.webkit.org/changeset/219178
2240 2017-07-05 Don Olmstead <don.olmstead@sony.com>
2242 [WTF] Move SoftLinking.h into WTF
2243 https://bugs.webkit.org/show_bug.cgi?id=174000
2245 Reviewed by Alex Christensen.
2247 * WTF.xcodeproj/project.pbxproj:
2248 * wtf/SoftLinking.h: Copied from Source/WebCore/platform/ios/QuickLookSoftLink.mm.
2249 * wtf/cocoa/SoftLinking.h: Renamed from Source/WebCore/platform/cocoa/SoftLinking.h.
2250 * wtf/win/SoftLinking.h: Renamed from Source/WebCore/platform/win/SoftLinking.h.
2252 2017-07-05 Yusuke Suzuki <utatane.tea@gmail.com>
2254 Upgrade GCC baseline
2255 https://bugs.webkit.org/show_bug.cgi?id=174155
2257 Reviewed by Michael Catanzaro.
2261 2017-07-05 Yusuke Suzuki <utatane.tea@gmail.com>
2263 WTF::StringImpl::copyChars segfaults when built with GCC 7
2264 https://bugs.webkit.org/show_bug.cgi?id=173407
2266 Reviewed by Andreas Kling.
2268 With GCC 7, StringImpl::copyChars() behaves as unexpected.
2269 This function violates strict aliasing rule.
2271 This optimization is originally introduced to improve performance
2272 in SunSpider's string tests in 2008. When running it in my Linux
2273 box, it no longer causes any observable difference. So, we just
2274 remove this optimization.
2278 string-base64 7.7544+-0.1761 7.6138+-0.2071 might be 1.0185x faster
2279 string-fasta 10.5429+-0.2746 ? 10.7500+-0.2669 ? might be 1.0196x slower
2280 string-tagcloud 14.8588+-0.2828 14.8039+-0.3039
2281 string-unpack-code 36.1769+-0.4251 35.3397+-0.5398 might be 1.0237x faster
2282 string-validate-input 8.5182+-0.2206 8.3514+-0.2179 might be 1.0200x faster
2284 * wtf/text/StringImpl.h:
2285 (WTF::StringImpl::copyChars):
2287 2017-07-05 Yusuke Suzuki <utatane.tea@gmail.com>
2289 Use std::lock_guard instead of std::unique_lock if move semantics and try_lock is not necessary
2290 https://bugs.webkit.org/show_bug.cgi?id=174148
2292 Reviewed by Mark Lam.
2294 It is not necessary to use std::unique_lock if we do not use additional features compared to std::lock_guard.
2296 (WTF::ThreadHolder::get):
2297 (WTF::ThreadHolder::initialize):
2298 (WTF::ThreadHolder::destruct):
2299 * wtf/Threading.cpp:
2300 (WTF::Thread::didExit):
2301 * wtf/ThreadingPthreads.cpp:
2302 (WTF::Thread::changePriority):
2303 (WTF::Thread::waitForCompletion):
2304 (WTF::Thread::detach):
2305 (WTF::Thread::signal):
2306 (WTF::Thread::resume):
2307 (WTF::Thread::getRegisters):
2308 (WTF::Thread::establish):
2309 * wtf/ThreadingWin.cpp:
2310 (WTF::Thread::changePriority):
2311 (WTF::Thread::waitForCompletion):
2312 (WTF::Thread::detach):
2313 (WTF::Thread::resume):
2314 (WTF::Thread::getRegisters):
2315 (WTF::Thread::establish):
2317 (WTF::WordLockBase::unlockSlow):
2319 2017-07-05 Yusuke Suzuki <utatane.tea@gmail.com>
2321 [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
2322 https://bugs.webkit.org/show_bug.cgi?id=174150
2324 Reviewed by Mark Lam.
2326 This patch cleans up StringStatics.cpp and remove it from the tree.
2328 1. Move StringImpl methods to appropriate place, "StringImpl.cpp".
2330 StringImpl::hashSlowCase() and StringImpl::concurrentHash() are defined in
2331 StringStatics.cpp. But they should be defined in StringImpl.cpp.
2332 This patch just moves them to StringImpl.cpp.
2334 2. Use LazyNeverDestroyed to initialize AtomicString atoms like emptyAtom.
2336 Previously, we initialized AtomicString atoms like emptyAtom in a hacky way.
2337 We first define them as extern global variables. However, AtomicString has
2338 a non-trivial constructor. Thus, we cannot do this because it requires global
2339 constructor calls. This is why we have StringStatics.cpp. In this file, we
2340 include "StaticConstructors.h". After including this file, all the global
2341 constructor call disabled in Windows. And in GCC environment, we allocate
2342 void* storage for that variable. And we use placement new in AtomicString::init()
2343 to initialize these storage.
2344 However, we already have better way for that: LazyNeverDestroyed. It just allocates
2345 storage like the above. And it does not have any global constructors. Thus
2346 we can just declare it as a global variable. And we initialize them lazily in
2347 AtomicString::init(). This way effectively avoids "StaticConstructors.h" hacky way.
2348 And it makes "StringStatics.cpp" unnecessary.
2349 Then, we just move these variables and AtomicString::init() to AtomicString.cpp.
2351 And we also change emptyAtom to emptyAtom() to get the value from LazyNeverDestroyed<>.
2353 * WTF.xcodeproj/project.pbxproj:
2354 * wtf/CMakeLists.txt:
2355 * wtf/text/AtomicString.cpp:
2356 (WTF::AtomicString::convertASCIICase):
2357 (WTF::AtomicString::fromUTF8Internal):
2358 (WTF::AtomicString::init):
2359 * wtf/text/AtomicString.h:
2365 (WTF::AtomicString::fromUTF8):
2366 * wtf/text/StringBuilder.h:
2367 (WTF::StringBuilder::toAtomicString):
2368 * wtf/text/StringImpl.cpp:
2369 (WTF::StringImpl::hashSlowCase):
2370 (WTF::StringImpl::concurrentHash):
2371 * wtf/text/StringStatics.cpp: Removed.
2373 2017-07-05 Yusuke Suzuki <utatane.tea@gmail.com>
2375 WTF::Thread should have the threads stack bounds.
2376 https://bugs.webkit.org/show_bug.cgi?id=173975
2378 Reviewed by Keith Miller.
2380 We move StackBounds from WTFThreadData to WTF::Thread.
2381 One important thing is that we should make valid StackBounds
2382 visible to Thread::create() caller. When the caller get
2383 WTF::Thread from Thread::create(), this WTF::Thread should
2384 have a valid StackBounds. But StackBounds information can be
2385 retrived only in the WTF::Thread's thread itself.
2387 We also clean up WTF::initializeThreading. StringImpl::empty()
2388 is now statically initialized by using constexpr constructor.
2389 Thus we do not need to call StringImpl::empty() explicitly here.
2390 And WTF::initializeThreading() does not have any main thread
2391 affinity right now in all the platforms. So we fix the comment
2392 in Threading.h. Then, now, WTF::initializeThreading() is called
2393 in UI thread when using Web thread in iOS.
2395 * wtf/StackBounds.h:
2396 (WTF::StackBounds::emptyBounds):
2397 (WTF::StackBounds::StackBounds):
2398 * wtf/StackStats.cpp:
2399 (WTF::StackStats::PerThreadStats::PerThreadStats):
2400 * wtf/Threading.cpp:
2401 (WTF::threadEntryPoint):
2402 (WTF::Thread::create):
2403 (WTF::Thread::currentMayBeNull):
2404 (WTF::Thread::initialize):
2405 (WTF::initializeThreading):
2407 (WTF::Thread::stack):
2408 * wtf/ThreadingPthreads.cpp:
2409 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
2410 (WTF::Thread::current):
2411 (WTF::initializeCurrentThreadEvenIfNonWTFCreated): Deleted.
2412 (WTF::Thread::currentMayBeNull): Deleted.
2413 * wtf/ThreadingWin.cpp:
2414 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
2415 (WTF::Thread::initializeCurrentThreadInternal):
2416 (WTF::Thread::current):
2417 * wtf/WTFThreadData.cpp:
2418 (WTF::WTFThreadData::WTFThreadData):
2419 * wtf/WTFThreadData.h:
2420 (WTF::WTFThreadData::stack): Deleted.
2422 2017-07-05 Keith Miller <keith_miller@apple.com>
2424 Crashing with information should have an abort reason
2425 https://bugs.webkit.org/show_bug.cgi?id=174185
2427 Reviewed by Saam Barati.
2429 Fix an ifdef to actually work with X86_64. It turns out X64_64 is
2430 not an architecture... Whoops.
2432 * wtf/Assertions.cpp:
2434 2017-07-03 Myles C. Maxfield <mmaxfield@apple.com>
2436 Remove copy of ICU headers from WebKit
2437 https://bugs.webkit.org/show_bug.cgi?id=116407
2439 Reviewed by Alex Christensen.
2441 Add an extra rsync command to CopyWTFHeaders which copies the ICU headers
2442 to DSTROOT/usr/local/include/. These headers already live inside a
2443 "unicode" folder, so an example path of a header is
2444 DSTROOT/usr/local/include/unicode/uchar.h. This is already in the search
2445 path of the other WebKit projects, so those other projects can remove
2446 their explicit listing of the old place these headers lived.
2448 Also add the remaining ICU 55.1 headers which the other projects (like
2449 WebCore) need. Revert any local changes to these headers in favor of
2450 using the GCC_PREPROCESSOR_DEFINITIONS build setting. This is so we can
2451 compile the same way against unmodified headers.
2453 * Configurations/Base.xcconfig:
2454 * Configurations/CopyWTFHeaders.xcconfig:
2455 * WTF.xcodeproj/project.pbxproj:
2456 * icu/unicode/alphaindex.h: Added.
2457 * icu/unicode/appendable.h: Added.
2458 * icu/unicode/basictz.h: Added.
2459 * icu/unicode/brkiter.h: Added.
2460 (BreakIterator::isBufferClone):
2461 * icu/unicode/bytestrie.h: Added.
2462 * icu/unicode/bytestriebuilder.h: Added.
2463 * icu/unicode/calendar.h: Added.
2464 (Calendar::createInstance):
2466 (Calendar::internalSet):
2467 (Calendar::weekNumber):
2468 * icu/unicode/caniter.h: Added.
2469 * icu/unicode/chariter.h: Renamed from Source/WebCore/icu/unicode/chariter.h.
2470 * icu/unicode/choicfmt.h: Added.
2471 * icu/unicode/coleitr.h: Added.
2472 (CollationElementIterator::primaryOrder):
2473 (CollationElementIterator::secondaryOrder):
2474 (CollationElementIterator::tertiaryOrder):
2475 (CollationElementIterator::isIgnorable):
2476 * icu/unicode/coll.h: Added.
2477 * icu/unicode/compactdecimalformat.h: Added.
2478 * icu/unicode/curramt.h: Added.
2479 (CurrencyAmount::getCurrency):
2480 (CurrencyAmount::getISOCurrency):
2481 * icu/unicode/currpinf.h: Added.
2482 (CurrencyPluralInfo::operator!=):
2483 * icu/unicode/currunit.h: Added.
2484 (CurrencyUnit::getISOCurrency):
2485 * icu/unicode/datefmt.h: Added.
2486 * icu/unicode/dbbi.h: Added.
2487 * icu/unicode/dcfmtsym.h: Added.
2488 (DecimalFormatSymbols::getSymbol):
2489 (DecimalFormatSymbols::getConstSymbol):
2490 (DecimalFormatSymbols::setSymbol):
2491 (DecimalFormatSymbols::getLocale):
2492 (DecimalFormatSymbols::getCurrencyPattern):
2493 * icu/unicode/decimfmt.h: Added.
2494 (DecimalFormat::getConstSymbol):
2495 * icu/unicode/docmain.h: Added.
2496 * icu/unicode/dtfmtsym.h: Added.
2497 * icu/unicode/dtintrv.h: Added.
2498 (DateInterval::getFromDate):
2499 (DateInterval::getToDate):
2500 (DateInterval::operator!=):
2501 * icu/unicode/dtitvfmt.h: Added.
2502 (DateIntervalFormat::operator!=):
2503 * icu/unicode/dtitvinf.h: Added.
2504 (DateIntervalInfo::operator!=):
2505 * icu/unicode/dtptngen.h: Added.
2506 * icu/unicode/dtrule.h: Added.
2507 * icu/unicode/enumset.h: Added.
2509 (EnumSet::~EnumSet):
2513 (EnumSet::contains):
2516 (EnumSet::isValidEnum):
2517 (EnumSet::isValidValue):
2518 (EnumSet::operator=):
2521 * icu/unicode/errorcode.h: Added.
2522 * icu/unicode/fieldpos.h: Added.
2523 (FieldPosition::operator=):
2524 (FieldPosition::operator==):
2525 (FieldPosition::operator!=):
2526 * icu/unicode/filteredbrk.h: Added.
2527 * icu/unicode/fmtable.h: Added.
2528 (Formattable::getDate):
2529 (Formattable::getString):
2530 (Formattable::getLong):
2531 (Formattable::toUFormattable):
2532 (Formattable::fromUFormattable):
2533 * icu/unicode/format.h: Added.
2534 * icu/unicode/fpositer.h: Added.
2535 * icu/unicode/gender.h: Added.
2536 * icu/unicode/gregocal.h: Added.
2537 * icu/unicode/icudataver.h: Added.
2538 * icu/unicode/icuplug.h: Added.
2539 * icu/unicode/idna.h: Added.
2540 * icu/unicode/listformatter.h: Added.
2541 (ListFormatData::ListFormatData):
2542 * icu/unicode/locdspnm.h: Added.
2543 (LocaleDisplayNames::createInstance):
2544 * icu/unicode/locid.h: Added.
2545 (Locale::operator!=):
2546 (Locale::getCountry):
2547 (Locale::getLanguage):
2548 (Locale::getScript):
2549 (Locale::getVariant):
2552 * icu/unicode/measfmt.h: Added.
2553 * icu/unicode/measunit.h: Added.
2554 * icu/unicode/measure.h: Added.
2555 (Measure::getNumber):
2557 * icu/unicode/messagepattern.h: Added.
2558 * icu/unicode/msgfmt.h: Added.
2559 * icu/unicode/normalizer2.h: Added.
2560 * icu/unicode/normlzr.h: Added.
2561 (Normalizer::operator!= ):
2562 (Normalizer::quickCheck):
2563 (Normalizer::isNormalized):
2564 (Normalizer::compare):
2565 * icu/unicode/numfmt.h: Added.
2566 (NumberFormat::isParseIntegerOnly):
2567 (NumberFormat::isLenient):
2568 * icu/unicode/numsys.h: Added.
2569 * icu/unicode/parsepos.h: Added.
2570 (ParsePosition::operator=):
2571 (ParsePosition::operator==):
2572 (ParsePosition::operator!=):
2573 (ParsePosition::getIndex):
2574 (ParsePosition::setIndex):
2575 (ParsePosition::getErrorIndex):
2576 (ParsePosition::setErrorIndex):
2577 * icu/unicode/plurfmt.h: Added.
2578 * icu/unicode/plurrule.h: Added.
2579 * icu/unicode/rbbi.h: Added.
2580 (RuleBasedBreakIterator::operator!=):
2581 * icu/unicode/rbnf.h: Added.
2582 (RuleBasedNumberFormat::isLenient):
2583 (RuleBasedNumberFormat::getDefaultRuleSet):
2584 * icu/unicode/rbtz.h: Added.
2585 * icu/unicode/regex.h: Added.
2586 * icu/unicode/region.h: Added.
2587 * icu/unicode/reldatefmt.h: Added.
2588 * icu/unicode/resbund.h: Added.
2589 * icu/unicode/schriter.h: Added.
2590 * icu/unicode/scientificnumberformatter.h: Added.
2591 * icu/unicode/search.h: Added.
2592 (SearchIterator::operator!=):
2593 * icu/unicode/selfmt.h: Added.
2594 * icu/unicode/simpletz.h: Added.
2595 (SimpleTimeZone::setStartRule):
2596 (SimpleTimeZone::setEndRule):
2597 (SimpleTimeZone::getOffset):
2598 * icu/unicode/smpdtfmt.h: Added.
2599 (SimpleDateFormat::get2DigitYearStart):
2600 * icu/unicode/sortkey.h: Added.
2601 (CollationKey::operator!=):
2602 (CollationKey::isBogus):
2603 (CollationKey::getByteArray):
2604 * icu/unicode/stringtriebuilder.h: Added.
2605 * icu/unicode/stsearch.h: Added.
2606 * icu/unicode/symtable.h: Added.
2607 * icu/unicode/tblcoll.h: Added.
2608 * icu/unicode/timezone.h: Added.
2611 * icu/unicode/tmunit.h: Added.
2612 * icu/unicode/tmutamt.h: Added.
2613 (TimeUnitAmount::operator!=):
2614 * icu/unicode/tmutfmt.h: Added.
2615 (TimeUnitFormat::operator!=):
2616 * icu/unicode/translit.h: Added.
2617 (Transliterator::getMaximumContextLength):
2618 (Transliterator::setID):
2619 (Transliterator::integerToken):
2620 (Transliterator::pointerToken):
2621 * icu/unicode/tzfmt.h: Added.
2622 * icu/unicode/tznames.h: Added.
2623 * icu/unicode/tzrule.h: Added.
2624 * icu/unicode/tztrans.h: Added.
2625 * icu/unicode/ubidi.h: Added.
2626 * icu/unicode/ucal.h: Renamed from Source/JavaScriptCore/icu/unicode/ucal.h.
2627 * icu/unicode/ucasemap.h: Added.
2628 * icu/unicode/ucat.h: Added.
2629 * icu/unicode/ucharstrie.h: Added.
2630 * icu/unicode/ucharstriebuilder.h: Added.
2631 * icu/unicode/uchriter.h: Added.
2632 * icu/unicode/uclean.h: Added.
2633 * icu/unicode/ucnv_cb.h: Renamed from Source/WebCore/icu/unicode/ucnv_cb.h.
2634 * icu/unicode/ucnvsel.h: Added.
2635 * icu/unicode/ucoleitr.h: Renamed from Source/WebCore/icu/unicode/ucoleitr.h.
2636 * icu/unicode/uconfig.h:
2637 * icu/unicode/ucsdet.h: Renamed from Source/WebCore/icu/unicode/ucsdet.h.
2638 * icu/unicode/udat.h: Renamed from Source/JavaScriptCore/icu/unicode/udat.h.
2639 * icu/unicode/udata.h: Added.
2640 * icu/unicode/udateintervalformat.h: Added.
2641 * icu/unicode/udatpg.h: Renamed from Source/JavaScriptCore/icu/unicode/udatpg.h.
2642 * icu/unicode/udisplaycontext.h: Renamed from Source/JavaScriptCore/icu/unicode/udisplaycontext.h.
2643 * icu/unicode/ufieldpositer.h: Renamed from Source/JavaScriptCore/icu/unicode/ufieldpositer.h.
2644 * icu/unicode/uformattable.h: Renamed from Source/JavaScriptCore/icu/unicode/uformattable.h.
2645 * icu/unicode/ugender.h: Added.
2646 * icu/unicode/uidna.h: Renamed from Source/WebCore/icu/unicode/uidna.h.
2647 * icu/unicode/uldnames.h: Added.
2648 * icu/unicode/ulistformatter.h: Added.
2649 * icu/unicode/ulocdata.h: Added.
2650 * icu/unicode/umisc.h: Renamed from Source/JavaScriptCore/icu/unicode/umisc.h.
2651 * icu/unicode/umsg.h: Added.
2652 * icu/unicode/unifilt.h: Added.
2653 * icu/unicode/unifunct.h: Added.
2654 * icu/unicode/unimatch.h: Added.
2655 * icu/unicode/unirepl.h: Added.
2656 * icu/unicode/uniset.h: Added.
2657 (UnicodeSet::operator!=):
2658 (UnicodeSet::isFrozen):
2659 (UnicodeSet::containsSome):
2660 (UnicodeSet::isBogus):
2661 (UnicodeSet::fromUSet):
2662 (UnicodeSet::toUSet):
2664 (UnicodeSet::spanBack):
2665 * icu/unicode/unum.h: Renamed from Source/JavaScriptCore/icu/unicode/unum.h.
2666 * icu/unicode/unumsys.h: Renamed from Source/JavaScriptCore/icu/unicode/unumsys.h.
2667 * icu/unicode/upluralrules.h: Added.
2668 * icu/unicode/uregex.h: Added.
2669 * icu/unicode/uregion.h: Added.
2670 * icu/unicode/urep.h: Added.
2671 * icu/unicode/ures.h: Added.
2672 (ures_getUnicodeString):
2673 (ures_getNextUnicodeString):
2674 (ures_getUnicodeStringByIndex):
2675 (ures_getUnicodeStringByKey):
2676 * icu/unicode/usearch.h: Renamed from Source/WebCore/icu/unicode/usearch.h.
2677 * icu/unicode/usetiter.h: Added.
2678 (UnicodeSetIterator::isString):
2679 (UnicodeSetIterator::getCodepoint):
2680 (UnicodeSetIterator::getCodepointEnd):
2681 * icu/unicode/ushape.h: Renamed from Source/WebCore/icu/unicode/ushape.h.
2682 * icu/unicode/uspoof.h: Added.
2683 * icu/unicode/usprep.h: Added.
2684 * icu/unicode/ustdio.h: Added.
2685 * icu/unicode/ustream.h: Added.
2686 * icu/unicode/ustringtrie.h: Added.
2687 * icu/unicode/utf32.h: Added.
2688 * icu/unicode/utmscale.h: Added.
2689 * icu/unicode/utrace.h: Added.
2690 * icu/unicode/utrans.h: Added.
2691 * icu/unicode/utypes.h:
2692 * icu/unicode/vtzone.h: Added.
2694 2017-07-04 Yusuke Suzuki <utatane.tea@gmail.com>
2696 [WTF] Make double-conversion's cache data constant and drop double_conversion::initialize()
2697 https://bugs.webkit.org/show_bug.cgi?id=174124
2699 Reviewed by Saam Barati.
2701 We annotate double-conversion's cache data as const and constexpr. And move it out of function.
2702 Since they are not involving global constructors, they are compiled as rodata and initialized
2703 without calling double_conversion::initialize().
2705 And we drop double_conversion::initialize() function since it is no longer necessary.
2707 * wtf/Threading.cpp:
2708 (WTF::initializeThreading):
2709 * wtf/dtoa/cached-powers.cc:
2710 * wtf/dtoa/cached-powers.h:
2712 2017-07-04 Yusuke Suzuki <utatane.tea@gmail.com>
2714 [WTF] Initialize srandom and srand with cryptographically random number
2715 https://bugs.webkit.org/show_bug.cgi?id=174123
2717 Reviewed by Mark Lam.
2719 Use cryptographically random number instead of current time as a seed.
2721 * wtf/RandomNumberSeed.h:
2722 (WTF::initializeRandomNumberGenerator):
2724 2017-07-04 Joseph Pecoraro <pecoraro@apple.com>
2726 Xcode duplicate UUID for DisallowCType.h and DispatchPtr.h
2727 https://bugs.webkit.org/show_bug.cgi?id=174117
2729 Reviewed by Alexey Proskuryakov.
2731 * WTF.xcodeproj/project.pbxproj:
2732 Give DisallowCType.h and DispatchPtr.h different UUIDs.
2734 2017-07-03 Saam Barati <sbarati@apple.com>
2736 LayoutTest workers/bomb.html is a Crash
2737 https://bugs.webkit.org/show_bug.cgi?id=167757
2738 <rdar://problem/33086462>
2740 Reviewed by Keith Miller.
2742 * wtf/AutomaticThread.cpp:
2743 (WTF::AutomaticThreadCondition::waitFor):
2744 * wtf/AutomaticThread.h:
2746 2017-07-03 Commit Queue <commit-queue@webkit.org>
2748 Unreviewed, rolling out r219060.
2749 https://bugs.webkit.org/show_bug.cgi?id=174108
2751 crashing constantly when initializing UIWebView (Requested by
2752 thorton on #webkit).
2756 "WTF::Thread should have the threads stack bounds."
2757 https://bugs.webkit.org/show_bug.cgi?id=173975
2758 http://trac.webkit.org/changeset/219060
2760 2017-07-03 Matt Lewis <jlewis3@apple.com>
2762 Unreviewed, rolling out r219103.
2764 Caused multiple build failures.
2768 "Remove copy of ICU headers from WebKit"
2769 https://bugs.webkit.org/show_bug.cgi?id=116407
2770 http://trac.webkit.org/changeset/219103
2772 2017-07-03 Myles C. Maxfield <mmaxfield@apple.com>
2774 Remove copy of ICU headers from WebKit
2775 https://bugs.webkit.org/show_bug.cgi?id=116407
2777 Reviewed by Alex Christensen.
2779 Add an extra rsync command to CopyWTFHeaders which copies the ICU headers
2780 to DSTROOT/usr/local/include/. These headers already live inside a
2781 "unicode" folder, so an example path of a header is
2782 DSTROOT/usr/local/include/unicode/uchar.h. This is already in the search
2783 path of the other WebKit projects, so those other projects can remove
2784 their explicit listing of the old place these headers lived.
2786 Also add the remaining ICU 55.1 headers which the other projects (like
2787 WebCore) need. Revert any local changes to these headers in favor of
2788 using the GCC_PREPROCESSOR_DEFINITIONS build setting. This is so we can
2789 compile the same way against unmodified headers.
2791 * Configurations/Base.xcconfig:
2792 * Configurations/CopyWTFHeaders.xcconfig:
2793 * WTF.xcodeproj/project.pbxproj:
2794 * icu/unicode/alphaindex.h: Added.
2795 * icu/unicode/appendable.h: Added.
2796 * icu/unicode/basictz.h: Added.
2797 * icu/unicode/brkiter.h: Added.
2798 (BreakIterator::isBufferClone):
2799 * icu/unicode/bytestrie.h: Added.
2800 * icu/unicode/bytestriebuilder.h: Added.
2801 * icu/unicode/calendar.h: Added.
2802 (Calendar::createInstance):
2804 (Calendar::internalSet):
2805 (Calendar::weekNumber):
2806 * icu/unicode/caniter.h: Added.
2807 * icu/unicode/chariter.h: Renamed from Source/WebCore/icu/unicode/chariter.h.
2808 * icu/unicode/choicfmt.h: Added.
2809 * icu/unicode/coleitr.h: Added.
2810 (CollationElementIterator::primaryOrder):
2811 (CollationElementIterator::secondaryOrder):
2812 (CollationElementIterator::tertiaryOrder):
2813 (CollationElementIterator::isIgnorable):
2814 * icu/unicode/coll.h: Added.
2815 * icu/unicode/compactdecimalformat.h: Added.
2816 * icu/unicode/curramt.h: Added.
2817 (CurrencyAmount::getCurrency):
2818 (CurrencyAmount::getISOCurrency):
2819 * icu/unicode/currpinf.h: Added.
2820 (CurrencyPluralInfo::operator!=):
2821 * icu/unicode/currunit.h: Added.
2822 (CurrencyUnit::getISOCurrency):
2823 * icu/unicode/datefmt.h: Added.
2824 * icu/unicode/dbbi.h: Added.
2825 * icu/unicode/dcfmtsym.h: Added.
2826 (DecimalFormatSymbols::getSymbol):
2827 (DecimalFormatSymbols::getConstSymbol):
2828 (DecimalFormatSymbols::setSymbol):
2829 (DecimalFormatSymbols::getLocale):
2830 (DecimalFormatSymbols::getCurrencyPattern):
2831 * icu/unicode/decimfmt.h: Added.
2832 (DecimalFormat::getConstSymbol):
2833 * icu/unicode/docmain.h: Added.
2834 * icu/unicode/dtfmtsym.h: Added.
2835 * icu/unicode/dtintrv.h: Added.
2836 (DateInterval::getFromDate):
2837 (DateInterval::getToDate):
2838 (DateInterval::operator!=):
2839 * icu/unicode/dtitvfmt.h: Added.
2840 (DateIntervalFormat::operator!=):
2841 * icu/unicode/dtitvinf.h: Added.
2842 (DateIntervalInfo::operator!=):
2843 * icu/unicode/dtptngen.h: Added.
2844 * icu/unicode/dtrule.h: Added.
2845 * icu/unicode/enumset.h: Added.
2847 (EnumSet::~EnumSet):
2851 (EnumSet::contains):
2854 (EnumSet::isValidEnum):
2855 (EnumSet::isValidValue):
2856 (EnumSet::operator=):
2859 * icu/unicode/errorcode.h: Added.
2860 * icu/unicode/fieldpos.h: Added.
2861 (FieldPosition::operator=):
2862 (FieldPosition::operator==):
2863 (FieldPosition::operator!=):
2864 * icu/unicode/filteredbrk.h: Added.
2865 * icu/unicode/fmtable.h: Added.
2866 (Formattable::getDate):
2867 (Formattable::getString):
2868 (Formattable::getLong):
2869 (Formattable::toUFormattable):
2870 (Formattable::fromUFormattable):
2871 * icu/unicode/format.h: Added.
2872 * icu/unicode/fpositer.h: Added.
2873 * icu/unicode/gender.h: Added.
2874 * icu/unicode/gregocal.h: Added.
2875 * icu/unicode/icudataver.h: Added.
2876 * icu/unicode/icuplug.h: Added.
2877 * icu/unicode/idna.h: Added.
2878 * icu/unicode/listformatter.h: Added.
2879 (ListFormatData::ListFormatData):
2880 * icu/unicode/locdspnm.h: Added.
2881 (LocaleDisplayNames::createInstance):
2882 * icu/unicode/locid.h: Added.
2883 (Locale::operator!=):
2884 (Locale::getCountry):
2885 (Locale::getLanguage):
2886 (Locale::getScript):
2887 (Locale::getVariant):
2890 * icu/unicode/measfmt.h: Added.
2891 * icu/unicode/measunit.h: Added.
2892 * icu/unicode/measure.h: Added.
2893 (Measure::getNumber):
2895 * icu/unicode/messagepattern.h: Added.
2896 * icu/unicode/msgfmt.h: Added.
2897 * icu/unicode/normalizer2.h: Added.
2898 * icu/unicode/normlzr.h: Added.
2899 (Normalizer::operator!= ):
2900 (Normalizer::quickCheck):
2901 (Normalizer::isNormalized):
2902 (Normalizer::compare):
2903 * icu/unicode/numfmt.h: Added.
2904 (NumberFormat::isParseIntegerOnly):
2905 (NumberFormat::isLenient):
2906 * icu/unicode/numsys.h: Added.
2907 * icu/unicode/parsepos.h: Added.
2908 (ParsePosition::operator=):
2909 (ParsePosition::operator==):
2910 (ParsePosition::operator!=):
2911 (ParsePosition::getIndex):
2912 (ParsePosition::setIndex):
2913 (ParsePosition::getErrorIndex):
2914 (ParsePosition::setErrorIndex):
2915 * icu/unicode/plurfmt.h: Added.
2916 * icu/unicode/plurrule.h: Added.
2917 * icu/unicode/rbbi.h: Added.
2918 (RuleBasedBreakIterator::operator!=):
2919 * icu/unicode/rbnf.h: Added.
2920 (RuleBasedNumberFormat::isLenient):
2921 (RuleBasedNumberFormat::getDefaultRuleSet):
2922 * icu/unicode/rbtz.h: Added.
2923 * icu/unicode/regex.h: Added.
2924 * icu/unicode/region.h: Added.
2925 * icu/unicode/reldatefmt.h: Added.
2926 * icu/unicode/resbund.h: Added.
2927 * icu/unicode/schriter.h: Added.
2928 * icu/unicode/scientificnumberformatter.h: Added.
2929 * icu/unicode/search.h: Added.
2930 (SearchIterator::operator!=):
2931 * icu/unicode/selfmt.h: Added.
2932 * icu/unicode/simpletz.h: Added.
2933 (SimpleTimeZone::setStartRule):
2934 (SimpleTimeZone::setEndRule):
2935 (SimpleTimeZone::getOffset):
2936 * icu/unicode/smpdtfmt.h: Added.
2937 (SimpleDateFormat::get2DigitYearStart):
2938 * icu/unicode/sortkey.h: Added.
2939 (CollationKey::operator!=):
2940 (CollationKey::isBogus):
2941 (CollationKey::getByteArray):
2942 * icu/unicode/stringtriebuilder.h: Added.
2943 * icu/unicode/stsearch.h: Added.
2944 * icu/unicode/symtable.h: Added.
2945 * icu/unicode/tblcoll.h: Added.
2946 * icu/unicode/timezone.h: Added.
2949 * icu/unicode/tmunit.h: Added.
2950 * icu/unicode/tmutamt.h: Added.
2951 (TimeUnitAmount::operator!=):
2952 * icu/unicode/tmutfmt.h: Added.
2953 (TimeUnitFormat::operator!=):
2954 * icu/unicode/translit.h: Added.
2955 (Transliterator::getMaximumContextLength):
2956 (Transliterator::setID):
2957 (Transliterator::integerToken):
2958 (Transliterator::pointerToken):
2959 * icu/unicode/tzfmt.h: Added.
2960 * icu/unicode/tznames.h: Added.
2961 * icu/unicode/tzrule.h: Added.
2962 * icu/unicode/tztrans.h: Added.
2963 * icu/unicode/ubidi.h: Added.
2964 * icu/unicode/ucal.h: Renamed from Source/JavaScriptCore/icu/unicode/ucal.h.
2965 * icu/unicode/ucasemap.h: Added.
2966 * icu/unicode/ucat.h: Added.
2967 * icu/unicode/ucharstrie.h: Added.
2968 * icu/unicode/ucharstriebuilder.h: Added.
2969 * icu/unicode/uchriter.h: Added.
2970 * icu/unicode/uclean.h: Added.
2971 * icu/unicode/ucnv_cb.h: Renamed from Source/WebCore/icu/unicode/ucnv_cb.h.
2972 * icu/unicode/ucnvsel.h: Added.
2973 * icu/unicode/ucoleitr.h: Renamed from Source/WebCore/icu/unicode/ucoleitr.h.
2974 * icu/unicode/uconfig.h:
2975 * icu/unicode/ucsdet.h: Renamed from Source/WebCore/icu/unicode/ucsdet.h.
2976 * icu/unicode/udat.h: Renamed from Source/JavaScriptCore/icu/unicode/udat.h.
2977 * icu/unicode/udata.h: Added.
2978 * icu/unicode/udateintervalformat.h: Added.
2979 * icu/unicode/udatpg.h: Renamed from Source/JavaScriptCore/icu/unicode/udatpg.h.
2980 * icu/unicode/udisplaycontext.h: Renamed from Source/JavaScriptCore/icu/unicode/udisplaycontext.h.
2981 * icu/unicode/ufieldpositer.h: Renamed from Source/JavaScriptCore/icu/unicode/ufieldpositer.h.
2982 * icu/unicode/uformattable.h: Renamed from Source/JavaScriptCore/icu/unicode/uformattable.h.
2983 * icu/unicode/ugender.h: Added.
2984 * icu/unicode/uidna.h: Renamed from Source/WebCore/icu/unicode/uidna.h.
2985 * icu/unicode/uldnames.h: Added.
2986 * icu/unicode/ulistformatter.h: Added.
2987 * icu/unicode/ulocdata.h: Added.
2988 * icu/unicode/umisc.h: Renamed from Source/JavaScriptCore/icu/unicode/umisc.h.
2989 * icu/unicode/umsg.h: Added.
2990 * icu/unicode/unifilt.h: Added.
2991 * icu/unicode/unifunct.h: Added.
2992 * icu/unicode/unimatch.h: Added.
2993 * icu/unicode/unirepl.h: Added.
2994 * icu/unicode/uniset.h: Added.
2995 (UnicodeSet::operator!=):
2996 (UnicodeSet::isFrozen):
2997 (UnicodeSet::containsSome):
2998 (UnicodeSet::isBogus):
2999 (UnicodeSet::fromUSet):
3000 (UnicodeSet::toUSet):
3002 (UnicodeSet::spanBack):
3003 * icu/unicode/unum.h: Renamed from Source/JavaScriptCore/icu/unicode/unum.h.
3004 * icu/unicode/unumsys.h: Renamed from Source/JavaScriptCore/icu/unicode/unumsys.h.
3005 * icu/unicode/upluralrules.h: Added.
3006 * icu/unicode/uregex.h: Added.
3007 * icu/unicode/uregion.h: Added.
3008 * icu/unicode/urep.h: Added.
3009 * icu/unicode/ures.h: Added.
3010 (ures_getUnicodeString):
3011 (ures_getNextUnicodeString):
3012 (ures_getUnicodeStringByIndex):
3013 (ures_getUnicodeStringByKey):
3014 * icu/unicode/usearch.h: Renamed from Source/WebCore/icu/unicode/usearch.h.
3015 * icu/unicode/usetiter.h: Added.
3016 (UnicodeSetIterator::isString):
3017 (UnicodeSetIterator::getCodepoint):
3018 (UnicodeSetIterator::getCodepointEnd):
3019 * icu/unicode/ushape.h: Renamed from Source/WebCore/icu/unicode/ushape.h.
3020 * icu/unicode/usprep.h: Added.
3021 * icu/unicode/ustdio.h: Added.
3022 * icu/unicode/ustream.h: Added.
3023 * icu/unicode/ustringtrie.h: Added.
3024 * icu/unicode/utf32.h: Added.
3025 * icu/unicode/utmscale.h: Added.
3026 * icu/unicode/utrace.h: Added.
3027 * icu/unicode/utrans.h: Added.
3028 * icu/unicode/utypes.h:
3029 * icu/unicode/vtzone.h: Added.
3031 2017-07-03 Keith Miller <keith_miller@apple.com>
3033 Fix ifndef in Assertions.h
3034 https://bugs.webkit.org/show_bug.cgi?id=174104
3036 Reviewed by Saam Barati.
3038 The ifndef should have been checking for
3039 CRASH_WITH_SECURITY_IMPLICATION_AND_INFO since that is what the
3044 2017-07-03 Andy Estes <aestes@apple.com>
3046 [Xcode] Add an experimental setting to build with ccache
3047 https://bugs.webkit.org/show_bug.cgi?id=173875
3049 Reviewed by Tim Horton.
3051 * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.
3053 2017-07-03 Daewoong Jang <daewoong.jang@navercorp.com>
3055 Remove an unused function export
3056 https://bugs.webkit.org/show_bug.cgi?id=174084
3058 Reviewed by Yusuke Suzuki.
3062 2017-07-02 Yusuke Suzuki <utatane.tea@gmail.com>
3064 WTF::Thread should have the threads stack bounds.
3065 https://bugs.webkit.org/show_bug.cgi?id=173975
3067 Reviewed by Mark Lam.
3069 We move StackBounds from WTFThreadData to WTF::Thread.
3070 One important thing is that we should make valid StackBounds
3071 visible to Thread::create() caller. When the caller get
3072 WTF::Thread from Thread::create(), this WTF::Thread should
3073 have a valid StackBounds. But StackBounds information can be
3074 retrived only in the WTF::Thread's thread itself.
3076 * wtf/StackBounds.h:
3077 (WTF::StackBounds::emptyBounds):
3078 (WTF::StackBounds::StackBounds):
3079 * wtf/StackStats.cpp:
3080 (WTF::StackStats::PerThreadStats::PerThreadStats):
3081 * wtf/Threading.cpp:
3082 (WTF::threadEntryPoint):
3083 (WTF::Thread::create):
3084 (WTF::Thread::currentMayBeNull):
3085 (WTF::Thread::initialize):
3087 (WTF::Thread::stack):
3088 * wtf/ThreadingPthreads.cpp:
3089 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3090 (WTF::Thread::current):
3091 (WTF::initializeCurrentThreadEvenIfNonWTFCreated): Deleted.
3092 (WTF::Thread::currentMayBeNull): Deleted.
3093 * wtf/ThreadingWin.cpp:
3094 (WTF::Thread::initializeCurrentThreadEvenIfNonWTFCreated):
3095 (WTF::Thread::initializeCurrentThreadInternal):
3096 (WTF::Thread::current):
3097 * wtf/WTFThreadData.cpp:
3098 (WTF::WTFThreadData::WTFThreadData):
3099 * wtf/WTFThreadData.h:
3100 (WTF::WTFThreadData::stack): Deleted.
3102 2017-07-01 Dan Bernstein <mitz@apple.com>
3104 [iOS] Remove code only needed when building for iOS 9.x
3105 https://bugs.webkit.org/show_bug.cgi?id=174068
3107 Reviewed by Tim Horton.
3110 * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
3111 * wtf/spi/darwin/dyldSPI.h:
3113 2017-07-01 Caio Lima <ticaiolima@gmail.com>
3115 [JSC] WTFGetBacktrace can return numberOfFrames == 0 in some architectures
3116 https://bugs.webkit.org/show_bug.cgi?id=172768
3118 Reviewed by Mark Lam.
3120 In some architectures, like ARMv6 running on a Raspberry pi, the
3121 backtrace function from "execinfo.h" is returning 0. In
3122 that case, the RELEASE_ASSERT in StackTrace::captureStackTrace
3123 fails causing a runtime crash.
3124 This patch is adding a guard for the case described above to
3125 avoid a runtime crash in such case.
3127 * wtf/StackTrace.cpp:
3128 (WTF::StackTrace::captureStackTrace):
3130 2017-07-01 Dan Bernstein <mitz@apple.com>
3132 [macOS] Remove code only needed when building for OS X Yosemite
3133 https://bugs.webkit.org/show_bug.cgi?id=174067
3135 Reviewed by Tim Horton.
3137 * Configurations/Base.xcconfig:
3138 * Configurations/DebugRelease.xcconfig:
3140 * wtf/mac/AppKitCompatibilityDeclarations.h:
3141 * wtf/spi/cocoa/SecuritySPI.h:
3142 * wtf/text/TextBreakIterator.cpp:
3144 2017-07-01 Joseph Pecoraro <pecoraro@apple.com>
3146 Add a warning if WEBGL2 is enabled without WEBGL
3147 https://bugs.webkit.org/show_bug.cgi?id=174054
3149 Reviewed by Sam Weinig.
3151 * wtf/FeatureDefines.h:
3153 2017-06-30 Keith Miller <keith_miller@apple.com>
3155 Force crashWithInfo to be out of line.
3156 https://bugs.webkit.org/show_bug.cgi?id=174028
3158 Reviewed by Filip Pizlo.
3160 The first pass at making crashes hold information about why they
3161 were crashing had the problem that it would inline the assertion.
3162 This meant that clang could coalesce DFG_ASSERTS with other
3163 assertion failures in the same function. This patch moves it out
3164 of line to help fix that issue.
3166 * wtf/Assertions.cpp:
3169 (WTF::isIntegralType):
3171 2017-06-30 Yusuke Suzuki <utatane.tea@gmail.com>
3173 [WTF] Drop SymbolRegistry::keyForSymbol
3174 https://bugs.webkit.org/show_bug.cgi?id=174052
3176 Reviewed by Sam Weinig.
3178 Since we can know whether a given symbol is registered by checking RegisteredSymbolImpl,
3179 we do not need to query key string for a given symbol by using SymbolRegistry::keyForSymbol.
3181 * wtf/text/SymbolImpl.h:
3182 (WTF::SymbolImpl::extractFoldedString): Deleted.
3183 * wtf/text/SymbolRegistry.cpp:
3184 (WTF::SymbolRegistry::keyForSymbol): Deleted.
3185 * wtf/text/SymbolRegistry.h:
3187 2017-06-29 Jer Noble <jer.noble@apple.com>
3189 Make Legacy EME API controlled by RuntimeEnabled setting.
3190 https://bugs.webkit.org/show_bug.cgi?id=173994
3192 Reviewed by Sam Weinig.
3194 * wtf/FeatureDefines.h:
3196 2017-06-30 Ryosuke Niwa <rniwa@webkit.org>
3198 Ran sort-Xcode-project-file.
3200 * WTF.xcodeproj/project.pbxproj:
3202 2017-06-30 Matt Lewis <jlewis3@apple.com>
3204 Unreviewed, rolling out r218992.
3206 The patch broke the iOS device builds.
3210 "DFG_ASSERT should allow stuffing registers before trapping."
3211 https://bugs.webkit.org/show_bug.cgi?id=174005
3212 http://trac.webkit.org/changeset/218992
3214 2017-06-30 Keith Miller <keith_miller@apple.com>
3216 DFG_ASSERT should allow stuffing registers before trapping.
3217 https://bugs.webkit.org/show_bug.cgi?id=174005
3219 Reviewed by Mark Lam.
3221 Add new template functions that enable stuffing up to five values
3222 into registers before crashing.
3227 2017-06-28 Brent Fulgham <bfulgham@apple.com>
3229 Teach ResourceLoadStatistics to recognize changes in the file system
3230 https://bugs.webkit.org/show_bug.cgi?id=173800
3231 <rdar://problem/32937842>
3233 Reviewed by Chris Dumez.
3235 * wtf/DispatchPtr.h: Added (moved from WebKit2)
3236 * wtf/Platform.h: Make sure USE_FILE_LOCK is enabled.
3238 2017-06-28 David Kilzer <ddkilzer@apple.com>
3240 Fix typo in comment: WordResult => WorkResult
3242 * wtf/AutomaticThread.h:
3244 2017-06-27 Caio Lima <ticaiolima@gmail.com>
3246 [ESnext] Implement Object Rest - Implementing Object Rest Destructuring
3247 https://bugs.webkit.org/show_bug.cgi?id=167962
3249 Reviewed by Saam Barati.
3254 2017-06-26 Yusuke Suzuki <utatane.tea@gmail.com>
3256 [WTF] Drop Thread::create(obsolete things) API since we can use lambda
3257 https://bugs.webkit.org/show_bug.cgi?id=173825
3259 Reviewed by Saam Barati.
3261 Thread::create(ThreadFunction, void* data, const char* name) is a bit old API.
3262 Since we have C++ lambda, the above API is simply unnecessary. And C++ lambda
3263 based one is better since the above API needs casting data to and from void*.
3267 * wtf/ParallelJobsGeneric.cpp:
3268 (WTF::ParallelEnvironment::ThreadPrivate::tryLockFor):
3269 (WTF::ParallelEnvironment::ThreadPrivate::workerThread): Deleted.
3270 * wtf/ParallelJobsGeneric.h:
3271 * wtf/Threading.cpp:
3272 * wtf/ThreadingWin.cpp:
3273 (WTF::createThread):
3275 2017-06-25 Yusuke Suzuki <utatane.tea@gmail.com>
3277 initializeThreading() [first] causes WTFCrash due to maxSingleAllocationSize not being initialized
3278 https://bugs.webkit.org/show_bug.cgi?id=173720
3280 Reviewed by Mark Lam.
3282 When using std::numeric_limits<size_t>::max() for global variable's initialization,
3283 it seems that it invokes static constructor to initialize this in VC++.
3284 We avoid this edge case by introducing a workaround using SIZE_MAX here.
3286 When I perform git-grep, there is only one site (this) using std::numeric_limits<>::xxx()
3287 to initialize global variable.
3289 * wtf/FastMalloc.cpp:
3291 2017-06-25 Konstantin Tokarev <annulen@yandex.ru>
3293 Remove excessive headers from JavaScriptCore
3294 https://bugs.webkit.org/show_bug.cgi?id=173812
3296 Reviewed by Darin Adler.
3300 2017-06-23 Keith Miller <keith_miller@apple.com>
3302 Switch VMTraps to use halt instructions rather than breakpoint instructions
3303 https://bugs.webkit.org/show_bug.cgi?id=173677
3304 <rdar://problem/32178892>
3306 Reviewed by JF Bastien.
3308 Remove the Trap signal handler code since it plays badly with lldb and combine
3309 SIGBUS with SIGSEGV since distiguishing them is generally non-portable.
3311 Also, update the platform code to only use signaling VMTraps
3312 on where we have an appropriate instruction (x86 and ARM64).
3315 * wtf/threads/Signals.cpp:
3316 (WTF::fromMachException):
3318 (WTF::installSignalHandler):
3319 (WTF::jscSignalHandler):
3320 * wtf/threads/Signals.h:
3321 (WTF::toSystemSignal):
3322 (WTF::fromSystemSignal):
3324 2017-06-23 Antti Koivisto <antti@apple.com>
3326 Add notifyutil registrations for going in and out of simulated low memory state
3327 https://bugs.webkit.org/show_bug.cgi?id=173797
3329 Reviewed by Andreas Kling.
3333 notifyutil -p org.WebKit.lowMemory.begin
3334 notifyutil -p org.WebKit.lowMemory.end
3338 * wtf/cocoa/MemoryPressureHandlerCocoa.mm:
3339 (WTF::MemoryPressureHandler::install):
3341 2017-06-23 Konstantin Tokarev <annulen@yandex.ru>
3343 Remove more unused headers from WTF
3344 https://bugs.webkit.org/show_bug.cgi?id=173761
3346 Reviewed by Yusuke Suzuki.
3349 * wtf/PageAllocation.h:
3350 * wtf/ParallelJobs.h:
3352 2017-06-22 Andreas Kling <akling@apple.com>
3354 Rename MemoryPressureHandler::setTabCount to setPageCount
3355 https://bugs.webkit.org/show_bug.cgi?id=173750
3357 Reviewed by Daniel Bates.
3359 This function is counting WebCore::Page objects (excluding utility Pages used
3360 by SVG-as-image and the web inspector) so let's name it appropriately.
3361 Not all WebKit clients have tabs.
3363 * wtf/MemoryPressureHandler.cpp:
3364 (WTF::MemoryPressureHandler::setPageCount):
3365 (WTF::MemoryPressureHandler::thresholdForMemoryKill):
3366 (WTF::MemoryPressureHandler::measurementTimerFired):
3367 (WTF::MemoryPressureHandler::setTabCount): Deleted.
3368 * wtf/MemoryPressureHandler.h:
3370 2017-06-21 Andreas Kling <akling@apple.com>
3372 Increase memory kill limits for WebContent processes that manage multiple tabs.
3373 https://bugs.webkit.org/show_bug.cgi?id=173674
3375 Reviewed by Geoffrey Garen.
3377 When opening <a target=_blank> links, we currently have to use the same WebContent
3378 process for the new tab, to support scripting the window.opener object.
3379 This means that some WebContent processes end up hosting multiple tabs, making it
3380 more likely that those processes will hit the memory limits.
3382 Address this by adding some additional allowance for multi-tab processes:
3384 For each additional tab, up to 4 tabs, add 1GB to the memory kill limit.
3386 * wtf/MemoryPressureHandler.cpp:
3387 (WTF::thresholdForMemoryKillWithProcessState):
3388 (WTF::MemoryPressureHandler::setTabCount):
3389 (WTF::MemoryPressureHandler::thresholdForMemoryKill):
3390 (WTF::MemoryPressureHandler::measurementTimerFired):
3391 * wtf/MemoryPressureHandler.h:
3393 2017-06-21 Chris Dumez <cdumez@apple.com>
3395 Allow constructing a WTF:Function from a function pointer
3396 https://bugs.webkit.org/show_bug.cgi?id=173660
3398 Reviewed by Alex Christensen.
3400 Allow constructing a WTF:Function from a function pointer and
3401 assigning a function pointer to a WTF:Function.
3405 2017-06-20 Simon Fraser <simon.fraser@apple.com>
3407 Remove WILL_REVEAL_EDGE_EVENTS code
3408 https://bugs.webkit.org/show_bug.cgi?id=173632
3410 Reviewed by Sam Weinig, Beth Dakin.
3412 Remove will-reveal-edge events, which never took off.
3414 * wtf/FeatureDefines.h:
3416 2017-06-20 Konstantin Tokarev <annulen@yandex.ru>
3418 Remove excessive include directives from WTF
3419 https://bugs.webkit.org/show_bug.cgi?id=173553
3421 Reviewed by Saam Barati.
3423 * wtf/AutomaticThread.h:
3424 * wtf/BagToHashMap.h:
3425 * wtf/CrossThreadCopier.h:
3426 * wtf/CrossThreadQueue.h:
3431 * wtf/MessageQueue.h:
3432 * wtf/MetaAllocator.h:
3433 * wtf/MetaAllocatorHandle.h:
3434 * wtf/RandomNumberSeed.h:
3438 * wtf/SchedulePair.h:
3440 * wtf/SynchronizedFixedQueue.h:
3441 * wtf/ThreadMessage.h:
3442 * wtf/Threading.cpp:
3444 * wtf/ThreadingPthreads.cpp:
3445 * wtf/ThreadingWin.cpp:
3446 * wtf/WTFThreadData.h:
3448 * wtf/glib/GRefPtr.h:
3449 * wtf/text/AtomicStringTable.h:
3450 * wtf/text/LineBreakIteratorPoolICU.h:
3452 2017-06-20 Yusuke Suzuki <utatane.tea@gmail.com>
3454 [WTF] Enable WTF::Signals only when HAVE(MACHINE_CONTEXT) is true
3455 https://bugs.webkit.org/show_bug.cgi?id=173590
3457 Reviewed by Carlos Garcia Campos.
3459 WTF::Signals require a feature rewriting a value of a machine context.
3460 This is only available under HAVE(MACHINE_CONTEXT).
3461 This patch disables WTF::Signals on !HAVE(MACHINE_CONTEXT) environments.
3463 * wtf/threads/Signals.cpp:
3464 * wtf/threads/Signals.h:
3466 2017-06-20 Yusuke Suzuki <utatane.tea@gmail.com>
3468 [WTF] Rebaseline std::optional
3469 https://bugs.webkit.org/show_bug.cgi?id=173582
3471 Reviewed by JF Bastien.
3473 Update the copy of our std::optional to the latest version.
3474 It adds std::optional::has_value() and std::optional::reset().
3478 2017-06-18 Yusuke Suzuki <utatane.tea@gmail.com>
3480 [WTF] Include execinfo.h and dlfcn.h based on platform defines
3481 https://bugs.webkit.org/show_bug.cgi?id=173531
3483 Reviewed by Alex Christensen.
3485 execinfo.h and dlfcn.h can be missing in some libc libraries.
3486 When including it, we should honor platform defines like HAVE(DLADDR).
3488 * wtf/StackTrace.cpp:
3490 2017-06-18 Darin Adler <darin@apple.com>
3492 Fix Ref to deref before assignment, add tests for this to RefPtr, Ref, Function
3493 https://bugs.webkit.org/show_bug.cgi?id=173526
3495 Reviewed by Sam Weinig.
3497 * wtf/Ref.h: Changed operator= to not be defined inside the class definition.
3498 Added swap functions. Changed operator= implementations to use swap in the
3499 conventional manner, the same way that RefPtr does.
3501 2017-06-18 Chris Dumez <cdumez@apple.com>
3503 Use WTF::Function instead of std::function in WTF/
3504 https://bugs.webkit.org/show_bug.cgi?id=173519
3506 Reviewed by Sam Weinig.
3508 Use WTF::Function instead of std::function in WTF/ to avoid
3514 * wtf/FunctionDispatcher.h:
3516 * wtf/MemoryPressureHandler.h:
3517 (WTF::MemoryPressureHandler::setMemoryKillCallback):
3518 (WTF::MemoryPressureHandler::setMemoryPressureStatusChangedCallback):
3519 (WTF::MemoryPressureHandler::setDidExceedInactiveLimitWhileActiveCallback):
3523 (WTF::RefCounter<T>::RefCounter):
3525 * wtf/linux/MemoryPressureHandlerLinux.cpp:
3526 (WTF::MemoryPressureHandler::EventFDPoller::EventFDPoller):
3527 * wtf/text/WTFString.cpp:
3528 (WTF::String::split):
3529 * wtf/text/WTFString.h:
3531 2017-06-16 Alex Christensen <achristensen@webkit.org>
3533 Fix Mac CMake build.
3535 * wtf/PlatformMac.cmake:
3536 Generate MachExceptionsServer.h
3538 2017-06-16 Wenson Hsieh <wenson_hsieh@apple.com>
3540 [iOS DnD] Upstream iOS drag and drop implementation into OpenSource WebKit
3541 https://bugs.webkit.org/show_bug.cgi?id=173366
3542 <rdar://problem/32767014>
3544 Reviewed by Tim Horton.
3546 Define ENABLE_DRAG_SUPPORT as 1 by default and 0 for iOS, and define ENABLE_DATA_INTERACTION as 0 by default.
3547 These are overridden to both be 1 for iOS 11+ in the FeatureDefines.xcconfig within each individual project.
3551 2017-06-15 Chris Dumez <cdumez@apple.com>
3553 Fix typo in XPCSPI.h
3554 https://bugs.webkit.org/show_bug.cgi?id=173426
3556 Reviewed by Alex Christensen.
3558 We should check if xpc_release is defined before defining it,
3561 * wtf/spi/darwin/XPCSPI.h:
3563 2017-06-15 Konstantin Tokarev&nb