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

[mini] Dynamically allocate a buffer for large runtime invoke results #58215

Merged
merged 2 commits into from
Aug 30, 2021

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented Aug 26, 2021

If the return type is a struct that's bigger than our buffer, malloc a buffer for it instead of using a fixed-size stack buffer.

Also take the ref-return logic from #52501 and add it to the non-LLVM runtime-invoke

This makes the System.Runtime testsuite (particularly InvokeRefReturnNetcoreTests) pass on M1 MacCatalyst FullAOT.

Related to #58190

@ghost
Copy link

ghost commented Aug 26, 2021

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

Issue Details

If the return type is a struct that's bigger than our buffer, malloc a
buffer for it instead of using a fixed-size stack buffer

Related to #58190

Author: lambdageek
Assignees: -
Labels:

area-VM-meta-mono

Milestone: -

If the return type is a struct that's bigger than our buffer, malloc a
buffer for it instead of using a fixed-size stack buffer
Fixes various tests in InvokeRefReturnNetcoreTests
@lambdageek lambdageek marked this pull request as ready for review August 27, 2021 18:49
@lambdageek
Copy link
Member Author

I think we want this for 6.0.

@lambdageek
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1182670893

@lambdageek lambdageek merged commit b6cc822 into dotnet:main Aug 30, 2021
lambdageek added a commit to lambdageek/runtime that referenced this pull request Sep 11, 2021
github-actions bot pushed a commit that referenced this pull request Sep 12, 2021
Fixes #58957
Related to #58215 which was attempting to
fix #58190
lambdageek added a commit that referenced this pull request Sep 12, 2021
* [mini] Use alloca for runtime_invoke retval buffer

Fixes #58957
Related to #58215 which was attempting to
fix #58190

* Set initial return buffer size to TARGET_SIZEOF_VOID_P

In the common case we use the return buffer just to hold a pointer to
the return value
Anipik pushed a commit that referenced this pull request Sep 13, 2021
)

* [mini] Use alloca for runtime_invoke retval buffer

Fixes #58957
Related to #58215 which was attempting to
fix #58190

* Set initial return buffer size to TARGET_SIZEOF_VOID_P

In the common case we use the return buffer just to hold a pointer to
the return value

Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
Co-authored-by: Aleksey Kliger <aleksey@lambdageek.org>
@ghost ghost locked as resolved and limited conversation to collaborators Sep 29, 2021
@lambdageek lambdageek deleted the fix-gh-58190 branch March 19, 2022 16:45
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