-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JSC] Compile wasm stubs in compiler threads
https://bugs.webkit.org/show_bug.cgi?id=274721 rdar://128746101 Reviewed by Justin Michaud. This patch moves wasm stub compilation from the main thread to one of compiler thread. When EntryPlan is running, the first thread which starts compiling will compile stubs too. If no thread compiled it, it gets compiled in the complete phase. Since we can complete stub compilation in the compiler thread and share it in all wasm users, we can make JSWebAssemblyModule creation simple. Now we change JSWebAssemblyModule::createStub to JSWebAssemblyModule::create, and which just creates JSWebAssemblyModule and it does not fail anymore. We also change WasmEntryPlan's batch mechanism: instead of checking for each function compilation, we now compute size apriori and grab range of function indice to compile. And we also stop computing costly thing for wasm tail-calls which is not enabled. It should be done more efficiently when enabling it. * Source/JavaScriptCore/wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::didCompleteCompilation): * Source/JavaScriptCore/wasm/WasmEntryPlan.cpp: (JSC::Wasm::EntryPlan::prepare): (JSC::Wasm::EntryPlan::compileFunctions): (JSC::Wasm::EntryPlan::didCompleteCompilation): (JSC::Wasm::EntryPlan::generateWasmToWasmStubs): (JSC::Wasm::EntryPlan::generateWasmToJSStubs): * Source/JavaScriptCore/wasm/WasmEntryPlan.h: * Source/JavaScriptCore/wasm/WasmIPIntPlan.cpp: (JSC::Wasm::IPIntPlan::didCompleteCompilation): * Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp: (JSC::Wasm::LLIntPlan::didCompleteCompilation): * Source/JavaScriptCore/wasm/WasmModule.h: * Source/JavaScriptCore/wasm/WasmStreamingCompiler.cpp: (JSC::Wasm::StreamingCompiler::didComplete): * Source/JavaScriptCore/wasm/js/JSWebAssembly.cpp: (JSC::JSWebAssembly::webAssemblyModuleValidateAsync): (JSC::compileAndInstantiate): * Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp: (JSC::JSWebAssemblyModule::create): (JSC::JSWebAssemblyModule::createStub): Deleted. * Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h: * Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp: (JSC::WebAssemblyModuleConstructor::createModule): * Source/WebCore/bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal): Canonical link: https://commits.webkit.org/279352@main
- Loading branch information
1 parent
935af36
commit c9a03e0
Showing
12 changed files
with
123 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.