summaryrefslogtreecommitdiff
path: root/src/jit/valuenumfuncs.h
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2018-11-19 09:23:22 +0100
committerGitHub <noreply@github.com>2018-11-19 09:23:22 +0100
commit497419bf8f19c649d821295da7e225e55581cce9 (patch)
tree5f2813fefef41417a102627277db2fb01b76d7d3 /src/jit/valuenumfuncs.h
parentd76d97ffc9ba23e6eec30536c6f07756e08151f2 (diff)
downloadcoreclr-497419bf8f19c649d821295da7e225e55581cce9.tar.gz
coreclr-497419bf8f19c649d821295da7e225e55581cce9.tar.bz2
coreclr-497419bf8f19c649d821295da7e225e55581cce9.zip
Make type comparisons more general purpose (#20940)
This has two parts: ## Part 1 CoreRT represents native type handles differently from CoreCLR - on CoreCLR, `RuntimeTypeHandle` is a wrapper over `RuntimeType` and RyuJIT is aware of that. On CoreRT, `RuntimeTypeHandle` wraps the native type handle, not a `RuntimeType`. The knowledge is hardcoded in importer when importing the sequence "ldtoken foo / call Type.GetTypeFromHandle" - importer just removes the call and bashes the result of ldtoken to be a reference type. CoreRT had to avoid reporting `Type.GetTypeFromHandle` as an intrinsic because of that. I'm adding another helper that lets RyuJIT avoid hardcoding that knowledge. Instead of just bashing the return type, we swap the helper call. ## Part 2 Native type handle equality checks need to go through a helper, unless the EE side says it's okay to compare native type handles directly.
Diffstat (limited to 'src/jit/valuenumfuncs.h')
-rw-r--r--src/jit/valuenumfuncs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/jit/valuenumfuncs.h b/src/jit/valuenumfuncs.h
index e29721b480..b5952dd9ad 100644
--- a/src/jit/valuenumfuncs.h
+++ b/src/jit/valuenumfuncs.h
@@ -37,6 +37,9 @@ ValueNumFuncDef(IsInstanceOf, 2, false, false, false) // Args: 0: Handle o
ValueNumFuncDef(ReadyToRunCastClass, 2, false, false, false) // Args: 0: Helper stub address, 1: object being cast.
ValueNumFuncDef(ReadyToRunIsInstanceOf, 2, false, false, false) // Args: 0: Helper stub address, 1: object being queried.
ValueNumFuncDef(TypeHandleToRuntimeType, 1, false, false, false) // Args: 0: TypeHandle to translate
+ValueNumFuncDef(TypeHandleToRuntimeTypeHandle, 1, false, false, false) // Args: 0: TypeHandle to translate
+
+ValueNumFuncDef(AreTypesEquivalent, 2, false, false, false) // Args: 0: first TypeHandle, 1: second TypeHandle
ValueNumFuncDef(LdElemA, 3, false, false, false) // Args: 0: array value; 1: index value; 2: type handle of element.