@@ -1489,8 +1489,25 @@ MethodTableBuilder::BuildMethodTableThrowing(
1489
1489
}
1490
1490
}
1491
1491
1492
+ // If this type is marked by [Intrinsic] attribute, it may be specially treated by the runtime/compiler
1493
+ // SIMD types have [Intrinsic] attribute, for example
1494
+ //
1495
+ // We check this here fairly early to ensure other downstream checks on these types can be slightly more efficient.
1496
+ if (GetModule ()->IsSystem () || GetAssembly ()->IsSIMDVectorAssembly ())
1497
+ {
1498
+ HRESULT hr = GetMDImport ()->GetCustomAttributeByName (bmtInternal->pType ->GetTypeDefToken (),
1499
+ g_CompilerServicesIntrinsicAttribute,
1500
+ NULL ,
1501
+ NULL );
1502
+
1503
+ if (hr == S_OK)
1504
+ {
1505
+ bmtProp->fIsIntrinsicType = true ;
1506
+ }
1507
+ }
1508
+
1492
1509
#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
1493
- if (GetModule ()-> IsSystem () && !bmtGenerics->HasInstantiation ())
1510
+ if (bmtProp-> fIsIntrinsicType && !bmtGenerics->HasInstantiation ())
1494
1511
{
1495
1512
LPCUTF8 className;
1496
1513
LPCUTF8 nameSpace;
@@ -1520,23 +1537,6 @@ MethodTableBuilder::BuildMethodTableThrowing(
1520
1537
}
1521
1538
#endif
1522
1539
1523
- // If this type is marked by [Intrinsic] attribute, it may be specially treated by the runtime/compiler
1524
- // Currently, only SIMD types have [Intrinsic] attribute
1525
- //
1526
- // We check this here fairly early to ensure other downstream checks on these types can be slightly more efficient.
1527
- if (GetModule ()->IsSystem () || GetAssembly ()->IsSIMDVectorAssembly ())
1528
- {
1529
- HRESULT hr = GetMDImport ()->GetCustomAttributeByName (bmtInternal->pType ->GetTypeDefToken (),
1530
- g_CompilerServicesIntrinsicAttribute,
1531
- NULL ,
1532
- NULL );
1533
-
1534
- if (hr == S_OK)
1535
- {
1536
- bmtProp->fIsIntrinsicType = true ;
1537
- }
1538
- }
1539
-
1540
1540
// Com Import classes are special. These types must derive from System.Object,
1541
1541
// and we then substitute the parent with System._ComObject.
1542
1542
if (IsComImport () && !IsEnum () && !IsInterface () && !IsValueClass () && !IsDelegate ())
0 commit comments