Skip to content

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.

@ghost
Copy link

ghost commented Feb 10, 2022

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 vargaz force-pushed the gshared-static-virtual branch from 3ad2d47 to 77a8ffa Compare February 10, 2022 13:25
@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