Can't narrow down the JIT bug yet, so block JIT for functions that call Function Pointers temporarily

This commit is contained in:
Ricardo Luís Vaz Silva 2024-03-22 10:35:46 -03:00
parent 071b5c5180
commit 682dd1b22d
3 changed files with 6 additions and 0 deletions

View file

@ -9542,6 +9542,8 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
auto &argflags = Function->Variants[0].ArgFlags; auto &argflags = Function->Variants[0].ArgFlags;
auto *defaults = FnPtrCall ? nullptr : &Function->Variants[0].Implementation->DefaultArgs; auto *defaults = FnPtrCall ? nullptr : &Function->Variants[0].Implementation->DefaultArgs;
if(FnPtrCall) static_cast<VMScriptFunction*>(ctx.Function->Variants[0].Implementation)->blockJit = true;
int implicit = Function->GetImplicitArgs(); int implicit = Function->GetImplicitArgs();
if (!CheckAccessibility(ctx.Version)) if (!CheckAccessibility(ctx.Version))

View file

@ -279,6 +279,8 @@ static bool CanJit(VMScriptFunction *func)
// Asmjit has a 256 register limit. Stay safely away from it as the jit compiler uses a few for temporaries as well. // Asmjit has a 256 register limit. Stay safely away from it as the jit compiler uses a few for temporaries as well.
// Any function exceeding the limit will use the VM - a fair punishment to someone for writing a function so bloated ;) // Any function exceeding the limit will use the VM - a fair punishment to someone for writing a function so bloated ;)
if(func->blockJit) return false;
int maxregs = 200; int maxregs = 200;
if (func->NumRegA + func->NumRegD + func->NumRegF + func->NumRegS < maxregs) if (func->NumRegA + func->NumRegD + func->NumRegF + func->NumRegS < maxregs)
return true; return true;

View file

@ -474,6 +474,8 @@ public:
VM_UBYTE NumArgs; // Number of arguments this function takes VM_UBYTE NumArgs; // Number of arguments this function takes
TArray<FTypeAndOffset> SpecialInits; // list of all contents on the extra stack which require construction and destruction TArray<FTypeAndOffset> SpecialInits; // list of all contents on the extra stack which require construction and destruction
bool blockJit = false; // function triggers Jit bugs, block compilation until bugs are fixed
void InitExtra(void *addr); void InitExtra(void *addr);
void DestroyExtra(void *addr); void DestroyExtra(void *addr);
int AllocExtraStack(PType *type); int AllocExtraStack(PType *type);