- moved the VM types into their own file and only include it where really needed.

This commit is contained in:
Christoph Oelckers 2017-04-13 01:12:04 +02:00
commit 6599e2c425
111 changed files with 4283 additions and 4147 deletions

View file

@ -6620,7 +6620,7 @@ ExpEmit FxClassDefaults::Emit(VMFunctionBuilder *build)
ob.Free(build);
ExpEmit meta(build, REGT_POINTER);
build->Emit(OP_CLSS, meta.RegNum, ob.RegNum);
build->Emit(OP_LOS, meta.RegNum, meta.RegNum, build->GetConstantInt(myoffsetof(PClass, Defaults)));
build->Emit(OP_LP, meta.RegNum, meta.RegNum, build->GetConstantInt(myoffsetof(PClass, Defaults)));
return meta;
}
@ -6878,7 +6878,7 @@ ExpEmit FxStackVariable::Emit(VMFunctionBuilder *build)
if (offsetreg == -1) offsetreg = build->GetConstantInt(0);
auto op = membervar->Type->GetLoadOp();
if (op == OP_LO)
op = OP_LOS;
op = OP_LP;
build->Emit(op, loc.RegNum, build->FramePointer.RegNum, offsetreg);
}
else
@ -9355,7 +9355,7 @@ ExpEmit FxGetParentClass::Emit(VMFunctionBuilder *build)
op.Free(build);
}
ExpEmit to(build, REGT_POINTER);
build->Emit(OP_LOS, to.RegNum, op.RegNum, build->GetConstantInt(myoffsetof(PClass, ParentClass)));
build->Emit(OP_LP, to.RegNum, op.RegNum, build->GetConstantInt(myoffsetof(PClass, ParentClass)));
return to;
}
@ -9427,7 +9427,7 @@ ExpEmit FxGetDefaultByType::Emit(VMFunctionBuilder *build)
build->Emit(OP_LKP, to.RegNum, op.RegNum);
op = to;
}
build->Emit(OP_LOS, to.RegNum, op.RegNum, build->GetConstantInt(myoffsetof(PClass, Defaults)));
build->Emit(OP_LP, to.RegNum, op.RegNum, build->GetConstantInt(myoffsetof(PClass, Defaults)));
return to;
}

View file

@ -46,6 +46,8 @@
#include "actor.h"
#include "vmbuilder.h"
#include "scopebarrier.h"
#include "types.h"
#include "vmintern.h"
#define CHECKRESOLVED() if (isresolved) return this; isresolved=true;

View file

@ -39,7 +39,9 @@
#include "tarray.h"
#include "dobject.h"
#include "thingdef.h"
#include "vm.h"
#include "types.h"
// We need one specific type for each of the 7 integral VM types and instantiate the needed functions for each of them.
// Dynamic arrays cannot hold structs because for every type there'd need to be an internal implementation which is impossible.

View file

@ -1,5 +1,7 @@
#include "dobject.h"
#include "scopebarrier.h"
#include "types.h"
#include "vmintern.h"
// Note: the same object can't be both UI and Play. This is checked explicitly in the field construction and will cause esoteric errors here if found.

View file

@ -35,8 +35,9 @@
#include "codegen.h"
#include "info.h"
#include "m_argv.h"
#include "thingdef.h"
//#include "thingdef.h"
#include "doomerrors.h"
#include "vmintern.h"
struct VMRemap
{

View file

@ -2,6 +2,7 @@
#define VMUTIL_H
#include "dobject.h"
#include "vmintern.h"
class VMFunctionBuilder;
class FxExpression;

View file

@ -34,6 +34,7 @@
#include "dobject.h"
#include "c_console.h"
#include "templates.h"
#include "vmintern.h"
#define NOP MODE_AUNUSED | MODE_BUNUSED | MODE_CUNUSED