diff options
author | Michal Strehovský <MichalStrehovsky@users.noreply.github.com> | 2018-03-28 10:21:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-28 10:21:18 +0300 |
commit | 7381280c5d07c4140fbc478edb4e87a6c51c18ef (patch) | |
tree | 30ed7323c0812daeaf1e40b9f72df6bbafa38336 /src | |
parent | dfcd12f92c37d7533dcf7a48e9ab16295d84cf31 (diff) |
Report IsIntrinsic on InstantiatedType (#5633)
Commit 5d96263c66e50ab88f51ec5aae01bd1d57d4ef37 made me aware that `IsIntrinsic` doesn't work on instantiated types. This fixes the problem in a bit of a roundabout way - we only want certain type system implementations to have the IsIntrinsic bit but the flags computation is in the core ECMA type system; a partial method to the rescue...
Diffstat (limited to 'src')
-rw-r--r-- | src/Common/src/TypeSystem/CodeGen/TypeDesc.CodeGen.cs | 9 | ||||
-rw-r--r-- | src/Common/src/TypeSystem/Common/InstantiatedType.cs | 6 | ||||
-rw-r--r-- | src/JitInterface/src/CorInfoImpl.cs | 2 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/Common/src/TypeSystem/CodeGen/TypeDesc.CodeGen.cs b/src/Common/src/TypeSystem/CodeGen/TypeDesc.CodeGen.cs index e5b0d36a7..9a5a1c8b2 100644 --- a/src/Common/src/TypeSystem/CodeGen/TypeDesc.CodeGen.cs +++ b/src/Common/src/TypeSystem/CodeGen/TypeDesc.CodeGen.cs @@ -18,4 +18,13 @@ namespace Internal.TypeSystem } } } + + partial class InstantiatedType + { + partial void AddComputedIntrinsicFlag(ref TypeFlags flags) + { + if (_typeDef.IsIntrinsic) + flags |= TypeFlags.IsIntrinsic; + } + } } diff --git a/src/Common/src/TypeSystem/Common/InstantiatedType.cs b/src/Common/src/TypeSystem/Common/InstantiatedType.cs index f89086f71..a777f223f 100644 --- a/src/Common/src/TypeSystem/Common/InstantiatedType.cs +++ b/src/Common/src/TypeSystem/Common/InstantiatedType.cs @@ -79,6 +79,10 @@ namespace Internal.TypeSystem } } + // Type system implementations that support the notion of intrinsic types + // will provide an implementation that adds the flag if necessary. + partial void AddComputedIntrinsicFlag(ref TypeFlags flags); + protected override TypeFlags ComputeTypeFlags(TypeFlags mask) { TypeFlags flags = 0; @@ -110,6 +114,8 @@ namespace Internal.TypeSystem if (_typeDef.IsByRefLike) flags |= TypeFlags.IsByRefLike; + + AddComputedIntrinsicFlag(ref flags); } return flags; diff --git a/src/JitInterface/src/CorInfoImpl.cs b/src/JitInterface/src/CorInfoImpl.cs index 66ef0e52d..f2809db0a 100644 --- a/src/JitInterface/src/CorInfoImpl.cs +++ b/src/JitInterface/src/CorInfoImpl.cs @@ -1006,7 +1006,7 @@ namespace Internal.JitInterface { TypeDesc type = HandleToObject(classHnd); - if (_simdHelper.IsSimdType(type.GetTypeDefinition())) + if (_simdHelper.IsSimdType(type)) { #if DEBUG // If this is Vector<T>, make sure the codegen and the type system agree on what instructions/registers |