platform/upstream/dotnet/runtime.git
2 years agoCleanup JsonTypeInfo construction (#67700)
Krzysztof Wicher [Thu, 7 Apr 2022 15:07:43 +0000 (17:07 +0200)]
Cleanup JsonTypeInfo construction (#67700)

2 years ago[Android] Disable System.Security.Cryptography tests on x64 and x86 Emulators (#67654)
Steve Pfister [Thu, 7 Apr 2022 14:02:15 +0000 (10:02 -0400)]
[Android] Disable System.Security.Cryptography tests on x64 and x86 Emulators (#67654)

Rolling back https://github.com/dotnet/runtime/pull/67057 as the changes we made to monitor caused OOM's to happen more frequently.

We were also able to reproduce locally, so we'll disable the suite until a proper fix can be made.

Tracking issue: https://github.com/dotnet/runtime/issues/62547

2 years agoEnable MSVC standard conformance for JIT sources, try 2 (#67695)
Jakob Botsch Nielsen [Thu, 7 Apr 2022 13:56:38 +0000 (15:56 +0200)]
Enable MSVC standard conformance for JIT sources, try 2 (#67695)

This was reverted in 794a19941a20275d47527dfa7389ae9accf754e1 as a
compiler error had snuck in in the precompiled header. This fixes the
problem by moving the global placement new operator into new.h instead
of defining it in compiler.h where jitstd cannot (should not) access it.

2 years agoAdd more StringSyntaxAttribute syntaxes (#67621)
Stephen Toub [Thu, 7 Apr 2022 13:16:10 +0000 (09:16 -0400)]
Add more StringSyntaxAttribute syntaxes (#67621)

* Add DateFormat and TimeFormat to StringSyntaxAttribute

* Add NumericFormat to StringSyntaxAttribute

* Add TimeSpanFormat to StringSyntaxAttribute

* Add EnumFormat to StringSyntaxAttribute

* Add GuidFormat to StringSyntaxAttribute

* Add CompositeFormat to StringSyntaxAttribute

* Add Xml to StringSyntaxAttribute

* Add Uri to StringSyntaxAttribute

* Update ref usage to strings

* Address API review renames

* Fix netstandard build

* Address PR feedback

2 years agoReenable crossgen2 promotion outside version bubble (#66983)
Jakob Botsch Nielsen [Thu, 7 Apr 2022 12:43:18 +0000 (14:43 +0200)]
Reenable crossgen2 promotion outside version bubble (#66983)

* [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.

Co-authored-by: Sergey Andreenko <andreenkosa@gmail.com>
2 years agoJIT: Fix UB in CreateConstVector (strict alignment) (#67669)
Egor Bogatov [Thu, 7 Apr 2022 10:50:24 +0000 (13:50 +0300)]
JIT: Fix UB in CreateConstVector (strict alignment) (#67669)

2 years agoUpdate xharness to latest version (#67667)
Alexander Köplinger [Thu, 7 Apr 2022 10:21:35 +0000 (12:21 +0200)]
Update xharness to latest version (#67667)

Needed for some perf scenarios.

2 years agoSplit Reflection and SourceGen TypeInfos (#67526)
Krzysztof Wicher [Thu, 7 Apr 2022 10:01:08 +0000 (12:01 +0200)]
Split Reflection and SourceGen TypeInfos (#67526)

* Split Reflection and SourceGen TypeInfos

* Apply PR feedback

* improve exception unwrapping

2 years ago[debugger][wasm] ValueTypeClass refactoring. (#63626)
Ilona Tomkowicz [Thu, 7 Apr 2022 08:33:10 +0000 (10:33 +0200)]
[debugger][wasm] ValueTypeClass refactoring. (#63626)

* Refactoring.

* Added null-indexing check.

* Cleaning ValueTypeClass.

* Moving public method below private fields.

* Applied @radical's comments about readonly fields and method names simplification.

* Rename and correct switch case error.

Switch case should be based on GetValues result, not GetValueTypeClass.

2 years agoVarious fixes for merged test runners on Mono (#67665)
Jeremy Koritzinsky [Thu, 7 Apr 2022 04:53:41 +0000 (21:53 -0700)]
Various fixes for merged test runners on Mono (#67665)

2 years agoRemove _caseInsensitive field from RegexInterpreter (#67681)
Stephen Toub [Thu, 7 Apr 2022 02:11:06 +0000 (22:11 -0400)]
Remove _caseInsensitive field from RegexInterpreter (#67681)

2 years agoSystem.Runtime no longer needs to enable preview features (#67162)
Jeff Handley [Wed, 6 Apr 2022 23:11:30 +0000 (16:11 -0700)]
System.Runtime no longer needs to enable preview features (#67162)

* System.Runtime no longer needs to enable preview features

* Remove diagnostic suppression around VirtualStaticsInInterfaces

* Remove remaining CA2252 suppressions for VirtualStaticsInInterfaces

2 years agoFix System.DirectoryServices.Protocols to work on Linux (#67338)
Petteri Stenius [Wed, 6 Apr 2022 23:06:38 +0000 (02:06 +0300)]
Fix System.DirectoryServices.Protocols to work on Linux (#67338)

Co-authored-by: Petteri Stenius <petteri.stenius@gmail.com>
2 years agoRevert "Enable MSVC standard conformance for JIT sources (#67608)" (#67674)
Jakob Botsch Nielsen [Wed, 6 Apr 2022 23:04:26 +0000 (01:04 +0200)]
Revert "Enable MSVC standard conformance for JIT sources (#67608)" (#67674)

This reverts commit 548bb581b632b40c8caf1aa39514590b7b183926.

2 years agoAdd libssl3 dependency (#67658)
Nikola Milosavljevic [Wed, 6 Apr 2022 22:56:24 +0000 (15:56 -0700)]
Add libssl3 dependency (#67658)

2 years agoPin Roslyn version for generators in .NET 7 ref pack (#67599)
Jeremy Koritzinsky [Wed, 6 Apr 2022 22:47:40 +0000 (15:47 -0700)]
Pin Roslyn version for generators in .NET 7 ref pack (#67599)

Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
2 years ago[main] Update dependencies from dotnet/linker (#67581)
dotnet-maestro[bot] [Wed, 6 Apr 2022 21:00:24 +0000 (17:00 -0400)]
[main] Update dependencies from dotnet/linker (#67581)

* Update dependencies from https://github.com/dotnet/linker build 20220404.1

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22204.1

* Update dependencies from https://github.com/dotnet/linker build 20220405.1

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22205.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoDisable HandleCollectionsAsync for OSX x64 (#67662)
Eirik Tsarpalis [Wed, 6 Apr 2022 20:26:25 +0000 (21:26 +0100)]
Disable HandleCollectionsAsync for OSX x64 (#67662)

2 years agoAllow access to child providers in ChainedConfigurationProvider (#67610)
Maryam Ariyan [Wed, 6 Apr 2022 20:01:57 +0000 (16:01 -0400)]
Allow access to child providers in ChainedConfigurationProvider (#67610)

2 years agoEnable MSVC standard conformance for JIT sources (#67608)
Jakob Botsch Nielsen [Wed, 6 Apr 2022 19:32:39 +0000 (21:32 +0200)]
Enable MSVC standard conformance for JIT sources (#67608)

The JIT sources pretty much already compiled under this mode except for
one thing that could just be fixed by removing the code. This will catch
some obvious bugs, like passing 'false' as a pointer.

2 years ago[mono][llvm] Remove support for llvm 9.x, the 11.x support is stable … (#67277)
Zoltan Varga [Wed, 6 Apr 2022 19:22:46 +0000 (21:22 +0200)]
[mono][llvm] Remove support for llvm 9.x, the 11.x support is stable … (#67277)

* [mono][llvm] Remove support for llvm 9.x, the 11.x support is stable enough.

* Use llvm 11.x APIs in some places.

* Remove cmake support for llvm 9.x as well.

2 years agoProposed changes to ECMA 335 for checked user-defined operators (#66714)
AlekseyTs [Wed, 6 Apr 2022 13:54:22 +0000 (06:54 -0700)]
Proposed changes to ECMA 335 for checked user-defined operators (#66714)

C# now supports defining `checked` variants of the following user-defined operators so that users can opt into or out of overflow behavior as appropriate:
*  The `++` and `--` unary operators [§11.7.14](https://github.com/dotnet/csharpstandard/blob/draft-v6/standard/expressions.md#11714-postfix-increment-and-decrement-operators) and [§11.8.6](https://github.com/dotnet/csharpstandard/blob/draft-v6/standard/expressions.md#1186-prefix-increment-and-decrement-operators).
*  The `-` unary operator [§11.8.3](https://github.com/dotnet/csharpstandard/blob/draft-v6/standard/expressions.md#1183-unary-minus-operator).
*  The `+`, `-`, `*`, and `/` binary operators [§11.9](https://github.com/dotnet/csharpstandard/blob/draft-v6/standard/expressions.md#119-arithmetic-operators).
*  Explicit conversion operators.

Motivation:
There is no way for a user to declare a type and support both checked and unchecked versions of an operator. This makes it hard to port various algorithms to use the proposed `generic math` interfaces exposed by the libraries team. Likewise, this makes it impossible to expose a type such as `Int128` or `UInt128` without the language simultaneously shipping its own support to avoid breaking changes.

This change adds names for the new checked operators to the specification.

2 years agoDisable RegexExperiment tests
Stephen Toub [Wed, 6 Apr 2022 13:01:14 +0000 (09:01 -0400)]
Disable RegexExperiment tests

These were accidentally left enabled.

2 years agoDisable System.Net.Quic.Tests.QuicStreamTests.WriteAsync_LocalAbort_Throws (#67638)
Radek Zikmund [Wed, 6 Apr 2022 10:35:17 +0000 (12:35 +0200)]
Disable System.Net.Quic.Tests.QuicStreamTests.WriteAsync_LocalAbort_Throws (#67638)

Contributes to #67612

2 years agoChange Regex UnicodeCategoryRanges to use spans (#67576)
Stephen Toub [Wed, 6 Apr 2022 10:27:00 +0000 (06:27 -0400)]
Change Regex UnicodeCategoryRanges to use spans (#67576)

* Change Regex UnicodeCategoryRanges to use spans

This avoids the overhead of allocating this data in large byte arrays.

* Clean up after merge

2 years agoImprove handling of more common Regex sets (#67365)
Stephen Toub [Wed, 6 Apr 2022 10:24:22 +0000 (06:24 -0400)]
Improve handling of more common Regex sets (#67365)

- Today for a set like [\r\n], we'll emit a comparison that compares the char to each of '\r' and '\n', but for a set like [^\r\n], we end up falling back to emitting a lookup table.  With this PR, we simply use the existing support for the non-negating case, just negating the result.
- Today for a set like [\p{IsGreek}\p{IsGreekExtended}] that ends up being two ranges, we'll fall back to our lookup table.  With this PR, we'll emit it as two range checks.
- Today for a set like [A-Za-z], we'll fall back to our lookup table.  As a special case of two-range support, with this PR we'll now recognize that these ranges are just one bit flip away from each other, and we'll employ the normal ASCII casing to do a single range comparison against the input or'd with a mask.
- Today as a fallback, we employ a lookup table stored in a string; this requires a bounds check, dereferencing the string object, doing the math to find the right index, doing the math to find the right bit, etc.  With this PR, for sets composed only of ranges where the exclusiveMax - inclusiveMin <= 64, with this PR we'll now emit it as a lookup into a ulong that's done in a branchless fashion and is much faster.
- It appears to be relatively common for folks to use [\d\D], [\w\W], or [\s\S] as a simple way of saying "match anything"; RegexOptions.Singleline changes '.' to mean this as well.  We already have special handling for '.' with Singleline as "AnyClass"... this just normalizes those other common representations into the same shape so that everyhing else recognizes them accordingly.
- Today when we see an AnyClass, we emit a nonsense comparison that always results in true (or false for negations); that's because, for a while, the expression given to the matching routine may have had side effects.  There are no longer side effects, though, so it's ok to just emit "true" or "false" directly and make the operation cheaper.
- For every optimization we have in MatchCharacterClass, we should always be able to handle negation trivially.
- Handle character classes composed of multiple UnicodeCategories. This helps with composed categories, like \p{N}.
- Fix hard-coded char class strings for \W and \S. There are multiple ways to invert a RegexCharClass string: you can invert the whole string by just setting the invert flag, or you can invert all the individual components, e.g. if the string is composed of only categories, invert each category.  The hardcoded string the parser uses when you write \W simply sets the negated bit, but this causes problems if \W is used as [\W], because then the individual components are added into a larger set that doesn't have negation set.  And that means \W and [\W] result in different strings, which means any place we special-case the string for \W, we don't recognize [\W].  The same applies to \S. This commit changes the hardcoded string for \W and \S to use the more canonical form. Also, the implementation generally uses "set" and "class" interchangeably, but when specifying the ECMA-related strings, it uses "set" to actually mean "ranges", which is very confusing.  I've changed them.

2 years agoIntroduce write barriers in wasm bindings, migrate to ref/out params, add gc safe...
Katelyn Gadd [Wed, 6 Apr 2022 09:27:12 +0000 (02:27 -0700)]
Introduce write barriers in wasm bindings, migrate to ref/out params, add gc safe regions (#65994)

Introduce write barriers in key parts of the wasm bindings and migrate most code to use ref/out parameters instead of passing raw managed pointers as arguments or return values.
Introduced MonoObjectRef typescript type and corresponding 'R' signature char (for 'ref/out object')
Marked various old/unsafe code as deprecated
Fixed some incorrect rooting in websocket APIs
Introduced 'volatile' attribute on various C pointers in the bindings
Added GC unsafe/safe regions in key parts of the C bindings
Expanded exported APIs

2 years agolog entire content to see which assertion fails (#67586)
Adam Sitnik [Wed, 6 Apr 2022 09:07:44 +0000 (11:07 +0200)]
log entire content to see which assertion fails (#67586)

* add AssertExtensions.Eqal(string, string) that logs entire content if provided strings are not equal

* log entire content to see which assertion fails

2 years agoAdd CipherSuitesPolicy support for MsQuic (#67239)
Radek Zikmund [Wed, 6 Apr 2022 08:08:50 +0000 (10:08 +0200)]
Add CipherSuitesPolicy support for MsQuic (#67239)

* Add CipherSuitesPolicy support for MsQuic

* Add tests

* Code review feedback

* Fix test

2 years agoRe-enable a few Regex source generator tests (#67585)
Stephen Toub [Wed, 6 Apr 2022 02:58:43 +0000 (22:58 -0400)]
Re-enable a few Regex source generator tests (#67585)

2 years agoChanging the logic for how we deal with RegexOptions.IgnoreCase matching. (#67184)
Jose Perez Rodriguez [Wed, 6 Apr 2022 02:25:24 +0000 (19:25 -0700)]
Changing the logic for how we deal with RegexOptions.IgnoreCase matching. (#67184)

* Changing the logic for how we deal with RegexOptions.IgnoreCase
matching.

* Addressing first round of feedback

* Addressing more feedback.

* - Ensure that Backreferences use the same case behavior that the casing table does when using IgnoreCase.
- Addressing more feedback.

* Apply suggestions from code review

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

* Fix allocation regression for patterns with a lot of ascii letters

* Skip few tests in Browser and .NET Framework

* Skip one more test that shouldn't be ran on wasm

* Address more PR Feedback

* More feedback

* Skip tests that are failing in NLS-globalization queues

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoUse ComSmartPtr in tests (#67584)
Andrii Kurdiumov [Wed, 6 Apr 2022 00:51:22 +0000 (06:51 +0600)]
Use ComSmartPtr in tests (#67584)

* Use ComSmartPtr in tests

See https://github.com/dotnet/winforms/pull/6743#discussion_r837019661 for discussion

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
2 years ago[iOS] Disable OptionsMonitorTest.TestCurrentValueDoesNotAllocateOnceValueIsCached...
Steve Pfister [Tue, 5 Apr 2022 22:50:29 +0000 (18:50 -0400)]
[iOS] Disable OptionsMonitorTest.TestCurrentValueDoesNotAllocateOnceValueIsCached (#67613)

Created a tracking issue so that it can be fixed at a later date and not block the extra-platforms rolling build.

https://github.com/dotnet/runtime/issues/67611

2 years ago[tests] Re-enable generic math Create tests on iOS (#67542)
Aleksey Kliger (λgeek) [Tue, 5 Apr 2022 20:45:16 +0000 (16:45 -0400)]
[tests] Re-enable generic math Create tests on iOS (#67542)

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

Fixed by https://github.com/dotnet/runtime/pull/66739

2 years agoMove tests that touch the network to outerloop only for infra-stability reasons ...
Jeremy Koritzinsky [Tue, 5 Apr 2022 19:50:43 +0000 (12:50 -0700)]
Move tests that touch the network to outerloop only for infra-stability reasons (#67593)

* Move tests that touch the network to outerloop only for infra-stability reasons

* PR feedback

2 years agoDisable deleting call counting stubs (#67563)
Koundinya Veluri [Tue, 5 Apr 2022 19:41:30 +0000 (12:41 -0700)]
Disable deleting call counting stubs (#67563)

It's currently incompatible with the W^X changes, and there's another rare issue that may cause a crash when checking if a precode target is a jump stub.

Memory impact on x64:

Calling and tiering up ~10 K empty methods causes the following amount of memory to remain.

Methods with stubs: 10139
Memory usage: ~876 KB
Memory usage per method with stub: ~88.5 B
Committed memory at the end after GC: ~9.5 MB

On a larger test case that compiles Roslyn sources 16 times in the same process, the numbers are similar.

Methods with stubs: 22141
Memory usage: ~1913 KB
Memory usage per method with stub: ~88.5 B
Committed memory at the end after GC: 90-95 MB

It should be possible to reduce the leaked memory per method with stub from ~88.5 B to about 10-16 B depending on architecture in the future if necessary.

- Fixes https://github.com/dotnet/runtime/issues/66924
- Fixes https://github.com/dotnet/runtime/issues/66424

2 years agoRevert "Publish crossgen as AOT if supported by the target platform (#65948)" (#67590)
Andy Gocke [Tue, 5 Apr 2022 19:06:34 +0000 (12:06 -0700)]
Revert "Publish crossgen as AOT if supported by the target platform (#65948)" (#67590)

This reverts commit 0d1e04ba2a9ebc9d21a7f65db00407dd0056b547.

2 years agoUpdate error message for runtime not found (#67564)
Elinor Fung [Tue, 5 Apr 2022 18:26:09 +0000 (11:26 -0700)]
Update error message for runtime not found (#67564)

2 years agoFix too wide constant stores to parameters on macOS (#67336)
Jakob Botsch Nielsen [Tue, 5 Apr 2022 17:05:35 +0000 (19:05 +0200)]
Fix too wide constant stores to parameters on macOS  (#67336)

Fix #67331

2 years ago[QUIC] Call SendResettableCompletionSource.CompleteException in AbortWrite (#67341)
Radek Zikmund [Tue, 5 Apr 2022 13:54:35 +0000 (15:54 +0200)]
[QUIC] Call SendResettableCompletionSource.CompleteException in AbortWrite (#67341)

* Call SendResettableCompletionSource.CompleteException in AbortWrite

* Add test

* fixup! Add test

* Use loop to make the test more robust

2 years agoDon't pass --minimize to Xcode 13.3 dsymutil (#67543)
Aleksey Kliger (λgeek) [Tue, 5 Apr 2022 02:02:34 +0000 (22:02 -0400)]
Don't pass --minimize to Xcode 13.3 dsymutil (#67543)

* Don't pass --minimize to Xcode 13.3 dsymutil

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

New xcode command line tools dropped support for the `--minimize` option (which
is now the default).

The related LLVM change is https://github.com/llvm/llvm-project/commit/5d07dc897707f877c45cab6c7e4b65dad7d3ff6d

* fix build with older Xcodes

   use a list of options, not a single option with a space in it

Co-authored-by: Kevin Jones <vcsjones@github.com>
2 years agoDon't force `TieredCompilation=0` for SuperPMI replay job (#67489)
Bruce Forstall [Tue, 5 Apr 2022 00:43:03 +0000 (17:43 -0700)]
Don't force `TieredCompilation=0` for SuperPMI replay job (#67489)

Use whatever flags already are baked into the SuperPMI collection.

2 years agoDisable `Microsoft.Extensions.Hosting.WindowsServices.Tests` for (#67550)
Ankit Jain [Tue, 5 Apr 2022 00:19:35 +0000 (20:19 -0400)]
Disable `Microsoft.Extensions.Hosting.WindowsServices.Tests` for (#67550)

* Disable `Microsoft.Extensions.Hosting.WindowsServices.Tests` for

.. non-windows platforms.

* UseWindowsServiceTests: Mark the test as windows only

* Fix build

2 years agoUpdating the generic math interfaces according to the last API review (#67453)
Tanner Gooding [Mon, 4 Apr 2022 22:40:36 +0000 (15:40 -0700)]
Updating the generic math interfaces according to the last API review (#67453)

* Create INumberBase and allow Complex to implement it

* Move DivRem to only be available for IBinaryInteger

* Split apart various floating-point interfaces for better extensibility

* Annotate the generic math interfaces to implement on BigInteger and Complex

* Moving various generic math interfaces into the System.Numerics namespace

* Split various generic math interfaces into their own file for easier discoverability

* IParseable -> IParsable

* Update ISignedNumber and IUnsignedNumber to be "marker" interfaces

* PI -> Pi and IEEERemainder -> Ieee754Remainder

* Removing the various TInteger constraints in favor of using int where feasible

* Moving IDivisionOperators and ISpanFormattable down to INumberBase

* Moving CopySign, IsNegative, MaxMagnitude, and MinMagnitude down to INumber

* Create<TOther> -> CreateChecked<TOther>

* Updating various generic math tests

* Update src/libraries/System.Private.CoreLib/src/System/Numerics/INumber.cs

Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
* Fixing the reference assembly for System.Numerics.Complex

* Removing generic math support from System.Numerics.Complex until the trimming issue can be resolved

Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
2 years agoDisable some interop tests on Win-ARM32 (#67553)
Aaron Robinson [Mon, 4 Apr 2022 20:50:23 +0000 (13:50 -0700)]
Disable some interop tests on Win-ARM32 (#67553)

2 years ago[wasm][debugger] Some test fixes (#67373)
Ankit Jain [Mon, 4 Apr 2022 20:14:13 +0000 (16:14 -0400)]
[wasm][debugger] Some test fixes (#67373)

* [wasm] Bump timeout for debugger tests to 30mins, to accomodate EvaluateOnCallFrameTests

* [wasm][debugger] statically init App.static_method_table

`debugger-driver.html` has a `App.init` function (called from `onDotnetReady`)
that init's `App.static_method_table`. But this function can
race with a test, which might call `invoke_static_method`, and that
would fail because `App.static_method_table` is not defined yet.

* Improve logging slightly to help debug random failures

* Update line numbers in tests

2 years agoRevert "[main] Update dependencies from dotnet/linker (#67381)" (#67539)
Ankit Jain [Mon, 4 Apr 2022 19:44:41 +0000 (15:44 -0400)]
Revert "[main] Update dependencies from dotnet/linker (#67381)" (#67539)

This reverts commit a0f7927c0ce4cfa8d1c832e70461b0145389a8be.

It broke wasm builds: https://github.com/dotnet/runtime/pull/67381

2 years agoConcatenate multiple cookies with semicolon (#67455)
devsko [Mon, 4 Apr 2022 18:28:28 +0000 (20:28 +0200)]
Concatenate multiple cookies with semicolon (#67455)

* Concatenate cookies with semicolon

* Restore tests that run on .NET Framework

* Change Cookie header to Custom

* PR feedback

2 years agoMake handling of invalid code more robust (#67524)
Michal Strehovský [Mon, 4 Apr 2022 16:41:37 +0000 (01:41 +0900)]
Make handling of invalid code more robust (#67524)

* Call `EnsureLoadableMethod` from scanner, same as we do in JitInterface.
* Make scan/compile diffing less sensitive to differences caused by invalid IL.

2 years agoFix handling of makeref/refvalue in generic code (#67523)
Michal Strehovský [Mon, 4 Apr 2022 16:30:33 +0000 (01:30 +0900)]
Fix handling of makeref/refvalue in generic code (#67523)

* Fix handling of makeref/refvalue in generic code

Found in Pri0 tests. We didn't have any coverage for TypedReference in smoke tests.

* Update Generics.cs

2 years agoFix parent test folder name (#67528)
Viktor Hofer [Mon, 4 Apr 2022 15:25:52 +0000 (17:25 +0200)]
Fix parent test folder name (#67528)

2 years agoUpdated branch name, from master to main. (#67522)
Marcelo M. Maciel [Mon, 4 Apr 2022 12:44:14 +0000 (09:44 -0300)]
Updated branch name, from master to main. (#67522)

2 years agoAvoid pre-allocating large arrays in some scenarios for Enumerable.Chunk (#67210)
madelson [Mon, 4 Apr 2022 11:59:23 +0000 (07:59 -0400)]
Avoid pre-allocating large arrays in some scenarios for Enumerable.Chunk (#67210)

* Avoid pre-allocating large arrays in some scenarios for Enumerable.Chunk().

Fix #67132

* Switch Chunk() to use List-based implementation.

See discussion here:
https://github.com/dotnet/runtime/pull/67210#discussion_r836561697

* Address feedback from https://github.com/dotnet/runtime/pull/67210/files

2 years agoJIT: Optimize unused array allocations (#67205)
Egor Bogatov [Mon, 4 Apr 2022 09:46:30 +0000 (12:46 +0300)]
JIT: Optimize unused array allocations (#67205)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
2 years agoDisable tests/profiler/eventpipe/eventpipe on JIT stress runs (#66473)
Tom McDonald [Mon, 4 Apr 2022 09:39:25 +0000 (02:39 -0700)]
Disable tests/profiler/eventpipe/eventpipe on JIT stress runs (#66473)

2 years agoAlign nodes when `!SupportsRelativePointers` (#67516)
Michal Strehovský [Mon, 4 Apr 2022 04:14:58 +0000 (13:14 +0900)]
Align nodes when `!SupportsRelativePointers` (#67516)

2 years agoConsistently use AssemblyName in execution script generator (#67449)
Tomáš Rylek [Sun, 3 Apr 2022 22:44:48 +0000 (00:44 +0200)]
Consistently use AssemblyName in execution script generator (#67449)

Before this change the execution script generator arbitrarily
referred to "InputAssemblyName", "AssemblyName" and
"MSBuildProjectName" w.r.t. names of the scripts and the
executables. This is unfortunate because for merged
ILPROJ projects we need to adjust the assembly name during build.
This simple change makes the scripts consistently refer to
AssemblyName everywhere.

Thanks

Tomas

2 years ago[arm64] Addressing modes for SIMD (#67490)
Egor Bogatov [Sun, 3 Apr 2022 19:16:00 +0000 (22:16 +0300)]
[arm64] Addressing modes for SIMD (#67490)

2 years agoStop using CLS_VAR on x86 (#67335)
SingleAccretion [Sun, 3 Apr 2022 18:13:34 +0000 (21:13 +0300)]
Stop using CLS_VAR on x86 (#67335)

2 years agoCleanup fp registers assignments from arm64 path (#65629)
Adeel Mujahid [Sun, 3 Apr 2022 16:51:57 +0000 (19:51 +0300)]
Cleanup fp registers assignments from arm64 path (#65629)

2 years agoTests for altered references for SignedXml (#67501)
Anders Abel [Sun, 3 Apr 2022 16:43:05 +0000 (18:43 +0200)]
Tests for altered references for SignedXml (#67501)

- Fix Null ref on non-existing reference. This is in line with how
  the old code worked, it returned false on CheckSignature but didn't
  throw on load.

2 years agoSkip check of Notepad title on Win 11 (#67495)
Dan Moseley [Sun, 3 Apr 2022 16:15:44 +0000 (10:15 -0600)]
Skip check of Notepad title on Win 11 (#67495)

2 years agoCleanup legacy interop in System.Security.Principal.Windows (#67479)
Jan Kotas [Sun, 3 Apr 2022 13:52:36 +0000 (06:52 -0700)]
Cleanup legacy interop in System.Security.Principal.Windows (#67479)

Replace Marshal.PtrToStructure and similar methods with unmanaged pointers. Fixes a few AOT compatibility warnings.

2 years ago[main] Update dependencies from dotnet/linker (#67381)
dotnet-maestro[bot] [Sun, 3 Apr 2022 08:21:23 +0000 (10:21 +0200)]
[main] Update dependencies from dotnet/linker (#67381)

* Update dependencies from https://github.com/dotnet/linker build 20220330.1

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22180.1

* Update dependencies from https://github.com/dotnet/linker build 20220331.1

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22181.1

* Update dependencies from https://github.com/dotnet/linker build 20220401.3

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22178.1 -> To Version 7.0.100-1.22201.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoFix loop cloning of array of struct with array field (#67130)
Bruce Forstall [Sun, 3 Apr 2022 03:34:31 +0000 (20:34 -0700)]
Fix loop cloning of array of struct with array field (#67130)

Loop cloning needs to parse what morph creates from GT_INDEX nodes
to determine if there are array accesses with bounds checks that
could potentially be optimized. For jagged array access, this can
be a "comma chain" of bounds checks and array element address expressions.
For a case where an array of structs had a struct field, such as
`ValueTuple<int[], int>[]`, cloning was confusing the expression
`a[i].Item1[j]` for the jagged array access `a[i][j]`.

The fix here is to keep track of the type of the `GT_INDEX` node that is
being morphed, in the `GT_BOUNDS_CHECK` node that is created for it.
(This is the only thing cloning parses, to avoid the need to parse
the very complex trees morph can create.) This type is then checked
when parsing the "comma chain" trees. If a non-`TYP_REF` is found (such
as a `TYP_STRUCT` in the above example), no more levels of array indexing
are considered. (`TYP_REF` is what an array object would have, for a jagged
array.)

Fixes #66254.

2 years agoAllow null-based ARR_ADDRs (#67486)
SingleAccretion [Sun, 3 Apr 2022 03:23:28 +0000 (06:23 +0300)]
Allow null-based ARR_ADDRs (#67486)

We can sometimes see trees like "ARR_ADDR(long 0)" that are the
result of morph's folding logic.

In general it does not seem great to allow folding of BYREFs
into LONGs like that, but it is also not incorrect per-se.

2 years agoAdd {ReadOnly}Span ctor (internal for now) that takes a ref and no length (#67447)
Stephen Toub [Sat, 2 Apr 2022 20:24:37 +0000 (16:24 -0400)]
Add {ReadOnly}Span ctor (internal for now) that takes a ref and no length (#67447)

* Add {ReadOnly}Span ctor (internal for now) that takes an in and no length

* Address PR feedback

* Fix native references to _pointer

2 years agoChange ConfigurationBinder to avoid reading properties unnecessarily. (#66723)
madelson [Sat, 2 Apr 2022 19:01:35 +0000 (15:01 -0400)]
Change ConfigurationBinder to avoid reading properties unnecessarily. (#66723)

Co-authored-by: Stephen Halter <halter73@gmail.com>
2 years agobuild: fix corehost.proj dac injection unquoted path (#67467)
Wraith [Sat, 2 Apr 2022 18:51:26 +0000 (19:51 +0100)]
build: fix corehost.proj dac injection unquoted path (#67467)

* add quotes around dotnet path

* address feedback

2 years agoFixed msquic method that's become void (#67481)
Marie Píchová [Sat, 2 Apr 2022 15:48:06 +0000 (17:48 +0200)]
Fixed msquic method that's become void (#67481)

2 years agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 169659...
dotnet bot [Sat, 2 Apr 2022 14:34:54 +0000 (07:34 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1696596 (#67463)

2 years agoRemove invalid assertion (#67482)
Eirik Tsarpalis [Sat, 2 Apr 2022 14:30:26 +0000 (15:30 +0100)]
Remove invalid assertion (#67482)

2 years agoDon't consider ShadowMethods reflectable (#67421)
Michal Strehovský [Sat, 2 Apr 2022 10:29:22 +0000 (19:29 +0900)]
Don't consider ShadowMethods reflectable (#67421)

Fixes #65612. This regression was exposed in #62891 - we had a mismatch between what methods are considered reflectable during scanning vs during optimized compilation due to extra array being injected for reflectable `params` methods on instantiated generic types.

There are two potential fixes - either expand the set of methods considered reflectable during scanning, or limit the number of methods considered reflectable in optimized compilation. It doesn't look like we need the expanded set, so going with a restriction instead. The CI may prove me otherwise, so keeping an open mind about this.

2 years agoDisable cast profiling (#67460)
Egor Bogatov [Sat, 2 Apr 2022 10:19:06 +0000 (13:19 +0300)]
Disable cast profiling (#67460)

2 years agoInfra fixes for bugs uncovered by testing of the JIT/Methodical merged tests (#67393)
Tomáš Rylek [Sat, 2 Apr 2022 09:25:50 +0000 (11:25 +0200)]
Infra fixes for bugs uncovered by testing of the JIT/Methodical merged tests (#67393)

* Move copying of merged wrapper native components to copynative step

* Move export of test exclusion file before ILLink changing CORE_ROOT

* Fix file mode for test execution bash scripts

* Add out-of-proc test folders to Helix work item payloads

* Fix Helix publishing in the presence of out-of-process tests

* Use a marker file triggered off of a project property to determine which files to skip running the Mono AOT compiler on (some tests fail at AOT time, so we need this to work around that limitation)

* Pass runtimeVariant to the Core_Root construction for the test exclusion list creation

* Don't write the output element when there's no test output. This causes issues with Helix test uploading.

* Write xunit results the way xharness expects to read them for wasm so we correctly report failures and don't report a test harness failure.

* Fix GeneratedTestRunner to build.

* Fix copying native wrappers for merged test runners.

Pre-emptively mark another test as RequiresProcessIsolation as I stumbled upon it while fixing this

* Fix copying of native test components to merged wrapper outputs

Due to Pri0 / Pri1 test grouping we may end up building the
wrapper in a different group than its components. Make sure that
we populate all native components of merged wrapper dependencies
before we copy them over to the merged wrapper output folder.

* Exclude wasm support files.

Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
2 years agoRemoved the hard heap limit heap balancing logic for regions + UOH and fixed infinite...
Mukund Raghav Sharma [Sat, 2 Apr 2022 08:37:19 +0000 (01:37 -0700)]
Removed the hard heap limit heap balancing logic for regions + UOH and fixed infinite retries in case at the LOH boundary (#67406)

* Removed the hard heap limit heap balancing logic for uoh and fixed inifite retries

* Addressed feedback - refactored region checking directives

* Removed all instances of hard_limit_exceeded_p as it is no longer needed

2 years agoDisable GitHub_35821 on arm64 (#67472)
Bruce Forstall [Sat, 2 Apr 2022 03:40:16 +0000 (20:40 -0700)]
Disable GitHub_35821 on arm64 (#67472)

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

2 years agoDisable readytorun/coreroot_determinism test on GCStress due to test failure (#67468)
Bruce Forstall [Sat, 2 Apr 2022 03:39:42 +0000 (20:39 -0700)]
Disable readytorun/coreroot_determinism test on GCStress due to test failure (#67468)

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

2 years agoDisable ArrBoundBinaryOp under GCStress due to failure (#67469)
Bruce Forstall [Sat, 2 Apr 2022 03:39:24 +0000 (20:39 -0700)]
Disable ArrBoundBinaryOp under GCStress due to failure (#67469)

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

2 years agoUpdate System.Runtime.InteropServices.cs (#67466)
Aaron Robinson [Sat, 2 Apr 2022 02:49:01 +0000 (19:49 -0700)]
Update System.Runtime.InteropServices.cs (#67466)

Remove `ObsoleteAttribute` from COM interop values.

2 years agoDetect systemd when inside a container. (#67288)
judilsteve [Sat, 2 Apr 2022 01:29:06 +0000 (09:29 +0800)]
Detect systemd when inside a container. (#67288)

* Detect systemd when inside a container.

Modify IsSystemdService to function correctly
for containerised services.

Fix #67203

Adds conditional compilation to fall back
to Process.GetCurrentProcess().Id when
Environment.ProcessId is not available.

* Apply suggestions from code review

The minimum supported .NETCoreApp version in the repository is 6.0, so just using NETCOREAPP.

Co-authored-by: james <judilsteve>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years agoMore XARCH `PUTARG_STK` CQ improvements (#67400)
SingleAccretion [Sat, 2 Apr 2022 00:20:52 +0000 (03:20 +0300)]
More XARCH `PUTARG_STK` CQ improvements (#67400)

* Dissolve structs into primitives for PUTARG_STK

The primary benefit of this change is "free" support for
complex addressing modes, which is always desirable when
we are loading a primitive (as opposed to the large struct
case, where we would not want to use the 3-operand LEA
in a loop, but instead cache the address in a register).

The additional (future) benefit is that we will no longer
need to mark the source local as DNER, once LCL_VAR sources
for struct PUTARG_STKs are supported.

* Contain PUTARG_STK sources for "push [mem]"

2 years agoIgnore execution scripts under merged wrappers (#67452)
Tomáš Rylek [Fri, 1 Apr 2022 23:26:52 +0000 (01:26 +0200)]
Ignore execution scripts under merged wrappers (#67452)

Today logic for emitting the legacy XUnit wrappers is based on
scanning the test output tree for execution scripts (sh / cmd);
we however need to emit execution scripts even in the presence of
merged wrappers in case of tests requiring project isolation.
This change filters these tests out so that they don't end up
creating a spurious legacy XUnit test wrapper.

Thanks

Tomas

2 years agoUse the stapled OCSP response from TLS on Linux, when available
Jeremy Barton [Fri, 1 Apr 2022 23:13:19 +0000 (16:13 -0700)]
Use the stapled OCSP response from TLS on Linux, when available

Based on (non-exhaustive) testing, chain builds from a Let's Encrypt issued certificate have
the following characteristics:

* Live OCSP request required (uncached/unstapled): 577ms
* OCSP response retrieved from cache (unstapled): 183ms
* OCSP response utilized from TLS stapling (bypasses cache): 182ms

In both cached and stapled the revocation portion was about 39ms.
(The revocation mode was ExcludeRoot, the CRL pertaining to the intermediate was cached for all three measurements.)

If the OCSP response was stapled (and the math worked out OK on it) then we completely ignore the OCSP cache.
While it could potentially be useful to update the cache if the stapled response was newer, the extra I/O of doing
the "newer" test didn't feel justified at this time.

2 years agoSync shared code from aspnetcore (#67456)
github-actions[bot] [Fri, 1 Apr 2022 22:26:17 +0000 (15:26 -0700)]
Sync shared code from aspnetcore (#67456)

2 years agoImprove support for multiple enveloped signatures in the same SignedXml document
Anders Abel [Fri, 1 Apr 2022 22:11:08 +0000 (00:11 +0200)]
Improve support for multiple enveloped signatures in the same SignedXml document

This should improve the experience when working with complex SAML tokens.

2 years ago[QUIC] Update to msquic 2 (#67383)
Marie Píchová [Fri, 1 Apr 2022 21:26:31 +0000 (23:26 +0200)]
[QUIC] Update to msquic 2 (#67383)

* Update to msquic 2, test and code fixes

* feedback

* Fixed more HTTP/3 bugs

* updated fedora image to contain the newest msquic

* Better test debugging, fixed some timeouts

* feedback

* Return some msquic calls into a lock

2 years agoRely on PGO for isinst/castclass (#65922)
Egor Bogatov [Fri, 1 Apr 2022 21:25:56 +0000 (00:25 +0300)]
Rely on PGO for isinst/castclass (#65922)

2 years ago[Group 5] Enable nullable annotations for `Microsoft.Extensions.Configuration.Xml...
Maksym Koshovyi [Fri, 1 Apr 2022 20:40:47 +0000 (23:40 +0300)]
[Group 5] Enable nullable annotations for `Microsoft.Extensions.Configuration.Xml` (#67178)

2 years ago[Group 6] Enable nullable annotations for Microsoft.Extensions.Logging.Configuration...
Maksym Koshovyi [Fri, 1 Apr 2022 19:51:27 +0000 (22:51 +0300)]
[Group 6] Enable nullable annotations for Microsoft.Extensions.Logging.Configuration (#67174)

2 years agoUse a simpler representation for array addresses after morph (#64581)
SingleAccretion [Fri, 1 Apr 2022 19:35:27 +0000 (22:35 +0300)]
Use a simpler representation for array addresses after morph (#64581)

* Do not copy flags in ADDR/COMMA opt

We only need to update the side effects, and
gtUpdateNodeSideEffects already takes care of that.

Will avoid copying GTF_NO_CSE unnecessarily.

No diffs.

* Add GT_ARR_ADDR

* Generate ARR_ADDR in morph

* gtSetEvalOrder tuning

* Delete the ArrayInfo map

* Delete GTF_IND_ARR_INDEX

* Make ARR_ADDR non-null

This preserves the non-faultness annotation for the parent
indir when ADDR(IND(ARR_ADDR)) -> ARR_ADDR folding happends.

* Simplify the array address parsing

We don't need the field sequence or the complex parsing.

A few diffs because previos code didn't handle COMMAs.
(The new code doesn't either, but they are skipped
automatically by the optComputeLoopSideEffectsOfBlock).

* Clean ParseArrayAddress up

Move it to GenTreeArrAddr, stop using ArrayInfo.

* More ParseArrayAddress cleanup

FldSeq no loger expected or needed. We will be
attaching it to ARR_ADDR directly in the future.

* Delete index labeling

And associated code. No longer needed, and we
will use a different mechanism for ARR_ADDR.

No diffs.

* Delete the last pseudo-field

No longer needed...

* Delete ArrayInfo

* Fix formatting

2 years ago[mono] Fix static virtual calls to generic methods from gshared code (#66739)
Vlad Brezae [Fri, 1 Apr 2022 19:27:49 +0000 (22:27 +0300)]
[mono] Fix static virtual calls to generic methods from gshared code (#66739)

* [mono] Fix static virtual calls to generic methods from gshared code

When the resolved method from the vtable is generic, we need to inflate it.

For example, in the gshared method we are calling on `Interface.InterfaceMethod<int> ()` (the type argument can either be fixed or determined based on the gshared method's context), and this method is resolved to generic method `Class.InterfaceMethod<T> ()`. We then need to inflate the method and resolve `T` to `int`.

* Enable tests

* [mono][interp] Fix calls to static virtual methods via delegates

* [mono][aot] Fix constrained + ldftn

* [mono][gsharing] Fix constrained + ldftn from gshared method

We can'd determine at compile time the static method if the constrained_class is a generic parameteri. We defer the computation of the method at runtime, in a similar fashion with calls.

* Disable test suite on android

It hits an issue in the android test runner

2 years agoBump Intellisense to Preview2 (#67396)
Carlos Sanchez [Fri, 1 Apr 2022 19:05:42 +0000 (12:05 -0700)]
Bump Intellisense to Preview2 (#67396)

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
2 years agoRevert "[mono][workload] Add workloads for win-arm64 using emulation again" (#67450)
Larry Ewing [Fri, 1 Apr 2022 18:51:56 +0000 (13:51 -0500)]
Revert "[mono][workload] Add workloads for win-arm64 using emulation again" (#67450)

This reverts commit eaa1f05dae0075a4709264b637f36e0f557cc2bb.

2 years ago[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.EventLog...
Maksym Koshovyi [Fri, 1 Apr 2022 18:43:38 +0000 (21:43 +0300)]
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.EventLog` (#67200)

2 years agoPublish crossgen as AOT if supported by the target platform (#65948)
Andy Gocke [Fri, 1 Apr 2022 17:22:28 +0000 (10:22 -0700)]
Publish crossgen as AOT if supported by the target platform (#65948)

Publishes crossgen as an AOT binary on Windows+Linux x64+ARM64, otherwise publishes as an R2R single file.

Closes #60016

2 years agoMake the cross-component build just another invocation of the build-runtime script...
Jeremy Koritzinsky [Fri, 1 Apr 2022 17:08:23 +0000 (10:08 -0700)]
Make the cross-component build just another invocation of the build-runtime script (#67108)

2 years agoFix IsPrefix and IsSuffix with ignored characters (#67370)
Tarek Mahmoud Sayed [Fri, 1 Apr 2022 16:26:33 +0000 (09:26 -0700)]
Fix IsPrefix and IsSuffix with ignored characters (#67370)

2 years agoUpdate dependencies from https://github.com/dotnet/roslyn-analyzers build 20220330...
dotnet-maestro[bot] [Fri, 1 Apr 2022 16:05:58 +0000 (12:05 -0400)]
Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20220330.6 (#67382)

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22174.1 -> To Version 7.0.0-preview1.22180.6

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[iOS] Enable some previously skipped tests (#65652)
Steve Pfister [Fri, 1 Apr 2022 14:35:22 +0000 (10:35 -0400)]
[iOS] Enable some previously skipped tests (#65652)

Enabling because the underlying issues appear to have been fixed.

https://github.com/dotnet/runtime/issues/56085
https://github.com/dotnet/runtime/issues/52460