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

Method CompileSingleStep

FEXCore/Source/Interface/Core/Core.cpp:839–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

837}
838
839uintptr_t ContextImpl::CompileSingleStep(FEXCore::Core::CpuStateFrame* Frame, uint64_t GuestRIP) {
840 FEXCORE_PROFILE_SCOPED("CompileSingleStep");
841 auto Thread = Frame->Thread;
842
843 static_cast<ContextImpl*>(Thread->CTX)->SyscallHandler->PreCompile();
844
845 // Invalidate might take a unique lock on this, to guarantee that during invalidation no code gets compiled
846 auto lk = GuardSignalDeferringSection<std::shared_lock>(CodeInvalidationMutex, Thread);
847
848 auto [CompiledCode, DebugData, StartAddr, Length, _] = CompileCode(Thread, GuestRIP, 1);
849 auto CodePtr = CompiledCode.EntryPoints[GuestRIP];
850 if (CodePtr == nullptr) {
851 return 0;
852 }
853
854 // Clear any relocations that might have been generated
855 Thread->CPUBackend->ClearRelocations();
856
857 return (uintptr_t)CodePtr;
858}
859
860static void InvalidateGuestThreadCodeRange(FEXCore::Core::InternalThreadState* Thread, InvalidatedEntryAccumulator& Accumulator,
861 uint64_t Start, uint64_t Length) {

Callers

nothing calls this directly

Calls 2

PreCompileMethod · 0.45
ClearRelocationsMethod · 0.45

Tested by

no test coverage detected