summaryrefslogtreecommitdiff
path: root/src/vm/argdestination.h
diff options
context:
space:
mode:
authorLubomir Litchev <lubol@microsoft.com>2016-01-25 22:23:31 -0800
committerLubomir Litchev <lubol@microsoft.com>2016-02-01 16:32:13 -0800
commitced8b62e9bee1ab3e3a5e6a519bdba3024245ca6 (patch)
tree8e24373ec541a98bd0735273ef03e1faf27003ad /src/vm/argdestination.h
parent2d93d77eaa87db87afbd93ed99e79095d6783020 (diff)
downloadcoreclr-ced8b62e9bee1ab3e3a5e6a519bdba3024245ca6.tar.gz
coreclr-ced8b62e9bee1ab3e3a5e6a519bdba3024245ca6.tar.bz2
coreclr-ced8b62e9bee1ab3e3a5e6a519bdba3024245ca6.zip
Fix for bugs related to clasifying System.TypedReference.
It was a long standing assumption in the Jit that a field of a struct can never be of ByRef type. It turns out this assumption is not entirely holding. The System.TypedReference is a very special type that is a struct, defined to have two IntPtr fields. When the VM instantiates this type it changes the type of the first field to ByRef. This change closes a GC hole in the passing this struct by value on the stack. It adds support to the classification algorithm for ByRef references. It also uses the tree types for generating the code that places struct field on the stack by value for passin to a callee. The handling of GT_RETURN in the codegenxarch.cpp has been extracted as a separate routine - genReturn. In case of struct return (multi-register struct return or an implicit retBuf return, it delegates to the genStructReturn method. This is a refactoring as well as making sure that GT_RETFILT is handled properly - the return type of it is always bool or void for the last statement of a finally block. More feedback addressed.
Diffstat (limited to 'src/vm/argdestination.h')
-rw-r--r--src/vm/argdestination.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vm/argdestination.h b/src/vm/argdestination.h
index 7837e51086..803d5f2454 100644
--- a/src/vm/argdestination.h
+++ b/src/vm/argdestination.h
@@ -144,7 +144,8 @@ public:
if (eightByteSize == 8)
{
_ASSERTE((eightByteClassification == SystemVClassificationTypeInteger) ||
- (eightByteClassification == SystemVClassificationTypeIntegerReference));
+ (eightByteClassification == SystemVClassificationTypeIntegerReference) ||
+ (eightByteClassification == SystemVClassificationTypeIntegerByRef));
_ASSERTE(IS_ALIGNED((SIZE_T)genRegDest, 8));
*(UINT64*)genRegDest = *(UINT64*)src;
@@ -193,7 +194,8 @@ public:
if (eightByteClassification != SystemVClassificationTypeSSE)
{
- if (eightByteClassification == SystemVClassificationTypeIntegerReference)
+ if ((eightByteClassification == SystemVClassificationTypeIntegerReference) ||
+ (eightByteClassification == SystemVClassificationTypeIntegerByRef))
{
_ASSERTE(eightByteSize == 8);
_ASSERTE(IS_ALIGNED((SIZE_T)genRegDest, 8));