Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Keep tokenScope consistent during devirtualization #26453

Merged
merged 1 commit into from
Sep 2, 2019

Conversation

trylek
Copy link
Member

@trylek trylek commented Aug 30, 2019

Previously, when we were constructing the CORINFO_RESOLVED_TOKEN
to represent a devirtualized method, we reused the previous
tokenScope so that the tokenScope effectively went out of sync
with the token value.

Based on Andy's advice I have changed this logic to update the
tokenScope by calling the JIT interface method getMethodModule
for the resolved virtual method. I have verified locally that
(with a bit of counterpart CPAOT changes) this logic fixes the
bug I was previously hitting due to this inconsistency.

This is the first time I'm trying to make a change in JIT (albeit
small) so I'll be grateful for any advice as to how to make sure
I don't break the world, so to say. I'm also unsure about some
of the related logistics:

  1. The change requires a counterpart CoreRT change (CPAOT / RyuJIT)
    I have just sent out for PR. Once that I [hopefully] manage to
    merge both changes in, I'm not sure about the subsequent logistics
    to update the JIT drop in CoreRT.

  2. Does this change merit bumping up the JITEEVersionIdentifier?
    I mean, it technically doesn't introduce a change in the JIT
    interface but it brings in slightly modified semantics in the sense
    that the getMethodModule method is now actually getting called
    (I haven't found any pre-existing JIT code calling the method
    and it was throwing a NotImplementedException in CoreRT).

Thanks

Tomas

P.S. You can find the counterpart CoreRT change at

dotnet/corert#7755

Previously, when we were constructing the CORINFO_RESOLVED_TOKEN
to represent a devirtualized method, we reused the previous
tokenScope so that the tokenScope effectively went out of sync
with the token value.

Based on Andy's advice I have changed this logic to update the
tokenScope by calling the JIT interface method getMethodModule
for the resolved virtual method. I have verified locally that
(with a bit of counterpart CPAOT changes) this logic fixes the
bug I was previously hitting due to this inconsistency.

This is the first time I'm trying to make a change in JIT (albeit
small) so I'll be grateful for any advice as to how to make sure
I don't break the world, so to say. I'm also unsure about some
of the related logistics:

1) The change requires a counterpart CoreRT change (CPAOT / RyuJIT)
I have just sent out for PR. Once that I [hopefully] manage to
merge both changes in, I'm not sure about the subsequent logistics
to update the JIT drop in CoreRT.

2) Does this change merit bumping up the JITEEVersionIdentifier?
I mean, it technically doesn't introduce a change in the JIT
interface but it brings in slightly modified semantics in the sense
that the getMethodModule method is now actually getting called
(I haven't found any pre-existing JIT code calling the method
and it was throwing a NotImplementedException in CoreRT).

Thanks

Tomas
Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@AndyAyersMS
Copy link
Member

No need to change the JIT GUID, you only need to do that when you modify the interface.

@trylek trylek merged commit b18ea9c into dotnet:master Sep 2, 2019
@trylek trylek deleted the DevirtualizedTokenScope branch September 2, 2019 20:35
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
)

Previously, when we were constructing the CORINFO_RESOLVED_TOKEN
to represent a devirtualized method, we reused the previous
tokenScope so that the tokenScope effectively went out of sync
with the token value.

Based on Andy's advice I have changed this logic to update the
tokenScope by calling the JIT interface method getMethodModule
for the resolved virtual method. I have verified locally that
(with a bit of counterpart CPAOT changes) this logic fixes the
bug I was previously hitting due to this inconsistency.

Thanks

Tomas


Commit migrated from dotnet/coreclr@b18ea9c
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants