- branch optimization.

This commit is contained in:
Christoph Oelckers 2016-12-02 00:51:29 +01:00
commit 77192fa9dd
4 changed files with 165 additions and 96 deletions

View file

@ -734,6 +734,13 @@ void VMFunctionBuilder::Backpatch(size_t loc, size_t target)
Code[loc].i24 = offset;
}
void VMFunctionBuilder::BackpatchList(TArray<size_t> &locs, size_t target)
{
for (auto loc : locs)
Backpatch(loc, target);
}
//==========================================================================
//
// VMFunctionBuilder :: BackpatchToHere
@ -748,6 +755,12 @@ void VMFunctionBuilder::BackpatchToHere(size_t loc)
Backpatch(loc, Code.Size());
}
void VMFunctionBuilder::BackpatchListToHere(TArray<size_t> &locs)
{
for (auto loc : locs)
Backpatch(loc, Code.Size());
}
//==========================================================================
//
// FFunctionBuildList