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][wasm] Fix the usage of function pointers in mixed mode. #54098

Merged
merged 3 commits into from
Jun 16, 2021

Conversation

vargaz
Copy link
Contributor

@vargaz vargaz commented Jun 12, 2021

The llvm compiled code expects function pointers to be a MonoFtnDesc*, while
the interpreter expects them to be a InterpMethod*. Use a MonoFtnDesc in
both cases.

@ghost
Copy link

ghost commented Jun 12, 2021

Tagging subscribers to this area: @BrzVlad
See info in area-owners.md if you want to be subscribed.

Issue Details

The llvm compiled code expects function pointers to be a MonoFtnDesc*, while
the interpreter expects them to be a InterpMethod*. Use a MonoFtnDesc in
both cases.

Author: vargaz
Assignees: -
Labels:

area-Codegen-Interpreter-mono

Milestone: -

@vargaz vargaz marked this pull request as draft June 12, 2021 07:19
@vargaz vargaz force-pushed the mixed-calli branch 2 times, most recently from 361687b to 9fd1df3 Compare June 13, 2021 11:11
@lewing lewing requested a review from BrzVlad June 13, 2021 23:59
@vargaz vargaz force-pushed the mixed-calli branch 4 times, most recently from fd16461 to a6357b2 Compare June 14, 2021 04:31
@vargaz vargaz marked this pull request as ready for review June 15, 2021 00:01
@vargaz
Copy link
Contributor Author

vargaz commented Jun 15, 2021

Fixes #50965

The llvm compiled code expects function pointers to be a MonoFtnDesc*, while
the interpreter expects them to be a InterpMethod*. Use a MonoFtnDesc in
both cases.
@BrzVlad
Copy link
Member

BrzVlad commented Jun 15, 2021

It's ugly that passing function pointers between aot and interp would only work in llvmonly. Is it feasible, if we decide to care about it, to use function descriptors also in normal jit/aot mode when doing a ldftn ?

@vargaz
Copy link
Contributor Author

vargaz commented Jun 16, 2021

For non-llvmonly mode, the interpreter should use the same representation as the jitted code i.e. normal pointers to the method code, for interpreted code, that would be some kind of trampoline to enter the interpreter.

@BrzVlad
Copy link
Member

BrzVlad commented Jun 16, 2021

That would have problems on the interp side, since, instead of having direct access to the InterpMethod when doing a ldftn, we would have this native pointer that we have to call and enter the interpreter every time.

@vargaz
Copy link
Contributor Author

vargaz commented Jun 16, 2021

/azp run

@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@vargaz
Copy link
Contributor Author

vargaz commented Jun 16, 2021

/azp run runtime runtime-staging

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@vargaz vargaz merged commit 5fd027c into dotnet:main Jun 16, 2021
@vargaz vargaz deleted the mixed-calli branch June 16, 2021 09:52
@ghost ghost locked as resolved and limited conversation to collaborators Jul 16, 2021
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.

2 participants