diff --git a/src/common/scripting/backend/vmbuilder.cpp b/src/common/scripting/backend/vmbuilder.cpp index ffd29d4ddf..d063790d28 100644 --- a/src/common/scripting/backend/vmbuilder.cpp +++ b/src/common/scripting/backend/vmbuilder.cpp @@ -37,6 +37,7 @@ #include "m_argv.h" #include "c_cvars.h" #include "jit.h" +#include "filesystem.h" CVAR(Bool, strictdecorate, false, CVAR_GLOBALCONFIG | CVAR_ARCHIVE) @@ -922,13 +923,17 @@ void FFunctionBuildList::Build() VMFunction::CreateRegUseInfo(); FScriptPosition::StrictErrors = strictdecorate; - if (FScriptPosition::ErrorCounter == 0 && Args->CheckParm("-dumpjit")) DumpJit(); + if (FScriptPosition::ErrorCounter == 0) + { + if (Args->CheckParm("-dumpjit")) DumpJit(true); + else if (Args->CheckParm("-dumpjitmod")) DumpJit(false); + } mItems.Clear(); mItems.ShrinkToFit(); FxAlloc.FreeAllBlocks(); } -void FFunctionBuildList::DumpJit() +void FFunctionBuildList::DumpJit(bool include_gzdoom_pk3) { #ifdef HAVE_VM_JIT FILE *dump = fopen("dumpjit.txt", "w"); @@ -937,7 +942,7 @@ void FFunctionBuildList::DumpJit() for (auto &item : mItems) { - JitDumpLog(dump, item.Function); + if(include_gzdoom_pk3 || fileSystem.GetFileContainer(item.Lump)) JitDumpLog(dump, item.Function); } fclose(dump); diff --git a/src/common/scripting/backend/vmbuilder.h b/src/common/scripting/backend/vmbuilder.h index 8bb43565e6..43ef1bc4cf 100644 --- a/src/common/scripting/backend/vmbuilder.h +++ b/src/common/scripting/backend/vmbuilder.h @@ -155,7 +155,7 @@ class FFunctionBuildList TArray mItems; - void DumpJit(); + void DumpJit(bool include_gzdoom_pk3); public: VMFunction *AddFunction(PNamespace *curglobals, const VersionInfo &ver, PFunction *func, FxExpression *code, const FString &name, bool fromdecorate, int currentstate, int statecnt, int lumpnum);