[webkit-changes] [WebKit/WebKit] 31e3bb: [JSC] Introduce NativeCallee
Yusuke Suzuki
noreply at github.com
Sat Aug 19 09:32:34 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 31e3bbe77c1b2331b13150a07ea0f587d6c1079a
https://github.com/WebKit/WebKit/commit/31e3bbe77c1b2331b13150a07ea0f587d6c1079a
Author: Yusuke Suzuki <ysuzuki at apple.com>
Date: 2023-08-19 (Sat, 19 Aug 2023)
Changed paths:
M Source/JavaScriptCore/CMakeLists.txt
M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
M Source/JavaScriptCore/Sources.txt
M Source/JavaScriptCore/bytecode/CodeBlock.cpp
M Source/JavaScriptCore/bytecode/Repatch.cpp
M Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
M Source/JavaScriptCore/dfg/DFGDoesGCCheck.cpp
M Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
M Source/JavaScriptCore/interpreter/CallFrame.cpp
M Source/JavaScriptCore/interpreter/CallFrame.h
M Source/JavaScriptCore/interpreter/CallFrameInlines.h
M Source/JavaScriptCore/interpreter/CalleeBits.h
M Source/JavaScriptCore/interpreter/Interpreter.cpp
M Source/JavaScriptCore/interpreter/ShadowChicken.cpp
M Source/JavaScriptCore/interpreter/StackVisitor.cpp
M Source/JavaScriptCore/interpreter/StackVisitor.h
M Source/JavaScriptCore/jit/JITExceptions.cpp
M Source/JavaScriptCore/jit/JITOperations.cpp
M Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.cpp
M Source/JavaScriptCore/jsc.cpp
M Source/JavaScriptCore/llint/InPlaceInterpreter.asm
M Source/JavaScriptCore/llint/LowLevelInterpreter.asm
M Source/JavaScriptCore/llint/WebAssembly.asm
M Source/JavaScriptCore/runtime/ArrayConstructor.cpp
M Source/JavaScriptCore/runtime/Error.cpp
M Source/JavaScriptCore/runtime/InitializeThreading.cpp
M Source/JavaScriptCore/runtime/JSCJSValue.h
M Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
A Source/JavaScriptCore/runtime/NativeCallee.cpp
A Source/JavaScriptCore/runtime/NativeCallee.h
A Source/JavaScriptCore/runtime/NativeCalleeRegistry.cpp
A Source/JavaScriptCore/runtime/NativeCalleeRegistry.h
M Source/JavaScriptCore/runtime/SamplingProfiler.cpp
M Source/JavaScriptCore/runtime/SamplingProfiler.h
M Source/JavaScriptCore/runtime/VM.cpp
M Source/JavaScriptCore/runtime/VMInlines.h
M Source/JavaScriptCore/runtime/VMTraps.cpp
M Source/JavaScriptCore/tools/JSDollarVM.cpp
M Source/JavaScriptCore/tools/VMInspector.cpp
M Source/JavaScriptCore/wasm/WasmAirIRGenerator32_64.cpp
M Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h
M Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
M Source/JavaScriptCore/wasm/WasmBBQPlan.cpp
M Source/JavaScriptCore/wasm/WasmCallee.cpp
M Source/JavaScriptCore/wasm/WasmCallee.h
R Source/JavaScriptCore/wasm/WasmCalleeRegistry.cpp
R Source/JavaScriptCore/wasm/WasmCalleeRegistry.h
M Source/JavaScriptCore/wasm/WasmCompilationMode.h
M Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp
M Source/JavaScriptCore/wasm/WasmIPIntPlan.cpp
M Source/JavaScriptCore/wasm/WasmIRGeneratorHelpers.h
M Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp
M Source/JavaScriptCore/wasm/WasmOMGPlan.cpp
M Source/JavaScriptCore/wasm/WasmOperations.cpp
M Source/JavaScriptCore/wasm/WasmSlowPaths.cpp
M Source/JavaScriptCore/wasm/WasmThunks.cpp
M Source/JavaScriptCore/wasm/js/JSToWasm.cpp
M Source/JavaScriptCore/wasm/js/WasmToJS.cpp
M Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
Log Message:
-----------
[JSC] Introduce NativeCallee
https://bugs.webkit.org/show_bug.cgi?id=260366
rdar://114050102
Reviewed by Keith Miller.
This patch adds NativeCallee abstraction, which is old Wasm::Callee, but now usable for non-wasm ones.
And Wasm::Callee inherits this NativeCallee. The reason of extracting NativeCallee is that we would like
to use this special Callee for non wasm, in particular our new handler IC's code. This allows us to
do appropriate unwinding even though we create a new CallFrame for handler IC code.
* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/bytecode/CodeBlock.cpp:
(JSC::CodeBlock::noticeIncomingCall):
* Source/JavaScriptCore/bytecode/Repatch.cpp:
(JSC::linkMonomorphicCall):
(JSC::linkVirtualFor):
(JSC::linkPolymorphicCall):
(JSC::webAssemblyOwner): Deleted.
* 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::bytecodeIndex const):
(JSC::CallFrame::globalObjectOfClosestCodeBlock):
(JSC::CallFrame::friendlyFunctionName):
(JSC::CallFrame::dump const):
(JSC::CallFrame::convertToStackOverflowFrame):
(JSC::CallFrame::lexicalGlobalObjectFromNativeCallee const):
(JSC::CallFrame::codeOwnerCellSlow const):
(JSC::CallFrame::lexicalGlobalObjectFromWasmCallee const): Deleted.
* Source/JavaScriptCore/interpreter/CallFrame.h:
* Source/JavaScriptCore/interpreter/CallFrameInlines.h:
(JSC::CallFrame::guaranteedJSValueCallee const):
(JSC::CallFrame::jsCallee const):
(JSC::CallFrame::codeBlock const):
(JSC::CallFrame::lexicalGlobalObject const):
(JSC::CallFrame::wasmInstance const):
(JSC::CallFrame::codeOwnerCell const):
(JSC::CallFrame::isStackOverflowFrame const):
(JSC::CallFrame::isNativeCalleeFrame const):
(JSC::CallFrame::isWasmFrame const): Deleted.
* Source/JavaScriptCore/interpreter/CalleeBits.h:
(JSC::CalleeBits::boxWasm):
(JSC::CalleeBits::isNativeCallee const):
(JSC::CalleeBits::isCell const):
(JSC::CalleeBits::asCell const):
(JSC::CalleeBits::asNativeCallee const):
(JSC::CalleeBits::isWasm const): Deleted.
(JSC::CalleeBits::asWasmCallee const): Deleted.
* Source/JavaScriptCore/interpreter/Interpreter.cpp:
(JSC::GetStackTraceFunctor::operator() const):
(JSC::UnwindFunctor::operator() const):
(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::readInlinableNativeCalleeFrame):
(JSC::StackVisitor::Frame::codeType const):
(JSC::StackVisitor::Frame::calleeSaveRegistersForUnwinding):
(JSC::StackVisitor::Frame::isImplementationVisibilityPrivate const):
(JSC::StackVisitor::readInlinableWasmFrame): Deleted.
* Source/JavaScriptCore/interpreter/StackVisitor.h:
(JSC::StackVisitor::Frame::isNativeFrame const):
(JSC::StackVisitor::Frame::isInlinedDFGFrame const):
(JSC::StackVisitor::Frame::isNativeCalleeFrame const):
(JSC::StackVisitor::Frame::wasmFunctionIndexOrName):
(JSC::StackVisitor::Frame::isWasmFrame const): Deleted.
* Source/JavaScriptCore/jit/JITExceptions.cpp:
(JSC::genericUnwind):
* Source/JavaScriptCore/jit/JITOperations.cpp:
(JSC::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/jit/PolymorphicCallStubRoutine.cpp:
(JSC::PolymorphicCallStubRoutine::PolymorphicCallStubRoutine):
* Source/JavaScriptCore/jsc.cpp:
(JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/llint/InPlaceInterpreter.asm:
* Source/JavaScriptCore/llint/LowLevelInterpreter.asm:
* Source/JavaScriptCore/llint/WebAssembly.asm:
* Source/JavaScriptCore/runtime/ArrayConstructor.cpp:
(JSC::isArraySlowInline):
* Source/JavaScriptCore/runtime/Error.cpp:
(JSC::FindFirstCallerFrameWithCodeblockFunctor::operator() const):
* Source/JavaScriptCore/runtime/InitializeThreading.cpp:
(JSC::initialize):
* Source/JavaScriptCore/runtime/JSCJSValue.h:
* Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:
(JSC::getCallerCodeBlock):
* Source/JavaScriptCore/runtime/NativeCallee.cpp: Copied from Source/JavaScriptCore/wasm/WasmCalleeRegistry.cpp.
(JSC::NativeCallee::NativeCallee):
(JSC::NativeCallee::dump const):
(JSC::NativeCallee::operator delete):
* Source/JavaScriptCore/runtime/NativeCallee.h: Copied from Source/JavaScriptCore/wasm/WasmCalleeRegistry.cpp.
(JSC::NativeCallee::category const):
(JSC::NativeCallee::implementationVisibility const):
* Source/JavaScriptCore/runtime/NativeCalleeRegistry.cpp: Renamed from Source/JavaScriptCore/wasm/WasmCalleeRegistry.cpp.
(JSC::NativeCalleeRegistry::initialize):
(JSC::NativeCalleeRegistry::singleton):
* Source/JavaScriptCore/runtime/NativeCalleeRegistry.h: Renamed from Source/JavaScriptCore/wasm/WasmCalleeRegistry.h.
(JSC::NativeCalleeRegistry::WTF_RETURNS_LOCK):
(JSC::NativeCalleeRegistry::registerCallee):
(JSC::NativeCalleeRegistry::unregisterCallee):
(JSC::NativeCalleeRegistry::WTF_REQUIRES_LOCK):
(JSC::NativeCalleeRegistry::addPCToCodeOriginMap):
* Source/JavaScriptCore/runtime/SamplingProfiler.cpp:
(JSC::FrameWalker::recordJITFrame):
(JSC::FrameWalker::resetAtMachineFrame):
(JSC::SamplingProfiler::takeSample):
(JSC::SamplingProfiler::processUnverifiedStackTraces):
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::VM::throwException):
* Source/JavaScriptCore/runtime/VMInlines.h:
(JSC::VM::topJSCallFrame const):
* Source/JavaScriptCore/runtime/VMTraps.cpp:
(JSC::VMTraps::invalidateCodeBlocksOnStack):
* Source/JavaScriptCore/tools/JSDollarVM.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/tools/VMInspector.cpp:
(JSC::VMInspector::dumpRegisters):
* Source/JavaScriptCore/wasm/WasmAirIRGenerator32_64.cpp:
(JSC::Wasm::buildEntryBufferForCatch32):
(JSC::Wasm::emitCatchPrologueShared):
* Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h:
(JSC::Wasm::ExpressionType>::AirIRGeneratorBase):
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJIT::addTopLevel):
(JSC::Wasm::BBQJIT::addLoopOSREntrypoint):
* Source/JavaScriptCore/wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::work):
(JSC::Wasm::BBQPlan::initializeCallees):
* Source/JavaScriptCore/wasm/WasmCallee.cpp:
(JSC::Wasm::Callee::Callee):
(JSC::Wasm::Callee::destroy):
(JSC::Wasm::JITCallee::setEntrypoint):
(JSC::Wasm::WasmToJSCallee::WasmToJSCallee):
(JSC::Wasm::IPIntCallee::setEntrypoint):
(JSC::Wasm::LLIntCallee::setEntrypoint):
(JSC::Wasm::Callee::operator delete): Deleted.
* Source/JavaScriptCore/wasm/WasmCallee.h:
(JSC::Wasm::Callee::compilationMode const):
(JSC::Wasm::Callee::implementationVisibility const): Deleted.
* Source/JavaScriptCore/wasm/WasmCompilationMode.h:
* Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp:
(JSC::Wasm::trapHandler):
* Source/JavaScriptCore/wasm/WasmIPIntPlan.cpp:
(JSC::Wasm::IPIntPlan::didCompleteCompilation):
* Source/JavaScriptCore/wasm/WasmIRGeneratorHelpers.h:
(JSC::Wasm::buildEntryBufferForCatch):
* Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp:
(JSC::Wasm::LLIntPlan::didCompleteCompilation):
* Source/JavaScriptCore/wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* Source/JavaScriptCore/wasm/WasmOperations.cpp:
(JSC::Wasm::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/wasm/WasmSlowPaths.cpp:
(JSC::LLInt::WASM_IPINT_EXTERN_CPP_DECL):
* Source/JavaScriptCore/wasm/WasmThunks.cpp:
(JSC::Wasm::catchInWasmThunkGenerator):
* Source/JavaScriptCore/wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* Source/JavaScriptCore/wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):
Canonical link: https://commits.webkit.org/267071@main
More information about the webkit-changes
mailing list