[webkit-changes] [WebKit/WebKit] d5ba7e: [JSC] Remove one level indirection for JS -> Wasm ...
Yusuke Suzuki
noreply at github.com
Mon Sep 16 17:35:30 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d5ba7ea242f0ff30ebeaabf23fbf712d1627fb61
https://github.com/WebKit/WebKit/commit/d5ba7ea242f0ff30ebeaabf23fbf712d1627fb61
Author: Yusuke Suzuki <ysuzuki at apple.com>
Date: 2024-09-16 (Mon, 16 Sep 2024)
Changed paths:
M Source/JavaScriptCore/API/JSCallbackConstructor.cpp
M Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
M Source/JavaScriptCore/assembler/JITOperationList.cpp
M Source/JavaScriptCore/bytecode/BytecodeList.rb
M Source/JavaScriptCore/interpreter/Interpreter.cpp
M Source/JavaScriptCore/llint/InPlaceInterpreter.cpp
M Source/JavaScriptCore/llint/LowLevelInterpreter.asm
M Source/JavaScriptCore/llint/WebAssembly.asm
M Source/JavaScriptCore/runtime/CallData.h
M Source/JavaScriptCore/runtime/InternalFunction.cpp
M Source/JavaScriptCore/runtime/JSFunction.cpp
M Source/JavaScriptCore/runtime/ProxyObject.cpp
M Source/JavaScriptCore/runtime/VM.cpp
M Source/JavaScriptCore/tools/JSDollarVM.cpp
M Source/JavaScriptCore/wasm/WasmCallee.cpp
M Source/JavaScriptCore/wasm/WasmCallee.h
M Source/JavaScriptCore/wasm/WasmOperations.cpp
M Source/JavaScriptCore/wasm/WasmOperations.h
M Source/JavaScriptCore/wasm/js/JSToWasm.cpp
M Source/JavaScriptCore/wasm/js/JSToWasm.h
M Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
M Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
M Source/WebCore/bindings/js/JSPluginElementFunctions.cpp
M Source/WebCore/bridge/objc/objc_runtime.mm
M Source/WebCore/bridge/runtime_object.cpp
Log Message:
-----------
[JSC] Remove one level indirection for JS -> Wasm calls
https://bugs.webkit.org/show_bug.cgi?id=279750
rdar://136055331
Reviewed by Yijia Huang.
Our current JS -> Wasm slow path implementation is very weird: We first
go to NativeExecutable, calling callWebAssemblyFunction. And then it
converts JS values to Wasm bits, and calling Wasm JSToWasm thunk.
And then Wasm JSToWasm thunk pushes values to appropriate stacks and
registers and calling wasm function. We do not want to do such a back
and forth.
This patch unifies JS value to wasm bits conversion and Wasm JSToWasm thunk.
Now JS calls Wasm JSToWasm thunk directly, and its operation will look
into JS stack, converting it to Wasm bits and storing it to appropriate
places. It may throw an error, so we will appropriately propagate errors
when it happens.
* Source/JavaScriptCore/API/JSCallbackConstructor.cpp:
(JSC::JSCallbackConstructor::getConstructData):
* Source/JavaScriptCore/API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::getConstructData):
(JSC::JSCallbackObject<Parent>::getCallData):
* Source/JavaScriptCore/assembler/JITOperationList.cpp:
(JSC::llintOperations):
* Source/JavaScriptCore/interpreter/Interpreter.cpp:
(JSC::Interpreter::executeCallImpl):
* Source/JavaScriptCore/llint/WebAssembly.asm:
* Source/JavaScriptCore/runtime/CallData.h:
* Source/JavaScriptCore/runtime/InternalFunction.cpp:
(JSC::InternalFunction::getCallData):
(JSC::InternalFunction::getConstructData):
* Source/JavaScriptCore/runtime/JSFunction.cpp:
(JSC::JSFunction::getCallData):
(JSC::JSFunction::getConstructData):
* Source/JavaScriptCore/runtime/ProxyObject.cpp:
(JSC::ProxyObject::getCallData):
(JSC::ProxyObject::getConstructData):
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::thunkGeneratorForIntrinsic):
(JSC::jitCodeForCallTrampoline):
(JSC::VM::getHostFunction):
* Source/JavaScriptCore/tools/JSDollarVM.cpp:
* Source/JavaScriptCore/wasm/WasmCallee.cpp:
(JSC::Wasm::JSEntrypointCallee::JSEntrypointCallee):
(JSC::Wasm::JSEntrypointCallee::entrypointImpl const):
* Source/JavaScriptCore/wasm/WasmCallee.h:
(JSC::Wasm::JSEntrypointCallee::create): Deleted.
(JSC::Wasm::JSEntrypointCallee:: const): Deleted.
(JSC::Wasm::JSEntrypointCallee::setReplacementTarget): Deleted.
(JSC::Wasm::JSEntrypointCallee::offsetOfIdent): Deleted.
(JSC::Wasm::JSEntrypointCallee::offsetOfWasmCallee): Deleted.
(JSC::Wasm::JSEntrypointCallee::offsetOfWasmFunctionPrologue): Deleted.
(JSC::Wasm::JSEntrypointCallee::offsetOfFrameSize): Deleted.
* Source/JavaScriptCore/wasm/WasmOperations.cpp:
(JSC::Wasm::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/wasm/WasmOperations.h:
* Source/JavaScriptCore/wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmJITShared):
(JSC::Wasm::wasmFunctionThunkGenerator):
(JSC::Wasm::createJSToWasmJITSharedCrashForSIMDParameters): Deleted.
* Source/JavaScriptCore/wasm/js/JSToWasm.h:
* Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::JSHTMLAllCollection::getCallData):
* Source/WebCore/bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginElementCustomGetCallData):
* Source/WebCore/bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcFallbackObjectImp::getCallData):
* Source/WebCore/bridge/runtime_object.cpp:
(JSC::Bindings::RuntimeObject::getCallData):
(JSC::Bindings::RuntimeObject::getConstructData):
Canonical link: https://commits.webkit.org/283736@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list