MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / IndirectBlockDelinker

Function IndirectBlockDelinker

FEXCore/Source/Interface/Core/JIT/JIT.cpp:516–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

514}
515
516static void IndirectBlockDelinker(FEXCore::Core::CpuStateFrame* Frame, FEXCore::Context::ExitFunctionLinkData* Record) {
517 uintptr_t JumpThunkStartAddress = reinterpret_cast<uintptr_t>(Record) - 0x10;
518 uint32_t BranchInst = 0;
519 ARMEmitter::Emitter BranchEmit(reinterpret_cast<uint8_t*>(&BranchInst), 4);
520 BranchEmit.b(0x8);
521
522 std::atomic_ref<uint32_t>(*reinterpret_cast<uint32_t*>(JumpThunkStartAddress)).store(BranchInst, std::memory_order::relaxed);
523 ARMEmitter::Emitter::ClearICache(reinterpret_cast<void*>(JumpThunkStartAddress), 4);
524
525 // No need to reset HostCode here as the exit linker pointer is stored separately, and if the block is relinked it will be updated.
526}
527
528uint64_t Arm64JITCore::ExitFunctionLink(FEXCore::Core::CpuStateFrame* Frame, FEXCore::Context::ExitFunctionLinkData* Record) {
529 auto Thread = Frame->Thread;

Callers

nothing calls this directly

Calls 1

ClearICacheFunction · 0.85

Tested by

no test coverage detected