summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2017-01-18 01:48:48 +0100
committerGitHub <noreply@github.com>2017-01-18 01:48:48 +0100
commitf22db8ccbbcfdc0a6f79d6a3130014742d537433 (patch)
tree5562d271939b4ca9d558e02b1c78a54f5e4989c0 /Documentation
parent8c822e69038faf8690165ed7b18f923db2e88dee (diff)
downloadcoreclr-f22db8ccbbcfdc0a6f79d6a3130014742d537433.tar.gz
coreclr-f22db8ccbbcfdc0a6f79d6a3130014742d537433.tar.bz2
coreclr-f22db8ccbbcfdc0a6f79d6a3130014742d537433.zip
Add generic instantion argument passing description on x86 (#8940)
This change adds missing information on generic instantion argument passing description on x86 to the CLR ABI document.
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/botr/clr-abi.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/botr/clr-abi.md b/Documentation/botr/clr-abi.md
index 1a6034467f..0ed9183f6c 100644
--- a/Documentation/botr/clr-abi.md
+++ b/Documentation/botr/clr-abi.md
@@ -50,7 +50,7 @@ Managed varargs are not supported in .NET Core.
## Generics
-*Shared generics*. In cases where the code address does not uniquely identify a generic instantiation of a method, then a 'generic instantiation parameter' is required. Often the "this" pointer can serve dual-purpose as the instantiation parameter. When the "this" pointer is not the generic parameter, the generic parameter is passed as the next argument (after the optional return buffer and the optional "this" pointer, but before any user arguments). For generic methods (where there is a type parameter directly on the method, as compared to the type), the generic parameter currently is a MethodDesc pointer (I believe an InstantiatedMethodDesc). For static methods (where there is no "this" pointer) the generic parameter is a MethodTable pointer/TypeHandle.
+*Shared generics*. In cases where the code address does not uniquely identify a generic instantiation of a method, then a 'generic instantiation parameter' is required. Often the "this" pointer can serve dual-purpose as the instantiation parameter. When the "this" pointer is not the generic parameter, the generic parameter is passed as an additional argument. On ARM, ARM64 and AMD64, it is passed after the optional return buffer and the optional "this" pointer, but before any user arguments. On x86, if all arguments of the function including "this" pointer fit into argument registers (ECX and EDX) and we still have argument registers available, we store the hidden argument in the next available argument register. Otherwise it is passed as the last stack argument. For generic methods (where there is a type parameter directly on the method, as compared to the type), the generic parameter currently is a MethodDesc pointer (I believe an InstantiatedMethodDesc). For static methods (where there is no "this" pointer) the generic parameter is a MethodTable pointer/TypeHandle.
Sometimes the VM asks the JIT to report and keep alive the generics parameter. In this case, it must be saved on the stack someplace and kept alive via normal GC reporting (if it was the "this" pointer, as compared to a MethodDesc or MethodTable) for the entire method except the prolog and epilog. Also note that the code to home it, must be in the range of code reported as the prolog in the GC info (which probably isn't the same as the range of code reported as the prolog in the unwind info).