[JSC] Restrict more ptr-tagging and avoid using OperationPtrTag for JIT code
https://bugs.webkit.org/show_bug.cgi?id=217460
Reviewed by Saam Barati.
Source/JavaScriptCore:
This patch makes tagging / untagging pointer functions solid by using PtrTag in template parameter.
Later, we will introduce compile time behavior change for different kind of PtrTag so that we can insert OperationPtrTag validation
when tagging a function with OperationPtrTag.
We also found that FTL is tagging JIT code with OperationPtrTag wrongly. We should tag it with JITThunkPtrTag.
- assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::getLinkerAddress):
- assembler/AssemblerBuffer.h:
(JSC::ARM64EHash::update):
(JSC::ARM64EHash::finalHash const):
- assembler/JITOperationList.cpp:
(JSC::addPointers):
- assembler/MacroAssemblerARM64.cpp:
(JSC::MacroAssembler::probe):
- assembler/MacroAssemblerCodeRef.h:
(JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
(JSC::MacroAssemblerCodePtr::createFromExecutableAddress):
(JSC::testProbeModifiesProgramCounter):
- b3/air/testair.cpp:
- ftl/FTLOutput.h:
(JSC::FTL::Output::callWithoutSideEffects):
(JSC::FTL::Output::operation):
(JSC::FTL::SlowPathCallContext::makeCall):
(JSC::JITCodeWithCodeRef::executableAddressAtOffset):
(JSC::genericUnwind):
- jit/JITOperations.cpp:
- jit/Repatch.cpp:
(JSC::readPutICCallTarget):
(JSC::ftlThunkAwareRepatchCall):
(JSC::tryCacheGetBy):
(JSC::tryCachePutByID):
(JSC::LLInt::initialize):
(JSC::LLInt::isLLIntPC):
- llint/LLIntSlowPaths.cpp:
(JSC::LLInt::setUpCall):
(JSC::LLInt::generateThunkWithJumpTo):
- runtime/MachineContext.h:
(JSC::MachineContext::instructionPointer):
- runtime/NativeExecutable.cpp:
(JSC::NativeExecutable::finishCreation):
- runtime/PutPropertySlot.h:
(JSC::PutPropertySlot::setCustomValue):
(JSC::PutPropertySlot::setCustomAccessor):
(JSC::PutPropertySlot::customSetter const):
- wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::emitCCall):
Source/WTF:
- wtf/PlatformRegisters.cpp:
(WTF::threadStateLRInternal):
(WTF::threadStatePCInternal):
(WTF::tagCFunctionPtr):
(WTF::tagCFunction):
(WTF::untagCFunctionPtr):
(WTF::tagInt):
(WTF::isTaggedWith):
(WTF::assertIsTaggedWith):
(WTF::assertIsNullOrTaggedWith):