mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 07:12:36 +00:00
- Add parameter tracking to VMBuilder::Emit().
SVN r1910 (scripting)
This commit is contained in:
parent
3001708d16
commit
4fa94390d0
2 changed files with 11 additions and 3 deletions
|
@ -427,6 +427,14 @@ size_t VMFunctionBuilder::Emit(int opcode, int opa, int opb, int opc)
|
|||
code[1] = opa;
|
||||
code[2] = opb;
|
||||
code[3] = opc;
|
||||
if (opcode == OP_PARAM)
|
||||
{
|
||||
ParamChange(1);
|
||||
}
|
||||
else if (opcode == OP_CALL || opcode == OP_CALL_K)
|
||||
{
|
||||
ParamChange(-opb);
|
||||
}
|
||||
return loc / 4;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,9 +47,6 @@ public:
|
|||
void FillAddressConstants(FVoidObj *konst, VM_ATAG *tags);
|
||||
void FillStringConstants(FString *strings);
|
||||
|
||||
// PARAM increases ActiveParam; CALL decreases it.
|
||||
void ParamChange(int delta);
|
||||
|
||||
// Track available registers.
|
||||
RegAvailability Registers[4];
|
||||
|
||||
|
@ -77,6 +74,9 @@ private:
|
|||
int ActiveParam;
|
||||
|
||||
TArray<VM_UBYTE> Code;
|
||||
|
||||
// PARAM increases ActiveParam; CALL decreases it.
|
||||
void ParamChange(int delta);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue