summaryrefslogtreecommitdiff
path: root/src/zap/zapinfo.cpp
diff options
context:
space:
mode:
authorAndy Ayers <andya@microsoft.com>2017-10-05 11:31:58 -0700
committerGitHub <noreply@github.com>2017-10-05 11:31:58 -0700
commitb085bfacb5eed105e3e55681f75c5413d91c1f86 (patch)
tree632213098eebafc8a28d56d8bf1e4aace2206289 /src/zap/zapinfo.cpp
parent6c18b66b6f4cc904065f8abaa442fd112493a36c (diff)
downloadcoreclr-b085bfacb5eed105e3e55681f75c5413d91c1f86.tar.gz
coreclr-b085bfacb5eed105e3e55681f75c5413d91c1f86.tar.bz2
coreclr-b085bfacb5eed105e3e55681f75c5413d91c1f86.zip
JIT: More type equality opts (#14317)
* JIT: Wrap some runtime lookups in new node type Work based on the plan outlined in #14305. Introduce a new unary node type GT_RUNTIMELOOKUP that wraps existing runtime lookup trees created in `impLookupToTree` and holds onto the handle that inspired the lookup. Note there are other importer paths that create lookups directly that we might also want to wrap, though wrapping is not a requirement for correctness. Keep this node type around through morph, then unwrap and just use the wrapped node after that. * JIT: More enhancements to type equality testing The jit is now able to optimize some type equality checks in shared method instances where one or both of the types require runtime lookup, for instance comparing `T` to a value type, or comparing two different value types `V1<T>` and `V2<T>`. Add two new jit interface methods, one for testing for type equality and the other for type casting. These return Must/MustNot/Maybe results depending on whether or not the equality or cast can be resolved at jit time. Implement the equality check. Use this to enhance the type equality opts in the jit for both direct comparison and the checking done by unbox.any.
Diffstat (limited to 'src/zap/zapinfo.cpp')
-rw-r--r--src/zap/zapinfo.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/zap/zapinfo.cpp b/src/zap/zapinfo.cpp
index 01d3a3b7cc..4007f678ae 100644
--- a/src/zap/zapinfo.cpp
+++ b/src/zap/zapinfo.cpp
@@ -3107,6 +3107,16 @@ BOOL ZapInfo::areTypesEquivalent(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE
return m_pEEJitInfo->areTypesEquivalent(cls1, cls2);
}
+TypeCompareState ZapInfo::compareTypesForCast(CORINFO_CLASS_HANDLE fromClass, CORINFO_CLASS_HANDLE toClass)
+{
+ return m_pEEJitInfo->compareTypesForCast(fromClass, toClass);
+}
+
+TypeCompareState ZapInfo::compareTypesForEquality(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2)
+{
+ return m_pEEJitInfo->compareTypesForEquality(cls1, cls2);
+}
+
CORINFO_CLASS_HANDLE ZapInfo::mergeClasses(
CORINFO_CLASS_HANDLE cls1,
CORINFO_CLASS_HANDLE cls2)