-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[JSC] Concurrently computing CodeBlockHash #47214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JSC] Concurrently computing CodeBlockHash #47214
Conversation
EWS run on previous version of this PR (hash b086f91) |
b086f91
to
5894f5d
Compare
EWS run on previous version of this PR (hash 5894f5d) |
5894f5d
to
43c1fea
Compare
EWS run on previous version of this PR (hash 43c1fea) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me
@@ -68,6 +61,7 @@ class CachedScriptSourceProvider final : public JSC::SourceProvider, public Cach | |||
|
|||
CachedResourceHandle<CachedScript> m_cachedScript; | |||
RefPtr<FragmentedSharedBuffer> m_buffer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to remove the m_buffer
in CachedScriptSourceProvider
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right!
@@ -68,6 +61,7 @@ class CachedScriptSourceProvider final : public JSC::SourceProvider, public Cach | |||
|
|||
CachedResourceHandle<CachedScript> m_cachedScript; | |||
RefPtr<FragmentedSharedBuffer> m_buffer; | |||
mutable Lock m_lock; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we don't need this lock right? Since CachedScript
has its own lock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right! Removed.
43c1fea
to
6a8d18c
Compare
EWS run on current version of this PR (hash 6a8d18c) |
https://bugs.webkit.org/show_bug.cgi?id=295000 rdar://154307835 Reviewed by Yijia Huang. This patch fixes an issue for concurrent CodeBlockHash. We put some locks around CachedScriptSourceProvider / ScriptBufferSourceProvider to ensure that we can touch these source code safely (do not ref them. This is concurrently touched). * Source/JavaScriptCore/bytecode/CodeBlock.cpp: (JSC::CodeBlock::hash const): * Source/JavaScriptCore/bytecode/CodeBlockHash.cpp: (JSC::CodeBlockHash::CodeBlockHash): * Source/JavaScriptCore/bytecode/CodeBlockHash.h: * Source/JavaScriptCore/parser/SourceProvider.cpp: (JSC::SourceProvider::codeBlockHashConcurrently): * Source/JavaScriptCore/parser/SourceProvider.h: (JSC::SourceProviderBufferGuard::provider): * Source/WebCore/bindings/js/CachedScriptSourceProvider.h: * Source/WebCore/bindings/js/ScriptBufferSourceProvider.h: * Source/WebCore/loader/TextResourceDecoder.cpp: (WebCore::TextResourceDecoder::TextResourceDecoder): (WebCore::TextResourceDecoder::create): * Source/WebCore/loader/TextResourceDecoder.h: (WebCore::TextResourceDecoder::contentType const): (WebCore::TextResourceDecoder::usesEncodingDetector const): * Source/WebCore/loader/cache/CachedScript.cpp: (WebCore::CachedScript::script): (WebCore::CachedScript::codeBlockHashConcurrently): (WebCore::CachedScript::destroyDecodedData): (WebCore::CachedScript::setBodyDataFrom): * Source/WebCore/loader/cache/CachedScript.h: Canonical link: https://commits.webkit.org/296668@main
6a8d18c
to
82de5bb
Compare
Committed 296668@main (82de5bb): https://commits.webkit.org/296668@main Reviewed commits have been landed. Closing PR #47214 and removing active labels. |
82de5bb
6a8d18c