Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Commit

Permalink
Adding Unsafe APIs that are used by System.Memory - CoreRT specific part
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas committed Dec 13, 2017
1 parent a35ffd1 commit fb17c5f
Show file tree
Hide file tree
Showing 41 changed files with 81 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Common/src/TypeSystem/IL/ILProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private MethodIL TryGetIntrinsicMethodIL(MethodDesc method)
{
case "Unsafe":
{
if (owningType.Namespace == "System.Runtime.CompilerServices")
if (owningType.Namespace == "Internal.Runtime.CompilerServices")
return UnsafeIntrinsics.EmitIL(method);
}
break;
Expand Down
4 changes: 4 additions & 0 deletions src/JitInterface/src/CorInfoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;

#if SUPPORT_JIT
using Internal.Runtime.CompilerServices;
#endif

using Internal.TypeSystem;

using Internal.IL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.CompilerServices;

#if BIT64
using nint = System.Int64;
#else
using nint = System.Int32;
#endif

namespace System.Runtime.CompilerServices
namespace Internal.Runtime.CompilerServices
{
//
// Subsetted clone of System.Runtime.CompilerServices.Unsafe for internal runtime use.
// Keep in sync with https://github.com/dotnet/corefx/tree/master/src/System.Runtime.CompilerServices.Unsafe.
//
//

/// <summary>
/// Contains generic, low-level functionality for manipulating pointers.
Expand Down
4 changes: 3 additions & 1 deletion src/Runtime.Base/src/Runtime.Base.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
<Compile Include="System\Runtime\CompilerServices\ManuallyManagedAttribute.cs" />
<Compile Include="System\Runtime\CompilerServices\MethodImplAttribute.cs" />
<Compile Include="System\Runtime\CompilerServices\RuntimeHelpers.cs" />
<Compile Include="System\Runtime\CompilerServices\Unsafe.cs" />
<Compile Include="System\Runtime\CompilerServices\UnsafeValueTypeAttribute.cs" />
<Compile Include="System\Runtime\InteropServices\CallingConvention.cs" />
<Compile Include="System\Runtime\InteropServices\CharSet.cs" />
Expand All @@ -92,6 +91,9 @@
<Compile Include="System\Runtime\InteropServices\UnsafeGCHandle.cs" />
<Compile Include="RhBaseName.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Internal\Runtime\CompilerServices\Unsafe.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Common\src\Internal\Runtime\EEType.Constants.cs" >
<Link>Common\EEType.Constants.cs</Link>
Expand Down
2 changes: 2 additions & 0 deletions src/Runtime.Base/src/System/Array.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

using Internal.Runtime.CompilerServices;

namespace System
{
// CONTRACT with Runtime
Expand Down
2 changes: 2 additions & 0 deletions src/Runtime.Base/src/System/Object.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

using Internal.Runtime.CompilerServices;

// TODO: remove when m_pEEType becomes EETypePtr
using EEType = Internal.Runtime.EEType;
using ObjHeader = Internal.Runtime.ObjHeader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Runtime.CompilerServices;

using Internal.Runtime;
using Internal.Runtime.CompilerServices;

namespace System.Runtime
{
Expand Down
4 changes: 3 additions & 1 deletion src/Runtime.Base/src/System/Runtime/CastableObjectSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
// See the LICENSE file in the project root for more information.

using System;
using Internal.Runtime;
using System.Runtime.CompilerServices;

using Internal.Runtime;
using Internal.Runtime.CompilerServices;

namespace System.Runtime
{
[System.Runtime.CompilerServices.EagerStaticClassConstructionAttribute]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using System.Runtime.CompilerServices;
using System.Diagnostics;

using Internal.Runtime.CompilerServices;

namespace System.Runtime.InteropServices
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/Runtime.Base/src/System/Runtime/RuntimeExports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Runtime.CompilerServices;

using Internal.Runtime;
using Internal.Runtime.CompilerServices;

namespace System.Runtime
{
Expand Down
1 change: 1 addition & 0 deletions src/Runtime.Base/src/System/Runtime/TypeCast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Runtime.InteropServices;

using Internal.Runtime;
using Internal.Runtime.CompilerServices;

namespace System.Runtime
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;

#if BIT64
Expand All @@ -12,12 +14,12 @@
using nuint = System.UInt32;
#endif

namespace System.Runtime.CompilerServices
namespace Internal.Runtime.CompilerServices
{
//
// Subsetted clone of System.Runtime.CompilerServices.Unsafe for internal runtime use.
// Keep in sync with https://github.com/dotnet/corefx/tree/master/src/System.Runtime.CompilerServices.Unsafe.
//
//

/// <summary>
/// Contains generic, low-level functionality for manipulating pointers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
<Compile Include="Internal\Runtime\CompilerServices\RuntimeMethodHandleInfo.cs" />
<Compile Include="Internal\Runtime\CompilerServices\RuntimeSignature.cs" />
<Compile Include="Internal\Runtime\CompilerServices\OpenMethodResolver.cs" />
<Compile Include="Internal\Runtime\CompilerServices\Unsafe.cs" />
<Compile Include="Internal\Runtime\TypeLoaderExceptionHelper.cs" />
<Compile Include="Internal\Threading\Tracing\SpinLockTrace.cs" />
<Compile Include="Internal\Toolchain\NonExecutableAttribute.cs" />
Expand Down Expand Up @@ -255,7 +256,6 @@
<Compile Include="System\Runtime\CompilerServices\InternalCompilerAttributes.cs" />
<Compile Include="System\Runtime\CompilerServices\ReflectionBlockedAttribute.cs" />
<Compile Include="System\Runtime\CompilerServices\StaticClassConstructionContext.cs" />
<Compile Include="System\Runtime\CompilerServices\Unsafe.cs" />
<Compile Include="System\Runtime\CompilerServices\NetNativeToolsVersionAttribute.cs" />
<Compile Include="System\Runtime\CompilerServices\FakeElementAttribute.cs" />
<Compile Include="System\Runtime\CompilerServices\YieldAwaitable.cs" />
Expand Down
1 change: 1 addition & 0 deletions src/System.Private.CoreLib/src/System/Array.CoreRT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Runtime.CompilerServices;

using Internal.Runtime.Augments;
using Internal.Runtime.CompilerServices;
using Internal.Reflection.Core.NonPortable;
using Internal.IntrinsicSupport;
using EEType = Internal.Runtime.EEType;
Expand Down
2 changes: 2 additions & 0 deletions src/System.Private.CoreLib/src/System/Array.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

using Internal.Runtime.CompilerServices;

namespace System
{
[Serializable]
Expand Down
2 changes: 2 additions & 0 deletions src/System.Private.CoreLib/src/System/Buffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

using Internal.Runtime.CompilerServices;

#if BIT64
using nuint = System.UInt64;
#else
Expand Down
1 change: 1 addition & 0 deletions src/System.Private.CoreLib/src/System/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Runtime.CompilerServices;
using System.Text;

using Internal.Runtime.CompilerServices;
using Internal.Runtime.Augments;
using Internal.Reflection.Augments;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using System.Runtime.InteropServices;
using System.Text;

using Internal.Runtime.CompilerServices;

#if ENABLE_WINRT
using Internal.Runtime.Augments;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/System.Private.CoreLib/src/System/Guid.CoreRT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Runtime.CompilerServices;
using Internal.Runtime.CompilerServices;

namespace System
{
Expand Down
1 change: 1 addition & 0 deletions src/System.Private.CoreLib/src/System/InvokeUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

using Internal.Reflection.Core.NonPortable;
using Internal.Runtime.Augments;
using Internal.Runtime.CompilerServices;

namespace System
{
Expand Down
2 changes: 2 additions & 0 deletions src/System.Private.CoreLib/src/System/Marvin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using System.Diagnostics;
using System.Runtime.CompilerServices;

using Internal.Runtime.CompilerServices;

namespace System
{
internal static class Marvin
Expand Down
1 change: 1 addition & 0 deletions src/System.Private.CoreLib/src/System/Object.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Internal.Reflection.Core.NonPortable;

using Internal.Runtime;
using Internal.Runtime.CompilerServices;

namespace System
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System.Threading.Tasks;

using Internal.Runtime.Augments;
using Internal.Runtime.CompilerServices;

using AsyncStatus = Internal.Runtime.Augments.AsyncStatus;
using CausalityRelation = Internal.Runtime.Augments.CausalityRelation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using System.Runtime.InteropServices;
using System.Threading;

using Internal.Runtime.CompilerServices;

namespace System.Runtime.CompilerServices
{
#region ConditionalWeakTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using System.Runtime.CompilerServices;
using System.Threading;

using Internal.Runtime.CompilerServices;

namespace System.Runtime.InteropServices
{
// This class allows you to create an opaque, GC handle to any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
using System;
using System.Runtime.CompilerServices;
using System.Collections.Generic;
using Internal.Runtime.Augments;
using System.Diagnostics;

using Internal.Runtime.Augments;
using Internal.Runtime.CompilerServices;

namespace System.Runtime.InteropServices
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
// See the LICENSE file in the project root for more information.

using System.Security;
using Internal.Runtime.CompilerHelpers;
using Internal.Runtime.Augments;
using Debug = System.Diagnostics.Debug;
using System.Collections.Generic;
using System.Threading;
using System.Runtime.CompilerServices;

using Internal.Runtime.Augments;
using Internal.Runtime.CompilerHelpers;
using Internal.Runtime.CompilerServices;

#if BIT64
using nuint = System.UInt64;
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using System.Runtime.CompilerServices;
using System.Threading;

using Internal.Runtime.CompilerServices;

namespace System.Runtime.InteropServices
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

using Internal.Runtime;
using Internal.Runtime.CompilerServices;

#if BIT64
using nuint = System.UInt64;
Expand Down
2 changes: 2 additions & 0 deletions src/System.Private.CoreLib/src/System/String.Comparison.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using System.Globalization;
using System.Runtime.CompilerServices;

using Internal.Runtime.CompilerServices;

namespace System
{
public partial class String
Expand Down
2 changes: 2 additions & 0 deletions src/System.Private.CoreLib/src/System/String.Manipulation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using System.Runtime.CompilerServices;
using System.Text;

using Internal.Runtime.CompilerServices;

namespace System
{
public partial class String
Expand Down
2 changes: 2 additions & 0 deletions src/System.Private.CoreLib/src/System/String.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
using System.Runtime.Versioning;
using System.Text;

using Internal.Runtime.CompilerServices;

namespace System
{
// The String class represents a static string of characters. Many of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;

using Internal.Runtime.CompilerServices;

namespace System.Threading
{
public static class Interlocked
Expand Down
2 changes: 2 additions & 0 deletions src/System.Private.CoreLib/src/System/Threading/Monitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
using System.Diagnostics;
using System.Runtime.CompilerServices;

using Internal.Runtime.CompilerServices;

namespace System.Threading
{
public static class Monitor
Expand Down
2 changes: 2 additions & 0 deletions src/System.Private.CoreLib/src/System/Threading/Overlapped.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
using System.Diagnostics;
using System.Collections.Concurrent;

using Internal.Runtime.CompilerServices;

namespace System.Threading
{
#region class _IOCompletionCallback
Expand Down
2 changes: 2 additions & 0 deletions src/System.Private.CoreLib/src/System/Threading/Volatile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
using System.Runtime.CompilerServices;
using System.Runtime;

using Internal.Runtime.CompilerServices;

namespace System.Threading
{
//
Expand Down
1 change: 1 addition & 0 deletions src/System.Private.CoreLib/src/System/TypedReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

using Internal.Runtime.CompilerServices;
using Internal.Reflection.Augments;

namespace System
Expand Down
1 change: 1 addition & 0 deletions src/System.Private.CoreLib/src/System/WeakReferenceOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Diagnostics;

using Internal.Runtime.Augments;
using Internal.Runtime.CompilerServices;

namespace System
{
Expand Down
Loading

0 comments on commit fb17c5f

Please sign in to comment.