This repository was archived by the owner on Nov 13, 2026. It is now read-only.
Repository navigation
Merge changes from TFS - #1612
Merged
Merged
Conversation
Almost all of these changes are from Ryan. I just split original change into two parts--product change and testcase change. :)
This change is to enable Interop CallInterceptor for WinRT Marshalling(Array, IEnumerable, Struct, string, blittable), WinRT call (manually created RCW/CCW) and PInvoke marshalling(array, string....). This change is the foundation of Interop CallInterceptor.
System.Private.TypeLoader:
1. Decouple the dependency between System.Private.TypeLoader and System.Private.Interop during compile time. now System.Private.TypeLoader will use MemAlloc/MemFree in System.Private.Corlib instead of Marshal.Alloc* in System.Private.Interop
2. Use Read<T>(IntPtr)/Write<T>(IntPtr, T) in System.Private.Corlib to read/write data from IntPtr to simulate il instruction:ldobj/stobj.
System.Private.CorLib:
1. InternalReflectionWhiteList.txt: Add couples Marshaller types in System.Private.Interop, since Dynamic Interop will use these marshaller throught reflection during runtime.
2. Expose MemAlloc/MemFree to other library(such as System.Private.TypeLoader) to use.
3. Implement T Read<T>(IntPtr)/Write<T>(IntPtr, T). In future nutc should be able to generic these methods directly(this part need some design).
Interop:
1. All these marshaller/testcase are from ryan. :)
2. LoadLibrary/GetProcAddress API not supported in UWP, so put all these Pinvoke into helpers.cs.
3. Update System.Private.MCG.dll due to TOF Testcase use contract assembly.
4. Add DependencyReductionRootAttribute for IIterable<T> and IIterator<T>
5. Restrict The testcase to run only on amd64
TODO:
1. Update MCG to use the VirtualAddrOf method in System.Private.Interop. Currently MCG will dynamically generate this method
2. Is it possible to Use Internal.Runtime.CompilerHelper.ResolvePInvoke to trigger pinvoke call?
3. Refactor Write<T>/Read<T> so that ntuc can recognize it is stobj/ldobj instruction and generate better code.
[tfs-changeset: 1620469]
This file contains hidden or 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
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.
No description provided.