Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Expose GetMethodILDefinition on MethodIL - #1523

Merged
MichalStrehovsky merged 1 commit into
dotnet:masterfrom
MichalStrehovsky:getMethodILDefinition
Jul 15, 2016
Merged

MichalStrehovsky merged 1 commit into
dotnet:masterfrom
MichalStrehovsky:getMethodILDefinition

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

This is a useful operation after all.

Also, simplify the constructor of InstantiatedMethodIL.

Also, simplify the constructor of `InstantiatedMethodIL`.
@jkotas

jkotas commented Jul 15, 2016

Copy link
Copy Markdown
Member

This is a useful operation after all.

What is it useful for?

LGTM otherwise.

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

In shared generic mode, RyuJIT will be compiling canonical method bodies (e.g. when compiling Foo.Bar<T> over __Canon a !!0 reference in the method body will be resolved as __Canon).

But the dependency analysis engine will be operating on top of runtime determined types, not raw canonical types. In order to get the runtime determined type out of this, we need to be able to resolve the token corresponding to the !!0 (from my example) within the context of a runtime determined method. (In my example it means we will get a T__Canon instead of __Canon.)

@jkotas

jkotas commented Jul 15, 2016

Copy link
Copy Markdown
Member

the dependency analysis engine will be operating on top of runtime determined types,

I understand why you want dependency analysis to operate on top of runtime determined types. But I do not understand why need GetMethodILDefinition to make this work. I would expect that the JIT-EE interface to have method IL instantiated over runtime determined types, and the runtime determined types to be lowered to plain __Cannon as necessary - to make JIT happy.

@jkotas

jkotas commented Jul 15, 2016

Copy link
Copy Markdown
Member

owered to plain __Cannon as necessary - to make JIT happy

Or fix the JIT to be happy with runtime determined types - it should be just a few very small tweaks.

@MichalStrehovsky

MichalStrehovsky commented Jul 15, 2016 •

Copy link
Copy Markdown
Member Author

@davidwrighton hinted that getting the JitInterface to operate on top of runtime determined types might be tricky since runtime determined types have some odd behaviors (constrained calls on them is one that I don't fully get yet, for example).

The current plan was to have JitInterface simply operate on top of __Canon types and when the need arises to talk to the dependency analysis, simply get the pResolvedToken.token, resolve it in the context of the definition (hence pull request), and instantiate over the runtime determined context.

Edit: I'm willing to be talked out of this plan :)

@MichalStrehovsky
MichalStrehovsky merged commit 4b1dca4 into dotnet:master Jul 15, 2016
@MichalStrehovsky
MichalStrehovsky deleted the getMethodILDefinition branch July 15, 2016 21:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants