Tanner Gooding [Wed, 8 Mar 2023 22:18:53 +0000 (14:18 -0800)]
Adding System.Runtime.CompilerServices.Unsafe.BitCast (#82917)
* Adding System.Runtime.CompilerServices.Unsafe.BitCast
* Adding some basic intrinsic recognition for Unsafe.BitCast
* Use ClassLayout::AreCompatible as part of Unsafe.BitCast
* Fixup BitConverter to use Unsafe.BitCast
* Fixup Enum to use Unsafe.BitCast
* Ensure BitCast resolves the right generic type for toTypeHnd
* Use Unsafe.BitCast in places using the `*(TTo*)&tfrom` pattern
* Don't use BitCast in places the generic constraints disallows it
* Missing semicolon
* Don't use Unsafe.BitCast where it introduces additional generic instantiations
* Don't regress the files that are used for both netstandard and netcoreapp
* Responding to PR feedback
* Fix a typo in the bitcast tests
Ankit Jain [Wed, 8 Mar 2023 22:00:38 +0000 (17:00 -0500)]
[wasm] Revert to using latest chrome for testing (#83150)
https://github.com/dotnet/runtime/issues/81792
DeepakRajendrakumaran [Wed, 8 Mar 2023 21:52:52 +0000 (13:52 -0800)]
Lowering subset of Vector512 methods for avx512. (#82953)
* Load(), LoadUnsafe(), LoadAligned(), LoadAlignedNonTemporal()
* Store(), StoreUnsafe(), StoreAligned(), StoreAlignedNonTemporal()
* Fixing 'HasSideEffect()' check used for RedundantMov
Radek Doulik [Wed, 8 Mar 2023 21:36:36 +0000 (22:36 +0100)]
[wasm] Add tests for build with SIMD disabled (#82845)
* [wasm] Add tests for build with SIMD disabled
Add BuildWithoutSIMD_AOT and PublishWithoutSIMD_AOT tests
Also try to enable SIMD tests on V8 and node
* The BuildWithoutSIMD_AOT should be without AOT
* Feedback
* Removed too much
* Negate the assert, it should not relink
* Update src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs
Co-authored-by: Ankit Jain <radical@gmail.com>
---------
Co-authored-by: Ankit Jain <radical@gmail.com>
Katelyn Gadd [Wed, 8 Mar 2023 20:26:35 +0000 (12:26 -0800)]
[wasm] Consume libc math functions directly from the jiterpreter without wrappers (#82963)
Implement more math opcodes and use the f32 functions as appropriate
Immo Landwerth [Wed, 8 Mar 2023 19:43:41 +0000 (11:43 -0800)]
Add ConsoleKey.None and ConsoleModifiers.None (#83114)
This fixes #79868.
Vitek Karas [Wed, 8 Mar 2023 19:20:08 +0000 (11:20 -0800)]
Implement parity for RAF and RDC attributes in NativeAOT (#83085)
The `RequiresUnreferencedCode` (RDC), `RequiresAssemblyFiles` (RAF) and `RequiresDynamicCode` (RDC) attributes should behave the same way in NativeAOT compiler. This change implements the necessary bits to make them almost 100% the same.
The only difference left is type hierarchy marking doesn't produce RAF/RDC related warnings - this is for now intentional, as it would probably produce unnecessary noise and the need for this seems to be really small.
Test changes are to basically fill in the missing expected warnings. We already have solid tests for pretty much all scenarios, they just didn't baseline these warnings since no tool produced them (illink doesn't produce RAF/RDC warnings, analyzer only produces them on direct access, not on reflection access).
This doesn't yet implement the IL3000 and IL3001 warnings in NativeAOT - that will be done in a subsequent change.
Stephen Toub [Wed, 8 Mar 2023 18:15:09 +0000 (13:15 -0500)]
Change a few more Encoding.UTF8.GetBytes to u8 in json (#83138)
Stephen Toub [Wed, 8 Mar 2023 18:14:28 +0000 (13:14 -0500)]
Clean up some code in SmtpDateTime (#83142)
- Remove an unnecessary static readonly char[]
- Simplified formatting via interpolated strings
- Removed some string allocation in parsing via spans
- Deleted some dead code
- Simplified some consts and readonly static creation
Jeremy Koritzinsky [Wed, 8 Mar 2023 17:58:30 +0000 (09:58 -0800)]
Update SourceBuild image to be our Centos 8 Stream image. (#83106)
dotnet-maestro[bot] [Wed, 8 Mar 2023 17:49:14 +0000 (11:49 -0600)]
Update dependencies from https://github.com/dotnet/roslyn build
20230307.14 (#83136)
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-3.23156.6 -> To Version 4.6.0-3.23157.14
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Zoltan Varga [Wed, 8 Mar 2023 17:40:13 +0000 (12:40 -0500)]
[mono] Fix virtual method resolution in mono_delegate_trampoline (). (#83004)
Use delegate->method_is_virtual instead of complicated conditions.
That flag is set by the code generated in handle_delegate_ctor () if
an ldvirtftn instruction was skipped, and thus virtual method
resolution needs to be done at call time.
Fixes https://github.com/dotnet/runtime/issues/83003.
dotnet-maestro[bot] [Wed, 8 Mar 2023 16:46:51 +0000 (11:46 -0500)]
[main] Update dependencies from dotnet/xharness (#83135)
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.23152.1 -> To Version 1.0.0-prerelease.23157.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Miha Zupan [Wed, 8 Mar 2023 16:37:43 +0000 (17:37 +0100)]
Minor tweaks to IndexOfAnyLookupCore (#83139)
Jordan Borean [Wed, 8 Mar 2023 16:34:45 +0000 (02:34 +1000)]
Support WindowStyle without UseShellExecute (#82662)
* Support WindowStyle without UseShellExecute
Supports specifying a custom ProcessStartInfo.WindowStyle without having
to use UseShellExecute.
Fix #81681
* Add tests for new behaviour
* Revert exception with CreateNoWindow and WindowStyle
* Apply suggestions from code review
Co-authored-by: David Cantú <dacantu@microsoft.com>
* Implement review suggestions
* Avoid running test on Windows nano since does not support UseShellExecute
---------
Co-authored-by: David Cantú <dacantu@microsoft.com>
Ankit Jain [Wed, 8 Mar 2023 16:26:04 +0000 (11:26 -0500)]
[wasi] Fixes to enable more tests (#82966)
* [wasi] Copy WasmFilesToIncludeInFileSystem to the bundle too
This could be changed in the future to include in the single file bundle
* [wasi] Enable System.IO.Packaging, and System.Data.DataSetExtensions tests
* WasiAppBuilder: Create an empty /tmp
* Disable System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests.TypesTest_Negative - Issue: https://github.com/dotnet/runtime/issues/82967
* Enable System.Runtime.Serialization.Xml.Tests, and System.Runtime.Serialization.Xml.ReflectionOnly.Tests
Remaining fixed by adding `/tmp`
Zoltan Varga [Wed, 8 Mar 2023 14:12:23 +0000 (09:12 -0500)]
[mono][arm64] Implement delegate virtual invoke trampolines. (#83028)
Stephen Toub [Wed, 8 Mar 2023 14:12:08 +0000 (09:12 -0500)]
Switch JsonReaderHelper.IndexOfQuoteOrAnyControlOrBackSlash to use IndexOfAnyValues (#82789)
* Switch JsonReaderHelper.IndexOfQuoteOrAnyControlOrBackSlash to use IndexOfAnyValues
* Remove aggressive inlining
Zoltan Varga [Wed, 8 Mar 2023 14:11:54 +0000 (09:11 -0500)]
[mono][jit] Don't try to do devirt for Delegate.Invoke (). (#83026)
The optimized delegate calling code in mini_emit_method_call_full ()
expects calls to Invoke to stay a virtual call.
Stephen Toub [Wed, 8 Mar 2023 14:11:39 +0000 (09:11 -0500)]
Add wasm support to IndexOfAnyAsciiSearcher (#83122)
* Add wasm support to IndexOfAnyAsciiSearcher
* Update with newly-added PackedSimd.ConvertNarrowing methods
---------
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Steve Harter [Wed, 8 Mar 2023 14:02:23 +0000 (08:02 -0600)]
Remove S.S.Permissions reference from S.C.ConfigurationManager (#82259)
Alexander Köplinger [Wed, 8 Mar 2023 13:29:44 +0000 (14:29 +0100)]
Add type-forwarders for Xamarin.Android compatibility to System.Drawing.Common.dll (#82839)
The legacy Xamarin.Android version of System.Drawing.Common.dll contained these types, add forwarders so we don't get a TypeLoadException when using an assembly compiled against that in modern .NET Android.
Fixes #82829
Vitek Karas [Wed, 8 Mar 2023 13:11:11 +0000 (05:11 -0800)]
Implement correct handling of new constraint in ilc (#82818)
This is done by treating the new constraint as a data flow annotation `PublicParameterlessConstructor` (which are supposed to be identical). The rest falls out from this change since all of the validation and marking will automatically kick in.
This change causes more methods to go through data flow (since that's what will actually perform the constraint validation/marking). I tested this on the ASP.NET API AOT template. Before this change it ran ~620 methods through data flow. With this change that number goes up to ~2100. The problem is tracked by https://github.com/dotnet/runtime/issues/82603.
I measured compiler perf but didn't see any noticeable changes. Current thinking is that ~2100 is still not that much and most of those methods are pretty small and thus cheap to run data flow on.
Fixes https://github.com/dotnet/runtime/issues/81720 - note that the repro still fails on AOT with this fix, but the failure is different (`System.InvalidOperationException: Sequence contains no matching element`). I verified that the missing .ctor is present in the app with the fix.
Pavel Savara [Wed, 8 Mar 2023 10:34:21 +0000 (11:34 +0100)]
[browser] legacy JS interop optional via WasmEnableLegacyJsInterop - managed (#82826)
* WasmEnableLegacyJsInterop and ILLink.Descriptors.LegacyJsInterop.xml
* revert back to USE_PTHREADS symbol
* feedback
Jakob Botsch Nielsen [Wed, 8 Mar 2023 09:15:21 +0000 (10:15 +0100)]
JIT: Support converting OR(condition, condition) -> CCMP (#83089)
Also support generating ccmp for GC pointers, which fixes #82703.
Also makes the handling of operands symmetrical, so that the ccmp can be
generated for either op1 or op2 of the AND/OR.
Tomas Weinfurt [Wed, 8 Mar 2023 08:36:27 +0000 (00:36 -0800)]
use MsQuic 2.1 again (#83124)
Pavel Savara [Wed, 8 Mar 2023 08:17:12 +0000 (09:17 +0100)]
[browser] cleanup before memory snapshot (#83082)
- moved get_preferred_icu_asset
- moved TZ detection
- moved runtimeHelpers.waitForDebugger
- added runtimeHelpers.updateGlobalBufferAndViews
- removed obsolete comments about blazor startup sequence
- removed diplicate calls mono_wasm_init_diagnostics (also previously blazor startup path)
- introduce DotnetModuleInternal instaed of anyModule
Adeel Mujahid [Wed, 8 Mar 2023 02:17:54 +0000 (04:17 +0200)]
Rename cgroup.cpp to cgroupcpu.cpp (#83029)
* Revert "Revert "Enable symbol stripping for crossgen2 (#82698)" (#82881)"
This reverts commit
13853e5a78dafb364305af823bac3a4dbeddf894.
* Rename cgroup.cpp to cgroupcpu.cpp
dotnet-maestro[bot] [Tue, 7 Mar 2023 23:50:45 +0000 (17:50 -0600)]
[main] Update dependencies from 8 repositories (#83032)
* Update dependencies from https://github.com/dotnet/runtime build
20230305.6
Microsoft.NET.ILLink.Tasks , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
From Version 8.0.0-preview.2.23126.3 -> To Version 8.0.0-preview.3.23155.6
* Update dependencies from https://github.com/dotnet/llvm-project build
20230306.3
runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter
From Version 14.0.0-alpha.1.23124.1 -> To Version 14.0.0-alpha.1.23156.3
* Update dependencies from https://github.com/dotnet/icu build
20230306.1
Microsoft.NETCore.Runtime.ICU.Transport
From Version 8.0.0-preview.3.23151.1 -> To Version 8.0.0-preview.3.23156.1
* Update dependencies from https://github.com/dotnet/runtime-assets build
20230306.1
Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.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 8.0.0-beta.23127.1 -> To Version 8.0.0-beta.23156.1
* Update dependencies from https://github.com/dotnet/emsdk build
20230306.1
Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100-preview.3 , Microsoft.NET.Workload.Emscripten.net6.Manifest-8.0.100-preview.3 , Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100-preview.3
From Version 8.0.0-preview.3.23151.1 -> To Version 8.0.0-preview.3.23156.1
* Update dependencies from https://github.com/dotnet/msquic build
20230306.1
System.Net.MsQuic.Transport
From Version 8.0.0-alpha.1.23153.1 -> To Version 8.0.0-alpha.1.23156.1
* Update dependencies from https://github.com/dotnet/hotreload-utils build
20230306.1
Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
From Version 1.1.0-alpha.0.23152.1 -> To Version 1.1.0-alpha.0.23156.1
* Update dependencies from https://github.com/dotnet/cecil build
20230306.1
Microsoft.DotNet.Cecil
From Version 0.11.4-alpha.23127.1 -> To Version 0.11.4-alpha.23156.1
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Tomas Weinfurt [Tue, 7 Mar 2023 23:44:18 +0000 (15:44 -0800)]
get transport MsQuic for Windows arm64 (#83104)
Tomas Weinfurt [Tue, 7 Mar 2023 22:25:17 +0000 (14:25 -0800)]
fix failing ConnectWithRevocation_ServerCertWithoutContext_NoStapledOcsp failures (#83013)
dotnet-maestro[bot] [Tue, 7 Mar 2023 22:04:38 +0000 (16:04 -0600)]
[main] Update dependencies from dotnet/roslyn (#83031)
* Update dependencies from https://github.com/dotnet/roslyn build
20230306.1
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-3.23154.2 -> To Version 4.6.0-3.23156.1
* Update dependencies from https://github.com/dotnet/roslyn build
20230306.6
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-3.23154.2 -> To Version 4.6.0-3.23156.6
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
dotnet-maestro[bot] [Tue, 7 Mar 2023 22:02:44 +0000 (16:02 -0600)]
Update dependencies from https://github.com/dotnet/arcade build
20230306.4 (#83087)
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 8.0.0-beta.23153.1 -> To Version 8.0.0-beta.23156.4
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Daniel Ramos [Tue, 7 Mar 2023 21:28:02 +0000 (13:28 -0800)]
Separate the generation of PerfMap and JitDump files (#82142)
Jeremy Koritzinsky [Tue, 7 Mar 2023 21:03:33 +0000 (13:03 -0800)]
Change the ComInterfaceGenerator to output source in one file per interface and use file-scoped types (#83055)
Tanner Gooding [Tue, 7 Mar 2023 19:56:26 +0000 (11:56 -0800)]
Some minor cleanup post the addition of TYP_SIMD64 and ZMM support - P1 (#83044)
* Ensure EA_16BYTE is FEATURE_SIMD only and EA_32/64BYTE are TARGET_XARCH only
* Remove getSIMDSupportLevel as its now unnecessary
* Ensure canUseVexEncoding and canUseEvexEncoding are xarch only
* Don't make EA_16BYTE+ require FEATURE_SIMD
* Resolving formatting and build failures
* Adding back a check that shouldn't have been removed
Jeremy Koritzinsky [Tue, 7 Mar 2023 19:00:30 +0000 (11:00 -0800)]
Use more traditional interface implementation + delegation for generator unit tests (#83057)
Bruce Forstall [Tue, 7 Mar 2023 17:33:15 +0000 (10:33 -0700)]
Rename IntegralRange::IsPositive() to IsNonNegative to be accurate (#83062)
Also, add a few `const` in various places.
Andy Ayers [Tue, 7 Mar 2023 16:31:45 +0000 (08:31 -0800)]
JIT: profile synthesis consistency checking and more (#83068)
Add the ability to verify that the profile counts produced by synthesis are
self-consistent, and optionally to assert if they're not. Disable checking
if we know profile flow will be inconsistent (because of irreducible loops
and/or capped cyclic probabilities).
Consistently ignore the likely flow out of handlers. Generally we model
handlers as isolated subgraphs that do not contribute flow to the main flow
graph. This is generally acceptable.
The one caveat is for flow into finallies. The plan here is to fix the weights
for finallies up in a subsequent pass via simple scaling once callfinallies
are introduced. Flow weights out of finallies will be ignored as the
callfinally block will be modeled as always flowing to its pair tail.
Also add the ability to propagate the synthesized counts into the live profile
data. This is mainly to facilitate using the MIBC comparison tools we have
to assess how closely the synthesiszed data comes to actual PGO data.
Finally, enable the new synthesized plus checked modes in a few of our PGO
pipelines.
Contributes to #82964.
Marek Fišera [Tue, 7 Mar 2023 15:54:24 +0000 (16:54 +0100)]
[wasm] Disable GetAsync_ManyDifferentResponseHeaders_ParsedCorrectly on NodeJS (#83090)
Radek Doulik [Tue, 7 Mar 2023 15:21:36 +0000 (16:21 +0100)]
[wasm] Add narrow methods to PackedSimd (#83084)
* [wasm] Add narrow methods to PackedSimd
Add them as internal as the approved API contains wrong methods for
these. https://github.com/dotnet/runtime/issues/53730#issuecomment-
1453900537
This will allow faster implementation of IndexOfAnyValues for wasm.
https://github.com/dotnet/runtime/pull/82789#issuecomment-
1451056305
* Fix build
Michal Strehovský [Tue, 7 Mar 2023 11:50:15 +0000 (20:50 +0900)]
Make open method resolver pay for play (#83064)
Resolver is called into from delegate thunks, so we can't get rid of it, but to construct a resolver one needs to do some reflection first. Make the resolution logic statically depend on resolver being constructed.
Michal Strehovský [Tue, 7 Mar 2023 07:00:18 +0000 (16:00 +0900)]
Ifdef out a piece of unreachable reflection stack (#83067)
This is only reachable if we have a .NET Native-esque SharedLibrary.dll. Method signature comparison calls into the type loader.
Michal Strehovský [Tue, 7 Mar 2023 06:59:49 +0000 (15:59 +0900)]
Emit leaner cctor context for preinitialized types (#83065)
If a type is preinitialized, we shouldn't need the cctor pointer anymore. This was the only thing keeping around general-purpose comparers logic after @EgorBo's #83054.
Stephen Toub [Tue, 7 Mar 2023 06:48:45 +0000 (01:48 -0500)]
Improve perf of CharEnumerator (#82990)
Michal Strehovský [Tue, 7 Mar 2023 04:52:41 +0000 (13:52 +0900)]
Allow devirtualizing more interface calls (#82927)
There is an existing implementation of "does this introduce variance complexities"?
Michal Strehovský [Tue, 7 Mar 2023 04:50:22 +0000 (13:50 +0900)]
Avoid generic virtual methods in enum infrastructure (#83063)
Katelyn Gadd [Tue, 7 Mar 2023 03:37:49 +0000 (19:37 -0800)]
[wasm] Don't generate unused imports in jiterpreter traces (#83061)
Egor Bogatov [Tue, 7 Mar 2023 03:09:08 +0000 (04:09 +0100)]
Improve EqualityComparer for NativeAOT (#83054)
Remove s_default field from EqualityComparer.NativeAot.cs and Comparer.NativeAot.cs
Tomas Weinfurt [Tue, 7 Mar 2023 01:52:33 +0000 (17:52 -0800)]
fix QUIC_STATUS in macOS (#83011)
Filip Navara [Tue, 7 Mar 2023 00:46:48 +0000 (01:46 +0100)]
[NativeAOT] Experiment: Cache location of unwind sections (#82994)
* WIP: Cache managed code unwind section lookup
* Clean up
* Attempt to fix EHABI and Darwin builds
* Rename `ip` to `pc`
Jackson Schuster [Tue, 7 Mar 2023 00:36:31 +0000 (16:36 -0800)]
Make ComWrappersUnwrapper public in test assembly (#83046)
Jakob Botsch Nielsen [Tue, 7 Mar 2023 00:01:28 +0000 (01:01 +0100)]
JIT: Remove JTRUE(relop) invariant in the backend (#82766)
Today the backend (and much of the JIT) allows only JTRUE with a relop
operand, and it is always assumed that this relop appears right before
JTRUE in linear order. This change adds support for JTRUE nodes with
arbitrary integral operands from lowering and onwards. The operand is
also allowed to appear at arbitrary locations in LIR.
With this, we can now enable an optimization that turns
EQ/NE(relop/SETCC, 0) into just a (potentially) reversed condition. This
improves codegen for some cases with SELECTCC and gives us a simple way
to allow for compare chains that feed conditional branches in the
future.
In addition change DISPTREERANGE to handle nodes that consume flags
by also finding the flags definitions as part of looking for data flow.
This is best-effort only, so there is an assert that it is only used in debug
builds.
Vitek Karas [Mon, 6 Mar 2023 21:56:15 +0000 (13:56 -0800)]
Adds a test for compiler generated trim warning suppression issue (#82957)
This is adding a test for https://github.com/dotnet/runtime/issues/82956 (currently assumes the wrong behavior).
Also adds a solution file which includes all three trim tools, illink, illink.analyzer and ilc. This brings several advantages:
- As we share more source files between the tools it will be much easier to work in.
- We already share test sources, so this makes it easy to run the modified test with all three tools at once (from one instance of VS)
Steve Pfister [Mon, 6 Mar 2023 21:55:14 +0000 (16:55 -0500)]
[android][ios] Add LibraryBuilder task to support aot library mode (#81919)
This change adds a build task to generate a self-contained shared or static library when using the aot compiler and will only export symbols for methods decorated with UnmanagedCallersOnly attributes (similar to NativeAOT).
Contributes to #79377
Stephen Toub [Mon, 6 Mar 2023 21:40:15 +0000 (16:40 -0500)]
Allow PeriodicTimer to have an infinite timeout (#82986)
* Allow PeriodicTimer to have an infinite timeout
When PeriodicTimer was introduced, we prohibited infinite timeouts as they made no sense: you couldn't change the period after construction, so creating a PeriodicTimer with an infinite timeout meant creating an instance that would never tick. But now that we've added a Period property with a setter that allows changing the period, infinite timeouts do make sense: as with Timer, they can be used as a mechanism to stop and start the timer, e.g. creating the PeriodicTimer with infinite and only in response to some later action updating its Period to start it.
* Update PeriodicTimer.cs
Stephen Toub [Mon, 6 Mar 2023 21:39:52 +0000 (16:39 -0500)]
Add IPAddress ISpanFormattable/Parsable implementations (#82913)
* Add IPAddress ISpanFormattable/Parsable implementations
* Address PR feedback
Tomáš Rylek [Mon, 6 Mar 2023 21:27:43 +0000 (22:27 +0100)]
Fix for GitHub issue 76673 and regression test - incorrect static virtual method resolution (#76724)
The issue tracks incorrect ordering of static virtual method lookup
methods in the CoreCLR runtime. According to the default interface
implementation ECMA 335 addendum, default interface implementation
resolution should only be used after the "old rules" failed to
resolve the method. In other words resolution on classes must go
first.
In the pre-existing implementation the for loop used to traverse
the chain of base classes was incorrectly combining
resolution on classes with default interface implementation
resolution. The fix is to walk the entire chain of base classes
first and only if that fails, attempt the default interface
implementation resolution.
Kevin Jones [Mon, 6 Mar 2023 21:06:14 +0000 (16:06 -0500)]
Use SecurityTransforms for RSA+PSS (#82728)
* Use SecurityTransforms for RSAPSS
* Code review feedback
Fan Yang [Mon, 6 Mar 2023 20:55:38 +0000 (15:55 -0500)]
[Mono] Add initial arm64 hardware intrinsics support for mini JIT (#82420)
* Initial change to make intrinsics work with mini JIT on arm64
* Fix alignment issue and add size getter functions
* Review feedback and refactor
* Fix align
* Fix issue with big offset
* Fix build warning
* Add intrinsics for get_One
* Add xconst to mdesc
* Fix MONO_PATCH_INFO_X128
* Stop the simd and fp registers sharing
* Stop v64 from emitting simd intrinsics
* Move between SIMD registers
* Adjust filter logic
* Keep the filter logic under non-llvm
* Uncomment
Kevin Jones [Mon, 6 Mar 2023 20:51:00 +0000 (15:51 -0500)]
Use output size helpers for cryptographic primitives (#82800)
Zoltan Varga [Mon, 6 Mar 2023 20:17:12 +0000 (15:17 -0500)]
[wasi] More cross compiler fixes. (#82911)
Katelyn Gadd [Mon, 6 Mar 2023 19:54:53 +0000 (11:54 -0800)]
Implement INITBLK and CPBLK in the Jiterpreter (#83033)
Jackson Schuster [Mon, 6 Mar 2023 19:46:13 +0000 (11:46 -0800)]
Share all "Compiles" tests from VTableIndexStubGenerator with ComInterfaceGenerator (#82657)
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
Andy Ayers [Mon, 6 Mar 2023 19:13:49 +0000 (11:13 -0800)]
JIT: initial implementation of profile synthesis (#82926)
Implements a profile synthesis algorithm based on the classic Wu-Larus
paper (Static branch frequency and program profile analysis, Micro-27,
1994), with a simple set of heuristics.
First step is construction of a depth-first spanning tree (DFST) for the
flowgraph, and corresponding reverse postorder (RPO). Together these drive
loop recognition; currently we only recognize reducible loops. We use DFST
(non-) ancestry as a proxy for (non-) domination: the dominator of a node
is required to be a DFST ancestor. So no explicit dominance computation is
needed. Irreducible loops are noted but ignored. Loop features like entry,
back, and exit edges, body sets, and nesting are computed and saved.
Next step is assignment of edge likelihoods. Here we use some simple local
heuristics based on loop structure, returns, and throws. A final heuristic
gives slight preference to conditional branches that fall through to the
next IL offset.
After that we use loop nesting to compute the "cyclic probability" $cp$ for
each loop, working inner to outer in loops and RPO within loops. $cp$ summarizes
the effect of flow through the loop and around loop back edges. We cap $cp$ at
no more than 1000. When finding $cp$ for outer loops we use $cp$ for inner
loops.
Once all $cp$ values are known, we assign "external" input weights to method
and EH entry points, and then a final RPO walk computes the expected weight
of each block (and, via edge likelihoods, each edge).
We use the existing DFS code to build the DFST and the RPO, augmented by
some fixes to ensure all blocks (even ones in isolated cycles) get numbered.
This initial version is intended to establish the right functionality, enable
wider correctness testing, and to provide a foundation for refinement of the
heuristics. It is not yet as efficient as it could be.
The loop recognition and recording done here overlaps with similar code
elsewhere in the JIT. The version here is structural and not sensitive to IL
patterns, so is arguably more general and I believe a good deal simpler than
the lexically driven recognition we use for the current loop optimizer.
I aspire to reconcile this somehow in future work.
All this is disabled by default; a new config option either enables using
synthesis to set block weights for all root methods or just those without PGO
data.
Synthesis for inlinees is not yet enabled; progress here is blocked by #82755.
Andrew Au [Mon, 6 Mar 2023 18:48:49 +0000 (10:48 -0800)]
Fix special sweep issue for workstation (#81248)
Bruce Forstall [Mon, 6 Mar 2023 16:48:38 +0000 (09:48 -0700)]
Simplify fgDfsReversePostorderHelper (#83018)
Andy Ayers [Mon, 6 Mar 2023 16:10:52 +0000 (08:10 -0800)]
Fixes for partial compilation of methods (#80635)
* don't block GC while waiting for PC continuation to jit
* fix flow cleanup at partial compilation point
Katelyn Gadd [Mon, 6 Mar 2023 15:58:44 +0000 (07:58 -0800)]
Fix cknull_ptr value tracking being incorrect for address-taken locals (#83006)
Jakob Botsch Nielsen [Mon, 6 Mar 2023 14:32:03 +0000 (15:32 +0100)]
JIT: Assume allocations succeed (#82961)
We call a NOMEM function when allocations fail that is already marked as
no-return, but at least MSVC is not able to pick up on this fact. The
result is that all operator new calls end up with an unnecessary null
check. This adds a COMPILER_ASSUME to allow compilers to recognize
that allocations never fail.
There was also a workaround for an old VSW bug that I've removed.
Egor Bogatov [Mon, 6 Mar 2023 11:36:59 +0000 (12:36 +0100)]
Enable more intrinsics for tier0 (#83002)
Michal Strehovský [Mon, 6 Mar 2023 11:14:52 +0000 (20:14 +0900)]
Update Microsoft.NETCore.Native.targets (#83024)
DeepakRajendrakumaran [Mon, 6 Mar 2023 06:03:21 +0000 (22:03 -0800)]
Initial support for zmm in .NET (#80960)
* Adding simd64 and zmm types.
* Adding other infrastructure to lower/emit code for simd64.
* Lowering + workarounds for simd64 constants.
* Fix lowering logic for Create().
* Save/restore for zmm
* Add ToDo comments for AVX512BW
* Separate AVX512F and AVX512BW + Fix disassembly.
* Review changes.
* Fixing throughput issue.
* Additional Review comments.
* Setting 'EnableIncompleteISAClass="1"' for relevant CI runs.
* Removing 64 bit flags + correcting check.
* Apply formatting patch
---------
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
Will Smith [Sun, 5 Mar 2023 23:54:18 +0000 (15:54 -0800)]
[JIT] Fixed improper peephole zero-extension removal when cdq/cwde instructions are involved (#82733)
* Fixed improper peephole zero-extension removal when cdq/cdqe/cwde instructions are involved
* Update regression test
* Formatting
* Handle cdq differently
* Handle cdq differently
* Handle cdq differently
* Take into account cmpxchg
* Take into account cmpxchg
* Feedback
* Added emitIsInstrWritingToReg. Removed the previously added function.
* Remove function from header
* Quick fix
* Added comment
* Formatting
* Feedback
* Fix build
Stephen Toub [Sun, 5 Mar 2023 23:36:44 +0000 (18:36 -0500)]
Fix BitConverter.ToXx error message (#82987)
The current message ("Destination array is not long enough to copy all the items in the collection. Check array index and length."), which is otherwise used by CopyTo methods, makes no sense in these APIs. :)
Mike McLaughlin [Sun, 5 Mar 2023 17:50:49 +0000 (09:50 -0800)]
Add NT_SIGINFO NOTE to ELF dumps (#82449)
* Add NT_SIGINFO NOTE to ELF dumps
Linux Watson needs this to better triage ELF dumps.
Add CreateDumpOptions helper struct to pass all the command options around. Add the
"--code", "--errno", "--address" command line options used to fill the NT_SIGINFO
NOTE. The runtime passes to createdump on a crash.
Added "ExceptionType" field to "Parameters" section of the Linux crash report json.
* Add NT_SIGINFO define
* Code review feedback
Adeel Mujahid [Sun, 5 Mar 2023 16:40:20 +0000 (18:40 +0200)]
Replace remaining instances of COMPlus with DOTNET (#82985)
* Replace remaining instances of COMPlus with DOTNET
* Fix heading in RyuJIT tutorial
Stephen Toub [Sun, 5 Mar 2023 05:11:19 +0000 (00:11 -0500)]
Replace some unnecessary use of CompareInfo (#82988)
Anywhere we're explicitly passing Ordinal or OrdinalIgnoreCase, the actual culture data is ignored. We can just use the relevant string/span methods directly.
dotnet-maestro[bot] [Sun, 5 Mar 2023 05:07:43 +0000 (23:07 -0600)]
Update dependencies from https://github.com/dotnet/msquic build
20230303.1 (#82979)
System.Net.MsQuic.Transport
From Version 8.0.0-alpha.1.23124.1 -> To Version 8.0.0-alpha.1.23153.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Bruce Forstall [Sat, 4 Mar 2023 20:55:37 +0000 (13:55 -0700)]
Clean up run.sh documentation (#82983)
Add line about build configuration.
Fix illink syntax help.
Simplify a couple cases that just set environment variables.
dotnet-maestro[bot] [Sat, 4 Mar 2023 20:54:28 +0000 (14:54 -0600)]
Update dependencies from https://github.com/dotnet/roslyn build
20230304.2 (#82980)
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-3.23153.1 -> To Version 4.6.0-3.23154.2
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Stephen Toub [Sat, 4 Mar 2023 19:18:02 +0000 (14:18 -0500)]
Fix invariant check in DateTimeParse (#82971)
dotnet-maestro[bot] [Sat, 4 Mar 2023 18:35:49 +0000 (12:35 -0600)]
Update dependencies from https://github.com/dotnet/arcade build
20230303.1 (#82978)
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 8.0.0-beta.23152.1 -> To Version 8.0.0-beta.23153.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Zoltan Varga [Sat, 4 Mar 2023 15:36:11 +0000 (10:36 -0500)]
[mono] Fix Hello World sample. (#82977)
Bruce Forstall [Sat, 4 Mar 2023 10:33:03 +0000 (03:33 -0700)]
Remove dead link (#82972)
Egor Bogatov [Sat, 4 Mar 2023 09:40:21 +0000 (10:40 +0100)]
Enable JitDasmWithAlignmentBoundaries and JitDasmWithAddress in Release (#82666)
Omair Majid [Sat, 4 Mar 2023 07:07:20 +0000 (02:07 -0500)]
Add RID for Fedora 39 (#82185)
The changes to runtime.json and runtime.compatibility.json were
generated by tooling.
David Wrighton [Sat, 4 Mar 2023 04:50:07 +0000 (20:50 -0800)]
Fix the multicore performance of mapping from an instruction pointer to a MethodDesc (#79021)
Mapping from an instruction pointer to a MethodDesc is a critical component of the runtime used in many places, notably diagnostics, slow path delegate creation, and stackwalking.
This change provides a dramatic improvement in the performance of that logic through several techniques.
1. The mapping from IP to range of interesting memory is done via a tree structure resembling that of a page table. The result of this is that in addition to reducing the locking logic, the cost of looking up in the presence of many different loaded assemblies will be reduced to a nearly constant time.
2. That tree structure is configured so that when accessing memory which will never be freed in the lifetime of the process, the memory can be accessed without taking any locks whatsoever.
3. The code map is enhanced to include not only the code generated by the JIT/R2R code, but also to include the fixup and stub precode stubs.
4. In addition, performance improvement was done to improve the performance of slow path delegate creation in particular, by reordering which checks are done, and by writing a simplified signature parse routine for computing the number of arguments to a function.
Performance of this was tested in both the EH stackwalking scenario as well as the delegate slow path creation scenario, but the delegate logic is what will be most visible when this is checked in. (See PR #79471 for details of the additional changes necessary to take advantage of this work when doing EH) (#8393 describes the potential product impact of just improving the delegate slow path creation code)
For the delegate creation scenario the perf impact was measured to be quite substantial. These numbers are in ms to create a constant number of delegates on each thread used. Smaller is better. The test was run on a 6 core machine.
| Threads | Without fix | With this PR
| ------------- | ------------- | ----- |
| 1 | 840 | 313|
| 2 | 1977 | 316 |
| 3 | 3290 | 325 |
| 4| 4259 | 344 |
| 5 | 5140 | 351 |
| 6 | 5872 | 374|
| 7 | 6463 | 442|
| 8 | 7046 | 499|
| 9 | 7648 | 547|
| 10 | 8241 | 627|
| 11 | 8851 | 749|
| 12 | 9595 | 773|
Fixes #8393
Katelyn Gadd [Sat, 4 Mar 2023 01:07:20 +0000 (17:07 -0800)]
[wasm] Improve jiterpreter trace entry point selection heuristic (#82604)
This PR adjusts the jiterpreter's heuristic that decides where it's best to put entry points:
* Adds a requirement that entry points be at least a certain distance apart, since in some cases we can end up with trace entry points right next to each other, which isn't very useful and adds overhead. (Backwards branch targets are exempted from this so loops will still JIT properly).
* If we fail to create a trace exactly located at a backwards branch target, continue trying at blocks afterward. This should help in the rare case where the body of a loop begins with an unsupported instruction.
* When considering how long a trace actually is, we treat conditional aborts (like calls and throws) separately from ignored and supported instructions, so they don't count towards the overall size of the trace. These instructions aren't actually doing any useful work and if executed the trace will exit, so it's better not to consider them when deciding whether a trace is worth compiling.
This PR also manually inlines trace entry logic.
Stephen Toub [Sat, 4 Mar 2023 01:06:29 +0000 (20:06 -0500)]
Trim some overheads for "r"/"o" DateTime parsing (#82925)
We were doing some unnecessary work on these fast paths.
I also noticed and cleaned up an unnecessary delegate involved in Hebrew number parsing.
Huo Yaoyuan [Fri, 3 Mar 2023 23:00:07 +0000 (07:00 +0800)]
Implement managed SegmentCommandLine (#82883)
* Implement managed version of SegmentCommandLine
* Remove P/Invoke for CommandLineToArgv
* Update parsing to latest UCRT
* Add test and fix trailing space in command
* Fix test cases
Ankit Jain [Fri, 3 Mar 2023 22:27:59 +0000 (17:27 -0500)]
[wasm] Debugger tests - fix build (#82958)
* [wasm] Debugger tests - fix build
`/workspaces/runtime/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessProxy.cs(135,44): error CS8601: Possible null reference assignment`
Started being hit with https://github.com/dotnet/runtime/pull/82479 .
The other instances of this were fixed in
https://github.com/dotnet/runtime/pull/82803 .
* CI: Trigger all the wasm jobs, when roslyn is updated
And this includes the debugger tests
Andy Ayers [Fri, 3 Mar 2023 21:56:52 +0000 (13:56 -0800)]
JIT: fix fgDfsReversePostorder (#82950)
This method was not doing a proper depth first search, so the reverse postorder
it created was flawed.
Jan Kotas [Fri, 3 Mar 2023 21:49:41 +0000 (13:49 -0800)]
Fix patterns that defeat resource string optimizations in CoreLib (#82947)
Replace the resource string keys with enums
Fixes #82759
Elinor Fung [Fri, 3 Mar 2023 21:28:54 +0000 (13:28 -0800)]
Fix trim warning in ComponentActivator (#82952)
* Fix trim warning in ComponentActivator
* Add UnsupportedOSPlatform attributes
Katelyn Gadd [Fri, 3 Mar 2023 21:14:09 +0000 (13:14 -0800)]
[wasm] Fix min/max in the jiterpreter (#82955)
The math intrinsics table had a typo
Tomas Weinfurt [Fri, 3 Mar 2023 21:00:24 +0000 (13:00 -0800)]
use PlatformSpecific attribute to supress platform specific Quic tests (#82933)
* use PlatformSpecific attribute to supress platform specific Quic tests
* Update src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicPlatformDetectionTests.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
---------
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Tomas Weinfurt [Fri, 3 Mar 2023 20:13:53 +0000 (12:13 -0800)]
add RID for Ubuntu 23.04 (#82284)
* add RID for Ubuntu 23.04
* fix resolve
Pavel Savara [Fri, 3 Mar 2023 19:24:37 +0000 (20:24 +0100)]
[browser] legacy JS interop optional via WasmEnableLegacyJsInterop - native part (#82834)
dotnet-maestro[bot] [Fri, 3 Mar 2023 19:17:23 +0000 (13:17 -0600)]
[main] Update dependencies from dotnet/roslyn (#82479)
* Update dependencies from https://github.com/dotnet/roslyn build
20230221.6
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-2.23120.1 -> To Version 4.6.0-2.23121.6
* Update dependencies from https://github.com/dotnet/roslyn build
20230222.3
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23073.4 -> To Version 4.6.0-2.23122.3
* Update dependencies from https://github.com/dotnet/roslyn build
20230223.15
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23073.4 -> To Version 4.6.0-2.23123.15
* Update dependencies from https://github.com/dotnet/roslyn build
20230225.1
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23073.4 -> To Version 4.6.0-2.23125.1
* Update dependencies from https://github.com/dotnet/roslyn build
20230226.1
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23073.4 -> To Version 4.6.0-2.23126.1
* Update dependencies from https://github.com/dotnet/roslyn build
20230226.2
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23073.4 -> To Version 4.6.0-2.23126.2
* Update dependencies from https://github.com/dotnet/roslyn build
20230228.2
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23073.4 -> To Version 4.6.0-2.23128.2
* Update dependencies from https://github.com/dotnet/roslyn build
20230301.1
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23073.4 -> To Version 4.6.0-2.23151.1
* Update dependencies from https://github.com/dotnet/roslyn build
20230302.1
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23073.4 -> To Version 4.6.0-3.23152.1
* Update dependencies from https://github.com/dotnet/roslyn build
20230303.1
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23073.4 -> To Version 4.6.0-3.23153.1
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>