-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement portable tailcall helpers #341
Implement portable tailcall helpers #341
Commits on Nov 27, 2019
-
Implement portable tailcall helpers
This implements tailcall-via-help support for all platforms supported by the runtime. In this new mechanism the JIT asks the runtime for help whenever it realizes it will need a helper to perform a tailcall, i.e. when it sees an explicit tail. prefixed call that it cannot make into a fast jump-based tailcall. The runtime created two important IL stubs to help the JIT in performing the necessary tailcalls. One IL stub is used to store the args for the tailcall, while the other is used to dispatch the actual tailcall itself. The JIT will then transform the call from return tail. F(a1, ..., an); to IL_STUB_StoreTailCallArgs(a1, ..., an); T result; IL_STUB_DispatchTailCalls(..., &result); return result; The dispatcher is written in such a way that it is able to dispatch multiple tailcalls in a row when tailcalled functions also perform tailcalls. To do this, the JIT helps the dispatcher detect if the caller's caller is also a dispatcher. When this is the case the dispatcher returns to let the previous dispatcher perform the tailcall with the currently stored args. This allows the frame to unwind and ensures that sequences of tailcalls do not grow the stack more than by a constant factor. Due to this unwinding the args cannot be stored on the stack and are instead stored in TLS. The GC is made specially of this buffer as the args can be anything, including interior pointers. The control-flow when performing the new tailcalls is nonstandard, so this also changes the debugger to support proper stepping into/over/out of tailcalled functions when they go through the new dispatcher. x86's tailcalling mechanism does not change.
Configuration menu - View commit details
-
Copy full SHA for cc45a0e - Browse repository at this point
Copy the full SHA cc45a0eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 62a0134 - Browse repository at this point
Copy the full SHA 62a0134View commit details
Commits on Feb 5, 2020
-
Configuration menu - View commit details
-
Copy full SHA for b6af537 - Browse repository at this point
Copy the full SHA b6af537View commit details
Commits on Mar 3, 2020
-
Configuration menu - View commit details
-
Copy full SHA for de7608a - Browse repository at this point
Copy the full SHA de7608aView commit details -
Configuration menu - View commit details
-
Copy full SHA for c121e9e - Browse repository at this point
Copy the full SHA c121e9eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 442f186 - Browse repository at this point
Copy the full SHA 442f186View commit details -
Configuration menu - View commit details
-
Copy full SHA for f21b9c6 - Browse repository at this point
Copy the full SHA f21b9c6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2671b74 - Browse repository at this point
Copy the full SHA 2671b74View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0406cbb - Browse repository at this point
Copy the full SHA 0406cbbView commit details
Commits on Mar 5, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 08a44e4 - Browse repository at this point
Copy the full SHA 08a44e4View commit details
Commits on Mar 6, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 0b7e464 - Browse repository at this point
Copy the full SHA 0b7e464View commit details
Commits on Mar 7, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 46a869b - Browse repository at this point
Copy the full SHA 46a869bView commit details
Commits on Mar 8, 2020
-
Configuration menu - View commit details
-
Copy full SHA for f43b6a2 - Browse repository at this point
Copy the full SHA f43b6a2View commit details
Commits on Mar 10, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 710f7a2 - Browse repository at this point
Copy the full SHA 710f7a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6af504a - Browse repository at this point
Copy the full SHA 6af504aView commit details
Commits on Mar 11, 2020
-
Configuration menu - View commit details
-
Copy full SHA for ad93d07 - Browse repository at this point
Copy the full SHA ad93d07View commit details -
Configuration menu - View commit details
-
Copy full SHA for 565833f - Browse repository at this point
Copy the full SHA 565833fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 13c9e22 - Browse repository at this point
Copy the full SHA 13c9e22View commit details
Commits on Mar 13, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 2209664 - Browse repository at this point
Copy the full SHA 2209664View commit details
Commits on Mar 14, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 6081e53 - Browse repository at this point
Copy the full SHA 6081e53View commit details -
Configuration menu - View commit details
-
Copy full SHA for a508947 - Browse repository at this point
Copy the full SHA a508947View commit details
Commits on Mar 16, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 4801b25 - Browse repository at this point
Copy the full SHA 4801b25View commit details
Commits on Mar 21, 2020
-
Merge branch 'master' of https://github.com/dotnet/runtime
# Conflicts: # src/coreclr/src/inc/corinfo.h # src/coreclr/src/jit/morph.cpp # src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs # src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp
Configuration menu - View commit details
-
Copy full SHA for 29f2832 - Browse repository at this point
Copy the full SHA 29f2832View commit details -
Configuration menu - View commit details
-
Copy full SHA for 03256b6 - Browse repository at this point
Copy the full SHA 03256b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd4fe1b - Browse repository at this point
Copy the full SHA bd4fe1bView commit details -
Configuration menu - View commit details
-
Copy full SHA for cc36784 - Browse repository at this point
Copy the full SHA cc36784View commit details
Commits on Mar 22, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 84bd83e - Browse repository at this point
Copy the full SHA 84bd83eView commit details
Commits on Mar 31, 2020
-
Merge branch 'master' of https://github.com/dotnet/runtime
# Conflicts: # src/coreclr/src/inc/corinfo.h # src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs # src/coreclr/src/tools/crossgen2/jitinterface/jitwrapper.cpp
Configuration menu - View commit details
-
Copy full SHA for bcd44da - Browse repository at this point
Copy the full SHA bcd44daView commit details -
Expand only required intrinsics in methods that call NextCallReturnAd…
…dress. This mitigates cases where the tail call caller is not optimized (e.g., when it's a static constructor) and a tail-prefixed intrinsic is not expanded and then IL_STUB_CallTailCallTarget is optimized and the intrinsic is expanded. In that case codegen for NextCallReturnAddress is confused since there is no call.
Configuration menu - View commit details
-
Copy full SHA for b1d2b41 - Browse repository at this point
Copy the full SHA b1d2b41View commit details
Commits on Apr 13, 2020
-
Merge branch 'master' of https://github.com/dotnet/runtime
# Conflicts: # src/coreclr/tests/issues.targets
Configuration menu - View commit details
-
Copy full SHA for bd8415b - Browse repository at this point
Copy the full SHA bd8415bView commit details -
Change lowering of GT_LABEL on arm.
Generate movw/movt instead of adr on arm. adr on arm allows offsets up to 4k, which may not be enough. In particular, IL_STUB_CallTailCallTarget uses GT_LABEL before argument setup code and it can be more than 4k.
Configuration menu - View commit details
-
Copy full SHA for 4219e96 - Browse repository at this point
Copy the full SHA 4219e96View commit details -
Add COMPlus_FastTailCalls environment variable.
COMPlus_FastTailCalls controls whether fast tail calls are allowed. If COMPlus_FastTailCalls is 0, fast tail calls are not allowed even for tail-prefixed calls. Only helper-based calls are allowed. This is useful for testing helper-based calls.
Configuration menu - View commit details
-
Copy full SHA for 564b089 - Browse repository at this point
Copy the full SHA 564b089View commit details -
Configuration menu - View commit details
-
Copy full SHA for f3d9f09 - Browse repository at this point
Copy the full SHA f3d9f09View commit details
Commits on Apr 21, 2020
-
Merge branch 'master' of https://github.com/dotnet/runtime
# Conflicts: # src/coreclr/src/jit/lower.cpp
Configuration menu - View commit details
-
Copy full SHA for 28878a8 - Browse repository at this point
Copy the full SHA 28878a8View commit details -
Fix the type of IL_STUB_StoreTailCallArgs
this
parameter.When we have an indirect tail call, we may not be able to figure out the target MethodDesc so we need to use the type of the caller's 'this` argument to get the correct type of the callee's this parameter. Without this fix we were passing a `byref` as 'this' argument to `IL_STUB_StoreTailCallArgs`, whose `this` parameter was typed as `ref`. This lead to validation failures during GC. With the fix we correctly set the type of the stub's `this` parameter as `byref`.
Configuration menu - View commit details
-
Copy full SHA for 8b641b1 - Browse repository at this point
Copy the full SHA 8b641b1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 47030d2 - Browse repository at this point
Copy the full SHA 47030d2View commit details
Commits on Apr 22, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 8fc501c - Browse repository at this point
Copy the full SHA 8fc501cView commit details -
Merge branch 'master' of https://github.com/dotnet/runtime
# Conflicts: # src/coreclr/tests/issues.targets
Configuration menu - View commit details
-
Copy full SHA for fb3d883 - Browse repository at this point
Copy the full SHA fb3d883View commit details
Commits on Apr 24, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 3ac5187 - Browse repository at this point
Copy the full SHA 3ac5187View commit details -
Configuration menu - View commit details
-
Copy full SHA for 20138ab - Browse repository at this point
Copy the full SHA 20138abView commit details
Commits on Apr 25, 2020
-
Configuration menu - View commit details
-
Copy full SHA for be718ba - Browse repository at this point
Copy the full SHA be718baView commit details -
Configuration menu - View commit details
-
Copy full SHA for f1e5638 - Browse repository at this point
Copy the full SHA f1e5638View commit details