platform/upstream/dotnet/runtime.git
14 months agoClean up dead code in illink targets (#85741)
Sven Boemer [Tue, 16 May 2023 20:36:48 +0000 (13:36 -0700)]
Clean up dead code in illink targets (#85741)

Removes TFM version checks, and adds a warning when using
explicit ILLink package reference.

We reference ILLink as a packagereference that versions with the
runtime, so the 8.0 linker is only supported when targeting
`net8.0`, and we can remove the TFM checks. We don't want to
support someone adding a PackageReference to an 8.0 linker, while
targeting an older TFM, in an attempt to get newer linker bits
but with settings that were closer to what we shipped with that
TFM.

---------

Co-authored-by: Marek Safar <marek.safar@gmail.com>
Co-authored-by: Vitek Karas <10670590+vitek-karas@users.noreply.github.com>
14 months agoWrite the generated file header to the ComInterfaceGenerator-generated files (#86283)
Jeremy Koritzinsky [Tue, 16 May 2023 20:15:15 +0000 (13:15 -0700)]
Write the generated file header to the ComInterfaceGenerator-generated files (#86283)

14 months ago[wasm] Webcil-in-WebAssembly (#85932)
Aleksey Kliger (λgeek) [Tue, 16 May 2023 20:10:38 +0000 (16:10 -0400)]
[wasm] Webcil-in-WebAssembly (#85932)

Define a WebAssembly module wrapper for Webcil assemblies.
Contributes to #80807

### Why

In some settings serving `application/octet-stream` data, or files with weird extensions will trigger firewalls or AV tools.  But let's assume that if you're interested in deploying a .NET WebAssembly app, you're in an environment that can at least serve WebAssembly modules.

### How

Essentially we serve this WebAssembly module:

```wat
(module
  (data "\0f\00\00\00") ;; data segment 0: payload size
  (data "webcil Payload\cc")  ;; data segment 1: webcil payload
  (memory (import "webcil" "memory") 1)
  (global (export "webcilVersion") i32 (i32.const 0))
  (func (export "getWebcilSize") (param $destPtr i32) (result)
    local.get $destPtr
    i32.const 0
    i32.const 4
    memory.init 0)
  (func (export "getWebcilPayload") (param $d i32) (param $n i32) (result)
    local.get $d
    i32.const 0
    local.get $n
    memory.init 1))
```

The module exports two WebAssembly functions `getWebcilSize` and `getWebcilPayload` that write some bytes (being the size or payload of the webcil assembly) to the linear memory at a given offset.  The module also exports the constant `webcilVersion` to version the wrapper format.

So a runtime or tool that wants to consume the webcil module can do something like:

```js
const wasmModule = new WebAssembly.Module (...);
const wasmMemory = new WebAssembly.Memory ({initial: 1});
const wasmInstance =
      new WebAssembly.Instance(wasmModule, {webcil: {memory: wasmMemory}});
const { getWebcilPayload, webcilVersion, getWebcilSize } = wasmInstance.exports;
console.log (`Version ${webcilVersion.value}`);
getWebcilSize(0);
const size = new Int32Array (wasmMemory.buffer)[0]
console.log (`Size ${size}`);
console.log (new Uint8Array(wasmMemory.buffer).subarray(0, 20));
getWebcilPayload(4, size);
console.log (new Uint8Array(wasmMemory.buffer).subarray(0, 20));
```

### How (Part 2)

But actually, we will define the wrapper to consist of exactly 2 data segments in the WebAssembly data section: segment 0 is 4 bytes and encodes the webcil payload size; and segment 1 is of variable size and contains the webcil payload.

So to load a webcil-in-wasm module, the runtime gets the _raw bytes_ of the WebAssembly module (ie: without instantiating it), and parses it to find the data section, assert that there are 2 segments, ensure they're both passive, and get the data directly from segment 1.

---

* Add option to emit webcil inside a wasm module wrapper

* [mono][loader] implement a webcil-in-wasm reader

* reword WebcilWasmWrapper summary comment

* update the Webcil spec to include the WebAssembly wrapper module

* Adjust RVA map offsets to account for wasm prefix

   MonoImage:raw_data is used as a base when applying the RVA map to map virtual addresses to physical offsets in the assembly.  With webcil-in-wasm there's an extra wasm prefix before the webcil payload starts, so we need to account for this extra data when creating the mapping.

   An alternative is to compute the correct offsets as part of generating the webcil, but that would entangle the wasm module and the webcil payload.  The current (somewhat hacky approach) keeps them logically separate.

* Add a note about the rva mapping to the spec

* Serve webcil-in-wasm as .wasm

* remove old .webcil support from Sdk Pack Tasks

* Implement support for webcil in wasm in the managed WebcilReader

* align webcil payload to a 4-byte boundary within the wasm module

   Add padding to data segment 0 to ensure that data segment 1's payload (ie the webcil content itself) is 4-byte aligned

* assert that webcil raw data is 4-byte aligned

* add 4-byte alignment requirement to the webcil spec

* Don't modify MonoImageStorage:raw_data

   instead just keep track of the webcil offset in the MonoImageStorage.

   This introduces a situation where MonoImage:raw_data is different from MonoImageStorage:raw_data.  The one to use for accessing IL and metadata is MonoImage:raw_data.

   The storage pointer is just used by the image loading machinery

---------

Co-authored-by: Larry Ewing <lewing@microsoft.com>
14 months agoEnsure that INS_TT_MEM128 is correctly handled (#86331)
Tanner Gooding [Tue, 16 May 2023 19:56:50 +0000 (12:56 -0700)]
Ensure that INS_TT_MEM128 is correctly handled (#86331)

14 months agoStop testing UnregisterFrozenSegment (#86279)
Andrew Au [Tue, 16 May 2023 19:20:21 +0000 (12:20 -0700)]
Stop testing UnregisterFrozenSegment (#86279)

14 months agoDelete some dead code (#86337)
Jan Kotas [Tue, 16 May 2023 18:51:43 +0000 (11:51 -0700)]
Delete some dead code (#86337)

NGen left overs

14 months agoImprove the handling of ToScalar and GetElement(0) (#86209)
Tanner Gooding [Tue, 16 May 2023 18:48:30 +0000 (11:48 -0700)]
Improve the handling of ToScalar and GetElement(0) (#86209)

* Improve the handling of ToScalar and GetElement(0)

* Fix build failure

* Ensure ToScalar handling is in EvalHWIntrinsicFunUnary, not FunBinary

* Ensure we don't regress codegen for small types

14 months ago[LoongArch64] just skip the array type. (#86290)
Qiao Pengcheng [Tue, 16 May 2023 18:48:13 +0000 (02:48 +0800)]
[LoongArch64] just skip the array type. (#86290)

The `struct {int array[1]; float field_2;}` which the array field is only one element,
just skip it although it can be passed by registers one integer and one float-register.
Details see github https://github.com/dotnet/runtime/pull/62885#discussion_r821878981

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
14 months agoAdd -DCLI_CMAKE_FALLBACK_OS in CMakeSettings.json (#86261)
Huo Yaoyuan [Tue, 16 May 2023 18:31:27 +0000 (02:31 +0800)]
Add -DCLI_CMAKE_FALLBACK_OS in CMakeSettings.json (#86261)

14 months agoImplement GetNonRuntimeDeterminedTypeFromRuntimeDeterminedSubtypeViaSubstitution...
Michal Strehovský [Tue, 16 May 2023 17:40:18 +0000 (02:40 +0900)]
Implement GetNonRuntimeDeterminedTypeFromRuntimeDeterminedSubtypeViaSubstitution (#86310)

This was reached in the Pri0 test suite.

14 months agoFix handling of non-beforefieldinit interface cctors (#86311)
Michal Strehovský [Tue, 16 May 2023 17:37:09 +0000 (02:37 +0900)]
Fix handling of non-beforefieldinit interface cctors (#86311)

Scanner would miss them. These trigger the same way as valuetype methods (instance methods will trigger them).

14 months agoAccount for rank 1 array special casing in RyuJIT (#86312)
Michal Strehovský [Tue, 16 May 2023 17:30:50 +0000 (02:30 +0900)]
Account for rank 1 array special casing in RyuJIT (#86312)

Should have been done in #84205.

14 months ago[LoongArch64] fix the conflicts within the DIV/MOD. (#86289)
Qiao Pengcheng [Tue, 16 May 2023 15:51:47 +0000 (23:51 +0800)]
[LoongArch64] fix the conflicts within the DIV/MOD. (#86289)

14 months agoUpdate dependencies from https://github.com/dotnet/arcade build 20230515.1 (#86320)
dotnet-maestro[bot] [Tue, 16 May 2023 14:38:57 +0000 (10:38 -0400)]
Update dependencies from https://github.com/dotnet/arcade build 20230515.1 (#86320)

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23262.5 -> To Version 8.0.0-beta.23265.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
14 months agoUpdate references to ILLink tool name (#86315)
Michal Strehovský [Tue, 16 May 2023 14:38:40 +0000 (23:38 +0900)]
Update references to ILLink tool name (#86315)

This warning message is shared with the NativeAOT compiler.

14 months agoDocument how we run multithreaded debugger tests. (#86325)
Ilona Tomkowicz [Tue, 16 May 2023 14:11:10 +0000 (16:11 +0200)]
Document how we run multithreaded debugger tests. (#86325)

14 months ago[mono] Prevent memory corruption when decoding UCO entry point (#86266)
Ivan Povazan [Tue, 16 May 2023 14:07:29 +0000 (16:07 +0200)]
[mono] Prevent memory corruption when decoding UCO entry point (#86266)

Fixes: https://github.com/dotnet/runtime/issues/86264

14 months ago[browser] fix lint issues (#86155)
Pavel Savara [Tue, 16 May 2023 13:42:07 +0000 (15:42 +0200)]
[browser] fix lint issues (#86155)

* fix lint issues
* don't format jiterpreter-tables

14 months agoRemove Architecture Property (#86277)
Andrew Au [Tue, 16 May 2023 13:26:13 +0000 (06:26 -0700)]
Remove Architecture Property (#86277)

14 months agoGetChromeVersions task: Try to find older versions, if the latest one is (#86184)
Ankit Jain [Tue, 16 May 2023 12:53:20 +0000 (08:53 -0400)]
GetChromeVersions task: Try to find older versions, if the latest one is (#86184)

14 months agoStart runing CctorForWrite test (#86302)
Michal Strehovský [Tue, 16 May 2023 10:48:07 +0000 (19:48 +0900)]
Start runing CctorForWrite test (#86302)

This was apparently fixed but not removed from issues.targets.

14 months ago[browser] Load appsettings to VFS (#85520)
Marek Fišera [Tue, 16 May 2023 07:34:13 +0000 (09:34 +0200)]
[browser] Load appsettings to VFS (#85520)

14 months ago[mono][tests] Enable runtime tests on Interpreter (#86097)
Milos Kotlar [Tue, 16 May 2023 06:46:34 +0000 (08:46 +0200)]
[mono][tests] Enable runtime tests on Interpreter (#86097)

* Enable runtime tests on interpreter

14 months ago[wasm] WBT: Re-enable blazor run test (#86268)
Ankit Jain [Tue, 16 May 2023 05:16:34 +0000 (01:16 -0400)]
[wasm] WBT: Re-enable blazor run test (#86268)

14 months ago[ComInterfaceGenerator] Interface inheritance follow up (#85117)
Jackson Schuster [Tue, 16 May 2023 04:45:34 +0000 (21:45 -0700)]
[ComInterfaceGenerator] Interface inheritance follow up (#85117)

This commit creates types to model the Com interfaces and the methods in the com interfaces. The new types with suffix "Info" are meant to be the first step of the pipeline that can be created with just an ISymbol and SyntaxNode. The types suffixed with "Context" are meant to contain all info necessary for generating the code, and they may require multiple "Info"s to be created (e.g. need info about the base interface or other methods in the interface). There is also a type that represents the Com interface and all the methods that are required to generate the code necessary for Com.

14 months agoMetricEventSource tests workaround .NET Framework double rounding (#86286)
Noah Falk [Tue, 16 May 2023 03:21:15 +0000 (20:21 -0700)]
MetricEventSource tests workaround .NET Framework double rounding (#86286)

Fixes #85290
Desktop .NET Framework on x86 improperly rounds double values in some circumstances. I switched the test to use a lower precision double value so that it is not impacted by the extra rounding.

14 months agoUnmark loop align regardless if we found block to align or not (#86198)
Kunal Pathak [Tue, 16 May 2023 02:23:07 +0000 (19:23 -0700)]
Unmark loop align regardless if we found block to align or not (#86198)

* unmark loop align regardless if we found block to align or not

* remove redundant if check

14 months agoIntrinsics analyzer and fixes (#85481)
David Wrighton [Tue, 16 May 2023 02:20:01 +0000 (19:20 -0700)]
Intrinsics analyzer and fixes (#85481)

* Implement analyzer for platform intrinsics use in System.Private.CoreLib

This analyzer detects the use of all platform intrinsics and checks to
ensure that they are all used either protected by an if statement OR
ternary operator which checks an appropriate IsSupported flag, or that
the intrinsic is used within a method where the behavior of platform
support for the intrinsic is not allowed to vary between compile time
and runtime. The analyzer attempts to be conservative about allowed patterns.

All existing code in System.Private.CoreLib has been annotated to avoid producing
errors.

See the markdown document for details.

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
14 months ago[Wasm] Adjust error message for .NET 7 assemblies, JSExport and multi-threading ...
Jérôme Laban [Tue, 16 May 2023 00:30:38 +0000 (20:30 -0400)]
[Wasm] Adjust error message for .NET 7 assemblies, JSExport and multi-threading (#86197)

fix: Adjust error message for .NET 7 assemblies, JSExport and multi-threading

14 months agoMove jiterpreter tables to new file; Add draft jiterpreter overview document (#86270)
Katelyn Gadd [Mon, 15 May 2023 23:02:06 +0000 (16:02 -0700)]
Move jiterpreter tables to new file; Add draft jiterpreter overview document (#86270)

Add draft jiterpreter overview document
Move jiterpreter tables out of jiterpreter-trace-generator

14 months agoIncremental generator for illink analyzer tests (#86260)
Sven Boemer [Mon, 15 May 2023 22:54:45 +0000 (15:54 -0700)]
Incremental generator for illink analyzer tests (#86260)

Changes the existing generator for ILLink.RoslynAnalyzer
testcases to be an IIncrementalGenerator.

14 months agoadd RID for Alpine 3.18 (#86276)
Tomas Weinfurt [Mon, 15 May 2023 22:53:47 +0000 (15:53 -0700)]
add RID for Alpine 3.18 (#86276)

14 months agoClean up impSpanEqualsOrStartsWith (#86129)
Egor Bogatov [Mon, 15 May 2023 22:13:15 +0000 (00:13 +0200)]
Clean up impSpanEqualsOrStartsWith (#86129)

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
14 months agoHandle the remainder in MemoryExtensions.Count vectorized (#82687)
Günther Foidl [Mon, 15 May 2023 22:06:22 +0000 (00:06 +0200)]
Handle the remainder in MemoryExtensions.Count vectorized (#82687)

* Re-use targetVector from Vector256 in Vector128 code-path

Saves an additional vpbroadcastb.

* Process remainder vectorized

* Use unsigned division for remaining elements

Avoids the signed integer division.

* Process remainder vectorized only if more than half of vector remains

Benchmarking showed that the cost is quite high, so for just a few elements the scalar loop seems better.

* Added comment why / 2 got chosen

14 months agoJIT: Fix new helper calls for some block copies involving promoted locals (#86246)
Jakob Botsch Nielsen [Mon, 15 May 2023 21:56:53 +0000 (23:56 +0200)]
JIT: Fix new helper calls for some block copies involving promoted locals (#86246)

The change in #85620 was missing a check for the case where the
destination is not on stack but the source is. The backend still uses a
helper call for this case.

The field-by-field case would also usually involve helper calls since it
would normally need write barriers; however, the exception were for
byref fields, so Span<T>/ReadOnlySpan<T> were particularly affected.

14 months agoDelete some code around `ModuleList` (#86230)
Michal Strehovský [Mon, 15 May 2023 21:33:42 +0000 (06:33 +0900)]
Delete some code around `ModuleList` (#86230)

The concept of loading modules on demand never existed outside some internal ProjectN branches. Delete some code around it. Also delete an extra enumerator that was only used in one place.

14 months ago[debugger] Fix MDBGPROT_CMD_TYPE_ELEMENT_TYPE behavior (#85679)
Thays Grazia [Mon, 15 May 2023 21:15:44 +0000 (18:15 -0300)]
[debugger] Fix MDBGPROT_CMD_TYPE_ELEMENT_TYPE behavior (#85679)

* Fix MDBGPROT_CMD_TYPE_ELEMENT_TYPE

* fix tabs

* Remove generation of dbgshim.
Address @lambdageek comment.

14 months ago[wasm] Add extending conversions to PackedSimd (#86252)
Radek Doulik [Mon, 15 May 2023 20:17:35 +0000 (22:17 +0200)]
[wasm] Add extending conversions to PackedSimd (#86252)

* [wasm] Add extending conversions to PackedSimd

* Feedback

14 months agoAdd Ubuntu Kinetic 22.10 and Mantic 23.10 RIDs (#85912)
Dominik Viererbe [Mon, 15 May 2023 20:12:15 +0000 (23:12 +0300)]
Add Ubuntu Kinetic 22.10 and Mantic 23.10 RIDs (#85912)

Adds the Runtime Identifiers (RIDs) for Ubuntu 22.10 Kinetic Kudu and
the recently announced Ubuntu 23.10 Mantic Minotaur.

Related to #84974, #84983, #84984

14 months ago[mono] Update offsets-tool python clang binding so it works with newer clang (#86256)
Alexander Köplinger [Mon, 15 May 2023 18:46:12 +0000 (20:46 +0200)]
[mono] Update offsets-tool python clang binding so it works with newer clang (#86256)

They introduced a breaking change to CursorKind.TRANSLATION_UNIT in https://github.com/llvm/llvm-project/commit/bb83f8e70bd1d56152f02307adacd718cd67e312, which means we hit an issue when using the binding against a newer clang. Update the binding to the latest upstream and add a tweak so it still works with older clang versions.

14 months agoSpecify NUnit test runner for illink tests (#86187)
Jeremy Koritzinsky [Mon, 15 May 2023 18:43:56 +0000 (11:43 -0700)]
Specify NUnit test runner for illink tests (#86187)

14 months agoChange CreateObjectFlags.Unwrap to be ComWrappers-instance-specific (#86195)
Jeremy Koritzinsky [Mon, 15 May 2023 18:43:05 +0000 (11:43 -0700)]
Change CreateObjectFlags.Unwrap to be ComWrappers-instance-specific (#86195)

14 months agoFix EventPipe shutdown logic (#86180)
David Mason [Mon, 15 May 2023 18:05:49 +0000 (11:05 -0700)]
Fix EventPipe shutdown logic (#86180)

14 months agoAlways expand cctor helpers for NAOT (#86147)
Egor Bogatov [Mon, 15 May 2023 18:04:15 +0000 (20:04 +0200)]
Always expand cctor helpers for NAOT (#86147)

14 months agoImplement AesGcm constructors accepting a tag size and obsolete the existing ones
Kevin Jones [Mon, 15 May 2023 17:28:00 +0000 (13:28 -0400)]
Implement AesGcm constructors accepting a tag size and obsolete the existing ones

14 months agoReenable AOTing System.Net.Quic.dll in Mono AOT runtime tests (#86247)
Alexander Köplinger [Mon, 15 May 2023 17:11:34 +0000 (19:11 +0200)]
Reenable AOTing System.Net.Quic.dll in Mono AOT runtime tests (#86247)

It was disabled due to https://github.com/dotnet/runtime/issues/52977 but that issue was fixed.

Also remove GitHub_25468 from issues.targets since it was disabled against that issue but the test was removed as part of System.Drawing cleanup.

14 months ago[browser] disable enablePerfMeasure by default (#86237)
Pavel Savara [Mon, 15 May 2023 17:01:21 +0000 (19:01 +0200)]
[browser] disable enablePerfMeasure by default (#86237)

* disable enablePerfMeasure by default
* fixed wrong order of config initialization

14 months agoFix Console.ForegroundColor usage in NativeRuntimeEventSourceTest (#86248)
Alexander Köplinger [Mon, 15 May 2023 16:59:01 +0000 (18:59 +0200)]
Fix Console.ForegroundColor usage in NativeRuntimeEventSourceTest (#86248)

It throws PNSE on mobile platforms, avoid getting/setting the property if we're on one of these platforms.

14 months agoIn Microsoft.XmlSerializer.Generator targets, respect Optimize property. (#82374)
Austin Wise [Mon, 15 May 2023 16:34:01 +0000 (09:34 -0700)]
In Microsoft.XmlSerializer.Generator targets, respect Optimize property. (#82374)

This will cause the generated `XmlSerializer` assemblies to be compiled
with optimizations in release builds.

Fixes #77136

14 months agoAssist JIT in eliminating bounds checks (#81036)
xtqqczze [Mon, 15 May 2023 16:17:41 +0000 (17:17 +0100)]
Assist JIT in eliminating bounds checks (#81036)

* for \(.+!= [^ ]+\.Length

* while \(.+!= [^ ]+\.Length

* Remove additional bounds check

14 months agoMove assignment rationalization to before forward substitution
SingleAccretion [Mon, 15 May 2023 15:37:09 +0000 (18:37 +0300)]
Move assignment rationalization to before forward substitution

14 months agoReduce overhead of calling into SearchValues (#86046)
Miha Zupan [Mon, 15 May 2023 14:12:16 +0000 (16:12 +0200)]
Reduce overhead of calling into SearchValues (#86046)

14 months agoUpdate dependencies from https://github.com/dotnet/roslyn-analyzers build 20230512...
dotnet-maestro[bot] [Mon, 15 May 2023 13:58:46 +0000 (09:58 -0400)]
Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230512.2 (#86206)

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23262.1 -> To Version 3.3.5-beta1.23262.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
14 months agolink to the latest version of Framework Design Guidelines (#86216)
Bonuspunkt [Mon, 15 May 2023 13:58:01 +0000 (15:58 +0200)]
link to the latest version of Framework Design Guidelines (#86216)

also added Jeremy Barton because he was inconsistently mentioned

14 months agoDisable SslStreamSniTest.UnencodedHostName_ValidatesCertificate on Android (#86241)
Alexander Köplinger [Mon, 15 May 2023 13:39:45 +0000 (15:39 +0200)]
Disable SslStreamSniTest.UnencodedHostName_ValidatesCertificate on Android (#86241)

14 months ago[RISC-V] Show method names in JitDisasm (#86060)
Alexander Soldatov [Mon, 15 May 2023 13:18:24 +0000 (16:18 +0300)]
[RISC-V] Show method names in JitDisasm (#86060)

14 months agoUpdate dependencies from https://github.com/dotnet/arcade build 20230512.5 (#86205)
dotnet-maestro[bot] [Mon, 15 May 2023 13:18:04 +0000 (08:18 -0500)]
Update dependencies from https://github.com/dotnet/arcade build 20230512.5 (#86205)

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23261.4 -> To Version 8.0.0-beta.23262.5

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
14 months agoUse /INCREMENTAL:NO for Debug (#86170)
Kunal Pathak [Mon, 15 May 2023 12:42:28 +0000 (05:42 -0700)]
Use /INCREMENTAL:NO for Debug (#86170)

* Use /INCREMENTAL:NO for Debug when using Visual Studio generator

---------

Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com>
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Jasper <jasper-d@users.noreply.github.com>
14 months ago[browser] Fix asset loading in boot config scenario (#86240)
Marek Fišera [Mon, 15 May 2023 12:19:47 +0000 (14:19 +0200)]
[browser] Fix asset loading in boot config scenario (#86240)

- Fix using downloadResource
- Fix loading boot config with startupOptions.loadBootResource

14 months agoRun fgValueNumberConstLoad for invariant loads (#86154)
Egor Bogatov [Mon, 15 May 2023 11:15:01 +0000 (13:15 +0200)]
Run fgValueNumberConstLoad for invariant loads (#86154)

14 months ago[wasm] Add fp <--> int conversions to PackedSimd (#86143)
Radek Doulik [Mon, 15 May 2023 09:18:21 +0000 (11:18 +0200)]
[wasm] Add fp <--> int conversions to PackedSimd (#86143)

14 months agoUpdate Base64StringAttribute.cs (#86221)
Weihan Li [Sun, 14 May 2023 19:30:23 +0000 (03:30 +0800)]
Update Base64StringAttribute.cs (#86221)

14 months agoFor Wasi build on windows, do not set CLR_CMAKE_TARGET_WIN32 (#86208)
yowl [Sun, 14 May 2023 05:56:01 +0000 (00:56 -0500)]
For Wasi build on windows, do not set CLR_CMAKE_TARGET_WIN32 (#86208)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
14 months agoAdd ImmutableArray.Contains overload that accepts an IEqualityComparer<T> (#86210)
RaymondHuy [Sun, 14 May 2023 01:47:19 +0000 (08:47 +0700)]
Add ImmutableArray.Contains overload that accepts an IEqualityComparer<T> (#86210)

14 months agoJIT: do early block merging in more cases (#86157)
Andy Ayers [Sat, 13 May 2023 14:42:33 +0000 (07:42 -0700)]
JIT: do early block merging in more cases (#86157)

OSR and PGO both rely on the fact that the early flowgraph the JIT builds is
the same flowgraph as the one seen in a previous JIT complation of that method,
since there is metadata (patchpoint offset, pgo schema) that refers to the
flowgraph. Previous work here (#85860) didn't ensure this for enough cases.

In particular if Tier0 does not do early block merging, but OSR does, it's possible
for the OSR entry point to fall within a merged block range, which the JIT is not
prepared to handle. This lead to the asserts seen in #86125.

The fix is to enable early block merging unless we're truly in a minopts or
debug codegen mode (previous to this Tier0 would not merge unless it also
was instrumenting; now it will always merge).

An alternative fix would be to find the block containing the OSR entry IL
offset, scan its statements, and split the block at the right spot, but that
seemed more involved.

Fixes #86125.

14 months agoRemove char[] allocation from TarHeader (#86201)
Stephen Toub [Sat, 13 May 2023 06:35:24 +0000 (02:35 -0400)]
Remove char[] allocation from TarHeader (#86201)

14 months ago[JIT]: Inline TLS field access for GC type (#85619)
Kunal Pathak [Sat, 13 May 2023 02:36:22 +0000 (19:36 -0700)]
[JIT]: Inline TLS field access for GC type (#85619)

* Add CORINFO_HELP_GETSHARED_GCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED

* Working prototype

* Rename ThreadStaticBlock to NonGCThreadStaticBlock

* Add GCThreadStaticBlock

* fix linux build

* Restrict the optimization to non-generics

* Update the guid

* Add canOptimizeHelper check

* Rename and related methods from typeIDMap to NonGCTypeID

* Introduce GCTypeIDMap and getGCThreadLocalFieldInfo()

* Use GCThreadLocalFieldInfo()

* fix the bug about gc tracking

* resolve merge conflicts

* remove the commented code

* add comment

* Unify some of the non-gc/gc methods

* fix missing methods

* update the comments

* Track gc for derefernce of object handle

* fix the superpmi methods

* review feedback

14 months agoRemove static modifiers from ThreadPool events in NativeRuntimeEventSource.PortableTh...
Nickolas McDonald [Sat, 13 May 2023 01:49:08 +0000 (21:49 -0400)]
Remove static modifiers from ThreadPool events in NativeRuntimeEventSource.PortableThreadPool.NativeSinks.cs (#85563)

* remove static modifiers

remove static modifiers from lines:
 - 156
 - 191
in:
src\libraries\System.Private.CoreLib\src\System\Threading\NativeRuntimeEventSource.PortableThreadPool.NativeSinks.cs

* Update NativeRuntimeEventSourceTest.cs

* Test NativeRuntimeEventSourceTest.cs

* Remove static modifiers

14 months ago[wasm] InstallWorkloadFromArtifacts: remove unnecessary workaround (#86191)
Ankit Jain [Sat, 13 May 2023 01:45:00 +0000 (21:45 -0400)]
[wasm] InstallWorkloadFromArtifacts: remove unnecessary workaround (#86191)

Prompted by WBT failing with:
```
/Users/ankj/dev/r2/eng/testing/workloads-testing.targets(191,5): error : Could not find IncludedWorkloadManifests.txt in /Users/ankj/dev/r2/artifacts/bin/dotnet-none/
```

.. which seems to been renamed to `KnownWorkloadManifests.txt`.

14 months agoAvoid NRE in networking EventSources (#86171)
Miha Zupan [Fri, 12 May 2023 23:53:06 +0000 (01:53 +0200)]
Avoid NRE in networking EventSources (#86171)

14 months agoFix the test build error (#86176)
Kunal Pathak [Fri, 12 May 2023 22:49:29 +0000 (15:49 -0700)]
Fix the test build error (#86176)

Remove outputtype=exe, mark test as [Fact]
---------

Co-authored-by: Mark Plesko <markples@microsoft.com>
14 months agoUpdate debugging-runtime.md to mention nativeprereqs (#86174)
Juan Hoyos [Fri, 12 May 2023 22:02:15 +0000 (15:02 -0700)]
Update debugging-runtime.md to mention nativeprereqs (#86174)

14 months agoWrite generic method, write complex signatures like array/pointer/generics (#86026)
Buyaa Namnan [Fri, 12 May 2023 21:12:45 +0000 (14:12 -0700)]
Write generic method, write complex signatures like array/pointer/generics (#86026)

* Write generic method, write complex signatures like array/pointer/generics

* Update src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/MethodBuilderImpl.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Update src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/MethodBuilderImpl.cs

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
14 months agoConvert JIT/Performance to a merged test group (#85851)
Mark Plesko [Fri, 12 May 2023 21:04:01 +0000 (14:04 -0700)]
Convert JIT/Performance to a merged test group (#85851)

See https://github.com/markples/utils/tree/for-PR-dotnet-runtime-85847-others for ILTransform tool.

* Manual removal of C# Main args
* [ILTransform -prociso] Set RequiresProcessIsolation when needed by other properties
* [ILTransform -public] Make test entrypoints accessible
* [ILTransform -ilfact] Main->TestEntryPoint, [Fact], remove OutputType=Exe
* Manual fixes for xUnit1013 - internal methods, disable for region
* Add merged group

14 months agoAdd tests for RUC warnings on override methods (#86015)
Vitek Karas [Fri, 12 May 2023 20:31:25 +0000 (13:31 -0700)]
Add tests for RUC warnings on override methods (#86015)

These are tests for bug https://github.com/dotnet/runtime/issues/86008.

I also restructured the test file into nested classes some more as it's easier to navigate this way.

Also adds a test for https://github.com/dotnet/runtime/issues/86032.

14 months agoAdd ICorProfiler API to allow profiler created providers to have a callback when...
David Mason [Fri, 12 May 2023 19:41:28 +0000 (12:41 -0700)]
Add ICorProfiler API to allow profiler created providers to have a callback when a session enables them (#80528)

14 months agoUse unique IL assembly names instead of automatic renaming (#85185)
Mark Plesko [Fri, 12 May 2023 19:22:03 +0000 (12:22 -0700)]
Use unique IL assembly names instead of automatic renaming (#85185)

The main motivation for this is that I got stuck trying to write documentation for test merging and test suffixes. We have _il_d for IL and both _d and _cs_d for C# (and similar for _r and others - I'll use _d to denote all such tests here). Only the IL files needed to be separated into different merged groups, yet we split the C# as well.

This change renames the _il_d to just _d (unless there is already an existing _d, likely for a C# version of the test). It then replaces .assembly <name> with .assembly ASSEMBLY_NAME and adds per-configuration "prefix" IL source files with #define ASSEMBLY_NAME <name>_d. Then the rules are simple - tests have unique assembly names and no build-time renaming is required.

This lets me remove the 4 Regression merged groups with ~10 tests each in them. I rebalanced the merged groups where the number of _d tests were larger except HardwareIntrinsics (a unique directory) and Methodical (most of the tests are _d).

14 months agoremove wrap_trace_function (#86158)
Pavel Savara [Fri, 12 May 2023 19:17:54 +0000 (21:17 +0200)]
remove wrap_trace_function (#86158)

14 months agoConvert JIT/SIMD to a merged test group (#85852)
Mark Plesko [Fri, 12 May 2023 18:49:51 +0000 (11:49 -0700)]
Convert JIT/SIMD to a merged test group (#85852)

See https://github.com/markples/utils/tree/for-PR-dotnet-runtime-85847-others for ILTransform tool.

* [ILTransform -prociso] Set RequiresProcessIsolation when needed by other properties
* [ILTransform -public] Make test entrypoints accessible
* Manual fixes for [ILTransform -public] - public partial classes
* [ILTransform -ilfact] Main->TestEntryPoint, [Fact], remove OutputType=Exe
* Remove DOTNET_JitFuncInfoLogFile/SIMD.log from JIT/SIMD
* Manual fixes for xUnit1013 - internal methods
* Manually fix case of accessibility of test in nested type
* Add merged group

14 months agoConvert JIT/opt to a merged test group (#85850)
Mark Plesko [Fri, 12 May 2023 18:49:10 +0000 (11:49 -0700)]
Convert JIT/opt to a merged test group (#85850)

See https://github.com/markples/utils/tree/for-PR-dotnet-runtime-85847-others for ILTransform tool. In this group, I was a bit more aggressive in converting individual tests in [Fact]s and [Theory]s when needing to make manual changes. This required a change to the wrapper generator.

* Manual removal of C# Main args
* Mark async Main test as RPI
* Manual removal of IL Main arg
* Manual fix for badcallee
* [ILTransform -p] Remove _il from project name
* [ILTransform -n] Unique project names
* [ILTransform -m] Remove .module from IL tests
* Rename GitHub_42719: _r means not DebugType=Full, _o for optimize
* [ILTransform -a] Match IL .assembly names to project names
* [ILTransform -prociso] Set RequiresProcessIsolation when needed by other properties
* [ILTransform -sr] Use canonical form for .assembly extern System.Runtime
* [ILTransform -ilfact] Main->TestEntryPoint, [Fact], remove OutputType=Exe
* [ILTransform -public] Make test entrypoints accessible
* Manual fixes for [ILTransform -public] - internal methods to handle internal parameter types
* Handle float constants for InlineData in XUnitWrapperGenerator
* Manual fixes for xUnit1013 - internal methods, convert to [Theory]
* Manual fixes for xUnit1013 - internal methods, disable region
* Add merged group
* Fix mismatch{32,64} by putting the test methods in classes

14 months agoConvert JIT/Generics to a merged test group (#85849)
Mark Plesko [Fri, 12 May 2023 18:48:13 +0000 (11:48 -0700)]
Convert JIT/Generics to a merged test group (#85849)

See https://github.com/markples/utils/tree/for-PR-dotnet-runtime-85847-others for ILTransform tool.

* [ILTransform -p] Remove _il from project names
* [ILTransform -n] Unique project names
* [ILTransform -a] Match IL .assembly names to project names
* [ILTransform -prociso] Set RequiresProcessIsolation when needed by other properties
* [ILTransform -public] Make test entrypoints accessible
* Manual fixes for [ILTransform -public] - internal methods to handle internal parameter types
* [ILTransform -sr] Use canonical form for .assembly extern System.Runtime
* [ILTransform -ilfact] Main->TestEntryPoint, [Fact], remove OutputType=Exe
* Manually created unique project names that were missed due to casing
* Add merged group

14 months ago[main] Update dependencies from dotnet/roslyn-analyzers (#86093)
dotnet-maestro[bot] [Fri, 12 May 2023 17:53:34 +0000 (12:53 -0500)]
[main] Update dependencies from dotnet/roslyn-analyzers (#86093)

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230510.2

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23258.1 -> To Version 3.3.5-beta1.23260.2

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230512.1

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23258.1 -> To Version 3.3.5-beta1.23262.1

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
14 months ago[wasm] Unify boot config location (#85763)
Marek Fišera [Fri, 12 May 2023 17:52:09 +0000 (19:52 +0200)]
[wasm] Unify boot config location (#85763)

Load mono-config.json and blazor.boot.json from the same location

14 months agoMake the STJ source generator cache friendly (#86121)
Eirik Tsarpalis [Fri, 12 May 2023 17:47:47 +0000 (18:47 +0100)]
Make the STJ source generator cache friendly (#86121)

* Make the STJ source generator cache friendly.

* Address feedback

* Fix GetHashCode implementation.

* Update src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Remove TODO comment.

* Remove TODO comment.

* Update src/libraries/System.Text.Json/gen/Model/ImmutableEquatableArray.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Address feedback.

* Address feedback

* Expand incremental compilation unit test coverage to include Roslyn tracking.

---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
14 months ago[main] Update dependencies from dotnet/arcade (#86091)
dotnet-maestro[bot] [Fri, 12 May 2023 17:40:34 +0000 (12:40 -0500)]
[main] Update dependencies from dotnet/arcade (#86091)

* Update dependencies from https://github.com/dotnet/arcade build 20230510.3

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23259.5 -> To Version 8.0.0-beta.23260.3

* Update dependencies from https://github.com/dotnet/arcade build 20230511.4

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23259.5 -> To Version 8.0.0-beta.23261.4

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
14 months agoRemove unused multi-dimensional array code (#86133)
Bruce Forstall [Fri, 12 May 2023 17:01:37 +0000 (10:01 -0700)]
Remove unused multi-dimensional array code (#86133)

MD array processing in the JIT changed with https://github.com/dotnet/runtime/pull/70271,
making all the code that implemented the old processing method unused.

Remove all this unused code.

Fixes #71678

14 months agoFix createdump --crashreport option error (#86137)
Mike McLaughlin [Fri, 12 May 2023 17:01:21 +0000 (10:01 -0700)]
Fix createdump --crashreport option error (#86137)

14 months agoTemplatize `enregisterLocalVars` in various methods of LSRA (#85144)
Kunal Pathak [Fri, 12 May 2023 16:52:59 +0000 (09:52 -0700)]
Templatize `enregisterLocalVars` in various methods of LSRA (#85144)

* Optimize identifyCandidates()

* Optimize isRegCandidate()

* Optimize initVarRegMaps()

* Optimize processBlockEndAllocation() and processBlockStartLocations()

* Optimize resolveRegisters()

* jit format

* Revert change for initVarRegMask()

* Remove the unneeded assert

* Optimize buildIntervals()

* Fix the revert I did previously

* review feedback

14 months ago[PERF] Reorder urllib and remove --force-reinstall but keep pinned version (#86128)
Parker Bibus [Fri, 12 May 2023 16:35:31 +0000 (09:35 -0700)]
[PERF] Reorder urllib and remove --force-reinstall but keep pinned version  (#86128)

* Move scenario urllib imports to the last install position.

* Remove force-reinstall from all pip installs in the scenarios-job.yml files.

14 months agoTweak new OutOfMemory_StringTooLong exception message (#86150)
Stephen Toub [Fri, 12 May 2023 16:33:06 +0000 (12:33 -0400)]
Tweak new OutOfMemory_StringTooLong exception message (#86150)

* Tweak new OutOfMemory_StringTooLong exception message

Add a period, fix the tense (the string isn't created yet), and clarify what it means to be too long.

* Update src/libraries/System.Private.CoreLib/src/Resources/Strings.resx

14 months agoFix official build of cross DAC components (#86138)
Jan Kotas [Fri, 12 May 2023 16:18:46 +0000 (09:18 -0700)]
Fix official build of cross DAC components (#86138)

* Fix official build of cross DAC components

Revert changes that broke build of the cross DAC linux-arm components

Fixes #86073

Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com>
14 months agoExpose remaining Avx512 integer intrinsics which don't require VectorMask (#86130)
Tanner Gooding [Fri, 12 May 2023 15:17:49 +0000 (08:17 -0700)]
Expose remaining Avx512 integer intrinsics which don't require VectorMask (#86130)

* Expose Shuffle2x128 and Shuffle4x128 in Avx512F

* Expose various PermuteVar#x#x2 APIs in Avx512F, Avx512BW, and Avx512Vbmi

* Apply formatting patch

* Fix unix build failure

14 months agoImprove Ascii (and Utf8) encoding (#85266)
Daniel Svensson [Fri, 12 May 2023 10:43:40 +0000 (12:43 +0200)]
Improve Ascii (and Utf8) encoding (#85266)

* Improve writing of lower vector part in ascii convertion

* from 10 /17 to 1 instruction for 64/32 bit x86

* Add [MethodImpl(MethodImplOptions.AggressiveInlining)] to NarrowUtf16ToAscii_Intrinsified

* rewrite StoreLower without Sse2.StoreScalar

* move helper to Vector128 and call in case conversion

* remove unused helpers

14 months ago[RISC-V] Fix emitOutputInstr (#86078)
Dong-Heon Jung [Fri, 12 May 2023 10:27:47 +0000 (19:27 +0900)]
[RISC-V] Fix emitOutputInstr (#86078)

- Fix to use instruction code not INS_

14 months agoDelete more code around reflection blocking (#86139)
Michal Strehovský [Fri, 12 May 2023 08:37:10 +0000 (17:37 +0900)]
Delete more code around reflection blocking (#86139)

We had a bunch of code to carefully compute names in situations where the metadata/names might not be available. Such situations no longer exist.

14 months agoRemove last `!` from Caching.Abstractions (#85918)
hrrrrustic [Fri, 12 May 2023 08:15:23 +0000 (11:15 +0300)]
Remove last `!` from Caching.Abstractions (#85918)

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Christopher Watford <132389385+watfordkcf@users.noreply.github.com>
14 months agoFix spurious SuperPMI asm diffs (#86132)
Bruce Forstall [Fri, 12 May 2023 04:02:48 +0000 (21:02 -0700)]
Fix spurious SuperPMI asm diffs (#86132)

Under ELT profiler stress, we encode the un-relocated address
of the `DummyProfilerELTStub` function in the JIT codebase into
the generated code. This can lead to spurious diffs if the address
is different between base and diff JITs (which is likely).

To avoid this, under SuperPMI replay (which we only know in DEBUG
builds currently), use a fixed constant for this address. The code
isn't executed during SuperPMI replay, so it doesn't need to be a
valid code address.

14 months agoUpdate portable linux source-build legs to use AlmaLinux to better represent building...
Jeremy Koritzinsky [Fri, 12 May 2023 02:01:50 +0000 (19:01 -0700)]
Update portable linux source-build legs to use AlmaLinux to better represent building on RHEL8 (#86114)

14 months agoFix an SSA bug from the `ASG` refactoring (#86108)
SingleAccretion [Fri, 12 May 2023 01:48:53 +0000 (04:48 +0300)]
Fix an SSA bug from the `ASG` refactoring (#86108)

* Add a test

* Fix an SSA bug from the GT_ASG refactoring

Recording PHIs from analyzable stores is a correctness requirement.

14 months agoClean up shared ArrayPool naming and add some env var config (#86109)
Stephen Toub [Thu, 11 May 2023 23:56:43 +0000 (19:56 -0400)]
Clean up shared ArrayPool naming and add some env var config (#86109)

* Clean up shared ArrayPool naming and add some env var config

We've had several requests to be able to tweak / experiment with how many arrays the shared array pool might store.  This adds two environment variables, one that controls the number of partitions the shared pool uses, and one that controls the number of arrays cacheable in each partition.  Previously these values were constants.

As part of doing that, I needed to choose names that were a bit more palatable for external consumption, and I renamed thngs in the implementation accordingly.

* Rename file to SharedArrayPool.cs

* Fix naming scheme

* Avoid using globalization

* Avoid using Environment.GetEnvironmentVariable

* Move nopool env var into Environment

* Move static readonly fields to statics type