summaryrefslogtreecommitdiff
path: root/src/vm/mtypes.h
AgeCommit message (Collapse)AuthorFilesLines
2019-05-23Fewer ilstubs in corelib from reflection apis (#24708)David Wrighton1-3/+0
Rework use of marshalling for RuntimeTypeHandle, RuntimeModule, RuntimeAssembly, and IRuntimeMethodInfo as used by QCalls - Remove special QCall only used marshallers for RuntimeAssembly, RuntimeModule and IRuntimeMethodInfo - Following the pattern of ObjectHandleOnStack, implement QCall handle types for RuntimeAssembly/Module/TypeHandle. Use these in all QCalls that once passed the types directly. - For uses of IRuntimeMethodInfo, follow the existing RuntimeMethodHandleInternal pattern Also perform some replacement of bool marshalling with use of Interop.BOOL, and a few cases of using pointers instead of byref arguments. Fix delivers a relatively small win on startup, and small throughput gains around reflection as IL stubs are no longer necessary for many functions in reflection that once needed them. Reduces methods jitted on powershell startup from 422 to 399, (About 5%) but performance win is only about 5ms on ~400ms as the methods removed are simple.
2019-03-19Implement support for copy constructors when marshalling in IJW (#22805)Jeremy Koritzinsky1-1/+1
Fixes #22219. I decided to try simplifying the code when bringing this feature over from .NET Framework. The .NETFX x86 implementation of this marshaler adds a lot of extra code-paths, and intercepts the calling stub to enable it to exactly replicate the behavior of what would be the native code by copy-constructing an object in-place where it goes on the stack for the native call. Instead of adding all of that extra goo, I decided to keep the implementation much more similar to the non-x86 implementation from .NETFX. Instead of intercepting the call and adding bookkeeping helper stubs, the marshaler just copies to a local in the IL stub, just like non-x86. When calling the native function, it just loads the local onto the IL stack and calls the native function as a normal function. There is a difference there, but I cannot think of a way that the difference is observable to the user. The non-x86 implementation is identical to the .NETFX implementation.
2018-11-15Add tests for ANSI BSTRs (#20985)Jeremy Koritzinsky1-1/+1
* Add tests for ANSI BSTRs * Fix signed/unsigned mismatch in comparisons. Add xplatform include * Use regular memcpy * Enable ANSI BSTR off-windows. * Also enable UnmanagedType.TBStr off-Windows since both BStr variants are available off-Windows. * Make sure the AnsiBSTR marshaller is hooked up off-Windows. * Remove a few more ifdefs I missed. * remove ifdefs around binder definitions and the C# stub helpers. * PR Feedback. * Add xplat ARRAYSIZE macro * Move xplat ARRAYSIZE to platformdefines.h
2018-09-28Enable BSTR Marshaling Support for x-plat PInvoke (#19766)Luqun Lou1-1/+1
2017-02-12Remove remainder of FEATURE_CORECLR (tool missed some files, also comments)danmosemsft1-1/+1
2017-02-10Remove always defined FEATURE_CORECLRdanmosemsft1-4/+1
2016-05-06UTF8 Marshaling support(UnmanagedType.LPUTF8Str)Tijoy Tom Kalathiparambil1-0/+2
Usage: [MarshalAs(UnmanagedType.LPUTF8Str)] applied to string and stringbuilder. Implementation mostly use Encoding.UTF8 API to do the byte buffer to string roundtripping. Introducing two new marshalers, UTF8StringMarshaler and UTF8BufferMarshaler which handle string and StringBuilder respectively. [Out] StringBuilder marshaling use builder capacity as the buffer size ie (builder. Capacity + 1) *3 which is enough for any UTF8 char in BMP plane, infact Encoding.UTF8 mscorlib APIs use the same length.All marshaling flags(ThrowOnUnmapable, defaultchar) are ignored since they do not make sense in UTF16 to UTD8 context. The public contracts are not yet updated, the public contracts and public marshaling API (Marshal.PtrToStringUtf8 and StringToHGlobalUtf8) will be added once the implementation is in. The marshal api are anyway going to be a wrapper around Encoding.GetBytes and GetChars.
2016-01-27Update license headersdotnet-bot1-4/+3
2015-01-30Initial commit to populate CoreCLR repo dotnet-bot1-0/+121
[tfs-changeset: 1407945]