Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mono] Fix support for calls to static virtual methods from gshared c… #65126

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

vargaz
Copy link
Contributor

@vargaz vargaz commented Feb 10, 2022

…ode.

Fixes #65002.

When called from gshared code, these methods cannot be resolved at compile time,
since they depend on the constrained class which is only known at runtime.

  • For calls from normal gshared code, load the method address from the rgctx.
  • For calls from gsharedvt code, extend the existing mono_gsharedvt_constrained_call ()
    JIT icall to be able to handle static virtual methods.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@vargaz vargaz removed the request for review from SamMonoRT February 10, 2022 09:27
@vargaz
Copy link
Contributor Author

vargaz commented Feb 10, 2022

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

…ode.

Fixes dotnet#65002.

When called from gshared code, these methods cannot be resolved at compile time,
since they depend on the constrained class which is only known at runtime.

* For calls from normal gshared code, load the method address from the rgctx.
* For calls from gsharedvt code, extend the existing mono_gsharedvt_constrained_call ()
JIT icall to be able to handle static virtual methods.
@vargaz
Copy link
Contributor Author

vargaz commented Feb 10, 2022

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lambdageek
Copy link
Member

This makes sense to me, at a high level.

Is there anything special that needs to be done for bitcode, or FullAOT+interp?

@vargaz
Copy link
Contributor Author

vargaz commented Feb 10, 2022

bitcode is handled by one of the if cases, interp support should be automatic.

@vargaz vargaz merged commit fea36d8 into dotnet:main Feb 10, 2022
@vargaz vargaz deleted the gshared-static-virtual branch February 10, 2022 17:33
@ghost ghost locked as resolved and limited conversation to collaborators Mar 12, 2022
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.

[mono][fullaot] Calling static virtual method from a generic method leads to "Attempting to JIT" error
2 participants