summaryrefslogtreecommitdiff
path: root/src/vm/fieldmarshaler.h
diff options
context:
space:
mode:
authorJeremy Koritzinsky <jkoritzinsky@gmail.com>2019-03-04 13:15:28 -0800
committerGitHub <noreply@github.com>2019-03-04 13:15:28 -0800
commit1278da1f480e664b5afd1b62f2be74424dbefbb8 (patch)
tree5feccfd6491e70205b6158bea5400e16b4117f1f /src/vm/fieldmarshaler.h
parentfd3afcaf0dc0ace3f84d0412c128f4e64c419105 (diff)
downloadcoreclr-1278da1f480e664b5afd1b62f2be74424dbefbb8.tar.gz
coreclr-1278da1f480e664b5afd1b62f2be74424dbefbb8.tar.bz2
coreclr-1278da1f480e664b5afd1b62f2be74424dbefbb8.zip
Move EEClassLayoutInfo::CollectLayoutFieldMetadataThrowing to class.cpp (#22932)
Move `EEClassLayoutInfo::CollectLayoutFieldMetadataThrowing` to class.cpp and out of fieldmarshaler.cpp. This change co-locates `EEClassLayoutInfo::CollectLayoutFieldMetadataThrowing` with the rest of the implementation of `EEClassLayoutInfo`. Additionally, this PR separates out the field blittability check into a separate function instead of burying it in `CollectLayoutFieldMetadataThrowing`. Finally, it adds a small optimization in the field marshaler implementations where if a field's native size is statically known, the code returns that value instead of calling into one of the FieldMarshaler "virtual" calls. Originally part of #21415, but extracted out to make that PR smaller.
Diffstat (limited to 'src/vm/fieldmarshaler.h')
-rw-r--r--src/vm/fieldmarshaler.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/vm/fieldmarshaler.h b/src/vm/fieldmarshaler.h
index 2e1b011c5c..e83835844a 100644
--- a/src/vm/fieldmarshaler.h
+++ b/src/vm/fieldmarshaler.h
@@ -31,7 +31,6 @@
#endif // FEATURE_PREJIT
// Forward refernces
-class EEClassLayoutInfo;
class FieldDesc;
class MethodTable;
@@ -89,6 +88,36 @@ enum NStructFieldType
#define DEFAULT_PACKING_SIZE 32
+enum class ParseNativeTypeFlags
+{
+ None = 0x00,
+ IsAnsi = 0x01,
+#ifdef FEATURE_COMINTEROP
+ IsWinRT = 0x02,
+#endif // FEATURE_COMINTEROP
+};
+
+VOID ParseNativeType(Module* pModule,
+ PCCOR_SIGNATURE pCOMSignature,
+ DWORD cbCOMSignature,
+ ParseNativeTypeFlags flags,
+ LayoutRawFieldInfo* pfwalk,
+ PCCOR_SIGNATURE pNativeType,
+ ULONG cbNativeType,
+ IMDInternalImport* pInternalImport,
+ mdTypeDef cl,
+ const SigTypeContext * pTypeContext,
+ BOOL *pfDisqualifyFromManagedSequential
+#ifdef _DEBUG
+ ,
+ LPCUTF8 szNamespace,
+ LPCUTF8 szClassName,
+ LPCUTF8 szFieldName
+#endif
+);
+
+BOOL IsFieldBlittable(FieldMarshaler* pFM);
+
//=======================================================================
// This is invoked from the class loader while building the data structures for a type.
// This function checks if explicit layout metadata exists.
@@ -456,7 +485,6 @@ protected:
}
#endif // _DEBUG
-
RelativeFixupPointer<PTR_FieldDesc> m_pFD; // FieldDesc
UINT32 m_dwExternalOffset; // offset of field in the fixed portion
NStructFieldType m_nft;