Age | Commit message (Collapse) | Author | Files | Lines |
|
* 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
|
|
* 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
|
|
* 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
|
|
* Remove more MDA support code
* PR Feedback
|
|
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
|
|
* 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
|
|
Delete some dead code related to Windows Phone and code access security
|
|
|
|
|
|
Fixes #9321 and deletes CleanupToDoList.cs
Delete unmanaged security implementation
|
|
Fixes dotnet/corefx#14747:
- Events include: AssemblyLoadContext.Unloading, AppDomain.ProcessExit
- Made the same change for AppDomain.DomainUnload for consistency, but it's not raised
|
|
|
|
|
|
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.
|
|
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.
|
|
[tfs-changeset: 1407945]
|