Implement a more efficient tagCFunction() tool.
https://bugs.webkit.org/show_bug.cgi?id=210254
Reviewed by Keith Miller.
Source/JavaScriptCore:
Putting tagCFunction() to use.
- b3/B3LowerMacros.cpp:
- b3/B3LowerMacrosAfterOptimizations.cpp:
- b3/B3MathExtras.cpp:
- b3/B3ReduceLoopStrength.cpp:
(JSC::B3::ReduceLoopStrength::reduceByteCopyLoopsToMemcpy):
- b3/B3ReduceStrength.cpp:
- b3/testb3_5.cpp:
(testCallSimple):
(testCallRare):
(testCallRareLive):
(testCallSimplePure):
(testCallFunctionWithHellaArguments):
(testCallFunctionWithHellaArguments2):
(testCallFunctionWithHellaArguments3):
(testCallSimpleDouble):
(testCallSimpleFloat):
(testCallFunctionWithHellaDoubleArguments):
(testCallFunctionWithHellaFloatArguments):
(testLinearScanWithCalleeOnStack):
(testInterpreter):
(testLICMPure):
(testLICMPureSideExits):
(testLICMPureWritesPinned):
(testLICMPureWrites):
(testLICMReadsLocalState):
(testLICMReadsPinned):
(testLICMReads):
(testLICMPureNotBackwardsDominant):
(testLICMPureFoiledByChild):
(testLICMPureNotBackwardsDominantFoiledByChild):
(testLICMExitsSideways):
(testLICMWritesLocalState):
(testLICMWrites):
(testLICMFence):
(testLICMWritesPinned):
(testLICMControlDependent):
(testLICMControlDependentNotBackwardsDominant):
(testLICMControlDependentSideExits):
(testLICMReadsPinnedWritesPinned):
(testLICMReadsWritesDifferentHeaps):
(testLICMReadsWritesOverlappingHeaps):
(testLICMDefaultCall):
(testShuffleDoesntTrashCalleeSaves):
(JSC::DFG::OSRExit::emitRestoreArguments):
- dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::handleExitCounts):
(JSC::DFG::osrWriteBarrier):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
- ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
(JSC::AssemblyHelpers::callExceptionFuzz):
(JSC::CCallHelpers::ensureShadowChickenPacket):
- jit/JITOperations.cpp:
- jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::slowPathFor):
(JSC::nativeForGenerator):
(JSC::boundFunctionCallGenerator):
- wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addTableGet):
(JSC::Wasm::B3IRGenerator::addTableSet):
(JSC::Wasm::B3IRGenerator::addRefFunc):
(JSC::Wasm::B3IRGenerator::addTableSize):
(JSC::Wasm::B3IRGenerator::addTableGrow):
(JSC::Wasm::B3IRGenerator::addTableFill):
(JSC::Wasm::B3IRGenerator::addGrowMemory):
(JSC::Wasm::B3IRGenerator::setGlobal):
(JSC::Wasm::B3IRGenerator::emitWriteBarrierForJSWrapper):
(JSC::Wasm::B3IRGenerator::addOp<OpType::I32Popcnt>):
(JSC::Wasm::B3IRGenerator::addOp<OpType::I64Popcnt>):
(JSC::Wasm::triggerOMGEntryTierUpThunkGenerator):
Source/WTF:
The current tagCFunctionPtr() tool does some extra work that is not needed if
we are tagging a known function and not a potentially arbitrary pointer. For
example,
- it doesn't need to do a null check.
- it doesn't need to authenticate the function address.
- The RELEASE_ASSERT used to enforce that authentication can also go away.
We should only use tagCFunction() (instead of tagCFunctionPtr()) if we know for
certain that we're operating on a C/C++ function, and not some arbitrary pointer.
(WTF::tagCFunction):