-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement System.Runtime.CompilerServices.DisabledRuntimeMarshallingA…
…ttribute on CoreCLR-family of runtimes/type systems (#63320) * Add the DisableRuntimeMarshallingAttribute to the build. * Add initial test suite * Implement support in IL stubs for the "disabled runtime marshalling" feature. * Add testing for inlining IL stubs. * Block SetLastError and LCID support when DisableRuntimeMarshallingAttribute is applied. * Bump NativeAOT-only R2R version header (missed previously) * Implement support in crossgen2 and NativeAOT * Clean up the test tree and update the tests to fail more reliably when bugs are present. Fix a bug that was uncovered when the tests were refactored. * Fix NativeAOT and clean up crossgen2 * Add a test for NoPreserveSig with DisableRuntimeMarshalling * Assign hr in SUCCEEDED macro. * PR feedback. * Block varargs in disabled marshalling mode. * Fix typo * Block types that have a field that is auto-layout somewhere in their layout. * Fix typo * Revert the AutoLayoutOrHasAutoLayoutFIeld check in the "marshalling enabled" case * Only set scope when it isn't null (it's null for some cases). * Fix narrowing conversion failure. * First pass simple implementation in Mono * Fix assert to still work for the built-in marshalling system * S_FALSE is a thing * Fix type load failures caused by eager type handle loading. * Get MethodILScope from the calling method when available (this covers all cases where we need it) * Add const modifier. * Try 2 to fix const modifiers * Fix compilation of NativeAOT jitinterface * Fix type lookup in Mono * Use try_get model for getting the attribute type in the case of failure. Fix mono implementation for looking up the attribute. * Handle void and generic instantiations * Update auto-layout check to check recursively in layout. * Enhance test suite with more tests for UnmanagedCallersOnly, generics, and the like. Fix AutoLayout test. * Fix IL and a few typos * Set a value in the padding for easier debugging. * Create sig->marshalling_disabled to track when marshalling is disabled, which is separate from the concept of "is this signature a P/Invoke" * Fix running test suite on Mono + Mini JIT * Fix recursive type load failure by only checking the "has auto-layout or field with auto-layout" for value types. * Fix mono windows build. * Feedback from Michal. * Fix bug in EcmaAssembly.HasAssemblyCustomAttribute * Make the runtime flavor check in the wrapper generator case-invariant * Use helper method since various different platforms/configurations throw different exceptions for these scenarios. * Fix AutoLayout test refactor and use a dummy value for the padding field in both enabled and disabled scenarios. * Add an explicit test for using enums as they're a little weird and needed some special-casing. * Fix build-time test filtering in xunit wrapper generator. * Fix some x86-specific issues * Add a nice big comment block. * Fix x86 * Refactor tests so we can skip one on Mono since Char->char lossy conversion is not supported. * Disable test in issues.targets until an alternative solution is reached. * Add another SkipOnMono attribute in the "Enabled" test suite. * Apply UnmangedFunctionPointerAttribute to help hint to the Mono LLVM AOT compiler to compile the managed->native thunks at aot-time * Unify on "runtime marshalling" terminology * Clean up unused usings. * Address Jan's feedback except for applying the attribute to CoreLib. * PR feedback. * Mono throws an InvalidProgramException for varargs * Fix copy-paste issue. * Make sure we use the P/Invoke's Module and not the caller's module when deciding if runtime marshalling is enabled for a varargs P/Invoke call. * Handle how LLVM AOT reports the failure to handle varargs (EEE)
- Loading branch information
1 parent
d7b6689
commit 358ee3c
Showing
83 changed files
with
1,997 additions
and
262 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
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
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
Oops, something went wrong.