Merge remote-tracking branch 'remotes/origin/master' into new_level_refactor

# Conflicts:
#	src/g_level.cpp
#	src/p_user.cpp
This commit is contained in:
Christoph Oelckers 2019-02-05 13:49:07 +01:00
commit 979f1df281
10 changed files with 89 additions and 51 deletions

View file

@ -922,6 +922,7 @@ void FFunctionBuildList::Build()
void FFunctionBuildList::DumpJit()
{
#ifdef HAVE_VM_JIT
FILE *dump = fopen("dumpjit.txt", "w");
if (dump == nullptr)
return;
@ -932,6 +933,7 @@ void FFunctionBuildList::DumpJit()
}
fclose(dump);
#endif // HAVE_VM_JIT
}

View file

@ -44,11 +44,7 @@
#include "c_cvars.h"
#include "version.h"
#if (defined(_M_X64 ) || defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(__amd64 ) || defined(__amd64__ ))
#define ARCH_X64
#endif
#ifdef ARCH_X64
#ifdef HAVE_VM_JIT
CUSTOM_CVAR(Bool, vm_jit, true, CVAR_NOINITCALL)
{
Printf("You must restart " GAMENAME " for this change to take effect.\n");
@ -56,6 +52,8 @@ CUSTOM_CVAR(Bool, vm_jit, true, CVAR_NOINITCALL)
}
#else
CVAR(Bool, vm_jit, false, CVAR_NOINITCALL|CVAR_NOSET)
FString JitCaptureStackTrace(int framesToSkip, bool includeNativeFrames) { return FString(); }
void JitRelease() {}
#endif
cycle_t VMCycles[10];
@ -282,7 +280,7 @@ static bool CanJit(VMScriptFunction *func)
int VMScriptFunction::FirstScriptCall(VMFunction *func, VMValue *params, int numparams, VMReturn *ret, int numret)
{
#ifdef ARCH_X64
#ifdef HAVE_VM_JIT
if (vm_jit && CanJit(static_cast<VMScriptFunction*>(func)))
{
func->ScriptCall = JitCompile(static_cast<VMScriptFunction*>(func));
@ -290,12 +288,10 @@ int VMScriptFunction::FirstScriptCall(VMFunction *func, VMValue *params, int num
func->ScriptCall = VMExec;
}
else
#endif // HAVE_VM_JIT
{
func->ScriptCall = VMExec;
}
#else
func->ScriptCall = VMExec;
#endif
return func->ScriptCall(func, params, numparams, ret, numret);
}