Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 74599 to 7.0 #75365

Closed
wants to merge 179 commits into from

Conversation

StephenMolloy
Copy link
Member

Manually backporting #74599 to 7.0 for RC2.

github-actions bot and others added 30 commits August 16, 2022 18:22
…'t have debug information (dotnet#74029)

* adding fields that are from non-user-code as private

* Do not show members from types that doesn't have debug information if JMC is enabled.

* Addressing @radical comments.

* Apply suggestions from code review

Co-authored-by: Ankit Jain <radical@gmail.com>

* Adding more tests.

Co-authored-by: Thays Grazia <thaystg@gmail.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
…rsion for libraries dependencies (dotnet#74024)

Co-authored-by: carlossanlop <1175054+carlossanlop@users.noreply.github.com>
Co-authored-by: Sven Boemer <sbomer@gmail.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
…vocation (dotnet#74043)

* [mono] Implement missing functionality for cctor invocation

* [mono] Re-enable test

Co-authored-by: Vlad Brezae <brezaevlad@gmail.com>
* Optimized string.Replace(char, char) vector code path

* Optimized code pathes even further

* Do vectorized operation at the end of the string only once

When the remaining length is a multiple of the vector size, then the remainder is processed twice. This is redundant, and not needed.
This commit changes that, so that the remainder is processed only once when the remaining elements match.

* Don't use trick for collapsed epilogs

Cf. dotnet#67049 (comment)

* Handle remainder vectorized even if remainingLength <= Vector<ushort>.Count and added tests for this

* Introduce (internal) Vector.LoadUnsafe and Vector.StoreUnsafe and use it in string.Replace(char, char)

* Avoid Unsafe.As<char, ushort> reinterpret casts by introducing string.GetRawStringDataAsUshort() internal method

* Fixed copy/paste error (from local dev to repo)

* PR Feedback

* Fixed bug and added tests for this

* Make condition about lengthToExamine clearer as suggested

Co-authored-by: Günther Foidl <gue@korporal.at>
…chives (dotnet#74054)

* Update arcade to 7.0.0-beta.22416.1
* Port workload changes from release/6.0
* workloads: Add multithread, and perftrace runtime packs for wasm workload
* Mono.ToolChain.Manifest short name
* Change order of shortnames

Co-authored-by: Juan Sebastian Hoyos Ayala <juan.hoyos@microsoft.com>
Co-authored-by: Jacques Eloff <joeloff@users.noreply.github.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
…reload-utils dotnet/runtime-assets (dotnet#74074)

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

runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 11.1.0-alpha.1.22412.3 -> To Version 11.1.0-alpha.1.22415.2

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22408.2 -> To Version 1.1.0-alpha.0.22415.2

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

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.22409.1 -> To Version 7.0.0-beta.22415.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…#73768) (dotnet#74086)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* perf pipeline: Switch to node 14.x

- Switch to node 14.x instead of 18.x, because the latter doesn't seem
to be compatible with ubuntu 18.x:
`node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)`

- Also, remove the existing `nodejs` package before installing a new
one, because these machines are shared, and would get affected by
installations performed by other runs.

* perf pipeline: install wasm pre-reqs only on wasm jobs

* perf pipeline: correctly return exit code, so helix can pick that up and set _commandExitCode

* Set a default value for non-wasm cases

* Change the prereqs condition so a failure needs to be explicitly marked

This allows cases which don't care about this, to continue working,
because they won't set `$PERF_PREREQS_INSTALL_FAILED`, and default to
continuing with the job.

* Use --user with pip install

* Update eng/testing/performance/microbenchmarks.proj

Co-authored-by: Ankit Jain <radical@gmail.com>
…et#74094)

Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
…nment correctly (dotnet#74091)

* New test

* Fix auto layout algorithm to compute structure alignment correctly - In particular: 1. The alignment requirement imposed by of a non-primitive, non-enum valuetype field is the alignment of that field 2. The alignment requirement imposed by a primitive is the pointer size of the target platform, unless running on Arm32, in which case if the primitive or enum is 8 bytes in size, the alignment requirement is 8.

- The previous implementation produced an alignment of pointer size, unless running on Arm32 and one of the fields had an alignment requirement of 8 (in which case the alignment requirement computed for the structure would be 8)

In addition, add a test which verifies that the instance field layout test types are actually producing R2R compatible results at runtime.
 - This test shows that we have some issues around explicit layout, so I was forced to disable that portion of the test for now.

Fixes dotnet#65281

* Re-enable disabled test

* Remove file that shouldn't be added as part of the new test

* Make a few test types public to silence unassigned field errors

* Update comments and add more testing

Co-authored-by: David Wrighton <davidwr@microsoft.com>
Co-authored-by: Tomas Rylek <trylek@microsoft.com>
…et#74098)

* Add Arm64 PGO/IBC to Windows and Linux builds

* WIP

* Update opt data package version

Co-authored-by: Drew Scoggins <anscoggi@microsoft.com>
…dotnet#74116)

* Fix nullable annotations on generic math interfaces

- All `where TSelf : ...` constraints become `where TSelf : ...?`.  Without this, trying to define a type like `Matrix<T> where T : INumber<T>?` in order to support nullable T types warns because `INumber<T>` constrains its `T` (`TSelf`) to be non-nullable.
- All `where TOther : ...` constraints are changed to be oblivious. They can't be correctly annotated as there's no way to express the nullability relationship with the nullability of TSelf.
- Use `[MaybeNullWhen(false)] out T` instead of `[NotNullWhen(true)] out T?`, as we do with other generics, since if the instantiation of `T` is nullable, we can't guarantee `NotNullWhen(true)`.
- Make `IEqualityOperators` `==` and `!=` accept `TSelf?`. This keeps it consistent with `IEquatable<T>.Equals(T?)`, `IEqualityComparer<in T>.Equals(T?, T?)`, `IEqualityComparer.Equals(object?, object?)`, `IStructuralEquatable.Equals(object?, IEqualityComparer)`, and `object.Equals(object?)` which all allow null even if generic and the generic is non-null. It in turn enables checks like `T.Zero == default` without nullability warnings.

* Address PR feedback

Co-authored-by: Stephen Toub <stoub@microsoft.com>
…otnet#74144)

* Move runtimeconfig.template.json stuff to csproj

NativeAOT ignores this and emits a warning. This fails the test build.

* It wasn't just one

* Update src/libraries/System.Resources.ResourceManager/tests/System.Resources.ResourceManager.Tests.csproj

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
…ce if available (dotnet#74145)

* Emit parameter names

Fixes dotnet#73051

* Address PR feedback

* Rename things

* Apply suggestions from code review

Co-authored-by: jasperd <jasper-d@users.noreply.github.com>
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
…/7.0-rc1-to-release/7.0

[automated] Merge branch 'release/7.0-rc1' => 'release/7.0'
* Avoid transformation from multiplication to left shift in case of 64 bit value

* Fixed System.Collections.Concurrent.Tests timeout issue

* [ppc64le] Fixed test case failures

* [ppc64le] Incorporated code review comments

Co-authored-by: Sapana Khemkar <sapana.khemkar@ibm.com>
Co-authored-by: Sapana-Khemkar <94051076+Sapana-Khemkar@users.noreply.github.com>
Co-authored-by: Anton Lapounov <antonl@microsoft.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
…ix field layout behavior (dotnet#74279)

* First stab at support for proper 128bit integer layout and abi

* Add ABI tests for Int128 covering interesting scenarios

* Fix bugs so that at least Windows Arm64 works

* Add more types to the ABI tester, so that we cover the Int128 scenarios

* Revert changes which attempted to enable by value passing for Int128

* Make Int128 have layout match the expected unmanaged field layout - On Unix platforms (64 bit) use 16 byte alignment - On Arm32 use 8 byte alignment matching the 128 byte vector type - On other Windows platforms the 128 bit integer type isn't defined by the C compiler, but match the behavior of other 128 bit types (16 byte alignment)

Add tests to call down to native that should pass with these rules

- Disable use of Int128 as p/invoke parameter passed by value

* Mark Int128 types as not having a stable abi - This disables use of these types for parameter passing in R2R images

* Address all known issues

* Try to fix PR job

* Should fix the test issues

* Apply suggestions from code review

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>

Co-authored-by: David Wrighton <davidwr@microsoft.com>
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
Lets us make dotnet#72645 a non-blocking-release issue.

We also set NativeAotSupported to false for Mac on the line above. Crossgen2 will still ship NativeAOT compiled on x64 Linux and Windows. R2R+SingleFile+Trimmed elsewhere.

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
…#74220)

* Add a way to suppress all trimming warnings

Fixes dotnet#73926.

Also adding AOT analysis suppression for parity.

I didn't port the warning level support because the compat kind of goes beyond that. We can revisit later if needed.

* Update Microsoft.NETCore.Native.targets

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Port of dotnet/linker#2979

Fixes dotnet#73048.

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
…/7.0-rc1-to-release/7.0

[automated] Merge branch 'release/7.0-rc1' => 'release/7.0'
…dpowTest.ModPowAxiom test (dotnet#74181)

* Fixed dotnet#70330

* Removed pessimistic buffer cleanup

Co-authored-by: sakno <roman.sakno@gmail.com>
…pper half to be save/restore (dotnet#74192)

* Revert "Ensure that GT_CNS_VEC is handled in LinearScan::isMatchingConstant (dotnet#70171)"

This reverts commit 24f5de4.

* Revert "Revert "Ensure that GT_CNS_VEC is handled in LinearScan::isMatchingConstant (dotnet#70171)""

This reverts commit 984120f.

* Add partial save check

* Use the correct register type

Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
jakobbotsch and others added 12 commits September 8, 2022 10:27
…amespaces/generics in release (dotnet#75260)

* JIT: Simplify JitDisasm matching behavior  (dotnet#74430)

This changes how the JIT matches method names and signatures for method
sets (e.g. JitDisasm). It also starts printing method instantiations for full method names
and makes references to types consistent in generic instantiations and the signature.
In addition it starts supporting generic instantiations in release too.
To do this, most of the type printing is moved to the JIT, which also aligns the output
between crossgen2 and the VM (there were subtle differences here, like spaces between generic type arguments).
More importantly, we (for the most part) stop relying on JIT-EE methods that are documented to only be for debug purposes.

The new behavior of the matching is the following:

* The matching behavior is always string based.
* The JitDisasm string is a space-separated list of patterns. Patterns can arbitrarily
   contain both '*' (match any characters) and '?' (match any 1 character).
* The string matched against depends on characters in the pattern:
    + If the pattern contains a ':' character, the string matched against is prefixed by the class name and a colon
    + If the pattern contains a '(' character, the string matched against is suffixed by the signature
    + If the class name (part before colon) contains a '[', the class contains its generic instantiation
    + If the method name (part between colon and '(') contains a '[', the method contains its generic instantiation

For example, consider

```
namespace MyNamespace
{
    public class C<T1, T2>
    {
        [MethodImpl(MethodImplOptions.NoInlining)]
        public void M<T3, T4>(T1 arg1, T2 arg2, T3 arg3, T4 arg4)
        {
        }
    }
}

new C<sbyte, string>().M<int, object>(default, default, default, default); // compilation 1
new C<int, int>().M<int, int>(default, default, default, default); // compilation 2
```
The full strings are:
Before the change:

```
MyNamespace.C`2[SByte,__Canon][System.SByte,System.__Canon]:M(byte,System.__Canon,int,System.__Canon)
MyNamespace.C`2[Int32,Int32][System.Int32,System.Int32]:M(int,int,int,int)
```
Notice no method instantiation and the double class instantiation, which seems like an EE bug. Also two different names are used for sbyte: System.SByte and byte.

After the change the strings are:

```
MyNamespace.C`2[byte,System.__Canon]:M[int,System.__Canon](byte,System.__Canon,int,System.__Canon)
MyNamespace.C`2[int,int]:M[int,int](int,int,int,int)
```

The following strings will match both compilations:

```
M
*C`2:M
*C`2[*]:M[*](*)
MyNamespace.C`2:M
```

The following will match only the first one:

```
M[int,*Canon]
MyNamespace.C`2[byte,*]:M
M(*Canon)
```

There is one significant change in behavior here, which is that I have removed the special case that allows matching class names without namespaces. In particular, today Console:WriteLine would match all overloads of System.Console.WriteLine, while after this change it will not match. However, with generalized wild cards the replacement is simple in *Console:WriteLine.

* Update JIT-EE GUID

Avoid using the same JIT-EE GUID as the main branch.
…5250)

For large field offsets we need to insert explicit null checks. This was
breaking recognition of unaligned accesses that needs special treatment
for floating point instructions.

Fix dotnet#74260

Co-authored-by: Jakob Botsch Nielsen <jakob.botsch.nielsen@gmail.com>
…pipeline to runtime-extra-platforms (dotnet#75273)

Backport of dotnet#74621

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
* Update: Fix Race Condition Issue

* Update: Review changes

* Update: Review change

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>

* Update: Add comment to volatile field

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

* Update src/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs

Co-authored-by: Karel Zikmund <karelz@microsoft.com>

Co-authored-by: Ahmet Ibrahim Aksoy <aaksoy@microsoft.com>
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Karel Zikmund <karelz@microsoft.com>
…time-assets dotnet/hotreload-utils dotnet/roslyn-analyzers (dotnet#75056)

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22451.2 -> To Version 1.1.0-alpha.0.22452.1

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

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22451.2 -> To Version 7.0.0-preview1.22452.2

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

runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 11.1.0-alpha.1.22451.2 -> To Version 11.1.0-alpha.1.22455.2

* Update dependencies from https://github.com/dotnet/runtime-assets build 20220906.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.22451.1 -> To Version 7.0.0-beta.22456.1

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22451.2 -> To Version 1.1.0-alpha.0.22456.2

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

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

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update dependencies from https://github.com/dotnet/icu build 20220907.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-rc.2.22451.2 -> To Version 7.0.0-rc.2.22457.1

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-rc.2.22451.2 -> To Version 7.0.0-rc.2.22458.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update dependencies from https://github.com/dotnet/emsdk build 20220907.1

Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100 , Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100
 From Version 7.0.0-rc.2.22451.4 -> To Version 7.0.0-rc.2.22457.1

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

Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100 , Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100
 From Version 7.0.0-rc.2.22451.4 -> To Version 7.0.0-rc.2.22458.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…)` (dotnet#75284)

* Don't ignore mode in IFloatingPoint.Round(TSelf, MipointRounding) DIM

* Fix recursion in IExponentialFunctions.Exp10M1's DIM

* Add tests for IExponentialFunctions.Exp10M1's DIM

* Add tests for IFloatingPoint.Round's DIM

* fix nits from tannergooding

Co-authored-by: Blokyk <32983140+Blokyk@users.noreply.github.com>
Co-authored-by: Blokyk <eliot.courvoisier@gmail.com>
…t timeout check boundaries (dotnet#75308)

* Test for exposing timeout check bug

* Fix timeout check bug

* Improve naming

* Simplify test

* Make test search range higher

* Simplify test for timeout check bug

Co-authored-by: Olli Saarikivi <olsaarik@microsoft.com>
Co-authored-by: vsadov <8218165+VSadov@users.noreply.github.com>
@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost
Copy link

ghost commented Sep 9, 2022

Tagging subscribers to this area: @dotnet/area-system-reflection-metadata
See info in area-owners.md if you want to be subscribed.

Issue Details

Manually backporting #74599 to 7.0 for RC2.

Author: StephenMolloy
Assignees: StephenMolloy
Labels:

area-System.Reflection.Metadata, new-api-needs-documentation

Milestone: -

@ghost ghost locked as resolved and limited conversation to collaborators Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.