summaryrefslogtreecommitdiff
path: root/src/vm/comdelegate.h
diff options
context:
space:
mode:
authorLubomir Litchev <llitchev@live.com>2015-02-19 11:42:30 -0800
committerLubomir Litchev <lubol@microsoft.com>2015-10-20 14:20:36 -0700
commit378e304f9e22b3c4d03c3b1b62c47b0aa58ceaf5 (patch)
treeb83aec8f77caeb9ca94c6d7505a548b93cdb7259 /src/vm/comdelegate.h
parent3015ff7afb4936a1c5c5856daa4e3482e6b390a9 (diff)
downloadcoreclr-378e304f9e22b3c4d03c3b1b62c47b0aa58ceaf5.tar.gz
coreclr-378e304f9e22b3c4d03c3b1b62c47b0aa58ceaf5.tar.bz2
coreclr-378e304f9e22b3c4d03c3b1b62c47b0aa58ceaf5.zip
Implementation of System V ABI struct passing.
This PR adds support for System V x86_64 ABI classification and calling convention to the VM and the Jit, including, but not limited to Ubuntu Linux and Mac OS X. The general rules outlined in the System V x86_64 ABI (described at http://www.x86-64.org/documentation/abi.pdf) are followed with a few little exceptions, described below: 1. The hidden argument for by-value passed structs is always after the ÎéÎíthisÎéÎí parameter (if there is one.). This is a difference with the Sysetem V ABI and affects only the internal jit calling conventions. For PInvoke calls the hidden argument is always the first parameter since there is no ÎéÎíthisÎéÎí parameter in this case. 2. Managed structs that have no fields are always passed by-value on the stack. 3. The jit proactively generates frame register frames (with RBP as a frame register) in order to aid the native OS tooling for stack unwinding and the like.
Diffstat (limited to 'src/vm/comdelegate.h')
-rw-r--r--src/vm/comdelegate.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/vm/comdelegate.h b/src/vm/comdelegate.h
index cfb9afa783..ab8ca04338 100644
--- a/src/vm/comdelegate.h
+++ b/src/vm/comdelegate.h
@@ -211,10 +211,14 @@ void DistributeUnhandledExceptionReliably(OBJECTREF *pDelegate,
// signature.
struct ShuffleEntry
{
+ // Offset masks and special value
enum {
- REGMASK = 0x8000,
- OFSMASK = 0x7fff,
- SENTINEL = 0xffff,
+ REGMASK = 0x8000, // Register offset bit
+ FPREGMASK = 0x4000, // Floating point register bit
+ FPSINGLEMASK = 0x2000, // Single precising floating point register
+ OFSMASK = 0x7fff, // Mask to get stack offset
+ OFSREGMASK = 0x1fff, // Mask to get register index
+ SENTINEL = 0xffff, // Indicates end of shuffle array
};
#if defined(_TARGET_AMD64_) && !defined(UNIX_AMD64_ABI)
@@ -224,17 +228,11 @@ struct ShuffleEntry
};
#else
- // Special values:
- // -1 - indicates end of shuffle array: stacksizedelta
- // == difference in stack size between virtual and static sigs.
- // high bit - indicates a register argument: mask it off and
- // the result is an offset into ArgumentRegisters.
-
UINT16 srcofs;
union {
UINT16 dstofs; //if srcofs != SENTINEL
- UINT16 stacksizedelta; //if dstofs == SENTINEL
+ UINT16 stacksizedelta; //if dstofs == SENTINEL, difference in stack size between virtual and static sigs
};
#endif // _TARGET_AMD64_
};