-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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] Clean up WasmToJS #8944
[JSC] Clean up WasmToJS #8944
Conversation
1ca9f65
to
0abedce
Compare
EWS run on previous version of this PR (hash 0abedce)
|
0abedce
to
b61ea5b
Compare
EWS run on previous version of this PR (hash b61ea5b)
|
b61ea5b
to
327ecd4
Compare
EWS run on current version of this PR (hash 327ecd4)
|
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.
This is great, so much better!
https://bugs.webkit.org/show_bug.cgi?id=250966 rdar://104523769 Reviewed by Tadeu Zagallo. This patch fixes terrible hack in WasmToJS where we are setting JSWebAssemblyInstance to |callee| slot. 1. We should use Wasm::Callee since this is wasm code. This patch adds WasmToJSCallee and materialize this. We also puts Wasm::Instance* in |codeBlock| slot too so that operation function from this code can get Wasm::Instance*. 2. Remove indirection of types of owners. We should tightly couple JSC with wasm engine. 3. Put JSGlobalObject* in Wasm::Instance* to make WasmToJS code simpler and efficient. 4. Remove CallFrame::isAnyWasmCallee. Now all Wasm frames have Wasm::Callee*. So this hack is no longer necessary. * JSTests/stress/sampling-profiler-wasm-name-section.js: (platformSupportsSamplingProfiler.vm.isWasmSupported): * Source/JavaScriptCore/bytecode/CodeBlock.cpp: (JSC::CodeBlock::noticeIncomingCall): * Source/JavaScriptCore/bytecode/Repatch.cpp: (JSC::linkMonomorphicCall): (JSC::linkVirtualFor): (JSC::linkPolymorphicCall): * Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp: (JSC::DebuggerCallFrame::scope): (JSC::DebuggerCallFrame::thisValue const): (JSC::DebuggerCallFrame::evaluateWithScopeExtension): (JSC::DebuggerCallFrame::sourceIDForCallFrame): * Source/JavaScriptCore/dfg/DFGDoesGCCheck.cpp: (JSC::DFG::DoesGCCheck::verifyCanGC): * Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp: (Inspector::functionName): * Source/JavaScriptCore/interpreter/CallFrame.cpp: (JSC::CallFrame::friendlyFunctionName): (JSC::CallFrame::dump const): (JSC::CallFrame::lexicalGlobalObjectFromWasmCallee const): (JSC::CallFrame::isAnyWasmCallee const): Deleted. * Source/JavaScriptCore/interpreter/CallFrame.h: * Source/JavaScriptCore/interpreter/Interpreter.cpp: (JSC::UnwindFunctor::notifyDebuggerOfUnwinding): (JSC::Interpreter::unwind): * Source/JavaScriptCore/interpreter/ShadowChicken.cpp: (JSC::ShadowChicken::update): * Source/JavaScriptCore/interpreter/StackVisitor.cpp: (JSC::StackVisitor::readFrame): (JSC::StackVisitor::readNonInlinedFrame): (JSC::StackVisitor::Frame::calleeSaveRegistersForUnwinding): * Source/JavaScriptCore/jit/JITExceptions.cpp: (JSC::genericUnwind): * Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.cpp: (JSC::PolymorphicCallStubRoutine::PolymorphicCallStubRoutine): * Source/JavaScriptCore/jsc.cpp: (JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp: (JSC::getCallerCodeBlock): * Source/JavaScriptCore/runtime/VM.cpp: (JSC::VM::throwException): * Source/JavaScriptCore/runtime/VMTraps.cpp: (JSC::VMTraps::invalidateCodeBlocksOnStack): * Source/JavaScriptCore/tools/VMInspector.cpp: (JSC::VMInspector::dumpRegisters): * Source/JavaScriptCore/wasm/WasmCallee.cpp: (JSC::Wasm::Callee::runWithDowncast): (JSC::Wasm::WasmToJSCallee::WasmToJSCallee): * Source/JavaScriptCore/wasm/WasmCallee.h: * Source/JavaScriptCore/wasm/WasmCompilationMode.cpp: (JSC::Wasm::makeString): * Source/JavaScriptCore/wasm/WasmCompilationMode.h: (JSC::Wasm::isOSREntry): (JSC::Wasm::isAnyBBQ): (JSC::Wasm::isAnyOMG): * Source/JavaScriptCore/wasm/WasmGlobal.cpp: * Source/JavaScriptCore/wasm/WasmGlobal.h: * Source/JavaScriptCore/wasm/WasmInstance.cpp: (JSC::Wasm::Instance::Instance): (JSC::Wasm::Instance::create): (JSC::Wasm::Instance::setGlobal): (JSC::Wasm::Instance::setFunctionWrapper): (JSC::Wasm::Instance::initElementSegment): * Source/JavaScriptCore/wasm/WasmInstance.h: (JSC::Wasm::Instance::setOwner): (JSC::Wasm::Instance::owner const): (JSC::Wasm::Instance::offsetOfGlobalObject): (JSC::Wasm::Instance::globalObject const): (JSC::Wasm::Instance::allocationSize): * Source/JavaScriptCore/wasm/WasmModule.cpp: (JSC::Wasm::Module::Module): * Source/JavaScriptCore/wasm/WasmModule.h: (JSC::Wasm::Module::wasmToJSCallee): * Source/JavaScriptCore/wasm/WasmOperations.cpp: (JSC::Wasm::JSC_DEFINE_JIT_OPERATION): * Source/JavaScriptCore/wasm/WasmOperations.h: * Source/JavaScriptCore/wasm/WasmOperationsInlines.h: (JSC::Wasm::arrayNew): (JSC::Wasm::structNew): (JSC::Wasm::structSet): (JSC::Wasm::throwWasmToJSException): * Source/JavaScriptCore/wasm/WasmSlowPaths.cpp: (JSC::LLInt::WASM_SLOW_PATH_DECL): * Source/JavaScriptCore/wasm/WasmTable.cpp: * Source/JavaScriptCore/wasm/WasmTable.h: (JSC::Wasm::Table::owner const): (JSC::Wasm::Table::setOwner): * Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp: (JSC::JSWebAssemblyInstance::visitChildrenImpl): (JSC::JSWebAssemblyInstance::tryCreate): * Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h: * Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp: (JSC::JSWebAssemblyModule::generateWasmToJSStubs): * Source/JavaScriptCore/wasm/js/WasmToJS.cpp: (JSC::Wasm::handleBadImportTypeUse): (JSC::Wasm::wasmToJS): * Source/JavaScriptCore/wasm/js/WasmToJS.h: * Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp: (JSC::WebAssemblyModuleRecord::initializeExports): Canonical link: https://commits.webkit.org/259216@main
327ecd4
to
db4b9bc
Compare
Committed 259216@main (db4b9bc): https://commits.webkit.org/259216@main Reviewed commits have been landed. Closing PR #8944 and removing active labels. |
db4b9bc
327ecd4