Merge branch 'master' into gonesolong
Conflicts: src/CMakeLists.txt src/b_think.cpp src/g_doom/a_doomweaps.cpp src/g_hexen/a_clericstaff.cpp src/g_hexen/a_fighterplayer.cpp src/namedef.h src/p_enemy.cpp src/p_local.h src/p_mobj.cpp src/p_teleport.cpp src/sc_man_tokens.h src/thingdef/thingdef_codeptr.cpp src/thingdef/thingdef_function.cpp src/thingdef/thingdef_parse.cpp wadsrc/static/actors/actor.txt wadsrc/static/actors/constants.txt wadsrc/static/actors/shared/inventory.txt - Added register reuse to VMFunctionBuilder for FxPick's code emitter. - Note to self: Need to reimplement IsPointerEqual and CheckClass, which were added to thingdef_function.cpp over the past year, as this file no longer exists in this branch.
This commit is contained in:
commit
b5e4153c78
182 changed files with 23025 additions and 8730 deletions
|
|
@ -279,7 +279,7 @@ VMFunctionBuilder::RegAvailability::RegAvailability()
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
// VMFunctionBuilder :: RegAvailibity :: Get
|
||||
// VMFunctionBuilder :: RegAvailability :: Get
|
||||
//
|
||||
// Gets one or more unused registers. If getting multiple registers, they
|
||||
// will all be consecutive. Returns -1 if there were not enough consecutive
|
||||
|
|
@ -411,6 +411,30 @@ void VMFunctionBuilder::RegAvailability::Return(int reg, int count)
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// VMFunctionBuilder :: RegAvailability :: Reuse
|
||||
//
|
||||
// Marks an unused register as in-use. Returns false if the register is
|
||||
// already in use or true if it was successfully reused.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
bool VMFunctionBuilder::RegAvailability::Reuse(int reg)
|
||||
{
|
||||
assert(reg >= 0 && reg <= 255);
|
||||
|
||||
VM_UWORD mask = reg & 31;
|
||||
int word = reg / 32;
|
||||
|
||||
if (Used[word] & mask)
|
||||
{ // It's already in use!
|
||||
return false;
|
||||
}
|
||||
Used[word] |= mask;
|
||||
return true;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// VMFunctionBuilder :: Emit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue