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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port IsBlittable fix and related changes from single-exe (#27746)
* 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.
- Loading branch information
Showing
12 changed files
with
266 additions
and
172 deletions.
There are no files selected for viewing
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
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
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
25 changes: 25 additions & 0 deletions
25
src/tools/crossgen2/Common/TypeSystem/Interop/FieldDesc.Interop.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace Internal.TypeSystem | ||
{ | ||
partial class FieldDesc | ||
{ | ||
/// <summary> | ||
/// Returns description of how the field should be marshalled to native code. | ||
/// </summary> | ||
public virtual MarshalAsDescriptor GetMarshalAsDescriptor() | ||
{ | ||
return null; | ||
} | ||
} | ||
|
||
partial class FieldForInstantiatedType | ||
{ | ||
public override MarshalAsDescriptor GetMarshalAsDescriptor() | ||
{ | ||
return _fieldDef.GetMarshalAsDescriptor(); | ||
} | ||
} | ||
} |
Oops, something went wrong.