diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2020-04-04 09:05:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-04 19:05:11 +1100 |
| commit | e99e6d0ad1fb0e0245469a67526de2dc03bc0658 (patch) | |
| tree | 4209b3c3b81cd648ef547c3a586d44fb18bd4c83 | |
| parent | f70cc964642b506d800b241919ac44fe12f1158d (diff) | |
Use the jump table for HighCq tail continues. (#1088)
* Use the jump table for tail continues.
This path is always reached when a function larger than our current length limit (currently 5000) is compiled.
* Use Call Flag rather than 1L
| -rw-r--r-- | ARMeilleure/Instructions/InstEmitFlowHelper.cs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/ARMeilleure/Instructions/InstEmitFlowHelper.cs b/ARMeilleure/Instructions/InstEmitFlowHelper.cs index f0a81e85..7b244296 100644 --- a/ARMeilleure/Instructions/InstEmitFlowHelper.cs +++ b/ARMeilleure/Instructions/InstEmitFlowHelper.cs @@ -225,14 +225,23 @@ namespace ARMeilleure.Instructions bool useTailContinue = true; // Left option here as it may be useful if we need to return to managed rather than tail call in future. (eg. for debug) if (useTailContinue) { - if (allowRejit) + if (context.HighCq) { - address = context.BitwiseOr(address, Const(1L)); - } + // If we're doing a tail continue in HighCq, reserve a space in the jump table to avoid calling back to the translator. + // This will always try to get a HighCq version of our continue target as well. + EmitJumpTableBranch(context, address, true); + } + else + { + if (allowRejit) + { + address = context.BitwiseOr(address, Const(CallFlag)); + } - Operand fallbackAddr = context.Call(new _U64_U64(NativeInterface.GetFunctionAddress), address); + Operand fallbackAddr = context.Call(new _U64_U64(NativeInterface.GetFunctionAddress), address); - EmitNativeCall(context, fallbackAddr, true); + EmitNativeCall(context, fallbackAddr, true); + } } else { |
