platform/upstream/dotnet/runtime.git
2 years agoUpdate dependencies from https://github.com/dotnet/msquic build 20220310.2 (#66468)
dotnet-maestro[bot] [Thu, 10 Mar 2022 20:58:09 +0000 (21:58 +0100)]
Update dependencies from https://github.com/dotnet/msquic build 20220310.2 (#66468)

System.Net.MsQuic.Transport
 From Version 7.0.0-alpha.1.22159.1 -> To Version 7.0.0-alpha.1.22160.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoRemove null check that is used later to handle size request scenario. (#66428)
Aaron Robinson [Thu, 10 Mar 2022 20:02:16 +0000 (15:02 -0500)]
Remove null check that is used later to handle size request scenario. (#66428)

2 years agoUse StartsWith(..., OrdinalIgnoreCase) in RegexCompiler / source generator (#66339)
Stephen Toub [Thu, 10 Mar 2022 19:11:56 +0000 (14:11 -0500)]
Use StartsWith(..., OrdinalIgnoreCase) in RegexCompiler / source generator (#66339)

* Use StartsWith(..., OrdinalIgnoreCase) in RegexCompiler / source generator

When we encounter a sequence of sets representing case-insensitive ASCII, we can simplify the code generated to just call StartsWith, which both makes it more readable but also takes advantage of the new JIT optimization to lower that into efficient vectorized comparisons based on the supplied literal.

This also cleans up some formatting in the source generator emitted code to make things much more concise and less noisy.

* Address PR feedback

2 years agoCheck gtClassProfileCandidateInfo before instrumentation (#66388)
Egor Bogatov [Thu, 10 Mar 2022 18:40:34 +0000 (21:40 +0300)]
Check gtClassProfileCandidateInfo before instrumentation (#66388)

2 years agoDisable timing out test on mono (#66381)
Eirik Tsarpalis [Thu, 10 Mar 2022 18:40:14 +0000 (18:40 +0000)]
Disable timing out test on mono (#66381)

* disable timing out test on mono

* Update src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/CustomConverterTests/CustomConverterTests.cs

2 years agoClean up NonBacktracking DgmlWriter (#66363)
Stephen Toub [Thu, 10 Mar 2022 18:33:14 +0000 (13:33 -0500)]
Clean up NonBacktracking DgmlWriter (#66363)

* Clean up NonBacktracking DgmlWriter

* Address PR feedback, clean up some lang=regex usage, fix a test failure

2 years ago[main] Update dependencies from 7 repositories (#66330)
dotnet-maestro[bot] [Thu, 10 Mar 2022 18:10:24 +0000 (19:10 +0100)]
[main] Update dependencies from 7 repositories (#66330)

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

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

* Update dependencies from https://github.com/dotnet/icu build 20220307.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.3.22128.1 -> To Version 7.0.0-preview.3.22157.1

* Update dependencies from https://github.com/dotnet/xharness build 20220307.2

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.22153.2 -> To Version 1.0.0-prerelease.22157.2

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

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22153.1 -> To Version 7.0.0-preview1.22157.1

* Update dependencies from https://github.com/dotnet/hotreload-utils build 20220307.2

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.2-alpha.0.22128.2 -> To Version 1.0.2-alpha.0.22157.2

* Update dependencies from https://github.com/dotnet/llvm-project build 20220307.1

runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter
 From Version 1.0.0-alpha.1.22128.1 -> To Version 1.0.0-alpha.1.22157.1

* Use full names for GenericHandler passed to xharness

* Update dependencies from https://github.com/dotnet/msquic build 20220309.1

System.Net.MsQuic.Transport
 From Version 7.0.0-alpha.1.21529.3 -> To Version 7.0.0-alpha.1.22159.1

* Update dependencies from https://github.com/dotnet/xharness build 20220310.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.22153.2 -> To Version 1.0.0-prerelease.22160.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoStop collecting disposables if changed token encountered (#66265)
Pavel Ivanov [Thu, 10 Mar 2022 16:49:34 +0000 (21:49 +0500)]
Stop collecting disposables if changed token encountered (#66265)

* reproduce issue: collecting disposables even if composite token has alredy been changed

* stop collecting disposables if composite token has already been changed

* Update src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* Update src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years agoRemove asserts checking OpenSSL error queues (#66443)
Radek Zikmund [Thu, 10 Mar 2022 14:45:04 +0000 (15:45 +0100)]
Remove asserts checking OpenSSL error queues (#66443)

Fixes #44689

As of #65148, libraries use different approach to handling OpenSSL errors. The original assert which would be hit if a previous operation left errors in the queue is no longer necessary as all OpenSSL calls are prepended by `ERR_clear_error()` to make sure the latest (and most relevant) error is reported.

2 years agoFix the accounting for gen 1 allocations by taking into account what has been already...
Peter Sollich [Thu, 10 Mar 2022 10:26:41 +0000 (11:26 +0100)]
Fix the accounting for gen 1 allocations by taking into account what has been already consumed in this GC. (#60248)

Details:

In gen 1 GCs, we recompute the budget at the end of the GC. However, the amount consumed in the current GC is nowhere taken into account. That causes us to do at most alternate gen 0 and gen 1 GCs, we cannot do back-to-back gen 1 GCs.

If we take the gen 1 budget as the amount of memory we are aiming to be used for gen 1, then it seems illogical to just drop the amount used in this GC on the floor.

The fix is to actually subtract the amount of gen 1 budget used in this GC from dd_new_allocation for gen 1. This is a bit awkward for server GC, because we even out the budget and the amount to subtract from dd_new_allocation across heaps after having computed it for each heap individually.

2 years agoFix implicit nullchecks for floats on arm64 (#66413)
Egor Bogatov [Thu, 10 Mar 2022 09:45:58 +0000 (12:45 +0300)]
Fix implicit nullchecks for floats on arm64 (#66413)

2 years agoAdd timestamp to some superpmi.py output (#66437)
Bruce Forstall [Thu, 10 Mar 2022 07:26:59 +0000 (23:26 -0800)]
Add timestamp to some superpmi.py output (#66437)

This should help determine where time is being spent in long-running
tasks such as PMI or crossgen2 collections in the CI system.

2 years agoAdd retries to `dotnet restore` in SPMI collection of benchmarks (#66433)
Bruce Forstall [Thu, 10 Mar 2022 06:18:55 +0000 (22:18 -0800)]
Add retries to `dotnet restore` in SPMI collection of benchmarks (#66433)

Also, run a `dotnet --info` command to verify the version of the CLI we are running.

2 years agoRevert "Do not mark implicit byrefs with GTF_GLOB_REF" (#66415)
Jakob Botsch Nielsen [Thu, 10 Mar 2022 05:10:10 +0000 (06:10 +0100)]
Revert "Do not mark implicit byrefs with GTF_GLOB_REF" (#66415)

* Revert "Do not mark implicit byrefs with GTF_GLOB_REF (#66266)"

This reverts commit 0a684281f661f5520ad7f358a5056a2eed5b50ba. This is
currently not safe to do in the JIT because we clear out address
exposure information in fgRetypeImplicitByRefArgs() and thus do not have
the necessary information in morph to know if indirections off of
implicit byrefs are global or not.

* Add a test

2 years agoAdd test for comhost with managed host (#66360)
Elinor Fung [Thu, 10 Mar 2022 04:52:18 +0000 (20:52 -0800)]
Add test for comhost with managed host (#66360)

2 years agoFix timeout checking in FindFinalStatePosition (#66365)
Stephen Toub [Thu, 10 Mar 2022 03:30:04 +0000 (22:30 -0500)]
Fix timeout checking in FindFinalStatePosition (#66365)

Exit the inner loop every now and then to do a timeout check.

2 years agoDowngrade the Roslyn version used by the Regex source generator to be 4.0.1 instead...
Jose Perez Rodriguez [Thu, 10 Mar 2022 03:28:15 +0000 (19:28 -0800)]
Downgrade the Roslyn version used by the Regex source generator to be 4.0.1 instead of 4.2.0 (#66423)

* Downgrade the Roslyn version used by the Regex source generator to be 4.0.1 instead of 4.2.0

* Update src/libraries/System.Text.RegularExpressions/gen/System.Text.RegularExpressions.Generator.csproj

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
2 years agoImplement System.Decimal.Scale (#66403)
MichalPetryka [Thu, 10 Mar 2022 03:26:36 +0000 (04:26 +0100)]
Implement System.Decimal.Scale (#66403)

Adds System.Decimal.Scale, a property that
returns the scaling factor of the decimal.

Closes #65074.

2 years agoRename `GeneratedDllImportAttribute` -> `LibraryImportAttribute` (#66307)
Elinor Fung [Thu, 10 Mar 2022 02:07:52 +0000 (18:07 -0800)]
Rename `GeneratedDllImportAttribute` -> `LibraryImportAttribute` (#66307)

2 years agoReenable compiler warning 4244 under coreclr/ (#66398)
Aaron Robinson [Thu, 10 Mar 2022 01:12:51 +0000 (20:12 -0500)]
Reenable compiler warning 4244 under coreclr/ (#66398)

* From vm/

* From util/

* From debug/

* GCInfo related

Use MAXDWORD instead of DWORD_MAX.
Remove DWORD_MAX from pal, since it is not used anywhere.

2 years agoFix random printf from JIT (#66420)
Jakob Botsch Nielsen [Thu, 10 Mar 2022 01:08:44 +0000 (02:08 +0100)]
Fix random printf from JIT (#66420)

2 years agoRun superpmi-replay pipeline on JIT PRs (#66063)
Bruce Forstall [Thu, 10 Mar 2022 01:01:21 +0000 (17:01 -0800)]
Run superpmi-replay pipeline on JIT PRs (#66063)

Currently, the `runtime-coreclr superpmi-replay` pipeline is run
when a JIT change is merged. This change moves the checking to happen
on the PR pre-merge, as a requirement for merging.

2 years ago[mono][wasm] Add changes required by emscripten 3.1.4. (#66410)
Zoltan Varga [Thu, 10 Mar 2022 00:27:01 +0000 (19:27 -0500)]
[mono][wasm] Add changes required by emscripten 3.1.4. (#66410)

2 years agochange the region related config names to be more reasonable (#66134)
Maoni Stephens [Thu, 10 Mar 2022 00:17:01 +0000 (16:17 -0800)]
change the region related config names to be more reasonable (#66134)

Co-authored-by: Maoni0 <maoni@microsoft.com>
2 years ago[MAUI][PERF] Add IPA file usage for iOS Maui SOD (#66358)
Parker Bibus [Wed, 9 Mar 2022 22:55:02 +0000 (16:55 -0600)]
[MAUI][PERF] Add IPA file usage for iOS Maui SOD (#66358)

* [PERF][MAUI] Add ios-arm64 logic to create .ipa for perf runs

Switches from simulator builds to device builds so we can track the size for the .ipa.

We generate a dummy codesigning cert and provisioning profile since device builds require that.

* First run with new ipa compatible ios perf setup and ipa app passthrough.

* Temporarily use preview 14 until all packages are synced for 6.0.300 for testing.

* Changed MacCatalyst folder copied on perf setup and made the mono ios app have it's subfolders copied.

* Update the calling args so xcopy knows the files are directories.

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoDon't build IJW and COM tests for mono (#66400)
Elinor Fung [Wed, 9 Mar 2022 22:16:17 +0000 (14:16 -0800)]
Don't build IJW and COM tests for mono (#66400)

2 years agoExtend Equals/StartsWith auto-vectorization for OrdinalIgnoreCase (#66095)
Egor Bogatov [Wed, 9 Mar 2022 21:14:37 +0000 (00:14 +0300)]
Extend Equals/StartsWith auto-vectorization for OrdinalIgnoreCase (#66095)

2 years agoskip the ReadToEndAsync_WithCancellation test if there is not enough disk space ...
Adam Sitnik [Wed, 9 Mar 2022 19:26:09 +0000 (20:26 +0100)]
skip the ReadToEndAsync_WithCancellation test if there is not enough disk space (#66397)

* skip the ReadToEndAsync_WithCancellation test if there is not enough disk space to create 1GB test file

* move the test to OuterLoop

2 years agoUpdate CancellationToken.cs (#66399)
Aaron Robinson [Wed, 9 Mar 2022 16:16:21 +0000 (11:16 -0500)]
Update CancellationToken.cs (#66399)

Remove ObjectDisposedException from doc since the method doesn't throw the exception.

2 years ago[mono][jit] Add a helper function to check that a method has the [Intrinsic] custom...
Zoltan Varga [Wed, 9 Mar 2022 15:57:41 +0000 (10:57 -0500)]
[mono][jit] Add a helper function to check that a method has the [Intrinsic] custom attribute. (#66359)

2 years agoMove Array.CreateInstance methods to shared CoreLib (#66025)
Jan Kotas [Wed, 9 Mar 2022 15:56:10 +0000 (07:56 -0800)]
Move Array.CreateInstance methods to shared CoreLib (#66025)

2 years agoReduce the amount of memory allocated by System.IO.Tests (#66387)
Adam Sitnik [Wed, 9 Mar 2022 14:46:58 +0000 (15:46 +0100)]
Reduce the amount of memory allocated by System.IO.Tests (#66387)

* use 2.1 GB instead 6.5 GB to verify lack of Int32 overflow:

reduce the size
use same memory for input and output

* use SkipTestException to indicate that the test has been skipped

* don't run WriteChars_VeryLargeArray_DoesNotOverflow with other tests in parallel, as it can cause OOM

* move the test to Outerloop as suggested by Stephen

2 years ago[Mono] Add SIMD intrinsics for Vector64/128 "All" and "Any" variants of GT/GE/LT...
Simon Rozsival [Wed, 9 Mar 2022 14:24:14 +0000 (15:24 +0100)]
[Mono] Add SIMD intrinsics for Vector64/128 "All" and "Any" variants of GT/GE/LT/LE (#65889)

* Add All and Any variants of GT/GE/LT/LE

* Fix indentation

* Fix indentation

* Add xones to llvm

* Fix comparisons for floating point numbers

* Add missing unsigned type

* Reduce code duplication

* Fix build

* Reorganize code a bit

* Remove redundant assertion

* Fix bitwise operators intrinsics

* Simplify checking float args

* Fix typo

2 years agoRemove compiler warning suppression 2 (#66375)
Aaron Robinson [Wed, 9 Mar 2022 14:10:36 +0000 (09:10 -0500)]
Remove compiler warning suppression 2 (#66375)

* Remove 4146 - coreclr

* Remove 4302

2 years agoFix early stack offset and size computations for ARM32 with FEATURE_FASTTAILCALL...
Jakob Botsch Nielsen [Wed, 9 Mar 2022 12:59:09 +0000 (13:59 +0100)]
Fix early stack offset and size computations for ARM32 with FEATURE_FASTTAILCALL enabled (#66367)

When FEATURE_FASTTAILCALL is enabled we compute stack offsets for parameters early. These are used to check for interference when placing arguments for fast tailcalls. On ARM32 the assigned offsets were wrong in several cases involving alignment and when we have split parameters.

2 years agoAdd Stopwatch.GetElapsedTime (#66372)
Stephen Toub [Wed, 9 Mar 2022 12:42:15 +0000 (07:42 -0500)]
Add Stopwatch.GetElapsedTime (#66372)

2 years agoFix cancellation race condition in PipeStream cancellation callback (#65909)
Stephen Toub [Wed, 9 Mar 2022 11:49:16 +0000 (06:49 -0500)]
Fix cancellation race condition in PipeStream cancellation callback (#65909)

* Fix cancellation race condition in PipeStream cancellation callback

The public PipeStream.SafePipeHandle property throws an exception if the handle has already been closed.  This code should have been using the internal InternalHandle property, which just gets the SafePipeHandle object if it exists.

* Update src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.ValueTaskSource.cs

Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
2 years agoFirst try at implementing newly suggested ctor for providing tighter control over...
brianmed [Wed, 9 Mar 2022 10:56:44 +0000 (05:56 -0500)]
First try at implementing newly suggested ctor for providing tighter control over charset (#63231)

* First try at implementing newly suggested ctor for providing tighter control over charset

* Update reference assembly so mediaType is accurate

* Update per github code review

2 years agoDo not mark implicit byrefs with GTF_GLOB_REF (#66266)
Jakob Botsch Nielsen [Wed, 9 Mar 2022 10:22:25 +0000 (11:22 +0100)]
Do not mark implicit byrefs with GTF_GLOB_REF (#66266)

2 years agoFix some exception messages for BindHandle-like cases (#66326)
Koundinya Veluri [Wed, 9 Mar 2022 02:35:55 +0000 (18:35 -0800)]
Fix some exception messages for BindHandle-like cases (#66326)

* Fix some exception messages for BindHandle-like cases

- Updated `ThrowHelper.ThrowApplicationException` to get and include an error message
- Enabled the disabled tests, disabled a `BindHandle` test on Unixes where it now throws `PNSE` before `ArgumentNullException`

Fixes https://github.com/dotnet/runtime/issues/66273
Fixes https://github.com/dotnet/runtime/issues/66274

2 years agoDo not propagate RHS flags in block morphing (#66291)
SingleAccretion [Wed, 9 Mar 2022 02:18:54 +0000 (05:18 +0300)]
Do not propagate RHS flags in block morphing (#66291)

It is not necessary to copy flags from the source node to the field nodes
when doing a field-by-field copy in block morphing. In fact, it can be a
pessimization in cases where the source node had NO_CSE set, which would
block constant propagation.

2 years agoRemove compiler warning suppression (#66234)
Aaron Robinson [Wed, 9 Mar 2022 00:57:12 +0000 (19:57 -0500)]
Remove compiler warning suppression (#66234)

* Remove 4996

* Remove 4701

* Remove 4611

* Remove 4610

* Remove 4510

* Remove 4267

* Remove 4267 - libunwind

2 years agoPartial revert of Maui Install Fix #65904 (#66221)
Parker Bibus [Tue, 8 Mar 2022 23:57:38 +0000 (17:57 -0600)]
Partial revert of Maui Install Fix #65904 (#66221)

* Prep for test build run.

* Replace the rollback file in the install call as the emscription line has been added to the downloaded json.

* Revert "Prep for test build run."

This reverts commit 2d7cca803e1cb6b79f83583b4dfa9846be3cf95e.

* Fix comment detailing Install Maui Workload setup.

2 years agoFix NonBacktracking quadratic behavior with deep loops (#66038)
Olli Saarikivi [Tue, 8 Mar 2022 21:30:46 +0000 (13:30 -0800)]
Fix NonBacktracking quadratic behavior with deep loops (#66038)

Derivative construction now accumulates a list of concatenands and
builds concatenations making up a part of a derivative just once.
Repeated concatenation to the right side in an interaction of the
derivation rule for concatenations and loops was causing quadratic
rebuilding of concatenations.

To implement this fix TransitionRegex is no longer used and instead both
normal and effectful derivative variants use a monolithic base function
that implements the rules for regex derivatives. This also gets rid of
the additional inefficiency of allocating TransitionRegex trees.

Both kinds of derivatives now support simulating backtracking behavior
and always use OrderedOr nodes to maintain transition ordering. The
second reverse phase of matching, however, needs to not use backtracking
simulation. A new DisableBacktrackingSimulation is used to signal this.

Other notable fixes:
The eager concept in derivatives is renamed to simulateBacktracking.
Put TransitionRegex and SymbolicNFA behind DEBUG.
Fix ApplyEffects calls to not create closures.
Fix OrderedOr to always deduplicate: when the new element was on the
 left deduplication was skipped.
Improve CaptureStart/End ToString to not look like parentheses and
 include the group number.

2 years ago[main] Update dependencies from dotnet/linker (#66331)
dotnet-maestro[bot] [Tue, 8 Mar 2022 19:34:24 +0000 (20:34 +0100)]
[main] Update dependencies from dotnet/linker (#66331)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoFix code coverage gaps in RegexGenerator and fix RegexCompiler bug (#66321)
Stephen Toub [Tue, 8 Mar 2022 19:24:48 +0000 (14:24 -0500)]
Fix code coverage gaps in RegexGenerator and fix RegexCompiler bug (#66321)

Noticed some easily-fillable gaps in code coverage for RegexGenerator.  In adding those tests, found and fixed a bug in RegexCompiler where we were incorrectly using `Call(s_spanIndexOfSpan)` instead of `Call(s_spanIndexOfAnySpan)`.

2 years agoFix instruction hex display for arm/arm64 when W^X is on (#66328)
Jakob Botsch Nielsen [Tue, 8 Mar 2022 18:41:32 +0000 (19:41 +0100)]
Fix instruction hex display for arm/arm64 when W^X is on (#66328)

Fix #65638

2 years agoMark EncryptionPolicy.NoEncryption and EncryptionPolicy.AllowNoEncryption as obsolete...
Radek Zikmund [Tue, 8 Mar 2022 17:44:17 +0000 (18:44 +0100)]
Mark EncryptionPolicy.NoEncryption and EncryptionPolicy.AllowNoEncryption as obsolete (#66292)

Fixes #65545

2 years agoAdd tests for `ijwhost` (#66308)
Elinor Fung [Tue, 8 Mar 2022 17:14:43 +0000 (09:14 -0800)]
Add tests for `ijwhost` (#66308)

2 years agouse the name of the header when throwing exception for invalid chars (#66250)
Badre BSAILA [Tue, 8 Mar 2022 16:15:18 +0000 (17:15 +0100)]
use the name of the header when throwing exception for invalid chars (#66250)

* use the name of the header when throwing exception for invalid chars

* delete VS code cleanups

* delete VS code cleanups 2

* add suggested changes 1

* delete VS code cleanups 3

* delete VS code cleanups 4

* delete VS code cleanups 5

2 years ago[Mono] Enable generating SIMD intrinsics for System.Numerics.Vector on Arm64 (#65486)
Fan Yang [Tue, 8 Mar 2022 15:20:59 +0000 (10:20 -0500)]
[Mono] Enable generating SIMD intrinsics for System.Numerics.Vector on Arm64 (#65486)

* Enable SIMD intrinsics for System.Numerics.Vector on Arm64

* Minor adjustment

* Use the correct op code for BitwiseAnd, BitwiseOr and Xor

* Check if vector element type is a primitive type or not

* Remove dead code and fix constant formet

* Add type checks for each method and refactor

* Remove extra condition check

* Loose the type check for vector creation methods

* Remove type checks for Create* functions

* Remove some of the type checks

2 years ago[mono][jit] Remove OP_FCONV_TO_I/OP_RCONV_TO_I from the back ends, convert them to...
Zoltan Varga [Tue, 8 Mar 2022 15:18:15 +0000 (10:18 -0500)]
[mono][jit] Remove OP_FCONV_TO_I/OP_RCONV_TO_I from the back ends, convert them to TO_I4/TO_I8 in the front end. (#66268)

2 years ago[mono][jit] Disable deopt in gsharedvt methods. (#66322)
Zoltan Varga [Tue, 8 Mar 2022 15:17:55 +0000 (10:17 -0500)]
[mono][jit] Disable deopt in gsharedvt methods. (#66322)

The deopt code can't handle the gsharedvt return value convention.

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

2 years ago[mono] Put WeakAttribute support under an ifdef (#66213)
Aleksey Kliger (λgeek) [Tue, 8 Mar 2022 14:08:40 +0000 (09:08 -0500)]
[mono] Put WeakAttribute support under an ifdef (#66213)

This code has been effectively dead in .NET 6 on all platforms since
System.WeakAttribute is not in CoreLib.

Not everything is removed:

- MonoClass:has_weak_fields bit is still present (and always 0).

- the AOT compiler still emits a (size 0) weak_field_indexes symbol (but the
  AOT runtime reader code is under an ifdef).  Likewise the AOT table
  definitions, etc are still there.  It seemed unnecessary to perturb the AOT
  format.

2 years agoAdd MultiModule test to issues.targets (#66289)
Michal Strehovský [Tue, 8 Mar 2022 05:51:58 +0000 (06:51 +0100)]
Add MultiModule test to issues.targets (#66289)

Hitting https://github.com/dotnet/runtime/issues/66191 in the CI.

2 years agoDisable failing bindhandleinvalid tests (#66303)
Bruce Forstall [Tue, 8 Mar 2022 01:43:56 +0000 (17:43 -0800)]
Disable failing bindhandleinvalid tests (#66303)

* Disable failing bindhandleinvalid tests

Tracking: https://github.com/dotnet/runtime/issues/66273

* Also disable bindhandlenull

Tracking: #66274

2 years agoAdding Count(ReadOnlySpan<char>) Overloads (#66026)
Jose Perez Rodriguez [Tue, 8 Mar 2022 01:39:21 +0000 (17:39 -0800)]
Adding Count(ReadOnlySpan<char>) Overloads (#66026)

* Adding Count(ReadOnlySpan<char>) Overloads

* Address PR Feedback

2 years agoFix ConditionalFactAttribute instances in ILPROJ tests (#66312)
Tomáš Rylek [Tue, 8 Mar 2022 01:22:08 +0000 (02:22 +0100)]
Fix ConditionalFactAttribute instances in ILPROJ tests (#66312)

I have found out that the change I originally made by changing
reference assembly for System.Type from System.Runtime to mscorlib
was incorrect - the Roslyn XUnit wrapper source generator started
failing with a nullref. I have experimentally identified that I can
fix this problem by explicitly specifying public key tokens of
the System.Runtime and Microsoft.DotNet.XUnitExtensions assembly
references and by adding a reference to the TestLibrary.

As I had to update System.Runtime references in all affected modules,
I also put back the System.Runtime assembly as the home for
System.Type as was the original state I copied from a C# compilation
disassembly, I changed them to mscorlib because I didn't know
I would need to specify the System.Runtime reference.

Thanks

Tomas

2 years agoAdd partial to the enclosing types when running the ConvertToGeneratedDllImport fixer...
Jeremy Koritzinsky [Tue, 8 Mar 2022 01:14:30 +0000 (17:14 -0800)]
Add partial to the enclosing types when running the ConvertToGeneratedDllImport fixer (#65452)

2 years agoTry additional nuget retries (#66306)
Bruce Forstall [Tue, 8 Mar 2022 00:33:13 +0000 (16:33 -0800)]
Try additional nuget retries (#66306)

After adding NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY, we still see
some benchmarks SPMI collection runs fail with the same nuget errors.

In case this is actually a potential workaround, try increasing the
number of retries and delay between them.

Also, print out the environment used so we can verify it, and see if
there are any other relevant variables set.

2 years agoJIT: Optimize movzx after setcc (#66245)
Egor Bogatov [Mon, 7 Mar 2022 23:22:14 +0000 (02:22 +0300)]
JIT: Optimize movzx after setcc (#66245)

2 years agoRevisiting nullable annotations on caching (#66215)
Maryam Ariyan [Mon, 7 Mar 2022 22:45:01 +0000 (17:45 -0500)]
Revisiting nullable annotations on caching (#66215)

* Revisiting nullable annotations on caching

* Fix up more nullablity mismatches

2 years ago[wasm] Rename `$(EmccInitialMemory)` to `$(EmccInitialHeapSize)` (#66233)
Ankit Jain [Mon, 7 Mar 2022 22:33:42 +0000 (17:33 -0500)]
[wasm] Rename `$(EmccInitialMemory)` to `$(EmccInitialHeapSize)` (#66233)

.. to better represent what it is.

2 years ago[wasm][aot] Disable `System.Text.RegularExpressions.Unit.Tests` (#66311)
Ankit Jain [Mon, 7 Mar 2022 22:08:49 +0000 (17:08 -0500)]
[wasm][aot] Disable `System.Text.RegularExpressions.Unit.Tests` (#66311)

Issue: https://github.com/dotnet/runtime/issues/66118

2 years agoFix compatibility with NTLM authentication to McAfee Web Gateway (#66305)
Filip Navara [Mon, 7 Mar 2022 22:00:02 +0000 (23:00 +0100)]
Fix compatibility with NTLM authentication to McAfee Web Gateway (#66305)

2 years agoFix missing StringSyntax attribute in Regex ref assembly (#66309)
Stephen Toub [Mon, 7 Mar 2022 21:53:12 +0000 (16:53 -0500)]
Fix missing StringSyntax attribute in Regex ref assembly (#66309)

2 years agoEnable RegexOptions.RightToLeft and lookbehinds in compiler / source generator (...
Stephen Toub [Mon, 7 Mar 2022 21:52:38 +0000 (16:52 -0500)]
Enable RegexOptions.RightToLeft and lookbehinds in compiler / source generator (#66280)

* Enable RegexOptions.RightToLeft and lookbehinds in compiler / source generator

For .NET 7 we rewrote RegexCompiler as we were writing the source generator, and in doing so we left out support for RegexOptions.RightToLeft as well as lookbehinds (which are implemented via RightToLeft).  This adds support for both.  I initially started incrementally adding in support for various constructs in lookbehinds, but from a testing perspective it made more sense to just add it all, as then all of the RightToLeft tests are used to validate the constructs that are also in lookbehinds.

* Address PR feedback

2 years agoUse runtime and targeting pack version of System.Diagnostics.DiagnosticSource in...
AraHaan [Mon, 7 Mar 2022 21:45:42 +0000 (16:45 -0500)]
Use runtime and targeting pack version of System.Diagnostics.DiagnosticSource in Microsoft.Extensions.Logging. (#66284)

* Use runtime and targeting pack version of System.Diagnostics.DiagnosticSource.

This removes the copy of System.Diagnostics.DiagnosticSource when using the Microsoft.Extensions.Logging package on .NET Core.

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years agoUse RegexGenerator in applicable tests (#66179)
Stephen A. Imhoff [Mon, 7 Mar 2022 21:04:10 +0000 (13:04 -0800)]
Use RegexGenerator in applicable tests (#66179)

2 years ago[Mono] Intrinsify Convert* for Vector{64, 128} on ARM64 (#65946)
Fan Yang [Mon, 7 Mar 2022 20:12:57 +0000 (15:12 -0500)]
[Mono] Intrinsify Convert* for Vector{64, 128} on ARM64 (#65946)

* Intrinsify Convert*

* Test - comment out my change

* Enable ConvertToDouble

* Enable ConvertToInt32 and ConvertToUInt32

* Enable ConvertToInt64 and ConvertToUInt64

* Disable ConvertToInt64 and ConvertToUInt64, but enable ConvertToSingle

* Remove the support for ConvertToInt64, ConvertToUInt64 and ConvertToSingle

2 years agoFix issues related to JsonSerializerOptions mutation and caching. (#66248)
Eirik Tsarpalis [Mon, 7 Mar 2022 19:44:14 +0000 (19:44 +0000)]
Fix issues related to JsonSerializerOptions mutation and caching. (#66248)

* Fix issues related to JsonSerializerOptions mutation and caching. (#65863)

* Fix issues related to JsonSerializerOptions mutation and caching.

* fix test style

* fix linker warning

* disable failing tests in netfx

2 years ago[main] Update dependencies from 9 repositories (#65843)
dotnet-maestro[bot] [Mon, 7 Mar 2022 19:10:18 +0000 (19:10 +0000)]
[main] Update dependencies from 9 repositories (#65843)

[main] Update dependencies from 9 repositories

 - Merge branch 'main' into darc-main-69c88284-a4b6-425e-834c-f89f194a9041

 - Merge branch 'main' into darc-main-69c88284-a4b6-425e-834c-f89f194a9041

 - Merge branch 'main' into darc-main-69c88284-a4b6-425e-834c-f89f194a9041

2 years agoFix a couple issues with GTF_GLOB_REF setting (#66247)
SingleAccretion [Mon, 7 Mar 2022 18:10:39 +0000 (21:10 +0300)]
Fix a couple issues with GTF_GLOB_REF setting (#66247)

Add it to INDs and BLKs off of exposed ADDRs in addition to OBJs.

Remove code from args morphing which was re-deriving the side effects
flags for an OBJ argument, it was:

 a) Unnecessary, as morph has already done all the work.
 b) Incorrect, as it lost GTF_GLOB_REF for OBJ(ADDR(LCL (AX)))-like trees.

2 years ago remove invalid System.IO.FileSystem.Watcher tests (#66296)
Adam Sitnik [Mon, 7 Mar 2022 17:39:04 +0000 (18:39 +0100)]
 remove invalid System.IO.FileSystem.Watcher tests (#66296)

2 years agoBackport docs fixes for Cbor (#66180)
Genevieve Warren [Mon, 7 Mar 2022 17:33:11 +0000 (09:33 -0800)]
Backport docs fixes for Cbor (#66180)

2 years agoAnnotating Native CoreLib library to be AOT friendly (#66112)
Lakshan Fernando [Mon, 7 Mar 2022 17:02:19 +0000 (09:02 -0800)]
Annotating Native CoreLib library to be AOT friendly (#66112)

* Annotating Native CoreLib to be AOT friendly

* change array attribute msg

* FB

* Update src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoFix clash between tentative method optimizations (#66145)
Michal Strehovský [Mon, 7 Mar 2022 16:49:50 +0000 (17:49 +0100)]
Fix clash between tentative method optimizations (#66145)

When we were in the situation of the newly added test, we would try to generate method body on the abstract class. Such method body is not actually reachable.

2 years agoFix workaround for static virtual methods (#66290)
Michal Strehovský [Mon, 7 Mar 2022 15:58:30 +0000 (16:58 +0100)]
Fix workaround for static virtual methods (#66290)

The workaround for reflection invoking static virtual methods wasn't working around well enough. Fixes #66028.

The repro case also hit a scanning failure due to scanner not scanning a throw helper. Those are more of asserts, so add them to the collection of throw helpers to ignore.

2 years agoMerikhamoyan vector intrinsics operators (#66002)
Meri Khamoyan [Mon, 7 Mar 2022 15:35:12 +0000 (19:35 +0400)]
Merikhamoyan vector intrinsics operators (#66002)

* Added addition and subtraction operator intrinsics

2 years agoDecommit region tails (#66008)
Peter Sollich [Mon, 7 Mar 2022 13:02:48 +0000 (14:02 +0100)]
Decommit region tails (#66008)

I observed that with gen 1 regions, we often get into the situation that gen 1 is much smaller per heap than a region. So it makes sense to decommit the tail end of the last region in an ephemeral generation guided by the budget for that generation.

To implement this, I reactivated decommit_target for regions and have decommit_step call decommit_ephemeral_segment_pages_step which in the regions case needs to synchronize with the allocator. This is done by taking the more space lock.

Note that with default settings, this decommitting logic will usually only apply to gen 1 because normally gen 0 is larger than a region. It can still happen for gen 0 though if gen 0 has pins and thus already has enough space to satisfy the budget. Then we will decommit the tail end of the last region in gen 0.

2 years agoCount `OBJ/BLK` as memory uses (#66135)
SingleAccretion [Mon, 7 Mar 2022 10:58:04 +0000 (13:58 +0300)]
Count `OBJ/BLK` as memory uses (#66135)

* Fix memory liveness for OBJ/BLK

We need to count OBJ/BLK as uses, otherwise SSA can
fail to insert a memory PHI where one is needed.

* Add a test

2 years agoDo not create small constants while morphing cascading addition (#66270)
SingleAccretion [Mon, 7 Mar 2022 09:54:35 +0000 (12:54 +0300)]
Do not create small constants while morphing cascading addition (#66270)

* Do not create small constants

* Add a test

2 years agoFix address exposure + fsub (#66253)
Egor Bogatov [Mon, 7 Mar 2022 08:53:34 +0000 (11:53 +0300)]
Fix address exposure + fsub (#66253)

2 years agoFix performance regression in SSL handshake (#66077)
Radek Zikmund [Mon, 7 Mar 2022 08:16:45 +0000 (09:16 +0100)]
Fix performance regression in SSL handshake (#66077)

2 years ago[main] Update dependencies from dotnet/linker (#66081)
dotnet-maestro[bot] [Mon, 7 Mar 2022 00:49:56 +0000 (01:49 +0100)]
[main] Update dependencies from dotnet/linker (#66081)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoAdd missing regex position check after BOL optimization (#66216)
Stephen Toub [Mon, 7 Mar 2022 00:13:14 +0000 (19:13 -0500)]
Add missing regex position check after BOL optimization (#66216)

* Add missing regex position check after BOL optimization

* Address PR feedback

2 years agoTry to remove "-" and "'" from HighCharTable (#66200)
Dennis Yemelyanov [Sun, 6 Mar 2022 22:40:24 +0000 (14:40 -0800)]
Try to remove "-" and "'" from HighCharTable (#66200)

2 years ago[crossgen2] Promote single byref aot. (#65682)
Sergey Andreenko [Sun, 6 Mar 2022 21:32:10 +0000 (16:32 -0500)]
[crossgen2] Promote single byref aot. (#65682)

* Rename `CORINFO_FLG_DONT_PROMOTE` to `CORINFO_FLG_DONT_DIG_FIELDS`.

* Support promotion of `struct{ 1 gcref; }` outside of version bubble.

2 years agoJIT: fix scalability issue in redundant branch optimizer (#66259)
Andy Ayers [Sun, 6 Mar 2022 16:27:35 +0000 (08:27 -0800)]
JIT: fix scalability issue in redundant branch optimizer (#66259)

In methods with long skinny dominator trees and lots of redundant branches
the jit can spend too much time trying to optimize the branches.

Place a limit on the number of redundant branches with matching VNs that
the jit will consider for a given branch.

Fixes #66067.

2 years agoJIT: add OSR patchpoint strategy, inhibit tail duplication (#66208)
Andy Ayers [Sun, 6 Mar 2022 16:26:43 +0000 (08:26 -0800)]
JIT: add OSR patchpoint strategy, inhibit tail duplication (#66208)

Two changes for OSR:
* add new strategies for placing patchpoints -- either at
  backedge sources (instead of targets) or adaptive. depending
  on number of backedges. Change default to adaptive, since this
  works better with the flow we see from C# `for` loops.
* inhibit tail duplication for OSR as it may end up interfering
  with loop recognition.

We may not be able to place patchpoints at sources, for various reasons;
if so we fall back to placing them at targets.

We also can't place patchpoints unless block entries are also stack empty
ponts. This means forgoing patchpoints in some IL cases..

2 years agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 164729...
dotnet bot [Sun, 6 Mar 2022 13:47:20 +0000 (05:47 -0800)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1647296 (#66130)

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1642379

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1642486

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1642664

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1643161

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1643830

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1644178

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1644565

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1644845

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1645065

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1645441

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1645652

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1645888

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1646089

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1646301

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1646622

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1646734

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1646905

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1647056

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1647296

2 years ago[mono] Remove SkipVerification support from the runtime (#66211)
Alexander Köplinger [Sun, 6 Mar 2022 13:44:33 +0000 (14:44 +0100)]
[mono] Remove SkipVerification support from the runtime (#66211)

CAS support was removed in .NET Core. This allows us removing a bunch of code that is unused, e.g. the dependency on libiconv.

2 years agoRemove unnecessary return (#66252)
Sajad Samiizadeh [Sun, 6 Mar 2022 00:59:26 +0000 (04:29 +0330)]
Remove unnecessary return (#66252)

2 years ago[mono][llvm] Fix crashes when methods fail LLVM compilation. (#65391)
Zoltan Varga [Sat, 5 Mar 2022 16:59:51 +0000 (11:59 -0500)]
[mono][llvm] Fix crashes when methods fail LLVM compilation. (#65391)

Calling LLVMDeleteBasicBlock () seems to cause crashes, so
call LLVMRemoveBasicBlockFromParent () instead.

2 years agoRevert "Fix issues related to JsonSerializerOptions mutation and caching. (#65863...
Jan Kotas [Sat, 5 Mar 2022 14:08:07 +0000 (06:08 -0800)]
Revert "Fix issues related to JsonSerializerOptions mutation and caching. (#65863)" (#66235)

This reverts commit 11b79618faf1023ba4ea26b4037f495f81070d79.

2 years agoReplace TargetFrameworks with TargetFramework where possible (#66198)
Jan Kotas [Sat, 5 Mar 2022 06:21:59 +0000 (22:21 -0800)]
Replace TargetFrameworks with TargetFramework where possible (#66198)

2 years agoAddress feedback on fabricbot config for area pods (#66137)
Jeff Handley [Sat, 5 Mar 2022 05:05:01 +0000 (21:05 -0800)]
Address feedback on fabricbot config for area pods (#66137)

Automatically remove the `untriaged` label when a triage action is performed. When an issue/PR is moved to another area, consider it done on the original board instead of removing it.

2 years agoReplace CngCommon hash with OneShotHashHelpers.
Kevin Jones [Sat, 5 Mar 2022 03:49:08 +0000 (22:49 -0500)]
Replace CngCommon hash with OneShotHashHelpers.

2 years agoRename classes in p/invoke generator to be `LibraryImport` (#66217)
Elinor Fung [Sat, 5 Mar 2022 03:42:33 +0000 (19:42 -0800)]
Rename classes in p/invoke generator to be `LibraryImport` (#66217)

2 years agoUse CMakeProjectReference instead of ProjectReference (#66202)
Aaron Robinson [Sat, 5 Mar 2022 03:40:27 +0000 (19:40 -0800)]
Use CMakeProjectReference instead of ProjectReference (#66202)

* Use CMakeProjectReference instead of ProjectReference

Changing this permits usage of "\runtime\dotnet.cmd build" as opposed
  to forcing users to use "\runtime\dotnet.cmd msbuild".