diff options
author | Michal Strehovský <MichalStrehovsky@users.noreply.github.com> | 2017-05-03 02:51:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-03 02:51:52 +0300 |
commit | 2818ded63f1e35becd711734fcbe90a821e73254 (patch) | |
tree | 57018fb7711ffef2f95da6ae18d9d51ef2d89e40 /src/System.Private.Jit | |
parent | 29d330e0d46d21053ab3aeb0ffe37fc7e3128851 (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.cs | 18 |
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(); } |