From dd6adeae44bc7b63c859d4fd017af97b1283ac5a Mon Sep 17 00:00:00 2001 From: Ahson Khan Date: Thu, 14 Dec 2017 18:24:05 -0800 Subject: [PATCH] Change ReadOnlySpan indexer to return ref readonly (dotnet/coreclr#14727) * Change ReadOnlySpan indexer to return ref readonly. Update JIT to handle changes to ReadOnlySpan indexer Resolving merge conflict and fixing jit importer Update ReadOnlySpan Enumerator Current to use indexer. Removing readonly keyword. * Temporarily disabling Span perf and other tests that use ReadOnlySpan * Isolating the ref readonly indexer change only to CoreCLR for now. Reverting the change to Enumerator Current for now Fix file formatting Enable Alpine CI (#15502) * Enable Alpine CI This enables Alpine CI leg on every PR using the pipelines. compare type size instead of var_types get rid of TYP_CHAR Adding support for Acosh, Asinh, Atanh, and Cbrt to Math and MathF Updating the PAL layer to support acosh, asinh, atanh, and cbrt Adding some PAL tests for acosh, asinh, atanh, and cbrt Adding valuenum support for acosh, asinh, atanh, and cbrt Lsra Documentation Update LinearScan section of ryujit-overview.md, and add lsra-detail.md Refactor Unsafe.cs to get it more in sync with CoreRT. (#15510) * Refactor Unsafe.cs to get it more in sync with CoreRT. * Format the document. * Unifying the copies of Unsafe using ifdefs * Change exception thrown to PlatformNotSupportedException * Addressing PR feedback and moving Unsafe to shared. * Addressing PR feedback * Addressing PR review - adding intrinsic attribute Update CoreClr, CoreFx to preview1-26014-01, preview1-26013-12, respectively (#15513) Revert "Add optional integer offset to OwnedMemory Pin (#15410)" This reverts commit 8931cfa4ebe94f57698b4c1b3ab5689cd467cb8e. Get rid of old -altjitcrossgen argument now that CI has been updated Merge pull request dotnet/corert#5109 from dotnet/nmirror (#15518) Merge nmirror to master Signed-off-by: dotnet-bot Revert " Revert "[Local GC] Move knowledge of overlapped I/O objects to the EE through four callbacks (#14982)"" Fix typo `_TARGET_ARM` to `_TARGET_ARM_`. This happens mostly in comments except lsra.cpp. Update CoreClr, CoreFx, PgoData to preview1-26014-04, preview1-26014-03, master-20171214-0043, respectively (#15520) * Disabling a test that uses ReadOnlySpan indexer * Temporarily disabling the superpmi test and fixing nit * Remove debug statements. Signed-off-by: dotnet-bot-corefx-mirror --- src/Common/src/CoreLib/System/ReadOnlySpan.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Common/src/CoreLib/System/ReadOnlySpan.cs b/src/Common/src/CoreLib/System/ReadOnlySpan.cs index fdee6012a128..f8fb7b6baf2e 100644 --- a/src/Common/src/CoreLib/System/ReadOnlySpan.cs +++ b/src/Common/src/CoreLib/System/ReadOnlySpan.cs @@ -165,18 +165,16 @@ public bool IsEmpty /// /// Thrown when index less than 0 or index greater than or equal to Length /// -#if PROJECTN + public ref readonly T this[int index] { +#if PROJECTN [BoundsChecking] get { return ref Unsafe.Add(ref _pointer.Value, index); } - } #else - public T this[int index] - { [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] @@ -184,10 +182,10 @@ public T this[int index] { if ((uint)index >= (uint)_length) ThrowHelper.ThrowIndexOutOfRangeException(); - return Unsafe.Add(ref _pointer.Value, index); + return ref Unsafe.Add(ref _pointer.Value, index); } - } #endif + } /// /// Copies the contents of this read-only span into destination span. If the source