[Loader] Patch red-zone sites from the previous instruction when every indirect branch is resolved
This commit is contained in:
parent
28b2f5709d
commit
ee9660d81d
|
|
@ -310,7 +310,10 @@ internal static class GuestRedZonePatcher
|
||||||
canBorrowFollowingInstructions,
|
canBorrowFollowingInstructions,
|
||||||
out span,
|
out span,
|
||||||
out refusal);
|
out refusal);
|
||||||
if (!forward)
|
var backward = !forward &&
|
||||||
|
canBorrowFollowingInstructions &&
|
||||||
|
TryBuildEnclosingPatchSpan(decoded, instructionIndex, branchTargets, out span);
|
||||||
|
if (!forward && !backward)
|
||||||
{
|
{
|
||||||
unrelocatableSites++;
|
unrelocatableSites++;
|
||||||
refusalCounts[(int)refusal]++;
|
refusalCounts[(int)refusal]++;
|
||||||
|
|
@ -335,7 +338,10 @@ internal static class GuestRedZonePatcher
|
||||||
shaInstructionCount += span.Instructions.Count(static instruction => ShaInstructionRewrite.CanRewrite(instruction));
|
shaInstructionCount += span.Instructions.Count(static instruction => ShaInstructionRewrite.CanRewrite(instruction));
|
||||||
}
|
}
|
||||||
|
|
||||||
instructionIndex += span.Instructions.Count - 1;
|
if (!backward)
|
||||||
|
{
|
||||||
|
instructionIndex += span.Instructions.Count - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue