From 378e304f9e22b3c4d03c3b1b62c47b0aa58ceaf5 Mon Sep 17 00:00:00 2001 From: Lubomir Litchev Date: Thu, 19 Feb 2015 11:42:30 -0800 Subject: Implementation of System V ABI struct passing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/vm/threads.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/vm/threads.cpp') diff --git a/src/vm/threads.cpp b/src/vm/threads.cpp index 065c396929..5e4c05f514 100644 --- a/src/vm/threads.cpp +++ b/src/vm/threads.cpp @@ -2242,6 +2242,9 @@ Thread::Thread() #endif m_pAllLoggedTypes = NULL; +#ifdef FEATURE_UNIX_AMD64_STRUCT_PASSING + m_pHijackReturnTypeClass = NULL; +#endif } -- cgit v1.2.3