overwriteCodePoint() in createAndFillGlyphPage() is wrong
https://bugs.webkit.org/show_bug.cgi?id=215643
<rdar://problem/67430461>
Reviewed by Alan Bujtas.
Source/WebCore:
The CSS spec says that certain characters have to be invisible. Previously, we were doing this
by just treating these characters as if they were the zero width space character. However, this
is wrong for 2 reasons:
1. If the primary font supports the desired character but doesn't support the zero width space
character, we'll fallback past it and trigger a download for secondary fonts until
we find one that supports the ZWS character (which the page didn't even ask for!)
2. Shaping is Turing-complete, and expects that the correct glyphIDs are fed into the shaper.
We can't just arbitrarily swap out glyphIDs before shaping just because we feel like it.
Instead, the solution is to handle these invisible characters after font fallback, and after
shaping. This patch does it just like we handle adding letter-spacing, word-spacing, and
justification after shaping - by iterating over the glyphs output by the shaper and seeing if
any need to be adjusted.
This patch also includes a fix for the situation where the glyph buffer might be left in an
inconsistent state, where the array of glyphs is shorter than the array of characters -
this new codepath added in this patch revealed this existing problem, and fixes it here too.
Test: fast/text/zwj-ligature.html
* platform/graphics/Font.cpp:
(WebCore::createAndFillGlyphPage):
(WebCore::overrideControlCharacters): Deleted.
* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::glyphAt const):
(WebCore::GlyphBuffer::deleteGlyphWithoutAffectingSize):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::applyCSSVisibilityRules):
(WebCore::WidthIterator::advance):
* platform/graphics/WidthIterator.h:
Source/WTF:
* wtf/unicode/CharacterNames.h:
LayoutTests:
* fast/text/resources/Ahem-GSUB-ligatures.ttf: Added.
* fast/text/zwj-ligature-expected.html: Added.
* fast/text/zwj-ligature.html: Added.
* platform/mac/fast/text/format-control-expected.txt: Progression! A new ligature is formed that wasn't formed before.
Also, this ligature is formed in both Chrome and Firefox, so we match them now.
* platform/win/TestExpectations:
Canonical link: https://commits.webkit.org/240804@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-22 05:41:27 +00:00
2021-08-21 Myles C. Maxfield <mmaxfield@apple.com>
overwriteCodePoint() in createAndFillGlyphPage() is wrong
https://bugs.webkit.org/show_bug.cgi?id=215643
<rdar://problem/67430461>
Reviewed by Alan Bujtas.
* wtf/unicode/CharacterNames.h:
2021-08-22 01:33:10 +00:00
2021-08-21 Sihui Liu <sihui_liu@apple.com>
IndexedDB: crash when triggering IDBOpenRequest completion back on a worker thread
https://bugs.webkit.org/show_bug.cgi?id=229375
Protect callee in CrossThreadTask if it inherits from ThreadSafeRefCounted<T>.
Reviewed by Brady Eidson.
* wtf/CrossThreadTask.h:
2021-08-20 15:56:05 +00:00
2021-08-20 Mark Lam <mark.lam@apple.com>
Make ptrTagName and tagForPtr WTF_EXPORT_PRIVATE.
https://bugs.webkit.org/show_bug.cgi?id=229328
Reviewed by Yusuke Suzuki.
If ptrTagName and tagForPtr are defined, make them WTF_EXPORT_PRIVATE instead of
static functions. This allows us to call them from the debugger during
interactive debugging sessions.
* wtf/PtrTag.cpp:
(WTF::tagForPtr):
(WTF::ptrTagName):
* wtf/PtrTag.h:
2021-08-20 15:53:13 +00:00
2021-08-20 Mark Lam <mark.lam@apple.com>
Remove assertIsTagged and assertIsNullOrTagged.
https://bugs.webkit.org/show_bug.cgi?id=229329
rdar://82162851
Reviewed by Yusuke Suzuki.
These assertion utility functions rely on tagged pointers always having non-zero
PAC bits. This is an incorrect assumption. A tagged pointer can have PAC bits
that are completely zero. Hence, these assert functions cannot be made to work
reliably. We should remove them to prevent them from being used, and potentially
resulting in flaky assertion failures that will be hard to debug later.
Note: assertIsNotTagged is fine to keep. It asserts that PAC bits of a pointer
are all 0. As a result, this assertion can have false positives where it may think
a tagged pointer is an untagged pointer. However, this is rare because it is not
common to have 0 PAC bits in tagged pointers. False positives on this assertion
won't result in flaky test failures that will waste our time later. Hence,
keeping the assertion will do more good (it will tend to help us find bugs) than
bad (it will rarely let false positives thru). As a result, I'm opting to not
remove it.
* wtf/PtrTag.h:
(WTF::assertIsTagged): Deleted.
(WTF::assertIsNullOrTagged): Deleted.
2021-08-20 05:15:47 +00:00
2021-08-19 Antti Koivisto <antti@apple.com>
[:has() pseudo-class] Basic support
https://bugs.webkit.org/show_bug.cgi?id=228894
Reviewed by Simon Fraser.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
Add off-by-default HasPseudoClassEnabled preference value.
2021-08-20 03:21:05 +00:00
2021-08-19 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Stop treating the system font as a non-variable font
https://bugs.webkit.org/show_bug.cgi?id=228176
Reviewed by Sam Weinig.
* wtf/PlatformUse.h:
2021-08-19 23:13:51 +00:00
2021-08-19 Aditya Keerthi <akeerthi@apple.com>
Remove __has_include guard for _UIDatePickerOverlayPresentation
https://bugs.webkit.org/show_bug.cgi?id=227298
rdar://79970171
Reviewed by Tim Horton.
* wtf/PlatformHave.h:
2021-08-19 21:25:12 +00:00
2021-08-19 David Kilzer <ddkilzer@apple.com>
[WTF] Fix static analyzer warnings for clang tidy bugprone-move-forwarding-reference checker
<https://webkit.org/b/229114>
Reviewed by Darin Adler.
* wtf/Deque.h:
(WTF::inlineCapacity>::appendAndBubble):
* wtf/Scope.h:
(WTF::ScopeExit::ScopeExit):
* wtf/ScopedLambda.h:
(WTF::scopedLambda):
* wtf/SharedTask.h:
(WTF::createSharedTask):
- Replace WTFMove() with std::forward<>().
2021-08-19 19:58:33 +00:00
2021-08-19 Alex Christensen <achristensen@webkit.org>
Remove more non-inclusive language from Source
https://bugs.webkit.org/show_bug.cgi?id=229230
Reviewed by Myles C. Maxfield.
* icu/unicode/uspoof.h:
This comment change comes from upstream ICU.
* wtf/URL.h:
2021-08-19 00:20:53 +00:00
2021-08-18 Ryosuke Niwa <rniwa@webkit.org>
[ iOS Debug ] 12 TestWebKitAPI.WebKitLegacy. tests are crashing
https://bugs.webkit.org/show_bug.cgi?id=229250
Reviewed by Wenson Hsieh.
Disable the assertion when Web Thread is enabled for now.
* wtf/CheckedRef.h:
(WTF::SingleThreadIntegralWrapper::assertThread const):
2021-08-18 21:17:26 +00:00
2021-08-18 Megan Gardner <megan_gardner@apple.com>
Remove unneeded UIKitSPI declarations
https://bugs.webkit.org/show_bug.cgi?id=210075
Reviewed by Wenson Hsieh.
Remove unneeded feature define.
* wtf/PlatformHave.h:
2021-08-18 08:26:33 +00:00
2021-08-18 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][EME] Try to parse XML init datas that could possibly come from MPD manifests
https://bugs.webkit.org/show_bug.cgi?id=229145
Reviewed by Alicia Boya Garcia.
* wtf/glib/GUniquePtr.h: Added deleter for GMarkupParseContext.
2021-08-16 21:45:04 +00:00
2021-08-16 Alex Christensen <achristensen@webkit.org>
Enable PerformanceNavigationAPI by default
https://bugs.webkit.org/show_bug.cgi?id=227336
Reviewed by Chris Dumez.
It passes WPT tests except the following:
navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html and navigation-timing/nav2_test_redirect_xserver.html pass when run from wpt.live,
and other browsers also don't pass when run from our local hosting infrastructure, which doesn't have a good cross-domain redirect.
nav2_test_attributes_values.html fails in Chrome and Firefox. There's something wrong with the port detection in the test.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-08-16 20:42:00 +00:00
2021-08-16 Ryosuke Niwa <rniwa@webkit.org>
Add thread safe version of CanMakeCheckedPtr
https://bugs.webkit.org/show_bug.cgi?id=229018
Reviewed by Geoffrey Garen.
Introduce CanMakeThreadSafeCheckedPtr which is a thread safe version of CanMakeCheckedPtr.
* wtf/CheckedRef.h:
(WTF::CanMakeCheckedPtrBase): Extracted from CanMakeCheckedPtr.
(WTF::CanMakeCheckedPtrBase::~CanMakeCheckedPtrBase):
(WTF::CanMakeCheckedPtrBase::ptrCount const):
(WTF::SingleThreadIntegralWrapper): Added.
(WTF::SingleThreadIntegralWrapper::SingleThreadIntegralWrapper):
(WTF::SingleThreadIntegralWrapper::operator IntegralType const):
(WTF::SingleThreadIntegralWrapper::operator! const):
(WTF::SingleThreadIntegralWrapper::operator++):
(WTF::SingleThreadIntegralWrapper::operator--):
(WTF::SingleThreadIntegralWrapper::assertThread const):
(WTF::CanMakeCheckedPtr): Redefined using CanMakeCheckedPtrBase and SimpleNonAtomicType.
(WTF::CanMakeThreadSafeCheckedPtr): Added.
2021-08-16 16:49:55 +00:00
2021-08-16 David Kilzer <ddkilzer@apple.com>
ThreadSanitizer: ignore uninteresting data races for reference counting of static WTF::StringImpl objects
<https://webkit.org/b/229113>
Reviewed by Chris Dumez.
* wtf/text/StringImpl.h:
(WTF::StringImpl::isStatic const):
- Add SUPPRESS_TSAN attribute since the 0x1 bit is set at
construction and refcounting occurs in increments of 0x2, so
the static bit never changes.
(WTF::StringImpl::ref):
(WTF::StringImpl::deref):
- Return early for static WTF::StringImpl objects to prevent
TSan from reporting data races for m_refCount.
2021-08-16 06:55:58 +00:00
2021-08-15 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Add API to pass WebKitMemoryPressureHandler parameters to the network processes
https://bugs.webkit.org/show_bug.cgi?id=228227
Reviewed by Carlos Garcia Campos.
Added a new method to MemoryPressureHandler to set the configuration by copying the parameter
instead of moving it.
* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::setConfiguration):
Add initial support for Cross-Origin-Embedder-Policy (COEP)
https://bugs.webkit.org/show_bug.cgi?id=228754
Reviewed by Alex Christensen.
LayoutTests/imported/w3c:
Rebaseline COEP WPT tests now that we are passing more checks.
* web-platform-tests/html/cross-origin-embedder-policy/blob.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/coep-frame-javascript.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/coep-on-response-from-service-worker.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/credentialless/iframe-coep-require-corp.tentative.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/data.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker-cache-storage.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/dedicated-worker.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/header-parsing.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/javascript.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/multi-globals/workers-coep-report.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/no-secure-context-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/none-sw-from-require-corp.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/none.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/reporting-to-endpoint.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-blank-expected.txt: Removed.
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-blank.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-srcdoc-expected.txt: Removed.
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-about-srcdoc.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-load-from-cache-storage.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-none.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw-from-require-corp.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp-sw.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/require-corp.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/sandbox.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/service-worker-cache-storage.https-expected.txt:
* web-platform-tests/html/cross-origin-embedder-policy/srcdoc.https-expected.txt:
Source/WebCore:
Add initial support for Cross-Origin-Embedder-Policy (COEP) behind a runtime feature flag, off by default:
- https://html.spec.whatwg.org/multipage/origin.html#coep
The COEP header has the following impacts:
- When a document with `Cross-Origin-Embedder-Policy: require-corp` loads an iframe or a worker script, if the network
response for that iframe doesn't also contain `Cross-Origin-Embedder-Policy: require-corp`, then we fail the load.
- When a document with `Cross-Origin-Embedder-Policy: require-corp` loads cross-origin subresources, then either CORS
must be used or the resource response must be allowed by Cross-Origin-Resource-Policy (CORP) header.
Support is only for WK2 and checks are done in the network process for better security. Support for workers and service
workers (including cache storage) is included.
Most of the Web-Platform-Tests for COEP are passing with this patch. The exceptions are:
- Some tests relying on Blob are failing. Similarly to COOP, Blobs need to inherit COEP from their
creator. This is currently unimplemented as the change will likely be non-trivial. I will follow-up
to fix Blob support for both COOP and COEP.
- Tests in the credentialless/ folder are failing because we do not support `Cross-Origin-Embedder-Policy: credentialless`.
This seems to be a fairly recent extension proposed by Google and it is not part of the HTML specification yet.
- Some tests expect violation reporting and they are failing and we do not implement reporting yet.
Note that `self.crossOriginIsolated` still returns false, even if the pages opts into both COOP & COEP, and APIs such
as SharedArrayBuffer still are not permitted to use. In order to support this, we will have to actually implement process
swapping so that we know a process is not actually shared by several origins.
Test: http/wpt/html/cross-origin-embedder-policy/require-corp.https.html
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::queryCache):
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::convertToException):
* Modules/cache/DOMCacheEngine.h:
* Modules/cache/RetrieveRecordsOptions.h:
(WebCore::RetrieveRecordsOptions::isolatedCopy const):
(WebCore::RetrieveRecordsOptions::encode const):
(WebCore::RetrieveRecordsOptions::decode):
* dom/Document.cpp:
(WebCore::Document::initSecurityContext):
* dom/SecurityContext.h:
(WebCore::SecurityContext::crossOriginEmbedderPolicy const):
(WebCore::SecurityContext::setCrossOriginEmbedderPolicy):
* loader/CrossOriginAccessControl.cpp:
(WebCore::shouldCrossOriginResourcePolicyCancelLoad):
(WebCore::validateCrossOriginResourcePolicy):
* loader/CrossOriginAccessControl.h:
* loader/CrossOriginEmbedderPolicy.cpp:
(WebCore::obtainCrossOriginEmbedderPolicy):
(WebCore::CrossOriginEmbedderPolicy::isolatedCopy const):
* loader/CrossOriginEmbedderPolicy.h:
(WebCore::CrossOriginEmbedderPolicy::encode const):
(WebCore::CrossOriginEmbedderPolicy::decode):
* loader/CrossOriginOpenerPolicy.cpp:
(WebCore::obtainCrossOriginOpenerPolicy):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadResourceSynchronously):
(WebCore::DocumentThreadableLoader::create):
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::crossOriginEmbedderPolicy const):
* loader/DocumentThreadableLoader.h:
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* loader/ResourceLoaderOptions.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/SecurityOrigin.h:
* platform/network/HTTPParsers.cpp:
(WebCore::parseCrossOriginResourcePolicyHeader):
* platform/network/HTTPParsers.h:
* workers/Worker.cpp:
(WebCore::Worker::notifyFinished):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
(WebCore::WorkerScriptLoader::didReceiveResponse):
* workers/WorkerScriptLoader.h:
(WebCore::WorkerScriptLoader::crossOriginEmbedderPolicy const):
* workers/WorkerThread.cpp:
(WebCore::WorkerParameters::isolatedCopy const):
* workers/WorkerThread.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerFetchResult.h:
(WebCore::ServiceWorkerFetchResult::isolatedCopy const):
(WebCore::serviceWorkerFetchError):
(WebCore::ServiceWorkerFetchResult::encode const):
(WebCore::ServiceWorkerFetchResult::decode):
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::notifyFinished):
* workers/service/ServiceWorkerJobClient.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::installContextData):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::SWServerWorker::contextData const):
* workers/service/server/SWServerWorker.h:
Source/WebKit:
As mentioned in the WebCore changelog, we do all the COEP checks in the network process
instead of WebCore for added security. As a result, we need to pass more information
to the network process when doing loads in order to do those checks. The checks are done
in NetworkResourceLoader for navigations & worker script loads (similarly to CSP,
X-FrameOptions) and in NetworkLoadChecker for CORP checks of subresource loads (similarly
to CORS checks).
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::validateResponse):
* NetworkProcess/NetworkLoadChecker.h:
(WebKit::NetworkLoadChecker::setParentCrossOriginEmbedderPolicy):
(WebKit::NetworkLoadChecker::setCrossOriginEmbedderPolicy):
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::parentOrigin const):
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions):
(WebKit::NetworkResourceLoader::shouldInterruptNavigationForCrossOriginEmbedderPolicy):
(WebKit::NetworkResourceLoader::shouldInterruptWorkerLoadForCrossOriginEmbedderPolicy):
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
(WebKit::PingLoad::initialize):
* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
(WebKit::ServiceWorkerFetchTask::didReceiveResponse):
* NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp:
(WebKit::ServiceWorkerSoftUpdateLoader::processResponse):
(WebKit::ServiceWorkerSoftUpdateLoader::didFinishLoading):
* NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h:
* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::Cache::retrieveRecords):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::addParametersShared):
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
Source/WTF:
Add experimental feature flag for Cross-Origin-Embedder-Policy (COEP), off by default.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
LayoutTests:
Update test expectations now that we support COEP on WK2.
* TestExpectations:
* http/wpt/html/cross-origin-embedder-policy/require-corp.https-expected.txt: Added.
* http/wpt/html/cross-origin-embedder-policy/require-corp.https.html: Added.
* http/wpt/html/cross-origin-embedder-policy/require-corp.https.html.headers: Added.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:
Canonical link: https://commits.webkit.org/240459@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-12 02:43:53 +00:00
2021-08-11 Chris Dumez <cdumez@apple.com>
Add initial support for Cross-Origin-Embedder-Policy (COEP)
https://bugs.webkit.org/show_bug.cgi?id=228754
Reviewed by Alex Christensen.
Add experimental feature flag for Cross-Origin-Embedder-Policy (COEP), off by default.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-08-12 02:08:08 +00:00
2021-08-11 Darin Adler <darin@apple.com>
Add deduction guide to RetainPtr, use constexpr a bit more, and streamline the implementation
https://bugs.webkit.org/show_bug.cgi?id=228852
Reviewed by Sam Weinig.
* wtf/RetainPtr.h: Sort includes. Made many functions constexpr including the move
constructors and adoptCF. Use using instead of typedef in most places. Use
remove_pointer_t, conditional_t, is_convertible_v, is_same_v, and other such templates
to simplify expressions. Initialize the m_ptr data member and use the default constructor.
Removed unneeded StorageType synonym for CFTypeRef. Move some inline function bodies out
of the class template definition. Use if constexpr to get rid of the need for the overloaded
autoreleaseHelper function. Added a deduction guide so we can use expressions with the
type RetainPtr on the left side, and an Objective-C pointer or CFTypeRef on the right side,
and have the appropriate RetainPtr type deduced.
2021-08-11 22:25:56 +00:00
2021-08-11 Sihui Liu <sihui_liu@apple.com>
Suspend WorkQueue of ResourceLoadStatistics and LocalStorage sooner
https://bugs.webkit.org/show_bug.cgi?id=228748
<rdar://problem/81626714>
Reviewed by Chris Dumez.
Add SuspendableWorkQueue that would perform suspend check before each task.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Forward.h:
* wtf/SuspendableWorkQueue.cpp: Added.
(WTF::SuspendableWorkQueue::create):
(WTF::SuspendableWorkQueue::SuspendableWorkQueue):
(WTF::SuspendableWorkQueue::suspend):
(WTF::SuspendableWorkQueue::resume):
(WTF::SuspendableWorkQueue::dispatch):
(WTF::SuspendableWorkQueue::dispatchAfter):
(WTF::SuspendableWorkQueue::dispatchSync):
(WTF::SuspendableWorkQueue::invokeAllSuspensionCompletionHandlers):
(WTF::SuspendableWorkQueue::suspendIfNeeded):
* wtf/SuspendableWorkQueue.h: Added.
* wtf/WorkQueue.h:
(): Deleted.
2021-08-11 15:09:00 +00:00
2021-08-11 Youenn Fablet <youenn@apple.com>
Enable WebRTC relay by default
https://bugs.webkit.org/show_bug.cgi?id=229000
<rdar://78767922>
Reviewed by Eric Carlson.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-08-11 06:57:42 +00:00
2021-08-10 Peng Liu <peng.liu6@apple.com>
Disable SYSTEM_FEATURE_FLAGS on iOS 14
https://bugs.webkit.org/show_bug.cgi?id=228979
<rdar://problem/81764452>
Reviewed by Tim Horton.
Stop using feature flags mechanism on iOS 14 to avoid some issues on iOS simulators.
* wtf/PlatformHave.h:
2021-08-10 21:53:12 +00:00
2021-08-10 Stephan Szabo <stephan.szabo@sony.com>
[WTF][PlayStation] REGRESSION(r280795) error: undefined symbol: WTF::logLevelString()
https://bugs.webkit.org/show_bug.cgi?id=228959
Reviewed by Fujii Hironori.
As per followup win fix, for declspec platforms, LoggingUnix needs
to include LogInitialization to get the export declaration.
* wtf/unix/LoggingUnix.cpp:
2021-08-10 18:17:15 +00:00
2021-08-10 Keith Miller <keith_miller@apple.com>
CallFrame::returnPC should untag the return address before passing it to ReturnAddressPtr
https://bugs.webkit.org/show_bug.cgi?id=228931
Reviewed by Mark Lam.
Add a new helper to untag the return pc from a stack frame.
* wtf/PtrTag.h:
(WTF::untagReturnPC):
2021-08-10 02:29:56 +00:00
2021-08-09 Fujii Hironori <Hironori.Fujii@sony.com>
[GTK][WPE] REGRESSION(r280795): MemoryPressureHandlerUnix.cpp:45:28: error: ‘ LogMemoryPressure’ was not declared in this scope
https://bugs.webkit.org/show_bug.cgi?id=228938
Unreviewed build fix.
* wtf/unix/MemoryPressureHandlerUnix.cpp:
2021-08-10 02:15:01 +00:00
2021-08-09 Fujii Hironori <Hironori.Fujii@sony.com>
[WTF][Win] REGRESSION(r280795) error LNK2019: unresolved external symbol "class WTF::String __cdecl WTF::logLevelString(void)"
https://bugs.webkit.org/show_bug.cgi?id=228937
<rdar://problem/81722757>
Unresolved build fix.
The previous attempt (r280819) didn't actually fix the build
error. LoggingWin.cpp has to include LogInitialization.h.
* wtf/win/LoggingWin.cpp:
2021-08-10 01:36:48 +00:00
2021-08-09 Fujii Hironori <Hironori.Fujii@sony.com>
[WTF][Win] REGRESSION(r280795) error LNK2019: unresolved external symbol "class WTF::String __cdecl WTF::logLevelString(void)"
https://bugs.webkit.org/show_bug.cgi?id=228937
Unreviewed build fix.
> error LNK2019: unresolved external symbol "class WTF::String __cdecl WTF::logLevelString(void)" (?logLevelString@WTF@@YA?AVString@1@XZ)
> referenced in function "private: void __cdecl WebKit::GPUProcessProxy::platformInitializeGPUProcessParameters(struct WebKit::GPUProcessCreationParameters &)"
> (?platformInitializeGPUProcessParameters@GPUProcessProxy@WebKit@@AEAAXAEAUGPUProcessCreationParameters@2@@Z)
> bin64\WebKit2.dll : fatal error LNK1120: 1 unresolved externals
* wtf/LogInitialization.h: Added WTF_EXPORT_PRIVATE for logLevelString.
2021-08-10 00:07:45 +00:00
2021-08-09 Myles C. Maxfield <mmaxfield@apple.com>
Create a Language log channel
https://bugs.webkit.org/show_bug.cgi?id=228764
Reviewed by Simon Fraser.
There have been a variety of bug reports over the past months/years about the procedure
by which we determine navigator.language. It's actually somewhat convoluted, so this
patch adds a (debug) log channel for it so we can follow what it's doing easily.
To enable all the logging, run these commands:
% defaults write com.apple.WebKit.WebContent.Development WTFLogging Language
% defaults write com.apple.WebKit.WebContent.Development WebKit2Logging Language
% defaults write com.apple.WebKit.WebContent WTFLogging Language
% defaults write com.apple.WebKit.WebContent WebKit2Logging Language
% defaults write -g WTFLogging Language
% defaults write -g WebKit2Logging Language
% defaults write /Users/$USER/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist WTFLogging Language
% defaults write /Users/$USER/Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari.plist WebKit2Logging Language
* wtf/Language.cpp:
(WTF::defaultLanguage):
(WTF::overrideUserPreferredLanguages):
(WTF::userPreferredLanguages):
* wtf/Logging.cpp:
* wtf/Logging.h:
* wtf/cf/LanguageCF.cpp:
(WTF::platformUserPreferredLanguages):
* wtf/cocoa/LanguageCocoa.mm:
(WTF::minimizedLanguagesFromLanguages):
2021-08-09 21:14:53 +00:00
2021-08-09 Myles C. Maxfield <mmaxfield@apple.com>
Support WTF logging channels
https://bugs.webkit.org/show_bug.cgi?id=228768
This patch builds on top of https://bugs.webkit.org/show_bug.cgi?id=228809, which added shared infrastructure
for logging. This patch simply triggers that shared infrastructure for WTF. There is no change in behavior -
the existing WTF logging channels currently are all implemented independently in custom ways, so this patch
just migrates them over to use the shared infrastructure.
Reviewed by Fujii Hironori.
* WTF.xcodeproj/project.pbxproj:
* wtf/Assertions.h:
* wtf/CMakeLists.txt:
* wtf/LogInitialization.cpp: Added.
(WTF::logChannels):
* wtf/LogInitialization.h: Added.
* wtf/Logging.cpp: Added.
* wtf/Logging.h: Added.
* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::singleton):
* wtf/MemoryPressureHandler.h:
* wtf/PlatformFTW.cmake:
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:
* wtf/RefCountedLeakCounter.cpp:
* wtf/cocoa/LoggingCocoa.mm: Copied from Source/WebKit/UIProcess/Cocoa/GPUProcessProxyCocoa.mm.
(WTF::logLevelString):
* wtf/cocoa/MachSendRight.cpp:
* wtf/cocoa/MainThreadCocoa.mm:
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
* wtf/unix/LoggingUnix.cpp: Added.
(WTF::logLevelString):
* wtf/win/LoggingWin.cpp: Added.
(WTF::logLevelString):
Deduplicate logging channel algorithms
https://bugs.webkit.org/show_bug.cgi?id=228809
Reviewed by Fujii Hironori.
Source/WebCore:
No new tests because there is no behavior change.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXLogger.cpp:
* inspector/agents/page/PageConsoleAgent.cpp:
* page/Page.cpp:
* platform/LogInitialization.cpp: Copied from Source/WebCore/platform/LogInitialization.h.
(WebCore::logChannels):
(WebCore::getLogChannel):
* platform/LogInitialization.h:
* platform/Logging.cpp:
(WebCore::isLogChannelEnabled): Deleted.
(WebCore::setLogChannelToAccumulate): Deleted.
(WebCore::clearAllLogChannelsToAccumulate): Deleted.
(WebCore::initializeLogChannelsIfNecessary): Deleted.
(WebCore::getLogChannel): Deleted.
* platform/Logging.h:
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setLogChannelToAccumulate):
(WebCoreTestSupport::clearAllLogChannelsToAccumulate):
(WebCoreTestSupport::initializeLogChannelsIfNecessary):
Source/WebKit:
* GPUProcess/GPUConnectionToWebProcess.cpp:
* GPUProcess/GPUProcess.cpp:
(WebKit::GPUProcess::initializeGPUProcess):
* Platform/LogInitialization.cpp: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp.
(WebKit::logChannels):
(WebKit::getLogChannel):
* Platform/LogInitialization.h:
* Platform/Logging.cpp:
(WebKit::initializeLogChannelsIfNecessary): Deleted.
(WebKit::getLogChannel): Deleted.
* Platform/Logging.h:
* Shared/AuxiliaryProcess.cpp:
(WebKit::AuxiliaryProcess::initialize):
* Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):
* Sources.txt:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebProcessPool.cpp:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
Source/WebKitLegacy:
* WebKitLegacy.xcodeproj/project.pbxproj:
Source/WebKitLegacy/mac:
* Misc/WebKitLogInitialization.h: Copied from Source/WebKit/Platform/LogInitialization.h.
* Misc/WebKitLogInitialization.mm: Copied from Source/WebKitLegacy/mac/Misc/WebKitLogging.m.
(WebKit::logChannels):
(ReportDiscardedDelegateException):
* Misc/WebKitLogging.h:
* Misc/WebKitLogging.m:
(ReportDiscardedDelegateException): Deleted.
* WebCoreSupport/WebDragClient.mm:
* WebView/WebDelegateImplementationCaching.mm:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
Source/WTF:
The current infrastructure (before this patch) had the following duplicated for each framework:
- A .cpp file declared the list of logging channels for that framework
- The .cpp file also had algorithms to search, modify, and initialize these logging channels
Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even
duplicated 3 times!)
Because the algorithms directly name their specific list of logging channels, a naive deduplication
would have had to add new parameters to these algorithms to pass in the appropriate framework's
list. That's fine, but this is exactly the sort of thing classes were designed for - classes are
an association of algorithms and data. The algorithms are shared but the data isn't, which really
just means we should have 3 instances of a shared class - one for the 3 sets of data.
So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each
framework has a NeverDestroyed singleton instance of that class. There is a single virtual method
in the class, so the appropriate "default write" variable can be queried for each framework.
The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2
files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h
files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other.
Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the
LogChannels instances are declared in. After this change, the Logging.h files are just for the
declarations of the logging channels themselves, and the LogInitialization.h files are for the
LogChannels instances which contain the searching/modifying/initializing algorithms on the list of
logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and
if you want to search/modify/initialize across the entire list of channels, then #include the
relevant LogInitialization.h file.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp.
(WTF::LogChannels::isLogChannelEnabled):
(WTF::LogChannels::setLogChannelToAccumulate):
(WTF::LogChannels::clearAllLogChannelsToAccumulate):
(WTF::LogChannels::initializeLogChannelsIfNecessary):
(WTF::LogChannels::getLogChannel):
* wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h.
Canonical link: https://commits.webkit.org/240343@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-07 18:50:12 +00:00
2021-08-07 Myles C. Maxfield <mmaxfield@apple.com>
Deduplicate logging channel algorithms
https://bugs.webkit.org/show_bug.cgi?id=228809
Reviewed by Fujii Hironori.
The current infrastructure (before this patch) had the following duplicated for each framework:
- A .cpp file declared the list of logging channels for that framework
- The .cpp file also had algorithms to search, modify, and initialize these logging channels
Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even
duplicated 3 times!)
Because the algorithms directly name their specific list of logging channels, a naive deduplication
would have had to add new parameters to these algorithms to pass in the appropriate framework's
list. That's fine, but this is exactly the sort of thing classes were designed for - classes are
an association of algorithms and data. The algorithms are shared but the data isn't, which really
just means we should have 3 instances of a shared class - one for the 3 sets of data.
So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each
framework has a NeverDestroyed singleton instance of that class. There is a single virtual method
in the class, so the appropriate "default write" variable can be queried for each framework.
The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2
files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h
files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other.
Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the
LogChannels instances are declared in. After this change, the Logging.h files are just for the
declarations of the logging channels themselves, and the LogInitialization.h files are for the
LogChannels instances which contain the searching/modifying/initializing algorithms on the list of
logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and
if you want to search/modify/initialize across the entire list of channels, then #include the
relevant LogInitialization.h file.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp.
(WTF::LogChannels::isLogChannelEnabled):
(WTF::LogChannels::setLogChannelToAccumulate):
(WTF::LogChannels::clearAllLogChannelsToAccumulate):
(WTF::LogChannels::initializeLogChannelsIfNecessary):
(WTF::LogChannels::getLogChannel):
* wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h.
2021-08-07 16:34:40 +00:00
2021-08-07 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r280756.
https://bugs.webkit.org/show_bug.cgi?id=228897
Broke gtk build
Reverted changeset:
"Deduplicate logging channel algorithms"
https://bugs.webkit.org/show_bug.cgi?id=228809
https://commits.webkit.org/r280756
Deduplicate logging channel algorithms
https://bugs.webkit.org/show_bug.cgi?id=228809
Reviewed by Fujii Hironori.
Source/WebCore:
No new tests because there is no behavior change.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXLogger.cpp:
* inspector/agents/page/PageConsoleAgent.cpp:
* page/Page.cpp:
* platform/LogInitialization.cpp: Copied from Source/WebCore/platform/LogInitialization.h.
(WebCore::logChannels):
(WebCore::getLogChannel):
* platform/LogInitialization.h:
* platform/Logging.cpp:
(WebCore::isLogChannelEnabled): Deleted.
(WebCore::setLogChannelToAccumulate): Deleted.
(WebCore::clearAllLogChannelsToAccumulate): Deleted.
(WebCore::initializeLogChannelsIfNecessary): Deleted.
(WebCore::getLogChannel): Deleted.
* platform/Logging.h:
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setLogChannelToAccumulate):
(WebCoreTestSupport::clearAllLogChannelsToAccumulate):
(WebCoreTestSupport::initializeLogChannelsIfNecessary):
Source/WebKit:
* GPUProcess/GPUConnectionToWebProcess.cpp:
* GPUProcess/GPUProcess.cpp:
(WebKit::GPUProcess::initializeGPUProcess):
* Platform/LogInitialization.cpp: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp.
(WebKit::logChannels):
(WebKit::getLogChannel):
* Platform/LogInitialization.h:
* Platform/Logging.cpp:
(WebKit::initializeLogChannelsIfNecessary): Deleted.
(WebKit::getLogChannel): Deleted.
* Platform/Logging.h:
* Shared/AuxiliaryProcess.cpp:
(WebKit::AuxiliaryProcess::initialize):
* Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):
* Sources.txt:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebProcessPool.cpp:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
Source/WebKitLegacy:
* WebKitLegacy.xcodeproj/project.pbxproj:
Source/WebKitLegacy/mac:
* Misc/WebKitLogInitialization.h: Copied from Source/WebKit/Platform/LogInitialization.h.
* Misc/WebKitLogInitialization.mm: Copied from Source/WebKitLegacy/mac/Misc/WebKitLogging.m.
(WebKit::logChannels):
(ReportDiscardedDelegateException):
* Misc/WebKitLogging.h:
* Misc/WebKitLogging.m:
(ReportDiscardedDelegateException): Deleted.
* WebCoreSupport/WebDragClient.mm:
* WebView/WebDelegateImplementationCaching.mm:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
Source/WTF:
The current infrastructure (before this patch) had the following duplicated for each framework:
- A .cpp file declared the list of logging channels for that framework
- The .cpp file also had algorithms to search, modify, and initialize these logging channels
Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even
duplicated 3 times!)
Because the algorithms directly name their specific list of logging channels, a naive deduplication
would have had to add new parameters to these algorithms to pass in the appropriate framework's
list. That's fine, but this is exactly the sort of thing classes were designed for - classes are
an association of algorithms and data. The algorithms are shared but the data isn't, which really
just means we should have 3 instances of a shared class - one for the 3 sets of data.
So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each
framework has a NeverDestroyed singleton instance of that class. There is a single virtual method
in the class, so the appropriate "default write" variable can be queried for each framework.
The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2
files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h
files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other.
Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the
LogChannels instances are declared in. After this change, the Logging.h files are just for the
declarations of the logging channels themselves, and the LogInitialization.h files are for the
LogChannels instances which contain the searching/modifying/initializing algorithms on the list of
logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and
if you want to search/modify/initialize across the entire list of channels, then #include the
relevant LogInitialization.h file.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp.
(WTF::LogChannels::isLogChannelEnabled):
(WTF::LogChannels::setLogChannelToAccumulate):
(WTF::LogChannels::clearAllLogChannelsToAccumulate):
(WTF::LogChannels::initializeLogChannelsIfNecessary):
(WTF::LogChannels::getLogChannel):
* wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h.
Canonical link: https://commits.webkit.org/240341@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-07 07:54:50 +00:00
2021-08-07 Myles C. Maxfield <mmaxfield@apple.com>
Deduplicate logging channel algorithms
https://bugs.webkit.org/show_bug.cgi?id=228809
Reviewed by Fujii Hironori.
The current infrastructure (before this patch) had the following duplicated for each framework:
- A .cpp file declared the list of logging channels for that framework
- The .cpp file also had algorithms to search, modify, and initialize these logging channels
Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even
duplicated 3 times!)
Because the algorithms directly name their specific list of logging channels, a naive deduplication
would have had to add new parameters to these algorithms to pass in the appropriate framework's
list. That's fine, but this is exactly the sort of thing classes were designed for - classes are
an association of algorithms and data. The algorithms are shared but the data isn't, which really
just means we should have 3 instances of a shared class - one for the 3 sets of data.
So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each
framework has a NeverDestroyed singleton instance of that class. There is a single virtual method
in the class, so the appropriate "default write" variable can be queried for each framework.
The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2
files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h
files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other.
Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the
LogChannels instances are declared in. After this change, the Logging.h files are just for the
declarations of the logging channels themselves, and the LogInitialization.h files are for the
LogChannels instances which contain the searching/modifying/initializing algorithms on the list of
logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and
if you want to search/modify/initialize across the entire list of channels, then #include the
relevant LogInitialization.h file.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp.
(WTF::LogChannels::isLogChannelEnabled):
(WTF::LogChannels::setLogChannelToAccumulate):
(WTF::LogChannels::clearAllLogChannelsToAccumulate):
(WTF::LogChannels::initializeLogChannelsIfNecessary):
(WTF::LogChannels::getLogChannel):
* wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h.
2021-08-05 15:27:03 +00:00
2021-08-05 Michael Catanzaro <mcatanzaro@gnome.org>
GCC 11 builds should use -Wno-array-bounds, -Wno-nonnull
https://bugs.webkit.org/show_bug.cgi?id=228601
Reviewed by Carlos Garcia Campos.
* wtf/Bitmap.h:
(WTF::WordType>::clear):
* wtf/Compiler.h:
* wtf/Packed.h:
(WTF::PackedAlignedPtr::get const):
* wtf/RefPtr.h:
(WTF::DefaultRefDerefTraits::derefIfNotNull):
2021-08-05 12:57:04 +00:00
2021-08-05 Zan Dobersek <zdobersek@igalia.com>
Avoid reinterpret_cast alignment increase warnings with GCC on CPU(RISCV64)
https://bugs.webkit.org/show_bug.cgi?id=228818
Reviewed by Adrian Perez de Castro.
* wtf/StdLibExtras.h: As with 32-bit ARM and MIPS targets, RISC-V 64-bit
builds with GCC also spawn warnings when the use of reinterpret_cast
causes an increase in alignment. Workaround via reinterpret_cast_ptr is
thus required for CPU(RISCV64).
2021-08-04 19:37:35 +00:00
2021-08-03 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Tweak the formatting for passing NSArrays to TextStreams
https://bugs.webkit.org/show_bug.cgi?id=228766
Reviewed by Simon Fraser.
Instead of using -[NSArray description], which puts its output on multiple lines,
instead use the same formatting as WTF::Vector, which puts its output on a single line.
We can also use this opportunity to tweak the implementation of operator<<(id) to
allow it to be called with Core Foundation types in raw C++ code.
* wtf/text/TextStream.h:
* wtf/text/cocoa/TextStreamCocoa.mm:
(WTF::TextStream::operator<<):
2021-08-04 01:37:22 +00:00
2021-08-03 Risul Islam <risul_islam@apple.com>
Add functions for parsing URL query string
https://bugs.webkit.org/show_bug.cgi?id=228122
Reviewed by Darin Adler.
Added parsing of URL query strings.
* wtf/KeyValuePair.h:
(WTF::operator== const):
* wtf/URL.cpp:
(WTF::URL::differingQueryParameters):
(WTF::lengthOfURLIgnoringQueryAndFragments):
(WTF::URL::isEqualIgnoringQueryAndFragments):
(WTF::URL::removeQueryParameters):
* wtf/URL.h:
2021-08-03 17:05:15 +00:00
2021-08-03 Youenn Fablet <youenn@apple.com>
RealtimeMediaSource::audioSamplesAvailable is calling malloc as part of locking in audio thread
https://bugs.webkit.org/show_bug.cgi?id=228688
Reviewed by Eric Carlson.
Allow allocations in lockSlow since allocations might happen in rare case and not for each lockSlow call.
* wtf/Lock.cpp:
(WTF::Lock::lockSlow):
(WTF::Lock::unlockSlow):
(WTF::Lock::unlockFairlySlow):
2021-08-02 21:46:29 +00:00
2021-08-02 Ryosuke Niwa <rniwa@webkit.org>
Add CheckedRef
https://bugs.webkit.org/show_bug.cgi?id=227164
Reviewed by Geoffrey Garen.
Like r278344, this patch introduces a new type of smart pointer, CheckedRef,
which lets each object keep track of pointers pointing to the object.
As with CheckedPtr, the purpose of the internal counter for CheckedRef is
to release assert that there is no outstanding pointer at the time of destruction
instead of keeping the object alive when there is one.
This patch also removes makeCheckedPtr in favor of using CheckedPtr with
template argument deduction in C++17.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CheckedPtr.h:
(WTF::CheckedPtr::CheckedPtr): Added variants which take CheckedRef as arguments.
(WTF::makeCheckedPtr): Deleted.
(WTF::CanMakeCheckedPtr): Moved to CheckedRef.h
* wtf/CheckedRef.h: Added.
(WTF::CheckedRef::~CheckedRef): Added.
(WTF::CheckedRef::CheckedRef): Added.
(WTF::CheckedRef::isHashTableDeletedValue const): Added.
(WTF::CheckedRef::isHashTableEmptyValue const): Added.
(WTF::CheckedRef::hashTableEmptyValue): Added.
(WTF::CheckedRef::ptrAllowingHashTableEmptyValue const): Added.
(WTF::CheckedRef::ptrAllowingHashTableEmptyValue): Added.
(WTF::CheckedRef::ptr const): Added.
(WTF::CheckedRef::ptr): Added.
(WTF::CheckedRef::get const): Added.
(WTF::CheckedRef::get): Added.
(WTF::CheckedRef::operator-> const): Added.
(WTF::CheckedRef::operator->): Added.
(WTF::CheckedRef::operator const T& const): Added.
(WTF::CheckedRef::operator T&): Added.
(WTF::CheckedRef::operator! const): Added.
(WTF::CheckedRef::operator=): Added.
(WTF::CheckedRef::releasePtr): Added. Returns m_ptr without calling decrementPtrCount.
This is equivalent of leakPtr in Ref but we don't call this that since CheckedRef or
CheckedPtr is generally not used to manage the object lifetime.
(WTF::CheckedRef::poison): Added.
(WTF::CheckedRef::unpoison): Added.
(WTF::is): Added.
(WTF::CheckedRefHashTraits): Added.
(WTF::CheckedRefHashTraits::emptyValue): Added.
(WTF::CheckedRefHashTraits::constructEmptyValue): Added.
(WTF::CheckedRefHashTraits::isEmptyValue): Added.
(WTF::CheckedRefHashTraits::peek): Added.
(WTF::CheckedRefHashTraits::take): Added.
(WTF::CanMakeCheckedPtr): Moved from CheckedPtr.h
* wtf/Forward.h:
2021-08-02 21:39:02 +00:00
2021-08-02 Devin Rousso <drousso@apple.com>
[Live Text] SPI for machine readable codes is only available on iOS
https://bugs.webkit.org/show_bug.cgi?id=228711
Reviewed by Tim Horton.
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
2021-08-02 18:39:53 +00:00
2021-08-02 Youenn Fablet <youenn@apple.com>
Enable WebRTCPlatformUDPSocketsEnabled experimental feature by default
https://bugs.webkit.org/show_bug.cgi?id=228689
<rdar://problem/81383711>
Reviewed by Eric Carlson.
Enable WebRTCPlatformUDPSocketsEnabled experimental feature by default, WebRTC proxying being off by default for now.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-08-02 17:46:27 +00:00
2021-08-02 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Yarr should use Bitmap instead of ByteVector for BoyerMoore search
https://bugs.webkit.org/show_bug.cgi?id=228676
Reviewed by Saam Barati.
* wtf/Bitmap.h:
2021-08-01 16:02:21 +00:00
2021-08-01 Youenn Fablet <youenn@apple.com>
Introduce an experimental feature to toggle WebRTC socket proxying
https://bugs.webkit.org/show_bug.cgi?id=228681
Reviewed by Eric Carlson.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-07-31 20:47:46 +00:00
2021-07-31 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Move JIT_UNICODE_EXPRESSIONS to ENABLE(YARR_JIT_UNICODE_EXPRESSIONS) in PlatformEnable.h
https://bugs.webkit.org/show_bug.cgi?id=228669
Reviewed by Alexey Shvayka.
* wtf/PlatformEnable.h:
2021-07-31 06:07:09 +00:00
2021-07-30 Rob Buis <rbuis@igalia.com>
[css-overflow] Implement clip value for overflow
https://bugs.webkit.org/show_bug.cgi?id=198230
Reviewed by Simon Fraser.
Add preference for overflow: clip support.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-07-31 00:07:37 +00:00
2021-07-30 Chris Dumez <cdumez@apple.com>
Add initial support for 'Cross-Origin-Opener-Policy' HTTP header
https://bugs.webkit.org/show_bug.cgi?id=192193
<rdar://problem/42013525>
Reviewed by Geoff Garen.
Add experimental feature flag for 'Cross-Origin-Opener-Policy' HTTP header
support.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-07-30 03:53:49 +00:00
2021-07-29 Myles C. Maxfield <mmaxfield@apple.com>
Stop building WebGPU and the WHLSL compiler to decrease binary size
https://bugs.webkit.org/show_bug.cgi?id=228179
Reviewed by Dean Jackson, Robin Morisset, and Devin Rousso.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
[Payment Request] `additionalShippingMethods` are not used if a `paymentMethodType` is provided
https://bugs.webkit.org/show_bug.cgi?id=228599
<rdar://problem/81190366>
Reviewed by Andy Estes.
Source/WebCore:
r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods`
can be specified without having to limit it to a specific payment method type. While this
works in theory, WebKit doesn't know about the user's selected payment method type until the
user actually selects a payment method, meaning that until then the `additionalShippingMethods`
are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not
support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list
of shipping methods when the user changed their selected payment method, meaning that WebKit
would have to wait/rely on the user to change their shipping address _after_ selecting a
payment method in order for `additionalShippingMethods` to take effect.
This also fixes an issue with WebKit's implementation of the W3C Payment Request API by
allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in
`PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly.
Test: http/tests/paymentrequest/ApplePayModifier-paymentMethodType.https.html
* Modules/applepay/ApplePayModifier.idl:
* Modules/applepay/ApplePayModifier.h:
* Modules/applepay/ApplePayPaymentMethodUpdate.idl:
* Modules/applepay/ApplePayPaymentMethodUpdate.h:
(WebCore::ApplePayPaymentMethodUpdate::encode const):
(WebCore::ApplePayPaymentMethodUpdate::decode):
* Modules/applepay/ApplePayShippingMethodUpdate.idl:
* Modules/applepay/ApplePayShippingMethodUpdate.h:
(WebCore::ApplePayShippingMethodUpdate::encode const):
(WebCore::ApplePayShippingMethodUpdate::decode):
Add (or wrap existing) `additionalShippingMethods`/`newShippingMethods` properties.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::computeShippingMethods):
(WebCore::ApplePayPaymentHandler::detailsUpdated):
(WebCore::ApplePayPaymentHandler::shippingOptionUpdated):
(WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
Also call `computeShippingMethods()` and add the result to the update.
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::completeShippingMethodSelection):
(WebCore::MockPaymentCoordinator::completeShippingContactSelection):
(WebCore::MockPaymentCoordinator::completePaymentMethodSelection):
(WebCore::MockPaymentCoordinator::completeCouponCodeChange):
Support for testing.
Source/WebCore/PAL:
r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods`
can be specified without having to limit it to a specific payment method type. While this
works in theory, WebKit doesn't know about the user's selected payment method type until the
user actually selects a payment method, meaning that until then the `additionalShippingMethods`
are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not
support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list
of shipping methods when the user changed their selected payment method, meaning that WebKit
would have to wait/rely on the user to change their shipping address _after_ selecting a
payment method in order for `additionalShippingMethods` to take effect.
This also fixes an issue with WebKit's implementation of the W3C Payment Request API by
allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in
`PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly.
* pal/spi/cocoa/PassKitSPI.h:
- add the new `shippingMethods` property on `PKPaymentRequestUpdate`
- add the existing `errors` property on `PKPaymentRequestPaymentMethodUpdate`
Source/WebKit:
r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods`
can be specified without having to limit it to a specific payment method type. While this
works in theory, WebKit doesn't know about the user's selected payment method type until the
user actually selects a payment method, meaning that until then the `additionalShippingMethods`
are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not
support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list
of shipping methods when the user changed their selected payment method, meaning that WebKit
would have to wait/rely on the user to change their shipping address _after_ selecting a
payment method in order for `additionalShippingMethods` to take effect.
This also fixes an issue with WebKit's implementation of the W3C Payment Request API by
allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in
`PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly.
* Platform/cocoa/PaymentAuthorizationPresenter.mm:
(WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection):
(WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection):
Also convert and set the `shippingMethods` on the update.
Source/WTF:
r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods`
can be specified without having to limit it to a specific payment method type. While this
works in theory, WebKit doesn't know about the user's selected payment method type until the
user actually selects a payment method, meaning that until then the `additionalShippingMethods`
are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not
support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list
of shipping methods when the user changed their selected payment method, meaning that WebKit
would have to wait/rely on the user to change their shipping address _after_ selecting a
payment method in order for `additionalShippingMethods` to take effect.
This also fixes an issue with WebKit's implementation of the W3C Payment Request API by
allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in
`PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly.
* wtf/PlatformHave.h:
* wtf/PlatformEnableCocoa.h:
Add new compile flags for PassKit supporting modifying shipping methods with any update.
LayoutTests:
* http/tests/paymentrequest/ApplePayModifier-paymentMethodType.https.html: Added.
* http/tests/paymentrequest/ApplePayModifier-paymentMethodType.https-expected.txt: Added.
* platform/ios-14-wk2/TestExpectations:
* platform/mac-bigsur-wk2/TestExpectations: Added.
Skip on older macOS/iOS since they don't support modifying shipping methods with any update.
Canonical link: https://commits.webkit.org/240094@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-30 00:28:45 +00:00
2021-07-29 Devin Rousso <drousso@apple.com>
[Payment Request] `additionalShippingMethods` are not used if a `paymentMethodType` is provided
https://bugs.webkit.org/show_bug.cgi?id=228599
<rdar://problem/81190366>
Reviewed by Andy Estes.
r275169 made it so that `paymentMethodType` is no longer `required` so that `additionalShippingMethods`
can be specified without having to limit it to a specific payment method type. While this
works in theory, WebKit doesn't know about the user's selected payment method type until the
user actually selects a payment method, meaning that until then the `additionalShippingMethods`
are not used. Unfortunately (until now) `PKPaymentRequestPaymentMethodUpdate` did not
support providing a `NSArray<PKShippingMethod *> *`, so there was no way to update the list
of shipping methods when the user changed their selected payment method, meaning that WebKit
would have to wait/rely on the user to change their shipping address _after_ selecting a
payment method in order for `additionalShippingMethods` to take effect.
This also fixes an issue with WebKit's implementation of the W3C Payment Request API by
allowing any generic (i.e. things not specific to Apple Pay) `shippingOptions` provided in
`PaymentDetailsUpdate` to actually be used and update the Apple Pay sheet accordingly.
* wtf/PlatformHave.h:
* wtf/PlatformEnableCocoa.h:
Add new compile flags for PassKit supporting modifying shipping methods with any update.
[JSC] Yarr should perform BoyerMoore search
https://bugs.webkit.org/show_bug.cgi?id=228301
Reviewed by Saam Barati.
JSTests:
* microbenchmarks/jquery-todomvc-regexp.js:
* stress/regexp--bm-search-long-character.js: Added.
(shouldBe):
* stress/regexp--bm-search-long-map.js: Added.
(shouldBe):
* stress/regexp-bitvector-reuse.js: Added.
(shouldBe):
* stress/regexp-non-ascii-bm-search-character.js: Added.
(shouldBe):
* stress/regexp-non-ascii-bm-search-map.js: Added.
(shouldBe):
Source/JavaScriptCore:
This patch emits skipping fast-path at the beginning of body alternatives with a large stride. So we can quickly discard unrelated characters
and attempt to find possibly related sequence in the long sequence. The method is derived from V8's implementation (with some extensions).
If we have a searching pattern /abcdef/, then we can check the 6th character against a set of {a, b, c, d, e, f}.
If it does not match, we can shift 6 characters. We use this strategy since this way can be extended easily to support
disjunction, character-class, and ignore-cases. For example, in the case of /(?:abc|def)/, we can check 3rd character
against {a, b, c, d, e, f} and shift 3 characters if it does not match.
Then, the best way to perform the above shifting is that finding the longest character sequence which does not have
many candidates. In the case of /[a-z]aaaaaaa[a-z]/, we can extract "aaaaaaa" sequence and check 8th character against {a}.
If it does not match, then we can shift 7 characters (length of "aaaaaaa"). This shifting is better than using "[a-z]aaaaaaa[a-z]"
sequence and {a-z} set since {a-z} set will almost always match.
We first collect possible characters for each character position. Then, apply heuristics to extract good character sequence from
that and construct fast searching with long stride.
Microbenchmark which performs RegExp ops in Speedometer2/jQuery-TodoMVC shows 25% improvement.
ToT Patched
jquery-todomvc-regexp 723.9739+-1.3997 ^ 579.1698+-1.2505 ^ definitely 1.2500x faster
This improves Speedometer2/jQuery-TodoMVC by 3%.
----------------------------------------------------------------------------------------------------------------------------------
| subtest | ms | ms | b / a | pValue (significance using False Discovery Rate) |
----------------------------------------------------------------------------------------------------------------------------------
| Elm-TodoMVC |123.365625 |123.456250 |1.000735 | 0.804077 |
| VueJS-TodoMVC |26.912500 |26.925000 |1.000464 | 0.969603 |
| EmberJS-TodoMVC |127.540625 |127.562500 |1.000172 | 0.960474 |
| BackboneJS-TodoMVC |50.606250 |50.518750 |0.998271 | 0.670313 |
| Preact-TodoMVC |21.018750 |20.850000 |0.991971 | 0.563818 |
| AngularJS-TodoMVC |136.943750 |137.271875 |1.002396 | 0.531513 |
| Vanilla-ES2015-TodoMVC |68.521875 |68.593750 |1.001049 | 0.701376 |
| Inferno-TodoMVC |65.559375 |65.803125 |1.003718 | 0.414418 |
| Flight-TodoMVC |77.284375 |76.715625 |0.992641 | 0.219870 |
| Angular2-TypeScript-TodoMVC |40.725000 |40.318750 |0.990025 | 0.281212 |
| VanillaJS-TodoMVC |55.209375 |54.715625 |0.991057 | 0.056921 |
| jQuery-TodoMVC |266.396875 |258.471875 |0.970251 | 0.000000 (significant) |
| EmberJS-Debug-TodoMVC |341.550000 |341.856250 |1.000897 | 0.618140 |
| React-TodoMVC |88.731250 |88.871875 |1.001585 | 0.512407 |
| React-Redux-TodoMVC |150.340625 |150.065625 |0.998171 | 0.412940 |
| Vanilla-ES2015-Babel-Webpack-TodoMVC |65.390625 |65.362500 |0.999570 | 0.834760 |
----------------------------------------------------------------------------------------------------------------------------------
a mean = 245.96997
b mean = 246.86366
pValue = 0.0061448402
(Bigger means are better.)
1.004 times better
Results ARE significant
* runtime/OptionsList.h:
* yarr/YarrJIT.cpp:
(JSC::Yarr::BoyerMooreInfo::BoyerMooreInfo):
(JSC::Yarr::BoyerMooreInfo::length const):
(JSC::Yarr::BoyerMooreInfo::set):
(JSC::Yarr::BoyerMooreInfo::index const):
(JSC::Yarr::BoyerMooreInfo::setIndex):
(JSC::Yarr::BoyerMooreInfo::create):
(JSC::Yarr::BoyerMooreInfo::findBestCharacterSequence const):
(JSC::Yarr::BoyerMooreInfo::findWorthwhileCharacterSequenceForLookahead const):
(JSC::Yarr::BoyerMooreInfo::createCandidateBitmap const):
* yarr/YarrJIT.h:
(JSC::Yarr::BoyerMooreBitmap::count const):
(JSC::Yarr::BoyerMooreBitmap::map const):
(JSC::Yarr::BoyerMooreBitmap::isMaskEffective const):
(JSC::Yarr::BoyerMooreBitmap::add):
(JSC::Yarr::BoyerMooreByteVector::BoyerMooreByteVector):
(JSC::Yarr::YarrCodeBlock::set8BitCode):
(JSC::Yarr::YarrCodeBlock::set16BitCode):
(JSC::Yarr::YarrCodeBlock::set8BitCodeMatchOnly):
(JSC::Yarr::YarrCodeBlock::set16BitCodeMatchOnly):
(JSC::Yarr::YarrCodeBlock::clear):
(JSC::Yarr::YarrCodeBlock::findSameVector const):
Source/WTF:
* wtf/BitVector.cpp:
(WTF::BitVector::dump const):
* wtf/Bitmap.h:
(WTF::WordType>::dump const):
* wtf/UniqueRef.h:
(WTF::makeUniqueRefFromNonNullUniquePtr):
(WTF::UniqueRef::UniqueRef):
Canonical link: https://commits.webkit.org/240087@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-29 22:26:13 +00:00
2021-07-28 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Yarr should perform BoyerMoore search
https://bugs.webkit.org/show_bug.cgi?id=228301
Reviewed by Saam Barati.
* wtf/BitVector.cpp:
(WTF::BitVector::dump const):
* wtf/Bitmap.h:
(WTF::WordType>::dump const):
* wtf/UniqueRef.h:
(WTF::makeUniqueRefFromNonNullUniquePtr):
(WTF::UniqueRef::UniqueRef):
2021-07-29 22:12:16 +00:00
2021-07-29 Kate Cheney <katherine_cheney@apple.com>
REGRESSION (r278877) [Cocoa] WebAuthn stopped working for non-Safari browsers
https://bugs.webkit.org/show_bug.cgi?id=228116
<rdar://problem/80693607>
Patch by Brent Fulgham.
Reviewed by Per Arne Vollan.
Add new SPI header for code signing features.
* WTF.xcodeproj/project.pbxproj:
* wtf/spi/cocoa/SecuritySPI.h:
* wtf/spi/darwin/CodeSignSPI.h: Added.
2021-07-29 20:43:17 +00:00
2021-07-29 Eric Carlson <eric.carlson@apple.com>
[iOS] Don't set capture attribution dynamically in the simulator
https://bugs.webkit.org/show_bug.cgi?id=228596
rdar://81176531
Reviewed by Jer Noble.
* wtf/PlatformHave.h: Don't define HAVE_SYSTEM_STATUS for the simulator.
2021-07-29 19:54:30 +00:00
2021-07-29 Kate Cheney <katherine_cheney@apple.com>
GetIdentifierStringForPreferredVoiceInListWithLocale() is deprecated in Monterey
<https://webkit.org/b/228066>
<rdar://problem/80577312>
Patch by David Kilzer.
Reviewed by David Kilzer.
* wtf/PlatformHave.h:
- Add HAVE(SPEECHSYNTHESIS_MONTEREY_SPI).
[WebAudio] Add webm/opus container support
https://bugs.webkit.org/show_bug.cgi?id=227110
<rdar://problem/79437067>
Reviewed by Jer Noble.
Source/WebCore:
Add support for webm in Web Audio.
As decoding needs to be performed in the web content process we
need to ensure that the decoders are available there. For security
reasons, com.apple.audio.AudioComponentRegistrar mach calls are blocked
which prevents registering a new audio component.
We instead register it in the UI process so that AudioComponentFetchServerRegistrations
SPI can forward the registration in the web process.
Unfortunately, for unknown reasons, this fails for Vorbis audio codec (bug 228139).
To demux the webm content, we use the existing SourceBufferParserWebM to extract all
audio packets. We then iterate over all CM Samples and decode them into PCM, performing
resampling as needed on the fly.
There are things left to fix.
- Opus and Vorbis encoder delay isn't handled (bug 228140) which leaves audible
silence at the beginning of the destination buffer.
- We can only decode mono and stereo content. Opus and Vorbis let you define a
custom channel ordering, this is particularly used with ambisonic audio (with opus 255 mode).
CoreMedia doesn't easily deal with such re-ordering as it appears to be essentially
designed for audible content. With more than 2 channels, decoding will either fail
or produce channels in the wrong order.
Test: webaudio/decode-audio-data-webm-opus.html
* Headers.cmake: Export header so that we can register the decoder in the UI process.
* WebCore.xcodeproj/project.pbxproj: same as above.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayType const): Make canPlayType(webm/audio; codecs=opus)
work if features is set.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebMWebAudioEnabled):
(WebCore::RuntimeEnabledFeatures::webMWebAudioEnabled const):
* platform/MediaSample.h: Fly-by fix: remove unnecessary WEBCORE_EXPORT
* platform/audio/AudioBus.cpp:
(WebCore::AudioBus::setLength):
* platform/audio/AudioBus.h: Add setLength method. Will change the reported length
without touching the underlying storage.
* platform/audio/AudioChannel.h: Add setLength method. Will change the reported
length without touching the underlying storage.
* platform/audio/cocoa/AudioFileReaderCocoa.cpp:
(WebCore::tryCreateAudioBufferList): Fix checkedInt use to catch potential overflow
(WebCore::AudioBufferListHolder::AudioBufferListHolder): Add convenience class that
free wrapped AudioBufferList object on exit.
(WebCore::AudioBufferListHolder::~AudioBufferListHolder):
(WebCore::AudioBufferListHolder::operator bool const):
(WebCore::AudioBufferListHolder::operator-> const):
(WebCore::AudioBufferListHolder::operator* const):
(WebCore::AudioBufferListHolder::isValid const):
(WebCore::AudioFileReader::AudioFileReader):
(WebCore::AudioFileReader::isMaybeWebM const): Method to check if the buffer
contains WebM data.
(WebCore::passthroughInputDataCallback): Required for AudioConverterFillComplexBuffer.
Will feed the decoder the data to decode, splitting the multiple packets found
in the CMSampleBuffer.
(WebCore::AudioFileReader::numberOfFrames const): Return the total number of
decoded frames in the packets.
(WebCore::AudioFileReader::fileDataFormat const): Create AudioStreamBasicDescription
related to the demuxed audio track. nullopt if unsupported content.
(WebCore::AudioFileReader::clientDataFormat const):
(WebCore::AudioFileReader::createBus):
(WebCore::AudioFileReader::logChannel const):
* platform/audio/cocoa/AudioFileReaderCocoa.h:
* platform/audio/cocoa/AudioSampleDataSource.h: Remove unused typedef.
* platform/audio/cocoa/AudioSampleDataSource.mm:
(WebCore::AudioSampleDataSource::~AudioSampleDataSource): Fly-by fix, make it use
PAL softlinks
(WebCore::AudioSampleDataSource::setupConverter): Fly-by fix, make it use PAL
softlinks
* platform/gamepad/mac/HIDGamepadProvider.mm: Fly-by fix, add missing header.
* platform/graphics/TrackPrivateBase.cpp: Fly-by fix, add missing header.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
Fly-by fix required by webkit-prepare : don't tag the whole class as WEBCORE_EXPORT.
Move constructor and destructor function definitions out-of-line to prevent
linkage errors.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Move code
* platform/graphics/cocoa/WebCoreDecompressionSession.mm: Fly-by fix, add missing header.
* platform/graphics/cocoa/WebMAudioUtilitiesCocoa.h: Export some symbols, add new
method definitions.
* platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm:
(WebCore::registerDecoderFactory): Instead of attempting to register the decoder
by dl-opening the required library, first attempting to see if the decoder is
already available. Calling AudioComponentRegister in the web content process
when the GPU process is enabled will fail due to sandbox settings. Which would
incorrectly report the codec to not be available when it was.
(WebCore::createAudioFormatDescriptionForFormat):
(WebCore::isOpusDecoderAvailable): Fly-by fix, should the method be called
on non-mac platform it would have return the unitialized value of the available
static variable.
(WebCore::registerOpusDecoderIfNeeded): Added
(WebCore::isVorbisDecoderAvailable): Same as isOpusDecoderAvailable
(WebCore::registerVorbisDecoderIfNeeded): Added
Source/WebCore/PAL:
Add various AVFoundation (AVAudioConverter) related methods and
CoreMedia to access required CMSampleBuffer related methods.
* pal/cf/CoreMediaSoftLink.cpp:
* pal/cf/CoreMediaSoftLink.h:
* pal/cocoa/AVFoundationSoftLink.h:
* pal/cocoa/AVFoundationSoftLink.mm:
Source/WebKit:
Add default value for webm_webaudio feature flag for the different platforms.
Disabled by default on all platforms.
Fly-by fix: don't make webm parser dependent on VP9 support.
* FeatureFlags/WebKit-appletvos.plist:
* FeatureFlags/WebKit-ios.plist:
* FeatureFlags/WebKit-macos.plist:
* FeatureFlags/WebKit-watchos.plist:
* GPUProcess/GPUProcess.h:
* GPUProcess/GPUProcess.messages.in:
* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultWebMWebAudioEnabled):
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::sendAudioComponentRegistrations):
Source/WTF:
Add WebMWebAudioEnabled preference to make canPlayType return probably for mimetype:
"audio/webm; codecs=opus"
Disabled by default.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
LayoutTests:
* platform/mac/TestExpectations: Only enable test on macOS Monterey
* webaudio/decode-audio-data-basic.html: fix whitespace
* webaudio/decode-audio-data-webm-opus-expected.txt: Added.
* webaudio/decode-audio-data-webm-opus.html: Added.
* webaudio/resources/media/opus.webm: Added.
* webaudio/resources/media/vorbis.webm: Added.
Canonical link: https://commits.webkit.org/240056@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280416 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-29 04:18:16 +00:00
2021-07-28 Jean-Yves Avenard <jya@apple.com>
[WebAudio] Add webm/opus container support
https://bugs.webkit.org/show_bug.cgi?id=227110
<rdar://problem/79437067>
Reviewed by Jer Noble.
Add WebMWebAudioEnabled preference to make canPlayType return probably for mimetype:
"audio/webm; codecs=opus"
Disabled by default.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-07-29 02:33:05 +00:00
2021-07-28 Ryosuke Niwa <rniwa@webkit.org>
makeWeakPtr should support Ref and RefPtr as the argument
https://bugs.webkit.org/show_bug.cgi?id=228574
Reviewed by Wenson Hsieh.
This patch adds variants of makeWeakPtr<T> which take Ref<T> and RefPtr<T>.
Tests: TestWebKitAPI.WTF_WeakPtr.MakeWeakPtrTakesRef
TestWebKitAPI.WTF_WeakPtr.MakeWeakPtrTakesRefPtr
* wtf/WeakPtr.h:
(WTF::makeWeakPtr):
2021-07-28 18:57:11 +00:00
2021-07-28 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] macOS Monterey and parallel OSes no longer need r280103
https://bugs.webkit.org/show_bug.cgi?id=228539
Reviewed by Alan Bujtas.
Core Text's behavior changed on these OSes.
* wtf/PlatformUse.h:
2021-07-27 01:43:33 +00:00
2021-07-26 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, speculative revert of r280193
https://bugs.webkit.org/show_bug.cgi?id=228142
* wtf/Vector.h:
(WTF::Malloc>::shrinkCapacity):
(WTF::Malloc>::shrinkToBestFit): Deleted.
* wtf/text/AtomStringImpl.cpp:
(WTF::UCharBufferTranslator::equal):
(WTF::LCharBufferTranslator::equal):
(WTF::BufferFromStaticDataTranslator::equal):
* wtf/text/StringView.h:
(WTF::StringView::stripLeadingMatchedCharacters): Deleted.
2021-07-27 00:06:18 +00:00
2021-07-26 Jer Noble <jer.noble@apple.com>
[Cocoa] WebKit is making GroupActivities API calls for all WebKit clients
https://bugs.webkit.org/show_bug.cgi?id=228299
<rdar://80802982>
Reviewed by Eric Carlson.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-07-26 22:07:20 +00:00
2021-07-26 Per Arne <pvollan@apple.com>
The layout test fast/images/heic-as-background-image.html is a constant failure
https://bugs.webkit.org/show_bug.cgi?id=228195
<rdar://80334724>
Reviewed by Said Abou-Hallawa.
Add HAVE macro for the system function CMPhotoIsTileDecoderAvailable.
* wtf/PlatformHave.h:
2021-07-26 17:51:09 +00:00
2021-07-26 Jer Noble <jer.noble@apple.com>
[iOS] All home screen web apps resume when any home screen web app is foregrounded
https://bugs.webkit.org/show_bug.cgi?id=228246
<rdar://72949281>
Reviewed by Eric Carlson.
* Scripts/Preferences/WebPreferences.yaml:
2021-07-23 22:05:03 +00:00
2021-07-23 Chris Dumez <cdumez@apple.com>
SharedBuffer::takeData() is a bit dangerous
https://bugs.webkit.org/show_bug.cgi?id=228161
Reviewed by Darin Adler.
Add Vector::uncheckedAppend() overload that takes in a Span.
* wtf/Vector.h:
(WTF::Vector::uncheckedAppend):
(WTF::Malloc>::uncheckedAppend):
2021-07-23 21:01:12 +00:00
2021-07-23 Robert Jenner <Jenner@apple.com>
Unreviewed, reverting r280205.
Broke multiple WebAuthn tests.
Reverted changeset:
"REGRESSION (r278877) [Cocoa] WebAuthn stopped working for
non-Safari browsers"
https://bugs.webkit.org/show_bug.cgi?id=228116
https://commits.webkit.org/r280205
2021-07-23 10:51:17 +00:00
2021-07-23 Philippe Normand <pnormand@igalia.com>
[GLib] Remove libportal dependency
https://bugs.webkit.org/show_bug.cgi?id=228056
Reviewed by Carlos Garcia Campos.
* Scripts/Preferences/WebPreferencesExperimental.yaml: Enable screen capture on GStreamer
ports. The PIPEWIRE ifdef is redundant.
2021-07-22 22:58:08 +00:00
2021-07-22 Brent Fulgham <bfulgham@apple.com>
REGRESSION (r278877) [Cocoa] WebAuthn stopped working for non-Safari browsers
https://bugs.webkit.org/show_bug.cgi?id=228116
<rdar://problem/80693607>
Reviewed by Per Arne Vollan.
Add new SPI header for code signing features.
* WTF.xcodeproj/project.pbxproj:
* wtf/spi/cocoa/SecuritySPI.h: Move some SecTask calls out of PLATFORM(MAC).
* wtf/spi/darwin/CodeSignSPI.h: Added.
Fix uses of Dependency::fence with respect to the compiler outsmarting us
https://bugs.webkit.org/show_bug.cgi?id=227757
<rdar://problem/80280931>
Reviewed by Robin Morisset.
Source/JavaScriptCore:
We were running into issues on arm64 with respect to the memory model
ordering of loads, and how the compiler optimized code around Dependency::fence.
The issue manifested as calls to isMarked incorrectly returning true.
To see the issue, let's consider a program like this:
a = load(p1)
b = load(p2)
if (a != b) return;
d = Dependency::fence(b)
At the point of defining the dependency, the compiler has proven
a == b. So, instead of building the dependency on the register used
for b, we end up using the register for a. So the actual compiled
code ends up with a dependency on load(p1), not load(p2).
To fix this, we end up adding a new API, Dependency::loadEndFence(pointer,
result), which is defined as:
template<typename T>
static Dependency loadAndFence(T* pointer, T& output)
{
T value = *opaque(pointer);
Dependency dependency = Dependency::fence(value);
output = opaque(value);
return dependency;
}
The reason for this is that it split "b" in the above program into two values,
and the "b" the program compares against is not known to the compiler to be
the same value that we build a dependency on.
* heap/MarkedBlock.h:
(JSC::MarkedBlock::aboutToMark):
(JSC::MarkedBlock::isMarked):
* runtime/JSObject.cpp:
(JSC::JSObject::visitButterflyImpl):
* runtime/JSObject.h:
(JSC::JSObject::fencedButterfly):
* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayEntry::getConcurrently):
(JSC::SparseArrayEntry::getConcurrently const): Deleted.
* runtime/SparseArrayValueMap.h:
* runtime/Structure.h:
(JSC::Structure::fencedIndexingMode):
* runtime/StructureIDBlob.h:
(JSC::StructureIDBlob::fencedIndexingModeIncludingHistory):
Source/WTF:
* wtf/Atomics.h:
(WTF::opaque):
(WTF::Dependency::loadAndFence):
Canonical link: https://commits.webkit.org/239883@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-22 20:05:09 +00:00
2021-07-22 Saam Barati <sbarati@apple.com>
Fix uses of Dependency::fence with respect to the compiler outsmarting us
https://bugs.webkit.org/show_bug.cgi?id=227757
<rdar://problem/80280931>
Reviewed by Robin Morisset.
* wtf/Atomics.h:
(WTF::opaque):
(WTF::Dependency::loadAndFence):
2021-07-22 20:04:10 +00:00
2021-07-22 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, follow-up after r280193
https://bugs.webkit.org/show_bug.cgi?id=228142
I accidentally reverted auto change when switching branches.
* wtf/text/AtomStringImpl.cpp:
(WTF::UCharBufferTranslator::equal):
(WTF::LCharBufferTranslator::equal):
(WTF::BufferFromStaticDataTranslator::equal):
2021-07-22 19:18:45 +00:00
2021-07-22 Yusuke Suzuki <ysuzuki@apple.com>
Micro-optimize innerHTML
https://bugs.webkit.org/show_bug.cgi?id=228142
Reviewed by Simon Fraser.
* wtf/Vector.h:
(WTF::Malloc>::shrinkToBestFit): This shrinks the backing storage to "appropriate for the living Vector".
* wtf/text/AtomStringImpl.cpp:
(WTF::UCharBufferTranslator::equal): WTF::equal for String does not check hash. This is because computing hash is expensive
and we would like to avoid that if it is not necessary. But when inserting string into AtomStringTable, we can use hash value
since they must be already computed because of HashMap's requirement. So let's use it before calling WTF::equal.
(WTF::LCharBufferTranslator::equal):
(WTF::BufferFromStaticDataTranslator::equal):
* wtf/text/StringView.h:
(WTF::StringView::stripLeadingMatchedCharacters): Add this and use it in HTMLTreeBuilder.
2021-07-22 17:44:34 +00:00
2021-07-22 Alex Christensen <achristensen@webkit.org>
XHR.send(Document) should replace mismatched surrogates with replacement character before sending
https://bugs.webkit.org/show_bug.cgi?id=228170
Reviewed by Chris Dumez.
* wtf/text/WTFString.cpp:
(WTF::replaceUnpairedSurrogatesWithReplacementCharacter):
* wtf/text/WTFString.h:
Move from WebCore, rename as suggested, update spec link to one that works.
2021-07-22 11:48:39 +00:00
2021-07-22 Zan Dobersek <zdobersek@igalia.com>
Add CPU(RISCV64)
https://bugs.webkit.org/show_bug.cgi?id=228178
Reviewed by Adrian Perez de Castro.
Detect when compiling for the RISC-V 64-bit architecture and define
the WTF_CPU_RISCV64 macro under that condition, enabling use of
CPU(RISCV64) build guards.
* wtf/PageBlock.h: Use 4 kB as the page size ceiling for CPU(RISCV64).
* wtf/PlatformCPU.h:
2021-07-21 20:10:49 +00:00
2021-07-21 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Allow the user to configure the MemoryPressureHandler inside the web process
https://bugs.webkit.org/show_bug.cgi?id=222738
Reviewed by Carlos Garcia Campos.
Add a configuration structure to MemoryPressureHandler, with the methods to encode/decode it. Also
add a method to set a configuration structure to a MemoryPressureHandler instance, and modify the
behavior so the the configuration is used when checking the memory used by the process.
* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor):
(WTF::MemoryPressureHandler::thresholdForMemoryKill):
(WTF::MemoryPressureHandler::thresholdForPolicy):
(WTF::MemoryPressureHandler::policyForFootprint):
(WTF::MemoryPressureHandler::Configuration::Configuration):
* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::Configuration::encode const):
(WTF::MemoryPressureHandler::Configuration::decode):
(WTF::MemoryPressureHandler::setConfiguration):
2021-07-21 19:26:52 +00:00
2021-07-21 Chris Dumez <cdumez@apple.com>
Unreviewed, reverting r280129.
Broke the internal Monterey build bots
Reverted changeset:
"GetIdentifierStringForPreferredVoiceInListWithLocale() is
deprecated in Monterey"
https://bugs.webkit.org/show_bug.cgi?id=228066
https://commits.webkit.org/r280129
2021-07-21 12:57:20 +00:00
2021-07-21 David Kilzer <ddkilzer@apple.com>
GetIdentifierStringForPreferredVoiceInListWithLocale() is deprecated in Monterey
<https://webkit.org/b/228066>
<rdar://problem/80577312>
Reviewed by Alexey Proskuryakov.
* wtf/PlatformHave.h:
- Add HAVE(SPEECHSYNTHESIS_MONTEREY_SPI).
2021-07-21 04:23:21 +00:00
2021-07-20 Myles C. Maxfield <mmaxfield@apple.com>
r280103 is not necessary on all operating systems
https://bugs.webkit.org/show_bug.cgi?id=228136
Reviewed by Alan Bujtas.
* wtf/PlatformUse.h:
[GTK][WPE] Support color-schemes CSS property
https://bugs.webkit.org/show_bug.cgi?id=208204
Patch by Alexander Mikhaylenko <alexm@gnome.org> on 2021-07-16
Reviewed by Adrian Perez de Castro.
.:
* Source/cmake/OptionsGTK.cmake:
Enable HAVE_OS_DARK_MODE_SUPPORT.
* Source/cmake/OptionsWPE.cmake:
Enable ENABLE_DARK_MODE_CSS and HAVE_OS_DARK_MODE_SUPPORT.
Source/WebCore:
Last time we tried enabling dark mode, we broke many webpages since we couldn't have diferent
controls, and more importantly, different system colors and defaults for pages that do and
don't support dark mode.
Now that we don't use GTK for this, we can try again. This time, use hardcoded system colors
and return different colors depending on StyleColor::Options::UseDarkAppearance.
To avoid dark-on-dark text on entries, we also need to enable HAVE_OS_DARK_MODE_SUPPORT for GTK
and make sure it's passed to use agent CSS. And since Adwaita controls are also used in WPE, we
need to enable it for WPE as well, and since WPE didn't have ENABLE_DARK_MODE_CSS, flip that as
well, all in lockstep.
No new tests, reenabled the existing css-dark-mode tests.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
Pass HAVE_OS_DARK_MODE_SUPPORT to user agent CSS.
* css/CSSValueKeywords.in:
Expose -webkit-control-background for anything with HAVE_OS_DARK_MODE_SUPPORT.
* css/themeAdwaita.css:
(input[type="search"]::-webkit-search-results-button,):
(input[type="search"]::-webkit-search-cancel-button):
(body[dir="rtl"] input[type="search"]::-webkit-search-cancel-button):
(input[type="search"]::-webkit-search-results-button:hover,):
(input[type="search"]::-webkit-search-cancel-button:hover): Deleted.
Use mask images instead of content so we can recolor them. Change
color on hover as opacity and inherit entry's color otherwise to
make sure it's legible with dark appearance.
* page/FrameView.cpp:
(WebCore::FrameView::updateBackgroundRecursively):
Use CSSValueWindow for background instead of CSSValueAppleSystemControlBackground
when the latter is not available.
* platform/adwaita/ThemeAdwaita.cpp:
(WebCore::ThemeAdwaita::focusColor):
(WebCore::ThemeAdwaita::paintFocus):
(WebCore::ThemeAdwaita::paintArrow):
(WebCore::ThemeAdwaita::paint):
(WebCore::ThemeAdwaita::paintCheckbox):
(WebCore::ThemeAdwaita::paintRadio):
(WebCore::ThemeAdwaita::paintButton):
(WebCore::ThemeAdwaita::paintSpinButton):
* platform/adwaita/ThemeAdwaita.h:
* rendering/RenderThemeAdwaita.cpp:
(WebCore::RenderThemeAdwaita::platformFocusRingColor const):
(WebCore::RenderThemeAdwaita::systemColor const):
(WebCore::RenderThemeAdwaita::paintTextField):
(WebCore::RenderThemeAdwaita::adjustTextFieldStyle const):
(WebCore::RenderThemeAdwaita::adjustTextAreaStyle const):
(WebCore::RenderThemeAdwaita::adjustSearchFieldStyle const):
Add a border radius to the default style, so the background doesn't bleed through
the corners.
(WebCore::RenderThemeAdwaita::paintMenuList):
(WebCore::RenderThemeAdwaita::paintProgressBar):
(WebCore::RenderThemeAdwaita::paintSliderTrack):
(WebCore::RenderThemeAdwaita::paintSliderThumb):
* rendering/RenderThemeAdwaita.h:
Source/WTF:
* wtf/PlatformHave.h:
Enable HAVE_OS_DARK_MODE_SUPPORT for GTK and WPE.
LayoutTests:
Reenable css-dark-mode tests for GTK as they pass now. Enable the same tests in WPE.
Keep css-dark-mode/older-syntax/supported-color-schemes-css.html as [ Pass Crash ] for now,
according to https://bugs.webkit.org/show_bug.cgi?id=202229#c2
* platform/gtk/TestExpectations:
* platform/gtk/css-dark-mode/color-scheme-css-expected.txt: Removed.
* platform/gtk/css-dark-mode/color-scheme-meta-expected.txt: Removed.
* platform/gtk/css-dark-mode/color-scheme-priority-expected.txt: Removed.
* platform/gtk/css-dark-mode/default-colors-expected.txt: Removed.
* platform/gtk/css-dark-mode/older-syntax/supported-color-schemes-css-expected.txt: Removed.
* platform/gtk/css-dark-mode/older-syntax/supported-color-schemes-meta-expected.txt: Removed.
* platform/wpe/TestExpectations:
Canonical link: https://commits.webkit.org/239730@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-16 16:39:15 +00:00
2021-07-16 Alexander Mikhaylenko <alexm@gnome.org>
[GTK][WPE] Support color-schemes CSS property
https://bugs.webkit.org/show_bug.cgi?id=208204
Reviewed by Adrian Perez de Castro.
* wtf/PlatformHave.h:
Enable HAVE_OS_DARK_MODE_SUPPORT for GTK and WPE.
2021-07-16 02:09:39 +00:00
2021-07-15 Jean-Yves Avenard <jya@apple.com>
[Wk1] media/media-source/media-webm-opus-partial.html is a consistent failure (Enable VP8/VP9/Vorbis/Opus in WebKitLegacy)
https://bugs.webkit.org/show_bug.cgi?id=228005
rdar://80346720
Reviewed by Jer Noble.
* Scripts/Preferences/WebPreferencesExperimental.yaml: Enable VP8/VP9/Vorbis/Opus
codecs for WebKitLegacy, no reasons they weren't already enabled.
2021-07-16 01:25:20 +00:00
2021-07-15 Joonghun Park <jh718.park@samsung.com>
Unreviewed. Fix the build warning below since r279895.
warning: comparison of integer expressions of different signedness: ‘ int’ and ‘ unsigned int’ [-Wsign-compare]
* wtf/URL.cpp:
(WTF::URL::setPath):
2021-07-16 00:36:39 +00:00
2021-07-15 Chris Dumez <cdumez@apple.com>
Add initial support for BroadcastChannel behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=227924
Reviewed by Sam Weinig.
Add experimental feature flag for BroadcastChannel, off by default.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-07-15 11:48:58 +00:00
2021-07-15 Philippe Normand <pnormand@igalia.com>
[GStreamer][Pipewire] Implement getDisplayMedia() backend
https://bugs.webkit.org/show_bug.cgi?id=210926
Reviewed by Xabier Rodriguez-Calvar.
* Scripts/Preferences/WebPreferencesExperimental.yaml: Enable screen-capture if libportal
was found.
2021-07-14 22:56:48 +00:00
2021-07-14 Jer Noble <jer.noble@apple.com>
Unreviewed build fix after r279912 (239661@main); Add a HAVE(SYSTEM_STATUS) macro.
* wtf/PlatformHave.h:
2021-07-13 22:54:29 +00:00
2021-07-13 Alex Christensen <achristensen@webkit.org>
Update and fix URL WPT tests
https://bugs.webkit.org/show_bug.cgi?id=227820
Reviewed by Chris Dumez.
There was an edge case where if we set a path to an empty string, it would add a slash. No more.
* wtf/URL.cpp:
(WTF::URL::setPath):
2021-07-13 21:53:22 +00:00
2021-07-13 Michael Catanzaro <mcatanzaro@gnome.org>
Remove USE_64KB_PAGE_BLOCK
https://bugs.webkit.org/show_bug.cgi?id=227905
Reviewed by Yusuke Suzuki.
* wtf/PageBlock.h:
New malloc algorithm
https://bugs.webkit.org/show_bug.cgi?id=226404
Reviewed by Yusuke Suzuki.
Source/bmalloc:
This change replaces bmalloc with libpas, by importing libpas and making it expose API that
looks like the current bmalloc API. Libpas replaces everything bmalloc gave us: the main
bmalloc API, the Gigacage API, and the IsoHeap API. Libpas also replaces the JSC
ExecutableAllocator (more on that in the JSC ChangeLog). I've been working on libpas for about
three years, and you'll be able to see the age of some of it in the copyrights.
Libpas is a totally new malloc implementation that focuses on allowing for the creation of lots
of isolated heaps, and making it possible for those heaps to provide certain type guarantees.
I'm not going to summarize everything that it does in this changelog; I'll mostly focus on
things that are interesting to its use in WebKit.
Libpas tries hard to make having lots of heaps cheap both by having a good isolated heap
implementation and by offsetting the cost by having a bunch of space saving improvements for all
kinds of heaps. Libpas heaps can be configured to be either very compact or very fast. In
WebKit, we configure libpas to be as fast as possible, except for the jit_heap, where we
configure it to be as compact as possible. The fast configuration relies on the segregated heap
for most allocations, while the compact configuration relies on bitfit for most configurations.
It's possible to use both in combination with any size cut-off before you switch to bitfit.
Libpas's segregated heap is competitive to bmalloc in speed. This patch is a speed-up on AS, and
it's only enabled on AS for now. Libpas is still a regression relative to bmalloc on some
devices that I have measured, so it should probably stay enabled on AS only for now. This patch
ought to be a 1% speed-up on Speedometer and MotionMark and be neutral elsewhere.
When it comes to memory usage, libpas's segregated heap is a 19% improvement on membuster and a
11% improvement on RAMification on AS, with most other devices exhibiting similar wins if you
enable libpas on them.
Here's the basic design:
- Libpas makes extreme use of generic programming in C, sometimes using macros, but mostly using
a technique where ALWAYS_INLINE functions are passed structs with function pointers to other
ALWAYS_INLINE functions, sometimes many layers deep. I've perfected this so that I can cause
outlining to happen wherever I want without losing the specialization, and I can cause
anything I want to become generic (i.e. it gets a pointer to that struct with function
pointers and it really has to call them).
This allows libpas to have many copies of the same algorithm, but configured differently.
That's why, for example, I was able to make libpas's bitfit obey ExecutableAllocator rules
like that you cannot put any metadata inside the memory you're managing. That's also how
libpas "scales" it's algorithm: there are the small configurations, and then with a different
struct, we get the medium configurations (larger overall page size, ability to decommit each
physical page within the logical page), and the marge configurations (optimized for even
bigger object sizes).
- Allocation uses thread-local caches that hold on to up to a page of memory. This is similar
overall to bmalloc, but rather different in the details. When allocating from that memory (see
bmalloc_heap_inlines.h, then pas_try_allocate_intrinsic_primitive.h, then
pas_try_allocate_common.h, then pas_local_allocator_inlines.h), libpas uses either bump
pointer or bit search. The bit search is optimized to death. Libpas does lots of clever things
with bits: for example, each bit represents just a "minalign" worth of memory (so like 16
bytes), and bits are set at the beginnings of objects. Lots of interesting bit manipulation
happens on the slow path to quickly turn this into a bitvector where the bits are set at
free object beginnings, which is what the allocator consumes (see for example
pas_local_allocator_scan_bits_to_set_up_free_bits() in pas_local_allocator_inlines.h). This
saves libpas from having to use multiplications on the allocation and deallocation paths.
Allocation fast paths are super fast and require no locks. Slow paths use fine-grained
locking so the likelihood of contention is very low. Each page has a lock, and they do crazy
things with their locks: pages will all share the same lock so long as that's efficient, but
will pick up different locks if that causes contention, and then they will share the same
lock again if contention goes away.
Allocation caches can be reclaimed by the scavenger. This is done using an
ask-nicely-then-more-firmly kind of mechanism: first the scavenger will just ask allocators
that haven't been used in a while to return their memory, and the thread will service this
request on the next allocation slow path for any thread-local allocator. But if the thread
doesn't do this, then the scavenger will eventually suspend the thread and take its caches.
- Deallocation uses a log. The log flush amortizes lock acquisition and memory access to libpas
metadata. This is quite a bit like bmalloc. The differences are: libpas may acquire multiple
locks during deallocation log flush, but because pages try to share locks, that usually
doesn't happen. Usually, all pages that were most recently used by some CPU will share the
same lock. The other difference is that the libpas scavenger can flush deallocation logs, and
does so on every tick.
The design described so far is for the libpas segregated heap, which is the most
performance-optimized heap, as well as the heap most suited for isoheaps. Segregated heap has
many isoheap optimizations, like allowing multiple heaps to share different slabs of the same
page. But libpas also has two other heap kinds:
- Bitfit. The bitfit heap uses a bit-per-minalign but uses it to implement first-fit. Allocation
searches for a span of set "free" bits and then clears them. Deallocation uses a second
bitvector, the "object ends" bits, to find the end of the object and then sets the whole range
of free bits. This allocator uses per-page locking and a clever short-circuiting algorithm
to find the first page that will have a contiguous slab of free memory big enough for the
size you're trying to allocate. This is much slower than the segregated heap, but also much
faster than the other option, which is the libpas large allocator. Bitfit is the most
space-efficient heap in libpas, except for super large objects. The space efficiency comes
from the fact that it's first-fit. It should be noted that segregated is also first-fit, but
within size classes, so segregated gets more external fragmentation than bitfit.
This patch causes us to use bitfit for the mini mode. We also use bitfit for marge allocations
(so bigger than segregated medium but too small for large) and for jit_heap.
I think the most interesting file for bitfit is pas_bitfit_page_inlines.h.
- Large. This is a first-fit allocator implemented using cartesian trees. Something special
about it is that it can do type-safe array allocations with complex combinations of memalign.
For example, you can tell it to create a heap that allocates arrays of a type whose size is
42, and then it will guarantee you that no matter how big or how small of an array you
allocate, no element of that array will ever be an "offset overlap" with a previously freed
element. So, it won't create any type confusions. It will guarantee this even if you did
memalign with any alignment (I needed to use extended GCD for this -- see pas_extended_gcd.c
and pas_coalign.c). The large algorithm is implemented generically
(pas_generic_large_free_heap.h), so it can use either cartesian trees
(pas_fast_large_free_heap.c) or just an array (pas_simple_large_free_heap.c). The large heap
is used internally in libpas a lot, for example for the bootstrap heap, which is how all of
libpas gets its memory. One particularly neat thing about this is that the bootstrap heap
allocates a freelist array inside of the memory it is managing using a kind of wild
metacircular design.
One of the main space saving features is that libpas has a fine-grained-locked LRU decommit
policy using a 10Hz scavenger thread. This scavenger incurs almost no perf cost but is able
to return a ton of memory. At any tick, it will decommit any totally free pages that haven't
been used in the last 300ms. This includes pages used for internal libpas metadata, like the
thread-local caches. Decommitting pages holds locks that other threads are unlikely to want to
grab (because of policies that actively avoid it), so decommit happens with minimal interference
to the running program.
Libpas is written in C and strongly assumes that the C compiler is modern enough to fixpoint
inlining of always-inline functions with the right other optimizations. Llvm does this, which
enables a wonderful style of generic programming. The fact that the same code can be used
for generic, specialized-and-inline, and specialized-but-out-of-line functions is great. I use
WebKit C++ style (so foo* p rather than foo *p) but with lower_case_identifiers for anything
that isn't a macro. Anything that isn't static is prefixed pas_, unless it's some specific
heap configuration, like the bmalloc one, which prefixes every non-static with bmalloc_.
Libpas includes a giant test suite. Lots of the heap configurations (iso_test, thingy,
minalign32, pagesize64k) are just for testing. The test suite has both unit tests and chaos
tests as well as everything in between. The test suite is written in C++.
This glues libpas into the DebugHeap mechanism in bmalloc, so Malloc=1 will give you system
malloc. Libpas supports libmalloc enumeration, and this patch exposes it (though you need a
shared cache rebuild to enjoy the benefits).
All of bmalloc's external-facing API are replaced with libpas when the BUSE(LIBPAS) flag is
set (so the bmalloc::XYZ functions, Gigacage::XYZ, and IsoHeap<> and friends). This also
exposes the jit_heap API for the ExecutableAllocator to use.
Notes for porting: this uses lots of Darwin APIs, like the APIs for getting an approximate time
very quickly, APIs for fast TLS, thread suspension, and probably other stuff. It'll be hard,
but possible, to port to Linux. It may never perform as well on Linux as it does on Darwin.
It's also worth noting that libpas strongly assumes 64-bit, that the CPU can do 128-bit
compare-and-swap, that there is no big downside to misaligned loads and stores, and that the
memory model is either the one in ARM64 or the one on x86_64 (or something not weaker than
either of them). Trying to make libpas work on 32-bit CPUs will quickly run into cases where
some pointer math doesn't work right because it was written strongly assuming properties
unique to 64-bit CPUs (like that some number of top bits are not used for the address), as well
as cases where lock-free algorithms are using uintptr_t for a versioning scheme (which may not
be as reliable as you want on 32-bit).
* CMakeLists.txt:
* Configurations/Base.xcconfig:
* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/BPlatform.h:
* bmalloc/DebugHeap.cpp:
(bmalloc::DebugHeap::tryGetSlow):
(pas_debug_heap_is_enabled):
(pas_debug_heap_malloc):
(pas_debug_heap_memalign):
(pas_debug_heap_realloc):
(pas_debug_heap_free):
* bmalloc/DebugHeap.h:
(bmalloc::debugHeapDisabled):
(bmalloc::DebugHeap::tryGet):
(bmalloc::DebugHeap::getExisting):
* bmalloc/Gigacage.cpp:
(Gigacage::ensureGigacage):
(Gigacage::allocBase):
(Gigacage::size):
* bmalloc/Gigacage.h:
* bmalloc/GigacageConfig.h:
(Gigacage::Config::allocBasePtr const):
(Gigacage::Config::setAllocBasePtr):
(Gigacage::Config::allocSize const):
(Gigacage::Config::setAllocSize):
* bmalloc/Heap.cpp:
(bmalloc::Heap::gigacageSize):
* bmalloc/Heap.h:
* bmalloc/IsoHeap.cpp: Added.
(bmalloc::api::isoAllocate):
(bmalloc::api::isoTryAllocate):
(bmalloc::api::isoDeallocate):
* bmalloc/IsoHeap.h:
(bmalloc::api::IsoHeap::IsoHeap):
(bmalloc::api::IsoHeap::allocate):
(bmalloc::api::IsoHeap::tryAllocate):
(bmalloc::api::IsoHeap::deallocate):
(bmalloc::api::IsoHeap::scavenge):
(bmalloc::api::IsoHeap::initialize):
(bmalloc::api::IsoHeap::isInitialized):
* bmalloc/IsoHeapImplInlines.h:
(bmalloc::IsoHeapImpl<Config>::IsoHeapImpl):
* bmalloc/IsoHeapInlines.h:
* bmalloc/IsoMallocFallback.cpp: Added.
(bmalloc::IsoMallocFallback::tryMalloc):
(bmalloc::IsoMallocFallback::tryFree):
* bmalloc/IsoMallocFallback.h: Copied from Source/bmalloc/bmalloc/DebugHeap.h.
(bmalloc::IsoMallocFallback::shouldTryToFallBack):
(bmalloc::IsoMallocFallback::MallocResult::MallocResult):
* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::determineMallocFallbackState): Deleted.
* bmalloc/IsoTLS.h:
* bmalloc/IsoTLSInlines.h:
(bmalloc::IsoTLS::allocateSlow):
(bmalloc::IsoTLS::deallocateSlow):
* bmalloc/PerThread.h:
(bmalloc::PerThreadStorage<PerHeapKind<Cache>>::init):
* bmalloc/bmalloc.cpp:
(bmalloc::api::tryLargeZeroedMemalignVirtual):
(bmalloc::api::freeLargeVirtual):
(bmalloc::api::scavengeThisThread):
(bmalloc::api::scavenge):
(bmalloc::api::setScavengerThreadQOSClass):
(bmalloc::api::commitAlignedPhysical):
(bmalloc::api::decommitAlignedPhysical):
(bmalloc::api::enableMiniMode):
(bmalloc::api::disableScavenger):
* bmalloc/bmalloc.h:
(bmalloc::api::heapForKind):
(bmalloc::api::tryMalloc):
(bmalloc::api::malloc):
(bmalloc::api::tryMemalign):
(bmalloc::api::memalign):
(bmalloc::api::tryRealloc):
(bmalloc::api::realloc):
(bmalloc::api::free):
(bmalloc::api::scavengeThisThread): Deleted.
* libpas/.gitignore: Added.
* libpas/build.sh: Added.
* libpas/build_and_test.sh: Added.
* libpas/common.sh: Added.
* libpas/libpas.xcodeproj/project.pbxproj: Added.
* libpas/scripts/tally_verifier_output: Added.
* libpas/src/chaos/Chaos.cpp: Added.
(std::Object::Object):
(std::Packet::~Packet):
(std::Locker::Locker):
(std::Locker::~Locker):
(std::threadMain):
(main):
* libpas/src/libpas/bmalloc_heap.c: Added.
(bmalloc_try_allocate):
(bmalloc_try_allocate_with_alignment):
(bmalloc_try_allocate_zeroed):
(bmalloc_allocate):
(bmalloc_allocate_with_alignment):
(bmalloc_allocate_zeroed):
(bmalloc_try_reallocate):
(bmalloc_reallocate):
(bmalloc_try_iso_allocate):
(bmalloc_iso_allocate):
(bmalloc_heap_ref_get_heap):
(bmalloc_try_allocate_auxiliary):
(bmalloc_allocate_auxiliary):
(bmalloc_try_allocate_auxiliary_zeroed):
(bmalloc_allocate_auxiliary_zeroed):
(bmalloc_try_allocate_auxiliary_with_alignment):
(bmalloc_allocate_auxiliary_with_alignment):
(bmalloc_try_reallocate_auxiliary):
(bmalloc_reallocate_auxiliary):
(bmalloc_deallocate):
(bmalloc_force_auxiliary_heap_into_reserved_memory):
* libpas/src/libpas/bmalloc_heap.h: Added.
* libpas/src/libpas/bmalloc_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h.
(bmalloc_heap_config_activate):
* libpas/src/libpas/bmalloc_heap_config.h: Added.
* libpas/src/libpas/bmalloc_heap_inlines.h: Added.
(bmalloc_try_allocate_inline):
(bmalloc_try_allocate_with_alignment_inline):
(bmalloc_try_allocate_zeroed_inline):
(bmalloc_allocate_inline):
(bmalloc_allocate_with_alignment_inline):
(bmalloc_allocate_zeroed_inline):
(bmalloc_try_reallocate_inline):
(bmalloc_reallocate_inline):
(bmalloc_try_iso_allocate_inline):
(bmalloc_iso_allocate_inline):
(bmalloc_try_allocate_auxiliary_inline):
(bmalloc_allocate_auxiliary_inline):
(bmalloc_try_allocate_auxiliary_zeroed_inline):
(bmalloc_allocate_auxiliary_zeroed_inline):
(bmalloc_try_allocate_auxiliary_with_alignment_inline):
(bmalloc_allocate_auxiliary_with_alignment_inline):
(bmalloc_try_reallocate_auxiliary_inline):
(bmalloc_reallocate_auxiliary_inline):
(bmalloc_deallocate_inline):
* libpas/src/libpas/bmalloc_heap_innards.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/bmalloc_heap_ref.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/hotbit_heap.c: Copied from Source/WTF/wtf/FastTLS.h.
(hotbit_try_allocate):
(hotbit_try_allocate_with_alignment):
(hotbit_try_reallocate):
(hotbit_deallocate):
* libpas/src/libpas/hotbit_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/hotbit_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h.
(hotbit_heap_config_activate):
* libpas/src/libpas/hotbit_heap_config.h: Added.
* libpas/src/libpas/hotbit_heap_inlines.h: Added.
(hotbit_try_allocate_inline):
(hotbit_try_allocate_with_alignment_inline):
(hotbit_try_reallocate_inline):
(hotbit_deallocate_inline):
* libpas/src/libpas/hotbit_heap_innards.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/iso_heap.c: Added.
(iso_try_allocate_common_primitive):
(iso_try_allocate_common_primitive_with_alignment):
(iso_try_allocate_common_primitive_zeroed):
(iso_allocate_common_primitive):
(iso_allocate_common_primitive_with_alignment):
(iso_allocate_common_primitive_zeroed):
(iso_try_reallocate_common_primitive):
(iso_reallocate_common_primitive):
(iso_try_allocate_dynamic_primitive):
(iso_try_allocate_dynamic_primitive_with_alignment):
(iso_try_allocate_dynamic_primitive_zeroed):
(iso_try_reallocate_dynamic_primitive):
(iso_heap_ref_construct):
(iso_try_allocate):
(iso_allocate):
(iso_try_allocate_array):
(iso_allocate_array):
(iso_try_allocate_array_zeroed):
(iso_allocate_array_zeroed):
(iso_try_reallocate_array):
(iso_reallocate_array):
(iso_heap_ref_get_heap):
(iso_primitive_heap_ref_construct):
(iso_try_allocate_primitive):
(iso_allocate_primitive):
(iso_try_allocate_primitive_zeroed):
(iso_allocate_primitive_zeroed):
(iso_try_allocate_primitive_with_alignment):
(iso_allocate_primitive_with_alignment):
(iso_try_reallocate_primitive):
(iso_reallocate_primitive):
(iso_try_allocate_for_objc):
(iso_has_object):
(iso_get_allocation_size):
(iso_get_heap):
(iso_deallocate):
(iso_force_primitive_heap_into_reserved_memory):
* libpas/src/libpas/iso_heap.h: Added.
* libpas/src/libpas/iso_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/iso_heap_config.h: Added.
* libpas/src/libpas/iso_heap_inlines.h: Added.
(iso_try_allocate_common_primitive_inline):
(iso_try_allocate_common_primitive_with_alignment_inline):
(iso_try_allocate_common_primitive_zeroed_inline):
(iso_allocate_common_primitive_inline):
(iso_allocate_common_primitive_with_alignment_inline):
(iso_allocate_common_primitive_zeroed_inline):
(iso_try_reallocate_common_primitive_inline):
(iso_reallocate_common_primitive_inline):
(iso_try_allocate_inline):
(iso_allocate_inline):
(iso_try_allocate_array_inline):
(iso_allocate_array_inline):
(iso_try_allocate_array_zeroed_inline):
(iso_allocate_array_zeroed_inline):
(iso_try_reallocate_array_inline):
(iso_reallocate_array_inline):
(iso_try_allocate_primitive_inline):
(iso_allocate_primitive_inline):
(iso_try_allocate_primitive_zeroed_inline):
(iso_allocate_primitive_zeroed_inline):
(iso_try_allocate_primitive_with_alignment_inline):
(iso_allocate_primitive_with_alignment_inline):
(iso_try_reallocate_primitive_inline):
(iso_reallocate_primitive_inline):
(iso_try_allocate_for_objc_inline):
(iso_has_object_inline):
(iso_get_allocation_size_inline):
(iso_get_heap_inline):
(iso_deallocate_inline):
* libpas/src/libpas/iso_heap_innards.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/iso_heap_ref.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/iso_test_heap.c: Added.
(iso_test_allocate_common_primitive):
(iso_test_allocate):
(iso_test_allocate_array):
(iso_test_deallocate):
(iso_test_heap_ref_get_heap):
* libpas/src/libpas/iso_test_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/iso_test_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/iso_test_heap_config.h: Added.
* libpas/src/libpas/jit_heap.c: Added.
(jit_heap_add_fresh_memory):
(jit_heap_try_allocate):
(jit_heap_shrink):
(jit_heap_get_size):
(jit_heap_deallocate):
* libpas/src/libpas/jit_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/jit_heap_config.c: Added.
(fresh_memory_aligned_allocator):
(initialize_fresh_memory_config):
(allocate_from_fresh):
(page_provider):
(jit_page_header_for_boundary_remote):
(jit_small_bitfit_allocate_page):
(jit_small_bitfit_create_page_header):
(jit_small_bitfit_destroy_page_header):
(jit_medium_bitfit_allocate_page):
(jit_medium_bitfit_create_page_header):
(jit_medium_bitfit_destroy_page_header):
(jit_aligned_allocator):
(jit_prepare_to_enumerate):
(jit_heap_config_for_each_shared_page_directory):
(jit_heap_config_for_each_shared_page_directory_remote):
(jit_heap_config_add_fresh_memory):
* libpas/src/libpas/jit_heap_config.h: Added.
(jit_type_size):
(jit_type_alignment):
(jit_heap_config_fast_megapage_kind):
(jit_small_bitfit_page_header_for_boundary):
(jit_small_bitfit_boundary_for_page_header):
(jit_medium_bitfit_page_header_for_boundary):
(jit_medium_bitfit_boundary_for_page_header):
(jit_heap_config_page_header):
* libpas/src/libpas/jit_heap_config_root_data.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/minalign32_heap.c: Added.
(minalign32_allocate_common_primitive):
(minalign32_allocate):
(minalign32_allocate_array):
(minalign32_deallocate):
(minalign32_heap_ref_get_heap):
* libpas/src/libpas/minalign32_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/minalign32_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h.
(minalign32_heap_config_activate):
* libpas/src/libpas/minalign32_heap_config.h: Added.
* libpas/src/libpas/pagesize64k_heap.c: Added.
(pagesize64k_allocate_common_primitive):
(pagesize64k_allocate):
(pagesize64k_allocate_array):
(pagesize64k_deallocate):
(pagesize64k_heap_ref_get_heap):
* libpas/src/libpas/pagesize64k_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pagesize64k_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h.
(pagesize64k_heap_config_activate):
* libpas/src/libpas/pagesize64k_heap_config.h: Added.
* libpas/src/libpas/pas_aligned_allocation_result.h: Added.
(pas_aligned_allocation_result_create_empty):
(pas_aligned_allocation_result_as_allocation_result):
* libpas/src/libpas/pas_aligned_allocator.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_alignment.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_alignment_dump):
* libpas/src/libpas/pas_alignment.h: Added.
(pas_alignment_create):
(pas_alignment_create_traditional):
(pas_alignment_create_trivial):
(pas_alignment_validate):
(pas_alignment_is_ptr_aligned):
(pas_alignment_round_up):
(pas_alignment_is_equal):
* libpas/src/libpas/pas_all_biasing_directories.c: Added.
(pas_all_biasing_directories_append):
(pas_all_biasing_directories_activate):
(scavenge_for_each_set_bit_bits_source):
(scavenge_for_each_set_bit_callback):
(scavenge_bitvector_word_callback):
(pas_all_biasing_directories_scavenge):
* libpas/src/libpas/pas_all_biasing_directories.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_all_heap_configs.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_all_heaps.c: Added.
(pas_all_heaps_add_heap):
(pas_all_heaps_for_each_static_heap):
(pas_all_heaps_for_each_dynamic_heap):
(pas_all_heaps_for_each_heap):
(pas_all_heaps_for_each_static_segregated_heap_not_part_of_a_heap):
(for_each_segregated_heap_callback):
(pas_all_heaps_for_each_static_segregated_heap):
(pas_all_heaps_for_each_segregated_heap):
(get_num_free_bytes_for_each_heap_callback):
(pas_all_heaps_get_num_free_bytes):
(reset_heap_ref_for_each_heap_callback):
(pas_all_heaps_reset_heap_ref):
(for_each_segregated_directory_global_size_directory_callback):
(for_each_segregated_directory_shared_page_directory_callback):
(for_each_segregated_directory_segregated_heap_callback):
(pas_all_heaps_for_each_segregated_directory):
(dump_directory_nicely):
(dump_view_nicely):
(verify_in_steady_state_segregated_directory_callback):
(pas_all_heaps_verify_in_steady_state):
(compute_total_non_utility_segregated_summary_directory_callback):
(pas_all_heaps_compute_total_non_utility_segregated_summary):
(compute_total_non_utility_bitfit_summary_heap_callback):
(pas_all_heaps_compute_total_non_utility_bitfit_summary):
(compute_total_non_utility_large_summary_heap_callback):
(pas_all_heaps_compute_total_non_utility_large_summary):
(pas_all_heaps_compute_total_non_utility_summary):
* libpas/src/libpas/pas_all_heaps.h: Added.
* libpas/src/libpas/pas_all_magazines.c: Added.
(pas_all_magazines_get_current):
* libpas/src/libpas/pas_all_magazines.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_all_shared_page_directories.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_all_shared_page_directories_add):
(pas_all_shared_page_directories_for_each):
* libpas/src/libpas/pas_all_shared_page_directories.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_allocation_callbacks.c: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_allocation_callbacks.h: Added.
(pas_did_allocate):
(pas_will_deallocate):
* libpas/src/libpas/pas_allocation_config.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_allocation_kind.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_allocation_kind_get_string):
* libpas/src/libpas/pas_allocation_result.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_allocation_result_zero):
* libpas/src/libpas/pas_allocation_result.h: Added.
(pas_allocation_result_create_failure):
(pas_allocation_result_create_success_with_zero_mode):
(pas_allocation_result_create_success):
* libpas/src/libpas/pas_allocator_counts.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_allocator_index.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_allocator_scavenge_action.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_allocator_scavenge_action_get_string):
* libpas/src/libpas/pas_baseline_allocator.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_baseline_allocator_attach_directory):
(pas_baseline_allocator_detach_directory):
* libpas/src/libpas/pas_baseline_allocator.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_baseline_allocator_result.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_baseline_allocator_result_create_failure):
(pas_baseline_allocator_result_create_success):
* libpas/src/libpas/pas_baseline_allocator_table.c: Added.
(initialize):
(pas_baseline_allocator_table_initialize_if_necessary):
(pas_baseline_allocator_table_get_random_index):
(pas_baseline_allocator_table_for_all):
* libpas/src/libpas/pas_baseline_allocator_table.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_basic_heap_config_enumerator_data.c: Added.
(pas_basic_heap_config_enumerator_data_add_page_header_table):
* libpas/src/libpas/pas_basic_heap_config_enumerator_data.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_basic_heap_config_root_data.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_basic_heap_page_caches.h: Added.
(pas_basic_heap_page_caches_get_shared_page_directories):
* libpas/src/libpas/pas_basic_heap_runtime_config.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_basic_segregated_page_caches.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_biasing_directory.c: Added.
(pas_biasing_directory_construct):
(pas_biasing_directory_get_sharing_pool):
(pas_biasing_directory_did_create_delta):
(pas_biasing_directory_take_last_unused):
(pas_biasing_directory_did_use_index_slow):
(pas_biasing_directory_index_did_become_eligible):
* libpas/src/libpas/pas_biasing_directory.h: Added.
(pas_is_segregated_biasing_directory):
(pas_is_bitfit_biasing_directory):
(pas_biasing_directory_magazine_index):
(pas_biasing_directory_ownership_threshold):
(pas_biasing_directory_unused_span_size):
(pas_biasing_directory_did_use_index):
* libpas/src/libpas/pas_biasing_directory_inlines.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_unwrap_segregated_biasing_directory):
(pas_unwrap_bitfit_biasing_directory):
* libpas/src/libpas/pas_biasing_directory_kind.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_biasing_directory_kind_get_string):
* libpas/src/libpas/pas_bitfield_vector.h: Added.
(pas_bitfield_vector_get):
(pas_bitfield_vector_set):
* libpas/src/libpas/pas_bitfit_allocation_result.h: Added.
(pas_bitfit_allocation_result_create_success):
(pas_bitfit_allocation_result_create_failure):
(pas_bitfit_allocation_result_create_empty):
(pas_bitfit_allocation_result_create_need_to_lock_commit_lock):
* libpas/src/libpas/pas_bitfit_allocator.c: Added.
(pas_bitfit_allocator_commit_view):
(pas_bitfit_allocator_finish_failing):
* libpas/src/libpas/pas_bitfit_allocator.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_bitfit_allocator_inlines.h: Added.
(pas_bitfit_allocator_reset):
(pas_bitfit_allocator_assert_reset):
(pas_bitfit_allocator_try_allocate):
* libpas/src/libpas/pas_bitfit_biasing_directory.c: Added.
(pas_bitfit_biasing_directory_create):
(pas_bitfit_biasing_directory_take_last_unused):
* libpas/src/libpas/pas_bitfit_biasing_directory.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_bitfit_directory.c: Added.
(pas_bitfit_directory_construct):
(pas_bitfit_directory_update_biasing_eligibility):
(pas_bitfit_directory_max_free_did_become_unprocessed):
(pas_bitfit_directory_max_free_did_become_unprocessed_unchecked):
(pas_bitfit_directory_max_free_did_become_empty_without_biasing_update):
(pas_bitfit_directory_max_free_did_become_empty):
(pas_bitfit_directory_get_first_free_view):
(pas_bitfit_directory_compute_summary):
(for_each_live_object_callback):
(pas_bitfit_directory_for_each_live_object):
* libpas/src/libpas/pas_bitfit_directory.h: Added.
(pas_bitfit_directory_size):
(pas_bitfit_directory_get_max_free_ptr):
(pas_bitfit_directory_get_max_free):
(pas_bitfit_directory_set_max_free_unchecked):
(pas_bitfit_directory_set_max_free_not_empty_impl):
(pas_bitfit_directory_set_processed_max_free):
(pas_bitfit_directory_set_unprocessed_max_free_unchecked):
(pas_bitfit_directory_set_empty_max_free):
(pas_bitfit_directory_set_unprocessed_max_free):
(pas_bitfit_directory_get_view_ptr):
(pas_bitfit_directory_get_view):
* libpas/src/libpas/pas_bitfit_directory_and_index.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_bitfit_directory_and_index_create):
* libpas/src/libpas/pas_bitfit_directory_inlines.h: Added.
(pas_bitfit_directory_get_global):
(pas_bitfit_directory_find_first_free_for_num_bits_iterate_callback):
(pas_bitfit_directory_find_first_free_for_num_bits):
(pas_bitfit_directory_find_first_free):
(pas_bitfit_directory_find_first_empty_iterate_callback):
(pas_bitfit_directory_find_first_empty):
* libpas/src/libpas/pas_bitfit_directory_kind.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_bitfit_directory_kind_get_string):
* libpas/src/libpas/pas_bitfit_global_directory.c: Added.
(pas_bitfit_global_directory_construct):
(pas_bitfit_global_directory_does_sharing):
(pas_bitfit_global_directory_get_use_epoch):
(pas_bitfit_global_directory_get_empty_bit_at_index):
(pas_bitfit_global_directory_set_empty_bit_at_index):
(pas_bitfit_global_directory_view_did_become_empty_at_index):
(pas_bitfit_global_directory_view_did_become_empty):
(pas_bitfit_global_directory_take_last_empty):
(pas_bitfit_global_directory_dump_reference):
(pas_bitfit_global_directory_dump_for_spectrum):
* libpas/src/libpas/pas_bitfit_global_directory.h: Added.
* libpas/src/libpas/pas_bitfit_global_size_class.c: Added.
(pas_bitfit_global_size_class_create):
(pas_bitfit_global_size_class_select_for_magazine):
* libpas/src/libpas/pas_bitfit_global_size_class.h: Added.
* libpas/src/libpas/pas_bitfit_heap.c: Added.
(pas_bitfit_heap_create):
(pas_bitfit_heap_select_variant):
(pas_bitfit_heap_ensure_global_size_class):
(pas_bitfit_heap_compute_summary):
(for_each_live_object_callback):
(pas_bitfit_heap_for_each_live_object):
* libpas/src/libpas/pas_bitfit_heap.h: Added.
(pas_bitfit_heap_get_directory):
* libpas/src/libpas/pas_bitfit_max_free.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_bitfit_page.c: Added.
(pas_bitfit_page_construct):
(pas_bitfit_page_get_config):
(pas_bitfit_page_log_bits):
(pas_bitfit_page_deallocation_did_fail):
(pas_bitfit_page_for_each_live_object):
(verify_for_each_object_callback):
(pas_bitfit_page_verify):
* libpas/src/libpas/pas_bitfit_page.h: Added.
(pas_bitfit_page_header_size):
(pas_bitfit_page_free_bits):
(pas_bitfit_page_object_end_bits):
(pas_bitfit_page_get_granule_use_counts):
(pas_bitfit_page_offset_to_first_object):
(pas_bitfit_page_offset_to_end_of_last_object):
(pas_bitfit_page_payload_size):
(pas_bitfit_page_for_boundary):
(pas_bitfit_page_for_boundary_or_null):
(pas_bitfit_page_for_boundary_unchecked):
(pas_bitfit_page_boundary):
(pas_bitfit_page_boundary_or_null):
(pas_bitfit_page_for_address_and_page_config):
(pas_bitfit_page_testing_verify):
* libpas/src/libpas/pas_bitfit_page_config.h: Added.
(pas_bitfit_page_config_is_enabled):
(pas_bitfit_page_config_num_alloc_bits):
(pas_bitfit_page_config_num_alloc_words):
(pas_bitfit_page_config_num_alloc_words64):
(pas_bitfit_page_config_num_alloc_bit_bytes):
(pas_bitfit_page_config_byte_offset_for_object_bits):
(pas_bitfit_page_config_uses_subpages):
* libpas/src/libpas/pas_bitfit_page_config_inlines.h: Added.
* libpas/src/libpas/pas_bitfit_page_config_kind.c: Added.
(pas_bitfit_page_config_kind_for_each):
* libpas/src/libpas/pas_bitfit_page_config_kind.def: Added.
* libpas/src/libpas/pas_bitfit_page_config_kind.h: Added.
(pas_bitfit_page_config_kind_get_string):
(pas_bitfit_page_config_kind_get_config):
* libpas/src/libpas/pas_bitfit_page_config_utils.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_bitfit_page_config_utils_inlines.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_bitfit_page_config_variant.h: Added.
(pas_bitfit_page_config_variant_get_string):
(pas_bitfit_page_config_variant_get_capitalized_string):
* libpas/src/libpas/pas_bitfit_page_inlines.h: Added.
(pas_bitfit_page_compute_offset):
(pas_bitfit_page_allocation_satisfies_alignment):
(pas_bitfit_page_allocation_commit_granules_or_reloop):
(pas_bitfit_page_finish_allocation):
(pas_bitfit_page_allocate):
(pas_bitfit_page_deallocate_with_page_impl_mode_get_string):
(pas_bitfit_page_deallocate_with_page_impl):
(pas_bitfit_page_deallocate_with_page):
(pas_bitfit_page_deallocate):
(pas_bitfit_page_get_allocation_size_with_page):
(pas_bitfit_page_get_allocation_size):
(pas_bitfit_page_shrink_with_page):
(pas_bitfit_page_shrink):
* libpas/src/libpas/pas_bitfit_size_class.c: Added.
(pas_bitfit_size_class_find_insertion_point):
(pas_bitfit_size_class_construct):
(pas_bitfit_size_class_create):
(pas_bitfit_size_class_get_first_free_view):
* libpas/src/libpas/pas_bitfit_size_class.h: Added.
* libpas/src/libpas/pas_bitfit_view.c: Added.
(pas_bitfit_view_create):
(pas_bitfit_view_lock_ownership_lock_slow):
(pas_bitfit_view_note_nonemptiness):
(did_become_empty_for_bits):
(pas_bitfit_view_note_full_emptiness):
(pas_bitfit_view_note_partial_emptiness):
(pas_bitfit_view_note_max_free):
(compute_summary):
(pas_bitfit_view_compute_summary):
(for_each_live_object_callback):
(for_each_live_object):
(pas_bitfit_view_for_each_live_object):
* libpas/src/libpas/pas_bitfit_view.h: Added.
(pas_bitfit_view_lock_ownership_lock):
* libpas/src/libpas/pas_bitfit_view_and_index.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_bitfit_view_and_index_create):
(pas_bitfit_view_and_index_create_empty):
* libpas/src/libpas/pas_bitfit_view_inlines.h: Added.
(pas_bitfit_view_current_directory_and_index):
(pas_bitfit_view_current_directory):
(pas_bitfit_view_index_in_current):
(pas_bitfit_view_is_empty):
* libpas/src/libpas/pas_bitvector.h: Added.
(pas_bitvector_get_from_word):
(pas_bitvector_get):
(pas_bitvector_get_from_one_word):
(pas_backward_bitvector_get):
(pas_bitvector_set_in_word):
(pas_bitvector_set):
(pas_bitvector_set_in_one_word):
(pas_bitvector_set_atomic_in_word):
(pas_bitvector_set_atomic):
(pas_backward_bitvector_set):
(pas_bitvector_find_first_set):
(pas_bitvector_for_each_set_bit):
(pas_bitvector64_set_range):
* libpas/src/libpas/pas_bootstrap_free_heap.c: Copied from Source/WTF/wtf/FastTLS.h.
(bootstrap_source_allocate_aligned):
(initialize_config):
* libpas/src/libpas/pas_bootstrap_free_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_bootstrap_heap_page_provider.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_bootstrap_heap_page_provider):
* libpas/src/libpas/pas_bootstrap_heap_page_provider.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_cares_about_size_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_cartesian_tree.h: Added.
(pas_cartesian_tree_node_child_ptr):
(pas_cartesian_tree_node_is_null_constrained):
(pas_cartesian_tree_node_minimum):
(pas_cartesian_tree_node_minimum_constrained):
(pas_cartesian_tree_node_maximum):
(pas_cartesian_tree_node_maximum_constrained):
(pas_cartesian_tree_node_successor):
(pas_cartesian_tree_node_successor_constrained):
(pas_cartesian_tree_node_predecessor):
(pas_cartesian_tree_node_predecessor_constrained):
(pas_cartesian_tree_node_reset):
(pas_cartesian_tree_construct):
(pas_cartesian_tree_node_find_exact):
(pas_cartesian_tree_find_exact):
(pas_cartesian_tree_node_find_least_greater_than_or_equal):
(pas_cartesian_tree_find_least_greater_than_or_equal):
(pas_cartesian_tree_node_find_least_greater_than):
(pas_cartesian_tree_find_least_greater_than):
(pas_cartesian_tree_node_find_greatest_less_than_or_equal):
(pas_cartesian_tree_find_greatest_less_than_or_equal):
(pas_cartesian_tree_node_find_greatest_less_than):
(pas_cartesian_tree_find_greatest_less_than):
(pas_cartesian_tree_minimum):
(pas_cartesian_tree_minimum_constrained):
(pas_cartesian_tree_maximum):
(pas_cartesian_tree_maximum_constrained):
(pas_cartesian_tree_is_empty):
(pas_cartesian_tree_insert):
(pas_cartesian_tree_remove):
(pas_cartesian_tree_validate_recurse):
(pas_cartesian_tree_validate):
(pas_cartesian_tree_size):
* libpas/src/libpas/pas_coalign.c: Added.
(formal_mod):
(ceiling_div):
(pas_coalign_one_sided):
(pas_coalign):
* libpas/src/libpas/pas_coalign.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_coalign_empty_result):
(pas_coalign_result_create):
* libpas/src/libpas/pas_commit_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_commit_mode_get_string):
* libpas/src/libpas/pas_commit_span.c: Added.
(pas_commit_span_construct):
(pas_commit_span_add_to_change):
(pas_commit_span_add_unchanged):
(commit):
(pas_commit_span_add_unchanged_and_commit):
(decommit):
(pas_commit_span_add_unchanged_and_decommit):
* libpas/src/libpas/pas_commit_span.h: Added.
* libpas/src/libpas/pas_compact_atomic_allocator_index_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_biasing_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_bitfit_biasing_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_bitfit_global_size_class_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_bitfit_heap_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_bitfit_size_class_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_bitfit_view_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_enumerable_range_list_chunk_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_page_sharing_pool_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_ptr.h: Added.
* libpas/src/libpas/pas_compact_atomic_segregated_exclusive_view_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_segregated_global_size_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_segregated_heap_page_sharing_pools_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_segregated_partial_view_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_segregated_view.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_thread_local_cache_layout_node.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_atomic_unsigned_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_biasing_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_bitfit_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_bitfit_global_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_bitfit_view_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_bootstrap_free_heap.c: Copied from Source/WTF/wtf/FastTLS.h.
(compact_bootstrap_source_allocate_aligned):
(initialize_config):
* libpas/src/libpas/pas_compact_bootstrap_free_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_cartesian_tree_node_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_heap_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_heap_reservation.c: Added.
(pas_compact_heap_reservation_try_allocate):
* libpas/src/libpas/pas_compact_heap_reservation.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_large_utility_free_heap.c: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_large_utility_free_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_page_granule_use_count_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_ptr.h: Added.
* libpas/src/libpas/pas_compact_segregated_biasing_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_segregated_global_size_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_segregated_heap_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_segregated_shared_page_directory_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_segregated_shared_view_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_segregated_view.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_skip_list_node_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_skip_list_node_ptr_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_subpage_map_entry_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_tagged_atomic_ptr.h: Added.
* libpas/src/libpas/pas_compact_tagged_page_granule_use_count_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_tagged_ptr.h: Added.
* libpas/src/libpas/pas_compact_tagged_unsigned_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compact_unsigned_ptr.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_compute_summary_object_callbacks.c: Added.
(pas_compute_summary_live_object_callback):
(pas_compute_summary_live_object_callback_without_physical_sharing):
(config):
(pas_compute_summary_dead_object_callback):
(pas_compute_summary_dead_object_callback_without_physical_sharing):
* libpas/src/libpas/pas_compute_summary_object_callbacks.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_config.h: Added.
* libpas/src/libpas/pas_config_prefix.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_count_lookup_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_count_lookup_mode_get_string):
* libpas/src/libpas/pas_create_basic_heap_page_caches_with_reserved_memory.c: Added.
(pas_create_basic_heap_page_caches_with_reserved_memory):
* libpas/src/libpas/pas_create_basic_heap_page_caches_with_reserved_memory.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_deallocate.c: Added.
(pas_try_deallocate_known_large):
(pas_deallocate_known_large):
(pas_try_deallocate_slow):
(deallocate_segregated):
(pas_try_deallocate_slow_no_cache):
* libpas/src/libpas/pas_deallocate.h: Added.
(pas_deallocate_known_segregated_impl):
(pas_deallocate_known_segregated):
(pas_try_deallocate_not_small):
(pas_try_deallocate_impl):
(pas_try_deallocate):
(pas_deallocate):
* libpas/src/libpas/pas_deallocation_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_deallocation_mode_get_string):
* libpas/src/libpas/pas_deallocator.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_deallocator_scavenge_action.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_deallocator_scavenge_action_get_string):
* libpas/src/libpas/pas_debug_heap.h: Added.
(pas_debug_heap_is_enabled):
(pas_debug_heap_malloc):
(pas_debug_heap_memalign):
(pas_debug_heap_realloc):
(pas_debug_heap_free):
* libpas/src/libpas/pas_debug_spectrum.c: Added.
(pas_debug_spectrum_add):
(pas_debug_spectrum_dump):
(pas_debug_spectrum_reset):
* libpas/src/libpas/pas_debug_spectrum.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_deferred_decommit_log.c: Added.
(pas_deferred_decommit_log_construct):
(pas_deferred_decommit_log_destruct):
(already_holds_lock):
(pas_deferred_decommit_log_lock_for_adding):
(pas_deferred_decommit_log_add):
(pas_deferred_decommit_log_add_already_locked):
(pas_deferred_decommit_log_add_maybe_locked):
(pas_deferred_decommit_log_unlock_after_aborted_add):
(decommit_all):
(pas_deferred_decommit_log_decommit_all):
(pas_deferred_decommit_log_pretend_to_decommit_all):
* libpas/src/libpas/pas_deferred_decommit_log.h: Added.
* libpas/src/libpas/pas_designated_intrinsic_heap.c: Added.
(set_up_range):
(pas_designated_intrinsic_heap_initialize):
* libpas/src/libpas/pas_designated_intrinsic_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_designated_intrinsic_heap_inlines.h: Added.
(pas_designated_intrinsic_heap_num_allocator_indices):
(pas_designated_index_result_create_failure):
(pas_designated_index_result_create_success):
(pas_designated_intrinsic_heap_num_designated_indices):
(pas_designated_intrinsic_heap_designated_index):
* libpas/src/libpas/pas_dyld_state.c: Added.
(pas_dyld_is_libsystem_initialized):
* libpas/src/libpas/pas_dyld_state.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_dynamic_primitive_heap_map.c: Added.
(pas_dynamic_primitive_heap_map_find_slow):
* libpas/src/libpas/pas_dynamic_primitive_heap_map.h: Added.
(pas_dynamic_primitive_heap_map_heaps_for_size_table_entry_create_empty):
(pas_dynamic_primitive_heap_map_heaps_for_size_table_entry_create_deleted):
(pas_dynamic_primitive_heap_map_heaps_for_size_table_entry_is_empty_or_deleted):
(pas_dynamic_primitive_heap_map_heaps_for_size_table_entry_is_empty):
(pas_dynamic_primitive_heap_map_heaps_for_size_table_entry_is_deleted):
(pas_dynamic_primitive_heap_map_heaps_for_size_table_entry_get_key):
(pas_dynamic_primitive_heap_map_heaps_for_size_table_key_get_hash):
(pas_dynamic_primitive_heap_map_heaps_for_size_table_key_is_equal):
(pas_dynamic_primitive_heap_map_hash):
(pas_dynamic_primitive_heap_map_find):
* libpas/src/libpas/pas_ensure_heap_forced_into_reserved_memory.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_ensure_heap_forced_into_reserved_memory):
* libpas/src/libpas/pas_ensure_heap_forced_into_reserved_memory.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_ensure_heap_with_page_caches.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_ensure_heap_with_page_caches):
* libpas/src/libpas/pas_ensure_heap_with_page_caches.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_enumerable_page_malloc.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_enumerable_page_malloc_try_allocate_without_deallocating_padding):
* libpas/src/libpas/pas_enumerable_page_malloc.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_enumerable_range_list.c: Added.
(pas_enumerable_range_list_append):
(pas_enumerable_range_list_iterate):
(pas_enumerable_range_list_iterate_remote):
* libpas/src/libpas/pas_enumerable_range_list.h: Added.
* libpas/src/libpas/pas_enumerate_bitfit_heaps.c: Added.
(view_callback):
(enumerate_bitfit_directory):
(enumerate_bitfit_heap_callback):
(pas_enumerate_bitfit_heaps):
* libpas/src/libpas/pas_enumerate_bitfit_heaps.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_enumerate_initially_unaccounted_pages.c: Added.
(range_list_iterate_add_unaccounted_callback):
(range_list_iterate_exclude_accounted_callback):
(pas_enumerate_initially_unaccounted_pages):
* libpas/src/libpas/pas_enumerate_initially_unaccounted_pages.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_enumerate_large_heaps.c: Added.
(range_list_iterate_add_large_payload_callback):
(record_span):
(large_map_hashtable_entry_callback):
(small_large_map_hashtable_entry_callback):
(tiny_large_map_second_level_hashtable_entry_callback):
(tiny_large_map_hashtable_entry_callback):
(pas_enumerate_large_heaps):
* libpas/src/libpas/pas_enumerate_large_heaps.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_enumerate_segregated_heaps.c: Added.
(local_allocator_map_entry_create_empty):
(local_allocator_map_entry_create_deleted):
(local_allocator_map_entry_is_empty_or_deleted):
(local_allocator_map_entry_is_empty):
(local_allocator_map_entry_is_deleted):
(local_allocator_map_entry_get_key):
(local_allocator_map_key_get_hash):
(local_allocator_map_key_is_equal):
(for_each_view):
(collect_shared_page_directories_shared_page_directory_callback):
(collect_shared_page_directories_heap_callback):
(record_page_payload_and_meta):
(record_page_objects):
(enumerate_exclusive_view):
(enumerate_shared_view):
(enumerate_partial_view):
(shared_page_directory_view_callback):
(size_directory_view_callback):
(enumerate_segregated_heap_callback):
(consider_allocator):
(pas_enumerate_segregated_heaps):
* libpas/src/libpas/pas_enumerate_segregated_heaps.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_enumerate_unaccounted_pages_as_meta.c: Added.
(pas_enumerate_unaccounted_pages_as_meta):
* libpas/src/libpas/pas_enumerate_unaccounted_pages_as_meta.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_enumerator.c: Added.
(allocate):
(deallocate):
(pas_enumerator_create):
(pas_enumerator_destroy):
(pas_enumerator_allocate):
(pas_enumerator_read_compact):
(pas_enumerator_read):
(pas_enumerator_add_unaccounted_pages):
(pas_enumerator_exclude_accounted_page):
(pas_enumerator_exclude_accounted_pages):
(pas_enumerator_record):
(record_payload_span):
(pas_enumerator_record_page_payload_and_meta):
(pas_enumerator_for_each_heap):
(pas_enumerator_enumerate_all):
* libpas/src/libpas/pas_enumerator.h: Added.
(pas_enumerator_record_kind_get_string):
* libpas/src/libpas/pas_enumerator_internal.h: Added.
* libpas/src/libpas/pas_enumerator_region.c: Added.
(pas_enumerator_region_allocate):
(pas_enumerator_region_destroy):
* libpas/src/libpas/pas_enumerator_region.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_epoch.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_get_epoch):
* libpas/src/libpas/pas_epoch.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_exclusive_view_template_memo_table.c: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_exclusive_view_template_memo_table.h: Added.
(pas_exclusive_view_template_memo_key_create):
(pas_exclusive_view_template_memo_entry_create_empty):
(pas_exclusive_view_template_memo_entry_create_deleted):
(pas_exclusive_view_template_memo_entry_is_empty_or_deleted):
(pas_exclusive_view_template_memo_entry_is_empty):
(pas_exclusive_view_template_memo_entry_is_deleted):
(pas_exclusive_view_template_memo_entry_get_key):
(pas_exclusive_view_template_memo_key_get_hash):
(pas_exclusive_view_template_memo_key_is_equal):
* libpas/src/libpas/pas_extended_gcd.c: Added.
(pas_extended_gcd):
* libpas/src/libpas/pas_extended_gcd.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_fast_large_free_heap.c: Added.
(key_compare_callback):
(get_x_key_callback):
(get_y_key_callback):
(initialize_cartesian_config):
(pas_fast_large_free_heap_construct):
(insert_node):
(remove_node):
(dump_heap):
(fast_find_first):
(fast_find_by_end):
(fast_read_cursor):
(fast_write_cursor):
(fast_merge):
(fast_remove):
(fast_append):
(fast_commit):
(fast_dump):
(fast_add_mapped_bytes):
(initialize_generic_heap_config):
(pas_fast_large_free_heap_try_allocate):
(pas_fast_large_free_heap_deallocate):
(pas_fast_large_free_heap_for_each_free):
(pas_fast_large_free_heap_get_num_free_bytes):
(pas_fast_large_free_heap_validate):
(pas_fast_large_free_heap_dump_to_printf):
* libpas/src/libpas/pas_fast_large_free_heap.h: Added.
(pas_fast_large_free_heap_get_num_mapped_bytes):
* libpas/src/libpas/pas_fast_megapage_cache.c: Added.
(table_set_by_index):
(pas_fast_megapage_cache_try_allocate):
* libpas/src/libpas/pas_fast_megapage_cache.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_fast_megapage_kind.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_fast_megapage_kind_get_string):
* libpas/src/libpas/pas_fast_megapage_table.c: Added.
(pas_fast_megapage_table_initialize_static):
(pas_fast_megapage_table_set_by_index):
* libpas/src/libpas/pas_fast_megapage_table.h: Added.
(pas_fast_megapage_table_get_by_index):
(pas_fast_megapage_table_get):
* libpas/src/libpas/pas_fast_path_allocation_result.h: Added.
(pas_fast_path_allocation_result_create):
(pas_fast_path_allocation_result_create_need_slow):
(pas_fast_path_allocation_result_create_out_of_memory):
(pas_fast_path_allocation_result_create_success):
(pas_fast_path_allocation_result_from_allocation_result):
(pas_fast_path_allocation_result_to_allocation_result):
* libpas/src/libpas/pas_fast_path_allocation_result_kind.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_fast_path_allocation_result_kind_get_string):
* libpas/src/libpas/pas_fast_tls.h: Added.
* libpas/src/libpas/pas_fd_stream.c: Copied from Source/WTF/wtf/FastTLS.h.
(fd_stream_vprintf):
(pas_fd_stream_vprintf):
* libpas/src/libpas/pas_fd_stream.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_first_level_tiny_large_map_entry.h: Added.
(pas_first_level_tiny_large_map_entry_create_empty):
(pas_first_level_tiny_large_map_entry_create_deleted):
(pas_first_level_tiny_large_map_entry_is_empty_or_deleted):
(pas_first_level_tiny_large_map_entry_is_empty):
(pas_first_level_tiny_large_map_entry_is_deleted):
(pas_first_level_tiny_large_map_entry_get_key):
(pas_first_level_tiny_large_map_key_get_hash):
(pas_first_level_tiny_large_map_key_is_equal):
* libpas/src/libpas/pas_found_bit_index.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_found_bit_index_create_empty):
(pas_found_bit_index_create):
* libpas/src/libpas/pas_found_index.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_found_index_create_empty):
(pas_found_index_create):
(pas_found_index_create_unsuccessful):
* libpas/src/libpas/pas_free_granules.c: Added.
(pas_free_granules_compute_and_mark_decommitted):
(pas_free_granules_unmark_decommitted):
(pas_free_granules_decommit_after_locking_range):
* libpas/src/libpas/pas_free_granules.h: Added.
(pas_free_granules_is_free):
* libpas/src/libpas/pas_free_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_free_range_kind.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_free_range_kind_get_string):
* libpas/src/libpas/pas_full_alloc_bits.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_full_alloc_bits_create_empty):
(pas_full_alloc_bits_create):
* libpas/src/libpas/pas_full_alloc_bits_inlines.h: Added.
(pas_full_alloc_bits_create_for_exclusive):
(pas_full_alloc_bits_create_for_partial):
(pas_full_alloc_bits_create_for_view_and_directory):
(pas_full_alloc_bits_create_for_view):
* libpas/src/libpas/pas_generic_large_free_heap.h: Added.
(pas_generic_large_free_heap_merge_physical):
(pas_generic_large_free_heap_try_allocate_test_allocation_candidate):
(pas_generic_large_free_heap_try_allocate):
* libpas/src/libpas/pas_get_allocation_size.h: Added.
(pas_get_allocation_size):
* libpas/src/libpas/pas_get_heap.h: Added.
(pas_get_heap_known_segregated):
(pas_get_heap):
* libpas/src/libpas/pas_get_object_kind.h: Added.
(pas_get_object_kind):
* libpas/src/libpas/pas_get_page_base.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_get_page_base):
* libpas/src/libpas/pas_has_object.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_has_object):
* libpas/src/libpas/pas_hashtable.h: Added.
* libpas/src/libpas/pas_heap.c: Added.
(pas_heap_create):
(pas_heap_get_type_size):
(pas_heap_get_num_free_bytes):
(for_each_live_object_small_object_callback):
(for_each_live_object_large_object_callback):
(pas_heap_for_each_live_object):
(pas_heap_compute_summary):
(pas_heap_reset_heap_ref):
(pas_heap_ensure_size_directory_for_count_slow):
* libpas/src/libpas/pas_heap.h: Added.
(pas_heap_for_large_heap):
(pas_heap_for_segregated_heap):
* libpas/src/libpas/pas_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_heap_config_activate):
* libpas/src/libpas/pas_heap_config.h: Added.
(pas_heap_config_segregated_page_config_ptr_for_variant):
(pas_heap_config_bitfit_page_config_ptr_for_variant):
(pas_heap_config_segregated_page_config_for_variant):
(pas_heap_config_bitfit_page_config_for_variant):
* libpas/src/libpas/pas_heap_config_inlines.h: Added.
* libpas/src/libpas/pas_heap_config_kind.c: Added.
(pas_heap_config_kind_for_each):
* libpas/src/libpas/pas_heap_config_kind.def: Added.
* libpas/src/libpas/pas_heap_config_kind.h: Added.
(pas_heap_config_kind_get_string):
(pas_heap_config_kind_get_config):
(pas_heap_config_kind_is_active):
* libpas/src/libpas/pas_heap_config_utils.c: Added.
(pas_heap_config_utils_null_activate):
(pas_heap_config_utils_for_each_shared_page_directory):
(pas_heap_config_utils_for_each_shared_page_directory_remote):
(pas_heap_config_utils_allocate_aligned):
(pas_heap_config_utils_prepare_to_enumerate):
* libpas/src/libpas/pas_heap_config_utils.h: Added.
* libpas/src/libpas/pas_heap_config_utils_inlines.h: Added.
* libpas/src/libpas/pas_heap_for_config.c: Added.
(pas_heap_for_config_allocate):
(pas_heap_for_page_config_kind_allocate):
(pas_heap_for_page_config_allocate):
(pas_heap_for_config_allocate_with_alignment):
(pas_heap_for_page_config_allocate_with_alignment):
(pas_heap_for_config_allocate_with_manual_alignment):
(pas_heap_for_page_config_kind_allocate_with_manual_alignment):
(pas_heap_for_page_config_allocate_with_manual_alignment):
(pas_heap_for_config_deallocate):
(pas_heap_for_page_config_kind_deallocate):
(pas_heap_for_page_config_deallocate):
* libpas/src/libpas/pas_heap_for_config.h: Added.
* libpas/src/libpas/pas_heap_inlines.h: Added.
(pas_heap_ensure_size_directory_for_count):
* libpas/src/libpas/pas_heap_kind.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_heap_kind_get_string):
* libpas/src/libpas/pas_heap_lock.c: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_heap_lock.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_heap_page_provider.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_heap_ref.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_ensure_heap_slow):
* libpas/src/libpas/pas_heap_ref.h: Added.
(pas_ensure_heap):
* libpas/src/libpas/pas_heap_ref_kind.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_heap_ref_kind_get_string):
* libpas/src/libpas/pas_heap_ref_prefix.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_heap_runtime_config.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_heap_summary.c: Added.
(pas_heap_summary_validate):
(pas_heap_summary_dump):
* libpas/src/libpas/pas_heap_summary.h: Added.
(pas_heap_summary_create_empty):
(pas_heap_summary_is_empty):
(pas_heap_summary_add):
(pas_heap_summary_committed_objects):
(pas_heap_summary_total):
(pas_heap_summary_fragmentation):
* libpas/src/libpas/pas_heap_table.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_heap_table_try_allocate_index):
* libpas/src/libpas/pas_heap_table.h: Added.
(pas_heap_table_has_index):
(pas_heap_table_get_index):
* libpas/src/libpas/pas_heap_table_state.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_heap_table_state_get_string):
* libpas/src/libpas/pas_immortal_heap.c: Added.
(bump_is_ok):
(pas_immortal_heap_allocate_with_manual_alignment):
(pas_immortal_heap_allocate_with_alignment):
(pas_immortal_heap_allocate):
(pas_immortal_heap_hold_lock_and_allocate):
(pas_immortal_heap_allocate_with_heap_lock_hold_mode):
(pas_immortal_heap_allocate_with_alignment_and_heap_lock_hold_mode):
* libpas/src/libpas/pas_immortal_heap.h: Added.
* libpas/src/libpas/pas_immutable_vector.h: Added.
* libpas/src/libpas/pas_internal_config.h: Added.
* libpas/src/libpas/pas_intrinsic_allocation_result.h: Added.
(pas_intrinsic_allocation_result_create_empty):
(pas_intrinsic_allocation_result_create):
(pas_intrinsic_allocation_result_identity):
(pas_intrinsic_allocation_result_zero):
(pas_intrinsic_allocation_result_set_errno):
(pas_intrinsic_allocation_result_crash_on_error):
* libpas/src/libpas/pas_intrinsic_heap_support.h: Added.
* libpas/src/libpas/pas_large_free.h: Added.
(pas_large_free_create_empty):
(pas_large_free_is_empty):
(pas_large_free_size):
(pas_large_free_offset_in_type_at_end):
* libpas/src/libpas/pas_large_free_heap_config.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_large_free_heap_declarations.def: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_large_free_heap_deferred_commit_log.c: Added.
(pas_large_free_heap_deferred_commit_log_construct):
(pas_large_free_heap_deferred_commit_log_destruct):
(pas_large_free_heap_deferred_commit_log_add):
(dump_large_commit):
(commit):
(commit_all):
(pas_large_free_heap_deferred_commit_log_commit_all):
(pas_large_free_heap_deferred_commit_log_pretend_to_commit_all):
* libpas/src/libpas/pas_large_free_heap_deferred_commit_log.h: Added.
* libpas/src/libpas/pas_large_free_heap_definitions.def: Added.
* libpas/src/libpas/pas_large_free_heap_helpers.c: Added.
(large_utility_aligned_allocator):
(initialize_config):
(pas_large_free_heap_helpers_try_allocate_with_alignment):
(pas_large_free_heap_helpers_deallocate):
(pas_large_free_heap_helpers_compute_summary):
* libpas/src/libpas/pas_large_free_heap_helpers.h: Added.
* libpas/src/libpas/pas_large_free_inlines.h: Added.
(pas_large_free_create_merged):
(pas_large_free_split):
(pas_large_free_allocation_candidate):
(pas_large_free_usable_space):
(pas_large_allocation_result_create_empty):
(pas_large_free_allocate):
(pas_large_free_create_merged_for_sure):
(pas_large_free_can_merge):
(pas_large_allocation_result_as_allocation_result):
* libpas/src/libpas/pas_large_free_visitor.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_large_heap.c: Added.
(pas_large_heap_construct):
(aligned_allocator):
(initialize_config):
(pas_large_heap_try_allocate):
(pas_large_heap_try_deallocate):
(pas_large_heap_try_shrink):
(pas_large_heap_shove_into_free):
(for_each_live_object_entry_callback):
(pas_large_heap_for_each_live_object):
(pas_large_heap_for_object):
(pas_large_heap_get_num_free_bytes):
(compute_summary_live_object_callback):
(pas_large_heap_compute_summary):
* libpas/src/libpas/pas_large_heap.h: Added.
* libpas/src/libpas/pas_large_heap_physical_page_sharing_cache.c: Added.
(large_aligned_allocator):
(pas_large_heap_physical_page_sharing_cache_construct):
(pas_large_heap_physical_page_sharing_cache_try_allocate_with_alignment):
* libpas/src/libpas/pas_large_heap_physical_page_sharing_cache.h: Added.
* libpas/src/libpas/pas_large_map.c: Added.
(pas_large_map_find):
(pas_large_map_add):
(pas_large_map_take):
(pas_large_map_for_each_entry):
* libpas/src/libpas/pas_large_map.h: Added.
* libpas/src/libpas/pas_large_map_entry.h: Added.
(pas_large_map_entry_create_empty):
(pas_large_map_entry_create_deleted):
(pas_large_map_entry_is_empty_or_deleted):
(pas_large_map_entry_is_empty):
(pas_large_map_entry_is_deleted):
(pas_large_map_entry_get_key):
(pas_large_map_key_get_hash):
(pas_large_map_key_is_equal):
* libpas/src/libpas/pas_large_sharing_pool.c: Added.
(node_compare_callback):
(inner_key_compare_callback):
(update_min_epoch):
(validate_min_heap):
(validate_node):
(validate_node_if_asserting_aggressively):
(create_node):
(create_and_insert):
(boot_tree):
(destroy_node):
(remove_from_min_heap):
(remove_and_destroy):
(predecessor):
(successor):
(states_match):
(is_eligible):
(belongs_in_min_heap):
(update_min_heap):
(split_node_and_get_right_impl):
(split_node_and_get_right):
(split_node_and_get_left):
(merge_if_possible):
(node_containing):
(min_node_for_range):
(max_node_for_range):
(splat_live_bytes):
(should_do_commit_stuff_to):
(splat_command_get_string):
(splat_command_get_free_mode):
(dump_large_commit):
(try_splat_impl):
(try_splat):
(splat):
(pas_large_sharing_pool_boot_free):
(pas_large_sharing_pool_free):
(pas_large_sharing_pool_allocate_and_commit):
(pas_large_sharing_pool_decommit_least_recently_used):
(pas_large_sharing_pool_validate):
(pas_large_sharing_pool_compute_summary):
(pas_large_sharing_pool_for_each):
* libpas/src/libpas/pas_large_sharing_pool.h: Added.
(pas_large_sharing_node_heap_compare):
(pas_large_sharing_node_heap_get_index):
(pas_large_sharing_node_heap_set_index):
* libpas/src/libpas/pas_large_sharing_pool_epoch_update_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_large_sharing_pool_epoch_update_mode_get_string):
* libpas/src/libpas/pas_large_utility_free_heap.c: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_large_utility_free_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_line_word_config.h: Added.
(pas_line_word_config_count_low_zeroes_8_bit):
(pas_line_word_config_count_high_zeroes_8_bit):
(pas_line_word_config_count_low_zeroes_16_bit):
(pas_line_word_config_count_high_zeroes_16_bit):
(pas_line_word_config_count_low_zeroes_32_bit):
(pas_line_word_config_count_high_zeroes_32_bit):
(pas_line_word_config_count_low_zeroes_64_bit):
(pas_line_word_config_count_high_zeroes_64_bit):
(pas_line_word_config_construct):
* libpas/src/libpas/pas_list_direction.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_list_direction_get_string):
(pas_list_direction_invert):
* libpas/src/libpas/pas_local_allocator.c: Added.
(pas_local_allocator_construct):
(pas_local_allocator_destruct):
(pas_local_allocator_reset):
(pas_local_allocator_move):
(pas_local_allocator_refill_with_bitfit):
(pas_local_allocator_finish_refill_with_bitfit):
(stop_impl):
(pas_local_allocator_stop):
(pas_local_allocator_scavenge):
* libpas/src/libpas/pas_local_allocator.h: Added.
(pas_local_allocator_is_null):
(pas_local_allocator_is_active):
(pas_local_allocator_has_bitfit):
(pas_local_allocator_get_bitfit):
(pas_local_allocator_page_boundary):
(pas_local_allocator_alignment):
* libpas/src/libpas/pas_local_allocator_config_kind.h: Added.
(pas_local_allocator_config_kind_is_primordial_partial):
(pas_local_allocator_config_kind_is_bitfit):
(pas_local_allocator_config_kind_create_normal):
(pas_local_allocator_config_kind_create_primordial_partial):
(pas_local_allocator_config_kind_create_bitfit):
(pas_local_allocator_config_kind_get_segregated_page_config_kind):
(pas_local_allocator_config_kind_get_bitfit_page_config_kind):
(pas_local_allocator_config_kind_get_string):
* libpas/src/libpas/pas_local_allocator_inlines.h: Added.
(pas_local_allocator_reset_impl):
(pas_local_allocator_set_up_bump):
(pas_local_allocator_scan_bits_to_set_up_use_counts_bits_source):
(pas_local_allocator_scan_bits_to_set_up_use_counts_bit_callback):
(pas_local_allocator_scan_bits_to_set_up_free_bits):
(pas_local_allocator_set_up_free_bits):
(pas_local_allocator_make_bump):
(pas_local_allocator_prepare_to_allocate):
(pas_local_allocator_set_up_primordial_bump):
(pas_local_allocator_start_allocating_in_primordial_partial_view):
(pas_local_allocator_bless_primordial_partial_view_before_stopping):
(pas_local_allocator_try_allocate_in_primordial_partial_view):
(pas_local_allocator_refill_with_known_config):
(pas_local_allocator_return_memory_to_page_bits_source):
(pas_local_allocator_return_memory_to_page_set_bit_callback):
(pas_local_allocator_return_memory_to_page):
(pas_local_allocator_try_allocate_with_free_bits):
(pas_local_allocator_try_allocate_inline_cases):
(pas_local_allocator_try_allocate_small_segregated_slow_impl):
(pas_local_allocator_try_allocate_small_segregated_slow):
(pas_local_allocator_try_allocate_out_of_line_cases):
(pas_local_allocator_try_allocate_slow_impl):
(pas_local_allocator_try_allocate_slow):
(pas_local_allocator_try_allocate):
* libpas/src/libpas/pas_local_allocator_line.h: Added.
(pas_local_allocator_line_fits_without_shift):
(pas_local_allocator_line_decode):
(pas_local_allocator_line_encode):
(pas_local_allocator_line_remaining):
(pas_local_allocator_line_set_remaining):
(pas_local_allocator_line_payload_end_delta):
(pas_local_allocator_line_set_payload_end_delta):
* libpas/src/libpas/pas_local_allocator_refill_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_local_allocator_result.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_local_allocator_result_create_failure):
(pas_local_allocator_result_create_success):
* libpas/src/libpas/pas_lock.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_lock_lock_slow):
* libpas/src/libpas/pas_lock.h: Added.
(pas_lock_construct):
(pas_lock_construct_disabled):
(pas_lock_lock):
(pas_lock_try_lock):
(pas_lock_unlock):
(pas_lock_assert_held):
(pas_lock_testing_assert_held):
(pas_lock_lock_with_mode):
(pas_lock_switch_with_mode):
(pas_lock_switch):
(pas_lock_lock_conditionally):
(pas_lock_unlock_conditionally):
(pas_lock_for_switch_conditionally):
(pas_lock_switch_conditionally):
* libpas/src/libpas/pas_lock_free_read_hashtable.h: Added.
(if):
* libpas/src/libpas/pas_lock_free_read_ptr_ptr_hashtable.c: Added.
(pas_lock_free_read_ptr_ptr_hashtable_set):
* libpas/src/libpas/pas_lock_free_read_ptr_ptr_hashtable.h: Added.
(pas_lock_free_read_ptr_ptr_hashtable_find):
(pas_lock_free_read_ptr_ptr_hashtable_size):
* libpas/src/libpas/pas_log.c: Added.
(pas_vlog_fd):
(pas_log_fd):
(pas_vlog):
(pas_log):
(pas_start_crash_logging):
* libpas/src/libpas/pas_log.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_magazine.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_magazine_create):
* libpas/src/libpas/pas_magazine.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_medium_megapage_cache.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_medium_megapage_cache_try_allocate):
* libpas/src/libpas/pas_medium_megapage_cache.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_megapage_cache.c: Added.
(megapage_cache_allocate_aligned):
(pas_megapage_cache_construct):
(pas_megapage_cache_try_allocate):
* libpas/src/libpas/pas_megapage_cache.h: Added.
* libpas/src/libpas/pas_min_heap.h: Added.
* libpas/src/libpas/pas_monotonic_time.c: Copied from Source/WTF/wtf/FastTLS.h.
(get_timebase_info):
(pas_get_current_monotonic_time_nanoseconds):
* libpas/src/libpas/pas_monotonic_time.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_mutation_count.h: Added.
(pas_mutation_count_start_mutating):
(pas_mutation_count_stop_mutating):
(pas_mutation_count_is_mutating):
(pas_mutation_count_matches):
(pas_mutation_count_depend):
* libpas/src/libpas/pas_object_kind.h: Added.
(pas_object_kind_get_string):
(pas_object_kind_for_segregated_variant):
(pas_object_kind_for_bitfit_variant):
* libpas/src/libpas/pas_object_size_mode.h: Added.
(pas_object_size_mode_get_string):
* libpas/src/libpas/pas_page_base.c: Added.
(pas_page_base_get_config):
(pas_page_base_get_granule_use_counts):
(pas_page_base_compute_committed_when_owned):
(pas_page_base_is_empty):
(pas_page_base_add_free_range):
* libpas/src/libpas/pas_page_base.h: Added.
(pas_page_base_construct):
(pas_page_base_get_kind):
(pas_page_base_get_config_kind):
(pas_page_base_is_segregated):
(pas_page_base_get_segregated):
(pas_page_base_is_bitfit):
(pas_page_base_get_bitfit):
(pas_page_base_index_of_object_at_offset_from_page_boundary):
(pas_page_base_object_offset_from_page_boundary_at_index):
(pas_page_base_boundary):
(pas_page_base_boundary_or_null):
(pas_page_base_for_boundary):
(pas_page_base_for_boundary_or_null):
(pas_page_base_boundary_for_address_and_page_config):
(pas_page_base_for_address_and_page_config):
* libpas/src/libpas/pas_page_base_config.h: Added.
(pas_page_base_config_min_align):
(pas_page_base_config_object_payload_end_offset_from_boundary):
(pas_page_base_config_num_granule_bytes):
(pas_page_base_config_get_config_kind):
(pas_page_base_config_is_segregated):
(pas_page_base_config_is_bitfit):
(pas_page_base_config_get_segregated):
(pas_page_base_config_get_bitfit):
* libpas/src/libpas/pas_page_base_config_inlines.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_page_base_config_is_utility):
* libpas/src/libpas/pas_page_base_config_utils.h: Added.
* libpas/src/libpas/pas_page_base_config_utils_inlines.h: Added.
* libpas/src/libpas/pas_page_base_inlines.h: Added.
(pas_page_base_free_granule_uses_in_range_action):
(pas_page_base_free_granule_uses_in_range):
* libpas/src/libpas/pas_page_config_kind.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_page_config_kind_get_string):
* libpas/src/libpas/pas_page_granule_use_count.h: Added.
(pas_page_granule_get_indices):
(pas_page_granule_for_each_use_in_range):
(pas_page_granule_use_count_increment):
(pas_page_granule_increment_uses_for_range):
* libpas/src/libpas/pas_page_header_placement_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_page_header_placement_mode_get_string):
* libpas/src/libpas/pas_page_header_table.c: Added.
(pas_page_header_table_add):
(pas_page_header_table_remove):
* libpas/src/libpas/pas_page_header_table.h: Added.
(pas_page_header_table_hash):
(pas_page_header_table_get_boundary_ptr):
(pas_page_header_table_get_boundary):
(pas_page_header_table_get_for_boundary):
(pas_page_header_table_get_for_address):
* libpas/src/libpas/pas_page_kind.h: Added.
(pas_page_kind_get_string):
(pas_page_kind_get_config_kind):
(pas_page_kind_get_segregated_variant):
(pas_page_kind_get_bitfit_variant):
* libpas/src/libpas/pas_page_malloc.c: Added.
(pas_page_malloc_alignment_slow):
(pas_page_malloc_alignment_shift_slow):
(pas_page_malloc_try_allocate_without_deallocating_padding):
(pas_page_malloc_commit):
(pas_page_malloc_decommit):
(pas_page_malloc_deallocate):
* libpas/src/libpas/pas_page_malloc.h: Added.
(pas_page_malloc_alignment):
(pas_page_malloc_alignment_shift):
* libpas/src/libpas/pas_page_sharing_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_page_sharing_mode_does_sharing):
(pas_page_sharing_mode_get_string):
* libpas/src/libpas/pas_page_sharing_participant.c: Added.
(pas_page_sharing_participant_create):
(pas_page_sharing_participant_get_payload):
(pas_page_sharing_participant_payload_construct):
(pas_page_sharing_participant_payload_with_use_epoch_construct):
(pas_page_sharing_participant_get_use_epoch):
(pas_page_sharing_participant_set_parent_pool):
(pas_page_sharing_participant_get_parent_pool):
(pas_page_sharing_participant_is_eligible):
(pas_page_sharing_participant_take_least_recently_used):
* libpas/src/libpas/pas_page_sharing_participant.h: Added.
(pas_page_sharing_participant_get_ptr):
(pas_page_sharing_participant_get_kind):
* libpas/src/libpas/pas_page_sharing_participant_kind.h: Added.
(pas_page_sharing_participant_kind_select_for_segregated_directory):
(pas_page_sharing_participant_kind_get_string):
* libpas/src/libpas/pas_page_sharing_pool.c: Added.
(verify_participants):
(verify_min_heap):
(dump_min_heap):
(pas_page_sharing_pool_construct):
(pas_page_sharing_pool_add_at_index):
(pas_page_sharing_pool_add):
(get_current_participant):
(take_from):
(pas_page_sharing_pool_take_least_recently_used):
(atomic_add_balance):
(pas_physical_page_sharing_pool_take):
(pas_physical_page_sharing_pool_scavenge):
(pas_physical_page_sharing_pool_take_later):
(pas_physical_page_sharing_pool_give_back):
(pas_physical_page_sharing_pool_take_for_page_config):
(pas_bias_page_sharing_pool_take):
(pas_page_sharing_pool_did_create_delta):
(pas_page_sharing_pool_verify):
(pas_page_sharing_pool_has_delta):
(pas_page_sharing_pool_has_current_participant):
* libpas/src/libpas/pas_page_sharing_pool.h: Added.
(pas_page_sharing_participant_compare):
(pas_page_sharing_participant_get_index):
(pas_page_sharing_participant_set_index):
(pas_page_sharing_pool_num_participants):
(pas_page_sharing_pool_get_participant):
* libpas/src/libpas/pas_page_sharing_pool_take_result.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_page_sharing_pool_take_result_get_string):
* libpas/src/libpas/pas_payload_reservation_page_list.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_payload_reservation_page_list_append):
* libpas/src/libpas/pas_payload_reservation_page_list.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_physical_memory_synchronization_style.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_physical_memory_synchronization_style_get_string):
* libpas/src/libpas/pas_physical_memory_transaction.c: Added.
(pas_physical_memory_transaction_construct):
(pas_physical_memory_transaction_begin):
(pas_physical_memory_transaction_end):
(pas_physical_memory_transaction_did_fail_to_acquire_lock):
* libpas/src/libpas/pas_physical_memory_transaction.h: Added.
* libpas/src/libpas/pas_primitive_heap_ref.c: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_primitive_heap_ref.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_promote_intrinsic_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_ptr_hash_map.h: Added.
(pas_ptr_hash_map_entry_create_empty):
(pas_ptr_hash_map_entry_create_deleted):
(pas_ptr_hash_map_entry_is_empty_or_deleted):
(pas_ptr_hash_map_entry_is_empty):
(pas_ptr_hash_map_entry_is_deleted):
(pas_ptr_hash_map_entry_get_key):
(pas_ptr_hash_map_key_get_hash):
(pas_ptr_hash_map_key_is_equal):
* libpas/src/libpas/pas_ptr_hash_set.h: Added.
(pas_ptr_hash_set_entry_create_empty):
(pas_ptr_hash_set_entry_create_deleted):
(pas_ptr_hash_set_entry_is_empty_or_deleted):
(pas_ptr_hash_set_entry_is_empty):
(pas_ptr_hash_set_entry_is_deleted):
(pas_ptr_hash_set_entry_get_key):
(pas_ptr_hash_set_key_get_hash):
(pas_ptr_hash_set_key_is_equal):
* libpas/src/libpas/pas_ptr_min_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_ptr_min_heap_compare):
(pas_ptr_min_heap_get_index):
(pas_ptr_min_heap_set_index):
* libpas/src/libpas/pas_ptr_worklist.c: Added.
(pas_ptr_worklist_construct):
(pas_ptr_worklist_destruct):
(pas_ptr_worklist_push):
(pas_ptr_worklist_pop):
* libpas/src/libpas/pas_ptr_worklist.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_race_test_hooks.c: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_race_test_hooks.h: Added.
(pas_race_test_hook_kind_get_string):
(pas_race_test_hook):
(pas_race_test_will_lock):
(pas_race_test_did_lock):
(pas_race_test_did_try_lock):
(pas_race_test_will_unlock):
* libpas/src/libpas/pas_random.c: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_random.h: Added.
(pas_get_random):
* libpas/src/libpas/pas_range.h: Added.
(pas_range_create):
(pas_range_create_empty):
(pas_range_create_forgiving):
(pas_range_is_empty):
(pas_range_size):
(pas_range_contains):
(pas_range_subsumes):
(pas_range_overlaps):
(pas_range_create_intersection):
(pas_range_compare):
* libpas/src/libpas/pas_range16.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_range16_create):
* libpas/src/libpas/pas_range_begin_min_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_range_begin_min_heap_compare):
(pas_range_begin_min_heap_get_index):
(pas_range_begin_min_heap_set_index):
* libpas/src/libpas/pas_range_locked_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_range_locked_mode_get_string):
* libpas/src/libpas/pas_range_min_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_range_compare_begin):
(pas_range_get_index):
(pas_range_set_index):
* libpas/src/libpas/pas_reallocate_free_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_reallocate_heap_teleport_rule.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_red_black_tree.c: Added.
(tree_insert):
(left_rotate):
(right_rotate):
(remove_fixup):
(pas_red_black_tree_insert):
(pas_red_black_tree_remove):
(pas_red_black_tree_size):
* libpas/src/libpas/pas_red_black_tree.h: Added.
(pas_red_black_tree_validate_enumerable):
(pas_red_black_tree_get_root):
(pas_red_black_tree_node_get_left):
(pas_red_black_tree_node_get_right):
(pas_red_black_tree_node_get_parent):
(pas_red_black_tree_node_get_color):
(pas_red_black_tree_set_root):
(pas_red_black_tree_node_set_left):
(pas_red_black_tree_node_set_right):
(pas_red_black_tree_node_set_parent):
(pas_red_black_tree_node_set_color):
(pas_red_black_tree_node_minimum):
(pas_red_black_tree_node_maximum):
(pas_red_black_tree_node_successor):
(pas_red_black_tree_node_predecessor):
(pas_red_black_tree_node_reset):
(pas_red_black_tree_construct):
(pas_red_black_tree_node_find_exact):
(pas_red_black_tree_find_exact):
(pas_red_black_tree_node_find_least_greater_than_or_equal):
(pas_red_black_tree_find_least_greater_than_or_equal):
(pas_red_black_tree_node_find_least_greater_than):
(pas_red_black_tree_find_least_greater_than):
(pas_red_black_tree_node_find_greatest_less_than_or_equal):
(pas_red_black_tree_find_greatest_less_than_or_equal):
(pas_red_black_tree_node_find_greatest_less_than):
(pas_red_black_tree_find_greatest_less_than):
(pas_red_black_tree_minimum):
(pas_red_black_tree_maximum):
(pas_red_black_tree_is_empty):
* libpas/src/libpas/pas_redundant_local_allocator_node.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_redundant_local_allocator_node_create):
* libpas/src/libpas/pas_redundant_local_allocator_node.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_reserved_memory_provider.c: Added.
(null_aligned_allocator):
(initialize_config):
(pas_reserved_memory_provider_construct):
(pas_reserved_memory_provider_try_allocate):
* libpas/src/libpas/pas_reserved_memory_provider.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_root.c: Added.
(count_static_heaps_callback):
(collect_static_heaps_callback):
(pas_root_construct):
(pas_root_create):
(default_reader):
(enumerator_reader):
(enumerator_recorder):
(pas_root_enumerate_for_libmalloc):
(pas_root_enumerate_for_libmalloc_with_root_after_zone):
(malloc_introspect_good_size):
(malloc_introspect_check):
(malloc_introspect_print):
(malloc_introspect_log):
(malloc_introspect_force_lock):
(malloc_introspect_force_unlock):
(malloc_introspect_statistics):
(pas_root_ensure_for_libmalloc_enumeration):
* libpas/src/libpas/pas_root.h: Added.
* libpas/src/libpas/pas_scavenger.c: Added.
(ensure_data_instance):
(get_time_in_milliseconds):
(timed_wait):
(scavenger_thread_main):
(pas_scavenger_did_create_eligible):
(pas_scavenger_notify_eligibility_if_needed):
(pas_scavenger_suspend):
(pas_scavenger_resume):
(pas_scavenger_clear_all_non_tlc_caches):
(pas_scavenger_clear_all_caches_except_remote_tlcs):
(pas_scavenger_clear_all_caches):
(pas_scavenger_decommit_free_memory):
(pas_scavenger_run_synchronously_now):
(pas_scavenger_perform_synchronous_operation):
* libpas/src/libpas/pas_scavenger.h: Added.
* libpas/src/libpas/pas_segmented_vector.h: Added.
* libpas/src/libpas/pas_segregated_biasing_directory.c: Added.
(pas_segregated_biasing_directory_create):
(take_first_eligible_loop_head_callback):
(take_first_eligible_create_new_view_callback):
(pas_segregated_biasing_directory_take_first_eligible):
(pas_segregated_biasing_directory_take_last_unused):
* libpas/src/libpas/pas_segregated_biasing_directory.h: Added.
(pas_segregated_biasing_directory_magazine_index):
* libpas/src/libpas/pas_segregated_biasing_view.c: Added.
(pas_segregated_biasing_view_create):
(pas_segregated_biasing_view_is_owned):
(pas_segregated_biasing_view_lock_ownership_lock):
(pas_segregated_biasing_view_should_table):
(pas_segregated_biasing_view_note_eligibility):
(pas_segregated_biasing_view_note_emptiness):
(pas_segregated_biasing_view_compute_summary):
(pas_segregated_biasing_view_is_eligible):
(pas_segregated_biasing_view_is_empty):
* libpas/src/libpas/pas_segregated_biasing_view.h: Added.
(pas_segregated_biasing_view_as_view):
(pas_segregated_biasing_view_as_ineligible_view):
(pas_segregated_biasing_view_as_view_non_null):
(pas_segregated_biasing_view_as_ineligible_view_non_null):
* libpas/src/libpas/pas_segregated_directory.c: Added.
(pas_segregated_directory_construct):
(pas_segregated_directory_get_data_slow):
(pas_segregated_directory_get_use_epoch):
(pas_segregated_directory_get_sharing_payload):
(pas_segregated_directory_minimize_first_eligible):
(pas_segregated_directory_update_first_eligible_after_search):
(pas_segregated_directory_view_did_become_eligible_at_index_without_biasing_update):
(pas_segregated_directory_view_did_become_eligible_at_index):
(pas_segregated_directory_view_did_become_eligible_without_biasing_update):
(pas_segregated_directory_view_did_become_eligible):
(maximize_last_empty):
(pas_segregated_directory_view_did_become_empty_at_index):
(pas_segregated_directory_view_did_become_empty):
(pas_segregated_directory_is_committed):
(pas_segregated_directory_num_committed_views):
(num_empty_views_should_consider_view_parallel):
(pas_segregated_directory_num_empty_views):
(pas_segregated_directory_update_last_empty_plus_one_after_search):
(pas_segregated_directory_append):
(pas_segregated_directory_compute_summary):
(pas_segregated_directory_num_empty_granules):
* libpas/src/libpas/pas_segregated_directory.h: Added.
(pas_segregated_directory_size):
(pas_segregated_directory_bits_get_by_mask):
(pas_segregated_directory_bits_set_by_mask):
(pas_segregated_directory_get_misc_bit):
(pas_segregated_directory_set_misc_bit):
(pas_segregated_directory_get_other_misc_bit):
(pas_segregated_directory_set_other_misc_bit):
(pas_segregated_directory_spoof_inline_segment):
(pas_segregated_directory_get_empty_bit):
(pas_segregated_directory_set_empty_bit):
(pas_segregated_directory_get_data):
(pas_segregated_directory_can_do_sharing):
(pas_segregated_directory_is_doing_sharing):
(pas_segregated_directory_data_try_get_sharing_payload):
(pas_segregated_directory_start_sharing_if_necessary):
(pas_segregated_directory_data_get_first_eligible_ptr):
(pas_segregated_directory_is_eligible):
(pas_segregated_directory_is_empty):
(pas_segregated_directory_is_tabled):
(pas_segregated_directory_get_first_eligible_impl):
(pas_segregated_directory_get_first_eligible):
(pas_segregated_directory_get_first_eligible_torn):
(pas_segregated_directory_watch_first_eligible):
(pas_segregated_directory_get_last_empty_plus_one_impl):
(pas_segregated_directory_get_last_empty_plus_one):
(pas_segregated_directory_get_last_empty_plus_one_value):
(pas_segregated_directory_watch_last_empty_plus_one):
(pas_segregated_directory_last_empty_plus_one):
(pas_segregated_directory_get):
* libpas/src/libpas/pas_segregated_directory_bit_reference.h: Added.
(pas_segregated_directory_bit_reference_create_null):
(pas_segregated_directory_bit_reference_create_inline):
(pas_segregated_directory_bit_reference_create_out_of_line):
(pas_segregated_directory_bit_reference_is_null):
(pas_segregated_directory_bit_reference_is_inline):
(pas_segregated_directory_bit_reference_is_out_of_line):
* libpas/src/libpas/pas_segregated_directory_first_eligible_kind.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_segregated_directory_find_eligible_kind_get_string):
* libpas/src/libpas/pas_segregated_directory_inlines.h: Added.
(pas_segregated_directory_iterate_iterate_callback):
(pas_segregated_directory_iterate_forward_iterate_callback):
(pas_segregated_directory_iterate_forward):
(pas_segregated_directory_iterate_backward_iterate_callback):
(pas_segregated_directory_iterate_backward):
(pas_segregated_directory_iterate_forward_to_take_first_eligible):
(pas_segregated_directory_iterate_backward_to_take_last_empty):
* libpas/src/libpas/pas_segregated_directory_kind.h: Added.
(pas_segregated_directory_kind_get_string):
* libpas/src/libpas/pas_segregated_exclusive_view.c: Added.
(pas_segregated_exclusive_view_create):
(pas_segregated_exclusive_view_should_table):
(pas_segregated_exclusive_ish_view_note_eligibility_impl):
(pas_segregated_exclusive_view_note_eligibility):
(pas_segregated_exclusive_view_note_emptiness):
(pas_segregated_exclusive_ish_view_compute_summary_impl):
(pas_segregated_exclusive_view_compute_summary):
(pas_segregated_exclusive_view_install_full_use_counts):
(pas_segregated_exclusive_view_is_eligible):
(pas_segregated_exclusive_view_is_empty):
* libpas/src/libpas/pas_segregated_exclusive_view.h: Added.
(pas_segregated_exclusive_view_as_view):
(pas_segregated_exclusive_view_as_ineligible_view):
(pas_segregated_exclusive_view_as_view_non_null):
(pas_segregated_exclusive_view_as_ineligible_view_non_null):
* libpas/src/libpas/pas_segregated_exclusive_view_inlines.h: Added.
(pas_segregated_exclusive_ish_view_did_start_allocating):
* libpas/src/libpas/pas_segregated_exclusive_view_ownership_kind.h: Added.
(pas_segregated_exclusive_view_ownership_kind_is_owned):
(pas_segregated_exclusive_view_ownership_kind_is_biased):
(pas_segregated_exclusive_view_ownership_kind_with_owned):
(pas_segregated_exclusive_view_ownership_kind_with_biased):
(pas_segregated_exclusive_view_ownership_kind_get_string):
* libpas/src/libpas/pas_segregated_global_size_directory.c: Added.
(pas_segregated_global_size_directory_create):
(pas_segregated_global_size_directory_ensure_data):
(pas_segregated_global_size_directory_get_extended_data):
(pas_segregated_global_size_directory_create_tlc_allocator):
(pas_segregated_global_size_directory_enable_exclusive_views):
(pas_segregated_global_size_directory_explode):
(pas_segregated_global_size_directory_select_allocator_slow):
(take_first_eligible_direct_loop_head_callback):
(take_first_eligible_direct_create_new_view_callback):
(pas_segregated_global_size_directory_take_first_eligible_direct):
(pas_segregated_global_size_directory_take_first_eligible):
(take_last_empty_should_consider_view_parallel):
(take_last_empty_consider_view):
(pas_segregated_global_size_directory_take_last_empty):
(pas_segregated_global_size_directory_for_object):
(pas_segregated_global_size_directory_get_allocator_from_tlc):
(pas_segregated_global_size_directory_compute_summary_for_unowned_exclusive):
(for_each_live_object_callback):
(pas_segregated_global_size_directory_for_each_live_object):
(pas_segregated_global_size_directory_local_allocator_size):
(pas_segregated_global_size_directory_num_allocator_indices):
(pas_segregated_global_size_directory_dump_reference):
(pas_segregated_global_size_directory_dump_for_spectrum):
* libpas/src/libpas/pas_segregated_global_size_directory.h: Added.
(pas_segregated_global_size_directory_as_view):
(pas_segregated_global_size_directory_alignment):
(pas_segregated_global_size_directory_contention_did_trigger_explosion):
(pas_segregated_global_size_directory_set_contention_did_trigger_explosion):
(pas_segregated_global_size_directory_has_tlc_allocator):
(pas_segregated_global_size_directory_are_exclusive_views_enabled):
(pas_segregated_global_size_directory_bias_sharing_pool):
* libpas/src/libpas/pas_segregated_global_size_directory_inlines.h: Added.
(pas_segregated_global_size_directory_select_allocator):
(pas_segregated_global_size_directory_local_allocator_size_for_null_config):
(pas_segregated_global_size_directory_local_allocator_size_for_config):
(pas_segregated_global_size_directory_num_allocator_indices_for_allocator_size):
(pas_segregated_global_size_directory_num_allocator_indices_for_config):
* libpas/src/libpas/pas_segregated_heap.c: Added.
(min_object_size_for_heap_config):
(max_count_for_page_config):
(max_object_size_for_page_config):
(max_small_count_for_heap_config):
(max_segregated_count_for_heap_config):
(max_bitfit_count_for_heap_config):
(max_count_for_heap_config):
(max_bitfit_object_size_for_heap_config):
(max_object_size_for_heap_config):
(pas_segregated_heap_construct):
(pas_segregated_heap_get_bitfit):
(medium_directory_tuple_for_index_impl):
(medium_directory_tuple_for_index_with_lock):
(pas_segregated_heap_medium_directory_tuple_for_index):
(pas_segregated_heap_medium_allocator_index_for_index):
(pas_segregated_heap_medium_size_directory_for_index):
(compute_small_index_upper_bound):
(ensure_count_lookup):
(pas_segregated_heap_ensure_allocator_index):
(compute_ideal_object_size):
(check_medium_directories):
(check_part_of_all_heaps_callback):
(check_part_of_all_segregated_heaps_callback):
(ensure_count_lookup_if_necessary):
(pas_segregated_heap_ensure_size_directory_for_count):
(pas_segregated_heap_get_num_free_bytes):
(pas_segregated_heap_for_each_global_size_directory):
(for_each_committed_size_directory_callback):
(pas_segregated_heap_for_each_committed_view):
(for_each_view_index_directory_callback):
(pas_segregated_heap_for_each_view_index):
(for_each_live_object_object_callback):
(for_each_live_object_directory_callback):
(for_each_live_object_bitfit_callback):
(pas_segregated_heap_for_each_live_object):
(num_committed_views_directory_callback):
(pas_segregated_heap_num_committed_views):
(num_empty_views_directory_callback):
(pas_segregated_heap_num_empty_views):
(num_empty_granules_directory_callback):
(pas_segregated_heap_num_empty_granules):
(num_views_directory_callback):
(pas_segregated_heap_num_views):
(compute_summary_directory_callback):
(pas_segregated_heap_compute_summary):
* libpas/src/libpas/pas_segregated_heap.h: Added.
(pas_segregated_heap_index_for_primitive_count):
(pas_segregated_heap_primitive_count_for_index):
(pas_segregated_heap_index_for_count):
(pas_segregated_heap_count_for_index):
(pas_segregated_heap_allocator_index_for_index):
(pas_segregated_heap_allocator_index_for_count_not_primitive):
* libpas/src/libpas/pas_segregated_heap_inlines.h: Added.
(pas_segregated_heap_size_directory_for_index):
(pas_segregated_heap_size_directory_for_count):
* libpas/src/libpas/pas_segregated_heap_lookup_kind.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_segregated_heap_page_sharing_mode.h: Added.
(pas_segregated_heap_page_sharing_mode_does_any_sharing):
(pas_segregated_heap_page_sharing_mode_does_virtual_sharing):
(pas_segregated_heap_page_sharing_mode_does_physical_sharing):
(pas_segregated_heap_page_sharing_mode_get_string):
* libpas/src/libpas/pas_segregated_page.c: Added.
(pas_segregated_page_switch_lock_slow):
(pas_segregated_page_switch_lock_and_rebias_to_magazine_while_ineligible_impl):
(pas_segregated_page_construct):
(pas_segregated_page_note_emptiness):
(commit_lock_for):
(pas_segregated_page_take_empty_granules):
(pas_segregated_page_take_physically):
(pas_segregated_page_commit_fully):
(verify_granules_live_object_callback):
(pas_segregated_page_verify_granules):
(pas_segregated_page_deallocation_did_fail):
(pas_segregated_page_get_num_empty_granules):
(pas_segregated_page_get_num_committed_granules):
(pas_segregated_page_get_config):
(pas_segregated_page_add_commit_range):
(pas_segregated_page_and_config_for_address_and_heap_config):
(pas_segregated_page_verify_num_non_empty_words):
* libpas/src/libpas/pas_segregated_page.h: Added.
(pas_segregated_page_header_size):
(pas_segregated_page_offset_from_page_boundary_to_first_object_for_hugging_mode):
(pas_segregated_page_offset_from_page_boundary_to_end_of_last_object_for_hugging_mode):
(pas_segregated_page_useful_object_payload_size_for_hugging_mode):
(pas_segregated_page_best_hugging_mode):
(pas_segregated_page_offset_from_page_boundary_to_first_object_exclusive):
(pas_segregated_page_offset_from_page_boundary_to_end_of_last_object_exclusive):
(pas_segregated_page_useful_object_payload_size):
(pas_segregated_page_number_of_objects):
(pas_segregated_page_bytes_dirtied_per_object):
(pas_segregated_page_get_granule_use_counts):
(pas_segregated_page_for_boundary):
(pas_segregated_page_for_boundary_or_null):
(pas_segregated_page_for_boundary_unchecked):
(pas_segregated_page_boundary):
(pas_segregated_page_boundary_or_null):
(pas_segregated_page_for_address_and_page_config):
(pas_segregated_page_is_allocated_with_page):
(pas_segregated_page_is_allocated):
(pas_segregated_page_for_address_and_heap_config):
* libpas/src/libpas/pas_segregated_page_and_config.h: Added.
(pas_segregated_page_and_config_create):
(pas_segregated_page_and_config_create_empty):
(pas_segregated_page_and_config_is_empty):
* libpas/src/libpas/pas_segregated_page_config.c: Added.
(pas_segregated_page_config_validate):
* libpas/src/libpas/pas_segregated_page_config.h: Added.
(pas_segregated_page_config_is_enabled):
(pas_segregated_page_config_min_align):
(pas_segregated_page_config_object_payload_end_offset_from_boundary):
(pas_segregated_page_config_num_alloc_words):
(pas_segregated_page_config_num_alloc_bytes):
(pas_segregated_page_config_get_kind):
(pas_segregated_page_config_kind_is_utility):
(pas_segregated_page_config_is_utility):
(pas_segregated_page_config_kind_heap_lock_hold_mode):
(pas_segregated_page_config_heap_lock_hold_mode):
* libpas/src/libpas/pas_segregated_page_config_inlines.h: Added.
* libpas/src/libpas/pas_segregated_page_config_kind.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_segregated_page_config_kind_for_each):
* libpas/src/libpas/pas_segregated_page_config_kind.def: Added.
* libpas/src/libpas/pas_segregated_page_config_kind.h: Added.
(pas_segregated_page_config_kind_get_string):
(pas_segregated_page_config_kind_get_config):
* libpas/src/libpas/pas_segregated_page_config_utils.h: Added.
(pas_segregated_page_config_verify_dealloc):
* libpas/src/libpas/pas_segregated_page_config_utils_inlines.h: Added.
* libpas/src/libpas/pas_segregated_page_config_variant.h: Added.
(pas_segregated_page_config_variant_get_string):
* libpas/src/libpas/pas_segregated_page_emptiness_kind.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_page_emptiness_kind_get_inverted):
(pas_page_emptiness_kind_get_string):
* libpas/src/libpas/pas_segregated_page_granule_use_count.h: Added.
(pas_segregated_page_granule_use_count_increment):
(pas_segregated_page_granule_for_each_use_in_range):
(pas_segregated_page_granule_increment_uses_for_range):
* libpas/src/libpas/pas_segregated_page_header_placement_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_segregated_page_header_placement_mode_get_string):
* libpas/src/libpas/pas_segregated_page_inlines.h: Added.
(pas_segregated_page_offset_from_page_boundary_to_first_object):
(pas_segregated_page_initialize_full_use_counts):
(pas_segregated_page_lock_with_unbias_not_utility):
(pas_segregated_page_lock_with_unbias):
(pas_segregated_page_lock):
(pas_segregated_page_unlock):
(pas_segregated_page_switch_lock_with_mode):
(pas_segregated_page_switch_lock):
(pas_segregated_page_switch_lock_and_rebias_to_magazine_while_ineligible):
(pas_segregated_page_deallocate_with_page):
(pas_segregated_page_deallocate):
(pas_segregated_page_qualifies_for_decommit):
(pas_segregated_page_get_directory_for_address_in_page):
(pas_segregated_page_get_directory_for_address_and_page_config):
(pas_segregated_page_get_object_size_for_address_in_page):
(pas_segregated_page_get_object_size_for_address_and_page_config):
* libpas/src/libpas/pas_segregated_partial_view.c: Added.
(pas_segregated_partial_view_create):
(pas_segregated_partial_view_note_eligibility):
(pas_segregated_partial_view_set_is_in_use_for_allocation):
(pas_segregated_partial_view_should_table):
(compute_summary):
(pas_segregated_partial_view_compute_summary):
(pas_segregated_partial_view_is_eligible):
* libpas/src/libpas/pas_segregated_partial_view.h: Added.
(pas_segregated_partial_view_as_view):
(pas_segregated_partial_view_as_view_non_null):
* libpas/src/libpas/pas_segregated_partial_view_inlines.h: Added.
(pas_segregated_partial_view_tell_shared_handle_for_word_general_case_source):
(pas_segregated_partial_view_tell_shared_handle_for_word_general_case_callback):
(pas_segregated_partial_view_tell_shared_handle_for_word_general_case):
(pas_segregated_partial_view_did_start_allocating):
* libpas/src/libpas/pas_segregated_shared_handle.c: Added.
(pas_segregated_shared_handle_create):
(pas_segregated_shared_handle_destroy):
(pas_segregated_shared_handle_note_emptiness):
* libpas/src/libpas/pas_segregated_shared_handle.h: Added.
(pas_segregated_shared_handle_num_views):
(pas_segregated_shared_handle_size):
(pas_segregated_shared_handle_as_view):
(pas_segregated_shared_handle_as_view_non_null):
* libpas/src/libpas/pas_segregated_shared_handle_inlines.h: Added.
(pas_segregated_shared_handle_partial_view_ptr_for_index):
(pas_segregated_shared_handle_partial_view_for_index):
(pas_segregated_shared_handle_partial_view_for_object):
* libpas/src/libpas/pas_segregated_shared_page_directory.c: Added.
(find_first_eligible_should_consider_view_parallel):
(find_first_eligible_consider_view):
(pas_segregated_shared_page_directory_find_first_eligible):
(take_last_empty_should_consider_view_parallel):
(switch_to_ownership):
(take_last_empty_consider_view):
(pas_segregated_shared_page_directory_take_last_empty):
(pas_segregated_shared_page_directory_dump_reference):
(pas_segregated_shared_page_directory_dump_for_spectrum):
* libpas/src/libpas/pas_segregated_shared_page_directory.h: Added.
* libpas/src/libpas/pas_segregated_shared_view.c: Added.
(pas_segregated_shared_view_create):
(pas_segregated_shared_view_commit_page):
(compute_summary_for_each_live_object_callback):
(compute_summary):
(pas_segregated_shared_view_compute_summary):
(pas_segregated_shared_view_is_empty):
* libpas/src/libpas/pas_segregated_shared_view.h: Added.
(pas_segregated_shared_view_as_view):
(pas_segregated_shared_view_as_view_non_null):
(pas_shared_view_computed_bump_result_create_empty):
(pas_segregated_shared_view_compute_initial_new_bump):
(pas_segregated_shared_view_can_bump):
(pas_segregated_shared_view_compute_new_bump):
(pas_segregated_shared_view_bump):
* libpas/src/libpas/pas_segregated_shared_view_inlines.h: Added.
(pas_segregated_shared_view_commit_page_if_necessary):
* libpas/src/libpas/pas_segregated_size_directory.c: Added.
(pas_segregated_size_directory_construct):
(for_each_live_object_object_callback):
(pas_segregated_size_directory_for_each_live_object):
(pas_segregated_size_directory_for_object):
* libpas/src/libpas/pas_segregated_size_directory.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_segregated_size_directory_inlines.h: Added.
(pas_segregated_size_directory_take_first_eligible_impl_should_consider_view_not_tabled_parallel):
(pas_segregated_size_directory_take_first_eligible_impl_should_consider_view_tabled_parallel):
(pas_segregated_size_directory_take_first_eligible_impl):
(pas_segregated_size_directory_get_global):
* libpas/src/libpas/pas_segregated_view.c: Added.
(pas_segregated_view_get_size_directory_slow):
(pas_segregated_view_get_global_size_directory_slow):
(pas_segregated_view_get_page_config_kind):
(pas_segregated_view_get_page_config):
(pas_segregated_view_get_index):
(pas_segregated_view_get_page_boundary):
(pas_segregated_view_get_page):
(pas_segregated_view_should_restart):
(pas_segregated_view_could_bump):
(pas_segregated_view_get_commit_lock):
(pas_segregated_view_get_ownership_lock):
(pas_segregated_view_is_owned):
(pas_segregated_view_should_table):
(pas_segregated_view_is_biased_exclusive):
(pas_segregated_view_lock_ownership_lock):
(pas_segregated_view_lock_ownership_lock_conditionally):
(pas_segregated_view_lock_ownership_lock_if_owned):
(pas_segregated_view_lock_ownership_lock_if_owned_conditionally):
(pas_segregated_view_unlock_ownership_lock):
(pas_segregated_view_unlock_ownership_lock_conditionally):
(pas_segregated_view_is_primordial_partial):
(pas_segregated_view_note_eligibility):
(pas_segregated_view_note_emptiness):
(for_each_live_object):
(pas_segregated_view_for_each_live_object):
(should_be_eligible):
(pas_segregated_view_should_be_eligible):
(pas_segregated_view_for_object):
(pas_segregated_view_compute_summary):
(pas_segregated_view_is_eligible):
(pas_segregated_view_is_eligible_or_biased):
(is_payload_empty_callback):
(pas_segregated_view_is_payload_empty):
(pas_segregated_view_is_empty):
(pas_segregated_view_is_empty_or_biased):
* libpas/src/libpas/pas_segregated_view.h: Added.
(pas_segregated_view_create):
(pas_segregated_view_create_non_null):
(pas_segregated_view_get_ptr):
(pas_segregated_view_get_kind):
(pas_segregated_view_is_null):
(pas_segregated_view_is_exclusive):
(pas_segregated_view_is_ineligible_exclusive):
(pas_segregated_view_is_some_exclusive):
(pas_segregated_view_is_exclusive_ish):
(pas_segregated_view_is_biasing):
(pas_segregated_view_is_ineligible_biasing):
(pas_segregated_view_is_some_biasing):
(pas_segregated_view_get_biasing):
(pas_segregated_view_is_eligible_kind):
(pas_segregated_view_is_ineligible_kind):
(pas_segregated_view_as_ineligible):
(pas_segregated_view_as_eligible):
(pas_segregated_view_is_shared):
(pas_segregated_view_get_shared):
(pas_segregated_view_is_shared_handle):
(pas_segregated_view_get_shared_handle):
(pas_segregated_view_is_partial):
(pas_segregated_view_get_partial):
(pas_segregated_view_is_global_size_directory):
(pas_segregated_view_get_size_directory):
(pas_segregated_view_get_global_size_directory):
* libpas/src/libpas/pas_segregated_view_allocator_inlines.h: Added.
(pas_segregated_view_will_start_allocating):
(pas_segregated_view_did_stop_allocating):
* libpas/src/libpas/pas_segregated_view_inlines.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_segregated_view_get_exclusive):
* libpas/src/libpas/pas_segregated_view_kind.h: Added.
(pas_segregated_view_kind_get_character_code):
(pas_segregated_view_kind_get_string):
(pas_segregated_view_kind_is_eligible):
(pas_segregated_view_kind_is_exclusive_ish):
(pas_segregated_view_kind_is_ineligible):
(pas_segregated_view_kind_can_become_empty):
* libpas/src/libpas/pas_shared_handle_or_page.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_wrap_page):
(pas_is_wrapped_shared_handle):
(pas_is_wrapped_page):
(pas_unwrap_page):
* libpas/src/libpas/pas_shared_handle_or_page_boundary.h: Added.
(pas_wrap_page_boundary):
(pas_is_wrapped_shared_handle):
(pas_is_wrapped_page_boundary):
(pas_unwrap_page_boundary):
* libpas/src/libpas/pas_shared_handle_or_page_boundary_inlines.h: Added.
(pas_wrap_shared_handle):
(pas_unwrap_shared_handle_no_liveness_checks):
(pas_unwrap_shared_handle):
(pas_shared_handle_or_page_boundary_get_page_boundary_no_liveness_checks):
(pas_shared_handle_or_page_boundary_get_page_boundary):
* libpas/src/libpas/pas_shared_handle_or_page_inlines.h: Added.
(pas_wrap_shared_handle):
(pas_unwrap_shared_handle_no_liveness_checks):
(pas_unwrap_shared_handle):
(pas_shared_handle_or_page_get_page_no_liveness_checks):
(pas_shared_handle_or_page_get_page):
* libpas/src/libpas/pas_shared_page_directory_by_size.c: Added.
(pas_shared_page_directory_by_size_get):
(pas_shared_page_directory_by_size_for_each):
(pas_shared_page_directory_by_size_for_each_remote):
* libpas/src/libpas/pas_shared_page_directory_by_size.h: Added.
* libpas/src/libpas/pas_simple_free_heap_declarations.def: Added.
* libpas/src/libpas/pas_simple_free_heap_definitions.def: Added.
* libpas/src/libpas/pas_simple_free_heap_helpers.c: Added.
(pas_simple_free_heap_helpers_try_allocate_with_manual_alignment):
(pas_simple_free_heap_helpers_deallocate):
* libpas/src/libpas/pas_simple_free_heap_helpers.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_simple_large_free_heap.c: Added.
(free_list_entry):
(pas_simple_large_free_heap_construct):
(dump_free_list):
(consider_expanding):
(append):
(merge):
(remove_entry):
(index_to_cursor):
(cursor_to_index):
(simple_find_first):
(simple_find_by_end):
(simple_read_cursor):
(simple_write_cursor):
(simple_merge):
(simple_remove):
(simple_append):
(simple_commit):
(simple_dump):
(simple_add_mapped_bytes):
(initialize_generic_heap_config):
(merge_physical):
(try_allocate_without_fixing):
(fix_free_list_if_necessary):
(pas_simple_large_free_heap_try_allocate):
(pas_simple_large_free_heap_deallocate):
(pas_simple_large_free_heap_for_each_free):
(pas_simple_large_free_heap_get_num_free_bytes):
(pas_simple_large_free_heap_dump_to_printf):
* libpas/src/libpas/pas_simple_large_free_heap.h: Added.
* libpas/src/libpas/pas_simple_type.h: Added.
(pas_simple_type_has_key):
(pas_simple_type_get_key_data):
(pas_simple_type_unwrap):
(pas_simple_type_size):
(pas_simple_type_alignment):
(pas_simple_type_key):
(pas_simple_type_create):
(pas_simple_type_create_with_key_data):
(pas_simple_type_as_heap_type_get_type_size):
(pas_simple_type_as_heap_type_get_type_alignment):
* libpas/src/libpas/pas_size_thunk.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_trivial_size_thunk):
* libpas/src/libpas/pas_skip_list.c: Added.
(pas_skip_list_construct):
(pas_skip_list_node_allocate_with_height):
(pas_skip_list_node_allocate):
(pas_skip_list_node_deallocate):
(pas_skip_list_remove):
(pas_skip_list_size):
(validate_other_node):
(pas_skip_list_validate):
* libpas/src/libpas/pas_skip_list.h: Added.
(pas_skip_list_node_prev):
(pas_skip_list_node_next):
(pas_skip_list_head):
(pas_skip_list_is_empty):
* libpas/src/libpas/pas_skip_list_inlines.h: Added.
(pas_skip_list_find_result_create_exact):
(pas_skip_list_find_result_create_inexact):
(pas_skip_list_level_get_direction):
(pas_skip_list_find_impl):
(pas_skip_list_find_ignore_head_attachment):
(pas_skip_list_find_ignore_pole_attachment):
(pas_skip_list_find):
(pas_skip_list_insert_after_note_head_attachment):
(pas_skip_list_insert_after_note_pole_attachment):
(pas_skip_list_insert):
* libpas/src/libpas/pas_slow_path_mode.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_slow_path_mode_prefix.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_small_large_map_entry.h: Added.
(pas_small_large_map_entry_create_empty):
(pas_small_large_map_entry_create_deleted):
(pas_small_large_map_entry_is_empty_or_deleted):
(pas_small_large_map_entry_is_empty):
(pas_small_large_map_entry_is_deleted):
(pas_small_large_map_entry_create):
(pas_small_large_map_entry_begin):
(pas_small_large_map_entry_get_key):
(pas_small_large_map_entry_end):
(pas_small_large_map_entry_heap):
(pas_small_large_map_entry_get_entry):
(pas_small_large_map_entry_can_create):
* libpas/src/libpas/pas_snprintf.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_status_reporter.c: Added.
(dump_ratio_initial):
(dump_occupancy_initial):
(dump_arrow):
(report_bitfit_directory_contents):
(pas_status_reporter_dump_bitfit_biasing_directory):
(pas_status_reporter_dump_bitfit_global_directory):
(report_segregated_directory_contents):
(pas_status_reporter_dump_segregated_biasing_directory):
(pas_status_reporter_dump_segregated_global_size_directory):
(pas_status_reporter_dump_segregated_shared_page_directory):
(pas_status_reporter_dump_large_heap):
(pas_status_reporter_dump_large_map):
(pas_status_reporter_dump_heap_table):
(pas_status_reporter_dump_immortal_heap):
(pas_status_reporter_dump_compact_large_utility_free_heap):
(pas_status_reporter_dump_large_utility_free_heap):
(pas_status_reporter_dump_compact_bootstrap_free_heap):
(pas_status_reporter_dump_bootstrap_free_heap):
(dump_segregated_heap_directory_callback):
(pas_status_reporter_dump_bitfit_heap):
(pas_status_reporter_dump_segregated_heap):
(pas_status_reporter_dump_heap):
(dump_all_heaps_heap_callback):
(pas_status_reporter_dump_all_heaps):
(dump_all_shared_page_directories_directory_callback):
(pas_status_reporter_dump_all_shared_page_directories):
(pas_status_reporter_dump_all_heaps_non_utility_summaries):
(pas_status_reporter_dump_utility_heap):
(add_to_size_histogram):
(dump_histogram):
(total_fragmentation_global_size_directory_callback):
(total_fragmentation_heap_callback):
(total_fragmentation_shared_page_directory_callback):
(pas_status_reporter_dump_total_fragmentation):
(tier_up_rate_global_size_directory_callback):
(tier_up_rate_heap_callback):
(dump_directory_tier_up_rate):
(pas_status_reporter_dump_tier_up_rates):
(allocator_state):
(pas_status_reporter_dump_baseline_allocators):
(pas_status_reporter_dump_thread_local_caches):
(pas_status_reporter_dump_configuration):
(pas_status_reporter_dump_everything):
(status_reporter_thread_main):
(start_reporter):
(pas_status_reporter_start_if_necessary):
* libpas/src/libpas/pas_status_reporter.h: Added.
* libpas/src/libpas/pas_stream.c: Copied from Source/WTF/wtf/FastTLS.h.
(pas_stream_vprintf):
(pas_stream_printf):
* libpas/src/libpas/pas_stream.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_stream_print_comma):
* libpas/src/libpas/pas_string_stream.c: Added.
(string_stream_vprintf):
(pas_string_stream_destruct):
(pas_string_stream_reset):
(pas_string_stream_vprintf):
* libpas/src/libpas/pas_string_stream.h: Added.
(pas_string_stream_get_string):
(pas_string_stream_get_string_length):
* libpas/src/libpas/pas_subpage_map.c: Added.
(pas_subpage_map_add):
(pas_subpage_map_get):
(pas_subpage_map_get_full_base):
* libpas/src/libpas/pas_subpage_map.h: Added.
(pas_subpage_map_hashtable_entry_create_empty):
(pas_subpage_map_hashtable_entry_create_deleted):
(pas_subpage_map_hashtable_entry_is_empty_or_deleted):
(pas_subpage_map_hashtable_entry_is_empty):
(pas_subpage_map_hashtable_entry_is_deleted):
(pas_subpage_map_hashtable_entry_get_key):
(pas_subpage_map_hashtable_key_get_hash):
(pas_subpage_map_hashtable_key_is_equal):
* libpas/src/libpas/pas_subpage_map_entry.c: Added.
(set_packed_value):
(pas_subpage_map_entry_create):
(prepare_indices):
(pas_subpage_map_assert_commit_state):
(set_bits):
(pas_subpage_map_entry_commit):
(pas_subpage_map_entry_decommit):
* libpas/src/libpas/pas_subpage_map_entry.h: Added.
(pas_subpage_map_entry_full_base):
(pas_subpage_map_entry_bits):
* libpas/src/libpas/pas_thread_local_cache.c: Added.
(pas_thread_local_cache_size_for_allocator_index_capacity):
(deallocate):
(destroy):
(destructor):
(allocate_cache):
(dump_thread_diagnostics):
(pas_thread_local_cache_create):
(pas_thread_local_cache_destroy):
(pas_thread_local_cache_get_slow):
(pas_thread_local_cache_get_local_allocator_slow):
(pas_thread_local_cache_get_local_allocator_if_can_set_cache_slow):
(pas_thread_local_cache_stop_local_allocators):
(stop_local_allocators_if_necessary_set_bit_source):
(stop_local_allocators_if_necessary_set_bit_callback):
(pas_thread_local_cache_stop_local_allocators_if_necessary):
(process_deallocation_log_with_config):
(flush_deallocation_log):
(pas_thread_local_cache_flush_deallocation_log):
(suspend):
(resume):
(pas_thread_local_cache_for_all):
(pas_thread_local_cache_append_deallocation_slow):
(pas_thread_local_cache_shrink):
* libpas/src/libpas/pas_thread_local_cache.h: Added.
(pas_thread_local_cache_try_get):
(pas_thread_local_cache_is_guaranteed_to_destruct):
(pas_thread_local_cache_can_set):
(pas_thread_local_cache_set_impl):
(pas_thread_local_cache_get_already_initialized):
(pas_thread_local_cache_get_with_heap_lock_hold_mode):
(pas_thread_local_cache_get):
(pas_thread_local_cache_get_holding_heap_lock):
(pas_thread_local_cache_get_local_allocator_impl):
(pas_thread_local_cache_get_local_allocator):
(pas_thread_local_cache_try_get_local_allocator):
(pas_thread_local_cache_get_local_allocator_if_can_set_cache):
(pas_thread_local_cache_encode_object):
(pas_thread_local_cache_append_deallocation):
(pas_thread_local_cache_append_deallocation_with_size):
* libpas/src/libpas/pas_thread_local_cache_layout.c: Added.
(pas_thread_local_cache_layout_add_node):
(pas_thread_local_cache_layout_add):
(pas_thread_local_cache_layout_duplicate):
* libpas/src/libpas/pas_thread_local_cache_layout.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_thread_local_cache_layout_node.c: Added.
(pas_thread_local_cache_layout_node_get_directory):
(allocator_index_ptr):
(pas_thread_local_cache_layout_node_get_allocator_index):
(pas_thread_local_cache_layout_node_set_allocator_index):
(next_ptr):
(pas_thread_local_cache_layout_node_get_next):
(pas_thread_local_cache_layout_node_set_next):
* libpas/src/libpas/pas_thread_local_cache_layout_node.h: Added.
(pas_wrap_segregated_global_size_directory):
(pas_wrap_redundant_local_allocator_node):
(pas_is_wrapped_segregated_global_size_directory):
(pas_is_wrapped_redundant_local_allocator_node):
(pas_unwrap_segregated_global_size_directory):
(pas_unwrap_redundant_local_allocator_node):
* libpas/src/libpas/pas_thread_local_cache_node.c: Added.
(pas_thread_local_cache_node_allocate):
(pas_thread_local_cache_node_deallocate):
* libpas/src/libpas/pas_thread_local_cache_node.h: Added.
* libpas/src/libpas/pas_tiny_large_map_entry.h: Added.
(pas_tiny_large_map_entry_base):
(pas_tiny_large_map_entry_create):
(pas_tiny_large_map_entry_begin):
(pas_tiny_large_map_entry_end):
(pas_tiny_large_map_entry_heap):
(pas_tiny_large_map_entry_get_entry):
(pas_tiny_large_map_entry_can_create):
(pas_tiny_large_map_entry_create_empty):
(pas_tiny_large_map_entry_create_deleted):
(pas_tiny_large_map_entry_is_empty_or_deleted):
(pas_tiny_large_map_entry_is_empty):
(pas_tiny_large_map_entry_is_deleted):
(pas_tiny_large_map_entry_get_key):
(pas_tiny_large_map_key_get_hash):
(pas_tiny_large_map_key_is_equal):
* libpas/src/libpas/pas_tree_direction.h: Added.
(pas_tree_direction_get_string):
(pas_tree_direction_invert):
(pas_tree_direction_invert_comparison_result_if_right):
* libpas/src/libpas/pas_tri_state.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_tri_state_get_string):
(pas_tri_state_equals_boolean):
* libpas/src/libpas/pas_try_allocate.h: Added.
(pas_try_allocate_impl_size_thunk):
(pas_try_allocate_impl):
* libpas/src/libpas/pas_try_allocate_array.h: Added.
(pas_try_allocate_array_impl):
* libpas/src/libpas/pas_try_allocate_common.h: Added.
(pas_try_allocate_common_can_go_fast):
(pas_try_allocate_common_impl_fast):
(pas_try_allocate_common_impl_slow):
(pas_try_allocate_common_impl):
* libpas/src/libpas/pas_try_allocate_intrinsic_primitive.h: Added.
(pas_try_allocate_intrinsic_primitive_impl_medium_slow_case):
(pas_try_allocate_intrinsic_primitive_impl):
* libpas/src/libpas/pas_try_allocate_primitive.h: Added.
(pas_try_allocate_primitive_impl):
* libpas/src/libpas/pas_try_reallocate.h: Added.
(pas_try_allocate_for_reallocate_and_copy):
(pas_try_reallocate_table_segregated_case):
(pas_try_reallocate_table_bitfit_case):
(pas_try_reallocate):
(pas_try_reallocate_intrinsic_primitive_allocate_callback):
(pas_try_reallocate_intrinsic_primitive):
(pas_try_reallocate_single_allocate_callback):
(pas_try_reallocate_single):
(pas_try_reallocate_array_allocate_callback):
(pas_try_reallocate_array):
(pas_try_reallocate_primitive_allocate_callback):
(pas_try_reallocate_primitive):
* libpas/src/libpas/pas_try_shrink.h: Added.
(pas_try_shrink):
* libpas/src/libpas/pas_typed_allocation_result.h: Added.
(pas_typed_allocation_result_create_empty):
(pas_typed_allocation_result_create):
(pas_typed_allocation_result_as_intrinsic_allocation_result):
(pas_typed_allocation_result_create_with_intrinsic_allocation_result):
(pas_typed_allocation_result_zero):
(pas_typed_allocation_result_set_errno):
(pas_typed_allocation_result_crash_on_error):
* libpas/src/libpas/pas_utility_heap.c: Added.
(pas_utility_heap_allocate_with_alignment):
(pas_utility_heap_try_allocate):
(pas_utility_heap_allocate):
(pas_utility_heap_deallocate):
(pas_utility_heap_get_num_free_bytes):
(for_each_live_object_small_object_callback):
(pas_utility_heap_for_each_live_object):
(pas_utility_heap_for_all_allocators):
* libpas/src/libpas/pas_utility_heap.h: Added.
(pas_utility_heap_allocate_with_asserted_kind):
(pas_utility_heap_deallocate_with_ignored_size_and_asserted_kind):
* libpas/src/libpas/pas_utility_heap_config.c: Added.
(pas_utility_heap_allocate_page):
(pas_utility_heap_config_for_each_shared_page_directory):
* libpas/src/libpas/pas_utility_heap_config.h: Added.
(pas_utility_heap_page_header_for_boundary):
(pas_utility_heap_boundary_for_page_header):
(pas_utility_heap_shared_page_directory_selector):
(pas_utility_heap_create_page_header):
(pas_utility_heap_destroy_page_header):
(pas_heap_config_is_utility):
(pas_heap_config_heap_lock_hold_mode):
* libpas/src/libpas/pas_utility_heap_support.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_utils.c: Added.
(pas_panic):
(pas_assertion_failed):
(pas_deallocation_did_fail):
(pas_set_deallocation_did_fail_callback):
(pas_reallocation_did_fail):
(pas_set_reallocation_did_fail_callback):
* libpas/src/libpas/pas_utils.h: Added.
(pas_is_power_of_2):
(pas_round_down_to_power_of_2):
(pas_round_down):
(pas_round_up_to_power_of_2):
(pas_round_up):
(pas_modulo_power_of_2):
(pas_is_aligned):
(pas_reverse):
(pas_reverse64):
(pas_make_mask64):
(pas_compare_and_swap_uintptr_weak):
(pas_compare_and_swap_uintptr_strong):
(pas_compare_and_swap_bool_weak):
(pas_compare_and_swap_bool_strong):
(pas_compare_and_swap_uint16_weak):
(pas_compare_and_swap_uint32_weak):
(pas_compare_and_swap_uint32_strong):
(pas_compare_and_swap_uint64_weak):
(pas_compare_and_swap_uint64_strong):
(pas_compare_and_swap_ptr_weak):
(pas_compare_and_swap_ptr_strong):
(pas_fence_after_load):
(pas_store_store_fence):
(pas_opaque):
(pas_pair_create):
(pas_compare_and_swap_pair_weak):
(pas_compare_and_swap_pair_strong):
(pas_atomic_load_pair):
(pas_atomic_store_pair):
(pas_hash32):
(pas_hash64):
(pas_hash_intptr):
(pas_hash_ptr):
(pas_log2):
(pas_log2_rounded_up):
(pas_log2_rounded_up_safe):
(pas_non_empty_ranges_overlap):
(pas_ranges_overlap):
(pas_xorshift32):
(pas_large_object_hash):
(pas_is_divisible_by):
* libpas/src/libpas/pas_utils_prefix.h: Added.
(__pas_round_up_to_power_of_2):
(__pas_compiler_fence):
(__pas_fence):
(__pas_depend_impl):
(__pas_depend):
(__pas_depend_cpu_only):
(__pas_memcpy):
* libpas/src/libpas/pas_versioned_field.c: Added.
(pas_versioned_field_minimize):
(pas_versioned_field_maximize):
(pas_versioned_field_minimize_watched):
(pas_versioned_field_maximize_watched):
* libpas/src/libpas/pas_versioned_field.h: Added.
(pas_versioned_field_construct):
(pas_versioned_field_create):
(pas_versioned_field_create_with_invalid_version):
(pas_versioned_field_create_empty):
(pas_versioned_field_with_version):
(pas_versioned_field_with_value):
(pas_versioned_field_as_pair):
(pas_versioned_field_from_pair):
(pas_versioned_field_equals):
(pas_versioned_field_read_torn):
(pas_versioned_field_read):
(pas_versioned_field_weak_cas):
(pas_versioned_field_strong_cas):
(pas_versioned_field_read_to_watch):
(pas_versioned_field_try_write):
(pas_versioned_field_try_write_watched):
(pas_versioned_field_write):
* libpas/src/libpas/pas_virtual_range.c: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/pas_virtual_range.h: Added.
(pas_virtual_range_create):
(pas_virtual_range_create_empty):
(pas_virtual_range_get_range):
(pas_virtual_range_is_empty):
(pas_virtual_range_size):
(pas_virtual_range_overlaps):
* libpas/src/libpas/pas_virtual_range_min_heap.h: Copied from Source/WTF/wtf/FastTLS.h.
(pas_virtual_range_compare_begin):
(pas_virtual_range_get_index):
(pas_virtual_range_set_index):
* libpas/src/libpas/pas_zero_mode.h: Added.
(pas_zero_mode_get_string):
(pas_zero_mode_validate):
(pas_zero_mode_merge):
* libpas/src/libpas/thingy_heap.c: Added.
(thingy_try_allocate_primitive):
(thingy_try_allocate_primitive_zeroed):
(thingy_try_allocate_primitive_with_alignment):
(thingy_try_reallocate_primitive):
(thingy_try_allocate):
(thingy_try_allocate_zeroed):
(thingy_try_allocate_array):
(thingy_try_allocate_zeroed_array):
(thingy_get_allocation_size):
(thingy_try_reallocate_array):
(thingy_deallocate):
(thingy_heap_ref_get_heap):
(thingy_utility_heap_allocate):
* libpas/src/libpas/thingy_heap.h: Added.
* libpas/src/libpas/thingy_heap_config.c: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/libpas/thingy_heap_config.h: Added.
* libpas/src/libpas/thingy_heap_prefix.h: Added.
* libpas/src/mbmalloc/mbmalloc_bmalloc.c: Copied from Source/WTF/wtf/FastTLS.h.
(mbmalloc):
(mbmemalign):
(mbrealloc):
(mbfree):
(mbscavenge):
* libpas/src/mbmalloc/mbmalloc_hotbit.c: Copied from Source/WTF/wtf/FastTLS.h.
(mbmalloc):
(mbmemalign):
(mbrealloc):
(mbfree):
(mbscavenge):
* libpas/src/mbmalloc/mbmalloc_iso_common_primitive.c: Added.
(install_verifier_if_necessary):
(mbmalloc):
(mbmemalign):
(mbrealloc):
(mbfree):
(dump_summary):
(mbscavenge):
* libpas/src/mbmalloc/mbmalloc_lineref.c: Copied from Source/WTF/wtf/FastTLS.h.
(mbmalloc):
(mbmemalign):
(mbrealloc):
(mbfree):
(mbscavenge):
* libpas/src/test/BitfieldVectorTests.cpp: Added.
(std::testBitfieldNumWords):
(std::testBitfieldNumFields):
(std::testBitfieldWordIndex):
(std::testBitfieldFieldIndex):
(std::testBitfieldFieldShift):
(std::BitfieldVector::BitfieldVector):
(std::BitfieldVector::get const):
(std::BitfieldVector::set):
(std::testBitfieldVectorForward):
(std::testBitfieldVectorBackward):
(addBitfieldVectorTests):
* libpas/src/test/BitvectorTests.cpp: Added.
(std::testFindFirst):
(addBitvectorTests):
* libpas/src/test/CartesianTreeTests.cpp: Added.
(std::TestNode::TestNode):
(std::TestNode::compare):
(std::TestNode::getXKey):
(std::TestNode::getYKey):
(std::Pair::Pair):
(std::Pair::operator== const):
(std::Pair::operator< const):
(std::findExact):
(std::remove):
(std::findLeastGreaterThanOrEqual):
(std::assertFoundAndRemove):
(std::assertEqual):
(std::assertSameValuesForKey):
(std::cartesianTreePrintWidth):
(std::printSpaces):
(std::dumpCartesianTree):
(std::dumpVector):
(std::testDriver):
(std::randomTestDriver):
(addCartesianTreeTests):
* libpas/src/test/CoalignTests.cpp: Added.
(std::testCoalignOneSided):
(std::testCoalignOneSidedError):
(std::testCoalign):
(addCoalignTests):
* libpas/src/test/ExtendedGCDTests.cpp: Copied from Source/WTF/wtf/FastTLS.h.
(std::testExtendedGCD):
(addExtendedGCDTests):
* libpas/src/test/HashtableTests.cpp: Added.
(std::hashtableForEachEntryCallback):
(std::hashtableForEachEntry):
(std::Key::Key):
(std::CollidingEntry_create_empty):
(std::CollidingEntry_create_deleted):
(std::CollidingEntry_is_empty_or_deleted):
(std::CollidingEntry_is_empty):
(std::CollidingEntry_is_deleted):
(std::CollidingEntry_get_key):
(std::CollidingKey_get_hash):
(std::CollidingKey_is_equal):
(std::testEmptyCollidingHashtable):
(std::testCollidingHashtableAddFindTakeImpl):
(std::testCollidingHashtableAddFindTake):
(std::testCollidingHashtableAddAddTakeSet):
(std::testCollidingHashtableAddAddAddTakeTakeSet):
(std::testCollidingHashtableAddAddAddTakeTakeAddSet):
(std::OutOfLineEntry_create_empty):
(std::OutOfLineEntry_create_deleted):
(std::OutOfLineEntry_is_empty_or_deleted):
(std::OutOfLineEntry_is_empty):
(std::OutOfLineEntry_is_deleted):
(std::OutOfLineEntry_get_key):
(std::OutOfLineKey_get_hash):
(std::OutOfLineKey_is_equal):
(std::testOutOfLineHashtable):
(addHashtableTests):
* libpas/src/test/HeapLocker.h: Copied from Source/WTF/wtf/FastTLS.h.
(HeapLocker::HeapLocker):
(HeapLocker::~HeapLocker):
* libpas/src/test/IsoDynamicPrimitiveHeapTests.cpp: Added.
(std::allocate42):
(std::allocate42WithAlignment):
(std::allocate42Zeroed):
(std::reallocate42):
(std::testManySizesAndKeys):
(std::testManySizesAndKeysInTandem):
(addIsoDynamicPrimitiveHeapTests):
* libpas/src/test/IsoHeapChaosTests.cpp: Added.
(std::flushDeallocationLogAndStopAllocators):
(std::verifyObjectSet):
(std::scavengerDidStart):
(std::scavengerWillShutDown):
(std::PageRange::PageRange):
(std::PageRange::operator< const):
(std::PageRange::end const):
(std::addPageRange):
(std::addPageRangeCallback):
(std::RecordedRange::RecordedRange):
(std::RecordedRange::operator< const):
(std::RecordedRange::end const):
(std::ReaderRange::ReaderRange):
(std::ReaderRange::operator< const):
(std::enumeratorReader):
(std::enumeratorRecorder):
(std::testAllocationChaos):
(std::addTheTests):
(std::addSpotTests):
(addIsoHeapChaosTests):
* libpas/src/test/IsoHeapPageSharingTests.cpp: Added.
(std::testTakePages):
(std::testTakePagesFromCorrectHeap):
(std::testLargeHeapTakesPagesFromCorrectSmallHeap):
(std::testLargeHeapTakesPagesFromCorrectSmallHeapAllocateAfterFree):
(std::testLargeHeapTakesPagesFromCorrectSmallHeapWithFancyOrder):
(std::testLargeHeapTakesPagesFromCorrectLargeHeap):
(std::testLargeHeapTakesPagesFromCorrectLargeHeapAllocateAfterFreeOnSmallHeap):
(std::testLargeHeapTakesPagesFromCorrectLargeHeapAllocateAfterFreeOnAnotherLargeHeap):
(std::testLargeHeapTakesPagesFromCorrectLargeHeapWithFancyOrder):
(std::testSmallHeapTakesPagesFromCorrectLargeHeap):
(std::testSmallHeapTakesPagesFromCorrectLargeHeapWithFancyOrder):
(std::testSmallHeapTakesPagesFromCorrectLargeHeapAllocateAfterFreeOnSmallHeap):
(std::testSmallHeapTakesPagesFromCorrectLargeHeapAllocateAfterFreeOnAnotherLargeHeap):
(std::thingyName):
(std::forEachThingyKind):
(std::setupThingy):
(std::cleanThingy):
(std::checkThingy):
(std::addObject):
(std::deleteThingy):
(std::allocationKindName):
(std::allocateThingiesImpl):
(std::allocateThingies):
(std::heapSummaryFor):
(std::assertOnlyDecommitted):
(std::testFullVdirToVdirObvious):
(std::testFullVdirToVdirObviousBackwards):
(std::testFullVdirToVdirOpportunistic):
(std::testFullVdirToVdirOpportunisticBackwards):
(std::testFullVdirToVdirNewAllocation):
(std::testFullVdirToVdirNewLateAllocation):
(std::testFullVdirToVdirNewDirAllocation):
(std::testFullVdirToVdirNewLateDirAllocation):
(std::testFullVdirToVdirNewLargeAllocation):
(std::testFullVdirToVdirNewLateLargeAllocation):
(std::testFullVdirToDir):
(std::testFullVdirToDirBackwardsTarget):
(std::testFullVdirToDirBackwardsSource):
(std::testFullVdirToDirNewAllocation):
(std::testFullVdirToDirNewLateAllocation):
(std::testFullVdirToDirNewDirAllocation):
(std::testFullVdirToDirNewLateDirAllocation):
(std::testFullVdirToDirNewLargeAllocation):
(std::testFullNotVdirButLargeToDirNewLargeAllocation):
(std::testFullVdirToDirNewLateLargeAllocation):
(std::testFullVdirToDirNewAllocationAlsoPhysical):
(std::testFullVdirToDirNewLateAllocationAlsoPhysical):
(std::testFullVdirToLarge):
(std::testFullVdirToLargeBackwardsTarget):
(std::testFullVdirToLargeBackwardsSource):
(std::testFullVdirToLargeNewAllocation):
(std::testFullVdirToLargeNewLateAllocation):
(std::testFullVdirToLargeNewDirAllocation):
(std::testFullVdirToLargeNewLateDirAllocation):
(std::testFullVdirToLargeNewLargeAllocation):
(std::testFullNotVdirButLargeToLargeNewLargeAllocation):
(std::testFullVdirToLargeNewLateLargeAllocation):
(std::testFullVdirToLargeNewAllocationAlsoPhysical):
(std::testFullVdirToLargeNewLateAllocationAlsoPhysical):
(std::testFullDirToVdir):
(std::testFullDirToVdirBackwards):
(std::testFullDirToVdirNewAllocation):
(std::testFullDirToVdirNewLateAllocation):
(std::testFullDirToDir):
(std::testFullDirToDirBackwards):
(std::testFullDirToDirWithThree):
(std::testFullDirToDirWithThreeBackwards):
(std::testFullDirToDirWithThreeNewAllocation):
(std::testFullDirToDirWithThreeNewLateAllocation):
(std::testFullDirToDirWithThreeNewVdirAllocation):
(std::testFullDirToDirWithThreeNewLateVdirAllocation):
(std::testFullDirToLarge):
(std::testFullDirToLargeNewAllocation):
(std::testFullDirToLargeNewLateAllocation):
(std::testFullDirToLargeNewVdirAllocation):
(std::testFullDirToLargeNewLateVdirAllocation):
(std::testFullLargeToVdirForwardMinEpoch):
(std::testFullNotLargeButDirToVdirCombinedUseEpoch):
(std::testFullLargeToVdirCombinedUseEpoch):
(std::testFullLargeToVdirBackwards):
(std::testFullLargeToVdirNewAllocation):
(std::testFullLargeToVdirNewLateAllocation):
(std::testFullLargeToVdirNewDirAllocationForwardMinEpoch):
(std::testFullLargeToVdirNewDirAllocationCombinedUseEpoch):
(std::testFullLargeToVdirNewLateDirAllocationForwardMinEpoch):
(std::testFullLargeToVdirNewLateDirAllocationCombinedUseEpoch):
(std::testFullLargeToDirForwardMinEpoch):
(std::testFullLargeToDirCombinedUseEpoch):
(std::testFullLargeToDirBackwardsSource):
(std::testFullLargeToDirBackwardsTarget):
(std::testFullLargeToDirBackwardsSourceAndTarget):
(std::testFullLargeToDirNewAllocation):
(std::testFullLargeToDirNewLateAllocation):
(std::testFullLargeToDirNewVdirAllocationForwardMinEpoch):
(std::testFullLargeToDirNewVdirAllocationCombinedUseEpoch):
(std::testFullLargeToDirNewLateVdirAllocationForwardMinEpoch):
(std::testFullLargeToDirNewLateVdirAllocationCombinedUseEpoch):
(std::testFullLargeToDirNewDirAllocationForwardMinEpoch):
(std::testFullLargeToDirNewDirAllocationCombinedUseEpoch):
(std::testFullLargeToDirNewLateDirAllocationForwardMinEpoch):
(std::testFullLargeToDirNewLateDirAllocationCombinedUseEpoch):
(std::testFullLargeToLargeForwardMinEpoch):
(std::testFullLargeToLargeCombinedUseEpoch):
(std::testFullLargeToLargeReverse):
(std::testFullLargeToLargeNewAllocation):
(std::testFullLargeToLargeNewLateAllocation):
(std::testFullLargeToLargeNewVdirAllocation):
(std::testFullLargeToLargeNewLateVdirAllocation):
(std::testFullLargeToLargeNewDirAllocation):
(std::testFullLargeToLargeNewLateDirAllocation):
(std::testNewEligibleHasOlderEpoch):
(std::scavengerCompletionCallback):
(std::testScavengerEventuallyReturnsMemory):
(std::testScavengerEventuallyReturnsMemoryEvenWithoutManualShrink):
(std::scavengerShutDownCallback):
(std::testScavengerShutsDownEventually):
(std::addAllTests):
(addIsoHeapPageSharingTests):
* libpas/src/test/IsoHeapPartialAndBaselineTests.cpp: Added.
(std::FreeOrder::setCount const):
(std::FreeOrder::didSetCount const):
(std::forEachSharedPageDirectoryCallbackAdaptor):
(std::forEachSharedPageDirectory):
(std::numSharedPages):
(std::numCommittedSharedPages):
(std::testSimplePartialAllocations):
(std::testFreeAroundPrimordialStop):
(std::testFreeInterleavedAroundPrimordialStop):
(std::PartialProgram::PartialProgram):
(std::testMultiplePartialsFromDifferentHeapsPerShared):
(std::addMultiplePartialsFromDifferentHeapsPerSharedTests):
(std::testMultiplePartialsFromDifferentThreadsPerShared):
(std::incrementalRandom):
(std::zeroRandom):
(std::testTwoBaselinesEvictions):
(std::addScavengerDependentTests):
(addIsoHeapPartialAndBaselineTests):
* libpas/src/test/IsoHeapReservedMemoryTests.cpp: Added.
(std::testSizeProgression):
(addIsoHeapReservedMemoryTests):
* libpas/src/test/IsoHeapTablingTests.cpp: Added.
(std::testTabling):
(std::testUntabling):
(std::addTablingTests):
(addIsoHeapTablingTests):
* libpas/src/test/JITHeapTests.cpp: Added.
(std::testAllocateShrinkAndAllocate):
(addJITHeapTests):
* libpas/src/test/LargeFreeHeapTests.cpp: Added.
(std::alignSimple):
(std::trappingAllocator):
(std::trappingDeallocator):
(std::failingAllocator):
(std::Action::allocate):
(std::Action::deallocate):
(std::Free::Free):
(std::Free::operator== const):
(std::Free::operator< const):
(std::Allocation::Allocation):
(std::function<pas_aligned_allocation_result):
(std::function<void):
(std::operator<<):
(std::allocatorAdapter):
(std::deallocatorAdapter):
(std::iterateAdapter):
(std::iterateHeap):
(std::testLargeFreeHeapImpl):
(std::testSimpleLargeFreeHeap):
(std::testFastLargeFreeHeap):
(std::testBootstrapHeap):
(std::freeListSize):
(addLargeFreeHeapTests):
* libpas/src/test/LargeSharingPoolDump.cpp: Copied from Source/WTF/wtf/FastTLS.h.
(std::forEachAdapter):
(forEachLargeSharingPoolNode):
(dumpLargeSharingPool):
* libpas/src/test/LargeSharingPoolDump.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/src/test/LargeSharingPoolTests.cpp: Added.
(std::Range::Range):
(std::assertState):
(std::testBadCoalesceEpochUpdate):
(addLargeSharingPoolTests):
* libpas/src/test/LockFreeReadPtrPtrHashtableTests.cpp: Added.
(std::hashFunction):
(std::testChaos):
(addLockFreeReadPtrPtrHashtableTests):
* libpas/src/test/MinHeapTests.cpp: Added.
(std::Element::Element):
(std::asChar):
(std::compare):
(std::getIndex):
(std::setIndex):
(std::dumpHeap):
(std::testMinHeap):
(std::minHeapChaos):
(std::testMinHeapChaos):
(std::makeBootstrapAllocationConfig):
(std::testBootstrapMinHeapChaos):
(addMinHeapTests):
* libpas/src/test/RaceTests.cpp: Added.
(std::hookCallbackAdapter):
(std::willLockCallback):
(std::recordLockAcquisition):
(std::didLockCallback):
(std::didTryLockCallback):
(std::willUnlockCallback):
(std::isHoldingContendedLocks):
(std::InstallRaceHooks::InstallRaceHooks):
(std::testLocalAllocatorStopRace):
(std::testLocalAllocatorStopRaceAgainstScavenge):
(addRaceTests):
* libpas/src/test/RedBlackTreeTests.cpp: Added.
(std::TestNode::TestNode):
(std::TestNode::compare):
(std::TestNode::compareKey):
(std::Pair::Pair):
(std::Pair::operator== const):
(std::Pair::operator< const):
(std::findExact):
(std::remove):
(std::findLeastGreaterThanOrEqual):
(std::assertFoundAndRemove):
(std::assertEqual):
(std::assertSameValuesForKey):
(std::push):
(std::validateEnumerable):
(std::testDriver):
(std::randomTestDriver):
(addRedBlackTreeTests):
* libpas/src/test/SkipListTests.cpp: Added.
(std::TestNode::TestNode):
(std::TestNode::fromSkipListNode):
(std::TestNode::compareKey):
(std::TestNode::compareKeyLeastGreaterThanOrEqual):
(std::TestNode::compareKeyForInsert):
(std::TestNode::compare):
(std::Pair::Pair):
(std::Pair::operator== const):
(std::Pair::operator< const):
(std::findExact):
(std::remove):
(std::findLeastGreaterThanOrEqual):
(std::assertFoundAndRemove):
(std::assertEqual):
(std::assertSameValuesForKey):
(std::dumpSkipList):
(std::dumpVector):
(std::testDriver):
(std::randomTestDriver):
(addSkipListTests):
* libpas/src/test/SuspendScavenger.h: Copied from Source/WTF/wtf/FastTLS.h.
(SuspendScavenger::SuspendScavenger):
(SuspendScavenger::~SuspendScavenger):
* libpas/src/test/TSDTests.cpp: Added.
(std::destructor):
(std::testTSD):
(addTSDTests):
* libpas/src/test/TestHarness.cpp: Added.
(allocationConfigAllocate):
(allocationConfigDeallocate):
(TestScopeImpl::TestScopeImpl):
(RuntimeConfigTestScope::RuntimeConfigTestScope):
(ForceExclusives::ForceExclusives):
(ForceTLAs::ForceTLAs):
(ForceBitfit::ForceBitfit):
(DisableBitfit::DisableBitfit):
(ForcePartials::ForcePartials):
(ForceBaselines::ForceBaselines):
(RunScavengerFully::RunScavengerFully):
(RunScavengerOnNonRemoteCaches::RunScavengerOnNonRemoteCaches):
(SuspendScavengerScope::SuspendScavengerScope):
(VerifyGranules::VerifyGranules):
(InstallVerifier::InstallVerifier):
(DisableExplosion::DisableExplosion):
(ForceExplosion::ForceExplosion):
(ForceOneMagazine::ForceOneMagazine):
(EpochIsCounter::EpochIsCounter):
(BootJITHeap::BootJITHeap):
(testSucceeded):
(deterministicRandomNumber):
(addTest):
(TestScope::TestScope):
(TestScope::~TestScope):
(hasScope):
(dumpObjectSet):
(dumpObjectsInHeap):
(dumpObjectsInHeaps):
(forEachLiveObject):
(verifyMinimumObjectDistance):
(verifyExactObjectDistance):
(runOneTest):
(runForkedTest):
(runTests):
(runFilteredTests):
(main):
(scavenge):
(printStatusReport):
* libpas/src/test/TestHarness.h: Added.
(stringStreamConstruct):
(dumpToString):
(operator<<):
* libpas/src/test/ThingyAndUtilityHeapAllocationTests.cpp: Added.
(std::flushDeallocationLog):
(std::flushDeallocationLogAndStopAllocators):
(std::sizeClassFor):
(std::isLarge):
(std::forEachLiveUtilityObjectAdapter):
(std::forEachLiveUtilityObject):
(std::forEachCommittedViewAdapter):
(std::forEachCommittedView):
(std::numCommittedViews):
(std::numViews):
(std::verifyMinimumObjectDistance):
(std::verifyObjectSet):
(std::verifyUtilityObjectSet):
(std::verifyHeapEmpty):
(std::PrimitiveAllocator::PrimitiveAllocator):
(std::PrimitiveReallocAllocator::PrimitiveReallocAllocator):
(std::AlignedPrimitiveAllocator::AlignedPrimitiveAllocator):
(std::createIsolatedHeapRef):
(std::IsolatedHeapAllocator::IsolatedHeapAllocator):
(std::IsolatedHeapArrayAllocator::IsolatedHeapArrayAllocator):
(std::CounterScope::CounterScope):
(std::CounterScope::~CounterScope):
(std::testDeallocateNull):
(std::deallocationFailureCallback):
(std::DeallocationShouldFail::DeallocationShouldFail):
(std::DeallocationShouldFail::~DeallocationShouldFail):
(std::testDeallocateMalloc):
(std::testDeallocateStack):
(std::testSimpleAllocation):
(std::testSmallOrMediumAllocation):
(std::testSmallAllocation):
(std::testLargeAllocation):
(std::testAllocationWithInterleavedFragmentation):
(std::testFreeListRefillSpans):
(std::testInternalScavenge):
(std::testInternalScavengeFromCorrectDirectory):
(std::SizeClassProgram::SizeClassProgram):
(std::testSizeClassCreationImpl):
(std::testSizeClassCreation):
(std::testSpuriousEligibility):
(std::testBasicSizeClassNotSet):
(std::testSmallDoubleFree):
(std::testSmallFreeInner):
(std::testSmallFreeNextWithShrink):
(std::testSmallFreeNextWithoutShrink):
(std::testSmallFreeNextBeforeShrink):
(std::AllocationProgram::allocate):
(std::AllocationProgram::free):
(std::AllocationProgram::kind const):
(std::AllocationProgram::key const):
(std::AllocationProgram::isAllocate const):
(std::AllocationProgram::count const):
(std::AllocationProgram::alignment const):
(std::AllocationProgram::isFree const):
(std::IsolatedComplexAllocator::IsolatedComplexAllocator):
(std::IsolatedUnitComplexAllocator::IsolatedUnitComplexAllocator):
(std::checkObjectDistances):
(std::checkObjectBeginnings):
(std::addObjectAllocation):
(std::ExpectedBytes::exact):
(std::ExpectedBytes::upperBound):
(std::ExpectedBytes::check):
(std::testComplexLargeAllocationImpl):
(std::testComplexLargeAllocation):
(std::testAllocationCountProgression):
(std::testAllocationChaos):
(std::testUtilityAllocationChaos):
(std::testCombinedAllocationChaos):
(std::testLargeDoubleFree):
(std::testLargeOffsetFree):
(std::addDeallocationTests):
(std::testReallocatePrimitive):
(std::testReallocateArray):
(std::addSmallHeapTests):
(std::addLargeHeapTests):
(std::addMediumHeapTests):
(std::addLargerThanMediumHeapTests):
(std::addMargeBitfitTests):
(std::addLargerThanMargeBitfitTests):
(std::addCombinedHeapTests):
(std::addAllTestsImpl):
(std::addAllTests):
(addThingyAndUtilityHeapAllocationTests):
* libpas/src/test/UtilsTests.cpp: Added.
(std::testIsDivisibleBy3):
(addUtilsTests):
* libpas/src/toys/QuadraticSizeClass.cpp: Added.
(std::printSizeCell):
(std::printProgression):
(main):
* libpas/src/verifier/Verifier.cpp: Added.
(std::Locker::Locker):
(std::Locker::~Locker):
(std::Allocation::Allocation):
(std::allocationCallback):
(std::deallocationCallback):
(std::dumpStateForHeapKind):
(std::dumpStateHoldingLock):
(std::uninstall):
(pas_install_verifier):
(pas_dump_state):
* libpas/src/verifier/Verifier.h: Copied from Source/WTF/wtf/FastTLS.h.
* libpas/test-impl.sh: Added.
* libpas/test.sh: Added.
Source/JavaScriptCore:
Switch the ExecutableAllocator to the libpas jit_heap. The libpas jit_heap uses two size
categories of bitfit and a large heap, and is happy to do its approximate first-fit in any
ranges of memory you give it. Jit_heap never allocates metadata inside the memory it manages.
Allocations and deallocations take a constant-bounded amount of time except for unusual
situations, and are protected by fine-grained locking in most cases. Decommit follows libpas
scavenging policy. This alone is a speed-up on Speedometer (probably about 1% or more).
Also expose some libpas introspection via $vm.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MacroAssemblerCodeRef.h:
* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::underMemoryPressure):
(JSC::ExecutableAllocator::memoryPressureMultiplier):
(JSC::ExecutableAllocator::allocate):
(JSC::ExecutableAllocator::committedByteCount):
(JSC::ExecutableMemoryHandle::createImpl):
(JSC::ExecutableMemoryHandle::~ExecutableMemoryHandle):
(JSC::ExecutableMemoryHandle::sizeInBytes const):
(JSC::ExecutableMemoryHandle::shrink):
* jit/ExecutableAllocator.h:
* jit/ExecutableMemoryHandle.h: Added.
(JSC::ExecutableMemoryHandle::start const):
(JSC::ExecutableMemoryHandle::end const):
(JSC::ExecutableMemoryHandle::startAsInteger const):
(JSC::ExecutableMemoryHandle::endAsInteger const):
(JSC::ExecutableMemoryHandle::containsIntegerAddress const):
(JSC::ExecutableMemoryHandle::contains const):
(JSC::ExecutableMemoryHandle::key const):
(JSC::ExecutableMemoryHandle::dump const):
(JSC::ExecutableMemoryHandle::ExecutableMemoryHandle):
* tools/JSDollarVM.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSDollarVM::finishCreation):
Source/WTF:
Introduce flags for using libpas as the ExecutableAllocator.
Explicitly ask for gigacage initialization, since libpas prefers it this way right now.
* wtf/FastTLS.h:
* wtf/PlatformUse.h:
* wtf/Threading.cpp:
(WTF::initialize):
Tools:
Disable the IsoHeap tests if we're using libpas. Libpas has its own tests.
* TestWebKitAPI/Tests/WTF/bmalloc/IsoHeap.cpp:
Canonical link: https://commits.webkit.org/239620@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-13 07:39:34 +00:00
2021-07-12 Filip Pizlo <fpizlo@apple.com> and Yusuke Suzuki <ysuzuki@apple.com>
New malloc algorithm
https://bugs.webkit.org/show_bug.cgi?id=226404
Reviewed by Yusuke Suzuki.
Introduce flags for using libpas as the ExecutableAllocator.
Explicitly ask for gigacage initialization, since libpas prefers it this way right now.
* wtf/FastTLS.h:
* wtf/PlatformUse.h:
* wtf/Threading.cpp:
(WTF::initialize):
2021-07-13 01:22:14 +00:00
2021-07-12 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Turn on `USE(OS_STATE)` when building with a non-Apple-internal SDK
https://bugs.webkit.org/show_bug.cgi?id=227884
Reviewed by Tim Horton.
Enable the compile-time flag for all Cocoa builds.
* wtf/PlatformUse.h:
2021-07-12 23:07:14 +00:00
2021-07-12 Chris Fleizach <cfleizach@apple.com>
AX: Make WebKit observe spatial audio accessibility settings
https://bugs.webkit.org/show_bug.cgi?id=227848
Reviewed by Sam Weinig.
This flag was using the wrong format for a HAVE setting, so the code wasn't being compiled in.
* wtf/PlatformHave.h:
2021-07-12 20:45:20 +00:00
2021-07-12 Simon Fraser <simon.fraser@apple.com>
Add a StyleSheets log channel and some logging
https://bugs.webkit.org/show_bug.cgi?id=227880
Reviewed by Alan Bujtas.
Make it possible to feed Ref<> and RefPtr<> into TextStream.
* wtf/text/TextStream.h:
(WTF::operator<<):
2021-07-09 16:46:05 +00:00
2021-07-09 Jer Noble <jer.noble@apple.com>
[Cocoa] Make Coordinator playback commands more precise
https://bugs.webkit.org/show_bug.cgi?id=227756
Reviewed by Eric Carlson.
Add a method to convert from a MonotonicTime to a MachAbsoluteTime.
* wtf/CurrentTime.cpp:
(WTF::machTimebaseInfo):
(WTF::MonotonicTime::fromMachAbsoluteTime):
(WTF::MonotonicTime::toMachAbsoluteTime const):
* wtf/MonotonicTime.h:
* wtf/PlatformHave.h:
2021-07-08 22:59:59 +00:00
2021-07-08 Alex Christensen <achristensen@webkit.org>
Fix some whitespace handling issues in URL setters
https://bugs.webkit.org/show_bug.cgi?id=227806
Reviewed by Chris Dumez.
Setters should ignore tabs and newlines like the main parser does.
The protocol setter is problematic, which I reported in https://github.com/whatwg/url/issues/620
* wtf/URL.cpp:
(WTF::URL::setFragmentIdentifier):
* wtf/URLParser.cpp:
(WTF::URLParser::isSpecialScheme):
(WTF::URLParser::parse):
* wtf/URLParser.h:
The URL.hash setter should allow trailing C0 and control characters, which we would otherwise trim.
Rather than introduce a new parameter, use a sentinel value for when we need to do this.
2021-07-08 22:13:59 +00:00
2021-07-08 Brent Fulgham <bfulgham@apple.com>
[Cocoa] Expose SPI to opt out of Extensible SSO authentication
https://bugs.webkit.org/show_bug.cgi?id=227729
<rdar://problem/75647892>
Reviewed by Tim Horton.
Create new WKPreference to allow WebKit clients to opt out of Extensible SSO authentication.
* Scripts/Preferences/WebPreferences.yaml:
2021-07-07 22:45:11 +00:00
2021-07-07 Alex Christensen <achristensen@webkit.org>
URL host setter should pass host to URLParser instead of trying to encode it itself
https://bugs.webkit.org/show_bug.cgi?id=227749
Reviewed by Chris Dumez.
For non-special schemes, the host is percent-encoded instead of punycode-encoded.
Allowing the URL parser to handle all input directly does the right thing for non-special schemes.
* wtf/URL.cpp:
(WTF::URL::setHost):
(WTF::URL::setHostAndPort):
2021-07-07 20:20:06 +00:00
2021-07-07 Alex Christensen <achristensen@webkit.org>
URL path setter should add "./" before non-empty path and after empty host for URLs with non-special schemes
https://bugs.webkit.org/show_bug.cgi?id=227750
Reviewed by Chris Dumez.
This is related to r267837 but in the path setter, too.
This helps preserve idempotence in parsed URLs.
This is an edge case that will rarely be hit in practice, but now the path setter matches the parser.
* wtf/URL.cpp:
(WTF::URL::setPath):
2021-07-07 19:54:06 +00:00
2021-07-07 Christopher Reid <chris.reid@sony.com>
[PlayStation] Don't assume 4KB block size when estimating Network Cache disk usage
https://bugs.webkit.org/show_bug.cgi?id=227502
Reviewed by Chris Dumez.
Add getVolumeFileBlockSize to fetch the block size from the filesystem.
Currently only implemented for Windows and POSIX filesystems.
* wtf/FileSystem.cpp:
* wtf/FileSystem.h:
* wtf/playstation/FileSystemPlayStation.cpp:
2021-07-07 17:07:57 +00:00
2021-07-07 Alex Christensen <achristensen@webkit.org>
Use more Span
https://bugs.webkit.org/show_bug.cgi?id=227606
Reviewed by Darin Adler.
New is always better, right?
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::mapToFile):
* wtf/FileSystem.h:
* wtf/persistence/PersistentCoders.cpp:
(WTF::Persistence::Coder<CString>::encode):
(WTF::Persistence::Coder<CString>::decode):
(WTF::Persistence::Coder<String>::encode):
(WTF::Persistence::decodeStringText):
(WTF::Persistence::Coder<SHA1::Digest>::encode):
(WTF::Persistence::Coder<SHA1::Digest>::decode):
* wtf/persistence/PersistentCoders.h:
* wtf/persistence/PersistentDecoder.cpp:
(WTF::Persistence::Decoder::Decoder):
(WTF::Persistence::Decoder::bufferIsLargeEnoughToContain const):
(WTF::Persistence::Decoder::bufferPointerForDirectRead):
(WTF::Persistence::Decoder::decodeFixedLengthData):
(WTF::Persistence::Decoder::decodeNumber):
(WTF::Persistence::Decoder::verifyChecksum):
* wtf/persistence/PersistentDecoder.h:
(WTF::Persistence::Decoder::length const):
(WTF::Persistence::Decoder::currentOffset const):
* wtf/persistence/PersistentEncoder.cpp:
(WTF::Persistence::Encoder::updateChecksumForData):
(WTF::Persistence::Encoder::encodeFixedLengthData):
(WTF::Persistence::Encoder::encodeChecksum):
* wtf/persistence/PersistentEncoder.h:
2021-07-06 19:25:04 +00:00
2021-07-05 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Optimize Object.assign and putDirectInternal
https://bugs.webkit.org/show_bug.cgi?id=227677
Reviewed by Filip Pizlo.
* wtf/HashMap.h:
* wtf/HashSet.h:
* wtf/HashTable.h:
(WTF::HashTable::isNullStorage const):
2021-07-02 23:21:00 +00:00
2021-07-02 Brent Fulgham <bfulgham@apple.com>
[macOS] Only use WebGL on Metal by default on safe versions of macOS
https://bugs.webkit.org/show_bug.cgi?id=227633
<rdar://problem/78527887>
Reviewed by Dean Jackson.
Tested by WebGL test suite.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* wtf/PlatformHave.h:
2021-07-01 20:56:00 +00:00
2021-07-01 Youenn Fablet <youenn@apple.com>
Disable relay for UDP sockets when not needed
https://bugs.webkit.org/show_bug.cgi?id=227253
<rdar://problem/79912154>
Reviewed by Eric Carlson.
* wtf/PlatformHave.h:
Add a macro for new NW methods.
2021-07-01 19:37:13 +00:00
2021-07-01 Antoine Quint <graouts@webkit.org>
[Model] Restrict IPC calls to ARKit SPI availability and runtime flag
https://bugs.webkit.org/show_bug.cgi?id=227581
Reviewed by Tim Horton.
Define a new compile-time flag when either of the iOS or macOS ARKit SPIs are available.
* wtf/PlatformHave.h:
2021-07-01 18:34:39 +00:00
2021-07-01 Aditya Keerthi <akeerthi@apple.com>
[iOS] <select> menus should scroll to the selected option
https://bugs.webkit.org/show_bug.cgi?id=227562
<rdar://problem/77887668>
Reviewed by Wenson Hsieh.
* wtf/PlatformHave.h:
Add HAVE(UIMENUOPTIONS_SINGLE_SELECTION).
2021-07-01 10:37:39 +00:00
2021-07-01 Youenn Fablet <youenn@apple.com>
[Cocoa] Migrate WebRTC UDP socket handling to NW API
https://bugs.webkit.org/show_bug.cgi?id=227210
Reviewed by Eric Carlson.
Add a new experimental flag for NW backed UDP sockets.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-07-01 07:07:49 +00:00
2021-07-01 Jer Noble <jer.noble@apple.com>
[Mac] (Re-)enable GroupActivities after upstreaming
https://bugs.webkit.org/show_bug.cgi?id=227546
Reviewed by Eric Carlson.
Add support for HAVE_GROUP_ACTIVITIES.
* wtf/PlatformHave.h:
[Model] [macOS] Add support for rendering model resources
https://bugs.webkit.org/show_bug.cgi?id=227530
<rdar://problem/79968206>
Reviewed by Dean Jackson.
Source/WebCore:
On macOS, ASVInlinePreview requires an instance in both the WebProcess and the UIProcess to exist with a matching UUID.
On the WebCore side, in the WebProcess, after writing the model resource as a file to disk, we create an instance when a
<model> element is created and message the UIProcess through the ChromeClient providing the UUID generated for it. When
the UIProcess is done processing this message, it will reply with another message which calls into
HTMLModelElement::inlinePreviewDidObtainContextId() with the matching UUID and a context ID for the remote context.
We can then set that remote context ID on our ASVInlinePreview instance.
We also introduce a HTMLModelElement::platformLayer() method such that RenderLayerBacking::updateConfiguration() can call
it to host the ASVInlinePreview layer.
* Modules/model-element/HTMLModelElement.cpp:
(WebCore::HTMLModelElement::~HTMLModelElement):
(WebCore::HTMLModelElement::setSourceURL):
(WebCore::HTMLModelElement::notifyFinished):
* Modules/model-element/HTMLModelElement.h:
* Modules/model-element/HTMLModelElementCocoa.mm: Added.
(WebCore::HTMLModelElement::createFile):
(WebCore::HTMLModelElement::clearFile):
(WebCore::HTMLModelElement::modelDidChange):
(WebCore::HTMLModelElement::inlinePreviewDidObtainContextId):
(WebCore::HTMLModelElement::platformLayer const):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/EmptyClients.cpp:
(WebCore::EmptyChromeClient::modelElementDidCreatePreview const):
* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::modelElementDidCreatePreview const):
* platform/Logging.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
Source/WebCore/PAL:
Declare the ASVInlinePreview class for macOS.
* PAL.xcodeproj/project.pbxproj:
* pal/spi/mac/SystemPreviewSPI.h: Added.
Source/WebKit:
On macOS, ASVInlinePreview requires an instance in both the WebProcess and the UIProcess to exist with a matching UUID.
On the WebKit side, in the UIProcess, we receive a message from the WebProcess when the ASVInlinePreview in that process
was created with its generated UUID. We provide this to the ModelElementController, set the remote connection up and load
the file. When those tasks complete successfully we message back the WebProcess with the UUID and the provided ElementContext
to talk back to the HTMLModelElement instance that initiated the message to the UIProcess in the first place.
* UIProcess/Cocoa/ModelElementControllerCocoa.mm:
(WebKit::ModelElementController::modelElementDidCreatePreview):
* UIProcess/ModelElementController.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::modelElementDidCreatePreview):
(WebKit::WebPageProxy::modelElementPreviewDidObtainContextId):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::modelElementDidCreatePreview const):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::modelElementDidCreatePreview):
(WebKit::WebPage::modelElementPreviewDidObtainContextId):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Source/WTF:
Add a new compile-time flag indicating the availability of the ASVInlinePreview SPI on macOS.
We only define it when the header itself is present for now to avoid issues with older macOS
12 SDKs, but ultimately we will only use the macOS version check.
* wtf/PlatformHave.h:
Canonical link: https://commits.webkit.org/239307@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-01 06:32:12 +00:00
2021-06-30 Antoine Quint <graouts@webkit.org>
[Model] [macOS] Add support for rendering model resources
https://bugs.webkit.org/show_bug.cgi?id=227530
<rdar://problem/79968206>
Reviewed by Dean Jackson.
Add a new compile-time flag indicating the availability of the ASVInlinePreview SPI on macOS.
We only define it when the header itself is present for now to avoid issues with older macOS
12 SDKs, but ultimately we will only use the macOS version check.
* wtf/PlatformHave.h:
2021-06-30 23:54:40 +00:00
2021-06-30 Megan Gardner <megan_gardner@apple.com>
Add ID and versioning support for AppHighlights
https://bugs.webkit.org/show_bug.cgi?id=227279
Reviewed by Tim Horton.
Allow PersistentDecoders to rewind, to help support v0 highlight data.
* wtf/persistence/PersistentDecoder.cpp:
(WTF::Persistence::Decoder::Decoder):
(WTF::Persistence::Decoder::rewind):
* wtf/persistence/PersistentDecoder.h:
2021-06-30 22:51:21 +00:00
2021-06-30 Ryosuke Niwa <rniwa@webkit.org>
Use WeakHashMap and WeakPtr with Node in more places
https://bugs.webkit.org/show_bug.cgi?id=227192
<rdar://problem/79828322>
Reviewed by Geoffrey Garen.
* wtf/WeakHashMap.h:
(WTF::WeakHashMap::WeakHashMapIteratorBase::makePeek): Fixed type mismatch errors.
(WTF::WeakHashMap::ensure): Made this function return AddResult like HashMap::ensure.
(WTF::WeakHashMap::take): Added.
(WTF::WeakHashMap::removeIf): Fixed the bug that the callback was called with the iterator
of m_impl and not WeakHashMapIterator.
* wtf/WeakHashSet.h:
(WTF::HashTraits<Ref<WeakPtrImpl<Counter>>>::isReleasedWeakValue): Moved to WeakPtr.h
* wtf/WeakPtr.h:
(WTF::HashTraits<Ref<WeakPtrImpl<Counter>>>::isReleasedWeakValue): Moved from WeakHashSet.h
2021-06-30 21:16:16 +00:00
2021-06-30 Truitt Savell <tsavell@apple.com>
Unreviewed, reverting r279405.
Casued 50+ webrtc crashes on Big Sur Debug
Reverted changeset:
"[Cocoa] Migrate WebRTC UDP socket handling to NW API"
https://bugs.webkit.org/show_bug.cgi?id=227210
https://commits.webkit.org/r279405
2021-06-30 10:19:03 +00:00
2021-06-30 Tim Horton <timothy_horton@apple.com>
Fix the build.
* wtf/PlatformHave.h:
This is not available on the simulator; disable it.
2021-06-30 08:46:38 +00:00
2021-06-30 Youenn Fablet <youenn@apple.com>
[Cocoa] Migrate WebRTC UDP socket handling to NW API
https://bugs.webkit.org/show_bug.cgi?id=227210
Reviewed by Eric Carlson.
Add a new experimental flag for NW backed UDP sockets.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-06-29 22:50:17 +00:00
2021-06-29 Antoine Quint <graouts@webkit.org>
WebKit_iosmac build failure: SystemPreviewSPI.h:29:9: fatal error: 'AssetViewer/ARQuickLookWebKitItem.h' file not found
https://bugs.webkit.org/show_bug.cgi?id=227507
<rdar://problem/79902043>
Reviewed by Dean Jackson.
When we added new SPIs in Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h as part of r279312 we also included this file
from a new file that is compiled on Catalyst. This revealed an issue where existing SPIs included in that file weren't
actually available on Catalyst. We now make sure we compile those out on Catalyst.
* wtf/PlatformHave.h:
2021-06-29 07:19:27 +00:00
2021-06-29 Antti Koivisto <antti@apple.com>
Enable Probabilistic Guard Malloc for RuleData and RuleFeature vectors
https://bugs.webkit.org/show_bug.cgi?id=227446
Reviewed by Geoffrey Garen.
Add SystemMalloc type that can be used with containers like Vector and
ProbabilisticGuardMalloc alias for it on Mac/iOS platforms.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/SystemMalloc.h: Added.
(WTF::SystemMalloc::malloc):
(WTF::SystemMalloc::tryMalloc):
(WTF::SystemMalloc::zeroedMalloc):
(WTF::SystemMalloc::tryZeroedMalloc):
(WTF::SystemMalloc::realloc):
(WTF::SystemMalloc::tryRealloc):
(WTF::SystemMalloc::free):
* wtf/Vector.h:
(WTF::Malloc>::appendVector):
Include all template parameters for the appendVector argument.
2021-06-28 16:48:33 +00:00
2021-06-28 Mikhail R. Gadelha <mikhail@igalia.com>
Prevent sign-extended casts for 32 bits arch
https://bugs.webkit.org/show_bug.cgi?id=227170
Reviewed by Yusuke Suzuki.
In a number of places, addresses are reinterpreted as uint64, which can
lead to wrong addresses in 32 bits arch.
* wtf/LoggerHelper.h:
(WTF::LoggerHelper::childLogIdentifier):
2021-06-28 15:34:32 +00:00
2021-06-28 Sam Weinig <weinig@apple.com>
Add helpers to create Spans from CFDataRef and NSData
https://bugs.webkit.org/show_bug.cgi?id=227217
Reviewed by Chris Dumez.
Add overloads of asBytes() for CFDataRef and NSData. This is going to
be a common enough pattern to warrent these helpers.
* WTF.xcodeproj/project.pbxproj:
* wtf/PlatformFTW.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformWin.cmake:
* wtf/cf/SpanCF.h: Added.
(WTF::asBytes):
* wtf/cocoa/SpanCocoa.h: Added.
(WTF::asBytes):
2021-06-27 08:55:52 +00:00
2021-06-27 Antoine Quint <graouts@webkit.org>
[Model] [iOS] Add support for rendering model resources
https://bugs.webkit.org/show_bug.cgi?id=227392
<rdar://problem/79770136>
Reviewed by Tim Horton.
Add a new compile-time flag indicating the availability of the ASVInlinePreview SPI on iOS.
We only define it when the header itself is present for now to avoid issues with older iOS
15 SDKs, but ultimately we will only use the iOS version check.
* wtf/PlatformHave.h:
2021-06-25 20:50:25 +00:00
2021-06-25 Kenneth Russell <kbr@chromium.org>
Set ImageBitmap experimental feature flag to true
https://bugs.webkit.org/show_bug.cgi?id=227140
Reviewed by Dean Jackson.
Web developers - most recently Google's Meet team - have asked for
ImageBitmap support in WebKit. The implementation was
substantially upgraded during development of WebGL 2.0, and is
thoroughly tested on the EWS. Change the default value for
ImageBitmap's experimental flag to true; this can be removed
completely after one release cycle.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-06-24 10:49:27 +00:00
2021-06-24 Martin Robinson <mrobinson@webkit.org>
[css-scroll-snap] Remove ENABLE_SCROLL_SNAP compile-time option
https://bugs.webkit.org/show_bug.cgi?id=227067
Reviewed by Simon Fraser.
Remove compile-time ENABLE_SCROLL_SNAP configuration option.
* wtf/PlatformEnable.h: Remove the global feature definition.
2021-06-24 04:27:14 +00:00
2021-06-23 Mark Lam <mark.lam@apple.com>
Base Options::useWebAssemblyFastMemory's default value on Gigacage::hasCapacityToUseLargeGigacage.
https://bugs.webkit.org/show_bug.cgi?id=227328
Reviewed by Saam Barati.
Provide a Gigacage::hasCapacityToUseLargeGigacage value for when !GIGACAGE_ENABLED.
* wtf/Gigacage.h:
Add a new pattern to instruction selector to utilize UBFIZ supported by ARM64
https://bugs.webkit.org/show_bug.cgi?id=227204
Patch by Yijia Huang <yijia_huang@apple.com> on 2021-06-23
Reviewed by Filip Pizlo.
Source/JavaScriptCore:
This patch includes three parts:
A) Add UBFIZ to instruction selector.
B) Fix UBFX, introduced in https://bugs.webkit.org/show_bug.cgi?id=226984,
to match all patterns.
C) Fix error condition in one strength reduction introduced
in https://bugs.webkit.org/show_bug.cgi?id=227138.
Part A
Unsigned Bitfield Insert in Zero(UBFIZ), supported by ARM64, zeros the
destination register and copies any number of contiguous bits from a
source register into any position in the destination register. The
instruction selector can utilize this to lowering certain patterns in
B3 IR before further Air optimization.
Given the operation: ubfiz d, n, lsb, width
This is equivalent to "d = (n << lsb) & (((1 << width) - 1) << lsb)".
Since wasm introduces constant folding, then the matched patterns would be:
1.1 d = (n << lsb) & maskShift
1.2 d = maskShift & (n << lsb)
2.1 d = (n & mask) << lsb
2.2 d = (mask & n) << lsb
Where:
maskShift = mask << lsb
mask = (1 << width) - 1
To make the pattern matching in instruction selection beneficial to JIT, these
constraints should be introduced:
1. 0 <= lsb < datasize
2. 0 < width < datasize
3. lsb + width <= datasize
Choose (n & mask) << lsb as the canonical form and introduce a strength reduction.
Turn this: (n << lsb) & maskShift
Into this: (n & mask) << lsb
Given B3 IR:
Int @0 = ArgumentReg(%x0)
Int @1 = lsb
Int @2 = 0b0110
Int @3 = Shl(@0, @1)
Int @4 = BitAnd(@3, @2)
Void@5 = Return(@4, Terminal)
Before Adding UBFIZ Pattern:
// Old optimized AIR
Lshift %x0, $62, %x0, @3
And 0b0110, %x0, %x0, @4
Ret %x0, @5
After Adding UBFIZ Pattern:
// New optimized AIR
Ubfiz %x0, lsb, 2, %x0, @4
Ret %x0, @5
Part B
Fix UBFX to match both patterns:
dest = (src >> lsb) & mask
dest = mask & (src >> lsb)
Where:
1. mask = (1 << width) - 1
2. 0 <= lsb < datasize
3. 0 < width < datasize
4. lsb + width <= datasize
Part C
Fix one B3 strength reduction.
Turn this: (src >> shiftAmount) & mask
Into this: src >> shiftAmount
With updated constraints:
1. mask = (1 << width) - 1
2. 0 <= shiftAmount < datasize
3. 0 < width < datasize
4. shiftAmount + width >= datasize
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::ubfiz32):
(JSC::MacroAssemblerARM64::ubfiz64):
* assembler/testmasm.cpp:
(JSC::testUbfiz32):
(JSC::testUbfiz64):
* b3/B3LowerToAir.cpp:
* b3/air/AirOpcode.opcodes:
* b3/testb3.h:
* b3/testb3_2.cpp:
(testUbfx32ArgLeft):
(testUbfx32ArgRight):
(testUbfx64ArgLeft):
(testUbfx64ArgRight):
(testUbfiz32ArgLeft):
(testUbfiz32ArgRight):
(testUbfiz64ArgLeft):
(testUbfiz64ArgRight):
(addBitTests):
(testUbfx32): Deleted.
(testUbfx32PatternMatch): Deleted.
(testUbfx64): Deleted.
(testUbfx64PatternMatch): Deleted.
Source/WTF:
Add functions to count the consecutive zero bits (trailing) on the
right with modulus division and lookup. Reference: Bit Twiddling Hacks.
* wtf/MathExtras.h:
(WTF::countTrailingZeros):
Canonical link: https://commits.webkit.org/239084@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-23 22:09:31 +00:00
2021-06-23 Yijia Huang <yijia_huang@apple.com>
Add a new pattern to instruction selector to utilize UBFIZ supported by ARM64
https://bugs.webkit.org/show_bug.cgi?id=227204
Reviewed by Filip Pizlo.
Add functions to count the consecutive zero bits (trailing) on the
right with modulus division and lookup. Reference: Bit Twiddling Hacks.
* wtf/MathExtras.h:
(WTF::countTrailingZeros):
2021-06-23 20:27:12 +00:00
2021-06-23 Kate Cheney <katherine_cheney@apple.com>
Migrate App Privacy Report code from WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=227045
<rdar://problem/74333287>
Reviewed by Alex Christensen.
Update compile flag naming to align with the App Privacy Report
feature. Added a new check for Symptoms for a simpler, more clear
check.
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:
2021-06-23 20:02:35 +00:00
2021-06-23 Aditya Keerthi <akeerthi@apple.com>
[iOS] Adopt new date picker presentation SPI
https://bugs.webkit.org/show_bug.cgi?id=227221
<rdar://problem/77930086>
Reviewed by Wenson Hsieh.
* wtf/PlatformHave.h:
Add HAVE(UIDATEPICKER_OVERLAY_PRESENTATION) and HAVE(UITOOLBAR_STANDARD_APPEARANCE).
Improve more of the CSS list style implementations
https://bugs.webkit.org/show_bug.cgi?id=227206
Reviewed by Antti Koivisto.
Source/WebCore:
Added support for 12 new values for list-style-type: disclosure-closed,
disclosure-open, ethiopic-numeric, japanese-formal, japanese-informal,
korean-hangul-formal, korean-hanja-formal, korean-hanja-informal,
simp-chinese-formal, simp-chinese-informal, trad-chinese-informal,
and trad-chinese-formal.
Improved implementation to match specification more closely for a few
existing values for list-style-type: armenian, cjk-ideographic, hebrew,
lower-armenian, lower-roman, upper-armenian, and upper-roman.
Fixed a rendering issue where we would position list items incorrectly
in list-style-position:inside cases because of measuring the list marker
widths and the list marker suffix widths separately and adding them
instead of measuring them together. This was causing some of the
Web Platform Tests, done using ref tests, to fail.
* accessibility/AccessibilityObject.cpp:
(WebCore::listMarkerTextForNode): Updated since
RenderListItem::markerTextWithSuffix now returns a StringView.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue const): Updated
to call RenderListMarker::textWithoutSuffix.
* accessibility/atk/WebKitAccessibleHyperlink.cpp:
(rangeLengthForObject): Ditto.
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(accessibilityObjectLength): Ditto.
(webkitAccessibleTextGetText): Updated since
RenderListItem::markerTextWithSuffix now returns a StringView.
* css/CSSPrimitiveValueMappings.h:
(WebCore::toCSSValueID): Factored this out into a separate helper.
Also made it take advantage of the relationship between the enumeration
and the CSS value keywords that the code in the other direction already
was relying on so we don't have to list all the keywords.
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Refactored to call the
toCSSValueID function.
* css/CSSValueKeywords.in: Added 12 new list-type-style constants:
disclosure-open, disclosure-closed, japanese-informal, japanese-formal,
korean-hangul-formal, korean-hanja-informal, korean-hanja-formal,
simp-chinese-informal, simp-chinese-formal, trad-chinese-informal,
trad-chinese-formal, and ethiopic-numeric.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::isPredefinedCounterStyle): Updated
since the last predefined counter style is EthiopicNumeric.
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::markerTextWithoutSuffix const): Renamed from
markerText, and changed to return a StringView.
(WebCore::RenderListItem::markerTextWithSuffix const): Return a StringView.
* rendering/RenderListItem.h: Updated for the above.
* rendering/RenderListMarker.cpp:
(WebCore::toRoman): Deleted.
(WebCore::toAlphabeticOrNumeric): Tweaked to use compile time instead of
runtime checks for alphabetic vs. numeric.
(WebCore::toSymbolic): Updated for above.
(WebCore::toAlphabetic): Ditto.
(WebCore::toNumeric): Ditto.
(WebCore::toHebrewUnder1000): Deleted.
(WebCore::toHebrew): Deleted.
(WebCore::toArmenianUnder10000): Deleted.
(WebCore::toArmenian): Deleted.
(WebCore::toGeorgian): Deleted.
(WebCore::toCJKIdeographic): Added handling for negative numbers and also
tweaked coding style a bit.
(WebCore::toPredefinedAdditiveSystem): Added. Implements the additive
system concept, which we use below to re-implement Hebrew, Armenian,
Georgian, Japanese, and Korean styles.
(WebCore::toEthiopicNumeric): Added.
(WebCore::effectiveListMarkerType): Added the new styles. Also updated the
allowable values for CJKIdeographic to allow negative numbers, and for Hebrew
to no longer allow 0 or numbers over 10999. Also sorted the sections by the
name of the first list style type in each section.
(WebCore::listMarkerSuffix): Changed to return a StringView instead of a
UChar, and include the trailing space. Choose the suffix based on the
specified type and not the effective type, so fallback does not cause the
suffix to fall back. Added the new types.
(WebCore::suffixRequiresSpace): Deleted.
(WebCore::listMarkerText): Added implementations for all the new types.
Also updated the implementation of CJKIdeographic, LowerRoman, UpperRoman,
Armenian, UpperArmenian, LowerArmenian, Georgian, and Hebrew to match a
newer CSS specification draft, and in most cases was able to use
toPredefinedAdditiveSystem instead of language-specific functions.
(WebCore::RenderListMarker::createInlineBox): Stop using the isText function,
which was only used here.
(WebCore::RenderListMarker::paint): Updated for the name change of
relativeMarkerRect. Removed unneeded special case for ListStyleType::None.
Use the new RenderListMarker::textRun function, moving all the code that
deals with direction and suffix in there.
(WebCore::reversed): Added. Helper used by textRun.
(WebCore::RenderListMarker::textRun const): Added. Composes a TextRun for
drawing or measuring text. By using the same function in all those places,
we guarantee we measure the text together instead of in pieces, which fixes
some layout errors leading to test failures that measuring separately and
adding the results together was causing.
(WebCore::RenderListMarker::addOverflowFromListMarker): Use the data
member m_lineOffsetForListItem instead of the lineOffsetForListItem
function, which was only used here.
(WebCore::RenderListMarker::updateMarginsAndContent): Moved the check of
preferredLogicalWidthsDirty and the comment about it here.
(WebCore::RenderListMarker::updateContent): Moved check of
preferredLogicalWidthsDirty out of this function since one caller asserts
it, and so the other caller can do the check itself. Added code to set
m_textWithSuffix, m_textWithoutSuffixLength, and m_textIsLeftToRightDirection.
Removed unneeded special cases for ListStyleType::None, Circle, Disc, and
Square, which are all handled correctly by the main algorithm. Added a FIXME
about the inadequacy of our bidi algorithm implementation for the general case.
(WebCore::RenderListMarker::computePreferredLogicalWidths): Use the new
textRun function, allowing us to remove some special case code, including
the special cases for ListStyleType::None, Asterisks, Footnotes, and String.
(WebCore::RenderListMarker::updateMargins): Removed unneeded special case for
ListStyleType::None, and updated string empty checks for the new name of the
m_textWithSuffix data member.
(WebCore::RenderListMarker::suffix const): Deleted.
(WebCore::RenderListMarker::relativeMarkerRect): Renamed from
getRelativeMarkerRect. Use the new textRun function, allowing us to remove
some special case code, including the special cases for ListTyleType::None,
Asterisks, Footnotes, and String.
(WebCore::RenderListMarker::textWithoutSuffix const): Added.
* rendering/RenderListMarker.h: Marked functions as final instead of just
override. Got rid of unneeded suffix and lineOffsetForListItem functions.
Renamed text ot textWithoutSuffix and added textWithSuffix. Added textRun
private member function. Replaced m_text with m_textWithSuffix,
m_textWithoutSuffixLength, and m_textIsLeftToRightDirection.
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject): Use textWithoutSuffix.
(WebCore::markerTextForListItem): Use markerTextWithoutSuffix.
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<): Use getValueName from CSSValueKeywords.h and
toCSSValueID to avoid repeating the names of all the list style types here.
* rendering/style/RenderStyleConstants.h: Added the 12 new list style types.
Source/WTF:
* wtf/unicode/CharacterNames.h: Added blackDown/Left/RightPointingSmallTriangle.
LayoutTests:
* TestExpectations: Expect about 50 more css-counter-styles tests to pass.
* fast/lists/li-values-expected.txt: Updated to expect newly specified behavior. When
this test was written, the specification was different.
* fast/lists/li-values.html: Ditto.
* fast/lists/w3-css3-list-styles-fallback-style-expected.txt: Ditto. Also many of these
were expecting failures.
* fast/lists/w3-css3-list-styles-fallback-style.html: Ditto.
* fast/lists/w3-css3-list-styles-numeric-expected.txt: Ditto. Also added tests for
ethiopic-numeric.
* fast/lists/w3-css3-list-styles-numeric.html: Ditto.
* fast/lists/w3-list-styles-expected.txt: Updated expected result for 0 in Hebrew.
* platform/mac/TestExpectations: Moved some image failure expectations from here to the
main TestExpectations because they do not seem to be platform-specific.
Canonical link: https://commits.webkit.org/239062@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-23 01:33:57 +00:00
2021-06-21 Darin Adler <darin@apple.com>
Improve more of the CSS list style implementations
https://bugs.webkit.org/show_bug.cgi?id=227206
Reviewed by Antti Koivisto.
* wtf/unicode/CharacterNames.h: Added blackDown/Left/RightPointingSmallTriangle.
[Live Text] [macOS] Add an internal option to disable inline text selection in images
https://bugs.webkit.org/show_bug.cgi?id=227265
rdar://79460142
Reviewed by Tim Horton.
Source/WebCore:
Add support for the new feature flag. See WebKit/ChangeLog for more details.
* en.lproj/Localizable.strings:
Add additional localizable strings to represent each of the possible titles for the "Quick Look"/"Look Up"
context menu item. When inline text selection is enabled, the item shows up as "Look Up", and is only added if
we actually discover visual search results.
However, when inline text selection is disabled, this item will always be added to the context menu under the
title "Quick Look", and will be retitled to either "Look Up in Quick Look" or "Select Text in Quick Look" once
either visual search results or text is recognized, respectively.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::populate):
In the case where inline text selection is disabled, add the Quick Look item to the end of the context menu,
after a separator. Note that in the case where inline text selection is enabled, it doesn't actually matter
where we add this item, since it is automatically removed and only reinserted if we find visual search results
for the image.
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):
Rename the existing ContextMenuItemTagLookUpImage to ContextMenuItemTagQuickLookImage, since it is no longer
limited to the visual look up feature.
* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode):
Consult the feature flag and avoid kicking off the text recognition timer if inline text selection is disabled.
* platform/ContextMenuItem.cpp:
(WebCore::isValidContextMenuAction):
* platform/ContextMenuItem.h:
* platform/LocalizedStrings.h:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::contextMenuItemTagQuickLookImage):
(WebCore::contextMenuItemTagQuickLookImageForTextSelection):
(WebCore::contextMenuItemTagQuickLookImageForVisualSearch):
Source/WebKit:
Refactor Live Text and Visual Look Up logic, such that the ability to select text inside of images is behind an
internal feature flag that can be toggled at runtime. When Live Text is disabled, we'll unconditionally show the
"Look Up" context menu action using the more generic title "Quick Look". This "Quick Look" action is then
retitled to either "Look Up in Quick Look" or "Select Text in Quick Look" once image analysis completes.
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
(WebKit::toImpl):
Rename ContextMenuItemTagLookUpImage to ContextMenuItemTagQuickLookImage.
* UIProcess/Cocoa/QuickLookPreviewActivity.h: Copied from Source/WebKit/UIProcess/mac/WKQuickLookPreviewController.h.
Move this enum out of WKQuickLookPreviewController.h, such that we can use and import it in non-Cocoa headers
and implementation files.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::computeHasImageAnalysisResults):
Rename `computeHasVisualSearchResults` to `computeHasImageAnalysisResults`, and allow it to take a flag to
indicate whether or not it should request text recognition results or visual search results. We use this for the
"Quick Look" context menu action when inline text selection is disabled, in order to retitle the item to "Select
Text in Quick Look".
(WebKit::WebViewImpl::computeHasVisualSearchResults): Deleted.
* UIProcess/PageClient.h:
(WebKit::PageClient::computeHasImageAnalysisResults):
(WebKit::PageClient::computeHasVisualSearchResults): Deleted.
* UIProcess/WebContextMenuProxy.h:
(WebKit::WebContextMenuProxy::quickLookPreviewActivity const):
Add a flag to WebContextMenuProxy to determine what initial activity to use when presenting the QuickLook
preview panel after selecting the ContextMenuItemTagQuickLookImage item.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::contextMenuItemSelected):
(WebKit::WebPageProxy::computeHasImageAnalysisResults):
(WebKit::WebPageProxy::computeHasVisualSearchResults): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::computeHasImageAnalysisResults):
(WebKit::PageClientImpl::computeHasVisualSearchResults): Deleted.
* UIProcess/mac/WKQuickLookPreviewController.h:
* UIProcess/mac/WKQuickLookPreviewController.mm:
* UIProcess/mac/WebContextMenuProxyMac.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::menuItemIdentifier):
(WebKit::WebContextMenuProxyMac::getContextMenuFromItems):
Add logic to either remove and reinsert the "Look Up" context menu action (if inline text selection in images is
enabled), or to promote the "Quick Look" context menu action to either "Select Text in Quick Look" or "Look Up
in Quick Look" in the case where inline text selection in images is disabled.
Note that when inline text selection in images is disabled, we'll first check for visual search results before
checking for text. This is because visual search results will take precedence over text selection (i.e., we'll
show "Look Up in Quick Look" even if both visual search results and text is present), so we can avoid performing
text analysis in the case where we already found visual search results.
(WebKit::WebContextMenuProxyMac::insertOrUpdateQuickLookImageItem):
(WebKit::WebContextMenuProxyMac::updateQuickLookContextMenuItemTitle):
Add a helper method to find and update the title of the NSMenuItem corresponding to
ContextMenuItemTagQuickLookImage. See `getContextMenuFromItems` above for more details.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::handleContextMenuQuickLookImage):
(WebKit::WebPageProxy::handleContextMenuLookUpImage): Deleted.
Rename this to `handleContextMenuQuickLookImage`, and have it take an argument to indicate whether the QuickLook
panel should start out in Visual Look Up mode.
* WebKit.xcodeproj/project.pbxproj:
Source/WebKitLegacy/mac:
Rename ContextMenuItemTagLookUpImage to ContextMenuItemTagQuickLookImage.
* WebView/WebHTMLView.mm:
(toTag):
Source/WTF:
Add a new internal feature flag. See WebKit ChangeLog for more details.
* Scripts/Preferences/WebPreferencesInternal.yaml:
Canonical link: https://commits.webkit.org/239061@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-23 01:32:54 +00:00
2021-06-22 Wenson Hsieh <wenson_hsieh@apple.com>
[Live Text] [macOS] Add an internal option to disable inline text selection in images
https://bugs.webkit.org/show_bug.cgi?id=227265
rdar://79460142
Reviewed by Tim Horton.
Add a new internal feature flag. See WebKit ChangeLog for more details.
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-06-22 19:47:57 +00:00
2021-06-22 Fujii Hironori <Hironori.Fujii@sony.com>
[GLib] Rewrite NetworkCache::Data::adoptMap without FileSystem::MappedFileData::leakHandle and munmap
https://bugs.webkit.org/show_bug.cgi?id=227017
Reviewed by Carlos Garcia Campos.
* wtf/FileSystem.h: MappedFileData::leakHandle is used only if PLATFORM(COCOA) now.
2021-06-22 17:48:42 +00:00
2021-06-22 Saam Barati <sbarati@apple.com>
jitCompileAndSetHeuristics shouldn't return true when we fail to compile
https://bugs.webkit.org/show_bug.cgi?id=227155
Reviewed by Tadeu Zagallo.
* wtf/WeakRandom.h:
2021-06-22 16:44:56 +00:00
2021-06-22 Truitt Savell <tsavell@apple.com>
Unreviewed, reverting r279083.
Broke Mac Builds
Reverted changeset:
"Migrate App Privacy Report code from WebKitAdditions"
https://bugs.webkit.org/show_bug.cgi?id=227045
https://commits.webkit.org/r279083
2021-06-22 13:25:03 +00:00
2021-06-22 Kimmo Kinnunen <kkinnunen@apple.com>
Functions dispatched to WorkQueue are sometimes destroyed in the calling thread due to block refcounting
https://bugs.webkit.org/show_bug.cgi?id=227160
Reviewed by Antti Koivisto.
WorkQueue::dispatch Function bodies always execute in the thread of target
queue. However, sometimes the Function destruction would happen in the
dispatched-from thread. This is not what the WorkQueue::dispatch callers
expect.
Implement some of the WorkQueue::dispatch* in terms of dispatch_..._f()
variants which take a function and context pointer instead of a block.
Blocks are reference counted objects without the ability to pass the
ownership of the reference. For dispatch case, it means that caller will
need to hold the reference while dispatch_...() returns. In thread
contention cases the called block might complete and reference be
dropped in the thread of the queue before the dispatched-from thread
would drop its reference to the block. This would cause the dispatched
Function to be destroyed in the dispatched-from thread.
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::dispatchWorkItem):
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):
(WTF::WorkQueue::dispatchSync):
2021-06-22 01:24:46 +00:00
2021-06-21 Chris Dumez <cdumez@apple.com>
Adjust `fetch` port blocking for ports 990, 989
https://bugs.webkit.org/show_bug.cgi?id=226971
<rdar://problem/79287147>
Reviewed by Geoffrey Garen.
Prevent connecting to ports 989 & 990 as per:
- https://github.com/whatwg/fetch/pull/1250
* wtf/URL.cpp:
(WTF::portAllowed):
2021-06-21 21:42:01 +00:00
2021-06-21 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] Turn ENABLE_SHAREABLE_RESOURCE on
https://bugs.webkit.org/show_bug.cgi?id=227011
Reviewed by Don Olmstead.
Added a new member m_fileMapping to MappedFileData to store a file
mapping object handle to create a SharedMemory from a
MappedFileData on Windows.
Conditioned out MappedFileData::leakHandle() if OS(WINDOWS). And,
removed unmapViewOfFile(). Destruction of MappedFileData should be
done by ~MappedFileData.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::MappedFileData::~MappedFileData):
(WTF::FileSystemImpl::MappedFileData::mapFileHandle):
(WTF::FileSystemImpl::unmapViewOfFile): Deleted.
* wtf/FileSystem.h:
(WTF::FileSystemImpl::MappedFileData::fileMapping const):
(WTF::FileSystemImpl::MappedFileData::MappedFileData):
(WTF::FileSystemImpl::MappedFileData::operator=):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::MappedFileData::~MappedFileData):
(WTF::FileSystemImpl::MappedFileData::mapFileHandle):
(WTF::FileSystemImpl::unmapViewOfFile): Deleted.
2021-06-21 21:25:45 +00:00
2021-06-21 Kate Cheney <katherine_cheney@apple.com>
Migrate App Privacy Report code from WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=227045
<rdar://problem/74333287>
Reviewed by Alex Christensen.
Update compile flag naming to align with the App Privacy Report
feature.
* wtf/PlatformEnableCocoa.h:
2021-06-21 18:48:29 +00:00
2021-06-21 Kimmo Kinnunen <kkinnunen@apple.com>
makeUnique cannot be used to instantiate function-local classes
https://bugs.webkit.org/show_bug.cgi?id=227163
Reviewed by Antti Koivisto.
Make WTF_MAKE_FAST_ALLOCATED and similar macros work in function
local classes. Mark the typedef that is used to enforce semicolon
after the macro as unused to avoid unused typedef warning.
Fixes cases where the compiler is able to prove that it sees all the
use sites of the class and the typedef is not used.
* wtf/Compiler.h:
* wtf/FastMalloc.h:
2021-06-21 08:36:09 +00:00
2021-06-21 Philippe Normand <pnormand@igalia.com>
Unreviewed build fix after r279062
* wtf/Span.h:
(std::is_convertible_v<std::remove_pointer_t<decltype):
2021-06-21 02:51:33 +00:00
2021-06-20 Sam Weinig <weinig@apple.com>
Replace Span implementation with one from libc++, which is more spec complient
https://bugs.webkit.org/show_bug.cgi?id=227197
Reviewed by Darin Adler.
* wtf/Span.h:
The tcb span implementation had some SFINAE issues when converting containers
had data() and size() member functions but were not span compatible that were
causing failures. Rather than trying to fix those, this adopts a modified version
of the libc++ span implementation which is more up-to-date.
To fix MSVC compile issues, the as_bytes/as_writable_bytes functions have been
re-implemented to not work around a compile issue seen where using the dynamic_extent
specicialization from the static extent specicialization was failing to compile.
2021-06-20 23:22:06 +00:00
2021-06-20 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Rename WKVisualSearchPreviewController to WKQuickLookPreviewController
https://bugs.webkit.org/show_bug.cgi?id=227193
Reviewed by Sam Weinig.
Add some compile-time flags to guard QuickLook SPI declarations.
* wtf/PlatformHave.h:
2021-06-20 20:33:15 +00:00
2021-06-20 Sam Weinig <weinig@apple.com>
Adopt Span in SHA1.h
https://bugs.webkit.org/show_bug.cgi?id=227184
Reviewed by Chris Dumez.
Replaces overload of addBytes taking a Vector with ones taking
a Span and add overloads for Span<const std::byte> which all the
others are now implemented in terms of. This is useful since
any Span can be turned into one of type Span<const std::byte>
just by calling asBytes(existingSpan).
This leaves most of the existing overloads in place (though
simplifies them by implementing them as Span contructions),
though we should consider removing some in a separate pass.
* wtf/SHA1.cpp:
* wtf/SHA1.h:
2021-06-20 02:05:08 +00:00
2021-06-19 Sam Weinig <weinig@apple.com>
Adopt Span in Base64.h
https://bugs.webkit.org/show_bug.cgi?id=227132
Reviewed by Chris Dumez.
Replaces overloads taking Vectors with ones taking Spans
and add overloads for Span<const std::byte> which all the
others are now implemented in terms of. This is useful since
any Span can be turned into one of type Span<const std::byte>
just by calling asBytes(existingSpan).
This leaves most of the existing overloads in place (though
simplifies them by implementing them as Span contructions)
though we should consider removing some in a separate pass.
* wtf/Vector.h:
Add value_type typedef so that Vector<T> can be automatically
deduced as Span<T>.
* wtf/text/CString.h:
Add bytes() and bytesInludingNullTerminator() (only the former
is used in this patch, but the later will be needed shortly)
which return Span<const uint8_t> of the CString. I chose to use
an explicit function, rather than making it converible to Span
like Vector, because some callers will want the null terminator
and some will not.
* wtf/text/Base64.cpp:
* wtf/text/Base64.h:
Canonicalize all input buffers either as a Span<const std::byte> or
a StringView, making all the other overloads just forward to one of
those two (String -> StringView, everything else -> Span<const std::byte>).
Clean up the header a bit by putting all the declarations at the top of
the file.
2021-06-18 04:09:24 +00:00
2021-06-17 Said Abou-Hallawa <said@apple.com>
[Cocoa] Disable hardware decoding in the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=226869
<rdar://77548905>
Reviewed by Per Arne Vollan and Simon Fraser.
Add have macros for using:
1. kCGImageSourceEnableRestrictedDecoding
2. VTRestrictVideoDecoders()
* wtf/PlatformHave.h:
2021-06-18 02:06:58 +00:00
2021-06-17 Mark Lam <mark.lam@apple.com>
Rename numberOfPACBits to maxNumberOfAllowedPACBits.
https://bugs.webkit.org/show_bug.cgi?id=227156
Reviewed by Saam Barati.
* wtf/CagedPtr.h:
2021-06-18 01:44:42 +00:00
2021-06-17 Mark Lam <mark.lam@apple.com>
Define MacroAssemblerARM64E::numberOfPACBits based on OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH).
https://bugs.webkit.org/show_bug.cgi?id=227147
rdar://78785309
Reviewed by Saam Barati.
For OS(DARWIN), define OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) in terms of
MACH_VM_MAX_ADDRESS, which is provided by the SDK. This ensures that it is
correct for each target OS(DARWIN) platform.
Also update an assertion in WTFAssertions.cpp to verify that address bits are
less than 48. The purpose of this assertion is to ensure that our 64-bit NaN
boxing encoding for JSValues will work. Hence, we should use the encoding limit
for pointers of 48 bits. It no longer makes sense to assert based on
OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH), because OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH)
is defined in terms of MACH_VM_MAX_ADDRESS.
* wtf/CagedPtr.h:
* wtf/CompactPointerTuple.h:
* wtf/PlatformOS.h:
* wtf/WTFAssertions.cpp:
* wtf/threads/Signals.cpp:
2021-06-18 01:27:53 +00:00
2021-06-17 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] WTF.ParseInteger and WTF.ParseIntegerAllowingTrailingJunk are failing
https://bugs.webkit.org/show_bug.cgi?id=227090
Reviewed by Yusuke Suzuki.
ArithmeticOperations::sub unexpectedly reported an overflow for
the result of std::numeric_limits<ResultType>::min() in MSVC code path.
For example, Checked<int, RecordOverflow>(INT_MIN + 1) - 1 was reported an overflow.
In the case of calculating (lhs - rhs), and lhs < 0 and rhs > 0,
the original code reported an overflow if (rhs > max() + lhs).
Mathematically, this condition checks (lhs - rhs < -max()).
It should use min() instead of max() in this case. It should be
(lhs - rhs < min()) mathematically.
* wtf/CheckedArithmetic.h:
2021-06-18 00:00:29 +00:00
2021-06-17 Alex Christensen <achristensen@webkit.org>
Add assertion in RunLoop::dispatch
https://bugs.webkit.org/show_bug.cgi?id=227154
<rdar://79243769>
Reviewed by Geoff Garen.
This should help us find what is scheduling null functions.
* wtf/RunLoop.cpp:
(WTF::RunLoop::dispatch):
(WTF::RunLoop::dispatchAfter):
2021-06-17 20:49:31 +00:00
2021-06-17 Ben Nham <nham@apple.com>
Remove Mac-specific CPUTime functions
https://bugs.webkit.org/show_bug.cgi?id=227109
Reviewed by Yusuke Suzuki.
There's no reason for the Mac-specific CPU time functions to exist, since getrusage and
clock_gettime work fine on Mac. It's actually slightly more efficient to use the POSIX calls
since getrusage returns CPU time for both current and terminated threads in a single
syscall, while using task_info requires two syscalls to do the same thing.
* WTF.xcodeproj/project.pbxproj:
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformPlayStation.cmake:
* wtf/PlatformWPE.cmake:
* wtf/cocoa/CPUTimeCocoa.cpp: Removed.
* wtf/posix/CPUTimePOSIX.cpp: Renamed from Source/WTF/wtf/unix/CPUTimeUnix.cpp.
2021-06-17 20:00:49 +00:00
2021-06-17 Tim Horton <timothy_horton@apple.com>
Adopt WKHoverGestureRecognizer
https://bugs.webkit.org/show_bug.cgi?id=227116
<rdar://79442027>
Reviewed by Wenson Hsieh.
* wtf/PlatformEnableCocoa.h:
2021-06-17 03:26:28 +00:00
2021-06-16 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Disable JITCage on macOS until we evaluate performance throughly
https://bugs.webkit.org/show_bug.cgi?id=227104
Reviewed by Mark Lam.
This patch disables JITCage on macOS until we evaluate performance throughly.
* wtf/PlatformEnable.h:
2021-06-16 15:41:15 +00:00
2021-06-16 Alicia Boya García <aboya@igalia.com>
[WTF] DataMutex: Assert on double locking on the same thread
https://bugs.webkit.org/show_bug.cgi?id=227069
Reviewed by Xabier Rodriguez-Calvar.
DataMutex used to use OwnerAwareLock to track what thread is holding
the mutex and emit assertion errors if a thread is found attempting to
lock a mutex held by that same thread. This turns deadlocks into
runtime errors.
OwnerAwareLock was removed when DataMutex got clang thread safety
annotations. This patch reintroduces the same logic, while keeping
thread-safety annotations.
This fixes WTF_DataMutex.DoubleLockDeathTest, which tested this
functionality and was previously regressed.
* wtf/DataMutex.h:
2021-06-15 19:15:32 +00:00
2021-06-06 Darin Adler <darin@apple.com>
Delete some recently-obsoleted files
https://bugs.webkit.org/show_bug.cgi?id=226705
Reviewed by Chris Dumez.
* wtf/CMakeLists.txt: Removed Optional.h.
* wtf/Optional.h: Removed.
2021-06-15 16:59:15 +00:00
2021-06-15 Alex Christensen <achristensen@webkit.org>
Check for "xn--" in any subdomain when parsing URL hosts
https://bugs.webkit.org/show_bug.cgi?id=226912
Reviewed by Darin Adler.
We have a fast path that doesn't call uidna_nameToASCII if the host is already ASCII.
We need to check if the host is properly-punycode-encoded if it starts with "xn--"
but we also need to check if any subdomain starts with "xn--" (not just the first one).
In order to not regress tests, I needed to also take the fix I did in r256629 and apply it to all use of uidna_nameToASCII.
* wtf/URL.cpp:
(WTF::appendEncodedHostname):
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::mapHostName):
* wtf/URLParser.cpp:
(WTF::URLParser::domainToASCII):
(WTF::URLParser::subdomainStartsWithXNDashDash):
(WTF::URLParser::parseHostAndPort):
(WTF::URLParser::startsWithXNDashDash): Deleted.
* wtf/URLParser.h:
2021-06-15 16:47:42 +00:00
2021-06-15 Michael Catanzaro <mcatanzaro@gnome.org>
-Warray-bounds warning in Packed.h
https://bugs.webkit.org/show_bug.cgi?id=226557
<rdar://problem/79103658>
Reviewed by Darin Adler.
* wtf/Bitmap.h:
(WTF::WordType>::clear): Use the newly-introduced IGNORE_ARRAY_BOUNDS_WARNINGS macros
instead of vanilla IGNORE_WARNINGS.
* wtf/Compiler.h: Add new IGNORE_ARRAY_BOUNDS_WARNINGS_[BEGIN,END] macros, since this
warning is now suppressed in several different places.
* wtf/Packed.h: Suppress the warning. Also, add a static_assert for safety.
2021-06-15 16:46:14 +00:00
2021-06-15 Brent Fulgham <bfulgham@apple.com>
[Cocoa] Harden WebAuthn process by restricting to browser-entitled processes
https://bugs.webkit.org/show_bug.cgi?id=226772
<rdar://problem/74721877>
Reviewed by Darin Adler.
Add a new entitlement utility that returns the String value of a given entitlement for
the process with the provided audit token.
* wtf/cocoa/Entitlements.h:
* wtf/cocoa/Entitlements.mm:
(WTF::hasEntitlementValue):
* wtf/PlatformHave.h: Add item for PAC shared region feature.
2021-06-14 09:28:55 +00:00
2021-06-14 Per Arne <pvollan@apple.com>
[iOS] Sync Accessibility preferences
https://bugs.webkit.org/show_bug.cgi?id=226738
<rdar://77922839>
Reviewed by Brent Fulgham.
Enable Per-App Accessibility preferences on iOS.
* wtf/PlatformHave.h:
2021-06-12 21:45:31 +00:00
2021-06-12 Wenson Hsieh <wenson_hsieh@apple.com>
Number pad button is missing its image when tapping on <input type=tel> in watchOS 8
https://bugs.webkit.org/show_bug.cgi?id=226955
Reviewed by Darin Adler.
Add compile-time flags to guard the presence of `PUICQuickboardController` and `PUICButtonTypePill`.
* wtf/PlatformHave.h:
2021-06-12 01:42:09 +00:00
2021-06-11 Ryosuke Niwa <rniwa@webkit.org>
Add WeakHashMap
https://bugs.webkit.org/show_bug.cgi?id=226872
Reviewed by Geoffrey Garen.
Added WeakHashMap which deletes entries during rehashing and amortized over time (based on
the number of read & write accesses done on a given WeakHashMap instance).
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/WeakHashMap.h: Added.
(WTF::WeakHashMap): Added.
(WTF::WeakHashMap::PeekKeyValuePairTraits): Added.
(WTF::WeakHashMap::PeekType): Added.
(WTF::WeakHashMap::PeekPtrType): Added. Unlike a regular HashMap, we need to fake the iterator
pointer value with this struct since key-value pair doesn't exist in HashTable itself as it stores
Ref<WeakRefImpl> instead.
(WTF::WeakHashMap::WeakHashMapIteratorBase): Added. Has a bunch of helper functions so that
WeakHashMapIterator and WeakHashMapConstIterator can share the code.
(WTF::WeakHashMap::WeakHashMapIterator): Added.
(WTF::WeakHashMap::WeakHashMapConstIterator): Added.
(WTF::WeakHashMap::AddResult): Added.
(WTF::WeakHashMap::begin): Added.
(WTF::WeakHashMap::end): Added.
(WTF::WeakHashMap::add): Added.
(WTF::WeakHashMap::set): Added.
(WTF::WeakHashMap::find): Added.
(WTF::WeakHashMap::contains): Added.
(WTF::WeakHashMap::get): Added.
(WTF::WeakHashMap::remove): Added.
(WTF::WeakHashMap::removeIf): Added.
(WTF::WeakHashMap::clear): Added.
(WTF::WeakHashMap::capacity): Added.
(WTF::WeakHashMap::isEmptyIgnoringNullReferences): Added. This is akin to WeakHashSet::computesEmpty.
Per prior discussion, we intend to rename WeakHashSet's version to this name as well for clarity.
Note that this function will clear the hash table completely if the map is semantically empty
but HashTable contains null references as keys.
(WTF::WeakHashMap::hasNullReferences): Added. Triggers amortized cleanup based on the number
of iterations performed. If there are no null references, it resets m_operationCountSinceLastCleanup.
(WTF::WeakHashMap::computeSize): Added.
(WTF::WeakHashMap::removeNullReferences): Added. Since WeakHashMap doesn't eagerly delete the value
when the key goes away, this function should be called when values held onto by WeakRefImpl with
the nullptr back pointer should be deleted en masse.
(WTF::WeakHashMap::checkConsistency): Added.
(WTF::WeakHashMap::makeKeyImpl): Added.
(WTF::WeakHashMap::keyImplIfExists): Added.
* wtf/WeakPtr.h:
2021-06-11 20:44:21 +00:00
2021-06-11 Jonathan Bedard <jbedard@apple.com>
[Monterey] Support building WebKit
https://bugs.webkit.org/show_bug.cgi?id=226846
<rdar://problem/79095148>
Reviewed by Tim Horton.
* wtf/PlatformHave.h: Add HAVE(VK_IMAGE_ANALYSIS).
* wtf/spi/cocoa/SecuritySPI.h:
2021-06-09 20:46:24 +00:00
2021-06-09 Chris Dumez <cdumez@apple.com>
Avoid some calls to StringView::toString() / StringView::toStringWithoutCopying()
https://bugs.webkit.org/show_bug.cgi?id=226803
Reviewed by Darin Adler.
Add support to TextStream for printing a StringView directly, without having to convert
it to a String first.
* wtf/text/TextStream.cpp:
(WTF::TextStream::operator<<):
* wtf/text/TextStream.h:
2021-06-09 10:58:36 +00:00
2021-06-09 Alicia Boya García <aboya@igalia.com>
[WTF][GStreamer] Add RAII lockers for 3rd party locks
https://bugs.webkit.org/show_bug.cgi?id=225650
Reviewed by Xabier Rodriguez-Calvar.
This patch introduces WTF::ExternalLocker, which allows to lock 3rd
party mutexes in a RAII fashion, very similar to WTF::Locker.
This is used also in WebCore to provide RAII lockers for GStreamer.
* wtf/Locker.h:
(WTF::unlockFunction):
2021-06-09 05:08:25 +00:00
2021-06-08 Alex Christensen <achristensen@webkit.org>
Move PrivacyStance code from WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=226774
Reviewed by Jer Noble.
* wtf/PlatformHave.h:
2021-06-09 02:26:34 +00:00
2021-06-08 Ben Nham <nham@apple.com>
Use access instead of stat in some filesystem functions
https://bugs.webkit.org/show_bug.cgi?id=226667
Reviewed by Chris Dumez.
We are spending a bit more time in WTF::FileSystemImpl functions after the move to
std::filesystem (https://bugs.webkit.org/show_bug.cgi?id=225255). In particular, several
std::filesystem functions (like the ones called by fileExists and makeAllDirectories) prefer
to use stat() over access() for file existence checks. Since our sandbox has a fast path for
access(path, F_OK) but not for stat, we ended up spending more time in sandbox evaluation in
the kernel after the move to std::filesystem.
Note that the two checks don't do exactly the same thing. access(path, F_OK) only checks for
path existence, while stat(path) additionally fetches metadata, which requires checking the
file-read-metadata permission. But in practice our code was written to be fine with just
checking for existence.
To work around this, I've re-introduced some of the old WTF::FileSystemImpl functions from
FileSystemPosix.cpp. They are the ones that are called by NetworkCache, which seems to be
the biggest consumer of these functions. The rest of the functions are still implemented
using std::filesystem.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fileExists):
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::pathByAppendingComponent):
(WTF::FileSystemImpl::pathByAppendingComponents):
* wtf/PlatformEnableCocoa.h:
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::fileExists):
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::pathByAppendingComponent):
(WTF::FileSystemImpl::pathByAppendingComponents):
2021-06-08 22:15:18 +00:00
2021-06-08 Devin Rousso <drousso@apple.com>
[Payment Request] upstream new features
https://bugs.webkit.org/show_bug.cgi?id=226740
<rdar://problem/78963132>
Reviewed by Andy Estes.
- recurring line items (`HAVE_PASSKIT_RECURRING_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_RECURRING_LINE_ITEM`)
- deferred line items (`HAVE_PASSKIT_DEFERRED_SUMMARY_ITEM` and `ENABLE_APPLE_PAY_DEFERRED_LINE_ITEM`)
- estimated shipping dates (`HAVE_PASSKIT_SHIPPING_METHOD_DATE_COMPONENTS_RANGE` and `ENABLE_APPLE_PAY_SHIPPING_METHOD_DATE_COMPONENTS_RANGE`)
- coupon code entry (`HAVE_PASSKIT_COUPON_CODE` and `ENABLE_APPLE_PAY_COUPON_CODE`)
- shipped vs in-store pickup (`HAVE_PASSKIT_SHIPPING_CONTACT_EDITING_MODE` and `ENABLE_APPLE_PAY_SHIPPING_CONTACT_EDITING_MODE`)
* wtf/PlatformHave.h:
* wtf/PlatformEnableCocoa.h:
2021-06-08 17:35:15 +00:00
2021-06-08 Chris Dumez <cdumez@apple.com>
Reduce use of reinterpret_cast<> in the codebase
https://bugs.webkit.org/show_bug.cgi?id=226743
Reviewed by Darin Adler.
* wtf/CryptographicallyRandomNumber.cpp:
* wtf/FastMalloc.h:
(WTF::FastAllocator::allocate):
* wtf/SHA1.h:
(WTF::SHA1::addBytes):
* wtf/StackCheck.h:
(WTF::StackCheck::Scope::Scope):
(WTF::StackCheck::StackCheck):
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::userVisibleURL):
* wtf/URLParser.cpp:
(WTF::URLParser::formURLDecode):
* wtf/cf/URLCF.cpp:
(WTF::URL::createCFURL const):
* wtf/cocoa/URLCocoa.mm:
(WTF::URL::createCFURL const):
* wtf/persistence/PersistentCoders.cpp:
(WTF::Persistence::Coder<CString>::encode):
(WTF::Persistence::Coder<String>::encode):
* wtf/text/CString.h:
* wtf/text/WTFString.cpp:
(WTF::String::latin1 const):
* wtf/text/cf/StringImplCF.cpp:
(WTF::StringImpl::createCFString):
2021-06-08 17:27:33 +00:00
2021-06-08 Devin Rousso <drousso@apple.com>
[Modern Media Controls] upstream new features
https://bugs.webkit.org/show_bug.cgi?id=226736
<rdar://problem/78957464>
Reviewed by Eric Carlson.
- bring the "Audio"/"Languages" tracks menu to iOS
- add a new "Playback Speed" menu on iOS and macOS in the overflow menu
- add support for showing the most relevant `<track kind="chapters">` in the overflow menu
* wtf/PlatformEnableCocoa.h:
2021-06-08 16:54:34 +00:00
2021-06-08 Sam Weinig <weinig@apple.com>
Add copy of std::span so that we can use it pre-moving to c++20
https://bugs.webkit.org/show_bug.cgi?id=226351
Reviewed by Alex Christensen.
Imports a copy of Tristan Brindle's Boost licensed implementation of std::span
from 5d8d366eca918d0ed3d2d196cbeae6abfd874736 of https://github.com/tcbrindle/span.
It has been further modified to rename tcb::span to WTF::Span.
* LICENSE_1_0-Boost.txt: Added.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Span.h: Added.
2021-06-08 02:25:49 +00:00
2021-06-07 Alex Christensen <achristensen@webkit.org>
Adopt SecTrustGetCertificateAtIndex replacement where available
https://bugs.webkit.org/show_bug.cgi?id=225893
Reviewed by Chris Dumez.
rdar://74752046 introduced a new way to access the same thing.
* wtf/PlatformHave.h:
2021-06-08 00:29:50 +00:00
2021-06-07 Chris Dumez <cdumez@apple.com>
Drop legacy MainThreadTaskQueue & EventLoopTaskQueue classes
https://bugs.webkit.org/show_bug.cgi?id=226734
Reviewed by Ryosuke Niwa.
We recently introduced the WTF::CancellableTask in order to be able to cancel
a pending task in the event loop, and/or check if the task is still pending.
It worked great as a replacement for EventLoopDeferrableTask. However, it was
insufficient as a replacement for task queues (such as MainThreadTaskQueue &
EventLoopTaskQueue) since there was no convenient way to cancel a group of
tasks. To address this, I am introducing WTF::TaskCancellationGroup. Whenever one
needs to create a CancellableTask, it now needs to provide a TaskCancellationGroup.
Several CancellableTask objects can share the same TaskCancellationGroup. Code now
now schedule one or more CancellableTasks on the event loop and hold on
to a TaskCancellationGroup. If they need to cancel those tasks, they can simply
call cancel() on the TaskCancellationGroup. They can also check if previously
scheduled tasks are still pending via TaskCancellationGroup::hasPendingTask().
* wtf/CancellableTask.h:
(WTF::TaskCancellationGroup::TaskCancellationGroup):
(WTF::TaskCancellationGroup::cancel):
(WTF::TaskCancellationGroup::hasPendingTask const):
(WTF::TaskCancellationGroup::Impl::cancel):
(WTF::TaskCancellationGroup::Impl::hasPendingTask const):
(WTF::TaskCancellationGroup::Handle::isCancelled const):
(WTF::TaskCancellationGroup::Handle::Handle):
(WTF::TaskCancellationGroup::createHandle):
(WTF::CancellableTask::CancellableTask):
(WTF::CancellableTask::operator()):
* wtf/WeakPtr.h:
(WTF::WeakPtrFactory::weakPtrCount const):
2021-06-07 22:11:29 +00:00
2021-06-07 Wenson Hsieh <wenson_hsieh@apple.com>
Upstream WebKit support for Live Text
https://bugs.webkit.org/show_bug.cgi?id=226706
<rdar://problem/78933684>
Reviewed by Tim Horton.
* wtf/PlatformEnableCocoa.h:
Move the feature flag out of WebKitAdditions and into OpenSource as IMAGE_ANALYSIS.
2021-06-07 11:45:59 +00:00
2021-06-07 Alicia Boya García <aboya@igalia.com>
[WTF][GStreamer] Fix clang TSA warnings in WTF::DataMutex
https://bugs.webkit.org/show_bug.cgi?id=226719
Reviewed by Xabier Rodriguez-Calvar.
Fix the remaning clang thread safety warnings in WTF::DataMutex.
The goal of this patch is to reduce the number of warnings in the
GStreamer codebase. Whether DataMutex should be deprecated in favor of
Locker with the clang TSA annotations is outside of the scope of this
patch.
* wtf/DataMutex.h:
2021-06-07 11:40:51 +00:00
2021-06-07 Alicia Boya García <aboya@igalia.com>
[GStreamer] Remove spurious assert in WTF::DataMutex
https://bugs.webkit.org/show_bug.cgi?id=226714
Reviewed by Michael Catanzaro.
Remove DATA_MUTEX_CHECK(!mutex().isHeld()); from the DataMutexLocker
constructor, introduced in r278248.
Trying to lock a currently held mutex is not an error condition that
should crash the process, it will just wait for its turn to lock it.
* wtf/DataMutex.h:
2021-06-07 04:22:38 +00:00
2021-06-06 Chris Dumez <cdumez@apple.com>
Stop using legacy EventLoopDeferrableTask
https://bugs.webkit.org/show_bug.cgi?id=226700
Reviewed by Darin Adler.
Introduce new WTF::CancellableTask type which is a wrapper around a WTF::Function.
It can create a handle for the task and this handle can be used to check if the
task is still pending and to cancel it. This is useful when scheduling tasks in the
event loop for example as there are cases where we need to know if a task we
scheduled is still pending (to avoid double scheduling) or where we need to cancel
a previously scheduled task.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CancellableTask.h: Added.
(WTF::CancellableTask::CancellableTask):
(WTF::CancellableTask::operator()):
(WTF::CancellableTask::isPending const):
(WTF::CancellableTask::cancel):
(WTF::CancellableTask::Handle::Handle):
(WTF::CancellableTask::Handle::isPending const):
(WTF::CancellableTask::Handle::cancel):
(WTF::CancellableTask::createHandle):
2021-06-05 04:47:23 +00:00
2021-06-04 Chris Dumez <cdumez@apple.com>
FileSystem::readFromFile() should return data as `void*`
https://bugs.webkit.org/show_bug.cgi?id=226671
Reviewed by Darin Adler.
FileSystem::readFromFile() should return data as `void*` instead of `char*`. This is more flexible and
consistent with FileSystem::writeToFile().
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::appendFileContentsToFileHandle):
(WTF::FileSystemImpl::readOrMakeSalt):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::readFromFile):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::readFromFile):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::readFromFile):
2021-06-04 18:35:42 +00:00
2021-06-04 Alex Christensen <achristensen@webkit.org>
Implement off-by-default experimental feature for PerformanceResourceTiming.transferSize, encodedBodySize, and decodedBodySize
https://bugs.webkit.org/show_bug.cgi?id=226629
Reviewed by Brady Eidson.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-06-04 17:58:37 +00:00
2021-06-04 Devin Rousso <drousso@apple.com>
Add a way to prefix output of `WTFReportBacktrace` to make log filtering easier
https://bugs.webkit.org/show_bug.cgi?id=226390
Reviewed by Megan Gardner.
Often times while debugging I add `WTFLogAlways("<DR> ...")` to various places as indicators
that "logic has reached here". This is especially useful when debugging iOS as unlike macOS
there's no console output from `run-safari`, meaning that I have to use system logging,
which is often a deluge of unrelated information. Having "<DR>" as a prefix makes filtering
through the system logging trivial as I can ignore logs that don't have it. Unfortunately,
`WTFReportBacktrace` does not have a way to add this prefix, so it becomes much harder to
find in the logs. This patch enables adding a prefix to each line of `WTFReportBacktrace`
via a new function `WTFReportBactraceWithPrefix`.
* wtf/Assertions.h:
* wtf/Assertions.cpp:
(WTFReportBacktraceWithPrefix): Added.
(WTFPrintBacktraceWithPrefix): Added.
* wtf/StackTrace.h:
(WTF::StackTrace::StackTrace):
* wtf/StackTrace.cpp:
(WTF::StackTrace::dump const):
2021-06-04 15:03:00 +00:00
2021-06-04 Michael Catanzaro <mcatanzaro@gnome.org>
Fix more GCC warnings
https://bugs.webkit.org/show_bug.cgi?id=226193
Reviewed by Adrian Perez de Castro.
Add missing static_cast<void*> required to suppress GCC's -Wclass-memaccess warning when
intentionally not running constructors/destructors. There's already a static_assert to
ensure this is safe, which is better than usual for us.
* wtf/SmallSet.h:
2021-06-03 23:45:43 +00:00
2021-06-03 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r277881.
Fix warning about unused function.
* wtf/cocoa/FileSystemCocoa.mm:
2021-06-03 13:10:38 +00:00
2021-06-03 Michael Catanzaro <mcatanzaro@gnome.org>
REGRESSION(r277744): Broke build on s390x mainframes
https://bugs.webkit.org/show_bug.cgi?id=226497
Reviewed by Darin Adler.
The problem is we have a template defined in a C++ source file, used by multiple source
files. This is not valid C++, so let's split the templates defined in StringBuilder.cpp out
into a new StringBuilderInternals.h that we can #include in both StringBuilder.cpp and
StringBuilderJSON.cpp.
Ideally we would move the template defined in StringBuilderJSON.cpp as well, and then
eliminate StringBuilderJSON.cpp since there would only be one function left. But that file
has an MPL license. It's easier to leave it be to keep the license situation simpler.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::expandedCapacity):
(WTF::expandedCapacity): Deleted.
(WTF::StringBuilder::allocateBuffer): Deleted.
(WTF::StringBuilder::extendBufferForAppending): Deleted.
(WTF::StringBuilder::extendBufferForAppendingSlowCase): Deleted.
* wtf/text/StringBuilder.h:
* wtf/text/StringBuilderInternals.h: Added.
(WTF::StringBuilder::allocateBuffer):
(WTF::StringBuilder::reallocateBuffer):
(WTF::StringBuilder::extendBufferForAppending):
(WTF::StringBuilder::extendBufferForAppendingSlowCase):
* wtf/text/StringBuilderJSON.cpp:
2021-06-02 23:49:05 +00:00
2021-06-02 Chris Dumez <cdumez@apple.com>
Drop WTF::Vector overloads taking index as Checked<size_t>
https://bugs.webkit.org/show_bug.cgi?id=226553
Reviewed by Geoffrey Garen.
Drop WTF::Vector overloads taking index as Checked<size_t>. They are no longer needed now that
Checked<size_t> can implicitly get converted to size_t (r278338).
* wtf/Vector.h:
(WTF::Vector::at const):
(WTF::Vector::operator[] const):
2021-06-02 19:02:15 +00:00
2021-06-02 Chris Dumez <cdumez@apple.com>
Drop Checked::safeGet()
https://bugs.webkit.org/show_bug.cgi?id=226537
Reviewed by Geoffrey Garen.
Drop Checked::safeGet() and replace with uses of Checked::operator T() or Checked::value().
safeGet() is a bit akward, having both a return value and an out-parameter.
* wtf/CheckedArithmetic.h:
(WTF::Checked::value const):
(WTF::operator+):
(WTF::operator-):
(WTF::operator*):
(WTF::operator/):
2021-06-02 16:21:15 +00:00
2021-06-02 Antti Koivisto <antti@apple.com>
Style::Scope should use CheckedPtr
https://bugs.webkit.org/show_bug.cgi?id=226530
Reviewed by Sam Weinig.
* wtf/CMakeLists.txt:
2021-06-02 15:42:27 +00:00
2021-06-02 Chris Dumez <cdumez@apple.com>
Use Checked aliases instead of Checked<T, RecordOverflow>
https://bugs.webkit.org/show_bug.cgi?id=226535
Reviewed by Keith Miller.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::userVisibleURL):
* wtf/URLParser.cpp:
(WTF::URLParser::parseIPv4Piece):
* wtf/cocoa/NSURLExtras.mm:
(WTF::dataWithUserTypedString):
* wtf/glib/SocketConnection.cpp:
(WTF::SocketConnection::sendMessage):
2021-06-02 08:43:13 +00:00
2021-05-23 Ryosuke Niwa <rniwa@webkit.org>
Add CheckedPtr
https://bugs.webkit.org/show_bug.cgi?id=226158
Reviewed by Antti Koivisto.
This patch introduces a new type of smart pointer, CheckedPtr, which behaves like RefPtr and
let each object keep track of pointers pointing to the object. Unlike CheckedPtr, the purpose of
this internal counter is to release assert that there is no outstanding pointer at the time
of destruction instead of keeping the object alive when there is one.
* WTF.xcodeproj/project.pbxproj:
* wtf/CheckedPtr.h: Added.
(WTF::CheckedPtr): Added.
(WTF::CheckedPtr::CheckedPtr): Added.
(WTF::CheckedPtr::~CheckedPtr): Added.
(WTF::CheckedPtr::isHashTableDeletedValue const): Added.
(WTF::CheckedPtr::operator UnspecifiedBoolType const): Added.
(WTF::CheckedPtr::operator! const): Added.
(WTF::CheckedPtr::get const): Added.
(WTF::CheckedPtr::get): Added.
(WTF::CheckedPtr::operator* const): Added.
(WTF::CheckedPtr::operator*): Added.
(WTF::CheckedPtr::operator-> const): Added.
(WTF::CheckedPtr::operator->): Added.
(WTF::CheckedPtr::operator== const): Added.
(WTF::CheckedPtr::operator=): Added.
(WTF::CheckedPtr::unspecifiedBoolTypeInstance const): Added.
(WTF::CheckedPtr::refIfNotNull): Added.
(WTF::CheckedPtr::derefIfNotNull): Added.
(WTF::makeCheckedPtr): Added.
(WTF::is): Added.
(WTF::CanMakeCheckedPtr): Added.
(WTF::CanMakeCheckedPtr::~CanMakeCheckedPtr): Added. Release assert that m_ptrCount is 0.
(WTF::CanMakeCheckedPtr::ptrCount const): Added.
(WTF::CanMakeCheckedPtr::incrementPtrCount): Added.
(WTF::CanMakeCheckedPtr::decrementPtrCount): Added. Note that we don't do anything when m_ptrCount
becomes 0 unlike RefPtr.
(WTF::HashTraits<CheckedPtr<P>>): Added.
(WTF::HashTraits<CheckedPtr<P>>::emptyValue): Added.
(WTF::HashTraits<CheckedPtr<P>>::peek): Added.
(WTF::HashTraits<CheckedPtr<P>>::customDeleteBucket): Added.
2021-06-02 06:45:51 +00:00
2021-06-01 Darin Adler <darin@apple.com>
Remove <wtf/Optional.h>
https://bugs.webkit.org/show_bug.cgi?id=226437
Reviewed by Chris Dumez.
* <many files>: Removed include of <wtf/Optional.h>.
* WTF.xcodeproj/project.pbxproj: Removed Optional.h.
* wtf/Markable.h: Added include of <optional>.
* wtf/OptionSet.h: Ditto.
* wtf/Optional.h: Emptied this file. On the Windows build system, we can't
seem to build successfully without an empty file here. The copied forwarding
header seems to linger even if we remove the original. Until we fix the
Windows build system, if we want to support incremental builds, we need
to keep this empty file around.
* wtf/PrintStream.h: Added include of <optional>.
* wtf/Seconds.h: Ditto.
* wtf/StackTrace.h: Ditto.
* wtf/StdLibExtras.h: Moved the valueOrCompute function here from Optional.h.
Re-sorted the "using" at the bottom of the file.
* wtf/URLHelpers.h: Added include of <optional>.
* wtf/Vector.h: Ditto.
2021-06-02 05:21:13 +00:00
2021-06-01 Chris Dumez <cdumez@apple.com>
Rename Checked::unsafeGet() to Checked::value()
https://bugs.webkit.org/show_bug.cgi?id=226514
Reviewed by Darin Adler.
Rename Checked::unsafeGet() to Checked::value(). The "unsafeGet" naming is confusing as this
function isn't really unsafe since it will crash if the value has overflowed. Also add an
`operator T()` to implicitly convert a Checked to its underlying type without needing to
call value().
* wtf/CheckedArithmetic.h:
(WTF::Checked::operator! const):
(WTF::Checked::operator bool const):
(WTF::Checked::operator T const):
(WTF::Checked::value const):
(WTF::Checked::operator==):
(WTF::Checked::operator< const):
(WTF::Checked::operator<= const):
(WTF::Checked::operator> const):
(WTF::Checked::operator>= const):
* wtf/ConcurrentBuffer.h:
* wtf/FastMalloc.cpp:
(WTF::fastCalloc):
(WTF::tryFastCalloc):
* wtf/Gigacage.cpp:
(Gigacage::tryMallocArray):
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::userVisibleURL):
* wtf/URLParser.cpp:
(WTF::URLParser::parseIPv4Piece):
* wtf/UniqueArray.h:
* wtf/cocoa/NSURLExtras.mm:
(WTF::dataWithUserTypedString):
* wtf/glib/SocketConnection.cpp:
(WTF::SocketConnection::readMessage):
(WTF::SocketConnection::sendMessage):
* wtf/text/CString.cpp:
(WTF::CStringBuffer::createUninitialized):
* wtf/text/StringBuffer.h:
(WTF::StringBuffer::StringBuffer):
* wtf/text/StringBuilderJSON.cpp:
(WTF::StringBuilder::appendQuotedJSONString):
* wtf/text/StringConcatenate.h:
(WTF::tryMakeStringFromAdapters):
* wtf/text/StringImpl.h:
(WTF::StringImpl::allocationSize):
* wtf/text/StringToIntegerConversion.h:
(WTF::parseInteger):
2021-06-01 19:24:53 +00:00
2021-06-01 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r277881.
Silence unused parameter warnings.
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::setAllowsMaterializingDatalessFiles):
(WTF::FileSystemImpl::allowsMaterializingDatalessFiles): Deleted.
(WTF::FileSystemImpl::isSafeToUseMemoryMapForPath): Deleted.
(WTF::FileSystemImpl::makeSafeToUseMemoryMapForPath): Deleted.
2021-06-01 13:01:01 +00:00
2021-06-01 Adrian Perez de Castro <aperez@igalia.com>
[WPE][GTK] Support building against uClibc
https://bugs.webkit.org/show_bug.cgi?id=226244
Reviewed by Michael Catanzaro.
* wtf/PlatformRegisters.h: Use the <sys/ucontext.h> header instead of
<ucontext.h>, which is enough to gain access to the type definitions
for CPU registers and is available on every libc. On the other hand,
uClibc does not have <ucontext.h>, so this fixes the build in that
case.
2021-05-30 20:35:59 +00:00
2021-05-30 Chris Dumez <cdumez@apple.com>
Drop UncheckedCondition / UncheckedLock
https://bugs.webkit.org/show_bug.cgi?id=226432
Reviewed by Darin Adler.
Drop UncheckedCondition / UncheckedLock now that the whole codebase has been ported to
Condition / Lock, which support Clang thread safety analysis.
* wtf/Condition.h:
* wtf/Forward.h:
* wtf/Lock.cpp:
(WTF::Lock::lockSlow):
(WTF::Lock::unlockSlow):
(WTF::Lock::unlockFairlySlow):
(WTF::Lock::safepointSlow):
* wtf/Lock.h:
(WTF::assertIsHeld):
(WTF::WTF_ASSERTS_ACQUIRED_LOCK):
2021-05-30 16:11:40 +00:00
2021-05-30 Darin Adler <darin@apple.com>
Remove WTF::Optional synonym for std::optional, using that class template directly instead
https://bugs.webkit.org/show_bug.cgi?id=226433
Reviewed by Chris Dumez.
* <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.
* wtf/Optional.h: Remove WTF::Optional.
2021-05-30 06:51:57 +00:00
2021-05-29 Chris Dumez <cdumez@apple.com>
Stop using UncheckedLock in JSC::VMInspector
https://bugs.webkit.org/show_bug.cgi?id=226427
Reviewed by Mark Lam.
Add Lock::tryLockWithTimeout(), similar to tryLock() but gives up after a
specified timeout. This used to be implemented in VMInspector but I think
Lock is a better place for it.
* wtf/Lock.cpp:
(WTF::Lock::tryLockWithTimeout):
* wtf/Lock.h:
2021-05-30 05:22:59 +00:00
2021-05-29 Chris Dumez <cdumez@apple.com>
Adopt clang thread safety annotations in WTF::DataMutex
https://bugs.webkit.org/show_bug.cgi?id=226431
Reviewed by Darin Adler.
Adopt clang thread safety annotations in WTF::DataMutex. This allows us to
stop using UncheckedCondition in a few places.
* wtf/DataMutex.h:
(WTF::DataMutex::DataMutex):
Clients of optional should use has_value instead of relying on hasValue macro
https://bugs.webkit.org/show_bug.cgi?id=226395
Reviewed by Chris Dumez.
Source/JavaScriptCore:
* bytecompiler/NodesCodegen.cpp:
(JSC::RegExpNode::emitBytecode): Don't use hasValue.
Source/WebCore:
In some files we are touching, moved from Optional to std::optional, but doing
that consistently in files we are not otherwise modifying is out of scope here.
In some places, use has_value instead of hasValue. In others, improved further
by not using has_value explicitly when it's clearer to do so. Wasn't 100%
consistent about that, but did aim to cover 100% of the hasValue call sites.
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::create): Don't use hasValue.
* Modules/webxr/WebXRFrame.cpp:
(WebCore::WebXRFrame::getViewerPose): Ditto.
(WebCore::WebXRFrame::getPose): Ditto.
* Modules/webxr/WebXRGamepad.cpp:
(WebCore::WebXRGamepad::WebXRGamepad): Ditto.
* Modules/webxr/WebXRInputSource.cpp:
(WebCore::WebXRInputSource::requiresInputSourceChange): Use has_value.
* bindings/js/DOMPromiseProxy.h:
(WebCore::DOMPromiseProxy<IDLType>::isFulfilled const): Ditto.
(WebCore::DOMPromiseProxy<IDLUndefined>::isFulfilled const): Ditto.
(WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const): Ditto.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal): Ditto.
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::addToFacesLookupTable): Removed unneeded double check
of optional value. !x and !x.has_value() check the same thing.
(WebCore::CSSFontFaceSet::remove): Ditto.
(WebCore::CSSFontFaceSet::fontFace): Simplified code with extra local variables
to use an idiom that does not use hasValue. Since using *, ->, or value() on an
optional already asserts, there is no need to explicitly assert in the caller.
* css/CSSGradientValue.cpp:
(WebCore::GradientStop::isSpecified const): Use has_value.
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::fontRanges): Removed unneeded calls to hasValue.
* css/FontFace.cpp:
(WebCore::FontFace::family const): Use has_value.
(WebCore::FontFace::style const): Ditto.
(WebCore::FontFace::weight const): Ditto.
(WebCore::FontFace::stretch const): Ditto.
(WebCore::FontFace::unicodeRange const): Ditto.
(WebCore::FontFace::featureSettings const): Ditto.
(WebCore::FontFace::display const): Ditto.
* css/parser/CSSSelectorParser.cpp:
(WebCore::consumeANPlusB): Ditto.
* display/css/DisplayStyle.h: Ditto.
* dom/DataTransferItemList.h: Ditto.
* dom/Document.cpp:
(WebCore::Document::updateHighlightPositions): Ditto.
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener): Ditto.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::hasPendingCorrection const): Ditto.
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyInlineStyle): Don't call hasValue.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::captionDisplayMode): Ditto.
* html/ImageBitmap.h: Ditto.
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setScreenSizeOverride): Use has_value.
* layout/LayoutPhase.cpp:
(WebCore::Layout::PhaseScope::PhaseScope): Ditto.
* layout/formattingContexts/inline/InlineContentBreaker.cpp:
(WebCore::Layout::InlineContentBreaker::tryBreakingTextRun const): Ditto.
* layout/formattingContexts/inline/InlineLine.h: Ditto.
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::parseAccessControlMaxAge): Ditto.
* page/EventHandler.cpp:
(WebCore::EventHandler::defaultWheelEventHandler): Ditto.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope): Ditto.
* page/scrolling/ScrollSnapOffsetsInfo.cpp:
(WebCore::closestSnapOffsetWithInfoAndAxis): Ditto.
* platform/ScrollController.cpp:
(WebCore::ScrollController::adjustScrollDestination): Don't use hasValue.
* platform/cocoa/SystemBattery.mm:
(WebCore::systemHasBattery): Use has_value.
(WebCore::systemHasAC): Use has_value.
* platform/graphics/Gradient.h: Ditto.
* platform/graphics/ImageSource.h: Ditto.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::wouldTaintOrigin const): Changed idiom to not use hasValue.
* platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
(setGLContext): Do not use hasValue.
* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::ElementFactories::hasElementForMediaType const): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::performTaskAtMediaTime): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::triggerRepaint): Ditto.
* platform/graphics/gstreamer/eme/CDMProxyThunder.cpp:
(WebCore::CDMProxyThunder::getDecryptionSession const): Use has_value.
* platform/graphics/gstreamer/eme/CDMThunder.cpp:
(WebCore::ParsedResponseMessage::hasType const): Use has_value.
(WebCore::CDMInstanceSessionThunder::cdmInstanceThunder const): Use
a pointer for the erturn value instead of Optional<&>. This hasn't
compiled since we switched to std::optional so I suspect this code is
not compiled by EWS or the buildbot.
* platform/graphics/gstreamer/eme/CDMThunder.h: Updated to match above.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps): Use value_or.
(WebCore::AppendPipeline::appsinkCapsChanged): Do not use has_value.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): Ditto.
* platform/graphics/transforms/TransformState.h: Use has_value.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(WebCore::supportsPictureInPicture): Ditto.
* platform/mac/NSScrollerImpDetails.mm:
(WebCore::ScrollerStyle::recommendedScrollerStyle): Ditto.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::isSystemPreview const): Ditto.
* platform/xr/openxr/OpenXRInputSource.cpp:
(PlatformXR::OpenXRInputSource::getInputSource const): Ditto.
* rendering/EventRegion.h: Ditto.
* rendering/GridTrackSizingAlgorithm.h: Remove unnecessary assertion, since
the * operator already does the assertion.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::canComputePercentageFlexBasis): Use has_value.
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::setExplicitValue): Ditto.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::systemFocusRingColor): Ditto.
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded): Ditto.
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::createSVGTransformFromMatrix): Changed idiom to not
call hasValue.
* svg/SVGTransform.h: Ditto.
* testing/WebFakeXRDevice.cpp:
(WebCore::WebFakeXRDevice::setViews): Ditto.
Source/WebDriver:
* socket/SessionHostSocket.cpp:
(WebDriver::SessionHost::isConnected const): Use has_value.
Source/WebKit:
* Platform/IPC/ArgumentCoders.h: Use std::optional; there was no hasValue
in here and I edited it by mistake, but we want to do this eventually.
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Removed using namespace WebCore.
(IPC::ArgumentCoder<Ref<WebCore::Font>>::decodePlatformData): Use has_value.
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::getClientSDKVersion): Ditto.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::decodeImage): Changed idiom to not call hasValue.
(IPC::ArgumentCoder<Ref<Font>>::decode): Ditto.
* Shared/mac/MediaFormatReader/MediaFormatReader.cpp:
(WebKit::MediaFormatReader::finishParsing): Use has_value.
(WebKit::MediaFormatReader::copyProperty): Ditto.
(WebKit::MediaFormatReader::copyTrackArray): Ditto.
* Shared/win/WebCoreArgumentCodersWin.cpp:
(IPC::ArgumentCoder<Ref<Font>>::decodePlatformData): Do not call hasValue.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration encodeWithCoder:]): Changed idiom to not use hasValue.
* UIProcess/API/glib/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::setState): Use has_value.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::AutomationCommandError::toProtocolString): Changed idiom to not use hasValue.
* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::determineDataOwner const): Use has_value.
* UIProcess/Inspector/socket/RemoteInspectorClient.cpp:
(WebKit::RemoteInspectorClient::sendWebInspectorEvent): Changed idiom to not use hasValue.
* UIProcess/glib/UserMediaPermissionRequestManagerProxyGLib.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::platformValidateUserMediaRequestConstraints): Ditto.
* WebProcess/GPU/media/MediaSourcePrivateRemote.cpp:
(WebKit::MediaSourcePrivateRemote::addSourceBuffer): Use has_value.
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::platformDidReceiveLoadParameters): Ditto.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::notifyPreferencesChanged): Changed idiom to not
call hasValue.
Source/WTF:
* wtf/Hasher.h: Use has_value.
* wtf/Optional.h: Remove hasValue macro. Not needed any more, but also a bit
dangerous because of how widespread the use of hasValue is for things other
than WTF::Optional.
Tools:
* TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp: Use has_value.
* TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp: Ditto.
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitPolicyClient.cpp: Ditto.
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(AudioRenderingWebViewTest::handleStart): Ditto.
* WebKitTestRunner/GeolocationProviderMock.cpp:
(WTR::GeolocationProviderMock::setPosition): Ditto.
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView canPerformAction:withSender:]): Ditto.
Canonical link: https://commits.webkit.org/238281@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-29 22:08:56 +00:00
2021-05-28 Darin Adler <darin@apple.com>
Clients of optional should use has_value instead of relying on hasValue macro
https://bugs.webkit.org/show_bug.cgi?id=226395
Reviewed by Chris Dumez.
* wtf/Hasher.h: Use has_value.
* wtf/Optional.h: Remove hasValue macro. Not needed any more, but also a bit
dangerous because of how widespread the use of hasValue is for things other
than WTF::Optional.
2021-05-29 05:48:10 +00:00
2021-05-28 Alex Christensen <achristensen@webkit.org>
Punycode encode U+0BE6 when not in context of other Tamil characters
https://bugs.webkit.org/show_bug.cgi?id=226409
<rdar://78160926>
Reviewed by Tim Horton.
It has quite legitimate use, so we don't want to always punycode encode it,
but when used in the context of non-Tamil characters we want to punycode encode it.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::isLookalikeCharacterOfScriptType<USCRIPT_ARMENIAN>):
(WTF::URLHelpers::isLookalikeCharacterOfScriptType<USCRIPT_TAMIL>):
(WTF::URLHelpers::isOfScriptType):
(WTF::URLHelpers::isLookalikeSequence):
(WTF::URLHelpers::isLookalikeCharacter):
(WTF::URLHelpers::isArmenianLookalikeCharacter): Deleted.
(WTF::URLHelpers::isArmenianScriptCharacter): Deleted.
(WTF::URLHelpers::isArmenianLookalikeSequence): Deleted.
2021-05-29 01:05:54 +00:00
2021-05-28 Chris Dumez <cdumez@apple.com>
Stop using UncheckedLock in WTF::MetaAllocator
https://bugs.webkit.org/show_bug.cgi?id=226396
Reviewed by Darin Adler.
Stop using UncheckedLock in WTF::MetaAllocator, as it is being phased out in favor on Lock,
which supports Clang thread safety analysis.
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::release):
(WTF::MetaAllocator::MetaAllocator):
(WTF::MetaAllocator::allocate):
(WTF::MetaAllocator::currentStatistics):
* wtf/MetaAllocator.h:
2021-05-28 20:17:41 +00:00
2021-05-28 Robin Morisset <rmorisset@apple.com>
Fix LikelyDenseUnsignedIntegerSet::clear()
https://bugs.webkit.org/show_bug.cgi?id=226388
Reviewed by Mark Lam.
There are two problems with it:
1) It calls BitVector::clearAll(), which does not free any memory.
Instead, it should call BitVector::~BitVector(), then do a placement new of a fresh BitVector (to get it back to its inline condition)
2) More problematically, it changes m_size before calling isBitVector() which relies crucially on the value of m_size.
So it is going to believe that it is in BitVector mode even when it is actually in HashSet mode.
* wtf/LikelyDenseUnsignedIntegerSet.h:
(WTF::LikelyDenseUnsignedIntegerSet::clear):
2021-05-28 18:54:27 +00:00
2021-05-28 Sam Weinig <weinig@apple.com>
Add stub implementation of CA separated portal bits for GraphicsLayer
https://bugs.webkit.org/show_bug.cgi?id=226343
Reviewed by Simon Fraser.
* wtf/PlatformHave.h: Add HAVE_CORE_ANIMATION_SEPARATED_PORTALS.
2021-05-28 17:59:21 +00:00
2021-05-28 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r277881.
Deal with IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES potentially not being defined on
older OSes.
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::setAllowsMaterializingDatalessFiles):
(WTF::FileSystemImpl::allowsMaterializingDatalessFiles):
2021-05-28 17:47:22 +00:00
2021-05-28 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r277881.
Add missing header include.
* wtf/cocoa/FileSystemCocoa.mm:
2021-05-28 04:16:18 +00:00
2021-05-27 Said Abou-Hallawa <said@apple.com>
Values of keySplines control points must all be in the range 0 to 1
https://bugs.webkit.org/show_bug.cgi?id=226336
Reviewed by Sam Weinig.
* wtf/MathExtras.h:
(isInRange):
There are a least couple of implementations of this function in WebCore.
The next step is to remove the redundant code in WebCore and use this one.
AirAllocateStackByGraphColoring should use the optimized interference graphs from AirAllocateRegistersByGraphColoring
https://bugs.webkit.org/show_bug.cgi?id=226258
Reviewed by Phil Pizlo.
Source/JavaScriptCore:
The main change in this patch is that AirAllocateStackByGraphColoring is now using the optimized datastructures in wtf/InterferenceGraph.h.
This required templating most of it over the interference graph used (Small/Large/Huge), but I tried keeping some common parts out of the templated class to minimize the impact on compile times and binary size.
A consequence of that change is that coalescableMoves and remappedStackSlots now store indices instead of direct pointers to StackSlots, resulting in a memory reduction of about 3x as well.
Another consequence is that I had to slightly alter the way that coalescing works: instead of carefully removing the interference edges of the killed slot, we simply use mayClear() which is not guaranteed to remove anything.
I believe that this is sound, because every subsequent access to m_interference checks whether a slot has been coalesced first, so dropping these edges is purely a memory saving, but has no logical effect.
The new code was tested in a few ways:
- running on JetStream2 with asan
- running on JetStream2 with TEST_OPTIMIZED_INTERFERENCE_GRAPH
- running on JetStream2 and logging the frame sizes at the end of this phase, and comparing to the results of doing the same on ToT (same average frame size)
The two functions where this code had the largest memory footprint in JetStream2 were both in tsf-wasm.
One has 751 stack slots, and had an interference graph of 2.1MB and a coalescableMoves vector of 440kB
The other has 673 stack slots, and had an interference graph of 1.9MB and a coalescableMoves vector of 421kB.
With this patch, they respectively use 79kB+146kB and 67kB+140kB
The effect on the rest of JetStream2 is less likely to matter as few functions used more than a few dozens of kB in this phase, but in percentages are just as huge.
More importantly (and the reason I wrote this patch in the first place), I checked mruby-wasm.aotoki.dev which with a few other pages forced us to lower Options::maximumTmpsForGraphColoring because of jetsams.
It has two massive functions that reach this phase if I increase Options::maximumTmpsForGraphColoring:
- about 6k stack slots -> 215MB + 6MB (interference graph + coalescableMoves)
- about 9k stack slots -> 395MB + 4MB
After this patch, they respectively use 4.5MB+2MB and 9MB+1.5MB, or roughly a 40x improvement.
Combined with the recent improvements to the register allocator, I hope to be able to increase Options::maximumTmpsForGraphColoring soon (in a different patch for easier bisection if either cause a perf regression).
This would be helpful, since its lowering cratered our performance on some other wasm application by 8x.
In terms of compile times, this patch lowered the time spent in AllocateStackByGraphColoring over the course of a run of JetStream2 from roughly 350ms to roughly 270ms.
This is almost certainly negligible, but at least it guarantees that it did not regress.
* b3/air/AirAllocateRegistersByGraphColoring.cpp:
* b3/air/AirAllocateStackByGraphColoring.cpp:
(JSC::B3::Air::allocateStackByGraphColoring):
Source/WTF:
I moved the interference graphs datastructures from AirAllocateRegistersByGraphColoring to their own wtf/InterferenceGraph.h file.
There are three of them:
- SmallInterferenceGraph, best for n < 400
- LargeInterferenceGraph, for n < 2**16
- HugeInterferenceGraph, for n up to 2**32
I also added "Iterable" versions of them, that have an operator[] method whose result you can iterate on to get all the indices which interfere with a given index.
SmallIterableInterferenceGraph is the same as the non-iterable version, but the Large and Huge versions are a bit slower than their counterparts and use 2x memory.
All of these were tested by running JetStream2 with the TEST_OPTIMIZED_INTERFERENCE_GRAPH set to 1.
This flag makes the optimized datastructures run in parallel with a reference implementation, and their results are checked for equality on every method call.
There is one small difference allowed: iteration is not guaranteed to go through elements in the same order.
I also added a clear() method to LikelyDenseUnsignedIntegerSet, and added the NotNull flag to its various uses of placement new.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/HashSet.h:
(WTF::W>::memoryUse const):
* wtf/InterferenceGraph.h: Added.
(WTF::InterferenceBitVector::contains):
(WTF::InterferenceBitVector::addAndReturnIsNewEntry):
(WTF::InterferenceBitVector::add):
(WTF::InterferenceBitVector::clear):
(WTF::InterferenceBitVector::mayClear):
(WTF::InterferenceBitVector::setMaxIndex):
(WTF::InterferenceBitVector::forEach):
(WTF::InterferenceBitVector::size const):
(WTF::InterferenceBitVector::memoryUse const):
(WTF::InterferenceBitVector::dumpMemoryUseInKB const):
(WTF::InterferenceBitVector::Iterable::iterator::operator++):
(WTF::InterferenceBitVector::Iterable::iterator::operator* const):
(WTF::InterferenceBitVector::Iterable::iterator::operator== const):
(WTF::InterferenceBitVector::Iterable::iterator::operator!= const):
(WTF::InterferenceBitVector::Iterable::begin const):
(WTF::InterferenceBitVector::Iterable::end const):
(WTF::InterferenceBitVector::operator[] const):
(WTF::InterferenceBitVector::index const):
(WTF::InterferenceVector::contains):
(WTF::InterferenceVector::addAndReturnIsNewEntry):
(WTF::InterferenceVector::add):
(WTF::InterferenceVector::clear):
(WTF::InterferenceVector::mayClear):
(WTF::InterferenceVector::setMaxIndex):
(WTF::InterferenceVector::forEach):
(WTF::InterferenceVector::size const):
(WTF::InterferenceVector::memoryUse const):
(WTF::InterferenceVector::dumpMemoryUseInKB const):
(WTF::InterferenceVector::Iterable::begin const):
(WTF::InterferenceVector::Iterable::end const):
(WTF::InterferenceVector::operator[] const):
(WTF::UndirectedEdgesDuplicatingAdapter::contains):
(WTF::UndirectedEdgesDuplicatingAdapter::addAndReturnIsNewEntry):
(WTF::UndirectedEdgesDuplicatingAdapter::add):
(WTF::UndirectedEdgesDuplicatingAdapter::clear):
(WTF::UndirectedEdgesDuplicatingAdapter::mayClear):
(WTF::UndirectedEdgesDuplicatingAdapter::setMaxIndex):
(WTF::UndirectedEdgesDuplicatingAdapter::forEach):
(WTF::UndirectedEdgesDuplicatingAdapter::size const):
(WTF::UndirectedEdgesDuplicatingAdapter::memoryUse const):
(WTF::UndirectedEdgesDuplicatingAdapter::dumpMemoryUseInKB const):
(WTF::UndirectedEdgesDuplicatingAdapter::operator[] const):
(WTF::UndirectedEdgesDedupAdapter::contains):
(WTF::UndirectedEdgesDedupAdapter::addAndReturnIsNewEntry):
(WTF::UndirectedEdgesDedupAdapter::add):
(WTF::UndirectedEdgesDedupAdapter::clear):
(WTF::UndirectedEdgesDedupAdapter::mayClear):
(WTF::UndirectedEdgesDedupAdapter::setMaxIndex):
(WTF::UndirectedEdgesDedupAdapter::forEach):
(WTF::UndirectedEdgesDedupAdapter::size const):
(WTF::UndirectedEdgesDedupAdapter::memoryUse const):
(WTF::UndirectedEdgesDedupAdapter::dumpMemoryUseInKB const):
(WTF::InterferenceHashSet::contains):
(WTF::InterferenceHashSet::addAndReturnIsNewEntry):
(WTF::InterferenceHashSet::add):
(WTF::InterferenceHashSet::clear):
(WTF::InterferenceHashSet::setMaxIndex):
(WTF::InterferenceHashSet::forEach):
(WTF::InterferenceHashSet::size const):
(WTF::InterferenceHashSet::memoryUse const):
(WTF::InterferenceHashSet::dumpMemoryUseInKB const):
(WTF::InstrumentedInterferenceGraph::contains):
(WTF::InstrumentedInterferenceGraph::addAndReturnIsNewEntry):
(WTF::InstrumentedInterferenceGraph::add):
(WTF::InstrumentedInterferenceGraph::clear):
(WTF::InstrumentedInterferenceGraph::mayClear):
(WTF::InstrumentedInterferenceGraph::setMaxIndex):
(WTF::InstrumentedInterferenceGraph::forEach):
(WTF::InstrumentedInterferenceGraph::size const):
(WTF::InstrumentedInterferenceGraph::memoryUse const):
(WTF::InstrumentedInterferenceGraph::dumpMemoryUseInKB const):
(WTF::InstrumentedIterableInterferenceGraph::Iterable::Iterable):
(WTF::InstrumentedIterableInterferenceGraph::Iterable::begin const):
(WTF::InstrumentedIterableInterferenceGraph::Iterable::end const):
(WTF::InstrumentedIterableInterferenceGraph::operator[] const):
* wtf/LikelyDenseUnsignedIntegerSet.h:
(WTF::LikelyDenseUnsignedIntegerSet::LikelyDenseUnsignedIntegerSet):
(WTF::LikelyDenseUnsignedIntegerSet::clear):
(WTF::LikelyDenseUnsignedIntegerSet::add):
(WTF::LikelyDenseUnsignedIntegerSet::estimateHashSetSize):
(WTF::LikelyDenseUnsignedIntegerSet::transitionToHashSet):
(WTF::LikelyDenseUnsignedIntegerSet::transitionToBitVector):
Canonical link: https://commits.webkit.org/238229@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-28 02:08:19 +00:00
2021-05-27 Robin Morisset <rmorisset@apple.com>
AirAllocateStackByGraphColoring should use the optimized interference graphs from AirAllocateRegistersByGraphColoring
https://bugs.webkit.org/show_bug.cgi?id=226258
Reviewed by Phil Pizlo.
I moved the interference graphs datastructures from AirAllocateRegistersByGraphColoring to their own wtf/InterferenceGraph.h file.
There are three of them:
- SmallInterferenceGraph, best for n < 400
- LargeInterferenceGraph, for n < 2**16
- HugeInterferenceGraph, for n up to 2**32
I also added "Iterable" versions of them, that have an operator[] method whose result you can iterate on to get all the indices which interfere with a given index.
SmallIterableInterferenceGraph is the same as the non-iterable version, but the Large and Huge versions are a bit slower than their counterparts and use 2x memory.
All of these were tested by running JetStream2 with the TEST_OPTIMIZED_INTERFERENCE_GRAPH set to 1.
This flag makes the optimized datastructures run in parallel with a reference implementation, and their results are checked for equality on every method call.
There is one small difference allowed: iteration is not guaranteed to go through elements in the same order.
I also added a clear() method to LikelyDenseUnsignedIntegerSet, and added the NotNull flag to its various uses of placement new.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/HashSet.h:
(WTF::W>::memoryUse const):
* wtf/InterferenceGraph.h: Added.
(WTF::InterferenceBitVector::contains):
(WTF::InterferenceBitVector::addAndReturnIsNewEntry):
(WTF::InterferenceBitVector::add):
(WTF::InterferenceBitVector::clear):
(WTF::InterferenceBitVector::mayClear):
(WTF::InterferenceBitVector::setMaxIndex):
(WTF::InterferenceBitVector::forEach):
(WTF::InterferenceBitVector::size const):
(WTF::InterferenceBitVector::memoryUse const):
(WTF::InterferenceBitVector::dumpMemoryUseInKB const):
(WTF::InterferenceBitVector::Iterable::iterator::operator++):
(WTF::InterferenceBitVector::Iterable::iterator::operator* const):
(WTF::InterferenceBitVector::Iterable::iterator::operator== const):
(WTF::InterferenceBitVector::Iterable::iterator::operator!= const):
(WTF::InterferenceBitVector::Iterable::begin const):
(WTF::InterferenceBitVector::Iterable::end const):
(WTF::InterferenceBitVector::operator[] const):
(WTF::InterferenceBitVector::index const):
(WTF::InterferenceVector::contains):
(WTF::InterferenceVector::addAndReturnIsNewEntry):
(WTF::InterferenceVector::add):
(WTF::InterferenceVector::clear):
(WTF::InterferenceVector::mayClear):
(WTF::InterferenceVector::setMaxIndex):
(WTF::InterferenceVector::forEach):
(WTF::InterferenceVector::size const):
(WTF::InterferenceVector::memoryUse const):
(WTF::InterferenceVector::dumpMemoryUseInKB const):
(WTF::InterferenceVector::Iterable::begin const):
(WTF::InterferenceVector::Iterable::end const):
(WTF::InterferenceVector::operator[] const):
(WTF::UndirectedEdgesDuplicatingAdapter::contains):
(WTF::UndirectedEdgesDuplicatingAdapter::addAndReturnIsNewEntry):
(WTF::UndirectedEdgesDuplicatingAdapter::add):
(WTF::UndirectedEdgesDuplicatingAdapter::clear):
(WTF::UndirectedEdgesDuplicatingAdapter::mayClear):
(WTF::UndirectedEdgesDuplicatingAdapter::setMaxIndex):
(WTF::UndirectedEdgesDuplicatingAdapter::forEach):
(WTF::UndirectedEdgesDuplicatingAdapter::size const):
(WTF::UndirectedEdgesDuplicatingAdapter::memoryUse const):
(WTF::UndirectedEdgesDuplicatingAdapter::dumpMemoryUseInKB const):
(WTF::UndirectedEdgesDuplicatingAdapter::operator[] const):
(WTF::UndirectedEdgesDedupAdapter::contains):
(WTF::UndirectedEdgesDedupAdapter::addAndReturnIsNewEntry):
(WTF::UndirectedEdgesDedupAdapter::add):
(WTF::UndirectedEdgesDedupAdapter::clear):
(WTF::UndirectedEdgesDedupAdapter::mayClear):
(WTF::UndirectedEdgesDedupAdapter::setMaxIndex):
(WTF::UndirectedEdgesDedupAdapter::forEach):
(WTF::UndirectedEdgesDedupAdapter::size const):
(WTF::UndirectedEdgesDedupAdapter::memoryUse const):
(WTF::UndirectedEdgesDedupAdapter::dumpMemoryUseInKB const):
(WTF::InterferenceHashSet::contains):
(WTF::InterferenceHashSet::addAndReturnIsNewEntry):
(WTF::InterferenceHashSet::add):
(WTF::InterferenceHashSet::clear):
(WTF::InterferenceHashSet::setMaxIndex):
(WTF::InterferenceHashSet::forEach):
(WTF::InterferenceHashSet::size const):
(WTF::InterferenceHashSet::memoryUse const):
(WTF::InterferenceHashSet::dumpMemoryUseInKB const):
(WTF::InstrumentedInterferenceGraph::contains):
(WTF::InstrumentedInterferenceGraph::addAndReturnIsNewEntry):
(WTF::InstrumentedInterferenceGraph::add):
(WTF::InstrumentedInterferenceGraph::clear):
(WTF::InstrumentedInterferenceGraph::mayClear):
(WTF::InstrumentedInterferenceGraph::setMaxIndex):
(WTF::InstrumentedInterferenceGraph::forEach):
(WTF::InstrumentedInterferenceGraph::size const):
(WTF::InstrumentedInterferenceGraph::memoryUse const):
(WTF::InstrumentedInterferenceGraph::dumpMemoryUseInKB const):
(WTF::InstrumentedIterableInterferenceGraph::Iterable::Iterable):
(WTF::InstrumentedIterableInterferenceGraph::Iterable::begin const):
(WTF::InstrumentedIterableInterferenceGraph::Iterable::end const):
(WTF::InstrumentedIterableInterferenceGraph::operator[] const):
* wtf/LikelyDenseUnsignedIntegerSet.h:
(WTF::LikelyDenseUnsignedIntegerSet::LikelyDenseUnsignedIntegerSet):
(WTF::LikelyDenseUnsignedIntegerSet::clear):
(WTF::LikelyDenseUnsignedIntegerSet::add):
(WTF::LikelyDenseUnsignedIntegerSet::estimateHashSetSize):
(WTF::LikelyDenseUnsignedIntegerSet::transitionToHashSet):
(WTF::LikelyDenseUnsignedIntegerSet::transitionToBitVector):
Next step toward using std::optional directly instead of through WTF::Optional typedef
https://bugs.webkit.org/show_bug.cgi?id=226280
Reviewed by Chris Dumez.
Source/JavaScriptCore:
* <many files>: Accept the renaming done by do-webcore-rename.
* yarr/YarrSyntaxChecker.cpp: Since the style checker complained about this file,
tweaked style to make it happy after the renaming done by do-webcore-rename, and
also hand-updated Optional to std::optional as long as we were touching it.
Source/WebCore:
* <many files>: Accept the renaming done by do-webcore-rename.
* Modules/webauthn/fido/DeviceRequestConverter.h: Since style checker complained
about the names of some arguments, fixed them, and also hand-updated Optional to
std::optional as long as we were touching it.
* loader/EmptyClients.cpp: Since style checker complained about the mix of
WEBCORE_EXPORT and inlined functions, moved them out of line, and
also hand-updated Optional to std::optional as long as we were touching it.
Also removed is<EmptyFrameLoaderClient>().
* loader/EmptyFrameLoaderClient.h: Ditto.
Source/WebCore/PAL:
* <many files>: Accept the renaming done by do-webcore-rename.
Source/WebDriver:
* <many files>: Accept the renaming done by do-webcore-rename.
Source/WebKit:
* <many files>: Accept the renaming done by do-webcore-rename.
Source/WebKitLegacy:
* Storage/StorageTracker.cpp:
(WebKit::StorageTracker::diskUsageForOrigin): Accept the renaming done by do-webcore-rename.
Source/WebKitLegacy/mac:
* <many files>: Accept the renaming done by do-webcore-rename.
Source/WebKitLegacy/win:
* <many files>: Accept the renaming done by do-webcore-rename.
Source/WTF:
* <many files>: Accept the renaming done by do-webcore-rename.
* wtf/Optional.h: Remove WTF::nullopt_t and WTF::makeOptional.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::mapHostName): Convert from nullopt to std::nullopt.
Tools:
* Scripts/do-webcore-rename: Use script to rename valueOr, WTF::nullopt, WTF::nullopt_t,
WTF::Optional, WTF::makeOptional, and makeOptional. Other renamings can't necessarily
be done by the script and so will be done in later passes.
* <many files>: Accept the renaming done by do-webcore-rename.
Canonical link: https://commits.webkit.org/238228@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-28 01:26:23 +00:00
2021-05-27 Darin Adler <darin@apple.com>
Next step toward using std::optional directly instead of through WTF::Optional typedef
https://bugs.webkit.org/show_bug.cgi?id=226280
Reviewed by Chris Dumez.
* <many files>: Accept the renaming done by do-webcore-rename.
* wtf/Optional.h: Remove WTF::nullopt_t and WTF::makeOptional.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::mapHostName): Convert from nullopt to std::nullopt.
2021-05-27 21:55:40 +00:00
2021-05-27 Sihui Liu <sihui_liu@apple.com>
Abandon pending tasks on background thread when WebIDBServer is closed
https://bugs.webkit.org/show_bug.cgi?id=226295
Reviewed by Chris Dumez.
Make the wait end with either a new message or queue being killed.
* wtf/CrossThreadQueue.h:
(WTF::CrossThreadQueue<DataType>::waitForMessage):
* wtf/CrossThreadTask.h:
(WTF::CrossThreadTask::operator bool const):
* wtf/CrossThreadTaskHandler.cpp:
(WTF::CrossThreadTaskHandler::taskRunLoop):
2021-05-27 21:35:51 +00:00
2021-05-27 Don Olmstead <don.olmstead@sony.com>
[CMake] Add check for timingsafe_bcmp
https://bugs.webkit.org/show_bug.cgi?id=226347
Reviewed by Chris Dumez.
Use HAVE(TIMINGSAFE_BCMP) in CryptographicUtilities code. Set its value in PlatformHave for
platforms not using CMake.
* wtf/CryptographicUtilities.cpp:
* wtf/CryptographicUtilities.h:
* wtf/PlatformHave.h:
2021-05-27 21:34:06 +00:00
2021-05-27 Mikhail R. Gadelha <mikhail.ramalho@gmail.com>
Increase NumberToStringBuffer to account for negative number
https://bugs.webkit.org/show_bug.cgi?id=226014
Reviewed by Robin Morisset.
In r250389, NumberToStringBuffer length was increased from 96 to 123 because:
<21 digits> + decimal point + <100 digits> + null char = 123.
however,
a = -100000000000000000000
a.toFixed(100)
is a valid conversion and it is 124 chars long, because of the "-" sign.
So this patch increases the length of NumberToStringBuffer to 124 and adds new
test cases.
Reviewed by Ryosuke Niwa.
* wtf/dtoa.h:
2021-05-27 20:48:14 +00:00
2021-05-27 Alex Christensen <achristensen@webkit.org>
Revert r277344
https://bugs.webkit.org/show_bug.cgi?id=225602
<rdar://78411776>
* wtf/PlatformHave.h:
2021-05-27 17:54:13 +00:00
2021-05-27 Devin Rousso <drousso@apple.com>
Use `NSLocale` SPI for comparing language identifiers instead of string comparison
https://bugs.webkit.org/show_bug.cgi?id=226252
Reviewed by Wenson Hsieh.
The existing `indexOfBestMatchingLanguageInList` logic uses (sub)string comparison of BCP47
language tags (e.g. looking for a `'-'` and comparing the substring before and after in the
input language and each item in the language list). While this does work for some languages,
it's really not the correct way to compare BCP47 language tags. Additionally, it basically
ignores the text after the first `'-'`, unless there's an exact match with the input
language. This leads to `"zh-CN"` and `"zh-HK"` being considered a (not exact) match, which
isn't ideal.
* wtf/Language.cpp:
* wtf/cocoa/LanguageCocoa.mm:
(WTF::indexOfBestMatchingLanguageInList): Added.
* wtf/spi/cocoa/NSLocaleSPI.h:
2021-05-27 06:42:52 +00:00
2021-05-26 Cameron McCormack <heycam@apple.com>
Prevent sbix glyphs from being rendered in the GPU process
https://bugs.webkit.org/show_bug.cgi?id=226159
<rdar://77231959>
Reviewed by Darin Adler.
* wtf/PlatformHave.h: Add HAVE_CORE_TEXT_SBIX_IMAGE_SIZE_FUNCTIONS.
2021-05-27 03:17:27 +00:00
2021-05-26 Chris Dumez <cdumez@apple.com>
Leverage the new Vector(const T*, size_t) constructor
https://bugs.webkit.org/show_bug.cgi?id=226304
Reviewed by Darin Adler.
Leverage the new Vector(const T*, size_t) constructor in existing code.
* wtf/text/WTFString.cpp:
(asciiDebug):
2021-05-27 01:48:53 +00:00
2021-05-26 Chris Dumez <cdumez@apple.com>
Use timingsafe_bcmp() in WTF::constantTimeMemcmp() when available
https://bugs.webkit.org/show_bug.cgi?id=226294
<rdar://problem/78542643>
Reviewed by Darin Adler.
Follow-up to r278140 to address post-landing feedback.
* wtf/CryptographicUtilities.cpp:
(WTF::constantTimeMemcmp):
* wtf/CryptographicUtilities.h:
(WTF::constantTimeMemcmp):
2021-05-27 00:39:08 +00:00
2021-05-26 Chris Dumez <cdumez@apple.com>
Use timingsafe_bcmp() in WTF::constantTimeMemcmp() when available
https://bugs.webkit.org/show_bug.cgi?id=226294
Reviewed by Alex Christensen.
Use timingsafe_bcmp() in WTF::constantTimeMemcmp() when available (iOS, macOS, FreeBSD, OpenBSD),
instead of our own custom implementation.
* wtf/CryptographicUtilities.cpp:
(WTF::constantTimeMemcmp):
2021-05-26 23:24:01 +00:00
2021-05-26 Chris Dumez <cdumez@apple.com>
[Hardening] Have the Ref<> destructor null out its pointer
https://bugs.webkit.org/show_bug.cgi?id=226293
<rdar://problem/78532149>
Reviewed by Geoffrey Garen.
* wtf/Ref.h:
(WTF::Ref::~Ref):
2021-05-26 17:34:02 +00:00
2021-05-26 Alex Christensen <achristensen@webkit.org>
URL path setter messes up UTF-8 encoding after ?
https://bugs.webkit.org/show_bug.cgi?id=226136
Reviewed by Chris Dumez.
escapePathWithoutCopying needs to tell percentEncodeCharacters to percent encode all non-ASCII characters in the output of UTF-8 encoding
in addition to ? and #. Otherwise, we take the output of UTF-8 encoding and append each code unit to the input of URL parsing as if it were Latin-1.
This matches Chrome, Firefox, and reason.
Covered by a newly passing WPT test.
Other callers of percentEncodeCharacters use functions that already encode all non-ASCII characters.
* wtf/URL.cpp:
(WTF::escapePathWithoutCopying):
2021-05-26 16:46:37 +00:00
2021-05-26 Chris Dumez <cdumez@apple.com>
Stop using UncheckedLock in WTF::AutomaticThread
https://bugs.webkit.org/show_bug.cgi?id=226255
Reviewed by Keith Miller.
Stop using UncheckedLock in WTF::AutomaticThread as it is being phased out in favor of
Lock, which supports Clang thread safety analysis.
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThreadCondition::wait):
(WTF::AutomaticThreadCondition::waitFor):
(WTF::AutomaticThread::AutomaticThread):
* wtf/AutomaticThread.h:
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperClient::~ParallelHelperClient):
(WTF::ParallelHelperClient::finish):
(WTF::ParallelHelperClient::finishWithLock):
(WTF::ParallelHelperPool::ParallelHelperPool):
* wtf/ParallelHelperPool.h:
(WTF::ParallelHelperPool::numberOfThreads const):
* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
* wtf/WorkerPool.h:
2021-05-26 00:37:19 +00:00
2021-05-25 Chris Dumez <cdumez@apple.com>
Use UncheckedLock less in JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=226212
Reviewed by Saam Barati.
Add support for unlockEarly() to Locker<Lock> specialization, for consistency
with the generic Locker.
* wtf/Lock.h:
[Modern Media Controls] REGRESSION(r254389) media controls needs the full list of language preferences for ordering tracks
https://bugs.webkit.org/show_bug.cgi?id=226038
Reviewed by Myles C. Maxfield and Eric Carlson.
Source/JavaScriptCore:
Media controls need access to the full list of language preferences in order to properly
sort/order the list of tracks in the controls UI. For example, if a `<video>` has subtitles
for English, Spanish, and French, and the user has English (default) and French (alternate)
configured in the Language & Region view of System Preferences on macOS, WebKit should order
the subtitles list English, French, and then Spanish.
* shell/playstation/TestShell.cpp:
(preTest):
Instead of propagating the override, just clear it out.
Source/WebCore:
Media controls need access to the full list of language preferences in order to properly
sort/order the list of tracks in the controls UI. For example, if a `<video>` has subtitles
for English, Spanish, and French, and the user has English (default) and French (alternate)
configured in the Language & Region view of System Preferences on macOS, WebKit should order
the subtitles list English, French, and then Spanish.
Test: media/modern-media-controls/tracks-support/sorted-by-user-preferred-languages.html
* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::preferredLanguages const):
(WebCore::CaptionUserPreferences::textTrackSelectionScore const):
(WebCore::CaptionUserPreferences::primaryAudioTrackLanguageOverride const):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::preferredLanguages const):
(WebCore::buildDisplayStringForTrackBase):
(WebCore::trackDisplayName):
(WebCore::textTrackCompare):
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions):
* bindings/js/JSDOMWindowBase.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:
* bindings/js/JSWorkletGlobalScopeBase.cpp:
Wrap `defaultLanguage` in a lambda since it now has a parameter.
* platform/LocalizedStrings.h:
* platform/LocalizedStrings.cpp:
(WebCore::captionsTextTrackKindDisplayName): Added.
(WebCore::descriptionsTextTrackKindDisplayName): Added.
(WebCore::chaptersTextTrackKindDisplayName): Added.
(WebCore::metadataTextTrackKindDisplayName): Added.
(WebCore::closedCaptionKindTrackDisplayName): Added.
(WebCore::sdhTrackKindDisplayName): Added.
(WebCore::easyReaderKindDisplayName): Added.
(WebCore::forcedTrackKindDisplayName): Added.
Move the logic added in r277797 from `buildDisplayStringForTrackBase` to `trackDisplayName`
and only perform it if the text track display name doesn't already contain the display name
for the text track kind (e.g. if the `label` is "English Captions" don't add "Captions", but
do if the `label` is only "English").
Source/WTF:
Media controls need access to the full list of language preferences in order to properly
sort/order the list of tracks in the controls UI. For example, if a `<video>` has subtitles
for English, Spanish, and French, and the user has English (default) and French (alternate)
configured in the Language & Region view of System Preferences on macOS, WebKit should order
the subtitles list English, French, and then Spanish.
* wtf/Language.h:
* wtf/Language.cpp:
(WTF::cachedFullPlatformPreferredLanguages): Added.
(WTF::cachedMinimizedPlatformPreferredLanguages): Added.
(WTF::languageDidChange):
(WTF::defaultLanguage):
(WTF::userPreferredLanguages):
(WTF::platformLanguageDidChange): Deleted.
Move the caching in `wtf/cf/LanguageCF.cpp` to `wtf/Language.cpp` so that all platforms can
benefit from caching the result of `platformUserPreferredLanguages`.
* wtf/cf/LanguageCF.cpp:
(WTF::platformUserPreferredLanguages):
(WTF::platformLanguageDidChange): Deleted.
* wtf/playstation/LanguagePlayStation.cpp:
(WTF::platformUserPreferredLanguages):
* wtf/spi/cocoa/NSLocaleSPI.h:
* wtf/unix/LanguageUnix.cpp:
(WTF::platformUserPreferredLanguages):
* wtf/win/LanguageWin.cpp:
(WTF::platformUserPreferredLanguages):
Add `WTF::ShouldMinimizeLanguages` that controls whether `WTF::minimizedPreferredLanguages`
is called. Since the result is cached, create separate `Vector<String>` for each enum value.
LayoutTests:
* media/modern-media-controls/tracks-support/sorted-by-user-preferred-languages.html: Added.
* media/modern-media-controls/tracks-support/sorted-by-user-preferred-languages-expected.txt: Added.
* media/content/lorem-ipsum.vtt: Added.
Canonical link: https://commits.webkit.org/238145@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-26 00:15:02 +00:00
2021-05-25 Devin Rousso <drousso@apple.com>
[Modern Media Controls] REGRESSION(r254389) media controls needs the full list of language preferences for ordering tracks
https://bugs.webkit.org/show_bug.cgi?id=226038
Reviewed by Myles C. Maxfield and Eric Carlson.
Media controls need access to the full list of language preferences in order to properly
sort/order the list of tracks in the controls UI. For example, if a `<video>` has subtitles
for English, Spanish, and French, and the user has English (default) and French (alternate)
configured in the Language & Region view of System Preferences on macOS, WebKit should order
the subtitles list English, French, and then Spanish.
* wtf/Language.h:
* wtf/Language.cpp:
(WTF::cachedFullPlatformPreferredLanguages): Added.
(WTF::cachedMinimizedPlatformPreferredLanguages): Added.
(WTF::languageDidChange):
(WTF::defaultLanguage):
(WTF::userPreferredLanguages):
(WTF::platformLanguageDidChange): Deleted.
Move the caching in `wtf/cf/LanguageCF.cpp` to `wtf/Language.cpp` so that all platforms can
benefit from caching the result of `platformUserPreferredLanguages`.
* wtf/cf/LanguageCF.cpp:
(WTF::platformUserPreferredLanguages):
(WTF::platformLanguageDidChange): Deleted.
* wtf/playstation/LanguagePlayStation.cpp:
(WTF::platformUserPreferredLanguages):
* wtf/spi/cocoa/NSLocaleSPI.h:
* wtf/unix/LanguageUnix.cpp:
(WTF::platformUserPreferredLanguages):
* wtf/win/LanguageWin.cpp:
(WTF::platformUserPreferredLanguages):
Add `WTF::ShouldMinimizeLanguages` that controls whether `WTF::minimizedPreferredLanguages`
is called. Since the result is cached, create separate `Vector<String>` for each enum value.
2021-05-25 23:19:19 +00:00
2021-05-25 Chris Dumez <cdumez@apple.com>
Stop using UncheckedLock in html/canvas
https://bugs.webkit.org/show_bug.cgi?id=226186
Reviewed by Darin Adler.
Allow converting a Locker<Lock> to an AbstractLocker type. This allows porting
code from UncheckedLock to Lock even if said code is passing the Locker<Lock>
as parameter around as an AbstractLocker. This is very common in JSC and in
html/canvas.
Also make DropLockForScope work with Locker<Lock> to help port code over.
* wtf/Lock.h:
Switch from WTF::Optional to std::optional
https://bugs.webkit.org/show_bug.cgi?id=211674
Reviewed by Chris Dumez.
Source/JavaScriptCore:
* runtime/IntlCollator.cpp:
(JSC::IntlCollator::initializeCollator): Use JSObject* instead of
Optional<JSObject&>.
* runtime/IntlDateTimeFormat.cpp:
(JSC::toDateTimeOptionsAnyDate): Ditto.
(JSC::IntlDateTimeFormat::initializeDateTimeFormat): Ditto.
* runtime/IntlDisplayNames.cpp:
(JSC::IntlDisplayNames::initializeDisplayNames): Ditto.
* runtime/IntlListFormat.cpp:
(JSC::IntlListFormat::initializeListFormat): Ditto.
* runtime/IntlLocale.cpp:
(JSC::IntlLocale::initializeLocale): Ditto.
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::initializeNumberFormat): Ditto.
* runtime/IntlNumberFormat.h: Ditto.
* runtime/IntlNumberFormatInlines.h:
(JSC::setNumberFormatDigitOptions): Ditto.
* runtime/IntlObject.cpp:
(JSC::intlBooleanOption): Ditto.
(JSC::intlStringOption): Ditto.
(JSC::intlNumberOption): Ditto.
(JSC::supportedLocales): Ditto.
* runtime/IntlObject.h: Ditto.
* runtime/IntlObjectInlines.h:
(JSC::intlOption): Ditto.
(JSC::intlGetOptionsObject): Ditto.
(JSC::intlCoerceOptionsToObject): Ditto.
* runtime/IntlPluralRules.cpp:
(JSC::IntlPluralRules::initializePluralRules): Ditto.
* runtime/IntlPluralRules.h: Ditto.
* runtime/IntlRelativeTimeFormat.cpp:
(JSC::IntlRelativeTimeFormat::initializeRelativeTimeFormat): Ditto.
* runtime/IntlSegmenter.cpp:
(JSC::IntlSegmenter::initializeSegmenter): Ditto.
Source/WebCore:
* platform/graphics/VP9Utilities.h: Tweaked coding style a bit.
Added missing operator!= because std::optional's operator!= relies
on that, while WTF::Optional's operator!= relied on operator==.
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
(Encoders::definition): Use a pointer instead of Optional<&>.
* testing/Internals.cpp:
(WebCore::Internals::setVP9ScreenSizeAndScaleForTesting): Use a
form of construction for ScreenDataOverrides that works with both
WTF::Optional and std::optional. Something about way the old code
used WTF::makeOptional was not compatible with std::make_optional,
but it was easy to make it more straightforward and not even have
to use a "make" function.
Source/WebKit:
* Platform/IPC/ArgumentCoder.h:
(IPC::ArgumentCoder::decode): Add a WTFMove. Turns out this was not needed
to get compiling with std::optional, but it's a good idea for performance.
This is one of those cases where it looks like the return value optimization
would work, but it doesn't because the return value doesn't exactly match
the local variable's type.
* Shared/TouchBarMenuData.h: Remove some overzealous use of explicit that
was preventing some files from compiling with the stricter std::optional
constructor rules, while it did not prevent compiling with WTF::Optional.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::switchToBrowsingContext): Removed an unused
lambda capture and local variable. Not clear how this is related to
std::optional, but showed up as a compiler warning.
Source/WTF:
* wtf/Forward.h: Remove Optional forward declaration.
Also include Optional.h, just for now. Need to remove this once
we do the global rename.
* wtf/Optional.h: Replaced the entire WTF::Optional implementation
with a WTF::Optional "using" that makes it a synonym for std::optional.
WTF::nullopt being a synonym for std::nullopt and WTF::nullopt_t
being a synonym for std::nullopt_t. Also included functions so
that WTF::makeOptional calls std::make_optional and kept the
WTF extension named valueOrCompute. Need to remove these once we
do the global rename, and likely just get rid of valueOrCompute, and
then delete this entire header.
* wtf/Seconds.h: Added an include of FastMalloc.h, since it's no
longer pulled in because of including Optional.h.
* wtf/persistence/PersistentCoder.h: Use Forward.h for now instead of
forward-declaring WTF::optional.
Tools:
* Scripts/webkitpy/style/checker.py: Removed exceptions from the WTF::Optional
style rule for WebRTC.
* Scripts/webkitpy/style/checkers/cpp.py: Removed check_wtf_optional.
* Scripts/webkitpy/style/checkers/cpp_unittest.py: Removed test_wtf_optional.
* TestWebKitAPI/CMakeLists.txt: Removed Optional.cpp.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Ditto.
* TestWebKitAPI/Tests/WTF/Optional.cpp: Removed.
* TestWebKitAPI/Tests/WTF/cf/RetainPtr.cpp: Updated test to not rely on non-standard
aspects of moving from an optional. Instead check the retain count to make sure we
have moved successfully.
* TestWebKitAPI/Tests/WTF/ns/RetainPtr.mm: Ditto.
Canonical link: https://commits.webkit.org/238131@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278035 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-25 19:35:15 +00:00
2021-05-24 Darin Adler <darin@apple.com>
Switch from WTF::Optional to std::optional
https://bugs.webkit.org/show_bug.cgi?id=211674
Reviewed by Chris Dumez.
* wtf/Forward.h: Remove Optional forward declaration.
Also include Optional.h, just for now. Need to remove this once
we do the global rename.
* wtf/Optional.h: Replaced the entire WTF::Optional implementation
with a WTF::Optional "using" that makes it a synonym for std::optional.
WTF::nullopt being a synonym for std::nullopt and WTF::nullopt_t
being a synonym for std::nullopt_t. Also included functions so
that WTF::makeOptional calls std::make_optional and kept the
WTF extension named valueOrCompute. Need to remove these once we
do the global rename, and likely just get rid of valueOrCompute, and
then delete this entire header.
* wtf/Seconds.h: Added an include of FastMalloc.h, since it's no
longer pulled in because of including Optional.h.
* wtf/persistence/PersistentCoder.h: Use Forward.h for now instead of
forward-declaring WTF::optional.
2021-05-25 19:12:21 +00:00
2021-05-25 Per Arne Vollan <pvollan@apple.com>
[AppleWin] JSC fails to build
https://bugs.webkit.org/show_bug.cgi?id=226225
<rdar://78330435>
Reviewed by Brent Fulgham.
Speculative build fix for missing script to generate unified sources. Make sure the WTF scripts directory exists before
copying the script there, and add a CMake log message to help further debugging if this is not the correct fix.
* wtf/CMakeLists.txt:
2021-05-25 17:34:01 +00:00
2021-05-25 Don Olmstead <don.olmstead@sony.com>
[PlayStation] Implement FileSystem without std::filesystem
https://bugs.webkit.org/show_bug.cgi?id=226197
Reviewed by Chris Dumez.
The PlayStation 4 doesn't have support in its SDK for std::filesystem so backport the
functions jettisoned from FileSystemPOSIX and add them to a FileSystemPlayStation.cpp.
The ordering matches the contents of FileSystem.cpp.
Most of the functions ported to std::filesystem were just moved over as is from the commit
prior to r276879. Minor changes to the function signatures made when required.
The fileTypePotentiallyFollowingSymLinks function was created from the previous behavior
of fileMetadataUsingFunction and toFileMetataType.
The hardLinkCount was created from looking at the behavior hardLinkCount replaced in
r277446.
* wtf/FileSystem.cpp:
* wtf/PlatformHave.h:
* wtf/PlatformPlayStation.cmake:
* wtf/StdFilesystem.h:
* wtf/playstation/FileSystemPlayStation.cpp: Added.
(WTF::FileSystemImpl::fileTypePotentiallyFollowingSymLinks):
(WTF::FileSystemImpl::fileExists):
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::deleteEmptyDirectory):
(WTF::FileSystemImpl::moveFile):
(WTF::FileSystemImpl::fileSize):
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::volumeFreeSpace):
(WTF::FileSystemImpl::createSymbolicLink):
(WTF::FileSystemImpl::hardLink):
(WTF::FileSystemImpl::hardLinkOrCopyFile):
(WTF::FileSystemImpl::hardLinkCount):
(WTF::FileSystemImpl::deleteNonEmptyDirectory):
(WTF::FileSystemImpl::fileModificationTime):
(WTF::FileSystemImpl::updateFileModificationTime):
(WTF::FileSystemImpl::isHiddenFile):
(WTF::FileSystemImpl::fileType):
(WTF::FileSystemImpl::fileTypeFollowingSymlinks):
(WTF::FileSystemImpl::pathFileName):
(WTF::FileSystemImpl::parentPath):
(WTF::FileSystemImpl::realPath):
(WTF::FileSystemImpl::pathByAppendingComponent):
(WTF::FileSystemImpl::pathByAppendingComponents):
(WTF::FileSystemImpl::listDirectory):
2021-05-25 03:59:48 +00:00
2021-05-24 Chris Dumez <cdumez@apple.com>
Stop using UncheckedLock in WTF::RecursiveLock
https://bugs.webkit.org/show_bug.cgi?id=226206
Reviewed by Sam Weinig.
Stop using UncheckedLock in WTF::RecursiveLock and use a regular Lock instead.
This is a step towards phasing out UncheckedLock.
Note that despite this change, RecursiveLock still doesn't benefit from
Clang thread safety analysis. Its functions do conditional locking / unlocking
which are not currently supported by analysis. Even if they were, we'd need
a template specialization for RecursiveLockAdapter<Lock> since
RecursiveLockAdapter may wrap other types of Lock which do not support analysis.
* wtf/RecursiveLockAdapter.h:
Remove StringBuilder::appendLiteral
https://bugs.webkit.org/show_bug.cgi?id=226137
Reviewed by Chris Dumez.
Source/JavaScriptCore:
* API/tests/PingPongStackOverflowTest.cpp:
(PingPongStackOverflowObject_hasInstance): Use append instead of appendLiteral.
* bindings/ScriptFunctionCall.cpp:
(Deprecated::ScriptCallArgumentHandler::appendArgument): Remove unnecessary cast
from const char* to String, which defeats optimization and has no benefit.
* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayPatternNode::toString const): Use append instead of appendLiteral.
(JSC::RestParameterNode::toString const): Ditto.
* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::json): Use append instead of appendLiteral.
Removed unnecesary use of appendQuotedJSONString to append the result of
snapshotTypeToString and edgeTypeToString, which return a const char* that
never contains characters that require special quoting consideration, so
can be appended efficiently with the normal append function.
* inspector/agents/InspectorAuditAgent.cpp:
(Inspector::InspectorAuditAgent::run): Use makeString instead of StringBuilder.
* inspector/agents/InspectorConsoleAgent.cpp: Use auto for the result of makeString.
* jsc.cpp: Use appned instead of appendLiteral.
* parser/ParserArena.cpp:
(JSC::IdentifierArena::makePrivateIdentifier): Use auto for the result of makeString.
* runtime/ConsoleClient.cpp:
(JSC::ConsoleClient::printConsoleMessage): Use append instead of appendLiteral.
Also use variadic append when practical for better efficiency.
(JSC::ConsoleClient::printConsoleMessageWithArguments): Ditto.
* runtime/DateConversion.cpp:
(JSC::formatDateTime): Ditto.
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::sanitizedToString): Use makeString instead of StringBuilder.
* runtime/ExceptionHelpers.cpp:
(JSC::notAFunctionSourceAppender): Use append instead of appendLiteral.
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::initializeDateTimeFormat): Ditto.
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::initializeNumberFormat): Ditto.
* runtime/JSCustomGetterFunction.cpp:
(JSC::JSCustomGetterFunction::create): Use auto and cut down on reference count
churn by using passing the StringImpl to makeString.
* runtime/JSCustomSetterFunction.cpp:
(JSC::JSCustomSetterFunction::create): Ditto.
* runtime/JSGlobalObjectFunctions.cpp: Use more const and use variadic
append for better efficiency.
* runtime/JSONObject.cpp:
(JSC::Stringifier::appendStringifiedValue): Use append instead of appendLiteral.
(JSC::Stringifier::Holder::appendNextProperty): Ditto.
* runtime/JSStringJoiner.h: Deleted unused appendLiteral function.
Unrelated to StringBuilder::appendLiteral, but dead code.
* runtime/Options.cpp:
(JSC::Options::dumpOption): Use append instead of appendLiteral.
* runtime/RegExpPrototype.cpp:
(JSC::appendLineTerminatorEscape<UChar>): Ditto.
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::reportTopFunctions): Use auto for the result of makeString.
(JSC::SamplingProfiler::reportTopBytecodes): Ditto.
* runtime/TypeProfiler.cpp:
(JSC::TypeProfiler::typeInformationForExpressionAtOffset): Use append instead of
appendLiteral.
* runtime/TypeSet.cpp:
(JSC::TypeSet::dumpTypes const): Use append instead of appendLiteral.
(JSC::TypeSet::toJSONString const): Ditto.
(JSC::StructureShape::propertyHash): Ditto.
(JSC::StructureShape::toJSONString const): Ditto.
Source/WebCore:
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::packageFormData): Use auto for the result of makeString.
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::loggingString const): Use append instead
of appendLiteral.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use auto
for the result of makeString.
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::buildPreIndexStatement): Use makeString
instead of StringBuilder.
(WebCore::IDBServer::buildIndexStatement): Ditto.
(WebCore::IDBServer::buildObjectStoreStatement): Ditto.
* Modules/websockets/WebSocket.cpp:
(WebCore::encodeProtocolString): Use append instead of appendLiteral.
* Modules/websockets/WebSocketExtensionDispatcher.cpp:
(WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension): Ditto.
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::clientHandshakeMessage const): Use
makeString instead of StringBuilder.
(WebCore::WebSocketHandshake::clientHandshakeRequest const): Tweak
to match the function above more closely, and use ASCIILiteral.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(formatForDebugger): Use makeString instead of StringBuilder.
* contentextensions/CombinedURLFilters.cpp:
(WebCore::ContentExtensions::prefixTreeVertexToString): Use
append instead of appendLiteral.
* css/CSSBasicShapes.cpp:
(WebCore::buildCircleString): Ditto.
(WebCore::buildEllipseString): Ditto.
(WebCore::buildPathString): Ditto.
(WebCore::buildPolygonString): Ditto.
(WebCore::buildInsetString): Ditto.
* css/CSSGradientValue.cpp:
(WebCore::CSSLinearGradientValue::customCSSText const): Ditto.
(WebCore::CSSRadialGradientValue::customCSSText const): Ditto.
(WebCore::CSSConicGradientValue::customCSSText const): Ditto.
* css/CSSGridIntegerRepeatValue.cpp:
(WebCore::CSSGridIntegerRepeatValue::customCSSText const):
Use makeString instead of StringBuilder.
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::customCSSText const): Use append
instead of appendLiteral.
* css/CSSImportRule.cpp:
(WebCore::CSSImportRule::cssText const): Use makeString instead
of StringBuilder.
* css/CSSKeyframeRule.cpp:
(WebCore::StyleRuleKeyframe::cssText const): Ditto.
* css/CSSKeyframesRule.cpp:
(WebCore::CSSKeyframesRule::cssText const): Use variadic append.
* css/CSSLineBoxContainValue.cpp:
(WebCore::CSSLineBoxContainValue::customCSSText const): Use
append instead of appendLiteral.
* css/CSSNamespaceRule.cpp:
(WebCore::CSSNamespaceRule::cssText const): Ditto.
* css/CSSPageRule.cpp:
(WebCore::CSSPageRule::cssText const): Use makeString instead of
StringBuilder.
* css/CSSPaintImageValue.cpp:
(WebCore::CSSPaintImageValue::customCSSText const): Ditto.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const):
Use append instead of appendLiteral.
* css/CSSSelector.cpp:
(WebCore::appendLangArgumentList): Use variadic append.
(WebCore::CSSSelector::selectorText const): Ditto. Also use
append instead of appendLiteral and make some improvements to
cut down on allocations a little.
* css/CSSSelectorList.cpp:
(WebCore::CSSSelectorList::buildSelectorsText const): Use
append instead of appendLiteral.
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::CSSStyleSheet): Moved more of the
data member initialization to the class definition.
(WebCore::CSSStyleSheet::addRule): Use makeString instead of
StringBuilder.
* css/CSSStyleSheet.h: Moved initialization here.
* css/CSSTimingFunctionValue.cpp:
(WebCore::CSSStepsTimingFunctionValue::customCSSText const):
Use makeString instead of StringBuilder.
(WebCore::CSSSpringTimingFunctionValue::customCSSText const):
Ditto.
* css/MediaList.cpp:
(WebCore::MediaQuerySet::mediaText const): Use append instead
of appendLiteral.
* css/MediaQuery.cpp:
(WebCore::MediaQuery::serialize const): Ditto.
* css/MediaQueryExpression.cpp:
(WebCore::MediaQueryExpression::serialize const): Use makeString
instead of StringBuilder.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getLayeredShorthandValue const):
Use append instead of appendLiteral.
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::serialize const): Removed a lot of
unnecessary braces. Use variadic append and append instead of appendLiteral.
* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Use auto for the result
of makeString.
* dom/Element.cpp:
(WebCore::appendAttributes): Use variadic append and append
instead of appendLiteral.
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::parseSandboxPolicy): Ditto.
* editing/HTMLInterchange.cpp:
(WebCore::convertHTMLTextToInterchangeFormat): Ditto.
* editing/TextIterator.cpp:
(WebCore::createSearcher): Use auto for the result of makeString.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag):
Use append instead of appendLiteral.
(WebCore::StyledMarkupAccumulator::appendStartTag): Ditto.
(WebCore::urlToMarkup): Ditto.
* html/FormController.cpp:
(WebCore::recordFormStructure): Ditto.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::reportValidity): Use auto for
the result of makeString.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::validateInteractively): Ditto.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::completeURLsInAttributeValue const):
Use append insteaed of appendLiteral.
* html/MediaElementSession.cpp:
(WebCore::restrictionNames): Use auto for the result of makeString.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getUniformLocation): Ditto.
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemaining): Ditto.
* html/parser/XSSAuditorDelegate.cpp:
(WebCore::buildConsoleError): Use makeString instead of StringBuilder.
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::rebuildDisplayTree): Ditto.
* inspector/InspectorFrontendAPIDispatcher.cpp:
(WebCore::expressionForEvaluatingCommand): Use append instead of appendLiteral.
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::drawElementTitle): Use auto for the result of makeString.
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::addRule): Use append instead of appendLiteral.
* inspector/agents/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource):
Use makeString instead of StringBuilder.
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::didReceiveResponse): Use auto for the result of makeString.
(WebCore::WebConsoleAgent::didFailLoading): Ditto.
* loader/MixedContentChecker.cpp:
(WebCore::logWarning): Ditto
(WebCore::MixedContentChecker::checkFormForMixedContent): Ditto
* loader/PrivateClickMeasurement.cpp:
(WebCore::makeValidURL): Added. Used for various cases below that all construct
URLs in the same way with the same kinds of checks. Use makeString here instead
of StringBuilder.
(WebCore::attributionReportURL): Call makeValidURL.
(WebCore::PrivateClickMeasurement::tokenSignatureURL const): Ditto.
(WebCore::PrivateClickMeasurement::tokenPublicKeyURL const): Ditto.
* loader/ResourceLoadStatistics.cpp:
(WebCore::appendBoolean): Use append instead of appendLiteral.
(WebCore::appendHashSet): Ditto.
(WebCore::appendNavigatorAPIOptionSet): Ditto.
(WebCore::appendScreenAPIOptionSet): Ditto.
(WebCore::ResourceLoadStatistics::toString const): Ditto.
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::loadResourceSynchronously): Use auto for
the result of makeString.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage): Ditto.
* page/Frame.cpp:
(WebCore::createRegExpForLabels): Use append instead of appendLiteral.
Also tweak coding style a bit.
* page/FrameView.cpp:
(WebCore::FrameView::logMockScrollAnimatorMessage const): Use makeString
instead of StringBuilder.
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator::appendStartTag):
Use append instead of appendLiteral.
(WebCore::PageSerializer::serializeCSSStyleSheet): Ditto.
(WebCore::PageSerializer::urlForBlankFrame): Use auto for the result of
makeString.
* page/PerformanceLoggingClient.cpp:
(WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString):
Use makeString instead of StringBuilder.
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw): Use auto for the result of
makeString.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::consoleMessageForViolation): Use makeString instsead of StringBuilder.
(WebCore::ContentSecurityPolicy::allowRunningOrDisplayingInsecureContent): Ditto.
(WebCore::ContentSecurityPolicy::reportInvalidDirectiveValueCharacter const):
Get rid of local variable for result of makeString.
(WebCore::ContentSecurityPolicy::reportInvalidPathCharacter const): Ditto.
(WebCore::ContentSecurityPolicy::reportInvalidSourceExpression const): Ditto.
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::create): Get rid of local
variable for result of makeString.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
Use makeString instead of StringBulder.
* platform/Decimal.cpp:
(WebCore::Decimal::toString const): Use append instead of appendLiteral.
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::createFromCSSText): Use makeString instead
of StringBuilder.
* platform/audio/HRTFElevation.cpp:
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation): Use auto
for the result of makeString.
* platform/glib/UserAgentGLib.cpp:
(WebCore::buildUserAgentString): Use append instead of appendLiteral.
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processCueAttributes): Use
append instead of appendLiteral.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveCommitChanges): Got rid of local
variable for result of makeString.
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations): Use auto
for result of makeString.
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::tileRevalidationTimerFired): Update to
use OptionSet.
* platform/graphics/ca/TileGrid.cpp:
(WebCore::validationPolicyAsString): Use OptionSet.
(WebCore::TileGrid::setNeedsDisplayInRect): Use auto for iterator
and range-based for loop.
(WebCore::TileGrid::updateTileLayerProperties): Ditto.
(WebCore::TileGrid::blankPixelCount const): Ditto.
(WebCore::TileGrid::removeTiles): Use HashCountedSet.
(WebCore::TileGrid::revalidateTiles): Use OptionSet.
(WebCore::TileGrid::retainedTileBackingStoreMemory const): Use
ranged-based for loop.
(WebCore::TileGrid::drawTileMapContents const): Use range-based
for loop and use writeIntegerToBuffer instead of String::number.
(WebCore::TileGrid::platformCALayerRepaintCount const): Use
HashCountedSet.
(WebCore::TileGrid::platformCALayerIncrementRepaintCount): Ditto.
This cuts us down from 3 hash table lookups to 1.
(WebCore::TileGrid::removeUnparentedTilesNow): Removed local
variable to make code a little tighter.
* platform/graphics/ca/TileGrid.h: Use OptionSet and HashCountedSet.
Removed some type names.
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(WebCore::PlatformCAFilters::setFiltersOnLayer): Use auto for
reuslt of makeString.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
* platform/mock/ScrollAnimatorMock.cpp:
(WebCore::ScrollAnimatorMock::scrollbarPrefix const): Added
helper function for use below.
(WebCore::ScrollAnimatorMock::mouseEnteredScrollbar const): Use
makeString instead of StringBuilder.
(WebCore::ScrollAnimatorMock::mouseExitedScrollbar const): Ditto.
(WebCore::ScrollAnimatorMock::mouseIsDownInScrollbar const): Ditto.
* platform/mock/ScrollAnimatorMock.h: Ditto.
* platform/network/ProxyServer.cpp:
(WebCore::appendProxyServerString): Use append instead of appendLiteral.
(WebCore::toString): Ditto.
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeSuggestedFilename): Get rid
of local variable with result of maekString in it.
* platform/playstation/UserAgentPlayStation.cpp:
(WebCore::platformForUAString): Deleted. No need for a global variable
to hold the result of something called only once.
(WebCore::platformVersionForUAString): Ditto.
(WebCore::buildUserAgentString): Deleted.
(WebCore::standardUserAgentStatic): Moved the logic from buildUserAgentString
here, using makeString instead of StringBuilder.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open): Use auto for result of makeString.
* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::deleteDatabaseFile): Ditto.
* platform/text/DateTimeFormat.cpp:
(WebCore::DateTimeFormat::quoteAndAppendLiteral): Use append instead
of appendLiteral and StringView::substring instead of String::substring.
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::replaceNewlinesWithWindowsStyleNewlines): Use append
instead of appendLiteral.
* platform/win/UserAgentWin.cpp:
(WebCore::standardUserAgent): Use makeString instead of StringBuildeer.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::name const): Ditto.
(WebCore::RenderLayer::debugDescription const): Ditto.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo): Use append instead of
appendLiteral.
* rendering/RenderTreeAsText.cpp:
(WebCore::quoteAndEscapeNonPrintables): Ditto.
(WebCore::nodePosition): Ditto.
* svg/SVGPathStringBuilder.cpp:
(WebCore::SVGPathStringBuilder::moveTo): Ditto.
(WebCore::SVGPathStringBuilder::lineTo): Ditto.
(WebCore::SVGPathStringBuilder::lineToHorizontal): Ditto.
(WebCore::SVGPathStringBuilder::lineToVertical): Ditto.
(WebCore::SVGPathStringBuilder::curveToCubic): Ditto.
(WebCore::SVGPathStringBuilder::curveToCubicSmooth): Ditto.
(WebCore::SVGPathStringBuilder::curveToQuadratic): Ditto.
(WebCore::SVGPathStringBuilder::curveToQuadraticSmooth): Ditto.
(WebCore::SVGPathStringBuilder::arcTo): Ditto.
(WebCore::SVGPathStringBuilder::closePath): Ditto.
* testing/Internals.cpp:
(WebCore::Internals::dumpMarkerRects): Ditto.
(WebCore::appendOffsets):
(WebCore::Internals::scrollSnapOffsets): Ditto.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::validateWorkerResponse): Use auto
for reuslt of makeString.
Source/WebKit:
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndMakeDomainList): Use append
instead of appendLiteral.
(WebKit::domainsToString): Ditto.
(WebKit::buildList): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics): Ditto.
(WebKit::appendBoolean): Ditto.
(WebKit::appendNextEntry): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::appendSubStatisticList const): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::attributionToString): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString): Ditto.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics): Ditto.
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: Ditto.
(WebKit::domainsToString): Ditto.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::create): Moved this here from the header.
(WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::toString const): Ditto.
(WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::encode const): Ditto.
(WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::decode): Ditto.
(WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::operator== const): Ditto.
(WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::toString const): Ditto.
(WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::encode const): Ditto.
(WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::decode): Ditto.
(WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::operator< const): Ditto.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: Moved member
functions of the nested structures into the implementation file and fixed
the indentation of the structures to indicate the nesting.
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::continueCheckingRequest): Do not use a local
variable for the reuslt of makeString.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::newTestingSession): Ditto.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::dumpContentsToFile): Use append instead of appendLiteral
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::asJSON const): Ditto.
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeVersionedDirectoryPath): Do not use a local variable for
the result of makeString.
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::buildAcceptLanguages): Use append instead of appendLiteral.
* NetworkProcess/soup/WebSocketTaskSoup.cpp:
(WebKit::WebSocketTask::acceptedExtensions const): Ditto.
* NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
(WebKit::NetworkMDNSRegister::registerMDNSName): Use auto for the result of makeString.
* Shared/WebMemorySampler.cpp:
(WebKit::WebMemorySampler::writeHeaders): Ditto.
* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::initializeSandboxParameters): Do not use a local variable for the result of
makeString. Also, take advantage of the support for concatenating an NSString instead
of converting it to a WTF::String.
* Shared/mac/WebMemorySampler.mac.mm:
(WebKit::WebMemorySampler::sampleWebKit const): Use ASCIILiteral and remove explicit
conversion to String.
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewRunJavaScriptCallback): Use append instead of appendLiteral.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::fileCanBeAcceptedForUpload): Use auto for result of makeString.
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: Use makeString instead of
StringBuilder.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::requestStorageSpace): Use auto for result of makeString.
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::loggingString): Use append instead of appendLiteral.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processDidFinishLaunching): Use auto for result of makeString.
(WebKit::WebProcessPool::startMemorySampler): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::dumpHistoryItem): Use append instead of appendLiteral.
(WebKit::WebPage::getContentsAsString): Ditto.
Source/WebKitLegacy:
* WebCoreSupport/NetworkStorageSessionMap.cpp:
(NetworkStorageSessionMap::switchToNewTestingSession): Do not use local
for return value of makeString.
Source/WebKitLegacy/mac:
* WebView/WebHTMLRepresentation.mm:
(regExpForLabels): Use append instead of appendLiteral.
Also imrpove local variable names a bit.
Source/WebKitLegacy/win:
* AccessibleBase.cpp:
(AccessibleBase::get_accKeyboardShortcut): Use append instead of appnedLiteral.
* WebView.cpp: Ditto.
Source/WTF:
The optimization done by appendLiteral has minimal value and is something we
can do without. It does not cut down the number of allocations, which is the
main cost of the StringBuilder class. Getting rid of the differently named
appendLiteral improves the design of the StringBuilder class for callers.
Our goal is to get as close as possible to a single append function.
If we decide we need an optimization for literals, we can come up with a
different way that is compatible with append. For example, we could assume
that any char array is a literal and check that at compile time in
StringConcatenate; that optimization would work for both makeString and
StringBuilder. Or we could use a strategy like ASCIILiteral.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::encodeForFileName): Streamline logic,
and use variadic append to make this more efficient.
* wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::escapeString): Use append instead
of appendLiteral.
(WTF::JSONImpl::Value::writeJSON const): Ditto.
* wtf/Logger.h:
(WTF::Logger::log): Use auto for result of makeString.
(WTF::Logger::logVerbose): Ditto.
* wtf/MediaTime.cpp:
(WTF::MediaTime::toString const): Use makeString instead of StringBuilder.
* wtf/text/IntegerToStringConversion.h:
Made lengthOfIntegerAsString a constexpr function so we can use it to
compute the required size of arrays for conversion. Added using for both
lengthOfIntegerAsString and writeIntegerToBuffer so we can use them without
the WTF prefix as is customary for functions in WTF.
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::appendLiteral): Deleted.
* wtf/text/StringConcatenate.h: Added support for appending StringImpl&,
StringImpl*, AtomStringImpl&, and AtomStringImpl*.
Tools:
* TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
Use append instead of appendLiteral.
* TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:
(TestWebKitAPI::createCommand): Use makeString instead of StringBuilder.
* TestWebKitAPI/Tests/WebCore/Logging.cpp:
(TestWebKitAPI::TEST_F): Made lots of fixes to code inside #if TEST_OUTPUT,
which hasn't compiled in a long time. Still not 100% there, but closer.
* TestWebKitAPI/Tests/WebCore/TextCodec.cpp:
(TestWebKitAPI::testDecode): Use append instead of appendLiteral.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::helpText const): Ditto.
Canonical link: https://commits.webkit.org/238091@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-24 21:51:47 +00:00
2021-05-24 Darin Adler <darin@apple.com>
Remove StringBuilder::appendLiteral
https://bugs.webkit.org/show_bug.cgi?id=226137
Reviewed by Chris Dumez.
The optimization done by appendLiteral has minimal value and is something we
can do without. It does not cut down the number of allocations, which is the
main cost of the StringBuilder class. Getting rid of the differently named
appendLiteral improves the design of the StringBuilder class for callers.
Our goal is to get as close as possible to a single append function.
If we decide we need an optimization for literals, we can come up with a
different way that is compatible with append. For example, we could assume
that any char array is a literal and check that at compile time in
StringConcatenate; that optimization would work for both makeString and
StringBuilder. Or we could use a strategy like ASCIILiteral.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::encodeForFileName): Streamline logic,
and use variadic append to make this more efficient.
* wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::escapeString): Use append instead
of appendLiteral.
(WTF::JSONImpl::Value::writeJSON const): Ditto.
* wtf/Logger.h:
(WTF::Logger::log): Use auto for result of makeString.
(WTF::Logger::logVerbose): Ditto.
* wtf/MediaTime.cpp:
(WTF::MediaTime::toString const): Use makeString instead of StringBuilder.
* wtf/text/IntegerToStringConversion.h:
Made lengthOfIntegerAsString a constexpr function so we can use it to
compute the required size of arrays for conversion. Added using for both
lengthOfIntegerAsString and writeIntegerToBuffer so we can use them without
the WTF prefix as is customary for functions in WTF.
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::appendLiteral): Deleted.
* wtf/text/StringConcatenate.h: Added support for appending StringImpl&,
StringImpl*, AtomStringImpl&, and AtomStringImpl*.
2021-05-24 19:29:38 +00:00
2021-05-24 Keith Miller <keith_miller@apple.com>
Unreviewed, revert r276610 because it causes a 1% PLT regression.
* wtf/Bag.h:
2021-05-24 18:29:01 +00:00
2021-05-24 Chris Dumez <cdumez@apple.com>
Drop CheckedLock / CheckedCondition aliases
https://bugs.webkit.org/show_bug.cgi?id=226176
Reviewed by Kate Cheney.
Drop CheckedLock / CheckedCondition aliases now that they are the default.
* WTF.xcodeproj/project.pbxproj:
* wtf/Assertions.cpp:
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThreadCondition::wait):
(WTF::AutomaticThreadCondition::waitFor):
(WTF::AutomaticThread::AutomaticThread):
* wtf/AutomaticThread.h:
* wtf/CMakeLists.txt:
* wtf/CheckedCondition.h: Removed.
* wtf/CheckedLock.h: Removed.
* wtf/Condition.h:
* wtf/CrossThreadQueue.h:
* wtf/CrossThreadTaskHandler.h:
* wtf/CryptographicallyRandomNumber.cpp:
* wtf/FastMalloc.cpp:
* wtf/Forward.h:
* wtf/Language.cpp:
* wtf/Lock.cpp:
(WTF::UncheckedLock::lockSlow):
(WTF::UncheckedLock::unlockSlow):
(WTF::UncheckedLock::unlockFairlySlow):
(WTF::UncheckedLock::safepointSlow):
* wtf/Lock.h:
(WTF::WTF_ASSERTS_ACQUIRED_LOCK):
* wtf/Logger.cpp:
* wtf/Logger.h:
(WTF::Logger::WTF_RETURNS_LOCK):
* wtf/MessageQueue.h:
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::release):
(WTF::MetaAllocator::MetaAllocator):
(WTF::MetaAllocator::allocate):
(WTF::MetaAllocator::currentStatistics):
* wtf/MetaAllocator.h:
* wtf/OSLogPrintStream.h:
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperPool::ParallelHelperPool):
* wtf/ParallelHelperPool.h:
* wtf/ParallelJobsGeneric.h:
* wtf/ParallelVectorIterator.h:
* wtf/ReadWriteLock.h:
* wtf/RecursiveLockAdapter.h:
* wtf/RunLoop.h:
* wtf/SynchronizedFixedQueue.h:
* wtf/Threading.cpp:
(WTF::Thread::allThreadsLock):
* wtf/Threading.h:
* wtf/TimingScope.cpp:
* wtf/URL.cpp:
* wtf/WTFSemaphore.h:
* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply):
* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
* wtf/WorkerPool.h:
* wtf/cf/LanguageCF.cpp:
* wtf/text/AtomStringImpl.cpp:
(WTF::AtomStringTableLocker::AtomStringTableLocker):
* wtf/text/StringView.cpp:
* wtf/threads/BinarySemaphore.h:
* wtf/unicode/icu/CollatorICU.cpp:
Make CheckedLock the default Lock
https://bugs.webkit.org/show_bug.cgi?id=226157
Reviewed by Darin Adler.
Make CheckedLock the default Lock so that we get more benefits from Clang
Thread Safety Analysis. Note that CheckedLock 100% relies on the existing
Source/JavaScriptCore:
Lock implementation and merely adds the clang anotations for thread
safety.
That this patch does is:
1. Rename the Lock class to UncheckedLock
2. Rename the CheckedLock class to Lock
3. Rename the Condition class to UncheckedCondition
4. Rename the CheckedCondition class to Condition
5. Update the types of certain variables from Lock / Condition to
UncheckedLock / UncheckedCondition if I got a build failure. Build
failures are usually caused by the following facts:
- Locker<CheckedLock> doesn't subclass AbstractLocker which a lot of
JSC code passes as argument
- Locker<CheckedLock> has no move constructor
- Locker<CheckedLock> cannot be constructed from a lock pointer, only
a reference
For now, CheckedLock and CheckedCondition remain as aliases to Lock and
Condition, in their respective CheckedLock.h / CheckedCondition.h headers.
I will drop them in a follow-up to reduce patch size.
I will also follow-up to try and get rid of as much usage of UncheckedLock
and UncheckedCondition as possible. I did not try very hard in this patch
to reduce patch size.
* assembler/testmasm.cpp:
* dfg/DFGCommon.cpp:
* dfg/DFGThreadData.h:
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::Worklist):
* dfg/DFGWorklist.h:
* dynbench.cpp:
* heap/BlockDirectory.h:
(JSC::BlockDirectory::bitvectorLock):
* heap/CodeBlockSet.h:
(JSC::CodeBlockSet::getLock):
* heap/Heap.cpp:
(JSC::Heap::Heap):
* heap/Heap.h:
* heap/MarkedSpace.h:
(JSC::MarkedSpace::directoryLock):
* heap/MarkingConstraintSolver.h:
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::donateKnownParallel):
* heap/SlotVisitor.h:
* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::getLock const):
(JSC::dumpJITMemory):
* jit/ExecutableAllocator.h:
(JSC::ExecutableAllocatorBase::getLock const):
* jit/JITWorklist.cpp:
(JSC::JITWorklist::JITWorklist):
* jit/JITWorklist.h:
* jsc.cpp:
* profiler/ProfilerDatabase.h:
* runtime/ConcurrentJSLock.h:
* runtime/DeferredWorkTimer.h:
* runtime/JSLock.h:
* runtime/SamplingProfiler.cpp:
(JSC::FrameWalker::FrameWalker):
(JSC::CFrameWalker::CFrameWalker):
(JSC::SamplingProfiler::takeSample):
* runtime/SamplingProfiler.h:
(JSC::SamplingProfiler::getLock):
* runtime/VM.h:
* runtime/VMTraps.cpp:
(JSC::VMTraps::invalidateCodeBlocksOnStack):
(JSC::VMTraps::VMTraps):
* runtime/VMTraps.h:
* tools/FunctionOverrides.h:
* tools/VMInspector.cpp:
(JSC::ensureIsSafeToLock):
* tools/VMInspector.h:
(JSC::VMInspector::getLock):
* wasm/WasmCalleeRegistry.h:
(JSC::Wasm::CalleeRegistry::getLock):
* wasm/WasmPlan.h:
* wasm/WasmStreamingCompiler.h:
* wasm/WasmThunks.h:
* wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::Worklist):
* wasm/WasmWorklist.h:
Source/WebCore:
Lock implementation and merely adds the clang anotations for thread
safety.
That this patch does is:
1. Rename the Lock class to UncheckedLock
2. Rename the CheckedLock class to Lock
3. Rename the Condition class to UncheckedCondition
4. Rename the CheckedCondition class to Condition
5. Update the types of certain variables from Lock / Condition to
UncheckedLock / UncheckedCondition if I got a build failure. Build
failures are usually caused by the following facts:
- Locker<CheckedLock> doesn't subclass AbstractLocker which a lot of
JSC code passes as argument
- Locker<CheckedLock> has no move constructor
- Locker<CheckedLock> cannot be constructed from a lock pointer, only
a reference
For now, CheckedLock and CheckedCondition remain as aliases to Lock and
Condition, in their respective CheckedLock.h / CheckedCondition.h headers.
I will drop them in a follow-up to reduce patch size.
I will also follow-up to try and get rid of as much usage of UncheckedLock
and UncheckedCondition as possible. I did not try very hard in this patch
to reduce patch size.
* Modules/indexeddb/server/IDBServer.cpp:
* Modules/webaudio/MediaElementAudioSourceNode.h:
* Modules/webdatabase/OriginLock.cpp:
* bindings/js/JSDOMGlobalObject.h:
* dom/Node.cpp:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::createMediaPlayer):
* html/canvas/WebGLContextGroup.cpp:
(WebCore::WebGLContextGroup::objectGraphLockForAContext):
* html/canvas/WebGLContextGroup.h:
* html/canvas/WebGLContextObject.cpp:
(WebCore::WebGLContextObject::objectGraphLockForContext):
* html/canvas/WebGLContextObject.h:
* html/canvas/WebGLObject.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::objectGraphLock):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLSharedObject.cpp:
(WebCore::WebGLSharedObject::objectGraphLockForContext):
* html/canvas/WebGLSharedObject.h:
* page/scrolling/mac/ScrollingTreeMac.h:
* platform/audio/ReverbConvolver.cpp:
(WebCore::ReverbConvolver::backgroundThreadEntry):
* platform/graphics/ShadowBlur.cpp:
(WebCore::ScratchBuffer::lock):
(WebCore::ShadowBlur::drawRectShadowWithTiling):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
Source/WebKit:
Lock implementation and merely adds the clang anotations for thread
safety.
That this patch does is:
1. Rename the Lock class to UncheckedLock
2. Rename the CheckedLock class to Lock
3. Rename the Condition class to UncheckedCondition
4. Rename the CheckedCondition class to Condition
5. Update the types of certain variables from Lock / Condition to
UncheckedLock / UncheckedCondition if I got a build failure. Build
failures are usually caused by the following facts:
- Locker<CheckedLock> doesn't subclass AbstractLocker which a lot of
JSC code passes as argument
- Locker<CheckedLock> has no move constructor
- Locker<CheckedLock> cannot be constructed from a lock pointer, only
a reference
For now, CheckedLock and CheckedCondition remain as aliases to Lock and
Condition, in their respective CheckedLock.h / CheckedCondition.h headers.
I will drop them in a follow-up to reduce patch size.
I will also follow-up to try and get rid of as much usage of UncheckedLock
and UncheckedCondition as possible. I did not try very hard in this patch
to reduce patch size.
* GPUProcess/graphics/RemoteGraphicsContextGL.cpp:
(WebKit::RemoteGraphicsContextGL::paintPixelBufferToImageBuffer):
* NetworkProcess/IndexedDB/WebIDBServer.cpp:
* UIProcess/API/glib/IconDatabase.h:
* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView knowsPageRange:]):
Source/WTF:
Lock implementation and merely adds the clang anotations for thread
safety.
That this patch does is:
1. Rename the Lock class to UncheckedLock
2. Rename the CheckedLock class to Lock
3. Rename the Condition class to UncheckedCondition
4. Rename the CheckedCondition class to Condition
5. Update the types of certain variables from Lock / Condition to
UncheckedLock / UncheckedCondition if I got a build failure. Build
failures are usually caused by the following facts:
- Locker<CheckedLock> doesn't subclass AbstractLocker which a lot of
JSC code passes as argument
- Locker<CheckedLock> has no move constructor
- Locker<CheckedLock> cannot be constructed from a lock pointer, only
a reference
For now, CheckedLock and CheckedCondition remain as aliases to Lock and
Condition, in their respective CheckedLock.h / CheckedCondition.h headers.
I will drop them in a follow-up to reduce patch size.
I will also follow-up to try and get rid of as much usage of UncheckedLock
and UncheckedCondition as possible. I did not try very hard in this patch
to reduce patch size.
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThreadCondition::wait):
(WTF::AutomaticThreadCondition::waitFor):
(WTF::AutomaticThread::AutomaticThread):
* wtf/AutomaticThread.h:
* wtf/CheckedCondition.h:
* wtf/CheckedLock.h:
* wtf/Condition.h:
* wtf/Lock.cpp:
(WTF::UncheckedLock::lockSlow):
(WTF::UncheckedLock::unlockSlow):
(WTF::UncheckedLock::unlockFairlySlow):
(WTF::UncheckedLock::safepointSlow):
* wtf/Lock.h:
(WTF::WTF_ASSERTS_ACQUIRED_LOCK):
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::release):
(WTF::MetaAllocator::MetaAllocator):
(WTF::MetaAllocator::allocate):
(WTF::MetaAllocator::currentStatistics):
* wtf/MetaAllocator.h:
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperPool::ParallelHelperPool):
* wtf/ParallelHelperPool.h:
* wtf/RecursiveLockAdapter.h:
* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
* wtf/WorkerPool.h:
Tools:
Lock implementation and merely adds the clang anotations for thread
safety.
That this patch does is:
1. Rename the Lock class to UncheckedLock
2. Rename the CheckedLock class to Lock
3. Rename the Condition class to UncheckedCondition
4. Rename the CheckedCondition class to Condition
5. Update the types of certain variables from Lock / Condition to
UncheckedLock / UncheckedCondition if I got a build failure. Build
failures are usually caused by the following facts:
- Locker<CheckedLock> doesn't subclass AbstractLocker which a lot of
JSC code passes as argument
- Locker<CheckedLock> has no move constructor
- Locker<CheckedLock> cannot be constructed from a lock pointer, only
a reference
For now, CheckedLock and CheckedCondition remain as aliases to Lock and
Condition, in their respective CheckedLock.h / CheckedCondition.h headers.
I will drop them in a follow-up to reduce patch size.
I will also follow-up to try and get rid of as much usage of UncheckedLock
and UncheckedCondition as possible. I did not try very hard in this patch
to reduce patch size.
* TestWebKitAPI/Tests/WTF/CheckedConditionTest.cpp:
* TestWebKitAPI/Tests/WTF/Condition.cpp:
* TestWebKitAPI/Tests/WTF/MetaAllocator.cpp:
* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
(WTR::AXThread::createThreadIfNeeded):
Canonical link: https://commits.webkit.org/238070@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-24 05:37:41 +00:00
2021-05-23 Chris Dumez <cdumez@apple.com>
Make CheckedLock the default Lock
https://bugs.webkit.org/show_bug.cgi?id=226157
Reviewed by Darin Adler.
Make CheckedLock the default Lock so that we get more benefits from Clang
Thread Safety Analysis. Note that CheckedLock 100% relies on the existing
Lock implementation and merely adds the clang anotations for thread
safety.
That this patch does is:
1. Rename the Lock class to UncheckedLock
2. Rename the CheckedLock class to Lock
3. Rename the Condition class to UncheckedCondition
4. Rename the CheckedCondition class to Condition
5. Update the types of certain variables from Lock / Condition to
UncheckedLock / UncheckedCondition if I got a build failure. Build
failures are usually caused by the following facts:
- Locker<CheckedLock> doesn't subclass AbstractLocker which a lot of
JSC code passes as argument
- Locker<CheckedLock> has no move constructor
- Locker<CheckedLock> cannot be constructed from a lock pointer, only
a reference
For now, CheckedLock and CheckedCondition remain as aliases to Lock and
Condition, in their respective CheckedLock.h / CheckedCondition.h headers.
I will drop them in a follow-up to reduce patch size.
I will also follow-up to try and get rid of as much usage of UncheckedLock
and UncheckedCondition as possible. I did not try very hard in this patch
to reduce patch size.
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThreadCondition::wait):
(WTF::AutomaticThreadCondition::waitFor):
(WTF::AutomaticThread::AutomaticThread):
* wtf/AutomaticThread.h:
* wtf/CheckedCondition.h:
* wtf/CheckedLock.h:
* wtf/Condition.h:
* wtf/Lock.cpp:
(WTF::UncheckedLock::lockSlow):
(WTF::UncheckedLock::unlockSlow):
(WTF::UncheckedLock::unlockFairlySlow):
(WTF::UncheckedLock::safepointSlow):
* wtf/Lock.h:
(WTF::WTF_ASSERTS_ACQUIRED_LOCK):
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::release):
(WTF::MetaAllocator::MetaAllocator):
(WTF::MetaAllocator::allocate):
(WTF::MetaAllocator::currentStatistics):
* wtf/MetaAllocator.h:
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperPool::ParallelHelperPool):
* wtf/ParallelHelperPool.h:
* wtf/RecursiveLockAdapter.h:
* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
* wtf/WorkerPool.h:
2021-05-23 21:46:38 +00:00
2021-05-23 Mark Lam <mark.lam@apple.com>
Remove ENABLE(MASM_PROBE) flag.
https://bugs.webkit.org/show_bug.cgi?id=226154
Reviewed by Yusuke Suzuki.
The MacroAssembler::probe() mechanism is now available on all supported platforms.
There's no longer a need for the ENABLE(MASM_PROBE) flag.
* wtf/PlatformEnable.h:
2021-05-23 19:55:32 +00:00
2021-05-23 Chris Dumez <cdumez@apple.com>
Drop WTF::tryHoldLock() as it is incompatible with Clang Thread Safety Analysis
https://bugs.webkit.org/show_bug.cgi?id=226145
Reviewed by Darin Adler.
Drop WTF::tryHoldLock() as it is incompatible with Clang Thread Safety Analysis.
Instead, use the following pattern which is supported:
```
if (lock.tryLock()) {
Locker locker { AdoptLock, lock };
// ...
}
```
* wtf/CheckedLock.h:
* wtf/Lock.h:
* wtf/Locker.h:
(WTF::Locker::Locker):
2021-05-23 13:59:17 +00:00
2021-05-23 Mark Lam <mark.lam@apple.com>
Build fix for JSCOnly-Linux-AArch64 bot.
Not reviewed.
* wtf/Vector.h:
(WTF::Malloc>::expandCapacity):
(WTF::Malloc>::reserveCapacity):
(WTF::Malloc>::constructAndAppendSlowCase):
2021-05-22 21:40:04 +00:00
2021-05-22 Chris Dumez <cdumez@apple.com>
Adopt CheckedLock in more places
https://bugs.webkit.org/show_bug.cgi?id=226138
Reviewed by Darin Adler.
Adopt CheckedLock in more places to benefit from Clang Thread Safety Analysis.
* wtf/Assertions.cpp:
* wtf/TimingScope.cpp:
* wtf/threads/BinarySemaphore.cpp:
(WTF::BinarySemaphore::waitUntil):
* wtf/threads/BinarySemaphore.h:
2021-05-22 16:49:42 +00:00
2021-05-22 Chris Dumez <cdumez@apple.com>
Replace LockHolder with Locker in local variables
https://bugs.webkit.org/show_bug.cgi?id=226133
Reviewed by Darin Adler.
Replace LockHolder with Locker in local variables. It is shorter and it allows switching the lock
type more easily since the compiler with deduce the lock type T for Locker<T>.
* benchmarks/LockSpeedTest.cpp:
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThread::~AutomaticThread):
(WTF::AutomaticThread::join):
(WTF::AutomaticThread::start):
* wtf/AutomaticThread.h:
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::shrink):
(WTF::MetaAllocator::addFreshFreeSpace):
(WTF::MetaAllocator::debugFreeSpaceSize):
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperClient::ParallelHelperClient):
(WTF::ParallelHelperClient::~ParallelHelperClient):
(WTF::ParallelHelperClient::setTask):
(WTF::ParallelHelperClient::finish):
(WTF::ParallelHelperClient::doSomeHelping):
(WTF::ParallelHelperClient::runTask):
(WTF::ParallelHelperPool::~ParallelHelperPool):
(WTF::ParallelHelperPool::ensureThreads):
(WTF::ParallelHelperPool::doSomeHelping):
* wtf/Seconds.cpp:
(WTF::sleep):
* wtf/TimeWithDynamicClockType.cpp:
(WTF::sleep):
* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
(WTF::WorkerPool::~WorkerPool):
(WTF::WorkerPool::postTask):
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::suspend):
(WTF::Thread::resume):
(WTF::Thread::getRegisters):
* wtf/win/DbgHelperWin.cpp:
(WTF::DbgHelper::SymFromAddress):
* wtf/win/ThreadingWin.cpp:
(WTF::Thread::suspend):
(WTF::Thread::resume):
(WTF::Thread::getRegisters):
2021-05-22 11:17:01 +00:00
2021-05-22 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r277913.
https://bugs.webkit.org/show_bug.cgi?id=226140
Caused multiple layout-test crash on mac debug queues
Reverted changeset:
"Replace LockHolder with Locker in local variables"
https://bugs.webkit.org/show_bug.cgi?id=226133
https://trac.webkit.org/changeset/277913
2021-05-22 06:39:44 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
Remove WTF::holdLock() / WTF::holdLockIf()
https://bugs.webkit.org/show_bug.cgi?id=226135
Reviewed by Darin Adler.
Remove WTF::holdLock() / WTF::holdLockIf() because they are not compatible with
Clang Thread Safety Analysis. All call sites have been converted to use the Locker
constructor directly.
* wtf/Locker.h:
2021-05-22 05:49:16 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
Replace LockHolder with Locker in local variables
https://bugs.webkit.org/show_bug.cgi?id=226133
Reviewed by Darin Adler.
Replace LockHolder with Locker in local variables. It is shorter and it allows switching the lock
type more easily since the compiler with deduce the lock type T for Locker<T>.
* benchmarks/LockSpeedTest.cpp:
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThread::~AutomaticThread):
(WTF::AutomaticThread::join):
(WTF::AutomaticThread::start):
* wtf/AutomaticThread.h:
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::shrink):
(WTF::MetaAllocator::addFreshFreeSpace):
(WTF::MetaAllocator::debugFreeSpaceSize):
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperClient::ParallelHelperClient):
(WTF::ParallelHelperClient::~ParallelHelperClient):
(WTF::ParallelHelperClient::setTask):
(WTF::ParallelHelperClient::finish):
(WTF::ParallelHelperClient::doSomeHelping):
(WTF::ParallelHelperClient::runTask):
(WTF::ParallelHelperPool::~ParallelHelperPool):
(WTF::ParallelHelperPool::ensureThreads):
(WTF::ParallelHelperPool::doSomeHelping):
* wtf/Seconds.cpp:
(WTF::sleep):
* wtf/TimeWithDynamicClockType.cpp:
(WTF::sleep):
* wtf/WorkerPool.cpp:
(WTF::WorkerPool::WorkerPool):
(WTF::WorkerPool::~WorkerPool):
(WTF::WorkerPool::postTask):
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::suspend):
(WTF::Thread::resume):
(WTF::Thread::getRegisters):
* wtf/win/DbgHelperWin.cpp:
(WTF::DbgHelper::SymFromAddress):
* wtf/win/ThreadingWin.cpp:
(WTF::Thread::suspend):
(WTF::Thread::resume):
(WTF::Thread::getRegisters):
2021-05-22 01:53:38 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
Use CheckedCondition in more places
https://bugs.webkit.org/show_bug.cgi?id=226113
Reviewed by Darin Adler.
Use CheckedCondition in more places to benefit from Clang Thread Safety
Analysis.
* wtf/RunLoop.h:
* wtf/SynchronizedFixedQueue.h:
* wtf/WTFSemaphore.h:
* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply):
* wtf/generic/RunLoopGeneric.cpp:
(WTF::RunLoop::~RunLoop):
(WTF::RunLoop::populateTasks):
(WTF::RunLoop::runImpl):
(WTF::RunLoop::stop):
(WTF::RunLoop::wakeUpWithLock):
(WTF::RunLoop::wakeUp):
(WTF::RunLoop::schedule):
(WTF::RunLoop::scheduleAndWakeUpWithLock):
(WTF::RunLoop::TimerBase::~TimerBase):
(WTF::RunLoop::TimerBase::start):
(WTF::RunLoop::TimerBase::stop):
(WTF::RunLoop::TimerBase::isActive const):
(WTF::RunLoop::TimerBase::secondsUntilFire const):
* wtf/win/RunLoopWin.cpp:
(WTF::RunLoop::TimerBase::timerFired):
(WTF::RunLoop::TimerBase::start):
(WTF::RunLoop::TimerBase::stop):
(WTF::RunLoop::TimerBase::isActive const):
(WTF::RunLoop::TimerBase::secondsUntilFire const):
2021-05-22 01:33:40 +00:00
2021-05-21 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Adopt QLItem in WKImageExtractionPreviewController
https://bugs.webkit.org/show_bug.cgi?id=226114
rdar://76657718
Reviewed by Tim Horton.
Introduce `SOFT_LINK_FRAMEWORK_IN_UMBRELLA_FOR_SOURCE_WITH_EXPORT`, so that we can soft link frameworks that are
embedded inside other umbrella frameworks in PAL.
* wtf/cocoa/SoftLinking.h:
2021-05-22 00:11:37 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis
https://bugs.webkit.org/show_bug.cgi?id=226117
Reviewed by Darin Adler.
Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis
(WTF::CheckedLock) and use the Locker constructor instead.
This is a step towards getting rid of holdLock() completely.
* benchmarks/ConditionSpeedTest.cpp:
* wtf/ConcurrentPtrHashSet.cpp:
(WTF::ConcurrentPtrHashSet::deleteOldTables):
(WTF::ConcurrentPtrHashSet::clear):
(WTF::ConcurrentPtrHashSet::containsImplSlow const):
(WTF::ConcurrentPtrHashSet::sizeSlow const):
(WTF::ConcurrentPtrHashSet::resizeIfNecessary):
* wtf/CountingLock.h:
* wtf/HashTable.cpp:
(WTF::HashTableStats::recordCollisionAtCount):
(WTF::HashTableStats::dumpStats):
* wtf/HashTable.h:
(WTF::invalidateIterators):
(WTF::addIterator):
(WTF::removeIterator):
* wtf/LockedPrintStream.cpp:
(WTF::LockedPrintStream::vprintf):
(WTF::LockedPrintStream::flush):
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocatorHandle::~MetaAllocatorHandle):
* wtf/MetaAllocator.h:
(WTF::MetaAllocator::allocate):
(WTF::MetaAllocator::currentStatistics):
* wtf/ReadWriteLock.h:
* wtf/StackShotProfiler.h:
(WTF::StackShotProfiler::profile):
(WTF::StackShotProfiler::run):
* wtf/StackStats.cpp:
(WTF::StackStats::CheckPoint::CheckPoint):
(WTF::StackStats::CheckPoint::~CheckPoint):
(WTF::StackStats::probe):
(WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint):
(WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint):
* wtf/ThreadGroup.cpp:
(WTF::ThreadGroup::~ThreadGroup):
(WTF::ThreadGroup::add):
* wtf/ThreadMessage.cpp:
(WTF::sendMessageScoped):
* wtf/Threading.cpp:
(WTF::Thread::didExit):
(WTF::Thread::addToThreadGroup):
(WTF::Thread::removeFromThreadGroup):
(WTF::Thread::numberOfThreadGroups):
* wtf/TimingScope.cpp:
* wtf/WTFConfig.cpp:
(WTF::Config::permanentlyFreeze):
* wtf/WTFSemaphore.h:
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::changePriority):
(WTF::Thread::waitForCompletion):
(WTF::Thread::detach):
(WTF::Thread::signal):
(WTF::Thread::establishPlatformSpecificHandle):
* wtf/threads/BinarySemaphore.cpp:
(WTF::BinarySemaphore::signal):
(WTF::BinarySemaphore::waitUntil):
* wtf/threads/Signals.cpp:
(WTF::SignalHandlers::add):
(WTF::registerThreadForMachExceptionHandling):
(WTF::activateSignalHandlersFor):
* wtf/win/LanguageWin.cpp:
(WTF::platformLanguage):
* wtf/win/ThreadingWin.cpp:
(WTF::Thread::changePriority):
(WTF::Thread::waitForCompletion):
(WTF::Thread::detach):
(WTF::Thread::establishPlatformSpecificHandle):
2021-05-21 20:20:07 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
[Cocoa] Unable to upload files that are stored in the cloud (without a local copy)
https://bugs.webkit.org/show_bug.cgi?id=226090
<rdar://77775887>
Reviewed by Darin Adler.
Add FileSystem API to allow/disallow the materializing of dataless files stored
in the cloud, at process or thread level.
* wtf/FileSystem.h:
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::toIOPolicyScope):
(WTF::FileSystemImpl::setAllowsMaterializingDatalessFiles):
(WTF::FileSystemImpl::allowsMaterializingDatalessFiles):
2021-05-21 20:19:46 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
Replace more static Locks with CheckedLocks in WTF / WebCore
https://bugs.webkit.org/show_bug.cgi?id=226040
Reviewed by Darin Adler.
Replace more static Locks with CheckedLocks so that we can benefit from Clang Thread Safety Analysis.
* wtf/Threading.cpp:
(WTF::Thread::allThreadsLock):
(WTF::Thread::create):
(WTF::Thread::didExit):
* wtf/Threading.h:
* wtf/URL.cpp:
(WTF::WTF_REQUIRES_LOCK):
(WTF::registerDefaultPortForProtocolForTesting):
(WTF::clearDefaultPortForProtocolMapForTesting):
(WTF::defaultPortForProtocol):
* wtf/cf/LanguageCF.cpp:
(WTF::WTF_REQUIRES_LOCK):
(WTF::platformLanguageDidChange):
(WTF::platformUserPreferredLanguages):
* wtf/text/StringView.cpp:
(WTF::StringView::invalidate):
(WTF::StringView::adoptUnderlyingString):
(WTF::StringView::setUnderlyingString):
* wtf/unicode/icu/CollatorICU.cpp:
(WTF::Collator::Collator):
(WTF::Collator::~Collator):
2021-05-21 19:24:05 +00:00
2021-05-21 Chris Dumez <cdumez@apple.com>
Use CheckedLock more in cases where we try-lock
https://bugs.webkit.org/show_bug.cgi?id=226056
Reviewed by Alex Christensen.
Use CheckedLock more in cases where we try-lock to benefit from Clang
Thread Safety Analysis.
* wtf/Logger.cpp:
* wtf/Logger.h:
(WTF::Logger::addObserver):
(WTF::Logger::removeObserver):
(WTF::Logger::log):
(WTF::Logger::logVerbose):
(WTF::Logger::WTF_RETURNS_LOCK):
2021-05-21 02:43:18 +00:00
2021-05-20 Chris Dumez <cdumez@apple.com>
Use CheckedLock more in WTF
https://bugs.webkit.org/show_bug.cgi?id=226045
Reviewed by Darin Adler.
Use CheckedLock more in WTF to benefit from Clang Thread Safety Analysis.
* wtf/CrossThreadQueue.h:
(WTF::CrossThreadQueue<DataType>::append):
(WTF::CrossThreadQueue<DataType>::waitForMessage):
(WTF::CrossThreadQueue<DataType>::tryGetMessage):
(WTF::CrossThreadQueue<DataType>::kill):
(WTF::CrossThreadQueue<DataType>::isKilled const):
(WTF::CrossThreadQueue<DataType>::isEmpty const):
* wtf/CrossThreadTaskHandler.cpp:
(WTF::CrossThreadTaskHandler::postTaskReply):
(WTF::CrossThreadTaskHandler::handleTaskRepliesOnMainThread):
* wtf/CrossThreadTaskHandler.h:
(WTF::CrossThreadTaskHandler::WTF_GUARDED_BY_LOCK):
* wtf/CryptographicallyRandomNumber.cpp:
* wtf/FastMalloc.cpp:
(WTF::MallocCallTracker::recordMalloc):
(WTF::MallocCallTracker::recordRealloc):
(WTF::MallocCallTracker::recordFree):
(WTF::MallocCallTracker::dumpStats):
* wtf/MessageQueue.h:
(WTF::MessageQueue<DataType>::append):
(WTF::MessageQueue<DataType>::appendAndKill):
(WTF::MessageQueue<DataType>::appendAndCheckEmpty):
(WTF::MessageQueue<DataType>::prepend):
(WTF::MessageQueue<DataType>::waitForMessageFilteredWithTimeout):
(WTF::MessageQueue<DataType>::tryGetMessage):
(WTF::MessageQueue<DataType>::takeAllMessages):
(WTF::MessageQueue<DataType>::tryGetMessageIgnoringKilled):
(WTF::MessageQueue<DataType>::removeIf):
(WTF::MessageQueue<DataType>::isEmpty):
(WTF::MessageQueue<DataType>::kill):
(WTF::MessageQueue<DataType>::killed const):
* wtf/OSLogPrintStream.cpp:
(WTF::OSLogPrintStream::vprintf):
* wtf/OSLogPrintStream.h:
* wtf/ParallelJobsGeneric.h:
(WTF::ParallelEnvironment::ThreadPrivate::WTF_GUARDED_BY_LOCK):
* wtf/ParallelVectorIterator.h:
(WTF::ParallelVectorIterator::iterate):
(WTF::ParallelVectorIterator::WTF_GUARDED_BY_LOCK):
* wtf/ReadWriteLock.cpp:
(WTF::ReadWriteLock::readLock):
(WTF::ReadWriteLock::readUnlock):
(WTF::ReadWriteLock::writeLock):
(WTF::ReadWriteLock::writeUnlock):
* wtf/ReadWriteLock.h:
(WTF::ReadWriteLock::WTF_GUARDED_BY_LOCK):
2021-05-21 01:28:17 +00:00
2021-05-20 Chris Dumez <cdumez@apple.com>
Add missing locks in Language.cpp
https://bugs.webkit.org/show_bug.cgi?id=226059
Reviewed by Alex Christensen.
Add missing locks in Language.cpp. This was found via Clang Thread Safety Analysis.
Some of the overrideUserPreferredLanguages() call sites were failing to grab the
lock first.
Also use NeverDestroyed in preferredLanguagesOverride() instead of LazyNeverDestroyed
with std::call_once. All call sites are already grabbing a lock so there is no need
for extra synchronization.
* wtf/Language.cpp:
(WTF::WTF_REQUIRES_LOCK):
(WTF::userPreferredLanguagesOverride):
(WTF::overrideUserPreferredLanguages):
(WTF::userPreferredLanguages):
(WTF::preferredLanguagesOverride): Deleted.
Add support for Navigation Timing Level 2
https://bugs.webkit.org/show_bug.cgi?id=184363
Reviewed by Ryosuke Niwa.
LayoutTests/imported/w3c:
* web-platform-tests/navigation-timing/META.yml: Added.
* web-platform-tests/navigation-timing/dom_interactive_image_document-expected.txt: Added.
* web-platform-tests/navigation-timing/dom_interactive_image_document.html: Added.
* web-platform-tests/navigation-timing/dom_interactive_media_document-expected.txt: Added.
* web-platform-tests/navigation-timing/dom_interactive_media_document.html: Added.
* web-platform-tests/navigation-timing/idlharness.window.js:
* web-platform-tests/navigation-timing/nav2_test_attributes_exist-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_attributes_exist.html: Added.
This test fails because we have not implemented transferSize, encodedBodySize, and decodedBodySize as noted in PerformanceResourceTiming.idl
* web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_attributes_values.html: Added.
This test fails because we have not implemented transferSize, encodedBodySize, and decodedBodySize as noted in PerformanceResourceTiming.idl
* web-platform-tests/navigation-timing/nav2_test_document_open-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_document_open.html:
* web-platform-tests/navigation-timing/nav2_test_document_replaced-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_document_replaced.html:
* web-platform-tests/navigation-timing/nav2_test_frame_removed-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_instance_accessible_from_the_start.html:
* web-platform-tests/navigation-timing/nav2_test_instance_accessors-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_instance_accessors.html: Added.
* web-platform-tests/navigation-timing/nav2_test_navigate_iframe-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_navigate_iframe.html: Added.
* web-platform-tests/navigation-timing/nav2_test_navigate_within_document-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_navigate_within_document.html:
* web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_navigation_type_backforward.html:
* web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate.html: Added.
* web-platform-tests/navigation-timing/nav2_test_navigation_type_reload-expected.txt:
* web-platform-tests/navigation-timing/nav2_test_navigation_type_reload.html:
* web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin-expected.txt: Added.
This test fails because our test infrastructure doesn't support loading from www.localhost.
* web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin.html: Copied from LayoutTests/imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html.
* web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in-expected.txt:
This test fails because our test infrastructure doesn't support loading from www.localhost.
* web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_partial_opt_in.html:
* web-platform-tests/navigation-timing/nav2_test_redirect_none-expected.txt: Added.
* web-platform-tests/navigation-timing/nav2_test_redirect_none.html: Added.
* web-platform-tests/navigation-timing/nav2_test_redirect_server-expected.txt:
This test failure needs further investigation.
* web-platform-tests/navigation-timing/nav2_test_redirect_server.html:
* web-platform-tests/navigation-timing/nav2_test_redirect_xserver-expected.txt:
This test fails because our test infrastructure doesn't support loading from www.localhost.
* web-platform-tests/navigation-timing/nav2_test_redirect_xserver.html:
* web-platform-tests/navigation-timing/nav2_test_unique_nav_instances-expected.txt: Added.
This test failure needs further investigation.
* web-platform-tests/navigation-timing/nav2_test_unique_nav_instances.html: Added.
* web-platform-tests/navigation-timing/po-navigation-expected.txt: Added.
* web-platform-tests/navigation-timing/po-navigation.html: Added.
* web-platform-tests/navigation-timing/resources/webperftestharness.js:
(test_namespace):
(test_attribute_exists):
(test_enum):
* web-platform-tests/navigation-timing/secure-connection-start-reuse.https-expected.txt: Added.
* web-platform-tests/navigation-timing/secure-connection-start-reuse.https.html: Added.
* web-platform-tests/navigation-timing/secure_connection_start_non_zero.https-expected.txt:
This test has been marked as flaky. It needs to be fixed to not rely on no initial connection reuse.
* web-platform-tests/navigation-timing/supported_navigation_type.any-expected.txt:
* web-platform-tests/navigation-timing/supported_navigation_type.any.worker-expected.txt:
* web-platform-tests/navigation-timing/test_document_onload-expected.txt: Added.
* web-platform-tests/navigation-timing/test_document_onload.html: Added.
This test failure needs further investigation.
* web-platform-tests/navigation-timing/unload-event-same-origin-check-expected.txt:
* web-platform-tests/navigation-timing/unload-event-same-origin-check.html:
* web-platform-tests/performance-timeline/META.yml: Added.
* web-platform-tests/performance-timeline/buffered-flag-after-timeout.any.js: Added.
(async_test.t.t.step_timeout):
* web-platform-tests/performance-timeline/buffered-flag-observer.any.js: Added.
* web-platform-tests/performance-timeline/get-invalid-entries-expected.txt: Added.
* web-platform-tests/performance-timeline/get-invalid-entries.html: Added.
* web-platform-tests/performance-timeline/idlharness.any.js: Added.
(async idl_array):
* web-platform-tests/performance-timeline/multiple-buffered-flag-observers.any.js: Added.
(promise_test):
* web-platform-tests/performance-timeline/not-clonable-expected.txt: Added.
* web-platform-tests/performance-timeline/not-clonable.html: Added.
* web-platform-tests/performance-timeline/observer-buffered-false.any.js: Added.
(async_test.t.t.step_timeout):
* web-platform-tests/performance-timeline/performanceentry-tojson.any.js: Added.
(test):
* web-platform-tests/performance-timeline/po-callback-mutate.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/po-disconnect-removes-observed-types.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/po-disconnect.any.js: Added.
(async_test):
(test):
* web-platform-tests/performance-timeline/po-entries-sort.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/po-getentries.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/po-mark-measure.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/po-observe-expected.txt: Added.
* web-platform-tests/performance-timeline/po-observe-repeated-type.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/po-observe.html: Added.
* web-platform-tests/performance-timeline/po-resource-expected.txt: Added.
* web-platform-tests/performance-timeline/po-resource.html: Added.
* web-platform-tests/performance-timeline/po-takeRecords.any.js: Added.
(async_test):
* web-platform-tests/performance-timeline/resources/postmessage-entry.html: Added.
* web-platform-tests/performance-timeline/resources/worker-invalid-entries.js: Added.
* web-platform-tests/performance-timeline/resources/worker-with-performance-observer.js: Added.
(catch):
* web-platform-tests/performance-timeline/supportedEntryTypes.any-expected.txt:
This test failure needs further investigation. It's a bindings generation problem I've unsuccessfully looked into before.
* web-platform-tests/performance-timeline/supportedEntryTypes.any.js:
(test):
* web-platform-tests/performance-timeline/supportedEntryTypes.any.worker-expected.txt:
* web-platform-tests/performance-timeline/webtiming-resolution.any.js: Added.
(testTimeResolution):
(timeByUserTiming):
* web-platform-tests/performance-timeline/worker-with-performance-observer-expected.txt: Added.
* web-platform-tests/performance-timeline/worker-with-performance-observer.html: Added.
* web-platform-tests/service-workers/service-worker/navigation-timing.https-expected.txt:
This existing test failure needs more investigation. We are probably close to a fix after this patch.
Source/WebCore:
This is basically just a new shape for exposing the same data as window.performance.navigation, but with a shape that fits better into the rest of the
performance timeline measurements that have been added to the web platform since performance.navigation.
I noted that exposing transfer size is problematic, and some of the tests for reading transfer size still fail.
There are still a few relatively minor test failures to fix in future patches. Each one is annotated in the LayoutTests ChangeLogs.
Tests: imported/w3c/web-platform-tests/navigation-timing/dom_interactive_image_document.html
imported/w3c/web-platform-tests/navigation-timing/dom_interactive_media_document.html
imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_exist.html
imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values.html
imported/w3c/web-platform-tests/navigation-timing/nav2_test_instance_accessors.html
imported/w3c/web-platform-tests/navigation-timing/nav2_test_navigate_iframe.html
imported/w3c/web-platform-tests/navigation-timing/nav2_test_navigation_type_navigate.html
imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_chain_xserver_final_original_origin.html
imported/w3c/web-platform-tests/navigation-timing/nav2_test_redirect_none.html
imported/w3c/web-platform-tests/navigation-timing/nav2_test_unique_nav_instances.html
imported/w3c/web-platform-tests/navigation-timing/po-navigation.html
imported/w3c/web-platform-tests/navigation-timing/secure-connection-start-reuse.https.html
imported/w3c/web-platform-tests/navigation-timing/test_document_onload.html
imported/w3c/web-platform-tests/performance-timeline/get-invalid-entries.html
imported/w3c/web-platform-tests/performance-timeline/not-clonable.html
imported/w3c/web-platform-tests/performance-timeline/po-observe.html
imported/w3c/web-platform-tests/performance-timeline/po-resource.html
imported/w3c/web-platform-tests/performance-timeline/worker-with-performance-observer.html
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSPerformanceEntryCustom.cpp:
(WebCore::toJSNewlyCreated):
* dom/Document.cpp:
(WebCore::Document::setReadyState):
Sometimes the ready state jumps right to Complete without hitting Interactive along the way.
When this happens, we want to mark both m_documentTiming.domComplete and m_documentTiming.domInteractive.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::notifyFinished):
Call addNavigationTiming in notifyFinished to create the navigation timing object when we are done navigating
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didFinishLoading):
* loader/ResourceLoader.h:
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::fromLoad):
Add a URL parameter. Sometimes we need to use the request's URL and sometimes the response's. Different specs written at different times.
(WebCore::ResourceTiming::populateServerTiming const):
(WebCore::ResourceTiming::populateServerTiming): Deleted.
* loader/ResourceTiming.h:
(WebCore::ResourceTiming::url const):
(WebCore::ResourceTiming::initiator const):
(WebCore::ResourceTiming::loadTiming const):
(WebCore::ResourceTiming::networkLoadMetrics const):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::reportResourceTiming):
* page/Performance.cpp:
(WebCore::Performance::getEntries const):
(WebCore::Performance::getEntriesByType const):
(WebCore::Performance::getEntriesByName const):
(WebCore::Performance::appendBufferedEntriesByType const):
(WebCore::Performance::addNavigationTiming):
(WebCore::Performance::registerPerformanceObserver):
(WebCore::Performance::queueEntry):
(WebCore::Performance::scheduleTaskIfNeeded):
* page/Performance.h:
* page/PerformanceEntry.h:
(WebCore::PerformanceEntry::startTime const):
(WebCore::PerformanceEntry::duration const):
(WebCore::PerformanceEntry::isResource const): Deleted.
(WebCore::PerformanceEntry::isMark const): Deleted.
(WebCore::PerformanceEntry::isMeasure const): Deleted.
(WebCore::PerformanceEntry::isPaint const): Deleted.
* page/PerformanceMark.h:
(isType): Deleted.
SPECIALIZE_TYPE_TRAITS_BEGIN/END doesn't work well with PerformanceNavigationTiming which inherits from PerformanceResourceTiming which both have distinct types.
is<PerformanceResourceTiming> doesn't give us the info we need. I replaced that with "switch (entry->performanceEntryType())" in the one place it's used, and it works like a charm.
Also renamed type to performanceEntryType so it doesn't conflict with PerformanceNavigationTiming::type, which is specified in the idl.
* page/PerformanceMeasure.h:
(isType): Deleted.
* page/PerformanceNavigationTiming.cpp: Added.
(WebCore::toPerformanceNavigationTimingNavigationType):
(WebCore::PerformanceNavigationTiming::PerformanceNavigationTiming):
(WebCore::PerformanceNavigationTiming::millisecondsSinceOrigin const):
(WebCore::PerformanceNavigationTiming::sameOriginCheckFails const):
(WebCore::PerformanceNavigationTiming::unloadEventStart const):
(WebCore::PerformanceNavigationTiming::unloadEventEnd const):
(WebCore::PerformanceNavigationTiming::domInteractive const):
(WebCore::PerformanceNavigationTiming::domContentLoadedEventStart const):
(WebCore::PerformanceNavigationTiming::domContentLoadedEventEnd const):
(WebCore::PerformanceNavigationTiming::domComplete const):
(WebCore::PerformanceNavigationTiming::loadEventStart const):
(WebCore::PerformanceNavigationTiming::loadEventEnd const):
(WebCore::PerformanceNavigationTiming::type const):
(WebCore::PerformanceNavigationTiming::redirectCount const):
(WebCore::PerformanceNavigationTiming::startTime const):
(WebCore::PerformanceNavigationTiming::duration const):
* page/PerformanceNavigationTiming.h: Added.
* page/PerformanceNavigationTiming.idl: Copied from Source/WebCore/page/PerformanceObserver.idl.
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::takeRecords):
(WebCore::PerformanceObserver::disconnect):
(WebCore::PerformanceObserver::deliver):
(WebCore::PerformanceObserver::supportedEntryTypes):
* page/PerformanceObserver.h:
* page/PerformanceObserver.idl:
* page/PerformanceObserverEntryList.cpp:
(WebCore::PerformanceObserverEntryList::getEntriesByName const):
* page/PerformancePaintTiming.h:
(isType): Deleted.
* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
(WebCore::PerformanceResourceTiming::nextHopProtocol const):
(WebCore::PerformanceResourceTiming::redirectStart const):
(WebCore::PerformanceResourceTiming::redirectEnd const):
(WebCore::PerformanceResourceTiming::fetchStart const):
(WebCore::PerformanceResourceTiming::domainLookupStart const):
(WebCore::PerformanceResourceTiming::domainLookupEnd const):
(WebCore::PerformanceResourceTiming::connectStart const):
(WebCore::PerformanceResourceTiming::connectEnd const):
(WebCore::PerformanceResourceTiming::secureConnectionStart const):
(WebCore::PerformanceResourceTiming::requestStart const):
(WebCore::PerformanceResourceTiming::responseStart const):
(WebCore::PerformanceResourceTiming::responseEnd const):
(WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp const):
* page/PerformanceResourceTiming.h:
(WebCore::PerformanceResourceTiming::initiatorType const):
(isType): Deleted.
* page/PerformanceResourceTiming.idl:
* platform/network/BlobResourceHandle.cpp:
(WebCore::doNotifyFinish):
* platform/network/NetworkLoadMetrics.h:
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::didFinishLoading):
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::didFinishLoading):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
Pass metrics including the response end time from NSURLConnection so we don't assert in WebKitLegacy.
* platform/network/cocoa/NetworkLoadMetrics.mm:
(WebCore::copyTimingData):
Use currentRequest instead of passing in the response so we can call it from didFinishLoading, where we don't have a response stored anywhere.
We're just looking for whether it's http or https, so the currentRequest (which is the request after all the redirects) fits our purpose.
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::handleDataURL):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
Source/WebKit:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
Mark reused TLS connections in complete metrics like I did in incomplete metrics in r277493.
Source/WebKitLegacy:
* WebCoreSupport/PingHandle.h:
Source/WTF:
* Scripts/Preferences/WebPreferencesExperimental.yaml:
LayoutTests:
* TestExpectations:
Annoyingly secure_connection_start_non_zero.https.html becomes flaky with a correct implementation because it assumes
that no connection is reused. However, when running this test after other tests, another connection is often reused.
* performance-api/paint-timing/performance-observer-first-contentful-paint-expected.txt:
* performance-api/paint-timing/performance-observer-first-contentful-paint.html:
* performance-api/performance-observer-api-expected.txt:
* performance-api/performance-timeline-api-expected.txt:
* performance-api/resources/timeline-api.js:
* platform/mac-wk1/imported/w3c/web-platform-tests/navigation-timing/nav2_test_attributes_values-expected.txt:
Next hop protocol isn't implemented in ResourceHandle. That's probably no big deal because WebKitLegacy is deprecated and not used by Safari.
Canonical link: https://commits.webkit.org/237930@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-20 00:33:02 +00:00
2021-05-19 Alex Christensen <achristensen@webkit.org>
Add support for Navigation Timing Level 2
https://bugs.webkit.org/show_bug.cgi?id=184363
Reviewed by Ryosuke Niwa.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-05-19 21:00:39 +00:00
2021-05-19 Chris Dumez <cdumez@apple.com>
Drop "get" prefix from SQLiteStatement member functions as well as out-parameters
https://bugs.webkit.org/show_bug.cgi?id=225971
Reviewed by Darin Adler.
Add Vector constructor that takes in an array and a size.
* wtf/Vector.h:
(WTF::Vector::Vector):
Move CFStringRef and NSString support from StringBuilder into StringConcatenateCF
https://bugs.webkit.org/show_bug.cgi?id=225839
Reviewed by Sam Weinig.
Source/JavaScriptCore:
* inspector/ConsoleMessage.cpp:
(Inspector::ConsoleMessage::ConsoleMessage): Use StringBuilder::clear instead of
StringBuilder::resize; no advantage to the latter after calling StringBuilder::toString.
* runtime/JSONObject.cpp:
(JSC::Stringifier::Holder::appendNextProperty): Update for name change of
StringBuilder::resize to StringBuilder::shrink.
* runtime/TypeSet.cpp:
(JSC::StructureShape::stringRepresentation): Ditto.
Source/WebCore:
* Modules/airplay/WebMediaSessionManager.cpp:
(WebCore::mediaProducerStateString): Use StringBuilder exclusively instead of
mixing it with makeString. Also updated for StringBuilder::shrink name.
* html/HTMLTextFormControlElement.cpp:
(WebCore::stripTrailingNewline): Updated for StringBuilder::shrink name.
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsTextColor const): Tweaked
coding style a bit.
(WebCore::appendCSS): Use variadic StringBuilder::append instead of many
separate calls.
(WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS const):
Tweaked coding style a bit, and use variadic StrinBuilder::append calls
to reduce the number of calls and streamline the code.
(WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const):
Ditto. Also removed unnecessary checks that strings are empty before appending.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
Updated for StringBuilder::shrink name.
* platform/LayoutUnit.h: Updated for saturatedSum/Difference names.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::cookiesForSession const): Tweaked codin
style a bit, and use variadic StrinBuilder::append calls to reduce the
number of calls and streamline the code.
* rendering/RenderCounter.cpp:
(WebCore::planCounter): Updated for saturatedSum name.
* style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyValueCounter): Ditto.
* svg/SVGPathStringBuilder.cpp:
(WebCore::SVGPathStringBuilder::result): Updated for StringBuilder::shrink name.
* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Ditto.
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::saveResultToString): Ditto.
Source/WebKit:
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::platformSetNetworkParameters): Use makeString instead
of StringBuilder.
Source/WTF:
The new header makes CFStringRef and NSString work with string concatenation,
which means it now works with the variadic StringBuilder::append and makeString,
and still works with the single-argument StringBuilder::append. More efficient
that the old version because it does not allocate a temporary WTF::String for
the 16-bit character path.
Also made many other small improvements to the StringBuilder implementation.
* WTF.xcodeproj/project.pbxproj: Added StringConcatenateCF.h.
* wtf/CheckedArithmetic.h: Removed ConditionalCrashOnOverflow, which was only
here for use by StringBuilder, which does not use CheckedArithmetic any more.
* wtf/PlatformFTW.cmake: Added StringConcatenateCF.h..
* wtf/PlatformMac.cmake: Ditto.
* wtf/PlatformWin.cmake: Ditto.
* wtf/SaturatedArithmetic.h: Moved the contents of this file inside the
WTF namespace.
(WTF::signedAddInt32Overflows): Renamed this function. The type here is
important, and we are not doing anything to prevent type conversion or
create ambiguity, so it's good to be explicit in the function name.
(WTF::saturatedSum<int32_t>): Renamed this from saturatedAddition for
clarity. The function returns a sum, so that's a better name than calling
it "addition". Also, it's clearer to be explicit about the return type.
(WTF::signedSubtractInt32Overflows): Renamed. Same reason as above.
(WTF::saturatedDifference<int32_t>): Ditto.
(WTF::saturatedSum): Added. Does unsigned integer saturated addition.
This one can be written in a portable manner and still get really
efficient code on at least Intel and ARM64.
(WTF::saturatedSum): Added a function template that lets callers pass
larger number of arguments to saturatedSum, rather than exactly two.
* wtf/text/StringBuilder.cpp:
(WTF::expandedCapacity): Renamed to use the term capacity rather than
length for the new required capacity.
(WTF::StringBuilder::didOverflow): Implement the new approach to
overflow, meaning we need to write the CRASH() here explicitly and
in the non-crashing mode, set m_length.
(WTF::StringBuilder::reifyString const): Changed the overflow check
into a RELEASE_ASSERT. This is now responsible for doing the check that
callers were doing earlier, so we want it in production builds. Also
simplified this since our m_length member is a simple integer now,
and removed the unused m_isReified.
(WTF::StringBuilder::shrink): Renamed this to shrink to match the
Vector::shrink function, since this has never supported making the
builder larger. Removed unnecessary overflow checks, since shrinking
cannot cause overflow.
(WTF::StringBuilder::allocateBuffer): Replaced two separate functions
with a single simpler function template. Removed extra overflow checks
because the StringImpl::tryCreateUninitialized function already does
the only overflow check we need. Also move to StringImpl::copyCharacters
for copying characters rather than using std::memcpy directly.
Removed code to set m_is8Bit and m_bufferCharacters.
(WTF::StringBuilder::reallocateBuffer): Replaced two separate
functions with a function template and a cover that calls the
appropriate instance of the template for places where we aren't
already in character-type-specific code paths. This version now
supports allocating a buffer for the first time in cases where
we have m_string and not m_buffer, which used to be handled at
the higher level. Removed code to set m_bufferCharacters.
(WTF::StringBuilder::reserveCapacity): Rewrote for simplicity.
By relying on the overflow checking inside reallocateBuffer and
allocateBuffer we no longer need checking of the passed-in value
at this level.
(WTF::StringBuilder::extendBufferForAppending): Removed the
version of this that takes additionalLength since it's
potentially confusing to have a family of functions that have the
same name and take the same type of argument, but interpret it
subtly differently. Streamlined the code using std::exchange.
This function now also includes the logic from the function named
extendBufferForAppendingWithoutOverflowCheck, which was subtly
misnamed since that was not the only semantic difference. Also
removed the ALWAYS_INLINE because the compiler will do the right
thing without such heavy handed advice.
(WTF::StringBuilder::extendBufferForAppendingSlowCase): Streamlined
this by using std::exchange and removed additional overflow checks
at this level since reallocateBuffer already does them. Also added
a check for the case where the new total length is 0, which would
not be handled correctly and efficiently by reallocateBuffer.
(WTF::StringBuilder::extendBufferForAppendingLChar): Renamed this
from extendBufferForAppending8, since it's now identical to calling
extendBufferForAppending<LChar>, except for inlining and linkage.
(WTF::StringBuilder::extendBufferForAppendingWithUpconvert):
Renamed this from extendBufferForAppending16. It is different from
the other extendBuffer functions because is supports upconverting
from LChar to UChar. Like the others it relies on allocateBuffer
for the overflow checking.
(WTF::StringBuilder::appendCharacters): Removed an unnecessary
assertion that the characters pointer is non-null; that will fail
in an obvious way without an assertion. Simplified the logic and
removed some invariant assertions that don't help us much. Changed
overflow checking by using saturatedSum to compute the new length.
In overflow cases, the new sum will be larger than the maximum
string length, but will fit in an unsigned, so we can pass it
down to lower levels and let functions like reallocateBuffer do
the actual overflow checking. Also use StringImpl::copyCharacters.
(WTF::StringBuilder::append): Removed the CFStringRef overload.
(WTF::StringBuilder::shouldShrinkToFit const): Rename this from
canShrink. Simplify the function a bit and remove the vague FIXME
that says "this should be tuned". That may be so, but the FIXME
is not really driving us to action.
(WTF::StringBuilder::shrinkToFit): Simplify by using the new
reallocateBuffer and std::exchange. Removed unneeded assertion
about overflow that doesn't help us maintain the invariant.
(WTF::StringBuilder::isAllASCII const): Was tempted to remove
this function, but for now just made it use the StringView
version for brevity.
* wtf/text/StringBuilder.h: Removed many unneeded includes, and
notably included SaturatedArithmetic.h instead of
CheckedArithmetic.h because we now use the former instead of the
latter. Changed the overflow checking implementation to work
more simply based on saturated addition rather than Checked.
This allowed us to get rid of dependency on our own unique mode
for Checked, called ConditionalCrashOnOverflow. Removed a
comment about making a templatized version of StringBuilder.
We can do it if we like, but does not seem urgent. Moved
fucntion bodies out of the class definition so it's easier to
see what's going on in the class. Since m_length is now an
ordinary integer, the check for overflowed simply checks to see
if the length is larger than the maximum string length. When we
encounter overflow that is not about length computation, we set
the length to the maximum integer to indicate the failure.
Deleted the append overloads for CFStringRef and NSString.
Removed m_bufferCharacters, m_is8Bit, and m_isReified.
(WTF::StringBuilder::StringBuilder): Simplified the constructor
since we only have to initialize the m_shouldCrashOnOverflow member.
(WTF::StringBuilder::clear): Fixed a mistake where this was not
resetting the m_isReified flag.
(WTF::StringBuilder::swap): Updated for changes in the data members.
(WTF::StringBuilder::operator StringView const): Moved out of line.
Made sure to call the length() function so we crash if this is
called after overflow.
(WTF::StringBuilder::append): Remove some of the unnecessary checks
and special cases in the various versions of append. Most of the
checking is done inside appendCharacters, with only a few exceptions.
(WTF::StringBuilder::appendSubstring): Moved out of the class
definition without making significant changes.
(WTF::StringBuilder::appendCharacter): Ditto.
(WTF::StringBuilder::toString): Greatly simplified this function
by relying on overflow checking in the reifyString function instead
of doing it here and removing unneeded invariant assertions.
(WTF::StringBuilder::toStringPreserveCapacity const): Ditto.
(WTF::StringBuilder::toAtomString const): Rewrote this to streamline,
removing explicit overflow checks.
(WTF::StringBuilder::length const): Moved out of the class
definition without making significant changes.
(WTF::StringBuilder::capacity const): Ditto.
(WTF::StringBuilder::operator[] const): Ditto.
(WTF::StringBuilder::characters const): Implemented this operation
in the function template. Now rather than having this call the
characters8 and characters16 functions, they can call it.
(WTF::StringBuilder::getBufferCharacters<LChar>): Deleted.
(WTF::StringBuilder::getBufferCharacters<UChar>): Deleted.
(WTF::StringBuilder::appendFromAdapters): Use saturatedSum to
compute the required length, which allows the extendBuffer
functions to do overflow checking without having to take special
checked integer types for arguments.
(WTF::StringBuilder::equal): Implement using StringView.
* wtf/text/StringBuilderJSON.cpp:
(WTF::StringBuilder::appendQuotedJSONString): Simplified the checked
arithmetic for computing the required capacity. Updated since we
removed m_bufferCharacters and changed the type of m_length.
* wtf/text/cf/StringConcatenateCF.h: Added. Specializes StringTypeAdapter for
both CFStringRef and NSString *. If CFStringGetCStringPtr works for Latin-1, then
does the 8-bit code path, otherwise the 16-bit.
* wtf/text/cocoa/TextStreamCocoa.mm: Include StringConcatenateCF.h, since it's
now needed to use CFStringRef with StringBuilder.
Tools:
* TestWebKitAPI/Tests/WTF/SaturatedArithmeticOperations.cpp: Updated
tests for changes to SaturatedArithmetic.h.
* TestWebKitAPI/Tests/WTF/StringBuilder.cpp: Updated tests for changes
to StringBuilder.
* TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
(TestWebKitAPI::wkMediaCaptureStateString): Ditto.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
Added include of StringConcatenateCF.h.
Added StringTypeAdapter for WKStringRef.
(WTR::styleDecToStr): Use ASCIILiteral instead of StringBuilder.
(WTR::string): Removed unneeded toWTFString since the WKStringRef
StringTypeAdapter takes care of it.
(WTR::string): Renamed from frameToStr. Use makeString.
(WTR::dumpResourceURL): Use append instead of appendLiteral.
(WTR::dumpFrameDescriptionSuitableForTestResult): Deleted.
(WTR::dumpLoadEvent): Use makeString.
(WTR::string): Renamed from a longer name. Return a String
instead of building in a StringBuilder. Use makeString.
(WTR::string): Ditto.
(WTR::dumpErrorDescriptionSuitableForTestResult): Removed
unneeded toWTFString.
(WTR::dumpFrameScrollPosition): Ditto.
(WTR::dumpDescendantFramesText): Ditto.
(WTR::InjectedBundlePage::dumpDOMAsWebArchive): Removed an
unneeded local variable.
(WTR::InjectedBundlePage::dump): Removed unneeded toWTFString.
(WTR::InjectedBundlePage::didReceiveTitleForFrame): Ditto.
(WTR::InjectedBundlePage::didFinishDocumentLoadForFrame):
Updated for functon name change.
(WTR::InjectedBundlePage::willSendRequestForFrame): Ditto.
Also use variadic append. Also use makeString.
(WTR::InjectedBundlePage::didReceiveResponseForResource): Ditto.
(WTR::InjectedBundlePage::didFinishLoadForResource): Ditto.
(WTR::InjectedBundlePage::didFailLoadForResource): Ditto.
(WTR::InjectedBundlePage::decidePolicyForNavigationAction): Ditto.
(WTR::InjectedBundlePage::decidePolicyForResponse): Ditto.
(WTR::InjectedBundlePage::willAddMessageToConsole): Ditto.
(WTR::InjectedBundlePage::willSetStatusbarText): Ditto.
(WTR::InjectedBundlePage::willRunJavaScriptPrompt): Ditto.
(WTR::InjectedBundlePage::didExceedDatabaseQuota): Ditto.
(WTR::InjectedBundlePage::shouldInsertNode): Ditto.
(WTR::InjectedBundlePage::shouldInsertText): Ditto.
(WTR::InjectedBundlePage::shouldDeleteRange): Ditto.
(WTR::InjectedBundlePage::shouldChangeSelectedRange): Ditto.
(WTR::InjectedBundlePage::shouldApplyStyle): Ditto.
(WTR::InjectedBundlePage::didBeginEditing): Ditto.
(WTR::InjectedBundlePage::didEndEditing): Ditto.
(WTR::InjectedBundlePage::didChange): Ditto.
(WTR::InjectedBundlePage::didChangeSelection): Ditto.
(WTR::InjectedBundlePage::dumpHistory): Ditto.
Canonical link: https://commits.webkit.org/237916@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-19 19:37:21 +00:00
2021-05-18 Darin Adler <darin@apple.com>
Move CFStringRef and NSString support from StringBuilder into StringConcatenateCF
https://bugs.webkit.org/show_bug.cgi?id=225839
Reviewed by Sam Weinig.
The new header makes CFStringRef and NSString work with string concatenation,
which means it now works with the variadic StringBuilder::append and makeString,
and still works with the single-argument StringBuilder::append. More efficient
that the old version because it does not allocate a temporary WTF::String for
the 16-bit character path.
Also made many other small improvements to the StringBuilder implementation.
* WTF.xcodeproj/project.pbxproj: Added StringConcatenateCF.h.
* wtf/CheckedArithmetic.h: Removed ConditionalCrashOnOverflow, which was only
here for use by StringBuilder, which does not use CheckedArithmetic any more.
* wtf/PlatformFTW.cmake: Added StringConcatenateCF.h..
* wtf/PlatformMac.cmake: Ditto.
* wtf/PlatformWin.cmake: Ditto.
* wtf/SaturatedArithmetic.h: Moved the contents of this file inside the
WTF namespace.
(WTF::signedAddInt32Overflows): Renamed this function. The type here is
important, and we are not doing anything to prevent type conversion or
create ambiguity, so it's good to be explicit in the function name.
(WTF::saturatedSum<int32_t>): Renamed this from saturatedAddition for
clarity. The function returns a sum, so that's a better name than calling
it "addition". Also, it's clearer to be explicit about the return type.
(WTF::signedSubtractInt32Overflows): Renamed. Same reason as above.
(WTF::saturatedDifference<int32_t>): Ditto.
(WTF::saturatedSum): Added. Does unsigned integer saturated addition.
This one can be written in a portable manner and still get really
efficient code on at least Intel and ARM64.
(WTF::saturatedSum): Added a function template that lets callers pass
larger number of arguments to saturatedSum, rather than exactly two.
* wtf/text/StringBuilder.cpp:
(WTF::expandedCapacity): Renamed to use the term capacity rather than
length for the new required capacity.
(WTF::StringBuilder::didOverflow): Implement the new approach to
overflow, meaning we need to write the CRASH() here explicitly and
in the non-crashing mode, set m_length.
(WTF::StringBuilder::reifyString const): Changed the overflow check
into a RELEASE_ASSERT. This is now responsible for doing the check that
callers were doing earlier, so we want it in production builds. Also
simplified this since our m_length member is a simple integer now,
and removed the unused m_isReified.
(WTF::StringBuilder::shrink): Renamed this to shrink to match the
Vector::shrink function, since this has never supported making the
builder larger. Removed unnecessary overflow checks, since shrinking
cannot cause overflow.
(WTF::StringBuilder::allocateBuffer): Replaced two separate functions
with a single simpler function template. Removed extra overflow checks
because the StringImpl::tryCreateUninitialized function already does
the only overflow check we need. Also move to StringImpl::copyCharacters
for copying characters rather than using std::memcpy directly.
Removed code to set m_is8Bit and m_bufferCharacters.
(WTF::StringBuilder::reallocateBuffer): Replaced two separate
functions with a function template and a cover that calls the
appropriate instance of the template for places where we aren't
already in character-type-specific code paths. This version now
supports allocating a buffer for the first time in cases where
we have m_string and not m_buffer, which used to be handled at
the higher level. Removed code to set m_bufferCharacters.
(WTF::StringBuilder::reserveCapacity): Rewrote for simplicity.
By relying on the overflow checking inside reallocateBuffer and
allocateBuffer we no longer need checking of the passed-in value
at this level.
(WTF::StringBuilder::extendBufferForAppending): Removed the
version of this that takes additionalLength since it's
potentially confusing to have a family of functions that have the
same name and take the same type of argument, but interpret it
subtly differently. Streamlined the code using std::exchange.
This function now also includes the logic from the function named
extendBufferForAppendingWithoutOverflowCheck, which was subtly
misnamed since that was not the only semantic difference. Also
removed the ALWAYS_INLINE because the compiler will do the right
thing without such heavy handed advice.
(WTF::StringBuilder::extendBufferForAppendingSlowCase): Streamlined
this by using std::exchange and removed additional overflow checks
at this level since reallocateBuffer already does them. Also added
a check for the case where the new total length is 0, which would
not be handled correctly and efficiently by reallocateBuffer.
(WTF::StringBuilder::extendBufferForAppendingLChar): Renamed this
from extendBufferForAppending8, since it's now identical to calling
extendBufferForAppending<LChar>, except for inlining and linkage.
(WTF::StringBuilder::extendBufferForAppendingWithUpconvert):
Renamed this from extendBufferForAppending16. It is different from
the other extendBuffer functions because is supports upconverting
from LChar to UChar. Like the others it relies on allocateBuffer
for the overflow checking.
(WTF::StringBuilder::appendCharacters): Removed an unnecessary
assertion that the characters pointer is non-null; that will fail
in an obvious way without an assertion. Simplified the logic and
removed some invariant assertions that don't help us much. Changed
overflow checking by using saturatedSum to compute the new length.
In overflow cases, the new sum will be larger than the maximum
string length, but will fit in an unsigned, so we can pass it
down to lower levels and let functions like reallocateBuffer do
the actual overflow checking. Also use StringImpl::copyCharacters.
(WTF::StringBuilder::append): Removed the CFStringRef overload.
(WTF::StringBuilder::shouldShrinkToFit const): Rename this from
canShrink. Simplify the function a bit and remove the vague FIXME
that says "this should be tuned". That may be so, but the FIXME
is not really driving us to action.
(WTF::StringBuilder::shrinkToFit): Simplify by using the new
reallocateBuffer and std::exchange. Removed unneeded assertion
about overflow that doesn't help us maintain the invariant.
(WTF::StringBuilder::isAllASCII const): Was tempted to remove
this function, but for now just made it use the StringView
version for brevity.
* wtf/text/StringBuilder.h: Removed many unneeded includes, and
notably included SaturatedArithmetic.h instead of
CheckedArithmetic.h because we now use the former instead of the
latter. Changed the overflow checking implementation to work
more simply based on saturated addition rather than Checked.
This allowed us to get rid of dependency on our own unique mode
for Checked, called ConditionalCrashOnOverflow. Removed a
comment about making a templatized version of StringBuilder.
We can do it if we like, but does not seem urgent. Moved
fucntion bodies out of the class definition so it's easier to
see what's going on in the class. Since m_length is now an
ordinary integer, the check for overflowed simply checks to see
if the length is larger than the maximum string length. When we
encounter overflow that is not about length computation, we set
the length to the maximum integer to indicate the failure.
Deleted the append overloads for CFStringRef and NSString.
Removed m_bufferCharacters, m_is8Bit, and m_isReified.
(WTF::StringBuilder::StringBuilder): Simplified the constructor
since we only have to initialize the m_shouldCrashOnOverflow member.
(WTF::StringBuilder::clear): Fixed a mistake where this was not
resetting the m_isReified flag.
(WTF::StringBuilder::swap): Updated for changes in the data members.
(WTF::StringBuilder::operator StringView const): Moved out of line.
Made sure to call the length() function so we crash if this is
called after overflow.
(WTF::StringBuilder::append): Remove some of the unnecessary checks
and special cases in the various versions of append. Most of the
checking is done inside appendCharacters, with only a few exceptions.
(WTF::StringBuilder::appendSubstring): Moved out of the class
definition without making significant changes.
(WTF::StringBuilder::appendCharacter): Ditto.
(WTF::StringBuilder::toString): Greatly simplified this function
by relying on overflow checking in the reifyString function instead
of doing it here and removing unneeded invariant assertions.
(WTF::StringBuilder::toStringPreserveCapacity const): Ditto.
(WTF::StringBuilder::toAtomString const): Rewrote this to streamline,
removing explicit overflow checks.
(WTF::StringBuilder::length const): Moved out of the class
definition without making significant changes.
(WTF::StringBuilder::capacity const): Ditto.
(WTF::StringBuilder::operator[] const): Ditto.
(WTF::StringBuilder::characters const): Implemented this operation
in the function template. Now rather than having this call the
characters8 and characters16 functions, they can call it.
(WTF::StringBuilder::getBufferCharacters<LChar>): Deleted.
(WTF::StringBuilder::getBufferCharacters<UChar>): Deleted.
(WTF::StringBuilder::appendFromAdapters): Use saturatedSum to
compute the required length, which allows the extendBuffer
functions to do overflow checking without having to take special
checked integer types for arguments.
(WTF::StringBuilder::equal): Implement using StringView.
* wtf/text/StringBuilderJSON.cpp:
(WTF::StringBuilder::appendQuotedJSONString): Simplified the checked
arithmetic for computing the required capacity. Updated since we
removed m_bufferCharacters and changed the type of m_length.
* wtf/text/cf/StringConcatenateCF.h: Added. Specializes StringTypeAdapter for
both CFStringRef and NSString *. If CFStringGetCStringPtr works for Latin-1, then
does the 8-bit code path, otherwise the 16-bit.
* wtf/text/cocoa/TextStreamCocoa.mm: Include StringConcatenateCF.h, since it's
now needed to use CFStringRef with StringBuilder.
2021-05-19 18:43:29 +00:00
2021-05-19 Sam Weinig <weinig@apple.com>
Update Base64 encoding/decoding to match more modern WebKit conventions
https://bugs.webkit.org/show_bug.cgi?id=225920
Reviewed by Chris Dumez.
Bring base64 encoding/decoding up to more modern WebKit conventions by:
- Replace use of "out parameter + bool" with Optional return values.
- Using enum class for enumerations.
- Replacing SignedOrUnsignedCharVectorAdapter/ConstSignedOrUnsignedCharVectorAdapter
with appropriate function overloads.
Also adds a new StringTypeAdapter for inline base64 encoding data in either makeString()
or StringBuilder. To make this work, a few modifications were need to the base64Encode()
functions to support the fixed size writeTo() function.
First, the length of the encoded data is now computed up front depending on the policy.
This has been extracted into a new calculateBase64EncodedSize() function used by both
the adaptor and by base64Encode when passed a Vector. Previously, when encoding using
some policies, the size was an overestimate and the resulting Vector would be resized
down after encoding.
Second, base64EncodeInternal was made into a template function to allow for two new
base64Encode functions, one of which has a UChar* destination. These are used by the
adaptor to write the encoded data.
One additional small change is that now a optional map type parameter has been added
to all the encoders to allow using either the default map or the URL one as defined
in RFC 4648. This simplifies the implementation of the StringTypeAdapter and makes the
base64URLEncode/base64URLDecode functions into simple convenience functions that use
the right defaults for the generic encode/decode functions.
* wtf/text/Base64.cpp:
(WTF::base64EncodeInternal):
(WTF::base64Encode):
(WTF::base64DecodeInternal):
(WTF::base64Decode):
(WTF::base64URLDecode):
(WTF::base64URLEncode): Deleted.
* wtf/text/Base64.h:
(WTF::base64Decode):
(WTF::base64Encode):
(WTF::base64URLEncode):
(WTF::isBase64OrBase64URLCharacter):
(WTF::calculateBase64EncodedSize):
(WTF::base64Encoded):
(WTF::base64URLEncoded):
(WTF::StringTypeAdapter<Base64Specification>::StringTypeAdapter):
(WTF::StringTypeAdapter<Base64Specification>::length const):
(WTF::StringTypeAdapter<Base64Specification>::is8Bit const):
(WTF::StringTypeAdapter<Base64Specification>::writeTo const):
Make AirAllocateRegistersByGraphColoring use less memory
https://bugs.webkit.org/show_bug.cgi?id=225848
Reviewed by Filip Pizlo.
Source/JavaScriptCore:
We've had some jetsam problems caused by the main Air register allocator, which caused us to lower Options::maximumTmpsForGraphColoring.
Hence this patch tries to improve the memory usage of the allocator. It includes several changes:
- Change the datastructure used for representing the interference graph. Before it was effectively a HashSet<std::pair<uint16_t, uint16_t>. Now, it is either a Bitvector (for n < 400 for now, can be tweaked easily), or a Vector<LikelyDenseUnsignedIntegerSet<uint16_t>> otherwise.
LikelyDenseUnsignedIntegerSet is a new datastructure introduced by this patch, it is either a HashSet if very sparse, or a BitVector + an amount to shift it by.
This is by far the largest memory reduction in this patch, it reduces the maximum memory used for an interference graph in tsf-wasm in JetStream2 from 16MB to 700kB, and in mruby-wasm.aotoki.dev from 262MB to 20MB (the later only happen when we increase Options::maximumTmpsForGraphColoring.. this is the exact function which caused us to lower it).
Its effect on smaller functions in JetStream2 is rarely as dramatic but always an improvement, and improvements between 2x and 5x are extremely common (10x to 30x are significantly rarer but do occur).
- In order to easily test this change and any further change to this datastructure, the old approach was preserved as InterferenceHashSet, and a template to run two such datastructures in parallel, checking their equivalence was added: InstrumentedInterferenceGraph. Running with it and reportInterferenceGraphMemoryUse set to true was used to compute the numbers given above.
- There was already some template parameter to change the size of the tmp indices from unsigned to uint16_t but the code failed to compile unless it was unsigned. I fixed this, made more consistent use of it, and switched to uint16_t in the very common case that we have less than 65k Tmps (we can have more despite the option because of spilling). This halved the memory usage of various other datastructures in the register allocator
- unspillableTmps was a HashSet<unsigned>. Since it is often quite dense (often around 20% on JetStream2), I replaced it by a Bitvector instead
- m_biases was a HashMap<IndexType, HashSet<IndexType>>. Since it is extremely rare that the sets have more than 8 elements (from looking at some instrumented run of JetStream2), I replaced it by HashMap<IndexType, SmallSet<IndexType>>. This not only significantly reduces memory, but nearly halves the time spent in assignColors(around 80ms -> 40ms in JetStream 2)
- UseCounts was needlessly general: it is only used by the register allocator (all other references to UseCounts refer to the completely different B3::UseCounts), so there is no point in it computing, and then storing lots of irrelevant data. A float is also more than enough precision (especially since it is pretty much always 1, 10, 100, or 1000 in practice…). Also, since we only need it indexed by Tmps, we can use a Vector with AbsoluteTmpMapper instead of its HashMap. These changes are not just memory savings, they also make selectSpill way faster (570ms -> 250ms on my machine on JetStream2)
- While I was at it, I did a couple of other tweaks to the logic of selectSpill. In particular, instead of having to check for isFastTmp every time, I just put the fast tmps directly in unspillableTmps, which prevents them from getting added to m_spillWorklist in the first place. This + a bit of clean-up (for example putting an early exit instead of setting score to infinity in the case of dead tmps) resulted in a further perf win (to roughly 200ms spent in selectSpill() on JetStream2)
All together, this patch reduces the time spent in the register allocator by roughly 15 to 20% in JetStream2 (tested both with the Briggs and the IRC allocators on my MBP 2019).
I do not yet have precise performance numbers for this exact patch, but benchmarking a previous version of it (with a less optimized interference graph) resulted in significant RAMification improvements (around 1%), and more surprisingly some JetStream2 improvements on weaker machines (e.g. an iPhone 7 gained > 1%). I believe these gains come either from less trashing of the caches, or less contention caused by the memory traffic.
I will try to update the bugzilla with more up-to-date thorough results when I get them.
This patch does not increase Options::maximumTmpsForGraphColoring, I intend to do that in a separate patch to make it easier to revert in case of a problem.
* b3/B3ReduceLoopStrength.cpp:
(JSC::B3::ReduceLoopStrength::reduceByteCopyLoopsToMemcpy):
* b3/air/AirAllocateRegistersAndStackByLinearScan.cpp:
* b3/air/AirAllocateRegistersByGraphColoring.cpp:
(JSC::B3::Air::allocateRegistersByGraphColoring):
* b3/air/AirCode.h:
(JSC::B3::Air::Code::forEachFastTmp const):
* b3/air/AirUseCounts.h:
(JSC::B3::Air::UseCounts::UseCounts):
(JSC::B3::Air::UseCounts::isConstDef const):
(JSC::B3::Air::UseCounts::numWarmUsesAndDefs const):
(JSC::B3::Air::UseCounts::dump const):
* parser/Nodes.h:
Source/WTF:
Two changes: the addition of LikelyDenseUnsignedIntegerSet, and various improvements to Small(Ptr)Set.
The latter include:
- Renaming SmallPtrSet into SmallSet, as it now supports integers as well as pointers.
- Reducing its size by sharing the same storage for m_buffer and for m_smallStorage.
This is safe to do, because all operations branch on isSmall() which depends purely on m_capacity.
- Adding trivial size(), isEmpty() and memoryUse() methods
- Adding a comment at the top of the file explaining when to use, and (more importantly) not to use SmallSet.
LikelyDenseUnsignedIntegerSet is an even more specialized data structure, that can represent sets of unsigned integers very compactly if they are clustered.
Finally I added an outOfLineMemoryUse() method to BitVector, making it more convenient to compare the memory consumption of different data structures in the register allocator.
* WTF.xcodeproj/project.pbxproj:
* wtf/BitVector.h:
* wtf/CMakeLists.txt:
* wtf/LikelyDenseUnsignedIntegerSet.cpp: Copied from Source/WTF/wtf/SmallPtrSet.cpp.
* wtf/LikelyDenseUnsignedIntegerSet.h: Added.
(WTF::LikelyDenseUnsignedIntegerSet::LikelyDenseUnsignedIntegerSet):
(WTF::LikelyDenseUnsignedIntegerSet::~LikelyDenseUnsignedIntegerSet):
(WTF::LikelyDenseUnsignedIntegerSet::contains const):
(WTF::LikelyDenseUnsignedIntegerSet::add):
(WTF::LikelyDenseUnsignedIntegerSet::size const):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::iterator):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::m_shift):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator++):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator* const):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator== const):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator!= const):
(WTF::LikelyDenseUnsignedIntegerSet::begin const):
(WTF::LikelyDenseUnsignedIntegerSet::end const):
(WTF::LikelyDenseUnsignedIntegerSet::memoryUse const):
(WTF::LikelyDenseUnsignedIntegerSet::validate const):
(WTF::LikelyDenseUnsignedIntegerSet::isBitVector const):
(WTF::LikelyDenseUnsignedIntegerSet::isValidValue const):
(WTF::LikelyDenseUnsignedIntegerSet::transitionToHashSet):
(WTF::LikelyDenseUnsignedIntegerSet::transitionToBitVector):
* wtf/SmallPtrSet.h: Removed.
* wtf/SmallSet.cpp: Renamed from Source/WTF/wtf/SmallPtrSet.cpp.
* wtf/SmallSet.h: Added.
Tools:
Simply added some tests for SmallSet.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/SmallSet.cpp: Added.
(TestWebKitAPI::testSmallSetOfUnsigned):
(TestWebKitAPI::testSmallSetOfPointers):
(TestWebKitAPI::testVectorsOfSmallSetsOfUnsigned):
(TestWebKitAPI::TEST):
Canonical link: https://commits.webkit.org/237893@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-19 03:24:14 +00:00
2021-05-18 Robin Morisset <rmorisset@apple.com>
Make AirAllocateRegistersByGraphColoring use less memory
https://bugs.webkit.org/show_bug.cgi?id=225848
Reviewed by Filip Pizlo.
Two changes: the addition of LikelyDenseUnsignedIntegerSet, and various improvements to Small(Ptr)Set.
The latter include:
- Renaming SmallPtrSet into SmallSet, as it now supports integers as well as pointers.
- Reducing its size by sharing the same storage for m_buffer and for m_smallStorage.
This is safe to do, because all operations branch on isSmall() which depends purely on m_capacity.
- Adding trivial size(), isEmpty() and memoryUse() methods
- Adding a comment at the top of the file explaining when to use, and (more importantly) not to use SmallSet.
LikelyDenseUnsignedIntegerSet is an even more specialized data structure, that can represent sets of unsigned integers very compactly if they are clustered.
Finally I added an outOfLineMemoryUse() method to BitVector, making it more convenient to compare the memory consumption of different data structures in the register allocator.
* WTF.xcodeproj/project.pbxproj:
* wtf/BitVector.h:
* wtf/CMakeLists.txt:
* wtf/LikelyDenseUnsignedIntegerSet.cpp: Copied from Source/WTF/wtf/SmallPtrSet.cpp.
* wtf/LikelyDenseUnsignedIntegerSet.h: Added.
(WTF::LikelyDenseUnsignedIntegerSet::LikelyDenseUnsignedIntegerSet):
(WTF::LikelyDenseUnsignedIntegerSet::~LikelyDenseUnsignedIntegerSet):
(WTF::LikelyDenseUnsignedIntegerSet::contains const):
(WTF::LikelyDenseUnsignedIntegerSet::add):
(WTF::LikelyDenseUnsignedIntegerSet::size const):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::iterator):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::m_shift):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator++):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator* const):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator== const):
(WTF::LikelyDenseUnsignedIntegerSet::iterator::operator!= const):
(WTF::LikelyDenseUnsignedIntegerSet::begin const):
(WTF::LikelyDenseUnsignedIntegerSet::end const):
(WTF::LikelyDenseUnsignedIntegerSet::memoryUse const):
(WTF::LikelyDenseUnsignedIntegerSet::validate const):
(WTF::LikelyDenseUnsignedIntegerSet::isBitVector const):
(WTF::LikelyDenseUnsignedIntegerSet::isValidValue const):
(WTF::LikelyDenseUnsignedIntegerSet::transitionToHashSet):
(WTF::LikelyDenseUnsignedIntegerSet::transitionToBitVector):
* wtf/SmallPtrSet.h: Removed.
* wtf/SmallSet.cpp: Renamed from Source/WTF/wtf/SmallPtrSet.cpp.
* wtf/SmallSet.h: Added.
2021-05-19 01:51:47 +00:00
2021-05-18 Chris Dumez <cdumez@apple.com>
Use WTF::Locker for locking BaseAudioContext's graph lock
https://bugs.webkit.org/show_bug.cgi?id=225935
Reviewed by Sam Weinig.
* wtf/RecursiveLockAdapter.h:
(WTF::RecursiveLockAdapter::isOwner const):
Add isOwner() function that returns true if the current thread is holding the lock.
This is needed for WebAudio purposes.
[macOS] Titlebar separator doesn't show when WKWebView is scrolled
https://bugs.webkit.org/show_bug.cgi?id=220633
<rdar://problem/71094055>
Reviewed by Darin Adler.
Source/WebKit:
Starting in Big Sur, NSWindows with a titlebar display a separator if
there is a scrolled NSScrollView adjacent to the titlebar. Since
WKWebViews are scrollable views, but not backed by NSScrollView, we
need to adopt SPI to support this functionality.
This patch updates WKWebView to conform to the NSScrollViewSeparatorTrackingAdapter
protocol, ensuring the titlebar separator is displayed when
necessary. Note that since WKWebViews are not actually NSScrollView's we
don't already have the scroll position of the view in the UIProcess. To
determine whether or not the view is scrolled, this patch adds plumbing
so that the WebProcess can tell the UIProcess the new scroll position
when a page is scrolled.
Tests: WKWebViewTitlebarSeparatorTests.BackForwardCache
WKWebViewTitlebarSeparatorTests.ChangeTitlebarAdjacency
WKWebViewTitlebarSeparatorTests.ChangeViewVisibility
WKWebViewTitlebarSeparatorTests.NavigationResetsTitlebarAppearance
WKWebViewTitlebarSeparatorTests.ParentWhileScrolled
WKWebViewTitlebarSeparatorTests.ScrollWithTitlebarAdjacency
WKWebViewTitlebarSeparatorTests.ScrollWithoutTitlebarAdjacency
* Platform/spi/mac/AppKitSPI.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView scrollViewFrame]):
(-[WKView hasScrolledContentsUnderTitlebar]):
* UIProcess/API/mac/WKWebViewMac.mm:
(-[WKWebView scrollViewFrame]):
(-[WKWebView hasScrolledContentsUnderTitlebar]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateWindowAndViewFrames):
If the WKWebView's frame changes, update the titlebar adjacency
state and notify observers of the change.
(WebKit::WebViewImpl::viewWillMoveToWindowImpl):
Unregister the WKWebView as an NSScrollViewSeparatorTrackingAdapter if
it is removed from the window.
(WebKit::WebViewImpl::viewDidHide):
Hidden views are not adjacent to the titlebar.
(WebKit::WebViewImpl::viewDidUnhide):
An unhidden view may be adjacent to the titlebar.
(WebKit::WebViewImpl::pageDidScroll):
Use the scroll position of the page to determine whether or not the
WKWebView is scrolled.
(WebKit::WebViewImpl::scrollViewFrame):
Needed to conform to NSScrollViewSeparatorTrackingAdapter.
(WebKit::WebViewImpl::hasScrolledContentsUnderTitlebar):
Needed to conform to NSScrollViewSeparatorTrackingAdapter. Returns true
if the view is registered as an NSScrollViewSeparatorTrackingAdapter
and is scrolled.
(WebKit::WebViewImpl::updateTitlebarAdjacencyState):
The WKWebView needs to be registered as an NSScrollViewSeparatorTrackingAdapter
if it's adjacent to the titlebar and unregistered otherwise.
* UIProcess/PageClient.h:
(WebKit::PageClient::pageDidScroll):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::pageDidScroll):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::didCommitLoadForMainFrame):
Reset the scroll position upon navigation, as pageDidScroll does not get
called when navigating.
(WebKit::PageClientImpl::pageDidScroll):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::pageDidScroll):
Pass the current scroll position when the page is scrolled, so that the
UIProcess knows whether or not the page has a non-zero scroll position.
Source/WTF:
* wtf/PlatformHave.h: Defined HAVE_NSSCROLLVIEW_SEPARATOR_TRACKING_ADAPTER.
Tools:
Added API tests to verify that the delegate implementation returns the
correct value for `hasScrolledContentsUnderTitlebar` depending on
the view's scroll position, visibility, and frame.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/TestWebKitAPI/mac/AppKitSPI.h:
* TestWebKitAPI/Tests/mac/WKWebViewTitlebarSeparatorTests.mm: Added.
(-[TitlebarSeparatorTestWKWebView initWithFrame:configuration:]):
(-[TitlebarSeparatorTestWKWebView separatorTrackingAdapter]):
(BackForwardCache):
(ChangeTitlebarAdjacency):
(ChangeViewVisibility):
(NavigationResetsTitlebarAppearance):
(ParentWhileScrolled):
(ScrollWithTitlebarAdjacency):
(ScrollWithoutTitlebarAdjacency):
Canonical link: https://commits.webkit.org/237884@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-18 23:15:23 +00:00
2021-05-18 Aditya Keerthi <akeerthi@apple.com>
[macOS] Titlebar separator doesn't show when WKWebView is scrolled
https://bugs.webkit.org/show_bug.cgi?id=220633
<rdar://problem/71094055>
Reviewed by Darin Adler.
* wtf/PlatformHave.h: Defined HAVE_NSSCROLLVIEW_SEPARATOR_TRACKING_ADAPTER.
2021-05-18 17:33:17 +00:00
2021-05-18 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com>
[PlayStation] Fix PlayStation port
https://bugs.webkit.org/show_bug.cgi?id=225913
Reviewed by Don Olmstead.
Fix PlayStation port
* wtf/PlatformPlayStation.cmake: Rename
PLAYSTATION_COPY_SHARED_LIBRARIES to PLAYSTATION_COPY_REQUIREMENTS.
2021-05-18 02:35:39 +00:00
2021-05-17 Saam Barati <sbarati@apple.com>
Enable JS to emit sign posts and trace points under Options::exposeProfilersOnGlobalObject
https://bugs.webkit.org/show_bug.cgi?id=225895
Reviewed by Yusuke Suzuki.
* wtf/SystemTracing.h:
2021-05-18 02:33:16 +00:00
2021-05-17 Wenson Hsieh <wenson_hsieh@apple.com>
[GPU Process] Object identifiers with the deleted value should cause MESSAGE_CHECKs
https://bugs.webkit.org/show_bug.cgi?id=225886
rdar://78114708
Reviewed by Chris Dumez.
See WebCore/ChangeLog for more details. Add a helper method on `ObjectIdentifier` that returns true only if it
is the empty value or deleted value.
* wtf/ObjectIdentifier.h:
(WTF::ObjectIdentifier::isValid const):
2021-05-17 21:26:59 +00:00
2021-05-17 Alex Christensen <achristensen@webkit.org>
Use kAudioObjectPropertyElementMain where available
https://bugs.webkit.org/show_bug.cgi?id=224635
Reviewed by Eric Carlson.
* wtf/PlatformHave.h:
2021-05-16 17:18:30 +00:00
2021-05-16 Chris Dumez <cdumez@apple.com>
Modernize / Optimize SQLiteStatement creation and preparation
https://bugs.webkit.org/show_bug.cgi?id=225791
Reviewed by Sam Weinig.
Allow constructing a UniqueRef<> from a C++ reference. std::unique_ptr<>() can be constructed
using a raw pointer and we can construct a UniqueRef<> from a std::unique_ptr<>() so I see
no reason not to allow that.
The reason I needed this is that I want to prevent call sites from allocating SQLiteStatement
without going through the SQLiteDatabase. As a result, I made the SQLiteStatement constructor
private and marked SQLiteDatabase as a friend class. SQLiteDatabase has to heap-allocate
a SQLiteStatement via new and then construct a UniqueRef<> for it. SQLiteDatabase cannot use
makeUniqueRef() because the SQLiteStatement constructor is private. I also cannot mark
makeUniqueRef() as a friend function of SQLiteStatement or anybody could heap allocate a
SQLiteStatement via makeUniqueRef (not just the SQLiteDatabase).
* wtf/UniqueRef.h:
(WTF::UniqueRef::UniqueRef):
2021-05-16 06:36:30 +00:00
2021-05-15 Ryosuke Niwa <rniwa@webkit.org>
Delete WebSQL code from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=225739
Reviewed by Sihui Liu.
Deleted the experimental feature to disable WebSQL since we've been shipping this,
and made the flag to selectively enable WebSQL in WebKit1 an internal debug setting
since nobody should be enabling this now.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-05-16 03:14:57 +00:00
2021-05-15 Sam Weinig <weinig@apple.com>
Allow conditionally enabling OffscreenCanvas only for non-worker contexts
https://bugs.webkit.org/show_bug.cgi?id=225845
Reviewed by Darin Adler.
* Scripts/Preferences/WebPreferencesInternal.yaml:
Add new OffscreenCanvasInWorkersEnabled preference.
* wtf/PlatformEnable.h:
Add new ENABLE_OFFSCREEN_CANVAS_IN_WORKERS macro.
2021-05-15 23:54:52 +00:00
2021-05-15 Alberto Garcia <berto@igalia.com>
CeilingOnPageSize too low for Loongson CPUs
https://bugs.webkit.org/show_bug.cgi?id=221198
<rdar://problem/74089683>
Reviewed by Michael Catanzaro.
Increase the page size to 16KB in MIPS64.
* wtf/PageBlock.h:
2021-05-15 05:46:43 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Drop FileSystem::fileMetadata() / fileMetadataFollowingSymlinks()
https://bugs.webkit.org/show_bug.cgi?id=225820
Reviewed by Darin Adler.
Drop FileSystem::fileMetadata() / fileMetadataFollowingSymlinks(). Those don't match very closely the
std::filesystem API we use internally and they are not very efficient because we gather several attributes
of a file but the callers are usually only interested in one thing (e.g. file type or file size).
Callers interested in the file size, can call the pre-existing FileSystem::fileSize(). For call sites
wanting to check if it is a hidden file, I introduced a new FileSystem::isHiddenFile() API. For call sites
interested in the file type, I replaced FileSystem::isDirectory() / FileSystem::isDirectoryFollowingSymlinks()
with more generic FileSystem::fileType() / FileSystem::fileTypeFollowingSymlinks().
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/FileMetadata.h: Removed.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::isHiddenFile):
(WTF::FileSystemImpl::fileTypePotentiallyFollowingSymLinks):
(WTF::FileSystemImpl::fileType):
(WTF::FileSystemImpl::fileTypeFollowingSymlinks):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
* wtf/posix/FileSystemPOSIX.cpp:
* wtf/win/FileSystemWin.cpp:
2021-05-15 04:18:38 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Drop legacy / prefixed WebAudio implementation
https://bugs.webkit.org/show_bug.cgi?id=225832
Reviewed by Darin Adler.
Drop preference for prefixed WebAudio, which was disabled everywhere.
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-05-15 00:26:58 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Port WTF::FileSystem::realPath() to std::filesystem
https://bugs.webkit.org/show_bug.cgi?id=225828
Reviewed by Darin Adler.
Port WTF::FileSystem::realPath() to std::filesystem (in particular std::filesystem::canonical())
so that we no longer need platform-specific code.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::realPath):
* wtf/posix/FileSystemPOSIX.cpp:
* wtf/win/FileSystemWin.cpp:
2021-05-14 23:12:12 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Drop "get" prefix from WTF::FileSystem's getFileModificationTime() / getFileCreationTime()
https://bugs.webkit.org/show_bug.cgi?id=225812
Reviewed by Darin Adler.
We avoid the "get" prefix in WebKit.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fileModificationTime):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::fileCreationTime):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::fileCreationTime):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::fileCreationTimeFromFindData):
(WTF::FileSystemImpl::fileModificationTimeFromFindData):
(WTF::FileSystemImpl::fileCreationTime):
2021-05-14 23:08:03 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Rename FileSystem::getVolumeFreeSpace() to FileSystem::volumeFreeSpace()
https://bugs.webkit.org/show_bug.cgi?id=225811
Reviewed by Darin Adler.
Rename FileSystem::getVolumeFreeSpace() to FileSystem::volumeFreeSpace() given that we
avoid the "get" prefix in WebKit. Also modernize the function by returning an
Optional<uint64_t> instead of using an out-parameter.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::volumeFreeSpace):
* wtf/FileSystem.h:
2021-05-14 21:34:46 +00:00
2021-05-14 Devin Rousso <drousso@apple.com>
Promote `-[WKWebView _pageExtendedBackgroundColor]` SPI to `-[WKWebView underPageBackgroundColor]` API
https://bugs.webkit.org/show_bug.cgi?id=225615
<rdar://problem/76568094>
Reviewed by Wenson Hsieh.
`underPageBackgroundColor` is a `null_resettable` property that will return (in order of validity)
- the most recent non-null value provided
- the CSS `background-color` of the `<body>` and/or `<html>` (this is the current value of `_pageExtendedBackgroundColor`)
- the underlying platform view's background color
Modifications to this property will not have any effect until control is returned to the runloop.
* Scripts/Preferences/WebPreferencesInternal.yaml:
Remove the experimental settings `UseSampledPageTopColorForScrollAreaBackgroundColor`and
`UseThemeColorForScrollAreaBackgroundColor` now that clients can override the default
overscroll area background color using `-[WKWebView setUnderPageBackgroundColor:]`.
2021-05-14 18:26:20 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Introduce FileSystem::updateFileModificationTime()
https://bugs.webkit.org/show_bug.cgi?id=225810
Reviewed by Darin Adler.
Introduce FileSystem::updateFileModificationTime() to update the modification time of a
file. The implementation is cross-platform and relies on std::filesystem. It allows us
to replace platform-specific code that we had at the WebKit2 layer.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::updateFileModificationTime):
* wtf/FileSystem.h:
2021-05-14 17:54:23 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Drop unused FileSystem::homeDirectoryPath()
https://bugs.webkit.org/show_bug.cgi?id=225808
Reviewed by Anders Carlsson.
Only Windows-specific code was calling FileSystem::homeDirectoryPath() but the Windows implementation
for this was always returning the empty string.
* wtf/FileSystem.h:
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::homeDirectoryPath): Deleted.
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::homeDirectoryPath): Deleted.
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::homeDirectoryPath): Deleted.
2021-05-14 16:10:38 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Rename FileSystem::getFileSize() to FileSystem::fileSize()
https://bugs.webkit.org/show_bug.cgi?id=225798
Reviewed by Alex Christensen.
Rename FileSystem::getFileSize() to FileSystem::fileSize() as we usually avoid the "get"
prefix in WebKit. It is also more consistent with the std::filesystem::file_size() the
implementation relies on.
Also have it return an Optional<uint64_t> instead of taking a long long out-parameter, as
this is more modern.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fileSize):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::fileSize):
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::fileSize):
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::getFileSizeFromByHandleFileInformationStructure):
(WTF::FileSystemImpl::fileSize):
(WTF::FileSystemImpl::MappedFileData::mapFileHandle):
2021-05-14 16:01:00 +00:00
2021-05-14 Chris Dumez <cdumez@apple.com>
Rename FileSystem::pathGetFileName() to FileSystem::pathFileName()
https://bugs.webkit.org/show_bug.cgi?id=225806
Reviewed by Alex Christensen.
Rename FileSystem::pathGetFileName() to FileSystem::pathFileName(), as we avoid "get" prefixes in WebKit.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::pathFileName):
(WTF::FileSystemImpl::pathGetFileName): Deleted.
* wtf/FileSystem.h:
2021-05-14 00:35:23 +00:00
2021-05-13 Dean Jackson <dino@apple.com>
[WebXR] Allow WebXR to be tested on PLATFORM(COCOA)
https://bugs.webkit.org/show_bug.cgi?id=225578
Reviewed by Sam Weinig.
Compile-time enabled on all Cocoa platforms.
* wtf/PlatformEnableCocoa.h:
2021-05-13 20:47:38 +00:00
2021-05-13 Chris Dumez <cdumez@apple.com>
Rename FileSystem::directoryName() to FileSystem::parentPath()
https://bugs.webkit.org/show_bug.cgi?id=225768
Reviewed by Darin Adler.
Rename FileSystem::directoryName() to FileSystem::parentPath() for clarity and
consistency with std::filesystem::parent_path() which is used internally.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::readOrMakeSalt):
(WTF::FileSystemImpl::parentPath):
(WTF::FileSystemImpl::directoryName): Deleted.
* wtf/FileSystem.h:
2021-05-13 20:08:36 +00:00
2021-05-13 Chris Dumez <cdumez@apple.com>
Rename FileSystem::fileIsDirectory(path, followSymlinks) to isDirectory(path) / isDirectoryFollowingSymlinks(path)
https://bugs.webkit.org/show_bug.cgi?id=225772
Reviewed by Darin Adler.
I don't think the "file" prefix is useful here so I am renaming the function to
isDirectory(). Also, instead of using an enum parameter to decide whether or
not to follow symlink, I am adding a separate function called
isDirectoryFollowingSymlinks(). This is consistent with the
fileMetadata() / fileMetadataFollowingSymlinks() pattern, which Darin said he
preferred.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::isDirectory):
(WTF::FileSystemImpl::isDirectoryFollowingSymlinks):
(WTF::FileSystemImpl::fileIsDirectory): Deleted.
* wtf/FileSystem.h:
2021-05-13 19:43:37 +00:00
2021-05-13 Chris Dumez <cdumez@apple.com>
Introduce FileSystem::hardLinkCount()
https://bugs.webkit.org/show_bug.cgi?id=225767
Reviewed by Darin Adler.
Introduce FileSystem::hardLinkCount() to replace our platform-specific implementation
in NetworkCacheBlobStorage.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::hardLinkCount):
* wtf/FileSystem.h:
2021-05-13 17:03:39 +00:00
2021-05-13 Alicia Boya García <aboya@igalia.com>
[WTF] Add holdLock() overload for WTF::DataMutex
https://bugs.webkit.org/show_bug.cgi?id=225652
Reviewed by Xabier Rodriguez-Calvar.
This patch adds a holdLock() overload for WTF::DataMutex as syntactic
sugar to simplify usage in a similar way to what holdLock() already
does for WTF::Locker.
* wtf/DataMutex.h:
(WTF::holdLock):
2021-05-13 16:18:32 +00:00
2021-05-13 Darin Adler <darin@apple.com>
Remove StringBuilder::appendNumber
https://bugs.webkit.org/show_bug.cgi?id=225732
Reviewed by Sam Weinig.
We originally added StringBuilder::appendNumber to resolve the ambiguity
between UChar and uint16_t, but that problem was solved long ago and it
is safe to use StringBuilder::append, including the variadic form, on all
types of numbers and we'll get the same results we did with appendNumber.
* wtf/JSONValues.cpp:
(WTF::JSONImpl::Value::writeJSON const): Use append instead of appendNumber.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendNumber): Deleted.
* wtf/text/StringBuilder.h: Removed appendNumber.
* wtf/text/TextStream.cpp:
(WTF::TextStream::operator<<): Use append instead of appendNumber.
Implement some common Baseline JIT slow paths using JIT thunks.
https://bugs.webkit.org/show_bug.cgi?id=225682
Reviewed by Filip Pizlo.
Source/JavaScriptCore:
This patch implements the following changes:
1. Implement exception handling thunks:
a. handleExceptionGenerator, which calls operationLookupExceptionHandler().
b. handleExceptionWithCallFrameRollbackGenerator, which calls
operationLookupExceptionHandlerFromCallerFrame().
All the JIT tiers were emitting their own copy of these routines to call these
operation, one per CodeBlock. We now emit 2 thunks for these and have all the
tiers just jump to them.
PolymorphicAccess also now uses the handleExceptionGenerator thunk.
DFG::JITCompiler::compileExceptionHandlers() has one small behavior difference
before it calls operationLookupExceptionHandlerFromCallerFrame(): it first
re-sets the top of stack for the function where we are about to throw a
StackOverflowError from. This re-setting of top of stack is useless because
we're imminently unwinding out of at least this frame for the StackOverflowError.
Hence, it is ok to use the handleExceptionWithCallFrameRollbackGenerator thunk
here as well. Note that no other tiers does this re-setting of top of stack.
FTLLowerDFGToB3 has one case using operationLookupExceptionHandlerFromCallerFrame()
which cannot be refactored to use these thunks because it does additional
work to throw a StackOverflowError. A different thunk will be needed. I left
it alone for now.
2. Introduce JITThunks::existingCTIStub(ThunkGenerator, NoLockingNecessaryTag) so
that a thunk can get a pointer to another thunk without locking the JITThunks
lock. Otherwise, deadlock ensues.
3. Change SlowPathCall to emit and use thunks instead of emitting a blob of code
to call a slow path function for every bytecode in a CodeBlock.
4. Introduce JITThunks::ctiSlowPathFunctionStub() to manage these SlowPathFunction
thunks.
5. Introduce JITThunks::preinitializeAggressiveCTIThunks() to initialize these
thunks at VM initialization time. Pre-initializing them has multiple benefits:
a. the thunks are not scattered through out JIT memory, thereby reducing
fragmentation.
b. we don't spend time at runtime compiling them when the user is interacting
with the VM. Conceptually, these thunks can be VM independent and can be
shared by VMs process-wide. However, it will require some additional work.
For now, the thunks remain bound to a specific VM instance.
These changes are only enabled when ENABLE(EXTRA_CTI_THUNKS), which is currently
only available for ARM64 and non-Windows x86_64.
This patch has passed JSC tests on AS Mac.
With this patch, --dumpLinkBufferStats shows the following changes in emitted
JIT code size (using a single run of the CLI version of JetStream2 on AS Mac):
Base New Diff
BaselineJIT: 89089964 (84.962811 MB) 84624776 (80.704475 MB) 0.95x (reduction)
DFG: 39117360 (37.305222 MB) 36415264 (34.728302 MB) 0.93x (reduction)
Thunk: 23230968 (22.154778 MB) 23130336 (22.058807 MB) 1.00x
InlineCache: 22027416 (21.006981 MB) 21969728 (20.951965 MB) 1.00x
FTL: 6575772 (6.271145 MB) 6097336 (5.814873 MB) 0.93x (reduction)
Wasm: 2302724 (2.196049 MB) 2301956 (2.195316 MB) 1.00x
YarrJIT: 1538956 (1.467663 MB) 1522488 (1.451958 MB) 0.99x
CSSJIT: 0 0
Uncategorized: 0 0
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/CodeBlock.h:
(JSC::CodeBlock::offsetOfInstructionsRawPointer):
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::emitExplicitExceptionHandler):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileExceptionHandlers):
(JSC::DFG::JITCompiler::link):
* dfg/DFGJITCompiler.h:
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* jit/JIT.cpp:
(JSC::JIT::link):
(JSC::JIT::privateCompileExceptionHandlers):
* jit/JIT.h:
* jit/JITThunks.cpp:
(JSC::JITThunks::existingCTIStub):
(JSC::JITThunks::ctiSlowPathFunctionStub):
(JSC::JITThunks::preinitializeExtraCTIThunks):
* jit/JITThunks.h:
* jit/SlowPathCall.cpp: Added.
(JSC::JITSlowPathCall::call):
(JSC::JITSlowPathCall::generateThunk):
* jit/SlowPathCall.h:
* jit/ThunkGenerators.cpp:
(JSC::handleExceptionGenerator):
(JSC::handleExceptionWithCallFrameRollbackGenerator):
(JSC::popThunkStackPreservesAndHandleExceptionGenerator):
* jit/ThunkGenerators.h:
* runtime/CommonSlowPaths.h:
* runtime/SlowPathFunction.h: Added.
* runtime/VM.cpp:
(JSC::VM::VM):
Source/WTF:
Introduce ENABLE(EXTRA_CTI_THUNKS) flag to guard the use of these new thunks.
Currently, the thunks are 64-bit only, and only supported for ARM64 and non-Windows
X86_64. The reason it is not supported for Windows as well is because Windows
only has 4 argument registers. In this patch, the thunks do not use that many
registers yet, but there will be more thunks coming that will require the use
of up to 6 argument registers.
* wtf/PlatformEnable.h:
Canonical link: https://commits.webkit.org/237639@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-12 19:11:25 +00:00
2021-05-12 Mark Lam <mark.lam@apple.com>
Implement some common Baseline JIT slow paths using JIT thunks.
https://bugs.webkit.org/show_bug.cgi?id=225682
Reviewed by Filip Pizlo.
Introduce ENABLE(EXTRA_CTI_THUNKS) flag to guard the use of these new thunks.
Currently, the thunks are 64-bit only, and only supported for ARM64 and non-Windows
X86_64. The reason it is not supported for Windows as well is because Windows
only has 4 argument registers. In this patch, the thunks do not use that many
registers yet, but there will be more thunks coming that will require the use
of up to 6 argument registers.
* wtf/PlatformEnable.h:
2021-05-12 05:55:23 +00:00
2021-05-11 Chris Dumez <cdumez@apple.com>
Port WTF::FileSystem::listDirectory to std::filesystem
https://bugs.webkit.org/show_bug.cgi?id=225633
Reviewed by Darin Adler.
Port WTF::FileSystem::listDirectory to std::filesystem with the following 2 changes:
- The function no longer takes a (blob-style) filter parameter
- The function now returns file names instead of file paths, allowing the call sites
to more easily filter based on prefixes.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::listDirectory):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
* wtf/posix/FileSystemPOSIX.cpp:
* wtf/win/FileSystemWin.cpp:
2021-05-12 04:23:30 +00:00
2021-05-11 Darin Adler <darin@apple.com>
Remove the String::toInt family of functions
https://bugs.webkit.org/show_bug.cgi?id=225599
Reviewed by Anders Carlsson.
* wtf/text/AtomString.h: Deleted AtomString::toInt.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::toIntStrict): Deleted.
(WTF::StringImpl::toUIntStrict): Deleted.
(WTF::StringImpl::toInt64Strict): Deleted.
(WTF::StringImpl::toUInt64Strict): Deleted.
(WTF::StringImpl::toIntPtrStrict): Deleted.
(WTF::StringImpl::toInt): Deleted.
(WTF::StringImpl::toUInt): Deleted.
(WTF::StringImpl::toInt64): Deleted.
(WTF::StringImpl::toUInt64): Deleted.
(WTF::StringImpl::toIntPtr): Deleted.
* wtf/text/StringImpl.h: Deleted the above functions.
* wtf/text/StringToIntegerConversion.h: Removed toIntegralType.
* wtf/text/StringView.cpp:
(WTF::parseUInt16): Deleted.
* wtf/text/StringView.h: Deleted StringView::toInt,
StringView::toIntStrict, StringView::toUInt64Strict,
StringView::toInt64Strict, and parseUInt16. Changed the constructor
that takes a const char* to work when passed nullptr. StringView has
a null value, and converting a null const char* should produce that.
* wtf/text/WTFString.cpp:
(WTF::String::toIntStrict const): Deleted.
(WTF::String::toUIntStrict const): Deleted.
(WTF::String::toInt64Strict const): Deleted.
(WTF::String::toUInt64Strict const): Deleted.
(WTF::String::toIntPtrStrict const): Deleted.
(WTF::String::toInt const): Deleted.
(WTF::String::toUInt const): Deleted.
(WTF::String::toInt64 const): Deleted.
(WTF::String::toUInt64 const): Deleted.
(WTF::String::toIntPtr const): Deleted.
(WTF::lengthOfCharactersAsInteger): Deleted.
(WTF::charactersToIntStrict): Deleted.
(WTF::charactersToUIntStrict): Deleted.
(WTF::charactersToInt64Strict): Deleted.
(WTF::charactersToUInt64Strict): Deleted.
(WTF::charactersToIntPtrStrict): Deleted.
(WTF::charactersToInt): Deleted.
(WTF::charactersToUInt): Deleted.
(WTF::charactersToInt64): Deleted.
(WTF::charactersToUInt64): Deleted.
(WTF::charactersToIntPtr): Deleted.
* wtf/text/WTFString.h: Deleted the above functions.
2021-05-12 03:55:46 +00:00
2021-05-11 Devin Rousso <drousso@apple.com>
[macCatalyst] should have CSS `hover: hover` and `pointer: fine`
https://bugs.webkit.org/show_bug.cgi?id=225672
Reviewed by Tim Horton.
* wtf/PlatformHave.h:
Add `HAVE_MOUSE_DEVICE_OBSERVATION` and `HAVE_STYLUS_DEVICE_OBSERVATION` to make callsites
clearer instead of having a somewhat unrelated connection to `HAVE_UIKIT_WITH_MOUSE_SUPPORT`
and `HAVE_PENCILKIT_TEXT_INPUT` (not to mention both of them are `PLATFORM(MACCATALYST)`
which isn't desirable since macCatalyst should consider the mouse as the primary pointing
device, just like macOS).
2021-05-12 00:05:49 +00:00
2021-05-11 Alex Christensen <achristensen@webkit.org>
Remove xpc_connection_kill
https://bugs.webkit.org/show_bug.cgi?id=225602
Reviewed by Alexey Proskuryakov.
* wtf/PlatformHave.h:
2021-05-11 02:14:57 +00:00
2021-05-10 Chris Dumez <cdumez@apple.com>
[ macOS Release wk2 ] http/tests/cache-storage/cache-records-persistency.https.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=225522
<rdar://problem/77680019>
Reviewed by Darin Adler.
Pass ec parameter to std::filesystem::directory_iterator() so that it doesn't throw in case of the
path does not exist. Normally, the function would return early earlier if the path does not exist
or isn't a directory. However, in the context of the test, this function is getting called on a
background thread and another thread is deleting the directory in parallel.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::deleteEmptyDirectory):
2021-05-10 23:16:00 +00:00
2021-05-10 Devin Rousso <drousso@apple.com>
`SLEEP_THREAD_FOR_DEBUGGER` should print the PID before sleeping
https://bugs.webkit.org/show_bug.cgi?id=225619
Reviewed by Tim Horton.
* wtf/DebugUtilities.h:
2021-05-10 07:16:13 +00:00
2021-05-10 Rob Buis <rbuis@igalia.com>
Implement <form>.requestSubmit()
https://bugs.webkit.org/show_bug.cgi?id=197958
Reviewed by Darin Adler.
Add requestSubmit as experimental feature, disabled by default.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-05-09 18:22:23 +00:00
2021-05-09 Darin Adler <darin@apple.com>
Remove uses of the String::toInt family of functions from WebCore/html and similar directories
https://bugs.webkit.org/show_bug.cgi?id=225577
Reviewed by Sam Weinig.
* wtf/text/StringBuilder.h: Added conversion operator to make a StringView, built on the exiting
is8Bit, characters8, characters16 and length functions. Removed now-uneeded equal function and
== and != operators since the StringView ones work for those same cases with the same syntax.
Rename toIntegralType to parseInteger and prepare to use it to replace all our integer-parsing functions
https://bugs.webkit.org/show_bug.cgi?id=225560
Reviewed by Sam Weinig.
I have a much larger patch that replaces all the many toInt functions with these parseInteger
function templates. The parseInteger ones take StringView, which means we can pass almost any
type of string or character/length pair including a substring without allocating a new string,
return Optional rather than using an out argument to report failure, take the integer type as
a template parameter so can be used for precisely the desired type at each call site, and make
the "allow trailing junk" feature explicit, rather than implicitly including it in the shortest
named functions, which I hope will discourage people from using that junk-ignoring mode
when it's not desirable.
Also includes adoption of parseInteger within WTF itself, outside the string classes.
My plan is to land the rest of adoption of this in chunks so we can review carefully and spot
mistakes as we go. Then return to files like WTFString.h and remove the many old functions
this replaces, including the String::toInt and charactersToInt families of functions.
* wtf/URL.cpp:
(WTF::URL::port const): Use parseInteger<uint16_t>.
(WTF::URL::setHostAndPort): Ditto.
* wtf/text/StringToIntegerConversion.h: Refactored the existing code to tighten things up
a bit, and got rid of overloads that take pointer and length and the the generic "any string
type" feature, since StringView already works well for that. Renamed toIntegralType to
parseInteger, leaving the old name behind to ease the transition while adopting parseInteger.
* wtf/text/WTFString.cpp:
(WTF::toDoubleType): Use the TrailingJunkPolicy enumeration from the
StringToIntegerConversion.h header.
(WTF::charactersToDouble): Ditto.
(WTF::charactersToFloat): Ditto.
Canonical link: https://commits.webkit.org/237503@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277234 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-09 00:59:28 +00:00
2021-05-08 Darin Adler <darin@apple.com>
Rename toIntegralType to parseInteger and prepare to use it to replace all our integer-parsing functions
https://bugs.webkit.org/show_bug.cgi?id=225560
Reviewed by Sam Weinig.
I have a much larger patch that replaces all the many toInt functions with these parseInteger
function templates. The parseInteger ones take StringView, which means we can pass almost any
type of string or character/length pair including a substring without allocating a new string,
return Optional rather than using an out argument to report failure, take the integer type as
a template parameter so can be used for precisely the desired type at each call site, and make
the "allow trailing junk" feature explicit, rather than implicitly including it in the shortest
named functions, which I hope will discourage people from using that junk-ignoring mode
when it's not desirable.
Also includes adoption of parseInteger within WTF itself, outside the string classes.
My plan is to land the rest of adoption of this in chunks so we can review carefully and spot
mistakes as we go. Then return to files like WTFString.h and remove the many old functions
this replaces, including the String::toInt and charactersToInt families of functions.
* wtf/URL.cpp:
(WTF::URL::port const): Use parseInteger<uint16_t>.
(WTF::URL::setHostAndPort): Ditto.
* wtf/text/StringToIntegerConversion.h: Refactored the existing code to tighten things up
a bit, and got rid of overloads that take pointer and length and the the generic "any string
type" feature, since StringView already works well for that. Renamed toIntegralType to
parseInteger, leaving the old name behind to ease the transition while adopting parseInteger.
* wtf/text/WTFString.cpp:
(WTF::toDoubleType): Use the TrailingJunkPolicy enumeration from the
StringToIntegerConversion.h header.
(WTF::charactersToDouble): Ditto.
(WTF::charactersToFloat): Ditto.
2021-05-08 22:35:07 +00:00
2021-05-08 Chris Dumez <cdumez@apple.com>
Port Filesystem::pathByAppendingComponent() & Filesystem:: pathByAppendingComponents() to std::filesystem
https://bugs.webkit.org/show_bug.cgi?id=225550
Reviewed by Darin Adler.
Port Filesystem::pathByAppendingComponent() & Filesystem:: pathByAppendingComponents() to std::filesystem
and get rid of platform-specific implementations.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::pathByAppendingComponent):
(WTF::FileSystemImpl::pathByAppendingComponents):
* wtf/glib/FileSystemGlib.cpp:
* wtf/posix/FileSystemPOSIX.cpp:
* wtf/win/FileSystemWin.cpp:
2021-05-08 16:54:09 +00:00
2021-05-08 Diego Pino Garcia <dpino@igalia.com>
[GLIB] REGRESSION(r277158) imported/w3c/web-platform-tests/xhr/FormData-append.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=225551
Reviewed by Chris Dumez.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fileIsDirectory): Remove unnecessary path.isEmpty check.
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::fileSystemRepresentation): Return empty CString if path is empty.
2021-05-08 01:05:02 +00:00
2021-05-07 Chris Dumez <cdumez@apple.com>
Port FileSystem::pathGetFileName() & Filesystem::directoryName() to std::filesystem
https://bugs.webkit.org/show_bug.cgi?id=225524
Reviewed by Darin Adler.
Port FileSystem::pathGetFileName() & Filesystem::directoryName() to std::filesystem so
that we can get rid of platform-specific implementions.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::pathGetFileName):
(WTF::FileSystemImpl::directoryName):
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::pathGetFileName): Deleted.
(WTF::FileSystemImpl::directoryName): Deleted.
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::pathGetFileName): Deleted.
(WTF::FileSystemImpl::directoryName): Deleted.
* wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::pathGetFileName): Deleted.
(WTF::FileSystemImpl::directoryName): Deleted.
2021-05-07 23:46:04 +00:00
2021-05-07 Tim Horton <timothy_horton@apple.com>
Add an experimental alternative display-list-based RemoteLayerBackingStore implementation
https://bugs.webkit.org/show_bug.cgi?id=225508
Reviewed by Sam Weinig.
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-05-07 11:46:48 +00:00
2021-05-07 Philippe Normand <pnormand@igalia.com>
[GTK] Warnings about unused filesystem functions
https://bugs.webkit.org/show_bug.cgi?id=225507
Reviewed by Adrian Perez de Castro.
Since r277158 these functions are no longer needed.
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::getFileStat): Deleted.
(WTF::FileSystemImpl::getFileLStat): Deleted.
2021-05-07 05:00:39 +00:00
2021-05-06 Chris Dumez <cdumez@apple.com>
Port Filesystem::fileMetadata() & Filesystem::getFileModificationTime() to std::filesystem
https://bugs.webkit.org/show_bug.cgi?id=225362
Reviewed by Darin Adler.
Port Filesystem::fileMetadata() & Filesystem::getFileModificationTime() to std::filesystem
and get rid of platform-specific implementations.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::toWallTime):
(WTF::FileSystemImpl::getFileModificationTime):
(WTF::FileSystemImpl::fileMetadata):
* wtf/FileSystem.h:
* wtf/glib/FileSystemGlib.cpp:
* wtf/posix/FileSystemPOSIX.cpp:
* wtf/win/FileSystemWin.cpp:
[OpenSSL] Implement CryptoAlgorithmRSA*
https://bugs.webkit.org/show_bug.cgi?id=225294
Reviewed by Don Olmstead.
Implement RSA for OpenSSL.
Implement CryptoAlgorithmRSA_OAEP, CryptoAlgorithmRSA_PSS,
CryptoAlgorithmRSAES_PKCS1_v1_5, CryptoAlgorithmRSASA_PKCS1_v1_5,
and CryptoKeyRSA for OpenSSL.
.:
Note that if such OpenSSL version that does not support RSA_OAEP or
RSA_PSS, the WebCrypto API for those algorithm will return a
NotSupportedError.
* Source/cmake/OptionsPlayStation.cmake:
* Source/cmake/OptionsWinCairo.cmake:
Source/WebCore:
Note that if such OpenSSL version that does not support RSA_OAEP or
RSA_PSS, the WebCrypto API for those algorithm will return a
NotSupportedError.
Also note that OpenSSL accepts RSA_PSS salt length longer than the hash
length. This makes the
crypto/subtle/rsa-pss-import-key-sign-large-salt.html test fail.
Test: Existing crypto/subtle tests
* crypto/keys/CryptoKeyRSA.h: Use the EVP_PKEY struct for the platform
key.
* crypto/openssl/CryptoAlgorithmHMACOpenSSL.cpp: Move HMACAlgorithm()
to OpenSSLUtilities as DigestAlgorithm().
* crypto/openssl/CryptoAlgorithmRSAES_PKCS1_v1_5OpenSSL.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
Implemented.
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
Implemented.
* crypto/openssl/CryptoAlgorithmRSASSA_PKCS1_v1_5OpenSSL.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
Implemented.
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
Implemented.
* crypto/openssl/CryptoAlgorithmRSA_OAEPOpenSSL.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt): Implemented.
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt): Implemented.
* crypto/openssl/CryptoAlgorithmRSA_PSSOpenSSL.cpp:
(WebCore::CryptoAlgorithmRSA_PSS::platformSign): Implemented.
(WebCore::CryptoAlgorithmRSA_PSS::platformVerify): Implemented.
* crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
Registered RSAES_PKCS1_v_1_5, RSASSA_PKCS1_v1_5, RSA_OAEP, and RSA_PSS.
* crypto/openssl/CryptoKeyRSAOpenSSL.cpp:
(WebCore::getRSAModulusLength):
(WebCore::convertToBytes):
(WebCore::convertToBigNumber):
(WebCore::CryptoKeyRSA::create):
(WebCore::CryptoKeyRSA::CryptoKeyRSA):
(WebCore::CryptoKeyRSA::isRestrictedToHash const):
(WebCore::CryptoKeyRSA::keySizeInBits const):
(WebCore::exponentVectorToUInt32):
(WebCore::CryptoKeyRSA::generatePair):
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::importPkcs8):
(WebCore::CryptoKeyRSA::exportSpki const):
(WebCore::CryptoKeyRSA::exportPkcs8 const):
(WebCore::CryptoKeyRSA::algorithm const):
(WebCore::CryptoKeyRSA::exportData const):
* crypto/openssl/OpenSSLCryptoUniquePtr.h:
(WebCore::OpenSSLCryptoPtrDeleter<EVP_PKEY_CTX>::operator() const):
Added.
(WebCore::OpenSSLCryptoPtrDeleter<RSA>::operator() const): Added.
(WebCore::OpenSSLCryptoPtrDeleter<PKCS8_PRIV_KEY_INFO>::operator() const): Added.
(WebCore::OpenSSLCryptoPtrDeleter<BIGNUM>::operator() const): Added.
(WebCore::OpenSSLCryptoPtrDeleter<BN_CTX>::operator() const): Added.
* crypto/openssl/OpenSSLUtilities.cpp:
(WebCore::digestAlgorithm): Added.
(WebCore::calculateDigest): Added.
* crypto/openssl/OpenSSLUtilities.h:
* platform/OpenSSL.cmake:
Source/WTF:
Note that if such OpenSSL version that does not support RSA_OAEP or
RSA_PSS, the WebCrypto API for those algorithm will return a
NotSupportedError.
* wtf/Platform.h: Set HAVE_RSA_PSS for USE(OPENSSL)
LayoutTests:
Add wincairo platform expectations for
rsa-generate/import-key-malformed-parameters, modifying RSA-PSS
related results from NotSupported to appropriate errors.
* platform/wincairo/TestExpectations: Unskip tests that are now supported.
* platform/wincairo/crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt: Added.
* platform/wincairo/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt: Added.
Canonical link: https://commits.webkit.org/237429@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-07 00:17:05 +00:00
2021-05-06 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com>
[OpenSSL] Implement CryptoAlgorithmRSA*
https://bugs.webkit.org/show_bug.cgi?id=225294
Reviewed by Don Olmstead.
Implement RSA for OpenSSL.
Implement CryptoAlgorithmRSA_OAEP, CryptoAlgorithmRSA_PSS,
CryptoAlgorithmRSAES_PKCS1_v1_5, CryptoAlgorithmRSASA_PKCS1_v1_5,
and CryptoKeyRSA for OpenSSL.
Note that if such OpenSSL version that does not support RSA_OAEP or
RSA_PSS, the WebCrypto API for those algorithm will return a
NotSupportedError.
* wtf/Platform.h: Set HAVE_RSA_PSS for USE(OPENSSL)
2021-05-06 23:01:17 +00:00
2021-05-06 Chris Dumez <cdumez@apple.com>
Regression(r254389?) navigator.languages returns all lowercase languages for ports using CF
https://bugs.webkit.org/show_bug.cgi?id=225461
Reviewed by Darin Adler.
Stop lowercasing the languages returned by navigator.language / navigator.languages
as this does not match the specification [1][2] or other Web browsers. The proper format is
'en-US', not 'en-us'.
[1] https://html.spec.whatwg.org/#dom-navigator-language
[2] https://tools.ietf.org/html/bcp47
* wtf/cf/LanguageCF.cpp:
(WTF::httpStyleLanguageCode):
2021-05-06 22:30:16 +00:00
2021-05-06 Filip Pizlo <fpizlo@apple.com>
Remove old and unused memory barrier abstractions
https://bugs.webkit.org/show_bug.cgi?id=225487
Reviewed by Mark Lam.
We don't use memoryBarrierBlahBlah anymore.
* wtf/Atomics.h:
(WTF::memoryBarrierAfterLock): Deleted.
(WTF::memoryBarrierBeforeUnlock): Deleted.
2021-05-06 20:54:16 +00:00
2021-05-06 Filip Pizlo <fpizlo@apple.com>
Reduce use of dmb ish on ARM64
https://bugs.webkit.org/show_bug.cgi?id=225465
Reviewed by Keith Miller.
* wtf/Atomics.h:
(WTF::dependentLoadLoadFence):
2021-05-06 18:40:03 +00:00
2021-05-06 Per Arne Vollan <pvollan@apple.com>
Add sandbox extension flag to specify that path contains no symlinks
https://bugs.webkit.org/show_bug.cgi?id=219428
<rdar://problem/66551986>
Reviewed by Brent Fulgham.
Declare canonical sandbox flag.
* wtf/spi/darwin/SandboxSPI.h:
2021-05-06 17:05:23 +00:00
2021-05-06 Dean Jackson <dino@apple.com>
[WebXR] Add IOSurface to FrameData::LayerData
https://bugs.webkit.org/show_bug.cgi?id=225428
<rdar://problem/77586270>
Reviewed by Tim Horton.
Add USE(IOSURFACE_FOR_XR_LAYER_DATA) and make it true
for Cocoa platforms.
* wtf/PlatformUse.h:
Streamline codec parsing, replacing uses of HashMap with SortedArrayMap
https://bugs.webkit.org/show_bug.cgi?id=225368
Reviewed by Sam Weinig.
Source/WebCore:
* platform/ContentType.cpp:
(WebCore::ContentType::parameter const): Use early return instead of nesting.
Strip HTML spaces, not all whitespace, and do it only once rather than twice.
Fixed a small bug where we search for the second quotation mark in a way that
could find the same quotation mark twice if there is a space before the first
one. Added FIXME comments about a few obvious problems in the parsing algorithm.
Improved efficiency by using StringView, saving the allocation of one temporary
StringImpl in the case where we have some HTML spaces to strip.
(WebCore::ContentType::containerType const): Simplified the implemementation
by taking advantage of the fact that our notFound value is designed to be used
as an argument to functions like String::left, telling them to return the
entire string. Strip HTML spaces, not all whitespace.
* platform/graphics/HEVCUtilities.cpp:
(WebCore::parseHEVCCodecParameters): Take a StringView instead of a String
for greater flexibility and efficiency. Don't store codecName, which is
never used after verifying that it is a legal value here. Don't store the
generalTierFlag, which is never used after verifying that it is a legal
value here. Don't store the constraint flags, which are never used after
verifying that they are legal values here.
(WebCore::makeOptionalFromPointer): Added to make code below cleaner.
(WebCore::parseDoViCodecType): Renamed from codecStringForDoViCodecType
since it now returns an enumeration value instead of a string. Also
take a StringView instead of a String for greater flexibility and efficiency.
Also use a SortedArrayMap instead of a MemoryCompactLookupOnlyRobinHoodHashMap.
(WebCore::profileIDForAlphabeticDoViProfile): Take a StringView instead of
a String for greater flexibility and efficiency. Use a SortedArrayMap instead
of a MemoryCompactLookupOnlyRobinHoodHashMap.
(WebCore::isValidProfileIDForCodec): Take a codec enumeration value parameter
instead of a string.
(WebCore::parseDoViCodecParameters): Take a StringView instead of a String
for greater flexibility and efficiency. Store the codec as an enumeration
instead of a String. Don't create a temporary String just so we can call the
profileIDForAlphabeticDoViProfile function.
* platform/graphics/HEVCUtilities.h: Renamed HEVCParameterSet and
DoViParameterSet to HEVCParameters and DoViParameters. The word "set" is not
helpful in these names. Removed codecName, generalTierFlag, and constraintFlags
from HEVCParameterSet. Changed the parse functions to take StringView instead
of String. Replaced the string codecName in DoViParameterSet with an enumeration
since there are only a few valid values.
* platform/graphics/cocoa/HEVCUtilitiesCocoa.h: Use Optional return value
instead of a bool and an out argument.
* platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
(WebCore::validateHEVCParameters): Updated to return Optional.
(WebCore::codecType): Updated to take an enumeration value and no longer
need to return an optional. Also renamed from codecTypeForDoViCodecString
since the type now makes this clear without a long function name.
(WebCore::parseStringArrayFromDictionaryToUInt16Vector): Renamed from
CFStringArrayToNumberVector, and moved the dictionary lookup in here.
The old name was a little vague; "NumberVector" doesn't say 16-bit unsigned.
Simplified code by using an Objective-C for loop instead of a block and
enumeration. This cut the size of the function down quite a bit.
(WebCore::validateDoViParameters): Updated to return Optional. Also
refactored to use the imrpoved helper functions above.
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
(WebCore::videoCodecTypeFromRFC4281Type): Take a StringView instead of a String
for greater flexibility and efficiency.
(WebCore::computeMediaCapabilitiesInfo): Factored out this helper function
so we don't have such complicated callback logic. Refactored to use the new
versions of validateHEVCParameters, validateDoViParameters, and
validateVPParameters.
(WebCore::createMediaPlayerDecodingConfigurationCocoa): Moved most of the
code into computeMediaCapabilitiesInfo; this mostly deals with the callback.
* platform/graphics/cocoa/VP9UtilitiesCocoa.h: Removed extraneous use of extern.
Added const for input-only reference arguments. Changed validateVPParameters to
return Optional instead of a bool with an out argument.
* platform/graphics/cocoa/VP9UtilitiesCocoa.mm:
(WebCore::isVP9CodecConfigurationRecordSupported): Added const.
(WebCore::isVP8CodecConfigurationRecordSupported): Ditto.
(WebCore::isVPCodecConfigurationRecordSupported): Ditto.
(WebCore::validateVPParameters): Refactored to return Optional.
* platform/network/HTTPHeaderMap.h: Removed unneeded includes.
* platform/text/LocaleToScriptMapping.cpp: Moved PackedASCIILowerCodes from
here into the SortedArrayMap.h header.
* testing/Internals.cpp:
(WebCore::Internals::parseHEVCCodecParameters): Tweaked since HEVCParameterSet
is now only the correct name here in the Internals class.
(WebCore::Internals::parseDoViCodecParameters): Ditto. Also added code to
expose the codec enumeration as a string. This is now a testing-only thing.
(WebCore::Internals::parseVPCodecParameters): Ditto.
* testing/Internals.h: Tweaked the ParameterSet types since they now don't
exactly match the structures used in the real code.
* testing/Internals.idl: Removed codecName, generalTierFlag, and
constraintFlags from HEVCParameterSet. Neither codecName nor constraintFlags
was used in any test. And the generalTierFlag test was something we can
do without; the parsed value isn't actually used in any WebKit code.
Source/WebKit:
* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
Removed unneeded include.
* Shared/WebsiteData/WebsiteData.h: Ditto.
Source/WTF:
* wtf/SortedArrayMap.h: Moved PackedASCIILowerCodes here for reuse.
Slightly tweaked ComparableASCIISubsetLiteral to match better.
LayoutTests:
* media/hevc-codec-parameters-expected.txt: Remove testing of generalTierFlag, which is ignored
by our actual media code after parsing.
* media/hevc-codec-parameters.html: Ditto.
Canonical link: https://commits.webkit.org/237395@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277093 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-06 16:08:17 +00:00
2021-05-06 Darin Adler <darin@apple.com>
Streamline codec parsing, replacing uses of HashMap with SortedArrayMap
https://bugs.webkit.org/show_bug.cgi?id=225368
Reviewed by Sam Weinig.
* wtf/SortedArrayMap.h: Moved PackedASCIILowerCodes here for reuse.
Slightly tweaked ComparableASCIISubsetLiteral to match better.
Sampled Page Top Color: take additional snapshots further down the page to see if the sampled top color is more than just a tiny strip
https://bugs.webkit.org/show_bug.cgi?id=225323
Reviewed by Beth Dakin.
Source/WebCore:
Add a `SampledPageTopColorMinHeight` setting that controls how far down the sampled page top
color needs to extend in order for us to not bail. If the value > 0, we take an additional
snapshot at (0, SampledPageTopColorMinHeight) and (width, SampledPageTopColorMinHeight),
comparing each to the snapshot directly above (e.g. (0, SampledPageTopColorMinHeight) is
compared to (0, 0)) using the `SampledPageTopColorMaxDifference`. Depending on the value, if
the color across the top of the page is only a small strip, these extra snapshot comparisons
will prevent a resulting color from being derived.
Tests: SampledPageTopColor.VerticalGradientBelowMaxDifference
SampledPageTopColor.VerticalGradientAboveMaxDifference
* dom/Document.cpp:
(WebCore::Document::determineSampledPageTopColor):
Source/WebKit:
Add a `SampledPageTopColorMinHeight` setting that controls how far down the sampled page top
color needs to extend in order for us to not bail. If the value > 0, we take an additional
snapshot at (0, SampledPageTopColorMinHeight) and (width, SampledPageTopColorMinHeight),
comparing each to the snapshot directly above (e.g. (0, SampledPageTopColorMinHeight) is
compared to (0, 0)) using the `SampledPageTopColorMaxDifference`. Depending on the value, if
the color across the top of the page is only a small strip, these extra snapshot comparisons
will prevent a resulting color from being derived.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _setSampledPageTopColorMinHeight:]): Added.
(-[WKWebViewConfiguration _sampledPageTopColorMinHeight]): Added.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setupPageConfiguration:]):
Provide SPI to configure the `SampledPageTopColorMinHeight` preference when creating the `WKWebView`.
Source/WTF:
Add a `SampledPageTopColorMinHeight` setting that controls how far down the sampled page top
color needs to extend in order for us to not bail. If the value > 0, we take an additional
snapshot at (0, SampledPageTopColorMinHeight) and (width, SampledPageTopColorMinHeight),
comparing each to the snapshot directly above (e.g. (0, SampledPageTopColorMinHeight) is
compared to (0, 0)) using the `SampledPageTopColorMaxDifference`. Depending on the value, if
the color across the top of the page is only a small strip, these extra snapshot comparisons
will prevent a resulting color from being derived.
* Scripts/Preferences/WebPreferences.yaml:
Tools:
* TestWebKitAPI/Tests/WebKitCocoa/SampledPageTopColor.mm:
(createWebViewWithSampledPageTopColorMaxDifference):
(createHTMLGradientWithColorStops):
(TEST.SampledPageTopColor.ZeroMaxDifference):
(TEST.SampledPageTopColor.NegativeMaxDifference):
(TEST.SampledPageTopColor.SolidColor):
(TEST.SampledPageTopColor.DifferentColorsWithoutOutlierBelowMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsWithLeftOutlierAboveMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsWithMiddleOutlierAboveMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsWithRightOutlierAboveMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsIndividuallyAboveMaxDifference):
(TEST.SampledPageTopColor.DifferentColorsCumulativelyAboveMaxDifference):
(TEST.SampledPageTopColor.VerticalGradientBelowMaxDifference): Added.
(TEST.SampledPageTopColor.VerticalGradientAboveMaxDifference): Added.
(TEST.SampledPageTopColor.DISABLED_DisplayP3):
(TEST.SampledPageTopColor.ExperimentalUseSampledPageTopColorForScrollAreaBackgroundColor):
Canonical link: https://commits.webkit.org/237343@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-05 18:17:53 +00:00
2021-05-05 Devin Rousso <drousso@apple.com>
Sampled Page Top Color: take additional snapshots further down the page to see if the sampled top color is more than just a tiny strip
https://bugs.webkit.org/show_bug.cgi?id=225323
Reviewed by Beth Dakin.
Add a `SampledPageTopColorMinHeight` setting that controls how far down the sampled page top
color needs to extend in order for us to not bail. If the value > 0, we take an additional
snapshot at (0, SampledPageTopColorMinHeight) and (width, SampledPageTopColorMinHeight),
comparing each to the snapshot directly above (e.g. (0, SampledPageTopColorMinHeight) is
compared to (0, 0)) using the `SampledPageTopColorMaxDifference`. Depending on the value, if
the color across the top of the page is only a small strip, these extra snapshot comparisons
will prevent a resulting color from being derived.
* Scripts/Preferences/WebPreferences.yaml:
2021-05-05 16:36:55 +00:00
2021-05-05 Sam Weinig <weinig@apple.com>
Add preliminary support for specifying a color space for 2D canvas
https://bugs.webkit.org/show_bug.cgi?id=225286
Reviewed by Dean Jackson.
Add new experimental feature, CanvasColorSpaceEnabled, which blocks
access to the new ability to specify color spaces for 2D canvas.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-05-04 18:51:25 +00:00
2021-05-04 Alex Christensen <achristensen@webkit.org>
Don't iterate NetworkProcessProxy::m_websiteDataStores
https://bugs.webkit.org/show_bug.cgi?id=225337
<rdar://77233103>
Reviewed by Geoffrey Garen.
* wtf/Vector.h:
(WTF::copyToVectorOf):
Use a universal reference instead of const&.
* wtf/WeakHashSet.h:
WeakHashSet iteration returns T&, and we need this instead of WeakPtr<T> to be able to return a Ref from a map function.
2021-05-04 17:14:36 +00:00
2021-05-04 Chris Dumez <cdumez@apple.com>
Drop std::filesystem logic in PlatformJSCOnly.cmake
https://bugs.webkit.org/show_bug.cgi?id=225355
Reviewed by Alex Christensen.
Drop std::filesystem logic in PlatformJSCOnly.cmake as it is no longer needed after r276946.
* wtf/PlatformJSCOnly.cmake:
2021-05-04 06:33:52 +00:00
2021-05-03 Kimmo Kinnunen <kkinnunen@apple.com>
[GPUP] Move GPUProcess WebGL to Experimental Feature
https://bugs.webkit.org/show_bug.cgi?id=222836
rdar://75048190
Reviewed by Brent Fulgham.
Move the setting for WebGL in GPU process
to experimental features but disable it by default,
even on layout tests.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-05-04 05:25:54 +00:00
2021-05-03 Lauro Moura <lmoura@igalia.com>
REGRESSION(r276879) Add libstdc++fs to wtf libraries when using experimental fs headers
https://bugs.webkit.org/show_bug.cgi?id=225341
Reviewed by Chris Dumez.
After r276879, Filesystem.cpp uses std::filesystem directly. So,
expose the need for stdc++fs like was done in r268708 when std::fs was
used in WTR.
* wtf/CMakeLists.txt:
2021-05-03 23:53:22 +00:00
2021-05-03 Chris Dumez <cdumez@apple.com>
Restore pre-r276879 behavior for FileSystem::moveFile()
https://bugs.webkit.org/show_bug.cgi?id=225307
Reviewed by Sam Weinig.
Update FileSystem::moveFile() so that it now supports again moving a file across different
volumes by copying the file over and then deleting the source file.
I have verified locally that the function is now able to move a file to a different volumes.
Sadly, I don't think having an API test is feasible here as it requires pre-determined
volumes to be available.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::moveFile):
2021-05-03 21:24:44 +00:00
2021-05-03 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix JSCOnly build with recent clang after r276879
https://bugs.webkit.org/show_bug.cgi?id=225327
* wtf/PlatformJSCOnly.cmake:
2021-05-03 17:28:41 +00:00
2021-05-03 Diego Pino Garcia <dpino@igalia.com>
[GLIB] REGRESSION(r276879): Several tests are crashing or failing
https://bugs.webkit.org/show_bug.cgi?id=225292
Reviewed by Carlos Alberto Lopez Perez.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fileIsDirectory): Return false if path is empty.
2021-05-03 17:23:25 +00:00
2021-05-03 Chris Dumez <cdumez@apple.com>
Restore pre-r276879 behavior for FileSystem::deleteFile() and FileSystem::deleteEmptyDirectory()
https://bugs.webkit.org/show_bug.cgi?id=225289
Reviewed by Darin Adler.
Restore pre-r276879 behavior for FileSystem::deleteFile() and FileSystem::deleteEmptyDirectory() to
reduce the risk of regressions. In particular, calling FileSystem::deleteFile() on an empty directory
now fails and calling FileSystem::deleteEmptyDirectory() on a non-directory now fails.
I have also gotten rid of the macOS-specific implementation of deleteEmptyDirectory() and merged the
needed behavior (Dealing with .DS_Store files) to the generic function.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::deleteEmptyDirectory):
* wtf/mac/FileSystemMac.mm:
(WTF::FileSystem::deleteEmptyDirectory): Deleted.
2021-05-02 19:01:51 +00:00
2021-05-02 Sam Weinig <weinig@apple.com>
Add support for DestinationColorSpace::DisplayP3 in preparation for DisplayP3 canvas
https://bugs.webkit.org/show_bug.cgi?id=225280
Reviewed by Anders Carlsson.
Add new ENABLE_DESTINATION_COLOR_SPACE_DISPLAY_P3 macro to declare which ports
support P3 backing stores. Currently, only the Apple/Cocoa ports support it.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
2021-05-02 03:09:34 +00:00
2021-04-30 Darin Adler <darin@apple.com>
Use SortedArrayMap in a few more places
https://bugs.webkit.org/show_bug.cgi?id=225251
Reviewed by Sam Weinig.
* wtf/SortedArrayMap.h: Added support for types that don't have a parse member function.
* wtf/cocoa/MainThreadCocoa.mm: Removed unneeded includes.
* wtf/text/AtomStringImpl.cpp: Ditto.
* wtf/text/AtomStringTable.cpp: Ditto.
2021-05-02 02:36:14 +00:00
2021-05-01 Chris Dumez <cdumez@apple.com>
Start leveraging std::filesystem in WTF::FileSystem
https://bugs.webkit.org/show_bug.cgi?id=225255
Reviewed by Sam Weinig.
Start leveraging std::filesystem in WTF::FileSystem to reduce the amount of
platform-specific code.
* WTF.xcodeproj/project.pbxproj:
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::fileExists):
(WTF::FileSystemImpl::deleteFile):
(WTF::FileSystemImpl::deleteEmptyDirectory):
(WTF::FileSystemImpl::moveFile):
(WTF::FileSystemImpl::getFileSize):
(WTF::FileSystemImpl::fileIsDirectory):
(WTF::FileSystemImpl::makeAllDirectories):
(WTF::FileSystemImpl::getVolumeFreeSpace):
(WTF::FileSystemImpl::createSymbolicLink):
(WTF::FileSystemImpl::hardLink):
(WTF::FileSystemImpl::hardLinkOrCopyFile):
(WTF::FileSystemImpl::deleteNonEmptyDirectory):
* wtf/FileSystem.h:
* wtf/cocoa/FileSystemCocoa.mm:
(WTF::FileSystemImpl::createTemporaryDirectory):
* wtf/glib/FileSystemGlib.cpp:
* wtf/posix/FileSystemPOSIX.cpp:
* wtf/win/FileSystemWin.cpp:
* wtf/PlatformJSCOnly.cmake:
GNU implementation prior to 9.1 requires linking with -lstdc++fs and LLVM implementation
prior to LLVM 9.0 requires linking with -lc++fs.
* wtf/StdFilesystem.cpp: Removed.
* wtf/StdFilesystem.h:
Drop our own copy of std::filesystem as all the operating system we support now have
support for this.
2021-05-01 18:06:08 +00:00
2021-05-01 Sam Weinig <weinig@apple.com>
Make destination color space enumeration match supported destination color spaces for the port
https://bugs.webkit.org/show_bug.cgi?id=225237
Reviewed by Simon Fraser.
Add ENABLE_DESTINATION_COLOR_SPACE_LINEAR_SRGB and enabled it for all ports
except the Apple Windows port, which is the only one doesn't have any support
for it.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
* wtf/PlatformEnableWinApple.h:
2021-04-30 16:02:52 +00:00
2021-04-30 Darin Adler <darin@apple.com>
Optimize SortedArrayMap by using linear search for small arrays
https://bugs.webkit.org/show_bug.cgi?id=225223
Reviewed by Yusuke Suzuki.
* wtf/SortedArrayMap.h: Added a base class SortedArrayBase that contains a constant
for the cutoff between linear and binary search. Based on a quick empirical test,
it seems faster to do linear search for arrays that have less then 20 elements.
While doing this also switched from tryBinarySearch to std::find/find_if/lower_bound
because the standard library function templates should be excellent for this purpose,
and there's no reason to use our own. Also filled out the operations for the
ComparableASCIILiteral family so that the "<" operator works in either direction,
since that's needed for compatibility with standard library algorithms.
2021-04-29 19:01:53 +00:00
2021-04-29 Ben Nham <nham@apple.com>
Reduce memory footprint for background tabs
https://bugs.webkit.org/show_bug.cgi?id=225007
Reviewed by Chris Dumez.
Add an option to slim background tabs by proactively calling WebCore::releaseMemory on Macs.
* wtf/PlatformEnableCocoa.h:
Extend SortedArrayMap further to work on case-folded strings, use in MIMETypeRegistry
https://bugs.webkit.org/show_bug.cgi?id=224968
Reviewed by Sam Weinig.
Source/WebCore:
Using fewer HashSet in MIMETypeRegistry saves code size and reduces memory use.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::supportedImageMIMETypes): Deleted. Replaced
this function with a constexpr array, eliminating the use of HashSet.
(WebCore::makeFixedVector): Added. Helper function used below for the repeated patttern
of converting a constexpr array into a FixedVector<const char*>.
(WebCore::supportedJavaScriptMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::supportedNonImageMIMETypes): Update since
supportedJavaScriptMIMETypeArray is now an array, not a HashSet.
(WebCore::MIMETypeRegistry::pdfMIMETypes): Rewrote to return a FixedVector<const char*>
instead of a HashSet. The only caller makes an NSArray<NSString *>, so there is no need
to involve a hash table or a WTF::String.
(WebCore::MIMETypeRegistry::unsupportedTextMIMETypes): Ditto.
(WebCore::commonMediaTypes): Deleted, merging into the function below.
(WebCore::commonMimeTypesMap): Moved the commonMediaTypes data in here
and use a constexpr array instead of an initializer_list.
(WebCore::MIMETypeRegistry::isSupportedImageMIMEType): Use SortedArraySet
instead of a HashSet for the core supported images types. Moved the code
that checks this against defaultSupportedImageTypes here.
(WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType): Use SortedArraySet.
(WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType): Ditto.
(WebCore::MIMETypeRegistry::isPDFMIMEType): Ditto.
(WebCore::MIMETypeRegistry::isPostScriptMIMEType): Use equalLettersIgnoringASCIICase.
For some reason this was the single case-sensitive function in this whole class!
(WebCore::MIMETypeRegistry::isSystemPreviewMIMEType): Use SortedArraySet.
(WebCore::MIMETypeRegistry::systemPreviewMIMETypes): Return a FixedVector.
(WebCore::normalizedImageMIMEType): Renamed this from its old name,
MIMETypeRegistry::normalizedMIMEType, to better reflect that it's only used in
one place. Also added comments to clarify that it's CURL-only and suggest it be
removed eventually.
* platform/MIMETypeRegistry.h: Changed supportedImageMIMETypes, pdfMIMETypes,
unsupportedTextMIMETypes, and systemPreviewMIMETypes to return FixedVector instead
of HashSet. Also removed normalizedMIMEType.
* svg/SVGTransformValue.h: Removed unneeded include of HashMap.h.
* testing/TypeConversions.h: Ditto.
Source/WebKit:
* UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _isDisplayingPDF]): Updated since MIMETypeRegistry::pdfMIMETypes
returns a different type.
* UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
(-[WKWebViewContentProviderRegistry initWithConfiguration:]): Updated since
MIMETypeRegistry::systemPreviewMIMETypes returns a different type.
Source/WebKitLegacy/mac:
* WebView/WebHTMLRepresentation.mm:
(createNSArray): Renamed from newArrayWithStrings so this overloads the createNSArray
function from VectorCocoa.h so we can use the two interchangably and handle both FixedVector
and HashSet with the smae code.
(+[WebHTMLRepresentation supportedMediaMIMETypes]): Updated for name change.
(+[WebHTMLRepresentation supportedNonImageMIMETypes]): Ditto.
(+[WebHTMLRepresentation supportedImageMIMETypes]): Ditto.
(+[WebHTMLRepresentation unsupportedTextMIMETypes]): Ditto.
Source/WTF:
* wtf/ASCIICType.h: Make most functions constexpr.
* wtf/Forward.h: Added FixedVector.
* wtf/SortedArrayMap.h: Added SortedArraySet. Added ComparableCaseFoldingASCIILiteral
and ComparableLettersLiteral, using a template shared with ComparableASCIILiteral.
* wtf/StdLibExtras.h: Added isSortedConstExpr and allOfConstExpr.
Tools:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added SortedArrayMap.cpp,
and removed references to non-existent FullscreenRemoveNodeBeforeEnter.h and
FloatQuadTests.h.
* TestWebKitAPI/Tests/WTF/SortedArrayMap.cpp: Added.
Canonical link: https://commits.webkit.org/237163@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-29 16:39:55 +00:00
2021-04-29 Darin Adler <darin@apple.com>
Extend SortedArrayMap further to work on case-folded strings, use in MIMETypeRegistry
https://bugs.webkit.org/show_bug.cgi?id=224968
Reviewed by Sam Weinig.
* wtf/ASCIICType.h: Make most functions constexpr.
* wtf/Forward.h: Added FixedVector.
* wtf/SortedArrayMap.h: Added SortedArraySet. Added ComparableCaseFoldingASCIILiteral
and ComparableLettersLiteral, using a template shared with ComparableASCIILiteral.
* wtf/StdLibExtras.h: Added isSortedConstExpr and allOfConstExpr.
2021-04-29 16:26:38 +00:00
2021-04-29 Ben Nham <nham@apple.com>
Unreviewed, reverting r276619.
Causes multiple regressions on perf bots.
Reverted changeset:
"Reduce memory footprint for background tabs"
https://bugs.webkit.org/show_bug.cgi?id=225007
https://commits.webkit.org/r276619
2021-04-29 00:51:46 +00:00
2021-04-28 Devin Rousso <drousso@apple.com>
experiment with averaging sampling colors across the top of the page as the scroll area background
https://bugs.webkit.org/show_bug.cgi?id=224987
<rdar://problem/76251889>
Reviewed by Darin Adler.
* Scripts/Preferences/WebPreferences.yaml:
Add a `SampledPageTopColorMaxDifference` setting that controls both whether or not to sample
colors from the top of the page (only if value > 0) and the max Lab color difference allowed
across all samples.
* Scripts/Preferences/WebPreferencesInternal.yaml:
Add a `UseSampledPageTopColorForScrollAreaBackgroundColor` internal setting that controls
whether the sampled page top color can be used as the overscroll area background color.
2021-04-29 00:17:49 +00:00
2021-04-28 Kate Cheney <katherine_cheney@apple.com>
Disable App Bound Requests on macOS
https://bugs.webkit.org/show_bug.cgi?id=225155
<rdar://problem/77288787>
App-bound requests is causing potential performance issues on macOS.
We should disable it while we investigate further.
Reviewed by Brent Fulgham.
* wtf/PlatformEnableCocoa.h:
2021-04-28 23:22:18 +00:00
2021-04-28 Basuke Suzuki <basuke.suzuki@sony.com>
Suppress warnings for %{private}s format specifier
https://bugs.webkit.org/show_bug.cgi?id=225137
Reviewed by Alex Christensen.
Add PRIVATE_LOG_STRING macro which is defined depending on if
os_log() is used or rather old printf().
See also: https://bugs.webkit.org/show_bug.cgi?id=207478
* wtf/Assertions.h:
2021-04-28 17:19:32 +00:00
2021-04-28 Alex Christensen <achristensen@webkit.org>
Remove support for NPAPI plugins in WebView
https://bugs.webkit.org/show_bug.cgi?id=224449
Reviewed by Geoffrey Garen.
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-04-28 15:44:02 +00:00
2021-04-28 Chris Dumez <cdumez@apple.com>
Drop ModernUnprefixedWebAudio & AudioWorklet experimental feature flags
https://bugs.webkit.org/show_bug.cgi?id=225130
Reviewed by Eric Carlson.
Drop ModernUnprefixedWebAudio & AudioWorklet experimental feature flags now that
these features have shipped. It also doesn't make sense to disable them given
that the prefixed WebAudio API is no longer exposed and there is no feature flag
to turn the legacy prefixed API back on.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-04-28 13:30:15 +00:00
2021-04-28 Kimmo Kinnunen <kkinnunen@apple.com>
Asserting that function or variable is accessed in a certain thread should be simpler and more robust
https://bugs.webkit.org/show_bug.cgi?id=224971
Reviewed by Darin Adler.
Adds support for more fine-grained thread assertion than
ASSERT(isMainThread()) / ASSERT(!isMainThread())
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Compiler.h:
Add NO_UNIQUE_ADDRESS which can be used to declare members that are empty in
RELEASE builds. The declaration avoids increasing the size of the enclosing type.
This should be used with ThreadAssertion:
class MyThreadAware {
....
NO_UNIQUE_ADDRESS ThreadAssertion m_ownerThread;
};
* wtf/ThreadAssertions.h: Added.
Add ThreadAssertion class that can be held as a member of a type.
This allows consistent assertions that the code in the type
runs in the expected thread.
Add NamedAssertion& WTF::mainThread.
Add NamedAssertion& WTF::mainRunLoop.
These are only to be used in thread safety analysis phase. These are undefined
symbols, it is an error to reference them.
Adds functions assertIsMainThread() and assertIsMainRunLoop() to replace
patterns of ASSERT(isMainThread()), ASSERT(isMainRunLoop().
In addition to behaving as the direct ASSERT behaves, the functions
enable compile-time thread safety analysis to know that the calling
scope has the assertions. These can be optionally then used in the
function and member signatures to require the assertions.
[WPE][GTK] More correct fixes for stack size issues on musl libc
https://bugs.webkit.org/show_bug.cgi?id=225099
Patch by Daniel Kolesa <dkolesa@igalia.com> on 2021-04-28
Reviewed by Adrian Perez de Castro.
Partial revert https://bugs.webkit.org/show_bug.cgi?id=210068
Source/JavaScriptCore:
After fixing the thread stack issues in WTF properly, we can revert
the JSC options changes, which are actually harmful since they result
in JSC being unstable. Previously, softReservedZoneSize was causing a
crash when set to 128K because of the main thread stack bounds, and
this is now fixed. We can keep the maxPerThreadStackUsage at 5M as
well; there is no fundamental difference from how things are done on
glibc anymore.
* runtime/OptionsList.h:
Source/WTF:
While the changes in r236306 stopped JSC from crashing outright,
they are not correct, since they also make it rather unstable.
To counter this, increase stack size for threads on Linux with
non-glibc/bionic libcs to 1 megabyte, which is a robust enough
value that should always be sufficient.
While at it, the previous approach to musl thread stack size was
breaking use of DEFAULT_THREAD_STACK_SIZE_IN_KB (if defined) as
well as not properly taking care of the unused parameter. Move
the code to a more appropriate place, which solves these problems.
All this is however not enough, since there is still the main thread;
using pthread_attr_getstack on a main thread is not reliable since main
thread stacks are allowed to grow, and we expect the bounds to always
be constant. On glibc, this already behaved right, but e.g. on musl
(and possibly other C libraries) this is not necessarily the case - at
the point of the check, it was returning 128k (since that's the initial
size reserved by the kernel). Therefore, do the same thing as on Darwin
and use process resource limits to get the boundary on Linux as well.
This results in JavaScriptCore behaving correctly on musl libc and
allows us to drop the options special-casing that was in place.
* wtf/StackBounds.cpp:
(WTF::StackBounds::currentThreadStackBoundsInternal):
* wtf/Threading.cpp:
(WTF::stackSize):
Canonical link: https://commits.webkit.org/237109@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-28 07:36:48 +00:00
2021-04-28 Daniel Kolesa <dkolesa@igalia.com>
[WPE][GTK] More correct fixes for stack size issues on musl libc
https://bugs.webkit.org/show_bug.cgi?id=225099
Reviewed by Adrian Perez de Castro.
Partial revert https://bugs.webkit.org/show_bug.cgi?id=210068
While the changes in r236306 stopped JSC from crashing outright,
they are not correct, since they also make it rather unstable.
To counter this, increase stack size for threads on Linux with
non-glibc/bionic libcs to 1 megabyte, which is a robust enough
value that should always be sufficient.
While at it, the previous approach to musl thread stack size was
breaking use of DEFAULT_THREAD_STACK_SIZE_IN_KB (if defined) as
well as not properly taking care of the unused parameter. Move
the code to a more appropriate place, which solves these problems.
All this is however not enough, since there is still the main thread;
using pthread_attr_getstack on a main thread is not reliable since main
thread stacks are allowed to grow, and we expect the bounds to always
be constant. On glibc, this already behaved right, but e.g. on musl
(and possibly other C libraries) this is not necessarily the case - at
the point of the check, it was returning 128k (since that's the initial
size reserved by the kernel). Therefore, do the same thing as on Darwin
and use process resource limits to get the boundary on Linux as well.
This results in JavaScriptCore behaving correctly on musl libc and
allows us to drop the options special-casing that was in place.
* wtf/StackBounds.cpp:
(WTF::StackBounds::currentThreadStackBoundsInternal):
* wtf/Threading.cpp:
(WTF::stackSize):
2021-04-28 06:26:12 +00:00
2021-04-27 Kimmo Kinnunen <kkinnunen@apple.com>
Add a Condition type that supports thread safety analysis
https://bugs.webkit.org/show_bug.cgi?id=224970
Reviewed by Darin Adler.
Add CheckedCondition, a condition variable to be used with CheckedLock.
Use thread safety analysis annotations for CheckedCondition.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CheckedCondition.h: Added.
* wtf/CheckedLock.h:
2021-04-28 00:18:19 +00:00
2021-04-27 Ben Nham <nham@apple.com>
Memory pressure events should be logged to com.apple.WebKit subsystem
https://bugs.webkit.org/show_bug.cgi?id=225112
Reviewed by Chris Dumez.
Currently memory pressure events are logged to the default os_log subsystem instead of the
com.apple.WebKit subsystem. This makes it hard to capture such events using common logging
prefs (e.g. a pref that persists all logs from the WebKit subsystem).
To fix this, call WTFInitializeLogChannelStatesFromString at init time. This associates the
WTFLogChannel with an os_log object that sends the messages to the WebKit subsystem.
* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::singleton):
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
2021-04-27 18:52:48 +00:00
2021-04-27 Alex Christensen <achristensen@webkit.org>
Unreviewed, reverting r275912.
rdar://77179042
Broke internal client
Reverted changeset:
"Remove support for NPAPI plugins in WebView"
https://bugs.webkit.org/show_bug.cgi?id=224449
https://commits.webkit.org/r275912
2021-04-26 23:42:01 +00:00
2021-04-26 Ben Nham <nham@apple.com>
Reduce memory footprint for background tabs
https://bugs.webkit.org/show_bug.cgi?id=225007
Reviewed by Chris Dumez.
When a WebContent process contains only non-visible pages (e.g. if it is a background tab),
we should attempt to reduce our memory footprint after some time interval to help relieve
system-wide memory pressure. This is enabled only on Mac because iOS already does something
similar just before WebContent suspends.
* wtf/PlatformEnableCocoa.h:
2021-04-26 20:22:35 +00:00
2021-04-26 Keith Miller <keith_miller@apple.com>
CodeBlock should do a better job accounting for extra memory it allocates.
https://bugs.webkit.org/show_bug.cgi?id=225068
Reviewed by Mark Lam.
Small convenience function to help compute the memory used by a Bag for JS GC
accounting.
* wtf/Bag.h:
2021-04-26 09:04:01 +00:00
2021-04-26 Angelos Oikonomopoulos <angelos@igalia.com>
Bump CeilingOnPageSize to 16KB on MIPS
https://bugs.webkit.org/show_bug.cgi?id=225030
Reviewed by Michael Catanzaro.
* wtf/PageBlock.h:
2021-04-25 22:59:03 +00:00
2021-04-25 Darin Adler <darin@apple.com>
Fix handling of overflow of /= and *= operators with double over Checked<uint64_t> and other 64-bit types.
https://bugs.webkit.org/show_bug.cgi?id=224835
Reviewed by Chris Dumez.
* wtf/CheckedArithmetic.h: Since it is quite difficult to write correct implementations of the
operations where we multiply or divide a checked integer by a floating point number, deleted
those functions, which were barely used. Also corrected return types of various member functions,
which were unconventional "const Type", replacing them with the conventional "Type" for functions
that return a distinct value, "Type&" for assignment operators, and bool for relational operators.
2021-04-25 21:45:51 +00:00
2021-04-25 Devin Rousso <drousso@apple.com>
Add `ALWAYS_LOG_WITH_STREAM` macro for easier development/debugging
https://bugs.webkit.org/show_bug.cgi?id=224959
Reviewed by Darin Adler.
It's often very helpful to use existing `operator<<` defined on objects, but annoying to
have to copypaste the boilerplate code that creates a `WTF::TextStream` and uses it in a
`WTFLogAlways` or wait for a debug build to enable existing `LOG_WITH_STREAM`.
* wtf/Assertions.h:
(LOG_WITH_STREAM): Moved from `Source/WebCore/pal/LogMacros.h`.
(ALWAYS_LOG_WITH_STREAM): Added.
Add `ALWAYS_LOG_WITH_STREAM` so that one change existing `LOG` when debugging with minimal
friction. As an example, many times I've wished I could've just changed
```
LOG_WITH_STREAM(Channel, stream << node);
```
to something like
```
ALWAYS_LOG_WITH_STREAM(stream << node);
```
and avoid having to modify the surrounding code too much.
Remove decoder memory allocations based on untrusted data (sizes) in the stream; related changes
https://bugs.webkit.org/show_bug.cgi?id=224984
Reviewed by Sam Weinig.
Source/WebCore:
* platform/network/cf/CertificateInfoCFNet.cpp:
(WTF::Persistence::decodeCFData): Removed unneeded check for zero size. Removed code that
locally allocates a vector before bufferIsLargeEnoughToContain is called. Instead use
bufferPointerForDirectRead, which makes does the buffer size check, and pass the pointer
directly to CFDataCreate.
Source/WebKit:
* Platform/IPC/ArgumentCoders.h: Remove the calls to
HashMap::reserveInitialCapacity and HashSet::reserveInitialCapacity, based
on number read in from the decoder. This means there will be more wasted
memory in these HashMap and HashSet objects, so we have to test to make
sure this does not create a performance problem. But without this check,
we are trying to allocate memory based on an unstrusted size.
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<RefPtr<ApplePayError>>::encode): Removed the coder
for a Vector of these RefPtr, replaced it with a coder for an individual one,
allowing the Vector ArgumentCoder template to handle vector size and construction.
One benefit is that this adds in a shrinkToFit and prevents us from making any
separate mistake about pre-sizing the Vector here since we use shared code.
(IPC::ArgumentCoder<RefPtr<ApplePayError>>::decode): Ditto.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<RefPtr<SecurityOrigin>>::encode): Ditto.
(IPC::ArgumentCoder<RefPtr<SecurityOrigin>>::decode): Ditto.
(IPC::ArgumentCoder<WebCore::CDMInstanceSession::KeyStatusVector>::encode):
(IPC::ArgumentCoder<WebCore::CDMInstanceSession::KeyStatusVector>::decode):
Removed unnecessary specialization for the KeyStatusVector. There is already
an ArgumentCoder for Vector, for std::pair, for Ref<SharedBuffer>, and for
enumerations like CDMKeyStatus, so there's no need to have a specialized
coder for this. This function that we are removing had a call to
reserveInitialCapacity, but the Vector ArgumentCoder template does not.
* Shared/WebCoreArgumentCoders.h: Replaced the
ArgumentCoder<Vector<RefPtr<WebCore::ApplePayError>>> specialization with
ArgumentCoder<RefPtr<WebCore::ApplePayError>>. Removed the
ArgumentCoder<WebCore::CDMInstanceSession::KeyStatusVector> specialization.
Source/WTF:
* wtf/persistence/PersistentDecoder.cpp:
(WTF::Persistence::Decoder::bufferPointerForDirectRead): Added.
(WTF::Persistence::Decoder::decodeFixedLengthData): Refactor to use bufferPointerForDirectRead.
* wtf/persistence/PersistentDecoder.h: Added bufferPointerForDirectRead function for use in the
rare cases where we want to read directly out of the decoder buffer, rather than writing to a
passed-in pointer. Also did a small refactoring of bufferIsLargeEnoughToContain to use &&
rather than an if statement.
Canonical link: https://commits.webkit.org/236967@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-23 19:06:25 +00:00
2021-04-23 Darin Adler <darin@apple.com>
Remove decoder memory allocations based on untrusted data (sizes) in the stream; related changes
https://bugs.webkit.org/show_bug.cgi?id=224984
Reviewed by Sam Weinig.
* wtf/persistence/PersistentDecoder.cpp:
(WTF::Persistence::Decoder::bufferPointerForDirectRead): Added.
(WTF::Persistence::Decoder::decodeFixedLengthData): Refactor to use bufferPointerForDirectRead.
* wtf/persistence/PersistentDecoder.h: Added bufferPointerForDirectRead function for use in the
rare cases where we want to read directly out of the decoder buffer, rather than writing to a
passed-in pointer. Also did a small refactoring of bufferIsLargeEnoughToContain to use &&
rather than an if statement.
2021-04-23 17:44:03 +00:00
2021-04-23 Chris Dumez <cdumez@apple.com>
Disable GPUProcess on shipping iOS
https://bugs.webkit.org/show_bug.cgi?id=224897
Reviewed by Eric Carlson.
* wtf/PlatformEnableCocoa.h:
2021-04-23 05:06:43 +00:00
2021-04-22 Lauro Moura <lmoura@igalia.com>
[WTF] Undefined behavior warning in StringBuilder::allocateBuffer
https://bugs.webkit.org/show_bug.cgi?id=224942
Reviewed by Chris Dumez.
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::allocateBuffer): Add check before calling memcpy
2021-04-22 22:33:20 +00:00
2021-04-22 Simon Fraser <simon.fraser@apple.com>
Add trace points for WKWebView snapshotting
https://bugs.webkit.org/show_bug.cgi?id=224943
Reviewed by Tim Horton.
New snapshot values.
* wtf/SystemTracing.h:
2021-04-22 18:09:53 +00:00
2021-04-22 Martin Robinson <mrobinson@webkit.org>
[GTK] Turn on editable <input type=date> and <input type=time> fields
https://bugs.webkit.org/show_bug.cgi?id=224921
Reviewed by Carlos Garcia Campos.
Turn on editable date and time inputs for GTK.
* Scripts/Preferences/WebPreferencesInternal.yaml: Set editable date/time inputs
on by default for GTK as well.
2021-04-22 18:05:23 +00:00
2021-04-22 Aditya Keerthi <akeerthi@apple.com>
Fix the tvOS build after r276325
https://bugs.webkit.org/show_bug.cgi?id=224929
<rdar://problem/77003408>
Reviewed by Wenson Hsieh.
Fix the tvOS build after r276325
* wtf/PlatformHave.h:
2021-04-21 22:59:11 +00:00
2021-04-21 Aditya Keerthi <akeerthi@apple.com>
[iOS] Fix internal builds after r276325
https://bugs.webkit.org/show_bug.cgi?id=224896
Reviewed by Tim Horton.
* wtf/PlatformHave.h:
2021-04-21 19:08:46 +00:00
2021-04-21 Martin Robinson <mrobinson@igalia.com>
Enable CSS Scroll Snap by default
https://bugs.webkit.org/show_bug.cgi?id=224867
Reviewed by Don Olmstead.
* wtf/PlatformEnable.h: Move the preprocessor enabling of scroll snap here.
* wtf/PlatformEnableCocoa.h: Move it from here.
2021-04-21 15:00:38 +00:00
2021-04-21 Simon Fraser <simon.fraser@apple.com>
Enhance scrolling-related trace points
https://bugs.webkit.org/show_bug.cgi?id=224852
Reviewed by Tim Horton.
One new trace point, and some argument descriptors.
* wtf/SystemTracing.h:
2021-04-21 01:05:30 +00:00
2021-04-20 Brent Fulgham <bfulgham@apple.com>
[Cocoa] Prevent GPU and WebContent processes from attempting to connect to the AppSSO service
https://bugs.webkit.org/show_bug.cgi?id=224834
<rdar://problem/72157514>
Reviewed by Jiewen Tan.
* wtf/PlatformHave.h:
2021-04-21 00:48:09 +00:00
2021-04-20 Eric Carlson <eric.carlson@apple.com>
[Cocoa] Enable MediaSession and MediaSessionCoordinator experimental features
https://bugs.webkit.org/show_bug.cgi?id=224822
<rdar://problem/76908014>
Reviewed by Jer Noble.
* Scripts/Preferences/WebPreferencesExperimental.yaml: Change the defaults for
MediaSessionCoordinatorEnabled and MediaSessionEnabled to true.
2021-04-21 00:08:15 +00:00
2021-04-20 Michael Catanzaro <mcatanzaro@gnome.org>
Lots of spurious -Wnonnull warnings with GCC 11
https://bugs.webkit.org/show_bug.cgi?id=224452
Reviewed by Darin Adler.
* wtf/RefPtr.h:
(WTF::DefaultRefDerefTraits::derefIfNotNull):
2021-04-20 22:42:05 +00:00
2021-04-20 Keith Miller <keith_miller@apple.com>
FullGCActivityCallback should use the percentage of pages uncompressed in RAM to determine deferral.
https://bugs.webkit.org/show_bug.cgi?id=224817
Reviewed by Filip Pizlo.
Add a noexcept flavor of FunctionTraits. On Linux mincore (and probably other syscalls) are marked noexcept so the existing overloads don't work.
* wtf/FunctionTraits.h:
2021-04-20 15:45:09 +00:00
2021-04-20 Chris Dumez <cdumez@apple.com>
Make sure we don't exit the GPUProcess too frequently while under memory pressure
https://bugs.webkit.org/show_bug.cgi?id=224798
Reviewed by Darin Adler.
Add member function to the MemoryPressureHandler to indicate if we're currently simulating memory
pressure or not.
* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::isSimulatingMemoryPressure const):
2021-04-20 14:48:06 +00:00
2021-04-19 Darin Adler <darin@apple.com>
Refactor sorted array mapping machinery in LocaleToScriptMapping.cpp for reuse elsewhere
https://bugs.webkit.org/show_bug.cgi?id=224733
Reviewed by Yusuke Suzuki.
* WTF.xcodeproj/project.pbxproj: Added SortedArrayMap.h.
* wtf/CMakeLists.txt: Ditto.
* wtf/SortedArrayMap.h: Added. Builds on the idiom in LocalToScriptMapping, and to be
generic uses std::pair instead of custom structures. Includes the ComparableASCIILiteral
structure for maps that are keyed by case-sensitive ASCII strings.
* wtf/StdLibExtras.h:
(WTF::binarySearchImpl): Use auto in one place to make this a bit more generic.
2021-04-19 13:12:23 +00:00
2021-04-19 Kimmo Kinnunen <kkinnunen@apple.com>
Enable -Wthread-safety, add attributes to custom lock classes, and provide macros to declare guards
https://bugs.webkit.org/show_bug.cgi?id=221614
<rdar://problem/74396781>
Reviewed by David Kilzer.
Implement rudimentary support for clang thread safety analysis.
The added macros can be used to declare which member variables or
global variables are locked by which mutexes. The compiler will
check statically that the mutexes are held correctly. The checking
is intra procedural, not global.
* Configurations/Base.xcconfig:
Add -Wthread-safety to compile flags.
* wtf/CheckedLock.h: Added.
Add CheckedLock, a Lock variant that is amenable to static
analysis.
Add a Locker specialization for CheckedLock that is amenable to
static analysis.
Locker<CheckedLock> is a std::scoped_lock. The scoped_lock cannot be aliased,
since it appears that (Apple's) libcxx is not compiled with thread safety
analysis support enabled by default.
New types are needed due Locker move constructor and conditional locking.
The Locker has default usage pattern of:
auto locker = holdLock(m_lock);
This forces dynamism that removes the possibility of simple statical
analysis that thread safety analysis capabilities "mutex" and "scoped_lock"
currently implement. Most likely large fraction of call sites is due to historical
lack of CTAD and as such can be converted to less general form.
Once the pattern is not used by default, CheckedLock can be deleted
and the move dynamism bits of Locker can be moved to some more specific type
("UncheckedLocker").
* wtf/ThreadSafetyAnalysis.h: Added.
Add macro wrappers around clang "mutex" and "scoped_lock" capability attributes.
2021-04-17 20:07:30 +00:00
2021-04-17 Sam Weinig <weinig@apple.com>
Move RuntimeEnabledFeatures to Settings (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=224440
Reviewed by Alex Christensen.
Move a few RuntimeEnabledFeatures to Settings to consolidate settings
in one object and removes the need for additional boilerplate. This
is now possible as Settings are now accessible in workers.
Moves PeerConnectionEnabled, WebGLUsingMetal, WebGL2Enabled, WebGPUEnabled
and MaskWebGLStringsEnabled.
* Scripts/Preferences/WebPreferences.yaml:
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-04-16 22:50:31 +00:00
2021-04-16 Kate Cheney <katherine_cheney@apple.com>
Disable app-bound request API tests on specific OS versions
https://bugs.webkit.org/show_bug.cgi?id=223692
<rdar://problem/75787288>
Reviewed by Brent Fulgham.
* wtf/PlatformEnableCocoa.h:
2021-04-16 20:41:08 +00:00
2021-04-16 Alex Christensen <achristensen@webkit.org>
Disable ApplicationCache with linkedOnOrAfter check
https://bugs.webkit.org/show_bug.cgi?id=224629
Reviewed by Brady Eidson.
* Scripts/Preferences/WebPreferences.yaml:
2021-04-16 19:22:56 +00:00
2021-04-16 Alex Christensen <achristensen@webkit.org>
Reduce maximum HashTable entry size to 128 bytes
https://bugs.webkit.org/show_bug.cgi?id=224381
Reviewed by Yusuke Suzuki.
* wtf/HashTable.h:
(WTF::KeyTraits>::inlineLookup):
[css-counter-styles] Parse and add feature flag for @counter-style
https://bugs.webkit.org/show_bug.cgi?id=223150
Patch by Tyler Wilcock <twilco.o@protonmail.com> on 2021-04-16
Reviewed by Darin Adler.
LayoutTests/imported/w3c:
@counter-style and its descriptors are now exposed behind a feature
flag, so pass some tests and fail others for a different reason
because this patch doesn't actually implement descriptor parsing and
setting yet.
* web-platform-tests/css/css-counter-styles/counter-style-additive-symbols-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-fallback-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-name-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-range-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-speak-as-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/counter-style-system-syntax-expected.txt:
* web-platform-tests/css/css-counter-styles/idlharness-expected.txt:
* web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt:
Source/WebCore:
Parse @counter-style (without implementing descriptor parsing) behind
a new feature flag, CSSCounterStyleAtRulesEnabled. A separate feature
flag for @counter-style <image> symbol values has also been added, as
image symbols have extra complexities that we won't want to hold the
entire feature back on.
https://www.w3.org/TR/css-counter-styles-3
The CSSCounterStyleRule IDL interface is also added and implemented,
and similarly feature flagged.
https://www.w3.org/TR/css-counter-styles-3/#apis
Test: webexposed/counter-style-is-not-exposed.html and existing WPTs.
* CMakeLists.txt:
Add CSSCounterStyleRule.idl.
* DerivedSources-input.xcfilelist:
Add CSSCounterStyleRule.idl.
* DerivedSources-output.xcfilelist:
Add JSCSSCounterStyleRule.h and JSCSSCounterStyleRule.cpp.
* DerivedSources.make:
Add CSSCounterStyleRule.idl.
* Sources.txt:
Add CSSCounterStyleRule.cpp and JSCSSCounterStyleRule.cpp.
* WebCore.xcodeproj/project.pbxproj:
Add CounterStyle.h, CounterStyle.cpp, and CounterStyle.idl.
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::toJSNewlyCreated):
Support CSSCounterStyleRule.
* bindings/js/WebCoreBuiltinNames.h:
Add macro(CSSCounterStyleRule) to generate counter-style built-in
names.
* css/CSSCounterStyleRule.cpp: Added.
(WebCore::StyleRuleCounterStyle::StyleRuleCounterStyle):
(WebCore::StyleRuleCounterStyle::create):
(WebCore::StyleRuleCounterStyle::mutableProperties):
(WebCore::CSSCounterStyleRule::CSSCounterStyleRule):
(WebCore::CSSCounterStyleRule::reattach):
(WebCore::CSSCounterStyleRule::cssText const):
* css/CSSCounterStyleRule.h: Added.
(isType): Add specialized rule.isCounterStyleRule() implementation.
* css/CSSCounterStyleRule.idl: Added.
* css/CSSRule.cpp: Add new StyleRuleType::CounterStyle COMPILE_ASSERT.
* css/CSSRule.h:
Add COUNTER_STYLE_RULE constant. Also add comment `// WebIDL enum` to
disable enum_casing lint, since these values are named to match IDL
attributes.
* css/CSSRule.idl: Add COUNTER_STYLE_RULE constant behind flag.
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::destroy):
(WebCore::StyleRuleBase::copy const):
(WebCore::StyleRuleBase::createCSSOMWrapper const):
Handle newly added StyleRuleType::CounterStyle.
* css/StyleRule.h:
(WebCore::StyleRuleBase::isCounterStyleRule const): Added.
* css/StyleRuleType.h: Add StyleRuleType::CounterStyle
* css/StyleSheetContents.cpp:
(WebCore::traverseRulesInVector):
(WebCore::StyleSheetContents::traverseSubresources const):
If @counter-style image symbols flag is enabled, do traverse
subresources.
* css/parser/CSSAtRuleID.cpp:
If the @counter-style feature flag is enabled, return newly added
CSSAtRuleCounterStyle ID.
(WebCore::cssAtRuleID):
* css/parser/CSSAtRuleID.h:
Add CSSAtRuleCounterStyle ID.
* css/parser/CSSParserContext.cpp:
(WebCore::operator==):
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash):
Add cssCounterStyleAtRulesEnabled and
cssCounterStyleAtRuleImageSymbolsEnabled flags.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
Refactor to use new CSSPropertyParserHelpers::isPredefinedCounterStyle
method.
* css/parser/CSSParserImpl.cpp:
(WebCore::computeNewAllowedRules):
(WebCore::CSSParserImpl::consumeAtRule):
(WebCore::CSSParserImpl::consumeCounterStyleRule): Added.
(WebCore::CSSParserImpl::consumeDeclarationList):
(WebCore::CSSParserImpl::consumeDeclaration):
* css/parser/CSSParserImpl.h:
Handle new @counter-style rule.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseValue): Handle
StyleRuleType::CounterStyle.
(WebCore::consumeCounterContent):
Refactor to use new CSSPropertyParserHelpers::isPredefinedCounterStyle
method.
(WebCore::CSSPropertyParser::parseCounterStyleDescriptor):
Add placeholder for future @counter-style descriptor parsing work.
* css/parser/CSSPropertyParser.h:
Add parseCounterStyleDescriptor method
* css/parser/CSSPropertyParserHelpers.h:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
Add new flag that allows consumed custom ident values to be lowercased
on-parse. This is necessary for some <counter-style-name> values.
(WebCore::CSSPropertyParserHelpers::isPredefinedCounterStyle): Added.
(WebCore::CSSPropertyParserHelpers::consumeCounterStyleName):
(WebCore::CSSPropertyParserHelpers::consumeCounterStyleNameInPrelude):
Parse @counter-style names, both in-prelude names and non-prelude
names (e.g. as part of the `extends` descriptor).
Source/WTF:
* Scripts/Preferences/WebPreferencesExperimental.yaml:
Add CSSCounterStyleAtRulesEnabled and CSSCounterStyleAtRuleImageSymbolsEnabled flags.
Tools:
* DumpRenderTree/TestOptions.cpp:
(WTR::TestOptions::defaults):
Add `false` defaults for CSSCounterStyleAtRulesEnabled and
CSSCounterStyleAtRuleImageSymbolsEnabled flags.
LayoutTests:
Add tests ensuring @counter-style is not exposed when feature flag is
disabled.
* webexposed/counter-style-is-not-exposed-expected.txt: Added.
* webexposed/counter-style-is-not-exposed.html: Added.
Canonical link: https://commits.webkit.org/236643@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-16 19:19:04 +00:00
2021-04-16 Tyler Wilcock <twilco.o@protonmail.com>
[css-counter-styles] Parse and add feature flag for @counter-style
https://bugs.webkit.org/show_bug.cgi?id=223150
Reviewed by Darin Adler.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
Add CSSCounterStyleAtRulesEnabled and CSSCounterStyleAtRuleImageSymbolsEnabled flags.
2021-04-15 17:38:48 +00:00
2021-04-15 Alex Christensen <achristensen@webkit.org>
Use WTF::Function instead of std::function in SVGPropertyAnimatorFactory::attributeAnimatorCreator
https://bugs.webkit.org/show_bug.cgi?id=224586
Reviewed by Darin Adler.
This requires something like r223122 until something like http://wg21.link/P1249 is accepted.
I also added a missing reserveInitialCapacity call that could reduce rehashing when constructing a HashMap from an initializer_list.
* wtf/HashMap.h:
2021-04-14 18:42:32 +00:00
2021-04-14 Alex Christensen <achristensen@webkit.org>
Revert important part of r275948
https://bugs.webkit.org/show_bug.cgi?id=224381
It caused an internal build failure.
* wtf/HashTable.h:
(WTF::KeyTraits>::inlineLookup):
2021-04-14 16:19:42 +00:00
2021-04-14 Alex Christensen <achristensen@webkit.org>
Reduce maximum HashTable entry size to 128 bytes
https://bugs.webkit.org/show_bug.cgi?id=224381
Reviewed by Yusuke Suzuki.
It turns out that HashMaps use HashTable::Value as KeyValuePair, so sizeof(Key) + sizeof(Value) was double counting the key size.
This caused FontCascadeCache to be a false positive. It has a key size of a little over 100 bytes. Only counting it once reflects what is intended.
Also, the USE(ANGLE) exception was convenient for a downstream branch, but isn't needed. Next time they rebase they will use UniqueRef.
* wtf/HashTable.h:
(WTF::KeyTraits>::inlineLookup):
2021-04-14 04:16:31 +00:00
2021-04-13 Ada Chan <ada.chan@apple.com>
Implement PlatformXRSystem::xrCoordinator() for USE(APPLE_INTERNAL_SDK)
https://bugs.webkit.org/show_bug.cgi?id=224510
Reviewed by Dean Jackson.
Update ENABLE_WEBXR flag
* wtf/PlatformEnableCocoa.h:
2021-04-13 22:48:10 +00:00
2021-04-13 Alex Christensen <achristensen@webkit.org>
WebProcessPool should store Vector<Ref<WebProcessProxy>> instead of Vector<RefPtr>
https://bugs.webkit.org/show_bug.cgi?id=224412
Reviewed by Chris Dumez.
* wtf/Ref.h:
(WTF::operator==):
(WTF::operator!=):
2021-04-13 21:20:56 +00:00
2021-04-13 Alex Christensen <achristensen@webkit.org>
Remove support for NPAPI plugins in WebView
https://bugs.webkit.org/show_bug.cgi?id=224449
Reviewed by Chris Dumez.
* Scripts/Preferences/WebPreferences.yaml:
2021-04-13 20:55:15 +00:00
2021-04-13 Chris Dumez <cdumez@apple.com>
Make MemoryPressureHandler::isUnderMemoryPressure() return true for 2 seconds after a simulated warning
https://bugs.webkit.org/show_bug.cgi?id=224505
Reviewed by Darin Adler.
Make MemoryPressureHandler::isUnderMemoryPressure() return true for 2 seconds after a simulated warning,
to make our simulated warning more realistic.
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
2021-04-13 19:54:06 +00:00
2021-04-13 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Add Vector&& move constructor / assignment to FixedVector and RefCountedArray
https://bugs.webkit.org/show_bug.cgi?id=224475
Reviewed by Ryosuke Niwa.
This patch adds move constructor and move-assignment taking Vector to FixedVector / RefCountedArray.
This allows transferring MoveOnly things from Vector to FixedVector.
* wtf/FixedVector.h:
(WTF::FixedVector::FixedVector):
(WTF::FixedVector::operator=):
* wtf/RefCountedArray.h:
(WTF::RefCountedArray::RefCountedArray):
(WTF::RefCountedArray::operator=):
(WTF::RefCountedArray::~RefCountedArray):
(WTF::RefCountedArray::allocateUninitializedData):
(WTF::RefCountedArray::assign):
2021-04-13 19:46:47 +00:00
2021-04-13 Alex Christensen <achristensen@webkit.org>
Revert r275172
https://bugs.webkit.org/show_bug.cgi?id=224499
<rdar://76396241>
Reviewed by Tim Horton.
* wtf/spi/darwin/XPCSPI.h:
2021-04-13 01:06:07 +00:00
2021-04-12 Basuke Suzuki <basuke.suzuki@sony.com>
[PlayStation] Enable WTFCrashWithInfo implementation
https://bugs.webkit.org/show_bug.cgi?id=224458
Reviewed by Don Olmstead.
Enable WTFCrashWithInfo implementation for PlayStation platform. It is x86_64 and uses clang
so that it can share Darwin's implemetation with us.
* wtf/Assertions.cpp:
2021-04-12 18:48:25 +00:00
2021-04-12 Youenn Fablet <youenn@apple.com>
Block loading for port 10080
https://bugs.webkit.org/show_bug.cgi?id=224432
Reviewed by Alex Christensen.
Follow Chrome and Firefox by blocking port 10080.
* wtf/URL.cpp:
(WTF::portAllowed):
Reduce compile time and binary size cost of enabling proper CSSStyleDeclaration property access behavior
https://bugs.webkit.org/show_bug.cgi?id=222518
<rdar://problem/75136887>
Reviewed by Darin Adler.
LayoutTests/imported/w3c:
* web-platform-tests/css/cssom/cssstyledeclaration-properties-expected.txt:
Update test result now that it is passing.
Source/WebCore:
Re-implement proper (not using named-getters) support for the CSSStyleDeclaration bindings
using a new DelegateToSharedSyntheticAttribute extended atttribute which allows IDL attributes
to share a custom getter / setter implementation and delegate their implementation to it. When
using this functionality, the synthetic attribute's implementation is passed the original property
name so it can implement functionality based on it.
We use this for CSSStyleDeclaration by breaking the huge list of generated properties into
four groups, each with their own synthetic attribute. The groups are based on the different
transformation rules in the spec.
* bindings/js/JSDOMAttribute.h:
(WebCore::IDLAttribute::setPassingPropertyName):
(WebCore::IDLAttribute::getPassingPropertyName):
Add overloads of get/set that pass the property name to the provided function. These can't
be simple overloads of get/set as MSVC does not allow overloading with only a non-type
template parameters differentiating.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateInterface):
Eagerly generate the any synthetic attributes before the rest of code generation,
matching the behavior of other synthetic constructions like map/set/stringifiers.
(GetAttributeGetterName):
(GetAttributeSetterName):
Add special cases to getter/setter name generation to forward to the generated
name of the synthetic attribute when delegating.
(GenerateImplementation):
Extract attribute function forward declaration genation into a new GenerateAttributeGetterAndSetterDeclaration
subroutine and use it for generation of both normal and synthetic attributes. Also adds
synthetic attributes to the list of attributes to generate function implementations for.
(GenerateAttributeGetterAndSetterDeclaration):
Extracted from GenerateImplementation. Adds extra condition to bail if DelegateToSharedSyntheticAttribute
is specified.
(GenerateAttributeGetterBodyDefinition):
Add support for the new CallWith=PropertyName extended attribute by adding a PropertyName
argument to the signature of getter body if it is present. Removes now unnecessary support
for the CSSProperty extended attribute.
(GenerateAttributeGetterTrampolineDefinition):
Switch function name from get to getPassingPropertyName if CallWith=PropertyName is specified.
(GenerateAttributeGetterDefinition):
Adds extra condition to bail if DelegateToSharedSyntheticAttribute is specified.
(GenerateAttributeSetterBodyDefinition):
Add support for the new CallWith=PropertyName extended attribute by adding a PropertyName
argument to the signature of getter body if it is present. Removes now unnecessary support
for the CSSProperty extended attribute.
(GenerateAttributeSetterTrampolineDefinition):
Switch function name from get to getPassingPropertyName if CallWith=PropertyName is specified.
(GenerateAttributeSetterDefinition):
Adds extra condition to bail if DelegateToSharedSyntheticAttribute is specified.
(GenerateCallWith):
Add support for the PropertyName value to CallWith.
(MakeSharedSyntheticAttribute):
Helper to generate the synthetic attribute from the base attribute with DelegateToSharedSyntheticAttribute
specefied. Maintains all existing extended attributes of the base attribute except
DelegateToSharedSyntheticAttribute is replaced with IsSharedSyntheticAttribute to avoid
infinite recursion.
(AddSharedSyntheticAttributesIfNeeded):
Helper to find all delegating attributes and generate / store the synthetic attributes.
(GetSharedSyntheticAttribute):
Helper to get the corresponding synthetic attribute given an attribute with
DelegateToSharedSyntheticAttribute specified on it.
* bindings/scripts/IDLAttributes.json:
Removes CSSProperty. Adds DelegateToSharedSyntheticAttribute. Adds PropertyName value to
CallWith and SetterCallWith.
* css/CSSStyleDeclaration.cpp:
(WebCore::lookupCSSPropertyFromIDLAttribute):
(WebCore::CSSStyleDeclaration::propertyValueForCamelCasedIDLAttribute):
(WebCore::CSSStyleDeclaration::setPropertyValueForCamelCasedIDLAttribute):
(WebCore::CSSStyleDeclaration::propertyValueForWebKitCasedIDLAttribute):
(WebCore::CSSStyleDeclaration::setPropertyValueForWebKitCasedIDLAttribute):
(WebCore::CSSStyleDeclaration::propertyValueForDashedIDLAttribute):
(WebCore::CSSStyleDeclaration::setPropertyValueForDashedIDLAttribute):
(WebCore::CSSStyleDeclaration::propertyValueForEpubCasedIDLAttribute):
(WebCore::CSSStyleDeclaration::setPropertyValueForEpubCasedIDLAttribute):
(WebCore::CSSStyleDeclaration::namedItem): Deleted.
(WebCore::CSSStyleDeclaration::setNamedItem): Deleted.
(WebCore::CSSStyleDeclaration::supportedPropertyNames const): Deleted.
* css/CSSStyleDeclaration.h:
Replace named-getter based implementation with helpers based on the definitions
in the CSSOM spec (plus one special set for 'epub' specializations we currently
maintain).
* css/CSSStyleDeclaration.idl:
Remove !ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION sections now that
we can fully support ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION.
* css/makeprop.pl:
Remove !ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION sections now that
we can fully support ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION.
Replaces CSSProperty extended attributes with DelegateToSharedSyntheticAttribute and
CallWith=PropertyName, which together allow us to implement all the attributes with just
8 implementation functions.
* bindings/scripts/test/BindingTestGlobalConstructors.idl:
* bindings/scripts/test/JS/JSTestCSSProperty.cpp: Removed.
* bindings/scripts/test/JS/JSTestCSSProperty.h: Removed.
* bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.cpp: Added.
* bindings/scripts/test/JS/JSTestDelegateToSharedSyntheticAttribute.h: Added.
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/SupplementalDependencies.dep:
* bindings/scripts/test/TestCSSProperty.idl: Removed.
* bindings/scripts/test/TestDelegateToSharedSyntheticAttribute.idl: Added.
Replace CSSProperty tests with DelegateToSharedSyntheticAttribute tests and update results
all around for new generation.
Source/WTF:
* wtf/PlatformEnable.h:
Remove ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION, as it is now the default and on everwhere.
LayoutTests:
* fast/css/style-enumerate-properties-expected.txt:
* fast/css/style-enumerate-properties.html:
* fast/dom/domListEnumeration-expected.txt:
* fast/dom/domListEnumeration.html:
Remove existing tests for iteration order, which is not standardized, and not consistent among
browsers. Adds a new one that checks invariants of the 4 groupings of properties which we currently
expect to hold, at least in our implementation.
* fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor-expected.txt:
* fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor.html:
Update now that the properties are proper attributes on the prototype.
* js/dom/put-override-should-not-use-ic.html:
Switch to using a DOMStringList as the object that overrides put, since CSSStyleDeclaration no longer does.
* transitions/transitions-parsing-expected.txt:
* transitions/transitions-parsing.html:
Remove Object.keys() aspect of the test, which is no longer meaningful since the
properties should no longer exist in the result set.
Canonical link: https://commits.webkit.org/236379@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-11 17:06:47 +00:00
2021-04-11 Sam Weinig <weinig@apple.com>
Reduce compile time and binary size cost of enabling proper CSSStyleDeclaration property access behavior
https://bugs.webkit.org/show_bug.cgi?id=222518
<rdar://problem/75136887>
Reviewed by Darin Adler.
* wtf/PlatformEnable.h:
Remove ENABLE_ATTRIBUTE_BASED_PROPERTIES_FOR_CSS_STYLE_DECLARATION, as it is now the default and on everwhere.
2021-04-09 20:31:51 +00:00
2021-04-09 Jer Noble <jer.noble@apple.com>
WTF SoftLinking macros can cause collisions with their target functions
https://bugs.webkit.org/show_bug.cgi?id=224379
<rdar://76434202>
Reviewed by Eric Carlson.
Do not declare an inline version of the target function, as this will collide if the target function
becomes inlined. Instead, callers should use the explicit softLink_Library_Function() syntax, or
the LibrarySoftLinking.h headers should use #defines to re-declare the function name.
* wtf/cocoa/SoftLinking.h:
2021-04-08 20:45:16 +00:00
2021-04-08 Stephan Szabo <stephan.szabo@sony.com>
[RunLoopGeneric] OneShotTimer should not remain "isActive" after fired
https://bugs.webkit.org/show_bug.cgi?id=189335
<rdar://problem/44226604>
Reviewed by Geoffrey Garen.
* wtf/generic/RunLoopGeneric.cpp:
Deactivate one-shot timer before invoking its callback.
2021-04-08 19:05:31 +00:00
2021-04-08 Khem Raj <raj.khem@gmail.com>
[WPE] Build fixes for musl C library on Linux
https://bugs.webkit.org/show_bug.cgi?id=210068
Reviewed by Carlos Alberto Lopez Perez.
Define 128KB DEFAULT_THREAD_STACK_SIZE_IN_KB for musl
Use OS(LINUX) check to include musl when building for
Linux based platforms.
* wtf/PlatformHave.h:
* wtf/Threading.cpp:
OfflineAudioContext objects are leaking
https://bugs.webkit.org/show_bug.cgi?id=224279
Reviewed by Darin Adler.
Source/WebCore:
OfflineAudioContext objects were always leaking due to 2 reference cycles:
1. BaseAudioContext -> m_listener (AudioListener) -> m_positionX (AudioParam) -> m_context (BaseAudioContext)
2. BaseAudioContext -> m_destinationNode (AudioDestinationNode) -> m_context (BaseAudioContext)
For reference cycle 1, I made AudioSummingJunction (base class of AudioParam) hold a weak pointer to the
AudioContext instead of a Ref<>. I don't think there is a good reason for an AudioSummingJunction (AudioParam
or AudioNodeInput) to keep its AudioContext alive. AudioNodes already keep their AudioContext alive.
AudioNodeInputs and AudioParams are associated to AudioNodes.
For reference cycle 2, I made AudioDestinationNode not hold a strong pointer to its context but instead a
weak pointer. Since keeping an AudioDestinationNode alive should keep its AudioContext alive, I made it so
that ref'ing the AudioDestinationNode refs its BaseAudioContext. Also, BaseAudioContext::m_destinationNode
is now a UniqueRef<> instead of a RefPtr<> to avoid a cycle.
Tests: webaudio/OfflineAudioContext/offlineaudiocontext-leak-after-rendering.html
webaudio/OfflineAudioContext/offlineaudiocontext-leak.html
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::baseLatency):
(WebCore::AudioContext::getOutputTimestamp):
(WebCore::AudioContext::close):
(WebCore::AudioContext::destination):
(WebCore::AudioContext::destination const):
(WebCore::AudioContext::suspendRendering):
(WebCore::AudioContext::resumeRendering):
(WebCore::AudioContext::startRendering):
(WebCore::AudioContext::lazyInitialize):
(WebCore::AudioContext::mediaState const):
(WebCore::AudioContext::mayResumePlayback):
(WebCore::AudioContext::suspendPlayback):
(WebCore::AudioContext::pageMutedStateDidChange):
* Modules/webaudio/AudioContext.h:
- Drop some null checks now that m_destinationNode can no longer be null.
- Capture an ActiveDOMObject::PendingActivity when doing async work that ends up resolving a Promise, so that
we keep both the object and its wrapper alive for the duration of the async work.
* Modules/webaudio/AudioDestinationNode.cpp:
(WebCore::AudioDestinationNode::ref):
(WebCore::AudioDestinationNode::deref):
* Modules/webaudio/AudioDestinationNode.h:
Have AudioDestinationNode override AudioNode's ref() / deref() to forward the refcounting
to its BaseAudioContext, instead of using the AudioNode's internal refCount.
* Modules/webaudio/AudioListener.cpp:
(WebCore::AudioListener::updateValuesIfNeeded):
(WebCore::AudioListener::setPosition):
(WebCore::AudioListener::setOrientation):
Add some null-checks for AudioParam::context() now that AudioParam holds a WeakPtr to its
context.
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::toWeakOrStrongContext):
(WebCore::AudioNode::AudioNode):
(WebCore::AudioNode::connect):
(WebCore::AudioNode::sampleRate const):
(WebCore::AudioNode::markNodeForDeletionIfNecessary):
(WebCore::AudioNode::contextForBindings):
(WebCore::AudioNode::context):
(WebCore::AudioNode::context const):
* Modules/webaudio/AudioNode.h:
- Hold the BaseAudioContext as a WeakPtr instead of a Ref<> if the AudioNode is an
AudioDestinationNode. This avoids a reference cycle since the BaseAudioContext owns the
AudioDestinationNode. Even though we are using a WeakPtr, it is safe to assume that
the context is not null because ref'ing an AudioDestinationNode refs its BaseAudioContext.
- Make sure markNodeForDeletionIfNecessary() has no effect for AudioDestinationNode since
BaseAudioContext now owns the AudioDestinationNode when we take care of destroying its
destination node when destroyed.
* Modules/webaudio/AudioNodeInput.cpp:
(WebCore::AudioNodeInput::connect):
(WebCore::AudioNodeInput::disconnect):
(WebCore::AudioNodeInput::outputEnabledStateChanged):
(WebCore::AudioNodeInput::updateInternalBus):
(WebCore::AudioNodeInput::bus):
(WebCore::AudioNodeInput::internalSummingBus):
(WebCore::AudioNodeInput::sumAllConnections):
(WebCore::AudioNodeInput::pull):
Add assertions that the context is not null. There were already assertions that we are the graph
owner, which means we are holding the BaseAudioContext's lock, which means that the audio context
is alive.
* Modules/webaudio/AudioParam.cpp:
(WebCore::AudioParam::value):
(WebCore::AudioParam::setValueForBindings):
(WebCore::AudioParam::smooth):
(WebCore::AudioParam::hasSampleAccurateValues const):
(WebCore::AudioParam::calculateSampleAccurateValues):
(WebCore::AudioParam::calculateFinalValues):
(WebCore::AudioParam::calculateTimelineValues):
(WebCore::AudioParam::connect):
(WebCore::AudioParam::disconnect):
Add null-checks for the AudioContext now that the AudioParam is only holding a WeakPtr to its
BaseAudioContext (to avoid a reference cycle).
* Modules/webaudio/AudioSummingJunction.cpp:
(WebCore::AudioSummingJunction::AudioSummingJunction):
(WebCore::AudioSummingJunction::~AudioSummingJunction):
(WebCore::AudioSummingJunction::markRenderingStateAsDirty):
(WebCore::AudioSummingJunction::addOutput):
(WebCore::AudioSummingJunction::removeOutput):
(WebCore::AudioSummingJunction::updateRenderingState):
(WebCore::AudioSummingJunction::outputEnabledStateChanged):
* Modules/webaudio/AudioSummingJunction.h:
(WebCore::AudioSummingJunction::context):
(WebCore::AudioSummingJunction::context const):
- Hold a WeakPtr to the BaseAudioContext to avoid a reference cycle.
- Deal with the fact that the audio context may be null now that we're holding a WeakPtr
to it (except when holding the graph lock)
* Modules/webaudio/BaseAudioContext.cpp:
(WebCore::BaseAudioContext::BaseAudioContext):
(WebCore::BaseAudioContext::~BaseAudioContext):
(WebCore::BaseAudioContext::numberOfInstances):
(WebCore::BaseAudioContext::lazyInitialize):
(WebCore::BaseAudioContext::clear):
(WebCore::BaseAudioContext::uninitialize):
(WebCore::BaseAudioContext::stop):
(WebCore::BaseAudioContext::sampleRate const):
(WebCore::BaseAudioContext::decodeAudioData):
(WebCore::BaseAudioContext::markForDeletion):
(WebCore::BaseAudioContext::deleteMarkedNodes):
(WebCore::BaseAudioContext::setPendingActivity):
(WebCore::BaseAudioContext::workletIsReady):
* Modules/webaudio/BaseAudioContext.h:
(WebCore::BaseAudioContext::destination):
(WebCore::BaseAudioContext::destination const):
(WebCore::BaseAudioContext::currentSampleFrame const):
(WebCore::BaseAudioContext::currentTime const):
- Switch m_destinationNode from RefPtr<> to UniqueRef<> since the AudioContext is now
the owner of the destinationNode and since refing the destination node actually refs
its BaseAudioContext.
- Drop some null checks now that m_destinationNode can no longer be null.
- Rename makePendingActivity() to setPendingActivity() to avoid a naming conflict with
ActiveDOMObject::makePendingActivity().
* Modules/webaudio/DefaultAudioDestinationNode.h:
* Modules/webaudio/OfflineAudioDestinationNode.h:
- Drop create() factory functions and make the constructor public now that the BaseAudioContext owns
its destination node via a UniqueRef<>.
- Make some member functions public as they are virtual and they now called on the subclass instead of the
base class (and these functions are public in the base class).
* Modules/webaudio/OfflineAudioContext.cpp:
(WebCore::OfflineAudioContext::startOfflineRendering):
(WebCore::OfflineAudioContext::resumeOfflineRendering):
* Modules/webaudio/OfflineAudioContext.h:
- Drop some null checks now that m_destinationNode can no longer be null.
- Capture an ActiveDOMObject::PendingActivity when doing async work that ends up resolving a Promise, so that
we keep both the object and its wrapper alive for the duration of the async work.
* Modules/webaudio/WebKitAudioContext.cpp:
(WebCore::WebKitAudioContext::close):
Drop null checks for the destination node now that it can never be null.
* dom/ShadowRoot.cpp:
* rendering/FloatingObjects.cpp:
* rendering/RootInlineBox.cpp:
Update classes used of size restrictions since the size of a WeakPtr is not longer the same as the size of a
pointer when debug assertions are enabled. As long as they are the same size in release builds, there is no
memory use concern.
* testing/Internals.cpp:
(WebCore::Internals::numberOfBaseAudioContexts const):
* testing/Internals.h:
* testing/Internals.idl:
Add testing function to check how many BaseAudioContexts are alive, so that we can write layout tests and check
for leaks.
Source/WTF:
Add flag that can be passed when constructing a WeakPtr to disable threading assertions.
This is useful for cases where we know it is safe due to locking but we'd like to use a
WeakPtr instead of a raw pointer because it is safer.
* wtf/WeakPtr.h:
(WTF::WeakPtr::get const):
(WTF::WeakPtr::operator-> const):
(WTF::WeakPtr::operator* const):
(WTF::WeakPtr::WeakPtr):
(WTF::WeakPtrFactory::createWeakPtr const):
(WTF::=):
(WTF::makeWeakPtr):
LayoutTests:
Add layout test coverage.
* webaudio/OfflineAudioContext/offlineaudiocontext-leak-after-rendering-expected.txt: Added.
* webaudio/OfflineAudioContext/offlineaudiocontext-leak-after-rendering.html: Added.
* webaudio/OfflineAudioContext/offlineaudiocontext-leak-expected.txt: Added.
* webaudio/OfflineAudioContext/offlineaudiocontext-leak.html: Added.
Canonical link: https://commits.webkit.org/236304@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-08 18:41:23 +00:00
2021-04-08 Chris Dumez <cdumez@apple.com>
OfflineAudioContext objects are leaking
https://bugs.webkit.org/show_bug.cgi?id=224279
Reviewed by Darin Adler.
Add flag that can be passed when constructing a WeakPtr to disable threading assertions.
This is useful for cases where we know it is safe due to locking but we'd like to use a
WeakPtr instead of a raw pointer because it is safer.
* wtf/WeakPtr.h:
(WTF::WeakPtr::get const):
(WTF::WeakPtr::operator-> const):
(WTF::WeakPtr::operator* const):
(WTF::WeakPtr::WeakPtr):
(WTF::WeakPtrFactory::createWeakPtr const):
(WTF::=):
(WTF::makeWeakPtr):
2021-04-08 16:14:00 +00:00
2021-04-08 Simon Fraser <simon.fraser@apple.com>
Copy-constructed Vectors should not have excess capacity
https://bugs.webkit.org/show_bug.cgi?id=224313
Reviewed by Darin Adler.
When copy-constructing a Vector<>, set the capacity to the size of the input.
This avoids wasted vector capacity at call sites that dynamically build vectors
and then copy them into read-only caches.
* wtf/Vector.h:
(WTF::Malloc>::Vector):
Use Hasher more, remove IntegerHasher, fix hashing-related mistakes
https://bugs.webkit.org/show_bug.cgi?id=224138
Reviewed by Chris Dumez.
Source/JavaScriptCore:
* bytecode/BytecodeIndex.h:
(JSC::BytecodeIndex::hash const): Remove unneeded WTF prefix on call
to intHash.
* ftl/FTLAbstractHeap.h: Use HashTraits instead of WTF::GenericHashTraits.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::validateAIState): Remove unneeded WTF
prefix on call to intHash.
* wasm/WasmLLIntGenerator.cpp: Use HashTraits instead of WTF::GenericHashTraits.
Source/WebCore:
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::TriggerHash::hash): Use computeHash to
hash all the fields instead of a custom-written algorithm. The custom
algorithm had some magic numbers, repeatedly hashed hashes, and combined
hashes using exclusive or. The new one is almost certainly better.
* contentextensions/Term.h:
(WebCore::ContentExtensions::Term::CharacterSet::hash const):
Use computeHash to hash the boolean and the characters rather than
using intHash and pairIntHash.
* css/parser/CSSParserContext.cpp:
(WebCore::add): Moved the hashing here from the header. Fixed the
mistake where this was using & instead of | and so none of the booleans
were having any effect on the hash value.
* css/parser/CSSParserContext.h: Use WTF_MAKE_STRUCT_FAST_ALLOCATED so
we don't have to say public: explicitly. Also moved all the function
members to the bottom of the struct. This is typically preferred style
for structures as opposed to classes. Since the data members are the
primary interface, they are first, and all function members are secondary
and so they come after.
(WebCore::CSSParserContextHash::hash): Use convertHash instead of
a custom written hash function. The custom written function was combining
hahes using exclusive or, not a best practice, and also had a mistake
where it used & instead of | and so the "bits" local variable was always 0.
* html/FormController.cpp: Use HashTraits instead of WTF::GenericHashTraits.
* platform/encryptedmedia/CDMProxy.h: Removed unneedes includes.
* platform/graphics/Font.cpp: Changed CharacterFallbackMapKey into a
simple struct with no additional function members or static data members.
Changed CharacterFallbackMapKeyHash to use computeHash to calculate the
hash, instead of IntegerHasher. Probably better to hash the pointer of
the AtomString rather than hashing the hash, but either way, we should
have the best implementation for AtomString hashing in the Hasher class.
Added CharacterFallbackMapKeyHashTraits instead of using
SimpleClassHashTraits. Use the value U_SENTINEL for the UChar32 character,
which is the same as the -1 used before, but slightly clearer why it's OK.
(WebCore::Font::systemFallbackFontForCharacter const): Use HashMap::ensure
instead of HashMap::add to make the logic simpler.
* platform/graphics/Font.h: Use bool instead of uint8_t as the base type
for the No/Yes enumeration IsForPlatformFont.
* platform/graphics/FontCache.cpp: Removed unneeded "using namespace WTF",
which is not our best practice, especially given unified builds.
Changed FontPlatformDataCacheKey into a simple struct, removing all the
hash-related member functions. Also used struct-style naming for the
members without an "m_" prefix. Used the type FontFamilyName for the
family name, which means we will use FontCascadeDescription's system
for hashing and comparing family names for equality without having to
remember do to so explicitly. Changed FontPlatformDataCacheKeyHash to
use computeHash. The old version had unnecessarily complex logic to
handle Optional and was unnecessarily hashing hashes.
(WebCore::FontCache::cachedFontPlatformData): Renamed to remove "get"
from the function's name. Also use shorter argument and local variable
names that are single words, and updated since FontPlatformDataCacheKey
is now a struct without a constructor.
(WebCore::FontCache::fontForFamily): Use shorter names.
(WebCore::operator==): To compare two FontCascadeCacheKey objects,
use a simpler constructions, depending on the fact that Vector already
has an == operator and we are using FontFamilyName for the elements
of the vector, which has a correct == operator.
(WebCore::FontCascadeCacheKeyHash::hash): Use computeHash since
the FontFamilyName hashing is now correct, and we can rely on the
way Hasher knows how to iterate a collection.
(WebCore::FontCache::retrieveOrAddCachedFonts): Update since
FontCascadeCacheEntry is now a simple struct. Also use constexpr a bit.
(WebCore::FontCache::invalidate): Use copyToVectorOf<> to simplify the
code that calls fontCacheInvalidated on all the font selectors.
* platform/graphics/FontCache.h: Use "using" instead of "typedef".
Remove FontDescriptionKey::computeHash.
(WebCore::add): An overload of add for Hasher to include a
FontDescriptionKey in a hash, which just lists all the data members.
The old version did a hash of hashes, but that's not needed any more.
Updated FontDescriptionKeyHash to use the Hasher version of ComputeHash.
Added FontFamilyName. Change FontCascadeCacheKey to use a vector of
FontFamilyName instead of AtomString. In FontCascadeCacheEntry, use
WTF_MAKE_STRUCT_FAST_ALLOCATED instead of WTF_MAKE_FAST_ALLOCATED
and also got rid of the unneeeded constructor.
(WebCore::FontCascadeCacheKeyHashTraits::constructDeletedValue):
Use the deleted value of FontDescriptionKey.
(WebCore::FontCascadeCacheKeyHashTraits::isDeletedValue): Ditto.
Renamed getCachedFontPlatformData to just cachedFontPlatformData.
* platform/graphics/FontGenericFamilies.h: Use HashTraits instead of
WTF::GenericHashTraits.
* platform/graphics/FontSelectionAlgorithm.h:
(WebCore::FontSelectionRange::uniqueValue const): Deleted.
(WebCore::add): Add both the minimum and maximum values to the hash
separately instead of combining them. For now, this makes the way
they are hashed a bit inefficient, but that can be re-tightened up by
improving the algorithm of Hasher if we like. Should be fine for our
needs either way.
* platform/graphics/FontTaggedSettings.cpp:
(WebCore::FontFeatureSettings::hash const): Deleted.
(WebCore::FontVariationSettings::hash const): Deleted.
* platform/graphics/FontTaggedSettings.h: Added overloads of the
add(Hasher&) function for std::array<char, 4> and FontTaggedSetting<T>.
Got rid of many uses of pass by reference instead of value for FontTag,
since it fits into a 32-bit register and bth more source code and less
efficient to pass by value.
* platform/graphics/Gradient.cpp: Removed "using WTF::pairIntHash" since
that's now done in the WTF header.
* platform/graphics/cg/GraphicsContextCG.cpp: Ditto. Also removed
"using WTF::GenericHashTraits", which was unhelpful. The GenericHashTraits
template is only really needed when specializing HashTraits, which
already has to be done within the WTF namespace. In all other cases, we
should just use HashTraits instead.
* platform/graphics/cg/SubimageCacheWithTimer.h: Use HashTraits
instead of WTF::GenericHashTraits.
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
Move the data members to the top of the FontFamilySpecificationKey struct.
Removed unneeded computeHash function and WTF prefix from safeCFEqual.
(WebCore::FontFamilySpecificationKeyHash::hash): Call the Hasher version
of computeHash directly to hash the two items in this structure.
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::hash const):
Use computeHash instead of IntegerHasher. Also renamed the hash function
struct from CascadeListParameters::CascadeListParametersHash to
CascadeListParameters::Hash.
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
Removed now-unneeded WTF prefixes from calls to safeCFEqual.
* rendering/TextAutoSizing.h: Use HashTraits instead of WTF::GenericHashTraits.
* rendering/style/RenderStyle.cpp:
(WebCore::computeFontHash): Use computeHash instead of IntegerHasher.
Still not great that we hash a hash here, but we can improve that later.
* workers/service/ServiceWorkerClientIdentifier.h:
(WebCore::ServiceWorkerClientIdentifier::decode): Removed unneeded
WTFMove on ObjectIdentifier, which are just integers, so move vs. copy
is not an important distinction.
(WebCore::ServiceWorkerClientIdentifier::hash const): Use computeHash
instead of combining intHash with StringHasher::hashMemory. This fixes
two mistakes: one is that there is no need to hash a hash. The second is
that intHash takes a 32-bit integer as its parameter, so high bits
of object identifiers were discarded unnecessarily.
* workers/service/ServiceWorkerContextData.h: Removed unneeded include.
* workers/service/ServiceWorkerGlobalScope.h: Added now-needed include
of URLHash.h, since we removed it from a widely-included header.
* workers/service/context/SWContextManager.h: Ditto.
* workers/service/server/ServiceWorkerThreadProxy.h: Ditto.
* workers/service/server/RegistrationStore.h: Ditto.
* workers/service/server/SWServer.h: Ditto.
* workers/service/server/SWServerToContextConnection.h: Ditto.
* workers/service/server/SWServerWorker.h: Ditto.
Source/WebKit:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: Added now-needed include
of URLHash.h, since we removed it from a widely-included header.
* NetworkProcess/cache/NetworkCache.h:
(WebKit::NetworkCache::GlobalFrameID::hash const): Use computeHash
instead of combining intHash with StringHasher::hashMemory. This fixes
two mistakes: one is that there is no need to hash a hash. The second is
that intHash takes a 32-bit integer as its parameter, so high bits
of object identifiers were discarded unnecessarily.
* Scripts/webkit/messages.py: Added code so that if URL is in an argument, we include the
URLHash.h header. Would be better to just use URL.h and use URLHash.h only if it's a
HashMap<URL>, but currently the script does not distinguish those cases. This wasn't needed
before becuase a widely included header was always pulling in URLHash.h.
* Shared/API/Cocoa/WKBrowsingContextHandle.mm:
(-[WKBrowsingContextHandle hash]): Use computeHash instead of pairIntHash.
This fixes a mistake: pairIntHash takes two 32-bit integers, so high bits
of object identifiers were discarded unnecessarily.
* NetworkProcess/Storage/WebSWContextManagerConnection.h: Added now-needed include
of URLHash.h, since we removed it from a widely-included header.
Source/WebKitLegacy/mac:
* History/BinaryPropertyList.cpp: Use HashTraits instead of WTF::GenericHashTraits.
Source/WTF:
* wtf/HashFunctions.h: Export intHash and pairIntHash to the global namespace
so they can be called without an explicit WTF prefix. This follows the usual
WTF design pattern given that these functions are intended for use outside WTF.
* wtf/Hasher.h: Deleted IntegerHasher.
(WTF::add): Added overloads for String, AtomString, and URL.
* wtf/ObjectIdentifier.h:
(WTF::add): Added a Hasher overload for any ObjectIdentifier.
* wtf/RetainPtr.h: Export safeCFEqual and safeCFHash to the global namespace
so they can be called without an explicit WTF prefix. This follows the usual
WTF design pattern given that these functions are intended for use outside WTF.
* wtf/VectorHash.h: Removed the VectorHash template, instead just specializing
DefaultHash. Use computeHash to hash the contents of the vector instead of
hashing the hashes of the items in the vector. This is better in general and
better for the one case where we are currently using this, for a Vector<int>.
We want to hash all the integers rather than hashing hashes of all the integers.
In the future, this means the elements of the Vector need to be hashable using
the Hasher machinery. The old requirement was the the elements had a DefaultHash.
Canonical link: https://commits.webkit.org/236286@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-08 02:19:20 +00:00
2021-04-02 Darin Adler <darin@apple.com>
Use Hasher more, remove IntegerHasher, fix hashing-related mistakes
https://bugs.webkit.org/show_bug.cgi?id=224138
Reviewed by Chris Dumez.
* wtf/HashFunctions.h: Export intHash and pairIntHash to the global namespace
so they can be called without an explicit WTF prefix. This follows the usual
WTF design pattern given that these functions are intended for use outside WTF.
* wtf/Hasher.h: Deleted IntegerHasher.
(WTF::add): Added overloads for String, AtomString, and URL.
* wtf/ObjectIdentifier.h:
(WTF::add): Added a Hasher overload for any ObjectIdentifier.
* wtf/RetainPtr.h: Export safeCFEqual and safeCFHash to the global namespace
so they can be called without an explicit WTF prefix. This follows the usual
WTF design pattern given that these functions are intended for use outside WTF.
* wtf/VectorHash.h: Removed the VectorHash template, instead just specializing
DefaultHash. Use computeHash to hash the contents of the vector instead of
hashing the hashes of the items in the vector. This is better in general and
better for the one case where we are currently using this, for a Vector<int>.
We want to hash all the integers rather than hashing hashes of all the integers.
In the future, this means the elements of the Vector need to be hashable using
the Hasher machinery. The old requirement was the the elements had a DefaultHash.
2021-04-07 23:49:40 +00:00
2021-04-07 Michael Catanzaro <mcatanzaro@gnome.org>
Suppress -Warray-bounds warning spam in Bitmap.h
https://bugs.webkit.org/show_bug.cgi?id=224207
Reviewed by Don Olmstead.
Suppress this warning.
* wtf/Bitmap.h:
(WTF::WordType>::clear):
2021-04-07 21:14:57 +00:00
2021-04-07 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Use FixedVector more in bytecode dir and JumpTable
https://bugs.webkit.org/show_bug.cgi?id=224275
Reviewed by Michael Saboff and Mark Lam.
* wtf/FixedVector.h:
(WTF::FixedVector::offsetOfStorage):
* wtf/RefCountedArray.h:
(WTF::RefCountedArray::Header::size):
(WTF::RefCountedArray::Header::offsetOfLength):
2021-04-07 19:16:47 +00:00
2021-04-07 Alex Christensen <achristensen@webkit.org>
Use os_transaction_create instead of deprecated xpc_transaction_begin/end
https://bugs.webkit.org/show_bug.cgi?id=224288
Reviewed by Tim Horton.
* wtf/spi/darwin/XPCSPI.h:
2021-04-07 09:28:49 +00:00
2021-04-06 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] WasmMemory caging should care nullptr
https://bugs.webkit.org/show_bug.cgi?id=224268
<rdar://problem/74654838>
Reviewed by Mark Lam.
Accept size_t since Wasm::Memory's length can be larger than 4GB.
* wtf/CagedPtr.h:
(WTF::CagedPtr::CagedPtr):
(WTF::CagedPtr::get const):
(WTF::CagedPtr::getMayBeNull const):
(WTF::CagedPtr::at const):
(WTF::CagedPtr::recage):
* wtf/CagedUniquePtr.h:
(WTF::CagedUniquePtr::CagedUniquePtr):
(WTF::CagedUniquePtr::create):
(WTF::CagedUniquePtr::tryCreate):
2021-04-06 21:28:04 +00:00
2021-04-06 Alex Christensen <achristensen@webkit.org>
Add U+0581 and U+0585 to list of Armenian characters that look like Latin characters
https://bugs.webkit.org/show_bug.cgi?id=224219
<rdar://75896365>
Reviewed by Brent Fulgham.
These code points are allowed in the context of other Armenian code points and punctuation, but not other script code points.
This was already implemented for the others, but I consolidated the list to one location to avoid having two locations for the list.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::isArmenianLookalikeCharacter):
(WTF::URLHelpers::isArmenianLookalikeSequence):
(WTF::URLHelpers::isLookalikeCharacter):
2021-04-06 19:47:47 +00:00
2021-04-06 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Introduce FixedVector and use it for FixedOperands
https://bugs.webkit.org/show_bug.cgi?id=224171
Reviewed by Mark Lam.
This FixedVector<T> is a wrapper around RefCountedArray<T>, but this offers Vector-like copy / move semantics,
so that we can use this FixedVector<T> as a drop-in-replacement for fixed-sized Vector fields. The purpose
of that is saving memory by removing unnecessary storage (FixedVector is fixed-sized allocated) and putting size
into the allocated memory.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/FastBitVector.h:
(WTF::FastBitVector::FastBitVector):
* wtf/FixedVector.h: Added.
(WTF::FixedVector::FixedVector):
(WTF::FixedVector::operator=):
(WTF::FixedVector::size const):
(WTF::FixedVector::isEmpty const):
(WTF::FixedVector::byteSize const):
(WTF::FixedVector::data):
(WTF::FixedVector::begin):
(WTF::FixedVector::end):
(WTF::FixedVector::data const):
(WTF::FixedVector::begin const):
(WTF::FixedVector::end const):
(WTF::FixedVector::rbegin):
(WTF::FixedVector::rend):
(WTF::FixedVector::rbegin const):
(WTF::FixedVector::rend const):
(WTF::FixedVector::at):
(WTF::FixedVector::at const):
(WTF::FixedVector::operator[]):
(WTF::FixedVector::operator[] const):
(WTF::FixedVector::first):
(WTF::FixedVector::first const):
(WTF::FixedVector::last):
(WTF::FixedVector::last const):
(WTF::FixedVector::fill):
(WTF::FixedVector::operator== const):
(WTF::FixedVector::swap):
(WTF::swap):
* wtf/RefCountedArray.h:
(WTF::RefCountedArray::RefCountedArray):
(WTF::RefCountedArray::fill):
(WTF::RefCountedArray::swap):
2021-04-06 08:54:06 +00:00
2021-04-06 Youenn Fablet <youenn@apple.com>
Enable NSURLSession WebSocket code path by default
https://bugs.webkit.org/show_bug.cgi?id=224102
Reviewed by Alex Christensen.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-04-06 04:25:33 +00:00
2021-04-05 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Shrink some of Vectors in JSC
https://bugs.webkit.org/show_bug.cgi?id=224162
Reviewed by Simon Fraser.
Add rbegin and rend to make RefCountedArray usable for Vector clients who use these features.
* wtf/RefCountedArray.h:
(WTF::RefCountedArray::begin):
(WTF::RefCountedArray::end):
(WTF::RefCountedArray::begin const):
(WTF::RefCountedArray::end const):
(WTF::RefCountedArray::rbegin):
(WTF::RefCountedArray::rend):
(WTF::RefCountedArray::rbegin const):
(WTF::RefCountedArray::rend const):
2021-04-06 03:19:14 +00:00
2021-04-05 Alex Christensen <achristensen@webkit.org>
Resurrect Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=224084
Reviewed by Tim Horton.
* wtf/PlatformMac.cmake:
2021-04-06 02:36:12 +00:00
2021-04-05 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION: ASSERTION FAILED: settings().textAutosizingEnabled() && settings().textAutosizingUsesIdempotentMode() on various tests
https://bugs.webkit.org/show_bug.cgi?id=209450
<rdar://problem/60799255>
Reviewed by Tim Horton.
Replace the call to `setNeedsRecalcStyleInAllFrames` with `textAutosizingUsesIdempotentModeChanged` when
changing whether idempotent text autosizing is enabled.
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-04-06 00:09:31 +00:00
2021-04-05 Yusuke Suzuki <ysuzuki@apple.com>
Define AtomString(ASCIILiteral) and use ASCIILiteral more to avoid memory allocation
https://bugs.webkit.org/show_bug.cgi?id=224125
Reviewed by Saam Barati.
Add AtomString(ASCIILiteral). ASCIILiteral ensures that storage is constant non-heap string by its type.
So we can just use it as a literal (not allocating a string storage).
* wtf/text/AtomString.h:
2021-04-02 22:57:56 +00:00
2021-04-02 Simon Fraser <simon.fraser@apple.com>
Enable PreferPageRenderingUpdatesNear60FPSEnabled by default
https://bugs.webkit.org/show_bug.cgi?id=224133
Reviewed by Tim Horton.
Turn the PreferPageRenderingUpdatesNear60FPSEnabled internal setting on by default. This
means that requestAnimationFrame on 144Hz displays will fire at 72Hz. 60Hz displays are
unaffected.
Firing at "close to 60fps" was determined to be necessary for web compatibility and power.
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-04-02 10:44:16 +00:00
2021-04-02 Youenn Fablet <youenn@apple.com>
[MacOS] Enable NSURLSession WebSocket code path in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=220973
<rdar://problem/73655870>
Reviewed by Darin Adler.
* wtf/PlatformHave.h:
Bump NSURLSessionWebSocket path to above BigSur and iOS14.
2021-04-02 08:50:20 +00:00
2021-04-02 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, fix passing hash value
https://bugs.webkit.org/show_bug.cgi?id=223895
* wtf/RobinHoodHashTable.h:
(WTF::SizePolicy>::addPassingHashCode):
[WTF] Introduce RobinHoodHashTable
https://bugs.webkit.org/show_bug.cgi?id=223895
Reviewed by Fil Pizlo.
Source/JavaScriptCore:
* builtins/BuiltinNames.cpp:
(JSC::lookUpPrivateNameImpl):
(JSC::lookUpWellKnownSymbolImpl):
* builtins/BuiltinNames.h:
* bytecode/BytecodeIntrinsicRegistry.h:
* runtime/Identifier.h:
* runtime/IntlCollator.cpp:
(JSC::IntlCollator::initializeCollator):
(JSC::IntlCollator::checkICULocaleInvariants):
* runtime/IntlCollator.h:
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/IntlDisplayNames.cpp:
(JSC::IntlDisplayNames::initializeDisplayNames):
* runtime/IntlDisplayNamesConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/IntlListFormat.cpp:
(JSC::IntlListFormat::initializeListFormat):
* runtime/IntlListFormatConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::initializeNumberFormat):
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/IntlObject.cpp:
(JSC::addScriptlessLocaleIfNeeded):
(JSC::intlAvailableLocales):
(JSC::intlCollatorAvailableLocales):
(JSC::intlSegmenterAvailableLocales):
(JSC::bestAvailableLocale):
(JSC::lookupMatcher):
(JSC::bestFitMatcher):
(JSC::resolveLocale):
(JSC::lookupSupportedLocales):
(JSC::bestFitSupportedLocales):
(JSC::supportedLocales):
* runtime/IntlObject.h:
(JSC::intlDateTimeFormatAvailableLocales):
(JSC::intlDisplayNamesAvailableLocales):
(JSC::intlNumberFormatAvailableLocales):
(JSC::intlPluralRulesAvailableLocales):
(JSC::intlRelativeTimeFormatAvailableLocales):
(JSC::intlListFormatAvailableLocales):
* runtime/IntlPluralRules.cpp:
(JSC::IntlPluralRules::initializePluralRules):
* runtime/IntlPluralRulesConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/IntlRelativeTimeFormat.cpp:
(JSC::IntlRelativeTimeFormat::initializeRelativeTimeFormat):
* runtime/IntlRelativeTimeFormatConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/IntlSegmenter.cpp:
(JSC::IntlSegmenter::initializeSegmenter):
* runtime/IntlSegmenterConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/RegExpCache.h:
* runtime/RegExpKey.h:
Source/WebCore:
* Modules/mediacapabilities/MediaCapabilities.cpp:
(WebCore::bucketMIMETypes):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::popupValue const):
* dom/Element.cpp:
(WebCore::canAttachAuthorShadowRoot):
* dom/QualifiedName.h:
* dom/make_names.pl:
(printNamesHeaderFile):
(printFactoryCppFile):
(printWrapperFactoryCppFile):
* editing/FormatBlockCommand.cpp:
(WebCore::isElementForFormatBlock):
* editing/RemoveFormatCommand.cpp:
(WebCore::isElementForRemoveFormatCommand):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::isProhibitedParagraphChild):
* html/Autofill.cpp:
(WebCore::fieldNameMap):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::isCaseSensitiveAttribute):
* html/HTMLObjectElement.cpp:
(WebCore::preventsParentObjectFromExposure):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::createCaseMap):
(WebCore::adjustSVGTagNameCase):
(WebCore::adjustAttributes):
(WebCore::createForeignAttributesMap):
(WebCore::adjustForeignAttributes):
(WebCore::addNamesWithPrefix): Deleted.
* page/DebugPageOverlays.cpp:
(WebCore::touchEventRegionColors):
(WebCore::NonFastScrollableRegionOverlay::drawRect):
* page/PerformanceUserTiming.cpp:
(WebCore::restrictedMarkNamesToNavigationTimingFunctionMap):
* platform/cocoa/MIMETypeRegistryCocoa.mm:
(WebCore::extensionsForMIMETypeMap):
* platform/graphics/FontCascade.cpp:
(WebCore::useBackslashAsYenSignForFamily):
(WebCore::FontCascade::hasValidAverageCharWidth const):
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::validInitDataTypes):
* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::defaultSupportedImageTypes):
* platform/graphics/cg/UTIRegistry.h:
* platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
(WebCore::codecTypeForDoViCodecString):
* platform/graphics/cocoa/SourceBufferParserWebM.cpp:
(WebCore::SourceBufferParserWebM::supportedVideoCodecs):
(WebCore::SourceBufferParserWebM::supportedAudioCodecs):
* platform/graphics/cocoa/SourceBufferParserWebM.h:
* rendering/svg/SVGResources.cpp:
(WebCore::clipperFilterMaskerTags):
(WebCore::markerTags):
(WebCore::fillAndStrokeTags):
(WebCore::chainableResourceTags):
* style/StyleAdjuster.cpp:
(WebCore::Style::hasEffectiveDisplayNoneForDisplayContents):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::isSupportedAttribute):
* svg/SVGElement.cpp:
(WebCore::createAttributeNameToCSSPropertyIDMap):
(WebCore::SVGElement::animatableAttributeForName):
(WebCore::SVGElement::cssPropertyIdForSVGAttributeName):
* svg/SVGTests.cpp:
(WebCore::SVGTests::addSupportedAttributes):
* svg/SVGTests.h:
* svg/SVGUseElement.cpp:
(WebCore::createAllowedElementSet):
(WebCore::isDisallowedElement):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::isSupportedAttribute):
* xml/XPathFunctions.cpp:
(WebCore::XPath::createFunctionMap):
* xml/XPathParser.cpp:
(WebCore::XPath::createAxisNamesMap):
Source/WebKit:
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ObservedDomainsTableSchemaV1Alternate):
(WebKit::expectedUnattributedColumns):
(WebKit::expectedAttributedColumns):
(WebKit::createTableQueries):
* Platform/IPC/ArgumentCoders.h:
* Shared/Cocoa/DefaultWebBrowserChecks.mm:
(WebKit::getAppBoundDomainsTesting):
* Shared/WebPreferencesStore.cpp:
(WebKit::WebPreferencesStore::decode):
* Shared/WebPreferencesStore.h:
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess):
* UIProcess/WebProcessProxy.h:
Source/WTF:
This patch implements RobinHoodHashTable[1]. We don't use it as a default hashtable since it has different performance v.s. memory-saving characteristics,
and this patch's goal is not tackling on making this default. Rather, the goal of this patch is introducing it to non-performance sensitive area quickly
so that we can save memory. RobinHoodHashTable more frequently computes hash value compared to HashTable, so this is not drop-in replacement for the existing
one. But still, this is useful since we know that "while there are many small HashTables and they holds much memory, there are super large HashTables and
they holds almost same amount of memory while they are a few.". This patch's goal is applying this RobinHoodHashTable to these "large, but a few" singleton tables.
RobinHoodHashTable maintains distance-from-initial-bucket (DIB) small by adjusting existing entries when inserting. When inserting, if we found that the
existing entry has less DIB than the current inserting entry's DIB, then we swap entries, and insert the existing entry to the other place. This is giving
some good DIB from rich entry to poor entry (that's why it is called RobinHood Hashing), and making average DIB lower. And this algorithm adds good invariant
that, when looking up an entry, and we found that existing entry has smaller DIB, then we can stop searching in the middle of the chain since we know that
we should swap entries when this happened when inserting. These two tricks maintain HashTable performance even under significantly high load factor: 90% load-factor
just works. 95% load-factor regress adding performance, but still it does not become catastrophic compared to normal open-addressing HashTable.
We introduce RobinHoodHashTable, and adding several kinds of tables based on load-factors.
1. MemoryCompactLookupOnlyRobinHoodHashSet / HashMap
This has 95% load-factor. This is suitable for sets and maps which is mostly-constant: constructing once, and looking up repeatedly. In WebKit, there are so
many this kind of tables e.g. singleton HashMap for various kinds of things. We can use this super high load-factor table so that we can save memory even while
we are maintains fast HashTable lookup.
2. MemoryCompactRobinHoodHashSet / HashMap
This has 90% load-factor. It just works, and we can try using it if sets and maps are significantly performance intensive.
3. FastRobinHoodHashSet / HashMap
This has 75% load-factor. This is still good compared to HashSet and HashMap since they are using 50% load-factor for large sized tables. This has very slightly performance regressed
compared to 50% load-factor large HashSet and HashMap, but if that is not performance intensive (e.g. AtomStringTable is one of the most performance intensive table), this is good.
In this patch, we replace many singleton HashSet / HashMap with RobinHoodHashTable.
[1]: https://www.sebastiansylvan.com/post/robin-hood-hashing-should-be-your-default-hash-table-implementation/
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Forward.h:
* wtf/HashMap.h:
(WTF::Y>::swap):
(WTF::Y>::size const):
(WTF::Y>::capacity const):
(WTF::Y>::isEmpty const):
(WTF::Y>::begin):
(WTF::Y>::end):
(WTF::Y>::begin const):
(WTF::Y>::end const):
(WTF::Y>::find):
(WTF::Y>::find const):
(WTF::Y>::contains const):
(WTF::Y>::get const):
(WTF::Y>::inlineGet const):
(WTF::TableTraitsArg>::inlineSet):
(WTF::TableTraitsArg>::inlineAdd):
(WTF::TableTraitsArg>::inlineEnsure):
(WTF::TableTraitsArg>::set):
(WTF::TableTraitsArg>::add):
(WTF::TableTraitsArg>::fastAdd):
(WTF::TableTraitsArg>::ensure):
(WTF::Y>::remove):
(WTF::Y>::removeIf):
(WTF::Y>::clear):
(WTF::Y>::take):
(WTF::Y>::checkConsistency const):
(WTF::Y>::isValidKey):
(WTF::operator==):
(WTF::operator!=):
(WTF::X>::swap): Deleted.
(WTF::X>::size const): Deleted.
(WTF::X>::capacity const): Deleted.
(WTF::X>::isEmpty const): Deleted.
(WTF::X>::begin): Deleted.
(WTF::X>::end): Deleted.
(WTF::X>::begin const): Deleted.
(WTF::X>::end const): Deleted.
(WTF::X>::find): Deleted.
(WTF::X>::find const): Deleted.
(WTF::X>::contains const): Deleted.
(WTF::X>::get const): Deleted.
(WTF::X>::inlineGet const): Deleted.
(WTF::MappedTraitsArg>::inlineSet): Deleted.
(WTF::MappedTraitsArg>::inlineAdd): Deleted.
(WTF::MappedTraitsArg>::inlineEnsure): Deleted.
(WTF::MappedTraitsArg>::set): Deleted.
(WTF::MappedTraitsArg>::add): Deleted.
(WTF::MappedTraitsArg>::fastAdd): Deleted.
(WTF::MappedTraitsArg>::ensure): Deleted.
(WTF::MappedTraits>::get const): Deleted.
(WTF::MappedTraits>::inlineGet const): Deleted.
(WTF::X>::remove): Deleted.
(WTF::X>::removeIf): Deleted.
(WTF::X>::clear): Deleted.
(WTF::MappedTraits>::take): Deleted.
(WTF::X>::take): Deleted.
(WTF::X>::checkConsistency const): Deleted.
(WTF::X>::isValidKey): Deleted.
* wtf/HashSet.h:
(WTF::W>::swap):
(WTF::W>::size const):
(WTF::W>::capacity const):
(WTF::W>::isEmpty const):
(WTF::W>::begin const):
(WTF::W>::end const):
(WTF::W>::find const):
(WTF::W>::contains const):
(WTF::TableTraits>::find const):
(WTF::TableTraits>::contains const):
(WTF::TableTraits>::ensure):
(WTF::W>::add):
(WTF::W>::addVoid):
(WTF::TableTraits>::add):
(WTF::W>::remove):
(WTF::W>::removeIf):
(WTF::W>::clear):
(WTF::W>::take):
(WTF::W>::takeAny):
(WTF::TableTraits>::remove):
(WTF::TableTraits>::take):
(WTF::W>::isValidValue):
(WTF::= const):
(WTF::W>::checkConsistency const):
(WTF::V>::swap): Deleted.
(WTF::V>::size const): Deleted.
(WTF::V>::capacity const): Deleted.
(WTF::V>::isEmpty const): Deleted.
(WTF::V>::begin const): Deleted.
(WTF::V>::end const): Deleted.
(WTF::V>::find const): Deleted.
(WTF::V>::contains const): Deleted.
(WTF::Traits>::find const): Deleted.
(WTF::Traits>::contains const): Deleted.
(WTF::Traits>::ensure): Deleted.
(WTF::V>::add): Deleted.
(WTF::V>::addVoid): Deleted.
(WTF::Traits>::add): Deleted.
(WTF::V>::remove): Deleted.
(WTF::V>::removeIf): Deleted.
(WTF::V>::clear): Deleted.
(WTF::V>::take): Deleted.
(WTF::V>::takeAny): Deleted.
(WTF::Traits>::remove): Deleted.
(WTF::Traits>::take): Deleted.
(WTF::V>::isValidValue): Deleted.
(WTF::V>::checkConsistency const): Deleted.
* wtf/HashTable.h:
(WTF::addIterator):
(WTF::removeIterator):
(WTF::invalidateIterators):
(WTF::HashTable::~HashTable):
(WTF::HashTable::random):
(WTF::KeyTraits>::inlineLookup):
(WTF::KeyTraits>::lookupForWriting):
(WTF::KeyTraits>::fullLookupForWriting):
(WTF::KeyTraits>::addUniqueForInitialization):
(WTF::KeyTraits>::add):
(WTF::KeyTraits>::addPassingHashCode):
(WTF::KeyTraits>::removeAndInvalidateWithoutEntryConsistencyCheck):
(WTF::KeyTraits>::removeAndInvalidate):
(WTF::KeyTraits>::clear):
(WTF::KeyTraits>::swap):
(WTF::KeyTraits>::HashTable):
(WTF::HashTable::invalidateIterators): Deleted.
(WTF::KeyTraits>::invalidateIterators): Deleted.
* wtf/RobinHoodHashMap.h: Added.
* wtf/RobinHoodHashSet.h: Added.
* wtf/RobinHoodHashTable.h: Added.
(WTF::RobinHoodHashTable::~RobinHoodHashTable):
(WTF::RobinHoodHashTable::begin):
(WTF::RobinHoodHashTable::end):
(WTF::RobinHoodHashTable::begin const):
(WTF::RobinHoodHashTable::end const):
(WTF::RobinHoodHashTable::random):
(WTF::RobinHoodHashTable::random const):
(WTF::RobinHoodHashTable::size const):
(WTF::RobinHoodHashTable::capacity const):
(WTF::RobinHoodHashTable::isEmpty const):
(WTF::RobinHoodHashTable::reserveInitialCapacity):
(WTF::RobinHoodHashTable::add):
(WTF::RobinHoodHashTable::find):
(WTF::RobinHoodHashTable::find const):
(WTF::RobinHoodHashTable::contains const):
(WTF::RobinHoodHashTable::isEmptyBucket):
(WTF::RobinHoodHashTable::isEmptyOrDeletedBucket):
(WTF::RobinHoodHashTable::lookup):
(WTF::RobinHoodHashTable::checkTableConsistency):
(WTF::RobinHoodHashTable::internalCheckTableConsistency const):
(WTF::RobinHoodHashTable::internalCheckTableConsistencyExceptSize const):
(WTF::RobinHoodHashTable::internalCheckTableConsistencyExceptSize):
(WTF::RobinHoodHashTable::internalCheckTableConsistency):
(WTF::RobinHoodHashTable::shouldExpand):
(WTF::RobinHoodHashTable::computeTableHash):
(WTF::RobinHoodHashTable::shouldExpand const):
(WTF::RobinHoodHashTable::shouldShrink const):
(WTF::RobinHoodHashTable::shrink):
(WTF::RobinHoodHashTable::deleteBucket):
(WTF::RobinHoodHashTable::desiredIndex):
(WTF::RobinHoodHashTable::probeDistance):
(WTF::RobinHoodHashTable::makeIterator):
(WTF::RobinHoodHashTable::makeConstIterator const):
(WTF::RobinHoodHashTable::makeKnownGoodIterator):
(WTF::RobinHoodHashTable::makeKnownGoodConstIterator const):
(WTF::RobinHoodHashTable::checkTableConsistencyExceptSize):
(WTF::RobinHoodHashTable::tableSize const):
(WTF::RobinHoodHashTable::tableSizeMask const):
(WTF::RobinHoodHashTable::keyCount const):
(WTF::RobinHoodHashTable::tableHash const):
(WTF::SizePolicy>::checkKey):
(WTF::SizePolicy>::lookup):
(WTF::SizePolicy>::inlineLookup):
(WTF::SizePolicy>::initializeBucket):
(WTF::SizePolicy>::add):
(WTF::SizePolicy>::maintainProbeDistanceForAdd):
(WTF::SizePolicy>::addPassingHashCode):
(WTF::SizePolicy>::reinsert):
(WTF::SizePolicy>::find):
(WTF::SizePolicy>::find const):
(WTF::SizePolicy>::contains const):
(WTF::SizePolicy>::removeAndInvalidateWithoutEntryConsistencyCheck):
(WTF::SizePolicy>::removeAndInvalidate):
(WTF::SizePolicy>::remove):
(WTF::SizePolicy>::removeWithoutEntryConsistencyCheck):
(WTF::SizePolicy>::allocateTable):
(WTF::SizePolicy>::deallocateTable):
(WTF::SizePolicy>::expand):
(WTF::SizePolicy>::computeBestTableSize):
(WTF::SizePolicy>::shrinkToBestSize):
(WTF::SizePolicy>::rehash):
(WTF::SizePolicy>::clear):
(WTF::SizePolicy>::RobinHoodHashTable):
(WTF::SizePolicy>::swap):
(WTF::=):
(WTF::SizePolicy>::checkTableConsistency const):
(WTF::SizePolicy>::checkTableConsistencyExceptSize const):
* wtf/text/AtomStringHash.h:
* wtf/text/AtomStringImpl.cpp:
* wtf/text/AtomStringTable.cpp:
(WTF::AtomStringTable::~AtomStringTable):
* wtf/text/AtomStringTable.h:
(WTF::AtomStringTable::table):
* wtf/text/StringHash.h:
Tools:
* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/DeletedAddressOfOperator.h:
* TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::testMovingUsingEnsure):
(TestWebKitAPI::testMovingUsingAdd):
* TestWebKitAPI/Tests/WTF/HashSet.cpp:
(TestWebKitAPI::generateTestCapacityUpToSize<0>):
(TestWebKitAPI::generateTestCapacityUpToSize):
* TestWebKitAPI/Tests/WTF/MoveOnly.h:
* TestWebKitAPI/Tests/WTF/RobinHoodHashMap.cpp: Copied from Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp.
(TestWebKitAPI::TEST):
(TestWebKitAPI::bucketForKey):
(TestWebKitAPI::ZeroHash::hash):
(TestWebKitAPI::ObjectWithRefLogger::ObjectWithRefLogger):
(TestWebKitAPI::testMovingUsingEnsure):
(TestWebKitAPI::testMovingUsingAdd):
(TestWebKitAPI::DerefObserver::ref):
(TestWebKitAPI::DerefObserver::deref):
(TestWebKitAPI::TestObjectWithCustomDestructor::TestObjectWithCustomDestructor):
(TestWebKitAPI::TestObjectWithCustomDestructor::~TestObjectWithCustomDestructor):
* TestWebKitAPI/Tests/WTF/RobinHoodHashSet.cpp: Copied from Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp.
(TestWebKitAPI::capacityForSize):
(TestWebKitAPI::testInitialCapacity):
(TestWebKitAPI::generateTestCapacityUpToSize<0>):
(TestWebKitAPI::generateTestCapacityUpToSize):
(TestWebKitAPI::TEST):
(TestWebKitAPI::DerefObserver::ref):
(TestWebKitAPI::DerefObserver::deref):
Canonical link: https://commits.webkit.org/236073@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-02 08:33:32 +00:00
2021-04-01 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Introduce RobinHoodHashTable
https://bugs.webkit.org/show_bug.cgi?id=223895
Reviewed by Fil Pizlo.
This patch implements RobinHoodHashTable[1]. We don't use it as a default hashtable since it has different performance v.s. memory-saving characteristics,
and this patch's goal is not tackling on making this default. Rather, the goal of this patch is introducing it to non-performance sensitive area quickly
so that we can save memory. RobinHoodHashTable more frequently computes hash value compared to HashTable, so this is not drop-in replacement for the existing
one. But still, this is useful since we know that "while there are many small HashTables and they holds much memory, there are super large HashTables and
they holds almost same amount of memory while they are a few.". This patch's goal is applying this RobinHoodHashTable to these "large, but a few" singleton tables.
RobinHoodHashTable maintains distance-from-initial-bucket (DIB) small by adjusting existing entries when inserting. When inserting, if we found that the
existing entry has less DIB than the current inserting entry's DIB, then we swap entries, and insert the existing entry to the other place. This is giving
some good DIB from rich entry to poor entry (that's why it is called RobinHood Hashing), and making average DIB lower. And this algorithm adds good invariant
that, when looking up an entry, and we found that existing entry has smaller DIB, then we can stop searching in the middle of the chain since we know that
we should swap entries when this happened when inserting. These two tricks maintain HashTable performance even under significantly high load factor: 90% load-factor
just works. 95% load-factor regress adding performance, but still it does not become catastrophic compared to normal open-addressing HashTable.
We introduce RobinHoodHashTable, and adding several kinds of tables based on load-factors.
1. MemoryCompactLookupOnlyRobinHoodHashSet / HashMap
This has 95% load-factor. This is suitable for sets and maps which is mostly-constant: constructing once, and looking up repeatedly. In WebKit, there are so
many this kind of tables e.g. singleton HashMap for various kinds of things. We can use this super high load-factor table so that we can save memory even while
we are maintains fast HashTable lookup.
2. MemoryCompactRobinHoodHashSet / HashMap
This has 90% load-factor. It just works, and we can try using it if sets and maps are significantly performance intensive.
3. FastRobinHoodHashSet / HashMap
This has 75% load-factor. This is still good compared to HashSet and HashMap since they are using 50% load-factor for large sized tables. This has very slightly performance regressed
compared to 50% load-factor large HashSet and HashMap, but if that is not performance intensive (e.g. AtomStringTable is one of the most performance intensive table), this is good.
In this patch, we replace many singleton HashSet / HashMap with RobinHoodHashTable.
[1]: https://www.sebastiansylvan.com/post/robin-hood-hashing-should-be-your-default-hash-table-implementation/
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Forward.h:
* wtf/HashMap.h:
(WTF::Y>::swap):
(WTF::Y>::size const):
(WTF::Y>::capacity const):
(WTF::Y>::isEmpty const):
(WTF::Y>::begin):
(WTF::Y>::end):
(WTF::Y>::begin const):
(WTF::Y>::end const):
(WTF::Y>::find):
(WTF::Y>::find const):
(WTF::Y>::contains const):
(WTF::Y>::get const):
(WTF::Y>::inlineGet const):
(WTF::TableTraitsArg>::inlineSet):
(WTF::TableTraitsArg>::inlineAdd):
(WTF::TableTraitsArg>::inlineEnsure):
(WTF::TableTraitsArg>::set):
(WTF::TableTraitsArg>::add):
(WTF::TableTraitsArg>::fastAdd):
(WTF::TableTraitsArg>::ensure):
(WTF::Y>::remove):
(WTF::Y>::removeIf):
(WTF::Y>::clear):
(WTF::Y>::take):
(WTF::Y>::checkConsistency const):
(WTF::Y>::isValidKey):
(WTF::operator==):
(WTF::operator!=):
(WTF::X>::swap): Deleted.
(WTF::X>::size const): Deleted.
(WTF::X>::capacity const): Deleted.
(WTF::X>::isEmpty const): Deleted.
(WTF::X>::begin): Deleted.
(WTF::X>::end): Deleted.
(WTF::X>::begin const): Deleted.
(WTF::X>::end const): Deleted.
(WTF::X>::find): Deleted.
(WTF::X>::find const): Deleted.
(WTF::X>::contains const): Deleted.
(WTF::X>::get const): Deleted.
(WTF::X>::inlineGet const): Deleted.
(WTF::MappedTraitsArg>::inlineSet): Deleted.
(WTF::MappedTraitsArg>::inlineAdd): Deleted.
(WTF::MappedTraitsArg>::inlineEnsure): Deleted.
(WTF::MappedTraitsArg>::set): Deleted.
(WTF::MappedTraitsArg>::add): Deleted.
(WTF::MappedTraitsArg>::fastAdd): Deleted.
(WTF::MappedTraitsArg>::ensure): Deleted.
(WTF::MappedTraits>::get const): Deleted.
(WTF::MappedTraits>::inlineGet const): Deleted.
(WTF::X>::remove): Deleted.
(WTF::X>::removeIf): Deleted.
(WTF::X>::clear): Deleted.
(WTF::MappedTraits>::take): Deleted.
(WTF::X>::take): Deleted.
(WTF::X>::checkConsistency const): Deleted.
(WTF::X>::isValidKey): Deleted.
* wtf/HashSet.h:
(WTF::W>::swap):
(WTF::W>::size const):
(WTF::W>::capacity const):
(WTF::W>::isEmpty const):
(WTF::W>::begin const):
(WTF::W>::end const):
(WTF::W>::find const):
(WTF::W>::contains const):
(WTF::TableTraits>::find const):
(WTF::TableTraits>::contains const):
(WTF::TableTraits>::ensure):
(WTF::W>::add):
(WTF::W>::addVoid):
(WTF::TableTraits>::add):
(WTF::W>::remove):
(WTF::W>::removeIf):
(WTF::W>::clear):
(WTF::W>::take):
(WTF::W>::takeAny):
(WTF::TableTraits>::remove):
(WTF::TableTraits>::take):
(WTF::W>::isValidValue):
(WTF::= const):
(WTF::W>::checkConsistency const):
(WTF::V>::swap): Deleted.
(WTF::V>::size const): Deleted.
(WTF::V>::capacity const): Deleted.
(WTF::V>::isEmpty const): Deleted.
(WTF::V>::begin const): Deleted.
(WTF::V>::end const): Deleted.
(WTF::V>::find const): Deleted.
(WTF::V>::contains const): Deleted.
(WTF::Traits>::find const): Deleted.
(WTF::Traits>::contains const): Deleted.
(WTF::Traits>::ensure): Deleted.
(WTF::V>::add): Deleted.
(WTF::V>::addVoid): Deleted.
(WTF::Traits>::add): Deleted.
(WTF::V>::remove): Deleted.
(WTF::V>::removeIf): Deleted.
(WTF::V>::clear): Deleted.
(WTF::V>::take): Deleted.
(WTF::V>::takeAny): Deleted.
(WTF::Traits>::remove): Deleted.
(WTF::Traits>::take): Deleted.
(WTF::V>::isValidValue): Deleted.
(WTF::V>::checkConsistency const): Deleted.
* wtf/HashTable.h:
(WTF::addIterator):
(WTF::removeIterator):
(WTF::invalidateIterators):
(WTF::HashTable::~HashTable):
(WTF::HashTable::random):
(WTF::KeyTraits>::inlineLookup):
(WTF::KeyTraits>::lookupForWriting):
(WTF::KeyTraits>::fullLookupForWriting):
(WTF::KeyTraits>::addUniqueForInitialization):
(WTF::KeyTraits>::add):
(WTF::KeyTraits>::addPassingHashCode):
(WTF::KeyTraits>::removeAndInvalidateWithoutEntryConsistencyCheck):
(WTF::KeyTraits>::removeAndInvalidate):
(WTF::KeyTraits>::clear):
(WTF::KeyTraits>::swap):
(WTF::KeyTraits>::HashTable):
(WTF::HashTable::invalidateIterators): Deleted.
(WTF::KeyTraits>::invalidateIterators): Deleted.
* wtf/RobinHoodHashMap.h: Added.
* wtf/RobinHoodHashSet.h: Added.
* wtf/RobinHoodHashTable.h: Added.
(WTF::RobinHoodHashTable::~RobinHoodHashTable):
(WTF::RobinHoodHashTable::begin):
(WTF::RobinHoodHashTable::end):
(WTF::RobinHoodHashTable::begin const):
(WTF::RobinHoodHashTable::end const):
(WTF::RobinHoodHashTable::random):
(WTF::RobinHoodHashTable::random const):
(WTF::RobinHoodHashTable::size const):
(WTF::RobinHoodHashTable::capacity const):
(WTF::RobinHoodHashTable::isEmpty const):
(WTF::RobinHoodHashTable::reserveInitialCapacity):
(WTF::RobinHoodHashTable::add):
(WTF::RobinHoodHashTable::find):
(WTF::RobinHoodHashTable::find const):
(WTF::RobinHoodHashTable::contains const):
(WTF::RobinHoodHashTable::isEmptyBucket):
(WTF::RobinHoodHashTable::isEmptyOrDeletedBucket):
(WTF::RobinHoodHashTable::lookup):
(WTF::RobinHoodHashTable::checkTableConsistency):
(WTF::RobinHoodHashTable::internalCheckTableConsistency const):
(WTF::RobinHoodHashTable::internalCheckTableConsistencyExceptSize const):
(WTF::RobinHoodHashTable::internalCheckTableConsistencyExceptSize):
(WTF::RobinHoodHashTable::internalCheckTableConsistency):
(WTF::RobinHoodHashTable::shouldExpand):
(WTF::RobinHoodHashTable::computeTableHash):
(WTF::RobinHoodHashTable::shouldExpand const):
(WTF::RobinHoodHashTable::shouldShrink const):
(WTF::RobinHoodHashTable::shrink):
(WTF::RobinHoodHashTable::deleteBucket):
(WTF::RobinHoodHashTable::desiredIndex):
(WTF::RobinHoodHashTable::probeDistance):
(WTF::RobinHoodHashTable::makeIterator):
(WTF::RobinHoodHashTable::makeConstIterator const):
(WTF::RobinHoodHashTable::makeKnownGoodIterator):
(WTF::RobinHoodHashTable::makeKnownGoodConstIterator const):
(WTF::RobinHoodHashTable::checkTableConsistencyExceptSize):
(WTF::RobinHoodHashTable::tableSize const):
(WTF::RobinHoodHashTable::tableSizeMask const):
(WTF::RobinHoodHashTable::keyCount const):
(WTF::RobinHoodHashTable::tableHash const):
(WTF::SizePolicy>::checkKey):
(WTF::SizePolicy>::lookup):
(WTF::SizePolicy>::inlineLookup):
(WTF::SizePolicy>::initializeBucket):
(WTF::SizePolicy>::add):
(WTF::SizePolicy>::maintainProbeDistanceForAdd):
(WTF::SizePolicy>::addPassingHashCode):
(WTF::SizePolicy>::reinsert):
(WTF::SizePolicy>::find):
(WTF::SizePolicy>::find const):
(WTF::SizePolicy>::contains const):
(WTF::SizePolicy>::removeAndInvalidateWithoutEntryConsistencyCheck):
(WTF::SizePolicy>::removeAndInvalidate):
(WTF::SizePolicy>::remove):
(WTF::SizePolicy>::removeWithoutEntryConsistencyCheck):
(WTF::SizePolicy>::allocateTable):
(WTF::SizePolicy>::deallocateTable):
(WTF::SizePolicy>::expand):
(WTF::SizePolicy>::computeBestTableSize):
(WTF::SizePolicy>::shrinkToBestSize):
(WTF::SizePolicy>::rehash):
(WTF::SizePolicy>::clear):
(WTF::SizePolicy>::RobinHoodHashTable):
(WTF::SizePolicy>::swap):
(WTF::=):
(WTF::SizePolicy>::checkTableConsistency const):
(WTF::SizePolicy>::checkTableConsistencyExceptSize const):
* wtf/text/AtomStringHash.h:
* wtf/text/AtomStringImpl.cpp:
* wtf/text/AtomStringTable.cpp:
(WTF::AtomStringTable::~AtomStringTable):
* wtf/text/AtomStringTable.h:
(WTF::AtomStringTable::table):
* wtf/text/StringHash.h:
2021-04-02 03:19:40 +00:00
2021-04-01 Kate Cheney <katherine_cheney@apple.com>
Clear network website data when a user clears history/website data
https://bugs.webkit.org/show_bug.cgi?id=224030
<rdar://problem/75288338>
Reviewed by David Kilzer.
* wtf/cocoa/SoftLinking.h:
Add a new soft link macro to link umbrella private frameworks. We need
this to support internal additions we need to clear network domain data.
2021-04-01 20:59:15 +00:00
2021-04-01 Chris Dumez <cdumez@apple.com>
REGRESSION(r275267): [GTK][WPE] 12 new crashes on service-workers layout tests
https://bugs.webkit.org/show_bug.cgi?id=224059
Reviewed by Carlos Alberto Lopez Perez.
Have the glib implementation of FileSystem::writeToFile() return early when the size to
write is 0, instead of calling g_output_stream_write_all(). It appears that passing a
NULL buffer to g_output_stream_write_all() crashes, even if size is 0.
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::writeToFile):
2021-04-01 18:09:13 +00:00
2021-03-31 Jiewen Tan <jiewen_tan@apple.com>
Allow ASCWebKitSPISupport to be used on macOS
https://bugs.webkit.org/show_bug.cgi?id=224036
<rdar://76028645>
Reviewed by Brent Fulgham.
* wtf/PlatformHave.h:
2021-03-31 20:32:02 +00:00
2021-03-31 Sam Weinig <weinig@apple.com>
Ease experimentation by enabling <model> if SEPARATED_MODEL is being used
https://bugs.webkit.org/show_bug.cgi?id=224011
Reviewed by Tim Horton.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
There is little point to experimenting with SEPARATED_MODEL if <model> is disabled.
2021-03-31 18:29:23 +00:00
2021-03-31 Antoine Quint <graouts@webkit.org>
Remove CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED
https://bugs.webkit.org/show_bug.cgi?id=224000
Reviewed by Simon Fraser.
Since trunk is no longer maintained on macOS versions earlier than 10.15,
we can remove this compile-time flag.
* wtf/PlatformHave.h:
Service Worker scripts use too much memory in the network process
https://bugs.webkit.org/show_bug.cgi?id=223808
<rdar://75637093>
Reviewed by Geoff Garen.
Source/WebCore:
Previously, the network process would store service worker scripts in a SQLite database.
When starting to use service workers, we would load all those scripts from the database
into memory. This would use a decent amount of memory in the network process.
To address the issue, the approach is this patch is to store the scripts as separate
files on the filesystem instead. This when, when loading them, we can simply mmap() them
and greatly reduce dirty memory usage.
Note that the service worker process (which may be the WebContent process) also keeps a
copy of the imported service worker scripts for the service workers it is running. More
work will be needed in a follow-up but we should be able to extend the approach so that
the service worker process would only have a mmap'd version of those scripts. This would
reduce dirty memory usage on the WebContent/ServiceWorker process side as well. I am
doing this separately though to reduce patch size and facilitate review.
No new tests, there should be no Web-facing behavior change, just a decreased
dirty memory usage in the network process when service workers are used.
I did manual memory testing with a very large service worker that had one ~100MB main
script, importing another ~100MB script.
Here are the memory results without my change:
- Networking (Dirty): 238MB (cold) / 331MB (warm)
- WebContent (Dirty): 441MB (cold) / 857MB (warm)
Here are the memory results with my change:
- Networking (Dirty): 22MB (cold) / 14MB (warm)
- WebContent (Dirty): 440MB (cold) / 438MB (warm)
This shows that ALL memory from the scripts in the network process is no longer marked
as dirty. We also see a significant progression in the WebProcess in the warm case, since
the scripts are coming from the network process as shared memory in this case. There is
no progression in the WebProcess in the cold case yet, since the script were just
downloaded and are coming from the WebProcess to the NetworkProcess. In a follow-up, the
network process could send shared memory back to the WebProcess, after saving the scripts
to disk, so that the WebProcess can replace the copies of its scripts and save more memory.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Add new SWScriptStorage class to the project.
* inspector/agents/worker/ServiceWorkerAgent.cpp:
(WebCore::ServiceWorkerAgent::getInitializationInfo):
Convert the script type from SharedBuffer to String.
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::operator== const):
Fix assertions that were hitting when comparing to empty SharedBuffers (offset would be 0
and size would be 0). This was caught by API tests since we have some service worker API
tests that use empty worker scripts.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
Add some conversion from String to SharedBuffer to the script, and vice-versa, in the
service worker case.
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
(WebCore::scriptBufferToString):
(WebCore::stringToScriptBuffer):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::ImportedScript::isolatedCopy const):
(WebCore::ServiceWorkerContextData::ImportedScript::decode):
(WebCore::ServiceWorkerContextData::decode):
- Store scripts as SharedBuffer instead of String, so that they can hold
mmap'd data.
- Add scriptBufferToString() / stringToScriptBuffer() utility functions to
convert script sources between String and SharedBuffer.
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
Convert from script from SharedBuffer to String.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::recordsTableSchema):
Update database schema and bump version now that we no longer store the
service worker script inside the SQLite database. Instead, those scripts
are stored separately on the filesystem via SWScriptStorage.
(WebCore::ImportedScriptAttributes::encode const):
(WebCore::ImportedScriptAttributes::decode):
Introduce new ImportedScriptAttributes struct which contains all the data
members of ServiceWorkerContextData::ImportedScript, except for the actual
script source. We now save a HashMap of ImportedScriptAttributes in the
databasae instead of HashMap of ImportedScript since we no longer want to
store imported script sources in the database, but rather store them
separately on the file system.
(WebCore::stripScriptSources):
Utility function to convert a HashMap of ServiceWorkerContextData::ImportedScript
into a HashMap of ImportedScriptAttributes (identical but without the script
source), ready to save in the SQLite database.
(WebCore::populateScriptSourcesFromDisk):
Utility function to construct a HashMap of ServiceWorkerContextData::ImportedScript
from a HasMap of ImportedScriptAttributes, coming from the SQLiteDatabase. The
missing script sources are fetched from the disk via SWScriptStorage.
(WebCore::RegistrationDatabase::~RegistrationDatabase):
Make sure we destroy the SWScriptStorage on the background queue for thread-safety.
(WebCore::RegistrationDatabase::scriptStorageDirectory const):
Returns the path on the filesystem where service worker scripts are stored.
(WebCore::RegistrationDatabase::scriptStorage):
Constructs (if necessary) a SWScriptStorage and return it.
(WebCore::RegistrationDatabase::clearAll):
Make sure we clear all the service worker scripts on disk in addition to the database,
now that they are stored separately.
(WebCore::RegistrationDatabase::doPushChanges):
- Stop storing the script sources in the SQLite database, and instead store them as separate
files on the file system via SWScriptStorage.
- Improve logging
- When done storing the scripts to disk, send these new mmap'd versions back to the
SWServerWorker on the main thread, so that it can replace it's heavy script sources with
these ones. This helps reduce memory usage.
(WebCore::RegistrationDatabase::importRecords):
- Load the script sources from the disk via SWScriptStorage, now that they are no longer
stored in the SQLite database.
- Improve logging.
* workers/service/server/RegistrationDatabase.h:
* workers/service/server/RegistrationStore.cpp:
(WebCore::RegistrationStore::didSaveWorkerScriptsToDisk):
* workers/service/server/RegistrationStore.h:
Pass scripts that were saved to disk from the store to the SWServerWorker so that it
can replace its scripts sources with those new mmap'd version, in order to save memory.
* workers/service/server/SWScriptStorage.cpp: Added.
(WebCore::hashURL):
(WebCore::SWScriptStorage::SWScriptStorage):
(WebCore::SWScriptStorage::registrationDirectory const):
(WebCore::SWScriptStorage::scriptPath const):
(WebCore::SWScriptStorage::store):
(WebCore::SWScriptStorage::retrieve):
(WebCore::SWScriptStorage::clear):
* workers/service/server/SWScriptStorage.h: Added.
Add SWScriptStorage to deal with the storage / retrieval of Service
Worker scripts to / from disk, as files on the file system. When
going a retrieval, we return a script as a SharedBuffer which usually contains
mmap'd() data (we don't use mmap() for files that are smaller than the PAGE_SIZE).
The scripts reside in a Scripts/ folder, beside the database. The scripts are separated
by origin (using SHA256 of the origin as folder name with salt), and then by registration (by
using SHA256 of the registration scope as subfolder name with salt). The file name for the script
is a SHA256 of the script URL with salt.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::didSaveWorkerScriptsToDisk):
Pass scripts that were saved to disk from the store to the SWServerWorker so that it
can replace its scripts sources with those new mmap'd version, in order to save memory.
(WebCore::SWServer::updateWorker):
Convert script from String to SharedBuffer.
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
Convert script from SharedBuffer to String.
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::setScriptResource):
* workers/service/server/SWServerToContextConnection.h:
Take in a ServiceWorkerContextData::ImportedScript for convenience, instead of taking
all its data members as separate parameters.
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
* workers/service/server/SWServerWorker.h:
(WebCore::SWServerWorker::script const):
Use SharedBuffer type for script instead of String type, so that we can hold on the
mmap'd data and reduce memory usage.
Source/WebKit:
* NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
Pass a ServiceWorkerContextData::ImportedScript struct in the SetScriptResource IPC
for convenience. We used to pass the ImportedScript data members separately.
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::clearAllCachesFromDisk):
(WebKit::CacheStorage::Engine::clearCachesForOriginFromDirectories):
(WebKit::CacheStorage::Engine::deleteNonEmptyDirectoryOnBackgroundThread):
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::deleteOldVersions):
Drop deleteDirectoryRecursively() implementation and use the existing
FileSystem::deleteNonEmptyDirectory() in wtf instead.
* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::Data::mapToFile const):
Moved some of the mapToFile() logic to WTF, so that it can be reused.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::encodeSharedBuffer):
(IPC::decodeSharedBuffer):
Update SharedBuffer's IPC argument coder to distinguish a null SharedBuffer
and an empty one. We now use SharedBuffer to store service worker script sources
and it is possible for the script sources to be empty (and they are in some of
our API tests).
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::setScriptResource):
Pass a ServiceWorkerContextData::ImportedScript struct in the SetScriptResource IPC
for convenience. We used to pass the ImportedScript data members separately.
Source/WTF:
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::deleteNonEmptyDirectory):
Add an implementation of FileSystem::deleteNonEmptyDirectory() on all supported platforms.
We previously only had implemetations for Cocoa and Windows.
(WTF::FileSystemImpl::mapToFile):
Moved most of the mapToFile() logic from NetworkCacheData::mapToFile() to FileSystem, so that
it can be reused by the new SWScriptStorage class. It creates the destination file, mmap's it,
writes the provided data to it and then returns the mmap'd file.
(WTF::FileSystemImpl::readOrMakeSalt):
Move readOrMakeSalt() from NetworkCacheData to FileSystem so that it can be reused by the new
SWScriptStorage.
* wtf/FileSystem.h:
Tools:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/SimpleServiceWorkerRegistrations-4.sqlite3: Removed.
Drop outdated pre-baked service worker registration database as it is no longer
needed and it is a pain to keep up to date.
* TestWebKitAPI/Tests/WTF/FileSystem.cpp:
(TestWebKitAPI::TEST_F):
Add API test coverage for FileSystem::deleteNonEmptyDirectory(). It is not a new API but it
had no tests, it used more in this patch and we now have an implementation on all supported
platforms.
* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
- Tweak service worker tests so that they expect a version 6 database instead of version 5,
since I updated the database scheme and bumped the version.
- Update test that was relying on a pre-baked service worker database file (with old schema) and
have it dynamically generate the database instead by loading a page that registers a service
worker.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Canonical link: https://commits.webkit.org/235952@main
2021-03-31 04:25:00 +00:00
2021-03-30 Chris Dumez <cdumez@apple.com>
Service Worker scripts use too much memory in the network process
https://bugs.webkit.org/show_bug.cgi?id=223808
<rdar://75637093>
Reviewed by Geoff Garen.
* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::deleteNonEmptyDirectory):
Add an implementation of FileSystem::deleteNonEmptyDirectory() on all supported platforms.
We previously only had implemetations for Cocoa and Windows.
(WTF::FileSystemImpl::mapToFile):
Moved most of the mapToFile() logic from NetworkCacheData::mapToFile() to FileSystem, so that
it can be reused by the new SWScriptStorage class. It creates the destination file, mmap's it,
writes the provided data to it and then returns the mmap'd file.
(WTF::FileSystemImpl::readOrMakeSalt):
Move readOrMakeSalt() from NetworkCacheData to FileSystem so that it can be reused by the new
SWScriptStorage.
* wtf/FileSystem.h:
JSGlobalObject's m_customGetterFunctionMap and m_customSetterFunctionMap should be sets, not maps, and should use both the identifier and function pointer as the key
https://bugs.webkit.org/show_bug.cgi?id=223613
Reviewed by Saam Barati.
Source/JavaScriptCore:
- Adds a generic WeakGCSet class to go with the existing WeakGCMap.
- Renames WeakGCMapBase to WeakGCHashTable, moves it to its own file
and now uses it as the base class of both WeakGCSet and WeakGCMap.
- Replaces JSGlobalObject's customGetterFunctionMap/customSetterFunctionMap
with customGetterFunctionSet/customSetterFunctionSet, using the new
WeakGCSet, and updates them to use both the function pointer and
property name for the key, rather than just the function pointer which
is what the previous code did. This allows multiple custom functions
to use the same underlying function pointer as long as they have distinct
property names, which is going to be used to optimize the bindings for
CSSStyleDeclaration.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
Add new files.
* heap/Heap.cpp:
(JSC::Heap::runEndPhase):
(JSC::Heap::pruneStaleEntriesFromWeakGCHashTables):
(JSC::Heap::registerWeakGCHashTable):
(JSC::Heap::unregisterWeakGCHashTable):
(JSC::Heap::pruneStaleEntriesFromWeakGCMaps): Deleted.
(JSC::Heap::registerWeakGCMap): Deleted.
(JSC::Heap::unregisterWeakGCMap): Deleted.
* heap/Heap.h:
Update for new name. WeakGCMapBase -> WeakGCHashTable.
* runtime/JSCInlines.h:
Add WeakGCSetInlines.h
* runtime/JSCustomGetterFunction.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSCustomGetterFunction::JSCustomGetterFunction):
(JSC::JSCustomGetterFunction::create):
* runtime/JSCustomGetterFunction.h:
* runtime/JSCustomSetterFunction.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSCustomSetterFunction::JSCustomSetterFunction):
(JSC::JSCustomSetterFunction::create):
* runtime/JSCustomSetterFunction.h:
Add helper type CustomFunctionPointer and helper function customFunctionPointer()
to allow some generic hashing code to run on either JSCustomGetterFunction
or JSCustomSetterFunction.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::WeakCustomGetterOrSetterHash::hash):
(JSC::JSGlobalObject::WeakCustomGetterOrSetterHash::equal):
(JSC::JSGlobalObject::customGetterFunctionSet):
(JSC::JSGlobalObject::customSetterFunctionSet):
(JSC::JSGlobalObject::customGetterFunctionMap): Deleted.
(JSC::JSGlobalObject::customSetterFunctionMap): Deleted.
Replace m_customGetterFunctionMap/m_customSetterFunctionMap with
m_customGetterFunctionSet/m_customSetterFunctionSet. As the key is included
in the value, it saves space to use a set rather than a map. We now also
hash and compare both the function pointer and the property name to allow
sharing implementations.
* runtime/JSObject.cpp:
(JSC::WeakCustomGetterOrSetterHashTranslator::hash):
(JSC::WeakCustomGetterOrSetterHashTranslator::equal):
(JSC::createCustomGetterFunction):
(JSC::createCustomSetterFunction):
Update creation functions to use the new sets, making use of the
ensureValue function and a HashTranslator allowing the use of a
std::pair<PropertyName, FunctionPointer> as an alternative lookup
key. This allows us to avoid creating the JSCustomGetterFunction/JSCustomSetterFunction
pointer if one with the same property name and function pointer are
already in the set.
* runtime/WeakGCHashTable.h: Added.
(JSC::WeakGCHashTable::~WeakGCHashTable):
Moved from WeakGCMap and renamed as it is now the base of both
WeakGCMap and WeakGCSet.
* runtime/WeakGCMap.h:
Update to use new WeakGCHashTable base class.
* runtime/WeakGCMapInlines.h:
(JSC::KeyTraitsArg>::WeakGCMap):
(JSC::KeyTraitsArg>::~WeakGCMap):
Update for new Heap function names for WeakGCHashTable.
* runtime/WeakGCSet.h: Added.
* runtime/WeakGCSetInlines.h: Added.
(JSC::TraitsArg>::WeakGCSet):
(JSC::TraitsArg>::~WeakGCSet):
(JSC::TraitsArg>::find):
(JSC::TraitsArg>::find const):
(JSC::TraitsArg>::contains const):
(JSC::TraitsArg>::pruneStaleEntries):
Added a minimal WeakGCSet based on WeakGCMap.
Source/WTF:
Adds a heterogenous HashSet::ensure, which allows lazy construction of the value to
insert into the HashSet only if the heterogenous key (e.g. a key + HashTranslator
that are not the same as the HashSet's ValueType) does not match any item in the
set. For example given a set of ExpensiveToConstruct, but uniquely identifiable
by CheapToConstruct:
HashSet<ExpensiveToConstruct> hashSet;
...
struct Translator {
static unsigned hash(const CheapToConstruct& key)
{
return key.hash();
}
static bool equal(const ExpensiveToConstruct& a, const CheapToConstruct& b)
{
return a == b;
}
};
hashSet.ensure<Translator>(CheapToConstruct { ... }, [] {
return ExpensiveToConstruct { ... };
});
This will be used by the custom getter/setter sets to avoid constructing the GC objects
unless they are really needed.
Also took the opertunity to replace some typedefs with usings, and fixed some comments.
* wtf/HashSet.h:
(WTF::Traits>::ensure):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Canonical link: https://commits.webkit.org/235948@main
2021-03-31 02:55:38 +00:00
2021-03-30 Sam Weinig <weinig@apple.com>
JSGlobalObject's m_customGetterFunctionMap and m_customSetterFunctionMap should be sets, not maps, and should use both the identifier and function pointer as the key
https://bugs.webkit.org/show_bug.cgi?id=223613
Reviewed by Saam Barati.
Adds a heterogenous HashSet::ensure, which allows lazy construction of the value to
insert into the HashSet only if the heterogenous key (e.g. a key + HashTranslator
that are not the same as the HashSet's ValueType) does not match any item in the
set. For example given a set of ExpensiveToConstruct, but uniquely identifiable
by CheapToConstruct:
HashSet<ExpensiveToConstruct> hashSet;
...
struct Translator {
static unsigned hash(const CheapToConstruct& key)
{
return key.hash();
}
static bool equal(const ExpensiveToConstruct& a, const CheapToConstruct& b)
{
return a == b;
}
};
hashSet.ensure<Translator>(CheapToConstruct { ... }, [] {
return ExpensiveToConstruct { ... };
});
This will be used by the custom getter/setter sets to avoid constructing the GC objects
unless they are really needed.
Also took the opertunity to replace some typedefs with usings, and fixed some comments.
* wtf/HashSet.h:
(WTF::Traits>::ensure):
2021-03-30 23:12:22 +00:00
2021-03-30 Mark Lam <mark.lam@apple.com>
Add disableForwardingVPrintfStdErrToOSLog() and use it in the jsc shell.
https://bugs.webkit.org/show_bug.cgi?id=223963
Reviewed by Saam Barati.
* wtf/Assertions.cpp:
(WTF::disableForwardingVPrintfStdErrToOSLog):
* wtf/Assertions.h:
* wtf/WTFConfig.h:
2021-03-29 20:31:13 +00:00
2021-03-29 Alex Christensen <achristensen@webkit.org>
Use terminate_with_reason instead of xpc_connection_kill
https://bugs.webkit.org/show_bug.cgi?id=223618
Reviewed by Darin Adler.
* wtf/spi/darwin/XPCSPI.h:
2021-03-29 05:27:15 +00:00
2021-03-28 Cameron McCormack <heycam@apple.com>
Enable AspectRatioOfImgFromWidthAndHeightEnabled for WebKitLegacy.
https://bugs.webkit.org/show_bug.cgi?id=223815
Reviewed by Sam Weinig.
There's no reason this is enabled for WebKit and not WebKitLegacy.
And set WebCore = true since this feature could conceivably be
used in SVG images.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-03-28 19:14:20 +00:00
2021-03-28 Sam Weinig <weinig@apple.com>
Remove ENABLE_INDEXED_DATABASE & ENABLE_INDEXED_DATABASE_IN_WORKERS, it seems like it is on for all ports
https://bugs.webkit.org/show_bug.cgi?id=223810
Reviewed by Simon Fraser.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
Remove ENABLE_INDEXED_DATABASE and ENABLE_INDEXED_DATABASE_IN_WORKERS.
2021-03-27 21:05:23 +00:00
2021-03-27 Chris Dumez <cdumez@apple.com>
wtf/Vector.h:1276:88: runtime error: reference binding to null pointer of type 'const WebCore::Style::RuleFeature'
https://bugs.webkit.org/show_bug.cgi?id=223828
Reviewed by David Kilzer.
Fix issue found by UBSan in Vector::append(const U*, size_t):
wtf/Vector.h:1276:88: runtime error: reference binding to null pointer of type 'const WebCore::Style::RuleFeature'
wtf/Vector.h:1276:88: runtime error: reference binding to null pointer of type 'const WebCore::LayoutRect'
wtf/Vector.h:1276:88: runtime error: reference binding to null pointer of type 'const WTF::RefPtr<WebCore::CSSStyleSheet, WTF::RawPtrTraits<WebCore::CSSStyleSheet>, WTF::DefaultRefDerefTraits<WebCore::CSSStyleSheet> >'
* wtf/Vector.h:
(WTF::Malloc>::append):
Return early if dataSize is 0. For some call sites, the pointer may be null and dataSize is 0. In such cases,
we should just return early instead of proceeding and using the null pointer. I believe this can happen if
you call Vector::appendVector() with an empty Vector for example.
2021-03-27 01:00:34 +00:00
2021-03-26 Chris Dumez <cdumez@apple.com>
REGRESSION (r275038?): Perf test IndexedDB/stress/large-binary-keys.html failing with logging about memory pressure events
https://bugs.webkit.org/show_bug.cgi?id=223826
<rdar://problem/75906134>
Reviewed by Darin Adler.
Use RELEASE_LOG() instead of WTFLogAlways() to log memory pressure events, so that they don't
show on stdout in the performance tests and make them fail.
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
2021-03-26 23:12:25 +00:00
2021-03-26 Wenson Hsieh <wenson_hsieh@apple.com>
Use PUICQuickboardController for text input when HAVE(QUICKBOARD_CONTROLLER) is defined
https://bugs.webkit.org/show_bug.cgi?id=223809
<rdar://problem/56730407>
Reviewed by Tim Horton.
Remove the `QuickboardControllerForTextInputEnabled` WebKit preference, now that the feature is enabled by
default behind a build-time flag.
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-03-26 20:05:48 +00:00
2021-03-26 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Use new Apple ICU APIs to avoid C++ ICU API usage
https://bugs.webkit.org/show_bug.cgi?id=223783
<rdar://problem/75060240>
Reviewed by Mark Lam.
* wtf/DateMath.h:
(WTF::LocalTimeOffset::LocalTimeOffset):
2021-03-26 19:26:35 +00:00
2021-03-26 Per Arne <pvollan@apple.com>
Enforce notifyd message filtering
https://bugs.webkit.org/show_bug.cgi?id=223601
<rdar://75098580>
Reviewed by Brent Fulgham.
Add ENABLE define for Notify filtering.
* wtf/PlatformEnableCocoa.h:
2021-03-26 10:28:55 +00:00
2021-03-26 Dean Jackson <dino@apple.com>
Enable Metal ANGLE backend for WebGL
https://bugs.webkit.org/show_bug.cgi?id=220076
<rdar://problem/72565020>
Reviewed by Sam Weinig.
Turn the Metal backend for ANGLE on, moving the feature
from Internal to Experimental.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-03-26 07:02:15 +00:00
2021-03-26 Jessie Berlin <jberlin@webkit.org>
Update the BEFORE/SINCE, SYSTEM_VERSION_PREFIX, and MACOSX_DEPLOYMENT_TARGET flags
https://bugs.webkit.org/show_bug.cgi?id=223779
Reviewed by Tim Horton.
* Configurations/DebugRelease.xcconfig:
2021-03-26 05:09:24 +00:00
2021-03-25 Megan Gardner <megan_gardner@apple.com>
Have App Highlights be a Configuration Setting instead of an internal Preference setting.
https://bugs.webkit.org/show_bug.cgi?id=223720
rdar://75196085
Reviewed by Wenson Hsieh.
* Scripts/Preferences/WebPreferences.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-03-26 01:29:16 +00:00
2021-03-25 Jessie Berlin <jberlin@webkit.org>
Remove 10.13 DEPLOYMENT_TARGETs and SYSTEM_VERSION_PREFIXs
https://bugs.webkit.org/show_bug.cgi?id=223765
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
2021-03-25 22:47:37 +00:00
2021-03-25 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r275057.
https://bugs.webkit.org/show_bug.cgi?id=223768
Caused build failure
Reverted changeset:
"Enforce notifyd message filtering"
https://bugs.webkit.org/show_bug.cgi?id=223601
https://trac.webkit.org/changeset/275057
2021-03-25 21:49:33 +00:00
2021-03-25 Kate Cheney <katherine_cheney@apple.com>
Some calls in AuthenticatorPresenterCoordinator::selectAssertionResponse are not yet available for mac
https://bugs.webkit.org/show_bug.cgi?id=223752
<rdar://problem/75808515>
Reviewed by Jiewen Tan.
* wtf/PlatformHave.h:
2021-03-25 21:23:45 +00:00
2021-03-25 Per Arne <pvollan@apple.com>
Enforce notifyd message filtering
https://bugs.webkit.org/show_bug.cgi?id=223601
<rdar://75098580>
Reviewed by Brent Fulgham.
Add ENABLE define for Notify filtering.
* wtf/PlatformEnableCocoa.h:
2021-03-25 20:20:47 +00:00
2021-03-25 Don Olmstead <don.olmstead@sony.com>
Embiggen maximum HashTable size when not using ANGLE
https://bugs.webkit.org/show_bug.cgi?id=223757
Reviewed by Alex Christensen.
This is a partial revert of r274603 which cut the maximum size HashTable from 400 to 250.
When not using ANGLE directly for an OpenGL ES implementation there's some code hashing its
sh::ShaderVariable from the shader compiler ANGLE ships with. This type is too big and
triggers the static_assert.
The eventual goal is for ANGLE to be the OpenGL ES implementation for WebKit when enabling
WebGL. On PlayStation we already have a system OpenGL ES and any use of WebGL is in legacy
applications. The WebGL compliance features in ANGLE aren't needed in this case so ideally
we wouldn't even compile out ANGLE.
This patch punts on fixing the actual problem and just resolves this build issue.
* wtf/HashTable.h:
(WTF::KeyTraits>::inlineLookup):
2021-03-25 16:49:46 +00:00
2021-03-25 Chris Dumez <cdumez@apple.com>
Do not do process pre-warming when the system is under memory pressure
https://bugs.webkit.org/show_bug.cgi?id=223717
<rdar://problem/75810423>
Reviewed by Antti Koivisto.
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::install):
- Listen to the same memory pressure notifications on macOS and iOS. Previously, macOS would not respond to
non-critical memory pressure notifications for example. Also, since macOS would not listen for the notification
that happens when the memory usage goes back to normal, MemoruPressureHandler::isUnderMemoryPressure() would
start returning true after a critical memory pressure notification and it would never go back to false.
2021-03-25 12:10:54 +00:00
2021-03-25 Alberto Garcia <berto@igalia.com>
REGRESSION(r271560): [Linux] release assert in Thread::initializePlatformThreading
https://bugs.webkit.org/show_bug.cgi?id=223069
Reviewed by Carlos Garcia Campos.
Replace an existing signal handler instead of aborting.
* wtf/posix/ThreadingPOSIX.cpp:
(WTF::Thread::initializePlatformThreading):
2021-03-25 02:53:03 +00:00
2021-03-24 Mark Lam <mark.lam@apple.com>
WTF::setPermissionsOfConfigPage() should allow its VM_FLAGS_PERMANENT workaround unconditionally.
https://bugs.webkit.org/show_bug.cgi?id=223725
rdar://75813316
Reviewed by Saam Barati.
If the OS does not support the flag, then we should not require it.
* wtf/WTFConfig.cpp:
(WTF::setPermissionsOfConfigPage):
2021-03-25 02:31:29 +00:00
2021-03-24 Yusuke Suzuki <ysuzuki@apple.com>
Use StaticStringImpl instead of StringImpl::createStaticStringImpl if it is not dynamic string content
https://bugs.webkit.org/show_bug.cgi?id=223714
Reviewed by Saam Barati.
We should just use StaticStringImpl instead of StringImpl::createStaticStringImpl if the string content is
not dynamically allocated one. Keep in mind that this URL code is strongly assuming that internal StringImpl
is static so that this string (and URL) can be used in multiple threads. And StaticStringImpl meets this requirement.
* wtf/URL.cpp:
(WTF::aboutBlankURL):
(WTF::aboutSrcDocURL):
2021-03-25 01:55:58 +00:00
2021-03-24 Yusuke Suzuki <ysuzuki@apple.com>
All string resources from UserAgentStyleSheets / UserAgentScripts should be used as non-copying StringImpl
https://bugs.webkit.org/show_bug.cgi?id=223685
Reviewed by Saam Barati.
Add StringImpl::createWithoutCopying for `const char*`.
* wtf/text/StringImpl.h:
(WTF::StringImpl::createWithoutCopying):
2021-03-24 23:14:51 +00:00
2021-03-24 Eric Carlson <eric.carlson@apple.com>
[Cocoa] Add Experimental MediaSession coordinator
https://bugs.webkit.org/show_bug.cgi?id=222158
<rdar://problem/74508862>
Reviewed by Jer Noble.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* wtf/PlatformEnableCocoa.h:
2021-03-24 19:30:31 +00:00
2021-03-24 Chris Dumez <cdumez@apple.com>
Address undefined behavior found by UBSan in StringToIntegerConversion.h
https://bugs.webkit.org/show_bug.cgi?id=223694
Reviewed by Geoffrey Garen.
Update StringToIntegerConversion to deal with overflows in a well-defined manner,
by relying on CheckedArithmetics. This addresses undefined behavior reborted by
UBSan:
- wtf/text/StringToIntegerConversion.h:94:30: runtime error: signed integer overflow: 2147483640 + 8 cannot be represented in type 'int'
- wtf/text/StringToIntegerConversion.h:104:17: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
* wtf/text/StringToIntegerConversion.h:
(WTF::toIntegralType):
2021-03-24 17:40:01 +00:00
2021-03-24 Truitt Savell <tsavell@apple.com>
Unreviewed, reverting r274927.
Broke many tests in WebGL
Reverted changeset:
"Enable Metal ANGLE backend for WebGL"
https://bugs.webkit.org/show_bug.cgi?id=220076
https://commits.webkit.org/r274927
2021-03-24 17:31:28 +00:00
2021-03-24 Chris Dumez <cdumez@apple.com>
Address undefined behavior found by UBSan in DateMath.h
https://bugs.webkit.org/show_bug.cgi?id=223663
Reviewed by Darin Adler.
Address undefined behavior found by UBSan in DateMath.h
Release/usr/local/include/wtf/DateMath.h:247:39: runtime error: nan is outside the range of representable values of type 'int'
Release/usr/local/include/wtf/DateMath.h:221:29: runtime error: nan is outside the range of representable values of type 'int'
Release/usr/local/include/wtf/DateMath.h:165:38: runtime error: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int'
* wtf/DateMath.h:
(WTF::daysFrom1970ToYear):
Cast year to a double *before* substracting 1 instead of *after*. This works around the fact that INT_MIN-1 would not
fit in an int and would be undefined behavior.
(WTF::dayInYear):
(WTF::msToYear):
Deal with the double potentially being NaN before casting to an int, since
casting NaN to an int type has undefined behavior.
2021-03-24 00:53:25 +00:00
2021-03-23 Dean Jackson <yolo@apple.com>
Enable Metal ANGLE backend for WebGL
https://bugs.webkit.org/show_bug.cgi?id=220076
<rdar://problem/72565020>
Reviewed by Sam Weinig.
Turn the Metal backend for ANGLE on, moving the feature
from Internal to Experimental.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:
2021-03-24 00:30:11 +00:00
2021-03-23 Chris Dumez <cdumez@apple.com>
DerivedSources/WebKitTestRunner/JSAccessibilityUIElement.cpp:802:72: runtime error: -1 is outside the range of representable values of type 'unsigned int'
https://bugs.webkit.org/show_bug.cgi?id=223650
Reviewed by Darin Adler.
Update the clampTo() template specialization that converts floating types into integer types so that
it deals with NaN inputs in a well-defined manner. Previously, it would simply cast the NaN to the
integer type, which was undefined behavior. We now return the minimum range boundary for the output
when the input is NaN.
* wtf/MathExtras.h:
(clampTo):
2021-03-23 20:55:20 +00:00
2021-03-23 Saam Barati <sbarati@apple.com>
Don't require VM_FLAGS_PERMANENT on the simulator builds
https://bugs.webkit.org/show_bug.cgi?id=223649
<rdar://problem/75747788>
Reviewed by Alexey Proskuryakov.
Since VM_FLAGS_PERMANENT must be supported by the kernel, let's make
it so that the vm_map that passes this flag in can fail when running
on the simulator. This is to support the use case of running a newer
simulator on an older OS. When the call to vm_map fails when running
on the simulator, we try again without the VM_FLAGS_PERMANENT flag.
* wtf/WTFConfig.cpp:
(WTF::setPermissionsOfConfigPage):
2021-03-23 20:32:53 +00:00
2021-03-23 Alex Christensen <achristensen@webkit.org>
Remove unused WTF::String::percentage
https://bugs.webkit.org/show_bug.cgi?id=223651
Reviewed by Chris Dumez.
* wtf/text/AtomString.h:
* wtf/text/WTFString.cpp:
(WTF::String::percentage const): Deleted.
* wtf/text/WTFString.h:
2021-03-23 16:54:05 +00:00
2021-03-23 Chris Dumez <cdumez@apple.com>
wtf/text/IntegerToStringConversion.h:54:104: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
https://bugs.webkit.org/show_bug.cgi?id=223614
Reviewed by Darin Adler.
numberToStringSigned() was calling -number when number is negative. This could trigger undefined behavior
since -number may not be representable in the input type. For example, if the type was int and number was
INT_MIN, -INT_MIN would overflow and the result would be undefined. To address the issue, we now cast
number to the destination *unsigned* type *before* negating it.
* wtf/text/IntegerToStringConversion.h:
(WTF::numberToStringSigned):
2021-03-23 15:56:50 +00:00
2021-03-23 Alex Christensen <achristensen@webkit.org>
Optimize StringView::CodePoints::Iterator
https://bugs.webkit.org/show_bug.cgi?id=162315
Reviewed by Darin Adler.
This stores range pointers in the iterator instead of a pointer to a pointer.
* wtf/text/StringView.h:
(WTF::StringView::CodePoints::Iterator::Iterator):
(WTF::StringView::CodePoints::Iterator::operator++):
(WTF::StringView::CodePoints::Iterator::operator* const):
(WTF::StringView::CodePoints::Iterator::operator== const):
2021-03-23 15:33:36 +00:00
2021-03-23 Chris Dumez <cdumez@apple.com>
Add assertions to guard against heap allocations on the audio thread
https://bugs.webkit.org/show_bug.cgi?id=223226
Reviewed by Darin Adler.
Add ForbidMallocUseForCurrentThreadScope to FastMalloc.h to enable assertions guarding against
doing heap allocations on the current thread (during the lifetime of the Scope object).
Also add a DisableMallocRestrictionsForCurrentThreadScope to temporarily disable those checks
to allow for some very specific assertions (either because they are required, or simply because
they are not fixed yet).
* wtf/FastMalloc.cpp:
(WTF::ForbidMallocUseForCurrentThreadScope::ForbidMallocUseForCurrentThreadScope):
(WTF::ForbidMallocUseForCurrentThreadScope::~ForbidMallocUseForCurrentThreadScope):
(WTF::DisableMallocRestrictionsForCurrentThreadScope::DisableMallocRestrictionsForCurrentThreadScope):
(WTF::DisableMallocRestrictionsForCurrentThreadScope::~DisableMallocRestrictionsForCurrentThreadScope):
(WTF::tryFastMalloc):
(WTF::fastMalloc):
(WTF::tryFastCalloc):
(WTF::fastCalloc):
(WTF::fastRealloc):
(WTF::tryFastRealloc):
(WTF::fastAlignedMalloc):
(WTF::tryFastAlignedMalloc):
* wtf/FastMalloc.h:
(WTF::ForbidMallocUseForCurrentThreadScope::~ForbidMallocUseForCurrentThreadScope):
(WTF::DisableMallocRestrictionsForCurrentThreadScope::~DisableMallocRestrictionsForCurrentThreadScope):
2021-03-22 22:17:49 +00:00
2021-03-22 Devin Rousso <drousso@apple.com>
Remove unused JS and CSS files of media controls
https://bugs.webkit.org/show_bug.cgi?id=214955
<rdar://problem/66604040>
Reviewed by Eric Carlson.
Cocoa platforms are already using modern media controls so there's no reason to keep the old
media controls resources/logic around any longer. It just wastes space.
The non-iOS Apple controls must be kept though as they are still used on Windows.
* wtf/PlatformEnable.h:
* wtf/PlatformEnableCocoa.h:
* Scripts/Preferences/WebPreferences.yaml:
Replace `ModernMediaControlsEnabled` setting with `ENABLE_MODERN_MEDIA_CONTROLS` build flag.
2021-03-22 20:51:10 +00:00
2021-03-22 Rob Buis <rbuis@igalia.com>
[css-contain] Parse CSS contain property
https://bugs.webkit.org/show_bug.cgi?id=223252
Reviewed by Darin Adler.
Add experimental feature flag.
* Scripts/Preferences/WebPreferencesExperimental.yaml:
2021-03-22 20:30:11 +00:00
2021-03-22 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed, fix Mac and non-unified JSCOnly builds
https://bugs.webkit.org/show_bug.cgi?id=223546
* wtf/PlatformJSCOnly.cmake:
Add missing file for JSCOnly build on Mac.
2021-03-22 18:45:13 +00:00
2021-03-19 Darin Adler <darin@apple.com>
[Cocoa] Make it possible to release a WKWebView on a non-main thread without a crash due to WKScriptMessage race
https://bugs.webkit.org/show_bug.cgi?id=222336
Reviewed by Chris Dumez.
* wtf/spi/cocoa/objcSPI.h: Removed unnecessary #if so functions are correctly compiled for
non-Objective-C source files. Added include of <objc/objc.h> so that "id" is defined.
2021-03-19 17:24:14 +00:00
2021-03-19 Sam Weinig <weinig@apple.com>
Add PropertyName parameter to custom setters to allow shared implementations to do late name lookup
https://bugs.webkit.org/show_bug.cgi?id=223413
Reviewed by Alexey Shvayka.
* wtf/PlatformCallingConventions.h:
Update JSC_DECLARE_CUSTOM_SETTER to account for the new PropertyName parameter.
2021-03-19 04:57:59 +00:00
== Rolled over to ChangeLog-2021-03-18 ==