Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschellap <schellap@microsoft.com>2015-12-01 22:45:26 +0300
committerschellap <schellap@microsoft.com>2015-12-01 22:45:26 +0300
commitf99654555bdf5e32048ce6f9e99ec3a6e70d10b2 (patch)
tree42a9a876e1ddbf4a2b0bbc62700c0040f83ab041 /src/JitInterface
parent87fc116236d67b0c1cb9c1e5241078c48d877d23 (diff)
Fix compile time handle for type
Diffstat (limited to 'src/JitInterface')
-rw-r--r--src/JitInterface/src/CorInfoImpl.cs23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/JitInterface/src/CorInfoImpl.cs b/src/JitInterface/src/CorInfoImpl.cs
index a9a727bf6..b7db79e22 100644
--- a/src/JitInterface/src/CorInfoImpl.cs
+++ b/src/JitInterface/src/CorInfoImpl.cs
@@ -1600,6 +1600,14 @@ namespace Internal.JitInterface
pResult.compileTimeHandle = (CORINFO_GENERIC_STRUCT_*)pResolvedToken.hField;
// fRuntimeLookup = th.IsSharedByGenericInstantiations() && pFD->IsStatic();
+
+ // TODO: shared generics
+ // If the target is not shared then we've already got our result and
+ // can simply do a static look up
+ pResult.lookup.lookupKind.needsRuntimeLookup = false;
+
+ pResult.lookup.constLookup.handle = (CORINFO_GENERIC_STRUCT_*)pResult.compileTimeHandle;
+ pResult.lookup.constLookup.accessType = InfoAccessType.IAT_VALUE;
}
else
{
@@ -1611,27 +1619,20 @@ namespace Internal.JitInterface
// TODO? If we're embedding a method handle for a method that points to a sub-class of the actual
// class, we might need to embed the actual declaring type in compileTimeHandle.
+ // TODO: shared generics
// IsSharedByGenericInstantiations would not work here. The runtime lookup is required
// even for standalone generic variables that show up as __Canon here.
//fRuntimeLookup = th.IsCanonicalSubtype();
- }
- Debug.Assert(pResult.compileTimeHandle != null);
-
- // TODO: shared generics
- //if (...)
- //{
- // ...
- //}
- // else
- {
// If the target is not shared then we've already got our result and
// can simply do a static look up
pResult.lookup.lookupKind.needsRuntimeLookup = false;
- pResult.lookup.constLookup.handle = (CORINFO_GENERIC_STRUCT_*)pResult.compileTimeHandle;
+ pResult.lookup.constLookup.handle = (CORINFO_GENERIC_STRUCT_*)ObjectToHandle(_compilation.NodeFactory.NecessaryTypeSymbol(td));
pResult.lookup.constLookup.accessType = InfoAccessType.IAT_VALUE;
}
+
+ Debug.Assert(pResult.compileTimeHandle != null);
}
// Workaround for struct return marshaling bug on Windows.