Use branch instead of tailcall for recursive calls (#2282)

* Use branch instead of tailcall for recursive calls

Use a branch instead of doing a tailcall for recursive calls. This
avoids having to store the dispatch address, setting up the epilogue and
keeps guest registers in host registers for longer.

The rejit check is moved down into the entry block so that the rejit
behaviour remains the same as before.

* Set PTC version

Co-authored-by: gdkchan <gab.dark.100@gmail.com>
This commit is contained in:
FICTURE7 2021-05-20 16:31:45 +04:00 committed by GitHub
parent 0181068016
commit 65ac00833a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 11 deletions

View file

@ -144,7 +144,14 @@ namespace ARMeilleure.Instructions
{
bool isRecursive = immediate == context.EntryAddress;
EmitJumpTableBranch(context, Const(immediate), isRecursive);
if (isRecursive)
{
context.Branch(context.GetLabel(immediate));
}
else
{
EmitJumpTableBranch(context, Const(immediate), isJump: false);
}
}
private static void EmitNativeCall(ArmEmitterContext context, Operand nativeContextPtr, Operand funcAddr, bool isJump)