This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix IsBlittableType #27436
Merged
MichalStrehovsky
merged 2 commits into
dotnet:single-exe
from
MichalStrehovsky:blittable
Oct 28, 2019
Merged
Fix IsBlittableType #27436
MichalStrehovsky
merged 2 commits into
dotnet:single-exe
from
MichalStrehovsky:blittable
Oct 28, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The implementation of `IsBlittableType` was an incomplete temporary crutch. It only did the right thing for the straightforward cases. * Implement similar logic to what CoreCLR does (iterate over fields and check how they're marshalled) * `MetadataType::GetFieldMarshalAsDescriptors()` was a weird API (the returned array was including static fields, making this awkward to use). Every single use of this API on the CoreRT side is wrong because of that. Deleting that and replacing with an API on the field. * Do not throw from `GetMarshallerKind` since we're using it from places that don't want to deal with that. * Move `MarshalUtils` to the project that can access `GetMarshallerKind`.
Cc @sergiy-k |
jkotas
reviewed
Oct 25, 2019
jkotas
approved these changes
Oct 25, 2019
Infrastructure problems:
|
/azp run coreclr-ci |
Azure Pipelines successfully started running 1 pipeline(s). |
CoreFX test failures look like some infrastructure problem with the single-exe branch. |
Yeah, I've been ignoring them in my pull requests. Crossgen2 is not involved in what CoreFX tests are testing and I'm pretty close to moving my stuff into master ("no IL stubs" is the last thing that I'm working on now). |
janvorli
added a commit
to janvorli/coreclr
that referenced
this pull request
Nov 7, 2019
* Enable precompilation of marshalling IL stubs in crossgen2 dotnet#26767 * P/invoke pregeneration fixes dotnet#27389 * Fixes to array marshalling pregeneration dotnet#27425 * Fix IsBlittableType dotnet#27436
janvorli
added a commit
that referenced
this pull request
Nov 7, 2019
* Port set of changes from single-exe branch * Enable precompilation of marshalling IL stubs in crossgen2 #26767 * P/invoke pregeneration fixes #27389 * Fixes to array marshalling pregeneration #27425 * Fix IsBlittableType #27436 * Fix stack overflow issue and m_alignpad==0 assert I've found that the changes from single-exe had issues - it was causing stack overflow during compilation of a couple of runtime assemblies. After I've fixed that, there was about 15 tests failing at runtime failing with assert failure: m_alignpad == 0. This is a well known indication of a problem where JIT and crossgen get different field offsets, resulting in writing beyond the end of an object. The problem was caused by incorrect usage of sequential layout for class without LayoutSequential attribute. I've added a commit with fix for those to this PR.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The implementation of
IsBlittableType
was an incomplete temporary crutch. It only did the right thing for the straightforward cases.MetadataType::GetFieldMarshalAsDescriptors()
was a weird API (the returned array was including static fields, making this awkward to use). Every single use of this API on the CoreRT side is wrong because of that. Deleting that and replacing with an API on the field.GetMarshallerKind
since we're using it from places that don't want to deal with that.MarshalUtils
to the project that can accessGetMarshallerKind
.