platform/upstream/dotnet/runtime.git
2 years agoRemove unused code (#70624)
Aaron Robinson [Sun, 12 Jun 2022 22:27:29 +0000 (15:27 -0700)]
Remove unused code (#70624)

* Remove unused AllowZeroAllocator and
DefaultAllocator.

* Remove static_assert_n.

* Remove the native Regex implementation and replace
with a minimal version from TPOP.

Add attribution in third party notices.

2 years agoOmit calls to CCCryptorFinal
Kevin Jones [Sun, 12 Jun 2022 21:34:12 +0000 (17:34 -0400)]
Omit calls to CCCryptorFinal

2 years agoForbid creating layout-less `TYP_STRUCT` `LCL_FLD` nodes (#70170)
SingleAccretion [Sun, 12 Jun 2022 19:55:55 +0000 (22:55 +0300)]
Forbid creating layout-less `TYP_STRUCT` `LCL_FLD` nodes (#70170)

* Fold ADD(ADDR(LCL_VAR), CONST) => ADDR(LCL_FLD)

* Add an assert for layout-less LCL_FLD

* Query the handle in "gtGetStructHandleIfPresent"

* Add layout checks to "Compare" and "gtHashValue"

2 years agodisable ClientOptions_TargetHostNull_OK on Android (#70619)
Tomas Weinfurt [Sun, 12 Jun 2022 17:56:07 +0000 (19:56 +0200)]
disable ClientOptions_TargetHostNull_OK on Android (#70619)

2 years agoFold System.Private.Reflection.Core into CoreLib (#70545)
Jan Kotas [Sun, 12 Jun 2022 16:03:56 +0000 (09:03 -0700)]
Fold System.Private.Reflection.Core into CoreLib (#70545)

2 years agoInvestigate helix error return (#70238)
Lakshan Fernando [Sun, 12 Jun 2022 07:25:20 +0000 (00:25 -0700)]
Investigate helix error return (#70238)

2 years agoUse ClrSafeInt everywhere and cleanup other same math declarations (#70197)
Huo Yaoyuan [Sat, 11 Jun 2022 21:26:28 +0000 (05:26 +0800)]
Use ClrSafeInt everywhere and cleanup other same math declarations (#70197)

* Replace safe math in util.hpp with ClrSafeInt

* Remove unused definitions in safeint.h

* Replace BSTR usage with ClrSafeInt

* Delete intsafe.h

2 years ago[NativeAOT] Better fix for nativeaot lock/typesystem reentrancy (#70605)
Vladimir Sadov [Sat, 11 Jun 2022 20:21:49 +0000 (13:21 -0700)]
[NativeAOT] Better fix for nativeaot lock/typesystem reentrancy (#70605)

* Better fix for nativeaot lock/typesystem reentrancy

* Turn list into a ring

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Update a comment

* CR feedback

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoARM64 - Always morph GT_MOD (#68885)
Will Smith [Sat, 11 Jun 2022 19:57:04 +0000 (12:57 -0700)]
ARM64 - Always morph GT_MOD (#68885)

2 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20220610.1 (#70612)
dotnet-maestro[bot] [Sat, 11 Jun 2022 17:42:26 +0000 (10:42 -0700)]
Update dependencies from https://github.com/dotnet/arcade build 20220610.1 (#70612)

Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22308.5 -> To Version 7.0.0-beta.22310.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoFix nullability annotation of `ILGenerator.BeginCatchBlock`. (#70615)
Theodore Tsirpanis [Sat, 11 Jun 2022 17:41:56 +0000 (20:41 +0300)]
Fix nullability annotation of `ILGenerator.BeginCatchBlock`. (#70615)

2 years agoSkip X.509 extension copies where possible
Kevin Jones [Sat, 11 Jun 2022 16:18:21 +0000 (12:18 -0400)]
Skip X.509 extension copies where possible

2 years agoUnpin locals (#70264)
Joni Aromaa [Sat, 11 Jun 2022 16:06:34 +0000 (19:06 +0300)]
Unpin locals (#70264)

Contributes to #40553

2 years agoRemove some more unnecessary pragma warning disables (#70583)
Stephen Toub [Sat, 11 Jun 2022 15:29:22 +0000 (11:29 -0400)]
Remove some more unnecessary pragma warning disables (#70583)

2 years agomake SslStream_UnifiedHello_Ok test conditional (#70472)
Tomas Weinfurt [Sat, 11 Jun 2022 10:28:56 +0000 (12:28 +0200)]
make SslStream_UnifiedHello_Ok test conditional (#70472)

2 years ago[mono] A few more PowerPC cleanups (#70576)
Alexander Köplinger [Sat, 11 Jun 2022 08:34:59 +0000 (10:34 +0200)]
[mono] A few more PowerPC cleanups (#70576)

Replace `__mono_ppc__` and `__mono_ppc64__` defines with the proper `TARGET_POWERPC` and `TARGET_POWERPC64` ones
Use `TARGET_POWERPC64` in a few places where it is more appropriate.

2 years agoPropagate c++ unhandled exception to previous handler (#70556)
Jan Vorlicek [Sat, 11 Jun 2022 04:32:32 +0000 (06:32 +0200)]
Propagate c++ unhandled exception to previous handler (#70556)

* Propagate c++ unhandled exception to previous handler

Currently runtime doesn't propagate c++ unhandled exceptions to a handler
registered by the std::set_terminate. That is problematic for custom
hosts that want e.g. to log such exceptions.

This change adds chaining unhandled C++ exception to the previously
registered handler.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoUse u8 in a few more places (#70568)
Stephen Toub [Sat, 11 Jun 2022 03:15:10 +0000 (23:15 -0400)]
Use u8 in a few more places (#70568)

2 years agoWindows/Arm64: Set flag for Atomics/Dp feature (#70600)
Kunal Pathak [Sat, 11 Jun 2022 02:09:20 +0000 (19:09 -0700)]
Windows/Arm64: Set flag for Atomics/Dp feature (#70600)

2 years agoCleanup idle rate limiters (#69677)
Brennan [Sat, 11 Jun 2022 00:05:35 +0000 (17:05 -0700)]
Cleanup idle rate limiters (#69677)

2 years agoDetect inlining accurately and skip generating precode fixups for inlines that do...
David Wrighton [Fri, 10 Jun 2022 23:16:41 +0000 (16:16 -0700)]
Detect inlining accurately and skip generating precode fixups for inlines that do not succeed (#70379)

- Fix reporting of nested inlining to be correct
  - In particular, if a doubly nested inline succeeds, but the method that called it didn't succeed its inline, do not report that the inner nested inline succeeded
- Fix reporting of precode fixups to only be the precode fixups needed during actual use
- fix SuperPMI detected JIT assertion around vector types

Also fixes #65814

2 years agoAdd support for parsing and working with CustomModifiers in field signatures and...
David Wrighton [Fri, 10 Jun 2022 23:14:44 +0000 (16:14 -0700)]
Add support for parsing and working with CustomModifiers in field signatures and make TypeSystemMetadataEmitter more flexible (#70593)

- Update TypeSystemMetadataEmitter to be able to generate a field signature given an appropriate array of EmbeddedSignatureData[]
- Add api to FieldDesc to allow the custom modifier data to be handled using the same scheme as custom modifier data on method signatures
- Adjust TypeSystemMetadataEmitter to be able to generate metadata not just for the Mibc emitter
  - The current implementation has some default behavior around creating metadata that is in the constructor. Break that out into helper functions so that other scenarios don't need to run that code.
  - Add an entrypoint for generating metadata for an arbitrary TypeSystemEntity
  - Add a feature to allow it the ResolutionScope of a non-nested type to be managed specially. This will be needed by #68919

2 years agoMono Code Guidelines (#70507)
Aleksey Kliger (λgeek) [Fri, 10 Jun 2022 21:37:39 +0000 (17:37 -0400)]
Mono Code Guidelines (#70507)

* Mono Code Guidelines

* markdownlint

* Add "Naming" and "public API" sections

* Add a section on assertions

* Fix sentence fragment; add threading design doc link

* Apply suggestions from code review

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years ago[Android] Fix failing LocalTzIsNotUtc test (#70485)
Steve Pfister [Fri, 10 Jun 2022 21:36:52 +0000 (17:36 -0400)]
[Android] Fix failing LocalTzIsNotUtc test (#70485)

Add a trait to control when the test executes as we don't have a good way to differentiate between Android emulators and devices.

Fixes #70482

2 years agoAvoid discarding upper bits when folding GT_SWITCH (#69986)
Jakob Botsch Nielsen [Fri, 10 Jun 2022 20:56:02 +0000 (22:56 +0200)]
Avoid discarding upper bits when folding GT_SWITCH (#69986)

2 years agoMove a morph opt to post-order (#69984)
Jakob Botsch Nielsen [Fri, 10 Jun 2022 20:31:59 +0000 (22:31 +0200)]
Move a morph opt to post-order (#69984)

When changing the shape of child nodes in pre-order we must ensure we properly morph
potential promoted/demoted child nodes. Normally this happens inside
fgMorphTree which does it for child nodes, but this specific transform was not
calling fgMorphTree on the parent tree after changing the shape of child nodes.

The simplest fix is just to move the optimization to post-order which catches more cases and does not need to bother dealing with this.

Fix #61074

2 years agoRemove Android crypto internals from System.Security.Cryptography.X509Certificates...
Alexander Köplinger [Fri, 10 Jun 2022 17:01:18 +0000 (19:01 +0200)]
Remove Android crypto internals from System.Security.Cryptography.X509Certificates tests (#70554)

* Remove Android crypto internals from System.Security.Cryptography.X509Certificates tests

The `Interop.AndroidCrypto.X509ChainSupportsRevocationOptions` internally just checks that a certain Java class exists, we can assume it is always there on Android API 24+.
This allows us to remove a bunch of internal crypto code from the tests.

* Remove unused managed API

2 years agoUpdate dependencies from https://github.com/dotnet/xharness build 20220610.1 (#70566)
Alexander Köplinger [Fri, 10 Jun 2022 17:00:22 +0000 (19:00 +0200)]
Update dependencies from https://github.com/dotnet/xharness build 20220610.1 (#70566)

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

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoRemove unnecessary CS8601 suppression from SSPIHandleCache.cs (#70565)
Stephen Toub [Fri, 10 Jun 2022 16:55:28 +0000 (12:55 -0400)]
Remove unnecessary CS8601 suppression from SSPIHandleCache.cs (#70565)

2 years agoUse Stream.CopyToAsync in OCSP download on Linux (#70567)
Stephen Toub [Fri, 10 Jun 2022 16:55:14 +0000 (12:55 -0400)]
Use Stream.CopyToAsync in OCSP download on Linux (#70567)

2 years ago[mono] add support to build for ppc64le architecture (#68802)
Sapana-Khemkar [Fri, 10 Jun 2022 16:04:28 +0000 (21:34 +0530)]
[mono] add support to build for ppc64le architecture  (#68802)

* mono add support to build for ppc64le

* fix build failures in mini-ppc.c

* handle unhandled exception ids

* donot use std/ld inst when address is not div by 4.
This adds fix for test failure in
System.Buffers.Binary.Tests.BinaryReaderUnitTestsw.ReadingStructFieldByFieldOrReadAndReverseEndianness

* Fixed failing test cases from System.Numerics.Vectors.Tests

* change objcopy name for ppc64le from ppc64le-linux-gnu-objcopy to powerpcle-linux-gnu-objcopy

2 years agoMakes the following changes: (#70430)
Eirik Tsarpalis [Fri, 10 Jun 2022 15:47:30 +0000 (18:47 +0300)]
Makes the following changes: (#70430)

* Change DeserializeAsyncEnumerable so that reading from the underlying stream does not wait until the underlying buffer is full.
* Encapsulate the buffer management logic behind ReadBufferState.
* Avoid allocating a new JsonTypeInfo instance on every IAsyncEnumerator initialization.

2 years agoUpdating the various generic math functions to have default implementations (#70445)
Tanner Gooding [Fri, 10 Jun 2022 14:31:43 +0000 (07:31 -0700)]
Updating the various generic math functions to have default implementations (#70445)

* Updating the various generic math functions to have default implementations

* Ensure GenericMathHelpers keep the right constraints

2 years agoFix async handle leak when sync RandomAccess read/write on async handle fails (#69956)
Stephen Toub [Fri, 10 Jun 2022 14:17:24 +0000 (10:17 -0400)]
Fix async handle leak when sync RandomAccess read/write on async handle fails (#69956)

* Fix async handle leak when sync RandomAccess read/write on async handle fails

* Use UnsafeAllocateNativeOverlapped in GetNativeOverlappedForAsyncHandle

This isn't invoking user code and it's entirely for synchronous operations; there's no reason it needs to capture ExecutionContext.

2 years agoFix typo (clr.dll -> mscordacwks.dll) (#70550)
Jan Krivanek [Fri, 10 Jun 2022 13:53:10 +0000 (15:53 +0200)]
Fix typo (clr.dll -> mscordacwks.dll) (#70550)

2 years ago[LoongArch64] Fixed the compiling error for #69041. (#70544)
Qiao Pengcheng [Fri, 10 Jun 2022 13:52:53 +0000 (21:52 +0800)]
[LoongArch64] Fixed the compiling error for #69041. (#70544)

2 years agoIncrease timeout for ARM64 testing (#70551)
Michal Strehovský [Fri, 10 Jun 2022 13:35:16 +0000 (22:35 +0900)]
Increase timeout for ARM64 testing (#70551)

We're seeing Windows ARM64 workitems being stuck in the Helix queue for more than 90 minutes.

2 years agoEnable IDE0029 (Use coalesce expression) (#70506)
Stephen Toub [Fri, 10 Jun 2022 13:33:19 +0000 (09:33 -0400)]
Enable IDE0029 (Use coalesce expression) (#70506)

* Enable IDE0029 (Use coalesce expression)

* Address PR feedback and a few missed cases

2 years agoMove analyzer and fixer tests into FunctionalTests project (#70406)
Jose Perez Rodriguez [Fri, 10 Jun 2022 13:32:17 +0000 (06:32 -0700)]
Move analyzer and fixer tests into FunctionalTests project (#70406)

* Move analyzer and fixer tests into FunctionalTests project

* Don't use the live ref pack references infrastructure

2 years agoJIT: Do not propagate some constants (#70378)
Egor Bogatov [Fri, 10 Jun 2022 11:27:32 +0000 (04:27 -0700)]
JIT: Do not propagate some constants (#70378)

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
2 years agoAdd disasm comments for field data addresses and code addresses (#70437)
Jakob Botsch Nielsen [Fri, 10 Jun 2022 10:58:37 +0000 (12:58 +0200)]
Add disasm comments for field data addresses and code addresses (#70437)

* Fix impTokenToHandle when importing parent

This was mistakenly creating a handle for the parent (always a class)
but specifying the handle type of the child (e.g. constructor method
handle).

* Do not lie about critical sections being method handles

2 years agoAdd markdown Readme for System.Text.Json (#69015)
MSDN.WhiteKnight [Fri, 10 Jun 2022 10:57:00 +0000 (15:57 +0500)]
Add markdown Readme for System.Text.Json (#69015)

* Update project

* Create readme.md

* Fix typo

* Update src/libraries/System.Text.Json/src/readme.md

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
* Delete readme.md

* Rename readme file

* Add more docs links

* Fix link

* Update PackageDescription

* Apply suggestions from code review

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
* Remove mentions of exact target framework versions

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2 years agoEnable IDE0036 (Modifers are not ordered) (#70502)
Stephen Toub [Fri, 10 Jun 2022 10:45:48 +0000 (06:45 -0400)]
Enable IDE0036 (Modifers are not ordered) (#70502)

2 years agoRemove params byte[] from System.Net.Mail (#70513)
Stephen Toub [Fri, 10 Jun 2022 10:45:21 +0000 (06:45 -0400)]
Remove params byte[] from System.Net.Mail (#70513)

2 years agoRemove unnecessary CA1052 suppressions (#70512)
Stephen Toub [Fri, 10 Jun 2022 10:07:54 +0000 (06:07 -0400)]
Remove unnecessary CA1052 suppressions (#70512)

The analyzer bug was fixed.

2 years agoAvoid calling into resource manager from the type loader (#70538)
Michal Strehovský [Fri, 10 Jun 2022 07:56:49 +0000 (16:56 +0900)]
Avoid calling into resource manager from the type loader (#70538)

Sample stack:

```
  System.Runtime.Tests.exe!S_P_CoreLib_System_SR__GetResourceString() Line 29 Unknown
  System.Runtime.Tests.exe!S_P_CoreLib_System_Exception__get_Message() Line 57 Unknown
  System.Runtime.Tests.exe!S_P_CoreLib_System_Exception__AppendExceptionStackFrame() Line 134 Unknown
  System.Runtime.Tests.exe!S_P_CoreLib_System_Runtime_EH__AppendExceptionStackFrameViaClasslib() Line 234 Unknown
  System.Runtime.Tests.exe!S_P_CoreLib_System_Runtime_EH__UpdateStackTrace() Line 735 Unknown
  System.Runtime.Tests.exe!S_P_CoreLib_System_Runtime_EH__DispatchEx() Line 630 Unknown
  System.Runtime.Tests.exe!S_P_CoreLib_System_Runtime_EH__RhThrowEx() Line 571 Unknown
  System.Runtime.Tests.exe!RhpThrowEx�() Unknown
  System.Runtime.Tests.exe!S_P_TypeLoader_Internal_TypeSystem_TypeDesc__ComputeTemplate_0() Line 241 Unknown
  System.Runtime.Tests.exe!S_P_TypeLoader_Internal_TypeSystem_TypeDesc__ComputeTemplate() Line 233 Unknown
```

2 years ago[NativeAOT] prevent reentering CreateThreadLocalContentionCountObject (#70456)
Vladimir Sadov [Fri, 10 Jun 2022 05:33:35 +0000 (22:33 -0700)]
[NativeAOT] prevent reentering CreateThreadLocalContentionCountObject (#70456)

* prevent reentering CreateThreadLocalContentionCountObject

* do not call into type system on lock contentions

2 years ago[wasm] Add infrastructure for building WebWorkers (#70220)
Aleksey Kliger (λgeek) [Fri, 10 Jun 2022 04:22:27 +0000 (00:22 -0400)]
[wasm] Add infrastructure for building WebWorkers (#70220)

* [wasm] Add infrastructure for building WebWorkers

- Modify the rollup.config.js script to look for webworkers and to
  roll them up into IIFE js files in the ${nativeBinDir}/src artifacts
  directory
   - A "webworker" is any file in `src/mono/wasm/runtime/workers/` that
looks like `dotnet-{workerName}-worker.ts` or `.js`.  It can also
include other files (ideally by defining them in files in
subdirectories for that worker
`src/mono/wasm/runtime/workers/dotnet-{workerName}-worker/utility.ts`)
   - Other changes still have to be done manually in wasm.proj, and
   elsewhere in order to place the bundled JS file in the right place.

- Adds a tsconfig.json for the workers to typecheck using the
DedicatedWorkerGlobalScope and without the DOM globals (`window`, etc)

- This doesn't convert dotnet-crypto-worker.js into TypeScript, but it
does turn on TypeScript checking using a JSDoc comment.
  To convert that file to typescript:
  1. rename `workers/dotnet-crypto-worker.js` to
  `workers/dotnet-crypto-worker.ts`
  2. replace uses of `var` by `let` or `const`
  3. add `:any` in various places.

* use fast-glob instead of fs.readdir

* add fast-glob to devDependencies

2 years ago[mono][wasm] Add a 'wasm-gc-safepoints' option to enable the generation of GC safe...
Zoltan Varga [Fri, 10 Jun 2022 01:39:03 +0000 (21:39 -0400)]
[mono][wasm] Add a 'wasm-gc-safepoints' option to enable the generation of GC safe points in AOTed code on WASM. (#70520)

2 years ago[wasm][nodejs] Ensure that stdout/stderr have been flushed out before exiting (#70416)
Ankit Jain [Fri, 10 Jun 2022 01:09:07 +0000 (21:09 -0400)]
[wasm][nodejs] Ensure that stdout/stderr have been flushed out before exiting (#70416)

When the results xml is large, and we are writing the base64
representation in one line, `node` can exit before all the output gets
flushed out. This results in xharness getting an incomplete
`STARTRESULTXML <len> <base64> ... ` with missing `ENDRESULTXML`, thus
no `testResults.xml` is generated.

This can be seen in the case of `Microsoft.Extensions.Primitives.Tests`
which has xml ~140KB, and `System.Memory.Tests` which has a xml ~13MB.

So, wait for the two streams to be flushed out, with a timeout of 3secs.

- use the `drain` event only if `stream.write('')` returns `false`
* Address review feedback @kg, @maraf

2 years agoAdd basic testing infrastructure in NativeAOT (port from dotnet/linker) (#70408)
Tlakaelel Axayakatl Ceja [Fri, 10 Jun 2022 00:07:05 +0000 (17:07 -0700)]
Add basic testing infrastructure in NativeAOT (port from dotnet/linker) (#70408)

Add basic testing infrastructure in NativeAOT (port from dotnet/linker)

- Port the Mono.Linker.Tests* projects from dotnet/linker
- Add the new projects to .editorconfig so they remain under the dotnet/linker format instead of dotnet/runtime
- clr.toolstests subset now runs the Mono.Linker.Tests infrastructure
- Make DisplayNameHelpers a public class so it can be used by the test infrastructure
- Add a couple of simple test cases (Dataflow and Requires) along with a Repro test, just like the repro project the repro test serves prototyping purposes
- Adds ProducedBy.NativeAOT to be able to represent differences between dotnet/linker and NativeAOT (either because of a bug or because NativeAOT correctly produces additional warnings)
- Use MSBuild properties instead of trying to figure out with linker paths

2 years agoUpdate analyzer version and fix new findings (#70157)
Buyaa Namnan [Thu, 9 Jun 2022 22:25:37 +0000 (15:25 -0700)]
Update analyzer version and fix new findings (#70157)

2 years agoUpdate disabled tests details with newly created issues (#70493)
Ivan Povazan [Thu, 9 Jun 2022 22:09:41 +0000 (00:09 +0200)]
Update disabled tests details with newly created issues (#70493)

2 years agoMerge pull request #70401 from dotnet/darc-main-fe02c49f-0b42-470f-be36-18cf3ef8aacb
Andy Gocke [Thu, 9 Jun 2022 22:05:30 +0000 (15:05 -0700)]
Merge pull request #70401 from dotnet/darc-main-fe02c49f-0b42-470f-be36-18cf3ef8aacb

[main] Update dependencies from dotnet/linker

2 years agoSet `UnusedValue` correctly for the operands of `ARR_ADDR`/`BOX` (#70498)
SingleAccretion [Thu, 9 Jun 2022 21:21:38 +0000 (00:21 +0300)]
Set `UnusedValue` correctly for the operands of `ARR_ADDR`/`BOX` (#70498)

* Add a test

* Fix the issue

2 years agoModify thread pool thread counting to be a bit more defensive (#70478)
Koundinya Veluri [Thu, 9 Jun 2022 21:20:22 +0000 (14:20 -0700)]
Modify thread pool thread counting to be a bit more defensive (#70478)

* Modify thread pool thread counting to be a bit more defensive

- An unexpected underflow in one or more thread counts can lead to a large number of threads to be created continually
- Prevented underflows in changes to thread counts, such that following an unexpected underflow, subsequent paired increments and decrements would avoid repeating the underflow
- Verified by creating an unexpected underflow in the debugger

2 years agoModify tests to distinguish between emit- and interpreted-based invoke (#70114)
Steve Harter [Thu, 9 Jun 2022 20:45:24 +0000 (15:45 -0500)]
Modify tests to distinguish between emit- and interpreted-based invoke (#70114)

2 years agoEnable IDE0110 (Remove unnecessary discard) (#70500)
Stephen Toub [Thu, 9 Jun 2022 20:09:33 +0000 (16:09 -0400)]
Enable IDE0110 (Remove unnecessary discard) (#70500)

2 years ago[wasm] Fix passing `shouldContinueOnError` through for the library tests (#70494)
Ankit Jain [Thu, 9 Jun 2022 19:18:42 +0000 (15:18 -0400)]
[wasm] Fix passing `shouldContinueOnError` through for the library tests (#70494)

The new `Threading*` CI jobs on `runtime-wasm` use `shouldContinueOnError: false` because the tests are known to be unstable right now. But they were not getting correctly forwarded to the base templates.

2 years agoSupport immutable types with configuration binding (#67258)
Steve Dunn [Thu, 9 Jun 2022 19:14:03 +0000 (20:14 +0100)]
Support immutable types with configuration binding (#67258)

Merging. Thanks @SteveDunn for your contribution.

2 years ago[main] Update dependencies from dotnet/arcade (#69643)
dotnet-maestro[bot] [Thu, 9 Jun 2022 18:55:29 +0000 (20:55 +0200)]
[main] Update dependencies from dotnet/arcade (#69643)

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

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.22255.2 -> To Version 2.5.1-beta.22269.3

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

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.22255.2 -> To Version 2.5.1-beta.22273.1

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

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.22255.2 -> To Version 2.5.1-beta.22274.3

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

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.22255.2 -> To Version 2.5.1-beta.22274.7

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

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.22255.2 -> To Version 2.5.1-beta.22275.1

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

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.22255.2 -> To Version 2.5.1-beta.22275.2

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

Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22255.2 -> To Version 7.0.0-beta.22276.1

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

Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22255.2 -> To Version 7.0.0-beta.22280.2

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

Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22255.2 -> To Version 7.0.0-beta.22281.1

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

Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22255.2 -> To Version 7.0.0-beta.22301.2

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

Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22255.2 -> To Version 7.0.0-beta.22306.1

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

Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22255.2 -> To Version 7.0.0-beta.22306.2

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

Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22255.2 -> To Version 7.0.0-beta.22308.5

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Premek Vysoky <premek.vysoky@microsoft.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
2 years agoManually skip IL2118
Andy Gocke [Thu, 9 Jun 2022 18:28:23 +0000 (11:28 -0700)]
Manually skip IL2118

2 years agoFix Crossgen2 PDB generator (#70407)
Tomáš Rylek [Thu, 9 Jun 2022 18:06:07 +0000 (20:06 +0200)]
Fix Crossgen2 PDB generator (#70407)

* Fix Crossgen2 PDB generator

During my perf investigation work I have found out that PDB emitter
in Crossgen2 is broken. I tracked this down to the change

https://github.com/dotnet/runtime/commit/fdf6485c800ec580656d7491795e10881d493afb#diff-24e48862e3b82f52e7fa04f22700b1c976a012bfeb08a246406f4e5ec579699b

that caused two behavioral changes in the PDB emitter:

1) The logic around QueryPDBNameEx got refactored to use a char[]
instead of a StringBuilder and that silently caused _pdbFilePath
to be set to the string "System.Char[]" instead of the actual path
(cf PdbWriter.cs#221 in the quoted commit).

2) The COM wrapper refactoring ended up bumping the refcount
on the _ngenWriter by one so that it never got actually closed
and properly flushed; due to this the resulting PDB was invalid.

Thanks

Tomas

2 years agoJIT: Unspecialize handle types after arithmetic ops in VN (#70452)
Jakob Botsch Nielsen [Thu, 9 Jun 2022 17:37:34 +0000 (19:37 +0200)]
JIT: Unspecialize handle types after arithmetic ops in VN (#70452)

VN was retaining the precise handle types when applying arithmetic
operations to handles. This meant that we could not rely on handles of
types like GTF_ICON_METHOD_HDL actually containing an embedded method
handle after constant propagation.

This change generalizes the handle type to GTF_ICON_CONST_PTR or
GTF_ICON_GLOBAL_PTR whenever VN does anything that semantically
"unassociates" the icon from the specialized handle type.

2 years ago[wasm] fix test failing when trimming
Ankit Jain [Thu, 9 Jun 2022 17:29:41 +0000 (17:29 +0000)]
[wasm] fix test failing when trimming

```
[06:37:05] fail: [FAIL] System.Diagnostics.Tests.StopwatchTests.DebuggerAttributesValid
[06:37:05] info: System.InvalidOperationException : Expected one DebuggerDisplayAttribute on System.Diagnostics.Stopwatch.
[06:37:05] info:    at System.Diagnostics.DebuggerAttributes.ValidateDebuggerDisplayReferences(Object obj)
[06:37:05] info:    at System.Diagnostics.Tests.StopwatchTests.DebuggerAttributesValid()
[06:37:05] info:    at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
```

Fixed by preserving the `DebuggerDisplayAttribute`.

2 years ago[wasm] Disable all trim warnings for tests, when using
Ankit Jain [Thu, 9 Jun 2022 16:35:10 +0000 (16:35 +0000)]
[wasm] Disable all trim warnings for tests, when using

.. `EnableAggressiveTrimming=true`, since the tests are not expected to
be trim-safe.

Based on @vitek-karas' suggestion.

2 years agoEnable nullable for Microsoft.Bcl.AsyncInterfaces (#70454)
Stephen Toub [Thu, 9 Jun 2022 14:26:30 +0000 (10:26 -0400)]
Enable nullable for Microsoft.Bcl.AsyncInterfaces (#70454)

* Enable nullable for Microsoft.Bcl.AsyncInterfaces

* Apply suggestions from code review

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years agoAdded tests for static DIM. (#70138)
Ilona Tomkowicz [Thu, 9 Jun 2022 14:09:02 +0000 (16:09 +0200)]
Added tests for static DIM. (#70138)

2 years agoDisable UnixDomainSocketTest.FilePathEquality test on tvOS and iOS (#70471)
Radek Zikmund [Thu, 9 Jun 2022 13:48:04 +0000 (15:48 +0200)]
Disable UnixDomainSocketTest.FilePathEquality test on tvOS and iOS (#70471)

2 years agoDispose algorithm for linux (#70458)
Kevin Jones [Thu, 9 Jun 2022 13:46:52 +0000 (09:46 -0400)]
Dispose algorithm for linux (#70458)

2 years agoremove extra GC.SuppressFinalize from SslStream (#70467)
Tomas Weinfurt [Thu, 9 Jun 2022 13:45:52 +0000 (15:45 +0200)]
remove extra GC.SuppressFinalize from SslStream (#70467)

2 years ago[mono][llvm] Make calls from the cold cconv wrappers through the PLT. (#70449)
Zoltan Varga [Thu, 9 Jun 2022 09:37:05 +0000 (05:37 -0400)]
[mono][llvm] Make calls from the cold cconv wrappers through the PLT. (#70449)

Some of the calls go through the trampoline infrastructure, which
cannot patch indirect calls made through GOT slots, causing crashes
in the MONO_ARCH_CODE_EXEC_ONLY case.

2 years agoAdd RUC
Andy Gocke [Thu, 9 Jun 2022 04:59:33 +0000 (21:59 -0700)]
Add RUC

2 years agoRemove SAFEARRAY APIs from PAL (#70462)
Aaron Robinson [Thu, 9 Jun 2022 04:58:43 +0000 (21:58 -0700)]
Remove SAFEARRAY APIs from PAL (#70462)

* Remove SAFEARRAY APIs from pal

2 years agoEnable IDE0074 (Use compound assignment) (#70402)
Stephen Toub [Thu, 9 Jun 2022 04:23:35 +0000 (00:23 -0400)]
Enable IDE0074 (Use compound assignment) (#70402)

2 years agoRemove <Nullable>disable/annotations</Nullable> from test projects (#70455)
Stephen Toub [Thu, 9 Jun 2022 02:42:19 +0000 (22:42 -0400)]
Remove <Nullable>disable/annotations</Nullable> from test projects (#70455)

2 years agoAdd using
Sven Boemer [Thu, 9 Jun 2022 00:39:48 +0000 (17:39 -0700)]
Add using

2 years ago[NativeAOT] Asynchronous thread suspension at GC safe points on Windows (#70316)
Vladimir Sadov [Thu, 9 Jun 2022 00:28:12 +0000 (17:28 -0700)]
[NativeAOT] Asynchronous thread suspension at GC safe points on Windows (#70316)

* simple case works

* FEATURE_SUSPEND_REDIRECTION

* AVX support

* refactor

* no need for asm

* ARM64

* stub `IsSafePoint` on Unix

* revert unnecessary changes to RhpGcPoll2

* no copy of redirect context

* Specialcase active frames in EnumGcRefs

* remove bogus assert.

2 years agoBump intellisense version to Preview4 (#70459)
Carlos Sanchez [Thu, 9 Jun 2022 00:17:29 +0000 (17:17 -0700)]
Bump intellisense version to Preview4 (#70459)

2 years agoSuppress trim warnings in tests
Sven Boemer [Thu, 9 Jun 2022 00:08:25 +0000 (17:08 -0700)]
Suppress trim warnings in tests

2 years ago[mono][jit] Fix an assertion on x86+android. (#70451)
Zoltan Varga [Thu, 9 Jun 2022 00:02:59 +0000 (20:02 -0400)]
[mono][jit] Fix an assertion on x86+android. (#70451)

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

2 years agoJIT: Handle enums in box-unbox optimization
Egor Bogatov [Wed, 8 Jun 2022 22:44:50 +0000 (00:44 +0200)]
JIT: Handle enums in box-unbox optimization

2 years agoRemove the pid argument on Windows createdump only take dumps of the parent process...
Mike McLaughlin [Wed, 8 Jun 2022 22:34:21 +0000 (15:34 -0700)]
Remove the pid argument on Windows createdump only take dumps of the parent process (#68877)

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

2 years agoFix unit test example (#70457)
Filip Navara [Wed, 8 Jun 2022 21:59:38 +0000 (23:59 +0200)]
Fix unit test example (#70457)

2 years agoGuard COM exception marshaling under FEATURE_COMINTEROP (#70431)
Huo Yaoyuan [Wed, 8 Jun 2022 21:58:11 +0000 (05:58 +0800)]
Guard COM exception marshaling under FEATURE_COMINTEROP (#70431)

* Guard FillVariant under FEATURE_COMINTEROP

* Guard COM exception information under FEATURE_COMINTEROP

* Remove TypeNameBuilder::ToString(BSTR)

* Remove the whole EECOMException type when COM interop is disabled

* Guard more ExceptionData usage under FEATURE_COMINTEROP

* Guard BSTRHolder under FEATURE_COMINTEROP

* Remove Unix BSTR simulation in palrt

* Add guard to COMException::GetMessage

2 years agoRemove some unnecessary regex NonBacktracking code (#70364)
Stephen Toub [Wed, 8 Jun 2022 21:52:43 +0000 (17:52 -0400)]
Remove some unnecessary regex NonBacktracking code (#70364)

* Remove some unnecessary regex NonBacktracking code

Move some debug-only code to #if DEBUG, remove other dead code, and clean up a few things that are unnecessary.  Also add a few tests to fill out some code coverage results, and address some style-related comments from a recently merged PR.

* Address PR feedback

* Fix non-deterministic threading-related failures in regex tests

If the wrong tests run concurrently, they can end up seeing a changed NFA safe limit from another test.

2 years agoIncrease precision and safety of the NonVersionableAttribute (#70327)
David Wrighton [Wed, 8 Jun 2022 20:28:23 +0000 (13:28 -0700)]
Increase precision and safety of the NonVersionableAttribute (#70327)

* Increase precision and safety of the NonVersionableAttribute
- NonVersionable now only unconditionally affects whether or not the IL is reported as inlined in the inlining data
- Primitive types are now implicitly considered to be NonVersionable
- Classes defined in CoreLib may now be considered to be NonVersionable
  - Classes now marked are String, RawData, and RawArrayData, which are all tied into intrinsics in crossgen2
- NFloat is now marked as NonVersionable so that some of its methods may actually be treated as NonVersionable
- There is now an additional predicate that the IL within the NonVersionable method must satisfy a series of tests to ensure that it can safely be inlined without adding additional tokens for the logic to depend on. See below for the details of the predicate

Collectively these changes make it so that even if we change our inlining rules, the NonVersionable marked methods will successfully pass through Crossgen, without generating requiring tokens from their original modules to be present in the final image.

The rules are:
                // 1. ldfld, ldflda, and stfld to instance fields of NonVersionable structs and NonVersionable classes
                // 2. cpobj, initobj, ldobj, stobj, ldelem, ldelema or sizeof, to NonVersionable structures, signature variables, pointers, function pointers, byrefs, classes, or arrays
                // 3. stelem, to NonVersionable structures
                // In addition, the method must not have any EH.
                // The method may only have locals which are NonVersionable structures, or classes

* Address code review feedback

2 years ago[wasm] Add legs to build wasm with internal threads only and full threading enabled...
Steve Pfister [Wed, 8 Jun 2022 19:50:13 +0000 (15:50 -0400)]
[wasm] Add legs to build wasm with internal threads only and full threading enabled (#68787)

This change adds two build-only lanes to `runtime` and two full build+test lanes to `runtime-wasm` that builds wasm with internal threads only (`WasmEnablePerfTracing`) and full threading (`WasmEnableThreads`).

The `runtime-wasm` additions can only be manually triggered at this time.

Co-authored-by: Aleksey Kliger (λgeek) <alklig@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoRemove old macOS compatibility code for RSA decryption
Kevin Jones [Wed, 8 Jun 2022 18:48:31 +0000 (14:48 -0400)]
Remove old macOS compatibility code for RSA decryption

2 years agoUpdate dependencies from https://github.com/dotnet/linker build 20220608.1
dotnet-maestro[bot] [Wed, 8 Jun 2022 18:33:33 +0000 (18:33 +0000)]
Update dependencies from https://github.com/dotnet/linker build 20220608.1

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22306.1 -> To Version 7.0.100-1.22308.1

2 years agoConvert assert to exception for loading native libraries (#70319)
Aaron Robinson [Wed, 8 Jun 2022 17:47:42 +0000 (10:47 -0700)]
Convert assert to exception for loading native libraries (#70319)

* Convert incorrect assert for loading relative paths to native libraries

* Reenable PMI running on InteropServices tests.

2 years agoAvoid unnecessary normalization for GT_RET_EXPR (#70340)
Jakob Botsch Nielsen [Wed, 8 Jun 2022 17:29:55 +0000 (19:29 +0200)]
Avoid unnecessary normalization for GT_RET_EXPR (#70340)

We can use type info from GT_RET_EXPR nodes when deciding whether we
need to normalize on a return.

Fix #70334

We could also consider typing these GT_RET_EXPR nodes with the actual
type of the call, though I am unsure if we want to introduce more
small-typed nodes.

2 years agoDon't call RuntimeHelper.Equals in Object.Equals (#70420)
Huo Yaoyuan [Wed, 8 Jun 2022 17:16:04 +0000 (01:16 +0800)]
Don't call RuntimeHelper.Equals in Object.Equals (#70420)

* Don't call RuntimeHelper.Equals in Object.Equals

* Update src/libraries/System.Private.CoreLib/src/System/Object.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoInclude `include` folder in runtime pack on all Mono platforms (#69719)
Jo Shields [Wed, 8 Jun 2022 17:09:59 +0000 (13:09 -0400)]
Include `include` folder in runtime pack on all Mono platforms (#69719)

Closes: #46461

2 years agoDelete a zero-diff quirk and update `INDEX`-related comments (#70398)
SingleAccretion [Wed, 8 Jun 2022 16:26:01 +0000 (19:26 +0300)]
Delete a zero-diff quirk and update `INDEX`-related comments (#70398)

* Delete a zero-diff quirk

* Also update some comments

Removing GT_INDEX/ADDR(IND) references.

2 years agoRemove ActiveIssue on OSVersion_ValidVersion_OSX (#70367)
Eric Erhardt [Wed, 8 Jun 2022 16:19:04 +0000 (11:19 -0500)]
Remove ActiveIssue on OSVersion_ValidVersion_OSX (#70367)

* Remove ActiveIssue on OSVersion_ValidVersion_OSX

This test was fixed to work correctly on the latest macOS versions in https://github.com/dotnet/runtime/pull/64565. The test can now be re-enabled.

Fix #49106

* Verify the Minor version as well, since it is no longer being verified by the RID.

2 years agoMark IQueryable.DefaultIfEmpty() as nullable (#69821)
kanadaj [Wed, 8 Jun 2022 16:16:06 +0000 (17:16 +0100)]
Mark IQueryable.DefaultIfEmpty() as nullable (#69821)

* Mark IQueryable.DefaultIfEmpty() as nullable

* Update CachedReflection.cs

* Update the nullability in the reference source

2 years agoupdate dogfooding instruction for 7.0 (#70423)
Tomas Weinfurt [Wed, 8 Jun 2022 14:42:35 +0000 (16:42 +0200)]
update dogfooding instruction for 7.0 (#70423)

* update dogfooding instruction for 7.0

* update example

* Update docs/project/dogfooding.md

Co-authored-by: Martin Costello <martin@martincostello.com>
2 years ago[main] Update dependencies from 8 repositories (#69709)
dotnet-maestro[bot] [Wed, 8 Jun 2022 12:55:36 +0000 (07:55 -0500)]
[main] Update dependencies from 8 repositories (#69709)

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.5.22269.3 -> To Version 7.0.0-preview.5.22273.1

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

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

* Update dependencies from https://github.com/dotnet/runtime-assets build 20220523.1

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 7.0.0-beta.22267.1 -> To Version 7.0.0-beta.22273.1

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

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22252.2 -> To Version 7.0.0-preview1.22274.2

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

System.Net.MsQuic.Transport
 From Version 7.0.0-alpha.1.22273.1 -> To Version 7.0.0-alpha.1.22273.2

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.5.22269.3 -> To Version 7.0.0-preview.6.22275.2

* Update dependencies from https://github.com/dotnet/emsdk build 20220525.2

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-preview.5.22268.1 -> To Version 7.0.0-preview.6.22275.2

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

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

* Update dependencies from https://github.com/dotnet/emsdk build 20220525.3

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-preview.5.22268.1 -> To Version 7.0.0-preview.6.22275.3

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

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22252.2 -> To Version 7.0.0-preview1.22277.2

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20220529.1

optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.22217.3 -> To Version 1.0.0-prerelease.22279.1

* Update dependencies from https://github.com/dotnet/runtime build 20220529.1

Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
 From Version 7.0.0-preview.5.22272.3 -> To Version 7.0.0-preview.6.22279.1

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.5.22269.3 -> To Version 7.0.0-preview.6.22280.1

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.5.22269.3 -> To Version 7.0.0-preview.6.22280.2

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

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

* Add manual marshalling for non-blittable delegates defined in System.Drawing.Common (which has the DisableRuntimeMarshallingAttribute applied) passed to P/Invokes.

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

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

* Update dependencies from https://github.com/dotnet/runtime-assets build 20220531.1

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 7.0.0-beta.22267.1 -> To Version 7.0.0-beta.22281.1

* Update dependencies from https://github.com/dotnet/emsdk build 20220531.1

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-preview.5.22268.1 -> To Version 7.0.0-preview.6.22281.1

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

System.Net.MsQuic.Transport
 From Version 7.0.0-alpha.1.22273.1 -> To Version 7.0.0-alpha.1.22281.1

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

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22252.2 -> To Version 7.0.0-preview1.22301.1

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

System.Net.MsQuic.Transport
 From Version 7.0.0-alpha.1.22273.1 -> To Version 7.0.0-alpha.1.22301.1

* Move OleDB to use more manual marshalling instead of delegate marshalling.

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

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22252.2 -> To Version 7.0.0-preview1.22302.1

* Update dependencies from https://github.com/dotnet/runtime build 20220605.4

Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
 From Version 7.0.0-preview.5.22272.3 -> To Version 7.0.0-preview.6.22305.4

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

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

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.5.22269.3 -> To Version 7.0.0-preview.6.22306.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
2 years agoStop normalizing managed calls in R2R (#70339)
Jakob Botsch Nielsen [Wed, 8 Jun 2022 11:59:59 +0000 (13:59 +0200)]
Stop normalizing managed calls in R2R (#70339)

We no longer need to interop with JIT64 so clean up this TODO. We are in
fact already relying on the normalization done by the callee since we
allow tailcalling that skips the inserted normalization in R2R.