Interface: Added Jit::Reset to reset CPU state

This commit is contained in:
MerryMage 2016-08-09 22:45:54 +01:00
parent 82f42d065f
commit 29d30bf931
2 changed files with 11 additions and 0 deletions

View file

@ -123,6 +123,11 @@ void Jit::ClearCache(bool poison_memory) {
impl->emitter.ClearCache(); impl->emitter.ClearCache();
} }
void Jit::Reset() {
ASSERT(!is_executing);
impl->jit_state = {};
}
void Jit::HaltExecution() { void Jit::HaltExecution() {
ASSERT(is_executing); ASSERT(is_executing);
halt_requested = true; halt_requested = true;

View file

@ -57,6 +57,12 @@ public:
*/ */
void ClearCache(bool poison_memory = true); void ClearCache(bool poison_memory = true);
/**
* Reset CPU state to state at startup. Does not clear code cache.
* Cannot be called from a callback.
*/
void Reset();
/** /**
* Stops execution in Jit::Run. * Stops execution in Jit::Run.
* Can only be called from a callback. * Can only be called from a callback.