Skip to content

Change all "unmanaged" (no GC fields) sequential types to have sequential layout. - #61759

Merged
jkoritzinsky merged 36 commits into
dotnet:mainfrom
jkoritzinsky:managedseqential_unmanaged
Dec 15, 2021
Merged

Change all "unmanaged" (no GC fields) sequential types to have sequential layout.#61759
jkoritzinsky merged 36 commits into
dotnet:mainfrom
jkoritzinsky:managedseqential_unmanaged

Conversation

@jkoritzinsky

@jkoritzinskyjkoritzinsky commented Nov 18, 2021

Copy link
Copy Markdown
Member

This is a prereq for #60639

This enables us to use the managed layout as the native layout for all LayoutKind.Sequential "C# unmanaged" structs, which is required for reconciling the "unmanaged" and "blittable" concepts.

Fixes#44579
Fixes#12977

@jkoritzinsky
jkoritzinskyforce-pushed the managedseqential_unmanaged branch from d5e15d0 to 3c4ccbcCompareNovember 18, 2021 17:57
@jkoritzinsky
jkoritzinskyforce-pushed the managedseqential_unmanaged branch from 0735747 to b85447dCompareNovember 19, 2021 20:20
jkoritzinskyand others added 3 commits November 29, 2021 16:21
…nMetadataFieldLayoutAlgorithm.cs
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
…all other scenarios (align-up to strictest alignment of members)
Comment threadsrc/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs Outdated
…Algorithm.cs
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Comment threadsrc/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs Outdated
@jkoritzinsky

Copy link
Copy Markdown
MemberAuthor

@jkotas I've updated this PR to now fix #12977. This is ready for another round of review.

Comment threadsrc/coreclr/vm/classlayoutinfo.cpp Outdated
@jkoritzinsky

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-coreclr crossgen2 outerloop,runtime-coreclr crossgen2-composite

Comment threadsrc/coreclr/vm/class.h Outdated
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@jkotas

Copy link
Copy Markdown
Member

It looks good to me (once it builds on all platforms).

Are you happy with the test coverage we have for this, or do you plan to add more tests?

It would be useful to also get a review from @trylek or @davidwrighton .

@trylektrylek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I love this change, thanks so much Jeremy for finally putting some order to all this mess!

Comment threadsrc/coreclr/vm/classlayoutinfo.cpp Outdated
Comment threadsrc/coreclr/vm/classlayoutinfo.cpp
@jkoritzinsky

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-coreclr crossgen2 outerloop,runtime-coreclr crossgen2-composite

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@jkoritzinsky

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-coreclr crossgen2 outerloop,runtime-coreclr crossgen2-composite

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@jkoritzinsky

Copy link
Copy Markdown
MemberAuthor

It looks like the macOS ARM64 test failures are #62747 due to the following multidimensional array:

privatestaticreadonlystring[,]s_fgbgAndColorStrings=newstring[2,16];// 2 == fg vs bg, 16 == ConsoleColor values

@jkoritzinsky

Copy link
Copy Markdown
MemberAuthor

I've confirmed these failures are also in main now that #61938 has been merged long enough to have outerloop runs triggered against it.

I think the test coverage already have makes me comfortable enough to merge this PR. I'll add more test coverage when I implement #60639.

@jkoritzinsky
jkoritzinsky merged commit 509d6c3 into dotnet:mainDec 15, 2021
@jkoritzinsky
jkoritzinsky deleted the managedseqential_unmanaged branch December 15, 2021 18:20
@ghostghost locked as resolved and limited conversation to collaborators Jan 14, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

3 participants

@jkoritzinsky@jkotas@trylek