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:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2017-05-03 02:51:52 +0300
committerGitHub <noreply@github.com>2017-05-03 02:51:52 +0300
commit2818ded63f1e35becd711734fcbe90a821e73254 (patch)
tree57018fb7711ffef2f95da6ae18d9d51ef2d89e40 /src/System.Private.Jit
parent29d330e0d46d21053ab3aeb0ffe37fc7e3128851 (diff)
Add ExactCallableAddress/CanonicalEntrypoint helpers to NodeFactory (#3465)
Removes a bit of boilerplate. This is an API @davidwrighton suggested some time ago. This was blocked until #3423 got implemented.
Diffstat (limited to 'src/System.Private.Jit')
-rw-r--r--src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitNodeFactory.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitNodeFactory.cs b/src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitNodeFactory.cs
index 413c17ecc..01615055d 100644
--- a/src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitNodeFactory.cs
+++ b/src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitNodeFactory.cs
@@ -86,6 +86,24 @@ namespace ILCompiler.DependencyAnalysis
return _methodEntrypoints.GetOrAdd(method);
}
+ public IMethodNode ExactCallableAddress(MethodDesc method, bool isUnboxingStub = false)
+ {
+ MethodDesc canonMethod = method.GetCanonMethodTarget(CanonicalFormKind.Specific);
+ if (method != canonMethod)
+ return FatFunctionPointer(method, isUnboxingStub);
+ else
+ return MethodEntrypoint(method, isUnboxingStub);
+ }
+
+ public IMethodNode CanonicalEntrypoint(MethodDesc method, bool isUnboxingStub = false)
+ {
+ MethodDesc canonMethod = method.GetCanonMethodTarget(CanonicalFormKind.Specific);
+ if (method != canonMethod)
+ return ShadowConcreteMethod(method, isUnboxingStub);
+ else
+ return MethodEntrypoint(method, isUnboxingStub);
+ }
+
public IMethodNode RuntimeDeterminedMethod(MethodDesc method) { throw new NotImplementedException(); }
public JitFrozenStringNode SerializedStringObject(string data) { return _frozenStrings.GetOrAdd(data); }
public JitGenericMethodDictionaryNode MethodGenericDictionary(MethodDesc method) { throw new NotImplementedException(); }