summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTanner Gooding <tagoo@outlook.com>2018-01-25 18:42:54 -0800
committerTanner Gooding <tagoo@outlook.com>2018-01-27 11:37:14 -0800
commit6b0164a9c94e8bc566914697a87db6b4267788e5 (patch)
tree194a9d2d00a008813e8016f008a1ab14dfdc1a8f /src
parentb20623ef37cd64a44313465110256cabf97d627e (diff)
downloadcoreclr-6b0164a9c94e8bc566914697a87db6b4267788e5.tar.gz
coreclr-6b0164a9c94e8bc566914697a87db6b4267788e5.tar.bz2
coreclr-6b0164a9c94e8bc566914697a87db6b4267788e5.zip
Moving the SetIsIntrinsic code earlier in the method table builder.
Diffstat (limited to 'src')
-rw-r--r--src/vm/methodtablebuilder.cpp42
1 files changed, 19 insertions, 23 deletions
diff --git a/src/vm/methodtablebuilder.cpp b/src/vm/methodtablebuilder.cpp
index 859d745470..9308844ac9 100644
--- a/src/vm/methodtablebuilder.cpp
+++ b/src/vm/methodtablebuilder.cpp
@@ -1858,24 +1858,6 @@ MethodTableBuilder::BuildMethodTableThrowing(
pMT->SetIsByRefLike();
}
- // If this type is marked by [Intrinsic] attribute, it may be specially treated by the runtime/compiler
- // Currently, only SIMD types have [Intrinsic] attribute
- //
- // We check this here, before the SystemVAmd64CheckForPass[Native]StructInRegister calls to ensure the SIMD
- // intrinsics are not enregistered incorrectly.
- if ((GetModule()->IsSystem() || GetAssembly()->IsSIMDVectorAssembly()) && IsValueClass() && bmtGenerics->HasInstantiation())
- {
- HRESULT hr = GetMDImport()->GetCustomAttributeByName(bmtInternal->pType->GetTypeDefToken(),
- g_CompilerServicesIntrinsicAttribute,
- NULL,
- NULL);
-
- if (hr == S_OK)
- {
- pMT->SetIsIntrinsicType();
- }
- }
-
if (IsValueClass())
{
if (bmtFP->NumInstanceFieldBytes != totalDeclaredFieldSize || HasOverLayedField())
@@ -9543,7 +9525,7 @@ void MethodTableBuilder::CheckForSystemTypes()
// We can exit early for generic types - there are just a few cases to check for.
if (bmtGenerics->HasInstantiation())
{
- if (pClass->HasLayout())
+ if (pMT->IsIntrinsicType() && pClass->HasLayout())
{
if (FAILED(GetMDImport()->GetNameOfTypeDef(GetCl(), &name, &nameSpace)))
{
@@ -9606,10 +9588,7 @@ void MethodTableBuilder::CheckForSystemTypes()
// These types should be handled or explicitly skipped below to ensure that we don't
// miss adding required ABI support for future types.
- _ASSERTE_MSG((strcmp(name, "Vector64DebugView`1") == 0) ||
- (strcmp(name, "Vector128DebugView`1") == 0) ||
- (strcmp(name, "Vector256DebugView`1") == 0),
- "Unhandled Hardware Intrinsic Type.");
+ _ASSERTE_MSG(FALSE, "Unhandled Hardware Intrinsic Type.");
}
return;
@@ -10449,6 +10428,23 @@ MethodTableBuilder::SetupMethodTable2(
}
pMT->SetInternalCorElementType(normalizedType);
+ // If this type is marked by [Intrinsic] attribute, it may be specially treated by the runtime/compiler
+ // Currently, only SIMD types have [Intrinsic] attribute
+ //
+ // We check this here fairly early to ensure other downstream checks on these types can be slightly more efficient.
+ if ((GetModule()->IsSystem() || GetAssembly()->IsSIMDVectorAssembly()) && IsValueClass() && bmtGenerics->HasInstantiation())
+ {
+ HRESULT hr = GetMDImport()->GetCustomAttributeByName(bmtInternal->pType->GetTypeDefToken(),
+ g_CompilerServicesIntrinsicAttribute,
+ NULL,
+ NULL);
+
+ if (hr == S_OK)
+ {
+ pMT->SetIsIntrinsicType();
+ }
+ }
+
if (GetModule()->IsSystem())
{
// we are in mscorlib