mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 17:00:52 +02:00
FEX: Implements support for JIT CodeBuffer guard page restart
When the JIT CodeBuffer overflows, we will now catch accesses to the guard page and longjump while restarting the JIT with a larger buffer request. Fixes #4877
This commit is contained in:
9 files changed
+93
-4
No files matched your search
@@ -28,6 +28,7 @@ $end_info$
|
||||
#include <FEXCore/Utils/SignalScopeGuards.h>
|
||||
|
||||
#include "Common/CallRetStack.h"
|
||||
#include "Common/JITGuardPage.h"
|
||||
#include "Common/Config.h"
|
||||
#include "Common/Exception.h"
|
||||
#include "Common/InvalidationTracker.h"
|
||||
@@ -736,6 +737,11 @@ bool ResetToConsistentStateImpl(const ThreadCPUArea CPUArea, EXCEPTION_RECORD* E
|
||||
return true;
|
||||
}
|
||||
|
||||
if (FEX::Windows::JITGuardPage::HandleJITGuardPage(Thread, reinterpret_cast<void*>(FaultAddress), NativeContext->X,
|
||||
reinterpret_cast<__uint128_t*>(NativeContext->V), &NativeContext->Pc)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::scoped_lock Lock(ThreadCreationMutex);
|
||||
if (InvalidationTracker && InvalidationTracker->HandleRWXAccessViolation(Thread, NativeContext->Pc, FaultAddress)) {
|
||||
FEXCORE_PROFILE_INSTANT_INCREMENT(Thread, AccumulatedSMCCount, 1);
|
||||
|
||||
Reference in new issue
Block a user