diff options
author | Jan Kotas <jkotas@microsoft.com> | 2018-06-24 03:19:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-24 03:19:20 +0300 |
commit | c9326538e74bcb8f73760cceb84b8abcddc9812f (patch) | |
tree | 97b300513b2eee7fc36691f657c482653acf4351 /src/System.Private.Jit | |
parent | 6c2368b53687609f2fd8ce4389596f2a0d283e3f (diff) |
Plumbing to generate calli PInvoke stubs (#6002)
Contributes to #5587
Diffstat (limited to 'src/System.Private.Jit')
-rw-r--r-- | src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitCompilation.cs | 9 | ||||
-rw-r--r-- | src/System.Private.Jit/src/System.Private.Jit.csproj | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitCompilation.cs b/src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitCompilation.cs index e628978b9..2c5f06f72 100644 --- a/src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitCompilation.cs +++ b/src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitCompilation.cs @@ -21,7 +21,8 @@ namespace ILCompiler { _typeSystemContext = context; _typeGetTypeMethodThunks = new TypeGetTypeMethodThunkCache(context.GetWellKnownType(WellKnownType.Object)); - _methodILCache = new ILProvider(new PInvokeILProvider(new PInvokeILEmitterConfiguration(forceLazyResolution: true), null)); + _pInvokeILProvider = new PInvokeILProvider(new PInvokeILEmitterConfiguration(forceLazyResolution: true), null); + _methodILCache = new ILProvider(_pInvokeILProvider); _nodeFactory = new NodeFactory(context); _devirtualizationManager = new DevirtualizationManager(); } @@ -31,9 +32,11 @@ namespace ILCompiler protected readonly Logger _logger = Logger.Null; private readonly TypeGetTypeMethodThunkCache _typeGetTypeMethodThunks; private ILProvider _methodILCache; + private PInvokeILProvider _pInvokeILProvider; private readonly DevirtualizationManager _devirtualizationManager; internal Logger Logger => _logger; + internal PInvokeILProvider PInvokeILProvider => _pInvokeILProvider; public TypeSystemContext TypeSystemContext { get { return _typeSystemContext; } } public NodeFactory NodeFactory { get { return _nodeFactory; } } @@ -51,7 +54,7 @@ namespace ILCompiler { // Flush the cache when it grows too big if (_methodILCache.Count > 1000) - _methodILCache = new ILProvider(new PInvokeILProvider(new PInvokeILEmitterConfiguration(forceLazyResolution: true), null)); + _methodILCache = new ILProvider(_pInvokeILProvider); return _methodILCache.GetMethodIL(method); } @@ -142,4 +145,4 @@ namespace ILCompiler return DelegateCreationInfo.Create(delegateType, target, NodeFactory, followVirtualDispatch); } } -}
\ No newline at end of file +} diff --git a/src/System.Private.Jit/src/System.Private.Jit.csproj b/src/System.Private.Jit/src/System.Private.Jit.csproj index 662339fa5..39cb058cc 100644 --- a/src/System.Private.Jit/src/System.Private.Jit.csproj +++ b/src/System.Private.Jit/src/System.Private.Jit.csproj @@ -69,6 +69,7 @@ <Compile Include="$(TypeSystemBasePath)\IL\Stubs\ArrayMethodILEmitter.cs" /> <Compile Include="$(TypeSystemBasePath)\IL\Stubs\CalliIntrinsic.cs" /> <Compile Include="$(TypeSystemBasePath)\IL\Stubs\ComparerIntrinsics.cs" /> + <Compile Include="$(TypeSystemBasePath)\IL\Stubs\CalliMarshallingMethodThunk.cs" /> <Compile Include="$(TypeSystemBasePath)\IL\Stubs\DelegateMarshallingMethodThunk.cs" /> <Compile Include="$(TypeSystemBasePath)\IL\Stubs\ForwardDelegateCreationThunk.cs" /> <Compile Include="$(TypeSystemBasePath)\IL\Stubs\EETypePtrOfIntrinsic.cs" /> |