#pragma once #include #include #include #include #include #include #include namespace FEXCore { class BlockCache; } namespace FEXCore::Context { struct Context; } namespace FEXCore::IR{ class OpDispatchBuilder; } namespace FEXCore::Core { struct RuntimeStats { std::atomic_uint64_t InstructionsExecuted; std::atomic_uint64_t BlocksCompiled; }; /** * @brief Contains debug data for a block of code for later debugger analysis * * Needs to remain around for as long as the code could be executed at least */ struct DebugData { uint64_t HostCodeSize; ///< The size of the code generated in the host JIT uint64_t GuestCodeSize; ///< The size of the guest side code uint64_t GuestInstructionCount; ///< Number of guest instructions uint64_t TimeSpentInCode; ///< How long this code has spent time running uint64_t RunCount; ///< Number of times this block of code has been run }; struct InternalThreadState { FEXCore::Core::ThreadState State; FEXCore::Context::Context *CTX; std::thread ExecutionThread; Event StartRunning; Event ThreadWaiting; std::unique_ptr OpDispatcher; std::unique_ptr CPUBackend; std::unique_ptr FallbackBackend; std::unique_ptr BlockCache; std::map>> IRLists; std::map DebugData; RuntimeStats Stats{}; FEXCore::Context::ExitReason ExitReason {FEXCore::Context::ExitReason::EXIT_WAITING}; }; }