platform/upstream/dotnet/runtime.git
2 years agoUpdate string marshallers to V2 shape (#71849)
Aaron Robinson [Sun, 10 Jul 2022 02:20:48 +0000 (19:20 -0700)]
Update string marshallers to V2 shape (#71849)

* Update to string marshallers to new V2 shape.

* Fix incorrect BStr casing.

* Use NativeMemory.Alloc/Free where possible.
Avoid initialization of marshaller when not used.
Remove unneccessary unmanaged->managed APIs for In marshallers.

* Add a ClassLoader::LoadTypeByNameThrowing overload
  that can be used to load nested classes.

* Allocate precise amounts for UTF8 and ANSI marshallers.

* Use CoTaskMemAlloc/Free

* Keep allocation in local.

2 years agoAdd AggressiveInlining to a couple of Vector.Create methods (#71889)
Egor Bogatov [Sun, 10 Jul 2022 01:08:59 +0000 (03:08 +0200)]
Add AggressiveInlining to a couple of Vector.Create methods (#71889)

2 years ago[main] Update dependencies from dotnet/arcade (#71631)
dotnet-maestro[bot] [Sun, 10 Jul 2022 01:06:55 +0000 (21:06 -0400)]
[main] Update dependencies from dotnet/arcade (#71631)

* Update dependencies from https://github.com/dotnet/arcade build 20220704.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.22327.2 -> To Version 7.0.0-beta.22354.1

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

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.22327.2 -> To Version 7.0.0-beta.22355.4

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

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.22327.2 -> To Version 7.0.0-beta.22356.3

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

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.22327.2 -> To Version 7.0.0-beta.22358.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoPass CancellationToken to Http2Connection SetupAsync (#70906)
campersau [Sun, 10 Jul 2022 01:04:01 +0000 (03:04 +0200)]
Pass CancellationToken to Http2Connection SetupAsync (#70906)

* Pass cancellation token to Http2Connection SetupAsync

* PR feedback

2 years agoConvert a few trivial Type, RuntimeType and Enum FCalls to C# (#71873)
Jan Kotas [Sun, 10 Jul 2022 01:01:45 +0000 (18:01 -0700)]
Convert a few trivial Type, RuntimeType and Enum FCalls to C# (#71873)

2 years agoMove System.Drawing files from Common to System.Drawing.Primitives (#71878)
Filip Navara [Sat, 9 Jul 2022 19:52:53 +0000 (21:52 +0200)]
Move System.Drawing files from Common to System.Drawing.Primitives (#71878)

2 years ago[wasm] Bump emscripten to 3.1.12 (#70693)
Radek Doulik [Sat, 9 Jul 2022 19:44:33 +0000 (21:44 +0200)]
[wasm] Bump emscripten to 3.1.12 (#70693)

* Use new docker images
* Silence warnings
* Bump dependencies
* Bump emscripten version
* Update dependencies
* Fix linking
* Move the link fix to default link response file

To make tests build
* Disable one more test
Affected by https://github.com/dotnet/runtime/issues/51375

* Ignore link errors coming from native refs
This avoids this error, where the linker seems more strict now:
```
      [] EXEC : error : undefined symbol: _ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv (referenced by top-level compiled C/C++ code) [/datadisks/disk1/work/BDDD0A63/w/A3D60932/e/blz_nativeref_aot_Debug/blz_nativeref_aot_Debug.csproj]
      [] EXEC : warning : Link with `-sLLD_REPORT_UNDEFINED` to get more information on undefined symbols [/datadisks/disk1/work/BDDD0A63/w/A3D60932/e/blz_nativeref_aot_Debug/blz_nativeref_aot_Debug.csproj]
      [] EXEC : warning : To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0` [/datadisks/disk1/work/BDDD0A63/w/A3D60932/e/blz_nativeref_aot_Debug/blz_nativeref_aot_Debug.csproj]
      [] EXEC : warning : __ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library [/datadisks/disk1/work/BDDD0A63/w/A3D60932/e/blz_nativeref_aot_Debug/blz_nativeref_aot_Debug.csproj]
      [] EXEC : error : undefined symbol: _ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv (referenced by top-level compiled C/C++ code) [/datadisks/disk1/work/BDDD0A63/w/A3D60932/e/blz_nativeref_aot_Debug/blz_nativeref_aot_Debug.csproj]
      [] EXEC : warning : __ZNKSt3__221__basic_string_commonILb1EE20__throw_length_errorEv may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library [/datadisks/disk1/work/BDDD0A63/w/A3D60932/e/blz_nativeref_aot_Debug/blz_nativeref_aot_Debug.csproj]
      [] EXEC : error : Aborting compilation due to previous errors [/datadisks/disk1/work/BDDD0A63/w/A3D60932/e/blz_nativeref_aot_Debug/blz_nativeref_aot_Debug.csproj]
      [] emcc : error : '/datadisks/disk1/work/BDDD0A63/w/A3D60932/e/dotnet-workload/packs/Microsoft.NET.Runtime.Emscripten.3.1.12.Node.linux-x64/7.0.0-preview.6.22308.2/tools/bin/node
```
* Avoid another linker error in tests
* Disable failing test
* Try to use emscripten_force_exit in mono_wasm_exit

* Bump docker image to get newer v8
* Fix remaining conflict
* Use 3.1.12 icu again, it was lost with merge
* Revert "Try to use emscripten_force_exit in mono_wasm_exit"

This reverts commit bdba37b8a7ac96cead35758dc234b3d71b13880d.

* Revert "Ignore link errors coming from native refs"
This reverts commit f2bfa1f22e84ecd6e9e84142ce87a97a9ecf69c3.

* [wasm] Don't run tests on windows with v8
- We are only interested in testing with v8 on linux

This changes:
1. All the AOT tests to run with browser on windows
2. Library tests (interpreter) will run with browser, and nodejs

* Fix System.Net.Http.Functional.Tests failing due to trimming
.. on Windows/AOT:
* [wasm] Fix windows/tests/aot timeout to be same for running on browser
.. as for v8.
* Disable failing tests - issue#71877

Co-authored-by: Radek Doulik <radekdoulik@google.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoUpdate dependencies from https://github.com/dotnet/msquic build 20220708.1 (#71880)
dotnet-maestro[bot] [Sat, 9 Jul 2022 19:00:36 +0000 (21:00 +0200)]
Update dependencies from https://github.com/dotnet/msquic build 20220708.1 (#71880)

System.Net.MsQuic.Transport
 From Version 7.0.0-alpha.1.22357.1 -> To Version 7.0.0-alpha.1.22358.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoUse u8 string in CultureNames (#71417)
Adeel Mujahid [Sat, 9 Jul 2022 12:24:45 +0000 (15:24 +0300)]
Use u8 string in CultureNames (#71417)

* Use u8 in CultureNames

* Update compiler version for u8 bug fix

* Update compiler toolset to 4.4.0-1.22358.14

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 186951...
dotnet bot [Sat, 9 Jul 2022 11:50:29 +0000 (04:50 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1869518 (#71867)

2 years agoUse the portable timer implementation in CoreCLR (#71864)
Koundinya Veluri [Sat, 9 Jul 2022 11:03:07 +0000 (04:03 -0700)]
Use the portable timer implementation in CoreCLR (#71864)

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

2 years agoUse HashCode.Combine instead of ValueTuple.GetHashCode in MatchingState (#71859)
Stephen Toub [Sat, 9 Jul 2022 10:54:30 +0000 (06:54 -0400)]
Use HashCode.Combine instead of ValueTuple.GetHashCode in MatchingState (#71859)

2 years agoEnable `TYP_STRUCT` `LCL_VAR/LCL_FLD` call args on ARM (#71598)
SingleAccretion [Sat, 9 Jul 2022 08:59:13 +0000 (11:59 +0300)]
Enable `TYP_STRUCT` `LCL_VAR/LCL_FLD` call args on ARM (#71598)

* ARM: local morph

* ARM: morph

* Jit dumps: print '(AX)' and others for LCL_FLD nodes

* Delete invalid assert

* Work around emitter limitations

2 years ago[wasm] JSImport and JSExport code gen (#71551)
Pavel Savara [Sat, 9 Jul 2022 07:28:50 +0000 (09:28 +0200)]
[wasm] JSImport and JSExport code gen (#71551)

-    based on shared infrastructure of LibraryImport code gen
-    few unit tests
-    localized diagnostic messages

Co-authored-by: Marek Fišera <mara@neptuo.com>
2 years ago[main] Update dependencies from dotnet/linker (#71378)
dotnet-maestro[bot] [Sat, 9 Jul 2022 05:50:00 +0000 (01:50 -0400)]
[main] Update dependencies from dotnet/linker (#71378)

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

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22324.1 -> To Version 7.0.100-1.22327.2

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

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22324.1 -> To Version 7.0.100-1.22328.1

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

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22324.1 -> To Version 7.0.100-1.22329.1

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

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22324.1 -> To Version 7.0.100-1.22329.2

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

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22324.1 -> To Version 7.0.100-1.22351.1

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

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22324.1 -> To Version 7.0.100-1.22354.1

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

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22324.1 -> To Version 7.0.100-1.22357.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoUpdating the Generic Math to match final API review feedback (#71800)
Tanner Gooding [Sat, 9 Jul 2022 04:58:35 +0000 (21:58 -0700)]
Updating the Generic Math to match final API review feedback (#71800)

* Updating the generic math implementation to match final API review feedback

* Updating the generic math reference to match final API review feedback

* Updating the generic math tests to match final API review feedback

* Break IComparisonOperators and IEqualityOperators typeloading cycle

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years ago[main] Update dependencies from dotnet/hotreload-utils (#70724)
dotnet-maestro[bot] [Sat, 9 Jul 2022 04:43:28 +0000 (23:43 -0500)]
[main] Update dependencies from dotnet/hotreload-utils (#70724)

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22306.2 -> To Version 1.1.0-alpha.0.22313.2

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22306.2 -> To Version 1.1.0-alpha.0.22320.2

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22306.2 -> To Version 1.1.0-alpha.0.22327.2

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22306.2 -> To Version 1.1.0-alpha.0.22354.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
2 years ago[main] Update dependencies from dotnet/xharness (#71866)
dotnet-maestro[bot] [Sat, 9 Jul 2022 04:22:31 +0000 (00:22 -0400)]
[main] Update dependencies from dotnet/xharness (#71866)

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

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoDo not throw BadImageFormat from the type system (#71820)
Michal Strehovský [Sat, 9 Jul 2022 03:32:17 +0000 (12:32 +0900)]
Do not throw BadImageFormat from the type system (#71820)

This shoots down AOT-usage. Throw whatever is the type system's version of the exception.

2 years agoEnable Rfc2898DeriveBytes on Browser WASM (#71768)
Eric Erhardt [Sat, 9 Jul 2022 02:51:14 +0000 (20:51 -0600)]
Enable Rfc2898DeriveBytes on Browser WASM (#71768)

* Enable Rfc2898DeriveBytes on Browser WASM

Marks the APIs as supported on Browser, and enables Rfc2898 tests on Browser WASM.
Use SubtleCrypto deriveBits API to implement one shot Pbkdf2.

* Mark HKDF as supported on Browser and enable tests

Contributes to #40074

2 years agoHandle unary operator GT_CNEG_LT in few code paths (#71845)
Kunal Pathak [Sat, 9 Jul 2022 02:25:16 +0000 (19:25 -0700)]
Handle unary operator GT_CNEG_LT in few code paths (#71845)

2 years agoMove _OOP_find_proc_info to libunwind (#71465)
Adeel Mujahid [Sat, 9 Jul 2022 02:13:52 +0000 (05:13 +0300)]
Move _OOP_find_proc_info to libunwind (#71465)

2 years agoEnabled `System.ComponentModel.TypeConverter.Tests`. (#71821)
Ilona Tomkowicz [Sat, 9 Jul 2022 00:40:18 +0000 (02:40 +0200)]
Enabled `System.ComponentModel.TypeConverter.Tests`. (#71821)

* Enabled - passing.

* Fix tests when running with trimming.

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoAdd an Azure NPM registry (#71393)
Andy Gocke [Sat, 9 Jul 2022 00:03:03 +0000 (17:03 -0700)]
Add an Azure NPM registry (#71393)

* Add an Azure NPM registry

* Get verbose output for 'npm audit'

* Audit against a registry that supports auditing

Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
2 years agoAdd basic regression testing for .NET 6 source generated JsonSerializerContext. ...
Eirik Tsarpalis [Fri, 8 Jul 2022 23:53:46 +0000 (00:53 +0100)]
Add basic regression testing for .NET 6 source generated JsonSerializerContext. (#71850)

* Add basic regression testing for .NET 6 source generated JsonSerializerContext.

* Add a negative test for combined v6 contexts

* Add README.md

2 years agoAdd/implement ObsoletedInOSPlatformAttribute. (#71846)
Rolf Bjarne Kvinge [Fri, 8 Jul 2022 23:43:27 +0000 (01:43 +0200)]
Add/implement ObsoletedInOSPlatformAttribute. (#71846)

2 years agoFix more warnings from updated IDE rules (#71779)
Stephen Toub [Fri, 8 Jul 2022 21:55:09 +0000 (17:55 -0400)]
Fix more warnings from updated IDE rules (#71779)

A newer version of Microsoft.CodeAnalysis.* causes some of the rules to fire in more cases.  Fixing them proactively before we ingest newer versions of these libs.

2 years agoFix stack overflow from start set calculation (#71842)
Olli Saarikivi [Fri, 8 Jul 2022 21:27:49 +0000 (14:27 -0700)]
Fix stack overflow from start set calculation (#71842)

Fixes issue (#71808) where deeply nested structures caused the start set
computation to overflow the stack.
Re-introduces bottom-up computation of start sets that (#71234) had reworked.
As an optimization, the Singleton node's set field is reused as the start set
field, since for Singleton nodes the two concepts coincide and other node types
do not need the set.

2 years agoAlways expand "obj is ExactClass" even in cold blocks (#71739)
Egor Bogatov [Fri, 8 Jul 2022 19:24:16 +0000 (21:24 +0200)]
Always expand "obj is ExactClass" even in cold blocks (#71739)

2 years agoAdd missing APIs to contract customization (#71797)
Eirik Tsarpalis [Fri, 8 Jul 2022 18:45:08 +0000 (19:45 +0100)]
Add missing APIs to contract customization (#71797)

* Add missing APIs to contract customization

* Address feedback

2 years agoCheck for V2 shapes on array marshallers (#71796)
Elinor Fung [Fri, 8 Jul 2022 18:16:44 +0000 (11:16 -0700)]
Check for V2 shapes on array marshallers (#71796)

2 years agoUpdate Compiles.cs (#71837)
Aaron Robinson [Fri, 8 Jul 2022 18:15:18 +0000 (11:15 -0700)]
Update Compiles.cs (#71837)

Missed passing `ID()` for a test case.

2 years agoDisable Runtime_57606 on win-arm32 (#71844)
Bruce Forstall [Fri, 8 Jul 2022 18:11:41 +0000 (11:11 -0700)]
Disable Runtime_57606 on win-arm32 (#71844)

Native varargs is not supported on win-arm32: #12979

2 years agoLess aggressive `stfld` spilling (#71663)
SingleAccretion [Fri, 8 Jul 2022 17:53:10 +0000 (20:53 +0300)]
Less aggressive `stfld` spilling (#71663)

* Simplify "st[s]fld" spilling

* Add a test

2 years ago[wasm] fix V8 events (#71834)
Pavel Savara [Fri, 8 Jul 2022 17:50:49 +0000 (19:50 +0200)]
[wasm] fix V8 events (#71834)

2 years agoRe-enable test now that the msbuild fix has propagated (#71745)
David Wrighton [Fri, 8 Jul 2022 17:49:14 +0000 (10:49 -0700)]
Re-enable test now that the msbuild fix has propagated (#71745)

2 years ago[mono] Update MonoAOTCompiler to provide reference assemblies location (#71787)
Mitchell Hwang [Fri, 8 Jul 2022 16:13:41 +0000 (12:13 -0400)]
[mono] Update MonoAOTCompiler to provide reference assemblies location (#71787)

* [mono] Update MonoAOTCompiler to provide reference assemblies location

* Address feedback

* Make ReferenceAssembliesForPGO an ITaskItem[]

* Default ReferenceAssembliesForPGO

* Clean up

2 years ago[main] Update dependencies from dotnet/xharness dotnet/runtime-assets dotnet/emsdk...
dotnet-maestro[bot] [Fri, 8 Jul 2022 16:11:12 +0000 (16:11 +0000)]
[main] Update dependencies from dotnet/xharness dotnet/runtime-assets dotnet/emsdk dotnet/msquic (#71762)

[main] Update dependencies from dotnet/xharness dotnet/runtime-assets dotnet/emsdk dotnet/msquic

2 years agoTar: for directories, use a default mask that has the 'x' bit. (#71760)
Tom Deseyn [Fri, 8 Jul 2022 15:50:11 +0000 (17:50 +0200)]
Tar: for directories, use a default mask that has the 'x' bit. (#71760)

* Tar: for directories, use a default mask that has the 'x' bit.

Without the 'x'-bit, the directories that get created are not
accessible.

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Formats.Tar/tests/TarTestsBase.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoReduce allocations when using DataContractSerializer with SurrogateTypes (#70620)
Daniel Svensson [Fri, 8 Jul 2022 15:33:19 +0000 (17:33 +0200)]
Reduce allocations when using DataContractSerializer with SurrogateTypes (#70620)

* Dont create HashSet unless needed in IsTypeSerializable

* Apply suggestions from code review

2 years agoMake sure the offset matches (#71792)
Kunal Pathak [Fri, 8 Jul 2022 15:16:22 +0000 (08:16 -0700)]
Make sure the offset matches (#71792)

2 years agoTar, Zip: respect umask when creating files. (#71647)
Tom Deseyn [Fri, 8 Jul 2022 14:43:49 +0000 (16:43 +0200)]
Tar, Zip: respect umask when creating files. (#71647)

* Tar, Zip: respect umask when creating files.

* Update UnixExtractFilePermissionsCompat

* Replace const int with const UnixFileMode.

* Also run tests with zero umask

2 years agoDisable several outerloop Regex tests stack overflowing (#71809)
Stephen Toub [Fri, 8 Jul 2022 14:27:58 +0000 (10:27 -0400)]
Disable several outerloop Regex tests stack overflowing (#71809)

2 years agoUse file-scoped types in RegexGenerator output (#71765)
Stephen Toub [Fri, 8 Jul 2022 14:26:19 +0000 (10:26 -0400)]
Use file-scoped types in RegexGenerator output (#71765)

* Use file-scoped types in RegexGenerator output

* Update System.Text.RegularExpressions.Tests.csproj

2 years agoEnable direct decomposition of promoted args on ARM (#71780)
SingleAccretion [Fri, 8 Jul 2022 12:50:30 +0000 (15:50 +0300)]
Enable direct decomposition of promoted args on ARM (#71780)

2 years agoDelete the zero-offset field sequence map (#71455)
SingleAccretion [Fri, 8 Jul 2022 12:49:20 +0000 (15:49 +0300)]
Delete the zero-offset field sequence map (#71455)

* Delete the unused GTF_ICON_FIELD_OFF

* Do not try to find "IND(struct ARR_ADDR)" handle

Leftover from GT_INDEX.

* Delete the zero-offset field sequence map

For statics at a zero offset, preserve the "CNS_INT 0" node instead.

* Make all field sequences singletons

* Print struct field offsets in the sequence

* Improve address mode marking to handle COMMAs

This avoids regressing cases where we now have new CSE
opportunities for statics with static init helper calls.

* Delete NotAField

Replace with using "nullptr" directly.

Note that "nullptr" can mean both an absense of a field
sequence and an "implicit" sequence of struct fields.

* Refactor the field sequence store

Now that we don't need the map to be a set, we can apply some optimizations.

* FieldSeqNode -> FieldSeq

* Turn asserts into "noway_assert"s

We don't expect empty sequences: they are either coming from
the "IsFieldAddr" code path, which disallows these, or from
the boxed static code path, where we should always have them.

* Fix formatting

* Take down SPMI

* Resurrect SPMI to work around a CG2 bug

2 years ago[wasm][debugger] Enable onCallFrame evaluation of static fields in classes/interfaces...
Ilona Tomkowicz [Fri, 8 Jul 2022 10:31:34 +0000 (12:31 +0200)]
[wasm][debugger] Enable onCallFrame evaluation of static fields in classes/interfaces from a static method. (#70560)

* Test for DIM - expected behavior.

* Static tests: renaming variables and small refactoring.

* Added new testcases and merged existing tests into Theories.

* Fix for resolving the name with namespace prefix matching the current frame location.

* Fix for tests failing on InvokeMethod in runtime.

* Applied smallest suggestions of @radical's review.

* Reverted deleting and renaming tests - only adding new.

* Corrected the logic + added new tests.

* Removed unnecessary logging.

2 years agoJIT: Remove some fgWalkTree uses (#71767)
Jakob Botsch Nielsen [Fri, 8 Jul 2022 08:42:08 +0000 (10:42 +0200)]
JIT: Remove some fgWalkTree uses (#71767)

Convert them to GenTreeVisitor.

2 years agoJIT: Handle GTF_REVERSE_OPS in fgMorphModToSubMulDiv (#71759)
Jakob Botsch Nielsen [Fri, 8 Jul 2022 08:33:26 +0000 (10:33 +0200)]
JIT: Handle GTF_REVERSE_OPS in fgMorphModToSubMulDiv (#71759)

We may see this in stress modes, and in general the JIT should be able to handle the flag.

2 years agoDetect generic recursion pattern in S.Linq.Parallel (#71802)
Michal Strehovský [Fri, 8 Jul 2022 06:19:54 +0000 (15:19 +0900)]
Detect generic recursion pattern in S.Linq.Parallel (#71802)

System.Linq.Parallel has multiple generic cycles in it. We probably hit them all in the System.Linq.Parallel.Tests assembly. We would be compiling the test forever (or until running out of memory) because we didn't detect one of them.

Add detection for the case where the recursion is entered through a generic interface virtual method call. The compiler terminates the infinite expansion after the user-specifiable cutoff point.

The test shows the pattern and the expected behavior.

2 years agoDelete invalid GVM analysis optimization (#71803)
Michal Strehovský [Fri, 8 Jul 2022 04:49:43 +0000 (13:49 +0900)]
Delete invalid GVM analysis optimization (#71803)

There was an optimization that was trying to prevent the compiler from doing unnecessary work when analyzing generic virtual methods. The optimization is invalid.

2 years agoSupport stateful linear collection marshalling (#71788)
Elinor Fung [Fri, 8 Jul 2022 03:06:11 +0000 (20:06 -0700)]
Support stateful linear collection marshalling (#71788)

- Find shape data for stateful collection marshallers
- Add marshalling strategy implementations for stateful collection marshalling of blittable elements and non-blittable elements
- Refactor non-blittable element handling into a base class for shared functionality between stateless and stateful
  - Probably can share more for blittable element handling too, but I'll plan to do that in a follow-up after getting general support in.
- Tests for stateful marshallers for `List<T>` and arrays

2 years agoNonBacktracking locking fixes and cleanup (#71234)
Olli Saarikivi [Fri, 8 Jul 2022 01:50:38 +0000 (18:50 -0700)]
NonBacktracking locking fixes and cleanup (#71234)

* Concurrency fixes and refactoring for clarity

Removed builder reference from SymbolicRegexNode instances; builder now
has to be passed in. Since the builder is not thread safe this clarifies
the locking required in the matcher when using it.
Moved matching specific state from the builder to the matcher. This
includes state and transition arrays.
Simplify character kind code by eliminating duplication of logic.

* Changes from review and cleanup

DfaMatchingState is now just MatchingState

* Comment on NFA mode IDs

2 years agoChanged the number of Maui iOS Blazor startups from 7 to 5. (#71781)
Parker Bibus [Thu, 7 Jul 2022 23:40:51 +0000 (18:40 -0500)]
Changed the number of Maui iOS Blazor startups from 7 to 5. (#71781)

2 years agoSilence SPMI replay REL32 reloc warning on 32-bit (#71750)
Bruce Forstall [Thu, 7 Jul 2022 23:30:32 +0000 (16:30 -0700)]
Silence SPMI replay REL32 reloc warning on 32-bit (#71750)

Fixes #61482

2 years agoUpdate all internal marshallers to the new model (#71470)
Jeremy Koritzinsky [Thu, 7 Jul 2022 23:26:52 +0000 (16:26 -0700)]
Update all internal marshallers to the new model (#71470)

2 years agoRemove implicit fallback to reflection-based serialization (#71746)
Eirik Tsarpalis [Thu, 7 Jul 2022 23:22:47 +0000 (00:22 +0100)]
Remove implicit fallback to reflection-based serialization (#71746)

* Remove implicit fallback to reflection-based serialization. Fix #71714

Include JsonSerializerContext in JsonSerializerOptions copy constructor. Fix #71716

Move reflection-based converter resolution out of JsonSerializerOptions. Fix #68878

* Address feedback & add one more test

* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerContext.cs

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

* Bring back throwing behavior in JsonSerializerContext and add tests

* Only create caching contexts if a resolver is populated

* Add null test for JsonSerializerContext interface implementation.

* skip RemoteExecutor test in netfx targets

* Add DefaultJsonTypeInfoResolver test for types with JsonConverterAttribute

* remove nullability annotation

* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Converters.cs

Co-authored-by: Krzysztof Wicher <mordotymoja@gmail.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Krzysztof Wicher <mordotymoja@gmail.com>
2 years agoAdd an ETW event for reporting richer debug information back (#71263)
Jakob Botsch Nielsen [Thu, 7 Jul 2022 22:54:04 +0000 (00:54 +0200)]
Add an ETW event for reporting richer debug information back (#71263)

This adds some richer debug information in the form of inline trees and
IL<->native mappings with inlinee information, plus an ETW event in the private
runtime provider to report it back. A COMPlus variable is used to opt-in to
generating and storing this larger debug information.

On the JIT side, we now store a few more fields of data for each inline context
in release builds:

* Its ordinal which is required to be incrementally assigned

* The actual IL offset of the IL instruction leading to the creation of the
  inline context

* The method handle of the inlinee

On the EE side we store the new debug information together with the normal debug
info, reusing the flag byte used for patchpoint information.

The hope is that the new richer format of debug info can eventually replace the
old one, but this won't happen in .NET 7 as I expect it will take some time to
come up with the right format for this data and the right set of fields to
expose. In the meantime this environment variable and event/debugging APIs are
mainly to be used as an opt-in way to start incrementally prototyping on the
tooling side without needing special checked builds of the runtime/JIT.

2 years agoOptimize `System.Reflection.Metadata.ByteSequenceComparer`. (#70047)
Theodore Tsirpanis [Thu, 7 Jul 2022 22:01:36 +0000 (01:01 +0300)]
Optimize `System.Reflection.Metadata.ByteSequenceComparer`. (#70047)

2 years agoObsolete Create(string) cryptographic factory methods (#71230)
Kevin Jones [Thu, 7 Jul 2022 21:49:35 +0000 (17:49 -0400)]
Obsolete Create(string) cryptographic factory methods (#71230)

* Obsolete Create(string) cryptographic factory methods

* Add to list of diagnostics

2 years agoFix Avx2.cs comments (#71448)
tfenise [Thu, 7 Jul 2022 21:43:32 +0000 (23:43 +0200)]
Fix Avx2.cs comments (#71448)

2 years agoFix EventSource deadlock (#71574)
Noah Falk [Thu, 7 Jul 2022 21:36:46 +0000 (14:36 -0700)]
Fix EventSource deadlock (#71574)

* Fix EventSource deadlock

Initializing NativeRuntimeEventSource inside the EventListener static constructor
could lead to a deadlock where a 2nd thread holding the ETW lock calls back
though ETWCallback and tries to get EventListener lock which blocks on the
static constructor.

Fixes #70870

2 years agoReturn receive flags from ReceiveMessageFromAsync on Windows (#71462)
Anton Firszov [Thu, 7 Jul 2022 21:34:32 +0000 (23:34 +0200)]
Return receive flags from ReceiveMessageFromAsync on Windows (#71462)

* ReturnsSocketFlags test

* fix

* ReceiveTruncated_TruncatedFlagIsSetOnReceive

2 years agoFix some null reference exceptions and improve nullable annotations (#71548)
Kevin Jones [Thu, 7 Jul 2022 21:34:02 +0000 (17:34 -0400)]
Fix some null reference exceptions and improve nullable annotations (#71548)

* Fix some null reference exceptions and improve nullable annotations.

* Remove new line that was introduced

2 years agoFix reordering arguments when normalizing in impPopCallArgs (#70992)
Jakob Botsch Nielsen [Thu, 7 Jul 2022 20:27:11 +0000 (22:27 +0200)]
Fix reordering arguments when normalizing in impPopCallArgs (#70992)

While experimenting with doing less spilling in #70932 I have realized
that the change I made in #68736 was not correct. There I commented that
"we now only check interference with the stack entries that are not
arguments since we now know that arguments will be normalized and kept
in order" -- this is not correct since the normalization may spill args
to new statements. It is possible that a later argument that we are
normalizing interferes with an earlier argument that was not normalized.
In that case the logic could reorder these two arguments by spilling
only the later argument to a new statement.

This changes the logic back to be more similar to what it was before --
we iterate the arguments in reverse order, popping them from the top as
we go along with normalization now checking interference with previous
args as well. Since we cannot walk args backwards we also need an extra
loop (as before) to walk the signature information in order.

2 years agoImplement GetIndexOfFirstNonAsciiChar intrinsic on AArch64 (#71637)
SwapnilGaikwad [Thu, 7 Jul 2022 20:23:53 +0000 (21:23 +0100)]
Implement GetIndexOfFirstNonAsciiChar intrinsic on AArch64 (#71637)

* Implement GetIndexOfFirstNonAsciiChar intrinsic on AArch64

* Fix typo in a method name

2 years agoEnsure that CreateChecked, CreateSaturating, and CreateTruncating are publicly expose...
Tanner Gooding [Thu, 7 Jul 2022 20:16:14 +0000 (13:16 -0700)]
Ensure that CreateChecked, CreateSaturating, and CreateTruncating are publicly exposed (#71493)

* Ensure that CreateChecked, CreateSaturating, and CreateTruncating are publicly exposed

* Fixing the constraint on the private TryConvertFrom helpers

2 years agoAdd IsSet check before calling AsString() (#71756)
David Mason [Thu, 7 Jul 2022 20:07:00 +0000 (13:07 -0700)]
Add IsSet check before calling AsString() (#71756)

2 years agoHandle some rare scenarios in local morph (#71536)
SingleAccretion [Thu, 7 Jul 2022 19:51:52 +0000 (22:51 +0300)]
Handle some rare scenarios in local morph (#71536)

Namely, cases where we cannot transform local indirections into local nodes:

1. Unused indirections - we simply remove them.
2. Volatile FIELDs - we mark the underlying local address-exposed.
3. Large offsets - likewise.

Overall this (as well as most other ADDR-related changes) works towards enabling the invariant that after local morph, every local access is either address-exposed, or transformed into LCL_VAR/LCL_FLD.

2 years agoUpdating a few BitConverter APIs to be intrinsic (#71567)
Tanner Gooding [Thu, 7 Jul 2022 19:47:15 +0000 (12:47 -0700)]
Updating a few BitConverter APIs to be intrinsic (#71567)

* Updating a few BitConverter APIs to be intrinsic

* Reacting to PR feedback

* Update src/coreclr/jit/valuenum.cpp

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
* Update src/coreclr/jit/gentree.h

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
* Apply formatting patch

* Ensure DoubleToInt64Bits and Int64BitsToDouble intrinsics only pop when appropriate

* Fix VNForBitCast to not handle exception set logic since its always a normal value now

* Applying formatting patch

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
2 years agoPreparatory changes for enabling direct decomposition of promoted locals into `FIELD_...
SingleAccretion [Thu, 7 Jul 2022 19:46:02 +0000 (22:46 +0300)]
Preparatory changes for enabling direct decomposition of promoted locals into `FIELD_LIST`s on ARM (#71726)

* Unify the "3-byte struct" ARM case with other targets

The only case when "structSize != passingSize" could be true is when we "upcast"
a "mis-sized" struct to a primitive.

For ARM, we never did that -- the relevant "#ifdef"s didn't include it, thus
"OperIs(GT_OBJ) && (structSize != passingSize)" was dead code. Instead, there
was bespoke handling for such structs: "if (structSize < TARGET_POINTER_SIZE)".

Delete the bespoke handling and the "#ifdef", unifying the handling.

* Update a comment

* Fix PUTARG_SPLIT codegen

We must use the "field type" for stores.

Example "struct { int a; byte b; byte c; }" is split between one register and
one stack slot, and both "b" and "c" become propagated constants, typed INT.

* Enable OBJ spilling for ARM

* Fold the last ARM-specific condition

* Do not convert large split args into FIELD_LISTs

We do not check the register requirements on the fields or their sizes (extents).

* Restructure support for "mis-sized" structs

Add a comment, simplify the code.

2 years agoS.S.C.Cose: Add new MultiSign APIs and address API review feedback on existing ones...
David Cantú [Thu, 7 Jul 2022 19:40:01 +0000 (14:40 -0500)]
S.S.C.Cose: Add new MultiSign APIs and address API review feedback on existing ones (#71390)

* Make full assembly unsupported on browser

* Add new MultiSign APIs and address API review feedback on existing ones

* Add SignaturePadding tests and address #70189

* Address feedback (typos and leftover code)

* Add tests for CoseHeaderValue and wrap CborReader/Writer errors

* nits and line chopping

* Move alg. validations to CoseSigner and add remaining AddSignatureFor* APIs

2 years agoBump Intellisense package version to Preview5 (#71772)
Carlos Sanchez [Thu, 7 Jul 2022 19:39:34 +0000 (12:39 -0700)]
Bump Intellisense package version to Preview5 (#71772)

2 years agoBump PreReleaseVersion to Preview7 (#71770)
Carlos Sanchez [Thu, 7 Jul 2022 19:39:10 +0000 (12:39 -0700)]
Bump PreReleaseVersion to Preview7 (#71770)

2 years agoBetter error handling in SubtleCrypto workers (#71693)
Eric Erhardt [Thu, 7 Jul 2022 19:27:35 +0000 (13:27 -0600)]
Better error handling in SubtleCrypto workers (#71693)

* Better error handling in SubtleCrypto workers

Handle exceptions from SubtleCrypto by catching and logging exceptions coming from the crypto stack.

Reset web worker when a request fails.

Also, fix race conditions where the web worker can read its own response as part of the next request.

Contributes to #69740

2 years agoPolyfill the incremental generator ForAttributeWithMetadataName from roslyn (for...
CyrusNajmabadi [Thu, 7 Jul 2022 19:02:29 +0000 (12:02 -0700)]
Polyfill the incremental generator ForAttributeWithMetadataName from roslyn (for LoggingGenerator). (#71651)

* Polyfill the incremental generator ForAttributeWithMetadataName from roslyn (for LoggingGenerator).

* Simplify

* Fix project file

* Remove

* revert

2 years agoFix long latencies in `ReaderWriterLockSlim` lock operations due to `Sleep(1)` (...
Koundinya Veluri [Thu, 7 Jul 2022 18:54:01 +0000 (11:54 -0700)]
Fix long latencies in `ReaderWriterLockSlim` lock operations due to `Sleep(1)` (#70165)

* Fix long latencies in `ReaderWriterLockSlim` lock operations due to `Sleep(1)`

- Removed usage of `Sleep(1)`
- Modified the spin-waiting scheme beyond the `Sleep(0)` threshold to avoid potentially long sequences of ineffective `Sleep(0)`s
- Retuned the threshold to reprioritize deprioritized spin-lock requests

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

2 years agoAdd note about Array.Initialize to ECMA-335 augments (#71766)
Jan Kotas [Thu, 7 Jul 2022 18:53:25 +0000 (11:53 -0700)]
Add note about Array.Initialize to ECMA-335 augments (#71766)

Fixes #71733

2 years agoClose PGO data file when done with it reliably (#71744)
David Wrighton [Thu, 7 Jul 2022 18:48:06 +0000 (11:48 -0700)]
Close PGO data file when done with it reliably (#71744)

2 years ago[Mono] Fix all remaining C4018 warnings and enable the check during build (#71269)
Fan Yang [Thu, 7 Jul 2022 18:27:18 +0000 (14:27 -0400)]
[Mono] Fix all remaining C4018 warnings and enable the check during build (#71269)

* 3rd round of fixing 4018 warnings

* Fix warnings on x86

* Fix remaining c4018 warnings and enable it for build

* Fix print format

* Fix type

* Fix warnings for LLVM

* Fix for wasm

* Fix for arm64

* Fix x86

* Iterator could be negative

* Fix a warning in decompose.c

* Fix warning for arm

* Fix warning for wasm only llvm code

* Correct a few iterator types

* Fix another incorrect iterator type

* Update src/mono/mono/mini/interp/transform.c

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Update src/mono/mono/mini/mini-generic-sharing.c

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Update src/mono/mono/mini/mini-generic-sharing.c

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Update src/mono/mono/mini/mini-generic-sharing.c

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Address review feedback

* Remove other fixed warning.

* Use more accurate types when possible

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
2 years ago[wasm] JSImport, JSExport and related API types for JavaScript interop (#71500)
Pavel Savara [Thu, 7 Jul 2022 18:12:48 +0000 (20:12 +0200)]
[wasm] JSImport, JSExport and related API types for JavaScript interop (#71500)

- approved API
- xmldoc

Co-authored-by: Marek Fišera <mara@neptuo.com>
Co-authored-by: Katelyn Gadd <kg@luminance.org>
2 years agoUnix arm64 atomics (#71512)
Kunal Pathak [Thu, 7 Jul 2022 17:14:43 +0000 (10:14 -0700)]
Unix arm64 atomics (#71512)

* Define_InterlockMethod macro

* compiler failure

* fix build errors

* Set g_arm64_atomics_present at common place

* Fix the missing declaration

* Change TARGET_ARM64 => HOST_ARM64

* Use LSE for InterlockedCompareExchange

* Attempt to fix osx-arm64 build issue

* Introduce LSE_INSTRUCTIONS_ENABLED_BY_DEFAULT

* Make sure that compiler knows that M1 has lse

2 years agoFix incoming arg struct splitting (#71701)
Bruce Forstall [Thu, 7 Jul 2022 16:14:07 +0000 (09:14 -0700)]
Fix incoming arg struct splitting (#71701)

This change only affects Windows/arm64 with varargs.

For incoming structs split between register and stack, handle the splitting
correctly.

Fixes #57606

2 years agoMove ICustomTypeMarshallingStrategy implementations into separate files (#71747)
Elinor Fung [Thu, 7 Jul 2022 15:28:17 +0000 (08:28 -0700)]
Move ICustomTypeMarshallingStrategy implementations into separate files (#71747)

* Move ICustomTypeMarshallingStrategy implementations into separate files
* Remove constructor args from V2 marshalling strategy

2 years agoAdd markdown readme for System.Collections.Immutable (#71247)
MSDN.WhiteKnight [Thu, 7 Jul 2022 14:16:02 +0000 (19:16 +0500)]
Add markdown readme for System.Collections.Immutable (#71247)

* Update System.Collections.Immutable.csproj

* Add README.md

* Add README.md

* Delete README.md

* Update PackageDescription

2 years ago#37093 disable Reciprocal test only for Android x86 (#71541)
Meri Khamoyan [Thu, 7 Jul 2022 13:45:20 +0000 (17:45 +0400)]
#37093 disable Reciprocal test only for Android x86 (#71541)

* #37093 disable Reciprocal test only for Android x86

2 years agoUse ObjectDisposedException.ThrowIf in more places (#71546)
Stephen Toub [Thu, 7 Jul 2022 12:54:58 +0000 (08:54 -0400)]
Use ObjectDisposedException.ThrowIf in more places (#71546)

* Use ObjectDisposedException.ThrowIf in more places

* Update TarWriter.cs

2 years agoUse scoped more in dotnet/runtime (#71589)
Stephen Toub [Thu, 7 Jul 2022 11:56:00 +0000 (07:56 -0400)]
Use scoped more in dotnet/runtime (#71589)

* Use scoped more in dotnet/runtime

This PR addresses a few issues:
- Exposes the new {ReadOnly}Span constructors that accept a ref.
- Uses those new constructors outside of corelib (they were previously internal and used only inside of corelib).
- Makes several members of Utf8JsonReader readonly in order to enable stackalloc'd spans to be used in ValueTextEquals calls.
- Makes several span arguments to SequenceReader scoped in order to enable stackalloc'd spans to be used with those calls.
- Removes all stackalloc T[0], replacing it with scoped locals.
- Removes some use of stackalloc'ing into a pointer and then manually wrapping into a span, instead directly stackalloc'ing into a span.  This is possible now in more cases due to the new language validation rules.
- Replaced some use of MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(...)) with Unsafe.AsRef.

* Address PR feedback

2 years ago[mono] Avoid calling mono_metadata_type_hash () on the container class in mono_generi...
Zoltan Varga [Thu, 7 Jul 2022 11:55:42 +0000 (07:55 -0400)]
[mono] Avoid calling mono_metadata_type_hash () on the container class in mono_generic_class_hash (). (#71734)

If a class inherits from a generic instance instantiated with itself, then its possible
for mono_generic_class_hash () to be called while the container class is not fully
initialized yet, i.e. byval_arg.type is 0. This would cause the generic class to change
its hash.

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

2 years agoReduce allocation overhead of Enumerable.Order{Descending} (#71564)
Stephen Toub [Thu, 7 Jul 2022 11:33:15 +0000 (07:33 -0400)]
Reduce allocation overhead of Enumerable.Order{Descending} (#71564)

Enumerable.OrderBy{Descending} buffers the input into an array.  It then allocates a TKey[] from that input to store the keys, and allocates an int[] that's what's actually sorted based on those keys.  The enumerator uses that sorted int[] then to decide what element from the buffered input to yield next.  In the case of the new Order and OrderDescending methods, though, that TKey[] isn't required; it's just a copy of the buffered input, so we can avoid it.

2 years agoMake things work for arrays of function pointers (#71749)
Michal Strehovský [Thu, 7 Jul 2022 08:07:51 +0000 (17:07 +0900)]
Make things work for arrays of function pointers (#71749)

* Don't try to obtain type handles for fields of types of function pointer arrays
* Add function pointer support to name mangler. We still don't make EETypes for these, but debug info generation also needs mangled names. We currently generate debug info for function pointers as debug info for `void*`, but arrays of function pointers only partially go through that handling and still end up needing a mangled name for the function pointer.

2 years agoUpdate ILToNativeMap event to include IL version (#71479)
David Mason [Thu, 7 Jul 2022 07:32:38 +0000 (00:32 -0700)]
Update ILToNativeMap event to include IL version (#71479)

* Update eventtrace.cpp

* Add native code ID and IL code ID

2 years agoImprove objcopy detection (#71742)
Adeel Mujahid [Thu, 7 Jul 2022 06:46:26 +0000 (09:46 +0300)]
Improve objcopy detection (#71742)

2 years agoFixing public field order for System.Numerics types (#71728)
Tanner Gooding [Thu, 7 Jul 2022 01:55:17 +0000 (18:55 -0700)]
Fixing public field order for System.Numerics types (#71728)

2 years agoEnsure side effects get spilled for the various hwintrinsic and simdashwintrinsic...
Tanner Gooding [Thu, 7 Jul 2022 01:52:58 +0000 (18:52 -0700)]
Ensure side effects get spilled for the various hwintrinsic and simdashwintrinsic nodes (#70054)

* Adding a regression test for #54956

* Ensure side effects get spilled for the various hwintrinsic and simdashwintrinsic nodes

* Applying formatting patch

* Don't mark Compiler::impSpillSideEffect as `inline` so clang can resolve it correctly

* Adding more tests for Runtime_54956

2 years agoHandle stateless collection marshalling with non-blittable elements (#71724)
Elinor Fung [Thu, 7 Jul 2022 01:51:50 +0000 (18:51 -0700)]
Handle stateless collection marshalling with non-blittable elements (#71724)

2 years agoUsing /unicode when running ildasm.exe roundtrip tests (#71163)
Will Smith [Thu, 7 Jul 2022 01:00:04 +0000 (18:00 -0700)]
Using /unicode when running ildasm.exe roundtrip tests (#71163)

* Using /unicode when running ildasm.exe roundtrip tests

* Added /unicode flag

* Update issues.targets

2 years agoTypedByReference should be treated as a normal valuetype for calling convention purpo...
David Wrighton [Wed, 6 Jul 2022 23:47:25 +0000 (16:47 -0700)]
TypedByReference should be treated as a normal valuetype for calling convention purposes (#71675)

TypedByReference should be treated as a normal valuetype for calling convention purposes
Add regression test for #42732

2 years agoAdd note about partition IV and V to ECMA-335 augments (#71737)
Jan Kotas [Wed, 6 Jul 2022 23:45:26 +0000 (16:45 -0700)]
Add note about partition IV and V to ECMA-335 augments (#71737)

Fixes #71733

2 years agoLeverage compiler attributes for snippets identification (#71729)
Aaron Robinson [Wed, 6 Jul 2022 23:20:29 +0000 (16:20 -0700)]
Leverage compiler attributes for snippets identification (#71729)

* Leverage compiler attributes for snippets identification