summaryrefslogtreecommitdiff
path: root/src/vm/comdelegate.h
AgeCommit message (Collapse)AuthorFilesLines
2020-06-18Implement instantiating and unboxing through portable stublinker code… (#106)JUNG DONG-HEON1-14/+14
* Implement instantiating and unboxing through portable stublinker code - Handle only the cases with register to register moves - Shares abi processing logic with delegate shuffle thunk creation - Architecture specific logic is relatively simple - Do not permit use of HELPERREG in computed instantiating stubs - Fix GetArgLoc such that it works on all architectures and OS combinations Add a JIT stress test case for testing all of the various combinations - Use the same calling convention test architecture that was used as part of tail call work Rename secure delegates to wrapper delegates - Secure delegates are no longer a feature of the runtime - But the wrapper delegate lives on as a workaround for a weird detail of the ARM32 abi
2020-06-18Fix GenerateShuffleArray to support cyclic shuffles (dotnet/coreclr#26169)JUNG DONG-HEON1-0/+1
* Fix GenerateShuffleArray to support cyclic shuffles The GenerateShuffleArray was not handling case when there was a cycle in the register / stack slots shuffle and it resulted in an infinite loop in this function. This issue is Unix Amd64 ABI specific. To fix that, this change reworks the algorithm completely. Besides fixing the issue, it has also better performance in some cases. To fix the cyclic shuffling, I needed an extra helper register. However, there was no available general purpose register available, so I had to use xmm8 for this purpose. * Remove special handling of the hang from ABI stress
2019-06-14Optimize Activator.CreateInstance (#25145)Jan Kotas1-3/+0
* Optimize Activator.CreateInstance - Short-circuit Activator.CreateInstance<T>() for value types without default constructor - Cache default constructor delegate on RuntimeType instead of fixed-size singleton cache
2019-05-08Remove more MDA support code (#24457)Steve MacLean1-6/+0
* Remove more MDA support code * PR Feedback
2018-08-23Enable unloading of AssemblyLoadContext (#18476)Jan Vorlicek1-0/+49
Enable assembly unloading * Allow PInvoke methods on collectible assemblies * Fix test unloadability Several hundreds of tests were using Helper class that created GCHandle, but never freed it. That prevented unloading of those tests. The change modifies the Helper class to keep the handle in a finalizable object. Several GCHandle related tests were not freeing the GCHandle they allocated, so this change adds freeing them to enable the unloading. * Add missing error messages to the resources * Fix shuffle thunk cache for unloadability * Add GetLoaderAllocator to ICLRPrivBinder
2018-07-23Remove hosthook api (#19079)Aaron Robinson1-1/+0
* Remove CallNeedsHostHook() API * Remove IsHostHookEnabled() API and with it related dead code * Remove code enabling host hooks (i.e. COMPlus_GenerateStubForHost) Remove function declarations for creating host hooks Update comments
2017-10-06Delete dead code (#14365)Jan Kotas1-3/+0
Delete some dead code related to Windows Phone and code access security
2017-08-07Cleanup code access security from the unmanaged runtime (#13241)Jan Kotas1-6/+0
2017-06-27Remove unused declaration (#12501)Jonghyun Park1-2/+0
2017-05-17Finish deleting dead CAS code from CoreLib (#11436)Jan Kotas1-1/+0
Fixes #9321 and deletes CleanupToDoList.cs Delete unmanaged security implementation
2017-03-27Don't ignore exceptions thrown from handlers of some events (#10502)Koundinya Veluri1-2/+2
Fixes dotnet/corefx#14747: - Events include: AssemblyLoadContext.Unloading, AppDomain.ProcessExit - Made the same change for AppDomain.DomainUnload for consistency, but it's not raised
2017-02-10Remove always defined FEATURE_CORECLRdanmosemsft1-4/+0
2016-01-27Update license headersdotnet-bot1-4/+3
2015-10-20Implementation of System V ABI struct passing.Lubomir Litchev1-10/+8
This PR adds support for System V x86_64 ABI classification and calling convention to the VM and the Jit, including, but not limited to Ubuntu Linux and Mac OS X. The general rules outlined in the System V x86_64 ABI (described at http://www.x86-64.org/documentation/abi.pdf) are followed with a few little exceptions, described below: 1. The hidden argument for by-value passed structs is always after the ÎéÎíthisÎéÎí parameter (if there is one.). This is a difference with the Sysetem V ABI and affects only the internal jit calling conventions. For PInvoke calls the hidden argument is always the first parameter since there is no ÎéÎíthisÎéÎí parameter in this case. 2. Managed structs that have no fields are always passed by-value on the stack. 3. The jit proactively generates frame register frames (with RBP as a frame register) in order to aid the native OS tooling for stack unwinding and the like.
2015-09-18Add support for NativeCallableAttributetijoytom1-0/+4
Apply [NativeCallable] attribute to a managed method and then it can be called from native code.Typical use would be passing a managed method as callback to native, now it can be done by wrapping the method in a delegate or directly using Marshal.GetFunctionPointerForDelegate.This's fine as long as we make sure that delegate is not garbage collected.[NativeCallable] introduce another way, where you can directly load the function pointer of a native callable method and use it as callback.This feature cannot be directly used from C#,but can be very useful in dynamic code generation scenarios where you want a callback to be passed to native. Here's an example of how it can be used. public static class NativeMethods { [DllImport("user32.dll")] public static extern int EnumWindows(IntPtr enumProc, IntPtr lParam); } //Method attributed with NativeCallable [NativeCallable] public static int CallbackMethod(IntPtr hWnd, IntPtr lParam){ return 1; } Now you can generate the below IL to load native callable function pointer ( LDFTN) and then pass it a native method. .locals init ([0] native int ptr) nop ldftn int32 CallbackMethod(native int,native int) stloc.0 ldloc.0 ldsfld native int System.IntPtr::Zero call bool NativeMethods::EnumWindows(native int,native int) pop ret Encoding native callable methods as ENCODE_METHOD_NATIVECALLABLE_HANDLE so that we don't have to check for the custom attribute at runtime to decode the method.Also fixing the remaining code review comments. Adding runtime check to prevent Native Callable methods from being used as calli target with an ldftn. Also adding some negative test cases , they are disabled for now since the tests failfast and msbuild report it as failure.
2015-01-30Initial commit to populate CoreCLR repo dotnet-bot1-0/+243
[tfs-changeset: 1407945]