[webkit-changes] [WebKit/WebKit] c55f32: Add Wasm::FunctionCodeIndex/FunctionSpaceIndex typ...
Keith Miller
noreply at github.com
Mon Sep 30 16:03:04 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c55f3242b0b5e224cd364a6bb8abdc1a38da0e0b
https://github.com/WebKit/WebKit/commit/c55f3242b0b5e224cd364a6bb8abdc1a38da0e0b
Author: Keith Miller <keith_miller at apple.com>
Date: 2024-09-30 (Mon, 30 Sep 2024)
Changed paths:
M Source/JavaScriptCore/tools/JSDollarVM.cpp
M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
M Source/JavaScriptCore/wasm/WasmBBQJIT.h
M Source/JavaScriptCore/wasm/WasmBBQPlan.cpp
M Source/JavaScriptCore/wasm/WasmBBQPlan.h
M Source/JavaScriptCore/wasm/WasmCallee.cpp
M Source/JavaScriptCore/wasm/WasmCallee.h
M Source/JavaScriptCore/wasm/WasmCalleeGroup.h
M Source/JavaScriptCore/wasm/WasmConstExprGenerator.cpp
M Source/JavaScriptCore/wasm/WasmEntryPlan.cpp
M Source/JavaScriptCore/wasm/WasmEntryPlan.h
M Source/JavaScriptCore/wasm/WasmFormat.h
M Source/JavaScriptCore/wasm/WasmFunctionCodeBlockGenerator.h
M Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.h
M Source/JavaScriptCore/wasm/WasmFunctionParser.h
M Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp
M Source/JavaScriptCore/wasm/WasmIPIntGenerator.h
M Source/JavaScriptCore/wasm/WasmIPIntPlan.cpp
M Source/JavaScriptCore/wasm/WasmIPIntPlan.h
M Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.cpp
M Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.h
M Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp
M Source/JavaScriptCore/wasm/WasmLLIntGenerator.h
M Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp
M Source/JavaScriptCore/wasm/WasmLLIntPlan.h
M Source/JavaScriptCore/wasm/WasmModule.cpp
M Source/JavaScriptCore/wasm/WasmModule.h
M Source/JavaScriptCore/wasm/WasmModuleInformation.h
M Source/JavaScriptCore/wasm/WasmOMGIRGenerator.cpp
M Source/JavaScriptCore/wasm/WasmOMGIRGenerator.h
M Source/JavaScriptCore/wasm/WasmOMGIRGenerator32_64.cpp
M Source/JavaScriptCore/wasm/WasmOMGPlan.cpp
M Source/JavaScriptCore/wasm/WasmOMGPlan.h
M Source/JavaScriptCore/wasm/WasmOSREntryPlan.cpp
M Source/JavaScriptCore/wasm/WasmOSREntryPlan.h
M Source/JavaScriptCore/wasm/WasmOperations.cpp
M Source/JavaScriptCore/wasm/WasmSectionParser.cpp
M Source/JavaScriptCore/wasm/WasmSlowPaths.cpp
M Source/JavaScriptCore/wasm/WasmStreamingCompiler.cpp
M Source/JavaScriptCore/wasm/WasmStreamingCompiler.h
M Source/JavaScriptCore/wasm/WasmStreamingParser.cpp
M Source/JavaScriptCore/wasm/WasmStreamingParser.h
M Source/JavaScriptCore/wasm/WasmStreamingPlan.cpp
M Source/JavaScriptCore/wasm/WasmStreamingPlan.h
M Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp
M Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp
M Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h
M Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp
M Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp
M Source/WTF/wtf/Compiler.h
Log Message:
-----------
Add Wasm::FunctionCodeIndex/FunctionSpaceIndex types to differentiate them
https://bugs.webkit.org/show_bug.cgi?id=280585
rdar://136929341
Reviewed by Yijia Huang.
Right now when refactoring code it can be time consuming to tell if a function index is
referring to the Module's code section index or its callee space index. This patch
adds two fairly trivial classes to distinguish them. This prevents passing the wrong
index to the wrong callsite without actively trying.
Additionally, on Clang, these classes are marked as `trivial_abi` so that they are
passed in registers rather than by reference as they are effectively glorified ints.
* Source/JavaScriptCore/llint/WebAssembly64.asm:
* Source/JavaScriptCore/tools/JSDollarVM.cpp:
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::BBQJIT):
(JSC::Wasm::BBQJITImpl::BBQJIT::addRefFunc):
(JSC::Wasm::BBQJITImpl::BBQJIT::emitTailCall):
(JSC::Wasm::BBQJITImpl::BBQJIT::addCall):
(JSC::Wasm::parseAndCompileBBQ):
* Source/JavaScriptCore/wasm/WasmBBQJIT.h:
* Source/JavaScriptCore/wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::BBQPlan):
(JSC::Wasm::BBQPlan::dumpDisassembly):
(JSC::Wasm::BBQPlan::work):
(JSC::Wasm::BBQPlan::compileFunction):
* Source/JavaScriptCore/wasm/WasmBBQPlan.h:
* Source/JavaScriptCore/wasm/WasmCallee.cpp:
(JSC::Wasm::Callee::Callee):
(JSC::Wasm::JITCallee::JITCallee):
(JSC::Wasm::IPIntCallee::IPIntCallee):
(JSC::Wasm::LLIntCallee::LLIntCallee):
* Source/JavaScriptCore/wasm/WasmCallee.h:
(JSC::Wasm::Callee::index const):
(JSC::Wasm::OptimizingJITCallee::OptimizingJITCallee):
* Source/JavaScriptCore/wasm/WasmCalleeGroup.h:
* Source/JavaScriptCore/wasm/WasmConstExprGenerator.cpp:
(JSC::Wasm::ConstExprGenerator::declaredFunctions const):
(JSC::Wasm::ConstExprGenerator::addRefFunc):
* Source/JavaScriptCore/wasm/WasmEntryPlan.cpp:
(JSC::Wasm::EntryPlan::compileFunctions):
* Source/JavaScriptCore/wasm/WasmEntryPlan.h:
* Source/JavaScriptCore/wasm/WasmFormat.h:
* Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.h:
(JSC::Wasm::FunctionIPIntMetadataGenerator::FunctionIPIntMetadataGenerator):
(JSC::Wasm::FunctionIPIntMetadataGenerator::functionIndex const):
* Source/JavaScriptCore/wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseFunctionIndex):
(JSC::Wasm::FunctionParser<Context>::addReferencedFunctions):
(JSC::Wasm::FunctionParser<Context>::parseExpression):
(JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression):
* Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp:
(JSC::Wasm::IPIntGenerator::IPIntGenerator):
(JSC::Wasm::IPIntGenerator::addRefFunc):
(JSC::Wasm::IPIntGenerator::addCall):
(JSC::Wasm::parseAndCompileMetadata):
* Source/JavaScriptCore/wasm/WasmIPIntGenerator.h:
* Source/JavaScriptCore/wasm/WasmIPIntPlan.cpp:
(JSC::Wasm::IPIntPlan::compileFunction):
(JSC::Wasm::IPIntPlan::ensureEntrypoint):
(JSC::Wasm::IPIntPlan::didCompleteCompilation):
(JSC::Wasm::IPIntPlan::didReceiveFunctionData):
(JSC::Wasm::IPIntPlan::computeTransitiveTailCalls const):
* Source/JavaScriptCore/wasm/WasmIPIntPlan.h:
* Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.cpp:
(JSC::IPInt::jitCompileAndSetHeuristics):
(JSC::IPInt::doWasmCall):
(JSC::IPInt::WASM_IPINT_EXTERN_CPP_DECL):
* Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.h:
* Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp:
(JSC::Wasm::LLIntGenerator::addCall):
(JSC::Wasm::LLIntGenerator::addRefFunc):
* Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp:
(JSC::Wasm::LLIntPlan::compileFunction):
(JSC::Wasm::LLIntPlan::ensureEntrypoint):
(JSC::Wasm::LLIntPlan::didCompleteCompilation):
(JSC::Wasm::LLIntPlan::didReceiveFunctionData):
(JSC::Wasm::LLIntPlan::computeTransitiveTailCalls const):
* Source/JavaScriptCore/wasm/WasmLLIntPlan.h:
* Source/JavaScriptCore/wasm/WasmModule.cpp:
(JSC::Wasm::Module::typeIndexFromFunctionIndexSpace const):
* Source/JavaScriptCore/wasm/WasmModule.h:
(JSC::Wasm::Module::importFunctionStub):
* Source/JavaScriptCore/wasm/WasmModuleInformation.h:
(JSC::Wasm::ModuleInformation::isImportedFunctionFromFunctionIndexSpace const):
(JSC::Wasm::ModuleInformation::typeIndexFromFunctionIndexSpace const):
(JSC::Wasm::ModuleInformation::toCodeIndex const):
(JSC::Wasm::ModuleInformation::toSpaceIndex const):
(JSC::Wasm::ModuleInformation::hasReferencedFunction const):
(JSC::Wasm::ModuleInformation::addReferencedFunction const):
(JSC::Wasm::ModuleInformation::isDeclaredFunction const):
(JSC::Wasm::ModuleInformation::addDeclaredFunction):
(JSC::Wasm::ModuleInformation::functionWasmSizeImportSpace const):
(JSC::Wasm::ModuleInformation::functionWasmSize const):
(JSC::Wasm::ModuleInformation::usesSIMDImportSpace const):
(JSC::Wasm::ModuleInformation::usesSIMD const):
(JSC::Wasm::ModuleInformation::markUsesSIMD):
(JSC::Wasm::ModuleInformation::usesExceptions const):
(JSC::Wasm::ModuleInformation::markUsesExceptions):
(JSC::Wasm::ModuleInformation::usesAtomics const):
(JSC::Wasm::ModuleInformation::markUsesAtomics):
(JSC::Wasm::ModuleInformation::doneSeeingFunction):
(JSC::Wasm::ModuleInformation::callCanClobberInstance const):
(JSC::Wasm::ModuleInformation::addClobberingTailCall):
* Source/JavaScriptCore/wasm/WasmOMGIRGenerator.cpp:
(JSC::Wasm::OMGIRGenerator::addRefFunc):
(JSC::Wasm::OMGIRGenerator::canInline const):
(JSC::Wasm::OMGIRGenerator::emitInlineDirectCall):
(JSC::Wasm::OMGIRGenerator::addCall):
(JSC::Wasm::parseAndCompileOMG):
* Source/JavaScriptCore/wasm/WasmOMGIRGenerator.h:
* Source/JavaScriptCore/wasm/WasmOMGIRGenerator32_64.cpp:
(JSC::Wasm::OMGIRGenerator::addRefFunc):
(JSC::Wasm::OMGIRGenerator::addCall):
* Source/JavaScriptCore/wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::OMGPlan):
(JSC::Wasm::OMGPlan::dumpDisassembly):
(JSC::Wasm::OMGPlan::work):
* Source/JavaScriptCore/wasm/WasmOMGPlan.h:
* Source/JavaScriptCore/wasm/WasmOSREntryPlan.cpp:
(JSC::Wasm::OSREntryPlan::OSREntryPlan):
(JSC::Wasm::OSREntryPlan::dumpDisassembly):
(JSC::Wasm::OSREntryPlan::work):
* Source/JavaScriptCore/wasm/WasmOSREntryPlan.h:
* Source/JavaScriptCore/wasm/WasmOperations.cpp:
(JSC::Wasm::triggerOMGReplacementCompile):
(JSC::Wasm::JSC_DEFINE_NOEXCEPT_JIT_OPERATION):
* Source/JavaScriptCore/wasm/WasmSectionParser.cpp:
(JSC::Wasm::SectionParser::parseGlobal):
(JSC::Wasm::SectionParser::parseExport):
(JSC::Wasm::SectionParser::parseStart):
(JSC::Wasm::SectionParser::parseInitExpr):
(JSC::Wasm::SectionParser::parseElementSegmentVectorOfExpressions):
(JSC::Wasm::SectionParser::parseElementSegmentVectorOfIndexes):
* Source/JavaScriptCore/wasm/WasmSlowPaths.cpp:
(JSC::LLInt::jitCompileAndSetHeuristics):
(JSC::LLInt::jitCompileSIMDFunction):
(JSC::LLInt::doWasmCall):
(JSC::LLInt::WASM_SLOW_PATH_DECL):
(JSC::LLInt::doWasmCallIndirect):
* Source/JavaScriptCore/wasm/WasmStreamingCompiler.cpp:
(JSC::Wasm::StreamingCompiler::didReceiveFunctionData):
* Source/JavaScriptCore/wasm/WasmStreamingCompiler.h:
* Source/JavaScriptCore/wasm/WasmStreamingParser.cpp:
(JSC::Wasm::StreamingParser::parseFunctionPayload):
* Source/JavaScriptCore/wasm/WasmStreamingParser.h:
* Source/JavaScriptCore/wasm/WasmStreamingPlan.cpp:
(JSC::Wasm::StreamingPlan::StreamingPlan):
* Source/JavaScriptCore/wasm/WasmStreamingPlan.h:
* Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::finalizeCreation):
(JSC::JSWebAssemblyInstance::initElementSegment):
* Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::typeIndexFromFunctionIndexSpace const):
* Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h:
* Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::createTypeReflectionObject):
* Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::initializeExports):
* Source/WTF/wtf/Compiler.h:
Canonical link: https://commits.webkit.org/284470@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