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

Fix Array ctor integer widening and add Reflection tests #61347

Merged
merged 16 commits into from
Nov 11, 2021

Conversation

AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT commented Nov 9, 2021

The Array ctor path via Reflection had a bug in its integer widening, so converted that to the correct path.
Add tests for Reflection Invoke where the input object[] is changed during invocation.
Remove some coreclr code in the Invoke path.

Remove always false IsStructRequiringStackAllocRetBuf().
Extract the conversion of array constructor arguments into managed.
Expose new FCall for Array ctor call.
Add special case for array construction during Invoke.
Create new icall for Array ctor call.
Create macro define for SPAN_T.
@ghost
Copy link

ghost commented Nov 9, 2021

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

Issue Details

This pulls out some logic from coreclr and mono for special casing array construction. The primary improvement is the unboxing of objects to ints is now done in managed code and passed down to the runtime as a Span<int>.

Author: AaronRobinsonMSFT
Assignees: -
Labels:

area-System.Reflection

Milestone: 7.0.0

Build issues.
@AaronRobinsonMSFT AaronRobinsonMSFT marked this pull request as ready for review November 9, 2021 06:13
@vargaz
Copy link
Contributor

vargaz commented Nov 9, 2021

The mono changes look ok.

@AaronRobinsonMSFT
Copy link
Member Author

Add tests for Reflection Binder type conversion support during Invoke.
Make sure integral types respect sign extension during widen operation.
Fix InvokeUtil::CreatePrimitiveValue to write destination size.
Validate arg count prior to running static constructor.
Properly widen the input by respecting endianness.
Revert changes to InvokeUtil::CreatePrimitiveValue.
Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

Revert some non-impactful changes
Revert some non-impactful changes
Revert some non-impactful changes
Remove additional changes.
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.

3 participants